From 2ef3190380980571ff808e79e2fe8d918a2c18aa Mon Sep 17 00:00:00 2001 From: Rudis Muiznieks Date: Fri, 2 Sep 2022 20:05:35 -0500 Subject: [PATCH] up/down between wrapped lines --- nvim/lua/keybindings.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nvim/lua/keybindings.lua b/nvim/lua/keybindings.lua index d9c4dad..6a4a085 100644 --- a/nvim/lua/keybindings.lua +++ b/nvim/lua/keybindings.lua @@ -1,6 +1,13 @@ local cwdopt = '{cwd = require("userfuncs").find_project_root()}' local noremap = {noremap = true} +local snoremap = { noremap = true, silent = true } + +-- up and down between wrapped lines +vim.api.nvim_set_keymap('', 'k', 'gk', snoremap) +vim.api.nvim_set_keymap('', 'j', 'gj', snoremap) +vim.api.nvim_set_keymap('', '', 'gk', snoremap) +vim.api.nvim_set_keymap('', '', 'gj', snoremap) -- file navigation vim.api.nvim_set_keymap('n', '-', 'lua require("telescope").extensions.vinegar.file_browser()', noremap) @@ -13,10 +20,8 @@ vim.api.nvim_set_keymap('n', 'gg', 'lua require("telescope.builtin" vim.api.nvim_set_keymap('n', 'fu', 'Telescope lsp_references', noremap) vim.api.nvim_set_keymap('n', 'gd', 'Telescope lsp_definitions', noremap) vim.api.nvim_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', noremap) -vim.api.nvim_set_keymap('n', 'dn', 'lua vim.lsp.diagnostic.goto_next()', noremap) -vim.api.nvim_set_keymap('n', 'dN', 'lua vim.lsp.diagnostic.goto_prev()', noremap) -vim.api.nvim_set_keymap('n', 'dd', 'Telescope lsp_document_diagnostics', noremap) -vim.api.nvim_set_keymap('n', 'dD', 'Telescope lsp_workspace_diagnostics', noremap) +vim.api.nvim_set_keymap('n', 'dn', 'lua vim.diagnostic.goto_next()', noremap) +vim.api.nvim_set_keymap('n', 'dN', 'lua vim.diagnostic.goto_prev()', noremap) vim.api.nvim_set_keymap('n', 'xx', 'lua vim.lsp.buf.code_action()', noremap) -- dadbod stuff