Compare commits

...

11 commits

Author SHA1 Message Date
a8dfb8fd79 chore(emacs): remove filenames from the org agenda
I don't really care where the todos come from. I only care about the todo
itself and I need to get it done.
2025-01-21 09:39:20 +00:00
e243672164 chore(emacs): install languagetool for spelling and grammar checking 2025-01-21 09:37:47 +00:00
e7a94003ac feat(emacs): add / key binding to search the roam notes
Usually this mapping would be to live grep in the current project. With emacs I
only have one project and thats my notes. The sole purpose of emacs for me is
to organize my self with org

Now this binding search for content in the org notes directory treating that as
the project.
2025-01-21 09:36:28 +00:00
770ca92c2b feat(emacs): add key binding to open the current pull request in an email
By pushing one key you can now open a PR in your browser. This will work from
your list view or the show view. This makes the email workflow in emacs much
faster.
2025-01-21 09:32:44 +00:00
1e6c7f40ef chore(emacs): use FiraCode font to make everything consistent 2025-01-21 09:30:12 +00:00
6022083000 chore(vim): format csharp files with the lsp
This will be using `dotnet format` under the hood and take any settings from
the editorconfig. The advantage of this is it will only do the file, with
`dotnet format` you need todo the hole solution.
2025-01-21 08:24:34 +00:00
c482f7a612 chore(nu): automatically set the node_modules bin dir on cd
When we are moving around the file system I always want to be able to use the
locally installed executables from my node modules.

Sometimes versions of programs like prettier have different outcomes. I always
want to be using the local version rather than the system installed version.
2025-01-21 08:22:40 +00:00
d7a955f103 chore(vim): remove eslint flags unstable_ts_config
This is no longer needed, in the eslint version we are using at work this is
now stable.
2025-01-21 08:19:18 +00:00
de1aefac38 chore(shell): add module load the rvm env into nushell
This is a real hack but, it works. Because nushell is not posix rvm will not
natively work. This uses a login sub shell to change the ruby version with
bash, it then get the all the relevant environment variables and loads them
into the nushell environment.
2025-01-11 07:23:58 +00:00
0c2e66214e chore(configz): create module to install fonts 2025-01-10 20:28:37 +00:00
b68ba5eb5e chore(term): use the FiraCode font 2025-01-10 20:28:00 +00:00
8 changed files with 144 additions and 14 deletions

21
modules/fira-code.lua Normal file
View file

@ -0,0 +1,21 @@
local v_cache = require "lib.v-cache"
local git_sha = "adc02c2976a3d90263b2c7ea7b10ed88ccdd06b7";
if v_cache.is_installed("fira-code", git_sha) then
return
end
local weights = { "Light", "Regular", "Medium", "SemiBold", "Bold", "Retina" }
for _, value in ipairs(weights) do
configz.download(os.getenv("HOME") .. "/.local/share/fonts/FiraCodeNerdFont-" .. value .. ".ttf", {
url = "https://github.com/ryanoasis/nerd-fonts/raw/" .. git_sha .. "/patched-fonts/FiraCode/" .. value .. "/FiraCodeNerdFont-" .. value .. ".ttf"
})
configz.download(os.getenv("HOME") .. "/.local/share/fonts/FiraCodeNerdFontMono-" .. value .. ".ttf", {
url = "https://github.com/ryanoasis/nerd-fonts/raw/" .. git_sha .. "/patched-fonts/FiraCode/" .. value .. "/FiraCodeNerdFontMono-" .. value .. ".ttf"
})
end
v_cache.install("fira-code", git_sha)

View file

@ -33,7 +33,7 @@ This is better than the `C-x +` and C-x - because this is global to emacs not
just in in the current buffer." just in in the current buffer."
(interactive "nFont Size: ") (interactive "nFont Size: ")
(setq aa-font "DejaVu Sans Mono") (setq aa-font "FiraCode Nerd Font Mono")
(setq aa-v-font "Sans Serif") (setq aa-v-font "Sans Serif")
;; (setq aa-v-font "Ubuntu") ;; (setq aa-v-font "Ubuntu")
@ -157,6 +157,10 @@ just in in the current buffer."
(setq org-directory "~/Org" (setq org-directory "~/Org"
org-todo-keywords '((sequence "TODO" "WAITING" "REVIEW" "|" "DONE" "ARCHIVED")) org-todo-keywords '((sequence "TODO" "WAITING" "REVIEW" "|" "DONE" "ARCHIVED"))
org-agenda-prefix-format '((agenda . " %?-12t% s")
(todo . " ")
(tags . " %i %-12:c")
(search . " %i %-12:c"))
org-hide-emphasis-markers t org-hide-emphasis-markers t
org-agenda-window-setup 'current-window org-agenda-window-setup 'current-window
org-export-with-broken-links "mark" org-export-with-broken-links "mark"
@ -165,6 +169,11 @@ just in in the current buffer."
org-export-with-toc nil org-export-with-toc nil
org-html-head "<style>body { font-family: system-ui; }</style>") org-html-head "<style>body { font-family: system-ui; }</style>")
(defun aa/search-org-roam-notes ()
"Search in the Org-Roam folder using counsel-rg."
(interactive)
(counsel-rg nil org-roam-directory nil "Search Org Roam: "))
(setq org-agenda-custom-commands (setq org-agenda-custom-commands
'(("d" "Dashboard" '(("d" "Dashboard"
((agenda "" ((org-deadline-warning-days 7))) ((agenda "" ((org-deadline-warning-days 7)))
@ -234,6 +243,13 @@ just in in the current buffer."
(setq-default org-download-image-dir (concat (file-name-as-directory org-directory) "Attachments") (setq-default org-download-image-dir (concat (file-name-as-directory org-directory) "Attachments")
org-download-heading-lvl nil)) org-download-heading-lvl nil))
(use-package languagetool
:straight t
:config
(setq languagetool-correction-language "en-GB"
languagetool-server-url "https://api.languagetool.org"
languagetool-server-port 443))
;;; Completion ;;; Completion
(use-package company (use-package company
@ -329,10 +345,46 @@ just in in the current buffer."
:query "query:inbox" :query "query:inbox"
:sort-order oldest-first))) :sort-order oldest-first)))
(evil-define-key 'normal notmuch-search-mode-map (defun aa/notmuch-open-github-link ()
"Open the first GitHub Pull Request or Issue link in the current notmuch message or thread.
Works in both `notmuch-show-mode` and `notmuch-search-mode`."
(interactive)
(let (url (original-buffer (current-buffer)))
(cond
;; Handle notmuch-show-mode (email message view)
((eq major-mode 'notmuch-show-mode)
(save-excursion
(goto-char (point-min))
(if (re-search-forward "https://github\\.com/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/\\(pull\\|issues\\)/[0-9]+" nil t)
(setq url (match-string 0))
(message "No GitHub link found in the current message."))))
;; Handle notmuch-search-mode (search list view)
((eq major-mode 'notmuch-search-mode)
(let ((message-id (notmuch-search-find-thread-id)))
(when message-id
(save-window-excursion
(with-temp-buffer
(notmuch-show message-id nil nil)
(goto-char (point-min))
(if (re-search-forward "https://github\\.com/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/\\(pull\\|issues\\)/[0-9]+" nil t)
(setq url (match-string 0))
(message "No GitHub link found in the thread."))))))))
;; Open the URL in the browser
(if url
(browse-url url)
(message "No GitHub link found."))))
(evil-define-key 'normal notmuch-search-mode-map
"d" 'aa/notmuch-search-delete
"b" 'aa/notmuch-open-github-link)
(evil-define-key 'visual notmuch-search-mode-map
"d" 'aa/notmuch-search-delete) "d" 'aa/notmuch-search-delete)
(evil-define-key 'visual notmuch-search-mode-map "b" 'aa/notmuch-open-github-link)
"d" 'aa/notmuch-search-delete))
(evil-define-key 'normal notmuch-show-mode-map
"b" 'aa/notmuch-open-github-link)
(defun aa/notmuch-search-inbox () (defun aa/notmuch-search-inbox ()
"Helper function to search for the inbox messages (oldest message first). "Helper function to search for the inbox messages (oldest message first).
@ -434,7 +486,7 @@ just in in the current buffer."
(aa/leader-keys (aa/leader-keys
;; Global bindings ;; Global bindings
"/" '(counsel-projectile-ag :which-key "Search Project") "/" '(aa/search-org-roam-notes :which-key "Search Org Roam")
"TAB" '(evil-switch-to-windows-last-buffer :which-key "Last Buffer") "TAB" '(evil-switch-to-windows-last-buffer :which-key "Last Buffer")
"SPC" '(counsel-M-x :which-key "M-x") "SPC" '(counsel-M-x :which-key "M-x")

View file

@ -1,10 +1,11 @@
use path.nu use path.nu *
use fzf.nu * use fzf.nu *
use neovim.nu * use neovim.nu *
use prompt.nu * use prompt.nu *
use sapling.nu * use sapling.nu *
use nvm.nu * use nvm.nu *
use rvm.nu *
nvm use default nvm use default
@ -14,6 +15,8 @@ $env.config = {
env_change: { env_change: {
PWD: [ PWD: [
{|_, after| nvm dir-hook $after } {|_, after| nvm dir-hook $after }
{|_, after| rvm-dir-hook $after }
{|_, after| node-modules-dir-hook $after }
] ]
} }
} }

View file

@ -1,4 +1,20 @@
export-env { export-env {
$env.GOPATH = $"($env.HOME)/Code" $env.GOPATH = $"($env.HOME)/Code"
$env.PATH = $env.PATH
| split row ":"
| prepend ([$env.HOME ".cargo" "bin"] | path join)
| str join ":"
} }
export def --env node-modules-dir-hook [dir: string] {
let nodePath = ([$dir, "node_modules", ".bin"] | path join)
if ($nodePath | path exists) {
$env.PATH = $env.PATH
| split row ":"
| where {|x| not ($x | str contains "node_modules")}
| prepend $nodePath
| str join ":"
}
}

View file

@ -0,0 +1,41 @@
# Plugin to manage ruby versions with rvm by reading the `.ruby-version` and
# `.ruby-gemset` files to install and setup your ruby version and the gemset.
#
# Like the custom nvmrc one this will only do something if you have the
# `.ruby-version` file in the current directory to try and reduce the amount of
# work that gets done on `cd`
def file-exists [file: string] {
($file | path exists) and ($file | path type) == "file"
}
export def --env rvm-use [version: string, gemset?: string] {
let env_map = if ($gemset | is-empty) {
(bash --login -c $"rvm use ($version); env" | lines | split column "=" | group-by column1)
} else {
(bash --login -c $"rvm use ($version); rvm gemset use --create ($gemset); env" | lines | split column "=" | group-by column1)
}
let old_env = $env.PATH | split row ":" | filter { not ($in | str contains "rvm") }
let new_env = $env_map.PATH.column2 | split row ":" | filter { $in | str contains "rvm" }
load-env {
RUBY_VERSION: ($env_map.RUBY_VERSION.column2 | first | str trim),
GEM_HOME: ($env_map.GEM_HOME.column2 | first | str trim),
GEM_PATH: ($env_map.GEM_PATH.column2 | first | str trim),
IRBRC: ($env_map.IRBRC.column2 | first | str trim),
MY_RUBY_HOME: ($env_map.MY_RUBY_HOME.column2 | first | str trim),
rvm_path: ($env_map.rvm_path.column2 | first | str trim),
PATH: ($old_env | prepend $new_env | uniq | str join ":"),
}
}
export def --env rvm-dir-hook [dir: string] {
let ruby_version_file = $"($dir)/.ruby-version"
let ruby_gemset_file = $"($dir)/.ruby-gemset"
if (file-exists $ruby_gemset_file) {
rvm-use (open $ruby_version_file | lines | get 0) (open $ruby_gemset_file | lines | get 0)
} else if (file-exists $ruby_version_file) {
rvm-use (open $ruby_version_file | lines | get 0) ""
}
}

View file

@ -3,7 +3,7 @@
" I don't accidentally start formatting when rebasing (bad memories). " I don't accidentally start formatting when rebasing (bad memories).
function s:format_on_save() function s:format_on_save()
if &filetype == 'fsharp' if &filetype == 'fsharp' || &filetype == 'cs'
return execute('lua vim.lsp.buf.format()') return execute('lua vim.lsp.buf.format()')
endif endif

View file

@ -51,9 +51,6 @@ table.insert(lint.linters.cspell.args, "--")
table.insert(lint.linters.cspell.args, "stdin") table.insert(lint.linters.cspell.args, "stdin")
lint.linters.eslint = eslint_linter lint.linters.eslint = eslint_linter
table.insert(lint.linters.eslint.args, 1, "--flag")
table.insert(lint.linters.eslint.args, 2, "unstable_ts_config")
lint.linters_by_ft = {} lint.linters_by_ft = {}
if vim.fn.executable "phpcs" == 1 then if vim.fn.executable "phpcs" == 1 then

View file

@ -25,9 +25,9 @@ return {
-- Use a sexy terminal font with ligatures. -- Use a sexy terminal font with ligatures.
-- You will need to install the beta version of the font to get the ligatures -- You will need to install the beta version of the font to get the ligatures
-- https://github.com/intel/intel-one-mono/issues/9#issuecomment-1994958719 -- https://github.com/intel/intel-one-mono/issues/9#issuecomment-1994958719
-- font = wezterm.font { font = wezterm.font {
-- family = "FiraCode Nerd Font Mono", family = "FiraCode Nerd Font Mono",
-- }, },
-- -- The nord theme to fit with everyting else -- -- The nord theme to fit with everyting else
color_scheme = "Poimandres", color_scheme = "Poimandres",