Compare commits
11 commits
ac2b15e673
...
a8dfb8fd79
| Author | SHA1 | Date | |
|---|---|---|---|
| a8dfb8fd79 | |||
| e243672164 | |||
| e7a94003ac | |||
| 770ca92c2b | |||
| 1e6c7f40ef | |||
| 6022083000 | |||
| c482f7a612 | |||
| d7a955f103 | |||
| de1aefac38 | |||
| 0c2e66214e | |||
| b68ba5eb5e |
8 changed files with 144 additions and 14 deletions
21
modules/fira-code.lua
Normal file
21
modules/fira-code.lua
Normal 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)
|
||||
|
|
@ -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."
|
||||
(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 "Ubuntu")
|
||||
|
||||
|
|
@ -157,6 +157,10 @@ just in in the current buffer."
|
|||
|
||||
(setq org-directory "~/Org"
|
||||
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-agenda-window-setup 'current-window
|
||||
org-export-with-broken-links "mark"
|
||||
|
|
@ -165,6 +169,11 @@ just in in the current buffer."
|
|||
org-export-with-toc nil
|
||||
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
|
||||
'(("d" "Dashboard"
|
||||
((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")
|
||||
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
|
||||
|
||||
(use-package company
|
||||
|
|
@ -329,10 +345,46 @@ just in in the current buffer."
|
|||
:query "query:inbox"
|
||||
:sort-order oldest-first)))
|
||||
|
||||
(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)
|
||||
"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)
|
||||
"b" 'aa/notmuch-open-github-link)
|
||||
|
||||
(evil-define-key 'normal notmuch-show-mode-map
|
||||
"b" 'aa/notmuch-open-github-link)
|
||||
|
||||
(defun aa/notmuch-search-inbox ()
|
||||
"Helper function to search for the inbox messages (oldest message first).
|
||||
|
|
@ -434,7 +486,7 @@ just in in the current buffer."
|
|||
|
||||
(aa/leader-keys
|
||||
;; 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")
|
||||
"SPC" '(counsel-M-x :which-key "M-x")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
use path.nu
|
||||
use path.nu *
|
||||
|
||||
use fzf.nu *
|
||||
use neovim.nu *
|
||||
use prompt.nu *
|
||||
use sapling.nu *
|
||||
use nvm.nu *
|
||||
use rvm.nu *
|
||||
|
||||
nvm use default
|
||||
|
||||
|
|
@ -14,6 +15,8 @@ $env.config = {
|
|||
env_change: {
|
||||
PWD: [
|
||||
{|_, after| nvm dir-hook $after }
|
||||
{|_, after| rvm-dir-hook $after }
|
||||
{|_, after| node-modules-dir-hook $after }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,20 @@
|
|||
|
||||
export-env {
|
||||
$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 ":"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
41
site-modules/core/files/nushell/scripts/rvm.nu
Normal file
41
site-modules/core/files/nushell/scripts/rvm.nu
Normal 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) ""
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
" I don't accidentally start formatting when rebasing (bad memories).
|
||||
|
||||
function s:format_on_save()
|
||||
if &filetype == 'fsharp'
|
||||
if &filetype == 'fsharp' || &filetype == 'cs'
|
||||
return execute('lua vim.lsp.buf.format()')
|
||||
endif
|
||||
|
||||
|
|
|
|||
|
|
@ -51,9 +51,6 @@ table.insert(lint.linters.cspell.args, "--")
|
|||
table.insert(lint.linters.cspell.args, "stdin")
|
||||
|
||||
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 = {}
|
||||
|
||||
if vim.fn.executable "phpcs" == 1 then
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ return {
|
|||
-- Use a sexy terminal font with 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
|
||||
-- font = wezterm.font {
|
||||
-- family = "FiraCode Nerd Font Mono",
|
||||
-- },
|
||||
font = wezterm.font {
|
||||
family = "FiraCode Nerd Font Mono",
|
||||
},
|
||||
|
||||
-- -- The nord theme to fit with everyting else
|
||||
color_scheme = "Poimandres",
|
||||
|
|
|
|||
Loading…
Reference in a new issue