From 7fd18eeda9bff733e2fbdeea51aa05d0617903e9 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sun, 10 Dec 2023 16:57:09 +0100 Subject: [PATCH 01/69] 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 <xesc@xesc.de> Date: Sun, 10 Dec 2023 18:52:19 +0100 Subject: [PATCH 02/69] 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 <xesc@xesc.de> Date: Sun, 10 Dec 2023 19:31:07 +0100 Subject: [PATCH 03/69] 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 { { "<leader>fb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" }, { "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" }, { "<leader>/", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" }, - { "<leader>fl", "<cmd>Telescope grep_string<cr>", desc = "Grep currently hovered String" }, + { "<leader>fl", "<cmd>Telescope grep_string<cr>", desc = "Grep currently hovered String" }, { "<leader>fG", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" }, - { "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "Find Git Files" }, + { "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "List Keymaps" }, { "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Find Recent Files" }, }, }, From b21a66b5386595de53a013cf903ea55ef9f9fa39 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sun, 10 Dec 2023 20:01:00 +0100 Subject: [PATCH 04/69] 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', '<space>cd', vim.diagnostic.open_float, opts) vim.keymap.set('n', '<space>cl', "<cmd>LspInfo<cr>", opts) @@ -38,9 +38,7 @@ return { vim.keymap.set('v', '<space>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 <xesc@xesc.de> Date: Sun, 17 Dec 2023 13:59:08 +0100 Subject: [PATCH 05/69] 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 <xesc@xesc.de> Date: Sun, 24 Dec 2023 01:00:01 +0100 Subject: [PATCH 06/69] 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 = { - { "<leader>GG", "<cmd>Git <cr>", desc = "git" }, - { "<leader>Gs", "<cmd>Git status <cr>", desc = "git status" }, - { "<leader>Gd", "<cmd>Git diff <cr>", desc = "git diff" }, - { "<leader>GD", "<cmd>Git diff --staged <cr>", desc = "git diff --staged" }, - { "<leader>Gl", "<cmd>Git log --graph <cr>", desc = "git log --graph" }, - { "<leader>Ga", "<cmd>Git add --interactive <cr>", desc = "git add" }, - { "<leader>GA", "<cmd>Git add -A <cr>", desc = "git add -A " }, - { "<leader>Gc", "<cmd>Git commit <cr>", desc = "git commit" }, - { "<leader>GC", "<cmd>Git commit --amend <cr>", desc = "git commit --amend " }, - { "<leader>Gp", "<cmd>Git push <cr>", desc = "git push" }, - { "<leader>GP", "<cmd>Git pull <cr>", desc = "git pull" }, - }, - } + { + 'tpope/vim-fugitive', + keys = { + { "<leader>gG", "<cmd>Git <cr>", desc = "git" }, + { "<leader>gs", "<cmd>Git status <cr>", desc = "git status" }, + { "<leader>gd", "<cmd>Git diff <cr>", desc = "git diff" }, + { "<leader>gD", "<cmd>Git diff --staged <cr>", desc = "git diff --staged" }, + { "<leader>gl", "<cmd>Git log --graph <cr>", desc = "git log --graph" }, + { "<leader>ga", "<cmd>Git add --interactive <cr>", desc = "git add" }, + { "<leader>gA", "<cmd>Git add -A <cr>", desc = "git add -A " }, + { "<leader>gc", "<cmd>Git commit <cr>", desc = "git commit" }, + { "<leader>gC", "<cmd>Git commit --amend <cr>", desc = "git commit --amend " }, + { "<leader>gCN", "<cmd>Git commit --amend --no-edit <cr>", desc = "git commit --amend " }, + { "<leader>gp", "<cmd>Git push <cr>", desc = "git push" }, + { "<leader>gP", "<cmd>Git pull <cr>", 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' }, '<leader>hs', ':Gitsigns stage_hunk<CR>') - map({ 'n', 'v' }, '<leader>hr', ':Gitsigns reset_hunk<CR>') - map('n', '<leader>hS', gs.stage_buffer) - map('n', '<leader>hu', gs.undo_stage_hunk) - map('n', '<leader>hR', gs.reset_buffer) - map('n', '<leader>hp', gs.preview_hunk) - map('n', '<leader>hb', function() gs.blame_line { full = true } end) - map('n', '<leader>tb', gs.toggle_current_line_blame) - map('n', '<leader>hd', gs.diffthis) - map('n', '<leader>hD', function() gs.diffthis('~') end) - map('n', '<leader>td', gs.toggle_deleted) + map('n', '<leader>gB', function() gs.blame_line { full = true } end) + map('n', '<leader>gb', gs.toggle_current_line_blame) - -- Text object - map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>') 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 = "<leader>sa", - delete = "<leader>sd", - find = "<leader>sf", - find_left = "<leader>sF", - highlight = "<leader>sh", - replace = "<leader>sr", - update_n_lines = "<leader>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 = { - { "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" }, - { "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" }, - -- find - { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" }, - { "<leader>fb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" }, - { "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" }, - { "<leader>/", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" }, - { "<leader>fl", "<cmd>Telescope grep_string<cr>", desc = "Grep currently hovered String" }, - { "<leader>fG", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" }, - { "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "List Keymaps" }, - { "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Find Recent Files" }, - }, + { + "nvim-telescope/telescope.nvim", + lazy = true, + cmd = "Telescope", + version = false, + keys = { + { "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" }, + { "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" }, + -- find + { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" }, + { "<leader>fb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" }, + { "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" }, + { "<leader>/", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" }, + { "<leader>fh", "<cmd>Telescope grep_string<cr>", desc = "Grep currently hovered String" }, + { "<leader>fG", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" }, + { "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "List Keymaps" }, + { "<leader>fr", "<cmd>Telescope oldfiles<cr>", 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", "<leader>xx", function() require("trouble").toggle() end) - vim.keymap.set("n", "<leader>xw", function() require("trouble").toggle("workspace_diagnostics") end) - vim.keymap.set("n", "<leader>xd", function() require("trouble").toggle("document_diagnostics") end) - vim.keymap.set("n", "<leader>xq", function() require("trouble").toggle("quickfix") end) - vim.keymap.set("n", "<leader>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 <xesc@xesc.de> Date: Sun, 24 Dec 2023 01:04:45 +0100 Subject: [PATCH 07/69] 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", "<C-l>", "<C-w>l", {}) -- buffer operations vim.api.nvim_set_keymap("n", "<leader><tab>", "<C-^>", {}) -vim.api.nvim_set_keymap("n", "<leader>on", "<cmd>w <bar> %bd <bar> e#<cr>", {}) vim.api.nvim_set_keymap("n", "<leader>bd", "<cmd>bd<cr>", {}) vim.api.nvim_set_keymap("n", "<S-h>", "<cmd>bprevious<cr>", {}) vim.api.nvim_set_keymap("n", "<S-l>", "<cmd>bnext<cr>", {}) From 5af52408148027ebd49d1b4266ebd46285dd79dd Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Tue, 2 Jan 2024 08:05:14 +0100 Subject: [PATCH 08/69] 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", "<leader>a", function() harpoon:list():append() end) + vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + + vim.keymap.set("n", "<leader>n", function() harpoon:list():select(1) end) + vim.keymap.set("n", "<leader>e", function() harpoon:list():select(2) end) + vim.keymap.set("n", "<leader>i", function() harpoon:list():select(3) end) + vim.keymap.set("n", "<leader>o", function() harpoon:list():select(4) end) + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set("n", "<C-P>", function() harpoon:list():prev() end) + vim.keymap.set("n", "<C-N>", function() harpoon:list():next() end) + end + } +} From e11096c0715ce8ef29be7e315a1732409406af58 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sat, 20 Jan 2024 13:31:34 +0100 Subject: [PATCH 09/69] 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", "<leader>T", function() require("trouble").toggle() end), + }, + } +} From 3d7e4b5e48b86ff942ed9ccec903a12f077bf60c Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sat, 20 Jan 2024 21:24:39 +0100 Subject: [PATCH 10/69] 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", "<leader>zz", function() require("zen-mode").toggle() end), + }, + } +} From 14c8746a1fe7ef59ba954d306114f03016127ef9 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Mon, 29 Jan 2024 23:04:43 +0100 Subject: [PATCH 11/69] 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', '<leader>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', '<space>gt', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', '<space>cw', vim.lsp.buf.rename, bufopts) - vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts) vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, bufopts) vim.keymap.set('v', '<space>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 = "<cr>", + quit = {'<Esc>', 'q'} + } + }, + outline = { + win_position = 'left', + win_width = 45, + }, + lightbulb = { + enable = false + }, + ui = { + code_action = ' ' + }, + rename = { + in_select = false, + keys = { + quit = {'<Esc>', 'q'}, + select = '<Space>' + } + }, + hover_doc = { + open_cmd = '!firefox' + }, + code_action = { + keys = { + quit = {'<Esc>', 'q'} + } + }, + definition = { + keys = { + quit = {'<Esc>', 'q'}, + }, + } + }) + + vim.keymap.set('n', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) + vim.keymap.set('t', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) + vim.keymap.set('n', '<space>cw', '<cmd>Lspsaga rename mode=n<cr>', opts) + vim.keymap.set('n', '<space>so', '<cmd>Lspsaga outline<cr>', opts) + vim.keymap.set('n', '<space>sf', '<cmd>Lspsaga finder<cr>', opts) + vim.keymap.set('n', '<space>sci', '<cmd>Lspsaga incoming_calls<cr>', opts) + vim.keymap.set('n', '<space>sco', '<cmd>Lspsaga outgoing_calls<cr>', opts) + vim.keymap.set('n', '<leader>k', '<cmd>Lspsaga hover_doc<cr>', bufopts) + vim.keymap.set('n', 'K', '<cmd>Lspsaga hover_doc<cr>', bufopts) + vim.keymap.set('n', '<space>ca', '<cmd>Lspsaga code_action<cr>', bufopts) + vim.keymap.set('n', '<space>sd', '<cmd>Lspsaga peek_definition<cr>', bufopts) + vim.keymap.set('n', '<space>st', '<cmd>Lspsaga peek_type_definition<cr>', 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', '<leader>k', vim.lsp.buf.hover, bufopts) vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) vim.keymap.set('n', '<space>gt', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', '<space>cw', vim.lsp.buf.rename, bufopts) - vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts) + vim.keymap.set('n', '<space>cw', "<cmd>Lspsaga rename mode=n<cr>", bufopts) + -- vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts) + vim.keymap.set('n', '<space>ca', '<cmd>Lspsaga code_action<cr>', bufopts) -- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, bufopts) vim.keymap.set('v', '<space>cf', function() vim.lsp.buf.format { async = true } end, bufopts) From 68796d499e5cd60c82d084090ac116ac4fe813e3 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Tue, 30 Jan 2024 21:30:20 +0100 Subject: [PATCH 12/69] 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', '<space>cd', vim.diagnostic.open_float, opts) - vim.keymap.set('n', '<space>cl', "<cmd>LspInfo<cr>", 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', '<space>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', '<space>cd', vim.diagnostic.open_float, opts) + vim.keymap.set('n', '<space>cl', "<cmd>LspInfo<cr>", 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', '<space>q', vim.diagnostic.setloclist, opts) - local on_attach = function(client, bufnr) - -- enable completion triggered by <c-x><c-o> - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + local on_attach = function(client, bufnr) + -- enable completion triggered by <c-x><c-o> + 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', '<C-k>', vim.lsp.buf.signature_help, bufopts) - vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts) - vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts) - vim.keymap.set('n', '<space>wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, bufopts) - vim.keymap.set('n', '<space>gt', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, bufopts) - vim.keymap.set('v', '<space>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 = "<cr>", + quit = { '<Esc>', 'q' } + } + }, + outline = { + win_position = 'left', + win_width = 45, + }, + lightbulb = { + enable = false + }, + ui = { + code_action = '', + border = 'rounded', + }, + rename = { + in_select = false, + keys = { + quit = { '<Esc>', 'q' }, + select = '<Space>' + } + }, + hover_doc = { + open_cmd = '!firefox' + }, + code_action = { + keys = { + quit = { '<Esc>', 'q' } + }, + extend_gitsigns = false, + }, + definition = { + keys = { + quit = { '<Esc>', 'q' }, + }, + }, + diagnostic = { + border_follow = false, + extend_relatedInformation = true, + keys = { + quit = { '<Esc>', 'q' }, + quit_in_show = { '<Esc>', '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', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) + vim.keymap.set('t', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) + vim.keymap.set('n', '<space>cw', '<cmd>Lspsaga rename mode=n<cr>', opts) + vim.keymap.set('n', '<space>so', '<cmd>Lspsaga outline<cr>', opts) + vim.keymap.set('n', '<space>sf', '<cmd>Lspsaga finder<cr>', opts) + vim.keymap.set('n', '<space>sci', '<cmd>Lspsaga incoming_calls<cr>', opts) + vim.keymap.set('n', '<space>sco', '<cmd>Lspsaga outgoing_calls<cr>', opts) + vim.keymap.set('n', '<leader>k', '<cmd>Lspsaga hover_doc<cr>', bufopts) + vim.keymap.set('n', 'K', '<cmd>Lspsaga hover_doc<cr>', bufopts) + vim.keymap.set('n', '<space>ca', '<cmd>Lspsaga code_action<cr>', bufopts) + vim.keymap.set('n', '<space>sd', '<cmd>Lspsaga peek_definition<cr>', bufopts) + vim.keymap.set('n', '<space>st', '<cmd>Lspsaga peek_type_definition<cr>', bufopts) + vim.keymap.set('n', '<space>cw', "<cmd>Lspsaga rename mode=n<cr>", bufopts) + vim.keymap.set('n', '<space>ca', '<cmd>Lspsaga code_action<cr>', bufopts) + vim.keymap.set('n', '[e', '<cmd>Lspsaga diagnostic_jump_next<cr>', bufopts) + vim.keymap.set('n', ']e', '<cmd>Lspsaga diagnostic_jump_prev<cr>', 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 = "<cr>", - quit = {'<Esc>', '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 = {'<Esc>', 'q'}, - select = '<Space>' - } - }, - hover_doc = { - open_cmd = '!firefox' - }, - code_action = { - keys = { - quit = {'<Esc>', 'q'} - } - }, - definition = { - keys = { - quit = {'<Esc>', 'q'}, - }, } - }) - - vim.keymap.set('n', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) - vim.keymap.set('t', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) - vim.keymap.set('n', '<space>cw', '<cmd>Lspsaga rename mode=n<cr>', opts) - vim.keymap.set('n', '<space>so', '<cmd>Lspsaga outline<cr>', opts) - vim.keymap.set('n', '<space>sf', '<cmd>Lspsaga finder<cr>', opts) - vim.keymap.set('n', '<space>sci', '<cmd>Lspsaga incoming_calls<cr>', opts) - vim.keymap.set('n', '<space>sco', '<cmd>Lspsaga outgoing_calls<cr>', opts) - vim.keymap.set('n', '<leader>k', '<cmd>Lspsaga hover_doc<cr>', bufopts) - vim.keymap.set('n', 'K', '<cmd>Lspsaga hover_doc<cr>', bufopts) - vim.keymap.set('n', '<space>ca', '<cmd>Lspsaga code_action<cr>', bufopts) - vim.keymap.set('n', '<space>sd', '<cmd>Lspsaga peek_definition<cr>', bufopts) - vim.keymap.set('n', '<space>st', '<cmd>Lspsaga peek_type_definition<cr>', 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', '<leader>K', vim.lsp.buf.hover, bufopts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) + vim.keymap.set('n', '<space>gt', vim.lsp.buf.type_definition, bufopts) + vim.keymap.set('n', '<space>cA', vim.lsp.buf.code_action, bufopts) + vim.keymap.set('n', '<space>gr', vim.lsp.buf.references, bufopts) + vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, bufopts) + vim.keymap.set('v', '<space>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', '<leader>k', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', '<space>gt', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', '<space>cw', "<cmd>Lspsaga rename mode=n<cr>", bufopts) - -- vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', '<space>ca', '<cmd>Lspsaga code_action<cr>', bufopts) - -- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, bufopts) - vim.keymap.set('v', '<space>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 <xesc@xesc.de> Date: Thu, 29 Feb 2024 20:33:48 +0100 Subject: [PATCH 13/69] 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", "<leader>mX", ":exec 'w'<cr> <bar> <cmd>!chmod -x % -- mk- and loadview for view-persistance vim.api.nvim_set_keymap("n", "<leader>vm", ":exec 'w'<cr> <bar> <cmd>mkview <cr>", {silent = true}) vim.api.nvim_set_keymap("n", "<leader>vl", ":exec 'w'<cr> <bar> <cmd>loadview <cr>", {silent = true}) + +-- <leader><leader> for fast save +vim.api.nvim_set_keymap("n", "<leader><leader>", ":exec 'w'<cr>", {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 <xesc@xesc.de> Date: Thu, 29 Feb 2024 21:11:28 +0100 Subject: [PATCH 14/69] 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 <xesc@xesc.de> Date: Thu, 21 Mar 2024 21:18:49 +0100 Subject: [PATCH 15/69] 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 <xesc@xesc.de> Date: Mon, 8 Apr 2024 20:01:42 +0200 Subject: [PATCH 16/69] 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", "<leader>a", function() harpoon:list():append() end) + vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end) vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) vim.keymap.set("n", "<leader>n", function() harpoon:list():select(1) end) From c87fee0ef6ffa48fa5be238bb6eea9c8a59dec89 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Fri, 24 May 2024 21:19:37 +0200 Subject: [PATCH 17/69] 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', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) vim.keymap.set('t', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) - vim.keymap.set('n', '<space>cw', '<cmd>Lspsaga rename mode=n<cr>', opts) vim.keymap.set('n', '<space>so', '<cmd>Lspsaga outline<cr>', opts) vim.keymap.set('n', '<space>sf', '<cmd>Lspsaga finder<cr>', opts) vim.keymap.set('n', '<space>sci', '<cmd>Lspsaga incoming_calls<cr>', opts) From 83b15578f12aea020a50ece800002ce9ff8e4c14 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Mon, 27 May 2024 12:07:46 +0200 Subject: [PATCH 18/69] 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 <c-x><c-o> 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 <xesc@xesc.de> Date: Mon, 17 Jun 2024 21:12:05 +0200 Subject: [PATCH 19/69] 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", "<leader>T", function() require("trouble").toggle() end), + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = "Trouble", + keys = { + { + "<leader>xx", + "<cmd>Trouble diagnostics toggle<cr>", + desc = "Diagnostics (Trouble)", + }, + { + "<leader>xX", + "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "<leader>xs", + "<cmd>Trouble symbols toggle focus=false<cr>", + desc = "Symbols (Trouble)", + }, + { + "<leader>xl", + "<cmd>Trouble lsp toggle focus=false win.position=right<cr>", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "<leader>xL", + "<cmd>Trouble loclist toggle<cr>", + desc = "Location List (Trouble)", + }, + { + "<leader>xQ", + "<cmd>Trouble qflist toggle<cr>", + desc = "Quickfix List (Trouble)", + }, }, } + + } From 1d55d0ec6f760e9525745f89a04ffda3ee124980 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Mon, 17 Jun 2024 21:38:20 +0200 Subject: [PATCH 20/69] 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 <xesc@xesc.de> Date: Mon, 17 Jun 2024 21:39:46 +0200 Subject: [PATCH 21/69] 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 <xesc@xesc.de> Date: Tue, 18 Jun 2024 20:58:55 +0200 Subject: [PATCH 22/69] 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 = { '<Esc>', '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 = { + { "<leader>F", "<cmd>NvimTreeToggle<cr>", desc = "Toggle Filetree" }, + }, + config = function() + require("nvim-tree").setup({ + view = { + width = 42, + }, + }) + end, +} From 3ddbd43536c8a8088846a3493402d40f703bd363 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Thu, 20 Jun 2024 20:54:58 +0200 Subject: [PATCH 23/69] 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 = { - { "<leader>F", "<cmd>NvimTreeToggle<cr>", desc = "Toggle Filetree" }, + { "<leader>F", "<cmd>NvimTreeFindFileToggle<cr>", 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 <xesc@xesc.de> Date: Tue, 2 Jul 2024 21:34:07 +0200 Subject: [PATCH 24/69] change <leader>/ 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 { { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" }, { "<leader>fb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" }, { "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" }, - { "<leader>/", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" }, + { "<leader>/", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" }, { "<leader>fh", "<cmd>Telescope grep_string<cr>", desc = "Grep currently hovered String" }, { "<leader>fG", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" }, { "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "List Keymaps" }, From 69b19abf8eed7764675a64706e22d2b8d35a95e9 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Thu, 25 Jul 2024 08:22:07 +0200 Subject: [PATCH 25/69] 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 <xesc@xesc.de> Date: Fri, 26 Jul 2024 14:30:59 +0200 Subject: [PATCH 26/69] 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 '<c-v>') 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 <xesc@xesc.de> Date: Sat, 31 Aug 2024 18:38:54 +0200 Subject: [PATCH 27/69] 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 = { - { "<leader>gG", "<cmd>Git <cr>", desc = "git" }, - { "<leader>gs", "<cmd>Git status <cr>", desc = "git status" }, - { "<leader>gd", "<cmd>Git diff <cr>", desc = "git diff" }, - { "<leader>gD", "<cmd>Git diff --staged <cr>", desc = "git diff --staged" }, - { "<leader>gl", "<cmd>Git log --graph <cr>", desc = "git log --graph" }, - { "<leader>ga", "<cmd>Git add --interactive <cr>", desc = "git add" }, - { "<leader>gA", "<cmd>Git add -A <cr>", desc = "git add -A " }, - { "<leader>gc", "<cmd>Git commit <cr>", desc = "git commit" }, - { "<leader>gC", "<cmd>Git commit --amend <cr>", desc = "git commit --amend " }, - { "<leader>gCN", "<cmd>Git commit --amend --no-edit <cr>", desc = "git commit --amend " }, - { "<leader>gp", "<cmd>Git push <cr>", desc = "git push" }, - { "<leader>gP", "<cmd>Git pull <cr>", 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 <b>HTML tags</b> dst remove HTML tags +-- 'change quotes' cs'" "change quotes" +-- <b>or tag types</b> csth1<CR> <h1>or tag types</h1> +-- delete(function calls) dsf function calls + +-- :h nvim-surround.usage From be5aaacc14379a7e0c2d974f87c88d1e13baf7f6 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sat, 31 Aug 2024 18:45:08 +0200 Subject: [PATCH 28/69] 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 <xesc@xesc.de> Date: Sat, 31 Aug 2024 21:05:35 +0200 Subject: [PATCH 29/69] 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", "<leader>vl", ":exec 'w'<cr> <bar> <cmd>loadview <c -- <leader><leader> for fast save vim.api.nvim_set_keymap("n", "<leader><leader>", ":exec 'w'<cr>", {silent = true}) + +-- <leader>r for redo +vim.api.nvim_set_keymap("n", "<leader>r", ":exec 'w <cr>", {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", "<leader>wp", "<cmd>WastePaste<cr>", {silent = true}), + vim.keymap.set("v", "<leader>wp", "<cmd>WastePaste<cr>", {silent = true}), + }, } } From 8e6acc1a5335ebf77b420bc3f01c1be334838255 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Fri, 27 Sep 2024 23:00:03 +0200 Subject: [PATCH 30/69] 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", "<leader>e", function() harpoon:list():select(2) end) vim.keymap.set("n", "<leader>i", function() harpoon:list():select(3) end) vim.keymap.set("n", "<leader>o", function() harpoon:list():select(4) end) + vim.keymap.set("n", "<leader>1", function() harpoon:list():select(1) end) + vim.keymap.set("n", "<leader>2", function() harpoon:list():select(2) end) + vim.keymap.set("n", "<leader>3", function() harpoon:list():select(3) end) + vim.keymap.set("n", "<leader>4", function() harpoon:list():select(4) end) + vim.keymap.set("n", "<leader>5", function() harpoon:list():select(5) end) + vim.keymap.set("n", "<leader>6", function() harpoon:list():select(6) end) + vim.keymap.set("n", "<leader>7", function() harpoon:list():select(7) end) + vim.keymap.set("n", "<leader>8", function() harpoon:list():select(8) end) + vim.keymap.set("n", "<leader>9", function() harpoon:list():select(9) end) -- Toggle previous & next buffers stored within Harpoon list vim.keymap.set("n", "<C-P>", 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 <xesc@xesc.de> Date: Sun, 29 Sep 2024 17:40:56 +0200 Subject: [PATCH 31/69] 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", "<leader>vl", ":exec 'w'<cr> <bar> <cmd>loadview <c vim.api.nvim_set_keymap("n", "<leader><leader>", ":exec 'w'<cr>", {silent = true}) -- <leader>r for redo -vim.api.nvim_set_keymap("n", "<leader>r", ":exec 'w <cr>", {silent = true}) +vim.api.nvim_set_keymap("n", "<leader>r", ":exec 'w' <cr>", {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 = { { "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" }, { "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" }, @@ -11,7 +23,7 @@ return { { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" }, { "<leader>fb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" }, { "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" }, - { "<leader>/", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" }, + { "<leader>/", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" }, { "<leader>fh", "<cmd>Telescope grep_string<cr>", desc = "Grep currently hovered String" }, { "<leader>fG", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" }, { "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "List Keymaps" }, From 112f2646f59b01280cc324822dd075aabd5104a5 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sun, 29 Sep 2024 17:49:59 +0200 Subject: [PATCH 32/69] 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 <xesc@xesc.de> Date: Wed, 2 Oct 2024 13:26:02 +0200 Subject: [PATCH 33/69] 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 <xesc@xesc.de> Date: Sat, 26 Oct 2024 22:26:32 +0200 Subject: [PATCH 34/69] 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", "<leader>Y", "\"+Y", {}) -- paste from system clipboard vim.api.nvim_set_keymap("n", "<leader>p", "\"+p", {}) --- opening explorer -vim.api.nvim_set_keymap("n", "<leader>E", ":20Lexplore<cr>", {}) - -- make current file (un)executable vim.api.nvim_set_keymap("n", "<leader>mx", ":exec 'w'<cr> <bar> <cmd>!chmod +x %<cr>", { silent = true }) vim.api.nvim_set_keymap("n", "<leader>mX", ":exec 'w'<cr> <bar> <cmd>!chmod -x %<cr>", { silent = true }) @@ -53,4 +50,4 @@ vim.api.nvim_set_keymap("n", "<leader>vl", ":exec 'w'<cr> <bar> <cmd>loadview <c vim.api.nvim_set_keymap("n", "<leader><leader>", ":exec 'w'<cr>", {silent = true}) -- <leader>r for redo -vim.api.nvim_set_keymap("n", "<leader>r", ":exec 'w' <cr>", {silent = true}) +vim.api.nvim_set_keymap("n", "<leader>r", ":redo <cr>", {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 <xesc@xesc.de> Date: Wed, 20 Nov 2024 19:30:58 +0100 Subject: [PATCH 35/69] 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 <xesc@xesc.de> Date: Wed, 25 Dec 2024 23:31:23 +0100 Subject: [PATCH 36/69] 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 <xesc@xesc.de> Date: Sun, 23 Feb 2025 19:36:05 +0100 Subject: [PATCH 37/69] 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", "<F5>", "<esc> :exec 'w' <bar> :exec '!xelat vim.api.nvim_buf_set_keymap(0, "v", "<F5>", "<esc> :exec 'w' <bar> :exec '!xelatex %'<cr>", {}) -- Open PDF-Viewer from LaTeX-file +vim.api.nvim_buf_set_keymap(0, "n", "cz", ":silent !zathura --fork %:r.pdf& <cr>", {}) vim.api.nvim_buf_set_keymap(0, "n", "<F6>", ":silent !zathura --fork %:r.pdf& <cr>", {}) vim.api.nvim_buf_set_keymap(0, "i", "<F6>", "<esc> :silent !zathura --fork %:r.pdf& <cr>", {}) vim.api.nvim_buf_set_keymap(0, "v", "<F6>", "<esc> :silent !zathura --fork %:r.pdf& <cr>", {}) 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", "<C-l>", "<C-w>l", {}) -- buffer operations vim.api.nvim_set_keymap("n", "<leader><tab>", "<C-^>", {}) vim.api.nvim_set_keymap("n", "<leader>bd", "<cmd>bd<cr>", {}) -vim.api.nvim_set_keymap("n", "<S-h>", "<cmd>bprevious<cr>", {}) -vim.api.nvim_set_keymap("n", "<S-l>", "<cmd>bnext<cr>", {}) + +-- quickfix and locationlist +vim.api.nvim_set_keymap("n", "<S-h>", "<cmd>cnext<cr>zz", {}) +vim.api.nvim_set_keymap("n", "<S-l>", "<cmd>cprev<cr>zz", {}) +vim.api.nvim_set_keymap("n", "<leader>h", "<cmd>lnext<cr>zz", {}) +vim.api.nvim_set_keymap("n", "<leader>l", "<cmd>lprev<cr>zz", {}) +vim.api.nvim_set_keymap("n", "<leader>L", "<cmd>lcl<cr>", {}) +vim.api.nvim_set_keymap("n", "<leader>Q", "<cmd>cw<cr>", {}) +vim.api.nvim_set_keymap("n", "<leader>q", "<cmd>ccl<cr>", {}) + -- moving visual blocks vim.api.nvim_set_keymap("v", "J", ":m '>+1<cr>gv=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", "<leader>wp", "<cmd>WastePaste<cr>", {silent = true}), - vim.keymap.set("v", "<leader>wp", "<cmd>WastePaste<cr>", {silent = true}), + vim.keymap.set("n", "<leader>wp", "<cmd>WastePaste<cr>", { silent = true }), + vim.keymap.set("v", "<leader>wp", "<cmd>WastePaste<cr>", { 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 '<Ignore>' - end, { expr = true }) + -- Navigation + map('n', ']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '<Ignore>' + end, { expr = true }) - map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '<Ignore>' - end, { expr = true }) + map('n', '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '<Ignore>' + end, { expr = true }) - -- Actions - map('n', '<leader>gB', function() gs.blame_line { full = true } end) - map('n', '<leader>gb', gs.toggle_current_line_blame) - - end - }) - end, - } + -- Actions + map('n', '<leader>gB', function() gs.blame_line { full = true } end) + map('n', '<leader>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", "<leader>7", function() harpoon:list():select(7) end) vim.keymap.set("n", "<leader>8", function() harpoon:list():select(8) end) vim.keymap.set("n", "<leader>9", function() harpoon:list():select(9) end) - - -- Toggle previous & next buffers stored within Harpoon list - vim.keymap.set("n", "<C-P>", function() harpoon:list():prev() end) - vim.keymap.set("n", "<C-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', '<space>cd', vim.diagnostic.open_float, opts) - vim.keymap.set('n', '<space>cl', "<cmd>LspInfo<cr>", 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', '<space>q', vim.diagnostic.setloclist, opts) - - local on_attach = function(client, bufnr) - -- enable completion triggered by <c-x><c-o> - 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 = "<cr>", - quit = { '<Esc>', '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 = { '<Esc>', 'q' }, - select = '<Space>' - } - }, - hover_doc = { - open_cmd = '!firefox' - }, - code_action = { - keys = { - quit = { '<Esc>', 'q' } - }, - extend_gitsigns = false, - }, - definition = { - keys = { - quit = { '<Esc>', 'q' }, - }, - }, - diagnostic = { - border_follow = true, - extend_relatedInformation = true, - keys = { - quit = { '<Esc>', 'q' }, - quit_in_show = { '<Esc>', 'q' }, - } - } - }) - - vim.keymap.set('n', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) - vim.keymap.set('t', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) - vim.keymap.set('n', '<space>so', '<cmd>Lspsaga outline<cr>', opts) - vim.keymap.set('n', '<space>sf', '<cmd>Lspsaga finder<cr>', opts) - vim.keymap.set('n', '<space>sci', '<cmd>Lspsaga incoming_calls<cr>', opts) - vim.keymap.set('n', '<space>sco', '<cmd>Lspsaga outgoing_calls<cr>', opts) - vim.keymap.set('n', '<leader>k', '<cmd>Lspsaga hover_doc<cr>', bufopts) - vim.keymap.set('n', 'K', '<cmd>Lspsaga hover_doc<cr>', bufopts) - vim.keymap.set('n', '<space>ca', '<cmd>Lspsaga code_action<cr>', bufopts) - vim.keymap.set('n', '<space>sd', '<cmd>Lspsaga peek_definition<cr>', bufopts) - vim.keymap.set('n', '<space>st', '<cmd>Lspsaga peek_type_definition<cr>', bufopts) - vim.keymap.set('n', '<space>cw', "<cmd>Lspsaga rename mode=n<cr>", bufopts) - vim.keymap.set('n', '<space>ca', '<cmd>Lspsaga code_action<cr>', bufopts) - vim.keymap.set('n', '[e', '<cmd>Lspsaga diagnostic_jump_next<cr>', bufopts) - vim.keymap.set('n', ']e', '<cmd>Lspsaga diagnostic_jump_prev<cr>', 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', '<leader>K', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', '<space>gt', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', '<space>cA', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', '<space>gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, bufopts) - vim.keymap.set('v', '<space>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({ - ['<C-b>'] = cmp.mapping.scroll_docs(-4), - ['<C-f>'] = cmp.mapping.scroll_docs(4), - -- ['<C-Space>'] = cmp.mapping.complete(), - -- ['<C-e>'] = cmp.mapping.abort(), - ['<C-e>'] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.abort() - else - cmp.complete() - end - end), - ['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - ["<Tab>"] = 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" }), - ["<S-Tab>"] = 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 = { - { - "<leader>xx", - "<cmd>Trouble diagnostics toggle<cr>", - desc = "Diagnostics (Trouble)", - }, - { - "<leader>xX", - "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", - desc = "Buffer Diagnostics (Trouble)", - }, - { - "<leader>xs", - "<cmd>Trouble symbols toggle focus=false<cr>", - desc = "Symbols (Trouble)", - }, - { - "<leader>xl", - "<cmd>Trouble lsp toggle focus=false win.position=right<cr>", - desc = "LSP Definitions / references / ... (Trouble)", - }, - { - "<leader>xL", - "<cmd>Trouble loclist toggle<cr>", - desc = "Location List (Trouble)", - }, - { - "<leader>xQ", - "<cmd>Trouble qflist toggle<cr>", - 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 = { - { "<leader>u", "<cmd>UndotreeToggle<cr>", desc = "toggle undotree" }, - }, - config = function() - vim.g.undotree_WindowLayout = 4 - vim.g.undotree_SplitWidth = 40 - vim.g.undotree_SetFocusWhenToggle = 1 - end - } + { + "mbbill/undotree", + keys = { + { "<leader>u", "<cmd>UndotreeToggle<cr>", 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 <xesc@xesc.de> Date: Sun, 23 Feb 2025 22:11:28 +0100 Subject: [PATCH 38/69] 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 = "<cr>", + quit = { '<Esc>', '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 = { '<Esc>', 'q' }, + select = '<Space>' + } + }, + hover_doc = { + open_cmd = '!firefox' + }, + code_action = { + keys = { + quit = { '<Esc>', 'q' } + }, + extend_gitsigns = false, + }, + definition = { + keys = { + quit = { '<Esc>', 'q' }, + }, + }, + diagnostic = { + border_follow = true, + extend_relatedInformation = true, + keys = { + quit = { '<Esc>', 'q' }, + quit_in_show = { '<Esc>', '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({ + ['<C-b>'] = cmp.mapping.scroll_docs(-4), + ['<C-f>'] = cmp.mapping.scroll_docs(4), + ['<C-e>'] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.abort() + else + cmp.complete() + end + end), + ['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + ["<Tab>"] = 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" }), + ["<S-Tab>"] = 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', '<leader>k', function() vim.lsp.buf.hover { border = "rounded" } end, opts) + vim.keymap.set('n', '<space>cl', "<cmd>LspInfo<cr>", opts) + vim.keymap.set('n', '<space>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', '<space>gr', vim.lsp.buf.references, opts) + vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, opts) + vim.keymap.set('v', '<space>cf', function() vim.lsp.buf.format { async = true } end, opts) + vim.keymap.set("n", "<leader>fws", function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set("i", "<C-s>", function() vim.lsp.buf.signature_help() end, opts) + vim.keymap.set('n', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) + vim.keymap.set('t', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) + vim.keymap.set('n', '<space>so', '<cmd>Lspsaga outline<cr>', opts) + vim.keymap.set('n', '<space>sf', '<cmd>Lspsaga finder<cr>', opts) + vim.keymap.set('n', '<space>sd', '<cmd>Lspsaga peek_definition<cr>', opts) + vim.keymap.set('n', '<space>cw', "<cmd>Lspsaga rename mode=n<cr>", opts) + vim.keymap.set('n', '<space>cA', vim.lsp.buf.code_action, opts) + vim.keymap.set('n', '<space>ca', '<cmd>Lspsaga code_action<cr>', 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 <xesc@xesc.de> Date: Sun, 23 Feb 2025 22:30:52 +0100 Subject: [PATCH 39/69] 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", "<leader>wp", "<cmd>WastePaste<cr>", { silent = true }), - vim.keymap.set("v", "<leader>wp", "<cmd>WastePaste<cr>", { 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", "<leader>wp", "<cmd>WastePaste<cr>", { silent = true }), + vim.keymap.set("v", "<leader>wp", "<cmd>WastePaste<cr>", { 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 '<Ignore>' - end, { expr = true }) + -- Navigation + map('n', ']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '<Ignore>' + end, { expr = true }) - map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '<Ignore>' - end, { expr = true }) + map('n', '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '<Ignore>' + end, { expr = true }) - -- Actions - map('n', '<leader>gB', function() gs.blame_line { full = true } end) - map('n', '<leader>gb', gs.toggle_current_line_blame) - end - }) - end, - } + -- Actions + map('n', '<leader>gB', function() gs.blame_line { full = true } end) + map('n', '<leader>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", "<leader>a", function() harpoon:list():add() end) - vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end) + vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) - vim.keymap.set("n", "<leader>n", function() harpoon:list():select(1) end) - vim.keymap.set("n", "<leader>e", function() harpoon:list():select(2) end) - vim.keymap.set("n", "<leader>i", function() harpoon:list():select(3) end) - vim.keymap.set("n", "<leader>o", function() harpoon:list():select(4) end) - vim.keymap.set("n", "<leader>1", function() harpoon:list():select(1) end) - vim.keymap.set("n", "<leader>2", function() harpoon:list():select(2) end) - vim.keymap.set("n", "<leader>3", function() harpoon:list():select(3) end) - vim.keymap.set("n", "<leader>4", function() harpoon:list():select(4) end) - vim.keymap.set("n", "<leader>5", function() harpoon:list():select(5) end) - vim.keymap.set("n", "<leader>6", function() harpoon:list():select(6) end) - vim.keymap.set("n", "<leader>7", function() harpoon:list():select(7) end) - vim.keymap.set("n", "<leader>8", function() harpoon:list():select(8) end) - vim.keymap.set("n", "<leader>9", function() harpoon:list():select(9) end) - end - } + vim.keymap.set("n", "<leader>n", function() harpoon:list():select(1) end) + vim.keymap.set("n", "<leader>e", function() harpoon:list():select(2) end) + vim.keymap.set("n", "<leader>i", function() harpoon:list():select(3) end) + vim.keymap.set("n", "<leader>o", function() harpoon:list():select(4) end) + vim.keymap.set("n", "<leader>1", function() harpoon:list():select(1) end) + vim.keymap.set("n", "<leader>2", function() harpoon:list():select(2) end) + vim.keymap.set("n", "<leader>3", function() harpoon:list():select(3) end) + vim.keymap.set("n", "<leader>4", function() harpoon:list():select(4) end) + vim.keymap.set("n", "<leader>5", function() harpoon:list():select(5) end) + vim.keymap.set("n", "<leader>6", function() harpoon:list():select(6) end) + vim.keymap.set("n", "<leader>7", function() harpoon:list():select(7) end) + vim.keymap.set("n", "<leader>8", function() harpoon:list():select(8) end) + vim.keymap.set("n", "<leader>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 = { - { "<leader>F", "<cmd>NvimTreeFindFileToggle<cr>", 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 = { + { "<leader>F", "<cmd>NvimTreeFindFileToggle<cr>", 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 = { + { "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" }, + { "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" }, + -- find + { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" }, + { "<leader>fb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" }, + { "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" }, + { "<leader>/", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" }, + { "<leader>fh", "<cmd>Telescope grep_string<cr>", desc = "Grep currently hovered String" }, + { "<leader>fG", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" }, + { "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "List Keymaps" }, + { "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Find Recent Files" }, }, - }) - end, - keys = { - { "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" }, - { "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" }, - -- find - { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" }, - { "<leader>fb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" }, - { "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" }, - { "<leader>/", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find Strings in current Buffer" }, - { "<leader>fh", "<cmd>Telescope grep_string<cr>", desc = "Grep currently hovered String" }, - { "<leader>fG", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" }, - { "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "List Keymaps" }, - { "<leader>fr", "<cmd>Telescope oldfiles<cr>", 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 '<c-v>') 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 '<c-v>') 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 = { - { "<leader>u", "<cmd>UndotreeToggle<cr>", desc = "toggle undotree" }, - }, - config = function() - vim.g.undotree_WindowLayout = 4 - vim.g.undotree_SplitWidth = 40 - vim.g.undotree_SetFocusWhenToggle = 1 - end - } + { + "mbbill/undotree", + keys = { + { "<leader>u", "<cmd>UndotreeToggle<cr>", 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", "<leader>zz", function() require("zen-mode").toggle() end), }, - gitsigns = { enabled = false } - }, - vim.keymap.set("n", "<leader>zz", function() require("zen-mode").toggle() end), - }, - } + } } From c371ab161efae5519d987774c5f90be43104af7c Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Thu, 27 Feb 2025 19:24:02 +0100 Subject: [PATCH 40/69] 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", "<C-l>", "<C-w>l", {}) -- buffer operations vim.api.nvim_set_keymap("n", "<leader><tab>", "<C-^>", {}) vim.api.nvim_set_keymap("n", "<leader>bd", "<cmd>bd<cr>", {}) +vim.api.nvim_set_keymap("n", "<leader>bn", "<cmd>bnext<cr>", {}) +vim.api.nvim_set_keymap("n", "<leader>bp", "<cmd>bprevious<cr>", {}) -- quickfix and locationlist vim.api.nvim_set_keymap("n", "<S-h>", "<cmd>cnext<cr>zz", {}) 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 <xesc@xesc.de> Date: Fri, 28 Feb 2025 21:26:18 +0100 Subject: [PATCH 41/69] 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 <xesc@xesc.de> Date: Sun, 2 Mar 2025 16:01:53 +0100 Subject: [PATCH 42/69] 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", "<leader>G", "<cmd>Git<cr>", {}) + end, + } +} From a5fe01560a4173dc719651c1f06ee856dc779f9c Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sun, 2 Mar 2025 16:22:03 +0100 Subject: [PATCH 43/69] 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", "<leader>G", "<cmd>Git<cr>", {}) + vim.api.nvim_set_keymap("n", "<leader>G", "<cmd>Git", {}) + vim.api.nvim_set_keymap("n", "<leader>Gr", "<cmd>Git<cr>", {}) end, } } From 46e71b24616daffd80bf62ba3f674ce1f1b247be Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sun, 2 Mar 2025 16:32:48 +0100 Subject: [PATCH 44/69] 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", "<leader>G", "<cmd>Git", {}) - vim.api.nvim_set_keymap("n", "<leader>Gr", "<cmd>Git<cr>", {}) - end, - } -} From 36aa117fbf08af6b35acd414c52e65124799c8a8 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sun, 2 Mar 2025 16:46:34 +0100 Subject: [PATCH 45/69] 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 '<Ignore>' - end, { expr = true }) - - map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '<Ignore>' - end, { expr = true }) - - -- Actions map('n', '<leader>gB', function() gs.blame_line { full = true } end) map('n', '<leader>gb', gs.toggle_current_line_blame) + map('n', '<leader>gs', gs.stage_hunk) -- git stage this + map('v', '<leader>gs', gs.stage_hunk) -- git stage this + map('n', '<leader>gus', gs.undo_stage_hunk) -- git undo stage this + map('v', '<leader>gus', gs.undo_stage_hunk) -- git undo stage this end }) end, From 6be73d9a952103dd489e125b8ebacea9731efa4e Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sun, 2 Mar 2025 20:55:04 +0100 Subject: [PATCH 46/69] 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 '<-2<cr>gv=gv", {}) vim.api.nvim_set_keymap("n", "<leader>d", "\"_d", {}) vim.api.nvim_set_keymap("v", "<leader>d", "\"_d", {}) +-- paste without yanking selected text +vim.api.nvim_set_keymap("x", "<leader>p", [["_dP]], {}) + -- copy to system clipboard vim.api.nvim_set_keymap("n", "<leader>y", "\"+y", {}) vim.api.nvim_set_keymap("v", "<leader>y", "\"+y", {}) vim.api.nvim_set_keymap("n", "<leader>Y", "\"+Y", {}) -- paste from system clipboard -vim.api.nvim_set_keymap("n", "<leader>p", "\"+p", {}) +vim.api.nvim_set_keymap("n", "<leader>P", "\"+p", {}) -- make current file (un)executable vim.api.nvim_set_keymap("n", "<leader>mx", ":exec 'w'<cr> <bar> <cmd>!chmod +x %<cr>", { silent = true }) vim.api.nvim_set_keymap("n", "<leader>mX", ":exec 'w'<cr> <bar> <cmd>!chmod -x %<cr>", { silent = true }) --- mk- and loadview for view-persistance -vim.api.nvim_set_keymap("n", "<leader>vm", ":exec 'w'<cr> <bar> <cmd>mkview <cr>", {silent = true}) -vim.api.nvim_set_keymap("n", "<leader>vl", ":exec 'w'<cr> <bar> <cmd>loadview <cr>", {silent = true}) - -- <leader><leader> for fast save vim.api.nvim_set_keymap("n", "<leader><leader>", ":exec 'w'<cr>", {silent = true}) -- <leader>r for redo vim.api.nvim_set_keymap("n", "<leader>r", ":redo <cr>", {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 <xesc@xesc.de> Date: Sun, 2 Mar 2025 20:56:34 +0100 Subject: [PATCH 47/69] add missing <cr> --- 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", "<leader><leader>", ":exec 'w'<cr>", {silent = true vim.api.nvim_set_keymap("n", "<leader>r", ":redo <cr>", {silent = true}) -- better ZQ -vim.api.nvim_set_keymap("n", "zq", ":q!", {}) +vim.api.nvim_set_keymap("n", "zq", ":q!<cr>", {}) -- 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!<cr>", {}) +vim.api.nvim_set_keymap("n", "XZZ", ":wqa!<cr>", {}) From c633ecd9174595b4a1c4da4fdcc33d0006b8e227 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sun, 2 Mar 2025 20:59:41 +0100 Subject: [PATCH 48/69] 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!<cr>", {}) -- even better vim.api.nvim_set_keymap("n", "XX", ":qa!<cr>", {}) vim.api.nvim_set_keymap("n", "XZZ", ":wqa!<cr>", {}) +vim.api.nvim_set_keymap("n", "<leader>x", ":q<cr>", {}) From 17d733cc098691fe319a6495eccaea4b7476ad50 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Tue, 4 Mar 2025 11:04:58 +0100 Subject: [PATCH 49/69] 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 <xesc@xesc.de> Date: Thu, 6 Mar 2025 20:42:15 +0100 Subject: [PATCH 50/69] 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", "<F5>", "<esc> :exec 'w' <bar> :exec '!xelat vim.api.nvim_buf_set_keymap(0, "v", "<F5>", "<esc> :exec 'w' <bar> :exec '!xelatex %'<cr>", {}) -- Open PDF-Viewer from LaTeX-file -vim.api.nvim_buf_set_keymap(0, "n", "cz", ":silent !zathura --fork %:r.pdf& <cr>", {}) +vim.api.nvim_buf_set_keymap(0, "n", "<leader>cz", ":silent !zathura --fork %:r.pdf& <cr>", {}) vim.api.nvim_buf_set_keymap(0, "n", "<F6>", ":silent !zathura --fork %:r.pdf& <cr>", {}) vim.api.nvim_buf_set_keymap(0, "i", "<F6>", "<esc> :silent !zathura --fork %:r.pdf& <cr>", {}) vim.api.nvim_buf_set_keymap(0, "v", "<F6>", "<esc> :silent !zathura --fork %:r.pdf& <cr>", {}) 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", "<leader>r", ":redo <cr>", {silent = true}) vim.api.nvim_set_keymap("n", "zq", ":q!<cr>", {}) -- even better -vim.api.nvim_set_keymap("n", "XX", ":qa!<cr>", {}) -vim.api.nvim_set_keymap("n", "XZZ", ":wqa!<cr>", {}) +vim.api.nvim_set_keymap("n", "<leader>XX", ":qa!<cr>", {}) +vim.api.nvim_set_keymap("n", "<leader>XZZ", ":wqa!<cr>", {}) vim.api.nvim_set_keymap("n", "<leader>x", ":q<cr>", {}) From 7d89c194034ddbe5512eb572b7a82d4ff2ef2d1e Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Tue, 11 Mar 2025 19:53:04 +0100 Subject: [PATCH 51/69] 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!<cr>", {}) vim.api.nvim_set_keymap("n", "<leader>XX", ":qa!<cr>", {}) vim.api.nvim_set_keymap("n", "<leader>XZZ", ":wqa!<cr>", {}) vim.api.nvim_set_keymap("n", "<leader>x", ":q<cr>", {}) + +-- fast editing +vim.api.nvim_set_keymap("n", "<leader>E", ":e ", {}) From adf806489e17189813a11a3961dd3033c6a292d6 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Fri, 14 Mar 2025 22:43:59 +0100 Subject: [PATCH 52/69] 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 = "<cr>", - quit = { '<Esc>', '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 = { '<Esc>', 'q' }, - select = '<Space>' - } - }, - hover_doc = { - open_cmd = '!firefox' - }, - code_action = { - keys = { - quit = { '<Esc>', 'q' } - }, - extend_gitsigns = false, - }, - definition = { - keys = { - quit = { '<Esc>', 'q' }, - }, - }, - diagnostic = { - border_follow = true, - extend_relatedInformation = true, - keys = { - quit = { '<Esc>', 'q' }, - quit_in_show = { '<Esc>', '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 = "<cr>", + quit = { '<Esc>', '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 = { '<Esc>', 'q' }, + select = '<Space>' + } + }, + hover_doc = { + open_cmd = '!firefox' + }, + code_action = { + keys = { + quit = { '<Esc>', 'q' } + }, + extend_gitsigns = false, + }, + definition = { + keys = { + quit = { '<Esc>', 'q' }, + }, + }, + diagnostic = { + border_follow = true, + extend_relatedInformation = true, + keys = { + quit = { '<Esc>', 'q' }, + quit_in_show = { '<Esc>', '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({ + ['<C-b>'] = cmp.mapping.scroll_docs(-4), + ['<C-f>'] = cmp.mapping.scroll_docs(4), + ['<C-e>'] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.abort() + else + cmp.complete() end + end), + ['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + ["<Tab>"] = 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" }), + ["<S-Tab>"] = 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({ - ['<C-b>'] = cmp.mapping.scroll_docs(-4), - ['<C-f>'] = cmp.mapping.scroll_docs(4), - ['<C-e>'] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.abort() - else - cmp.complete() - end - end), - ['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - ["<Tab>"] = 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" }), - ["<S-Tab>"] = 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', '<leader>k', function() vim.lsp.buf.hover { border = "rounded" } end, opts) - vim.keymap.set('n', '<space>cl', "<cmd>LspInfo<cr>", opts) - vim.keymap.set('n', '<space>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', '<space>gr', vim.lsp.buf.references, opts) - vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, opts) - vim.keymap.set('v', '<space>cf', function() vim.lsp.buf.format { async = true } end, opts) - vim.keymap.set("n", "<leader>fws", function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set("i", "<C-s>", function() vim.lsp.buf.signature_help() end, opts) - vim.keymap.set('n', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) - vim.keymap.set('t', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) - vim.keymap.set('n', '<space>so', '<cmd>Lspsaga outline<cr>', opts) - vim.keymap.set('n', '<space>sf', '<cmd>Lspsaga finder<cr>', opts) - vim.keymap.set('n', '<space>sd', '<cmd>Lspsaga peek_definition<cr>', opts) - vim.keymap.set('n', '<space>cw', "<cmd>Lspsaga rename mode=n<cr>", opts) - vim.keymap.set('n', '<space>cA', vim.lsp.buf.code_action, opts) - vim.keymap.set('n', '<space>ca', '<cmd>Lspsaga code_action<cr>', 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', '<leader>k', function() vim.lsp.buf.hover { border = "rounded" } end, opts) + vim.keymap.set('n', '<space>cl', "<cmd>LspInfo<cr>", opts) + vim.keymap.set('n', '<space>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', '<space>gr', vim.lsp.buf.references, opts) + vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, opts) + vim.keymap.set('v', '<space>cf', function() vim.lsp.buf.format { async = true } end, opts) + vim.keymap.set("n", "<leader>fws", function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set("i", "<C-s>", function() vim.lsp.buf.signature_help() end, opts) + vim.keymap.set('n', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) + vim.keymap.set('t', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) + vim.keymap.set('n', '<space>so', '<cmd>Lspsaga outline<cr>', opts) + vim.keymap.set('n', '<space>sf', '<cmd>Lspsaga finder<cr>', opts) + vim.keymap.set('n', '<space>sd', '<cmd>Lspsaga peek_definition<cr>', opts) + vim.keymap.set('n', '<space>cw', "<cmd>Lspsaga rename mode=n<cr>", opts) + vim.keymap.set('n', '<space>cA', vim.lsp.buf.code_action, opts) + vim.keymap.set('n', '<space>ca', '<cmd>Lspsaga code_action<cr>', opts) + end, + } } From 55361c475dcc9ba862111adf870ff03b4953c0db Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Fri, 14 Mar 2025 22:53:42 +0100 Subject: [PATCH 53/69] 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", "<leader>x", ":q<cr>", {}) -- fast editing vim.api.nvim_set_keymap("n", "<leader>E", ":e ", {}) + +-- vertical resize +vim.api.nvim_set_keymap("n", "<leader>vr", ":vertical-resize ", {}) From 0b6e5cc89304a40e5dd8fe018b4ac587887a473d Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sat, 15 Mar 2025 19:31:06 +0100 Subject: [PATCH 54/69] 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 <xesc@xesc.de> Date: Sat, 15 Mar 2025 19:34:37 +0100 Subject: [PATCH 55/69] 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', '<space>cf', function() vim.lsp.buf.format { async = true } end, opts) vim.keymap.set('v', '<space>cf', function() vim.lsp.buf.format { async = true } end, opts) vim.keymap.set("n", "<leader>fws", function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set("i", "<C-s>", function() vim.lsp.buf.signature_help() end, opts) + vim.keymap.set("i", "<C-s>", function() vim.lsp.buf.signature_help {border = "rounded" } end, opts) vim.keymap.set('n', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) vim.keymap.set('t', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) vim.keymap.set('n', '<space>so', '<cmd>Lspsaga outline<cr>', opts) From 96540f20baef41145bfd51f944b9c13b3c2cc0ea Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sat, 31 May 2025 14:59:40 +0200 Subject: [PATCH 56/69] fix lsp capabilities --- lua/plugin/lsp.lua | 272 +++++++++++++++++++++++---------------------- 1 file changed, 138 insertions(+), 134 deletions(-) diff --git a/lua/plugin/lsp.lua b/lua/plugin/lsp.lua index 90735cd..0a8f8d1 100644 --- a/lua/plugin/lsp.lua +++ b/lua/plugin/lsp.lua @@ -19,12 +19,146 @@ return { "jay-babu/mason-null-ls.nvim", }, config = function() + -- 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({ + ['<C-b>'] = cmp.mapping.scroll_docs(-4), + ['<C-f>'] = cmp.mapping.scroll_docs(4), + ['<C-e>'] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.abort() + else + cmp.complete() + end + end), + ['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + ["<Tab>"] = 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" }), + ["<S-Tab>"] = 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' } + }) + }) + }) + + -- setup -- + local client_capabilities = vim.lsp.protocol.make_client_capabilities() + local cmp_capabilities = require('cmp_nvim_lsp').default_capabilities() + local capabilities = vim.tbl_deep_extend( "force", - {}, - vim.lsp.protocol.make_client_capabilities() + client_capabilities, + cmp_capabilities ) -- mason -- @@ -53,7 +187,7 @@ return { -- 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) + function(server_name) -- default handler (optional) require("lspconfig")[server_name].setup { capabilities = capabilities } @@ -166,136 +300,6 @@ return { } }) - -- 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({ - ['<C-b>'] = cmp.mapping.scroll_docs(-4), - ['<C-f>'] = cmp.mapping.scroll_docs(4), - ['<C-e>'] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.abort() - else - cmp.complete() - end - end), - ['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - ["<Tab>"] = 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" }), - ["<S-Tab>"] = 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({ @@ -328,7 +332,7 @@ return { vim.keymap.set('n', '<space>cf', function() vim.lsp.buf.format { async = true } end, opts) vim.keymap.set('v', '<space>cf', function() vim.lsp.buf.format { async = true } end, opts) vim.keymap.set("n", "<leader>fws", function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set("i", "<C-s>", function() vim.lsp.buf.signature_help {border = "rounded" } end, opts) + vim.keymap.set("i", "<C-s>", function() vim.lsp.buf.signature_help { border = "rounded" } end, opts) vim.keymap.set('n', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) vim.keymap.set('t', '<C-n>', "<cmd>Lspsaga term_toggle<cr>", opts) vim.keymap.set('n', '<space>so', '<cmd>Lspsaga outline<cr>', opts) From 8d0cb98beb9603d85fef2049ad2cad4c8ff4608b Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sat, 31 May 2025 15:40:10 +0200 Subject: [PATCH 57/69] update readme --- readme.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/readme.md b/readme.md index f415aa1..5bf1f0d 100644 --- a/readme.md +++ b/readme.md @@ -1 +1,11 @@ # Neovim Configfiles + +## Dependencies +- [ripgrep](https://github.com/BurntSushi/ripgrep) +- [fd](https://github.com/sharkdp/fd) +- [fzf](https://github.com/junegunn/fzf) +- [git](https://git-scm.com/) +- [wget](https://www.gnu.org/software/wget/) +- [wl-clipboard](https://github.com/bugaevc/wl-clipboard) +- [zathura](https://github.com/pwmt/zathura) (only for pdf-viewing) +- [rust](https://www.rust-lang.org/) (for downloading with mason) From 2e2e6751fc775fc3d9e8c8c3508ecb3d8b41187b Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sat, 31 May 2025 16:49:26 +0200 Subject: [PATCH 58/69] add obsidian plugin for notetaking --- ftplugin/markdown.lua | 1 + lua/plugin/obsidian.lua | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 ftplugin/markdown.lua create mode 100644 lua/plugin/obsidian.lua diff --git a/ftplugin/markdown.lua b/ftplugin/markdown.lua new file mode 100644 index 0000000..1bf2a44 --- /dev/null +++ b/ftplugin/markdown.lua @@ -0,0 +1 @@ +vim.opt.conceallevel = 1 diff --git a/lua/plugin/obsidian.lua b/lua/plugin/obsidian.lua new file mode 100644 index 0000000..92e2f16 --- /dev/null +++ b/lua/plugin/obsidian.lua @@ -0,0 +1,41 @@ +return { + { + "epwalsh/obsidian.nvim", + version = "*", -- recommended, use latest release instead of latest commit + lazy = true, + ft = "markdown", + -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault: + -- event = { + -- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'. + -- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md" + -- -- refer to `:h file-pattern` for more examples + -- "BufReadPre path/to/my-vault/*.md", + -- "BufNewFile path/to/my-vault/*.md", + -- }, + dependencies = { + "nvim-lua/plenary.nvim", + }, + opts = { + workspaces = { + { + name = "notes", + path = "~/notes", + }, + }, + completion = { + -- Set to false to disable completion. + nvim_cmp = true, + -- Trigger completion at 2 chars. + min_chars = 1, + }, + + new_notes_location = "current_dir", + wiki_link_func = "use_alias_only", + preferred_link_style = "wiki", + note_id_func = function(title) + return title; + end, + disable_frontmatter = true, + }, + } +} From a440c30e2e0e7fd6c5993dbb0941b72c0b83ae2e Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sun, 1 Jun 2025 00:52:26 +0200 Subject: [PATCH 59/69] initial setup of obsidian plugin --- lua/plugin/obsidian.lua | 73 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/lua/plugin/obsidian.lua b/lua/plugin/obsidian.lua index 92e2f16..c80295b 100644 --- a/lua/plugin/obsidian.lua +++ b/lua/plugin/obsidian.lua @@ -28,7 +28,41 @@ return { -- Trigger completion at 2 chars. min_chars = 1, }, - + mappings = { + -- Overrides the 'gf' mapping to work on markdown/wiki links within your vault. + ["gf"] = { + action = function() + return require("obsidian").util.gf_passthrough() + end, + opts = { noremap = false, expr = true, buffer = true }, + }, + -- paste image + ["<Space>Op"] = { + action = function() + return "<cmd>ObsidianPasteImg<cr>" + end, + opts = { noremap = false, expr = true, buffer = true }, + }, + -- Toggle check-boxes. + ["<leader>ch"] = { + action = function() + return require("obsidian").util.toggle_checkbox() + end, + opts = { buffer = true }, + }, + ["<cr>"] = { + action = function() + return require("obsidian").util.gf_passthrough() + end, + opts = { buffer = true, expr = true }, + }, + ["bl"] = { + action = function() + return "<cmd>ObsidianBacklinks<cr>" + end, + opts = { noremap = false, expr = true, buffer = true }, + }, + }, new_notes_location = "current_dir", wiki_link_func = "use_alias_only", preferred_link_style = "wiki", @@ -36,6 +70,43 @@ return { return title; end, disable_frontmatter = true, + + -- Optional, by default when you use `:ObsidianFollowLink` on a link to an external + -- URL it will be ignored but you can customize this behavior here. + ---@param url string + follow_url_func = function(url) + -- Open the URL in the default web browser. + -- vim.fn.jobstart({ "open", url }) -- Mac OS + vim.fn.jobstart({"xdg-open", url}) -- linux + -- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows + -- vim.ui.open(url) -- need Neovim 0.10.0+ + end, + + -- Optional, by default when you use `:ObsidianFollowLink` on a link to an image + -- file it will be ignored but you can customize this behavior here. + ---@param img string + follow_img_func = function(img) + -- vim.fn.jobstart { "qlmanage", "-p", img } -- Mac OS quick look preview + vim.fn.jobstart({"xdg-open", url}) -- linux + -- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows + end, + attachments = { + -- The default folder to place images in via `:ObsidianPasteImg`. + -- If this is a relative path it will be interpreted as relative to the vault root. + -- You can always override this per image by passing a full path to the command instead of just a filename. + img_folder = "images", -- This is the default + + -- A function that determines the text to insert in the note when pasting an image. + -- It takes two arguments, the `obsidian.Client` and an `obsidian.Path` to the image file. + -- This is the default implementation. + ---@param client obsidian.Client + ---@param path obsidian.Path the absolute path to the image file + ---@return string + img_text_func = function(client, path) + path = client:vault_relative_path(path) or path + return string.format("", path.name, path) + end, + }, }, } } From b6f5af87e7ad8cf2e9cd38048481140a365a6ee7 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Sun, 1 Jun 2025 22:51:08 +0200 Subject: [PATCH 60/69] update obsidian config --- lua/plugin/obsidian.lua | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/lua/plugin/obsidian.lua b/lua/plugin/obsidian.lua index c80295b..3cba993 100644 --- a/lua/plugin/obsidian.lua +++ b/lua/plugin/obsidian.lua @@ -28,6 +28,7 @@ return { -- Trigger completion at 2 chars. min_chars = 1, }, + mappings = { -- Overrides the 'gf' mapping to work on markdown/wiki links within your vault. ["gf"] = { @@ -52,7 +53,7 @@ return { }, ["<cr>"] = { action = function() - return require("obsidian").util.gf_passthrough() + return require("obsidian").util.smart_action() end, opts = { buffer = true, expr = true }, }, @@ -63,11 +64,17 @@ return { opts = { noremap = false, expr = true, buffer = true }, }, }, + new_notes_location = "current_dir", - wiki_link_func = "use_alias_only", + + wiki_link_func = function(opts) + return require("obsidian.util").wiki_link_id_prefix(opts) + end, + preferred_link_style = "wiki", + note_id_func = function(title) - return title; + return tostring(os.date("%Y-%m-%d") .. "-" .. title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()) end, disable_frontmatter = true, @@ -76,36 +83,21 @@ return { ---@param url string follow_url_func = function(url) -- Open the URL in the default web browser. - -- vim.fn.jobstart({ "open", url }) -- Mac OS - vim.fn.jobstart({"xdg-open", url}) -- linux - -- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows - -- vim.ui.open(url) -- need Neovim 0.10.0+ + -- vim.fn.jobstart({ "xdg-open", url }) -- linux + vim.ui.open(url) -- need Neovim 0.10.0+ end, -- Optional, by default when you use `:ObsidianFollowLink` on a link to an image -- file it will be ignored but you can customize this behavior here. ---@param img string follow_img_func = function(img) - -- vim.fn.jobstart { "qlmanage", "-p", img } -- Mac OS quick look preview - vim.fn.jobstart({"xdg-open", url}) -- linux - -- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows + vim.fn.jobstart({ "xdg-open", url }) -- linux end, attachments = { -- The default folder to place images in via `:ObsidianPasteImg`. -- If this is a relative path it will be interpreted as relative to the vault root. -- You can always override this per image by passing a full path to the command instead of just a filename. img_folder = "images", -- This is the default - - -- A function that determines the text to insert in the note when pasting an image. - -- It takes two arguments, the `obsidian.Client` and an `obsidian.Path` to the image file. - -- This is the default implementation. - ---@param client obsidian.Client - ---@param path obsidian.Path the absolute path to the image file - ---@return string - img_text_func = function(client, path) - path = client:vault_relative_path(path) or path - return string.format("", path.name, path) - end, }, }, } From d962226a0dd46e47cbba463f2998eae89ffa64bb Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Tue, 3 Jun 2025 15:41:07 +0200 Subject: [PATCH 61/69] update obsidian config --- lua/plugin/obsidian.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lua/plugin/obsidian.lua b/lua/plugin/obsidian.lua index 3cba993..c2b71df 100644 --- a/lua/plugin/obsidian.lua +++ b/lua/plugin/obsidian.lua @@ -67,15 +67,20 @@ return { new_notes_location = "current_dir", - wiki_link_func = function(opts) - return require("obsidian.util").wiki_link_id_prefix(opts) - end, + wiki_link_func = "use_alias_only", + + -- wiki_link_func = function(opts) + -- return require("obsidian.util").wiki_link_id_prefix(opts) + -- end, preferred_link_style = "wiki", note_id_func = function(title) - return tostring(os.date("%Y-%m-%d") .. "-" .. title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()) + return title end, + -- note_id_func = function(title) + -- return tostring(os.date("%Y-%m-%d") .. "-" .. title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()) + -- end, disable_frontmatter = true, -- Optional, by default when you use `:ObsidianFollowLink` on a link to an external @@ -91,7 +96,7 @@ return { -- file it will be ignored but you can customize this behavior here. ---@param img string follow_img_func = function(img) - vim.fn.jobstart({ "xdg-open", url }) -- linux + vim.fn.jobstart({ "xdg-open", img }) -- linux end, attachments = { -- The default folder to place images in via `:ObsidianPasteImg`. From dc7663d10129f38196d4e095500d9ef41b3186cf Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Tue, 3 Jun 2025 16:01:03 +0200 Subject: [PATCH 62/69] update obsidian config --- lua/plugin/obsidian.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/plugin/obsidian.lua b/lua/plugin/obsidian.lua index c2b71df..5286959 100644 --- a/lua/plugin/obsidian.lua +++ b/lua/plugin/obsidian.lua @@ -1,6 +1,6 @@ return { { - "epwalsh/obsidian.nvim", + "obsidian-nvim/obsidian.nvim", version = "*", -- recommended, use latest release instead of latest commit lazy = true, ft = "markdown", @@ -44,6 +44,12 @@ return { end, opts = { noremap = false, expr = true, buffer = true }, }, + ["<Space>On"] = { + action = function() + return "<cmd>ObsidianNew<cr>" + end, + opts = { noremap = false, expr = true, buffer = true }, + }, -- Toggle check-boxes. ["<leader>ch"] = { action = function() From 6fe483f173552bdc91babce99056971472fd4a2d Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Tue, 3 Jun 2025 16:10:12 +0200 Subject: [PATCH 63/69] update obsidian config --- lua/plugin/obsidian.lua | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lua/plugin/obsidian.lua b/lua/plugin/obsidian.lua index 5286959..e6ee5bd 100644 --- a/lua/plugin/obsidian.lua +++ b/lua/plugin/obsidian.lua @@ -73,11 +73,11 @@ return { new_notes_location = "current_dir", - wiki_link_func = "use_alias_only", + -- wiki_link_func = "use_alias_only", - -- wiki_link_func = function(opts) - -- return require("obsidian.util").wiki_link_id_prefix(opts) - -- end, + wiki_link_func = function(opts) + return require("obsidian.util").wiki_link_id_prefix(opts) + end, preferred_link_style = "wiki", @@ -91,19 +91,19 @@ return { -- Optional, by default when you use `:ObsidianFollowLink` on a link to an external -- URL it will be ignored but you can customize this behavior here. - ---@param url string - follow_url_func = function(url) - -- Open the URL in the default web browser. - -- vim.fn.jobstart({ "xdg-open", url }) -- linux - vim.ui.open(url) -- need Neovim 0.10.0+ - end, - - -- Optional, by default when you use `:ObsidianFollowLink` on a link to an image - -- file it will be ignored but you can customize this behavior here. - ---@param img string - follow_img_func = function(img) - vim.fn.jobstart({ "xdg-open", img }) -- linux - end, + -- ---@param url string + -- follow_url_func = function(url) + -- -- Open the URL in the default web browser. + -- -- vim.fn.jobstart({ "xdg-open", url }) -- linux + -- vim.ui.open(url) -- need Neovim 0.10.0+ + -- end, + -- + -- -- Optional, by default when you use `:ObsidianFollowLink` on a link to an image + -- -- file it will be ignored but you can customize this behavior here. + -- ---@param img string + -- follow_img_func = function(img) + -- vim.fn.jobstart({ "xdg-open", img }) -- linux + -- end, attachments = { -- The default folder to place images in via `:ObsidianPasteImg`. -- If this is a relative path it will be interpreted as relative to the vault root. From cd0a2d4c3e346de0e596a740e9a05d114af2055e Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Wed, 4 Jun 2025 11:39:10 +0200 Subject: [PATCH 64/69] add markdown rendering --- lua/core/settings.lua | 2 +- lua/plugin/markdown.lua | 84 +++++++++++++++++++++++++++++++++++++++++ lua/plugin/obsidian.lua | 1 + 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 lua/plugin/markdown.lua diff --git a/lua/core/settings.lua b/lua/core/settings.lua index 18b9d69..7185950 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -22,7 +22,7 @@ vim.opt.shiftwidth = 2 vim.opt.expandtab = true -- enable foldcolumn -vim.wo.foldcolumn = "2" +vim.wo.foldcolumn = "auto:7" -- enable wrap vim.opt.wrap = true diff --git a/lua/plugin/markdown.lua b/lua/plugin/markdown.lua new file mode 100644 index 0000000..709ca52 --- /dev/null +++ b/lua/plugin/markdown.lua @@ -0,0 +1,84 @@ +return { + { + 'MeanderingProgrammer/render-markdown.nvim', + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins + dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons + lazy = true, + ft = "markdown", + opts = { + completions = { lsp = { enabled = true } }, + preset = 'obsidian', + heading = { + backgrounds = {}, + position = 'inline', + }, + checkbox = { + enabled = true, + render_modes = false, + bullet = false, + right_pad = 1, + unchecked = { + icon = ' ', + highlight = 'RenderMarkdownUnchecked', + scope_highlight = nil, + }, + checked = { + icon = ' ', + highlight = 'RenderMarkdownChecked', + scope_highlight = nil, + }, + custom = { + todo = { raw = '[>]', rendered = ' ', highlight = 'RenderMarkdownInfo', scope_highlight = nil }, + urgent = { raw = '[!]', rendered = ' ', highlight = 'RenderMarkdownError', scope_highlight = nil }, + important = { raw = '[~]', rendered = ' ', highlight = 'DiagnosticWarn', }, + }, + }, + pipe_table = { + preset = 'round', + head = 'RenderMarkdownTableRow', + }, + code = { + border = 'thick', + width = 'block', + left_pad = 2, + min_width = 40, + }, + callout = { + -- Callouts are a special instance of a 'block_quote' that start with a 'shortcut_link'. + -- The key is for healthcheck and to allow users to change its values, value type below. + -- | raw | matched against the raw text of a 'shortcut_link', case insensitive | + -- | rendered | replaces the 'raw' value when rendering | + -- | highlight | highlight for the 'rendered' text and quote markers | + -- | quote_icon | optional override for quote.icon value for individual callout | + -- | category | optional metadata useful for filtering | + + -- Obsidian: https://help.obsidian.md/Editing+and+formatting/Callouts + abstract = { raw = '[!ABSTRACT]', rendered = ' Abstract', highlight = 'RenderMarkdownInfo', category = 'obsidian' }, + summary = { raw = '[!SUMMARY]', rendered = ' Summary', highlight = 'RenderMarkdownInfo', category = 'obsidian' }, + tldr = { raw = '[!TLDR]', rendered = ' Tldr', highlight = 'RenderMarkdownInfo', category = 'obsidian' }, + info = { raw = '[!INFO]', rendered = ' Info', highlight = 'RenderMarkdownInfo', category = 'obsidian' }, + todo = { raw = '[!TODO]', rendered = ' Todo', highlight = 'RenderMarkdownInfo', category = 'obsidian' }, + hint = { raw = '[!HINT]', rendered = ' Hint', highlight = 'RenderMarkdownSuccess', category = 'obsidian' }, + success = { raw = '[!SUCCESS]', rendered = ' Success', highlight = 'RenderMarkdownSuccess', category = 'obsidian' }, + check = { raw = '[!CHECK]', rendered = ' Check', highlight = 'RenderMarkdownSuccess', category = 'obsidian' }, + done = { raw = '[!DONE]', rendered = ' Done', highlight = 'RenderMarkdownSuccess', category = 'obsidian' }, + question = { raw = '[!QUESTION]', rendered = ' Question', highlight = 'RenderMarkdownWarn', category = 'obsidian' }, + help = { raw = '[!HELP]', rendered = ' Help', highlight = 'RenderMarkdownWarn', category = 'obsidian' }, + faq = { raw = '[!FAQ]', rendered = ' Faq', highlight = 'RenderMarkdownWarn', category = 'obsidian' }, + attention = { raw = '[!ATTENTION]', rendered = ' Attention', highlight = 'RenderMarkdownWarn', category = 'obsidian' }, + failure = { raw = '[!FAILURE]', rendered = ' Failure', highlight = 'RenderMarkdownError', category = 'obsidian' }, + fail = { raw = '[!FAIL]', rendered = ' Fail', highlight = 'RenderMarkdownError', category = 'obsidian' }, + missing = { raw = '[!MISSING]', rendered = ' Missing', highlight = 'RenderMarkdownError', category = 'obsidian' }, + danger = { raw = '[!DANGER]', rendered = ' Danger', highlight = 'RenderMarkdownError', category = 'obsidian' }, + error = { raw = '[!ERROR]', rendered = ' Error', highlight = 'RenderMarkdownError', category = 'obsidian' }, + bug = { raw = '[!BUG]', rendered = ' Bug', highlight = 'RenderMarkdownError', category = 'obsidian' }, + example = { raw = '[!EXAMPLE]', rendered = ' Example', highlight = 'RenderMarkdownHint', category = 'obsidian' }, + quote = { raw = '[!QUOTE]', rendered = ' Quote', highlight = 'RenderMarkdownQuote', category = 'obsidian' }, + cite = { raw = '[!CITE]', rendered = ' Cite', highlight = 'RenderMarkdownQuote', category = 'obsidian' }, + }, + + + }, + } +} diff --git a/lua/plugin/obsidian.lua b/lua/plugin/obsidian.lua index e6ee5bd..57446ac 100644 --- a/lua/plugin/obsidian.lua +++ b/lua/plugin/obsidian.lua @@ -110,6 +110,7 @@ return { -- You can always override this per image by passing a full path to the command instead of just a filename. img_folder = "images", -- This is the default }, + ui = { enable = false}, }, } } From d6e8537105e4dde12d7798e3acd46976c162d447 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Wed, 4 Jun 2025 11:43:08 +0200 Subject: [PATCH 65/69] update markdown rendering --- lua/plugin/markdown.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugin/markdown.lua b/lua/plugin/markdown.lua index 709ca52..1baa78c 100644 --- a/lua/plugin/markdown.lua +++ b/lua/plugin/markdown.lua @@ -42,6 +42,7 @@ return { border = 'thick', width = 'block', left_pad = 2, + right_pad = 2, min_width = 40, }, callout = { From 44dbe8a14b07ec0dda7f76b06cfb6ecab2e33c6e Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Wed, 4 Jun 2025 13:53:27 +0200 Subject: [PATCH 66/69] fix obsidian mapping --- lua/plugin/obsidian.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugin/obsidian.lua b/lua/plugin/obsidian.lua index 57446ac..bfcae6c 100644 --- a/lua/plugin/obsidian.lua +++ b/lua/plugin/obsidian.lua @@ -63,7 +63,7 @@ return { end, opts = { buffer = true, expr = true }, }, - ["bl"] = { + ["<Space>bl"] = { action = function() return "<cmd>ObsidianBacklinks<cr>" end, From bf207d76593f5305381966ded60180b77ff11d5d Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Fri, 6 Jun 2025 07:42:26 +0200 Subject: [PATCH 67/69] enable markdown highlighting --- lua/plugin/treesitter.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/lua/plugin/treesitter.lua b/lua/plugin/treesitter.lua index 0b73d09..6561205 100644 --- a/lua/plugin/treesitter.lua +++ b/lua/plugin/treesitter.lua @@ -20,9 +20,6 @@ return { auto_install = true, highlight = { enable = true, - disable = { - "markdown", - }, }, }, config = function(_, opts) From 583ab49953c2325fca9b3fab507211f7d14ac5c1 Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Fri, 6 Jun 2025 11:55:59 +0200 Subject: [PATCH 68/69] add todo mapping and obsidian search --- lua/core/remap.lua | 3 +++ lua/plugin/obsidian.lua | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index 1d68274..3b08ea9 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -74,3 +74,6 @@ vim.api.nvim_set_keymap("n", "<leader>E", ":e ", {}) -- vertical resize vim.api.nvim_set_keymap("n", "<leader>vr", ":vertical-resize ", {}) + +-- fast Todo and way to notes +vim.api.nvim_set_keymap("n", "<leader>N", ":e ~/notes/Todo.md", {}) diff --git a/lua/plugin/obsidian.lua b/lua/plugin/obsidian.lua index bfcae6c..70a83f6 100644 --- a/lua/plugin/obsidian.lua +++ b/lua/plugin/obsidian.lua @@ -50,6 +50,12 @@ return { end, opts = { noremap = false, expr = true, buffer = true }, }, + ["<Space>Os"] = { + action = function() + return "<cmd>ObsidianSearch<cr>" + end, + opts = { noremap = false, expr = true, buffer = true }, + }, -- Toggle check-boxes. ["<leader>ch"] = { action = function() From 9379ce6b406bc8268b7e74209a96b536517d15dd Mon Sep 17 00:00:00 2001 From: xesc <xesc@xesc.de> Date: Fri, 6 Jun 2025 11:58:18 +0200 Subject: [PATCH 69/69] add missing '<cr>' --- lua/core/remap.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index 3b08ea9..eac099d 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -76,4 +76,4 @@ vim.api.nvim_set_keymap("n", "<leader>E", ":e ", {}) vim.api.nvim_set_keymap("n", "<leader>vr", ":vertical-resize ", {}) -- fast Todo and way to notes -vim.api.nvim_set_keymap("n", "<leader>N", ":e ~/notes/Todo.md", {}) +vim.api.nvim_set_keymap("n", "<leader>N", ":e ~/notes/Todo.md<cr>", {})