From 013d70b8fc655e8f7cc010c451d8f2be658aaa11 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Mon, 21 Aug 2023 22:13:02 -0600 Subject: add split navigation kb --- lua/config/keymap.lua | 10 ++++++++++ lua/config/set.lua | 15 +++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'lua/config') diff --git a/lua/config/keymap.lua b/lua/config/keymap.lua index 2280d15..6d99cfa 100644 --- a/lua/config/keymap.lua +++ b/lua/config/keymap.lua @@ -10,3 +10,13 @@ vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous dia vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) + +-- Split navigation +vim.keymap.set('n', '', 'h', { desc = 'Split: Move left' }) +vim.keymap.set('n', '', 'j', { desc = 'Split: Move down' }) +vim.keymap.set('n', '', 'k', { desc = 'Split: Move up' }) +vim.keymap.set('n', '', 'l', { desc = 'Split: Move right' }) +vim.keymap.set('n', '', 'vertical resize -5', { desc = 'Split: Resize left', noremap = true }) +vim.keymap.set('n', '', 'resize +5', { desc = 'Split: Resize down', noremap = true }) +vim.keymap.set('n', '', 'resize -5', { desc = 'Split: Resize up', noremap = true }) +vim.keymap.set('n', '', 'vertical resize +5', { desc = 'Split: Resize right', noremap = true }) diff --git a/lua/config/set.lua b/lua/config/set.lua index 1f4d774..3793a22 100644 --- a/lua/config/set.lua +++ b/lua/config/set.lua @@ -38,6 +38,21 @@ vim.opt.foldexpr='nvim_treesitter#foldexpr()' -- Disable folding at startup. vim.nofoldenable=true +-- 4 spaces for tab indentation +-- not needed, using https://EditorConfig.org instead for 'tpope/vim-sleuth' +-- vim.api.nvim_create_autocmd({'FileType', 'BufEnter', 'BufNewFile', 'BufRead'}, { +-- pattern = { '*.py' }, +-- callback = function() +-- vim.cmd[[filetype plugin indent on]] +-- -- show existing tab with 4 spaces width +-- vim.tabstop=4 +-- -- when indenting with '>', use 4 spaces width +-- vim.shiftwidth=4 +-- -- on pressing tab, insert 4 spaces +-- vim.expandtab=true +-- end +-- }) + -- Highlight on yank local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) vim.api.nvim_create_autocmd('TextYankPost', { -- cgit v1.2.3-70-g09d2