From 09d70e1bc0bf1e5c54b3faf2918a3e14c4fc4cfc Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Thu, 19 Jun 2025 01:07:18 +0400 Subject: refactor: improve Neovim config for better readability and functionality - Switch to Lua API options for setting vim options instead of vim.cmd - Add autocmd to trim trailing whitespace on save (except markdown) - Disable auto-comments via autocmd for all filetypes - Enhance and standardize key mappings with noremap and silent flags - Clean up plugin config indentation and comments --- config/nvim/lua/plugins.lua | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'config/nvim/lua/plugins.lua') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 911a4d7..7b00b1c 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -33,18 +33,18 @@ require("lazy").setup({ }) require("Comment").setup{ - padding = true, -- Add a space b/w comment and the line - sticky = true, -- Whether the cursor should stay at its position - ignore = nil, -- Lines to be ignored while (un)comment + padding = true, -- Add a space b/w comment and the line + sticky = true, -- Whether the cursor should stay at its position + ignore = nil, -- Lines to be ignored while (un)comment -- LHS of toggle mappings in NORMAL mode toggler = { - line = 'cc', --Line-comment toggle keymap - block = 'cb', -- Block-comment toggle keymap + line = 'cc', --Line-comment toggle keymap + block = 'cb', -- Block-comment toggle keymap }, -- LHS of operator-pending mappings in NORMAL and VISUAL mode opleader = { - line = 'cc', --Line-comment keymap - block = 'cb', --Block-comment keymap + line = 'cc', --Line-comment keymap + block = 'cb', --Block-comment keymap }, } @@ -72,25 +72,21 @@ require("neo-tree").setup({ } } }, - --Indent Markers default_component_configs = { indent = { + --Indent Markers with_markers = true, indent_marker = "│", last_indent_marker = "└", indent_size = 2, - }, - }, - --Expanders - default_component_configs = { - indent = { + -- Expanders with_expanders = false, --Not active expander_collapsed = ">", expander_expanded = "", expander_highlight = "NeoTreeExpander", + }, }, - }) require("nvim-autopairs").setup({ -- cgit v1.2.3