diff --git a/modules/neovim.nix b/modules/neovim.nix index f750ff0..02118dd 100644 --- a/modules/neovim.nix +++ b/modules/neovim.nix @@ -15,7 +15,6 @@ in globals = { mapleader = " "; - clipboard = "unnamedplus"; }; options = { @@ -35,6 +34,35 @@ in "o." = "Telescope file_browser"; "." = "Telescope find_files"; # cwd full sub-dir fuzzy find "of" = "Telescope live_grep"; # cwd search file + + # keep cursor centered while navigating + "" = "zz"; + "" = "zz"; + "n" = "nzzzv"; + "N" = "Nzzzv"; + + # yank to system clipboard + "y" = "\"+y"; + "Y" = "\"+Y"; + + # perma-delete without putting on any clipboard + "d" = "\"_d"; + }; + + maps.visual = { + # moves visual selection up and down lines + "J" = ":m '>+1gv=gv"; + "K" = ":m '<-2gv=gv"; + + # copy to system clipboard + "y" = "\"+y"; + + # perma-delete without putting on any clipboard + "d" = "\"_d"; + }; + + maps.visualOnly = { + "p" = "\"_dP"; # leader+p deletes the selection to null, then pastes }; plugins = { @@ -91,7 +119,7 @@ in # Read settings here: https://github.com/mfussenegger/nvim-dap#Usage # See :help dap.txt, :help dap-mapping and :help dap-api. cmp-dap.enable = true; - cmp-vsnip.enable = true; + # cmp-vsnip.enable = true; cmp-buffer.enable = true; cmp-nvim-lsp-signature-help.enable = true; cmp-nvim-lua.enable = true; diff --git a/rsrcs/nvim.lua b/rsrcs/nvim.lua index 09d1ca2..85f46cf 100644 --- a/rsrcs/nvim.lua +++ b/rsrcs/nvim.lua @@ -129,6 +129,8 @@ vim.keymap.set('', 'ff', function() hop.hint_patterns({ multi_windows = true, current_line_only = false }) end, {remap=true}) +vim.opt.scrolloff = 8; + require("telescope").load_extension "file_browser"