style(nvim): format with stylua

This commit is contained in:
Price Hiller 2023-12-22 11:03:58 -06:00
parent ed9d8dbd5b
commit 3a833516a8
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8
27 changed files with 197 additions and 177 deletions

View File

@ -1,10 +1,7 @@
vim.keymap.set("n", "<leader>fr", vim.keymap.set("n", "<leader>fr", function()
function() vim.cmd.write()
vim.cmd.write() vim.cmd.terminal("deno run " .. vim.fn.expand("%"))
vim.cmd.terminal("deno run " .. vim.fn.expand("%")) end, {
end, buffer = true,
{ silent = true,
buffer = true, })
silent = true
}
)

View File

@ -1,4 +1,4 @@
vim.api.nvim_create_autocmd({"BufNewFile", "BufRead"}, { vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
pattern = {"*.log", "*_log", "*.LOG", "*_LOG"}, pattern = { "*.log", "*_log", "*.LOG", "*_LOG" },
command = "set ft=log" command = "set ft=log",
}) })

View File

@ -10,9 +10,9 @@ return {
{ {
"petertriho/cmp-git", "petertriho/cmp-git",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim" "nvim-lua/plenary.nvim",
}, },
opts = {} opts = {},
}, },
"hrsh7th/cmp-nvim-lsp-document-symbol", "hrsh7th/cmp-nvim-lsp-document-symbol",
"hrsh7th/cmp-calc", "hrsh7th/cmp-calc",
@ -27,7 +27,7 @@ return {
"tzachar/cmp-fuzzy-buffer", "tzachar/cmp-fuzzy-buffer",
dependencies = { dependencies = {
"tzachar/fuzzy.nvim", "tzachar/fuzzy.nvim",
} },
}, },
-- Snippets -- Snippets
{ {
@ -55,7 +55,7 @@ return {
-- Load Snippets -- Load Snippets
require("luasnip.loaders.from_vscode").lazy_load() require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_lua").load({ require("luasnip.loaders.from_lua").load({
paths = vim.fn.stdpath("config") .. "/lua/plugins/snippets" paths = vim.fn.stdpath("config") .. "/lua/plugins/snippets",
}) })
local colors_bg_color = vim.api.nvim_get_hl(0, { name = "CmpCustomSelectionColor" }).bg local colors_bg_color = vim.api.nvim_get_hl(0, { name = "CmpCustomSelectionColor" }).bg
@ -119,7 +119,7 @@ return {
sources = sources or {} sources = sources or {}
local default_sources = { local default_sources = {
{ name = "nvim_lsp", priority = 11 }, { name = "nvim_lsp", priority = 11 },
{ name = "luasnip", priority = 10 }, -- For luasnip users. { name = "luasnip", priority = 10 }, -- For luasnip users.
{ {
name = "fuzzy_buffer", name = "fuzzy_buffer",
priority = 8, priority = 8,
@ -132,17 +132,19 @@ return {
option = { option = {
"--smart-case", "--smart-case",
"--hidden", "--hidden",
"--max-depth 4" "--max-depth 4",
} },
}, },
{ name = "async_path", priority = 6 }, { name = "async_path", priority = 6 },
{ name = "zsh", priority = 5 }, { name = "zsh", priority = 5 },
{ name = "emoji", keyword_length = 2 }, { name = "emoji", keyword_length = 2 },
{ name = "calc" }, { name = "calc" },
{ name = "npm", keyword_length = 2 }, { name = "npm", keyword_length = 2 },
} }
vim.tbl_map(function(source) table.insert(default_sources, 1, source) end, sources) vim.tbl_map(function(source)
table.insert(default_sources, 1, source)
end, sources)
return cmp.config.sources(default_sources) return cmp.config.sources(default_sources)
end end
cmp.setup({ cmp.setup({
@ -165,7 +167,7 @@ return {
conventionalcommits = { symbol = "", name = "Commit", hl_group = "Commit" }, conventionalcommits = { symbol = "", name = "Commit", hl_group = "Commit" },
git = { symbol = "󰊢 ", name = "Git", hl_group = "Git" }, git = { symbol = "󰊢 ", name = "Git", hl_group = "Git" },
docker_compose_language_service = { symbol = "󰡨 ", name = "Docker", hl_group = "Docker" }, docker_compose_language_service = { symbol = "󰡨 ", name = "Docker", hl_group = "Docker" },
luasnip = { symbol = "", name = "Snippet" } luasnip = { symbol = "", name = "Snippet" },
} }
local extra_kind_icons = { local extra_kind_icons = {
@ -339,7 +341,7 @@ return {
sorting = { sorting = {
priority_weight = 2, priority_weight = 2,
comparators = { comparators = {
require('cmp_fuzzy_buffer.compare'), require("cmp_fuzzy_buffer.compare"),
compare.score, compare.score,
compare.offset, compare.offset,
compare.recently_used, compare.recently_used,
@ -355,23 +357,29 @@ return {
-- Git Commit Completions -- Git Commit Completions
cmp.setup.filetype("gitcommit", { cmp.setup.filetype("gitcommit", {
sources = standard_sources({ sources = standard_sources({
{ name = "git", priority = 20 }, { name = "git", priority = 20 },
{ name = "conventionalcommits", priority = 19 } { name = "conventionalcommits", priority = 19 },
}), }),
}) })
cmp.setup.filetype("octo", { cmp.setup.filetype("octo", {
sources = standard_sources({ sources = standard_sources({
{ name = "git", priority = 20 } { name = "git", priority = 20 },
}), }),
}) })
cmp.setup.filetype("sql", cmp.setup.filetype(
{ sources = standard_sources({ { name = "vim-dadbod-completion", priority = 20 } }) }) "sql",
cmp.setup.filetype("mysql", { sources = standard_sources({ { name = "vim-dadbod-completion", priority = 20 } }) }
{ sources = standard_sources({ { name = "vim-dadbod-completion", priority = 20 } }) }) )
cmp.setup.filetype("plsql", cmp.setup.filetype(
{ sources = standard_sources({ { name = "vim-dadbod-completion", priority = 20 } }) }) "mysql",
{ sources = standard_sources({ { name = "vim-dadbod-completion", priority = 20 } }) }
)
cmp.setup.filetype(
"plsql",
{ sources = standard_sources({ { name = "vim-dadbod-completion", priority = 20 } }) }
)
cmp.setup.filetype("toml", { sources = standard_sources({ { name = "crates" } }) }) cmp.setup.filetype("toml", { sources = standard_sources({ { name = "crates" } }) })
cmp.setup.filetype("org", { sources = standard_sources({ { name = "orgmode", priority = 20 } }) }) cmp.setup.filetype("org", { sources = standard_sources({ { name = "orgmode", priority = 20 } }) })
@ -380,7 +388,7 @@ return {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "fuzzy_buffer" }, { name = "fuzzy_buffer" },
{ name = "rg" } { name = "rg" },
}), }),
}) })

View File

@ -3,7 +3,7 @@ return {
"numToStr/Comment.nvim", "numToStr/Comment.nvim",
config = function() config = function()
require("Comment").setup({ require("Comment").setup({
pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook(), pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
}) })
end, end,
dependencies = { dependencies = {
@ -13,15 +13,15 @@ return {
vim.g.skip_ts_context_commentstring_module = true vim.g.skip_ts_context_commentstring_module = true
end, end,
config = function() config = function()
require('ts_context_commentstring').setup({ require("ts_context_commentstring").setup({
enable_autocmd = false enable_autocmd = false,
}) })
end end,
}, },
}, },
keys = { keys = {
{ "gc", desc = "> Comment: Line" }, { "gc", desc = "> Comment: Line" },
{ "gb", desc = "> Comment: Block " }, { "gb", desc = "> Comment: Block " },
{ "gbc", desc = "Comment: Toggle block comment" }, { "gbc", desc = "Comment: Toggle block comment" },
{ "gcc", desc = "Comment: Toggle line comment" }, { "gcc", desc = "Comment: Toggle line comment" },
{ "gcO", desc = "Comment: Add comment on line above" }, { "gcO", desc = "Comment: Add comment on line above" },

View File

@ -4,12 +4,12 @@ return {
dependencies = { dependencies = {
{ {
"tpope/vim-dadbod", "tpope/vim-dadbod",
lazy = true lazy = true,
}, },
{ {
"kristijanhusak/vim-dadbod-completion", "kristijanhusak/vim-dadbod-completion",
ft = { "sql", "mysql", "plsql" }, ft = { "sql", "mysql", "plsql" },
lazy = true lazy = true,
}, },
}, },
cmd = { cmd = {

View File

@ -25,7 +25,7 @@ return {
markdown = filetypes.markdown.prettierd, markdown = filetypes.markdown.prettierd,
css = filetypes.css.prettierd, css = filetypes.css.prettierd,
lua = filetypes.lua.stylua, lua = filetypes.lua.stylua,
sql = function () sql = function()
return { return {
exe = "sql-formatter", exe = "sql-formatter",
args = { args = {

View File

@ -22,7 +22,7 @@ return {
auto_refresh = true, auto_refresh = true,
filewatcher = { filewatcher = {
enabled = true, enabled = true,
interval = 1000 interval = 1000,
}, },
graph_style = "unicode", graph_style = "unicode",
integrations = { integrations = {
@ -81,7 +81,7 @@ return {
{ {
"linrongbin16/gitlinker.nvim", "linrongbin16/gitlinker.nvim",
cmd = { cmd = {
"GitLink" "GitLink",
}, },
opts = function() opts = function()
--- @param s string --- @param s string
@ -115,13 +115,13 @@ return {
return { return {
router = { router = {
browse = { browse = {
["^gitlab%.orion%-technologies%.io"] = gitlab_orion_router("blob") ["^gitlab%.orion%-technologies%.io"] = gitlab_orion_router("blob"),
}, },
blame = { blame = {
["^gitlab%.orion%-technologies%.io"] = gitlab_orion_router("blame") ["^gitlab%.orion%-technologies%.io"] = gitlab_orion_router("blame"),
} },
}, },
} }
end end,
} },
} }

View File

@ -1061,14 +1061,11 @@ return {
disable_winbar_cb = function(args) disable_winbar_cb = function(args)
if args.event == "FileType" then if args.event == "FileType" then
local ft = args.match local ft = args.match
local matches = vim.tbl_filter( local matches = vim.tbl_filter(function(excluded_ft)
function(excluded_ft) return ft:lower():find(excluded_ft) ~= nil
return ft:lower():find(excluded_ft) ~= nil end, {
end, ".*neogit.*",
{ })
".*neogit.*"
}
)
if #matches > 0 then if #matches > 0 then
return false return false
end end

View File

@ -100,7 +100,7 @@ return {
{ "u", gitsigns.undo_stage_hunk }, { "u", gitsigns.undo_stage_hunk },
{ "S", gitsigns.stage_buffer }, { "S", gitsigns.stage_buffer },
{ "p", gitsigns.preview_hunk }, { "p", gitsigns.preview_hunk },
{ "d", gitsigns.toggle_deleted, { nowait = true } }, { "d", gitsigns.toggle_deleted, { nowait = true } },
{ "b", gitsigns.blame_line }, { "b", gitsigns.blame_line },
{ {
"B", "B",
@ -108,9 +108,9 @@ return {
gitsigns.blame_line({ full = true }) gitsigns.blame_line({ full = true })
end, end,
}, },
{ "/", gitsigns.show, { exit = true } }, -- show the base of the file { "/", gitsigns.show, { exit = true } }, -- show the base of the file
{ "<Enter>", "<cmd>Neogit<CR>", { exit = true } }, { "<Enter>", "<cmd>Neogit<CR>", { exit = true } },
{ "q", nil, { exit = true, nowait = true } }, { "q", nil, { exit = true, nowait = true } },
}, },
}) })
@ -150,26 +150,36 @@ _b_: Toggle Breakpoint _l_: Toggle Log Breakpoint _B_: Toggle Conditional
^^ _<F7>_: Step Out _<F8>_: Step Back ^^ _<F7>_: Step Out _<F8>_: Step Back
]], ]],
heads = { heads = {
{ "c", ":DapContinue<CR>" }, { "c", ":DapContinue<CR>" },
{ "r", ":DapRunLast<CR>" }, { "r", ":DapRunLast<CR>" },
{ "e", ":DapTerminate<CR>" }, { "e", ":DapTerminate<CR>" },
{ "b", ":DapToggleBreakpoint<CR>" }, { "b", ":DapToggleBreakpoint<CR>" },
{ "B", function() require("dap").set_breakpoint(vim.fn.input("Breakpoint Condition: ")) end }, {
{ "l", function() require("dap").set_breakpoint(vim.fn.input("Breakpoint Condition: ")) end }, "B",
{ "s", require("dapui").toggle }, function()
{ "R", require("dap").run_to_cursor }, require("dap").set_breakpoint(vim.fn.input("Breakpoint Condition: "))
end,
},
{
"l",
function()
require("dap").set_breakpoint(vim.fn.input("Breakpoint Condition: "))
end,
},
{ "s", require("dapui").toggle },
{ "R", require("dap").run_to_cursor },
{ "<F5>", ":DapStepOver<CR>" }, { "<F5>", ":DapStepOver<CR>" },
{ "<F6>", ":DapStepInto<CR>" }, { "<F6>", ":DapStepInto<CR>" },
{ "<F7>", ":DapStepOut<CR>" }, { "<F7>", ":DapStepOut<CR>" },
{ "<F8>", require("dap").step_back } { "<F8>", require("dap").step_back },
}, },
config = { config = {
color = "pink", color = "pink",
invoke_on_body = true, invoke_on_body = true,
hint = { hint = {
border = "solid" border = "solid",
} },
} },
}) })
-- Hydra for diagrams -- Hydra for diagrams
@ -197,12 +207,12 @@ _b_: Toggle Breakpoint _l_: Toggle Log Breakpoint _B_: Toggle Conditional
mode = "n", mode = "n",
body = "<leader>hD", body = "<leader>hD",
heads = { heads = {
{ "H", "<C-v>h:VBox<CR>" }, { "H", "<C-v>h:VBox<CR>" },
{ "J", "<C-v>j:VBox<CR>" }, { "J", "<C-v>j:VBox<CR>" },
{ "K", "<C-v>k:VBox<CR>" }, { "K", "<C-v>k:VBox<CR>" },
{ "L", "<C-v>l:VBox<CR>" }, { "L", "<C-v>l:VBox<CR>" },
{ "f", ":VBox<CR>", { mode = "v" } }, { "f", ":VBox<CR>", { mode = "v" } },
{ "<Esc>", nil, { exit = true } }, { "<Esc>", nil, { exit = true } },
}, },
}) })

View File

@ -11,7 +11,7 @@ return {
exclude = { exclude = {
buftypes = { buftypes = {
"terminal", "terminal",
"nofile" "nofile",
}, },
filetypes = { filetypes = {
"help", "help",
@ -31,13 +31,13 @@ return {
"NeogitPopup", "NeogitPopup",
"NeogitLogView", "NeogitLogView",
"norg", "norg",
"org" "org",
} },
}, },
indent = { indent = {
char = "", char = "",
tab_char = "", tab_char = "",
smart_indent_cap = true smart_indent_cap = true,
}, },
scope = { scope = {
enabled = true, enabled = true,
@ -45,12 +45,12 @@ return {
node_type = { node_type = {
lua = { lua = {
"return_statement", "return_statement",
"table_constructor" "table_constructor",
}, },
nix = { nix = {
"binding" "binding",
} },
} },
}, },
highlight = { highlight = {
"RainbowDelimiterRed", "RainbowDelimiterRed",
@ -60,8 +60,8 @@ return {
"RainbowDelimiterGreen", "RainbowDelimiterGreen",
"RainbowDelimiterViolet", "RainbowDelimiterViolet",
"RainbowDelimiterCyan", "RainbowDelimiterCyan",
} },
} },
}) })
end, end,
}, },

View File

@ -206,7 +206,7 @@ return {
org_table_header = { fg = colors.crystalBlue, bg = colors.winterBlue }, org_table_header = { fg = colors.crystalBlue, bg = colors.winterBlue },
org_table = { bg = colors.winterBlue }, org_table = { bg = colors.winterBlue },
["@OrgTSBlock.org"] = { fg = colors.fujiGray, bold = true, italic = true }, ["@OrgTSBlock.org"] = { fg = colors.fujiGray, bold = true, italic = true },
["@OrgTSDirective.org"] = { link = "@OrgTSBlock.org" } ["@OrgTSDirective.org"] = { link = "@OrgTSBlock.org" },
} }
return overrides return overrides

View File

@ -29,8 +29,7 @@ local function on_attach(client, bufnr)
end end
end end
local lsp_capabilities = local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
local server_opts = { local server_opts = {
capabilities = lsp_capabilities, capabilities = lsp_capabilities,
on_attach = on_attach, on_attach = on_attach,
@ -96,8 +95,8 @@ return {
end, end,
}, },
{ {
'mrcjkb/rustaceanvim', "mrcjkb/rustaceanvim",
ft = { 'rust' }, ft = { "rust" },
config = function() config = function()
vim.g.rustaceanvim = { vim.g.rustaceanvim = {
server = { server = {
@ -111,7 +110,7 @@ return {
command = "codelldb", command = "codelldb",
args = { "--port", "${port}" }, args = { "--port", "${port}" },
}, },
} },
}, },
tools = { tools = {
executor = require("rustaceanvim.executors").termopen, executor = require("rustaceanvim.executors").termopen,
@ -120,7 +119,7 @@ return {
}, },
}, },
} }
end end,
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
@ -144,7 +143,7 @@ return {
}, },
}, },
keys = { keys = {
{ "<leader>l", desc = "> LSP" }, { "<leader>l", desc = "> LSP" },
{ {
"<leader>lh", "<leader>lh",
function() function()
@ -156,11 +155,11 @@ return {
end, end,
desc = "LSP: Toggle Diagnostics", desc = "LSP: Toggle Diagnostics",
}, },
{ "<leader>lD", vim.lsp.buf.declaration, desc = "LSP: Declaration" }, { "<leader>lD", vim.lsp.buf.declaration, desc = "LSP: Declaration" },
{ "<leader>k", vim.lsp.buf.hover, desc = "LSP: Hover" }, { "<leader>k", vim.lsp.buf.hover, desc = "LSP: Hover" },
{ "<leader>K", vim.lsp.buf.signature_help, desc = "LSP: Sig Help" }, { "<leader>K", vim.lsp.buf.signature_help, desc = "LSP: Sig Help" },
{ "<leader>lc", vim.lsp.buf.code_action, desc = "LSP: Code Action" }, { "<leader>lc", vim.lsp.buf.code_action, desc = "LSP: Code Action" },
{ "<leader>lR", ":LspRestart<CR>", desc = "LSP: Restart" }, { "<leader>lR", ":LspRestart<CR>", desc = "LSP: Restart" },
{ {
"<leader>ls", "<leader>ls",
function() function()
@ -265,11 +264,11 @@ return {
python = { python = {
analysis = { analysis = {
diagnosticMode = "workspace", diagnosticMode = "workspace",
typeCheckingMode = "strict" typeCheckingMode = "strict",
} },
}, },
capabilities = lsp_capabilities, capabilities = lsp_capabilities,
on_attach = on_attach on_attach = on_attach,
}) })
lspconfig.yamlls.setup({ lspconfig.yamlls.setup({
@ -307,11 +306,11 @@ return {
lspconfig.docker_compose_language_service.setup({ lspconfig.docker_compose_language_service.setup({
settings = { settings = {
telemetry = { telemetry = {
enableTelemetry = false enableTelemetry = false,
} },
}, },
capabilities = lsp_capabilities, capabilities = lsp_capabilities,
on_attach = on_attach on_attach = on_attach,
}) })
lspconfig.powershell_es.setup({ lspconfig.powershell_es.setup({

View File

@ -3,6 +3,8 @@ return {
"iamcco/markdown-preview.nvim", "iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" }, ft = { "markdown" },
build = function() vim.fn["mkdp#util#install"]() end, build = function()
} vim.fn["mkdp#util#install"]()
end,
},
} }

View File

@ -2,19 +2,25 @@ return {
{ {
"jbyuki/nabla.nvim", "jbyuki/nabla.nvim",
keys = { keys = {
{ ";nn", function() require("nabla").popup() end, desc = "Nabla: Popup" }, {
";nn",
function()
require("nabla").popup()
end,
desc = "Nabla: Popup",
},
{ {
";nv", ";nv",
function() function()
require("nabla").toggle_virt() require("nabla").toggle_virt()
end, end,
desc = "Nabla: Toggle Virt Lines" desc = "Nabla: Toggle Virt Lines",
} },
}, },
ft = { ft = {
"org", "org",
"tex" "tex",
}, },
config = false config = false,
} },
} }

View File

@ -2,7 +2,7 @@ return {
{ {
"shortcuts/no-neck-pain.nvim", "shortcuts/no-neck-pain.nvim",
opts = { opts = {
width = 160 width = 160,
}, },
cmds = { cmds = {
"NoNeckPain", "NoNeckPain",
@ -10,10 +10,10 @@ return {
"NoNeckPainWidthDown", "NoNeckPainWidthDown",
"NoNeckPainScratchPad", "NoNeckPainScratchPad",
"NoNeckPainToggleLeftSide", "NoNeckPainToggleLeftSide",
"NoNeckPainToggleRightSide" "NoNeckPainToggleRightSide",
}, },
keys = { keys = {
{"<leader>bb", "<cmd>NoNeckPain<cr>", desc = "NoNeckPain: Toggle", } { "<leader>bb", "<cmd>NoNeckPain<cr>", desc = "NoNeckPain: Toggle" },
} },
} },
} }

View File

@ -32,29 +32,28 @@ return {
routes = { routes = {
{ {
filter = { event = "msg_show", find = "Hop .*:" }, filter = { event = "msg_show", find = "Hop .*:" },
opts = { skip = true } opts = { skip = true },
}, },
-- Ignore `written` message -- Ignore `written` message
{ {
filter = { event = "msg_show", find = '^".*" %d*L, %d*B written$' }, filter = { event = "msg_show", find = '^".*" %d*L, %d*B written$' },
opts = { skip = true } opts = { skip = true },
}, },
-- Ignore `undo` message -- Ignore `undo` message
{ {
filter = { event = "msg_show", find = "^%d+ .*; before #%d+ %d+.*ago$" }, filter = { event = "msg_show", find = "^%d+ .*; before #%d+ %d+.*ago$" },
opts = { skip = true } opts = { skip = true },
}, },
-- Ignore `redo` message -- Ignore `redo` message
{ {
filter = { event = "msg_show", find = "^%d+ .*; after #%d+ %d+.*ago$" }, filter = { event = "msg_show", find = "^%d+ .*; after #%d+ %d+.*ago$" },
opts = { skip = true } opts = { skip = true },
}, },
{ {
view = "split", view = "split",
filter = { event = "msg_show", min_height = 20 }, filter = { event = "msg_show", min_height = 20 },
}, },
},
}
}, },
dependencies = { dependencies = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries

View File

@ -5,7 +5,7 @@ return {
config = function() config = function()
require("lint").linters_by_ft = { require("lint").linters_by_ft = {
markdown = { "proselint" }, markdown = { "proselint" },
dockerfile = { "hadolint" } dockerfile = { "hadolint" },
} }
vim.api.nvim_create_autocmd({ "BufWritePost", "BufEnter" }, { vim.api.nvim_create_autocmd({ "BufWritePost", "BufEnter" }, {
callback = function() callback = function()

View File

@ -1,7 +1,7 @@
vim.api.nvim_create_autocmd("BufReadPre", { vim.api.nvim_create_autocmd("BufReadPre", {
callback = function() callback = function()
vim.b.ufo_foldlevel = 0 vim.b.ufo_foldlevel = 0
end end,
}) })
local change_buf_foldlevel_by = function(num) local change_buf_foldlevel_by = function(num)
@ -31,14 +31,14 @@ return {
function() function()
require("ufo").openAllFolds() require("ufo").openAllFolds()
end, end,
desc = "UFO: Open All Folds" desc = "UFO: Open All Folds",
}, },
{ {
"zM", "zM",
function() function()
require("ufo").closeAllFolds() require("ufo").closeAllFolds()
end, end,
desc = "UFO: Close All Folds" desc = "UFO: Close All Folds",
}, },
{ {
"zm", "zm",
@ -49,7 +49,7 @@ return {
end end
change_buf_foldlevel_by(count or -1) change_buf_foldlevel_by(count or -1)
end, end,
desc = "UFO: Fold Less" desc = "UFO: Fold Less",
}, },
{ {
"zr", "zr",
@ -60,7 +60,7 @@ return {
end end
change_buf_foldlevel_by(count or 1) change_buf_foldlevel_by(count or 1)
end, end,
desc = "UFO: Fold More" desc = "UFO: Fold More",
}, },
{ {
"zS", "zS",
@ -71,7 +71,7 @@ return {
set_buf_foldlevel(vim.v.count) set_buf_foldlevel(vim.v.count)
end end
end, end,
desc = "UFO: Set Foldlevel" desc = "UFO: Set Foldlevel",
}, },
}, },
opts = function() opts = function()

View File

@ -16,10 +16,10 @@ return {
"", "",
"󰬪", "󰬪",
"󱆭", "󱆭",
} },
} },
} },
} },
}, },
ft = { "org" }, ft = { "org" },
keys = { keys = {
@ -36,7 +36,7 @@ return {
org_agenda_files = "~/Notes/**/*", org_agenda_files = "~/Notes/**/*",
org_default_notes_file = "~/Notes/notes.org", org_default_notes_file = "~/Notes/notes.org",
org_startup_folded = "inherit", org_startup_folded = "inherit",
org_todo_keywords = {'TODO(t)', 'NEXT(n)', '|', 'DONE(d)', "CANCELLED(c)" }, org_todo_keywords = { "TODO(t)", "NEXT(n)", "|", "DONE(d)", "CANCELLED(c)" },
win_split_mode = "auto", win_split_mode = "auto",
org_capture_templates = { org_capture_templates = {
t = { t = {
@ -46,12 +46,12 @@ return {
j = { j = {
description = "Journal", description = "Journal",
template = "\n* %? %U :journal:", template = "\n* %? %U :journal:",
target = "~/Notes/journal/%<%Y-%m-%d>.org" target = "~/Notes/journal/%<%Y-%m-%d>.org",
}, },
}, },
emacs_config = { emacs_config = {
config_path = "$HOME/.config/emacs/init.el" config_path = "$HOME/.config/emacs/init.el",
} },
}) })
vim.api.nvim_set_hl(0, "org_code", { link = "@field" }) vim.api.nvim_set_hl(0, "org_code", { link = "@field" })
@ -65,5 +65,5 @@ return {
vim.cmd.edit() vim.cmd.edit()
end end
end, end,
} },
} }

View File

@ -4,10 +4,10 @@ return {
ft = { "http" }, ft = { "http" },
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter" "nvim-treesitter/nvim-treesitter",
}, },
config = function () config = function()
require("rest-nvim").setup({}) require("rest-nvim").setup({})
end end,
} },
} }

View File

@ -34,7 +34,7 @@ return {
{ "<leader>tm", ":Telescope man_pages<CR>", desc = "Telescope: Man Pages" }, { "<leader>tm", ":Telescope man_pages<CR>", desc = "Telescope: Man Pages" },
{ "<leader>tq", ":Telescope quickfixhistry", desc = "LSP: Telescope Quickfix History" }, { "<leader>tq", ":Telescope quickfixhistry", desc = "LSP: Telescope Quickfix History" },
{ "<leader>nv", ":Telescope notify<CR>", desc = "Notifications: Search" }, { "<leader>nv", ":Telescope notify<CR>", desc = "Notifications: Search" },
{ "<leader>tt", ":Telescope<CR>", desc = "Telescope: Open Telescope" } { "<leader>tt", ":Telescope<CR>", desc = "Telescope: Open Telescope" },
}, },
dependencies = { dependencies = {
"artart222/telescope_find_directories", "artart222/telescope_find_directories",
@ -58,7 +58,7 @@ return {
"f", "f",
"--strip-cwd-prefix", "--strip-cwd-prefix",
"--exclude", "--exclude",
".git/" ".git/",
}, },
}, },
}, },
@ -71,7 +71,7 @@ return {
"--line-number", "--line-number",
"--column", "--column",
"--smart-case", "--smart-case",
"--hidden" "--hidden",
}, },
history = { history = {
path = "~/.local/share/nvim/databases/telescope_history.sqlite3", path = "~/.local/share/nvim/databases/telescope_history.sqlite3",

View File

@ -3,11 +3,11 @@ return {
{ {
"danymat/neogen", "danymat/neogen",
keys = { keys = {
{ "<leader>ng", desc = "> Neogen" }, { "<leader>ng", desc = "> Neogen" },
{ "<leader>ngf", "<cmd>Neogen func<CR>", desc = "Neogen: Function Annotation" }, { "<leader>ngf", "<cmd>Neogen func<CR>", desc = "Neogen: Function Annotation" },
{ "<leader>ngc", "<cmd>Neogen class<CR>", desc = "Neogen: Class Annotation" }, { "<leader>ngc", "<cmd>Neogen class<CR>", desc = "Neogen: Class Annotation" },
{ "<leader>ngt", "<cmd>Neogen type<CR>", desc = "Neogen: Type Annotation" }, { "<leader>ngt", "<cmd>Neogen type<CR>", desc = "Neogen: Type Annotation" },
{ "<leader>ngb", "<cmd>Neogen file<CR>", desc = "Neogen: File Annotation" }, { "<leader>ngb", "<cmd>Neogen file<CR>", desc = "Neogen: File Annotation" },
}, },
cmd = { cmd = {
"Neogen", "Neogen",
@ -32,7 +32,7 @@ return {
}, },
config = function() config = function()
require("treesitter-context").setup({ require("treesitter-context").setup({
max_lines = 3 max_lines = 3,
}) })
vim.cmd.TSContextEnable() vim.cmd.TSContextEnable()
end, end,
@ -144,7 +144,7 @@ return {
disable = function(_, buf) disable = function(_, buf)
local disabled_filetypes = { local disabled_filetypes = {
"tex", "tex",
"log" "log",
} }
for _, ft in ipairs(disabled_filetypes) do for _, ft in ipairs(disabled_filetypes) do

View File

@ -42,26 +42,26 @@ return {
dependencies = { "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
config = function() config = function()
vim.api.nvim_create_autocmd("QuickFixCmdPost", { vim.api.nvim_create_autocmd("QuickFixCmdPost", {
callback = function () callback = function()
vim.cmd.TroubleRefresh() vim.cmd.TroubleRefresh()
vim.cmd.Trouble("quickfix") vim.cmd.Trouble("quickfix")
end end,
}) })
-- HACK: Unfortuantely Neovim & Vim don't expose some C level functions to know when content in the -- HACK: Unfortuantely Neovim & Vim don't expose some C level functions to know when content in the
-- quickfix has been updated 😢. A serious issue with this is that it just tries to refresh after 200ms, -- quickfix has been updated 😢. A serious issue with this is that it just tries to refresh after 200ms,
-- which may or may not work depending on how long the quickfix filtering took :/ -- which may or may not work depending on how long the quickfix filtering took :/
vim.api.nvim_create_autocmd({"CmdlineLeave", "CmdwinLeave"}, { vim.api.nvim_create_autocmd({ "CmdlineLeave", "CmdwinLeave" }, {
callback = function () callback = function()
vim.defer_fn(vim.cmd.TroubleRefresh, 200) vim.defer_fn(vim.cmd.TroubleRefresh, 200)
end end,
}) })
require("trouble").setup({ require("trouble").setup({
auto_open = false, auto_open = false,
auto_close = true, auto_close = true,
position = "right", position = "right",
action_keys = { action_keys = {
cancel = "q" cancel = "q",
} },
}) })
end, end,
cmd = { cmd = {

View File

@ -3,7 +3,7 @@ return {
"chrisgrieser/nvim-various-textobjs", "chrisgrieser/nvim-various-textobjs",
opts = { opts = {
useDefaultKeymaps = true, useDefaultKeymaps = true,
disabledKeymaps = { "r", "R" } disabledKeymaps = { "r", "R" },
} },
}, },
} }

View File

@ -1,5 +1,5 @@
return { return {
{ {
"tpope/vim-repeat" "tpope/vim-repeat",
} },
} }

View File

@ -2,14 +2,14 @@ return {
{ {
"dhruvasagar/vim-table-mode", "dhruvasagar/vim-table-mode",
keys = { keys = {
{ ";;", "<cmd>TableModeRealign<CR>", desc = "Table Mode: Realign" } { ";;", "<cmd>TableModeRealign<CR>", desc = "Table Mode: Realign" },
}, },
lazy = false, lazy = false,
init = function() init = function()
vim.g.table_mode_map_prefix = ';t' vim.g.table_mode_map_prefix = ";t"
vim.g.table_mode_always_active = 1 vim.g.table_mode_always_active = 1
vim.g.table_mode_header_fillchar = '-' vim.g.table_mode_header_fillchar = "-"
vim.g.table_mode_corner = '|' vim.g.table_mode_corner = "|"
end end,
} },
} }

View File

@ -10,8 +10,10 @@ if not vim.uv.fs_stat(lazypath) then
lazypath, lazypath,
}):wait() }):wait()
if status.code > 0 then if status.code > 0 then
error("Failed to install lazy.nvim!\n====STDOUT====\n" .. status.stdout .. "\n====STDERR====\n" ..status.stderr) error(
"Failed to install lazy.nvim!\n====STDOUT====\n" .. status.stdout .. "\n====STDERR====\n" .. status.stderr
)
end end
end end
vim.opt.runtimepath:prepend(lazypath) vim.opt.runtimepath:prepend(lazypath)