diff options
author | Soispha <soispha@vhack.eu> | 2023-08-19 19:40:21 +0200 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2023-08-19 19:45:28 +0200 |
commit | 3d0658a9945586215ade21992d7bfda903d2d4d8 (patch) | |
tree | 3b1c2fc35c875f4ebaed5d9229955d5c302d6d12 | |
parent | Fix(hm/conf/neovim/plugins/lf): Prepend 'vim' to global 'o' usage (diff) | |
download | nixos-config-3d0658a9945586215ade21992d7bfda903d2d4d8.tar.gz nixos-config-3d0658a9945586215ade21992d7bfda903d2d4d8.zip |
Fix(hm/conf/neovim/mappings): Correctly specify lua code
Diffstat (limited to '')
-rw-r--r-- | home-manager/soispha/config/neovim/nixvim/mappings/default.nix | 52 | ||||
-rw-r--r-- | home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix | 2 |
2 files changed, 30 insertions, 24 deletions
diff --git a/home-manager/soispha/config/neovim/nixvim/mappings/default.nix b/home-manager/soispha/config/neovim/nixvim/mappings/default.nix index 575ad465..a152a17e 100644 --- a/home-manager/soispha/config/neovim/nixvim/mappings/default.nix +++ b/home-manager/soispha/config/neovim/nixvim/mappings/default.nix @@ -7,7 +7,7 @@ maps = let normal_and_insert = { "<Esc>" = { - action = "'<cmd>noh<CR><Esc>'"; + action = "<cmd>noh<CR><Esc>"; desc = "Disable the search highlighting and send Escape"; }; }; @@ -27,6 +27,7 @@ end end ''; + lua = true; desc = "completion trigger/ forward in completen menu"; }; "<C-Space>" = { @@ -36,22 +37,23 @@ cmp.confirm() end ''; + lua = true; desc = "confirm the selected item"; }; } normal_and_insert; normalVisualOp = { # yank/ cut to the system clipboard - "<leader>y" = "'\"+y'"; - "<leader>Y" = "'\"+Y'"; + "<leader>y" = "\"+y"; + "<leader>Y" = "\"+Y"; # Unmap some old keys #"s" = "'<Nop>'"; #"t" = "'<Nop>'"; - "<Up>" = "'<Nop>'"; - "<Down>" = "'<Nop>'"; - "<Left>" = "'<Nop>'"; - "<Right>" = "'<Nop>'"; + "<Up>" = "<Nop>"; + "<Down>" = "<Nop>"; + "<Left>" = "<Nop>"; + "<Right>" = "<Nop>"; # remap dvorak "l" = "n"; @@ -74,48 +76,49 @@ normal = lib.recursiveUpdate { "<Tab>" = { - action = "':'"; + action = ":"; desc = "jump to command line"; }; "\\f" = { action = "require('lf').start()"; + lua = true; desc = "open lf in a floating window"; }; # Splits "<C-t>" = { - action = "'<C-w>p'"; + action = "<C-w>p"; desc = "go to previous split"; }; "<C-n>" = { - action = "'<C-w>w'"; + action = "<C-w>w"; desc = "go to next split"; }; "<leader>-" = { - action = "'<C-W>s'"; + action = "<C-W>s"; desc = "New horizontal split"; }; "<leader>|" = { - action = "'<C-W>v'"; + action = "<C-W>v"; desc = "New vertical split"; }; # Exit insert mode after creating a new line above or below the current line."; - "o" = "'o<Esc>'"; - "O" = "'O<Esc>'"; + "o" = "o<Esc>"; + "O" = "O<Esc>"; # Center the cursor vertically when moving to the next word during a search. - "n" = "'nzzzv'"; - #"N" = "'Nzzzv'"; + "n" = "nzzzv"; + #"N" = "Nzzzv"; "<leader>p" = { - action = "'\"_dP'"; + action = "\"_dP"; desc = "keep the cut thing in the base register"; }; "<leader>d" = { - action = "'\"_d'"; + action = "\"_d"; desc = "delete without saving to register"; }; "dd" = { @@ -128,37 +131,38 @@ end end ''; + lua = true; desc = "Pipe all blank line deletions to the blackhole register"; expr = true; silent = true; }; "<leader>s" = { - action = "':%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>'"; + action = ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>"; desc = "replace for the word under the cursor"; }; "<C-s>" = { - action = "'<cmd>mksession! <CR>'"; + action = "<cmd>mksession! <CR>"; desc = "to overwrite/create a session"; }; "<leader>X" = { - action = "'[[!!$SHELL <cr>]]'"; + action = "[[!!$SHELL <cr>]]"; desc = "Read the current line and execute that line in your $SHELL. The resulting output will replace the curent line that was being executed."; }; } normal_and_insert; terminal = { "<Esc><Esc>" = { - action = "'<C-\\><C-n>'"; + action = "<C-\\><C-n>"; desc = "Exit terminal mode with <Esc><Esc>"; }; }; visual = { # move selected lines in visual mode - "T" = "':m '>+1<CR>gv=gv'"; - "N" = "':m '<-2<CR>gv=gv'"; + "T" = ":m '>+1<CR>gv=gv"; + "N" = ":m '<-2<CR>gv=gv"; }; }; }; diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix index c36bc102..1cca9866 100644 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix +++ b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix @@ -70,6 +70,7 @@ normal = { "<space>f" = { action = "function() vim.lsp.buf.format { async = true } end"; + lua = true; desc = "[F]ormat the current buffer (asynchronously)"; }; "<space>wl" = { @@ -78,6 +79,7 @@ print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end ''; + lua = true; desc = "[W]orkspace folders [l]ist"; }; }; |