From dacb34c4eea34dd626f646f69019e7004b64cb9e Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Fri, 20 Jun 2025 17:05:56 +0400 Subject: 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 q to use `wqa!` for saving and quitting all tabs --- config/nvim/init.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'config/nvim/init.lua') 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 -- and don't work either in normal or insert mode. -- Tabs vim.keymap.set('n', '', 'tabnew' , { noremap = true, silent = true }) -vim.keymap.set('n', 'H' , 'wincmd h', { noremap = true, silent = true }) vim.keymap.set('n', 'J' , 'tabn' , { noremap = true, silent = true }) vim.keymap.set('n', 'K' , 'tabp' , { noremap = true, silent = true }) -vim.keymap.set('n', 'L' , 'wincmd l', { noremap = true, silent = true }) -- Windows vim.keymap.set('n', '' , 'split' , { noremap = true, silent = true }) @@ -71,4 +79,4 @@ vim.keymap.set('n', 'e', 'Neotree toggle right', { noremap = tr -- Other vim.keymap.set('n', '', 'w!' , { noremap = true, silent = true }) -vim.keymap.set('n', 'q' , 'wq!', { noremap = true, silent = true }) +vim.keymap.set('n', 'q' , 'wqa!', { noremap = true, silent = true }) -- cgit v1.2.3