Format config

This commit is contained in:
Janis Hutz 2025-06-05 11:33:49 +02:00
parent 5870ed5fc5
commit 4aa0c54fc4
35 changed files with 867 additions and 856 deletions

View File

@ -11,16 +11,15 @@ if not vim.loop.fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
{ import = "plugins.nav" },
{ import = "plugins.lsp" },
{ import = "plugins.style" },
{ import = "plugins.util" },
{ import = "plugins.testing" }
{ import = "plugins.testing" },
},
change_detection = {
notify = false, -- dont notify when plugins are changed
}
},
})

View File

@ -16,8 +16,8 @@ vim.opt.breakindent = true
vim.opt.linebreak = true
-- folding
vim.wo.foldmethod = 'expr'
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.wo.foldmethod = "expr"
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
-- line numbers
vim.wo.number = true

View File

@ -19,7 +19,7 @@ return {
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").load({paths = { "~/.config/nvim/snippets" }})
require("luasnip.loaders.from_vscode").load({ paths = { "~/.config/nvim/snippets" } })
luasnip.setup({
region_check_events = { "CursorMoved" },
delete_check_events = { "TextChanged" },
@ -86,7 +86,7 @@ return {
-- Otherwise, fallback (insert a tab character)
fallback()
end
end, { "i", "s" })
end, { "i", "s" }),
}),
-- sources for autocompletion
@ -95,7 +95,7 @@ return {
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
{ name = 'nvim_lsp_signature_help' }, -- signature help
{ name = "nvim_lsp_signature_help" }, -- signature help
}),
formatting = {

View File

@ -7,7 +7,7 @@ return {
vim.diagnostic.config({ virtual_lines = false })
local lsplines = false
vim.keymap.set("n", "<Leader>L", function ()
vim.keymap.set("n", "<Leader>L", function()
lsplines = not lsplines
vim.diagnostic.config({ virtual_text = not lsplines })
vim.diagnostic.config({ virtual_lines = lsplines })

View File

@ -1,12 +1,3 @@
return {
'L3MON4D3/LuaSnip',
-- config = function()
-- local luasnip = require('luasnip')
-- -- luasnip.setup({
-- -- region_check_events = "CursorMoved",
-- -- delete_check_events = "TextChanged",
-- -- })
--
-- require("luasnip.loaders.from_vscode").load({paths = "~/.config/nvim/my_snippets"})
-- end
"L3MON4D3/LuaSnip",
}

View File

@ -1,7 +1,10 @@
-- ┌ ┐
-- │ Formatting, diagnostics │
-- └ ┘
return {
"nvimtools/none-ls.nvim",
dependencies = {
'nvimtools/none-ls-extras.nvim'
"nvimtools/none-ls-extras.nvim",
},
config = function()
local null_ls = require("null-ls")
@ -46,9 +49,9 @@ return {
null_ls.builtins.formatting.shfmt,
null_ls.builtins.formatting.asmfmt,
null_ls.builtins.code_actions.proselint,
require( 'none-ls.diagnostics.eslint_d' ),
require( 'none-ls.code_actions.eslint_d' ),
require( 'none-ls.formatting.eslint_d' ),
require("none-ls.diagnostics.eslint_d"),
require("none-ls.code_actions.eslint_d"),
require("none-ls.formatting.eslint_d"),
null_ls.builtins.formatting.black,
},
})

View File

@ -41,13 +41,13 @@ return {
"vue",
"xml",
"yaml",
"zathurarc"
"zathurarc",
},
sync_install = false,
highlight = {
enable = true,
disable = { "tex" }
disable = { "tex" },
},
})
end,

View File

@ -2,14 +2,14 @@ return {
"lervag/vimtex",
config = function()
-- vimtex settings
-- vim.g.vimtex_view_method = 'startup' -- PDF viewer (example: zathura, or use 'skim' for macOS)
vim.g.vimtex_compiler_method = 'latexmk' -- Use latexmk for compilation
-- vim.g.vimtex_view_method = 'zathura' -- PDF viewer (example: zathura, or use 'skim' for macOS)
vim.g.vimtex_compiler_method = "latexmk" -- Use latexmk for compilation
vim.g.vimtex_fold_enabled = 1 -- Enable folding for LaTeX sections
vim.g.vimtex_quickfix_mode = 0 -- Disable quickfix mode for compilation errors
-- Key Mappings for LaTeX workflow
vim.api.nvim_set_keymap('n', '<leader>lc', ':VimtexCompile<CR>', {}) -- Compile LaTeX file
vim.api.nvim_set_keymap('n', '<leader>lv', ':VimtexView<CR>', {}) -- View compiled PDF
vim.api.nvim_set_keymap('n', '<leader>lq', ':VimtexStop<CR>', {}) -- Stop compilation
end
-- ── Key Mappings for LaTeX workflow ──────────────────────────────
vim.api.nvim_set_keymap("n", "<leader>lc", ":VimtexCompile<CR>", {}) -- Compile LaTeX file
vim.api.nvim_set_keymap("n", "<leader>lv", ":VimtexView<CR>", {}) -- View compiled PDF
vim.api.nvim_set_keymap("n", "<leader>lq", ":VimtexStop<CR>", {}) -- Stop compilation
end,
}

View File

@ -1,7 +1,12 @@
return {
"echasnovski/mini.bufremove",
config = function ()
_G.MiniBufremove = require( 'mini.bufremove' );
vim.keymap.set( 'n', '<C-x>', ':lua MiniBufremove.delete()<CR>', { silent = true, noremap = true, desc = 'Remove buffer' } );
config = function()
_G.MiniBufremove = require("mini.bufremove")
vim.keymap.set(
"n",
"<C-x>",
":lua MiniBufremove.delete()<CR>",
{ silent = true, noremap = true, desc = "Remove buffer" }
)
end,
}

View File

@ -1,7 +1,7 @@
return {
-- open file at previous position
'ethanholz/nvim-lastplace',
"ethanholz/nvim-lastplace",
config = function()
require('nvim-lastplace').setup{}
require("nvim-lastplace").setup({})
end,
}

View File

@ -141,6 +141,6 @@ return {
custom_hl_group = nil, -- "Visual" or any other hl group to use instead of inverted colors
})
vim.keymap.set("n", "<leader>n", ":Navbuddy<CR>", { silent = true, desc = "open navbuddy menu" })
vim.keymap.set("n", "<leader><leader>n", ":Navbuddy<CR>", { silent = true, desc = "open navbuddy menu" })
end,
}

View File

@ -174,7 +174,7 @@ return {
},
nesting_rules = {},
filesystem = {
scan_mode = 'deep',
scan_mode = "deep",
filtered_items = {
visible = false, -- when true, they will just be displayed differently than normal items
hide_dotfiles = true,

View File

@ -35,34 +35,34 @@ return {
-- Recent Commands
opts.desc = "Show recent commands"
vim.keymap.set('n', '<leader>frc', ':Telescope command_history<CR>', opts)
vim.keymap.set("n", "<leader>frc", ":Telescope command_history<CR>", opts)
-- Recent Searches
opts.desc = "Show recent searches"
vim.keymap.set('n', '<leader>frs', ':Telescope search_history<CR>', opts)
vim.keymap.set("n", "<leader>frs", ":Telescope search_history<CR>", opts)
-- Old Files
opts.desc = "Show recent files"
vim.keymap.set('n', '<leader>frf', ':Telescope oldfiles<CR>', opts)
vim.keymap.set("n", "<leader>frf", ":Telescope oldfiles<CR>", opts)
-- Quickfix Items
opts.desc = "Show quickfix items"
vim.keymap.set('n', '<leader>fq', ':Telescope quickfix<CR>', opts)
vim.keymap.set("n", "<leader>fq", ":Telescope quickfix<CR>", opts)
-- Spell Suggestions
opts.desc = "Show spell suggestions"
vim.keymap.set('n', '<leader>fs', ':Telescope spell_suggest<CR>', opts)
vim.keymap.set("n", "<leader>fs", ":Telescope spell_suggest<CR>", opts)
-- Diagnostics
opts.desc = "Show diagnostics"
vim.keymap.set('n', '<leader>fd', ':Telescope diagnostics<CR>', opts)
vim.keymap.set("n", "<leader>fd", ":Telescope diagnostics<CR>", opts)
-- Notifications
opts.desc = "Show notifications"
vim.keymap.set('n', '<leader>fn', ':Telescope notify<CR>', opts)
vim.keymap.set("n", "<leader>fn", ":Telescope notify<CR>", opts)
-- Implementations
opts.desc = "Show implementations"
vim.keymap.set('n', '<leader>fi', ':Telescope lsp_implementations<CR>', opts)
vim.keymap.set("n", "<leader>fi", ":Telescope lsp_implementations<CR>", opts)
end,
}

View File

@ -6,7 +6,5 @@ return {
vim.o.timeout = true
vim.o.timeoutlen = 500
end,
opts = {
}
opts = {},
}

View File

@ -1,9 +1,9 @@
return {
-- colorizes colors in code
'NvChad/nvim-colorizer.lua' ,
"NvChad/nvim-colorizer.lua",
--cmd = 'ColorizerToggle',
config = function ()
require("colorizer").setup {
config = function()
require("colorizer").setup({
filetypes = { "*" },
user_default_options = {
RGB = true, -- #RGB hex codes - #FCE
@ -21,14 +21,14 @@ return {
-- True is same as normal
tailwind = false, -- Enable tailwind colors
-- parsers can contain values used in |user_default_options|
sass = { enable = false, parsers = { "css" }, }, -- Enable sass colors
sass = { enable = false, parsers = { "css" } }, -- Enable sass colors
virtualtext = "",
-- update color values even if buffer is not focused
-- example use: cmp_menu, cmp_docs
always_update = false
always_update = false,
},
-- all the sub-options of filetypes apply to buftypes
buftypes = {},
}
})
end,
}

View File

@ -13,7 +13,7 @@ return {
functions = "italic",
keywords = "italic",
types = "italic",
}
},
},
palettes = {
all = {
@ -77,7 +77,7 @@ return {
statement = "magenta",
string = "cyan",
type = "red",
variable = "orange"
variable = "orange",
},
diag = {
error = "darkred",
@ -91,22 +91,22 @@ return {
warn = "#a16b00",
info = "cyan",
hint = "bg3",
ok = "green";
ok = "green",
},
diff = {
add = "darkgreen",
delete = "darkred",
changed = "lightblue",
text = "fg0"
text = "fg0",
},
git = {
add = "darkgreen",
removed = "darkred",
changed = "lightblue",
conflict = "orange",
ignored = "gray"
}
}
ignored = "gray",
},
},
},
groups = {
all = {

View File

@ -45,17 +45,17 @@ return {
local opts = { silent = true }
opts.desc = "comment text box"
vim.keymap.set({"n", "v"}, "<leader>cb", ":CBccbox<CR>", opts)
vim.keymap.set({ "n", "v" }, "<leader>cb", ":CBccbox<CR>", opts)
opts.desc = "comment text line"
vim.keymap.set({"n", "v"}, "<leader>cl", ":CBllline<CR>", opts)
vim.keymap.set({ "n", "v" }, "<leader>cl", ":CBllline<CR>", opts)
opts.desc = "comment line"
vim.keymap.set({"n", "v"}, "<leader>ce", ":CBline<CR>", opts)
vim.keymap.set({ "n", "v" }, "<leader>ce", ":CBline<CR>", opts)
opts.desc = "comment highlight"
vim.keymap.set({"n", "v"}, "<leader>ch", ":CBlcbox18<CR>", opts)
vim.keymap.set({ "n", "v" }, "<leader>ch", ":CBlcbox18<CR>", opts)
opts.desc = "delete comment box"
vim.keymap.set({"n", "v"}, "<leader>cd", ":CBd<CR>", opts)
vim.keymap.set({ "n", "v" }, "<leader>cd", ":CBd<CR>", opts)
opts.desc = "yank comment box contents"
vim.keymap.set({"n", "v"}, "<leader>cy", ":CBy<CR>", opts)
vim.keymap.set({ "n", "v" }, "<leader>cy", ":CBy<CR>", opts)
end,
}

View File

@ -1,10 +1,10 @@
return {
-- add comment keybinds
'numToStr/Comment.nvim',
"numToStr/Comment.nvim",
opts = {},
lazy = false,
config = function()
require('Comment').setup()
require('Comment.ft').set('hyprlang', '#%s')
end
require("Comment").setup()
require("Comment.ft").set("hyprlang", "#%s")
end,
}

View File

@ -1,5 +1,5 @@
return {
-- prettier prompts
'stevearc/dressing.nvim',
event = 'VeryLazy',
"stevearc/dressing.nvim",
event = "VeryLazy",
}

View File

@ -1,7 +1,7 @@
return {
-- status line
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
local function getWords()
local wc = vim.api.nvim_eval("wordcount()")
@ -11,45 +11,45 @@ return {
return wc["words"]
end
end
require('lualine').setup {
require("lualine").setup({
options = {
icons_enabled = true,
theme = "auto",
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = { 'neo-tree' },
ignore_focus = { "neo-tree" },
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
},
sections = {
lualine_a = { { 'mode', separator = { left = '', right = '' }, } },
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = { getWords, 'encoding', 'fileformat', 'filetype'},
lualine_y = { { 'progress', left_padding=0 } },
lualine_z = { { 'location', separator = { left = '', right = '' }, padding=0} }
lualine_a = { { "mode", separator = { left = "", right = "" } } },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { getWords, "encoding", "fileformat", "filetype" },
lualine_y = { { "progress", left_padding = 0 } },
lualine_z = { { "location", separator = { left = "", right = "" }, padding = 0 } },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {}
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}
extensions = {},
})
end,
}

View File

@ -10,12 +10,12 @@ return {
"rcarriga/nvim-notify",
},
config = function()
require( 'notify' ).setup( {
require("notify").setup({
max_width = 80,
minimum_width = 30,
render = 'wrapped-default', -- default, minimal, simple, compact, wrapped-compact or wrapped-default
stages = 'slide', -- fade_in_slide_out, fade, slide, static
} );
render = "wrapped-default", -- default, minimal, simple, compact, wrapped-compact or wrapped-default
stages = "slide", -- fade_in_slide_out, fade, slide, static
})
require("noice").setup({
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**

View File

@ -24,26 +24,26 @@ return {
[[ █████ ░░█████░░██████ ░░██████ ░░███ █████ █████░███ █████ ]],
[[ ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ ]],
[[ ]],
},
},
highlight = "String",
default_color = "#010155"
default_color = "#010155",
},
quotes = {
type = "text",
align = "center",
content = function ()
content = function()
local handle = io.popen("pwd")
if handle then
local cwd = handle:read("*l")
handle:close()
return {"Currently in " .. cwd}
return { "Currently in " .. cwd }
else
return {"Error running command"}
return { "Error running command" }
end
end,
highlight = "String",
default_color = "#FFFFFF"
default_color = "#FFFFFF",
},
old = {
@ -58,12 +58,12 @@ return {
},
options = {
mapping_keys = false;
mapping_keys = false,
},
colors = {
background = "#000000",
folded_section = "#100000"
folded_section = "#100000",
},
mappings = {
@ -71,7 +71,7 @@ return {
open_file = "<CR>",
},
parts = {"title", "quotes", "old"}
parts = { "title", "quotes", "old" },
})
end,
}

View File

@ -47,10 +47,16 @@ return {
dapui.close()
end
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DapBreakpoint", linehl = "", numhl = ""})
vim.fn.sign_define("DapBreakpointCondition", { text = "", texthl = "DapBreakpointCondition", linehl = "", numhl = ""})
vim.fn.sign_define("DapLogPoint", { text = "", texthl = "DapLogPoint", linehl = "", numhl = ""})
vim.fn.sign_define('DapStopped', { text='', texthl='DapStopped', linehl='DapStopped', numhl= 'DapStopped' })
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DapBreakpoint", linehl = "", numhl = "" })
vim.fn.sign_define(
"DapBreakpointCondition",
{ text = "", texthl = "DapBreakpointCondition", linehl = "", numhl = "" }
)
vim.fn.sign_define("DapLogPoint", { text = "", texthl = "DapLogPoint", linehl = "", numhl = "" })
vim.fn.sign_define(
"DapStopped",
{ text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
)
dap.configurations.python = {
{
@ -91,7 +97,7 @@ return {
else
cb({
type = "executable",
command = vim.fn.stdpath("data") .. '/mason/packages/debugpy/venv/bin/python',
command = vim.fn.stdpath("data") .. "/mason/packages/debugpy/venv/bin/python",
args = { "-m", "debugpy.adapter" },
options = {
source_filetype = "python",

View File

@ -1,13 +1,13 @@
return {
"windwp/nvim-ts-autotag",
config = function ()
require('nvim-ts-autotag').setup({
config = function()
require("nvim-ts-autotag").setup({
opts = {
-- Defaults
enable_close = true, -- Auto close tags
enable_rename = true, -- Auto rename pairs of tags
enable_close_on_slash = true -- Auto close on trailing </
enable_close_on_slash = true, -- Auto close on trailing </
},
} )
end
})
end,
}

View File

@ -1,16 +1,21 @@
return {
'uga-rosa/ccc.nvim',
config = function ()
local ccc = require( 'ccc' );
vim.opt.termguicolors = true;
ccc.setup( {
"uga-rosa/ccc.nvim",
config = function()
local ccc = require("ccc")
vim.opt.termguicolors = true
ccc.setup({
highlighter = {
auto_enable = false,
lsp = true
}
} )
lsp = true,
},
})
local keymap = vim.keymap
keymap.set( 'n', '<leader>cp', '<cmd>CccPick<CR>', { noremap = true, silent = true, desc = "Toggle colour picker" } )
end
keymap.set(
"n",
"<leader>cp",
"<cmd>CccPick<CR>",
{ noremap = true, silent = true, desc = "Toggle colour picker" }
)
end,
}

View File

@ -6,9 +6,8 @@ return {
notification = {
window = {
winblend = 0,
}
}
},
},
})
end
end,
}

View File

@ -1,9 +1,9 @@
return {
-- indent lines
'lukas-reineke/indent-blankline.nvim',
"lukas-reineke/indent-blankline.nvim",
opts = {},
main = 'ibl',
main = "ibl",
config = function()
require('ibl').setup()
end
require("ibl").setup()
end,
}

View File

@ -4,14 +4,16 @@ return {
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" },
build = function(plugin)
if vim.fn.executable "npx" then
if vim.fn.executable("npx") then
vim.cmd("!cd " .. plugin.dir .. " && cd app && npx --yes yarn install")
else
vim.cmd [[Lazy load markdown-preview.nvim]]
vim.cmd([[Lazy load markdown-preview.nvim]])
vim.fn["mkdp#util#install"]()
end
end,
init = function()
if vim.fn.executable "npx" then vim.g.mkdp_filetypes = { "markdown" } end
if vim.fn.executable("npx") then
vim.g.mkdp_filetypes = { "markdown" }
end
end,
}

View File

@ -2,16 +2,16 @@ return {
"smoka7/multicursors.nvim",
event = "VeryLazy",
dependencies = {
'nvimtools/hydra.nvim',
"nvimtools/hydra.nvim",
},
opts = {},
cmd = { 'MCstart', 'MCvisual', 'MCclear', 'MCpattern', 'MCvisualPattern', 'MCunderCursor' },
cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
keys = {
{
mode = { 'v', 'n' },
'<leader><leader>c',
'<cmd>MCstart<cr>',
desc = 'Create a selection for selected text or word under the cursor',
mode = { "v", "n" },
"<leader><leader>c",
"<cmd>MCstart<cr>",
desc = "Create a selection for selected text or word under the cursor",
},
},
}

View File

@ -1,10 +1,10 @@
return {
"danymat/neogen",
config = function ()
config = function()
local opts = { noremap = true, silent = true, desc = "Generate docs" }
vim.api.nvim_set_keymap("n", "<leader>gd", ":lua require('neogen').generate()<CR>", opts)
require( 'neogen' ).setup( {
snippet_engine = "luasnip"
} );
end
require("neogen").setup({
snippet_engine = "luasnip",
})
end,
}

View File

@ -4,5 +4,5 @@ return {
event = "VeryLazy",
config = function()
require("nvim-surround").setup()
end
end,
}

View File

@ -4,7 +4,7 @@ local M = {}
M.opts = function(desc)
if desc then
return { silent = true, desc = desc}
return { silent = true, desc = desc }
else
return { silent = true }
end
@ -24,30 +24,33 @@ M.sudo_exec = function(cmd, print_output)
print(out)
return false
end
if print_output then print("\r\n", out) end
if print_output then
print("\r\n", out)
end
return true
end
M.sudo_write = function(tmpfile, filepath)
if not tmpfile then tmpfile = vim.fn.tempname() end
if not filepath then filepath = vim.fn.expand("%") end
if not tmpfile then
tmpfile = vim.fn.tempname()
end
if not filepath then
filepath = vim.fn.expand("%")
end
if not filepath or #filepath == 0 then
print("E32: No file name")
return
end
-- `bs=1048576` is equivalent to `bs=1M` for GNU dd or `bs=1m` for BSD dd
-- Both `bs=1M` and `bs=1m` are non-POSIX
local cmd = string.format("dd if=%s of=%s bs=1048576",
vim.fn.shellescape(tmpfile),
vim.fn.shellescape(filepath))
local cmd = string.format("dd if=%s of=%s bs=1048576", vim.fn.shellescape(tmpfile), vim.fn.shellescape(filepath))
-- no need to check error as this fails the entire function
vim.api.nvim_exec(string.format("write! %s", tmpfile), true)
if M.sudo_exec(cmd) then
-- refreshes the buffer and prints the "written" message
vim.cmd.checktime()
-- exit command mode
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(
"<Esc>", true, false, true), "n", true)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "n", true)
end
vim.fn.delete(tmpfile)
end