From 7fd18eeda9bff733e2fbdeea51aa05d0617903e9 Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 10 Dec 2023 16:57:09 +0100 Subject: [PATCH 01/55] updates default colorscheme to everforest --- init.lua | 2 +- lua/plugin/everforest.lua | 2 +- lua/plugin/gruvbox-material.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 6c2aedb..3646f50 100644 --- a/init.lua +++ b/init.lua @@ -22,7 +22,7 @@ require("lazy").setup({ border = "rounded", }, install = { - colorscheme = { "gruvbox-material" } + colorscheme = { "everforest" } }, }) diff --git a/lua/plugin/everforest.lua b/lua/plugin/everforest.lua index 742b554..1ad91e5 100644 --- a/lua/plugin/everforest.lua +++ b/lua/plugin/everforest.lua @@ -1,7 +1,7 @@ return { { "sainnhe/everforest", - lazy = true, + priority = 1000, config = function() -- Settings for colorscheme vim.api.nvim_set_var("everforest_background", "hard") diff --git a/lua/plugin/gruvbox-material.lua b/lua/plugin/gruvbox-material.lua index fb9148b..00b4076 100644 --- a/lua/plugin/gruvbox-material.lua +++ b/lua/plugin/gruvbox-material.lua @@ -1,7 +1,7 @@ return { { "sainnhe/gruvbox-material", - priority = 1000, + lazy = true, config = function() -- Settings for colorscheme vim.api.nvim_set_var("gruvbox_material_background", "hard") From db85bcfc3377aa6bd289d778c67d290f22bb3ddb Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 10 Dec 2023 18:52:19 +0100 Subject: [PATCH 02/55] updates colorscheme settings --- lua/plugin/bufferline.lua | 3 +-- lua/plugin/everforest.lua | 36 ++++++++++++++++++------------------ lua/plugin/lualine.lua | 2 +- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/lua/plugin/bufferline.lua b/lua/plugin/bufferline.lua index b13e1bc..b9b3934 100644 --- a/lua/plugin/bufferline.lua +++ b/lua/plugin/bufferline.lua @@ -17,8 +17,7 @@ return { }, highlights = { buffer_selected = { - fg = "#d8a657", - bg = "#141617", + fg = "#dfa000", }, }, }) diff --git a/lua/plugin/everforest.lua b/lua/plugin/everforest.lua index 1ad91e5..f7b5e0d 100644 --- a/lua/plugin/everforest.lua +++ b/lua/plugin/everforest.lua @@ -16,8 +16,8 @@ return { -- Settings to override colorscheme -- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"}) -- colors of tabline - vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) + vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) -- color of statusline vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) @@ -25,22 +25,22 @@ return { -- color of vertical split line vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#2d353b" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dfa000" }) -- color of Floats and FloatBorders vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) -- autocommand for overrides vim.api.nvim_create_autocmd("ColorScheme", { pattern = "everforest", callback = function() - vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) + vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) -- color of statusline vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) @@ -48,15 +48,15 @@ return { -- color of vertical split line vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#2d353b" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dfa000" }) -- color of Floats and FloatBorders vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) end, }) end, diff --git a/lua/plugin/lualine.lua b/lua/plugin/lualine.lua index 96ff0d4..a2574b6 100644 --- a/lua/plugin/lualine.lua +++ b/lua/plugin/lualine.lua @@ -50,7 +50,7 @@ return { }, { 'fileformat', - color = {gui = 'italic'}, + color = {gui = 'italic', bg = '#141617'}, symbols = { unix = '(unix)', dos = '(dos)', From 7e5c846bc478c56be413477b4255282cf3951eab Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 10 Dec 2023 19:31:07 +0100 Subject: [PATCH 03/55] fixes description in telescope --- lua/plugin/telescope.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugin/telescope.lua b/lua/plugin/telescope.lua index 724261a..a698477 100644 --- a/lua/plugin/telescope.lua +++ b/lua/plugin/telescope.lua @@ -12,9 +12,9 @@ return { { "fb", "Telescope current_buffer_fuzzy_find", desc = "Find Strings in current Buffer" }, { "fg", "Telescope live_grep", desc = "Grep Content in Files" }, { "/", "Telescope live_grep", desc = "Grep Content in Files" }, - { "fl", "Telescope grep_string", desc = "Grep currently hovered String" }, + { "fl", "Telescope grep_string", desc = "Grep currently hovered String" }, { "fG", "Telescope git_files", desc = "Find Git Files" }, - { "fk", "Telescope keymaps", desc = "Find Git Files" }, + { "fk", "Telescope keymaps", desc = "List Keymaps" }, { "fr", "Telescope oldfiles", desc = "Find Recent Files" }, }, }, From b21a66b5386595de53a013cf903ea55ef9f9fa39 Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 10 Dec 2023 20:01:00 +0100 Subject: [PATCH 04/55] changes colors and icons back to working state --- lua/plugin/lspconfig.lua | 10 ++++------ lua/plugin/nvim-cmp.lua | 16 ++++++++-------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lua/plugin/lspconfig.lua b/lua/plugin/lspconfig.lua index d676f62..9f6eb4c 100644 --- a/lua/plugin/lspconfig.lua +++ b/lua/plugin/lspconfig.lua @@ -4,7 +4,7 @@ return { -- event = "BufReadPre", config = function() require('lspconfig.ui.windows').default_options.border = 'rounded' - vim.api.nvim_set_hl(0, "LspInfoBorder", { bg = none, fg = "#d4be98" }) + vim.api.nvim_set_hl(0, "LspInfoBorder", { bg = none, fg = "#9da9a0" }) local opts = { noremap = true, silent = true } vim.keymap.set('n', 'cd', vim.diagnostic.open_float, opts) vim.keymap.set('n', 'cl', "LspInfo", opts) @@ -38,9 +38,7 @@ return { vim.keymap.set('v', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) end - local signs = { Error = "✘ ", Warn = " ", Hint = " ", Info = " " } - -- local signs = { Error = "✘ ", Warn = " ", Hint = " ", Info = " " } - -- local signs = { Error = "✘ ", Warn = "⚠ ", Hint = " ", Info = " " } -- Unicode + local signs = { Error = "󰈸 ", Warn = " ", Hint = "󰌶 ", Info = " " } for type, icon in pairs(signs) do local hl = "DiagnosticSign" .. type vim.fn.sign_define(hl, { text = icon, texthl = hl }) @@ -63,7 +61,7 @@ return { virtual_text = { prefix = '●', -- Could be '●', '■', 'x', '▎' }, - update_in_insert = true + update_in_insert = true, }) -- LSP settings (for overriding per client) @@ -83,7 +81,7 @@ return { icons = { package_installed = "✔", package_pending = "➜", - package_uninstalled = "✘" + package_uninstalled = "✗" } } }) diff --git a/lua/plugin/nvim-cmp.lua b/lua/plugin/nvim-cmp.lua index 4f078f9..9a5d422 100644 --- a/lua/plugin/nvim-cmp.lua +++ b/lua/plugin/nvim-cmp.lua @@ -8,14 +8,14 @@ return { "rafamadriz/friendly-snippets", config = function() require("luasnip.loaders.from_vscode").lazy_load() - vim.api.nvim_set_hl(0, "PmenuSel", { fg = 'NONE', bg = '#141617' }) - vim.api.nvim_set_hl(0, "Pmenu", { fg = 'NONE', bg = '#1d2021' }) - vim.api.nvim_set_hl(0, "CmpItemMenu", { fg = 'NONE', bg = '#141617' }) - vim.api.nvim_set_hl(0, "CmpItemMenuDefault", { fg = 'NONE', bg = '#141617' }) - vim.api.nvim_set_hl(0, "CmpItemKindFunction", { fg = '#d3869b', bg = 'NONE', italic = true }) - vim.api.nvim_set_hl(0, "CmpItemKindSnippet", { fg = '#d8a657', bg = 'NONE', italic = true }) - vim.api.nvim_set_hl(0, "CmpItemKindText", { fg = '#ddc7a1', bg = 'NONE', italic = true }) - vim.api.nvim_set_hl(0, "CmpItemKindVariable", { fg = '#7daea3', bg = 'NONE', italic = true }) + vim.api.nvim_set_hl(0, "PmenuSel", { fg = 'NONE', bg = '#272e33' }) + vim.api.nvim_set_hl(0, "Pmenu", { fg = 'NONE', bg = '#1e2326' }) + vim.api.nvim_set_hl(0, "CmpItemMenu", { fg = 'NONE', bg = '#272e33' }) + vim.api.nvim_set_hl(0, "CmpItemMenuDefault", { fg = 'NONE', bg = '#272e33' }) + vim.api.nvim_set_hl(0, "CmpItemKindFunction", { fg = '#d699b6', bg = 'NONE', italic = true }) + vim.api.nvim_set_hl(0, "CmpItemKindSnippet", { fg = '#dbbc7f', bg = 'NONE', italic = true }) + vim.api.nvim_set_hl(0, "CmpItemKindText", { fg = '#9da9a0', bg = 'NONE', italic = true }) + vim.api.nvim_set_hl(0, "CmpItemKindVariable", { fg = '#7fbbb3', bg = 'NONE', italic = true }) end, }, }, From 007ba4db83113208b9bc1db895174cd4efc461ef Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 17 Dec 2023 13:59:08 +0100 Subject: [PATCH 05/55] fix broken icon --- lua/plugin/lualine.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugin/lualine.lua b/lua/plugin/lualine.lua index a2574b6..ba98349 100644 --- a/lua/plugin/lualine.lua +++ b/lua/plugin/lualine.lua @@ -64,7 +64,7 @@ return { 'diagnostics', color = { gui = 'bold', bg = '#141617' }, sections = { 'error', 'warn', 'info', 'hint' }, - symbols = { error = "✘ ", warn = " ", info = " ", hint = "󰌶 " }, + symbols = { error = "󰈸 ", warn = " ", info = " ", hint = "󰌶 " }, padding = 1, update_in_insert = true }, From 1099c2772d6c8b36d5b0736454f0193318b9ecb6 Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 24 Dec 2023 01:00:01 +0100 Subject: [PATCH 06/55] updates plugins --- lua/core/autocmd.lua | 5 ----- lua/core/statusline.lua | 2 +- lua/plugin/bufferline.lua | 26 -------------------------- lua/plugin/fugitive.lua | 33 +++++++++++++++++---------------- lua/plugin/gitsigns.lua | 15 ++------------- lua/plugin/surround.lua | 20 -------------------- lua/plugin/telescope.lua | 36 ++++++++++++++++++------------------ lua/plugin/todo-comments.lua | 11 ----------- lua/plugin/trouble.lua | 13 ------------- 9 files changed, 38 insertions(+), 123 deletions(-) delete mode 100644 lua/plugin/bufferline.lua delete mode 100644 lua/plugin/surround.lua delete mode 100644 lua/plugin/todo-comments.lua delete mode 100644 lua/plugin/trouble.lua diff --git a/lua/core/autocmd.lua b/lua/core/autocmd.lua index e7ba79f..4e0cbd2 100644 --- a/lua/core/autocmd.lua +++ b/lua/core/autocmd.lua @@ -6,8 +6,3 @@ vim.api.nvim_create_autocmd("Filetype", { pattern = "*", command = "setlocal formatoptions-=c formatoptions-=r formatoptions-=o" }) - -vim.api.nvim_create_autocmd("FocusLost", { - pattern = "*", - command = ":wa" -}) diff --git a/lua/core/statusline.lua b/lua/core/statusline.lua index 9672388..0912228 100644 --- a/lua/core/statusline.lua +++ b/lua/core/statusline.lua @@ -4,4 +4,4 @@ vim.api.nvim_set_option("statusline", " ") -- tabline -- always show tabline (0 = never, 1 = only with at least 2 tabs, 2 = always) and colors -vim.api.nvim_set_option("showtabline", 2) +vim.api.nvim_set_option("showtabline", 1) diff --git a/lua/plugin/bufferline.lua b/lua/plugin/bufferline.lua deleted file mode 100644 index b9b3934..0000000 --- a/lua/plugin/bufferline.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - { - "akinsho/bufferline.nvim", - config = function() - require("bufferline").setup({ - options = { - offsets = { - { - filetype = "netrw", - text = "File Explorer", - highlight = "Directory", - text_align = 'center', - separator = true - } - }, - show_buffer_close_icons = false, - }, - highlights = { - buffer_selected = { - fg = "#dfa000", - }, - }, - }) - end, - } -} diff --git a/lua/plugin/fugitive.lua b/lua/plugin/fugitive.lua index cd5bdbb..5d9ada6 100644 --- a/lua/plugin/fugitive.lua +++ b/lua/plugin/fugitive.lua @@ -1,18 +1,19 @@ return { - { - 'tpope/vim-fugitive', - keys = { - { "GG", "Git ", desc = "git" }, - { "Gs", "Git status ", desc = "git status" }, - { "Gd", "Git diff ", desc = "git diff" }, - { "GD", "Git diff --staged ", desc = "git diff --staged" }, - { "Gl", "Git log --graph ", desc = "git log --graph" }, - { "Ga", "Git add --interactive ", desc = "git add" }, - { "GA", "Git add -A ", desc = "git add -A " }, - { "Gc", "Git commit ", desc = "git commit" }, - { "GC", "Git commit --amend ", desc = "git commit --amend " }, - { "Gp", "Git push ", desc = "git push" }, - { "GP", "Git pull ", desc = "git pull" }, - }, - } + { + 'tpope/vim-fugitive', + keys = { + { "gG", "Git ", desc = "git" }, + { "gs", "Git status ", desc = "git status" }, + { "gd", "Git diff ", desc = "git diff" }, + { "gD", "Git diff --staged ", desc = "git diff --staged" }, + { "gl", "Git log --graph ", desc = "git log --graph" }, + { "ga", "Git add --interactive ", desc = "git add" }, + { "gA", "Git add -A ", desc = "git add -A " }, + { "gc", "Git commit ", desc = "git commit" }, + { "gC", "Git commit --amend ", desc = "git commit --amend " }, + { "gCN", "Git commit --amend --no-edit ", desc = "git commit --amend " }, + { "gp", "Git push ", desc = "git push" }, + { "gP", "Git pull ", desc = "git pull" }, + }, + } } diff --git a/lua/plugin/gitsigns.lua b/lua/plugin/gitsigns.lua index 9b63384..60c83ab 100644 --- a/lua/plugin/gitsigns.lua +++ b/lua/plugin/gitsigns.lua @@ -30,20 +30,9 @@ return { end, { expr = true }) -- Actions - map({ 'n', 'v' }, 'hs', ':Gitsigns stage_hunk') - map({ 'n', 'v' }, 'hr', ':Gitsigns reset_hunk') - map('n', 'hS', gs.stage_buffer) - map('n', 'hu', gs.undo_stage_hunk) - map('n', 'hR', gs.reset_buffer) - map('n', 'hp', gs.preview_hunk) - map('n', 'hb', function() gs.blame_line { full = true } end) - map('n', 'tb', gs.toggle_current_line_blame) - map('n', 'hd', gs.diffthis) - map('n', 'hD', function() gs.diffthis('~') end) - map('n', 'td', gs.toggle_deleted) + map('n', 'gB', function() gs.blame_line { full = true } end) + map('n', 'gb', gs.toggle_current_line_blame) - -- Text object - map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk') end }) end, diff --git a/lua/plugin/surround.lua b/lua/plugin/surround.lua deleted file mode 100644 index 6bf538e..0000000 --- a/lua/plugin/surround.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - { - "echasnovski/mini.surround", - event = "VeryLazy", - opts = { - mappings = { - add = "sa", - delete = "sd", - find = "sf", - find_left = "sF", - highlight = "sh", - replace = "sr", - update_n_lines = "sn", - }, - }, - config = function(_, opts) - require("mini.surround").setup(opts) - end, - } -} diff --git a/lua/plugin/telescope.lua b/lua/plugin/telescope.lua index a698477..13f2b15 100644 --- a/lua/plugin/telescope.lua +++ b/lua/plugin/telescope.lua @@ -1,21 +1,21 @@ return { - { - "nvim-telescope/telescope.nvim", - lazy = true, - cmd = "Telescope", - version = false, - keys = { - { ":", "Telescope command_history", desc = "Command History" }, - { ",", "Telescope buffers show_all_buffers=true", desc = "Switch Buffer" }, - -- find - { "ff", "Telescope find_files", desc = "Find Files" }, - { "fb", "Telescope current_buffer_fuzzy_find", desc = "Find Strings in current Buffer" }, - { "fg", "Telescope live_grep", desc = "Grep Content in Files" }, - { "/", "Telescope live_grep", desc = "Grep Content in Files" }, - { "fl", "Telescope grep_string", desc = "Grep currently hovered String" }, - { "fG", "Telescope git_files", desc = "Find Git Files" }, - { "fk", "Telescope keymaps", desc = "List Keymaps" }, - { "fr", "Telescope oldfiles", desc = "Find Recent Files" }, - }, + { + "nvim-telescope/telescope.nvim", + lazy = true, + cmd = "Telescope", + version = false, + keys = { + { ":", "Telescope command_history", desc = "Command History" }, + { ",", "Telescope buffers show_all_buffers=true", desc = "Switch Buffer" }, + -- find + { "ff", "Telescope find_files", desc = "Find Files" }, + { "fb", "Telescope current_buffer_fuzzy_find", desc = "Find Strings in current Buffer" }, + { "fg", "Telescope live_grep", desc = "Grep Content in Files" }, + { "/", "Telescope live_grep", desc = "Grep Content in Files" }, + { "fh", "Telescope grep_string", desc = "Grep currently hovered String" }, + { "fG", "Telescope git_files", desc = "Find Git Files" }, + { "fk", "Telescope keymaps", desc = "List Keymaps" }, + { "fr", "Telescope oldfiles", desc = "Find Recent Files" }, }, + }, } diff --git a/lua/plugin/todo-comments.lua b/lua/plugin/todo-comments.lua deleted file mode 100644 index 7e9149a..0000000 --- a/lua/plugin/todo-comments.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - { - "folke/todo-comments.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - } - } -} diff --git a/lua/plugin/trouble.lua b/lua/plugin/trouble.lua deleted file mode 100644 index 25ef1bd..0000000 --- a/lua/plugin/trouble.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - "folke/trouble.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - opts = {}, - config = function() - vim.keymap.set("n", "xx", function() require("trouble").toggle() end) - vim.keymap.set("n", "xw", function() require("trouble").toggle("workspace_diagnostics") end) - vim.keymap.set("n", "xd", function() require("trouble").toggle("document_diagnostics") end) - vim.keymap.set("n", "xq", function() require("trouble").toggle("quickfix") end) - vim.keymap.set("n", "xl", function() require("trouble").toggle("loclist") end) - vim.keymap.set("n", "gr", function() require("trouble").open("lsp_references") end) - end -} From b95c8cf16198de118c126cdc7766e83a764ca75f Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 24 Dec 2023 01:04:45 +0100 Subject: [PATCH 07/55] removes confusing keymap --- lua/core/remap.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index fdf942e..f7c6f14 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -18,7 +18,6 @@ vim.api.nvim_set_keymap("n", "", "l", {}) -- buffer operations vim.api.nvim_set_keymap("n", "", "", {}) -vim.api.nvim_set_keymap("n", "on", "w %bd e#", {}) vim.api.nvim_set_keymap("n", "bd", "bd", {}) vim.api.nvim_set_keymap("n", "", "bprevious", {}) vim.api.nvim_set_keymap("n", "", "bnext", {}) From 5af52408148027ebd49d1b4266ebd46285dd79dd Mon Sep 17 00:00:00 2001 From: xesc Date: Tue, 2 Jan 2024 08:05:14 +0100 Subject: [PATCH 08/55] adds harpoon plugin --- lua/plugin/harpoon.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lua/plugin/harpoon.lua diff --git a/lua/plugin/harpoon.lua b/lua/plugin/harpoon.lua new file mode 100644 index 0000000..e73c6da --- /dev/null +++ b/lua/plugin/harpoon.lua @@ -0,0 +1,26 @@ +return { + { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { + "nvim-lua/plenary.nvim", + lazy = true, + }, + config = function() + local harpoon = require("harpoon") + harpoon:setup() + + vim.keymap.set("n", "a", function() harpoon:list():append() end) + vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + + vim.keymap.set("n", "n", function() harpoon:list():select(1) end) + vim.keymap.set("n", "e", function() harpoon:list():select(2) end) + vim.keymap.set("n", "i", function() harpoon:list():select(3) end) + vim.keymap.set("n", "o", function() harpoon:list():select(4) end) + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set("n", "", function() harpoon:list():prev() end) + vim.keymap.set("n", "", function() harpoon:list():next() end) + end + } +} From e11096c0715ce8ef29be7e315a1732409406af58 Mon Sep 17 00:00:00 2001 From: xesc Date: Sat, 20 Jan 2024 13:31:34 +0100 Subject: [PATCH 09/55] adds trouble.nvim plugin --- lua/plugin/trouble.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lua/plugin/trouble.lua diff --git a/lua/plugin/trouble.lua b/lua/plugin/trouble.lua new file mode 100644 index 0000000..9cfa8ad --- /dev/null +++ b/lua/plugin/trouble.lua @@ -0,0 +1,10 @@ +return { + { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = { + use_diagnostic_signs = true, + vim.keymap.set("n", "T", function() require("trouble").toggle() end), + }, + } +} From 3d7e4b5e48b86ff942ed9ccec903a12f077bf60c Mon Sep 17 00:00:00 2001 From: xesc Date: Sat, 20 Jan 2024 21:24:39 +0100 Subject: [PATCH 10/55] adds zenmode --- lua/plugin/zen.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lua/plugin/zen.lua diff --git a/lua/plugin/zen.lua b/lua/plugin/zen.lua new file mode 100644 index 0000000..dcee5d2 --- /dev/null +++ b/lua/plugin/zen.lua @@ -0,0 +1,21 @@ +return { + { + "folke/zen-mode.nvim", + opts = { + window = { + backdrop = 1, + width = 90, + }, + plugins = { + options = { + enabled = true, + ruler = true, + showcmd = true, + laststatus = 3, + }, + gitsigns = { enabled = false } + }, + vim.keymap.set("n", "zz", function() require("zen-mode").toggle() end), + }, + } +} From 14c8746a1fe7ef59ba954d306114f03016127ef9 Mon Sep 17 00:00:00 2001 From: xesc Date: Mon, 29 Jan 2024 23:04:43 +0100 Subject: [PATCH 11/55] adds lspsaga --- lua/plugin/lspconfig.lua | 70 ++++++++++++++++++++++++++++++++++++++-- lua/plugin/lualine.lua | 35 ++++++++++++-------- lua/plugin/none-ls.lua | 5 +-- 3 files changed, 91 insertions(+), 19 deletions(-) diff --git a/lua/plugin/lspconfig.lua b/lua/plugin/lspconfig.lua index 9f6eb4c..ab7b2d9 100644 --- a/lua/plugin/lspconfig.lua +++ b/lua/plugin/lspconfig.lua @@ -21,7 +21,6 @@ return { local bufopts = { noremap = true, silent = true, buffer = bufnr } vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) - vim.keymap.set('n', 'k', vim.lsp.buf.hover, bufopts) vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) -- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) vim.keymap.set('n', 'gK', vim.lsp.buf.signature_help, bufopts) @@ -32,8 +31,6 @@ return { print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, bufopts) vim.keymap.set('n', 'gt', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', 'cw', vim.lsp.buf.rename, bufopts) - vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) vim.keymap.set('n', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) vim.keymap.set('v', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) end @@ -70,6 +67,73 @@ return { end, }, + { + 'nvimdev/lspsaga.nvim', + event = 'LspAttach', + config = function() + require('lspsaga').setup({ + symbol_in_winbar = { + enable = false, + show_file = false + }, + finder = { + keys = { + toggle_or_open = "", + quit = {'', 'q'} + } + }, + outline = { + win_position = 'left', + win_width = 45, + }, + lightbulb = { + enable = false + }, + ui = { + code_action = '󰌶 ' + }, + rename = { + in_select = false, + keys = { + quit = {'', 'q'}, + select = '' + } + }, + hover_doc = { + open_cmd = '!firefox' + }, + code_action = { + keys = { + quit = {'', 'q'} + } + }, + definition = { + keys = { + quit = {'', 'q'}, + }, + } + }) + + vim.keymap.set('n', '', "Lspsaga term_toggle", opts) + vim.keymap.set('t', '', "Lspsaga term_toggle", opts) + vim.keymap.set('n', 'cw', 'Lspsaga rename mode=n', opts) + vim.keymap.set('n', 'so', 'Lspsaga outline', opts) + vim.keymap.set('n', 'sf', 'Lspsaga finder', opts) + vim.keymap.set('n', 'sci', 'Lspsaga incoming_calls', opts) + vim.keymap.set('n', 'sco', 'Lspsaga outgoing_calls', opts) + vim.keymap.set('n', 'k', 'Lspsaga hover_doc', bufopts) + vim.keymap.set('n', 'K', 'Lspsaga hover_doc', bufopts) + vim.keymap.set('n', 'ca', 'Lspsaga code_action', bufopts) + vim.keymap.set('n', 'sd', 'Lspsaga peek_definition', bufopts) + vim.keymap.set('n', 'st', 'Lspsaga peek_type_definition', bufopts) + + end, + depedencies = { + 'nvim-treesitter/nvim-treesitter', + 'nvim-tree/nvim-web-devicons' + }, + }, + { "williamboman/mason.nvim", lazy = true, diff --git a/lua/plugin/lualine.lua b/lua/plugin/lualine.lua index ba98349..b84ba4d 100644 --- a/lua/plugin/lualine.lua +++ b/lua/plugin/lualine.lua @@ -5,10 +5,14 @@ return { vim.api.nvim_set_option("showmode", false) local custom_gruvbox = require 'lualine.themes.gruvbox-material' custom_gruvbox.normal.a.bg = '#89b482' - custom_gruvbox.normal.c.bg = '#141617' + custom_gruvbox.normal.c.bg = '' custom_gruvbox.insert.a.bg = '#d8a657' custom_gruvbox.visual.a.bg = '#a9b665' custom_gruvbox.replace.a.bg = '#ea6962' + + local function lspsaga() + return require('lspsaga.symbol.winbar').get_bar() + end require('lualine').setup { options = { theme = custom_gruvbox, @@ -29,15 +33,18 @@ return { icon = '', color = { fg = '#d8a657', bg = '#141617', gui = 'bold' }, padding = 1, - } + }, + { + 'filename', + color = { gui = 'italic', fg = '#d3869b', bg = '#1d2021' }, + padding = 1, + path = 1, + }, }, lualine_c = { - { - 'filename', - color = { gui = 'italic', fg = '#d3869b', bg = '#1d2021' }, - padding = 1, - path = 1, - } + { + lspsaga + } }, lualine_x = { { @@ -95,14 +102,14 @@ return { 'branch', icon = '', padding = 1, - } + }, + { + 'filename', + padding = 1, + path = 1, + } }, lualine_c = { - { - 'filename', - padding = 1, - path = 1, - } }, lualine_x = { { diff --git a/lua/plugin/none-ls.lua b/lua/plugin/none-ls.lua index 22443ff..ff9f440 100644 --- a/lua/plugin/none-ls.lua +++ b/lua/plugin/none-ls.lua @@ -32,8 +32,9 @@ return { vim.keymap.set('n', 'k', vim.lsp.buf.hover, bufopts) vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) vim.keymap.set('n', 'gt', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', 'cw', vim.lsp.buf.rename, bufopts) - vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) + vim.keymap.set('n', 'cw', "Lspsaga rename mode=n", bufopts) + -- vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) + vim.keymap.set('n', 'ca', 'Lspsaga code_action', bufopts) -- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) vim.keymap.set('n', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) vim.keymap.set('v', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) From 68796d499e5cd60c82d084090ac116ac4fe813e3 Mon Sep 17 00:00:00 2001 From: xesc Date: Tue, 30 Jan 2024 21:30:20 +0100 Subject: [PATCH 12/55] restucture lsp-setup --- lua/plugin/lspconfig.lua | 378 ++++++++++++++++++++++----------------- lua/plugin/none-ls.lua | 60 ------- 2 files changed, 214 insertions(+), 224 deletions(-) delete mode 100644 lua/plugin/none-ls.lua diff --git a/lua/plugin/lspconfig.lua b/lua/plugin/lspconfig.lua index ab7b2d9..5cfc508 100644 --- a/lua/plugin/lspconfig.lua +++ b/lua/plugin/lspconfig.lua @@ -1,179 +1,229 @@ return { - { - "neovim/nvim-lspconfig", - -- event = "BufReadPre", - config = function() - require('lspconfig.ui.windows').default_options.border = 'rounded' - vim.api.nvim_set_hl(0, "LspInfoBorder", { bg = none, fg = "#9da9a0" }) - local opts = { noremap = true, silent = true } - vim.keymap.set('n', 'cd', vim.diagnostic.open_float, opts) - vim.keymap.set('n', 'cl', "LspInfo", opts) - vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) - vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) - -- vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) + { + "neovim/nvim-lspconfig", + -- event = "BufReadPre", + config = function() + require('lspconfig.ui.windows').default_options.border = 'rounded' + vim.api.nvim_set_hl(0, "LspInfoBorder", { bg = none, fg = "#9da9a0" }) + local opts = { noremap = true, silent = true } + vim.keymap.set('n', 'cd', vim.diagnostic.open_float, opts) + vim.keymap.set('n', 'cl', "LspInfo", opts) + vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) + vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) + -- vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) - local on_attach = function(client, bufnr) - -- enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + local on_attach = function(client, bufnr) + -- enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + end + local signs = { Error = "󰈸 ", Warn = " ", Hint = "󰌶 ", Info = " " } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl }) + end - -- Mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - local bufopts = { noremap = true, silent = true, buffer = bufnr } - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) - -- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', 'gK', vim.lsp.buf.signature_help, bufopts) - vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) - vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) - vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) - vim.keymap.set('n', 'wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, bufopts) - vim.keymap.set('n', 'gt', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) - vim.keymap.set('v', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) - end + local border = { + { "╭", "FloatBorder" }, + { "─", "FloatBorder" }, + { "╮", "FloatBorder" }, + { "│", "FloatBorder" }, + { "╯", "FloatBorder" }, + { "─", "FloatBorder" }, + { "╰", "FloatBorder" }, + { "│", "FloatBorder" }, + } - local signs = { Error = "󰈸 ", Warn = " ", Hint = "󰌶 ", Info = " " } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl }) - end + vim.diagnostic.config({ + float = { border = border }, + virtual_text = { + prefix = '●', -- Could be '●', '■', 'x', '▎', or anything else + }, + update_in_insert = true, + }) + -- LSP settings (for overriding per client) + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border }) + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signatureHelp, { border = border }) + end, + }, - local border = { - { "╭", "FloatBorder" }, - { "─", "FloatBorder" }, - { "╮", "FloatBorder" }, - { "│", "FloatBorder" }, - { "╯", "FloatBorder" }, - { "─", "FloatBorder" }, - { "╰", "FloatBorder" }, - { "│", "FloatBorder" }, - } + -- pretty ui + { + 'nvimdev/lspsaga.nvim', + event = 'LspAttach', + config = function() + require('lspsaga').setup({ + symbol_in_winbar = { + enable = false, + show_file = false + }, + finder = { + keys = { + toggle_or_open = "", + quit = { '', 'q' } + } + }, + outline = { + win_position = 'left', + win_width = 45, + }, + lightbulb = { + enable = false + }, + ui = { + code_action = '󰌶', + border = 'rounded', + }, + rename = { + in_select = false, + keys = { + quit = { '', 'q' }, + select = '' + } + }, + hover_doc = { + open_cmd = '!firefox' + }, + code_action = { + keys = { + quit = { '', 'q' } + }, + extend_gitsigns = false, + }, + definition = { + keys = { + quit = { '', 'q' }, + }, + }, + diagnostic = { + border_follow = false, + extend_relatedInformation = true, + keys = { + quit = { '', 'q' }, + quit_in_show = { '', 'q' }, + } + } + }) - vim.diagnostic.config({ - float = { border = border }, - virtual_text = { - prefix = '●', -- Could be '●', '■', 'x', '▎' - }, - update_in_insert = true, - }) - - -- LSP settings (for overriding per client) - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border }) - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signatureHelp, { border = border }) - end, + vim.keymap.set('n', '', "Lspsaga term_toggle", opts) + vim.keymap.set('t', '', "Lspsaga term_toggle", opts) + vim.keymap.set('n', 'cw', 'Lspsaga rename mode=n', opts) + vim.keymap.set('n', 'so', 'Lspsaga outline', opts) + vim.keymap.set('n', 'sf', 'Lspsaga finder', opts) + vim.keymap.set('n', 'sci', 'Lspsaga incoming_calls', opts) + vim.keymap.set('n', 'sco', 'Lspsaga outgoing_calls', opts) + vim.keymap.set('n', 'k', 'Lspsaga hover_doc', bufopts) + vim.keymap.set('n', 'K', 'Lspsaga hover_doc', bufopts) + vim.keymap.set('n', 'ca', 'Lspsaga code_action', bufopts) + vim.keymap.set('n', 'sd', 'Lspsaga peek_definition', bufopts) + vim.keymap.set('n', 'st', 'Lspsaga peek_type_definition', bufopts) + vim.keymap.set('n', 'cw', "Lspsaga rename mode=n", bufopts) + vim.keymap.set('n', 'ca', 'Lspsaga code_action', bufopts) + vim.keymap.set('n', '[e', 'Lspsaga diagnostic_jump_next', bufopts) + vim.keymap.set('n', ']e', 'Lspsaga diagnostic_jump_prev', bufopts) + end, + depedencies = { + 'nvim-treesitter/nvim-treesitter', + 'nvim-tree/nvim-web-devicons' }, + }, - { - 'nvimdev/lspsaga.nvim', - event = 'LspAttach', - config = function() - require('lspsaga').setup({ - symbol_in_winbar = { - enable = false, - show_file = false - }, - finder = { - keys = { - toggle_or_open = "", - quit = {'', 'q'} + { + "williamboman/mason.nvim", + lazy = true, + cmd = "Mason", + config = function() + require("mason").setup({ + ui = { + border = "rounded", + icons = { + package_installed = "✔", + package_pending = "➜", + package_uninstalled = "✗" + } + } + }) + end, + }, + + { + "williamboman/mason-lspconfig.nvim", + -- event = "BufReadPre", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "clangd", + } + }) + + require("mason-lspconfig").setup_handlers { + -- The first entry (without a key) will be the default handler + -- and will be called for each installed server that doesn't have + -- a dedicated handler. + function(server_name) -- default handler (optional) + require("lspconfig")[server_name].setup { + on_attach = on_attach, + handlers = handlers, + } + end, + } + end, + }, + { + "nvimtools/none-ls.nvim", + -- event = "BufReadPost", + dependencies = { + { + "nvim-telescope/telescope-ui-select.nvim", + lazy = true, + config = function() + -- This is your opts table + require("telescope").setup { + extensions = { + ["ui-select"] = { + -- require("telescope.themes").get_dropdown { + -- -- even more opts + -- } } - }, - outline = { - win_position = 'left', - win_width = 45, - }, - lightbulb = { - enable = false - }, - ui = { - code_action = '󰌶 ' - }, - rename = { - in_select = false, - keys = { - quit = {'', 'q'}, - select = '' - } - }, - hover_doc = { - open_cmd = '!firefox' - }, - code_action = { - keys = { - quit = {'', 'q'} - } - }, - definition = { - keys = { - quit = {'', 'q'}, - }, } - }) - - vim.keymap.set('n', '', "Lspsaga term_toggle", opts) - vim.keymap.set('t', '', "Lspsaga term_toggle", opts) - vim.keymap.set('n', 'cw', 'Lspsaga rename mode=n', opts) - vim.keymap.set('n', 'so', 'Lspsaga outline', opts) - vim.keymap.set('n', 'sf', 'Lspsaga finder', opts) - vim.keymap.set('n', 'sci', 'Lspsaga incoming_calls', opts) - vim.keymap.set('n', 'sco', 'Lspsaga outgoing_calls', opts) - vim.keymap.set('n', 'k', 'Lspsaga hover_doc', bufopts) - vim.keymap.set('n', 'K', 'Lspsaga hover_doc', bufopts) - vim.keymap.set('n', 'ca', 'Lspsaga code_action', bufopts) - vim.keymap.set('n', 'sd', 'Lspsaga peek_definition', bufopts) - vim.keymap.set('n', 'st', 'Lspsaga peek_type_definition', bufopts) - - end, - depedencies = { - 'nvim-treesitter/nvim-treesitter', - 'nvim-tree/nvim-web-devicons' + } + require("telescope").load_extension("ui-select") + end, }, }, - - { - "williamboman/mason.nvim", - lazy = true, - cmd = "Mason", - config = function() - require("mason").setup({ - ui = { - border = "rounded", - icons = { - package_installed = "✔", - package_pending = "➜", - package_uninstalled = "✗" - } - } - }) + opts = function() + local null_ls = require('null-ls') + return { + border = 'rounded', + on_attach = function(client, bufnr) + local bufopts = { noremap = true, silent = true, buffer = bufnr } + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) + vim.keymap.set('n', 'gt', vim.lsp.buf.type_definition, bufopts) + vim.keymap.set('n', 'cA', vim.lsp.buf.code_action, bufopts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) + vim.keymap.set('n', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) + vim.keymap.set('v', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) end, - }, - - { - "williamboman/mason-lspconfig.nvim", - -- event = "BufReadPre", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { - "lua_ls", - "clangd", - } - }) - - require("mason-lspconfig").setup_handlers { - -- The first entry (without a key) will be the default handler - -- and will be called for each installed server that doesn't have - -- a dedicated handler. - function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup { - on_attach = on_attach, - handlers = handlers, - } - end, - } - end, - }, + sources = { + null_ls.builtins.diagnostics.trail_space.with { + disabled_filetypes = { "lua" } + }, + null_ls.builtins.diagnostics.shellcheck, + null_ls.builtins.code_actions.shellcheck, + null_ls.builtins.formatting.jq, + null_ls.builtins.code_actions.gitsigns, + null_ls.builtins.diagnostics.flake8, + null_ls.builtins.diagnostics.yamllint, + null_ls.builtins.formatting.yamlfmt, + null_ls.builtins.formatting.shfmt, + null_ls.builtins.formatting.shellharden, + null_ls.builtins.formatting.beautysh, + }, + } + end, + } } diff --git a/lua/plugin/none-ls.lua b/lua/plugin/none-ls.lua deleted file mode 100644 index ff9f440..0000000 --- a/lua/plugin/none-ls.lua +++ /dev/null @@ -1,60 +0,0 @@ -return { - { - "nvimtools/none-ls.nvim", - -- event = "BufReadPost", - dependencies = { - { - "nvim-telescope/telescope-ui-select.nvim", - lazy = true, - config = function() - -- This is your opts table - require("telescope").setup { - extensions = { - ["ui-select"] = { - -- require("telescope.themes").get_dropdown { - -- -- even more opts - -- } - } - } - } - require("telescope").load_extension("ui-select") - end, - }, - }, - opts = function() - local null_ls = require('null-ls') - return { - border = 'rounded', - on_attach = function(client, bufnr) - local bufopts = { noremap = true, silent = true, buffer = bufnr } - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) - vim.keymap.set('n', 'k', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', 'gt', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', 'cw', "Lspsaga rename mode=n", bufopts) - -- vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', 'ca', 'Lspsaga code_action', bufopts) - -- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) - vim.keymap.set('v', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) - end, - sources = { - null_ls.builtins.diagnostics.trail_space.with { - disabled_filetypes = { "lua" } - }, - null_ls.builtins.diagnostics.shellcheck, - null_ls.builtins.code_actions.shellcheck, - null_ls.builtins.formatting.jq, - null_ls.builtins.code_actions.gitsigns, - null_ls.builtins.diagnostics.flake8, - null_ls.builtins.diagnostics.yamllint, - null_ls.builtins.formatting.yamlfmt, - null_ls.builtins.formatting.shfmt, - null_ls.builtins.formatting.shellharden, - null_ls.builtins.formatting.beautysh, - }, - } - end, - }, -} From 376fb5df910c30ca04cd483522e811425e3e24e8 Mon Sep 17 00:00:00 2001 From: xesc Date: Thu, 29 Feb 2024 20:33:48 +0100 Subject: [PATCH 13/55] general updates to config, minor fixes --- ftplugin/c.lua | 1 + lua/core/remap.lua | 3 +++ lua/core/statusline.lua | 2 +- lua/plugin/lspconfig.lua | 5 ----- lua/plugin/lualine.lua | 4 +++- lua/plugin/zen.lua | 3 +-- 6 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 ftplugin/c.lua diff --git a/ftplugin/c.lua b/ftplugin/c.lua new file mode 100644 index 0000000..0a1491d --- /dev/null +++ b/ftplugin/c.lua @@ -0,0 +1 @@ +vim.opt.colorcolumn = "80" diff --git a/lua/core/remap.lua b/lua/core/remap.lua index f7c6f14..f42bd06 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -48,3 +48,6 @@ vim.api.nvim_set_keymap("n", "mX", ":exec 'w' !chmod -x % -- mk- and loadview for view-persistance vim.api.nvim_set_keymap("n", "vm", ":exec 'w' mkview ", {silent = true}) vim.api.nvim_set_keymap("n", "vl", ":exec 'w' loadview ", {silent = true}) + +-- for fast save +vim.api.nvim_set_keymap("n", "", ":exec 'w'", {silent = true}) diff --git a/lua/core/statusline.lua b/lua/core/statusline.lua index 0912228..4852505 100644 --- a/lua/core/statusline.lua +++ b/lua/core/statusline.lua @@ -1,5 +1,5 @@ -- statusline -vim.api.nvim_set_option("laststatus", 2) +vim.api.nvim_set_option("laststatus", 3) vim.api.nvim_set_option("statusline", " ") -- tabline diff --git a/lua/plugin/lspconfig.lua b/lua/plugin/lspconfig.lua index 5cfc508..06cb6ab 100644 --- a/lua/plugin/lspconfig.lua +++ b/lua/plugin/lspconfig.lua @@ -212,16 +212,11 @@ return { null_ls.builtins.diagnostics.trail_space.with { disabled_filetypes = { "lua" } }, - null_ls.builtins.diagnostics.shellcheck, - null_ls.builtins.code_actions.shellcheck, - null_ls.builtins.formatting.jq, null_ls.builtins.code_actions.gitsigns, - null_ls.builtins.diagnostics.flake8, null_ls.builtins.diagnostics.yamllint, null_ls.builtins.formatting.yamlfmt, null_ls.builtins.formatting.shfmt, null_ls.builtins.formatting.shellharden, - null_ls.builtins.formatting.beautysh, }, } end, diff --git a/lua/plugin/lualine.lua b/lua/plugin/lualine.lua index b84ba4d..d856bfe 100644 --- a/lua/plugin/lualine.lua +++ b/lua/plugin/lualine.lua @@ -10,15 +10,17 @@ return { custom_gruvbox.visual.a.bg = '#a9b665' custom_gruvbox.replace.a.bg = '#ea6962' + local function lspsaga() return require('lspsaga.symbol.winbar').get_bar() end require('lualine').setup { options = { theme = custom_gruvbox, + globalstatus = true, component_separators = { left = '', right = '' }, section_separators = { left = '', right = '' }, - disabled_filetypes = { 'netrw', 'Trouble' } + disabled_filetypes = { 'netrw', 'Trouble' }, }, sections = { lualine_a = { diff --git a/lua/plugin/zen.lua b/lua/plugin/zen.lua index dcee5d2..1bd79ae 100644 --- a/lua/plugin/zen.lua +++ b/lua/plugin/zen.lua @@ -4,12 +4,11 @@ return { opts = { window = { backdrop = 1, - width = 90, + width = 92, }, plugins = { options = { enabled = true, - ruler = true, showcmd = true, laststatus = 3, }, From 080b90f430898844b4a3a92e3ccf3d97962e51d3 Mon Sep 17 00:00:00 2001 From: xesc Date: Thu, 29 Feb 2024 21:11:28 +0100 Subject: [PATCH 14/55] disable intro message --- lua/core/settings.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/core/settings.lua b/lua/core/settings.lua index 2cc9847..6f6ef50 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -61,3 +61,5 @@ vim.opt.swapfile = false vim.opt.backup = false vim.opt.undodir = os.getenv("HOME") .. "/.local/share/nvim/undodir" vim.opt.undofile = true + +vim.opt.shortmess = "I" From 0b08c6a2015fad9682b645c8292215fe96c4e3d3 Mon Sep 17 00:00:00 2001 From: xesc Date: Thu, 21 Mar 2024 21:18:49 +0100 Subject: [PATCH 15/55] update colorline --- ftplugin/c.lua | 2 +- ftplugin/python.lua | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ftplugin/c.lua b/ftplugin/c.lua index 0a1491d..0e4c436 100644 --- a/ftplugin/c.lua +++ b/ftplugin/c.lua @@ -1 +1 @@ -vim.opt.colorcolumn = "80" +vim.opt.colorcolumn = "81" diff --git a/ftplugin/python.lua b/ftplugin/python.lua index 918114f..b51ccb3 100644 --- a/ftplugin/python.lua +++ b/ftplugin/python.lua @@ -1,3 +1,4 @@ setlocal tabstop = 4 setlocal softtabstop = 4 setlocal shiftwidth = 4 +vim.opt.colorcolumn="80" From ff684aba9413a90539c856f5f59c6d16ae0425ef Mon Sep 17 00:00:00 2001 From: xesc Date: Mon, 8 Apr 2024 20:01:42 +0200 Subject: [PATCH 16/55] updates cursorlinecolor and fixes harpoon --- lua/plugin/everforest.lua | 4 ++-- lua/plugin/harpoon.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/plugin/everforest.lua b/lua/plugin/everforest.lua index f7b5e0d..586df99 100644 --- a/lua/plugin/everforest.lua +++ b/lua/plugin/everforest.lua @@ -26,7 +26,7 @@ return { vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) -- color of the cursorline and cursorlinenumber vim.api.nvim_set_hl(0, "Cursorline", { bg = "#2d353b" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) -- color of Floats and FloatBorders vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) @@ -49,7 +49,7 @@ return { vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) -- color of the cursorline and cursorlinenumber vim.api.nvim_set_hl(0, "Cursorline", { bg = "#2d353b" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) -- color of Floats and FloatBorders vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) diff --git a/lua/plugin/harpoon.lua b/lua/plugin/harpoon.lua index e73c6da..b8b2b32 100644 --- a/lua/plugin/harpoon.lua +++ b/lua/plugin/harpoon.lua @@ -10,7 +10,7 @@ return { local harpoon = require("harpoon") harpoon:setup() - vim.keymap.set("n", "a", function() harpoon:list():append() end) + vim.keymap.set("n", "a", function() harpoon:list():add() end) vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) vim.keymap.set("n", "n", function() harpoon:list():select(1) end) From c87fee0ef6ffa48fa5be238bb6eea9c8a59dec89 Mon Sep 17 00:00:00 2001 From: xesc Date: Fri, 24 May 2024 21:19:37 +0200 Subject: [PATCH 17/55] remove title from floating windows in lspsaga --- lua/plugin/lspconfig.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugin/lspconfig.lua b/lua/plugin/lspconfig.lua index 06cb6ab..4aef552 100644 --- a/lua/plugin/lspconfig.lua +++ b/lua/plugin/lspconfig.lua @@ -71,7 +71,8 @@ return { enable = false }, ui = { - code_action = '󰌶', + code_action = '', + title = false, border = 'rounded', }, rename = { @@ -107,7 +108,6 @@ return { vim.keymap.set('n', '', "Lspsaga term_toggle", opts) vim.keymap.set('t', '', "Lspsaga term_toggle", opts) - vim.keymap.set('n', 'cw', 'Lspsaga rename mode=n', opts) vim.keymap.set('n', 'so', 'Lspsaga outline', opts) vim.keymap.set('n', 'sf', 'Lspsaga finder', opts) vim.keymap.set('n', 'sci', 'Lspsaga incoming_calls', opts) From 83b15578f12aea020a50ece800002ce9ff8e4c14 Mon Sep 17 00:00:00 2001 From: xesc Date: Mon, 27 May 2024 12:07:46 +0200 Subject: [PATCH 18/55] remove deprecated sign-set func --- lua/plugin/lspconfig.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lua/plugin/lspconfig.lua b/lua/plugin/lspconfig.lua index 4aef552..008667e 100644 --- a/lua/plugin/lspconfig.lua +++ b/lua/plugin/lspconfig.lua @@ -16,11 +16,6 @@ return { -- enable completion triggered by vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') end - local signs = { Error = "󰈸 ", Warn = " ", Hint = "󰌶 ", Info = " " } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl }) - end local border = { { "╭", "FloatBorder" }, @@ -34,6 +29,7 @@ return { } vim.diagnostic.config({ + signs = { text = { [vim.diagnostic.severity.ERROR] = "✘ ", [vim.diagnostic.severity.WARN] = " ", [vim.diagnostic.severity.HINT] = " ", [vim.diagnostic.severity.INFO] = " " } }, float = { border = border }, virtual_text = { prefix = '●', -- Could be '●', '■', 'x', '▎', or anything else From 33c23c282c964232ccfde26e9151a6039022701f Mon Sep 17 00:00:00 2001 From: xesc Date: Mon, 17 Jun 2024 21:12:05 +0200 Subject: [PATCH 19/55] update trouble after rework --- lua/plugin/lspconfig.lua | 2 +- lua/plugin/lualine.lua | 2 +- lua/plugin/trouble.lua | 39 +++++++++++++++++++++++++++++++++++---- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/lua/plugin/lspconfig.lua b/lua/plugin/lspconfig.lua index 008667e..31c0f04 100644 --- a/lua/plugin/lspconfig.lua +++ b/lua/plugin/lspconfig.lua @@ -135,7 +135,7 @@ return { icons = { package_installed = "✔", package_pending = "➜", - package_uninstalled = "✗" + package_uninstalled = "✘" } } }) diff --git a/lua/plugin/lualine.lua b/lua/plugin/lualine.lua index d856bfe..60f2e6e 100644 --- a/lua/plugin/lualine.lua +++ b/lua/plugin/lualine.lua @@ -73,7 +73,7 @@ return { 'diagnostics', color = { gui = 'bold', bg = '#141617' }, sections = { 'error', 'warn', 'info', 'hint' }, - symbols = { error = "󰈸 ", warn = " ", info = " ", hint = "󰌶 " }, + symbols = { error = "✘ ", warn = " ", info = " ", hint = " " }, padding = 1, update_in_insert = true }, diff --git a/lua/plugin/trouble.lua b/lua/plugin/trouble.lua index 9cfa8ad..943da86 100644 --- a/lua/plugin/trouble.lua +++ b/lua/plugin/trouble.lua @@ -1,10 +1,41 @@ return { { "folke/trouble.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - opts = { - use_diagnostic_signs = true, - vim.keymap.set("n", "T", function() require("trouble").toggle() end), + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = "Trouble", + keys = { + { + "xx", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "xX", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "xs", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "xl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "xL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "xQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, }, } + + } From 1d55d0ec6f760e9525745f89a04ffda3ee124980 Mon Sep 17 00:00:00 2001 From: xesc Date: Mon, 17 Jun 2024 21:38:20 +0200 Subject: [PATCH 20/55] update neovim --- lua/plugin/lspconfig.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/plugin/lspconfig.lua b/lua/plugin/lspconfig.lua index 31c0f04..23ad588 100644 --- a/lua/plugin/lspconfig.lua +++ b/lua/plugin/lspconfig.lua @@ -61,7 +61,8 @@ return { }, outline = { win_position = 'left', - win_width = 45, + win_width = 50, + auto_preview = false, }, lightbulb = { enable = false From 33f4ce88efa6a2c2bebe1b11b06375c702276327 Mon Sep 17 00:00:00 2001 From: xesc Date: Mon, 17 Jun 2024 21:39:46 +0200 Subject: [PATCH 21/55] update neovim --- lua/plugin/lspconfig.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugin/lspconfig.lua b/lua/plugin/lspconfig.lua index 23ad588..e8e26ce 100644 --- a/lua/plugin/lspconfig.lua +++ b/lua/plugin/lspconfig.lua @@ -61,7 +61,7 @@ return { }, outline = { win_position = 'left', - win_width = 50, + win_width = 47, auto_preview = false, }, lightbulb = { From 87ce55295b90fa45c6b88a3764bbe28548cffe87 Mon Sep 17 00:00:00 2001 From: xesc Date: Tue, 18 Jun 2024 20:58:55 +0200 Subject: [PATCH 22/55] add nvimtree --- lua/core/settings.lua | 5 +++++ lua/plugin/lspconfig.lua | 10 +++++----- lua/plugin/nvimtree.lua | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 lua/plugin/nvimtree.lua diff --git a/lua/core/settings.lua b/lua/core/settings.lua index 6f6ef50..e923f84 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -56,6 +56,11 @@ vim.api.nvim_set_option("splitright",true) -- disable Netrw-Banner vim.g.netrw_banner = 0 +-- disable Netrw for Filetree Plugin +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + + -- undotree file management vim.opt.swapfile = false vim.opt.backup = false diff --git a/lua/plugin/lspconfig.lua b/lua/plugin/lspconfig.lua index e8e26ce..d91f488 100644 --- a/lua/plugin/lspconfig.lua +++ b/lua/plugin/lspconfig.lua @@ -60,16 +60,16 @@ return { } }, outline = { - win_position = 'left', - win_width = 47, - auto_preview = false, + win_position = 'right', + win_width = 32, + auto_preview = true, }, lightbulb = { enable = false }, ui = { code_action = '', - title = false, + title = true, border = 'rounded', }, rename = { @@ -94,7 +94,7 @@ return { }, }, diagnostic = { - border_follow = false, + border_follow = true, extend_relatedInformation = true, keys = { quit = { '', 'q' }, diff --git a/lua/plugin/nvimtree.lua b/lua/plugin/nvimtree.lua new file mode 100644 index 0000000..ba0a429 --- /dev/null +++ b/lua/plugin/nvimtree.lua @@ -0,0 +1,18 @@ +return { + "nvim-tree/nvim-tree.lua", + version = "*", + lazy = false, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + keys = { + { "F", "NvimTreeToggle", desc = "Toggle Filetree" }, + }, + config = function() + require("nvim-tree").setup({ + view = { + width = 42, + }, + }) + end, +} From 3ddbd43536c8a8088846a3493402d40f703bd363 Mon Sep 17 00:00:00 2001 From: xesc Date: Thu, 20 Jun 2024 20:54:58 +0200 Subject: [PATCH 23/55] update shortcut for nvimtree --- lua/plugin/nvimtree.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugin/nvimtree.lua b/lua/plugin/nvimtree.lua index ba0a429..4419585 100644 --- a/lua/plugin/nvimtree.lua +++ b/lua/plugin/nvimtree.lua @@ -6,12 +6,12 @@ return { "nvim-tree/nvim-web-devicons", }, keys = { - { "F", "NvimTreeToggle", desc = "Toggle Filetree" }, + { "F", "NvimTreeFindFileToggle", desc = "Toggle Filetree" }, }, config = function() require("nvim-tree").setup({ view = { - width = 42, + width = 44, }, }) end, From 6407a15cfddb07d6821f173af65a40be39c65833 Mon Sep 17 00:00:00 2001 From: xesc Date: Tue, 2 Jul 2024 21:34:07 +0200 Subject: [PATCH 24/55] change / to telescopes "current buffer fuzzy find" --- lua/plugin/telescope.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugin/telescope.lua b/lua/plugin/telescope.lua index 13f2b15..84a4353 100644 --- a/lua/plugin/telescope.lua +++ b/lua/plugin/telescope.lua @@ -11,7 +11,7 @@ return { { "ff", "Telescope find_files", desc = "Find Files" }, { "fb", "Telescope current_buffer_fuzzy_find", desc = "Find Strings in current Buffer" }, { "fg", "Telescope live_grep", desc = "Grep Content in Files" }, - { "/", "Telescope live_grep", desc = "Grep Content in Files" }, + { "/", "Telescope current_buffer_fuzzy_find", desc = "Find Strings in current Buffer" }, { "fh", "Telescope grep_string", desc = "Grep currently hovered String" }, { "fG", "Telescope git_files", desc = "Find Git Files" }, { "fk", "Telescope keymaps", desc = "List Keymaps" }, From 69b19abf8eed7764675a64706e22d2b8d35a95e9 Mon Sep 17 00:00:00 2001 From: xesc Date: Thu, 25 Jul 2024 08:22:07 +0200 Subject: [PATCH 25/55] add surround plugin --- lua/plugin/surround.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lua/plugin/surround.lua diff --git a/lua/plugin/surround.lua b/lua/plugin/surround.lua new file mode 100644 index 0000000..32a0f63 --- /dev/null +++ b/lua/plugin/surround.lua @@ -0,0 +1,12 @@ +return { + { + "kylechui/nvim-surround", + version = "*", -- Use for stability; omit to use `main` branch for the latest features + event = "VeryLazy", + config = function() + require("nvim-surround").setup({ + -- Configuration here, or leave empty to use defaults + }) + end + } +} From 4aaf17eddf8ab34fd26936e94211f7b42ca48f7b Mon Sep 17 00:00:00 2001 From: xesc Date: Fri, 26 Jul 2024 14:30:59 +0200 Subject: [PATCH 26/55] add treesitterr-textobjects plugin --- lua/plugin/treesitter-textobjects.lua | 68 +++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 lua/plugin/treesitter-textobjects.lua diff --git a/lua/plugin/treesitter-textobjects.lua b/lua/plugin/treesitter-textobjects.lua new file mode 100644 index 0000000..dac0dda --- /dev/null +++ b/lua/plugin/treesitter-textobjects.lua @@ -0,0 +1,68 @@ +return { + { + "nvim-treesitter/nvim-treesitter-textobjects", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + opts = { + textobjects = { + select = { + enable = true, + + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, + + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ap"] = "@parameter.outer", + ["ip"] = "@parameter.inner", + ["ac"] = "@comment.outer", + ["aS"] = "@statement.outer", + ["ae"] = "@block.outer", + ["al"] = "@loop.outer", + ["il"] = "@loop.inner", + ["ar"] = "@return.outer", + ["ir"] = "@return.inner", + ["ia"] = "@assignment.rhs", + ["aa"] = "@assignment.inner", + ["i?"] = "@conditional.inner", + ["a?"] = "@conditional.outer", + ["in"] = "@number.inner", + ["iC"] = "@class.inner", + ["aC"] = "@class.outer", + ["ig"] = "@call.inner", + ["ag"] = "@call.outer", + + -- You can also use captures from other query groups like `locals.scm` + ["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" }, + }, + -- You can choose the select mode (default is charwise 'v') + -- + -- Can also be a function which gets passed a table with the keys + -- * query_string: eg '@function.inner' + -- * method: eg 'v' or 'o' + -- and should return the mode ('v', 'V', or '') or a table + -- mapping query_strings to modes. + selection_modes = { + ['@parameter.outer'] = 'v', -- charwise + ['@function.outer'] = 'V', -- linewise + }, + -- If you set this to `true` (default is `false`) then any textobject is + -- extended to include preceding or succeeding whitespace. Succeeding + -- whitespace has priority in order to act similarly to eg the built-in + -- `ap`. + -- + -- Can also be a function which gets passed a table with the keys + -- * query_string: eg '@function.inner' + -- * selection_mode: eg 'v' + -- and should return true or false + include_surrounding_whitespace = false, + }, + }, + + }, + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, + } +} From 4bf1e1caae0ba287d60cea180cd09fdcbd0dad0b Mon Sep 17 00:00:00 2001 From: xesc Date: Sat, 31 Aug 2024 18:38:54 +0200 Subject: [PATCH 27/55] add comments, set width of Filetree and remove fugitive --- lua/plugin/fugitive.lua | 19 ------------------- lua/plugin/nvimtree.lua | 2 +- lua/plugin/surround.lua | 12 ++++++++++++ 3 files changed, 13 insertions(+), 20 deletions(-) delete mode 100644 lua/plugin/fugitive.lua diff --git a/lua/plugin/fugitive.lua b/lua/plugin/fugitive.lua deleted file mode 100644 index 5d9ada6..0000000 --- a/lua/plugin/fugitive.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - { - 'tpope/vim-fugitive', - keys = { - { "gG", "Git ", desc = "git" }, - { "gs", "Git status ", desc = "git status" }, - { "gd", "Git diff ", desc = "git diff" }, - { "gD", "Git diff --staged ", desc = "git diff --staged" }, - { "gl", "Git log --graph ", desc = "git log --graph" }, - { "ga", "Git add --interactive ", desc = "git add" }, - { "gA", "Git add -A ", desc = "git add -A " }, - { "gc", "Git commit ", desc = "git commit" }, - { "gC", "Git commit --amend ", desc = "git commit --amend " }, - { "gCN", "Git commit --amend --no-edit ", desc = "git commit --amend " }, - { "gp", "Git push ", desc = "git push" }, - { "gP", "Git pull ", desc = "git pull" }, - }, - } -} diff --git a/lua/plugin/nvimtree.lua b/lua/plugin/nvimtree.lua index 4419585..4a75c8a 100644 --- a/lua/plugin/nvimtree.lua +++ b/lua/plugin/nvimtree.lua @@ -11,7 +11,7 @@ return { config = function() require("nvim-tree").setup({ view = { - width = 44, + width = 56, }, }) end, diff --git a/lua/plugin/surround.lua b/lua/plugin/surround.lua index 32a0f63..aa80b74 100644 --- a/lua/plugin/surround.lua +++ b/lua/plugin/surround.lua @@ -10,3 +10,15 @@ return { end } } + +-- Old text Command New text +-- -------------------------------------------------------------------------------- +-- surround_words ysiw) (surround_words) +-- make strings ys$" "make strings" +-- [delete around me!] ds] delete around me! +-- remove HTML tags dst remove HTML tags +-- 'change quotes' cs'" "change quotes" +-- or tag types csth1

or tag types

+-- delete(function calls) dsf function calls + +-- :h nvim-surround.usage From be5aaacc14379a7e0c2d974f87c88d1e13baf7f6 Mon Sep 17 00:00:00 2001 From: xesc Date: Sat, 31 Aug 2024 18:45:08 +0200 Subject: [PATCH 28/55] add bin plugin --- lua/plugin/bin.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lua/plugin/bin.lua diff --git a/lua/plugin/bin.lua b/lua/plugin/bin.lua new file mode 100644 index 0000000..2658a39 --- /dev/null +++ b/lua/plugin/bin.lua @@ -0,0 +1,11 @@ +return { + { + "matze/wastebin.nvim", + config = function () + require("wastebin").setup({ + url = "https://bin.xesc.de", + open_cmd="xdg-open" + }) + end + } +} From f742c60750bda68e9e50315cf7f975f6f83a188e Mon Sep 17 00:00:00 2001 From: xesc Date: Sat, 31 Aug 2024 21:05:35 +0200 Subject: [PATCH 29/55] add mappings for redo and pasting to bin --- lua/core/remap.lua | 3 +++ lua/plugin/bin.lua | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index f42bd06..bf7093c 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -51,3 +51,6 @@ vim.api.nvim_set_keymap("n", "vl", ":exec 'w' loadview for fast save vim.api.nvim_set_keymap("n", "", ":exec 'w'", {silent = true}) + +-- r for redo +vim.api.nvim_set_keymap("n", "r", ":exec 'w ", {silent = true}) diff --git a/lua/plugin/bin.lua b/lua/plugin/bin.lua index 2658a39..d9c05bd 100644 --- a/lua/plugin/bin.lua +++ b/lua/plugin/bin.lua @@ -6,6 +6,10 @@ return { url = "https://bin.xesc.de", open_cmd="xdg-open" }) - end + end, + opts = { + vim.keymap.set("n", "wp", "WastePaste", {silent = true}), + vim.keymap.set("v", "wp", "WastePaste", {silent = true}), + }, } } From 8e6acc1a5335ebf77b420bc3f01c1be334838255 Mon Sep 17 00:00:00 2001 From: xesc Date: Fri, 27 Sep 2024 23:00:03 +0200 Subject: [PATCH 30/55] add noice as ui-component | add more mappings for harpoon --- lua/plugin/harpoon.lua | 9 +++++++++ lua/plugin/noice.lua | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 lua/plugin/noice.lua diff --git a/lua/plugin/harpoon.lua b/lua/plugin/harpoon.lua index b8b2b32..cc26cb9 100644 --- a/lua/plugin/harpoon.lua +++ b/lua/plugin/harpoon.lua @@ -17,6 +17,15 @@ return { vim.keymap.set("n", "e", function() harpoon:list():select(2) end) vim.keymap.set("n", "i", function() harpoon:list():select(3) end) vim.keymap.set("n", "o", function() harpoon:list():select(4) end) + vim.keymap.set("n", "1", function() harpoon:list():select(1) end) + vim.keymap.set("n", "2", function() harpoon:list():select(2) end) + vim.keymap.set("n", "3", function() harpoon:list():select(3) end) + vim.keymap.set("n", "4", function() harpoon:list():select(4) end) + vim.keymap.set("n", "5", function() harpoon:list():select(5) end) + vim.keymap.set("n", "6", function() harpoon:list():select(6) end) + vim.keymap.set("n", "7", function() harpoon:list():select(7) end) + vim.keymap.set("n", "8", function() harpoon:list():select(8) end) + vim.keymap.set("n", "9", function() harpoon:list():select(9) end) -- Toggle previous & next buffers stored within Harpoon list vim.keymap.set("n", "", function() harpoon:list():prev() end) diff --git a/lua/plugin/noice.lua b/lua/plugin/noice.lua new file mode 100644 index 0000000..63bd18c --- /dev/null +++ b/lua/plugin/noice.lua @@ -0,0 +1,34 @@ +return { + { + "folke/noice.nvim", + event = "VeryLazy", + config = function() + require("noice").setup({ + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = false, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + }) + end, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + "rcarriga/nvim-notify", + } + } +} From 6a4b41828c75bcabe39af0a19cdbb6bcf4e8ef4f Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 29 Sep 2024 17:40:56 +0200 Subject: [PATCH 31/55] minor fixes --- lua/core/remap.lua | 2 +- lua/plugin/noice.lua | 7 +++++++ lua/plugin/telescope.lua | 14 +++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index bf7093c..97c7f89 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -53,4 +53,4 @@ vim.api.nvim_set_keymap("n", "vl", ":exec 'w' loadview ", ":exec 'w'", {silent = true}) -- r for redo -vim.api.nvim_set_keymap("n", "r", ":exec 'w ", {silent = true}) +vim.api.nvim_set_keymap("n", "r", ":exec 'w' ", {silent = true}) diff --git a/lua/plugin/noice.lua b/lua/plugin/noice.lua index 63bd18c..534948f 100644 --- a/lua/plugin/noice.lua +++ b/lua/plugin/noice.lua @@ -5,6 +5,9 @@ return { config = function() require("noice").setup({ lsp = { + progress = { + enabled = false, + }, -- override markdown rendering so that **cmp** and other plugins use **Treesitter** override = { ["vim.lsp.util.convert_input_to_markdown_lines"] = true, @@ -20,6 +23,10 @@ return { inc_rename = false, -- enables an input dialog for inc-rename.nvim lsp_doc_border = false, -- add a border to hover docs and signature help }, + messages = { + enabled = false, + view = "cmdline", + } }) end, dependencies = { diff --git a/lua/plugin/telescope.lua b/lua/plugin/telescope.lua index 84a4353..09a5d2a 100644 --- a/lua/plugin/telescope.lua +++ b/lua/plugin/telescope.lua @@ -4,6 +4,18 @@ return { lazy = true, cmd = "Telescope", version = false, + config = function() + require('telescope').setup({ + pickers = { + find_files = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + }, + }) + end, keys = { { ":", "Telescope command_history", desc = "Command History" }, { ",", "Telescope buffers show_all_buffers=true", desc = "Switch Buffer" }, @@ -11,7 +23,7 @@ return { { "ff", "Telescope find_files", desc = "Find Files" }, { "fb", "Telescope current_buffer_fuzzy_find", desc = "Find Strings in current Buffer" }, { "fg", "Telescope live_grep", desc = "Grep Content in Files" }, - { "/", "Telescope current_buffer_fuzzy_find", desc = "Find Strings in current Buffer" }, + { "/", "Telescope current_buffer_fuzzy_find", desc = "Find Strings in current Buffer" }, { "fh", "Telescope grep_string", desc = "Grep currently hovered String" }, { "fG", "Telescope git_files", desc = "Find Git Files" }, { "fk", "Telescope keymaps", desc = "List Keymaps" }, From 112f2646f59b01280cc324822dd075aabd5104a5 Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 29 Sep 2024 17:49:59 +0200 Subject: [PATCH 32/55] update telescope picker views --- lua/plugin/telescope.lua | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/lua/plugin/telescope.lua b/lua/plugin/telescope.lua index 09a5d2a..84e8db9 100644 --- a/lua/plugin/telescope.lua +++ b/lua/plugin/telescope.lua @@ -13,6 +13,48 @@ return { }, sorting_strategy = 'ascending', }, + live_grep = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + current_buffer_fuzzy_find = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + grep_string = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + git_files = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + keymaps = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + oldfiles = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + command_history = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, }, }) end, From e5664d42ede261da93f189cb02372d829efe19d3 Mon Sep 17 00:00:00 2001 From: xesc Date: Wed, 2 Oct 2024 13:26:02 +0200 Subject: [PATCH 33/55] remove noice --- lua/plugin/noice.lua | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 lua/plugin/noice.lua diff --git a/lua/plugin/noice.lua b/lua/plugin/noice.lua deleted file mode 100644 index 534948f..0000000 --- a/lua/plugin/noice.lua +++ /dev/null @@ -1,41 +0,0 @@ -return { - { - "folke/noice.nvim", - event = "VeryLazy", - config = function() - require("noice").setup({ - lsp = { - progress = { - enabled = false, - }, - -- override markdown rendering so that **cmp** and other plugins use **Treesitter** - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp - }, - }, - -- you can enable a preset for easier configuration - presets = { - bottom_search = false, -- use a classic bottom cmdline for search - command_palette = true, -- position the cmdline and popupmenu together - long_message_to_split = true, -- long messages will be sent to a split - inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = false, -- add a border to hover docs and signature help - }, - messages = { - enabled = false, - view = "cmdline", - } - }) - end, - dependencies = { - -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries - "MunifTanjim/nui.nvim", - -- OPTIONAL: - -- `nvim-notify` is only needed, if you want to use the notification view. - -- If not available, we use `mini` as the fallback - "rcarriga/nvim-notify", - } - } -} From 6e5fa5adb9f891886b9cf8f806990b67e2ecc2d2 Mon Sep 17 00:00:00 2001 From: xesc Date: Sat, 26 Oct 2024 22:26:32 +0200 Subject: [PATCH 34/55] update cursorline and fix keymap --- lua/core/remap.lua | 5 +---- lua/core/settings.lua | 2 +- lua/plugin/everforest.lua | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index 97c7f89..40666fd 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -38,9 +38,6 @@ vim.api.nvim_set_keymap("n", "Y", "\"+Y", {}) -- paste from system clipboard vim.api.nvim_set_keymap("n", "p", "\"+p", {}) --- opening explorer -vim.api.nvim_set_keymap("n", "E", ":20Lexplore", {}) - -- make current file (un)executable vim.api.nvim_set_keymap("n", "mx", ":exec 'w' !chmod +x %", { silent = true }) vim.api.nvim_set_keymap("n", "mX", ":exec 'w' !chmod -x %", { silent = true }) @@ -53,4 +50,4 @@ vim.api.nvim_set_keymap("n", "vl", ":exec 'w' loadview ", ":exec 'w'", {silent = true}) -- r for redo -vim.api.nvim_set_keymap("n", "r", ":exec 'w' ", {silent = true}) +vim.api.nvim_set_keymap("n", "r", ":redo ", {silent = true}) diff --git a/lua/core/settings.lua b/lua/core/settings.lua index e923f84..f199eb5 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -1,7 +1,7 @@ -- Settings -- cursor -vim.api.nvim_set_option("guicursor","n-v-c-sm:hor20-Cursor,i-ci-ve:ver80-iCursor,r-cr-o:hor40,a:blinkwait700-blinkoff400-blinkon250") +vim.api.nvim_set_option("guicursor","n-v-c-sm:hor100-Cursor,i-ci-ve:ver100-iCursor,r-cr-o:hor40,a:blinkwait700-blinkoff400-blinkon250") -- disable mouse vim.api.nvim_set_option("mouse","") diff --git a/lua/plugin/everforest.lua b/lua/plugin/everforest.lua index 586df99..cb4134b 100644 --- a/lua/plugin/everforest.lua +++ b/lua/plugin/everforest.lua @@ -25,7 +25,7 @@ return { -- color of vertical split line vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#2d353b" }) + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3a464c" }) vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) -- color of Floats and FloatBorders vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) @@ -48,7 +48,7 @@ return { -- color of vertical split line vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#2d353b" }) + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3c464c" }) vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) -- color of Floats and FloatBorders vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) From d5009afeff4ea811990744f2791faae0e8a3295a Mon Sep 17 00:00:00 2001 From: xesc Date: Wed, 20 Nov 2024 19:30:58 +0100 Subject: [PATCH 35/55] add marks plugin and broader signcolumn --- lua/core/settings.lua | 2 +- lua/plugin/marks.lua | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 lua/plugin/marks.lua diff --git a/lua/core/settings.lua b/lua/core/settings.lua index f199eb5..9fb4c8a 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -9,7 +9,7 @@ vim.api.nvim_set_option("mouse","") -- relative numbers vim.opt.nu = true vim.opt.rnu = true -vim.opt.signcolumn = 'yes' +vim.opt.signcolumn = 'yes:3' -- setting completion menu for autocompletion vim.opt.completeopt = 'menu,menuone,noselect' diff --git a/lua/plugin/marks.lua b/lua/plugin/marks.lua new file mode 100644 index 0000000..553249f --- /dev/null +++ b/lua/plugin/marks.lua @@ -0,0 +1,12 @@ +return { + { + "chentoast/marks.nvim", + event = "VeryLazy", + opts = {}, + config = function() + require 'marks'.setup({ + sign_priority = 5; + }) + end, + } +} From c8a9410ad7a21efc00e8e8ed614e2d2d17c5547f Mon Sep 17 00:00:00 2001 From: xesc Date: Wed, 25 Dec 2024 23:31:23 +0100 Subject: [PATCH 36/55] lsp: update mason path-loading, zen: update window-width --- lua/plugin/lspconfig.lua | 2 ++ lua/plugin/zen.lua | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/plugin/lspconfig.lua b/lua/plugin/lspconfig.lua index d91f488..cdb5f4a 100644 --- a/lua/plugin/lspconfig.lua +++ b/lua/plugin/lspconfig.lua @@ -131,6 +131,7 @@ return { cmd = "Mason", config = function() require("mason").setup({ + PATH = "append", ui = { border = "rounded", icons = { @@ -151,6 +152,7 @@ return { ensure_installed = { "lua_ls", "clangd", + "rust_analyzer", } }) diff --git a/lua/plugin/zen.lua b/lua/plugin/zen.lua index 1bd79ae..dc3610f 100644 --- a/lua/plugin/zen.lua +++ b/lua/plugin/zen.lua @@ -4,7 +4,7 @@ return { opts = { window = { backdrop = 1, - width = 92, + width = 101, }, plugins = { options = { From 49c040e36e1b3b258a4a634b0eb559e80e63b6a4 Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 23 Feb 2025 19:36:05 +0100 Subject: [PATCH 37/55] update lsp, keymaps, format and some other settings --- ftplugin/tex.lua | 1 + init.lua | 1 + lua/core/autocmd.lua | 12 ++ lua/core/remap.lua | 12 +- lua/core/settings.lua | 14 +- lua/plugin/autopairs.lua | 16 +- lua/plugin/bin.lua | 8 +- lua/plugin/commenting.lua | 12 +- lua/plugin/devicons.lua | 4 +- lua/plugin/everforest.lua | 118 +++++------ lua/plugin/gitsigns.lua | 67 ++++--- lua/plugin/gruvbox-material.lua | 118 +++++------ lua/plugin/harpoon.lua | 4 - lua/plugin/indent-blankline.lua | 44 ++--- lua/plugin/lspconfig.lua | 223 --------------------- lua/plugin/lualine.lua | 274 +++++++++++++------------- lua/plugin/marks.lua | 2 +- lua/plugin/nvim-cmp.lua | 196 ------------------ lua/plugin/plenary.lua | 8 +- lua/plugin/treesitter-context.lua | 24 +-- lua/plugin/treesitter-textobjects.lua | 2 +- lua/plugin/treesitter.lua | 58 +++--- lua/plugin/trouble.lua | 41 ---- lua/plugin/undotree.lua | 23 ++- lua/plugin/zen.lua | 2 +- 25 files changed, 423 insertions(+), 861 deletions(-) delete mode 100644 lua/plugin/lspconfig.lua delete mode 100644 lua/plugin/nvim-cmp.lua delete mode 100644 lua/plugin/trouble.lua diff --git a/ftplugin/tex.lua b/ftplugin/tex.lua index 6262f2e..895e50c 100644 --- a/ftplugin/tex.lua +++ b/ftplugin/tex.lua @@ -5,6 +5,7 @@ vim.api.nvim_buf_set_keymap(0, "i", "", " :exec 'w' :exec '!xelat vim.api.nvim_buf_set_keymap(0, "v", "", " :exec 'w' :exec '!xelatex %'", {}) -- Open PDF-Viewer from LaTeX-file +vim.api.nvim_buf_set_keymap(0, "n", "cz", ":silent !zathura --fork %:r.pdf& ", {}) vim.api.nvim_buf_set_keymap(0, "n", "", ":silent !zathura --fork %:r.pdf& ", {}) vim.api.nvim_buf_set_keymap(0, "i", "", " :silent !zathura --fork %:r.pdf& ", {}) vim.api.nvim_buf_set_keymap(0, "v", "", " :silent !zathura --fork %:r.pdf& ", {}) diff --git a/init.lua b/init.lua index 3646f50..3652a0e 100644 --- a/init.lua +++ b/init.lua @@ -24,6 +24,7 @@ require("lazy").setup({ install = { colorscheme = { "everforest" } }, + change_detection = { notify = false } }) diff --git a/lua/core/autocmd.lua b/lua/core/autocmd.lua index 4e0cbd2..06c6958 100644 --- a/lua/core/autocmd.lua +++ b/lua/core/autocmd.lua @@ -6,3 +6,15 @@ vim.api.nvim_create_autocmd("Filetype", { pattern = "*", command = "setlocal formatoptions-=c formatoptions-=r formatoptions-=o" }) + +-- persistent folds +vim.api.nvim_create_autocmd({"BufWinLeave"}, { + pattern = {"*.*"}, + desc = "save view (folds), when closing file", + command = "mkview", +}) +vim.api.nvim_create_autocmd({"BufWinEnter"}, { + pattern = {"*.*"}, + desc = "load view (folds), when opening file", + command = "silent! loadview" +}) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index 40666fd..4b0fa59 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -19,8 +19,16 @@ vim.api.nvim_set_keymap("n", "", "l", {}) -- buffer operations vim.api.nvim_set_keymap("n", "", "", {}) vim.api.nvim_set_keymap("n", "bd", "bd", {}) -vim.api.nvim_set_keymap("n", "", "bprevious", {}) -vim.api.nvim_set_keymap("n", "", "bnext", {}) + +-- quickfix and locationlist +vim.api.nvim_set_keymap("n", "", "cnextzz", {}) +vim.api.nvim_set_keymap("n", "", "cprevzz", {}) +vim.api.nvim_set_keymap("n", "h", "lnextzz", {}) +vim.api.nvim_set_keymap("n", "l", "lprevzz", {}) +vim.api.nvim_set_keymap("n", "L", "lcl", {}) +vim.api.nvim_set_keymap("n", "Q", "cw", {}) +vim.api.nvim_set_keymap("n", "q", "ccl", {}) + -- moving visual blocks vim.api.nvim_set_keymap("v", "J", ":m '>+1gv=gv", {}) diff --git a/lua/core/settings.lua b/lua/core/settings.lua index 9fb4c8a..55a2adb 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -16,14 +16,20 @@ vim.opt.completeopt = 'menu,menuone,noselect' vim.opt.list = true -- correct tabbing -vim.opt.tabstop = 2 -vim.opt.softtabstop = 2 -vim.opt.shiftwidth = 2 +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 vim.opt.expandtab = true -- enable foldcolumn vim.wo.foldcolumn = "2" +-- disable wrap +vim.opt.wrap = false + +-- allow "@" in filenames +vim.opt.isfname:append("@-@") + -- smart indenting by vim vim.api.nvim_set_option("smartindent",true) @@ -39,7 +45,7 @@ vim.api.nvim_set_option("background", "dark") -- always center -- vim.api.nvim_set_option("scrolloff",999) -vim.api.nvim_set_option("scrolloff",15) +vim.opt.scrolloff = 10 -- spellchecking vim.wo.spell = true diff --git a/lua/plugin/autopairs.lua b/lua/plugin/autopairs.lua index 693cfc5..f101fbd 100644 --- a/lua/plugin/autopairs.lua +++ b/lua/plugin/autopairs.lua @@ -1,10 +1,10 @@ return { - { - "echasnovski/mini.pairs", - event = "VeryLazy", - version = false, - config = function() - require("mini.pairs").setup() - end, - } + { + "echasnovski/mini.pairs", + event = "VeryLazy", + version = false, + config = function() + require("mini.pairs").setup() + end, + } } diff --git a/lua/plugin/bin.lua b/lua/plugin/bin.lua index d9c05bd..94cc945 100644 --- a/lua/plugin/bin.lua +++ b/lua/plugin/bin.lua @@ -1,15 +1,15 @@ return { { "matze/wastebin.nvim", - config = function () + config = function() require("wastebin").setup({ url = "https://bin.xesc.de", - open_cmd="xdg-open" + open_cmd = "xdg-open" }) end, opts = { - vim.keymap.set("n", "wp", "WastePaste", {silent = true}), - vim.keymap.set("v", "wp", "WastePaste", {silent = true}), + vim.keymap.set("n", "wp", "WastePaste", { silent = true }), + vim.keymap.set("v", "wp", "WastePaste", { silent = true }), }, } } diff --git a/lua/plugin/commenting.lua b/lua/plugin/commenting.lua index d21d817..d68b2cb 100644 --- a/lua/plugin/commenting.lua +++ b/lua/plugin/commenting.lua @@ -1,8 +1,8 @@ return { - { - "echasnovski/mini.comment", - config = function() - require("mini.comment").setup() - end, - }, + { + "echasnovski/mini.comment", + config = function() + require("mini.comment").setup() + end, + }, } diff --git a/lua/plugin/devicons.lua b/lua/plugin/devicons.lua index a5b320d..7b84802 100644 --- a/lua/plugin/devicons.lua +++ b/lua/plugin/devicons.lua @@ -1,4 +1,4 @@ return { - "nvim-tree/nvim-web-devicons", - lazy = true, + "nvim-tree/nvim-web-devicons", + lazy = true, } diff --git a/lua/plugin/everforest.lua b/lua/plugin/everforest.lua index cb4134b..99ffd55 100644 --- a/lua/plugin/everforest.lua +++ b/lua/plugin/everforest.lua @@ -1,64 +1,64 @@ return { - { - "sainnhe/everforest", - priority = 1000, - config = function() - -- Settings for colorscheme - vim.api.nvim_set_var("everforest_background", "hard") - vim.api.nvim_set_var("everforest_transparent_background", "1") - vim.api.nvim_set_var("everforest_ui_contrast", "low") - vim.api.nvim_set_var("everforest_show_eob", "0") - vim.api.nvim_set_var("everforest_enable_bold", "1") - vim.api.nvim_set_var("everforest_enable_italic", "1") - vim.api.nvim_set_var("everforest_better_performance", "1") - vim.cmd([[colo everforest]]) + { + "sainnhe/everforest", + priority = 1000, + config = function() + -- Settings for colorscheme + vim.api.nvim_set_var("everforest_background", "hard") + vim.api.nvim_set_var("everforest_transparent_background", "1") + vim.api.nvim_set_var("everforest_ui_contrast", "low") + vim.api.nvim_set_var("everforest_show_eob", "0") + vim.api.nvim_set_var("everforest_enable_bold", "1") + vim.api.nvim_set_var("everforest_enable_italic", "1") + vim.api.nvim_set_var("everforest_better_performance", "1") + vim.cmd([[colo everforest]]) - -- Settings to override colorscheme - -- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"}) - -- colors of tabline - vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) - vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) - -- color of statusline - vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) - -- color of vertical split line - vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) - -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3a464c" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) - -- color of Floats and FloatBorders - vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) + -- Settings to override colorscheme + -- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"}) + -- colors of tabline + vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) + vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) + -- color of statusline + vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) + -- color of vertical split line + vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) + -- color of the cursorline and cursorlinenumber + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3a464c" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) + -- color of Floats and FloatBorders + vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) - -- autocommand for overrides - vim.api.nvim_create_autocmd("ColorScheme", { - pattern = "everforest", - callback = function() - vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) - vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) - -- color of statusline - vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) - -- color of vertical split line - vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) - -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3c464c" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) - -- color of Floats and FloatBorders - vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) - end, - }) + -- autocommand for overrides + vim.api.nvim_create_autocmd("ColorScheme", { + pattern = "everforest", + callback = function() + vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) + vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) + -- color of statusline + vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) + -- color of vertical split line + vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) + -- color of the cursorline and cursorlinenumber + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3c464c" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) + -- color of Floats and FloatBorders + vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) end, - }, + }) + end, + }, } diff --git a/lua/plugin/gitsigns.lua b/lua/plugin/gitsigns.lua index 60c83ab..930471c 100644 --- a/lua/plugin/gitsigns.lua +++ b/lua/plugin/gitsigns.lua @@ -1,40 +1,39 @@ return { - { - 'lewis6991/gitsigns.nvim', - event = "VeryLazy", - config = function() - require('gitsigns').setup({ - preview_config = { - border = 'rounded', - }, - on_attach = function(bufnr) - local gs = package.loaded.gitsigns + { + 'lewis6991/gitsigns.nvim', + event = "VeryLazy", + config = function() + require('gitsigns').setup({ + preview_config = { + border = 'rounded', + }, + on_attach = function(bufnr) + local gs = package.loaded.gitsigns - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end - -- Navigation - map('n', ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '' - end, { expr = true }) + -- Navigation + map('n', ']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '' + end, { expr = true }) - map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' - end, { expr = true }) + map('n', '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '' + end, { expr = true }) - -- Actions - map('n', 'gB', function() gs.blame_line { full = true } end) - map('n', 'gb', gs.toggle_current_line_blame) - - end - }) - end, - } + -- Actions + map('n', 'gB', function() gs.blame_line { full = true } end) + map('n', 'gb', gs.toggle_current_line_blame) + end + }) + end, + } } diff --git a/lua/plugin/gruvbox-material.lua b/lua/plugin/gruvbox-material.lua index 00b4076..81c12a1 100644 --- a/lua/plugin/gruvbox-material.lua +++ b/lua/plugin/gruvbox-material.lua @@ -1,64 +1,64 @@ return { - { - "sainnhe/gruvbox-material", - lazy = true, - config = function() - -- Settings for colorscheme - vim.api.nvim_set_var("gruvbox_material_background", "hard") - vim.api.nvim_set_var("gruvbox_material_transparent_background", "1") - vim.api.nvim_set_var("gruvbox_material_ui_contrast", "low") - vim.api.nvim_set_var("gruvbox_material_show_eob", "0") - vim.api.nvim_set_var("gruvbox_material_enable_bold", "1") - vim.api.nvim_set_var("gruvbox_material_enable_italic", "1") - vim.api.nvim_set_var("gruvbox_material_better_performance", "1") - vim.cmd([[colo gruvbox-material]]) + { + "sainnhe/gruvbox-material", + lazy = true, + config = function() + -- Settings for colorscheme + vim.api.nvim_set_var("gruvbox_material_background", "hard") + vim.api.nvim_set_var("gruvbox_material_transparent_background", "1") + vim.api.nvim_set_var("gruvbox_material_ui_contrast", "low") + vim.api.nvim_set_var("gruvbox_material_show_eob", "0") + vim.api.nvim_set_var("gruvbox_material_enable_bold", "1") + vim.api.nvim_set_var("gruvbox_material_enable_italic", "1") + vim.api.nvim_set_var("gruvbox_material_better_performance", "1") + vim.cmd([[colo gruvbox-material]]) - -- Settings to override colorscheme - -- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"}) - -- colors of tabline - vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) - vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) - -- color of statusline - vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) - -- color of vertical split line - vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) - -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) - -- color of Floats and FloatBorders - vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) + -- Settings to override colorscheme + -- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"}) + -- colors of tabline + vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) + vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) + -- color of statusline + vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) + -- color of vertical split line + vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) + -- color of the cursorline and cursorlinenumber + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) + -- color of Floats and FloatBorders + vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) - -- autocommand for overrides - vim.api.nvim_create_autocmd("ColorScheme", { - pattern = "gruvbox-material", - callback = function() - vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) - vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) - -- color of statusline - vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) - -- color of vertical split line - vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) - -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) - -- color of Floats and FloatBorders - vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) - end, - }) + -- autocommand for overrides + vim.api.nvim_create_autocmd("ColorScheme", { + pattern = "gruvbox-material", + callback = function() + vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) + vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) + -- color of statusline + vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) + -- color of vertical split line + vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) + -- color of the cursorline and cursorlinenumber + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) + -- color of Floats and FloatBorders + vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) end, - }, + }) + end, + }, } diff --git a/lua/plugin/harpoon.lua b/lua/plugin/harpoon.lua index cc26cb9..f158430 100644 --- a/lua/plugin/harpoon.lua +++ b/lua/plugin/harpoon.lua @@ -26,10 +26,6 @@ return { vim.keymap.set("n", "7", function() harpoon:list():select(7) end) vim.keymap.set("n", "8", function() harpoon:list():select(8) end) vim.keymap.set("n", "9", function() harpoon:list():select(9) end) - - -- Toggle previous & next buffers stored within Harpoon list - vim.keymap.set("n", "", function() harpoon:list():prev() end) - vim.keymap.set("n", "", function() harpoon:list():next() end) end } } diff --git a/lua/plugin/indent-blankline.lua b/lua/plugin/indent-blankline.lua index 9b2a604..fad971b 100644 --- a/lua/plugin/indent-blankline.lua +++ b/lua/plugin/indent-blankline.lua @@ -1,24 +1,24 @@ return { - { - "lukas-reineke/indent-blankline.nvim", - -- event = "BufReadPre", - main = 'ibl', - config = function() - require("ibl").setup({ - enabled = true, - indent = { - char = "│", - smart_indent_cap = true - }, - whitespace = { - remove_blankline_trail = true, - }, - scope = { - exclude = { - language = { "help", "lazy" } - } - }, - }) - end, - }, + { + "lukas-reineke/indent-blankline.nvim", + -- event = "BufReadPre", + main = 'ibl', + config = function() + require("ibl").setup({ + enabled = true, + indent = { + char = "│", + smart_indent_cap = true + }, + whitespace = { + remove_blankline_trail = true, + }, + scope = { + exclude = { + language = { "help", "lazy" } + } + }, + }) + end, + }, } diff --git a/lua/plugin/lspconfig.lua b/lua/plugin/lspconfig.lua deleted file mode 100644 index cdb5f4a..0000000 --- a/lua/plugin/lspconfig.lua +++ /dev/null @@ -1,223 +0,0 @@ -return { - { - "neovim/nvim-lspconfig", - -- event = "BufReadPre", - config = function() - require('lspconfig.ui.windows').default_options.border = 'rounded' - vim.api.nvim_set_hl(0, "LspInfoBorder", { bg = none, fg = "#9da9a0" }) - local opts = { noremap = true, silent = true } - vim.keymap.set('n', 'cd', vim.diagnostic.open_float, opts) - vim.keymap.set('n', 'cl', "LspInfo", opts) - vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) - vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) - -- vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) - - local on_attach = function(client, bufnr) - -- enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - end - - local border = { - { "╭", "FloatBorder" }, - { "─", "FloatBorder" }, - { "╮", "FloatBorder" }, - { "│", "FloatBorder" }, - { "╯", "FloatBorder" }, - { "─", "FloatBorder" }, - { "╰", "FloatBorder" }, - { "│", "FloatBorder" }, - } - - vim.diagnostic.config({ - signs = { text = { [vim.diagnostic.severity.ERROR] = "✘ ", [vim.diagnostic.severity.WARN] = " ", [vim.diagnostic.severity.HINT] = " ", [vim.diagnostic.severity.INFO] = " " } }, - float = { border = border }, - virtual_text = { - prefix = '●', -- Could be '●', '■', 'x', '▎', or anything else - }, - update_in_insert = true, - }) - - -- LSP settings (for overriding per client) - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border }) - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signatureHelp, { border = border }) - end, - }, - - -- pretty ui - { - 'nvimdev/lspsaga.nvim', - event = 'LspAttach', - config = function() - require('lspsaga').setup({ - symbol_in_winbar = { - enable = false, - show_file = false - }, - finder = { - keys = { - toggle_or_open = "", - quit = { '', 'q' } - } - }, - outline = { - win_position = 'right', - win_width = 32, - auto_preview = true, - }, - lightbulb = { - enable = false - }, - ui = { - code_action = '', - title = true, - border = 'rounded', - }, - rename = { - in_select = false, - keys = { - quit = { '', 'q' }, - select = '' - } - }, - hover_doc = { - open_cmd = '!firefox' - }, - code_action = { - keys = { - quit = { '', 'q' } - }, - extend_gitsigns = false, - }, - definition = { - keys = { - quit = { '', 'q' }, - }, - }, - diagnostic = { - border_follow = true, - extend_relatedInformation = true, - keys = { - quit = { '', 'q' }, - quit_in_show = { '', 'q' }, - } - } - }) - - vim.keymap.set('n', '', "Lspsaga term_toggle", opts) - vim.keymap.set('t', '', "Lspsaga term_toggle", opts) - vim.keymap.set('n', 'so', 'Lspsaga outline', opts) - vim.keymap.set('n', 'sf', 'Lspsaga finder', opts) - vim.keymap.set('n', 'sci', 'Lspsaga incoming_calls', opts) - vim.keymap.set('n', 'sco', 'Lspsaga outgoing_calls', opts) - vim.keymap.set('n', 'k', 'Lspsaga hover_doc', bufopts) - vim.keymap.set('n', 'K', 'Lspsaga hover_doc', bufopts) - vim.keymap.set('n', 'ca', 'Lspsaga code_action', bufopts) - vim.keymap.set('n', 'sd', 'Lspsaga peek_definition', bufopts) - vim.keymap.set('n', 'st', 'Lspsaga peek_type_definition', bufopts) - vim.keymap.set('n', 'cw', "Lspsaga rename mode=n", bufopts) - vim.keymap.set('n', 'ca', 'Lspsaga code_action', bufopts) - vim.keymap.set('n', '[e', 'Lspsaga diagnostic_jump_next', bufopts) - vim.keymap.set('n', ']e', 'Lspsaga diagnostic_jump_prev', bufopts) - end, - depedencies = { - 'nvim-treesitter/nvim-treesitter', - 'nvim-tree/nvim-web-devicons' - }, - }, - - { - "williamboman/mason.nvim", - lazy = true, - cmd = "Mason", - config = function() - require("mason").setup({ - PATH = "append", - ui = { - border = "rounded", - icons = { - package_installed = "✔", - package_pending = "➜", - package_uninstalled = "✘" - } - } - }) - end, - }, - - { - "williamboman/mason-lspconfig.nvim", - -- event = "BufReadPre", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { - "lua_ls", - "clangd", - "rust_analyzer", - } - }) - - require("mason-lspconfig").setup_handlers { - -- The first entry (without a key) will be the default handler - -- and will be called for each installed server that doesn't have - -- a dedicated handler. - function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup { - on_attach = on_attach, - handlers = handlers, - } - end, - } - end, - }, - { - "nvimtools/none-ls.nvim", - -- event = "BufReadPost", - dependencies = { - { - "nvim-telescope/telescope-ui-select.nvim", - lazy = true, - config = function() - -- This is your opts table - require("telescope").setup { - extensions = { - ["ui-select"] = { - -- require("telescope.themes").get_dropdown { - -- -- even more opts - -- } - } - } - } - require("telescope").load_extension("ui-select") - end, - }, - }, - opts = function() - local null_ls = require('null-ls') - return { - border = 'rounded', - on_attach = function(client, bufnr) - local bufopts = { noremap = true, silent = true, buffer = bufnr } - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', 'gt', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', 'cA', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) - vim.keymap.set('v', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) - end, - sources = { - null_ls.builtins.diagnostics.trail_space.with { - disabled_filetypes = { "lua" } - }, - null_ls.builtins.code_actions.gitsigns, - null_ls.builtins.diagnostics.yamllint, - null_ls.builtins.formatting.yamlfmt, - null_ls.builtins.formatting.shfmt, - null_ls.builtins.formatting.shellharden, - }, - } - end, - } -} diff --git a/lua/plugin/lualine.lua b/lua/plugin/lualine.lua index 60f2e6e..294aa10 100644 --- a/lua/plugin/lualine.lua +++ b/lua/plugin/lualine.lua @@ -1,161 +1,161 @@ return { - { - "nvim-lualine/lualine.nvim", - config = function() - vim.api.nvim_set_option("showmode", false) - local custom_gruvbox = require 'lualine.themes.gruvbox-material' - custom_gruvbox.normal.a.bg = '#89b482' - custom_gruvbox.normal.c.bg = '' - custom_gruvbox.insert.a.bg = '#d8a657' - custom_gruvbox.visual.a.bg = '#a9b665' - custom_gruvbox.replace.a.bg = '#ea6962' + { + "nvim-lualine/lualine.nvim", + config = function() + vim.api.nvim_set_option("showmode", false) + local custom_gruvbox = require 'lualine.themes.gruvbox-material' + custom_gruvbox.normal.a.bg = '#89b482' + custom_gruvbox.normal.c.bg = '' + custom_gruvbox.insert.a.bg = '#d8a657' + custom_gruvbox.visual.a.bg = '#a9b665' + custom_gruvbox.replace.a.bg = '#ea6962' local function lspsaga() return require('lspsaga.symbol.winbar').get_bar() end - require('lualine').setup { - options = { - theme = custom_gruvbox, + require('lualine').setup { + options = { + theme = custom_gruvbox, globalstatus = true, - component_separators = { left = '', right = '' }, - section_separators = { left = '', right = '' }, - disabled_filetypes = { 'netrw', 'Trouble' }, - }, - sections = { - lualine_a = { - { - 'mode', - padding = 1, - } - }, - lualine_b = { - { - 'branch', - icon = '', - color = { fg = '#d8a657', bg = '#141617', gui = 'bold' }, - padding = 1, - }, + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = { 'netrw', 'Trouble' }, + }, + sections = { + lualine_a = { + { + 'mode', + padding = 1, + } + }, + lualine_b = { + { + 'branch', + icon = '', + color = { fg = '#d8a657', bg = '#141617', gui = 'bold' }, + padding = 1, + }, { 'filename', color = { gui = 'italic', fg = '#d3869b', bg = '#1d2021' }, padding = 1, path = 1, }, - }, - lualine_c = { + }, + lualine_c = { { lspsaga } - }, - lualine_x = { - { - 'filetype', - color = { bg = '#1d2021', fg = '#d4be98', gui = 'italic' }, - padding = 1, - fmt = function(str) - return (str:gsub("^%l", string.upper)) - end, - }, - { - 'fileformat', - color = {gui = 'italic', bg = '#141617'}, - symbols = { - unix = '(unix)', - dos = '(dos)', - mac = '(mac)', - }, - } + }, + lualine_x = { + { + 'filetype', + color = { bg = '#1d2021', fg = '#d4be98', gui = 'italic' }, + padding = 1, + fmt = function(str) + return (str:gsub("^%l", string.upper)) + end, + }, + { + 'fileformat', + color = { gui = 'italic', bg = '#141617' }, + symbols = { + unix = '(unix)', + dos = '(dos)', + mac = '(mac)', + }, + } - }, - lualine_y = { - { - 'diagnostics', - color = { gui = 'bold', bg = '#141617' }, - sections = { 'error', 'warn', 'info', 'hint' }, - symbols = { error = "✘ ", warn = " ", info = " ", hint = " " }, - padding = 1, - update_in_insert = true - }, - { - 'diff', - icon = { ' ', color = { bg = '#141617', fg = '#d8a657', gui = 'bold' } }, - color = { gui = 'bold', bg = '#141617' }, - padding = 1, - } - }, - lualine_z = { - { - 'location', - padding = 1, - } - } - }, + }, + lualine_y = { + { + 'diagnostics', + color = { gui = 'bold', bg = '#141617' }, + sections = { 'error', 'warn', 'info', 'hint' }, + symbols = { error = "✘ ", warn = " ", info = " ", hint = " " }, + padding = 1, + update_in_insert = true + }, + { + 'diff', + icon = { ' ', color = { bg = '#141617', fg = '#d8a657', gui = 'bold' } }, + color = { gui = 'bold', bg = '#141617' }, + padding = 1, + } + }, + lualine_z = { + { + 'location', + padding = 1, + } + } + }, - inactive_sections = { - lualine_a = { - { - 'mode', - padding = 1, - } - }, - lualine_b = { - { - 'branch', - icon = '', - padding = 1, - }, + inactive_sections = { + lualine_a = { + { + 'mode', + padding = 1, + } + }, + lualine_b = { + { + 'branch', + icon = '', + padding = 1, + }, { 'filename', padding = 1, path = 1, } - }, - lualine_c = { - }, - lualine_x = { - { - 'filetype', - color = { gui = 'italic' }, - padding = 1, - fmt = function(str) - return (str:gsub("^%l", string.upper)) - end, - }, - { - 'fileformat', - color = {gui = 'italic'}, - symbols = { - unix = 'Unix', - dos = 'Dos', - mac = 'Mac', - }, - }, - }, - lualine_y = { - { - 'diagnostics', - color = { gui = 'bold', bg = '#141617' }, - sections = { 'error', 'warn', 'info', 'hint' }, - symbols = { error = "✘ ", warn = " ", info = " ", hint = "󰌶 " }, - padding = 1, - update_in_insert = true - }, - { - 'diff', - icon = { ' ', color = { bg = '#141617', gui = 'bold' } }, - color = { gui = 'bold', bg = '#141617' }, - padding = 1, - } - }, - lualine_z = { - { - 'location', - padding = 1, - }, - } - }, - } - end, - }, + }, + lualine_c = { + }, + lualine_x = { + { + 'filetype', + color = { gui = 'italic' }, + padding = 1, + fmt = function(str) + return (str:gsub("^%l", string.upper)) + end, + }, + { + 'fileformat', + color = { gui = 'italic' }, + symbols = { + unix = 'Unix', + dos = 'Dos', + mac = 'Mac', + }, + }, + }, + lualine_y = { + { + 'diagnostics', + color = { gui = 'bold', bg = '#141617' }, + sections = { 'error', 'warn', 'info', 'hint' }, + symbols = { error = "✘ ", warn = " ", info = " ", hint = "󰌶 " }, + padding = 1, + update_in_insert = true + }, + { + 'diff', + icon = { ' ', color = { bg = '#141617', gui = 'bold' } }, + color = { gui = 'bold', bg = '#141617' }, + padding = 1, + } + }, + lualine_z = { + { + 'location', + padding = 1, + }, + } + }, + } + end, + }, } diff --git a/lua/plugin/marks.lua b/lua/plugin/marks.lua index 553249f..2157ce9 100644 --- a/lua/plugin/marks.lua +++ b/lua/plugin/marks.lua @@ -5,7 +5,7 @@ return { opts = {}, config = function() require 'marks'.setup({ - sign_priority = 5; + sign_priority = 5, }) end, } diff --git a/lua/plugin/nvim-cmp.lua b/lua/plugin/nvim-cmp.lua deleted file mode 100644 index 9a5d422..0000000 --- a/lua/plugin/nvim-cmp.lua +++ /dev/null @@ -1,196 +0,0 @@ -return { - - -- snippets - { - "L3MON4D3/LuaSnip", - lazy = true, - dependencies = { - "rafamadriz/friendly-snippets", - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - vim.api.nvim_set_hl(0, "PmenuSel", { fg = 'NONE', bg = '#272e33' }) - vim.api.nvim_set_hl(0, "Pmenu", { fg = 'NONE', bg = '#1e2326' }) - vim.api.nvim_set_hl(0, "CmpItemMenu", { fg = 'NONE', bg = '#272e33' }) - vim.api.nvim_set_hl(0, "CmpItemMenuDefault", { fg = 'NONE', bg = '#272e33' }) - vim.api.nvim_set_hl(0, "CmpItemKindFunction", { fg = '#d699b6', bg = 'NONE', italic = true }) - vim.api.nvim_set_hl(0, "CmpItemKindSnippet", { fg = '#dbbc7f', bg = 'NONE', italic = true }) - vim.api.nvim_set_hl(0, "CmpItemKindText", { fg = '#9da9a0', bg = 'NONE', italic = true }) - vim.api.nvim_set_hl(0, "CmpItemKindVariable", { fg = '#7fbbb3', bg = 'NONE', italic = true }) - end, - }, - }, - - -- completion - { - "hrsh7th/nvim-cmp", - version = false, - event = { - -- "InsertEnter", - -- "CmdlineEnter", - "BufWinEnter", - }, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "saadparwaiz1/cmp_luasnip", - }, - opts = function() - -- Set up nvim-cmp with luasnip - local kind_icons = { - Text = "", - Method = "󰆧", - Function = "󰊕", - Constructor = "", - Field = "󰇽", - Variable = "󰂡", - Class = "󰠱", - Interface = "", - Module = "", - Property = "󰜢", - Unit = "", - Value = "󰎠", - Enum = "", - Keyword = "󰌋", - Snippet = "", - Color = "󰏘", - File = "󰈙", - Reference = "", - Folder = "󰉋", - EnumMember = "", - Constant = "󰏿", - Struct = "", - Event = "", - Operator = "󰆕", - TypeParameter = "󰅲" - } - - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and - vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end - - local luasnip = require("luasnip") - local cmp = require("cmp") - - return { - formatting = { - format = function(entry, vim_item) - -- Kind icons - vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind - -- Source - vim_item.menu = ({ - -- buffer = "[Buffer]", - -- nvim_lsp = "[LSP]", - -- luasnip = "[LuaSnip]", - -- nvim_lua = "[Lua]", - -- latex_symbols = "[LaTeX]", - buffer = "", - nvim_lsp = "", - luasnip = "", - nvim_lua = "", - latex_symbols = "", - })[entry.source.name] - return vim_item - end - }, - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - -- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - -- require('snippy').expand_snippet(args.body) -- For `snippy` users. - -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. - end, - }, - -- completion = { - -- autocomplete = false, - -- }, - - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - -- [''] = cmp.mapping.complete(), - -- [''] = cmp.mapping.abort(), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.abort() - else - cmp.complete() - end - end), - [''] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- they way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - -- { name = 'vsnip' }, -- For vsnip users. - { name = 'luasnip' }, -- For luasnip users. - -- { name = 'ultisnips' }, -- For ultisnips users. - -- { name = 'snippy' }, -- For snippy users. - { - name = 'buffer', - option = { - get_bufnrs = function() - return vim.api.nvim_list_bufs() - end - }, - }, - }, { - }), - -- Set configuration for specific filetype. - cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. - }, { - { name = 'buffer' }, - }) - }), - -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline({ '/', '?' }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } - }), - -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) - }), - } - end, - } -} diff --git a/lua/plugin/plenary.lua b/lua/plugin/plenary.lua index 0fe75df..46ee96d 100644 --- a/lua/plugin/plenary.lua +++ b/lua/plugin/plenary.lua @@ -1,6 +1,6 @@ return { - { - "nvim-lua/plenary.nvim", - lazy = true, - }, + { + "nvim-lua/plenary.nvim", + lazy = true, + }, } diff --git a/lua/plugin/treesitter-context.lua b/lua/plugin/treesitter-context.lua index b1f1363..afa8ad1 100644 --- a/lua/plugin/treesitter-context.lua +++ b/lua/plugin/treesitter-context.lua @@ -1,14 +1,14 @@ return { - { - "nvim-treesitter/nvim-treesitter-context", - event = "VeryLazy", - config = function () - require('treesitter-context').setup{ - enable = true, - max_lines = 0, - min_window_height = 0, - line_numbers = true, - } - end - } + { + "nvim-treesitter/nvim-treesitter-context", + event = "VeryLazy", + config = function() + require('treesitter-context').setup { + enable = true, + max_lines = 0, + min_window_height = 0, + line_numbers = true, + } + end + } } diff --git a/lua/plugin/treesitter-textobjects.lua b/lua/plugin/treesitter-textobjects.lua index dac0dda..2040acd 100644 --- a/lua/plugin/treesitter-textobjects.lua +++ b/lua/plugin/treesitter-textobjects.lua @@ -45,7 +45,7 @@ return { -- mapping query_strings to modes. selection_modes = { ['@parameter.outer'] = 'v', -- charwise - ['@function.outer'] = 'V', -- linewise + ['@function.outer'] = 'V', -- linewise }, -- If you set this to `true` (default is `false`) then any textobject is -- extended to include preceding or succeeding whitespace. Succeeding diff --git a/lua/plugin/treesitter.lua b/lua/plugin/treesitter.lua index 0b73d09..a0a7947 100644 --- a/lua/plugin/treesitter.lua +++ b/lua/plugin/treesitter.lua @@ -1,32 +1,32 @@ return { - { - "nvim-treesitter/nvim-treesitter", - version = false, - build = ":TSUpdate", - -- event = "BufReadPre", - opts = { - ensure_installed = { - "c", - "lua", - "rust", - "latex", - "bibtex", - "python", - "vim", - "yaml", - "json", - }, - sync_install = false, - auto_install = true, - highlight = { - enable = true, - disable = { - "markdown", - }, - }, + { + "nvim-treesitter/nvim-treesitter", + version = false, + build = ":TSUpdate", + -- event = "BufReadPre", + opts = { + ensure_installed = { + "c", + "lua", + "rust", + "latex", + "bibtex", + "python", + "vim", + "yaml", + "json", + }, + sync_install = false, + auto_install = true, + highlight = { + enable = true, + disable = { + "markdown", }, - config = function(_, opts) - require("nvim-treesitter.configs").setup(opts) - end, - } + }, + }, + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, + } } diff --git a/lua/plugin/trouble.lua b/lua/plugin/trouble.lua deleted file mode 100644 index 943da86..0000000 --- a/lua/plugin/trouble.lua +++ /dev/null @@ -1,41 +0,0 @@ -return { - { - "folke/trouble.nvim", - opts = {}, -- for default options, refer to the configuration section for custom setup. - cmd = "Trouble", - keys = { - { - "xx", - "Trouble diagnostics toggle", - desc = "Diagnostics (Trouble)", - }, - { - "xX", - "Trouble diagnostics toggle filter.buf=0", - desc = "Buffer Diagnostics (Trouble)", - }, - { - "xs", - "Trouble symbols toggle focus=false", - desc = "Symbols (Trouble)", - }, - { - "xl", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP Definitions / references / ... (Trouble)", - }, - { - "xL", - "Trouble loclist toggle", - desc = "Location List (Trouble)", - }, - { - "xQ", - "Trouble qflist toggle", - desc = "Quickfix List (Trouble)", - }, - }, - } - - -} diff --git a/lua/plugin/undotree.lua b/lua/plugin/undotree.lua index b7a7346..6fb2067 100644 --- a/lua/plugin/undotree.lua +++ b/lua/plugin/undotree.lua @@ -1,14 +1,13 @@ return { - { - "mbbill/undotree", - keys = { - { "u", "UndotreeToggle", desc = "toggle undotree" }, - }, - config = function() - vim.g.undotree_WindowLayout = 4 - vim.g.undotree_SplitWidth = 40 - vim.g.undotree_SetFocusWhenToggle = 1 - end - } + { + "mbbill/undotree", + keys = { + { "u", "UndotreeToggle", desc = "toggle undotree" }, + }, + config = function() + vim.g.undotree_WindowLayout = 4 + vim.g.undotree_SplitWidth = 40 + vim.g.undotree_SetFocusWhenToggle = 1 + end + } } - diff --git a/lua/plugin/zen.lua b/lua/plugin/zen.lua index dc3610f..08dcc9e 100644 --- a/lua/plugin/zen.lua +++ b/lua/plugin/zen.lua @@ -4,7 +4,7 @@ return { opts = { window = { backdrop = 1, - width = 101, + width = 120, }, plugins = { options = { From bdf75e4c1d984fe2f99ee0c2f5eec9dac98bee53 Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 23 Feb 2025 22:11:28 +0100 Subject: [PATCH 38/55] add lsp and snippets back --- lua/plugin/lsp.lua | 324 ++++++++++++++++++++++++++++++++++++++++ lua/plugin/snippets.lua | 20 +++ 2 files changed, 344 insertions(+) create mode 100644 lua/plugin/lsp.lua create mode 100644 lua/plugin/snippets.lua diff --git a/lua/plugin/lsp.lua b/lua/plugin/lsp.lua new file mode 100644 index 0000000..747b70a --- /dev/null +++ b/lua/plugin/lsp.lua @@ -0,0 +1,324 @@ +return { + { + "neovim/nvim-lspconfig", + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "hrsh7th/nvim-cmp", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "nvim-telescope/telescope-ui-select.nvim", + "nvimtools/none-ls.nvim", + "nvimdev/lspsaga.nvim", + 'nvim-treesitter/nvim-treesitter', + 'nvim-tree/nvim-web-devicons', + }, + config = function() + + -- setup -- + + local capabilities = vim.tbl_deep_extend( + "force", + {}, + vim.lsp.protocol.make_client_capabilities() + ) + + -- mason -- + + require("mason").setup({ + PATH = "append", + ui = { + border = "rounded", + icons = { + package_installed = "✔", + package_pending = "➜", + package_uninstalled = "✘" + } + } + }) + + -- mason lspconfig -- + + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "clangd", + "rust_analyzer", + }, + handlers = { + -- The first entry (without a key) will be the default handler + -- and will be called for each installed server that doesn't have + -- a dedicated handler. + function(server_name) -- default handler (optional) + require("lspconfig")[server_name].setup { + capabilities = capabilities + } + end, + } + }) + + -- telescope ui for null-ls + + require("telescope").setup { + extensions = { + ["ui-select"] = { + -- require("telescope.themes").get_dropdown { + -- -- even more opts + -- } + } + } + } + require("telescope").load_extension("ui-select") + + + -- null-ls (none-ls) + + local null_ls = require('null-ls') + require("null-ls").setup({ + sources = { + null_ls.builtins.diagnostics.trail_space.with { + disabled_filetypes = { "lua" } + }, + null_ls.builtins.code_actions.gitsigns, + null_ls.builtins.diagnostics.yamllint, + null_ls.builtins.formatting.yamlfmt, + null_ls.builtins.formatting.shfmt, + null_ls.builtins.formatting.shellharden, + }, + }) + + -- lspsaga (pretty lsp-windows) + + require('lspsaga').setup({ + symbol_in_winbar = { + enable = false, + show_file = false + }, + finder = { + keys = { + toggle_or_open = "", + quit = { '', 'q' } + } + }, + outline = { + win_position = 'right', + win_width = 32, + auto_preview = true, + }, + lightbulb = { + enable = false + }, + ui = { + code_action = '', + title = true, + border = 'rounded', + }, + rename = { + in_select = false, + keys = { + quit = { '', 'q' }, + select = '' + } + }, + hover_doc = { + open_cmd = '!firefox' + }, + code_action = { + keys = { + quit = { '', 'q' } + }, + extend_gitsigns = false, + }, + definition = { + keys = { + quit = { '', 'q' }, + }, + }, + diagnostic = { + border_follow = true, + extend_relatedInformation = true, + keys = { + quit = { '', 'q' }, + quit_in_show = { '', 'q' }, + } + } + }) + + -- autocomplete -- + + local kind_icons = { + Text = "", + Method = "󰆧", + Function = "󰊕", + Constructor = "", + Field = "󰇽", + Variable = "󰂡", + Class = "󰠱", + Interface = "", + Module = "", + Property = "󰜢", + Unit = "", + Value = "󰎠", + Enum = "", + Keyword = "󰌋", + Snippet = "", + Color = "󰏘", + File = "󰈙", + Reference = "", + Folder = "󰉋", + EnumMember = "", + Constant = "󰏿", + Struct = "", + Event = "", + Operator = "󰆕", + TypeParameter = "󰅲" + } + + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and + vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + local luasnip = require("luasnip") + local cmp = require("cmp") + cmp.setup({ + formatting = { + format = function(entry, vim_item) + -- Kind icons + vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind + -- Source + vim_item.menu = ({ + buffer = "", + nvim_lsp = "", + luasnip = "", + nvim_lua = "", + latex_symbols = "", + })[entry.source.name] + return vim_item + end + }, + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.abort() + else + cmp.complete() + end + end), + [''] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- they way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, -- For luasnip users. + { + name = 'buffer', + option = { + get_bufnrs = function() + return vim.api.nvim_list_bufs() + end + }, + }, + }, { + }), + -- Set configuration for specific filetype. + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } + }), + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) + }) + }) + + -- config -- + + vim.diagnostic.config({ + update_in_insert = true, + signs = { text = { [vim.diagnostic.severity.ERROR] = "✘ ", [vim.diagnostic.severity.WARN] = " ", [vim.diagnostic.severity.HINT] = " ", [vim.diagnostic.severity.INFO] = " " } }, + float = { + focusable = false, + style = "minimal", + border = "rounded", + source = "always", + header = "", + prefix = "", + }, + virtual_text = { + prefix = '●', -- Could be '●', '■', 'x', '▎', or anything else + }, + }) + + -- keymaps -- + + local opts = { noremap = true, silent = true } + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + vim.keymap.set('n', 'K', function() vim.lsp.buf.hover { border = "rounded" } end, opts) + vim.keymap.set('n', 'k', function() vim.lsp.buf.hover { border = "rounded" } end, opts) + vim.keymap.set('n', 'cl', "LspInfo", opts) + vim.keymap.set('n', 'cd', vim.diagnostic.open_float, opts) + vim.keymap.set('n', '[n', vim.diagnostic.goto_prev, opts) + vim.keymap.set('n', ']n', vim.diagnostic.goto_next, opts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) + vim.keymap.set('n', 'cf', function() vim.lsp.buf.format { async = true } end, opts) + vim.keymap.set('v', 'cf', function() vim.lsp.buf.format { async = true } end, opts) + vim.keymap.set("n", "fws", function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) + vim.keymap.set('n', '', "Lspsaga term_toggle", opts) + vim.keymap.set('t', '', "Lspsaga term_toggle", opts) + vim.keymap.set('n', 'so', 'Lspsaga outline', opts) + vim.keymap.set('n', 'sf', 'Lspsaga finder', opts) + vim.keymap.set('n', 'sd', 'Lspsaga peek_definition', opts) + vim.keymap.set('n', 'cw', "Lspsaga rename mode=n", opts) + vim.keymap.set('n', 'cA', vim.lsp.buf.code_action, opts) + vim.keymap.set('n', 'ca', 'Lspsaga code_action', opts) + end, + } +} diff --git a/lua/plugin/snippets.lua b/lua/plugin/snippets.lua new file mode 100644 index 0000000..273e250 --- /dev/null +++ b/lua/plugin/snippets.lua @@ -0,0 +1,20 @@ +return { + { + "L3MON4D3/LuaSnip", + lazy = true, + dependencies = { + "rafamadriz/friendly-snippets", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + vim.api.nvim_set_hl(0, "PmenuSel", { fg = 'NONE', bg = '#272e33' }) + vim.api.nvim_set_hl(0, "Pmenu", { fg = 'NONE', bg = '#1e2326' }) + vim.api.nvim_set_hl(0, "CmpItemMenu", { fg = 'NONE', bg = '#272e33' }) + vim.api.nvim_set_hl(0, "CmpItemMenuDefault", { fg = 'NONE', bg = '#272e33' }) + vim.api.nvim_set_hl(0, "CmpItemKindFunction", { fg = '#d699b6', bg = 'NONE', italic = true }) + vim.api.nvim_set_hl(0, "CmpItemKindSnippet", { fg = '#dbbc7f', bg = 'NONE', italic = true }) + vim.api.nvim_set_hl(0, "CmpItemKindText", { fg = '#9da9a0', bg = 'NONE', italic = true }) + vim.api.nvim_set_hl(0, "CmpItemKindVariable", { fg = '#7fbbb3', bg = 'NONE', italic = true }) + end, + }, + } +} From 6458c24d8af66f35efa73d431b6106df3f02ea1b Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 23 Feb 2025 22:30:52 +0100 Subject: [PATCH 39/55] add sources to null-ls --- lua/plugin/autopairs.lua | 16 +- lua/plugin/bin.lua | 26 +-- lua/plugin/commenting.lua | 12 +- lua/plugin/devicons.lua | 4 +- lua/plugin/everforest.lua | 118 +++++----- lua/plugin/gitsigns.lua | 66 +++--- lua/plugin/gruvbox-material.lua | 118 +++++----- lua/plugin/harpoon.lua | 54 ++--- lua/plugin/indent-blankline.lua | 44 ++-- lua/plugin/lsp.lua | 15 +- lua/plugin/lualine.lua | 308 +++++++++++++------------- lua/plugin/marks.lua | 20 +- lua/plugin/nvimtree.lua | 32 +-- lua/plugin/plenary.lua | 8 +- lua/plugin/surround.lua | 20 +- lua/plugin/telescope.lua | 142 ++++++------ lua/plugin/treesitter-context.lua | 24 +- lua/plugin/treesitter-textobjects.lua | 124 +++++------ lua/plugin/treesitter.lua | 58 ++--- lua/plugin/undotree.lua | 22 +- lua/plugin/zen.lua | 34 +-- 21 files changed, 638 insertions(+), 627 deletions(-) diff --git a/lua/plugin/autopairs.lua b/lua/plugin/autopairs.lua index f101fbd..693cfc5 100644 --- a/lua/plugin/autopairs.lua +++ b/lua/plugin/autopairs.lua @@ -1,10 +1,10 @@ return { - { - "echasnovski/mini.pairs", - event = "VeryLazy", - version = false, - config = function() - require("mini.pairs").setup() - end, - } + { + "echasnovski/mini.pairs", + event = "VeryLazy", + version = false, + config = function() + require("mini.pairs").setup() + end, + } } diff --git a/lua/plugin/bin.lua b/lua/plugin/bin.lua index 94cc945..26b7b0f 100644 --- a/lua/plugin/bin.lua +++ b/lua/plugin/bin.lua @@ -1,15 +1,15 @@ return { - { - "matze/wastebin.nvim", - config = function() - require("wastebin").setup({ - url = "https://bin.xesc.de", - open_cmd = "xdg-open" - }) - end, - opts = { - vim.keymap.set("n", "wp", "WastePaste", { silent = true }), - vim.keymap.set("v", "wp", "WastePaste", { silent = true }), - }, - } + { + "matze/wastebin.nvim", + config = function() + require("wastebin").setup({ + url = "https://bin.xesc.de", + open_cmd = "xdg-open" + }) + end, + opts = { + vim.keymap.set("n", "wp", "WastePaste", { silent = true }), + vim.keymap.set("v", "wp", "WastePaste", { silent = true }), + }, + } } diff --git a/lua/plugin/commenting.lua b/lua/plugin/commenting.lua index d68b2cb..d21d817 100644 --- a/lua/plugin/commenting.lua +++ b/lua/plugin/commenting.lua @@ -1,8 +1,8 @@ return { - { - "echasnovski/mini.comment", - config = function() - require("mini.comment").setup() - end, - }, + { + "echasnovski/mini.comment", + config = function() + require("mini.comment").setup() + end, + }, } diff --git a/lua/plugin/devicons.lua b/lua/plugin/devicons.lua index 7b84802..a5b320d 100644 --- a/lua/plugin/devicons.lua +++ b/lua/plugin/devicons.lua @@ -1,4 +1,4 @@ return { - "nvim-tree/nvim-web-devicons", - lazy = true, + "nvim-tree/nvim-web-devicons", + lazy = true, } diff --git a/lua/plugin/everforest.lua b/lua/plugin/everforest.lua index 99ffd55..cb4134b 100644 --- a/lua/plugin/everforest.lua +++ b/lua/plugin/everforest.lua @@ -1,64 +1,64 @@ return { - { - "sainnhe/everforest", - priority = 1000, - config = function() - -- Settings for colorscheme - vim.api.nvim_set_var("everforest_background", "hard") - vim.api.nvim_set_var("everforest_transparent_background", "1") - vim.api.nvim_set_var("everforest_ui_contrast", "low") - vim.api.nvim_set_var("everforest_show_eob", "0") - vim.api.nvim_set_var("everforest_enable_bold", "1") - vim.api.nvim_set_var("everforest_enable_italic", "1") - vim.api.nvim_set_var("everforest_better_performance", "1") - vim.cmd([[colo everforest]]) + { + "sainnhe/everforest", + priority = 1000, + config = function() + -- Settings for colorscheme + vim.api.nvim_set_var("everforest_background", "hard") + vim.api.nvim_set_var("everforest_transparent_background", "1") + vim.api.nvim_set_var("everforest_ui_contrast", "low") + vim.api.nvim_set_var("everforest_show_eob", "0") + vim.api.nvim_set_var("everforest_enable_bold", "1") + vim.api.nvim_set_var("everforest_enable_italic", "1") + vim.api.nvim_set_var("everforest_better_performance", "1") + vim.cmd([[colo everforest]]) - -- Settings to override colorscheme - -- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"}) - -- colors of tabline - vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) - vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) - -- color of statusline - vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) - -- color of vertical split line - vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) - -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3a464c" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) - -- color of Floats and FloatBorders - vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) + -- Settings to override colorscheme + -- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"}) + -- colors of tabline + vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) + vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) + -- color of statusline + vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) + -- color of vertical split line + vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) + -- color of the cursorline and cursorlinenumber + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3a464c" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) + -- color of Floats and FloatBorders + vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) - -- autocommand for overrides - vim.api.nvim_create_autocmd("ColorScheme", { - pattern = "everforest", - callback = function() - vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) - vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) - -- color of statusline - vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) - -- color of vertical split line - vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) - -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3c464c" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) - -- color of Floats and FloatBorders - vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) + -- autocommand for overrides + vim.api.nvim_create_autocmd("ColorScheme", { + pattern = "everforest", + callback = function() + vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) + vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) + -- color of statusline + vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) + -- color of vertical split line + vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) + -- color of the cursorline and cursorlinenumber + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3c464c" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) + -- color of Floats and FloatBorders + vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) + end, + }) end, - }) - end, - }, + }, } diff --git a/lua/plugin/gitsigns.lua b/lua/plugin/gitsigns.lua index 930471c..338e99d 100644 --- a/lua/plugin/gitsigns.lua +++ b/lua/plugin/gitsigns.lua @@ -1,39 +1,39 @@ return { - { - 'lewis6991/gitsigns.nvim', - event = "VeryLazy", - config = function() - require('gitsigns').setup({ - preview_config = { - border = 'rounded', - }, - on_attach = function(bufnr) - local gs = package.loaded.gitsigns + { + 'lewis6991/gitsigns.nvim', + event = "VeryLazy", + config = function() + require('gitsigns').setup({ + preview_config = { + border = 'rounded', + }, + on_attach = function(bufnr) + local gs = package.loaded.gitsigns - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end - -- Navigation - map('n', ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '' - end, { expr = true }) + -- Navigation + map('n', ']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '' + end, { expr = true }) - map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' - end, { expr = true }) + map('n', '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '' + end, { expr = true }) - -- Actions - map('n', 'gB', function() gs.blame_line { full = true } end) - map('n', 'gb', gs.toggle_current_line_blame) - end - }) - end, - } + -- Actions + map('n', 'gB', function() gs.blame_line { full = true } end) + map('n', 'gb', gs.toggle_current_line_blame) + end + }) + end, + } } diff --git a/lua/plugin/gruvbox-material.lua b/lua/plugin/gruvbox-material.lua index 81c12a1..00b4076 100644 --- a/lua/plugin/gruvbox-material.lua +++ b/lua/plugin/gruvbox-material.lua @@ -1,64 +1,64 @@ return { - { - "sainnhe/gruvbox-material", - lazy = true, - config = function() - -- Settings for colorscheme - vim.api.nvim_set_var("gruvbox_material_background", "hard") - vim.api.nvim_set_var("gruvbox_material_transparent_background", "1") - vim.api.nvim_set_var("gruvbox_material_ui_contrast", "low") - vim.api.nvim_set_var("gruvbox_material_show_eob", "0") - vim.api.nvim_set_var("gruvbox_material_enable_bold", "1") - vim.api.nvim_set_var("gruvbox_material_enable_italic", "1") - vim.api.nvim_set_var("gruvbox_material_better_performance", "1") - vim.cmd([[colo gruvbox-material]]) + { + "sainnhe/gruvbox-material", + lazy = true, + config = function() + -- Settings for colorscheme + vim.api.nvim_set_var("gruvbox_material_background", "hard") + vim.api.nvim_set_var("gruvbox_material_transparent_background", "1") + vim.api.nvim_set_var("gruvbox_material_ui_contrast", "low") + vim.api.nvim_set_var("gruvbox_material_show_eob", "0") + vim.api.nvim_set_var("gruvbox_material_enable_bold", "1") + vim.api.nvim_set_var("gruvbox_material_enable_italic", "1") + vim.api.nvim_set_var("gruvbox_material_better_performance", "1") + vim.cmd([[colo gruvbox-material]]) - -- Settings to override colorscheme - -- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"}) - -- colors of tabline - vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) - vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) - -- color of statusline - vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) - -- color of vertical split line - vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) - -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) - -- color of Floats and FloatBorders - vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) + -- Settings to override colorscheme + -- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"}) + -- colors of tabline + vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) + vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) + -- color of statusline + vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) + -- color of vertical split line + vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) + -- color of the cursorline and cursorlinenumber + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) + -- color of Floats and FloatBorders + vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) - -- autocommand for overrides - vim.api.nvim_create_autocmd("ColorScheme", { - pattern = "gruvbox-material", - callback = function() - vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) - vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) - -- color of statusline - vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) - -- color of vertical split line - vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) - -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) - -- color of Floats and FloatBorders - vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) + -- autocommand for overrides + vim.api.nvim_create_autocmd("ColorScheme", { + pattern = "gruvbox-material", + callback = function() + vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) + vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) + -- color of statusline + vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) + -- color of vertical split line + vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) + -- color of the cursorline and cursorlinenumber + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) + -- color of Floats and FloatBorders + vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) + end, + }) end, - }) - end, - }, + }, } diff --git a/lua/plugin/harpoon.lua b/lua/plugin/harpoon.lua index f158430..b7d297f 100644 --- a/lua/plugin/harpoon.lua +++ b/lua/plugin/harpoon.lua @@ -1,31 +1,31 @@ return { - { - "ThePrimeagen/harpoon", - branch = "harpoon2", - dependencies = { - "nvim-lua/plenary.nvim", - lazy = true, - }, - config = function() - local harpoon = require("harpoon") - harpoon:setup() + { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { + "nvim-lua/plenary.nvim", + lazy = true, + }, + config = function() + local harpoon = require("harpoon") + harpoon:setup() - vim.keymap.set("n", "a", function() harpoon:list():add() end) - vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + vim.keymap.set("n", "a", function() harpoon:list():add() end) + vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) - vim.keymap.set("n", "n", function() harpoon:list():select(1) end) - vim.keymap.set("n", "e", function() harpoon:list():select(2) end) - vim.keymap.set("n", "i", function() harpoon:list():select(3) end) - vim.keymap.set("n", "o", function() harpoon:list():select(4) end) - vim.keymap.set("n", "1", function() harpoon:list():select(1) end) - vim.keymap.set("n", "2", function() harpoon:list():select(2) end) - vim.keymap.set("n", "3", function() harpoon:list():select(3) end) - vim.keymap.set("n", "4", function() harpoon:list():select(4) end) - vim.keymap.set("n", "5", function() harpoon:list():select(5) end) - vim.keymap.set("n", "6", function() harpoon:list():select(6) end) - vim.keymap.set("n", "7", function() harpoon:list():select(7) end) - vim.keymap.set("n", "8", function() harpoon:list():select(8) end) - vim.keymap.set("n", "9", function() harpoon:list():select(9) end) - end - } + vim.keymap.set("n", "n", function() harpoon:list():select(1) end) + vim.keymap.set("n", "e", function() harpoon:list():select(2) end) + vim.keymap.set("n", "i", function() harpoon:list():select(3) end) + vim.keymap.set("n", "o", function() harpoon:list():select(4) end) + vim.keymap.set("n", "1", function() harpoon:list():select(1) end) + vim.keymap.set("n", "2", function() harpoon:list():select(2) end) + vim.keymap.set("n", "3", function() harpoon:list():select(3) end) + vim.keymap.set("n", "4", function() harpoon:list():select(4) end) + vim.keymap.set("n", "5", function() harpoon:list():select(5) end) + vim.keymap.set("n", "6", function() harpoon:list():select(6) end) + vim.keymap.set("n", "7", function() harpoon:list():select(7) end) + vim.keymap.set("n", "8", function() harpoon:list():select(8) end) + vim.keymap.set("n", "9", function() harpoon:list():select(9) end) + end + } } diff --git a/lua/plugin/indent-blankline.lua b/lua/plugin/indent-blankline.lua index fad971b..9b2a604 100644 --- a/lua/plugin/indent-blankline.lua +++ b/lua/plugin/indent-blankline.lua @@ -1,24 +1,24 @@ return { - { - "lukas-reineke/indent-blankline.nvim", - -- event = "BufReadPre", - main = 'ibl', - config = function() - require("ibl").setup({ - enabled = true, - indent = { - char = "│", - smart_indent_cap = true - }, - whitespace = { - remove_blankline_trail = true, - }, - scope = { - exclude = { - language = { "help", "lazy" } - } - }, - }) - end, - }, + { + "lukas-reineke/indent-blankline.nvim", + -- event = "BufReadPre", + main = 'ibl', + config = function() + require("ibl").setup({ + enabled = true, + indent = { + char = "│", + smart_indent_cap = true + }, + whitespace = { + remove_blankline_trail = true, + }, + scope = { + exclude = { + language = { "help", "lazy" } + } + }, + }) + end, + }, } diff --git a/lua/plugin/lsp.lua b/lua/plugin/lsp.lua index 747b70a..85c5872 100644 --- a/lua/plugin/lsp.lua +++ b/lua/plugin/lsp.lua @@ -18,7 +18,6 @@ return { 'nvim-tree/nvim-web-devicons', }, config = function() - -- setup -- local capabilities = vim.tbl_deep_extend( @@ -83,8 +82,20 @@ return { null_ls.builtins.diagnostics.trail_space.with { disabled_filetypes = { "lua" } }, - null_ls.builtins.code_actions.gitsigns, + null_ls.builtins.code_actions.gitrebase, + null_ls.builtins.diagnostics.checkmake, + null_ls.builtins.diagnostics.cmake_lint, + null_ls.builtins.diagnostics.cppcheck, null_ls.builtins.diagnostics.yamllint, + null_ls.builtins.diagnostics.sqlfluff.with({ + extra_args = { "--dialect", "sqlite" }, + }), + null_ls.builtins.formatting.sqlfluff.with({ + extra_args = { "--dialect", "sqlite" }, + }), + null_ls.builtins.formatting.asmfmt, + null_ls.builtins.formatting.cmake_format, + null_ls.builtins.formatting.yamlfmt, null_ls.builtins.formatting.shfmt, null_ls.builtins.formatting.shellharden, diff --git a/lua/plugin/lualine.lua b/lua/plugin/lualine.lua index 294aa10..055ae24 100644 --- a/lua/plugin/lualine.lua +++ b/lua/plugin/lualine.lua @@ -1,161 +1,161 @@ return { - { - "nvim-lualine/lualine.nvim", - config = function() - vim.api.nvim_set_option("showmode", false) - local custom_gruvbox = require 'lualine.themes.gruvbox-material' - custom_gruvbox.normal.a.bg = '#89b482' - custom_gruvbox.normal.c.bg = '' - custom_gruvbox.insert.a.bg = '#d8a657' - custom_gruvbox.visual.a.bg = '#a9b665' - custom_gruvbox.replace.a.bg = '#ea6962' + { + "nvim-lualine/lualine.nvim", + config = function() + vim.api.nvim_set_option("showmode", false) + local custom_gruvbox = require 'lualine.themes.gruvbox-material' + custom_gruvbox.normal.a.bg = '#89b482' + custom_gruvbox.normal.c.bg = '' + custom_gruvbox.insert.a.bg = '#d8a657' + custom_gruvbox.visual.a.bg = '#a9b665' + custom_gruvbox.replace.a.bg = '#ea6962' - local function lspsaga() - return require('lspsaga.symbol.winbar').get_bar() - end - require('lualine').setup { - options = { - theme = custom_gruvbox, - globalstatus = true, - component_separators = { left = '', right = '' }, - section_separators = { left = '', right = '' }, - disabled_filetypes = { 'netrw', 'Trouble' }, - }, - sections = { - lualine_a = { - { - 'mode', - padding = 1, - } - }, - lualine_b = { - { - 'branch', - icon = '', - color = { fg = '#d8a657', bg = '#141617', gui = 'bold' }, - padding = 1, - }, - { - 'filename', - color = { gui = 'italic', fg = '#d3869b', bg = '#1d2021' }, - padding = 1, - path = 1, - }, - }, - lualine_c = { - { - lspsaga - } - }, - lualine_x = { - { - 'filetype', - color = { bg = '#1d2021', fg = '#d4be98', gui = 'italic' }, - padding = 1, - fmt = function(str) - return (str:gsub("^%l", string.upper)) - end, - }, - { - 'fileformat', - color = { gui = 'italic', bg = '#141617' }, - symbols = { - unix = '(unix)', - dos = '(dos)', - mac = '(mac)', - }, - } + local function lspsaga() + return require('lspsaga.symbol.winbar').get_bar() + end + require('lualine').setup { + options = { + theme = custom_gruvbox, + globalstatus = true, + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = { 'netrw', 'Trouble' }, + }, + sections = { + lualine_a = { + { + 'mode', + padding = 1, + } + }, + lualine_b = { + { + 'branch', + icon = '', + color = { fg = '#d8a657', bg = '#141617', gui = 'bold' }, + padding = 1, + }, + { + 'filename', + color = { gui = 'italic', fg = '#d3869b', bg = '#1d2021' }, + padding = 1, + path = 1, + }, + }, + lualine_c = { + { + lspsaga + } + }, + lualine_x = { + { + 'filetype', + color = { bg = '#1d2021', fg = '#d4be98', gui = 'italic' }, + padding = 1, + fmt = function(str) + return (str:gsub("^%l", string.upper)) + end, + }, + { + 'fileformat', + color = { gui = 'italic', bg = '#141617' }, + symbols = { + unix = '(unix)', + dos = '(dos)', + mac = '(mac)', + }, + } - }, - lualine_y = { - { - 'diagnostics', - color = { gui = 'bold', bg = '#141617' }, - sections = { 'error', 'warn', 'info', 'hint' }, - symbols = { error = "✘ ", warn = " ", info = " ", hint = " " }, - padding = 1, - update_in_insert = true - }, - { - 'diff', - icon = { ' ', color = { bg = '#141617', fg = '#d8a657', gui = 'bold' } }, - color = { gui = 'bold', bg = '#141617' }, - padding = 1, - } - }, - lualine_z = { - { - 'location', - padding = 1, - } - } - }, + }, + lualine_y = { + { + 'diagnostics', + color = { gui = 'bold', bg = '#141617' }, + sections = { 'error', 'warn', 'info', 'hint' }, + symbols = { error = "✘ ", warn = " ", info = " ", hint = " " }, + padding = 1, + update_in_insert = true + }, + { + 'diff', + icon = { ' ', color = { bg = '#141617', fg = '#d8a657', gui = 'bold' } }, + color = { gui = 'bold', bg = '#141617' }, + padding = 1, + } + }, + lualine_z = { + { + 'location', + padding = 1, + } + } + }, - inactive_sections = { - lualine_a = { - { - 'mode', - padding = 1, + inactive_sections = { + lualine_a = { + { + 'mode', + padding = 1, + } + }, + lualine_b = { + { + 'branch', + icon = '', + padding = 1, + }, + { + 'filename', + padding = 1, + path = 1, + } + }, + lualine_c = { + }, + lualine_x = { + { + 'filetype', + color = { gui = 'italic' }, + padding = 1, + fmt = function(str) + return (str:gsub("^%l", string.upper)) + end, + }, + { + 'fileformat', + color = { gui = 'italic' }, + symbols = { + unix = 'Unix', + dos = 'Dos', + mac = 'Mac', + }, + }, + }, + lualine_y = { + { + 'diagnostics', + color = { gui = 'bold', bg = '#141617' }, + sections = { 'error', 'warn', 'info', 'hint' }, + symbols = { error = "✘ ", warn = " ", info = " ", hint = "󰌶 " }, + padding = 1, + update_in_insert = true + }, + { + 'diff', + icon = { ' ', color = { bg = '#141617', gui = 'bold' } }, + color = { gui = 'bold', bg = '#141617' }, + padding = 1, + } + }, + lualine_z = { + { + 'location', + padding = 1, + }, + } + }, } - }, - lualine_b = { - { - 'branch', - icon = '', - padding = 1, - }, - { - 'filename', - padding = 1, - path = 1, - } - }, - lualine_c = { - }, - lualine_x = { - { - 'filetype', - color = { gui = 'italic' }, - padding = 1, - fmt = function(str) - return (str:gsub("^%l", string.upper)) - end, - }, - { - 'fileformat', - color = { gui = 'italic' }, - symbols = { - unix = 'Unix', - dos = 'Dos', - mac = 'Mac', - }, - }, - }, - lualine_y = { - { - 'diagnostics', - color = { gui = 'bold', bg = '#141617' }, - sections = { 'error', 'warn', 'info', 'hint' }, - symbols = { error = "✘ ", warn = " ", info = " ", hint = "󰌶 " }, - padding = 1, - update_in_insert = true - }, - { - 'diff', - icon = { ' ', color = { bg = '#141617', gui = 'bold' } }, - color = { gui = 'bold', bg = '#141617' }, - padding = 1, - } - }, - lualine_z = { - { - 'location', - padding = 1, - }, - } - }, - } - end, - }, + end, + }, } diff --git a/lua/plugin/marks.lua b/lua/plugin/marks.lua index 2157ce9..bb23dc8 100644 --- a/lua/plugin/marks.lua +++ b/lua/plugin/marks.lua @@ -1,12 +1,12 @@ return { - { - "chentoast/marks.nvim", - event = "VeryLazy", - opts = {}, - config = function() - require 'marks'.setup({ - sign_priority = 5, - }) - end, - } + { + "chentoast/marks.nvim", + event = "VeryLazy", + opts = {}, + config = function() + require 'marks'.setup({ + sign_priority = 5, + }) + end, + } } diff --git a/lua/plugin/nvimtree.lua b/lua/plugin/nvimtree.lua index 4a75c8a..e35d7b4 100644 --- a/lua/plugin/nvimtree.lua +++ b/lua/plugin/nvimtree.lua @@ -1,18 +1,18 @@ return { - "nvim-tree/nvim-tree.lua", - version = "*", - lazy = false, - dependencies = { - "nvim-tree/nvim-web-devicons", - }, - keys = { - { "F", "NvimTreeFindFileToggle", desc = "Toggle Filetree" }, - }, - config = function() - require("nvim-tree").setup({ - view = { - width = 56, - }, - }) - end, + "nvim-tree/nvim-tree.lua", + version = "*", + lazy = false, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + keys = { + { "F", "NvimTreeFindFileToggle", desc = "Toggle Filetree" }, + }, + config = function() + require("nvim-tree").setup({ + view = { + width = 56, + }, + }) + end, } diff --git a/lua/plugin/plenary.lua b/lua/plugin/plenary.lua index 46ee96d..0fe75df 100644 --- a/lua/plugin/plenary.lua +++ b/lua/plugin/plenary.lua @@ -1,6 +1,6 @@ return { - { - "nvim-lua/plenary.nvim", - lazy = true, - }, + { + "nvim-lua/plenary.nvim", + lazy = true, + }, } diff --git a/lua/plugin/surround.lua b/lua/plugin/surround.lua index aa80b74..c54b65b 100644 --- a/lua/plugin/surround.lua +++ b/lua/plugin/surround.lua @@ -1,14 +1,14 @@ return { - { - "kylechui/nvim-surround", - version = "*", -- Use for stability; omit to use `main` branch for the latest features - event = "VeryLazy", - config = function() - require("nvim-surround").setup({ - -- Configuration here, or leave empty to use defaults - }) - end - } + { + "kylechui/nvim-surround", + version = "*", -- Use for stability; omit to use `main` branch for the latest features + event = "VeryLazy", + config = function() + require("nvim-surround").setup({ + -- Configuration here, or leave empty to use defaults + }) + end + } } -- Old text Command New text diff --git a/lua/plugin/telescope.lua b/lua/plugin/telescope.lua index 84e8db9..3f7a68c 100644 --- a/lua/plugin/telescope.lua +++ b/lua/plugin/telescope.lua @@ -1,75 +1,75 @@ return { - { - "nvim-telescope/telescope.nvim", - lazy = true, - cmd = "Telescope", - version = false, - config = function() - require('telescope').setup({ - pickers = { - find_files = { - layout_config = { - prompt_position = 'top', - }, - sorting_strategy = 'ascending', - }, - live_grep = { - layout_config = { - prompt_position = 'top', - }, - sorting_strategy = 'ascending', - }, - current_buffer_fuzzy_find = { - layout_config = { - prompt_position = 'top', - }, - sorting_strategy = 'ascending', - }, - grep_string = { - layout_config = { - prompt_position = 'top', - }, - sorting_strategy = 'ascending', - }, - git_files = { - layout_config = { - prompt_position = 'top', - }, - sorting_strategy = 'ascending', - }, - keymaps = { - layout_config = { - prompt_position = 'top', - }, - sorting_strategy = 'ascending', - }, - oldfiles = { - layout_config = { - prompt_position = 'top', - }, - sorting_strategy = 'ascending', - }, - command_history = { - layout_config = { - prompt_position = 'top', - }, - sorting_strategy = 'ascending', - }, + { + "nvim-telescope/telescope.nvim", + lazy = true, + cmd = "Telescope", + version = false, + config = function() + require('telescope').setup({ + pickers = { + find_files = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + live_grep = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + current_buffer_fuzzy_find = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + grep_string = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + git_files = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + keymaps = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + oldfiles = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + command_history = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, + }, + }) + end, + keys = { + { ":", "Telescope command_history", desc = "Command History" }, + { ",", "Telescope buffers show_all_buffers=true", desc = "Switch Buffer" }, + -- find + { "ff", "Telescope find_files", desc = "Find Files" }, + { "fb", "Telescope current_buffer_fuzzy_find", desc = "Find Strings in current Buffer" }, + { "fg", "Telescope live_grep", desc = "Grep Content in Files" }, + { "/", "Telescope current_buffer_fuzzy_find", desc = "Find Strings in current Buffer" }, + { "fh", "Telescope grep_string", desc = "Grep currently hovered String" }, + { "fG", "Telescope git_files", desc = "Find Git Files" }, + { "fk", "Telescope keymaps", desc = "List Keymaps" }, + { "fr", "Telescope oldfiles", desc = "Find Recent Files" }, }, - }) - end, - keys = { - { ":", "Telescope command_history", desc = "Command History" }, - { ",", "Telescope buffers show_all_buffers=true", desc = "Switch Buffer" }, - -- find - { "ff", "Telescope find_files", desc = "Find Files" }, - { "fb", "Telescope current_buffer_fuzzy_find", desc = "Find Strings in current Buffer" }, - { "fg", "Telescope live_grep", desc = "Grep Content in Files" }, - { "/", "Telescope current_buffer_fuzzy_find", desc = "Find Strings in current Buffer" }, - { "fh", "Telescope grep_string", desc = "Grep currently hovered String" }, - { "fG", "Telescope git_files", desc = "Find Git Files" }, - { "fk", "Telescope keymaps", desc = "List Keymaps" }, - { "fr", "Telescope oldfiles", desc = "Find Recent Files" }, }, - }, } diff --git a/lua/plugin/treesitter-context.lua b/lua/plugin/treesitter-context.lua index afa8ad1..43d76d5 100644 --- a/lua/plugin/treesitter-context.lua +++ b/lua/plugin/treesitter-context.lua @@ -1,14 +1,14 @@ return { - { - "nvim-treesitter/nvim-treesitter-context", - event = "VeryLazy", - config = function() - require('treesitter-context').setup { - enable = true, - max_lines = 0, - min_window_height = 0, - line_numbers = true, - } - end - } + { + "nvim-treesitter/nvim-treesitter-context", + event = "VeryLazy", + config = function() + require('treesitter-context').setup { + enable = true, + max_lines = 0, + min_window_height = 0, + line_numbers = true, + } + end + } } diff --git a/lua/plugin/treesitter-textobjects.lua b/lua/plugin/treesitter-textobjects.lua index 2040acd..c43422f 100644 --- a/lua/plugin/treesitter-textobjects.lua +++ b/lua/plugin/treesitter-textobjects.lua @@ -1,68 +1,68 @@ return { - { - "nvim-treesitter/nvim-treesitter-textobjects", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - opts = { - textobjects = { - select = { - enable = true, + { + "nvim-treesitter/nvim-treesitter-textobjects", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + opts = { + textobjects = { + select = { + enable = true, - -- Automatically jump forward to textobj, similar to targets.vim - lookahead = true, + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ap"] = "@parameter.outer", - ["ip"] = "@parameter.inner", - ["ac"] = "@comment.outer", - ["aS"] = "@statement.outer", - ["ae"] = "@block.outer", - ["al"] = "@loop.outer", - ["il"] = "@loop.inner", - ["ar"] = "@return.outer", - ["ir"] = "@return.inner", - ["ia"] = "@assignment.rhs", - ["aa"] = "@assignment.inner", - ["i?"] = "@conditional.inner", - ["a?"] = "@conditional.outer", - ["in"] = "@number.inner", - ["iC"] = "@class.inner", - ["aC"] = "@class.outer", - ["ig"] = "@call.inner", - ["ag"] = "@call.outer", + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ap"] = "@parameter.outer", + ["ip"] = "@parameter.inner", + ["ac"] = "@comment.outer", + ["aS"] = "@statement.outer", + ["ae"] = "@block.outer", + ["al"] = "@loop.outer", + ["il"] = "@loop.inner", + ["ar"] = "@return.outer", + ["ir"] = "@return.inner", + ["ia"] = "@assignment.rhs", + ["aa"] = "@assignment.inner", + ["i?"] = "@conditional.inner", + ["a?"] = "@conditional.outer", + ["in"] = "@number.inner", + ["iC"] = "@class.inner", + ["aC"] = "@class.outer", + ["ig"] = "@call.inner", + ["ag"] = "@call.outer", + + -- You can also use captures from other query groups like `locals.scm` + ["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" }, + }, + -- You can choose the select mode (default is charwise 'v') + -- + -- Can also be a function which gets passed a table with the keys + -- * query_string: eg '@function.inner' + -- * method: eg 'v' or 'o' + -- and should return the mode ('v', 'V', or '') or a table + -- mapping query_strings to modes. + selection_modes = { + ['@parameter.outer'] = 'v', -- charwise + ['@function.outer'] = 'V', -- linewise + }, + -- If you set this to `true` (default is `false`) then any textobject is + -- extended to include preceding or succeeding whitespace. Succeeding + -- whitespace has priority in order to act similarly to eg the built-in + -- `ap`. + -- + -- Can also be a function which gets passed a table with the keys + -- * query_string: eg '@function.inner' + -- * selection_mode: eg 'v' + -- and should return true or false + include_surrounding_whitespace = false, + }, + }, - -- You can also use captures from other query groups like `locals.scm` - ["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" }, - }, - -- You can choose the select mode (default is charwise 'v') - -- - -- Can also be a function which gets passed a table with the keys - -- * query_string: eg '@function.inner' - -- * method: eg 'v' or 'o' - -- and should return the mode ('v', 'V', or '') or a table - -- mapping query_strings to modes. - selection_modes = { - ['@parameter.outer'] = 'v', -- charwise - ['@function.outer'] = 'V', -- linewise - }, - -- If you set this to `true` (default is `false`) then any textobject is - -- extended to include preceding or succeeding whitespace. Succeeding - -- whitespace has priority in order to act similarly to eg the built-in - -- `ap`. - -- - -- Can also be a function which gets passed a table with the keys - -- * query_string: eg '@function.inner' - -- * selection_mode: eg 'v' - -- and should return true or false - include_surrounding_whitespace = false, }, - }, - - }, - config = function(_, opts) - require("nvim-treesitter.configs").setup(opts) - end, - } + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, + } } diff --git a/lua/plugin/treesitter.lua b/lua/plugin/treesitter.lua index a0a7947..0b73d09 100644 --- a/lua/plugin/treesitter.lua +++ b/lua/plugin/treesitter.lua @@ -1,32 +1,32 @@ return { - { - "nvim-treesitter/nvim-treesitter", - version = false, - build = ":TSUpdate", - -- event = "BufReadPre", - opts = { - ensure_installed = { - "c", - "lua", - "rust", - "latex", - "bibtex", - "python", - "vim", - "yaml", - "json", - }, - sync_install = false, - auto_install = true, - highlight = { - enable = true, - disable = { - "markdown", + { + "nvim-treesitter/nvim-treesitter", + version = false, + build = ":TSUpdate", + -- event = "BufReadPre", + opts = { + ensure_installed = { + "c", + "lua", + "rust", + "latex", + "bibtex", + "python", + "vim", + "yaml", + "json", + }, + sync_install = false, + auto_install = true, + highlight = { + enable = true, + disable = { + "markdown", + }, + }, }, - }, - }, - config = function(_, opts) - require("nvim-treesitter.configs").setup(opts) - end, - } + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, + } } diff --git a/lua/plugin/undotree.lua b/lua/plugin/undotree.lua index 6fb2067..418a3fe 100644 --- a/lua/plugin/undotree.lua +++ b/lua/plugin/undotree.lua @@ -1,13 +1,13 @@ return { - { - "mbbill/undotree", - keys = { - { "u", "UndotreeToggle", desc = "toggle undotree" }, - }, - config = function() - vim.g.undotree_WindowLayout = 4 - vim.g.undotree_SplitWidth = 40 - vim.g.undotree_SetFocusWhenToggle = 1 - end - } + { + "mbbill/undotree", + keys = { + { "u", "UndotreeToggle", desc = "toggle undotree" }, + }, + config = function() + vim.g.undotree_WindowLayout = 4 + vim.g.undotree_SplitWidth = 40 + vim.g.undotree_SetFocusWhenToggle = 1 + end + } } diff --git a/lua/plugin/zen.lua b/lua/plugin/zen.lua index 08dcc9e..67281a8 100644 --- a/lua/plugin/zen.lua +++ b/lua/plugin/zen.lua @@ -1,20 +1,20 @@ return { - { - "folke/zen-mode.nvim", - opts = { - window = { - backdrop = 1, - width = 120, - }, - plugins = { - options = { - enabled = true, - showcmd = true, - laststatus = 3, + { + "folke/zen-mode.nvim", + opts = { + window = { + backdrop = 1, + width = 120, + }, + plugins = { + options = { + enabled = true, + showcmd = true, + laststatus = 3, + }, + gitsigns = { enabled = false } + }, + vim.keymap.set("n", "zz", function() require("zen-mode").toggle() end), }, - gitsigns = { enabled = false } - }, - vim.keymap.set("n", "zz", function() require("zen-mode").toggle() end), - }, - } + } } From c371ab161efae5519d987774c5f90be43104af7c Mon Sep 17 00:00:00 2001 From: xesc Date: Thu, 27 Feb 2025 19:24:02 +0100 Subject: [PATCH 40/55] fix null-ls cppcheck, add buffermappings, better window highlighting --- lua/core/autocmd.lua | 12 ++++++++++++ lua/core/remap.lua | 2 ++ lua/core/settings.lua | 6 +++++- lua/plugin/lsp.lua | 1 - 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lua/core/autocmd.lua b/lua/core/autocmd.lua index 06c6958..08d5d93 100644 --- a/lua/core/autocmd.lua +++ b/lua/core/autocmd.lua @@ -18,3 +18,15 @@ vim.api.nvim_create_autocmd({"BufWinEnter"}, { desc = "load view (folds), when opening file", command = "silent! loadview" }) + +vim.api.nvim_create_autocmd("WinEnter", { + callback = function() + vim.wo.cursorline = true + end, +}) + +vim.api.nvim_create_autocmd("WinLeave", { + callback = function() + vim.wo.cursorline = false + end, +}) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index 4b0fa59..3145076 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -19,6 +19,8 @@ vim.api.nvim_set_keymap("n", "", "l", {}) -- buffer operations vim.api.nvim_set_keymap("n", "", "", {}) vim.api.nvim_set_keymap("n", "bd", "bd", {}) +vim.api.nvim_set_keymap("n", "bn", "bnext", {}) +vim.api.nvim_set_keymap("n", "bp", "bprevious", {}) -- quickfix and locationlist vim.api.nvim_set_keymap("n", "", "cnextzz", {}) diff --git a/lua/core/settings.lua b/lua/core/settings.lua index 55a2adb..10897c2 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -73,4 +73,8 @@ vim.opt.backup = false vim.opt.undodir = os.getenv("HOME") .. "/.local/share/nvim/undodir" vim.opt.undofile = true -vim.opt.shortmess = "I" +-- message options +vim.opt.shortmess = "aItTF" + +-- hide buffers instead of closing +vim.opt.hidden = true diff --git a/lua/plugin/lsp.lua b/lua/plugin/lsp.lua index 85c5872..ae3103e 100644 --- a/lua/plugin/lsp.lua +++ b/lua/plugin/lsp.lua @@ -85,7 +85,6 @@ return { null_ls.builtins.code_actions.gitrebase, null_ls.builtins.diagnostics.checkmake, null_ls.builtins.diagnostics.cmake_lint, - null_ls.builtins.diagnostics.cppcheck, null_ls.builtins.diagnostics.yamllint, null_ls.builtins.diagnostics.sqlfluff.with({ extra_args = { "--dialect", "sqlite" }, From cfad61efe21097783e4b49c5dad00399b3afd523 Mon Sep 17 00:00:00 2001 From: xesc Date: Fri, 28 Feb 2025 21:26:18 +0100 Subject: [PATCH 41/55] set tabwidth --- lua/core/settings.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/core/settings.lua b/lua/core/settings.lua index 10897c2..18d6e7f 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -16,9 +16,9 @@ vim.opt.completeopt = 'menu,menuone,noselect' vim.opt.list = true -- correct tabbing -vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 -vim.opt.shiftwidth = 4 +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 vim.opt.expandtab = true -- enable foldcolumn From 711138561fc3a55ad48bb679638d8a9d97d5dc0d Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 2 Mar 2025 16:01:53 +0100 Subject: [PATCH 42/55] add fugitive --- lua/plugin/fugitive.lua | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lua/plugin/fugitive.lua diff --git a/lua/plugin/fugitive.lua b/lua/plugin/fugitive.lua new file mode 100644 index 0000000..cb245d9 --- /dev/null +++ b/lua/plugin/fugitive.lua @@ -0,0 +1,8 @@ +return { + { + 'tpope/vim-fugitive', + config = function() + vim.api.nvim_set_keymap("n", "G", "Git", {}) + end, + } +} From a5fe01560a4173dc719651c1f06ee856dc779f9c Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 2 Mar 2025 16:22:03 +0100 Subject: [PATCH 43/55] fugitive: add mapping for Git cmd --- lua/plugin/fugitive.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/plugin/fugitive.lua b/lua/plugin/fugitive.lua index cb245d9..754d632 100644 --- a/lua/plugin/fugitive.lua +++ b/lua/plugin/fugitive.lua @@ -2,7 +2,8 @@ return { { 'tpope/vim-fugitive', config = function() - vim.api.nvim_set_keymap("n", "G", "Git", {}) + vim.api.nvim_set_keymap("n", "G", "Git", {}) + vim.api.nvim_set_keymap("n", "Gr", "Git", {}) end, } } From 46e71b24616daffd80bf62ba3f674ce1f1b247be Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 2 Mar 2025 16:32:48 +0100 Subject: [PATCH 44/55] remove fugitive --- lua/plugin/fugitive.lua | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 lua/plugin/fugitive.lua diff --git a/lua/plugin/fugitive.lua b/lua/plugin/fugitive.lua deleted file mode 100644 index 754d632..0000000 --- a/lua/plugin/fugitive.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { - 'tpope/vim-fugitive', - config = function() - vim.api.nvim_set_keymap("n", "G", "Git", {}) - vim.api.nvim_set_keymap("n", "Gr", "Git", {}) - end, - } -} From 36aa117fbf08af6b35acd414c52e65124799c8a8 Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 2 Mar 2025 16:46:34 +0100 Subject: [PATCH 45/55] remove obsolete mappings, add mappings for staging and unstaging of seletcd hunks --- lua/plugin/gitsigns.lua | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/lua/plugin/gitsigns.lua b/lua/plugin/gitsigns.lua index 338e99d..de1c022 100644 --- a/lua/plugin/gitsigns.lua +++ b/lua/plugin/gitsigns.lua @@ -15,23 +15,12 @@ return { opts.buffer = bufnr vim.keymap.set(mode, l, r, opts) end - - -- Navigation - map('n', ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '' - end, { expr = true }) - - map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' - end, { expr = true }) - - -- Actions map('n', 'gB', function() gs.blame_line { full = true } end) map('n', 'gb', gs.toggle_current_line_blame) + map('n', 'gs', gs.stage_hunk) -- git stage this + map('v', 'gs', gs.stage_hunk) -- git stage this + map('n', 'gus', gs.undo_stage_hunk) -- git undo stage this + map('v', 'gus', gs.undo_stage_hunk) -- git undo stage this end }) end, From 6be73d9a952103dd489e125b8ebacea9731efa4e Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 2 Mar 2025 20:55:04 +0100 Subject: [PATCH 46/55] add better mappings for pasting & quitting, removed old mappings --- lua/core/remap.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index 3145076..bb1c704 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -40,24 +40,30 @@ vim.api.nvim_set_keymap("v", "K", ":m '<-2gv=gv", {}) vim.api.nvim_set_keymap("n", "d", "\"_d", {}) vim.api.nvim_set_keymap("v", "d", "\"_d", {}) +-- paste without yanking selected text +vim.api.nvim_set_keymap("x", "p", [["_dP]], {}) + -- copy to system clipboard vim.api.nvim_set_keymap("n", "y", "\"+y", {}) vim.api.nvim_set_keymap("v", "y", "\"+y", {}) vim.api.nvim_set_keymap("n", "Y", "\"+Y", {}) -- paste from system clipboard -vim.api.nvim_set_keymap("n", "p", "\"+p", {}) +vim.api.nvim_set_keymap("n", "P", "\"+p", {}) -- make current file (un)executable vim.api.nvim_set_keymap("n", "mx", ":exec 'w' !chmod +x %", { silent = true }) vim.api.nvim_set_keymap("n", "mX", ":exec 'w' !chmod -x %", { silent = true }) --- mk- and loadview for view-persistance -vim.api.nvim_set_keymap("n", "vm", ":exec 'w' mkview ", {silent = true}) -vim.api.nvim_set_keymap("n", "vl", ":exec 'w' loadview ", {silent = true}) - -- for fast save vim.api.nvim_set_keymap("n", "", ":exec 'w'", {silent = true}) -- r for redo vim.api.nvim_set_keymap("n", "r", ":redo ", {silent = true}) + +-- better ZQ +vim.api.nvim_set_keymap("n", "zq", ":q!", {}) + +-- even better +vim.api.nvim_set_keymap("n", "XX", ":qa!", {}) +vim.api.nvim_set_keymap("n", "XZZ", ":wqa!", {}) From f5b49f75af3dd8a08acb6926851cfea5e4c04909 Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 2 Mar 2025 20:56:34 +0100 Subject: [PATCH 47/55] add missing --- lua/core/remap.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index bb1c704..d07f229 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -62,8 +62,8 @@ vim.api.nvim_set_keymap("n", "", ":exec 'w'", {silent = true vim.api.nvim_set_keymap("n", "r", ":redo ", {silent = true}) -- better ZQ -vim.api.nvim_set_keymap("n", "zq", ":q!", {}) +vim.api.nvim_set_keymap("n", "zq", ":q!", {}) -- even better -vim.api.nvim_set_keymap("n", "XX", ":qa!", {}) -vim.api.nvim_set_keymap("n", "XZZ", ":wqa!", {}) +vim.api.nvim_set_keymap("n", "XX", ":qa!", {}) +vim.api.nvim_set_keymap("n", "XZZ", ":wqa!", {}) From c633ecd9174595b4a1c4da4fdcc33d0006b8e227 Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 2 Mar 2025 20:59:41 +0100 Subject: [PATCH 48/55] more quitting aliases --- lua/core/remap.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index d07f229..cfca6c0 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -67,3 +67,4 @@ vim.api.nvim_set_keymap("n", "zq", ":q!", {}) -- even better vim.api.nvim_set_keymap("n", "XX", ":qa!", {}) vim.api.nvim_set_keymap("n", "XZZ", ":wqa!", {}) +vim.api.nvim_set_keymap("n", "x", ":q", {}) From 17d733cc098691fe319a6495eccaea4b7476ad50 Mon Sep 17 00:00:00 2001 From: xesc Date: Tue, 4 Mar 2025 11:04:58 +0100 Subject: [PATCH 49/55] enable wrap --- lua/core/settings.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/core/settings.lua b/lua/core/settings.lua index 18d6e7f..18b9d69 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -24,8 +24,8 @@ vim.opt.expandtab = true -- enable foldcolumn vim.wo.foldcolumn = "2" --- disable wrap -vim.opt.wrap = false +-- enable wrap +vim.opt.wrap = true -- allow "@" in filenames vim.opt.isfname:append("@-@") From ab319539fd9aaa22fe237b00437c636575d0ade3 Mon Sep 17 00:00:00 2001 From: xesc Date: Thu, 6 Mar 2025 20:42:15 +0100 Subject: [PATCH 50/55] fix new mappings --- ftplugin/tex.lua | 2 +- lua/core/remap.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ftplugin/tex.lua b/ftplugin/tex.lua index 895e50c..30b0cff 100644 --- a/ftplugin/tex.lua +++ b/ftplugin/tex.lua @@ -5,7 +5,7 @@ vim.api.nvim_buf_set_keymap(0, "i", "", " :exec 'w' :exec '!xelat vim.api.nvim_buf_set_keymap(0, "v", "", " :exec 'w' :exec '!xelatex %'", {}) -- Open PDF-Viewer from LaTeX-file -vim.api.nvim_buf_set_keymap(0, "n", "cz", ":silent !zathura --fork %:r.pdf& ", {}) +vim.api.nvim_buf_set_keymap(0, "n", "cz", ":silent !zathura --fork %:r.pdf& ", {}) vim.api.nvim_buf_set_keymap(0, "n", "", ":silent !zathura --fork %:r.pdf& ", {}) vim.api.nvim_buf_set_keymap(0, "i", "", " :silent !zathura --fork %:r.pdf& ", {}) vim.api.nvim_buf_set_keymap(0, "v", "", " :silent !zathura --fork %:r.pdf& ", {}) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index cfca6c0..ef76cab 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -65,6 +65,6 @@ vim.api.nvim_set_keymap("n", "r", ":redo ", {silent = true}) vim.api.nvim_set_keymap("n", "zq", ":q!", {}) -- even better -vim.api.nvim_set_keymap("n", "XX", ":qa!", {}) -vim.api.nvim_set_keymap("n", "XZZ", ":wqa!", {}) +vim.api.nvim_set_keymap("n", "XX", ":qa!", {}) +vim.api.nvim_set_keymap("n", "XZZ", ":wqa!", {}) vim.api.nvim_set_keymap("n", "x", ":q", {}) From 7d89c194034ddbe5512eb572b7a82d4ff2ef2d1e Mon Sep 17 00:00:00 2001 From: xesc Date: Tue, 11 Mar 2025 19:53:04 +0100 Subject: [PATCH 51/55] add mapping for editing --- lua/core/remap.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index ef76cab..00b96fd 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -68,3 +68,6 @@ vim.api.nvim_set_keymap("n", "zq", ":q!", {}) vim.api.nvim_set_keymap("n", "XX", ":qa!", {}) vim.api.nvim_set_keymap("n", "XZZ", ":wqa!", {}) vim.api.nvim_set_keymap("n", "x", ":q", {}) + +-- fast editing +vim.api.nvim_set_keymap("n", "E", ":e ", {}) From adf806489e17189813a11a3961dd3033c6a292d6 Mon Sep 17 00:00:00 2001 From: xesc Date: Fri, 14 Mar 2025 22:43:59 +0100 Subject: [PATCH 52/55] add mason-null-ls for convinience --- lua/plugin/lsp.lua | 653 +++++++++++++++++++++++---------------------- 1 file changed, 330 insertions(+), 323 deletions(-) diff --git a/lua/plugin/lsp.lua b/lua/plugin/lsp.lua index ae3103e..a6dbaf3 100644 --- a/lua/plugin/lsp.lua +++ b/lua/plugin/lsp.lua @@ -1,334 +1,341 @@ return { - { - "neovim/nvim-lspconfig", - dependencies = { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "hrsh7th/nvim-cmp", - "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", - "nvim-telescope/telescope-ui-select.nvim", - "nvimtools/none-ls.nvim", - "nvimdev/lspsaga.nvim", - 'nvim-treesitter/nvim-treesitter', - 'nvim-tree/nvim-web-devicons', + { + "neovim/nvim-lspconfig", + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "hrsh7th/nvim-cmp", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "nvim-telescope/telescope-ui-select.nvim", + "nvimtools/none-ls.nvim", + "nvimdev/lspsaga.nvim", + 'nvim-treesitter/nvim-treesitter', + 'nvim-tree/nvim-web-devicons', + "jay-babu/mason-null-ls.nvim", + }, + config = function() + -- setup -- + + local capabilities = vim.tbl_deep_extend( + "force", + {}, + vim.lsp.protocol.make_client_capabilities() + ) + + -- mason -- + + require("mason").setup({ + PATH = "append", + ui = { + border = "rounded", + icons = { + package_installed = "✔", + package_pending = "➜", + package_uninstalled = "✘" + } + } + }) + + -- mason lspconfig -- + + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "clangd", + "rust_analyzer", }, - config = function() - -- setup -- - - local capabilities = vim.tbl_deep_extend( - "force", - {}, - vim.lsp.protocol.make_client_capabilities() - ) - - -- mason -- - - require("mason").setup({ - PATH = "append", - ui = { - border = "rounded", - icons = { - package_installed = "✔", - package_pending = "➜", - package_uninstalled = "✘" - } - } - }) - - -- mason lspconfig -- - - require("mason-lspconfig").setup({ - ensure_installed = { - "lua_ls", - "clangd", - "rust_analyzer", - }, - handlers = { - -- The first entry (without a key) will be the default handler - -- and will be called for each installed server that doesn't have - -- a dedicated handler. - function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup { - capabilities = capabilities - } - end, - } - }) - - -- telescope ui for null-ls - - require("telescope").setup { - extensions = { - ["ui-select"] = { - -- require("telescope.themes").get_dropdown { - -- -- even more opts - -- } - } - } + handlers = { + -- The first entry (without a key) will be the default handler + -- and will be called for each installed server that doesn't have + -- a dedicated handler. + function(server_name) -- default handler (optional) + require("lspconfig")[server_name].setup { + capabilities = capabilities } - require("telescope").load_extension("ui-select") - - - -- null-ls (none-ls) - - local null_ls = require('null-ls') - require("null-ls").setup({ - sources = { - null_ls.builtins.diagnostics.trail_space.with { - disabled_filetypes = { "lua" } - }, - null_ls.builtins.code_actions.gitrebase, - null_ls.builtins.diagnostics.checkmake, - null_ls.builtins.diagnostics.cmake_lint, - null_ls.builtins.diagnostics.yamllint, - null_ls.builtins.diagnostics.sqlfluff.with({ - extra_args = { "--dialect", "sqlite" }, - }), - null_ls.builtins.formatting.sqlfluff.with({ - extra_args = { "--dialect", "sqlite" }, - }), - null_ls.builtins.formatting.asmfmt, - null_ls.builtins.formatting.cmake_format, - - null_ls.builtins.formatting.yamlfmt, - null_ls.builtins.formatting.shfmt, - null_ls.builtins.formatting.shellharden, - }, - }) - - -- lspsaga (pretty lsp-windows) - - require('lspsaga').setup({ - symbol_in_winbar = { - enable = false, - show_file = false - }, - finder = { - keys = { - toggle_or_open = "", - quit = { '', 'q' } - } - }, - outline = { - win_position = 'right', - win_width = 32, - auto_preview = true, - }, - lightbulb = { - enable = false - }, - ui = { - code_action = '', - title = true, - border = 'rounded', - }, - rename = { - in_select = false, - keys = { - quit = { '', 'q' }, - select = '' - } - }, - hover_doc = { - open_cmd = '!firefox' - }, - code_action = { - keys = { - quit = { '', 'q' } - }, - extend_gitsigns = false, - }, - definition = { - keys = { - quit = { '', 'q' }, - }, - }, - diagnostic = { - border_follow = true, - extend_relatedInformation = true, - keys = { - quit = { '', 'q' }, - quit_in_show = { '', 'q' }, - } - } - }) - - -- autocomplete -- - - local kind_icons = { - Text = "", - Method = "󰆧", - Function = "󰊕", - Constructor = "", - Field = "󰇽", - Variable = "󰂡", - Class = "󰠱", - Interface = "", - Module = "", - Property = "󰜢", - Unit = "", - Value = "󰎠", - Enum = "", - Keyword = "󰌋", - Snippet = "", - Color = "󰏘", - File = "󰈙", - Reference = "", - Folder = "󰉋", - EnumMember = "", - Constant = "󰏿", - Struct = "", - Event = "", - Operator = "󰆕", - TypeParameter = "󰅲" + end, + clangd = function() + require("lspconfig").clangd.setup { + on_attach = function(client) + client.server_capabilities.documentFormattingProvider = false + client.server_capabilities.documentRangeFormattingProvider = false + end, } + end, + } + }) - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and - vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + -- telescope ui for null-ls + + require("telescope").setup { + extensions = { + ["ui-select"] = { + -- require("telescope.themes").get_dropdown { + -- -- even more opts + -- } + } + } + } + require("telescope").load_extension("ui-select") + + + -- null-ls (none-ls) + + local null_ls = require('null-ls') + require("null-ls").setup({ + sources = { + null_ls.builtins.diagnostics.trail_space.with { + disabled_filetypes = { "lua" } + }, + null_ls.builtins.diagnostics.sqlfluff.with({ + extra_args = { "--dialect", "sqlite" }, + }), + null_ls.builtins.formatting.sqlfluff.with({ + extra_args = { "--dialect", "sqlite" }, + }), + null_ls.builtins.formatting.clang_format.with({ + extra_args = { "-style={BasedOnStyle: llvm, IndentWidth: 2, BreakBeforeBraces: Linux, ColumnLimit: 0}" } + }) + }, + }) + + require("mason-null-ls").setup({ + ensure_installed = { "clang_format", "shellharden", "shfmt" } + }) + + + -- lspsaga (pretty lsp-windows) + + require('lspsaga').setup({ + symbol_in_winbar = { + enable = false, + show_file = false + }, + finder = { + keys = { + toggle_or_open = "", + quit = { '', 'q' } + } + }, + outline = { + win_position = 'right', + win_width = 32, + auto_preview = true, + }, + lightbulb = { + enable = false + }, + ui = { + code_action = '', + title = true, + border = 'rounded', + }, + rename = { + in_select = false, + keys = { + quit = { '', 'q' }, + select = '' + } + }, + hover_doc = { + open_cmd = '!firefox' + }, + code_action = { + keys = { + quit = { '', 'q' } + }, + extend_gitsigns = false, + }, + definition = { + keys = { + quit = { '', 'q' }, + }, + }, + diagnostic = { + border_follow = true, + extend_relatedInformation = true, + keys = { + quit = { '', 'q' }, + quit_in_show = { '', 'q' }, + } + } + }) + + -- autocomplete -- + + local kind_icons = { + Text = "", + Method = "󰆧", + Function = "󰊕", + Constructor = "", + Field = "󰇽", + Variable = "󰂡", + Class = "󰠱", + Interface = "", + Module = "", + Property = "󰜢", + Unit = "", + Value = "󰎠", + Enum = "", + Keyword = "󰌋", + Snippet = "", + Color = "󰏘", + File = "󰈙", + Reference = "", + Folder = "󰉋", + EnumMember = "", + Constant = "󰏿", + Struct = "", + Event = "", + Operator = "󰆕", + TypeParameter = "󰅲" + } + + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and + vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + local luasnip = require("luasnip") + local cmp = require("cmp") + cmp.setup({ + formatting = { + format = function(entry, vim_item) + -- Kind icons + vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind + -- Source + vim_item.menu = ({ + buffer = "", + nvim_lsp = "", + luasnip = "", + nvim_lua = "", + latex_symbols = "", + })[entry.source.name] + return vim_item + end + }, + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.abort() + else + cmp.complete() end + end), + [''] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- they way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, -- For luasnip users. + { + name = 'buffer', + option = { + get_bufnrs = function() + return vim.api.nvim_list_bufs() + end + }, + }, + }, { + }), + -- Set configuration for specific filetype. + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } + }), + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) + }) + }) - local luasnip = require("luasnip") - local cmp = require("cmp") - cmp.setup({ - formatting = { - format = function(entry, vim_item) - -- Kind icons - vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind - -- Source - vim_item.menu = ({ - buffer = "", - nvim_lsp = "", - luasnip = "", - nvim_lua = "", - latex_symbols = "", - })[entry.source.name] - return vim_item - end - }, - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.abort() - else - cmp.complete() - end - end), - [''] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- they way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, -- For luasnip users. - { - name = 'buffer', - option = { - get_bufnrs = function() - return vim.api.nvim_list_bufs() - end - }, - }, - }, { - }), - -- Set configuration for specific filetype. - -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline({ '/', '?' }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } - }), - -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) - }) - }) + -- config -- - -- config -- + vim.diagnostic.config({ + update_in_insert = true, + signs = { text = { [vim.diagnostic.severity.ERROR] = "✘ ", [vim.diagnostic.severity.WARN] = " ", [vim.diagnostic.severity.HINT] = " ", [vim.diagnostic.severity.INFO] = " " } }, + float = { + focusable = false, + style = "minimal", + border = "rounded", + source = "always", + header = "", + prefix = "", + }, + virtual_text = { + prefix = '●', -- Could be '●', '■', 'x', '▎', or anything else + }, + }) - vim.diagnostic.config({ - update_in_insert = true, - signs = { text = { [vim.diagnostic.severity.ERROR] = "✘ ", [vim.diagnostic.severity.WARN] = " ", [vim.diagnostic.severity.HINT] = " ", [vim.diagnostic.severity.INFO] = " " } }, - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, - virtual_text = { - prefix = '●', -- Could be '●', '■', 'x', '▎', or anything else - }, - }) + -- keymaps -- - -- keymaps -- - - local opts = { noremap = true, silent = true } - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) - vim.keymap.set('n', 'K', function() vim.lsp.buf.hover { border = "rounded" } end, opts) - vim.keymap.set('n', 'k', function() vim.lsp.buf.hover { border = "rounded" } end, opts) - vim.keymap.set('n', 'cl', "LspInfo", opts) - vim.keymap.set('n', 'cd', vim.diagnostic.open_float, opts) - vim.keymap.set('n', '[n', vim.diagnostic.goto_prev, opts) - vim.keymap.set('n', ']n', vim.diagnostic.goto_next, opts) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) - vim.keymap.set('n', 'cf', function() vim.lsp.buf.format { async = true } end, opts) - vim.keymap.set('v', 'cf', function() vim.lsp.buf.format { async = true } end, opts) - vim.keymap.set("n", "fws", function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) - vim.keymap.set('n', '', "Lspsaga term_toggle", opts) - vim.keymap.set('t', '', "Lspsaga term_toggle", opts) - vim.keymap.set('n', 'so', 'Lspsaga outline', opts) - vim.keymap.set('n', 'sf', 'Lspsaga finder', opts) - vim.keymap.set('n', 'sd', 'Lspsaga peek_definition', opts) - vim.keymap.set('n', 'cw', "Lspsaga rename mode=n", opts) - vim.keymap.set('n', 'cA', vim.lsp.buf.code_action, opts) - vim.keymap.set('n', 'ca', 'Lspsaga code_action', opts) - end, - } + local opts = { noremap = true, silent = true } + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + vim.keymap.set('n', 'K', function() vim.lsp.buf.hover { border = "rounded" } end, opts) + vim.keymap.set('n', 'k', function() vim.lsp.buf.hover { border = "rounded" } end, opts) + vim.keymap.set('n', 'cl', "LspInfo", opts) + vim.keymap.set('n', 'cd', vim.diagnostic.open_float, opts) + vim.keymap.set('n', '[n', vim.diagnostic.goto_prev, opts) + vim.keymap.set('n', ']n', vim.diagnostic.goto_next, opts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) + vim.keymap.set('n', 'cf', function() vim.lsp.buf.format { async = true } end, opts) + vim.keymap.set('v', 'cf', function() vim.lsp.buf.format { async = true } end, opts) + vim.keymap.set("n", "fws", function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) + vim.keymap.set('n', '', "Lspsaga term_toggle", opts) + vim.keymap.set('t', '', "Lspsaga term_toggle", opts) + vim.keymap.set('n', 'so', 'Lspsaga outline', opts) + vim.keymap.set('n', 'sf', 'Lspsaga finder', opts) + vim.keymap.set('n', 'sd', 'Lspsaga peek_definition', opts) + vim.keymap.set('n', 'cw', "Lspsaga rename mode=n", opts) + vim.keymap.set('n', 'cA', vim.lsp.buf.code_action, opts) + vim.keymap.set('n', 'ca', 'Lspsaga code_action', opts) + end, + } } From 55361c475dcc9ba862111adf870ff03b4953c0db Mon Sep 17 00:00:00 2001 From: xesc Date: Fri, 14 Mar 2025 22:53:42 +0100 Subject: [PATCH 53/55] add mapping for vertical-resize --- lua/core/remap.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index 00b96fd..1d68274 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -71,3 +71,6 @@ vim.api.nvim_set_keymap("n", "x", ":q", {}) -- fast editing vim.api.nvim_set_keymap("n", "E", ":e ", {}) + +-- vertical resize +vim.api.nvim_set_keymap("n", "vr", ":vertical-resize ", {}) From 0b6e5cc89304a40e5dd8fe018b4ac587887a473d Mon Sep 17 00:00:00 2001 From: xesc Date: Sat, 15 Mar 2025 19:31:06 +0100 Subject: [PATCH 54/55] fix clangd special handling in lsp --- lua/plugin/lsp.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugin/lsp.lua b/lua/plugin/lsp.lua index a6dbaf3..710ff41 100644 --- a/lua/plugin/lsp.lua +++ b/lua/plugin/lsp.lua @@ -60,6 +60,7 @@ return { end, clangd = function() require("lspconfig").clangd.setup { + capabilities = capabilities, on_attach = function(client) client.server_capabilities.documentFormattingProvider = false client.server_capabilities.documentRangeFormattingProvider = false From d990179adf19bd641103eb59e60fcdcc612fdf6b Mon Sep 17 00:00:00 2001 From: xesc Date: Sat, 15 Mar 2025 19:34:37 +0100 Subject: [PATCH 55/55] fix signature hover in lsp --- lua/plugin/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugin/lsp.lua b/lua/plugin/lsp.lua index 710ff41..90735cd 100644 --- a/lua/plugin/lsp.lua +++ b/lua/plugin/lsp.lua @@ -328,7 +328,7 @@ return { vim.keymap.set('n', 'cf', function() vim.lsp.buf.format { async = true } end, opts) vim.keymap.set('v', 'cf', function() vim.lsp.buf.format { async = true } end, opts) vim.keymap.set("n", "fws", function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) + vim.keymap.set("i", "", function() vim.lsp.buf.signature_help {border = "rounded" } end, opts) vim.keymap.set('n', '', "Lspsaga term_toggle", opts) vim.keymap.set('t', '', "Lspsaga term_toggle", opts) vim.keymap.set('n', 'so', 'Lspsaga outline', opts)