diff --git a/flake.lock b/flake.lock index 9e46a4a..b7dfe37 100644 --- a/flake.lock +++ b/flake.lock @@ -497,11 +497,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1735140310, - "narHash": "sha256-NuhGCcev/etYS4qAsh905St1Co0tK8FjgGDovUeCVjo=", + "lastModified": 1735226532, + "narHash": "sha256-4UYXERaJPiiy+JxjKo+IWuHN7kgwmlYdV5x8Ew+YNGQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bb881a68c1174d38ee466a35f5e23d03a938b186", + "rev": "03539677da5a6caba6a6b3d2143ec63b116902d3", "type": "github" }, "original": { diff --git a/home/config/nvim/nifoc/keymap.fnl b/home/config/nvim/nifoc/keymap.fnl index 64f7df9..99eb173 100644 --- a/home/config/nvim/nifoc/keymap.fnl +++ b/home/config/nvim/nifoc/keymap.fnl @@ -1,7 +1,7 @@ (let [mod {} keymap vim.keymap - substitute (require :substitute) - fzf (require :fzf-lua) + (ok-substitute substitute) (pcall require :substitute) + (ok-fzf fzf) (pcall require :fzf-lua) fzf-layout-bottom {:winopts_fn #(let [height (math.floor (* vim.o.lines 0.4))] {:split (.. "belowright new | resize " @@ -9,45 +9,51 @@ fzf-layout-dropdown {:winopts {:height 0.4 :width 0.6 :preview {:hidden :hidden}}} - npairs (require :nvim-autopairs) - hover (require :hover) - gitsigns (require :gitsigns) - neogit (require :neogit) - wk (require :which-key) + (ok-npairs npairs) (pcall require :nvim-autopairs) + (ok-hover hover) (pcall require :hover) + (ok-gitsigns gitsigns) (pcall require :gitsigns) + (ok-neogit neogit) (pcall require :neogit) + (ok-wk wk) (pcall require :which-key) repl (require :nifoc.repl) repo (require :nifoc.repo) formatting (require :nifoc.formatting)] (fn mod.setup [] (keymap.set :n : : {:noremap true}) ;; Leader Mappings - (keymap.set :n :o fzf.files {:desc "Find Files"}) - (keymap.set :n :s #(fzf.live_grep fzf-layout-bottom) - {:desc "Live Grep"}) + (when ok-fzf + (keymap.set :n :o fzf.files {:desc "Find Files"}) + (keymap.set :n :s #(fzf.live_grep fzf-layout-bottom) + {:desc "Live Grep"})) (keymap.set :n :fn :enew {:desc "New File"}) (keymap.set :n :u "UrlView buffer" {:desc "Open UrlView"}) (keymap.set :n :c repl.open-shell {:desc "Open Shell"}) (keymap.set :n :r repl.open-repl {:desc "Open REPL"}) - (keymap.set :n :bl fzf.buffers {:desc "List Buffers"}) - (keymap.set :n :bf fzf.grep_curbuf {:desc "Find In Buffer"}) - (keymap.set :n :bt fzf.treesitter {:desc "Find via Treesitter"}) - (keymap.set :n :g #(neogit.open {:kind :split}) - {:desc "Open Neogit"}) - (keymap.set :n :vs #(neogit.open {:kind :split}) - {:desc "VCS Status"}) - (keymap.set :n :vb #(fzf.git_branches fzf-layout-dropdown) - {:desc "List VCS Branches"}) - (keymap.set :n :vl #(gitsigns.blame_line {:full true}) - {:desc "Blame Line"}) + (when ok-fzf + (keymap.set :n :bl fzf.buffers {:desc "List Buffers"}) + (keymap.set :n :bf fzf.grep_curbuf {:desc "Find In Buffer"}) + (keymap.set :n :bt fzf.treesitter {:desc "Find via Treesitter"})) + (when ok-neogit + (keymap.set :n :g #(neogit.open {:kind :split}) + {:desc "Open Neogit"}) + (keymap.set :n :vs #(neogit.open {:kind :split}) + {:desc "VCS Status"})) + (when ok-fzf + (keymap.set :n :vb #(fzf.git_branches fzf-layout-dropdown) + {:desc "List VCS Branches"})) + (when ok-gitsigns + (keymap.set :n :vl #(gitsigns.blame_line {:full true}) + {:desc "Blame Line"})) (keymap.set :n :vd :DiffviewOpen {:desc "Open DiffView"}) (keymap.set :n :vvr #(repo.open-repo) {:desc "Open repository"}) (keymap.set :n :vvm #(repo.open-merge-request) {:desc "Open MR"}) (keymap.set :n :vvc #(repo.open-ci) {:desc "Open CI"}) (keymap.set :n :vtc #(repo.run-ci) {:desc "Trigger CI"}) - (keymap.set :n :lk fzf.keymaps {:desc "Show Keymappings"}) - (keymap.set :n :ld #(fzf.diagnostics_document fzf-layout-bottom) - {:desc "Show Diagnostics"}) - (keymap.set :n :lt :TodoFzfLua - {:desc "Show Todo Comments"}) + (when ok-fzf + (keymap.set :n :lk fzf.keymaps {:desc "Show Keymappings"}) + (keymap.set :n :ld #(fzf.diagnostics_document fzf-layout-bottom) + {:desc "Show Diagnostics"}) + (keymap.set :n :lt :TodoFzfLua + {:desc "Show Todo Comments"})) (keymap.set :n :dli :LspInfo {:desc "LSP Info"}) (keymap.set :n :dlr :LspRestart {:desc "Restart LSP"}) (keymap.set :n :ds #(vim.diagnostic.open_float {:scope :line}) @@ -55,8 +61,9 @@ (keymap.set :n :dtp :TSPlaygroundToggle {:desc "Toggle Treetsitter Playground"}) ;; Other Mappings - (keymap.set :i : npairs.autopairs_cr - {:expr true :replace_keycodes false :silent true}) + (when ok-npairs + (keymap.set :i : npairs.autopairs_cr + {:expr true :replace_keycodes false :silent true})) (keymap.set :n :F #(formatting.maybe-format-buffer 0) {:desc "Format Buffer"}) (keymap.set :n : :b) @@ -74,7 +81,8 @@ {:noremap true :silent true}) (keymap.set :n :p "(YankyPutAfter)") (keymap.set :n :P "(YankyPutBefore)") - (keymap.set :x :p substitute.visual) + (when ok-substitute + (keymap.set :x :p substitute.visual)) (keymap.set :x :P "(YankyPutBefore)") (keymap.set :n :gp "(YankyGPutAfter)") (keymap.set :n :gP "(YankyGPutBefore)") @@ -84,35 +92,39 @@ (keymap.set :x :y "(YankyYank)") (keymap.set :n "-" :Oil {:desc "Open Oil"}) ;; hover.nvim - (keymap.set :n :K hover.hover {:desc "Show Documentation"}) - (keymap.set :n :gK hover.hover_select {:desc "hover.nvim selection"}) - (keymap.set :n : #(hover.hover_switch :previous) - {:desc "hover.nvim previous source"}) - (keymap.set :n : #(hover.hover_switch :next) - {:desc "hover.nvim next source"}) - (keymap.set :n : hover.hover_mouse {:desc "hover.nvim mouse"}) + (when ok-hover + (keymap.set :n :K hover.hover {:desc "Show Documentation"}) + (keymap.set :n :gK hover.hover_select {:desc "hover.nvim selection"}) + (keymap.set :n : #(hover.hover_switch :previous) + {:desc "hover.nvim previous source"}) + (keymap.set :n : #(hover.hover_switch :next) + {:desc "hover.nvim next source"})) ;; Label - (wk.add [{1 :v :group :vcs} - {1 :l :group :list/lsp} - {1 :d :group :debug}])) + (when ok-wk + (wk.add [{1 :v :group :vcs} + {1 :l :group :list/lsp} + {1 :d :group :debug}]))) (fn mod.lsp-attach [_client bufnr] - (keymap.set :n :t #(fzf.lsp_document_symbols fzf-layout-dropdown) - {:buffer bufnr :desc "LSP Document Symbols"}) - (keymap.set :n :tw #(fzf.lsp_workspace_symbols fzf-layout-dropdown) - {:buffer bufnr :desc "LSP Workspace Symbols"}) + (when ok-fzf + (keymap.set :n :t #(fzf.lsp_document_symbols fzf-layout-dropdown) + {:buffer bufnr :desc "LSP Document Symbols"}) + (keymap.set :n :tw + #(fzf.lsp_workspace_symbols fzf-layout-dropdown) + {:buffer bufnr :desc "LSP Workspace Symbols"})) (keymap.set :n :th #(vim.lsp.inlay_hint.enable (not (vim.lsp.inlay_hint.is_enabled bufnr)) {: bufnr}) {:buffer bufnr :desc "Toggle Inlay Hints"}) - (keymap.set :n :lca fzf.lsp_code_actions - {:buffer bufnr :desc "LSP Code Action"}) - (keymap.set :n :lfr fzf.lsp_references - {:buffer bufnr :desc "Find References"}) - (keymap.set :n :lfd fzf.lsp_definitions - {:buffer bufnr :desc "Find Definitions"}) - (keymap.set :n :lfi fzf.lsp_implementations - {:buffer bufnr :desc "Find Implementations"})) + (when ok-fzf + (keymap.set :n :lca fzf.lsp_code_actions + {:buffer bufnr :desc "LSP Code Action"}) + (keymap.set :n :lfr fzf.lsp_references + {:buffer bufnr :desc "Find References"}) + (keymap.set :n :lfd fzf.lsp_definitions + {:buffer bufnr :desc "Find Definitions"}) + (keymap.set :n :lfi fzf.lsp_implementations + {:buffer bufnr :desc "Find Implementations"}))) (fn mod.terminal-open [bufnr] (let [map-opts {:buffer bufnr}] diff --git a/home/config/nvim/nifoc/statuscolumn.fnl b/home/config/nvim/nifoc/statuscolumn.fnl index a6e3244..0a6ed9f 100644 --- a/home/config/nvim/nifoc/statuscolumn.fnl +++ b/home/config/nvim/nifoc/statuscolumn.fnl @@ -6,7 +6,7 @@ v vim.v statusline (require :nifoc.statusline) diagnostic vim.diagnostic - gitsigns (require :gitsigns) + (ok-gitsigns gitsigns) (pcall require :gitsigns) gitsigns-ns (api.nvim_create_namespace :gitsigns_signs_) augroup (vim.api.nvim_create_augroup :NifocStatuscolumn {:clear true}) aucmd vim.api.nvim_create_autocmd] @@ -64,11 +64,12 @@ (vim.diagnostic.get $1.buf)) :group augroup :desc "Update cached diagnostic signs"}) - (aucmd :User {:pattern :GitSignsUpdate - :callback #(when (not= $1.data nil) - (update-cache-gitsigns $1.data.buffer)) - :group augroup - :desc "Update cached gitsigns signs"}) + (when (= b.nifoc_gitsigns_enabled 1) + (aucmd :User {:pattern :GitSignsUpdate + :callback #(when (not= $1.data nil) + (update-cache-gitsigns $1.data.buffer)) + :group augroup + :desc "Update cached gitsigns signs"})) (aucmd :BufWipeout {:callback (fn [args] (tset cache :diagnostics args.buf nil) @@ -107,7 +108,8 @@ cursor-pos [mouse.line 0]] (api.nvim_win_set_cursor mouse.winid cursor-pos) - (vim.defer_fn #(gitsigns.blame_line {:full true}) + (vim.defer_fn #(when ok-gitsigns + (gitsigns.blame_line {:full true})) 100)))}}) (set mod.gitsigns-or-bar [{:condition #(and (not= b.nifoc_gitsigns_enabled 1) (or (o.number:get) diff --git a/home/config/nvim/nifoc/statusline.fnl b/home/config/nvim/nifoc/statusline.fnl index 4c32ad6..da66a91 100644 --- a/home/config/nvim/nifoc/statusline.fnl +++ b/home/config/nvim/nifoc/statusline.fnl @@ -10,7 +10,7 @@ repo (require :nifoc.repo) nifoc-treesitter (require :nifoc.treesitter) navic (require :nvim-navic) - neogit (require :neogit) + (ok-neogit neogit) (pcall require :neogit) fzf (require :fzf-lua) fzf-layout-bottom {:winopts_fn #(let [height (math.floor (* vim.o.lines 0.4))] @@ -179,7 +179,7 @@ :hl {:fg colors.black :bg colors.orange :bold true}} 3 {:provider #(.. $1.git-head " ") :on_click {:name :heirline_git_branch - :callback #(neogit.open {:kind :split})} + :callback #(when ok-neogit (neogit.open {:kind :split}))} :hl {:fg colors.black :bg colors.orange :bold true}} 4 mod.space 5 {:provider #(.. " " $1.git-added " ") diff --git a/home/config/nvim/nifoc/theme.fnl b/home/config/nvim/nifoc/theme.fnl index 24ab268..6993557 100644 --- a/home/config/nvim/nifoc/theme.fnl +++ b/home/config/nvim/nifoc/theme.fnl @@ -8,9 +8,6 @@ g vim.g dracula (require :dracula) dracula-colors (dracula.colors)] - (fn swap-bg-with-fg [fg group] - (highlight group {: fg :bg (highlight-get-field group :fg)})) - (set mod.colors dracula-colors) (fn mod.setup [] @@ -29,46 +26,6 @@ (highlight :IlluminatedWordText {:bg mod.colors.selection}) (highlight :IlluminatedWordRead {:bg mod.colors.selection}) (highlight :IlluminatedWordWrite {:bg mod.colors.selection :underline true}) - ;; cmp - (highlight :PmenuSel {:fg mod.colors.white :bg "#363848"}) - (highlight :CmpCursorLine {:bg "#363848"}) - (highlight :CmpItemAbbr {:fg mod.colors.white :bg :NONE}) - (highlight :CmpItemAbbrMatch {:fg mod.colors.cyan :bg :NONE :bold true}) - (highlight :CmpItemAbbrMatchFuzzy - {:fg mod.colors.cyan :bg :NONE :bold true}) - (highlight :CmpItemAbbrDeprecated - {:fg mod.colors.white :bg :NONE :strikethrough true}) - (highlight :CmpItemMenu {:fg mod.colors.purple :bg :NONE :italic true}) - (let [cmp-groups [:CmpItemKindField - :CmpItemKindProperty - :CmpItemKindEvent - :CmpItemKindText - :CmpItemKindEnum - :CmpItemKindKeyword - :CmpItemKindConstant - :CmpItemKindConstructor - :CmpItemKindReference - :CmpItemKindFunction - :CmpItemKindStruct - :CmpItemKindClass - :CmpItemKindModule - :CmpItemKindOperator - :CmpItemKindVariable - :CmpItemKindUnit - :CmpItemKindSnippet - :CmpItemKindFolder - :CmpItemKindMethod - :CmpItemKindValue - :CmpItemKindEnumMember - :CmpItemKindInterface - :CmpItemKindColor - :CmpItemKindTypeParameter]] - (each [_ group (pairs cmp-groups)] - (swap-bg-with-fg mod.colors.black group))) - (highlight :CmpItemKindFile {:fg mod.colors.black :bg mod.colors.white}) - (highlight :CmpItemKindFolder {:fg mod.colors.black :bg mod.colors.white}) - (highlight :CmpItemKindTabNine - {:fg mod.colors.black :bg mod.colors.bright_magenta}) ;; neogit (highlight :NeogitBranch {:fg mod.colors.green :bold true}) (highlight :NeogitBranchHead diff --git a/home/config/nvim/nifoc/treesitter.fnl b/home/config/nvim/nifoc/treesitter.fnl index 9ddad1b..da5079d 100644 --- a/home/config/nvim/nifoc/treesitter.fnl +++ b/home/config/nvim/nifoc/treesitter.fnl @@ -1,20 +1,20 @@ (let [mod {} - treesitter (require :nvim-treesitter) + (ok treesitter) (pcall require :nvim-treesitter) set-bufvar vim.api.nvim_buf_set_var] (fn mod.setup [] - (treesitter.define_modules {:nifoc_hooks {:enable false - :attach (lambda [bufnr] - (set-bufvar bufnr - :nifoc_treesitter_enabled - 1)) - :detach (lambda [bufnr] - (set-bufvar bufnr - :nifoc_treesitter_enabled - 0)) - :is_supported #true}})) + (if ok + (treesitter.define_modules {:nifoc_hooks {:enable false + :attach (lambda [bufnr] + (set-bufvar bufnr + :nifoc_treesitter_enabled + 1)) + :detach (lambda [bufnr] + (set-bufvar bufnr + :nifoc_treesitter_enabled + 0)) + :is_supported #true}}))) (fn mod.active? [] (= vim.b.nifoc_treesitter_enabled 1)) mod) - diff --git a/home/config/nvim/plugins/blink-cmp.fnl b/home/config/nvim/plugins/blink-cmp.fnl new file mode 100644 index 0000000..620ea8b --- /dev/null +++ b/home/config/nvim/plugins/blink-cmp.fnl @@ -0,0 +1,42 @@ +(let [cmp (require :blink.cmp) + (ok-luasnip luasnip) (pcall require :luasnip) + config-snippets (if ok-luasnip + {:expand (fn [snippet] + (luasnip.lsp_expand snippet)) + :active (fn [filter] + (if (and filter filter.direction) + (luasnip.jumpable filter.direction) + (luasnip.in_snippet))) + :jump (fn [direction] (luasnip.jump direction))} + {}) + config-sources-providers (if (pcall require :cmp_tabnine.config) + {:cmp_tabnine {:name :cmp_tabnine + :module :blink.compat.source}} + {})] + (cmp.setup {:keymap {:preset :none + : [:accept :fallback] + : [:cancel :fallback] + : [(fn [cmp] + (if (cmp.snippet_active) (cmp.accept) + (cmp.select_next))) + :snippet_forward + :fallback] + : [:select_prev :snippet_backward :fallback] + : [:select_prev :fallback] + : [:select_next :fallback] + : [:show + :show_documentation + :hide_documentation] + : [:scroll_documentation_up :fallback] + : [:scroll_documentation_down :fallback] + : [:hide :fallback]} + :completion {:list {:selection :manual} + :menu {:min_width 20 :max_height 25} + :documentation {:auto_show true + :window {:border :rounded}} + :ghost_text {:enabled false}} + :signature {:enabled true} + :snippets config-snippets + :sources {:default [:lsp :cmp_tabnine :path :luasnip :buffer] + :providers config-sources-providers} + :fuzzy {:prebuilt_binaries {:download false :force_version nil}}})) diff --git a/home/config/nvim/plugins/cmp.fnl b/home/config/nvim/plugins/cmp.fnl deleted file mode 100644 index 4856433..0000000 --- a/home/config/nvim/plugins/cmp.fnl +++ /dev/null @@ -1,113 +0,0 @@ -(let [cmp (require :cmp) - luasnip (require :luasnip) - lspkind (require :lspkind) - npairs (require :nvim-autopairs.completion.cmp)] - (fn main-sources [] - (let [maybe-tabnine (if (pcall require :cmp_tabnine.config) - [{:name :cmp_tabnine}] - [])] - (vim.list_extend (vim.list_extend [{:name :nvim_lsp}] maybe-tabnine) - [{:name :async_path} {:name :luasnip}]))) - - (fn comparator-list [] - (let [compare (require :cmp.config.compare) - maybe-tabnine (if (pcall require :cmp_tabnine.compare) - [(require :cmp_tabnine.compare)] - [])] - (vim.list_extend (vim.list_extend [compare.offset - compare.exact - compare.score] - maybe-tabnine) - [compare.recently_used - compare.locality - compare.kind - compare.length - compare.order]))) - - (fn has-words-before? [] - (let [(line col) (-> 0 (vim.api.nvim_win_get_cursor) (unpack))] - (if (not= col 0) - (let [line-content (vim.api.nvim_buf_get_lines 0 (- line 1) line true) - cursor-content (: (. line-content 1) :sub col col)] - (= (cursor-content:match "%s") nil)) - false))) - - (fn map-tab [fallback] - (if (cmp.visible) (cmp.select_next_item) - (luasnip.expand_or_jumpable) (luasnip.expand_or_jump) - (has-words-before?) (cmp.complete) - (fallback))) - - (fn map-stab [fallback] - (if (cmp.visible) (cmp.select_prev_item) - (luasnip.jumpable -1) (luasnip.jump -1) - (fallback))) - - (cmp.setup {:sources (cmp.config.sources (main-sources) - [{:name :treesitter - :keyword_length 3} - {:name :buffer}]) - :sorting {:priority_weight 2 :comparators (comparator-list)} - :mapping (cmp.mapping.preset.insert {: (cmp.mapping {:i (cmp.mapping.abort) - :c (cmp.mapping.close)}) - : (cmp.mapping {:i (cmp.mapping.abort)}) - : (cmp.mapping {:c #(if (cmp.visible) - (cmp.select_next_item {:behavior cmp.SelectBehavior.Insert}) - (cmp.complete)) - :i map-tab - :s map-tab}) - : (cmp.mapping {:c #(if (cmp.visible) - (cmp.select_prev_item {:behavior cmp.SelectBehavior.Insert}) - (cmp.complete)) - :i map-stab - :s map-stab}) - : (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Insert - :select true}) - : (cmp.mapping.confirm {:select true})}) - :window {:completion {:winhighlight "Normal:Pmenu,FloatBorder:Pmenu,CursorLine:CmpCursorLine,Search:None" - :col_offset -3 - :side_padding 0 - :scrollbar true} - :documentation (cmp.config.window.bordered)} - :view {:entries {:name :custom :selection_order :near_cursor}} - :completion {:keyword_length 2 - :completeopt "menu,menuone,noinsert"} - :snippet {:expand (fn [args] - (luasnip.lsp_expand args.body))} - :formatting {:fields [:kind :abbr :menu] - :format (fn [entry vim-item] - (let [kind-fn (lspkind.cmp_format {:mode :symbol_text - :maxwidth 50}) - kind (kind-fn entry vim-item) - strings (vim.split kind.kind "%s" - {:trimempty true})] - (if (= entry.source.name :cmp_tabnine) - (do - (set kind.kind " 󱜚 ") - (set kind.menu " (TabNine)")) - (= entry.source.name :cmp_yanky) - (do - (set kind.kind " 󰅌 ") - (set kind.menu " (Clipboard)")) - (= (. strings 1) :TypeParameter) - (do - (set kind.kind "  ") - (set kind.menu - " (TypeParameter)")) - (do - (set kind.kind - (.. " " (or (. strings 1) "") - " ")) - (set kind.menu - (.. " (" - (or (. strings 2) "") ")")))) - kind))}}) - (cmp.setup.cmdline "/" - {:sources (cmp.config.sources [{:name :nvim_lsp_document_symbol}] - [{:name :buffer}]) - :mapping (cmp.mapping.preset.cmdline)}) - (cmp.setup.cmdline ":" - {:sources (cmp.config.sources [{:name :async_path}] - [{:name :cmdline}]) - :mapping (cmp.mapping.preset.cmdline)}) - (cmp.event:on :confirm_done (npairs.on_confirm_done))) diff --git a/home/config/nvim/plugins/gitsigns.fnl b/home/config/nvim/plugins/gitsigns.fnl index 29ee6bf..69f3cef 100644 --- a/home/config/nvim/plugins/gitsigns.fnl +++ b/home/config/nvim/plugins/gitsigns.fnl @@ -8,7 +8,6 @@ :untracked {:text "┆"}} :numhl false :linehl false - :diff_opts {:internal true} :preview_config {:border :rounded} :on_attach (fn [bufnr] - (set-bufvar bufnr :nifoc_gitsigns_enabled 1))})) + (set-bufvar bufnr :nifoc_gitsigns_enabled 0))})) diff --git a/home/config/nvim/plugins/lsp.fnl b/home/config/nvim/plugins/lsp.fnl index 944906b..a8bf535 100644 --- a/home/config/nvim/plugins/lsp.fnl +++ b/home/config/nvim/plugins/lsp.fnl @@ -1,5 +1,5 @@ (let [lsp (require :lspconfig) - cmp (require :cmp_nvim_lsp) + cmp (require :blink.cmp) schemastore (require :schemastore) navic (require :nvim-navic) diagnostic (require :nifoc.diagnostic) @@ -30,9 +30,7 @@ :desc "Automatic LSP setup"}) ;; Servers (vim.lsp.set_log_level :OFF) - (let [capabilities (vim.tbl_deep_extend :force - (vim.lsp.protocol.make_client_capabilities) - (cmp.default_capabilities)) + (let [capabilities (cmp.get_lsp_capabilities nil true) handlers {:textDocument/hover (vim.lsp.with vim.lsp.handlers.hover {:border :rounded}) :textDocument/signatureHelp (vim.lsp.with vim.lsp.handlers.signature_help diff --git a/home/config/nvim/plugins/neogit.fnl b/home/config/nvim/plugins/neogit.fnl index 7ae4401..6466627 100644 --- a/home/config/nvim/plugins/neogit.fnl +++ b/home/config/nvim/plugins/neogit.fnl @@ -1,5 +1,5 @@ (let [neogit (require :neogit) - gitsigns (require :gitsigns) + (ok-gitsigns gitsigns) (pcall require :gitsigns) augroup (vim.api.nvim_create_augroup :NifocNeogit {:clear true}) aucmd vim.api.nvim_create_autocmd] (neogit.setup {}) @@ -17,5 +17,5 @@ :NeogitPullComplete :NeogitPushComplete :NeogitStatusRefreshed] - :callback #(gitsigns.refresh) + :callback #(when ok-gitsigns (gitsigns.refresh)) :group augroup})) diff --git a/home/config/nvim/plugins/treesitter.fnl b/home/config/nvim/plugins/treesitter.fnl index 02d0c06..85028b5 100644 --- a/home/config/nvim/plugins/treesitter.fnl +++ b/home/config/nvim/plugins/treesitter.fnl @@ -10,10 +10,8 @@ :dockerfile :eex :elixir - :elvish :erlang :fennel - :fish :git_config :git_rebase :gitattributes diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index 2dbc16d..0e4d974 100644 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -3,6 +3,8 @@ let inherit (pkgs.stdenv) isDarwin; inherit (lib) optionals; + + inherit (pkgs) vimPlugins; in { programs.neovim = { @@ -84,7 +86,7 @@ in nvim-web-devicons { - plugin = wezterm-nvim; + plugin = vimPlugins.wezterm-nvim; config = builtins.readFile ../../config/nvim/plugins/wezterm.fnl; type = "fennel"; } @@ -123,13 +125,13 @@ in } { - plugin = rainbow-delimiters-nvim; + plugin = vimPlugins.rainbow-delimiters-nvim; config = builtins.readFile ../../config/nvim/plugins/rainbow-delimiters.fnl; type = "fennel"; } { - plugin = todo-comments-nvim; + plugin = vimPlugins.todo-comments-nvim; config = builtins.readFile ../../config/nvim/plugins/todo-comments.fnl; type = "fennel"; } @@ -187,19 +189,14 @@ in type = "fennel"; } - # cmp + # Completion { - plugin = nvim-cmp; - config = builtins.readFile ../../config/nvim/plugins/cmp.fnl; + plugin = vimPlugins.blink-cmp; + config = builtins.readFile ../../config/nvim/plugins/blink-cmp.fnl; type = "fennel"; } - cmp-nvim-lsp - cmp_luasnip - cmp-async-path - cmp-buffer - cmp-cmdline - cmp-nvim-lsp-document-symbol + vimPlugins.blink-compat # Formatting @@ -268,11 +265,11 @@ in type = "fennel"; } - { - plugin = gitsigns-nvim; - config = builtins.readFile ../../config/nvim/plugins/gitsigns.fnl; - type = "fennel"; - } + # { + # plugin = gitsigns-nvim; + # config = builtins.readFile ../../config/nvim/plugins/gitsigns.fnl; + # type = "fennel"; + # } { plugin = diffview-nvim; diff --git a/home/programs/nvim/plugins.yaml b/home/programs/nvim/plugins.yaml index e65dee2..c2d8fe9 100644 --- a/home/programs/nvim/plugins.yaml +++ b/home/programs/nvim/plugins.yaml @@ -2,7 +2,6 @@ - src: nvim-lua/popup.nvim - src: nvim-lua/plenary.nvim - src: kyazdani42/nvim-web-devicons -- src: willothy/wezterm.nvim - src: romainl/vim-cool # Keybindings - src: gbprod/yanky.nvim @@ -13,8 +12,6 @@ - src: Mofiqul/dracula.nvim # Syntax - src: nvim-treesitter/nvim-treesitter -- src: HiPhish/rainbow-delimiters.nvim -- src: folke/todo-comments.nvim # Finder - src: ibhagwan/fzf-lua # LSP @@ -30,15 +27,6 @@ - src: folke/ts-comments.nvim # Snippets - src: L3MON4D3/LuaSnip -# cmp -- src: hrsh7th/nvim-cmp -- src: hrsh7th/cmp-nvim-lsp -- src: saadparwaiz1/cmp_luasnip -- src: https://codeberg.org/FelipeLema/cmp-async-path.git - name: cmp-async-path -- src: hrsh7th/cmp-buffer -- src: hrsh7th/cmp-cmdline -- src: hrsh7th/cmp-nvim-lsp-document-symbol # Formatting - src: stevearc/conform.nvim # Pairs