summaryrefslogtreecommitdiff
path: root/nvim
diff options
context:
space:
mode:
Diffstat (limited to 'nvim')
-rw-r--r--nvim/init.lua19
-rw-r--r--nvim/lazy-lock.json10
2 files changed, 23 insertions, 6 deletions
diff --git a/nvim/init.lua b/nvim/init.lua
index 798835d..6276ecd 100644
--- a/nvim/init.lua
+++ b/nvim/init.lua
@@ -9,6 +9,23 @@ vim.o.number = true
vim.o.signcolumn = "yes"
vim.cmd([[colorscheme gruvbox]])
+-- highlights trailing spaces
+vim.cmd('match Search /\\s\\+$/')
+
+-- disable highlight when going into insert mode
+vim.api.nvim_create_autocmd({'ModeChanged'}, {
+ pattern = {'*:i'},
+ command = 'match none',
+})
+
+-- highlights trailing spaces when going back to normal mode
+vim.api.nvim_create_autocmd({'ModeChanged'}, {
+ pattern = {'*:n'},
+ command = 'match Search /\\s\\+$/',
+})
+
+vim.keymap.set('n', '<leader>t', ':%s/\\s\\+$//g<CR>', { noremap = true, silent = true, desc = 'Remove Trailing Whitespaces' })
+
vim.keymap.set('n', '<leader>c', '<C-w>c', { noremap = true, silent = true, desc = 'Close window' })
vim.keymap.set('n', '<leader>o', '<C-w>o', { noremap = true, silent = true, desc = 'Close other windows' })
@@ -28,7 +45,7 @@ vim.keymap.set('n', '<leader>gl', ':Git log<CR>', { noremap = true, silent = tru
vim.keymap.set('n', '<leader>gL', ':0Gclog<CR>', { noremap = true, silent = true, desc = 'Git log: this file' })
vim.keymap.set('n', '<leader>ge', ':Gedit<CR>', { noremap = true, silent = true, desc = 'Git: return to worktree' })
-vim.keymap.set('n', '<leader>e', ':lua MiniFiles.open(vim.api.nvim_buf_get_name(0), false)<CR>', { noremap = true, silent = true, desc = 'Open file tree' })
+vim.keymap.set('n', '<leader>e', ':lua MiniFiles.open(vim.api.nvim_buf_get_name(0), false)<CR>', { noremap = true, silent = true, desc = 'File Explorer' })
vim.keymap.set('n', '<leader>aa', ':argadd<CR>:argdedupe<CR>', { noremap = true, silent = true, desc = 'Add to args' })
vim.keymap.set('n', '<leader>ad', ':argdelete %<CR>', { noremap = true, silent = true, desc = 'Delete from args' })
vim.keymap.set('n', '<leader>lr', ':LspRestart<CR>', { noremap = true, silent = true, desc = 'LSP: restart' })
diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json
index 3b31ae1..532f034 100644
--- a/nvim/lazy-lock.json
+++ b/nvim/lazy-lock.json
@@ -3,17 +3,17 @@
"auto-dark-mode.nvim": { "branch": "master", "commit": "e300259ec777a40b4b9e3c8e6ade203e78d15881" },
"blink.cmp": { "branch": "main", "commit": "451168851e8e2466bc97ee3e026c3dcb9141ce07" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
- "fzf-lua": { "branch": "main", "commit": "8a79ee54d6216d10b2f153921a12b152be0c1a20" },
- "gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" },
+ "fzf-lua": { "branch": "main", "commit": "bde73a6886b607246095aa59f396de5e0d036890" },
+ "gitsigns.nvim": { "branch": "main", "commit": "5310a7f3a97b6de629269f8935691627a076ae4b" },
"gruvbox.nvim": { "branch": "main", "commit": "334d5fd49fc8033f26408425366c66c6390c57bb" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"mini.files": { "branch": "main", "commit": "b4796e09eb103f9f2d1e00aa2dab3753b879b17b" },
"mini.icons": { "branch": "main", "commit": "5b9076dae1bfbe47ba4a14bc8b967cde0ab5d77e" },
- "nvim-lspconfig": { "branch": "master", "commit": "841c6d4139aedb8a3f2baf30cef5327371385b93" },
+ "nvim-lspconfig": { "branch": "master", "commit": "1a6d69206749a646ef28bfb39460610b14baff40" },
"nvim-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" },
- "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
+ "nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" },
"nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" },
- "schemastore.nvim": { "branch": "main", "commit": "cf2b276dc88696b35d55ea4bd55dfaf7d608c9a2" },
+ "schemastore.nvim": { "branch": "main", "commit": "66e53f3316515ac8548b47826f8d273955aa7af1" },
"vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" },
"vim-prettier": { "branch": "master", "commit": "7dbdbb12c50a9f4ba72390cce2846248e4368fd0" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }