From 49c040e36e1b3b258a4a634b0eb559e80e63b6a4 Mon Sep 17 00:00:00 2001 From: xesc Date: Sun, 23 Feb 2025 19:36:05 +0100 Subject: [PATCH] update lsp, keymaps, format and some other settings --- ftplugin/tex.lua | 1 + init.lua | 1 + lua/core/autocmd.lua | 12 ++ lua/core/remap.lua | 12 +- lua/core/settings.lua | 14 +- lua/plugin/autopairs.lua | 16 +- lua/plugin/bin.lua | 8 +- lua/plugin/commenting.lua | 12 +- lua/plugin/devicons.lua | 4 +- lua/plugin/everforest.lua | 118 +++++------ lua/plugin/gitsigns.lua | 67 ++++--- lua/plugin/gruvbox-material.lua | 118 +++++------ lua/plugin/harpoon.lua | 4 - lua/plugin/indent-blankline.lua | 44 ++--- lua/plugin/lspconfig.lua | 223 --------------------- lua/plugin/lualine.lua | 274 +++++++++++++------------- lua/plugin/marks.lua | 2 +- lua/plugin/nvim-cmp.lua | 196 ------------------ lua/plugin/plenary.lua | 8 +- lua/plugin/treesitter-context.lua | 24 +-- lua/plugin/treesitter-textobjects.lua | 2 +- lua/plugin/treesitter.lua | 58 +++--- lua/plugin/trouble.lua | 41 ---- lua/plugin/undotree.lua | 23 ++- lua/plugin/zen.lua | 2 +- 25 files changed, 423 insertions(+), 861 deletions(-) delete mode 100644 lua/plugin/lspconfig.lua delete mode 100644 lua/plugin/nvim-cmp.lua delete mode 100644 lua/plugin/trouble.lua diff --git a/ftplugin/tex.lua b/ftplugin/tex.lua index 6262f2e..895e50c 100644 --- a/ftplugin/tex.lua +++ b/ftplugin/tex.lua @@ -5,6 +5,7 @@ vim.api.nvim_buf_set_keymap(0, "i", "", " :exec 'w' :exec '!xelat vim.api.nvim_buf_set_keymap(0, "v", "", " :exec 'w' :exec '!xelatex %'", {}) -- Open PDF-Viewer from LaTeX-file +vim.api.nvim_buf_set_keymap(0, "n", "cz", ":silent !zathura --fork %:r.pdf& ", {}) vim.api.nvim_buf_set_keymap(0, "n", "", ":silent !zathura --fork %:r.pdf& ", {}) vim.api.nvim_buf_set_keymap(0, "i", "", " :silent !zathura --fork %:r.pdf& ", {}) vim.api.nvim_buf_set_keymap(0, "v", "", " :silent !zathura --fork %:r.pdf& ", {}) diff --git a/init.lua b/init.lua index 3646f50..3652a0e 100644 --- a/init.lua +++ b/init.lua @@ -24,6 +24,7 @@ require("lazy").setup({ install = { colorscheme = { "everforest" } }, + change_detection = { notify = false } }) diff --git a/lua/core/autocmd.lua b/lua/core/autocmd.lua index 4e0cbd2..06c6958 100644 --- a/lua/core/autocmd.lua +++ b/lua/core/autocmd.lua @@ -6,3 +6,15 @@ vim.api.nvim_create_autocmd("Filetype", { pattern = "*", command = "setlocal formatoptions-=c formatoptions-=r formatoptions-=o" }) + +-- persistent folds +vim.api.nvim_create_autocmd({"BufWinLeave"}, { + pattern = {"*.*"}, + desc = "save view (folds), when closing file", + command = "mkview", +}) +vim.api.nvim_create_autocmd({"BufWinEnter"}, { + pattern = {"*.*"}, + desc = "load view (folds), when opening file", + command = "silent! loadview" +}) diff --git a/lua/core/remap.lua b/lua/core/remap.lua index 40666fd..4b0fa59 100644 --- a/lua/core/remap.lua +++ b/lua/core/remap.lua @@ -19,8 +19,16 @@ vim.api.nvim_set_keymap("n", "", "l", {}) -- buffer operations vim.api.nvim_set_keymap("n", "", "", {}) vim.api.nvim_set_keymap("n", "bd", "bd", {}) -vim.api.nvim_set_keymap("n", "", "bprevious", {}) -vim.api.nvim_set_keymap("n", "", "bnext", {}) + +-- quickfix and locationlist +vim.api.nvim_set_keymap("n", "", "cnextzz", {}) +vim.api.nvim_set_keymap("n", "", "cprevzz", {}) +vim.api.nvim_set_keymap("n", "h", "lnextzz", {}) +vim.api.nvim_set_keymap("n", "l", "lprevzz", {}) +vim.api.nvim_set_keymap("n", "L", "lcl", {}) +vim.api.nvim_set_keymap("n", "Q", "cw", {}) +vim.api.nvim_set_keymap("n", "q", "ccl", {}) + -- moving visual blocks vim.api.nvim_set_keymap("v", "J", ":m '>+1gv=gv", {}) diff --git a/lua/core/settings.lua b/lua/core/settings.lua index 9fb4c8a..55a2adb 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -16,14 +16,20 @@ vim.opt.completeopt = 'menu,menuone,noselect' vim.opt.list = true -- correct tabbing -vim.opt.tabstop = 2 -vim.opt.softtabstop = 2 -vim.opt.shiftwidth = 2 +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 vim.opt.expandtab = true -- enable foldcolumn vim.wo.foldcolumn = "2" +-- disable wrap +vim.opt.wrap = false + +-- allow "@" in filenames +vim.opt.isfname:append("@-@") + -- smart indenting by vim vim.api.nvim_set_option("smartindent",true) @@ -39,7 +45,7 @@ vim.api.nvim_set_option("background", "dark") -- always center -- vim.api.nvim_set_option("scrolloff",999) -vim.api.nvim_set_option("scrolloff",15) +vim.opt.scrolloff = 10 -- spellchecking vim.wo.spell = true diff --git a/lua/plugin/autopairs.lua b/lua/plugin/autopairs.lua index 693cfc5..f101fbd 100644 --- a/lua/plugin/autopairs.lua +++ b/lua/plugin/autopairs.lua @@ -1,10 +1,10 @@ return { - { - "echasnovski/mini.pairs", - event = "VeryLazy", - version = false, - config = function() - require("mini.pairs").setup() - end, - } + { + "echasnovski/mini.pairs", + event = "VeryLazy", + version = false, + config = function() + require("mini.pairs").setup() + end, + } } diff --git a/lua/plugin/bin.lua b/lua/plugin/bin.lua index d9c05bd..94cc945 100644 --- a/lua/plugin/bin.lua +++ b/lua/plugin/bin.lua @@ -1,15 +1,15 @@ return { { "matze/wastebin.nvim", - config = function () + config = function() require("wastebin").setup({ url = "https://bin.xesc.de", - open_cmd="xdg-open" + open_cmd = "xdg-open" }) end, opts = { - vim.keymap.set("n", "wp", "WastePaste", {silent = true}), - vim.keymap.set("v", "wp", "WastePaste", {silent = true}), + vim.keymap.set("n", "wp", "WastePaste", { silent = true }), + vim.keymap.set("v", "wp", "WastePaste", { silent = true }), }, } } diff --git a/lua/plugin/commenting.lua b/lua/plugin/commenting.lua index d21d817..d68b2cb 100644 --- a/lua/plugin/commenting.lua +++ b/lua/plugin/commenting.lua @@ -1,8 +1,8 @@ return { - { - "echasnovski/mini.comment", - config = function() - require("mini.comment").setup() - end, - }, + { + "echasnovski/mini.comment", + config = function() + require("mini.comment").setup() + end, + }, } diff --git a/lua/plugin/devicons.lua b/lua/plugin/devicons.lua index a5b320d..7b84802 100644 --- a/lua/plugin/devicons.lua +++ b/lua/plugin/devicons.lua @@ -1,4 +1,4 @@ return { - "nvim-tree/nvim-web-devicons", - lazy = true, + "nvim-tree/nvim-web-devicons", + lazy = true, } diff --git a/lua/plugin/everforest.lua b/lua/plugin/everforest.lua index cb4134b..99ffd55 100644 --- a/lua/plugin/everforest.lua +++ b/lua/plugin/everforest.lua @@ -1,64 +1,64 @@ return { - { - "sainnhe/everforest", - priority = 1000, - config = function() - -- Settings for colorscheme - vim.api.nvim_set_var("everforest_background", "hard") - vim.api.nvim_set_var("everforest_transparent_background", "1") - vim.api.nvim_set_var("everforest_ui_contrast", "low") - vim.api.nvim_set_var("everforest_show_eob", "0") - vim.api.nvim_set_var("everforest_enable_bold", "1") - vim.api.nvim_set_var("everforest_enable_italic", "1") - vim.api.nvim_set_var("everforest_better_performance", "1") - vim.cmd([[colo everforest]]) + { + "sainnhe/everforest", + priority = 1000, + config = function() + -- Settings for colorscheme + vim.api.nvim_set_var("everforest_background", "hard") + vim.api.nvim_set_var("everforest_transparent_background", "1") + vim.api.nvim_set_var("everforest_ui_contrast", "low") + vim.api.nvim_set_var("everforest_show_eob", "0") + vim.api.nvim_set_var("everforest_enable_bold", "1") + vim.api.nvim_set_var("everforest_enable_italic", "1") + vim.api.nvim_set_var("everforest_better_performance", "1") + vim.cmd([[colo everforest]]) - -- Settings to override colorscheme - -- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"}) - -- colors of tabline - vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) - vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) - -- color of statusline - vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) - -- color of vertical split line - vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) - -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3a464c" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) - -- color of Floats and FloatBorders - vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) + -- Settings to override colorscheme + -- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"}) + -- colors of tabline + vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) + vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) + -- color of statusline + vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) + -- color of vertical split line + vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) + -- color of the cursorline and cursorlinenumber + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3a464c" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) + -- color of Floats and FloatBorders + vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) - -- autocommand for overrides - vim.api.nvim_create_autocmd("ColorScheme", { - pattern = "everforest", - callback = function() - vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) - vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) - -- color of statusline - vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) - -- color of vertical split line - vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) - -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3c464c" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) - -- color of Floats and FloatBorders - vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) - end, - }) + -- autocommand for overrides + vim.api.nvim_create_autocmd("ColorScheme", { + pattern = "everforest", + callback = function() + vim.api.nvim_set_hl(0, "TabLine", { bg = "#272e33", fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#374145" }) + vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) + -- color of statusline + vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) + -- color of vertical split line + vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) + -- color of the cursorline and cursorlinenumber + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#3c464c" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, fg = "#dbbc7f" }) + -- color of Floats and FloatBorders + vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#9da9a0" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#dfa000" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#f85552" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#35a77c" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#8da101" }) end, - }, + }) + end, + }, } diff --git a/lua/plugin/gitsigns.lua b/lua/plugin/gitsigns.lua index 60c83ab..930471c 100644 --- a/lua/plugin/gitsigns.lua +++ b/lua/plugin/gitsigns.lua @@ -1,40 +1,39 @@ return { - { - 'lewis6991/gitsigns.nvim', - event = "VeryLazy", - config = function() - require('gitsigns').setup({ - preview_config = { - border = 'rounded', - }, - on_attach = function(bufnr) - local gs = package.loaded.gitsigns + { + 'lewis6991/gitsigns.nvim', + event = "VeryLazy", + config = function() + require('gitsigns').setup({ + preview_config = { + border = 'rounded', + }, + on_attach = function(bufnr) + local gs = package.loaded.gitsigns - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end - -- Navigation - map('n', ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '' - end, { expr = true }) + -- Navigation + map('n', ']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '' + end, { expr = true }) - map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' - end, { expr = true }) + map('n', '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '' + end, { expr = true }) - -- Actions - map('n', 'gB', function() gs.blame_line { full = true } end) - map('n', 'gb', gs.toggle_current_line_blame) - - end - }) - end, - } + -- Actions + map('n', 'gB', function() gs.blame_line { full = true } end) + map('n', 'gb', gs.toggle_current_line_blame) + end + }) + end, + } } diff --git a/lua/plugin/gruvbox-material.lua b/lua/plugin/gruvbox-material.lua index 00b4076..81c12a1 100644 --- a/lua/plugin/gruvbox-material.lua +++ b/lua/plugin/gruvbox-material.lua @@ -1,64 +1,64 @@ return { - { - "sainnhe/gruvbox-material", - lazy = true, - config = function() - -- Settings for colorscheme - vim.api.nvim_set_var("gruvbox_material_background", "hard") - vim.api.nvim_set_var("gruvbox_material_transparent_background", "1") - vim.api.nvim_set_var("gruvbox_material_ui_contrast", "low") - vim.api.nvim_set_var("gruvbox_material_show_eob", "0") - vim.api.nvim_set_var("gruvbox_material_enable_bold", "1") - vim.api.nvim_set_var("gruvbox_material_enable_italic", "1") - vim.api.nvim_set_var("gruvbox_material_better_performance", "1") - vim.cmd([[colo gruvbox-material]]) + { + "sainnhe/gruvbox-material", + lazy = true, + config = function() + -- Settings for colorscheme + vim.api.nvim_set_var("gruvbox_material_background", "hard") + vim.api.nvim_set_var("gruvbox_material_transparent_background", "1") + vim.api.nvim_set_var("gruvbox_material_ui_contrast", "low") + vim.api.nvim_set_var("gruvbox_material_show_eob", "0") + vim.api.nvim_set_var("gruvbox_material_enable_bold", "1") + vim.api.nvim_set_var("gruvbox_material_enable_italic", "1") + vim.api.nvim_set_var("gruvbox_material_better_performance", "1") + vim.cmd([[colo gruvbox-material]]) - -- Settings to override colorscheme - -- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"}) - -- colors of tabline - vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) - vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) - -- color of statusline - vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) - -- color of vertical split line - vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) - -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) - -- color of Floats and FloatBorders - vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) + -- Settings to override colorscheme + -- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"}) + -- colors of tabline + vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) + vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) + -- color of statusline + vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) + -- color of vertical split line + vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) + -- color of the cursorline and cursorlinenumber + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) + -- color of Floats and FloatBorders + vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) - -- autocommand for overrides - vim.api.nvim_create_autocmd("ColorScheme", { - pattern = "gruvbox-material", - callback = function() - vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) - vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) - -- color of statusline - vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) - vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) - -- color of vertical split line - vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) - -- color of the cursorline and cursorlinenumber - vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) - vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) - -- color of Floats and FloatBorders - vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) - vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) - vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) - end, - }) + -- autocommand for overrides + vim.api.nvim_create_autocmd("ColorScheme", { + pattern = "gruvbox-material", + callback = function() + vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" }) + vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" }) + -- color of statusline + vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" }) + vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" }) + -- color of vertical split line + vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" }) + -- color of the cursorline and cursorlinenumber + vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" }) + -- color of Floats and FloatBorders + vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none }) + vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" }) + vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" }) end, - }, + }) + end, + }, } diff --git a/lua/plugin/harpoon.lua b/lua/plugin/harpoon.lua index cc26cb9..f158430 100644 --- a/lua/plugin/harpoon.lua +++ b/lua/plugin/harpoon.lua @@ -26,10 +26,6 @@ return { vim.keymap.set("n", "7", function() harpoon:list():select(7) end) vim.keymap.set("n", "8", function() harpoon:list():select(8) end) vim.keymap.set("n", "9", function() harpoon:list():select(9) end) - - -- Toggle previous & next buffers stored within Harpoon list - vim.keymap.set("n", "", function() harpoon:list():prev() end) - vim.keymap.set("n", "", function() harpoon:list():next() end) end } } diff --git a/lua/plugin/indent-blankline.lua b/lua/plugin/indent-blankline.lua index 9b2a604..fad971b 100644 --- a/lua/plugin/indent-blankline.lua +++ b/lua/plugin/indent-blankline.lua @@ -1,24 +1,24 @@ return { - { - "lukas-reineke/indent-blankline.nvim", - -- event = "BufReadPre", - main = 'ibl', - config = function() - require("ibl").setup({ - enabled = true, - indent = { - char = "│", - smart_indent_cap = true - }, - whitespace = { - remove_blankline_trail = true, - }, - scope = { - exclude = { - language = { "help", "lazy" } - } - }, - }) - end, - }, + { + "lukas-reineke/indent-blankline.nvim", + -- event = "BufReadPre", + main = 'ibl', + config = function() + require("ibl").setup({ + enabled = true, + indent = { + char = "│", + smart_indent_cap = true + }, + whitespace = { + remove_blankline_trail = true, + }, + scope = { + exclude = { + language = { "help", "lazy" } + } + }, + }) + end, + }, } diff --git a/lua/plugin/lspconfig.lua b/lua/plugin/lspconfig.lua deleted file mode 100644 index cdb5f4a..0000000 --- a/lua/plugin/lspconfig.lua +++ /dev/null @@ -1,223 +0,0 @@ -return { - { - "neovim/nvim-lspconfig", - -- event = "BufReadPre", - config = function() - require('lspconfig.ui.windows').default_options.border = 'rounded' - vim.api.nvim_set_hl(0, "LspInfoBorder", { bg = none, fg = "#9da9a0" }) - local opts = { noremap = true, silent = true } - vim.keymap.set('n', 'cd', vim.diagnostic.open_float, opts) - vim.keymap.set('n', 'cl', "LspInfo", opts) - vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) - vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) - -- vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) - - local on_attach = function(client, bufnr) - -- enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - end - - local border = { - { "╭", "FloatBorder" }, - { "─", "FloatBorder" }, - { "╮", "FloatBorder" }, - { "│", "FloatBorder" }, - { "╯", "FloatBorder" }, - { "─", "FloatBorder" }, - { "╰", "FloatBorder" }, - { "│", "FloatBorder" }, - } - - vim.diagnostic.config({ - signs = { text = { [vim.diagnostic.severity.ERROR] = "✘ ", [vim.diagnostic.severity.WARN] = " ", [vim.diagnostic.severity.HINT] = " ", [vim.diagnostic.severity.INFO] = " " } }, - float = { border = border }, - virtual_text = { - prefix = '●', -- Could be '●', '■', 'x', '▎', or anything else - }, - update_in_insert = true, - }) - - -- LSP settings (for overriding per client) - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border }) - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signatureHelp, { border = border }) - end, - }, - - -- pretty ui - { - 'nvimdev/lspsaga.nvim', - event = 'LspAttach', - config = function() - require('lspsaga').setup({ - symbol_in_winbar = { - enable = false, - show_file = false - }, - finder = { - keys = { - toggle_or_open = "", - quit = { '', 'q' } - } - }, - outline = { - win_position = 'right', - win_width = 32, - auto_preview = true, - }, - lightbulb = { - enable = false - }, - ui = { - code_action = '', - title = true, - border = 'rounded', - }, - rename = { - in_select = false, - keys = { - quit = { '', 'q' }, - select = '' - } - }, - hover_doc = { - open_cmd = '!firefox' - }, - code_action = { - keys = { - quit = { '', 'q' } - }, - extend_gitsigns = false, - }, - definition = { - keys = { - quit = { '', 'q' }, - }, - }, - diagnostic = { - border_follow = true, - extend_relatedInformation = true, - keys = { - quit = { '', 'q' }, - quit_in_show = { '', 'q' }, - } - } - }) - - vim.keymap.set('n', '', "Lspsaga term_toggle", opts) - vim.keymap.set('t', '', "Lspsaga term_toggle", opts) - vim.keymap.set('n', 'so', 'Lspsaga outline', opts) - vim.keymap.set('n', 'sf', 'Lspsaga finder', opts) - vim.keymap.set('n', 'sci', 'Lspsaga incoming_calls', opts) - vim.keymap.set('n', 'sco', 'Lspsaga outgoing_calls', opts) - vim.keymap.set('n', 'k', 'Lspsaga hover_doc', bufopts) - vim.keymap.set('n', 'K', 'Lspsaga hover_doc', bufopts) - vim.keymap.set('n', 'ca', 'Lspsaga code_action', bufopts) - vim.keymap.set('n', 'sd', 'Lspsaga peek_definition', bufopts) - vim.keymap.set('n', 'st', 'Lspsaga peek_type_definition', bufopts) - vim.keymap.set('n', 'cw', "Lspsaga rename mode=n", bufopts) - vim.keymap.set('n', 'ca', 'Lspsaga code_action', bufopts) - vim.keymap.set('n', '[e', 'Lspsaga diagnostic_jump_next', bufopts) - vim.keymap.set('n', ']e', 'Lspsaga diagnostic_jump_prev', bufopts) - end, - depedencies = { - 'nvim-treesitter/nvim-treesitter', - 'nvim-tree/nvim-web-devicons' - }, - }, - - { - "williamboman/mason.nvim", - lazy = true, - cmd = "Mason", - config = function() - require("mason").setup({ - PATH = "append", - ui = { - border = "rounded", - icons = { - package_installed = "✔", - package_pending = "➜", - package_uninstalled = "✘" - } - } - }) - end, - }, - - { - "williamboman/mason-lspconfig.nvim", - -- event = "BufReadPre", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { - "lua_ls", - "clangd", - "rust_analyzer", - } - }) - - require("mason-lspconfig").setup_handlers { - -- The first entry (without a key) will be the default handler - -- and will be called for each installed server that doesn't have - -- a dedicated handler. - function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup { - on_attach = on_attach, - handlers = handlers, - } - end, - } - end, - }, - { - "nvimtools/none-ls.nvim", - -- event = "BufReadPost", - dependencies = { - { - "nvim-telescope/telescope-ui-select.nvim", - lazy = true, - config = function() - -- This is your opts table - require("telescope").setup { - extensions = { - ["ui-select"] = { - -- require("telescope.themes").get_dropdown { - -- -- even more opts - -- } - } - } - } - require("telescope").load_extension("ui-select") - end, - }, - }, - opts = function() - local null_ls = require('null-ls') - return { - border = 'rounded', - on_attach = function(client, bufnr) - local bufopts = { noremap = true, silent = true, buffer = bufnr } - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', 'gt', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', 'cA', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) - vim.keymap.set('v', 'cf', function() vim.lsp.buf.format { async = true } end, bufopts) - end, - sources = { - null_ls.builtins.diagnostics.trail_space.with { - disabled_filetypes = { "lua" } - }, - null_ls.builtins.code_actions.gitsigns, - null_ls.builtins.diagnostics.yamllint, - null_ls.builtins.formatting.yamlfmt, - null_ls.builtins.formatting.shfmt, - null_ls.builtins.formatting.shellharden, - }, - } - end, - } -} diff --git a/lua/plugin/lualine.lua b/lua/plugin/lualine.lua index 60f2e6e..294aa10 100644 --- a/lua/plugin/lualine.lua +++ b/lua/plugin/lualine.lua @@ -1,161 +1,161 @@ return { - { - "nvim-lualine/lualine.nvim", - config = function() - vim.api.nvim_set_option("showmode", false) - local custom_gruvbox = require 'lualine.themes.gruvbox-material' - custom_gruvbox.normal.a.bg = '#89b482' - custom_gruvbox.normal.c.bg = '' - custom_gruvbox.insert.a.bg = '#d8a657' - custom_gruvbox.visual.a.bg = '#a9b665' - custom_gruvbox.replace.a.bg = '#ea6962' + { + "nvim-lualine/lualine.nvim", + config = function() + vim.api.nvim_set_option("showmode", false) + local custom_gruvbox = require 'lualine.themes.gruvbox-material' + custom_gruvbox.normal.a.bg = '#89b482' + custom_gruvbox.normal.c.bg = '' + custom_gruvbox.insert.a.bg = '#d8a657' + custom_gruvbox.visual.a.bg = '#a9b665' + custom_gruvbox.replace.a.bg = '#ea6962' local function lspsaga() return require('lspsaga.symbol.winbar').get_bar() end - require('lualine').setup { - options = { - theme = custom_gruvbox, + require('lualine').setup { + options = { + theme = custom_gruvbox, globalstatus = true, - component_separators = { left = '', right = '' }, - section_separators = { left = '', right = '' }, - disabled_filetypes = { 'netrw', 'Trouble' }, - }, - sections = { - lualine_a = { - { - 'mode', - padding = 1, - } - }, - lualine_b = { - { - 'branch', - icon = '', - color = { fg = '#d8a657', bg = '#141617', gui = 'bold' }, - padding = 1, - }, + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = { 'netrw', 'Trouble' }, + }, + sections = { + lualine_a = { + { + 'mode', + padding = 1, + } + }, + lualine_b = { + { + 'branch', + icon = '', + color = { fg = '#d8a657', bg = '#141617', gui = 'bold' }, + padding = 1, + }, { 'filename', color = { gui = 'italic', fg = '#d3869b', bg = '#1d2021' }, padding = 1, path = 1, }, - }, - lualine_c = { + }, + lualine_c = { { lspsaga } - }, - lualine_x = { - { - 'filetype', - color = { bg = '#1d2021', fg = '#d4be98', gui = 'italic' }, - padding = 1, - fmt = function(str) - return (str:gsub("^%l", string.upper)) - end, - }, - { - 'fileformat', - color = {gui = 'italic', bg = '#141617'}, - symbols = { - unix = '(unix)', - dos = '(dos)', - mac = '(mac)', - }, - } + }, + lualine_x = { + { + 'filetype', + color = { bg = '#1d2021', fg = '#d4be98', gui = 'italic' }, + padding = 1, + fmt = function(str) + return (str:gsub("^%l", string.upper)) + end, + }, + { + 'fileformat', + color = { gui = 'italic', bg = '#141617' }, + symbols = { + unix = '(unix)', + dos = '(dos)', + mac = '(mac)', + }, + } - }, - lualine_y = { - { - 'diagnostics', - color = { gui = 'bold', bg = '#141617' }, - sections = { 'error', 'warn', 'info', 'hint' }, - symbols = { error = "✘ ", warn = " ", info = " ", hint = " " }, - padding = 1, - update_in_insert = true - }, - { - 'diff', - icon = { ' ', color = { bg = '#141617', fg = '#d8a657', gui = 'bold' } }, - color = { gui = 'bold', bg = '#141617' }, - padding = 1, - } - }, - lualine_z = { - { - 'location', - padding = 1, - } - } - }, + }, + lualine_y = { + { + 'diagnostics', + color = { gui = 'bold', bg = '#141617' }, + sections = { 'error', 'warn', 'info', 'hint' }, + symbols = { error = "✘ ", warn = " ", info = " ", hint = " " }, + padding = 1, + update_in_insert = true + }, + { + 'diff', + icon = { ' ', color = { bg = '#141617', fg = '#d8a657', gui = 'bold' } }, + color = { gui = 'bold', bg = '#141617' }, + padding = 1, + } + }, + lualine_z = { + { + 'location', + padding = 1, + } + } + }, - inactive_sections = { - lualine_a = { - { - 'mode', - padding = 1, - } - }, - lualine_b = { - { - 'branch', - icon = '', - padding = 1, - }, + inactive_sections = { + lualine_a = { + { + 'mode', + padding = 1, + } + }, + lualine_b = { + { + 'branch', + icon = '', + padding = 1, + }, { 'filename', padding = 1, path = 1, } - }, - lualine_c = { - }, - lualine_x = { - { - 'filetype', - color = { gui = 'italic' }, - padding = 1, - fmt = function(str) - return (str:gsub("^%l", string.upper)) - end, - }, - { - 'fileformat', - color = {gui = 'italic'}, - symbols = { - unix = 'Unix', - dos = 'Dos', - mac = 'Mac', - }, - }, - }, - lualine_y = { - { - 'diagnostics', - color = { gui = 'bold', bg = '#141617' }, - sections = { 'error', 'warn', 'info', 'hint' }, - symbols = { error = "✘ ", warn = " ", info = " ", hint = "󰌶 " }, - padding = 1, - update_in_insert = true - }, - { - 'diff', - icon = { ' ', color = { bg = '#141617', gui = 'bold' } }, - color = { gui = 'bold', bg = '#141617' }, - padding = 1, - } - }, - lualine_z = { - { - 'location', - padding = 1, - }, - } - }, - } - end, - }, + }, + lualine_c = { + }, + lualine_x = { + { + 'filetype', + color = { gui = 'italic' }, + padding = 1, + fmt = function(str) + return (str:gsub("^%l", string.upper)) + end, + }, + { + 'fileformat', + color = { gui = 'italic' }, + symbols = { + unix = 'Unix', + dos = 'Dos', + mac = 'Mac', + }, + }, + }, + lualine_y = { + { + 'diagnostics', + color = { gui = 'bold', bg = '#141617' }, + sections = { 'error', 'warn', 'info', 'hint' }, + symbols = { error = "✘ ", warn = " ", info = " ", hint = "󰌶 " }, + padding = 1, + update_in_insert = true + }, + { + 'diff', + icon = { ' ', color = { bg = '#141617', gui = 'bold' } }, + color = { gui = 'bold', bg = '#141617' }, + padding = 1, + } + }, + lualine_z = { + { + 'location', + padding = 1, + }, + } + }, + } + end, + }, } diff --git a/lua/plugin/marks.lua b/lua/plugin/marks.lua index 553249f..2157ce9 100644 --- a/lua/plugin/marks.lua +++ b/lua/plugin/marks.lua @@ -5,7 +5,7 @@ return { opts = {}, config = function() require 'marks'.setup({ - sign_priority = 5; + sign_priority = 5, }) end, } diff --git a/lua/plugin/nvim-cmp.lua b/lua/plugin/nvim-cmp.lua deleted file mode 100644 index 9a5d422..0000000 --- a/lua/plugin/nvim-cmp.lua +++ /dev/null @@ -1,196 +0,0 @@ -return { - - -- snippets - { - "L3MON4D3/LuaSnip", - lazy = true, - dependencies = { - "rafamadriz/friendly-snippets", - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - vim.api.nvim_set_hl(0, "PmenuSel", { fg = 'NONE', bg = '#272e33' }) - vim.api.nvim_set_hl(0, "Pmenu", { fg = 'NONE', bg = '#1e2326' }) - vim.api.nvim_set_hl(0, "CmpItemMenu", { fg = 'NONE', bg = '#272e33' }) - vim.api.nvim_set_hl(0, "CmpItemMenuDefault", { fg = 'NONE', bg = '#272e33' }) - vim.api.nvim_set_hl(0, "CmpItemKindFunction", { fg = '#d699b6', bg = 'NONE', italic = true }) - vim.api.nvim_set_hl(0, "CmpItemKindSnippet", { fg = '#dbbc7f', bg = 'NONE', italic = true }) - vim.api.nvim_set_hl(0, "CmpItemKindText", { fg = '#9da9a0', bg = 'NONE', italic = true }) - vim.api.nvim_set_hl(0, "CmpItemKindVariable", { fg = '#7fbbb3', bg = 'NONE', italic = true }) - end, - }, - }, - - -- completion - { - "hrsh7th/nvim-cmp", - version = false, - event = { - -- "InsertEnter", - -- "CmdlineEnter", - "BufWinEnter", - }, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "saadparwaiz1/cmp_luasnip", - }, - opts = function() - -- Set up nvim-cmp with luasnip - local kind_icons = { - Text = "", - Method = "󰆧", - Function = "󰊕", - Constructor = "", - Field = "󰇽", - Variable = "󰂡", - Class = "󰠱", - Interface = "", - Module = "", - Property = "󰜢", - Unit = "", - Value = "󰎠", - Enum = "", - Keyword = "󰌋", - Snippet = "", - Color = "󰏘", - File = "󰈙", - Reference = "", - Folder = "󰉋", - EnumMember = "", - Constant = "󰏿", - Struct = "", - Event = "", - Operator = "󰆕", - TypeParameter = "󰅲" - } - - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and - vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end - - local luasnip = require("luasnip") - local cmp = require("cmp") - - return { - formatting = { - format = function(entry, vim_item) - -- Kind icons - vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind - -- Source - vim_item.menu = ({ - -- buffer = "[Buffer]", - -- nvim_lsp = "[LSP]", - -- luasnip = "[LuaSnip]", - -- nvim_lua = "[Lua]", - -- latex_symbols = "[LaTeX]", - buffer = "", - nvim_lsp = "", - luasnip = "", - nvim_lua = "", - latex_symbols = "", - })[entry.source.name] - return vim_item - end - }, - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - -- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - -- require('snippy').expand_snippet(args.body) -- For `snippy` users. - -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. - end, - }, - -- completion = { - -- autocomplete = false, - -- }, - - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - -- [''] = cmp.mapping.complete(), - -- [''] = cmp.mapping.abort(), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.abort() - else - cmp.complete() - end - end), - [''] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- they way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - -- { name = 'vsnip' }, -- For vsnip users. - { name = 'luasnip' }, -- For luasnip users. - -- { name = 'ultisnips' }, -- For ultisnips users. - -- { name = 'snippy' }, -- For snippy users. - { - name = 'buffer', - option = { - get_bufnrs = function() - return vim.api.nvim_list_bufs() - end - }, - }, - }, { - }), - -- Set configuration for specific filetype. - cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. - }, { - { name = 'buffer' }, - }) - }), - -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline({ '/', '?' }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } - }), - -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) - }), - } - end, - } -} diff --git a/lua/plugin/plenary.lua b/lua/plugin/plenary.lua index 0fe75df..46ee96d 100644 --- a/lua/plugin/plenary.lua +++ b/lua/plugin/plenary.lua @@ -1,6 +1,6 @@ return { - { - "nvim-lua/plenary.nvim", - lazy = true, - }, + { + "nvim-lua/plenary.nvim", + lazy = true, + }, } diff --git a/lua/plugin/treesitter-context.lua b/lua/plugin/treesitter-context.lua index b1f1363..afa8ad1 100644 --- a/lua/plugin/treesitter-context.lua +++ b/lua/plugin/treesitter-context.lua @@ -1,14 +1,14 @@ return { - { - "nvim-treesitter/nvim-treesitter-context", - event = "VeryLazy", - config = function () - require('treesitter-context').setup{ - enable = true, - max_lines = 0, - min_window_height = 0, - line_numbers = true, - } - end - } + { + "nvim-treesitter/nvim-treesitter-context", + event = "VeryLazy", + config = function() + require('treesitter-context').setup { + enable = true, + max_lines = 0, + min_window_height = 0, + line_numbers = true, + } + end + } } diff --git a/lua/plugin/treesitter-textobjects.lua b/lua/plugin/treesitter-textobjects.lua index dac0dda..2040acd 100644 --- a/lua/plugin/treesitter-textobjects.lua +++ b/lua/plugin/treesitter-textobjects.lua @@ -45,7 +45,7 @@ return { -- mapping query_strings to modes. selection_modes = { ['@parameter.outer'] = 'v', -- charwise - ['@function.outer'] = 'V', -- linewise + ['@function.outer'] = 'V', -- linewise }, -- If you set this to `true` (default is `false`) then any textobject is -- extended to include preceding or succeeding whitespace. Succeeding diff --git a/lua/plugin/treesitter.lua b/lua/plugin/treesitter.lua index 0b73d09..a0a7947 100644 --- a/lua/plugin/treesitter.lua +++ b/lua/plugin/treesitter.lua @@ -1,32 +1,32 @@ return { - { - "nvim-treesitter/nvim-treesitter", - version = false, - build = ":TSUpdate", - -- event = "BufReadPre", - opts = { - ensure_installed = { - "c", - "lua", - "rust", - "latex", - "bibtex", - "python", - "vim", - "yaml", - "json", - }, - sync_install = false, - auto_install = true, - highlight = { - enable = true, - disable = { - "markdown", - }, - }, + { + "nvim-treesitter/nvim-treesitter", + version = false, + build = ":TSUpdate", + -- event = "BufReadPre", + opts = { + ensure_installed = { + "c", + "lua", + "rust", + "latex", + "bibtex", + "python", + "vim", + "yaml", + "json", + }, + sync_install = false, + auto_install = true, + highlight = { + enable = true, + disable = { + "markdown", }, - config = function(_, opts) - require("nvim-treesitter.configs").setup(opts) - end, - } + }, + }, + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, + } } diff --git a/lua/plugin/trouble.lua b/lua/plugin/trouble.lua deleted file mode 100644 index 943da86..0000000 --- a/lua/plugin/trouble.lua +++ /dev/null @@ -1,41 +0,0 @@ -return { - { - "folke/trouble.nvim", - opts = {}, -- for default options, refer to the configuration section for custom setup. - cmd = "Trouble", - keys = { - { - "xx", - "Trouble diagnostics toggle", - desc = "Diagnostics (Trouble)", - }, - { - "xX", - "Trouble diagnostics toggle filter.buf=0", - desc = "Buffer Diagnostics (Trouble)", - }, - { - "xs", - "Trouble symbols toggle focus=false", - desc = "Symbols (Trouble)", - }, - { - "xl", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP Definitions / references / ... (Trouble)", - }, - { - "xL", - "Trouble loclist toggle", - desc = "Location List (Trouble)", - }, - { - "xQ", - "Trouble qflist toggle", - desc = "Quickfix List (Trouble)", - }, - }, - } - - -} diff --git a/lua/plugin/undotree.lua b/lua/plugin/undotree.lua index b7a7346..6fb2067 100644 --- a/lua/plugin/undotree.lua +++ b/lua/plugin/undotree.lua @@ -1,14 +1,13 @@ return { - { - "mbbill/undotree", - keys = { - { "u", "UndotreeToggle", desc = "toggle undotree" }, - }, - config = function() - vim.g.undotree_WindowLayout = 4 - vim.g.undotree_SplitWidth = 40 - vim.g.undotree_SetFocusWhenToggle = 1 - end - } + { + "mbbill/undotree", + keys = { + { "u", "UndotreeToggle", desc = "toggle undotree" }, + }, + config = function() + vim.g.undotree_WindowLayout = 4 + vim.g.undotree_SplitWidth = 40 + vim.g.undotree_SetFocusWhenToggle = 1 + end + } } - diff --git a/lua/plugin/zen.lua b/lua/plugin/zen.lua index dc3610f..08dcc9e 100644 --- a/lua/plugin/zen.lua +++ b/lua/plugin/zen.lua @@ -4,7 +4,7 @@ return { opts = { window = { backdrop = 1, - width = 101, + width = 120, }, plugins = { options = {