diff --git a/nvim-old/.config/nvim/.luacheckrc b/nvim-old/.config/nvim/.luacheckrc new file mode 100644 index 0000000..f5cda50 --- /dev/null +++ b/nvim-old/.config/nvim/.luacheckrc @@ -0,0 +1,15 @@ +-- Rerun tests only if their modification time changed. +cache = true + +ignore = { + "122", -- Setting a read-only field of a global variable. + "212", -- Unused argument, In the case of callback function, _arg_name is easier to understand than _, so this option is set to off. +} + +-- Global objects defined by the C code +read_globals = { + "vim", + "Snacks", +} + +files["snippets/*.lua"] = { ignore = { "211", "631" } } diff --git a/nvim/.config/nvim/README.md b/nvim-old/.config/nvim/README.md similarity index 100% rename from nvim/.config/nvim/README.md rename to nvim-old/.config/nvim/README.md diff --git a/nvim/.config/nvim/after/ftplugin/rust.lua b/nvim-old/.config/nvim/after/ftplugin/rust.lua similarity index 100% rename from nvim/.config/nvim/after/ftplugin/rust.lua rename to nvim-old/.config/nvim/after/ftplugin/rust.lua diff --git a/nvim-old/.config/nvim/init.lua b/nvim-old/.config/nvim/init.lua new file mode 100644 index 0000000..ca2162a --- /dev/null +++ b/nvim-old/.config/nvim/init.lua @@ -0,0 +1,2 @@ +require("ink") +require("config.lazy") diff --git a/nvim-old/.config/nvim/lsp/bashls.lua b/nvim-old/.config/nvim/lsp/bashls.lua new file mode 100644 index 0000000..a38d1b4 --- /dev/null +++ b/nvim-old/.config/nvim/lsp/bashls.lua @@ -0,0 +1,5 @@ +return { + cmd = { "bash-language-server" }, + filetypes = { "sh", "bash", "zsh" }, + settings = {}, +} diff --git a/nvim-old/.config/nvim/lsp/gopls.lua b/nvim-old/.config/nvim/lsp/gopls.lua new file mode 100644 index 0000000..8af03df --- /dev/null +++ b/nvim-old/.config/nvim/lsp/gopls.lua @@ -0,0 +1,27 @@ +return { + cmd = { "gopls" }, + root_markers = { "go.mod" }, + filetypes = { "go", "golang" }, + settings = { + gopls = { + completeUnimported = true, + usePlaceholders = true, + ["completion.matcher"] = "fuzzy", + ["completion.completeFunctionCalls"] = true, + analyses = { + unusedparams = true, + staticcheck = true, + unusedwrite = true, + shadow = true, + }, + ["ui.inlayhint.hints"] = { + compositeLiteralFields = true, + constantValues = true, + parameterNames = true, + assignVariableTypes = true, + functionTypeParameters = true, + rangeVariableTypes = true, + }, + }, + }, +} diff --git a/nvim-old/.config/nvim/lsp/luals.lua b/nvim-old/.config/nvim/lsp/luals.lua new file mode 100644 index 0000000..84fe9ee --- /dev/null +++ b/nvim-old/.config/nvim/lsp/luals.lua @@ -0,0 +1,17 @@ +return { + cmd = { "lua-language-server" }, + root_markers = { ".luarc.json", ".luarc.jsonc" }, + filetypes = { "lua" }, + settings = { + Lua = { + completion = { callSnippet = "Both" }, + hint = { enable = true }, + workspace = { + library = { + vim.env.VIMRUNTIME, + }, + }, + runtime = { version = "LuaJIT" }, + }, + }, +} diff --git a/nvim-old/.config/nvim/lsp/rust.lua b/nvim-old/.config/nvim/lsp/rust.lua new file mode 100644 index 0000000..1b39767 --- /dev/null +++ b/nvim-old/.config/nvim/lsp/rust.lua @@ -0,0 +1,31 @@ +return { + cmd = { "rust-analyzer" }, + root_markers = { "Cargo.toml" }, + filetypes = { "rust" }, + settings = { + ["rust-analyzer"] = { + cargo = { + allFeatures = true, + loadOutDirsFromCheck = true, + runBuildScripts = true, + }, + checkOnSave = true, + completion = { + autoself = { enable = true }, + snippets = { enable = true }, + }, + diagnostics = { + enable = true, + experimental = { enable = true }, + }, + procMacro = { + enable = true, + ignored = { + ["async-trait"] = { "async_trait" }, + ["napi-derive"] = { "napi" }, + ["async-recursion"] = { "async_recursion" }, + }, + }, + }, + }, +} diff --git a/nvim-old/.config/nvim/lsp/terraform.lua b/nvim-old/.config/nvim/lsp/terraform.lua new file mode 100644 index 0000000..21ccf7d --- /dev/null +++ b/nvim-old/.config/nvim/lsp/terraform.lua @@ -0,0 +1,6 @@ +return { + cmd = { "terraform-ls", "serve" }, + root_markers = { ".terraform.lock", "backend.tf" }, + filetypes = { "terraform", "tf" }, + settings = {}, +} diff --git a/nvim/.config/nvim/lua/config/lazy.lua b/nvim-old/.config/nvim/lua/config/lazy.lua similarity index 100% rename from nvim/.config/nvim/lua/config/lazy.lua rename to nvim-old/.config/nvim/lua/config/lazy.lua diff --git a/nvim-old/.config/nvim/lua/ink/init.lua b/nvim-old/.config/nvim/lua/ink/init.lua new file mode 100644 index 0000000..9228f3a --- /dev/null +++ b/nvim-old/.config/nvim/lua/ink/init.lua @@ -0,0 +1,144 @@ +require("ink.remap") +require("ink.lsp") +require("ink.tabline") + +vim.opt.hlsearch = false -- do not highlight matches +vim.wo.number = true +vim.opt.relativenumber = true +vim.opt.mouse = "a" +vim.opt.clipboard = "unnamedplus" +vim.opt.breakindent = true -- Enable break indent +vim.opt.undofile = true -- Save undo history +vim.opt.ignorecase = true -- ignore case in searches by default +vim.opt.smartcase = true -- but make it case sensitive if an uppercase is entered +vim.w.signcolumn = "yes" -- Keep signcolumn on by default +vim.opt.updatetime = 250 -- Decrease update time +vim.opt.timeoutlen = 300 -- time to wait for a mapped sequence to complete (in milliseconds) +vim.opt.backup = false -- creates a backup file +-- if a file is being edited by another program (or was written to file while editing with another program), it is not +-- allowed to be edited +vim.opt.writebackup = false +vim.opt.autoread = true -- reload files changed outside of neovim +vim.o.completeopt = "menuone,noinsert,popup,fuzzy" +vim.opt.termguicolors = true -- set termguicolors to enable highlight groups +vim.opt.whichwrap = "bs<>[]hl" -- which "horizontal" keys are allowed to travel to prev/next line +vim.o.wrap = true -- 1. Enable line wrapping by default +vim.o.linebreak = true -- 2. Break lines at word boundaries (improves readability) +vim.o.showbreak = "↪ " -- 3. Add a visual indicator for wrapped lines +vim.opt.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor +vim.opt.sidescrolloff = 8 -- minimal number of screen columns either side of cursor if wrap is `false` +vim.opt.numberwidth = 2 -- set number column width to 2 {default 4} +vim.opt.shiftwidth = 4 -- Number of spaces inserted when indenting +vim.opt.tabstop = 4 -- A TAB character looks like 4 spaces +vim.opt.softtabstop = 4 -- Number of spaces inserted instead of a TAB character +vim.opt.expandtab = true -- Pressing the TAB key will insert spaces instead of a TAB character +vim.opt.cursorline = true +vim.opt.splitbelow = true -- open new vertical split bottom +vim.opt.splitright = true -- open new horizontal splits right +vim.opt.swapfile = false -- creates a swapfile +vim.opt.smartindent = true -- make indenting smarter again +vim.opt.showtabline = 2 -- always show tabs +vim.opt.backspace = "indent,eol,start" -- allow backspace on +vim.opt.pumheight = 10 -- pop up menu height +vim.wo.conceallevel = 0 -- so that `` is visible in markdown files +vim.opt.encoding = "utf-8" -- the encoding written to a file +vim.opt.cmdheight = 1 -- more space in the neovim command line for displaying messages +vim.opt.autoindent = true + +vim.opt.shortmess:append("c") -- don't give |ins-completion-menu| messages +vim.opt.iskeyword:append("-") -- hyphenated words recognized by searches +-- don't insert the current comment leader automatically for auto-wrapping comments using 'textwidth', hitting +-- in insert mode, or hitting 'o' or 'O' in normal mode. +vim.opt.formatoptions:remove({ "c", "r", "o" }) +vim.opt.runtimepath:remove("/usr/share/vim/vimfiles") -- separate vim plugins from neovim in case vim still in use + +-- Nice and simple folding: +vim.opt.foldenable = true +vim.opt.foldlevel = 99 +vim.opt.foldmethod = "expr" +-- Default to treesitter folding +vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()" +-- vim.opt.foldtext = "> " +vim.opt.fillchars:append({ fold = ">" }) + +vim.opt.incsearch = true -- search as characters are entered + +-- Auto-reload buffers when files change on disk (e.g. from external tools or AI agents) +vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold" }, { + callback = function() + if vim.fn.getcmdwintype() == "" then + vim.cmd("checktime") + end + end, +}) + +-- remove trailing whitespace (keeppatterns avoids adding to search history) +vim.api.nvim_create_autocmd({ "BufWritePre" }, { + pattern = { "*" }, + callback = function() + local save_cursor = vim.fn.getpos(".") + pcall(function() + vim.cmd([[keeppatterns %s/\s\+$//e]]) + end) + vim.fn.setpos(".", save_cursor) + end, +}) +-- +-- Set a keymap to toggle the 'wrap' option +vim.keymap.set("n", "w", function() + vim.opt.wrap:toggle() +end, { desc = "Toggle line wrapping" }) + +local uv = vim.uv + +vim.api.nvim_create_autocmd({ "VimEnter", "VimLeave" }, { + callback = function() + if vim.env.TMUX_PLUGIN_MANAGER_PATH then + uv.spawn(vim.env.TMUX_PLUGIN_MANAGER_PATH .. "/tmux-window-name/scripts/rename_session_windows.py", {}) + end + end, +}) +-- +-- Filetypes to enable spellcheck +local spell_types = { "text", "plaintex", "typst", "gitcommit", "markdown" } + +-- add gotmpl filetypes for blueprint repos +-- *.ext.tmpl files use the filetype of ext (e.g. foo.json.tmpl -> json, bar.sh.tmpl -> bash) +vim.filetype.add({ + extension = { + gotmpl = "gotmpl", + }, + pattern = { + [".*/recipes/.*%.ya?ml"] = "gotmpl", + [".*%.tmpl$"] = function(path) + local name = vim.fn.fnamemodify(path, ":t") + local base = name:match("^(.+)%.tmpl$") + if base then + local ext = base:match("%.(%w+)$") + if ext then + if ext == "sh" then + return "bash" + end + return ext + end + end + return nil + end, + }, +}) + +-- Set global spell option to false initially to disable it for all file types +vim.opt.spell = false + +-- Create an augroup for spellcheck to group related autocommands +vim.api.nvim_create_augroup("Spellcheck", { clear = true }) + +-- Create an autocommand to enable spellcheck for specified file types +vim.api.nvim_create_autocmd({ "FileType" }, { + group = "Spellcheck", -- Grouping the command for easier management + pattern = spell_types, -- Only apply to these file types + callback = function() + vim.opt_local.spell = true -- Enable spellcheck for these file types + end, + desc = "Enable spellcheck for defined filetypes", -- Description for clarity +}) diff --git a/nvim-old/.config/nvim/lua/ink/lsp.lua b/nvim-old/.config/nvim/lua/ink/lsp.lua new file mode 100644 index 0000000..9a07f81 --- /dev/null +++ b/nvim-old/.config/nvim/lua/ink/lsp.lua @@ -0,0 +1,70 @@ +--- [[ LSP setup]] +--- + +vim.lsp.enable("luals") +vim.lsp.enable("rust") +vim.lsp.enable("gopls") +vim.lsp.enable("bashls") +vim.lsp.enable("terraform") + +vim.lsp.config("*", { + capabilities = { + textDocument = { + semanticTokens = { + multilineTokenSupport = true, + }, + }, + }, +}) + +-- [[FOLDING SETUP +-- Prefer LSP folding if client supports it +vim.api.nvim_create_autocmd("LspAttach", { + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + if client ~= nil then + if client:supports_method("textDocument/foldingRange") then + local win = vim.api.nvim_get_current_win() + vim.wo[win].foldexpr = "v:lua.vim.lsp.foldexpr()" + end + end + end, +}) +-- ]] + +-- [[INLAY HINTS +vim.api.nvim_create_autocmd("LspAttach", { + callback = function(args) + local client = assert(vim.lsp.get_client_by_id(args.data.client_id)) + if client.server_capabilities.inlayHintProvider then + vim.lsp.inlay_hint.enable(true, { bufnr = vim.fn.bufnr() }) + end + end, +}) + +-- [[CODE ACTIONS +vim.api.nvim_create_autocmd("LspAttach", { + callback = function(args) + local bufnr = args.data.bufnr + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { buffer = bufnr, desc = "Code action (menu)" }) + vim.keymap.set("v", "ca", function() + vim.lsp.buf.code_action({ context = { only = { "quickfix" } } }) + end, { buffer = bufnr, desc = "Code action (selection)" }) + -- Quickfix at cursor: apply single fix without menu when only one available + vim.keymap.set("n", "cf", function() + vim.lsp.buf.code_action({ + context = { only = { "quickfix" } }, + apply = true, + }) + end, { buffer = bufnr, desc = "Apply fix at cursor" }) + -- Organize imports (Rust: source.organizeImports.rust, Go: source.organizeImports) + vim.keymap.set("n", "ci", function() + vim.lsp.buf.code_action({ + context = { + only = { "source.organizeImports.rust", "source.organizeImports" }, + }, + apply = true, + }) + end, { buffer = bufnr, desc = "Organize imports" }) + end, +}) diff --git a/nvim-old/.config/nvim/lua/ink/remap.lua b/nvim-old/.config/nvim/lua/ink/remap.lua new file mode 100644 index 0000000..722b369 --- /dev/null +++ b/nvim-old/.config/nvim/lua/ink/remap.lua @@ -0,0 +1,63 @@ +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" +-- (mode, key, command) +vim.keymap.set({ "n", "v" }, "", "", { silent = true }) +-- vim.keymap.set("n", "pv", vim.cmd.Ex, { desc = "Open current directory" }) + +local function map(mode, lhs, rhs, opts) + local options = { noremap = true, silent = true } + if opts then + if opts.desc then + opts.desc = "keymaps.lua: " .. opts.desc + end + options = vim.tbl_extend("force", options, opts) + end + vim.keymap.set(mode, lhs, rhs, options) +end + +map("n", "sn", "noautocmd w ", { desc = "Save without formatting" }) -- save without autoformat + +map("n", "x", '"_x', { desc = "Remove character under cursor without clipboard" }) + +map("n", "n", "nzzzv", { desc = "Find next occurence of search" }) +map("n", "N", "Nzzzv", { desc = "Find previous occurence of search" }) + +map("n", "", ":bnext", { desc = "Switch to next buffer" }) +map("n", "", ":bprev", { desc = "Switch to previous buffer" }) +map("n", "x", ":bdelete!", { desc = "Close buffer" }) +map("n", "b", " enew ", { desc = "Open new buffer" }) + +map("n", "v", "v", { desc = "Split vertical" }) +map("n", "h", "s", { desc = "Split horizontal" }) +map("n", "se", "=", { desc = "Reset split sizes" }) +map("n", "xs", ":close", { desc = "Close split" }) + +map("v", "<", "", ">gv", { desc = "Indent right" }) +map("v", "p", '"_dP', { desc = "Paste without yanking underlying text" }) + +map("n", "gl", "`.", { desc = "Jump to the last change in the file" }) + +map("n", "C-d", "zz") +map("n", "C-u", "zz") +map("n", "C-f", "zz") +map("n", "C-b", "zz") + +-- map('n', '', 'za', { desc = 'Toggle cursor fold' }) +-- map('n', '', 'zm', { desc = 'Toggle all folds at cursor' }) +-- map('n', '', 'zM', { desc = 'Close all open folds' }) +-- map('n', '', 'zr', { desc = 'Open all folds' }) +-- map('n', '', 'zR', { desc = 'Open all folds' }) + +-- map("n", "", "", { desc = "Move to split upwards" }) +-- map("n", "", "", { desc = "Move to split upwards" }) +-- map("n", "", "", { desc = "Move to split left" }) +-- map("n", "", "", { desc = "Move to split right" }) + +map("n", "", "", { desc = "Move screen up one line" }) +map("n", "", "", { desc = "Move screen down one line" }) +map("v", "", "", { desc = "Move screen up one line" }) +map("v", "", "", { desc = "Move screen down one line" }) diff --git a/nvim-old/.config/nvim/lua/ink/tabline.lua b/nvim-old/.config/nvim/lua/ink/tabline.lua new file mode 100644 index 0000000..c5b450d --- /dev/null +++ b/nvim-old/.config/nvim/lua/ink/tabline.lua @@ -0,0 +1,27 @@ +--- @return string +local function tab_info() + local fname = vim.fn.expand("%:p") + if fname == "" then + return "" + end + return "%#WildMenu# " .. fname .. " %*" +end + +--- @return string +local function filestatus() + if vim.bo.modified == true then + return "%#Error# ● %*" + end + if vim.bo.readonly == true then + return "%#Error#  %*" + end + return "" +end + +function _G.TabLine() + return table.concat({ + tab_info(), + filestatus(), + }) +end +vim.opt.tabline = "%!v:lua.TabLine()" diff --git a/nvim/.config/nvim/lua/plugins/avante.lua b/nvim-old/.config/nvim/lua/plugins/avante.lua similarity index 100% rename from nvim/.config/nvim/lua/plugins/avante.lua rename to nvim-old/.config/nvim/lua/plugins/avante.lua diff --git a/nvim/.config/nvim/lua/plugins/basic.lua b/nvim-old/.config/nvim/lua/plugins/basic.lua similarity index 100% rename from nvim/.config/nvim/lua/plugins/basic.lua rename to nvim-old/.config/nvim/lua/plugins/basic.lua diff --git a/nvim/.config/nvim/lua/plugins/completion.lua b/nvim-old/.config/nvim/lua/plugins/completion.lua similarity index 100% rename from nvim/.config/nvim/lua/plugins/completion.lua rename to nvim-old/.config/nvim/lua/plugins/completion.lua diff --git a/nvim/.config/nvim/lua/plugins/file_explorer.lua b/nvim-old/.config/nvim/lua/plugins/file_explorer.lua similarity index 100% rename from nvim/.config/nvim/lua/plugins/file_explorer.lua rename to nvim-old/.config/nvim/lua/plugins/file_explorer.lua diff --git a/nvim/.config/nvim/lua/plugins/formatting.lua b/nvim-old/.config/nvim/lua/plugins/formatting.lua similarity index 100% rename from nvim/.config/nvim/lua/plugins/formatting.lua rename to nvim-old/.config/nvim/lua/plugins/formatting.lua diff --git a/nvim/.config/nvim/lua/plugins/linting.lua b/nvim-old/.config/nvim/lua/plugins/linting.lua similarity index 100% rename from nvim/.config/nvim/lua/plugins/linting.lua rename to nvim-old/.config/nvim/lua/plugins/linting.lua diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim-old/.config/nvim/lua/plugins/telescope.lua similarity index 100% rename from nvim/.config/nvim/lua/plugins/telescope.lua rename to nvim-old/.config/nvim/lua/plugins/telescope.lua diff --git a/nvim/.config/nvim/lua/plugins/tmux.lua b/nvim-old/.config/nvim/lua/plugins/tmux.lua similarity index 100% rename from nvim/.config/nvim/lua/plugins/tmux.lua rename to nvim-old/.config/nvim/lua/plugins/tmux.lua diff --git a/nvim/.config/nvim/lua/plugins/ui.lua b/nvim-old/.config/nvim/lua/plugins/ui.lua similarity index 100% rename from nvim/.config/nvim/lua/plugins/ui.lua rename to nvim-old/.config/nvim/lua/plugins/ui.lua diff --git a/nvim/.config/nvim/queries/gotmpl/injections.scm b/nvim-old/.config/nvim/queries/gotmpl/injections.scm similarity index 100% rename from nvim/.config/nvim/queries/gotmpl/injections.scm rename to nvim-old/.config/nvim/queries/gotmpl/injections.scm diff --git a/nvim/.config/nvim/snippets/bash.lua b/nvim-old/.config/nvim/snippets/bash.lua similarity index 100% rename from nvim/.config/nvim/snippets/bash.lua rename to nvim-old/.config/nvim/snippets/bash.lua diff --git a/nvim/.config/nvim/snippets/lua.lua b/nvim-old/.config/nvim/snippets/lua.lua similarity index 100% rename from nvim/.config/nvim/snippets/lua.lua rename to nvim-old/.config/nvim/snippets/lua.lua diff --git a/nvim/.config/nvim/snippets/python.lua b/nvim-old/.config/nvim/snippets/python.lua similarity index 100% rename from nvim/.config/nvim/snippets/python.lua rename to nvim-old/.config/nvim/snippets/python.lua diff --git a/nvim/.config/nvim/snippets/rust.lua b/nvim-old/.config/nvim/snippets/rust.lua similarity index 100% rename from nvim/.config/nvim/snippets/rust.lua rename to nvim-old/.config/nvim/snippets/rust.lua diff --git a/nvim/.config/nvim/snippets/terraform.lua b/nvim-old/.config/nvim/snippets/terraform.lua similarity index 100% rename from nvim/.config/nvim/snippets/terraform.lua rename to nvim-old/.config/nvim/snippets/terraform.lua diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index ca2162a..b9b63a5 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,2 +1,2 @@ require("ink") -require("config.lazy") +require("plugins") diff --git a/nvim/.config/nvim/lsp/rust.lua b/nvim/.config/nvim/lsp/rust.lua index 1b39767..1c32159 100644 --- a/nvim/.config/nvim/lsp/rust.lua +++ b/nvim/.config/nvim/lsp/rust.lua @@ -9,7 +9,9 @@ return { loadOutDirsFromCheck = true, runBuildScripts = true, }, - checkOnSave = true, + checkOnSave = { + command = "clippy", + }, completion = { autoself = { enable = true }, snippets = { enable = true }, diff --git a/nvim/.config/nvim/lua/ink/init.lua b/nvim/.config/nvim/lua/ink/init.lua index 9228f3a..aba6199 100644 --- a/nvim/.config/nvim/lua/ink/init.lua +++ b/nvim/.config/nvim/lua/ink/init.lua @@ -1,28 +1,23 @@ require("ink.remap") -require("ink.lsp") require("ink.tabline") +require("ink.lsp") -vim.opt.hlsearch = false -- do not highlight matches -vim.wo.number = true -vim.opt.relativenumber = true -vim.opt.mouse = "a" -vim.opt.clipboard = "unnamedplus" -vim.opt.breakindent = true -- Enable break indent -vim.opt.undofile = true -- Save undo history vim.opt.ignorecase = true -- ignore case in searches by default vim.opt.smartcase = true -- but make it case sensitive if an uppercase is entered + +vim.wo.number = true +vim.opt.relativenumber = true vim.w.signcolumn = "yes" -- Keep signcolumn on by default -vim.opt.updatetime = 250 -- Decrease update time -vim.opt.timeoutlen = 300 -- time to wait for a mapped sequence to complete (in milliseconds) -vim.opt.backup = false -- creates a backup file + +vim.opt.swapfile = false -- creates a swapfile +vim.opt.undofile = true -- Save undo history -- if a file is being edited by another program (or was written to file while editing with another program), it is not -- allowed to be edited vim.opt.writebackup = false -vim.opt.autoread = true -- reload files changed outside of neovim -vim.o.completeopt = "menuone,noinsert,popup,fuzzy" -vim.opt.termguicolors = true -- set termguicolors to enable highlight groups -vim.opt.whichwrap = "bs<>[]hl" -- which "horizontal" keys are allowed to travel to prev/next line -vim.o.wrap = true -- 1. Enable line wrapping by default + +vim.opt.mouse = "a" +vim.opt.clipboard = "unnamedplus" + vim.o.linebreak = true -- 2. Break lines at word boundaries (improves readability) vim.o.showbreak = "↪ " -- 3. Add a visual indicator for wrapped lines vim.opt.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor @@ -32,18 +27,28 @@ vim.opt.shiftwidth = 4 -- Number of spaces inserted when indenting vim.opt.tabstop = 4 -- A TAB character looks like 4 spaces vim.opt.softtabstop = 4 -- Number of spaces inserted instead of a TAB character vim.opt.expandtab = true -- Pressing the TAB key will insert spaces instead of a TAB character +vim.opt.breakindent = true -- Enable break indent +vim.opt.smartindent = true -- make indenting smarter again +vim.opt.whichwrap = "bs<>[]hl" -- which "horizontal" keys are allowed to travel to prev/next line + +vim.opt.updatetime = 250 -- Decrease update time +vim.opt.timeoutlen = 300 -- time to wait for a mapped sequence to complete (in milliseconds) + +vim.o.completeopt = "menuone,noinsert,popup,fuzzy" +-- Replicate blink's cmdline configuration +vim.opt.wildmode = "longest:full,full" +vim.opt.wildoptions = { "pum", "fuzzy" } -- Use a popup menu for cmdline with fuzzy matching + +-- vim.keymap.set("i", "", "", { desc = "Trigger LSP completion" }) +-- Toggle signature help natively with in insert mode (Neovim 0.11+ default) + vim.opt.cursorline = true + vim.opt.splitbelow = true -- open new vertical split bottom vim.opt.splitright = true -- open new horizontal splits right -vim.opt.swapfile = false -- creates a swapfile -vim.opt.smartindent = true -- make indenting smarter again + vim.opt.showtabline = 2 -- always show tabs -vim.opt.backspace = "indent,eol,start" -- allow backspace on vim.opt.pumheight = 10 -- pop up menu height -vim.wo.conceallevel = 0 -- so that `` is visible in markdown files -vim.opt.encoding = "utf-8" -- the encoding written to a file -vim.opt.cmdheight = 1 -- more space in the neovim command line for displaying messages -vim.opt.autoindent = true vim.opt.shortmess:append("c") -- don't give |ins-completion-menu| messages vim.opt.iskeyword:append("-") -- hyphenated words recognized by searches @@ -55,13 +60,9 @@ vim.opt.runtimepath:remove("/usr/share/vim/vimfiles") -- separate vim plugins fr -- Nice and simple folding: vim.opt.foldenable = true vim.opt.foldlevel = 99 -vim.opt.foldmethod = "expr" --- Default to treesitter folding -vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()" --- vim.opt.foldtext = "> " vim.opt.fillchars:append({ fold = ">" }) -vim.opt.incsearch = true -- search as characters are entered +-- vim.o.autocomplete = true -- Enables the overall completion feature. -- Auto-reload buffers when files change on disk (e.g. from external tools or AI agents) vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold" }, { @@ -101,44 +102,3 @@ vim.api.nvim_create_autocmd({ "VimEnter", "VimLeave" }, { -- -- Filetypes to enable spellcheck local spell_types = { "text", "plaintex", "typst", "gitcommit", "markdown" } - --- add gotmpl filetypes for blueprint repos --- *.ext.tmpl files use the filetype of ext (e.g. foo.json.tmpl -> json, bar.sh.tmpl -> bash) -vim.filetype.add({ - extension = { - gotmpl = "gotmpl", - }, - pattern = { - [".*/recipes/.*%.ya?ml"] = "gotmpl", - [".*%.tmpl$"] = function(path) - local name = vim.fn.fnamemodify(path, ":t") - local base = name:match("^(.+)%.tmpl$") - if base then - local ext = base:match("%.(%w+)$") - if ext then - if ext == "sh" then - return "bash" - end - return ext - end - end - return nil - end, - }, -}) - --- Set global spell option to false initially to disable it for all file types -vim.opt.spell = false - --- Create an augroup for spellcheck to group related autocommands -vim.api.nvim_create_augroup("Spellcheck", { clear = true }) - --- Create an autocommand to enable spellcheck for specified file types -vim.api.nvim_create_autocmd({ "FileType" }, { - group = "Spellcheck", -- Grouping the command for easier management - pattern = spell_types, -- Only apply to these file types - callback = function() - vim.opt_local.spell = true -- Enable spellcheck for these file types - end, - desc = "Enable spellcheck for defined filetypes", -- Description for clarity -}) diff --git a/nvim/.config/nvim/lua/ink/lsp.lua b/nvim/.config/nvim/lua/ink/lsp.lua index 9a07f81..d97f602 100644 --- a/nvim/.config/nvim/lua/ink/lsp.lua +++ b/nvim/.config/nvim/lua/ink/lsp.lua @@ -1,12 +1,14 @@ ---- [[ LSP setup]] ---- - -vim.lsp.enable("luals") -vim.lsp.enable("rust") -vim.lsp.enable("gopls") -vim.lsp.enable("bashls") -vim.lsp.enable("terraform") +-- [[ LSP setup ]] +-- You can consolidate your enable calls into a single table +vim.lsp.enable({ + "luals", + "rust", + "gopls", + "bashls", + "terraform", +}) +-- Global capabilities override remains exactly the same vim.lsp.config("*", { capabilities = { textDocument = { @@ -17,47 +19,45 @@ vim.lsp.config("*", { }, }) --- [[FOLDING SETUP --- Prefer LSP folding if client supports it -vim.api.nvim_create_autocmd("LspAttach", { - callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - if client ~= nil then - if client:supports_method("textDocument/foldingRange") then - local win = vim.api.nvim_get_current_win() - vim.wo[win].foldexpr = "v:lua.vim.lsp.foldexpr()" - end - end - end, -}) --- ]] - --- [[INLAY HINTS +-- Consolidate all LSP actions into a single LspAttach autocmd vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", { clear = true }), callback = function(args) local client = assert(vim.lsp.get_client_by_id(args.data.client_id)) - if client.server_capabilities.inlayHintProvider then - vim.lsp.inlay_hint.enable(true, { bufnr = vim.fn.bufnr() }) - end - end, -}) --- [[CODE ACTIONS -vim.api.nvim_create_autocmd("LspAttach", { - callback = function(args) - local bufnr = args.data.bufnr - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { buffer = bufnr, desc = "Code action (menu)" }) - vim.keymap.set("v", "ca", function() - vim.lsp.buf.code_action({ context = { only = { "quickfix" } } }) - end, { buffer = bufnr, desc = "Code action (selection)" }) - -- Quickfix at cursor: apply single fix without menu when only one available + -- args.buf is the modern 0.12 standard. It guarantees you are acting + -- exactly on the buffer that triggered the attach. + local bufnr = args.buf + + -- [[ INLAY HINTS ]] + if client:supports_method("textDocument/inlayHint") then + -- Enable them by default when opening the file + vim.lsp.inlay_hint.enable(true, { bufnr = bufnr }) + + -- Create a buffer-local keymap to toggle them on/off + vim.keymap.set("n", "th", function() + local is_enabled = vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }) + vim.lsp.inlay_hint.enable(not is_enabled, { bufnr = bufnr }) + end, { buffer = bufnr, desc = "Toggle Inlay Hints" }) + end + -- [[ FOLDING SETUP ]] + if client:supports_method("textDocument/foldingRange") then + -- opt_local cleanly applies to the attached buffer without risking + -- applying to the wrong window if attached in the background + vim.opt_local.foldexpr = "v:lua.vim.lsp.foldexpr()" + vim.opt_local.foldmethod = "expr" + end + + -- [[ CODE ACTIONS ]] + -- Note: Neovim 0.11+ automatically maps 'gra' to code actions natively. + vim.keymap.set("n", "cf", function() vim.lsp.buf.code_action({ context = { only = { "quickfix" } }, apply = true, }) end, { buffer = bufnr, desc = "Apply fix at cursor" }) - -- Organize imports (Rust: source.organizeImports.rust, Go: source.organizeImports) + vim.keymap.set("n", "ci", function() vim.lsp.buf.code_action({ context = { @@ -68,3 +68,22 @@ vim.api.nvim_create_autocmd("LspAttach", { end, { buffer = bufnr, desc = "Organize imports" }) end, }) + +-- vim.api.nvim_create_autocmd("LspAttach", { +-- group = vim.api.nvim_create_augroup("lsp_completion", { clear = true }), +-- callback = function(args) +-- local client_id = args.data.client_id +-- if not client_id then +-- return +-- end +-- +-- local client = vim.lsp.get_client_by_id(client_id) +-- if client and client:supports_method("textDocument/completion") then +-- -- Enable native LSP completion for this client + buffer +-- vim.lsp.completion.enable(true, client_id, args.buf, { +-- autotrigger = true, -- auto-show menu as you type (recommended) +-- -- You can also set { autotrigger = false } and trigger manually with +-- }) +-- end +-- end, +-- }) diff --git a/nvim/.config/nvim/lua/ink/remap.lua b/nvim/.config/nvim/lua/ink/remap.lua index 722b369..36e4248 100644 --- a/nvim/.config/nvim/lua/ink/remap.lua +++ b/nvim/.config/nvim/lua/ink/remap.lua @@ -1,11 +1,6 @@ --- Make sure to setup `mapleader` and `maplocalleader` before --- loading lazy.nvim so that mappings are correct. --- This is also a good place to setup other settings (vim.opt) vim.g.mapleader = " " vim.g.maplocalleader = "\\" -- (mode, key, command) -vim.keymap.set({ "n", "v" }, "", "", { silent = true }) --- vim.keymap.set("n", "pv", vim.cmd.Ex, { desc = "Open current directory" }) local function map(mode, lhs, rhs, opts) local options = { noremap = true, silent = true } @@ -41,10 +36,10 @@ map("v", "p", '"_dP', { desc = "Paste without yanking underlying text" }) map("n", "gl", "`.", { desc = "Jump to the last change in the file" }) -map("n", "C-d", "zz") -map("n", "C-u", "zz") -map("n", "C-f", "zz") -map("n", "C-b", "zz") +map("n", "", "zz") +map("n", "", "zz") +map("n", "", "zz") +map("n", "", "zz") -- map('n', '', 'za', { desc = 'Toggle cursor fold' }) -- map('n', '', 'zm', { desc = 'Toggle all folds at cursor' }) diff --git a/nvim/.config/nvim/lua/ink/tabline.lua b/nvim/.config/nvim/lua/ink/tabline.lua index c5b450d..8011dce 100644 --- a/nvim/.config/nvim/lua/ink/tabline.lua +++ b/nvim/.config/nvim/lua/ink/tabline.lua @@ -1,4 +1,3 @@ ---- @return string local function tab_info() local fname = vim.fn.expand("%:p") if fname == "" then diff --git a/nvim/.config/nvim/lua/plugins/ai/init.lua b/nvim/.config/nvim/lua/plugins/ai/init.lua new file mode 100644 index 0000000..0f36267 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/ai/init.lua @@ -0,0 +1,105 @@ +vim.pack.add({ + { src = "https://github.com/olimorris/codecompanion.nvim" }, + { src = "https://github.com/nvim-lua/plenary.nvim" }, + { + src = "https://github.com/saghen/blink.cmp", + version = vim.version.range("^1"), + }, +}) + +local codecompanion = require("codecompanion") +-- Dynamically choose the adapter based on the environment variable +local active_adapter = os.getenv("GEMINI_API_KEY") and "gemini" or "kiro" + +codecompanion.setup({ + strategies = { + chat = { adapter = active_adapter }, + inline = { adapter = active_adapter }, + agent = { adapter = active_adapter }, + }, + adapters = { + gemini = function() + return require("codecompanion.adapters").extend("gemini", { + env = { + -- We read the API key from the environment variable. + -- You can also use "cmd:pass show gemini/api_key" or "cmd:cat ~/.gemini_api_key" + api_key = os.getenv("GEMINI_API_KEY") or "cmd:cat ~/.gemini_api_key", + }, + schema = { + model = { + default = "gemini-3.1-pro-preview", + }, + }, + }) + end, + -- If 'kiro' is a custom CLI or local LLM, you must define it here. + -- This is a generic custom adapter stub for CodeCompanion: + kiro = function() + return require("codecompanion.adapters").extend("openai_compatible", { + name = "kiro", + env = { + url = "http://localhost:11434", -- Example endpoint + -- api_key = "...", + }, + }) + end, + }, +}) + +-- Optional: Keymaps for CodeCompanion +vim.keymap.set({ "n", "v" }, "a", "CodeCompanionChat Toggle", { noremap = true, silent = true }) +vim.cmd([[cab cc CodeCompanion]]) + +vim.cmd("packadd blink.cmp") +local blink = require("blink.cmp") +blink.setup({ + keymap = { preset = "default" }, + appearance = { nerd_font_variant = "mono" }, + completion = { documentation = { auto_show = true } }, + + cmdline = { + keymap = { [""] = { "show", "accept" } }, + completion = { menu = { auto_show = true }, ghost_text = { enabled = true } }, + }, + + -- By removing `snippets = { preset = 'luasnip' }`, Blink natively + -- defaults to Neovim 0.11+ built-in `vim.snippet` API. + + sources = { + -- Added codecompanion, removed emoji + default = { "lsp", "path", "snippets", "buffer", "codecompanion" }, + providers = { + cmdline = { + min_keyword_length = function(ctx) + if ctx.mode == "cmdline" and string.find(ctx.line, " ") == nil then + return 3 + end + return 0 + end, + }, + -- Wire up CodeCompanion to Blink + codecompanion = { + name = "CodeCompanion", + module = "codecompanion.providers.completion.blink", + enabled = true, + }, + }, + }, + fuzzy = { implementation = "prefer_rust_with_warning" }, +}) + +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities = blink.get_lsp_capabilities(capabilities) + +-- Safely merge with existing global LSP capabilities so we don't overwrite settings from ink/lsp.lua +local existing_config = vim.lsp.config["*"] +if type(existing_config) == "table" and type(existing_config.capabilities) == "table" then + capabilities = vim.tbl_deep_extend("force", existing_config.capabilities, capabilities) +end + +-- Apply to all natively loaded 0.12 LSP servers +vim.lsp.config("*", { + capabilities = capabilities, + -- Note: We DO NOT use vim.lsp.completion.enable() here because + -- Blink is taking over the UI rendering. +}) diff --git a/nvim/.config/nvim/lua/plugins/basic/init.lua b/nvim/.config/nvim/lua/plugins/basic/init.lua new file mode 100644 index 0000000..9c80365 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/basic/init.lua @@ -0,0 +1,22 @@ +vim.pack.add({ + { src = "https://github.com/folke/which-key.nvim" }, + { src = "https://github.com/tpope/vim-fugitive" }, + { src = "https://github.com/stevearc/oil.nvim" }, + { src = "https://github.com/echasnovski/mini.icons" }, + { src = "https://github.com/yorickpeterse/nvim-jump" }, +}) +require("which-key").setup({ + preset = "helix", +}) + +vim.keymap.set("n", "gs", vim.cmd.Git, { desc = "Fugitive git command" }) + +require("oil").setup({ + default_file_explorer = true, + view_options = { + show_hidden = true, + }, +}) + +vim.keymap.set("n", "pv", "Oil", { desc = "Open current directory" }) +vim.keymap.set({ "n", "x", "o" }, "f", require("jump").start, {}) diff --git a/nvim/.config/nvim/lua/plugins/formatting/init.lua b/nvim/.config/nvim/lua/plugins/formatting/init.lua new file mode 100644 index 0000000..c5fef55 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/formatting/init.lua @@ -0,0 +1,79 @@ +vim.pack.add({ + { src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" }, + { src = "https://github.com/stevearc/conform.nvim" }, +}) + +require("nvim-treesitter").install({ + --"zsh", + "cmake", + "dockerfile", + "gitignore", + "go", + "gotmpl", + "java", + "json", + "make", + "regex", + "rust", + "terraform", + "yaml", +}) + +-- Default to treesitter folding +vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()" +vim.opt.foldmethod = "expr" +vim.opt.foldtext = "> " + +vim.api.nvim_create_autocmd({ "BufReadPre", "BufNewFile" }, { + group = vim.api.nvim_create_augroup("LazyLoadConform", { clear = true }), + callback = function() + vim.cmd("packadd conform.nvim") + local conform = require("conform") + conform.setup({ + formatters_by_ft = { + -- brew install stylua + lua = { "stylua" }, + -- install rust + rust = { "rustfmt" }, + -- brew install prettier + markdown = { "markdownlint-cli2" }, + json = { "prettierd", "prettier" }, + yaml = { "yamlfmt" }, + -- install terraform + terraform = { "terraform_fmt" }, + -- brew install shfmt + bash = { "shfmt" }, + zsh = { "shfmt" }, + sh = { "shfmt" }, + -- brew install ruff + python = { "ruff" }, + -- go install mvdan.cc/gofumpt@latest + go = { "gofumpt" }, + }, + formatters = { + prettier = { + prepend_args = { "--prose-wrap", "always" }, + }, + shfmt = { + prepend_args = { "-i", "4", "-ci" }, + }, + ruff = { + prepend_args = { "--extend-select", "I" }, + }, + }, + format_on_save = { + lsp_fallback = true, + async = false, + timeout_ms = 3000, + }, + }) + + vim.keymap.set({ "n", "v" }, "mp", function() + conform.format({ + lsp_fallback = true, + async = false, + timeout_ms = 5000, + }) + end, { desc = "Format file or range (in visual mode)" }) + end, +}) diff --git a/nvim/.config/nvim/lua/plugins/init.lua b/nvim/.config/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..297401f --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,6 @@ +require("plugins.basic") +require("plugins.tmux") +require("plugins.ui") +require("plugins.formatting") +require("plugins.linting") +require("plugins.ai") diff --git a/nvim/.config/nvim/lua/plugins/linting/init.lua b/nvim/.config/nvim/lua/plugins/linting/init.lua new file mode 100644 index 0000000..0b0e461 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/linting/init.lua @@ -0,0 +1,41 @@ +vim.pack.add({ + { src = "https://github.com/mfussenegger/nvim-lint" }, +}) + +vim.api.nvim_create_autocmd({ "BufReadPre", "BufNewFile" }, { + group = vim.api.nvim_create_augroup("LazyLoadNvimLint", { clear = true }), + callback = function() + vim.cmd("packadd lint.nvim") + local lint = require("lint") + lint.linters_by_ft = { + -- brew install luacheck + lua = { "luacheck" }, + bash = { "shellcheck" }, + sh = { "shellcheck" }, + -- brew install tflint + terraform = { "tflint" }, + -- brew install markdownlint-cli2 + markdown = { "markdownlint-cli2" }, + -- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.0 + go = { "golangcilint" }, + } + local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) + + vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { + group = lint_augroup, + callback = function() + lint.try_lint() + end, + }) + vim.keymap.set("n", "l", function() + lint.try_lint() + end, { desc = "Trigger linting for current file" }) + vim.keymap.set("n", "d", function() + if vim.diagnostic.config().virtual_lines then + vim.diagnostic.config({ virtual_lines = false }) + else + vim.diagnostic.config({ virtual_lines = { current_line = true } }) + end + end, { desc = "Toggle inline diagnostics" }) + end, +}) diff --git a/nvim/.config/nvim/lua/plugins/tmux/init.lua b/nvim/.config/nvim/lua/plugins/tmux/init.lua new file mode 100644 index 0000000..3c56593 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/tmux/init.lua @@ -0,0 +1,16 @@ +vim.pack.add({ + { src = "https://github.com/alexghergh/nvim-tmux-navigation" }, +}) + +local nvim_tmux_nav = require("nvim-tmux-navigation") + +nvim_tmux_nav.setup({ + disable_when_zoomed = true, -- defaults to false +}) + +vim.keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateLeft, { desc = "Move to the split to the left" }) +vim.keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateDown, { desc = "Move to the split below" }) +vim.keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateUp, { desc = "Move to the split above" }) +vim.keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateRight, { desc = "Move to the split to the right" }) +vim.keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateLastActive, { desc = "Move to the last active split" }) +vim.keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateNext, { desc = "Move to the next split" }) diff --git a/nvim/.config/nvim/lua/plugins/ui/init.lua b/nvim/.config/nvim/lua/plugins/ui/init.lua new file mode 100644 index 0000000..2a6bd57 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/ui/init.lua @@ -0,0 +1,84 @@ +require("vim._core.ui2").enable({ + enable = true, +}) + +vim.opt.cmdheight = 2 -- more space in the neovim command line for displaying messages + +vim.pack.add({ + { src = "https://github.com/rose-pine/neovim" }, + { src = "https://github.com/zaldih/themery.nvim" }, + { src = "https://github.com/mvllow/modes.nvim", version = "v0.3.0" }, + { src = "https://github.com/brenoprata10/nvim-highlight-colors" }, +}) + +require("themery").setup({ + -- add the config here + themes = { "rose-pine-dawn", "rose-pine-main" }, -- Your list of installed colorschemes. + livePreview = true, -- Apply theme while picking. Default to true. +}) +vim.keymap.set("n", "tt", function() + local themery = require("themery") + local currentTheme = themery.getCurrentTheme() + if currentTheme and currentTheme.name == "rose-pine-dawn" then + themery.setThemeByName("rose-pine-main", true) + else + themery.setThemeByName("rose-pine-dawn", true) + end +end, { noremap = true, desc = "Alternate between light and dark mode" }) + +require("nvim-highlight-colors").setup() +require("modes").setup() + +vim.pack.add({ + { src = "https://github.com/nvim-tree/nvim-web-devicons" }, + { src = "https://github.com/nvim-lualine/lualine.nvim" }, + { src = "https://github.com/lukas-reineke/indent-blankline.nvim" }, +}) + +require("lualine").setup({ + options = { + section_separators = "", + component_separators = "", + theme = "rose-pine", + }, + extensions = { "fugitive", "lazy" }, +}) + +require("ibl").setup() + +vim.pack.add({ + { src = "https://github.com/lewis6991/gitsigns.nvim" }, + { src = "https://github.com/f-person/git-blame.nvim" }, +}) + +require("gitsigns").setup({ + signs = { + add = { text = "+" }, + change = { text = "~" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + }, + signs_staged = { + add = { text = "+" }, + change = { text = "~" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + }, +}) + +vim.keymap.set("n", "gk", "GitBlameToggle", { desc = "Toggle git-blame" }) +vim.g.gitblame_display_virtual_text = false +-- schedule_event = "CursorHold" +-- clear_event = "CursorHoldI" +vim.g.gitblame_delay = 50 -- miliseconds +local git_blame = require("gitblame") +require("lualine").setup({ + sections = { + lualine_c = { + { "filename" }, + { git_blame.get_current_blame_text, cond = git_blame.is_blame_text_available }, + }, + }, +}) diff --git a/nvim/.config/nvim/nvim-pack-lock.json b/nvim/.config/nvim/nvim-pack-lock.json new file mode 100644 index 0000000..f6b600d --- /dev/null +++ b/nvim/.config/nvim/nvim-pack-lock.json @@ -0,0 +1,95 @@ +{ + "plugins": { + "blink.cmp": { + "rev": "78336bc89ee5365633bcf754d93df01678b5c08f", + "src": "https://github.com/saghen/blink.cmp", + "version": "1.0.0 - 2.0.0" + }, + "codecompanion.nvim": { + "rev": "7d7957c26d33a97085d3a0c82eeb0147a0f51314", + "src": "https://github.com/olimorris/codecompanion.nvim" + }, + "conform.nvim": { + "rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395", + "src": "https://github.com/stevearc/conform.nvim" + }, + "git-blame.nvim": { + "rev": "5c536e2d4134d064aa3f41575280bc8a2a0e03d7", + "src": "https://github.com/f-person/git-blame.nvim" + }, + "gitsigns.nvim": { + "rev": "0d797daee85366bc242580e352a4f62d67557b84", + "src": "https://github.com/lewis6991/gitsigns.nvim" + }, + "indent-blankline.nvim": { + "rev": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03", + "src": "https://github.com/lukas-reineke/indent-blankline.nvim" + }, + "lualine.nvim": { + "rev": "8811f3f3f4dc09d740c67e9ce399e7a541e2e5b2", + "src": "https://github.com/nvim-lualine/lualine.nvim" + }, + "mini.icons": { + "rev": "7fdae2443a0e2910015ca39ad74b50524ee682d3", + "src": "https://github.com/echasnovski/mini.icons" + }, + "modes.nvim": { + "rev": "fc7bc0141500d9cf7c14f46fca846f728545a781", + "src": "https://github.com/mvllow/modes.nvim", + "version": "'v0.3.0'" + }, + "neovim": { + "rev": "cf2a288696b03d0934da713d66c6d71557b5c997", + "src": "https://github.com/rose-pine/neovim" + }, + "nvim-highlight-colors": { + "rev": "e2cb22089cc2358b2b995c09578224f142de6039", + "src": "https://github.com/brenoprata10/nvim-highlight-colors" + }, + "nvim-jump": { + "rev": "41261ddebbb595decd0302cb9e5eec7ce230e382", + "src": "https://github.com/yorickpeterse/nvim-jump" + }, + "nvim-lint": { + "rev": "4b03656c09c1561f89b6aa0665c15d292ba9499d", + "src": "https://github.com/mfussenegger/nvim-lint" + }, + "nvim-tmux-navigation": { + "rev": "4898c98702954439233fdaf764c39636681e2861", + "src": "https://github.com/alexghergh/nvim-tmux-navigation" + }, + "nvim-treesitter": { + "rev": "4916d6592ede8c07973490d9322f187e07dfefac", + "src": "https://github.com/nvim-treesitter/nvim-treesitter", + "version": "'main'" + }, + "nvim-web-devicons": { + "rev": "95b7a002d5dba1a42eb58f5fac5c565a485eefd0", + "src": "https://github.com/nvim-tree/nvim-web-devicons" + }, + "oil.nvim": { + "rev": "0fcc83805ad11cf714a949c98c605ed717e0b83e", + "src": "https://github.com/stevearc/oil.nvim" + }, + "plenary.nvim": { + "rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509", + "src": "https://github.com/nvim-lua/plenary.nvim" + }, + "snacks.nvim": { + "rev": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e", + "src": "https://github.com/folke/snacks.nvim" + }, + "themery.nvim": { + "rev": "bfa58f4b279d21cb515b28023e1b68ec908584b2", + "src": "https://github.com/zaldih/themery.nvim" + }, + "vim-fugitive": { + "rev": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0", + "src": "https://github.com/tpope/vim-fugitive" + }, + "which-key.nvim": { + "rev": "3aab2147e74890957785941f0c1ad87d0a44c15a", + "src": "https://github.com/folke/which-key.nvim" + } + } +}