From 737fb45fac0831eb876690c490db9fbbf02e93f6 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Sun, 13 Jul 2025 01:14:36 +0200 Subject: [PATCH] (neovim) Go back to LazyVim, as it's blazingy fast. --- _saved/vim/ftpd/init.lua | 2 + .../nvim => _saved/vim/ftpd}/lsp/lua.lua | 0 .../vim/ftpd}/lsp/terraform.lua | 0 _saved/vim/ftpd/lua/config/autocmds.lua | 100 ++++++++++++++++ .../vim/ftpd}/lua/config/init.lua | 0 _saved/vim/ftpd/lua/config/keymaps.lua | 74 ++++++++++++ .../vim/ftpd}/lua/config/settings.lua | 0 .../vim/ftpd}/lua/core/init.lua | 0 .../vim/ftpd}/lua/core/lazy.lua | 0 .../nvim => _saved/vim/ftpd}/lua/core/lsp.lua | 0 .../vim/ftpd}/lua/core/mason-path.lua | 0 _saved/vim/ftpd/lua/plugins/blink.lua | 64 +++++++++++ .../vim/ftpd}/lua/plugins/conform.lua | 0 .../vim/ftpd}/lua/plugins/gitsigns.lua | 0 _saved/vim/ftpd/lua/plugins/lualine.lua | 60 ++++++++++ .../vim/ftpd}/lua/plugins/mason.lua | 0 .../vim/ftpd}/lua/plugins/mini.lua | 0 _saved/vim/ftpd/lua/plugins/monokai.lua | 10 ++ .../vim/ftpd}/lua/plugins/noice.lua | 0 _saved/vim/ftpd/lua/plugins/snacks.lua | 47 ++++++++ _saved/vim/ftpd/lua/plugins/treesitter.lua | 25 ++++ _saved/vim/ftpd/lua/plugins/which-key.lua | 36 ++++++ _saved/vim/{lazyvim => ftpd}/stylua.toml | 0 _saved/vim/lazyvim/init.lua | 2 - _saved/vim/lazyvim/lua/config/autocmds.lua | 25 ---- _saved/vim/lazyvim/lua/config/keymaps.lua | 67 ----------- _saved/vim/lazyvim/lua/config/options.lua | 20 ---- _saved/vim/lazyvim/lua/plugins/lualine.lua | 40 ------- _saved/vim/lazyvim/lua/plugins/monokai.lua | 15 --- _saved/vim/lazyvim/lua/plugins/snacks.lua | 28 ----- _saved/vim/lazyvim/lua/plugins/treesitter.lua | 18 --- _saved/vim/lazyvim/lua/plugins/which-key.lua | 35 ------ .../lazyvim => config/common/nvim}/.gitignore | 0 .../common/nvim}/.neoconf.json | 0 .../lazyvim => config/common/nvim}/LICENSE | 0 .../lazyvim => config/common/nvim}/README.md | 0 config/common/nvim/init.lua | 4 +- config/common/nvim/lua/config/autocmds.lua | 63 +---------- config/common/nvim/lua/config/keymaps.lua | 76 +++++++++---- .../common/nvim}/lua/config/lazy.lua | 0 config/common/nvim/lua/config/options.lua | 44 +++++++ config/common/nvim/lua/plugins/blink.lua | 72 ++---------- .../common/nvim}/lua/plugins/disabled.lua | 0 .../common/nvim}/lua/plugins/lsp.lua | 0 config/common/nvim/lua/plugins/lualine.lua | 107 +++++++++--------- config/common/nvim/lua/plugins/monokai.lua | 19 ++-- config/common/nvim/lua/plugins/treesitter.lua | 38 +++---- config/common/nvim/lua/plugins/which-key.lua | 61 +++++----- 48 files changed, 644 insertions(+), 508 deletions(-) create mode 100644 _saved/vim/ftpd/init.lua rename {config/common/nvim => _saved/vim/ftpd}/lsp/lua.lua (100%) rename {config/common/nvim => _saved/vim/ftpd}/lsp/terraform.lua (100%) create mode 100644 _saved/vim/ftpd/lua/config/autocmds.lua rename {config/common/nvim => _saved/vim/ftpd}/lua/config/init.lua (100%) create mode 100644 _saved/vim/ftpd/lua/config/keymaps.lua rename {config/common/nvim => _saved/vim/ftpd}/lua/config/settings.lua (100%) rename {config/common/nvim => _saved/vim/ftpd}/lua/core/init.lua (100%) rename {config/common/nvim => _saved/vim/ftpd}/lua/core/lazy.lua (100%) rename {config/common/nvim => _saved/vim/ftpd}/lua/core/lsp.lua (100%) rename {config/common/nvim => _saved/vim/ftpd}/lua/core/mason-path.lua (100%) create mode 100644 _saved/vim/ftpd/lua/plugins/blink.lua rename {config/common/nvim => _saved/vim/ftpd}/lua/plugins/conform.lua (100%) rename {config/common/nvim => _saved/vim/ftpd}/lua/plugins/gitsigns.lua (100%) create mode 100644 _saved/vim/ftpd/lua/plugins/lualine.lua rename {config/common/nvim => _saved/vim/ftpd}/lua/plugins/mason.lua (100%) rename {config/common/nvim => _saved/vim/ftpd}/lua/plugins/mini.lua (100%) create mode 100644 _saved/vim/ftpd/lua/plugins/monokai.lua rename {config/common/nvim => _saved/vim/ftpd}/lua/plugins/noice.lua (100%) create mode 100644 _saved/vim/ftpd/lua/plugins/snacks.lua create mode 100644 _saved/vim/ftpd/lua/plugins/treesitter.lua create mode 100644 _saved/vim/ftpd/lua/plugins/which-key.lua rename _saved/vim/{lazyvim => ftpd}/stylua.toml (100%) delete mode 100644 _saved/vim/lazyvim/init.lua delete mode 100644 _saved/vim/lazyvim/lua/config/autocmds.lua delete mode 100644 _saved/vim/lazyvim/lua/config/keymaps.lua delete mode 100644 _saved/vim/lazyvim/lua/config/options.lua delete mode 100644 _saved/vim/lazyvim/lua/plugins/lualine.lua delete mode 100644 _saved/vim/lazyvim/lua/plugins/monokai.lua delete mode 100644 _saved/vim/lazyvim/lua/plugins/snacks.lua delete mode 100644 _saved/vim/lazyvim/lua/plugins/treesitter.lua delete mode 100644 _saved/vim/lazyvim/lua/plugins/which-key.lua rename {_saved/vim/lazyvim => config/common/nvim}/.gitignore (100%) rename {_saved/vim/lazyvim => config/common/nvim}/.neoconf.json (100%) rename {_saved/vim/lazyvim => config/common/nvim}/LICENSE (100%) rename {_saved/vim/lazyvim => config/common/nvim}/README.md (100%) rename {_saved/vim/lazyvim => config/common/nvim}/lua/config/lazy.lua (100%) create mode 100644 config/common/nvim/lua/config/options.lua rename {_saved/vim/lazyvim => config/common/nvim}/lua/plugins/disabled.lua (100%) rename {_saved/vim/lazyvim => config/common/nvim}/lua/plugins/lsp.lua (100%) diff --git a/_saved/vim/ftpd/init.lua b/_saved/vim/ftpd/init.lua new file mode 100644 index 0000000..f6daed1 --- /dev/null +++ b/_saved/vim/ftpd/init.lua @@ -0,0 +1,2 @@ +require("config") +require("core") diff --git a/config/common/nvim/lsp/lua.lua b/_saved/vim/ftpd/lsp/lua.lua similarity index 100% rename from config/common/nvim/lsp/lua.lua rename to _saved/vim/ftpd/lsp/lua.lua diff --git a/config/common/nvim/lsp/terraform.lua b/_saved/vim/ftpd/lsp/terraform.lua similarity index 100% rename from config/common/nvim/lsp/terraform.lua rename to _saved/vim/ftpd/lsp/terraform.lua diff --git a/_saved/vim/ftpd/lua/config/autocmds.lua b/_saved/vim/ftpd/lua/config/autocmds.lua new file mode 100644 index 0000000..824f84b --- /dev/null +++ b/_saved/vim/ftpd/lua/config/autocmds.lua @@ -0,0 +1,100 @@ +-- don't auto comment new line +vim.api.nvim_create_autocmd("BufEnter", { command = [[set formatoptions-=cro]] }) + +-- resize neovim split when terminal is resized +vim.api.nvim_command("autocmd VimResized * wincmd =") + +-- enable spell for text files +vim.api.nvim_create_autocmd("FileType", { + group = vim.api.nvim_create_augroup("spell", { clear = true }), + pattern = { "text", "plaintex", "typst", "gitcommit", "markdown" }, + callback = function() + vim.api.nvim_set_hl(0, "SpellBad", { bg = "#770000", fg = "#ffffff" }) + vim.opt_local.spell = true + end, +}) + +-- set some colors +vim.api.nvim_create_autocmd({ "BufReadPre" }, { + callback = function() + vim.api.nvim_set_hl(0, "ColorColumn", { bg = "#770000" }) + vim.api.nvim_set_hl(0, "DiffChange", { bg = "NONE", fg = "#e7c547" }) + vim.api.nvim_set_hl(0, "DiffText", { bg = "NONE", fg = "#ff8700" }) + vim.api.nvim_set_hl(0, "Visual", { bg = "#0094d8", fg = "#ffffff" }) + end, +}) + +-- fix dimmed elements in Snacks.picker +vim.api.nvim_create_autocmd("User", { + pattern = "VeryLazy", + callback = function() + Snacks.util.set_hl({ + PickerDir = { link = "Text" }, + PickerPathHidden = { link = "Text" }, + PickerPathIgnored = { link = "Comment" }, + PickerGitStatusUntracked = { link = "Special" }, + }, { prefix = "Snacks" }) + end, +}) + +-- remember last location +vim.api.nvim_create_autocmd("BufReadPost", { + group = vim.api.nvim_create_augroup("last-loc", { clear = true }), + callback = function(event) + local exclude = { "gitcommit" } + local buf = event.buf + if vim.tbl_contains(exclude, vim.bo[buf].filetype) or vim.b[buf].my_last_loc then + return + end + vim.b[buf].my_last_loc = true + local mark = vim.api.nvim_buf_get_mark(buf, '"') + local lcount = vim.api.nvim_buf_line_count(buf) + if mark[1] > 0 and mark[1] <= lcount then + pcall(vim.api.nvim_win_set_cursor, 0, mark) + end + end, +}) + +-- lsp +vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }), + callback = function(event) + local map = function(keys, func, desc) + vim.keymap.set("n", keys, func, { buffer = event.buf, desc = desc }) + end + map("cd", vim.diagnostic.open_float, "diagnostic (float)") + map("ch", vim.lsp.buf.hover, "help") + map("ca", vim.lsp.buf.code_action, "actions") + map("cf", vim.lsp.buf.format, "format file") + local function client_supports_method(client, method, bufnr) + if vim.fn.has("nvim-0.11") == 1 then + return client:supports_method(method, bufnr) + else + return client.supports_method(method, { bufnr = bufnr }) + end + end + local client = vim.lsp.get_client_by_id(event.data.client_id) + if + client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) + then + local highlight_augroup = vim.api.nvim_create_augroup("lsp-highlight", { clear = false }) + vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.document_highlight, + }) + vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.clear_references, + }) + vim.api.nvim_create_autocmd("LspDetach", { + group = vim.api.nvim_create_augroup("lsp-detach", { clear = true }), + callback = function(event2) + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds({ group = "lsp-highlight", buffer = event2.buf }) + end, + }) + end + end, +}) diff --git a/config/common/nvim/lua/config/init.lua b/_saved/vim/ftpd/lua/config/init.lua similarity index 100% rename from config/common/nvim/lua/config/init.lua rename to _saved/vim/ftpd/lua/config/init.lua diff --git a/_saved/vim/ftpd/lua/config/keymaps.lua b/_saved/vim/ftpd/lua/config/keymaps.lua new file mode 100644 index 0000000..4b6a090 --- /dev/null +++ b/_saved/vim/ftpd/lua/config/keymaps.lua @@ -0,0 +1,74 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +local map = vim.keymap.set + +map("i", "", "I") +map("i", "", "A") + +map("v", "/", "gc", { desc = "toggle comments", remap = true }) + +map("n", "", "wqa", { desc = "save and exit", remap = true }) +map("n", "", "wqa", { desc = "save and exit", remap = true }) +map("n", "", "w", { desc = "switch pane", remap = true }) + +map("n", "+", ":vertical resize +5") +map("n", "_", ":vertical resize -5") +map("n", "=", ":resize +5") +map("n", "-", ":resize -5") + +map("n", "-", "s", { desc = "split horizontally", remap = true }) +map("n", "/", "gcc", { desc = "toggle comments", remap = true }) +map("n", "|", "v", { desc = "split vertically", remap = true }) + +map("n", "b[", "bprevious", { desc = "buffer previous", remap = true }) +map("n", "b]", "bnext", { desc = "buffer next", remap = true }) +map("n", "bd", function() + Snacks.bufdelete() +end, { desc = "buffer delete", remap = true }) +map("n", "bl", function() + Snacks.picker.buffers() +end, { desc = "buffer list", remap = true }) +map("n", "bn", "enew", { desc = "buffer create", remap = true }) + +map("n", "e", function() + Snacks.explorer() +end, { desc = "explorer", remap = true }) +map("n", "s", "set hlsearch!", { desc = "toggle hlsearch", remap = true }) + +map("n", "ff", function() + Snacks.picker.files() +end, { desc = "files", remap = true }) +map("n", "fg", function() + Snacks.picker.grep() +end, { desc = "grep", remap = true }) + +map("n", "hc", function() + Snacks.picker.command_history() +end, { desc = "commands", remap = true }) +map("n", "hn", "Noice", { desc = "notifications", remap = true }) +map("n", "hs", function() + Snacks.picker.search_history() +end, { desc = "search", remap = true }) + +map( + "n", + "m", + 'execute "set colorcolumn=" . (&colorcolumn == "" ? "80,120" : "")', + { desc = "toggle columns" } +) +map("n", "n", function() + vim.cmd("set number!") + vim.cmd('execute "set signcolumn=" . (&signcolumn == "yes" ? "no" : "yes")') + if Snacks.indent.enabled then + Snacks.indent.disable() + else + Snacks.indent.enable() + end +end, { desc = "toggle decorations", remap = true }) +map("n", "t", function() + Snacks.terminal() +end, { desc = "terminal", remap = true }) + +map("n", "us", "set spell!", { desc = "toggle spell", remap = true }) +map("n", "uw", "set wrap!", { desc = "toggle wrap", remap = true }) diff --git a/config/common/nvim/lua/config/settings.lua b/_saved/vim/ftpd/lua/config/settings.lua similarity index 100% rename from config/common/nvim/lua/config/settings.lua rename to _saved/vim/ftpd/lua/config/settings.lua diff --git a/config/common/nvim/lua/core/init.lua b/_saved/vim/ftpd/lua/core/init.lua similarity index 100% rename from config/common/nvim/lua/core/init.lua rename to _saved/vim/ftpd/lua/core/init.lua diff --git a/config/common/nvim/lua/core/lazy.lua b/_saved/vim/ftpd/lua/core/lazy.lua similarity index 100% rename from config/common/nvim/lua/core/lazy.lua rename to _saved/vim/ftpd/lua/core/lazy.lua diff --git a/config/common/nvim/lua/core/lsp.lua b/_saved/vim/ftpd/lua/core/lsp.lua similarity index 100% rename from config/common/nvim/lua/core/lsp.lua rename to _saved/vim/ftpd/lua/core/lsp.lua diff --git a/config/common/nvim/lua/core/mason-path.lua b/_saved/vim/ftpd/lua/core/mason-path.lua similarity index 100% rename from config/common/nvim/lua/core/mason-path.lua rename to _saved/vim/ftpd/lua/core/mason-path.lua diff --git a/_saved/vim/ftpd/lua/plugins/blink.lua b/_saved/vim/ftpd/lua/plugins/blink.lua new file mode 100644 index 0000000..0e89abc --- /dev/null +++ b/_saved/vim/ftpd/lua/plugins/blink.lua @@ -0,0 +1,64 @@ +return { + { "L3MON4D3/LuaSnip", keys = {} }, + { + "saghen/blink.cmp", + dependencies = { + "rafamadriz/friendly-snippets", + }, + version = "*", + config = function() + require("blink.cmp").setup({ + snippets = { preset = "luasnip" }, + signature = { enabled = true }, + appearance = { + use_nvim_cmp_as_default = false, + nerd_font_variant = "normal", + }, + sources = { + default = { "lsp", "path", "snippets", "buffer" }, + providers = { + cmdline = { + min_keyword_length = 2, + }, + }, + }, + keymap = { + [""] = { "accept", "fallback" }, + }, + cmdline = { + enabled = false, + completion = { menu = { auto_show = true } }, + keymap = { + [""] = { "accept_and_enter", "fallback" }, + }, + }, + completion = { + menu = { + border = nil, + scrolloff = 1, + scrollbar = false, + draw = { + columns = { + { "kind_icon" }, + { "label", "label_description", gap = 1 }, + { "kind" }, + { "source_name" }, + }, + }, + }, + documentation = { + window = { + border = nil, + scrollbar = false, + winhighlight = "Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,EndOfBuffer:BlinkCmpDoc", + }, + auto_show = true, + auto_show_delay_ms = 500, + }, + }, + }) + + require("luasnip.loaders.from_vscode").lazy_load() + end, + }, +} diff --git a/config/common/nvim/lua/plugins/conform.lua b/_saved/vim/ftpd/lua/plugins/conform.lua similarity index 100% rename from config/common/nvim/lua/plugins/conform.lua rename to _saved/vim/ftpd/lua/plugins/conform.lua diff --git a/config/common/nvim/lua/plugins/gitsigns.lua b/_saved/vim/ftpd/lua/plugins/gitsigns.lua similarity index 100% rename from config/common/nvim/lua/plugins/gitsigns.lua rename to _saved/vim/ftpd/lua/plugins/gitsigns.lua diff --git a/_saved/vim/ftpd/lua/plugins/lualine.lua b/_saved/vim/ftpd/lua/plugins/lualine.lua new file mode 100644 index 0000000..3dcbf09 --- /dev/null +++ b/_saved/vim/ftpd/lua/plugins/lualine.lua @@ -0,0 +1,60 @@ +return { + "nvim-lualine/lualine.nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("lualine").setup({ + options = { + theme = "monokai-pro", + section_separators = "", + component_separators = "", + globalstatus = false, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch" }, + lualine_c = { + { + "diff", + symbols = { + added = " ", + modified = " ", + removed = " ", + }, + }, + { + "diagnostics", + symbols = { + error = " ", + warn = " ", + info = " ", + hint = " ", + }, + }, + { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, + { "filename", file_status = true, path = 1 }, + }, + lualine_x = { + { + "lsp_status", + symbols = { + spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }, + done = "✓", + separator = " ", + }, + }, + }, + lualine_y = { + { "searchcount" }, + { "progress", separator = " ", padding = { left = 1, right = 0 } }, + { "location", padding = { left = 0, right = 1 } }, + }, + lualine_z = {}, + }, + tabline = { + lualine_a = { "buffers" }, + }, + }) + end, +} diff --git a/config/common/nvim/lua/plugins/mason.lua b/_saved/vim/ftpd/lua/plugins/mason.lua similarity index 100% rename from config/common/nvim/lua/plugins/mason.lua rename to _saved/vim/ftpd/lua/plugins/mason.lua diff --git a/config/common/nvim/lua/plugins/mini.lua b/_saved/vim/ftpd/lua/plugins/mini.lua similarity index 100% rename from config/common/nvim/lua/plugins/mini.lua rename to _saved/vim/ftpd/lua/plugins/mini.lua diff --git a/_saved/vim/ftpd/lua/plugins/monokai.lua b/_saved/vim/ftpd/lua/plugins/monokai.lua new file mode 100644 index 0000000..03c45eb --- /dev/null +++ b/_saved/vim/ftpd/lua/plugins/monokai.lua @@ -0,0 +1,10 @@ +return { + "loctvl842/monokai-pro.nvim", + priority = 10000, + config = function() + require("monokai-pro").setup({ + filter = "classic", + }) + vim.cmd.colorscheme("monokai-pro") + end, +} diff --git a/config/common/nvim/lua/plugins/noice.lua b/_saved/vim/ftpd/lua/plugins/noice.lua similarity index 100% rename from config/common/nvim/lua/plugins/noice.lua rename to _saved/vim/ftpd/lua/plugins/noice.lua diff --git a/_saved/vim/ftpd/lua/plugins/snacks.lua b/_saved/vim/ftpd/lua/plugins/snacks.lua new file mode 100644 index 0000000..2d3fa53 --- /dev/null +++ b/_saved/vim/ftpd/lua/plugins/snacks.lua @@ -0,0 +1,47 @@ +return { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + config = function() + require("snacks").setup({ + animate = { enabled = false }, + bigfile = { enabled = false }, + bufdelete = { enabled = true }, + dashboard = { enabled = false }, + debug = { enabled = false }, + dim = { enabled = false }, + explorer = { enabled = true, replace_netrw = true }, + git = { enabled = false }, + gitbrowse = { enabled = false }, + image = { enabled = false }, + indent = { enabled = true }, + input = { enabled = true }, + layout = { enabled = false }, + lazygit = { enabled = false }, + notifier = { enabled = true }, + notify = { enabled = true }, + picker = { + enabled = true, + files = { + hidden = true, + ignored = true, + }, + hidden = true, + ignored = true, + }, + profiler = { enabled = false }, + quickfile = { enabled = true }, + rename = { enabled = false }, + scope = { enabled = true }, + scratch = { enabled = false }, + scroll = { enabled = true }, + statuscolumn = { enabled = false }, + terminal = { enabled = true }, + toggle = { enabled = false }, + util = { enabled = true }, + win = { enabled = false }, + words = { enabled = false }, + zen = { enabled = false }, + }) + end, +} diff --git a/_saved/vim/ftpd/lua/plugins/treesitter.lua b/_saved/vim/ftpd/lua/plugins/treesitter.lua new file mode 100644 index 0000000..394fa1f --- /dev/null +++ b/_saved/vim/ftpd/lua/plugins/treesitter.lua @@ -0,0 +1,25 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "bash", + "diff", + "gotmpl", + "hcl", + "helm", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "regex", + "terraform", + "vim", + }, + highlight = { enable = true }, + indent = { enable = true }, + }) + end, +} diff --git a/_saved/vim/ftpd/lua/plugins/which-key.lua b/_saved/vim/ftpd/lua/plugins/which-key.lua new file mode 100644 index 0000000..c9f05f8 --- /dev/null +++ b/_saved/vim/ftpd/lua/plugins/which-key.lua @@ -0,0 +1,36 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + config = function() + require("which-key").setup({ + preset = "helix", + delay = 300, + icons = { + rules = false, + breadcrumb = " ", + separator = "󱦰 ", + group = "󰹍 ", + }, + plugins = { + spelling = { + enabled = false, + }, + }, + win = { + height = { + max = math.huge, + }, + }, + spec = { + { + mode = { "n", "v" }, + { "b", group = "buffer" }, + { "c", group = "code" }, + { "f", group = "find" }, + { "h", group = "history" }, + { "u", group = "ui" }, + }, + }, + }) + end, +} diff --git a/_saved/vim/lazyvim/stylua.toml b/_saved/vim/ftpd/stylua.toml similarity index 100% rename from _saved/vim/lazyvim/stylua.toml rename to _saved/vim/ftpd/stylua.toml diff --git a/_saved/vim/lazyvim/init.lua b/_saved/vim/lazyvim/init.lua deleted file mode 100644 index 2514f9e..0000000 --- a/_saved/vim/lazyvim/init.lua +++ /dev/null @@ -1,2 +0,0 @@ --- bootstrap lazy.nvim, LazyVim and your plugins -require("config.lazy") diff --git a/_saved/vim/lazyvim/lua/config/autocmds.lua b/_saved/vim/lazyvim/lua/config/autocmds.lua deleted file mode 100644 index fb101c3..0000000 --- a/_saved/vim/lazyvim/lua/config/autocmds.lua +++ /dev/null @@ -1,25 +0,0 @@ --- Autocmds are automatically loaded on the VeryLazy event --- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua --- --- Add any additional autocmds here --- with `vim.api.nvim_create_autocmd` --- --- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults) --- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell") - -vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { - pattern = { "helmfile.y?ml", "*.gotmpl" }, - callback = function() - vim.cmd("set filetype=helm") - end, -}) - -vim.api.nvim_create_autocmd({ "BufReadPre" }, { - callback = function() - vim.api.nvim_set_hl(0, "ColorColumn", { bg = "#770000" }) - vim.api.nvim_set_hl(0, "DiffChange", { bg = "NONE", fg = "#e7c547" }) - vim.api.nvim_set_hl(0, "DiffText", { bg = "NONE", fg = "#ff8700" }) - vim.api.nvim_set_hl(0, "SpellBad", { bg = "#770000", fg = "#ffffff" }) - vim.api.nvim_set_hl(0, "Visual", { bg = "#0094d8", fg = "#ffffff" }) - end, -}) diff --git a/_saved/vim/lazyvim/lua/config/keymaps.lua b/_saved/vim/lazyvim/lua/config/keymaps.lua deleted file mode 100644 index 5cda86d..0000000 --- a/_saved/vim/lazyvim/lua/config/keymaps.lua +++ /dev/null @@ -1,67 +0,0 @@ --- Keymaps are automatically loaded on the VeryLazy event --- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua --- Add any additional keymaps here - -local map = vim.keymap.set -local nomap = vim.keymap.del - -nomap("n", "") -nomap("n", ",") -nomap("n", ".") -nomap("n", "?") -nomap("n", "K") -nomap("n", "l") -nomap("n", "L") -nomap("n", "S") -nomap("n", "`") - -nomap("n", "bb") -nomap("n", "bD") -nomap("n", "bo") - -nomap("n", "E") - -nomap("n", "fB") -nomap("n", "fe") -nomap("n", "fE") -nomap("n", "fn") -nomap("n", "fp") -nomap("n", "fR") -nomap("n", "ft") -nomap("n", "fT") - -nomap("n", "gY") -nomap("n", "gS") - -nomap("n", "qq") - -nomap("n", "xl") -nomap("n", "xq") - -map("i", "", "I") -map("i", "", "A") - -map("n", "", "wq!", { desc = "Save and Exit", remap = true }) -map("n", "", "w", { desc = "Switch Pane", remap = true }) - -map("n", "-", "s", { desc = "Split Horizontally", remap = true }) -map("n", "/", "gcc", { desc = "Toggle Comments", remap = true }) -map("n", "|", "v", { desc = "Split Vertically", remap = true }) -map("n", "bl", function() - Snacks.picker.buffers() -end, { desc = "Buffer List", remap = true }) -map("n", "b[", "bprevious", { desc = "Previous Buffer", remap = true }) -map("n", "b]", "bnext", { desc = "Next Buffer", remap = true }) -map("n", "bn", "enew", { desc = "New Buffer", remap = true }) -map("n", "h", "set hlsearch!", { desc = "Toggle hlsearch", remap = true }) -map( - "n", - "m", - 'execute "set colorcolumn=" . (&colorcolumn == "" ? "80,120" : "")', - { desc = "Toggle Columns", remap = true } -) -map("n", "T", function() - Snacks.terminal() -end, { desc = "Terminal", remap = true }) - -map("v", "/", "gc", { desc = "Toggle Comments", remap = true }) diff --git a/_saved/vim/lazyvim/lua/config/options.lua b/_saved/vim/lazyvim/lua/config/options.lua deleted file mode 100644 index 67ec8cb..0000000 --- a/_saved/vim/lazyvim/lua/config/options.lua +++ /dev/null @@ -1,20 +0,0 @@ --- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua -local o = vim.o -o.expandtab = true -o.gdefault = true -o.hlsearch = false -o.inccommand = "split" -o.relativenumber = false -o.shiftround = true -o.termguicolors = true -o.wrap = true -o.writebackup = false - -o.clipboard = "" -o.foldcolumn = "0" -o.mouse = "" -o.shiftwidth = 2 -o.softtabstop = 2 -o.statuscolumn = "" -o.tabstop = 2 -o.whichwrap = "" diff --git a/_saved/vim/lazyvim/lua/plugins/lualine.lua b/_saved/vim/lazyvim/lua/plugins/lualine.lua deleted file mode 100644 index 4b6a4c0..0000000 --- a/_saved/vim/lazyvim/lua/plugins/lualine.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - "nvim-lualine/lualine.nvim", - opts = { - options = { - theme = "powerline", - section_separators = "", - component_separators = "", - globalstatus = false, - }, - sections = { - lualine_c = { - { - "diagnostics", - symbols = { - error = LazyVim.config.icons.diagnostics.Error, - warn = LazyVim.config.icons.diagnostics.Warn, - info = LazyVim.config.icons.diagnostics.Info, - hint = LazyVim.config.icons.diagnostics.Hint, - }, - }, - { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, - { "filename", file_status = true, path = 1 }, - }, - lualine_x = { - { - "diff", - symbols = { - added = LazyVim.config.icons.git.added, - modified = LazyVim.config.icons.git.modified, - removed = LazyVim.config.icons.git.removed, - }, - }, - }, - lualine_z = {}, - }, - tabline = { - lualine_a = { "buffers" }, - }, - }, -} diff --git a/_saved/vim/lazyvim/lua/plugins/monokai.lua b/_saved/vim/lazyvim/lua/plugins/monokai.lua deleted file mode 100644 index bd1de20..0000000 --- a/_saved/vim/lazyvim/lua/plugins/monokai.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - { - "loctvl842/monokai-pro.nvim", - priority = 1000, - opts = { - filter = "classic", - }, - }, - { - "LazyVim/LazyVim", - opts = { - colorscheme = "monokai-pro", - }, - }, -} diff --git a/_saved/vim/lazyvim/lua/plugins/snacks.lua b/_saved/vim/lazyvim/lua/plugins/snacks.lua deleted file mode 100644 index 8c38215..0000000 --- a/_saved/vim/lazyvim/lua/plugins/snacks.lua +++ /dev/null @@ -1,28 +0,0 @@ -return { - "folke/snacks.nvim", - opts = { - dashboard = { enabled = false }, - }, - keys = { - { - "n", - function() - vim.cmd("set number!") - vim.cmd('execute "set signcolumn=" . (&signcolumn == "yes" ? "no" : "yes")') - if Snacks.indent.enabled then - Snacks.indent.disable() - else - Snacks.indent.enable() - end - end, - desc = "Toggle Decorations", - }, - { - "e", - function() - Snacks.explorer() - end, - desc = "File Explorer", - }, - }, -} diff --git a/_saved/vim/lazyvim/lua/plugins/treesitter.lua b/_saved/vim/lazyvim/lua/plugins/treesitter.lua deleted file mode 100644 index ac75221..0000000 --- a/_saved/vim/lazyvim/lua/plugins/treesitter.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "bash", - "diff", - "gotmpl", - "helm", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "terraform", - "vim", - }, - }, -} diff --git a/_saved/vim/lazyvim/lua/plugins/which-key.lua b/_saved/vim/lazyvim/lua/plugins/which-key.lua deleted file mode 100644 index 47460fe..0000000 --- a/_saved/vim/lazyvim/lua/plugins/which-key.lua +++ /dev/null @@ -1,35 +0,0 @@ -return { - "folke/which-key.nvim", - event = "VeryLazy", - opts_extend = { "spec" }, - opts = { - preset = "helix", - icons = { - mappings = false, - }, - defaults = {}, - spec = { - { - mode = { "n", "v" }, - { - "b", - group = "buffer", - expand = function() - return require("which-key.extras").expand.buf() - end, - }, - { "", group = "tabs", hidden = true }, - { "d", group = "debug", hidden = true }, - { "dp", group = "profiler", hidden = true }, - { "gh", group = "hunks", hidden = true }, - { "q", group = "quit/session", hidden = true }, - { "s", group = "search", hidden = true }, - { "t", hidden = true }, - { "u", group = "ui", hidden = true }, - { "w", hidden = true }, - { "x", group = "diagnostics/quickfix", hidden = true }, - { "gx", desc = "Open with system app", hidden = true }, - }, - }, - }, -} diff --git a/_saved/vim/lazyvim/.gitignore b/config/common/nvim/.gitignore similarity index 100% rename from _saved/vim/lazyvim/.gitignore rename to config/common/nvim/.gitignore diff --git a/_saved/vim/lazyvim/.neoconf.json b/config/common/nvim/.neoconf.json similarity index 100% rename from _saved/vim/lazyvim/.neoconf.json rename to config/common/nvim/.neoconf.json diff --git a/_saved/vim/lazyvim/LICENSE b/config/common/nvim/LICENSE similarity index 100% rename from _saved/vim/lazyvim/LICENSE rename to config/common/nvim/LICENSE diff --git a/_saved/vim/lazyvim/README.md b/config/common/nvim/README.md similarity index 100% rename from _saved/vim/lazyvim/README.md rename to config/common/nvim/README.md diff --git a/config/common/nvim/init.lua b/config/common/nvim/init.lua index f6daed1..2514f9e 100644 --- a/config/common/nvim/init.lua +++ b/config/common/nvim/init.lua @@ -1,2 +1,2 @@ -require("config") -require("core") +-- bootstrap lazy.nvim, LazyVim and your plugins +require("config.lazy") diff --git a/config/common/nvim/lua/config/autocmds.lua b/config/common/nvim/lua/config/autocmds.lua index 824f84b..6162353 100644 --- a/config/common/nvim/lua/config/autocmds.lua +++ b/config/common/nvim/lua/config/autocmds.lua @@ -20,6 +20,7 @@ vim.api.nvim_create_autocmd({ "BufReadPre" }, { vim.api.nvim_set_hl(0, "ColorColumn", { bg = "#770000" }) vim.api.nvim_set_hl(0, "DiffChange", { bg = "NONE", fg = "#e7c547" }) vim.api.nvim_set_hl(0, "DiffText", { bg = "NONE", fg = "#ff8700" }) + vim.api.nvim_set_hl(0, "SpellBad", { bg = "#770000", fg = "#ffffff" }) vim.api.nvim_set_hl(0, "Visual", { bg = "#0094d8", fg = "#ffffff" }) end, }) @@ -36,65 +37,3 @@ vim.api.nvim_create_autocmd("User", { }, { prefix = "Snacks" }) end, }) - --- remember last location -vim.api.nvim_create_autocmd("BufReadPost", { - group = vim.api.nvim_create_augroup("last-loc", { clear = true }), - callback = function(event) - local exclude = { "gitcommit" } - local buf = event.buf - if vim.tbl_contains(exclude, vim.bo[buf].filetype) or vim.b[buf].my_last_loc then - return - end - vim.b[buf].my_last_loc = true - local mark = vim.api.nvim_buf_get_mark(buf, '"') - local lcount = vim.api.nvim_buf_line_count(buf) - if mark[1] > 0 and mark[1] <= lcount then - pcall(vim.api.nvim_win_set_cursor, 0, mark) - end - end, -}) - --- lsp -vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }), - callback = function(event) - local map = function(keys, func, desc) - vim.keymap.set("n", keys, func, { buffer = event.buf, desc = desc }) - end - map("cd", vim.diagnostic.open_float, "diagnostic (float)") - map("ch", vim.lsp.buf.hover, "help") - map("ca", vim.lsp.buf.code_action, "actions") - map("cf", vim.lsp.buf.format, "format file") - local function client_supports_method(client, method, bufnr) - if vim.fn.has("nvim-0.11") == 1 then - return client:supports_method(method, bufnr) - else - return client.supports_method(method, { bufnr = bufnr }) - end - end - local client = vim.lsp.get_client_by_id(event.data.client_id) - if - client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) - then - local highlight_augroup = vim.api.nvim_create_augroup("lsp-highlight", { clear = false }) - vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.document_highlight, - }) - vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.clear_references, - }) - vim.api.nvim_create_autocmd("LspDetach", { - group = vim.api.nvim_create_augroup("lsp-detach", { clear = true }), - callback = function(event2) - vim.lsp.buf.clear_references() - vim.api.nvim_clear_autocmds({ group = "lsp-highlight", buffer = event2.buf }) - end, - }) - end - end, -}) diff --git a/config/common/nvim/lua/config/keymaps.lua b/config/common/nvim/lua/config/keymaps.lua index 4b6a090..96eee15 100644 --- a/config/common/nvim/lua/config/keymaps.lua +++ b/config/common/nvim/lua/config/keymaps.lua @@ -1,25 +1,62 @@ -vim.g.mapleader = " " -vim.g.maplocalleader = "\\" +-- Keymaps are automatically loaded on the VeryLazy event +-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua +-- Add any additional keymaps here local map = vim.keymap.set +local nomap = vim.keymap.del + +nomap("n", "") +nomap("n", ",") +nomap("n", ".") +nomap("n", "?") +nomap("n", "K") +nomap("n", "l") +nomap("n", "L") +nomap("n", "S") +nomap("n", "`") + +nomap("n", "bb") +nomap("n", "bD") +nomap("n", "bo") + +nomap("n", "E") + +nomap("n", "fb") +nomap("n", "fc") +nomap("n", "fF") +nomap("n", "fr") + +nomap("n", "fB") +nomap("n", "fe") +nomap("n", "fE") +nomap("n", "fn") +nomap("n", "fp") +nomap("n", "fR") +nomap("n", "ft") +nomap("n", "fT") + +nomap("n", "gY") +nomap("n", "gS") + +nomap("n", "qq") + +nomap("n", "xl") +nomap("n", "xq") map("i", "", "I") map("i", "", "A") -map("v", "/", "gc", { desc = "toggle comments", remap = true }) - -map("n", "", "wqa", { desc = "save and exit", remap = true }) -map("n", "", "wqa", { desc = "save and exit", remap = true }) -map("n", "", "w", { desc = "switch pane", remap = true }) +map("n", "", "wq!", { desc = "Save and Exit", remap = true }) +map("n", "", "w", { desc = "Switch Pane", remap = true }) map("n", "+", ":vertical resize +5") map("n", "_", ":vertical resize -5") map("n", "=", ":resize +5") map("n", "-", ":resize -5") -map("n", "-", "s", { desc = "split horizontally", remap = true }) -map("n", "/", "gcc", { desc = "toggle comments", remap = true }) -map("n", "|", "v", { desc = "split vertically", remap = true }) +map("n", "-", "s", { desc = "Split Horizontally", remap = true }) +map("n", "/", "gcc", { desc = "Toggle Comments", remap = true }) +map("n", "|", "v", { desc = "Split Vertically", remap = true }) map("n", "b[", "bprevious", { desc = "buffer previous", remap = true }) map("n", "b]", "bnext", { desc = "buffer next", remap = true }) @@ -33,7 +70,7 @@ map("n", "bn", "enew", { desc = "buffer create", remap = true } map("n", "e", function() Snacks.explorer() -end, { desc = "explorer", remap = true }) +end, { desc = "Explorer", remap = true }) map("n", "s", "set hlsearch!", { desc = "toggle hlsearch", remap = true }) map("n", "ff", function() @@ -51,12 +88,6 @@ map("n", "hs", function() Snacks.picker.search_history() end, { desc = "search", remap = true }) -map( - "n", - "m", - 'execute "set colorcolumn=" . (&colorcolumn == "" ? "80,120" : "")', - { desc = "toggle columns" } -) map("n", "n", function() vim.cmd("set number!") vim.cmd('execute "set signcolumn=" . (&signcolumn == "yes" ? "no" : "yes")') @@ -65,10 +96,15 @@ map("n", "n", function() else Snacks.indent.enable() end -end, { desc = "toggle decorations", remap = true }) -map("n", "t", function() +end, { desc = "Toggle Decorations", remap = true }) + +map("n", "T", function() Snacks.terminal() -end, { desc = "terminal", remap = true }) +end, { desc = "Terminal", remap = true }) + +map("n", "s", "set hlsearch!", { desc = "Toggle hlsearch", remap = true }) map("n", "us", "set spell!", { desc = "toggle spell", remap = true }) map("n", "uw", "set wrap!", { desc = "toggle wrap", remap = true }) + +map("v", "/", "gc", { desc = "Toggle Comments", remap = true }) diff --git a/_saved/vim/lazyvim/lua/config/lazy.lua b/config/common/nvim/lua/config/lazy.lua similarity index 100% rename from _saved/vim/lazyvim/lua/config/lazy.lua rename to config/common/nvim/lua/config/lazy.lua diff --git a/config/common/nvim/lua/config/options.lua b/config/common/nvim/lua/config/options.lua new file mode 100644 index 0000000..805d8b6 --- /dev/null +++ b/config/common/nvim/lua/config/options.lua @@ -0,0 +1,44 @@ +vim.filetype.add({ + pattern = { + ["helmfile.y.ml"] = "helm", + [".*.gotmpl"] = "helm", + }, +}) + +vim.o.backup = false +vim.o.breakindent = true +vim.o.confirm = true +vim.o.cursorline = true +vim.o.expandtab = true +vim.o.gdefault = true +vim.o.hlsearch = true +vim.o.inccommand = "split" +vim.o.number = true +vim.o.relativenumber = false +vim.o.shiftround = true +vim.o.showcmd = false +vim.o.showmode = false +vim.o.smartcase = true +vim.o.smartindent = true +vim.o.splitbelow = true +vim.o.splitright = true +vim.o.termguicolors = true +vim.o.undofile = true +vim.o.wrap = true +vim.o.writebackup = false + +vim.o.clipboard = "" +vim.o.conceallevel = 0 +vim.o.fileencoding = "utf-8" +vim.o.foldcolumn = "0" +vim.o.mouse = "" +vim.o.shiftwidth = 2 +vim.o.signcolumn = "yes" +vim.o.softtabstop = 2 +vim.o.spelllang = "en_us,pl" +vim.o.statuscolumn = "" +vim.o.tabstop = 2 +vim.o.updatetime = 100 +vim.o.whichwrap = "" + +vim.opt.shortmess:append({ W = true, I = true, c = true, C = true, S = false }) diff --git a/config/common/nvim/lua/plugins/blink.lua b/config/common/nvim/lua/plugins/blink.lua index 0e89abc..ffe32ec 100644 --- a/config/common/nvim/lua/plugins/blink.lua +++ b/config/common/nvim/lua/plugins/blink.lua @@ -1,64 +1,16 @@ return { - { "L3MON4D3/LuaSnip", keys = {} }, - { - "saghen/blink.cmp", - dependencies = { - "rafamadriz/friendly-snippets", + "saghen/blink.cmp", + opts = { + keymap = { + preset = "none", + [""] = { "accept", "fallback" }, + }, + cmdline = { + enabled = true, + completion = { menu = { auto_show = true } }, + keymap = { + [""] = { "accept_and_enter", "fallback" }, + }, }, - version = "*", - config = function() - require("blink.cmp").setup({ - snippets = { preset = "luasnip" }, - signature = { enabled = true }, - appearance = { - use_nvim_cmp_as_default = false, - nerd_font_variant = "normal", - }, - sources = { - default = { "lsp", "path", "snippets", "buffer" }, - providers = { - cmdline = { - min_keyword_length = 2, - }, - }, - }, - keymap = { - [""] = { "accept", "fallback" }, - }, - cmdline = { - enabled = false, - completion = { menu = { auto_show = true } }, - keymap = { - [""] = { "accept_and_enter", "fallback" }, - }, - }, - completion = { - menu = { - border = nil, - scrolloff = 1, - scrollbar = false, - draw = { - columns = { - { "kind_icon" }, - { "label", "label_description", gap = 1 }, - { "kind" }, - { "source_name" }, - }, - }, - }, - documentation = { - window = { - border = nil, - scrollbar = false, - winhighlight = "Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,EndOfBuffer:BlinkCmpDoc", - }, - auto_show = true, - auto_show_delay_ms = 500, - }, - }, - }) - - require("luasnip.loaders.from_vscode").lazy_load() - end, }, } diff --git a/_saved/vim/lazyvim/lua/plugins/disabled.lua b/config/common/nvim/lua/plugins/disabled.lua similarity index 100% rename from _saved/vim/lazyvim/lua/plugins/disabled.lua rename to config/common/nvim/lua/plugins/disabled.lua diff --git a/_saved/vim/lazyvim/lua/plugins/lsp.lua b/config/common/nvim/lua/plugins/lsp.lua similarity index 100% rename from _saved/vim/lazyvim/lua/plugins/lsp.lua rename to config/common/nvim/lua/plugins/lsp.lua diff --git a/config/common/nvim/lua/plugins/lualine.lua b/config/common/nvim/lua/plugins/lualine.lua index 3dcbf09..e092d9c 100644 --- a/config/common/nvim/lua/plugins/lualine.lua +++ b/config/common/nvim/lua/plugins/lualine.lua @@ -1,60 +1,55 @@ return { "nvim-lualine/lualine.nvim", - dependencies = { - "nvim-tree/nvim-web-devicons", + opts = { + options = { + theme = "monokai-pro", + section_separators = "", + component_separators = "", + globalstatus = false, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch" }, + lualine_c = { + { + "diff", + symbols = { + added = " ", + modified = " ", + removed = " ", + }, + }, + { + "diagnostics", + symbols = { + error = " ", + warn = " ", + info = " ", + hint = " ", + }, + }, + { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, + { "filename", file_status = true, path = 1 }, + }, + lualine_x = { + { + "lsp_status", + symbols = { + spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }, + done = "✓", + separator = " ", + }, + }, + }, + lualine_y = { + { "searchcount" }, + { "progress", separator = " ", padding = { left = 1, right = 0 } }, + { "location", padding = { left = 0, right = 1 } }, + }, + lualine_z = {}, + }, + tabline = { + lualine_a = { "buffers" }, + }, }, - config = function() - require("lualine").setup({ - options = { - theme = "monokai-pro", - section_separators = "", - component_separators = "", - globalstatus = false, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch" }, - lualine_c = { - { - "diff", - symbols = { - added = " ", - modified = " ", - removed = " ", - }, - }, - { - "diagnostics", - symbols = { - error = " ", - warn = " ", - info = " ", - hint = " ", - }, - }, - { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, - { "filename", file_status = true, path = 1 }, - }, - lualine_x = { - { - "lsp_status", - symbols = { - spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }, - done = "✓", - separator = " ", - }, - }, - }, - lualine_y = { - { "searchcount" }, - { "progress", separator = " ", padding = { left = 1, right = 0 } }, - { "location", padding = { left = 0, right = 1 } }, - }, - lualine_z = {}, - }, - tabline = { - lualine_a = { "buffers" }, - }, - }) - end, } diff --git a/config/common/nvim/lua/plugins/monokai.lua b/config/common/nvim/lua/plugins/monokai.lua index 03c45eb..bd1de20 100644 --- a/config/common/nvim/lua/plugins/monokai.lua +++ b/config/common/nvim/lua/plugins/monokai.lua @@ -1,10 +1,15 @@ return { - "loctvl842/monokai-pro.nvim", - priority = 10000, - config = function() - require("monokai-pro").setup({ + { + "loctvl842/monokai-pro.nvim", + priority = 1000, + opts = { filter = "classic", - }) - vim.cmd.colorscheme("monokai-pro") - end, + }, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "monokai-pro", + }, + }, } diff --git a/config/common/nvim/lua/plugins/treesitter.lua b/config/common/nvim/lua/plugins/treesitter.lua index 394fa1f..4acf30c 100644 --- a/config/common/nvim/lua/plugins/treesitter.lua +++ b/config/common/nvim/lua/plugins/treesitter.lua @@ -1,25 +1,19 @@ return { "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = { - "bash", - "diff", - "gotmpl", - "hcl", - "helm", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "regex", - "terraform", - "vim", - }, - highlight = { enable = true }, - indent = { enable = true }, - }) - end, + opts = { + ensure_installed = { + "bash", + "diff", + "gotmpl", + "helm", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "regex", + "terraform", + "vim", + }, + }, } diff --git a/config/common/nvim/lua/plugins/which-key.lua b/config/common/nvim/lua/plugins/which-key.lua index c9f05f8..43422dd 100644 --- a/config/common/nvim/lua/plugins/which-key.lua +++ b/config/common/nvim/lua/plugins/which-key.lua @@ -1,36 +1,39 @@ return { "folke/which-key.nvim", event = "VeryLazy", - config = function() - require("which-key").setup({ - preset = "helix", - delay = 300, - icons = { - rules = false, - breadcrumb = " ", - separator = "󱦰 ", - group = "󰹍 ", - }, - plugins = { - spelling = { - enabled = false, - }, - }, - win = { - height = { - max = math.huge, - }, - }, - spec = { + opts_extend = { "spec" }, + opts = { + preset = "helix", + icons = { + mappings = false, + }, + defaults = {}, + spec = { + { + mode = { "n", "v" }, { - mode = { "n", "v" }, - { "b", group = "buffer" }, - { "c", group = "code" }, - { "f", group = "find" }, - { "h", group = "history" }, - { "u", group = "ui" }, + "b", + group = "buffer", + expand = function() + return require("which-key.extras").expand.buf() + end, }, + { "b", group = "buffer" }, + { "c", group = "code" }, + { "f", group = "find" }, + { "h", group = "history" }, + { "u", group = "ui" }, + { "", group = "tabs", hidden = true }, + { "d", group = "debug", hidden = true }, + { "dp", group = "profiler", hidden = true }, + { "gh", group = "hunks", hidden = true }, + { "q", group = "quit/session", hidden = true }, + { "s", group = "search", hidden = true }, + { "t", hidden = true }, + { "w", hidden = true }, + { "x", group = "diagnostics/quickfix", hidden = true }, + { "gx", desc = "Open with system app", hidden = true }, }, - }) - end, + }, + }, }