summaryrefslogtreecommitdiff
path: root/lua/config
diff options
context:
space:
mode:
authorbh <qn+git@excalibur.computer>2026-04-09 15:46:00 +0800
committerbh <qn+git@excalibur.computer>2026-04-09 15:46:00 +0800
commit6c81e38e15455fb3074d9d46c94ec2c951b5a382 (patch)
treec103a81c733ff200b4114f3a1caee058c10f374e /lua/config
parent0a67a5614c1716c8ccf46980e13826616aa70c28 (diff)
Fix indentation
Diffstat (limited to 'lua/config')
-rw-r--r--lua/config/colorpicker.lua22
-rw-r--r--lua/config/completion.lua118
-rw-r--r--lua/config/dashboard.lua148
-rw-r--r--lua/config/hex.lua30
-rw-r--r--lua/config/indent.lua69
-rw-r--r--lua/config/lazy.lua40
-rw-r--r--lua/config/lsp.lua208
-rw-r--r--lua/config/luasnip.lua54
-rw-r--r--lua/config/statusline.lua140
-rw-r--r--lua/config/tabs.lua134
-rw-r--r--lua/config/tree.lua44
-rw-r--r--lua/config/treesitter.lua132
-rw-r--r--lua/config/vimtex.lua68
13 files changed, 603 insertions, 604 deletions
diff --git a/lua/config/colorpicker.lua b/lua/config/colorpicker.lua
index 39772be..f489b9c 100644
--- a/lua/config/colorpicker.lua
+++ b/lua/config/colorpicker.lua
@@ -1,16 +1,16 @@
return function()
- -- Enable true color
- vim.opt.termguicolors = true
+ -- Enable true color
+ vim.opt.termguicolors = true
- local ccc = require("ccc")
- local mapping = ccc.mapping
+ local ccc = require("ccc")
+ local mapping = ccc.mapping
- ccc.setup({
- highlighter = {
- auto_enable = true,
- lsp = true,
- },
- -- add other options here
- })
+ ccc.setup({
+ highlighter = {
+ auto_enable = true,
+ lsp = true,
+ },
+ -- add other options here
+ })
end
diff --git a/lua/config/completion.lua b/lua/config/completion.lua
index 9d737db..6f32cdc 100644
--- a/lua/config/completion.lua
+++ b/lua/config/completion.lua
@@ -1,65 +1,65 @@
-- return a function for lazy.nvim
return function()
- local cmp = require("cmp")
- local luasnip = require("luasnip")
- local lspkind = require("lspkind")
+ local cmp = require("cmp")
+ local luasnip = require("luasnip")
+ local lspkind = require("lspkind")
- -- load friendly-snippets
- require("luasnip.loaders.from_vscode").lazy_load()
+ -- load friendly-snippets
+ require("luasnip.loaders.from_vscode").lazy_load()
- cmp.setup({
- snippet = {
- expand = function(args)
- luasnip.lsp_expand(args.body)
- end,
- },
- mapping = cmp.mapping.preset.insert({
- ["<C-b>"] = cmp.mapping.scroll_docs(-4),
- ["<C-f>"] = cmp.mapping.scroll_docs(4),
- ["<C-Space>"] = cmp.mapping.complete(), -- manual trigger
- ["<CR>"] = cmp.mapping.confirm({ select = true }),
- ["<Tab>"] = cmp.mapping(function(fallback)
- if cmp.visible() then
- cmp.select_next_item()
- elseif luasnip.expand_or_jumpable() then
- luasnip.expand_or_jump()
- else
- fallback()
- end
- end, { "i", "s" }),
- ["<S-Tab>"] = cmp.mapping(function(fallback)
- if cmp.visible() then
- cmp.select_prev_item()
- elseif luasnip.jumpable(-1) then
- luasnip.jump(-1)
- else
- fallback()
- end
- end, { "i", "s" }),
- }),
- sources = cmp.config.sources({
- { name = "nvim_lsp" },
- { name = "path" },
- { name = "luasnip" },
- }, {
- { name = "buffer" },
- }),
- formatting = {
- format = lspkind.cmp_format({ with_text = true, maxwidth = 50 }),
- },
- window = {
- completion = cmp.config.window.bordered({
- border = "rounded",
- winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
- }),
- documentation = cmp.config.window.bordered({
- border = "rounded",
- winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
- }),
- },
- completion = {
- autocomplete = false, -- only trigger with <C-Space>
- },
- })
+ cmp.setup({
+ snippet = {
+ expand = function(args)
+ luasnip.lsp_expand(args.body)
+ end,
+ },
+ mapping = cmp.mapping.preset.insert({
+ ["<C-b>"] = cmp.mapping.scroll_docs(-4),
+ ["<C-f>"] = cmp.mapping.scroll_docs(4),
+ ["<C-Space>"] = cmp.mapping.complete(), -- manual trigger
+ ["<CR>"] = cmp.mapping.confirm({ select = true }),
+ ["<Tab>"] = cmp.mapping(function(fallback)
+ if cmp.visible() then
+ cmp.select_next_item()
+ elseif luasnip.expand_or_jumpable() then
+ luasnip.expand_or_jump()
+ else
+ fallback()
+ end
+ end, { "i", "s" }),
+ ["<S-Tab>"] = cmp.mapping(function(fallback)
+ if cmp.visible() then
+ cmp.select_prev_item()
+ elseif luasnip.jumpable(-1) then
+ luasnip.jump(-1)
+ else
+ fallback()
+ end
+ end, { "i", "s" }),
+ }),
+ sources = cmp.config.sources({
+ { name = "nvim_lsp" },
+ { name = "path" },
+ { name = "luasnip" },
+ }, {
+ { name = "buffer" },
+ }),
+ formatting = {
+ format = lspkind.cmp_format({ with_text = true, maxwidth = 50 }),
+ },
+ window = {
+ completion = cmp.config.window.bordered({
+ border = "rounded",
+ winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
+ }),
+ documentation = cmp.config.window.bordered({
+ border = "rounded",
+ winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
+ }),
+ },
+ completion = {
+ autocomplete = false, -- only trigger with <C-Space>
+ },
+ })
end
diff --git a/lua/config/dashboard.lua b/lua/config/dashboard.lua
index c317a71..3d7b9b3 100644
--- a/lua/config/dashboard.lua
+++ b/lua/config/dashboard.lua
@@ -3,82 +3,82 @@ local db = require("dashboard")
-- Safe fortune function
local function quote()
- local handle = io.popen("fortune -s") -- run fortune
- local result = handle:read("*a") -- read all output
- handle:close()
- -- Remove all newlines and carriage returns
- result = result:gsub("\r",""):gsub("\n"," ")
- return result
+ local handle = io.popen("fortune -s") -- run fortune
+ local result = handle:read("*a") -- read all output
+ handle:close()
+ -- Remove all newlines and carriage returns
+ result = result:gsub("\r",""):gsub("\n"," ")
+ return result
end
db.setup {
- theme = "hyper",
- config = {
- week_header = {
- enable = false -- or true if you want date/time header
- },
- header = {
- " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗",
- " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║",
- " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║",
- " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██╔╝██╔╝██║",
- " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║",
- " ╚═╝ ╚═══╝╚══════╝╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝",
- " ",
- "  " .. os.date("%A, %B %d, %Y"), -- your custom date/day line
- "",
- "[TIP: To exit Vim, use a Sledgehammer!]",
- "" -- optional empty line to separate from center shortcuts
- },
- shortcut = {
- {
- icon = " ",
- desc = "New File",
- key = "n",
- action = "enew"
- },
- {
- icon = " ",
- desc = "Find File",
- key = "f",
- action = "Telescope find_files"
- },
- {
- icon = " ",
- desc = "Recent Files",
- key = "r",
- action = "Telescope oldfiles"
- },
- {
- icon = "󰓢 ",
- desc = "Open Config",
- key = "c",
- action = "edit ~/.config/nvim/"
- },
- {
- icon = "󰣪 ",
- desc = "SLEDGEHAMMER!",
- action = "qa"
- },
- },
- packages = {
- enable = true -- set to true if you want plugin count display
- },
- mru = {
- enable = true, -- set true if you want MRU files
- limit = 10,
- icon = " ",
- label = "Recent",
- cwd_only = false
- },
- project = {
- enable = false, -- set true if you want project list
- limit = 8,
- icon = " ",
- label = "Projects",
- action = "Telescope find_files cwd="
- },
- footer = { "", quote() },
- },
+ theme = "hyper",
+ config = {
+ week_header = {
+ enable = false -- or true if you want date/time header
+ },
+ header = {
+ " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗",
+ " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║",
+ " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║",
+ " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██╔╝██╔╝██║",
+ " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║",
+ " ╚═╝ ╚═══╝╚══════╝╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝",
+ " ",
+ "  " .. os.date("%A, %B %d, %Y"), -- your custom date/day line
+ "",
+ "[TIP: To exit Vim, use a Sledgehammer!]",
+ "" -- optional empty line to separate from center shortcuts
+ },
+ shortcut = {
+ {
+ icon = " ",
+ desc = "New File",
+ key = "n",
+ action = "enew"
+ },
+ {
+ icon = " ",
+ desc = "Find File",
+ key = "f",
+ action = "Telescope find_files"
+ },
+ {
+ icon = " ",
+ desc = "Recent Files",
+ key = "r",
+ action = "Telescope oldfiles"
+ },
+ {
+ icon = "󰓢 ",
+ desc = "Open Config",
+ key = "c",
+ action = "edit ~/.config/nvim/"
+ },
+ {
+ icon = "󰣪 ",
+ desc = "SLEDGEHAMMER!",
+ action = "qa"
+ },
+ },
+ packages = {
+ enable = true -- set to true if you want plugin count display
+ },
+ mru = {
+ enable = true, -- set true if you want MRU files
+ limit = 10,
+ icon = " ",
+ label = "Recent",
+ cwd_only = false
+ },
+ project = {
+ enable = false, -- set true if you want project list
+ limit = 8,
+ icon = " ",
+ label = "Projects",
+ action = "Telescope find_files cwd="
+ },
+ footer = { "", quote() },
+ },
}
end
diff --git a/lua/config/hex.lua b/lua/config/hex.lua
index a743620..4608579 100644
--- a/lua/config/hex.lua
+++ b/lua/config/hex.lua
@@ -2,23 +2,23 @@ return function()
require 'HexEditor'.setup {
- -- cli command used to dump hex data
- dump_cmd = 'xxd -g 1 -u',
+ -- cli command used to dump hex data
+ dump_cmd = 'xxd -g 1 -u',
- -- cli command used to assemble from hex data
- assemble_cmd = 'xxd -r',
-
- -- function that runs on BufReadPre to determine if it's binary or not
- is_buf_binary_pre_read = function()
- -- logic that determines if a buffer contains binary data or not
- -- must return a bool
- end,
+ -- cli command used to assemble from hex data
+ assemble_cmd = 'xxd -r',
+
+ -- function that runs on BufReadPre to determine if it's binary or not
+ is_buf_binary_pre_read = function()
+ -- logic that determines if a buffer contains binary data or not
+ -- must return a bool
+ end,
- -- function that runs on BufReadPost to determine if it's binary or not
- is_buf_binary_post_read = function()
- -- logic that determines if a buffer contains binary data or not
- -- must return a bool
- end,
+ -- function that runs on BufReadPost to determine if it's binary or not
+ is_buf_binary_post_read = function()
+ -- logic that determines if a buffer contains binary data or not
+ -- must return a bool
+ end,
}
end
diff --git a/lua/config/indent.lua b/lua/config/indent.lua
index a73ee1c..af73787 100644
--- a/lua/config/indent.lua
+++ b/lua/config/indent.lua
@@ -1,41 +1,40 @@
-- ~/.config/nvim/lua/config/indent.lua
return function()
- local ibl = require("ibl")
- local hooks = require("ibl.hooks")
+ local ibl = require("ibl")
+ local hooks = require("ibl.hooks")
- -- Define your highlight colors
- local highlight = {
- "RainbowRed",
- "RainbowYellow",
- "RainbowBlue",
- "RainbowOrange",
- "RainbowGreen",
- "RainbowViolet",
- "RainbowCyan",
- }
+ -- Define your highlight colors
+ local highlight = {
+ "RainbowRed",
+ "RainbowYellow",
+ "RainbowBlue",
+ "RainbowOrange",
+ "RainbowGreen",
+ "RainbowViolet",
+ "RainbowCyan",
+ }
- -- Register hook to set highlights (resets on colorscheme change)
- hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
- vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
- vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
- vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
- vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
- vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
- vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
- vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
- end)
+ -- Register hook to set highlights (resets on colorscheme change)
+ hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
+ vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
+ vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
+ vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
+ vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
+ vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
+ vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
+ vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
+ end)
- -- Setup ibl with your highlights
- ibl.setup {
- indent = {
- highlight = highlight,
- char = "│",
- tab_char = "│",
- },
- exclude = {
- filetypes = { "dashboard", "alpha", "help", "neo-tree", "NvimTree", "lazy" },
- buftypes = { "nofile", "terminal" }, -- optional but useful
- },
- }
+ -- Setup ibl with your highlights
+ ibl.setup {
+ indent = {
+ highlight = highlight,
+ char = "│",
+ tab_char = "│",
+ },
+ exclude = {
+ filetypes = { "dashboard", "alpha", "help", "neo-tree", "NvimTree", "lazy" },
+ buftypes = { "nofile", "terminal" }, -- optional but useful
+ },
+ }
end
-
diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua
index 0b93d4e..b9a280f 100644
--- a/lua/config/lazy.lua
+++ b/lua/config/lazy.lua
@@ -1,17 +1,17 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
- local lazyrepo = "https://github.com/folke/lazy.nvim.git"
- local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
- if vim.v.shell_error ~= 0 then
- vim.api.nvim_echo({
- { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
- { out, "WarningMsg" },
- { "\nPress any key to exit..." },
- }, true, {})
- vim.fn.getchar()
- os.exit(1)
- end
+ local lazyrepo = "https://github.com/folke/lazy.nvim.git"
+ local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
+ if vim.v.shell_error ~= 0 then
+ vim.api.nvim_echo({
+ { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
+ { out, "WarningMsg" },
+ { "\nPress any key to exit..." },
+ }, true, {})
+ vim.fn.getchar()
+ os.exit(1)
+ end
end
vim.opt.rtp:prepend(lazypath)
@@ -23,13 +23,13 @@ vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
- spec = {
- -- import your plugins
- { import = "plugins" },
- },
- -- Configure any other settings here. See the documentation for more details.
- -- colorscheme that will be used when installing plugins.
- install = { colorscheme = { "habamax" } },
- -- automatically check for plugin updates
- checker = { enabled = false },
+ spec = {
+ -- import your plugins
+ { import = "plugins" },
+ },
+ -- Configure any other settings here. See the documentation for more details.
+ -- colorscheme that will be used when installing plugins.
+ install = { colorscheme = { "habamax" } },
+ -- automatically check for plugin updates
+ checker = { enabled = false },
})
diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua
index 880a664..67e80eb 100644
--- a/lua/config/lsp.lua
+++ b/lua/config/lsp.lua
@@ -1,118 +1,118 @@
-- ~/.config/nvim/lua/config/lsp.lua
return function()
- -- Shared settings✖
- local cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
- local capabilities = vim.lsp.protocol.make_client_capabilities()
- if cmp_ok then
- capabilities = cmp_nvim_lsp.default_capabilities(capabilities)
- end
+ -- Shared settings✖
+ local cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
+ local capabilities = vim.lsp.protocol.make_client_capabilities()
+ if cmp_ok then
+ capabilities = cmp_nvim_lsp.default_capabilities(capabilities)
+ end
- local on_attach = function(client, bufnr)
- local opts = { noremap = true, silent = true, buffer = bufnr }
- vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
- vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
- vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
- vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
- vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
- -- Normal mode: show diagnostics in a floating window
- vim.keymap.set('n', '<leader>d', vim.diagnostic.open_float, { noremap=true, silent=true })
+ local on_attach = function(client, bufnr)
+ local opts = { noremap = true, silent = true, buffer = bufnr }
+ vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
+ vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
+ vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
+ vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
+ vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
+ -- Normal mode: show diagnostics in a floating window
+ vim.keymap.set('n', '<leader>d', vim.diagnostic.open_float, { noremap=true, silent=true })
- end
+ end
- -- Server‑specific configurations
- local servers = {
- lua_ls = {
- settings = {
- Lua = {
- diagnostics = { globals = { "vim" } },
- workspace = { library = vim.api.nvim_get_runtime_file("", true) },
- telemetry = { enable = false },
- },
- },
- },
- ts_ls = {},
- texlab = {
- settings = {
- texlab = {
- auxDirectory = "build",
- build = {
- executable = "latexmk",
- args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
- onSave = true,
- },
- forwardSearch = {
- executable = "zathura",
- args = { "--synctex-forward", "%l:1:%f", "%p" },
- },
- },
- },
- },
- clangd = {}, -- C & C++
- pyright = {}, -- Python
- rust_analyzer = {}, -- Rust
- zls = {}, -- Zig
- hls = {}, -- Haskell
- jdtls = {}, -- Java
- asm_lsp = {}, -- Assembly (if you install it)
- clojure_lsp = {}, -- Clojure
- racket_langserver = {}, -- Racket (Scheme dialect)
- }
+ -- Server‑specific configurations
+ local servers = {
+ lua_ls = {
+ settings = {
+ Lua = {
+ diagnostics = { globals = { "vim" } },
+ workspace = { library = vim.api.nvim_get_runtime_file("", true) },
+ telemetry = { enable = false },
+ },
+ },
+ },
+ ts_ls = {},
+ texlab = {
+ settings = {
+ texlab = {
+ auxDirectory = "build",
+ build = {
+ executable = "latexmk",
+ args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
+ onSave = true,
+ },
+ forwardSearch = {
+ executable = "zathura",
+ args = { "--synctex-forward", "%l:1:%f", "%p" },
+ },
+ },
+ },
+ },
+ clangd = {}, -- C & C++
+ pyright = {}, -- Python
+ rust_analyzer = {}, -- Rust
+ zls = {}, -- Zig
+ hls = {}, -- Haskell
+ jdtls = {}, -- Java
+ asm_lsp = {}, -- Assembly (if you install it)
+ clojure_lsp = {}, -- Clojure
+ racket_langserver = {}, -- Racket (Scheme dialect)
+ }
- for name, cfg in pairs(servers) do
- -- Use the new api
- vim.lsp.config(name, {
- on_attach = on_attach,
- capabilities = capabilities,
- settings = cfg.settings,
- root_dir = cfg.root_dir, -- optional if you have special root logic
- })
- vim.lsp.enable(name)
+ for name, cfg in pairs(servers) do
+ -- Use the new api
+ vim.lsp.config(name, {
+ on_attach = on_attach,
+ capabilities = capabilities,
+ settings = cfg.settings,
+ root_dir = cfg.root_dir, -- optional if you have special root logic
+ })
+ vim.lsp.enable(name)
- -- Diagnostic Icons
- vim.diagnostic.config({
- signs = {
- active = true, -- enable signs
- text = {
- [vim.diagnostic.severity.ERROR] = "✖",
- [vim.diagnostic.severity.WARN] = "",
- [vim.diagnostic.severity.INFO] = "",
- [vim.diagnostic.severity.HINT] = "", -- lightbulb for hint
- },
- },
- -- virtual_text = {
- -- prefix = "●GAY●",
- -- },
- underline = true,
- severity_sort = true,
- virtual_text = true, -- inline messages
- signs = true, -- show signs in the gutter
- underline = true, -- underline errors/warnings
- update_in_insert = false,
- -- severity_sort = true,
- })
+ -- Diagnostic Icons
+ vim.diagnostic.config({
+ signs = {
+ active = true, -- enable signs
+ text = {
+ [vim.diagnostic.severity.ERROR] = "✖",
+ [vim.diagnostic.severity.WARN] = "",
+ [vim.diagnostic.severity.INFO] = "",
+ [vim.diagnostic.severity.HINT] = "", -- lightbulb for hint
+ },
+ },
+ -- virtual_text = {
+ -- prefix = "●GAY●",
+ -- },
+ underline = true,
+ severity_sort = true,
+ virtual_text = true, -- inline messages
+ signs = true, -- show signs in the gutter
+ underline = true, -- underline errors/warnings
+ update_in_insert = false,
+ -- severity_sort = true,
+ })
- -- local signs = { Error = "✖", Warn = "", Hint = "", Info = "" }
- -- for type, icon in pairs(signs) do
- -- local hl = "DiagnosticSign" .. type
- -- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
- -- end
+ -- local signs = { Error = "✖", Warn = "", Hint = "", Info = "" }
+ -- for type, icon in pairs(signs) do
+ -- local hl = "DiagnosticSign" .. type
+ -- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
+ -- end
- -- Use Nerd Font symbols for diagnostics
- -- vim.fn.sign_define("DiagnosticSignError", {text = "✖", texthl = "DiagnosticError"}) -- x-mark
- -- vim.fn.sign_define("DiagnosticSignWarn", {text = "", texthl = "DiagnosticWarn"}) -- warning triangle
- -- vim.fn.sign_define("DiagnosticSignInfo", {text = "", texthl = "DiagnosticInfo"}) -- info circle
- -- vim.fn.sign_define("DiagnosticSignHint", {text = "", texthl = "DiagnosticHint"}) -- lightbulb
+ -- Use Nerd Font symbols for diagnostics
+ -- vim.fn.sign_define("DiagnosticSignError", {text = "✖", texthl = "DiagnosticError"}) -- x-mark
+ -- vim.fn.sign_define("DiagnosticSignWarn", {text = "", texthl = "DiagnosticWarn"}) -- warning triangle
+ -- vim.fn.sign_define("DiagnosticSignInfo", {text = "", texthl = "DiagnosticInfo"}) -- info circle
+ -- vim.fn.sign_define("DiagnosticSignHint", {text = "", texthl = "DiagnosticHint"}) -- lightbulb
- lualine_x = {
- {
- "diagnostics",
- sources = {"nvim_lsp"},
- sections = {"error", "warn", "info", "hint"},
- symbols = { error = " ", warn = " ", info = " ", hint = " " },
- }
- }
+ lualine_x = {
+ {
+ "diagnostics",
+ sources = {"nvim_lsp"},
+ sections = {"error", "warn", "info", "hint"},
+ symbols = { error = " ", warn = " ", info = " ", hint = " " },
+ }
+ }
- end
+ end
end
diff --git a/lua/config/luasnip.lua b/lua/config/luasnip.lua
index 4524322..1dbc039 100644
--- a/lua/config/luasnip.lua
+++ b/lua/config/luasnip.lua
@@ -1,36 +1,36 @@
-- Return a function so we can call it from Lazy.nvim
return function()
- local ls = require("luasnip")
+ local ls = require("luasnip")
- -- Load snippets from friendly-snippets
- require("luasnip.loaders.from_vscode").lazy_load()
+ -- Load snippets from friendly-snippets
+ require("luasnip.loaders.from_vscode").lazy_load()
- -- Example Lua snippets
- ls.add_snippets("lua", {
- ls.parser.parse_snippet("hi", "print('Hello, world!')"),
- ls.parser.parse_snippet("fn", "function ${1:name}(${2:args})\n\t$0\nend"),
- })
+ -- Example Lua snippets
+ ls.add_snippets("lua", {
+ ls.parser.parse_snippet("hi", "print('Hello, world!')"),
+ ls.parser.parse_snippet("fn", "function ${1:name}(${2:args})\n\t$0\nend"),
+ })
- local opts = { silent = true, noremap = true }
+ local opts = { silent = true, noremap = true }
- -- Expand snippet or jump forward
- vim.keymap.set({ "i", "s" }, "<C-k>", function()
- if ls.expand_or_jumpable() then
- ls.expand_or_jump()
- end
- end, opts)
+ -- Expand snippet or jump forward
+ vim.keymap.set({ "i", "s" }, "<C-k>", function()
+ if ls.expand_or_jumpable() then
+ ls.expand_or_jump()
+ end
+ end, opts)
- -- Jump backward
- vim.keymap.set({ "i", "s" }, "<C-j>", function()
- if ls.jumpable(-1) then
- ls.jump(-1)
- end
- end, opts)
+ -- Jump backward
+ vim.keymap.set({ "i", "s" }, "<C-j>", function()
+ if ls.jumpable(-1) then
+ ls.jump(-1)
+ end
+ end, opts)
- -- Change choice in choice node
- vim.keymap.set({ "i", "s" }, "<C-l>", function()
- if ls.choice_active() then
- ls.change_choice(1)
- end
- end, opts)
+ -- Change choice in choice node
+ vim.keymap.set({ "i", "s" }, "<C-l>", function()
+ if ls.choice_active() then
+ ls.change_choice(1)
+ end
+ end, opts)
end
diff --git a/lua/config/statusline.lua b/lua/config/statusline.lua
index 9e5fbb8..fd86179 100644
--- a/lua/config/statusline.lua
+++ b/lua/config/statusline.lua
@@ -1,76 +1,76 @@
-- ~/.config/nvim/lua/config/statusline.lua
return function()
- local colors = {
- fg = '#8affff',
- bg = '#003636',
- blue1 = '#00a8e6',
- blue2 = '#2dc5fc',
- green = '#00e6a9',
- purple = '#d38cff',
- red1 = '#f07178',
- red2 = '#ff5370',
- yellow = '#ffcb6b',
- }
+ local colors = {
+ fg = '#8affff',
+ bg = '#003636',
+ blue1 = '#00a8e6',
+ blue2 = '#2dc5fc',
+ green = '#00e6a9',
+ purple = '#d38cff',
+ red1 = '#f07178',
+ red2 = '#ff5370',
+ yellow = '#ffcb6b',
+ }
- local theal = {
- normal = {
- a = { fg = colors.bg, bg = colors.blue2, gui = 'bold' },
- b = { fg = colors.fg, bg = colors.bg },
- c = { fg = colors.fg, bg = colors.bg },
- },
- insert = {
- a = { fg = colors.bg, bg = colors.green, gui = 'bold' },
- b = { fg = colors.fg, bg = colors.bg },
- },
- visual = {
- a = { fg = colors.bg, bg = colors.purple, gui = 'bold' },
- b = { fg = colors.fg, bg = colors.bg },
- },
- replace = {
- a = { fg = colors.bg, bg = colors.red1, gui = 'bold' },
- b = { fg = colors.fg, bg = colors.bg },
- },
- command = {
- a = { fg = colors.bg, bg = colors.yellow, gui = 'bold' },
- b = { fg = colors.fg, bg = colors.bg },
- },
- inactive = {
- a = { fg = colors.fg, bg = colors.bg, gui = 'bold' },
- b = { fg = colors.fg, bg = colors.bg },
- c = { fg = colors.fg, bg = colors.bg },
- },
- }
+ local theal = {
+ normal = {
+ a = { fg = colors.bg, bg = colors.blue2, gui = 'bold' },
+ b = { fg = colors.fg, bg = colors.bg },
+ c = { fg = colors.fg, bg = colors.bg },
+ },
+ insert = {
+ a = { fg = colors.bg, bg = colors.green, gui = 'bold' },
+ b = { fg = colors.fg, bg = colors.bg },
+ },
+ visual = {
+ a = { fg = colors.bg, bg = colors.purple, gui = 'bold' },
+ b = { fg = colors.fg, bg = colors.bg },
+ },
+ replace = {
+ a = { fg = colors.bg, bg = colors.red1, gui = 'bold' },
+ b = { fg = colors.fg, bg = colors.bg },
+ },
+ command = {
+ a = { fg = colors.bg, bg = colors.yellow, gui = 'bold' },
+ b = { fg = colors.fg, bg = colors.bg },
+ },
+ inactive = {
+ a = { fg = colors.fg, bg = colors.bg, gui = 'bold' },
+ b = { fg = colors.fg, bg = colors.bg },
+ c = { fg = colors.fg, bg = colors.bg },
+ },
+ }
- require('lualine').setup {
- options = {
- icons_enabled = true,
- theme = theal,
- component_separators = { left = '', right = '' },
- section_separators = { left = '', right = '' },
- always_divide_middle = true,
- globalstatus = false,
- refresh = { statusline = 1000, tabline = 1000, winbar = 1000 },
- },
- sections = {
- lualine_a = {'mode'},
- lualine_b = {'branch', 'diff', 'diagnostics'},
- lualine_c = {'filename'},
- lualine_x = {'encoding', 'fileformat', 'filetype'},
- lualine_y = {'progress'},
- lualine_z = {'location'}
- },
- inactive_sections = {
- lualine_a = {},
- lualine_b = {},
- lualine_c = {'filename'},
- lualine_x = {'location'},
- lualine_y = {},
- lualine_z = {}
- },
- tabline = {},
- winbar = {},
- inactive_winbar = {},
- extensions = {}
- }
+ require('lualine').setup {
+ options = {
+ icons_enabled = true,
+ theme = theal,
+ component_separators = { left = '', right = '' },
+ section_separators = { left = '', right = '' },
+ always_divide_middle = true,
+ globalstatus = false,
+ refresh = { statusline = 1000, tabline = 1000, winbar = 1000 },
+ },
+ sections = {
+ lualine_a = {'mode'},
+ lualine_b = {'branch', 'diff', 'diagnostics'},
+ lualine_c = {'filename'},
+ lualine_x = {'encoding', 'fileformat', 'filetype'},
+ lualine_y = {'progress'},
+ lualine_z = {'location'}
+ },
+ inactive_sections = {
+ lualine_a = {},
+ lualine_b = {},
+ lualine_c = {'filename'},
+ lualine_x = {'location'},
+ lualine_y = {},
+ lualine_z = {}
+ },
+ tabline = {},
+ winbar = {},
+ inactive_winbar = {},
+ extensions = {}
+ }
end
diff --git a/lua/config/tabs.lua b/lua/config/tabs.lua
index 82e9e8f..6e118ac 100644
--- a/lua/config/tabs.lua
+++ b/lua/config/tabs.lua
@@ -1,81 +1,81 @@
-- ~/.config/nvim/lua/config/tabs.lua
return function()
- -- Disable auto-setup
- vim.g.barbar_auto_setup = false -- disable auto-setup
+ -- Disable auto-setup
+ vim.g.barbar_auto_setup = false -- disable auto-setup
- require'barbar'.setup {
- -- WARN: do not copy everything below into your config!
- -- It is just an example of what configuration options there are.
- -- The defaults are suitable for most people.
+ require'barbar'.setup {
+ -- WARN: do not copy everything below into your config!
+ -- It is just an example of what configuration options there are.
+ -- The defaults are suitable for most people.
- -- Enable/disable animations
- animation = true,
+ -- Enable/disable animations
+ animation = true,
- -- Automatically hide the tabline when there are this many buffers left.
- -- Set to any value >=0 to enable.
- auto_hide = 1,
+ -- Automatically hide the tabline when there are this many buffers left.
+ -- Set to any value >=0 to enable.
+ auto_hide = 1,
- -- Set the filetypes which barbar will offset itself for
- sidebar_filetypes = {
- -- Use the default values: {event = 'BufWinLeave', text = '', align = 'left'}
- NvimTree = true,
- -- Or, specify the text used for the offset:
- undotree = {
- text = 'undotree',
- align = 'center', -- *optionally* specify an alignment (either 'left', 'center', or 'right')
- },
- -- Or, specify the event which the sidebar executes when leaving:
- ['neo-tree'] = {event = 'BufWipeout'},
- -- Or, specify all three
- Outline = {event = 'BufWinLeave', text = 'symbols-outline', align = 'right'},
- },
+ -- Set the filetypes which barbar will offset itself for
+ sidebar_filetypes = {
+ -- Use the default values: {event = 'BufWinLeave', text = '', align = 'left'}
+ NvimTree = true,
+ -- Or, specify the text used for the offset:
+ undotree = {
+ text = 'undotree',
+ align = 'center', -- *optionally* specify an alignment (either 'left', 'center', or 'right')
+ },
+ -- Or, specify the event which the sidebar executes when leaving:
+ ['neo-tree'] = {event = 'BufWipeout'},
+ -- Or, specify all three
+ Outline = {event = 'BufWinLeave', text = 'symbols-outline', align = 'right'},
+ },
- -- icons = {
- -- -- Configure the base icons on the bufferline.
- -- -- Valid options to display the buffer index and -number are `true`, 'superscript' and 'subscript'
- -- buffer_index = false,
- -- buffer_number = false,
- -- button = '',
- -- -- Enables / disables diagnostic symbols
- -- diagnostics = {
- -- [vim.diagnostic.severity.ERROR] = {enabled = true, icon = 'ff'},
- -- [vim.diagnostic.severity.WARN] = {enabled = false},
- -- [vim.diagnostic.severity.INFO] = {enabled = false},
- -- [vim.diagnostic.severity.HINT] = {enabled = true},
- -- },
- -- gitsigns = {
- -- added = {enabled = true, icon = '+'},
- -- changed = {enabled = true, icon = '~'},
- -- deleted = {enabled = true, icon = '-'},
- -- },
- -- filetype = {
- -- -- Sets the icon's highlight group.
- -- -- If false, will use nvim-web-devicons colors
- -- custom_colors = false,
+ -- icons = {
+ -- -- Configure the base icons on the bufferline.
+ -- -- Valid options to display the buffer index and -number are `true`, 'superscript' and 'subscript'
+ -- buffer_index = false,
+ -- buffer_number = false,
+ -- button = '',
+ -- -- Enables / disables diagnostic symbols
+ -- diagnostics = {
+ -- [vim.diagnostic.severity.ERROR] = {enabled = true, icon = 'ff'},
+ -- [vim.diagnostic.severity.WARN] = {enabled = false},
+ -- [vim.diagnostic.severity.INFO] = {enabled = false},
+ -- [vim.diagnostic.severity.HINT] = {enabled = true},
+ -- },
+ -- gitsigns = {
+ -- added = {enabled = true, icon = '+'},
+ -- changed = {enabled = true, icon = '~'},
+ -- deleted = {enabled = true, icon = '-'},
+ -- },
+ -- filetype = {
+ -- -- Sets the icon's highlight group.
+ -- -- If false, will use nvim-web-devicons colors
+ -- custom_colors = false,
- -- -- Requires `nvim-web-devicons` if `true`
- -- enabled = true,
- -- },
- -- separator = {left = '▎', right = ''},
+ -- -- Requires `nvim-web-devicons` if `true`
+ -- enabled = true,
+ -- },
+ -- separator = {left = '▎', right = ''},
- -- -- If true, add an additional separator at the end of the buffer list
- -- separator_at_end = true,
+ -- -- If true, add an additional separator at the end of the buffer list
+ -- separator_at_end = true,
- -- -- Configure the icons on the bufferline when modified or pinned.
- -- -- Supports all the base icon options.
- -- modified = {button = '●'},
- -- pinned = {button = '', filename = true},
+ -- -- Configure the icons on the bufferline when modified or pinned.
+ -- -- Supports all the base icon options.
+ -- modified = {button = '●'},
+ -- pinned = {button = '', filename = true},
- -- -- Use a preconfigured buffer appearance— can be 'default', 'powerline', or 'slanted'
- -- preset = 'default',
+ -- -- Use a preconfigured buffer appearance— can be 'default', 'powerline', or 'slanted'
+ -- preset = 'default',
- -- -- Configure the icons on the bufferline based on the visibility of a buffer.
- -- -- Supports all the base icon options, plus `modified` and `pinned`.
- -- alternate = {filetype = {enabled = false}},
- -- current = {buffer_index = true},
- -- inactive = {button = '×'},
- -- visible = {modified = {buffer_number = false}},
- -- },
- }
+ -- -- Configure the icons on the bufferline based on the visibility of a buffer.
+ -- -- Supports all the base icon options, plus `modified` and `pinned`.
+ -- alternate = {filetype = {enabled = false}},
+ -- current = {buffer_index = true},
+ -- inactive = {button = '×'},
+ -- visible = {modified = {buffer_number = false}},
+ -- },
+ }
end
diff --git a/lua/config/tree.lua b/lua/config/tree.lua
index bb1c6c9..5f13877 100644
--- a/lua/config/tree.lua
+++ b/lua/config/tree.lua
@@ -1,29 +1,29 @@
-- ~/.config/nvim/lua/config/tree.lua
return function()
- -- disable netrw
- vim.g.loaded_netrw = 1
- vim.g.loaded_netrwPlugin = 1
+ -- disable netrw
+ vim.g.loaded_netrw = 1
+ vim.g.loaded_netrwPlugin = 1
- -- enable 24-bit colors
- vim.opt.termguicolors = true
+ -- enable 24-bit colors
+ vim.opt.termguicolors = true
- -- nvim-tree setup
- require("nvim-tree").setup({
- sort = {
- sorter = "case_sensitive",
- },
- view = {
- width = 30,
- },
- renderer = {
- group_empty = true,
- },
- filters = {
- dotfiles = true,
- },
- })
+ -- nvim-tree setup
+ require("nvim-tree").setup({
+ sort = {
+ sorter = "case_sensitive",
+ },
+ view = {
+ width = 30,
+ },
+ renderer = {
+ group_empty = true,
+ },
+ filters = {
+ dotfiles = true,
+ },
+ })
- -- keybindings
- vim.api.nvim_set_keymap('n', '<leader>t', ':NvimTreeToggle<CR>', { noremap = true, silent = true })
+ -- keybindings
+ vim.api.nvim_set_keymap('n', '<leader>t', ':NvimTreeToggle<CR>', { noremap = true, silent = true })
end
diff --git a/lua/config/treesitter.lua b/lua/config/treesitter.lua
index 238d4a2..38e1d6b 100644
--- a/lua/config/treesitter.lua
+++ b/lua/config/treesitter.lua
@@ -1,72 +1,72 @@
-- ~/.config/nvim/lua/config/treesitter.lua
return function()
- require("nvim-treesitter.configs").setup {
- ensure_installed = {
- "c",
- "lua",
- "vim",
- "vimdoc",
- "query",
- "markdown",
- "markdown_inline",
- "python",
- "javascript",
- "cpp",
- "rust",
- "haskell",
- "commonlisp",
- "scheme",
- "clojure",
- "fennel",
- },
- sync_install = false,
- auto_install = true,
- highlight = {
- enable = true,
- disable = {"latex"},
- additional_vim_regex_highlighting = false,
- },
- indent = {
- enable = false,
- },
- -- incremental_selection = {
- -- enable = true,
- -- keymaps = {
- -- init_selection = "gnn",
- -- node_incremental = "grn",
- -- scope_incremental = "grc",
- -- node_decremental = "grm",
- -- },
- -- },
- textobjects = {
- select = {
- enable = true,
- keymaps = {
- ["af"] = "@function.outer",
- ["if"] = "@function.inner",
- ["ac"] = "@class.outer",
- ["ic"] = "@class.inner",
- },
- },
- },
- fold = {
- enable = true,
- },
+ require("nvim-treesitter.configs").setup {
+ ensure_installed = {
+ "c",
+ "lua",
+ "vim",
+ "vimdoc",
+ "query",
+ "markdown",
+ "markdown_inline",
+ "python",
+ "javascript",
+ "cpp",
+ "rust",
+ "haskell",
+ "commonlisp",
+ "scheme",
+ "clojure",
+ "fennel",
+ },
+ sync_install = false,
+ auto_install = true,
+ highlight = {
+ enable = true,
+ disable = {"latex"},
+ additional_vim_regex_highlighting = false,
+ },
+ indent = {
+ enable = false,
+ },
+ -- incremental_selection = {
+ -- enable = true,
+ -- keymaps = {
+ -- init_selection = "gnn",
+ -- node_incremental = "grn",
+ -- scope_incremental = "grc",
+ -- node_decremental = "grm",
+ -- },
+ -- },
+ textobjects = {
+ select = {
+ enable = true,
+ keymaps = {
+ ["af"] = "@function.outer",
+ ["if"] = "@function.inner",
+ ["ac"] = "@class.outer",
+ ["ic"] = "@class.inner",
+ },
+ },
+ },
+ fold = {
+ enable = true,
+ },
- }
- -- Add folding settings here
- vim.opt.foldmethod = "expr"
- vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
- vim.opt.foldlevelstart = 99
- vim.api.nvim_create_autocmd("FileType", {
- callback = function()
- if require("nvim-treesitter.parsers").has_parser() then
- vim.opt.foldmethod = "expr"
- vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
- else
- vim.opt.foldmethod = "indent" -- or whatever you prefer
- end
- end,
+ }
+ -- Add folding settings here
+ vim.opt.foldmethod = "expr"
+ vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
+ vim.opt.foldlevelstart = 99
+ vim.api.nvim_create_autocmd("FileType", {
+ callback = function()
+ if require("nvim-treesitter.parsers").has_parser() then
+ vim.opt.foldmethod = "expr"
+ vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
+ else
+ vim.opt.foldmethod = "indent" -- or whatever you prefer
+ end
+ end,
})
diff --git a/lua/config/vimtex.lua b/lua/config/vimtex.lua
index 4a1de11..e7c4998 100644
--- a/lua/config/vimtex.lua
+++ b/lua/config/vimtex.lua
@@ -1,39 +1,39 @@
return function()
- -- Use Zathura as the PDF viewer
- vim.g.vimtex_view_method = "zathura"
+ -- Use Zathura as the PDF viewer
+ vim.g.vimtex_view_method = "zathura"
- -- Compile using latexmk automatically
- vim.g.vimtex_compiler_method = "latexmk"
- vim.g.vimtex_compiler_latexmk = {
- build_dir = "build", -- Keep files in a separate folder
- callback = 1,
- continuous = 1, -- Automatically recompile on save
- executable = "latexmk",
- options = {
- "-pdf",
- "-interaction=nonstopmode",
- "-synctex=1",
- },
- }
+ -- Compile using latexmk automatically
+ vim.g.vimtex_compiler_method = "latexmk"
+ vim.g.vimtex_compiler_latexmk = {
+ build_dir = "build", -- Keep files in a separate folder
+ callback = 1,
+ continuous = 1, -- Automatically recompile on save
+ executable = "latexmk",
+ options = {
+ "-pdf",
+ "-interaction=nonstopmode",
+ "-synctex=1",
+ },
+ }
- -- Auto hard-wrap at 80 columns for .tex files
- vim.api.nvim_create_autocmd("FileType", {
- pattern = "tex",
- callback = function()
- vim.opt_local.textwidth = 80
- vim.opt_local.formatoptions:append("t")
- end,
- })
+ -- Auto hard-wrap at 80 columns for .tex files
+ vim.api.nvim_create_autocmd("FileType", {
+ pattern = "tex",
+ callback = function()
+ vim.opt_local.textwidth = 80
+ vim.opt_local.formatoptions:append("t")
+ end,
+ })
- -- Optional: disable conceal for clearer LaTeX text
- vim.g.vimtex_syntax_conceal = {
- accents = 0,
- ligatures = 0,
- cites = 0,
- fancy = 0,
- spacing = 0,
- greek = 0,
- math_delimiters = 0,
- math_super_sub = 0,
- }
+ -- Optional: disable conceal for clearer LaTeX text
+ vim.g.vimtex_syntax_conceal = {
+ accents = 0,
+ ligatures = 0,
+ cites = 0,
+ fancy = 0,
+ spacing = 0,
+ greek = 0,
+ math_delimiters = 0,
+ math_super_sub = 0,
+ }
end