diff --git a/_saved/vim/ftpd/init.lua b/_saved/vim/ftpd/init.lua deleted file mode 100644 index f6daed1..0000000 --- a/_saved/vim/ftpd/init.lua +++ /dev/null @@ -1,2 +0,0 @@ -require("config") -require("core") diff --git a/_saved/vim/ftpd/lua/config/autocmds.lua b/_saved/vim/ftpd/lua/config/autocmds.lua deleted file mode 100644 index 824f84b..0000000 --- a/_saved/vim/ftpd/lua/config/autocmds.lua +++ /dev/null @@ -1,100 +0,0 @@ --- 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/_saved/vim/ftpd/lua/plugins/blink.lua b/_saved/vim/ftpd/lua/plugins/blink.lua deleted file mode 100644 index 73cc489..0000000 --- a/_saved/vim/ftpd/lua/plugins/blink.lua +++ /dev/null @@ -1,61 +0,0 @@ -return { - { - "saghen/blink.cmp", - dependencies = { - "rafamadriz/friendly-snippets", - "L3MON4D3/LuaSnip", - }, - event = "InsertEnter", - 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 = { - 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/ftpd/lua/plugins/linters.lua b/_saved/vim/ftpd/lua/plugins/linters.lua deleted file mode 100644 index ce53db1..0000000 --- a/_saved/vim/ftpd/lua/plugins/linters.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - "stevearc/conform.nvim", - opts = {}, - config = function() - require("conform").setup({ - formatters_by_ft = { - lua = { "stylua" }, - terraform = { "terraform_fmt" }, - tf = { "terraform_fmt" }, - ["terraform-vars"] = { "terraform_fmt" }, - }, - format_on_save = { - lsp_fallback = true, - async = false, - }, - }) - end, -} diff --git a/_saved/vim/ftpd/lua/plugins/lualine.lua b/_saved/vim/ftpd/lua/plugins/lualine.lua deleted file mode 100644 index 9893b4b..0000000 --- a/_saved/vim/ftpd/lua/plugins/lualine.lua +++ /dev/null @@ -1,61 +0,0 @@ -return { - "nvim-lualine/lualine.nvim", - dependencies = { - "nvim-tree/nvim-web-devicons", - }, - event = "VeryLazy", - config = function() - require("lualine").setup({ - options = { - theme = "powerline", - 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/_saved/vim/ftpd/lua/plugins/mason.lua b/_saved/vim/ftpd/lua/plugins/mason.lua deleted file mode 100644 index c7d4259..0000000 --- a/_saved/vim/ftpd/lua/plugins/mason.lua +++ /dev/null @@ -1,45 +0,0 @@ -return { - { - "williamboman/mason.nvim", - lazy = false, - cmd = "Mason", - keys = { { "cm", "Mason", desc = "Mason" } }, - build = ":MasonUpdate", - opts = { - ensure_installed = { - "lua-language-server", - "terraform-ls", - "stylua", - }, - }, - config = function(_, opts) - require("mason").setup(opts) - local mr = require("mason-registry") - local function ensure_installed() - for _, tool in ipairs(opts.ensure_installed) do - if mr.has_package(tool) then - local p = mr.get_package(tool) - if not p:is_installed() then - vim.notify("Mason: Installing " .. tool .. "...", vim.log.levels.INFO) - p:install():once("closed", function() - if p:is_installed() then - vim.notify("Mason: Successfully installed " .. tool, vim.log.levels.INFO) - else - vim.notify("Mason: Failed to install " .. tool, vim.log.levels.ERROR) - end - end) - end - else - vim.notify("Mason: Package '" .. tool .. "' not found", vim.log.levels.WARN) - end - end - end - - if mr.refresh then - mr.refresh(ensure_installed) - else - ensure_installed() - end - end, - }, -} diff --git a/_saved/vim/ftpd/lua/plugins/monokai.lua b/_saved/vim/ftpd/lua/plugins/monokai.lua deleted file mode 100644 index 14c2287..0000000 --- a/_saved/vim/ftpd/lua/plugins/monokai.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - "loctvl842/monokai-pro.nvim", - priority = 10000, - lazy = false, - config = function() - require("monokai-pro").setup({ - filter = "classic", - }) - vim.cmd.colorscheme("monokai-pro") - end, -} diff --git a/_saved/vim/ftpd/lua/plugins/noice.lua b/_saved/vim/ftpd/lua/plugins/noice.lua deleted file mode 100644 index e4a65b5..0000000 --- a/_saved/vim/ftpd/lua/plugins/noice.lua +++ /dev/null @@ -1,27 +0,0 @@ -return { - "folke/noice.nvim", - event = "VeryLazy", - dependencies = { - "MunifTanjim/nui.nvim", - }, - config = function() - require("noice").setup({ - lsp = { - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, - }, - }, - messages = { - view_search = false, - }, - presets = { - bottom_search = true, - command_palette = true, - long_message_to_split = true, - lsp_doc_border = true, - }, - }) - end, -} diff --git a/_saved/vim/ftpd/lua/plugins/treesitter.lua b/_saved/vim/ftpd/lua/plugins/treesitter.lua deleted file mode 100644 index 5034419..0000000 --- a/_saved/vim/ftpd/lua/plugins/treesitter.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - event = "VeryLazy", - 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 deleted file mode 100644 index c9f05f8..0000000 --- a/_saved/vim/ftpd/lua/plugins/which-key.lua +++ /dev/null @@ -1,36 +0,0 @@ -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/config/common/nvim/.gitignore b/_saved/vim/lazyvim/.gitignore similarity index 100% rename from config/common/nvim/.gitignore rename to _saved/vim/lazyvim/.gitignore diff --git a/config/common/nvim/.neoconf.json b/_saved/vim/lazyvim/.neoconf.json similarity index 100% rename from config/common/nvim/.neoconf.json rename to _saved/vim/lazyvim/.neoconf.json diff --git a/config/common/nvim/LICENSE b/_saved/vim/lazyvim/LICENSE similarity index 100% rename from config/common/nvim/LICENSE rename to _saved/vim/lazyvim/LICENSE diff --git a/config/common/nvim/README.md b/_saved/vim/lazyvim/README.md similarity index 100% rename from config/common/nvim/README.md rename to _saved/vim/lazyvim/README.md diff --git a/_saved/vim/lazyvim/init.lua b/_saved/vim/lazyvim/init.lua new file mode 100644 index 0000000..2514f9e --- /dev/null +++ b/_saved/vim/lazyvim/init.lua @@ -0,0 +1,2 @@ +-- bootstrap lazy.nvim, LazyVim and your plugins +require("config.lazy") diff --git a/_saved/vim/lazyvim/linters/global.markdownlint-cli2.yaml b/_saved/vim/lazyvim/linters/global.markdownlint-cli2.yaml new file mode 100644 index 0000000..ca8c544 --- /dev/null +++ b/_saved/vim/lazyvim/linters/global.markdownlint-cli2.yaml @@ -0,0 +1,3 @@ +config: + MD004: false + MD013: false diff --git a/_saved/vim/lazyvim/lua/config/autocmds.lua b/_saved/vim/lazyvim/lua/config/autocmds.lua new file mode 100644 index 0000000..7a10f17 --- /dev/null +++ b/_saved/vim/lazyvim/lua/config/autocmds.lua @@ -0,0 +1,37 @@ +-- 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.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, +}) diff --git a/_saved/vim/ftpd/lua/config/keymaps.lua b/_saved/vim/lazyvim/lua/config/keymaps.lua similarity index 52% rename from _saved/vim/ftpd/lua/config/keymaps.lua rename to _saved/vim/lazyvim/lua/config/keymaps.lua index 4b6a090..96eee15 100644 --- a/_saved/vim/ftpd/lua/config/keymaps.lua +++ b/_saved/vim/lazyvim/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/config/common/nvim/lua/config/lazy.lua b/_saved/vim/lazyvim/lua/config/lazy.lua similarity index 100% rename from config/common/nvim/lua/config/lazy.lua rename to _saved/vim/lazyvim/lua/config/lazy.lua diff --git a/config/common/nvim/lua/config/options.lua b/_saved/vim/lazyvim/lua/config/options.lua similarity index 100% rename from config/common/nvim/lua/config/options.lua rename to _saved/vim/lazyvim/lua/config/options.lua diff --git a/_saved/vim/lazyvim/lua/plugins/blink.lua b/_saved/vim/lazyvim/lua/plugins/blink.lua new file mode 100644 index 0000000..9d68c38 --- /dev/null +++ b/_saved/vim/lazyvim/lua/plugins/blink.lua @@ -0,0 +1,12 @@ +return { + "saghen/blink.cmp", + opts = { + keymap = { + preset = "none", + [""] = { "accept", "fallback" }, + }, + cmdline = { + enabled = false, + }, + }, +} diff --git a/config/common/nvim/lua/plugins/conform.lua b/_saved/vim/lazyvim/lua/plugins/conform.lua similarity index 100% rename from config/common/nvim/lua/plugins/conform.lua rename to _saved/vim/lazyvim/lua/plugins/conform.lua diff --git a/config/common/nvim/lua/plugins/disabled.lua b/_saved/vim/lazyvim/lua/plugins/disabled.lua similarity index 100% rename from config/common/nvim/lua/plugins/disabled.lua rename to _saved/vim/lazyvim/lua/plugins/disabled.lua diff --git a/config/common/nvim/lua/plugins/linter.lua b/_saved/vim/lazyvim/lua/plugins/linter.lua similarity index 100% rename from config/common/nvim/lua/plugins/linter.lua rename to _saved/vim/lazyvim/lua/plugins/linter.lua diff --git a/config/common/nvim/lua/plugins/lsp.lua b/_saved/vim/lazyvim/lua/plugins/lsp.lua similarity index 100% rename from config/common/nvim/lua/plugins/lsp.lua rename to _saved/vim/lazyvim/lua/plugins/lsp.lua diff --git a/_saved/vim/lazyvim/lua/plugins/lualine.lua b/_saved/vim/lazyvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..a1ec1fa --- /dev/null +++ b/_saved/vim/lazyvim/lua/plugins/lualine.lua @@ -0,0 +1,57 @@ +return { + "nvim-lualine/lualine.nvim", + opts = { + options = { + theme = "powerline", + section_separators = "", + component_separators = "", + globalstatus = false, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { + { "branch" }, + { + "diff", + symbols = { + added = " ", + modified = " ", + removed = " ", + }, + }, + { + "diagnostics", + symbols = { + error = " ", + warn = " ", + info = " ", + hint = " ", + }, + }, + }, + lualine_c = { + { "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" }, + }, + }, +} diff --git a/_saved/vim/lazyvim/lua/plugins/monokai.lua b/_saved/vim/lazyvim/lua/plugins/monokai.lua new file mode 100644 index 0000000..bd1de20 --- /dev/null +++ b/_saved/vim/lazyvim/lua/plugins/monokai.lua @@ -0,0 +1,15 @@ +return { + { + "loctvl842/monokai-pro.nvim", + priority = 1000, + opts = { + filter = "classic", + }, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "monokai-pro", + }, + }, +} diff --git a/_saved/vim/lazyvim/lua/plugins/noice.lua b/_saved/vim/lazyvim/lua/plugins/noice.lua new file mode 100644 index 0000000..84ac2de --- /dev/null +++ b/_saved/vim/lazyvim/lua/plugins/noice.lua @@ -0,0 +1,8 @@ +return { + "folke/noice.nvim", + opts = { + messages = { + view_search = false, + }, + }, +} diff --git a/_saved/vim/ftpd/lua/plugins/snacks.lua b/_saved/vim/lazyvim/lua/plugins/snacks.lua similarity index 100% rename from _saved/vim/ftpd/lua/plugins/snacks.lua rename to _saved/vim/lazyvim/lua/plugins/snacks.lua diff --git a/_saved/vim/lazyvim/lua/plugins/treesitter.lua b/_saved/vim/lazyvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..4acf30c --- /dev/null +++ b/_saved/vim/lazyvim/lua/plugins/treesitter.lua @@ -0,0 +1,19 @@ +return { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "diff", + "gotmpl", + "helm", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "regex", + "terraform", + "vim", + }, + }, +} diff --git a/_saved/vim/lazyvim/lua/plugins/which-key.lua b/_saved/vim/lazyvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..43422dd --- /dev/null +++ b/_saved/vim/lazyvim/lua/plugins/which-key.lua @@ -0,0 +1,39 @@ +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, + }, + { "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 }, + }, + }, + }, +} diff --git a/_saved/vim/ftpd/stylua.toml b/_saved/vim/lazyvim/stylua.toml similarity index 100% rename from _saved/vim/ftpd/stylua.toml rename to _saved/vim/lazyvim/stylua.toml diff --git a/config/common/nvim/init.lua b/config/common/nvim/init.lua index 2514f9e..f6daed1 100644 --- a/config/common/nvim/init.lua +++ b/config/common/nvim/init.lua @@ -1,2 +1,2 @@ --- bootstrap lazy.nvim, LazyVim and your plugins -require("config.lazy") +require("config") +require("core") diff --git a/_saved/vim/ftpd/lsp/lua.lua b/config/common/nvim/lsp/lua.lua similarity index 100% rename from _saved/vim/ftpd/lsp/lua.lua rename to config/common/nvim/lsp/lua.lua diff --git a/config/common/nvim/lsp/markdown.lua b/config/common/nvim/lsp/markdown.lua new file mode 100644 index 0000000..99c7512 --- /dev/null +++ b/config/common/nvim/lsp/markdown.lua @@ -0,0 +1,4 @@ +return { + cmd = { "marksman", "server" }, + filetypes = { "markdown" }, +} diff --git a/_saved/vim/ftpd/lsp/terraform.lua b/config/common/nvim/lsp/terraform.lua similarity index 100% rename from _saved/vim/ftpd/lsp/terraform.lua rename to config/common/nvim/lsp/terraform.lua diff --git a/config/common/nvim/lua/config/autocmds.lua b/config/common/nvim/lua/config/autocmds.lua index 7a10f17..159ce3d 100644 --- a/config/common/nvim/lua/config/autocmds.lua +++ b/config/common/nvim/lua/config/autocmds.lua @@ -9,6 +9,7 @@ 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, }) @@ -35,3 +36,65 @@ 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/_saved/vim/ftpd/lua/config/init.lua b/config/common/nvim/lua/config/init.lua similarity index 100% rename from _saved/vim/ftpd/lua/config/init.lua rename to config/common/nvim/lua/config/init.lua diff --git a/config/common/nvim/lua/config/keymaps.lua b/config/common/nvim/lua/config/keymaps.lua index 96eee15..f51d002 100644 --- a/config/common/nvim/lua/config/keymaps.lua +++ b/config/common/nvim/lua/config/keymaps.lua @@ -1,62 +1,44 @@ --- 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 +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" 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", "`") +local diagnostic_goto = function(next, severity) + local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev + severity = severity and vim.diagnostic.severity[severity] or nil + return function() + go({ severity = severity }) + end +end -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", "n", "s" }, "", function() + vim.cmd("noh") + return "" +end, { expr = true, desc = "Escape and Clear hlsearch" }) 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", "]d", diagnostic_goto(true), { desc = "Next Diagnostic" }) +map("n", "[d", diagnostic_goto(false), { desc = "Prev Diagnostic" }) +map("n", "]e", diagnostic_goto(true, "ERROR"), { desc = "Next Error" }) +map("n", "[e", diagnostic_goto(false, "ERROR"), { desc = "Prev Error" }) +map("n", "]w", diagnostic_goto(true, "WARN"), { desc = "Next Warning" }) +map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" }) + +map("v", "/", "gc", { desc = "toggle comments", 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", "-", "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 }) @@ -68,9 +50,17 @@ map("n", "bl", function() end, { desc = "buffer list", remap = true }) map("n", "bn", "enew", { desc = "buffer create", remap = true }) +map("n", "cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" }) +map({ "n", "v" }, "cf", function() + require("conform").format({ + lsp_fallback = true, + async = false, + }) +end, { desc = "format", 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() @@ -88,6 +78,12 @@ 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")') @@ -96,15 +92,10 @@ 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 }) - -map("n", "s", "set hlsearch!", { desc = "Toggle hlsearch", remap = true }) +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 }) - -map("v", "/", "gc", { desc = "Toggle Comments", remap = true }) diff --git a/_saved/vim/ftpd/lua/config/settings.lua b/config/common/nvim/lua/config/settings.lua similarity index 100% rename from _saved/vim/ftpd/lua/config/settings.lua rename to config/common/nvim/lua/config/settings.lua diff --git a/_saved/vim/ftpd/lua/core/init.lua b/config/common/nvim/lua/core/init.lua similarity index 100% rename from _saved/vim/ftpd/lua/core/init.lua rename to config/common/nvim/lua/core/init.lua diff --git a/_saved/vim/ftpd/lua/core/lazy.lua b/config/common/nvim/lua/core/lazy.lua similarity index 100% rename from _saved/vim/ftpd/lua/core/lazy.lua rename to config/common/nvim/lua/core/lazy.lua diff --git a/_saved/vim/ftpd/lua/core/lsp.lua b/config/common/nvim/lua/core/lsp.lua similarity index 99% rename from _saved/vim/ftpd/lua/core/lsp.lua rename to config/common/nvim/lua/core/lsp.lua index ed3e623..716b3da 100644 --- a/_saved/vim/ftpd/lua/core/lsp.lua +++ b/config/common/nvim/lua/core/lsp.lua @@ -1,11 +1,12 @@ vim.lsp.enable({ "lua", "terraform", + "markdown", }) vim.diagnostic.config({ - virtual_lines = true, - -- virtual_text = true, + -- virtual_lines = true, + virtual_text = true, underline = false, update_in_insert = false, severity_sort = true, diff --git a/_saved/vim/ftpd/lua/core/mason-path.lua b/config/common/nvim/lua/core/mason-path.lua similarity index 100% rename from _saved/vim/ftpd/lua/core/mason-path.lua rename to config/common/nvim/lua/core/mason-path.lua diff --git a/config/common/nvim/lua/plugins/blink.lua b/config/common/nvim/lua/plugins/blink.lua index 9d68c38..73cc489 100644 --- a/config/common/nvim/lua/plugins/blink.lua +++ b/config/common/nvim/lua/plugins/blink.lua @@ -1,12 +1,61 @@ return { - "saghen/blink.cmp", - opts = { - keymap = { - preset = "none", - [""] = { "accept", "fallback" }, - }, - cmdline = { - enabled = false, + { + "saghen/blink.cmp", + dependencies = { + "rafamadriz/friendly-snippets", + "L3MON4D3/LuaSnip", }, + event = "InsertEnter", + 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 = { + 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/ftpd/lua/plugins/gitsigns.lua b/config/common/nvim/lua/plugins/gitsigns.lua similarity index 100% rename from _saved/vim/ftpd/lua/plugins/gitsigns.lua rename to config/common/nvim/lua/plugins/gitsigns.lua diff --git a/config/common/nvim/lua/plugins/linters.lua b/config/common/nvim/lua/plugins/linters.lua new file mode 100644 index 0000000..97636d9 --- /dev/null +++ b/config/common/nvim/lua/plugins/linters.lua @@ -0,0 +1,95 @@ +return { + { + "williamboman/mason.nvim", + cmd = "Mason", + keys = { { "cm", "Mason", desc = "Mason" } }, + build = ":MasonUpdate", + opts = { + ensure_installed = { + "lua-language-server", + "markdown-toc", + "markdownlint-cli2", + "marksman", + "shfmt", + "stylua", + "terraform-ls", + "tflint", + }, + }, + config = function(_, opts) + require("mason").setup(opts) + local mr = require("mason-registry") + local function ensure_installed() + for _, tool in ipairs(opts.ensure_installed) do + if mr.has_package(tool) then + local p = mr.get_package(tool) + if not p:is_installed() then + vim.notify("Mason: Installing " .. tool .. "...", vim.log.levels.INFO) + p:install():once("closed", function() + if p:is_installed() then + vim.notify("Mason: Successfully installed " .. tool, vim.log.levels.INFO) + else + vim.notify("Mason: Failed to install " .. tool, vim.log.levels.ERROR) + end + end) + end + else + vim.notify("Mason: Package '" .. tool .. "' not found", vim.log.levels.WARN) + end + end + end + + if mr.refresh then + mr.refresh(ensure_installed) + else + ensure_installed() + end + end, + }, + { + "mfussenegger/nvim-lint", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("lint").linters_by_ft = { + markdown = { "markdownlint-cli2" }, + terraform = { "terraform_validate" }, + tf = { "terraform_validate" }, + } + + local markdownlint = require("lint").linters["markdownlint-cli2"] + markdownlint.args = { + "--config", + "/Users/f/.config/nvim-ftpd/linters/global.markdownlint-cli2.yaml", + } + + vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { + callback = function() + require("lint").try_lint() + end, + }) + end, + }, + { + "stevearc/conform.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { "mason.nvim" }, + config = function() + require("conform").setup({ + formatters_by_ft = { + ["terraform-vars"] = { "terraform_fmt" }, + bash = { "shfmt" }, + lua = { "stylua" }, + markdown = { "markdownlint-cli2" }, + sh = { "shfmt" }, + terraform = { "terraform_fmt" }, + tf = { "terraform_fmt" }, + zsh = { "shfmt" }, + }, + -- format_on_save = { + -- lsp_fallback = true, + -- async = false, + -- }, + }) + end, + }, +} diff --git a/config/common/nvim/lua/plugins/lualine.lua b/config/common/nvim/lua/plugins/lualine.lua index a1ec1fa..c1082a5 100644 --- a/config/common/nvim/lua/plugins/lualine.lua +++ b/config/common/nvim/lua/plugins/lualine.lua @@ -1,57 +1,60 @@ return { "nvim-lualine/lualine.nvim", - opts = { - options = { - theme = "powerline", - section_separators = "", - component_separators = "", - globalstatus = false, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { - { "branch" }, - { - "diff", - symbols = { - added = " ", - modified = " ", - removed = " ", + event = "VeryLazy", + config = function() + require("lualine").setup({ + options = { + theme = "powerline", + section_separators = "", + component_separators = "", + globalstatus = false, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { + { "branch" }, + { + "diff", + symbols = { + added = " ", + modified = " ", + removed = " ", + }, + }, + { + "diagnostics", + symbols = { + error = " ", + warn = " ", + info = " ", + hint = " ", + }, }, }, - { - "diagnostics", - symbols = { - error = " ", - warn = " ", - info = " ", - hint = " ", + lualine_c = { + { "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_c = { - { "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 = {}, }, - lualine_y = { - { "searchcount" }, - { "progress", separator = " ", padding = { left = 1, right = 0 } }, - { "location", padding = { left = 0, right = 1 } }, + tabline = { + lualine_a = { "buffers" }, }, - lualine_z = {}, - }, - tabline = { - lualine_a = { "buffers" }, - }, - }, + }) + end, } diff --git a/config/common/nvim/lua/plugins/markdown.lua b/config/common/nvim/lua/plugins/markdown.lua new file mode 100644 index 0000000..b1f7a0b --- /dev/null +++ b/config/common/nvim/lua/plugins/markdown.lua @@ -0,0 +1,20 @@ +return { + "MeanderingProgrammer/render-markdown.nvim", + ft = { "markdown", "norg", "rmd", "org", "codecompanion" }, + config = function() + require("render-markdown").setup({ + code = { + sign = false, + width = "block", + right_pad = 1, + }, + heading = { + sign = false, + icons = {}, + }, + checkbox = { + enabled = false, + }, + }) + end, +} diff --git a/_saved/vim/ftpd/lua/plugins/mini.lua b/config/common/nvim/lua/plugins/mini.lua similarity index 100% rename from _saved/vim/ftpd/lua/plugins/mini.lua rename to config/common/nvim/lua/plugins/mini.lua diff --git a/config/common/nvim/lua/plugins/monokai.lua b/config/common/nvim/lua/plugins/monokai.lua index bd1de20..6d2b649 100644 --- a/config/common/nvim/lua/plugins/monokai.lua +++ b/config/common/nvim/lua/plugins/monokai.lua @@ -1,15 +1,14 @@ return { - { - "loctvl842/monokai-pro.nvim", - priority = 1000, - opts = { + "loctvl842/monokai-pro.nvim", + priority = 10000, + lazy = false, + dependencies = { + "echasnovski/mini.icons", + }, + config = function() + require("monokai-pro").setup({ filter = "classic", - }, - }, - { - "LazyVim/LazyVim", - opts = { - colorscheme = "monokai-pro", - }, - }, + }) + vim.cmd.colorscheme("monokai-pro") + end, } diff --git a/config/common/nvim/lua/plugins/noice.lua b/config/common/nvim/lua/plugins/noice.lua index 84ac2de..e4a65b5 100644 --- a/config/common/nvim/lua/plugins/noice.lua +++ b/config/common/nvim/lua/plugins/noice.lua @@ -1,8 +1,27 @@ return { "folke/noice.nvim", - opts = { - messages = { - view_search = false, - }, + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", }, + config = function() + require("noice").setup({ + lsp = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + messages = { + view_search = false, + }, + presets = { + bottom_search = true, + command_palette = true, + long_message_to_split = true, + lsp_doc_border = true, + }, + }) + end, } diff --git a/config/common/nvim/lua/plugins/treesitter.lua b/config/common/nvim/lua/plugins/treesitter.lua index 4acf30c..5034419 100644 --- a/config/common/nvim/lua/plugins/treesitter.lua +++ b/config/common/nvim/lua/plugins/treesitter.lua @@ -1,19 +1,26 @@ return { "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "bash", - "diff", - "gotmpl", - "helm", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "regex", - "terraform", - "vim", - }, - }, + build = ":TSUpdate", + event = "VeryLazy", + 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/config/common/nvim/lua/plugins/which-key.lua b/config/common/nvim/lua/plugins/which-key.lua index 43422dd..97ac0dd 100644 --- a/config/common/nvim/lua/plugins/which-key.lua +++ b/config/common/nvim/lua/plugins/which-key.lua @@ -1,39 +1,38 @@ 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, - }, - { "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 }, + 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" }, + { "[", group = "previous..." }, + { "]", group = "next..." }, + { "b", group = "buffer" }, + { "c", group = "code" }, + { "f", group = "find" }, + { "h", group = "history" }, + { "u", group = "ui" }, + }, + }, + }) + end, }