From 6a3d402797b1347d1535415543d7ffce77efdb7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Niemier?= <~@hauleth.dev> Date: Wed, 30 Apr 2025 08:54:19 +0200 Subject: [PATCH] fix: update Nvim config to newest version --- modules/nvim.nix | 80 +++++++++++++++++++++++++++++- modules/nvim/fnl/langclient.fnl | 9 +--- modules/nvim/fnl/plugins.fnl | 5 +- modules/nvim/init.fnl | 11 ++-- modules/nvim/plugin/unimpaired.vim | 18 ------- 5 files changed, 90 insertions(+), 33 deletions(-) diff --git a/modules/nvim.nix b/modules/nvim.nix index 9a05e21..b287b3e 100644 --- a/modules/nvim.nix +++ b/modules/nvim.nix @@ -30,7 +30,85 @@ # plugins.lua-utils-nvim plugins.neorg plugins.neorg-telescope - plugins.nvim-treesitter.withAllGrammars + (plugins.nvim-treesitter.withPlugins (p: with p; [ + awk + bash + c + clojure + comment + cpp + css + dhall + diff + djot + dot + editorconfig + eex + elixir + erlang + fennel + fish + git_config + git_rebase + gitattributes + gitcommit + gitignore + gleam + glsl + graphql + haskell + hcl + heex + html + hurl + ini + javascript + jq + json + julia + just + latex + lua + luadoc + luap + luau + make + markdown + markdown_inline + mermaid + meson + nginx + nickel + nix + norg + po + printf + prolog + promql + properties + python + r + racket + ruby + rust + scala + scheme + sql + ssh_config + superhtml + terraform + toml + toml + typescript + typst + vim + vimdoc + xml + yaml + zig + ziggy + ziggy_schema + ])) ]; opt = []; diff --git a/modules/nvim/fnl/langclient.fnl b/modules/nvim/fnl/langclient.fnl index e4c0845..b7e6059 100644 --- a/modules/nvim/fnl/langclient.fnl +++ b/modules/nvim/fnl/langclient.fnl @@ -12,7 +12,7 @@ (tset (require :lspconfig.ui.windows) :default_options {:border border}) (set lsp.handlers.textDocument/hover (lsp.with lsp.handlers.hover {:border border})) (set lsp.handlers.textDocument/signatureHelp (lsp.with lsp.handlers.signature_help {:border border})) - (vim.diagnostic.config {:float {:border border} :virtual_text false})) + (vim.diagnostic.config {:float {:border border}})) (augroup hauleth-lsp (on LspAttach @@ -27,12 +27,7 @@ (bmap :n :gD #(vim.lsp.buf.declaration))) (when (capable? :documentFormattingProvider) (bmap :n :Q #(vim.lsp.buf.format))) - (when (capable? :documentSymbolProvider) - (bmap :n :gO #(picker.lsp_document_symbols)))))) - -(map :n :grr #(picker.lsp_references)) -(map :n :gra #(vim.lsp.buf.code_action)) -(map :n :grs #(vim.lsp.buf.rename)) + ))) (augroup hauleth-lsp-diagnostics (on CursorHold "*" (vim.diagnostic.open_float {:focus false}))) diff --git a/modules/nvim/fnl/plugins.fnl b/modules/nvim/fnl/plugins.fnl index b484026..fd15b72 100644 --- a/modules/nvim/fnl/plugins.fnl +++ b/modules/nvim/fnl/plugins.fnl @@ -52,8 +52,9 @@ (pkg :j-hui/fidget.nvim {:tag :legacy}) ; Code manipulation - (pkg :AndrewRadev/splitjoin.vim - {:keys [:gS :gJ]}) + ;(pkg :AndrewRadev/splitjoin.vim + ; {:keys [:gS :gJ]}) + (pkg :Wansmer/treesj) (pkg :hauleth/sad.vim) ; Task running diff --git a/modules/nvim/init.fnl b/modules/nvim/init.fnl index 15ecf63..818922c 100644 --- a/modules/nvim/init.fnl +++ b/modules/nvim/init.fnl @@ -173,11 +173,7 @@ (let [unimpaired (fn [char left right] (map :n (.. "[" char) left) (map :n (.. "]" char) right))] - (unimpaired :w :gT :gt) - (unimpaired :q ":cprev" ":cnext") - (unimpaired :Q ":cpfile" ":cnfile") - (unimpaired :l ":lprev" ":lnext") - (unimpaired :L ":lpfile" ":lnfile"))) + (unimpaired :w :gT :gt))) (do ; Terminal mappings ; (map :n :c ":term") @@ -316,4 +312,9 @@ (fun.termopen command) (cmd.startinsert))) +(do ; TreeSJ + (map :n :gS #(let [lib (require "treesj") + toggle (. lib :toggle)] + (toggle)))) + (require :langclient) diff --git a/modules/nvim/plugin/unimpaired.vim b/modules/nvim/plugin/unimpaired.vim index aefd37c..6545407 100644 --- a/modules/nvim/plugin/unimpaired.vim +++ b/modules/nvim/plugin/unimpaired.vim @@ -1,23 +1,5 @@ " Section: Line operations -function! s:BlankUp(count) abort - put!=repeat(nr2char(10), a:count) - ']+1 - silent! call repeat#set("\unimpairedBlankUp", a:count) -endfunction - -function! s:BlankDown(count) abort - put =repeat(nr2char(10), a:count) - '[-1 - silent! call repeat#set("\unimpairedBlankDown", a:count) -endfunction - -nnoremap unimpairedBlankUp :call BlankUp(v:count1) -nnoremap unimpairedBlankDown :call BlankDown(v:count1) - -nmap [ unimpairedBlankUp -nmap ] unimpairedBlankDown - function! s:ExecMove(cmd) abort let old_fdm = &foldmethod if old_fdm !=# 'manual' -- 2.51.2