summaryrefslogtreecommitdiff
path: root/.config/nvim/lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua')
-rw-r--r--.config/nvim/lua/keymaps.lua21
-rw-r--r--.config/nvim/lua/options.lua51
2 files changed, 35 insertions, 37 deletions
diff --git a/.config/nvim/lua/keymaps.lua b/.config/nvim/lua/keymaps.lua
index c043fc7..8501c64 100644
--- a/.config/nvim/lua/keymaps.lua
+++ b/.config/nvim/lua/keymaps.lua
@@ -1,15 +1,24 @@
-vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
+-- Misc
+vim.keymap.set({ 'n', 'i'}, '<C-a>', '<Esc>ggVG', { desc = 'Visually Highlight [A]ll' })
+vim.keymap.set('n', '<Esc>', ':nohlsearch<CR>')
+-- Window Navigation
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
+-- Window resizing
+local resize = 2;
+vim.keymap.set('n', '<C-Left>', string.format(':vertical resize -%d<CR>', resize), { desc = "Resize Left" })
+vim.keymap.set('n', '<C-Up>', string.format(':resize -%d<CR>', resize), { desc = "Resize Up" })
+vim.keymap.set('n', '<C-Down>', string.format(':resize +%d<CR>', resize), { desc = "Resize Down" })
+vim.keymap.set('n', '<C-Right>', string.format(':vertical resize +%d<CR>', resize), { desc = "Resize Right" })
+-- Keep selection after < and >
+vim.keymap.set('v', '<', '<gv', {})
+vim.keymap.set('v', '>', '>gv', {})
-
-
-
-
-
+-- todo.lua
+vim.keymap.set('n', '<leader>ft', ':TodoTelescope<cr>', { desc = "[F]ind [T]odos" })
diff --git a/.config/nvim/lua/options.lua b/.config/nvim/lua/options.lua
index 1941a5b..f55703d 100644
--- a/.config/nvim/lua/options.lua
+++ b/.config/nvim/lua/options.lua
@@ -1,47 +1,36 @@
vim.g.mapleader = " "
vim.g.maplocalleader = " "
+-- System
vim.g.have_nerd_font = true
+vim.opt.mouse = 'a' -- enable mouse
+vim.opt.clipboard = 'unnamedplus' -- use system clipboard
--- Remove duplicate mode cuz lualine
-vim.opt.showmode = false
+-- Tab
+vim.opt.expandtab = true -- convert tabs to spaces
+vim.opt.tabstop = 4 -- number of visual spaces per TAB
+vim.opt.softtabstop = 4 -- number of idfk tab when editing
+vim.opt.shiftwidth = 4 -- number of spaces to insert on tab
+-- UI
+vim.opt.signcolumn = 'auto'
vim.opt.number = true
vim.opt.relativenumber = true
-
-vim.opt.expandtab = true
-vim.opt.tabstop = 4
-vim.opt.softtabstop = 4
-vim.opt.shiftwidth = 4
-
-vim.opt.mouse = 'a'
-vim.opt.clipboard = 'unnamedplus'
-
-vim.opt.undofile = true
-
-vim.opt.ignorecase = true
-vim.opt.smartcase = true
-
-vim.opt.signcolumn = 'auto'
-
-vim.opt.updatetime = 250
-
--- Displays which-key sooner, once that's setupped
-vim.opt.timeoutlen = 300
-
+vim.opt.cursorline = true -- highlight current line
vim.opt.splitright = true
vim.opt.splitbelow = true
-
--- vim.opt.list = true
--- vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
-
+vim.opt.showmode = false -- don't show mode, because lualine already does
vim.opt.list = true
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
-vim.opt.cursorline = true
-
-vim.opt.scrolloff = 8
-
+-- Searching
vim.opt.hlsearch = true
+vim.opt.ignorecase = true
+vim.opt.smartcase = true
+-- Misc
+vim.opt.scrolloff = 8
+vim.opt.undofile = true
+vim.opt.updatetime = 250
+vim.opt.timeoutlen = 300 -- Displays which-key sooner, once that's setupped