aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2026-01-12 10:33:52 +0200
committerPetri Hienonen <petri.hienonen@gmail.com>2026-01-12 10:33:52 +0200
commit515b747a4273030e8bd145a6eac770c4de20f69c (patch)
treef399fcbc55fb4a93abb099f9455e3b76e1fd4a77
parent9091ec72fe5ed12ae56a46f8580e0053d4b525fb (diff)
downloadnixos-515b747a4273030e8bd145a6eac770c4de20f69c.tar.zst
Use tabs to indent nvim configurations
-rw-r--r--home/nvim/autocommands.lua440
-rw-r--r--home/nvim/keymaps.lua54
-rw-r--r--home/nvim/lsp.lua504
-rw-r--r--home/nvim/options.lua10
-rw-r--r--home/nvim/plugins/dap.lua246
-rw-r--r--home/nvim/plugins/mini.lua2
-rw-r--r--home/nvim/plugins/treesitter.lua152
7 files changed, 704 insertions, 704 deletions
diff --git a/home/nvim/autocommands.lua b/home/nvim/autocommands.lua
index b8bf173..eda0653 100644
--- a/home/nvim/autocommands.lua
+++ b/home/nvim/autocommands.lua
@@ -1,272 +1,272 @@
local augroup = vim.api.nvim_create_augroup("UserConfig", {})
vim.api.nvim_create_autocmd("TextYankPost", {
- desc = "Highlight when yanking (copying) text",
- group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
- callback = function() vim.highlight.on_yank() end,
+ desc = "Highlight when yanking (copying) text",
+ group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
+ callback = function() vim.highlight.on_yank() end,
})
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
- pattern = { "*" },
- command = [[%s/\s\+$//e]],
+ pattern = { "*" },
+ command = [[%s/\s\+$//e]],
})
-- Return to last edit position when opening files
vim.api.nvim_create_autocmd("BufReadPost", {
- group = augroup,
- callback = function()
- local mark = vim.api.nvim_buf_get_mark(0, '"')
- local lcount = vim.api.nvim_buf_line_count(0)
- if mark[1] > 0 and mark[1] <= lcount then pcall(vim.api.nvim_win_set_cursor, 0, mark) end
- end,
+ group = augroup,
+ callback = function()
+ local mark = vim.api.nvim_buf_get_mark(0, '"')
+ local lcount = vim.api.nvim_buf_line_count(0)
+ if mark[1] > 0 and mark[1] <= lcount then pcall(vim.api.nvim_win_set_cursor, 0, mark) end
+ end,
})
-- Auto-close terminal when process exits
vim.api.nvim_create_autocmd("TermClose", {
- group = augroup,
- callback = function()
- if vim.v.event.status == 0 then vim.api.nvim_buf_delete(0, {}) end
- end,
+ group = augroup,
+ callback = function()
+ if vim.v.event.status == 0 then vim.api.nvim_buf_delete(0, {}) end
+ end,
})
-- Disable line numbers in terminal
vim.api.nvim_create_autocmd("TermOpen", {
- group = augroup,
- callback = function()
- vim.opt_local.number = false
- vim.opt_local.relativenumber = false
- vim.opt_local.signcolumn = "no"
- end,
+ group = augroup,
+ callback = function()
+ vim.opt_local.number = false
+ vim.opt_local.relativenumber = false
+ vim.opt_local.signcolumn = "no"
+ end,
})
-- Auto-resize splits when window is resized
vim.api.nvim_create_autocmd("VimResized", {
- group = augroup,
- callback = function() vim.cmd("tabdo wincmd =") end,
+ group = augroup,
+ callback = function() vim.cmd("tabdo wincmd =") end,
})
local og_virt_text
local og_virt_line
vim.api.nvim_create_autocmd({ "CursorMoved", "DiagnosticChanged" }, {
- group = vim.api.nvim_create_augroup("diagnostic_only_virtlines", { clear = true }),
- callback = function()
- if og_virt_line == nil then og_virt_line = vim.diagnostic.config().virtual_lines end
-
- -- ignore if virtual_lines.current_line is disabled
- if not (og_virt_line and og_virt_line.current_line) then
- if og_virt_text then
- vim.diagnostic.config({ virtual_text = og_virt_text })
- og_virt_text = nil
- end
- return
- end
-
- if og_virt_text == nil then og_virt_text = vim.diagnostic.config().virtual_text end
-
- local lnum = vim.api.nvim_win_get_cursor(0)[1] - 1
-
- if vim.tbl_isempty(vim.diagnostic.get(0, { lnum = lnum })) then
- vim.diagnostic.config({ virtual_text = og_virt_text })
- else
- vim.diagnostic.config({ virtual_text = false })
- end
- end,
+ group = vim.api.nvim_create_augroup("diagnostic_only_virtlines", { clear = true }),
+ callback = function()
+ if og_virt_line == nil then og_virt_line = vim.diagnostic.config().virtual_lines end
+
+ -- ignore if virtual_lines.current_line is disabled
+ if not (og_virt_line and og_virt_line.current_line) then
+ if og_virt_text then
+ vim.diagnostic.config({ virtual_text = og_virt_text })
+ og_virt_text = nil
+ end
+ return
+ end
+
+ if og_virt_text == nil then og_virt_text = vim.diagnostic.config().virtual_text end
+
+ local lnum = vim.api.nvim_win_get_cursor(0)[1] - 1
+
+ if vim.tbl_isempty(vim.diagnostic.get(0, { lnum = lnum })) then
+ vim.diagnostic.config({ virtual_text = og_virt_text })
+ else
+ vim.diagnostic.config({ virtual_text = false })
+ end
+ end,
})
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 = "LSP: " .. desc })
- end
-
- local client = vim.lsp.get_client_by_id(event.data.client_id)
-
- if client and client:supports_method("textDocument/implementation") then
- -- defaults:
- -- https://neovim.io/doc/user/news-0.11.html#_defaults
- map("gl", vim.diagnostic.open_float, "Open Diagnostic Float")
- map("K", vim.lsp.buf.hover, "Hover Documentation")
- map("gs", vim.lsp.buf.signature_help, "Signature Documentation")
- map("gD", vim.lsp.buf.declaration, "Goto Declaration")
- map("<leader>la", vim.lsp.buf.code_action, "Code Action")
- map("<leader>lr", vim.lsp.buf.rename, "Rename all references")
- map("<leader>lf", vim.lsp.buf.format, "Format")
- map(
- "<leader>v",
- "<cmd>vsplit | lua vim.lsp.buf.definition()<cr>",
- "Goto Definition in Vertical Split"
- )
- map("gd", vim.lsp.buf.definition, "Goto Definition")
- map("gr", vim.lsp.buf.references, "Goto References")
- map("gI", vim.lsp.buf.implementation, "Goto Implementation")
- end
-
- if client and client:supports_method("textDocument/completion") then
- vim.lsp.completion.enable(true, client.id, event.buf, {
- autotrigger = true,
- convert = function(item) return { abbr = item.label:gsub("%b()", "") } end,
- })
- vim.keymap.set("i", "<c-space>", function() vim.lsp.completion.get() end)
- client.server_capabilities.completionProvider = client.server_capabilities.completionProvider or {}
- local trigger_chars = {}
- for i = 32, 126 do
- table.insert(trigger_chars, string.char(i))
- end
- client.server_capabilities.completionProvider.triggerCharacters = vim.list_extend(
- client.server_capabilities.completionProvider.triggerCharacters or {},
- trigger_chars
- )
- end
-
- if client and client:supports_method("textDocument/formatting") then
- vim.api.nvim_create_autocmd("BufWritePre", {
- group = vim.api.nvim_create_augroup("my.lsp", { clear = false }),
- buffer = event.buf,
- callback = function()
- vim.lsp.buf.format({ bufnr = event.buf, id = client.id, timeout_ms = 1000 })
- end,
- })
- end
-
- if client and client:supports_method("textDocument/inlayHint") then
- vim.lsp.inlay_hint.enable(true, { bufnr = event.buf })
- end
-
- if client and client:supports_method("textDocument/documentHighlight") then
- local highlight_augroup =
- vim.api.nvim_create_augroup("lsp-highlight", { clear = false })
-
- -- When cursor stops moving: Highlights all instances of the symbol under the cursor
- -- When cursor moves: Clears the highlighting
- 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,
- })
-
- -- When LSP detaches: Clears the highlighting
- 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,
+ 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 = "LSP: " .. desc })
+ end
+
+ local client = vim.lsp.get_client_by_id(event.data.client_id)
+
+ if client and client:supports_method("textDocument/implementation") then
+ -- defaults:
+ -- https://neovim.io/doc/user/news-0.11.html#_defaults
+ map("gl", vim.diagnostic.open_float, "Open Diagnostic Float")
+ map("K", vim.lsp.buf.hover, "Hover Documentation")
+ map("gs", vim.lsp.buf.signature_help, "Signature Documentation")
+ map("gD", vim.lsp.buf.declaration, "Goto Declaration")
+ map("<leader>la", vim.lsp.buf.code_action, "Code Action")
+ map("<leader>lr", vim.lsp.buf.rename, "Rename all references")
+ map("<leader>lf", vim.lsp.buf.format, "Format")
+ map(
+ "<leader>v",
+ "<cmd>vsplit | lua vim.lsp.buf.definition()<cr>",
+ "Goto Definition in Vertical Split"
+ )
+ map("gd", vim.lsp.buf.definition, "Goto Definition")
+ map("gr", vim.lsp.buf.references, "Goto References")
+ map("gI", vim.lsp.buf.implementation, "Goto Implementation")
+ end
+
+ if client and client:supports_method("textDocument/completion") then
+ vim.lsp.completion.enable(true, client.id, event.buf, {
+ autotrigger = true,
+ convert = function(item) return { abbr = item.label:gsub("%b()", "") } end,
+ })
+ vim.keymap.set("i", "<c-space>", function() vim.lsp.completion.get() end)
+ client.server_capabilities.completionProvider = client.server_capabilities.completionProvider or {}
+ local trigger_chars = {}
+ for i = 32, 126 do
+ table.insert(trigger_chars, string.char(i))
+ end
+ client.server_capabilities.completionProvider.triggerCharacters = vim.list_extend(
+ client.server_capabilities.completionProvider.triggerCharacters or {},
+ trigger_chars
+ )
+ end
+
+ if client and client:supports_method("textDocument/formatting") then
+ vim.api.nvim_create_autocmd("BufWritePre", {
+ group = vim.api.nvim_create_augroup("my.lsp", { clear = false }),
+ buffer = event.buf,
+ callback = function()
+ vim.lsp.buf.format({ bufnr = event.buf, id = client.id, timeout_ms = 1000 })
+ end,
+ })
+ end
+
+ if client and client:supports_method("textDocument/inlayHint") then
+ vim.lsp.inlay_hint.enable(true, { bufnr = event.buf })
+ end
+
+ if client and client:supports_method("textDocument/documentHighlight") then
+ local highlight_augroup =
+ vim.api.nvim_create_augroup("lsp-highlight", { clear = false })
+
+ -- When cursor stops moving: Highlights all instances of the symbol under the cursor
+ -- When cursor moves: Clears the highlighting
+ 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,
+ })
+
+ -- When LSP detaches: Clears the highlighting
+ 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,
})
vim.api.nvim_create_autocmd("ModeChanged", {
- group = vim.api.nvim_create_augroup("diagnostic_redraw", {}),
- callback = function() pcall(vim.diagnostic.show) end,
+ group = vim.api.nvim_create_augroup("diagnostic_redraw", {}),
+ callback = function() pcall(vim.diagnostic.show) end,
})
-- terminal
local terminal_state = {
- buf = nil,
- win = nil,
- is_open = false,
+ buf = nil,
+ win = nil,
+ is_open = false,
}
local function FloatingTerminal()
- -- If terminal is already open, close it (toggle behavior)
- if terminal_state.is_open and vim.api.nvim_win_is_valid(terminal_state.win) then
- vim.api.nvim_win_close(terminal_state.win, false)
- terminal_state.is_open = false
- return
- end
-
- -- Create buffer if it doesn't exist or is invalid
- if not terminal_state.buf or not vim.api.nvim_buf_is_valid(terminal_state.buf) then
- terminal_state.buf = vim.api.nvim_create_buf(false, true)
- -- Set buffer options for better terminal experience
- vim.api.nvim_buf_set_option(terminal_state.buf, "bufhidden", "hide")
- end
-
- -- Calculate window dimensions
- local width = math.floor(vim.o.columns * 0.8)
- local height = math.floor(vim.o.lines * 0.8)
- local row = math.floor((vim.o.lines - height) / 2)
- local col = math.floor((vim.o.columns - width) / 2)
-
- -- Create the floating window
- terminal_state.win = vim.api.nvim_open_win(terminal_state.buf, true, {
- relative = "editor",
- width = width,
- height = height,
- row = row,
- col = col,
- style = "minimal",
- border = "rounded",
- })
-
- -- Set transparency for the floating window
- vim.api.nvim_win_set_option(terminal_state.win, "winblend", 0)
-
- -- Set transparent background for the window
- vim.api.nvim_win_set_option(
- terminal_state.win,
- "winhighlight",
- "Normal:FloatingTermNormal,FloatBorder:FloatingTermBorder"
- )
-
- -- Define highlight groups for transparency
- vim.api.nvim_set_hl(0, "FloatingTermNormal", { bg = "none" })
- vim.api.nvim_set_hl(0, "FloatingTermBorder", { bg = "none" })
-
- -- Start terminal if not already running
- local has_terminal = false
- local lines = vim.api.nvim_buf_get_lines(terminal_state.buf, 0, -1, false)
- for _, line in ipairs(lines) do
- if line ~= "" then
- has_terminal = true
- break
- end
- end
-
- if not has_terminal then vim.fn.termopen(os.getenv("SHELL")) end
-
- terminal_state.is_open = true
- vim.cmd("startinsert")
-
- -- Set up auto-close on buffer leave
- vim.api.nvim_create_autocmd("BufLeave", {
- buffer = terminal_state.buf,
- callback = function()
- if terminal_state.is_open and vim.api.nvim_win_is_valid(terminal_state.win) then
- vim.api.nvim_win_close(terminal_state.win, false)
- terminal_state.is_open = false
- end
- end,
- once = true,
- })
+ -- If terminal is already open, close it (toggle behavior)
+ if terminal_state.is_open and vim.api.nvim_win_is_valid(terminal_state.win) then
+ vim.api.nvim_win_close(terminal_state.win, false)
+ terminal_state.is_open = false
+ return
+ end
+
+ -- Create buffer if it doesn't exist or is invalid
+ if not terminal_state.buf or not vim.api.nvim_buf_is_valid(terminal_state.buf) then
+ terminal_state.buf = vim.api.nvim_create_buf(false, true)
+ -- Set buffer options for better terminal experience
+ vim.api.nvim_buf_set_option(terminal_state.buf, "bufhidden", "hide")
+ end
+
+ -- Calculate window dimensions
+ local width = math.floor(vim.o.columns * 0.8)
+ local height = math.floor(vim.o.lines * 0.8)
+ local row = math.floor((vim.o.lines - height) / 2)
+ local col = math.floor((vim.o.columns - width) / 2)
+
+ -- Create the floating window
+ terminal_state.win = vim.api.nvim_open_win(terminal_state.buf, true, {
+ relative = "editor",
+ width = width,
+ height = height,
+ row = row,
+ col = col,
+ style = "minimal",
+ border = "rounded",
+ })
+
+ -- Set transparency for the floating window
+ vim.api.nvim_win_set_option(terminal_state.win, "winblend", 0)
+
+ -- Set transparent background for the window
+ vim.api.nvim_win_set_option(
+ terminal_state.win,
+ "winhighlight",
+ "Normal:FloatingTermNormal,FloatBorder:FloatingTermBorder"
+ )
+
+ -- Define highlight groups for transparency
+ vim.api.nvim_set_hl(0, "FloatingTermNormal", { bg = "none" })
+ vim.api.nvim_set_hl(0, "FloatingTermBorder", { bg = "none" })
+
+ -- Start terminal if not already running
+ local has_terminal = false
+ local lines = vim.api.nvim_buf_get_lines(terminal_state.buf, 0, -1, false)
+ for _, line in ipairs(lines) do
+ if line ~= "" then
+ has_terminal = true
+ break
+ end
+ end
+
+ if not has_terminal then vim.fn.termopen(os.getenv("SHELL")) end
+
+ terminal_state.is_open = true
+ vim.cmd("startinsert")
+
+ -- Set up auto-close on buffer leave
+ vim.api.nvim_create_autocmd("BufLeave", {
+ buffer = terminal_state.buf,
+ callback = function()
+ if terminal_state.is_open and vim.api.nvim_win_is_valid(terminal_state.win) then
+ vim.api.nvim_win_close(terminal_state.win, false)
+ terminal_state.is_open = false
+ end
+ end,
+ once = true,
+ })
end
-- Function to explicitly close the terminal
local function CloseFloatingTerminal()
- if terminal_state.is_open and vim.api.nvim_win_is_valid(terminal_state.win) then
- vim.api.nvim_win_close(terminal_state.win, false)
- terminal_state.is_open = false
- end
+ if terminal_state.is_open and vim.api.nvim_win_is_valid(terminal_state.win) then
+ vim.api.nvim_win_close(terminal_state.win, false)
+ terminal_state.is_open = false
+ end
end
-- Key mappings
vim.keymap.set(
- "n",
- "<leader>t",
- FloatingTerminal,
- { noremap = true, silent = true, desc = "Toggle floating terminal" }
+ "n",
+ "<leader>t",
+ FloatingTerminal,
+ { noremap = true, silent = true, desc = "Toggle floating terminal" }
)
vim.keymap.set("t", "<Esc>", function()
- if terminal_state.is_open then
- vim.api.nvim_win_close(terminal_state.win, false)
- terminal_state.is_open = false
- end
+ if terminal_state.is_open then
+ vim.api.nvim_win_close(terminal_state.win, false)
+ terminal_state.is_open = false
+ end
end, { noremap = true, silent = true, desc = "Close floating terminal from terminal mode" })
diff --git a/home/nvim/keymaps.lua b/home/nvim/keymaps.lua
index d8907bf..0e00e4b 100644
--- a/home/nvim/keymaps.lua
+++ b/home/nvim/keymaps.lua
@@ -24,10 +24,10 @@ vim.keymap.set({ "n", "x" }, "gp", '"+p', { desc = "Paste clipboard text" })
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
vim.keymap.set(
- "n",
- "<leader>q",
- vim.diagnostic.setloclist,
- { desc = "Open diagnostic [Q]uickfix list" }
+ "n",
+ "<leader>q",
+ vim.diagnostic.setloclist,
+ { desc = "Open diagnostic [Q]uickfix list" }
)
vim.keymap.set("n", "<leader>q", ":bp<bar>sp<bar>bn<bar>bd<CR>", { desc = "Close buffer" })
vim.keymap.set("n", "<leader>Q", ":bd!<CR>", { desc = "Force close buffer" })
@@ -48,38 +48,38 @@ vim.keymap.set("n", "<F8>", "<cmd>DapStepOut<CR>", { desc = "DAP: Step Out" })
vim.keymap.set("n", "<leader>dt", "<cmd>DapTerminate<CR>", { desc = "DAP: Terminate" })
local function tab_complete()
- if vim.fn.pumvisible() == 1 then
- -- navigate to next item in completion menu
- return "<Down>"
- end
+ if vim.fn.pumvisible() == 1 then
+ -- navigate to next item in completion menu
+ return "<Down>"
+ end
- local c = vim.fn.col(".") - 1
- local is_whitespace = c == 0 or vim.fn.getline("."):sub(c, c):match("%s")
+ local c = vim.fn.col(".") - 1
+ local is_whitespace = c == 0 or vim.fn.getline("."):sub(c, c):match("%s")
- if is_whitespace then
- -- insert tab
- return "<Tab>"
- end
+ if is_whitespace then
+ -- insert tab
+ return "<Tab>"
+ end
- local lsp_completion = vim.bo.omnifunc == "v:lua.vim.lsp.omnifunc"
+ local lsp_completion = vim.bo.omnifunc == "v:lua.vim.lsp.omnifunc"
- if lsp_completion then
- -- trigger lsp code completion
- return "<C-x><C-o>"
- end
+ if lsp_completion then
+ -- trigger lsp code completion
+ return "<C-x><C-o>"
+ end
- -- suggest words in current buffer
- return "<C-x><C-n>"
+ -- suggest words in current buffer
+ return "<C-x><C-n>"
end
local function tab_prev()
- if vim.fn.pumvisible() == 1 then
- -- navigate to previous item in completion menu
- return "<Up>"
- end
+ if vim.fn.pumvisible() == 1 then
+ -- navigate to previous item in completion menu
+ return "<Up>"
+ end
- -- insert tab
- return "<Tab>"
+ -- insert tab
+ return "<Tab>"
end
vim.keymap.set("i", "<Tab>", tab_complete, { expr = true })
diff --git a/home/nvim/lsp.lua b/home/nvim/lsp.lua
index 97037c6..15d463d 100644
--- a/home/nvim/lsp.lua
+++ b/home/nvim/lsp.lua
@@ -3,306 +3,306 @@ vim.lsp.set_log_level(vim.log.levels.WARN)
vim.lsp.log.set_format_func(vim.inspect)
vim.diagnostic.config({
- virtual_text = true,
- virtual_lines = { current_line = true },
- underline = true,
- update_in_insert = false,
- severity_sort = true,
- float = {
- border = "rounded",
- source = true,
- },
- signs = {
- text = {
- [vim.diagnostic.severity.ERROR] = "󰅚 ",
- [vim.diagnostic.severity.WARN] = "󰀪 ",
- [vim.diagnostic.severity.INFO] = "󰋽 ",
- [vim.diagnostic.severity.HINT] = "󰌶 ",
- },
- numhl = {
- [vim.diagnostic.severity.ERROR] = "ErrorMsg",
- [vim.diagnostic.severity.WARN] = "WarningMsg",
- },
- },
+ virtual_text = true,
+ virtual_lines = { current_line = true },
+ underline = true,
+ update_in_insert = false,
+ severity_sort = true,
+ float = {
+ border = "rounded",
+ source = true,
+ },
+ signs = {
+ text = {
+ [vim.diagnostic.severity.ERROR] = "󰅚 ",
+ [vim.diagnostic.severity.WARN] = "󰀪 ",
+ [vim.diagnostic.severity.INFO] = "󰋽 ",
+ [vim.diagnostic.severity.HINT] = "󰌶 ",
+ },
+ numhl = {
+ [vim.diagnostic.severity.ERROR] = "ErrorMsg",
+ [vim.diagnostic.severity.WARN] = "WarningMsg",
+ },
+ },
})
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend("force", capabilities, {
- textDocument = {
- inlayHint = {
- dynamicRegistration = false, -- Static registration
- resolveSupport = {
- properties = { "textEdits", "tooltip", "label" }, -- Resolve additional hint details
- },
- },
- synchronization = {
- dynamicRegistration = false, -- Static registration
- willSave = true, -- Notify server before saving
- willSaveWaitUntil = true, -- Allow server to provide edits before saving
- didSave = true, -- Notify server after saving
- },
- hover = {
- dynamicRegistration = false, -- Static registration
- contentFormat = { "markdown", "plaintext" }, -- Prefer markdown, fallback to plaintext
- },
- documentSymbol = {
- dynamicRegistration = false, -- Static registration
- hierarchicalDocumentSymbolSupport = true, -- Support nested symbols
- symbolKind = {
- valueSet = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- }, -- All standard symbol kinds (file, module, namespace, etc.)
- },
- },
- completion = {
- completionItem = {
- snippetSupport = true,
- preselectSupport = true,
- insertReplaceSupport = true,
- labelDetailsSupport = true,
- deprecatedSupport = true,
- commitCharactersSupport = true,
- tagSupport = { valueSet = { 1 } },
- resolveSupport = {
- properties = { "documentation", "detail", "additionalTextEdits" },
- },
- },
- },
- diagnostic = {
- documentDiagnosticProvider = true, -- Enable document-level diagnostics
- relatedInformation = true, -- Show related diagnostic information
- tagSupport = { valueSet = { 1, 2 } }, -- Support deprecated (1) and unused (2) tags
- dataSupport = true, -- Allow custom data in diagnostics
- },
- semanticTokens = {
- multilineTokenSupport = true,
- overlappingTokenSupport = true,
- augmentsSyntaxTokens = true,
- },
- foldingRange = {
- dynamicRegistration = false,
- lineFoldingOnly = true,
- },
- },
- workspace = {
- configuration = true,
- workspaceFolders = true,
- didChangeWatchedFiles = {
- dynamicRegistration = true,
- },
- fileOperations = {
- didRename = true,
- willRename = true,
- didDelete = true,
- didCreate = true,
- },
- symbol = {
- dynamicRegistration = false, -- Static registration
- symbolKind = {
- valueSet = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- }, -- All standard symbol kinds
- },
- },
- diagnostic = {
- workspaceDiagnosticsProvider = true, -- Enable workspace-level diagnostics
- },
- },
+ textDocument = {
+ inlayHint = {
+ dynamicRegistration = false, -- Static registration
+ resolveSupport = {
+ properties = { "textEdits", "tooltip", "label" }, -- Resolve additional hint details
+ },
+ },
+ synchronization = {
+ dynamicRegistration = false, -- Static registration
+ willSave = true, -- Notify server before saving
+ willSaveWaitUntil = true, -- Allow server to provide edits before saving
+ didSave = true, -- Notify server after saving
+ },
+ hover = {
+ dynamicRegistration = false, -- Static registration
+ contentFormat = { "markdown", "plaintext" }, -- Prefer markdown, fallback to plaintext
+ },
+ documentSymbol = {
+ dynamicRegistration = false, -- Static registration
+ hierarchicalDocumentSymbolSupport = true, -- Support nested symbols
+ symbolKind = {
+ valueSet = {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ }, -- All standard symbol kinds (file, module, namespace, etc.)
+ },
+ },
+ completion = {
+ completionItem = {
+ snippetSupport = true,
+ preselectSupport = true,
+ insertReplaceSupport = true,
+ labelDetailsSupport = true,
+ deprecatedSupport = true,
+ commitCharactersSupport = true,
+ tagSupport = { valueSet = { 1 } },
+ resolveSupport = {
+ properties = { "documentation", "detail", "additionalTextEdits" },
+ },
+ },
+ },
+ diagnostic = {
+ documentDiagnosticProvider = true, -- Enable document-level diagnostics
+ relatedInformation = true, -- Show related diagnostic information
+ tagSupport = { valueSet = { 1, 2 } }, -- Support deprecated (1) and unused (2) tags
+ dataSupport = true, -- Allow custom data in diagnostics
+ },
+ semanticTokens = {
+ multilineTokenSupport = true,
+ overlappingTokenSupport = true,
+ augmentsSyntaxTokens = true,
+ },
+ foldingRange = {
+ dynamicRegistration = false,
+ lineFoldingOnly = true,
+ },
+ },
+ workspace = {
+ configuration = true,
+ workspaceFolders = true,
+ didChangeWatchedFiles = {
+ dynamicRegistration = true,
+ },
+ fileOperations = {
+ didRename = true,
+ willRename = true,
+ didDelete = true,
+ didCreate = true,
+ },
+ symbol = {
+ dynamicRegistration = false, -- Static registration
+ symbolKind = {
+ valueSet = {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ }, -- All standard symbol kinds
+ },
+ },
+ diagnostic = {
+ workspaceDiagnosticsProvider = true, -- Enable workspace-level diagnostics
+ },
+ },
})
vim.lsp.config("*", {
- capabilities = capabilities,
- root_markers = { ".git" },
+ capabilities = capabilities,
+ root_markers = { ".git" },
})
vim.lsp.config("lua_ls", {
- cmd = { "lua-language-server" },
- filetypes = { "lua" },
- root_markers = { ".luarc.json", ".luarc.jsonc" },
- single_file_support = true,
- settings = {
- Lua = {
- format = {
- enable = true,
- defaultConfig = {
- indent_size = 1,
- indent_style = "tab",
- max_line_length = 120,
- quote_style = "double"
- },
- },
- runtime = { version = "LuaJIT" },
- diagnostics = {
- globals = { "vim", "luassert", "luv" },
- },
- workspace = {
- checkThirdParty = true,
- library = vim.api.nvim_get_runtime_file("", true),
- },
- telemetry = { enable = false },
- hint = {
- enable = true,
- setType = true,
- paramType = true,
- paramName = "All",
- },
- },
- },
+ cmd = { "lua-language-server" },
+ filetypes = { "lua" },
+ root_markers = { ".luarc.json", ".luarc.jsonc" },
+ single_file_support = true,
+ settings = {
+ Lua = {
+ format = {
+ enable = true,
+ defaultConfig = {
+ indent_size = 1,
+ indent_style = "tab",
+ max_line_length = 120,
+ quote_style = "double"
+ },
+ },
+ runtime = { version = "LuaJIT" },
+ diagnostics = {
+ globals = { "vim", "luassert", "luv" },
+ },
+ workspace = {
+ checkThirdParty = true,
+ library = vim.api.nvim_get_runtime_file("", true),
+ },
+ telemetry = { enable = false },
+ hint = {
+ enable = true,
+ setType = true,
+ paramType = true,
+ paramName = "All",
+ },
+ },
+ },
})
vim.lsp.config("nil_ls", {
- cmd = { "nil" },
- root_markers = { "flake.nix" },
- filetypes = { "nix" },
- settings = {
- ["nil"] = {
- formatting = { command = { "nixfmt", "-s" } },
- },
- },
+ cmd = { "nil" },
+ root_markers = { "flake.nix" },
+ filetypes = { "nix" },
+ settings = {
+ ["nil"] = {
+ formatting = { command = { "nixfmt", "-s" } },
+ },
+ },
})
vim.lsp.config("ts_ls", {
- cmd = { "typescript-language-server", "--stdio" },
- root_markers = { ".editorconfig", "jsconfig.json" },
- filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue" },
- init_options = {
- preferences = {
- disableSuggestions = false,
- includeCompletionsForModuleExports = true,
- },
- },
- capabilities = {
- textDocument = {
- formatting = false,
- },
- },
- on_attach = function(client, bufnr)
- client.server_capabilities.documentFormattingProvider = false
- client.server_capabilities.documentRangeFormattingProvider = false
- end,
+ cmd = { "typescript-language-server", "--stdio" },
+ root_markers = { ".editorconfig", "jsconfig.json" },
+ filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue" },
+ init_options = {
+ preferences = {
+ disableSuggestions = false,
+ includeCompletionsForModuleExports = true,
+ },
+ },
+ capabilities = {
+ textDocument = {
+ formatting = false,
+ },
+ },
+ on_attach = function(client, bufnr)
+ client.server_capabilities.documentFormattingProvider = false
+ client.server_capabilities.documentRangeFormattingProvider = false
+ end,
})
vim.lsp.config("ruff", {
- cmd = { "ruff", "server" },
- root_markers = { "pyproject.toml" },
- filetypes = { "python" },
- init_options = {
- settings = {
- configurationPreference = "filesystemFirst",
- fixAll = true,
- lineLength = 100,
- lint = { enable = true },
- organizeImports = true,
- },
- },
+ cmd = { "ruff", "server" },
+ root_markers = { "pyproject.toml" },
+ filetypes = { "python" },
+ init_options = {
+ settings = {
+ configurationPreference = "filesystemFirst",
+ fixAll = true,
+ lineLength = 100,
+ lint = { enable = true },
+ organizeImports = true,
+ },
+ },
})
vim.lsp.config("dprint", {
- cmd = { "dprint", "lsp" },
- filetypes = { "toml", "yaml", "markdown", "css" },
- settings = {},
+ cmd = { "dprint", "lsp" },
+ filetypes = { "toml", "yaml", "markdown", "css" },
+ settings = {},
})
vim.lsp.config("clangd", {
- cmd = { "clangd" },
- filetypes = { "c", "cpp" },
- root_markers = {
- ".clangd", ".git"
- },
+ cmd = { "clangd" },
+ filetypes = { "c", "cpp" },
+ root_markers = {
+ ".clangd", ".git"
+ },
})
vim.lsp.config("vale_ls", {
- cmd = { "vale-ls" },
- filetypes = { "markdown", "text", "tex", "rst", "adoc", "asciidoc" },
- root_markers = { ".vale.ini" },
+ cmd = { "vale-ls" },
+ filetypes = { "markdown", "text", "tex", "rst", "adoc", "asciidoc" },
+ root_markers = { ".vale.ini" },
})
vim.lsp.config("ty", {
- cmd = { "ty", "server" },
- root_markers = { "pyproject.toml" },
- filetypes = { "python" },
- settings = {
- ty = {
- diagnosticMode = "workspace",
- experimental = {
- rename = true,
- autoImport = true,
- completions = true,
- },
- },
- },
+ cmd = { "ty", "server" },
+ root_markers = { "pyproject.toml" },
+ filetypes = { "python" },
+ settings = {
+ ty = {
+ diagnosticMode = "workspace",
+ experimental = {
+ rename = true,
+ autoImport = true,
+ completions = true,
+ },
+ },
+ },
})
vim.lsp.config("rust_analyzer", {
- cmd = { "rust-analyzer" },
- root_markers = { "Cargo.toml" },
- filetypes = { "rust" },
- settings = {
- ["rust-analyzer"] = {
- check = {
- command = "clippy",
- },
- },
- },
+ cmd = { "rust-analyzer" },
+ root_markers = { "Cargo.toml" },
+ filetypes = { "rust" },
+ settings = {
+ ["rust-analyzer"] = {
+ check = {
+ command = "clippy",
+ },
+ },
+ },
})
vim.lsp.config("biome", {
- cmd = { "biome", "lsp-proxy" },
- workspace_required = true,
- filetypes = {
- "graphql",
- "javascript",
- "json",
- "html"
- },
- root_markers = { "biome.json" },
- capabilities = {
- textDocument = {
- formatting = {
- dynamicRegistration = false,
- },
- },
- },
- single_file_support = false
+ cmd = { "biome", "lsp-proxy" },
+ workspace_required = true,
+ filetypes = {
+ "graphql",
+ "javascript",
+ "json",
+ "html"
+ },
+ root_markers = { "biome.json" },
+ capabilities = {
+ textDocument = {
+ formatting = {
+ dynamicRegistration = false,
+ },
+ },
+ },
+ single_file_support = false
})
vim.lsp.config("gopls", {
- cmd = { "gopls" },
- root_markers = { "go.mod" },
- filetypes = { "go", "gomod", "gowork", "gotmpl" },
- settings = {
- gopls = {
- analyses = {
- unusedparams = true,
- },
- staticcheck = true,
- },
- },
+ cmd = { "gopls" },
+ root_markers = { "go.mod" },
+ filetypes = { "go", "gomod", "gowork", "gotmpl" },
+ settings = {
+ gopls = {
+ analyses = {
+ unusedparams = true,
+ },
+ staticcheck = true,
+ },
+ },
})
vim.lsp.config("bashls", {
- cmd = { "bash-language-server", "start" },
- filetypes = { "sh" },
+ cmd = { "bash-language-server", "start" },
+ filetypes = { "sh" },
})
vim.lsp.config("texlab", {
- cmd = { "texlab" },
- filetypes = { "tex", "plaintex", "bib" },
+ cmd = { "texlab" },
+ filetypes = { "tex", "plaintex", "bib" },
})
vim.lsp.enable({
- "bashls",
- "biome",
- "clangd",
- "dprint",
- "gopls",
- "lua_ls",
- "nil_ls",
- "ruff",
- "rust_analyzer",
- "texlab",
- "ts_ls",
- "ty",
- "vale_ls",
+ "bashls",
+ "biome",
+ "clangd",
+ "dprint",
+ "gopls",
+ "lua_ls",
+ "nil_ls",
+ "ruff",
+ "rust_analyzer",
+ "texlab",
+ "ts_ls",
+ "ty",
+ "vale_ls",
})
diff --git a/home/nvim/options.lua b/home/nvim/options.lua
index 109c9b5..4795bac 100644
--- a/home/nvim/options.lua
+++ b/home/nvim/options.lua
@@ -1,5 +1,5 @@
vim.schedule(function()
- vim.opt.clipboard = "unnamedplus"
+ vim.opt.clipboard = "unnamedplus"
end)
vim.g.have_nerd_fonts = true
@@ -7,15 +7,15 @@ vim.g.have_nerd_fonts = true
vim.o.fileencoding = "utf-8"
vim.o.mouse = "a" -- turn on mouse interaction
vim.o.shell = "nushell"
-vim.o.signcolumn = true
+vim.o.signcolumn = "yes"
vim.o.termguicolors = true -- Enable GUI colors for the terminal to get truecolor
vim.opt.conceallevel = 0
vim.opt.title = true -- set the title of window to the value of the titlestring
vim.opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to
vim.o.guicursor = table.concat({
- "n-v-c:block-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",
- "i-ci:ver25-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",
- "r:hor50-Cursor/lCursor-blinkwait100-blinkon100-blinkoff100",
+ "n-v-c:block-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",
+ "i-ci:ver25-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",
+ "r:hor50-Cursor/lCursor-blinkwait100-blinkon100-blinkoff100",
}, ",")
vim.o.autoindent = true
diff --git a/home/nvim/plugins/dap.lua b/home/nvim/plugins/dap.lua
index c20ae36..8a37318 100644
--- a/home/nvim/plugins/dap.lua
+++ b/home/nvim/plugins/dap.lua
@@ -1,128 +1,128 @@
-- Store DAP configuration in a function to load on demand
local function setup_dap()
- local dap = require("dap")
- local dapview = require("dap-view")
- local dapvt = require("nvim-dap-virtual-text")
+ local dap = require("dap")
+ local dapview = require("dap-view")
+ local dapvt = require("nvim-dap-virtual-text")
- dapview.setup({})
+ dapview.setup({})
- dapvt.setup {
- enabled = true,
- enabled_commands = true,
- highlight_changed_variables = true,
- highlight_new_as_changed = false,
- show_stop_reason = true,
- commented = false,
- only_first_definition = true,
- all_references = false,
- clear_on_continue = false,
- display_callback = function(variable, buf, stackframe, node, options)
- if options.virt_text_pos == "inline" then
- return " = " .. variable.value:gsub("%s+", " ")
- else
- return variable.name .. " = " .. variable.value:gsub("%s+", " ")
- end
- end,
- all_frames = true,
- virt_lines = true,
- virt_text_win_col = nil,
- }
+ dapvt.setup {
+ enabled = true,
+ enabled_commands = true,
+ highlight_changed_variables = true,
+ highlight_new_as_changed = false,
+ show_stop_reason = true,
+ commented = false,
+ only_first_definition = true,
+ all_references = false,
+ clear_on_continue = false,
+ display_callback = function(variable, buf, stackframe, node, options)
+ if options.virt_text_pos == "inline" then
+ return " = " .. variable.value:gsub("%s+", " ")
+ else
+ return variable.name .. " = " .. variable.value:gsub("%s+", " ")
+ end
+ end,
+ all_frames = true,
+ virt_lines = true,
+ virt_text_win_col = nil,
+ }
- -- === PYTHON ===
- dap.adapters.python = {
- type = "executable",
- command = "python",
- args = { "-m", "debugpy.adapter" },
- }
- dap.configurations.python = {
- {
- type = "python",
- request = "launch",
- name = "Launch file",
- program = "${file}",
- console = "integratedTerminal",
- justMyCode = true,
- },
- {
- type = "python",
- request = "attach",
- name = "Attach to process",
- connect = { host = "127.0.0.1", port = 5678 },
- },
- }
+ -- === PYTHON ===
+ dap.adapters.python = {
+ type = "executable",
+ command = "python",
+ args = { "-m", "debugpy.adapter" },
+ }
+ dap.configurations.python = {
+ {
+ type = "python",
+ request = "launch",
+ name = "Launch file",
+ program = "${file}",
+ console = "integratedTerminal",
+ justMyCode = true,
+ },
+ {
+ type = "python",
+ request = "attach",
+ name = "Attach to process",
+ connect = { host = "127.0.0.1", port = 5678 },
+ },
+ }
- -- === RUST ===
- dap.adapters.lldb = {
- type = "executable",
- command = "lldb-dap",
- name = "lldb",
- }
- dap.configurations.rust = {
- {
- name = "Launch (LLDB)",
- type = "lldb",
- request = "launch",
- program = function()
- return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/target/debug/", "file")
- end,
- cwd = "${workspaceFolder}",
- stopOnEntry = false,
- args = {},
- runInTerminal = false,
- },
- {
- name = "Attach to process (LLDB)",
- type = "lldb",
- request = "attach",
- pid = require("dap.utils").pick_process,
- args = {},
- },
- }
+ -- === RUST ===
+ dap.adapters.lldb = {
+ type = "executable",
+ command = "lldb-dap",
+ name = "lldb",
+ }
+ dap.configurations.rust = {
+ {
+ name = "Launch (LLDB)",
+ type = "lldb",
+ request = "launch",
+ program = function()
+ return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/target/debug/", "file")
+ end,
+ cwd = "${workspaceFolder}",
+ stopOnEntry = false,
+ args = {},
+ runInTerminal = false,
+ },
+ {
+ name = "Attach to process (LLDB)",
+ type = "lldb",
+ request = "attach",
+ pid = require("dap.utils").pick_process,
+ args = {},
+ },
+ }
- -- === GO ===
- dap.adapters.go = {
- type = "executable",
- command = "dlv",
- args = { "dap" },
- }
- dap.configurations.go = {
- { type = "go", name = "Debug main.go", request = "launch", program = "${file}" },
- { type = "go", name = "Debug package", request = "launch", program = "${workspaceFolder}" },
- { type = "go", name = "Attach to process", request = "attach", processId = require("dap.utils").pick_process },
- }
+ -- === GO ===
+ dap.adapters.go = {
+ type = "executable",
+ command = "dlv",
+ args = { "dap" },
+ }
+ dap.configurations.go = {
+ { type = "go", name = "Debug main.go", request = "launch", program = "${file}" },
+ { type = "go", name = "Debug package", request = "launch", program = "${workspaceFolder}" },
+ { type = "go", name = "Attach to process", request = "attach", processId = require("dap.utils").pick_process },
+ }
- -- === EVENT LISTENERS ===
- dap.listeners.after.event_initialized["dapview_config"] = function() dapview.open() end
- dap.listeners.before.event_terminated["dapview_config"] = function() dapview.close() end
- dap.listeners.before.event_exited["dapview_config"] = function() dapview.close() end
+ -- === EVENT LISTENERS ===
+ dap.listeners.after.event_initialized["dapview_config"] = function() dapview.open() end
+ dap.listeners.before.event_terminated["dapview_config"] = function() dapview.close() end
+ dap.listeners.before.event_exited["dapview_config"] = function() dapview.close() end
end
-- Define custom commands to trigger DAP setup
local function define_dap_commands()
- vim.api.nvim_create_user_command("DapContinue", function()
- setup_dap()
- require("dap").continue()
- end, {})
- vim.api.nvim_create_user_command("DapToggleBreakpoint", function()
- setup_dap()
- require("dap").toggle_breakpoint()
- end, {})
- vim.api.nvim_create_user_command("DapStepOver", function()
- setup_dap()
- require("dap").step_over()
- end, {})
- vim.api.nvim_create_user_command("DapStepInto", function()
- setup_dap()
- require("dap").step_into()
- end, {})
- vim.api.nvim_create_user_command("DapStepOut", function()
- setup_dap()
- require("dap").step_out()
- end, {})
- vim.api.nvim_create_user_command("DapTerminate", function()
- setup_dap()
- require("dap").terminate()
- end, {})
+ vim.api.nvim_create_user_command("DapContinue", function()
+ setup_dap()
+ require("dap").continue()
+ end, {})
+ vim.api.nvim_create_user_command("DapToggleBreakpoint", function()
+ setup_dap()
+ require("dap").toggle_breakpoint()
+ end, {})
+ vim.api.nvim_create_user_command("DapStepOver", function()
+ setup_dap()
+ require("dap").step_over()
+ end, {})
+ vim.api.nvim_create_user_command("DapStepInto", function()
+ setup_dap()
+ require("dap").step_into()
+ end, {})
+ vim.api.nvim_create_user_command("DapStepOut", function()
+ setup_dap()
+ require("dap").step_out()
+ end, {})
+ vim.api.nvim_create_user_command("DapTerminate", function()
+ setup_dap()
+ require("dap").terminate()
+ end, {})
end
-- Create autocommand group for DAP
@@ -130,18 +130,18 @@ local augroup = vim.api.nvim_create_augroup("DapLazyLoad", { clear = true })
-- Load DAP on filetypes
vim.api.nvim_create_autocmd("FileType", {
- group = augroup,
- pattern = { "python", "rust", "go" },
- callback = function()
- define_dap_commands()
- end,
+ group = augroup,
+ pattern = { "python", "rust", "go" },
+ callback = function()
+ define_dap_commands()
+ end,
})
-- Load DAP on specific commands
vim.api.nvim_create_autocmd("CmdUndefined", {
- group = augroup,
- pattern = { "DapContinue", "DapToggleBreakpoint", "DapStepOver", "DapStepInto", "DapStepOut", "DapTerminate" },
- callback = function()
- define_dap_commands()
- end,
+ group = augroup,
+ pattern = { "DapContinue", "DapToggleBreakpoint", "DapStepOver", "DapStepInto", "DapStepOut", "DapTerminate" },
+ callback = function()
+ define_dap_commands()
+ end,
})
diff --git a/home/nvim/plugins/mini.lua b/home/nvim/plugins/mini.lua
index f41f1b4..75a3912 100644
--- a/home/nvim/plugins/mini.lua
+++ b/home/nvim/plugins/mini.lua
@@ -9,6 +9,6 @@ require("mini.sessions").setup()
require("mini.starter").setup()
require("mini.statusline").setup()
require("mini.tabline").setup({
- show_icons = true
+ show_icons = true
})
require("mini.completion").setup()
diff --git a/home/nvim/plugins/treesitter.lua b/home/nvim/plugins/treesitter.lua
index 314e4a3..0b688ec 100644
--- a/home/nvim/plugins/treesitter.lua
+++ b/home/nvim/plugins/treesitter.lua
@@ -1,81 +1,81 @@
local function disable(lang, buf)
- local max_filesize = 100 * 1024 -- 100 KB
- local ok, stats = pcall(vim.uv.fs_stat, vim.api.nvim_buf_get_name(buf))
- if ok and stats and stats.size > max_filesize then
- return true
- end
+ local max_filesize = 100 * 1024 -- 100 KB
+ local ok, stats = pcall(vim.uv.fs_stat, vim.api.nvim_buf_get_name(buf))
+ if ok and stats and stats.size > max_filesize then
+ return true
+ end
end
require("nvim-treesitter").setup({
- auto_install = false,
- ensure_installed = {},
- ignore_install = {},
- modules = {},
- sync_install = false,
- highlight = {
- additional_vim_regex_highlighting = false,
- disable = disable,
- enable = true,
- },
- indent = { enable = true, disable = { "rust", "lua", "python", "golang", "nix", "json", "html", "javascript" } },
- incremental_selection = {
- enable = true,
- keymaps = {
- init_selection = "<leader>vv",
- node_decremental = "_",
- node_incremental = "+",
- scope_incremental = false,
- },
- },
- textobjects = {
- select = {
- enable = true,
- lookahead = true,
- keymaps = {
- -- You can use the capture groups defined in textobjects.scm
- ["af"] = { query = "@function.outer", desc = "around a function" },
- ["if"] = { query = "@function.inner", desc = "inner part of a function" },
- ["ac"] = { query = "@class.outer", desc = "around a class" },
- ["ic"] = { query = "@class.inner", desc = "inner part of a class" },
- ["ai"] = { query = "@conditional.outer", desc = "around an if statement" },
- ["ii"] = { query = "@conditional.inner", desc = "inner part of an if statement" },
- ["al"] = { query = "@loop.outer", desc = "around a loop" },
- ["il"] = { query = "@loop.inner", desc = "inner part of a loop" },
- ["ap"] = { query = "@parameter.outer", desc = "around parameter" },
- ["ip"] = { query = "@parameter.inner", desc = "inside a parameter" },
- },
- selection_modes = {
- ["@parameter.outer"] = "v", -- charwise
- ["@parameter.inner"] = "v", -- charwise
- ["@function.outer"] = "v", -- charwise
- ["@conditional.outer"] = "V", -- linewise
- ["@loop.outer"] = "V", -- linewise
- ["@class.outer"] = "<c-v>", -- blockwise
- },
- include_surrounding_whitespace = false,
- },
- move = {
- enable = true,
- set_jumps = true, -- whether to set jumps in the jumplist
- goto_previous_start = {
- ["[f"] = { query = "@function.outer", desc = "Previous function" },
- ["[c"] = { query = "@class.outer", desc = "Previous class" },
- ["[p"] = { query = "@parameter.inner", desc = "Previous parameter" },
- },
- goto_next_start = {
- ["]f"] = { query = "@function.outer", desc = "Next function" },
- ["]c"] = { query = "@class.outer", desc = "Next class" },
- ["]p"] = { query = "@parameter.inner", desc = "Next parameter" },
- },
- },
- swap = {
- enable = true,
- swap_next = {
- ["<leader>a"] = "@parameter.inner",
- },
- swap_previous = {
- ["<leader>A"] = "@parameter.inner",
- },
- },
- },
+ auto_install = false,
+ ensure_installed = {},
+ ignore_install = {},
+ modules = {},
+ sync_install = false,
+ highlight = {
+ additional_vim_regex_highlighting = false,
+ disable = disable,
+ enable = true,
+ },
+ indent = { enable = true, disable = { "rust", "lua", "python", "golang", "nix", "json", "html", "javascript" } },
+ incremental_selection = {
+ enable = true,
+ keymaps = {
+ init_selection = "<leader>vv",
+ node_decremental = "_",
+ node_incremental = "+",
+ scope_incremental = false,
+ },
+ },
+ textobjects = {
+ select = {
+ enable = true,
+ lookahead = true,
+ keymaps = {
+ -- You can use the capture groups defined in textobjects.scm
+ ["af"] = { query = "@function.outer", desc = "around a function" },
+ ["if"] = { query = "@function.inner", desc = "inner part of a function" },
+ ["ac"] = { query = "@class.outer", desc = "around a class" },
+ ["ic"] = { query = "@class.inner", desc = "inner part of a class" },
+ ["ai"] = { query = "@conditional.outer", desc = "around an if statement" },
+ ["ii"] = { query = "@conditional.inner", desc = "inner part of an if statement" },
+ ["al"] = { query = "@loop.outer", desc = "around a loop" },
+ ["il"] = { query = "@loop.inner", desc = "inner part of a loop" },
+ ["ap"] = { query = "@parameter.outer", desc = "around parameter" },
+ ["ip"] = { query = "@parameter.inner", desc = "inside a parameter" },
+ },
+ selection_modes = {
+ ["@parameter.outer"] = "v", -- charwise
+ ["@parameter.inner"] = "v", -- charwise
+ ["@function.outer"] = "v", -- charwise
+ ["@conditional.outer"] = "V", -- linewise
+ ["@loop.outer"] = "V", -- linewise
+ ["@class.outer"] = "<c-v>", -- blockwise
+ },
+ include_surrounding_whitespace = false,
+ },
+ move = {
+ enable = true,
+ set_jumps = true, -- whether to set jumps in the jumplist
+ goto_previous_start = {
+ ["[f"] = { query = "@function.outer", desc = "Previous function" },
+ ["[c"] = { query = "@class.outer", desc = "Previous class" },
+ ["[p"] = { query = "@parameter.inner", desc = "Previous parameter" },
+ },
+ goto_next_start = {
+ ["]f"] = { query = "@function.outer", desc = "Next function" },
+ ["]c"] = { query = "@class.outer", desc = "Next class" },
+ ["]p"] = { query = "@parameter.inner", desc = "Next parameter" },
+ },
+ },
+ swap = {
+ enable = true,
+ swap_next = {
+ ["<leader>a"] = "@parameter.inner",
+ },
+ swap_previous = {
+ ["<leader>A"] = "@parameter.inner",
+ },
+ },
+ },
})