From 50c462a55f7b392f82c069be48c35099e5cb1b0b Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Wed, 9 Mar 2022 15:29:18 +0100 Subject: [PATCH] More nvim --- nvim/.config/nvim/fnl/dots/keybinds.fnl | 3 +++ nvim/.config/nvim/fnl/dots/plugins.fnl | 14 +++++++---- nvim/.config/nvim/fnl/dots/plugins/lsp.fnl | 10 ++++---- .../.config/nvim/fnl/dots/plugins/ltex-ls.fnl | 23 ++++++++++++------- .../nvim/fnl/dots/plugins/todo-comments.fnl | 11 +++++++++ nvim/.config/nvim/fnl/dots/utils.fnl | 5 ++++ nvim/.config/nvim/fnl/init.fnl | 1 + profile/.profile | 1 + scripts/scripts/screenshot.sh | 4 ++-- 9 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 nvim/.config/nvim/fnl/dots/plugins/todo-comments.fnl diff --git a/nvim/.config/nvim/fnl/dots/keybinds.fnl b/nvim/.config/nvim/fnl/dots/keybinds.fnl index 027771b..cdfba40 100644 --- a/nvim/.config/nvim/fnl/dots/keybinds.fnl +++ b/nvim/.config/nvim/fnl/dots/keybinds.fnl @@ -21,6 +21,9 @@ (utils.keymap :n :MM "lua require('nvim-gehzu').go_to_definition()" {}) (utils.keymap :n :MN "lua require('nvim-gehzu').show_definition()" {}) +(utils.keymap :n :zt "zt") +(utils.keymap :n :zb "zb") + ; Fix keybinds in linewrapped mode ;(utils.keymap [:n] :j "gj") diff --git a/nvim/.config/nvim/fnl/dots/plugins.fnl b/nvim/.config/nvim/fnl/dots/plugins.fnl index 76f732c..acbc114 100644 --- a/nvim/.config/nvim/fnl/dots/plugins.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins.fnl @@ -30,12 +30,13 @@ :config `#(require ,config-mod)))) (use - ; sort me pls + ; TODO sort me pls - ;:vimwiki/vimwiki {:opt false - ;:config #(set vim.g.vimwiki_list [{:path "~/obsidian-stuff/obsidian-vault" - ;:syntax "markdown" - ;:ext "md"}])} + :vimwiki/vimwiki {:opt false + :branch "dev" + :config #(set vim.g.vimwiki_list [{:path "~/notes/veil-vimwiki/" + :syntax "markdown" + :ext "md"}])} ; sorted from here! :Olical/aniseed {:branch "develop"} @@ -45,6 +46,7 @@ :lifepillar/vim-gruvbox8 (cfg "dots.plugins.gruvbox8") :kyazdani42/nvim-web-devicons {} :folke/which-key.nvim {} + :folke/todo-comments.nvim (cfg "dots.plugins.todo-comments") :Famiu/feline.nvim (cfg "dots.plugins.feline") :akinsho/nvim-bufferline.lua (cfg "dots.plugins.bufferline") @@ -183,6 +185,8 @@ :purescript-contrib/purescript-vim {:ft ["purescript"]} :derekelkins/agda-vim {:ft ["agda"]} :neovimhaskell/haskell-vim { :ft ["haskell"]} + :stewy33/mercury-vim {:opt false} + :ionide/Ionide-vim {:opt false} :rust-lang/rust.vim {:ft ["rust"] diff --git a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl index 12c0445..7055a87 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl @@ -62,7 +62,7 @@ ((. lsp lsp-name :setup) merged-opts))) (init-lsp :jsonls {:commands {:Format [ #(vim.lsp.buf.range_formatting [] [0 0] [(vim.fn.line "$") 0])]}}) -(init-lsp :denols {:root_dir (better_root_pattern [".git"] ["package.json"])}) +;(init-lsp :denols {:root_dir (better_root_pattern [".git"] ["package.json"])}) (init-lsp :hls {:settings {:languageServerHaskell {:formattingProvider "stylish-haskell"}}}) (init-lsp :ocamllsp) (init-lsp :vimls) @@ -97,10 +97,10 @@ :less {:validate true} :scss {:validate true}}}) -;(lsp.tsserver.setup {:root_dir (lsp.util.root_pattern "package.json") - ;:on_attach (fn [client bufnr] - ;(set client.resolved_capabilities.document_formatting false) - ;(on_attach client bufnr))}) +(lsp.tsserver.setup {:root_dir (lsp.util.root_pattern "package.json") + :on_attach (fn [client bufnr] + (set client.resolved_capabilities.document_formatting false) + (on_attach client bufnr))}) (let [rust-tools (require "rust-tools") diff --git a/nvim/.config/nvim/fnl/dots/plugins/ltex-ls.fnl b/nvim/.config/nvim/fnl/dots/plugins/ltex-ls.fnl index 98f1af2..644b555 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/ltex-ls.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/ltex-ls.fnl @@ -8,9 +8,13 @@ cmp_nvim_lsp cmp_nvim_lsp}}) +(defn cmds [xs] + (icollect [_ x (ipairs xs)] + (.. "\\" x "{}"))) + (def latex-command-settings - {:dummy ["\\texttt{}" "\\scripture{}" "\\todo{}" "\\lstref{}" "\\personaltextcite{}" "\\personalparencite{}"] - :ignore ["\\urlfootnote{}"]}) + {:dummy (cmds ["texttt" "scripture""lstref" "figref" "tblref" "secref" "personaltextcite" "personalparencite" "game" "acsu" "enquote" "name" "item"]) + :ignore (cmds ["urlfootnote" "caption" "todo"])}) @@ -93,7 +97,7 @@ (lua "return (table.unpack or _G.unpack)(___antifnl_rtns_1___)"))) (if (= filetype :dictionary) (update-config lang :dictionary) (= filetype :disable) (update-config lang :disable) - (= filetype :falsePositive) (update-config lang :disable))) + (= filetype :falsePositive) (update-config lang :falsePositive))) (fn add-to [filetype lang file value] (let [dict (read-files file)] @@ -106,19 +110,19 @@ (defn init [] (set configs.ltex {:default_config {:cmd [:ltex-ls] - :filetypes [:tex :bib :md] + :filetypes [:tex :latex :bib] :root_dir (fn [filename] (lsputil.path.dirname filename))}}) - (lsp.ltex.setup {:settings {:ltex {:enabled [:latex :tex :bib :md] + (lsp.ltex.setup {:settings {:ltex {:enabled [:latex :tex :bib] :language "de-DE" :checkFrequency "save" :diagnosticSeverity "information" :setenceCacheSize 5000 :additionalRules {:enablePickyRules true :motherTongue "de-DE"} - :dictionary {:de-DE (read-files (. Dictionary-file :de-DE))} - :disabledRules {:de-DE (read-files (. Disabled-rules-file :de-DE))} - :hiddenFalsePositives {:de-DE (read-files (. False-positives-file :de-DE))} + :dictionary (utils.map-values read-files Dictionary-file) + :disabledRules (utils.map-values read-files Disabled-rules-file) + :hiddenFalsePositives (utils.map-values read-files False-positives-file) :latex {:commands latex-command-settings-formatted}}}}) (set lsp.ltex.dictionary_file Dictionary-file) @@ -147,3 +151,6 @@ (local filetype :falsePositive) (add-to filetype lang (find-ltex-files filetype lang) rule)))) (orig-execute-command command))))) + + + diff --git a/nvim/.config/nvim/fnl/dots/plugins/todo-comments.fnl b/nvim/.config/nvim/fnl/dots/plugins/todo-comments.fnl new file mode 100644 index 0000000..b8fceba --- /dev/null +++ b/nvim/.config/nvim/fnl/dots/plugins/todo-comments.fnl @@ -0,0 +1,11 @@ +(module dots.plugins.todo-comments + {autoload {a aniseed.core + todo-comments todo-comments}}) + +(todo-comments.setup + {:keywords {:TODO {:icon " "} + :WARN {:icon " " :alt [:WARNING :XXX :!!!]} + :NOTE {:icon " " :alt [:INFO]} + :FIX {:icon " " :alt [:FIXME :BUG :FIXIT :ISSUE :PHIX]} + :PERF {:icon " " :alt [:OPTIM :PERFORMANCE :OPTIMIZE]} + :HACK {:icon " "}}}) diff --git a/nvim/.config/nvim/fnl/dots/utils.fnl b/nvim/.config/nvim/fnl/dots/utils.fnl index f1e9eff..83dca1c 100644 --- a/nvim/.config/nvim/fnl/dots/utils.fnl +++ b/nvim/.config/nvim/fnl/dots/utils.fnl @@ -47,6 +47,11 @@ (defn keep-if [f x] (when (f x) x)) +(defn map-values [f t] + "Map over the values of a table, keeping the keys intact" + (collect [k v (pairs t)] + k (f v))) + (defn without-keys [keys t] (filter-table #(not (contains? keys $1)) t)) diff --git a/nvim/.config/nvim/fnl/init.fnl b/nvim/.config/nvim/fnl/init.fnl index a2455e7..6819cac 100644 --- a/nvim/.config/nvim/fnl/init.fnl +++ b/nvim/.config/nvim/fnl/init.fnl @@ -34,6 +34,7 @@ (vim.cmd "syntax on") (set vim.opt.foldmethod "marker") +(set vim.opt.scrolloff 5) (set vim.opt.showmode false) (set vim.opt.undodir (.. vim.env.HOME "/.vim/undo-dir")) (set vim.opt.undofile true) diff --git a/profile/.profile b/profile/.profile index 275a050..c608a0b 100644 --- a/profile/.profile +++ b/profile/.profile @@ -14,6 +14,7 @@ export PATH="$HOME/.nix-profile/bin/:$PATH" export PATH="$HOME/.cpm/bin:$PATH" export PATH="$HOME/.local/bin:$PATH" export PATH="$HOME/.nimble/bin:$PATH" +export PATH="$HOME/.dotnet/tools:$PATH" export EDITOR="$(which nvim)" diff --git a/scripts/scripts/screenshot.sh b/scripts/scripts/screenshot.sh index 488a94a..6208eb6 100755 --- a/scripts/scripts/screenshot.sh +++ b/scripts/scripts/screenshot.sh @@ -18,11 +18,11 @@ if [ $to_file -eq 1 ]; then file="$HOME/Bilder/screenshots/screenshot_$(date +%s).png" echo "$file" [ -z "$select_flag" ] && sleep 1 - maim $select_flag --format png "$file" + maim -u $select_flag --format png "$file" echo "$file" | xclip -selection clipboard else [ -z "$select_flag" ] && sleep 1 - maim $select_flag --format png /dev/stdout | xclip -selection clipboard -t image/png -i + maim -u $select_flag --format png /dev/stdout | xclip -selection clipboard -t image/png -i fi