summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuleyman Farajli <suleyman@farajli.net>2025-06-20 17:05:56 +0400
committerSuleyman Farajli <suleyman@farajli.net>2025-06-20 17:05:56 +0400
commitdacb34c4eea34dd626f646f69019e7004b64cb9e (patch)
treed82e086805ba705c636b0c861d8fa566a4749c31
parent9adf7bc6def4378ab70d65222da79e7a74e797db (diff)
refactor(nvim): update keybindings and enable spellcheck for text based file types
- Commented out `vim.opt.list` to hide invisible characters by default - Removed window navigation keybindings (H and L) to avoid terminal issues - Enabled spellcheck for writing-related filetypes (e.g., markdown, gitcommit) - Changed <leader>q to use `wqa!` for saving and quitting all tabs
-rw-r--r--config/nvim/init.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/config/nvim/init.lua b/config/nvim/init.lua
index ea8a3d2..dc96c1a 100644
--- a/config/nvim/init.lua
+++ b/config/nvim/init.lua
@@ -3,7 +3,7 @@ require("plugins")
vim.g.mapleader = ' '
vim.opt.background = "dark"
vim.opt.clipboard = "unnamedplus" -- Use system clipboard
-vim.opt.list = true -- Show spaces, tabs, etc.
+-- vim.opt.list = true -- Show spaces, tabs, etc.
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.shortmess:append("I") -- Disable intro message
@@ -40,16 +40,24 @@ vim.api.nvim_create_autocmd("FileType", {
end,
})
+-- Enable spellcheck for certain file types
+vim.api.nvim_create_autocmd("FileType", {
+ pattern = {
+ "gitcommit", "markdown", "text", "rst",
+ "asciidoc", "org", "norg", "latex", "tex", "mail", "pandoc"
+ },
+ callback = function()
+ vim.opt_local.spell = true
+ end,
+})
-- NOTE: On some terminal emulators, the keybinds
-- <C-j> and <C-k> don't work either in normal or insert mode.
-- Tabs
vim.keymap.set('n', '<C-t>', '<cmd>tabnew<CR>' , { noremap = true, silent = true })
-vim.keymap.set('n', 'H' , '<cmd>wincmd h<CR>', { noremap = true, silent = true })
vim.keymap.set('n', 'J' , '<cmd>tabn<CR>' , { noremap = true, silent = true })
vim.keymap.set('n', 'K' , '<cmd>tabp<CR>' , { noremap = true, silent = true })
-vim.keymap.set('n', 'L' , '<cmd>wincmd l<CR>', { noremap = true, silent = true })
-- Windows
vim.keymap.set('n', '<C-Down>' , '<cmd>split<CR>' , { noremap = true, silent = true })
@@ -71,4 +79,4 @@ vim.keymap.set('n', '<leader>e', '<cmd>Neotree toggle right<CR>', { noremap = tr
-- Other
vim.keymap.set('n', '<leader><leader>', '<cmd>w!<CR>' , { noremap = true, silent = true })
-vim.keymap.set('n', '<leader>q' , '<cmd>wq!<CR>', { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>q' , '<cmd>wqa!<CR>', { noremap = true, silent = true })