commit 106d5cc6698b88d3091c345aebf72917fe2fb1dc parent 4efc5a8c4ec0416da8a6b08689589afbd7ea19a6 Author: mtmn <miro@haravara.org> Date: Fri, 22 May 2026 01:47:53 +0200 chore: fix nvim Diffstat:
16 files changed, 5 insertions(+), 223 deletions(-)
diff --git a/hosts/work/overlays/config/nvim/fnl/config/blink.fnl b/hosts/work/overlays/config/nvim/fnl/config/blink.fnl Binary files differ. diff --git a/hosts/work/overlays/config/nvim/fnl/config/lsp.fnl b/hosts/work/overlays/config/nvim/fnl/config/lsp.fnl Binary files differ. diff --git a/hosts/work/overlays/config/nvim/fnl/config/treesitter.fnl b/hosts/work/overlays/config/nvim/fnl/config/treesitter.fnl Binary files differ. diff --git a/hosts/work/overlays/config/nvim/fnl/flsproject.fnl b/hosts/work/overlays/config/nvim/fnl/flsproject.fnl Binary files differ. diff --git a/hosts/work/overlays/config/nvim/fnl/functions.fnl b/hosts/work/overlays/config/nvim/fnl/functions.fnl Binary files differ. diff --git a/hosts/work/overlays/config/nvim/fnl/init.fnl b/hosts/work/overlays/config/nvim/fnl/init.fnl Binary files differ. diff --git a/hosts/work/overlays/config/nvim/fnl/keymaps.fnl b/hosts/work/overlays/config/nvim/fnl/keymaps.fnl Binary files differ. diff --git a/hosts/work/overlays/config/shell/overrides b/hosts/work/overlays/config/shell/overrides Binary files differ. diff --git a/modules/mixins/dotfiles/config/nota b/modules/mixins/dotfiles/config/nota @@ -1,3 +1,3 @@ GPG=0 MARKDOWN=1 -EDITOR=emacsclient -t +EDITOR=nvim diff --git a/modules/mixins/dotfiles/config/nvim/fnl/aliases.fnl b/modules/mixins/dotfiles/config/nvim/fnl/aliases.fnl @@ -1,7 +0,0 @@ -(vim.cmd "cnoreabbrev nt botright vert new - cnoreabbrev sft %!sft - cnoreabbrev ptn %!ptn - cnoreabbrev mpc %!mpc clear - cnoreabbrev mpl %!mpc play") - -(local home (os.getenv :HOME)) diff --git a/modules/mixins/dotfiles/config/nvim/fnl/config/blink.fnl b/modules/mixins/dotfiles/config/nvim/fnl/config/blink.fnl @@ -1,20 +0,0 @@ -(fn config [] - (let [blink (require :blink.cmp)] - (blink.setup {:snippets {:preset :luasnip} - :appearance {:nerd_font_variant :none} - :keymap {:preset :none - :<C-p> [:select_prev :fallback] - :<C-n> [:select_next :fallback] - :<C-b> [:scroll_documentation_up :fallback] - :<C-f> [:scroll_documentation_down :fallback] - :<C-Space> [:show - :show_documentation - :hide_documentation] - :<C-e> [:hide :fallback] - :<CR> [:accept :fallback]} - :completion {:menu {:winhighlight "Normal:CmpNormal"} - :documentation {:auto_show true - :window {:winhighlight "Normal:CmpNormal"}}} - :sources {:default [:lsp :snippets :path :buffer]}}))) - -{: config} diff --git a/modules/mixins/dotfiles/config/nvim/fnl/config/lsp.fnl b/modules/mixins/dotfiles/config/nvim/fnl/config/lsp.fnl @@ -1,51 +0,0 @@ -(local {:nvim_create_augroup create-augroup - :nvim_create_autocmd create-autocmd - :nvim_clear_autocmds clear-autocmds - :nvim_get_current_buf get-current-buf} vim.api) - -(create-augroup :local-lsp-auto-format {:clear true}) - -(fn is-array [tbl] - (not (not (. tbl 1)))) - -(fn map-vals [func tbl] - (icollect [_ v (ipairs tbl)] (func v))) - -(fn create-auto-format-autocmd [extra-opts] - (let [extra-opts (or extra-opts {}) - all-extra-opts (if (is-array extra-opts) - extra-opts - [extra-opts]) - all-opts (map-vals #(vim.tbl_extend :force - {:formatting_options {:timeout_ms 5000}} - $1) - all-extra-opts) - auto-format-callback #(each [_ opts (ipairs all-opts)] - (vim.lsp.buf.format opts))] - (clear-autocmds {:event :BufWritePre - :buffer (get-current-buf) - :group :local-lsp-auto-format}) - (create-autocmd :BufWritePre - {:buffer (get-current-buf) - :callback auto-format-callback - :group :local-lsp-auto-format}) - nil)) - -(fn auto-format-on-save [filetypes extra-opts] - (let [callback #(create-auto-format-autocmd extra-opts)] - (each [_ filetype (ipairs filetypes)] - (create-autocmd :FileType {:pattern filetype : callback})))) - -(fn config [] - (vim.lsp.config :purescriptls - {:cmd [:npx :purescript-language-server :--stdio]}) - (let [open-floating-preview vim.lsp.util.open_floating_preview] - (set vim.lsp.util.open_floating_preview - (fn [contents syntax opts ...] - (let [opts (or opts {})] - (set opts.border (or opts.border :rounded)) - (open-floating-preview contents syntax opts ...)))))) - -(vim.diagnostic.config {:virtual_text true}) - -{: auto-format-on-save : config} diff --git a/modules/mixins/dotfiles/config/nvim/fnl/config/treesitter.fnl b/modules/mixins/dotfiles/config/nvim/fnl/config/treesitter.fnl @@ -1,13 +0,0 @@ -(local {:nvim_create_autocmd autocmd} vim.api) - -(fn config [] - (autocmd :FileType - {:callback (fn [] - (let [lang (vim.treesitter.language.get_lang vim.bo.filetype) - (ok) (pcall vim.treesitter.start 0 lang)] - (when (and lang ok) - (set vim.wo.foldmethod :expr) - (set vim.wo.foldexpr - "v:lua.vim.treesitter.foldexpr()"))))})) - -{: config} diff --git a/modules/mixins/dotfiles/config/nvim/fnl/functions.fnl b/modules/mixins/dotfiles/config/nvim/fnl/functions.fnl @@ -1,52 +0,0 @@ -(vim.api.nvim_create_autocmd [:BufRead :BufNewFile] - {:pattern [:*.m3u :*.m3u8] - :callback (fn [] - (set vim.bo.filetype :text) - (set vim.bo.syntax :text))}) - -(let [group (vim.api.nvim_create_augroup :MagdalenaLogFile {:clear true})] - (vim.api.nvim_create_autocmd [:BufReadPost :BufNewFile] - {: group - :callback (fn [ev] - (let [filename (vim.api.nvim_buf_get_name ev.buf)] - (when (and filename - (not= filename "") - (not (filename:match "^oil://"))) - (let [_job (vim.fn.jobstart [:magdalena - :log-file - filename] - {:detach true - :on_stderr (fn [_ - _]) - :on_exit (fn [_ - _])})] - nil))))})) - -(vim.api.nvim_create_autocmd :BufWritePre - {:callback (fn [ev] - (vim.lsp.buf.code_action {:apply true - :context {:only [:source.fixAll]}})) - :pattern [:*.zig :*.zon]}) - -(vim.api.nvim_create_autocmd :FileType - {:pattern :markdown - :callback (fn [] - (set vim.opt_local.suffixesadd :.md) - (set vim.opt_local.includeexpr - "v:lua.follow_md_link()") - (global follow_md_link - #(: vim.v.fname :gsub - "%[%[(.-)%]%]" "%1")) - (vim.keymap.set :n :gf - (fn [] - (let [line (vim.api.nvim_get_current_line) - col (. (vim.api.nvim_win_get_cursor 0) - 2) - link (line:match "%[([%w_%-][%w_%-]+)%]" - col)] - (if link - (vim.cmd (.. "edit " - link - :.md)) - (vim.cmd "normal! gf")))) - {:buffer true}))}) diff --git a/modules/mixins/dotfiles/config/nvim/fnl/init.fnl b/modules/mixins/dotfiles/config/nvim/fnl/init.fnl @@ -9,30 +9,13 @@ ;; fnlfmt: skip (fn setup-plugins [] - ;; Require config modules before pack.add alters runtimepath - (local blink (require :config.blink)) - (local lsp (require :config.lsp)) - (local treesitter (require :config.treesitter)) - - (vim.api.nvim_create_autocmd :PackChanged - {:callback (fn [ev] - (let [{:spec {:name name} :kind kind :path path} ev.data] - (when (and (= name :blink.cmp) - (or (= kind :install) (= kind :update))) - (vim.system [:cargo :build :--release] {:cwd path}))))}) - (vim.pack.add - [(gh :nvim-lua/plenary.nvim) - (gh :L3MON4D3/LuaSnip) - (gh :aymenhafeez/doric-themes.nvim) + [(gh :aymenhafeez/doric-themes.nvim) (gh :windwp/nvim-autopairs) (gh :ibhagwan/fzf-lua) - (gh :smoka7/hop.nvim) (gh :stevearc/oil.nvim) (gh :neogitorg/neogit) (gh :sindrets/diffview.nvim) - {:src (gh :saghen/blink.cmp) :version (vim.version.range "^1")} - {:src (gh :neovim/nvim-lspconfig) :version :master} (gh :tpope/vim-commentary) (gh :tpope/vim-repeat) (gh :tpope/vim-surround) @@ -46,7 +29,6 @@ ((. (require :nvim-autopairs) :setup)) ((. (require :fzf-lua) :setup)) - ((. (require :hop) :setup) {:keys :etovxqpdygfblzhckisuran}) ((. (require :oil) :setup) {:default_file_explorer false}) ((. (require :neogit) :setup)) ((. (require :diffview) :setup) @@ -55,10 +37,7 @@ :git_cmd [:git] :use_icons false :show_help_hints false - :watch_index true}) - (: blink :config) - (: lsp :config) - (treesitter.config)) + :watch_index true})) (fn init [] (let [vimrc (.. (vim.fn.stdpath :config) :/init_.vim) @@ -73,12 +52,10 @@ (set vim.opt.undodir (.. vim-dir :undo//)) (set vim.opt.undofile true)) (set vim.opt.clipboard :unnamedplus) - (vim.opt.rtp:append (.. (vim.fn.stdpath :data) :/site/tree-sitter)) - (vim.opt.rtp:append (.. (vim.fn.stdpath :data) :/site/tree-sitter-custom)) (set package.path (.. (fs.normalize "~") "/.config/nvim/lua/?.lua;" package.path)) (setup-plugins) - (each [_ module (ipairs [:aliases :keymaps :functions])] + (each [_ module (ipairs [:keymaps])] (require module))) (init) diff --git a/modules/mixins/dotfiles/config/nvim/fnl/keymaps.fnl b/modules/mixins/dotfiles/config/nvim/fnl/keymaps.fnl @@ -9,56 +9,4 @@ (each [key func (pairs fzf-keymaps)] (vim.keymap.set :n key (.. "<cmd>lua require('fzf-lua')." func "()<CR>"))) -(local single-keymaps {:<leader>g :<cmd>Neogit<CR> - :- :<cmd>Oil<CR> - :f :<cmd>HopWord<CR> - :mn :<cmd>Mnav<CR>}) - -(each [key cmd (pairs single-keymaps)] - (vim.keymap.set :n key cmd)) - -(local lsp-keymaps {:<leader>gg :hover - :<leader>gd :definition - :<leader>gD :declaration - :<leader>gi :implementation - :<leader>gt :type_definition - :<leader>gr :references - :<leader>gs :signature_help - :<leader>rr :rename - :<leader>ga :code_action - :<leader>tr :document_symbol}) - -(each [key func (pairs lsp-keymaps)] - (vim.keymap.set :n key (.. "<cmd>lua vim.lsp.buf." func "()<CR>"))) - -(vim.keymap.set :n :<leader>ta - (fn [] - (let [row (. (vim.api.nvim_win_get_cursor 0) 1)] - (vim.api.nvim_buf_set_lines 0 row row false ["- [ ] "]) - (vim.api.nvim_win_set_cursor 0 [(+ row 1) 5])))) - -(vim.keymap.set :n :<leader>tt - (fn [] - (let [line (vim.api.nvim_get_current_line)] - (var new-line nil) - (if (line:match "%[ %]") - (set new-line (line:gsub "%[ %]" "[-]" 1)) - (line:match "%[%-%]") - (set new-line (line:gsub "%[%-%]" "[x]" 1)) - (line:match "%[x%]") - (set new-line (line:gsub "%[x%]" "[ ]" 1))) - (when new-line (vim.api.nvim_set_current_line new-line))))) - -(local diagnostic-keymaps {:<leader>gl :open_float - :<leader>gp :goto_prev - :<leader>gn :goto_next}) - -(each [key func (pairs diagnostic-keymaps)] - (vim.keymap.set :n key (.. "<cmd>lua vim.diagnostic." func "()<CR>"))) - -(vim.keymap.set :v :<leader>gf - "<cmd>lua vim.lsp.buf.format({async = true})<CR>") - -(vim.keymap.set :i :<C-Space> "<cmd>lua vim.lsp.buf.completion()<CR>") - -(vim.keymap.set :n :x "\"_x") +(local single-keymaps {:<leader>g :<cmd>Neogit<CR> :- :<cmd>Oil<CR>})