Update 2025-01-07

This commit is contained in:
2025-01-07 10:22:56 +02:00
parent f8a4240bf6
commit 1c5aee84a0
21 changed files with 555 additions and 302 deletions

View File

@@ -1,6 +1,5 @@
return {
{
"saghen/blink.cmp",
dependencies = {
"folke/lazydev.nvim",
@@ -13,30 +12,43 @@ return {
{
"MattiasMTS/cmp-dbee",
dependencies = {
{ "kndndrj/nvim-dbee" },
"kndndrj/nvim-dbee",
},
ft = { "sql", "mysql", "plsql" },
opts = {},
},
{
"petertriho/cmp-git",
ft = { "gitcommit", "octo", "NeogitCommitMessage" },
},
},
version = "*",
-- build = "cargo build --release", -- build from source
opts = {
-- 'default' for mappings similar to built-in completion
-- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate)
-- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
-- "default" for mappings similar to built-in completion
-- "super-tab" for mappings similar to vscode (tab to accept, arrow keys to navigate)
-- "enter" for mappings similar to 'super-tab' but with 'enter' to accept
-- See the full "keymap" documentation for information on defining your own keymap.
keymap = {
preset = "default",
["<C-e>"] = { "hide", "show", "fallback" },
["<cr>"] = { "select_and_accept", "fallback" },
["<C-u>"] = { "scroll_documentation_up", "fallback" },
["<C-d>"] = { "scroll_documentation_down", "fallback" },
["<C-u>"] = {
function(cmp)
cmp.scroll_documentation_up(4)
end,
},
["<C-d>"] = {
function(cmp)
cmp.scroll_documentation_down(4)
end,
},
["<C-g>"] = {
function()
require("blink-cmp").show({ sources = { "ripgrep" } })
end,
"fallback",
},
["<Tab>"] = {},
["<S-Tab>"] = {},
@@ -50,7 +62,7 @@ return {
-- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend`
sources = {
default = { "lazydev", "crates", "lsp", "path", "luasnip", "buffer", "dbee" },
default = { "lazydev", "crates", "lsp", "path", "luasnip", "buffer", "git", "dbee" },
providers = {
lazydev = {
name = "LazyDev",
@@ -65,7 +77,7 @@ return {
git = {
name = "git",
module = "blink.compat.source",
score_offset = 10,
score_offset = 20,
},
dbee = {
name = "cmp-dbee",
@@ -88,17 +100,31 @@ return {
},
},
completion = {
documentation = { window = { border = "single" }, auto_show = true },
ghost_text = { enabled = true },
-- 'prefix' will fuzzy match on the text before the cursor
-- 'full' will fuzzy match on the text before *and* after the cursor
-- example: 'foo_|_bar' will match 'foo_' for 'prefix' and 'foo__bar' for 'full'
keyword = { range = "full" },
-- Disable auto brackets
-- NOTE: some LSPs may add auto brackets themselves anyway
accept = { auto_brackets = { enabled = true } },
-- Insert completion item on selection, don't select by default
-- list = { selection = "auto_insert" },
list = {
selection = function(ctx)
return ctx.mode == "cmdline" and "auto_insert" or "preselect"
end,
},
menu = {
border = "single",
auto_show = function(ctx)
return ctx.mode ~= "cmdline"
end,
border = "single",
draw = {
columns = { { "kind_icon" }, { "label", "label_description", gap = 1 }, { "kind" } },
components = {
kind_icon = {
ellipsis = false,
ellipsis = true,
text = function(ctx)
local kind_icon, _, _ = require("mini.icons").get("lsp", ctx.kind)
return kind_icon
@@ -112,6 +138,8 @@ return {
},
},
},
documentation = { window = { border = "single" }, auto_show = true },
ghost_text = { enabled = true },
},
signature = { enabled = true, window = { border = "single" } },
snippets = {

View File

@@ -1,111 +1,15 @@
return {
"petertriho/cmp-git",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local format = require("cmp_git.format")
local sort = require("cmp_git.sort")
require("cmp_git").setup({
-- defaults
filetypes = { "gitcommit", "octo" },
remotes = { "upstream", "origin" }, -- in order of most to least prioritized
enableRemoteUrlRewrites = false, -- enable git url rewrites, see https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf
git = {
commits = {
limit = 100,
sort_by = sort.git.commits,
format = format.git.commits,
},
ft = { "gitcommit", "octo", "NeogitCommitMessage" },
opts = {
gitlab = {
hosts = {
"git.modulation.lv",
},
github = {
hosts = {}, -- list of private instances of github
issues = {
fields = { "title", "number", "body", "updatedAt", "state" },
filter = "all", -- assigned, created, mentioned, subscribed, all, repos
limit = 100,
state = "open", -- open, closed, all
sort_by = sort.github.issues,
format = format.github.issues,
},
mentions = {
limit = 100,
sort_by = sort.github.mentions,
format = format.github.mentions,
},
pull_requests = {
fields = { "title", "number", "body", "updatedAt", "state" },
limit = 100,
state = "open", -- open, closed, merged, all
sort_by = sort.github.pull_requests,
format = format.github.pull_requests,
},
},
gitlab = {
hosts = {
"git.modulation.lv",
}, -- list of private instances of gitlab
issues = {
limit = 100,
state = "opened", -- opened, closed, all
sort_by = sort.gitlab.issues,
format = format.gitlab.issues,
},
mentions = {
limit = 100,
sort_by = sort.gitlab.mentions,
format = format.gitlab.mentions,
},
merge_requests = {
limit = 100,
state = "opened", -- opened, closed, locked, merged
sort_by = sort.gitlab.merge_requests,
format = format.gitlab.merge_requests,
},
},
trigger_actions = {
{
debug_name = "git_commits",
trigger_character = ":",
action = function(sources, trigger_char, callback, params, git_info)
return sources.git:get_commits(callback, params, trigger_char)
end,
},
{
debug_name = "gitlab_issues",
trigger_character = "#",
action = function(sources, trigger_char, callback, params, git_info)
return sources.gitlab:get_issues(callback, git_info, trigger_char)
end,
},
{
debug_name = "gitlab_mentions",
trigger_character = "@",
action = function(sources, trigger_char, callback, params, git_info)
return sources.gitlab:get_mentions(callback, git_info, trigger_char)
end,
},
{
debug_name = "gitlab_mrs",
trigger_character = "!",
action = function(sources, trigger_char, callback, params, git_info)
return sources.gitlab:get_merge_requests(callback, git_info, trigger_char)
end,
},
{
debug_name = "github_issues_and_pr",
trigger_character = "#",
action = function(sources, trigger_char, callback, params, git_info)
return sources.github:get_issues_and_prs(callback, git_info, trigger_char)
end,
},
{
debug_name = "github_mentions",
trigger_character = "@",
action = function(sources, trigger_char, callback, params, git_info)
return sources.github:get_mentions(callback, git_info, trigger_char)
end,
},
},
})
},
},
config = function(_, opts)
require("cmp_git").setup(opts)
end,
}

View File

@@ -1,12 +0,0 @@
return {
"Exafunction/codeium.nvim",
enabled = false,
dependencies = {
"nvim-lua/plenary.nvim",
"hrsh7th/nvim-cmp",
},
cmd = { "Codeium" },
opts = {
enable_chat = true,
},
}

View File

@@ -15,6 +15,7 @@ return {
"typst",
"htmldjango",
"conf",
"rust",
},
user_default_options = {
RGB = true, -- #RGB hex codes

View File

@@ -194,21 +194,22 @@ return {
require("mason-nvim-dap").setup({
ensure_installed = {
"firefox-debug-adapter",
"codelldb",
},
automatic_install = true,
})
require("nvim-dap-virtual-text").setup({})
-- Python
--- Python
require("dap-python").setup("python")
-- JS/TS
--- JS/TS
local firefox_debug_adapter = mason_registry.get_package("firefox-debug-adapter"):get_install_path()
.. "/dist/adapter.bundle.js"
dap.adapters.firefox = {
type = "executable",
command = "bun",
command = "node",
args = { firefox_debug_adapter },
}
dap.configurations.javascript = {
@@ -222,6 +223,7 @@ return {
firefoxExecutable = "/usr/bin/floorp",
},
}
dap.configurations.javascriptreact = dap.configurations.javascript
dap.configurations.typescript = dap.configurations.javascript
dap.configurations.typescriptreact = dap.configurations.javascript

View File

@@ -18,6 +18,6 @@ return {
--- https://github.com/kndndrj/nvim-dbee/blob/master/lua/dbee/config.lua
},
config = function(_, opts)
require("dbee").setup(opts)
require("dbee").setup()
end,
}

View File

@@ -1,5 +1,17 @@
return {
"mawkler/demicolon.nvim",
keys = {
";",
",",
"t",
"f",
"T",
"F",
"]",
"[",
"]d",
"[d",
},
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-treesitter/nvim-treesitter-textobjects",

58
lua/plugins/gh.lua Normal file
View File

@@ -0,0 +1,58 @@
return {
"ldelossa/gh.nvim",
dependencies = {
{
"ldelossa/litee.nvim",
config = function()
require("litee.lib").setup()
end,
},
"folke/which-key.nvim",
},
otps = {
-- deprecated, around for compatability for now.
jump_mode = "invoking",
-- remap the arrow keys to resize any litee.nvim windows.
map_resize_keys = false,
-- do not map any keys inside any gh.nvim buffers.
disable_keymaps = false,
-- the icon set to use.
icon_set = "default",
-- any custom icons to use.
icon_set_custom = nil,
-- whether to register the @username and #issue_number omnifunc completion
-- in buffers which start with .git/
git_buffer_completion = true,
-- defines keymaps in gh.nvim buffers.
keymaps = {
-- when inside a gh.nvim panel, this key will open a node if it has
-- any futher functionality. for example, hitting <CR> on a commit node
-- will open the commit's changed files in a new gh.nvim panel.
open = "<CR>",
-- when inside a gh.nvim panel, expand a collapsed node
expand = "zo",
-- when inside a gh.nvim panel, collpased and expanded node
collapse = "zc",
-- when cursor is over a "#1234" formatted issue or PR, open its details
-- and comments in a new tab.
goto_issue = "gd",
-- show any details about a node, typically, this reveals commit messages
-- and submitted review bodys.
details = "d",
-- inside a convo buffer, submit a comment
submit_comment = "<C-s>",
-- inside a convo buffer, when your cursor is ontop of a comment, open
-- up a set of actions that can be performed.
actions = "<C-a>",
-- inside a thread convo buffer, resolve the thread.
resolve_thread = "<C-r>",
-- inside a gh.nvim panel, if possible, open the node's web URL in your
-- browser. useful particularily for digging into external failed CI
-- checks.
goto_web = "gx",
},
},
config = function(_, opts)
require("litee.gh").setup(opts)
end,
}

6
lua/plugins/hardtime.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
"m4xshen/hardtime.nvim",
enabled = false,
dependencies = { "MunifTanjim/nui.nvim" },
opts = {},
}

View File

@@ -1,5 +1,6 @@
return {
"3rd/image.nvim",
enabled = false,
opts = {
backend = "ueberzug",
processor = "magick_rock", -- or "magick_cli"

3
lua/plugins/just.lua Normal file
View File

@@ -0,0 +1,3 @@
return {
"chrisgrieser/nvim-justice",
}

View File

@@ -6,25 +6,58 @@ return {
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter",
"nvim-neotest/neotest-python",
"mrcjkb/rustaceanvim",
"alfaix/neotest-gtest",
"nvim-neotest/neotest-vim-test",
"mrcjkb/rustaceanvim",
},
-- enabled = false,
config = function()
require("neotest").setup({
adapters = {
require("neotest-python")({
dap = { justMyCode = false },
args = { "--log-level", "DEBUG" },
runner = "pytest",
}),
require("rustaceanvim.neotest"),
require("neotest-gtest").setup({}),
require("neotest-vim-test")({
ignore_file_types = { "python", "vim", "lua" },
}),
},
})
cmd = { "Neotest" },
keys = {
{
"<leader>tt",
function()
require("neotest").watch.toggle(vim.fn.expand("%"))
end,
desc = "Toggle Neo[T]est",
},
{
"<leader>ts",
function()
require("neotest").summary.toggle()
end,
desc = "Toggle [S]ummary",
},
{
"<leader>tj",
function()
require("neotest").jump.next({ status = "failed" })
end,
desc = "Jump to next",
},
{
"<leader>tk",
function()
require("neotest").jump.prev({ status = "failed" })
end,
desc = "Jump to prev",
},
},
opts = function(_, opts)
opts = opts or {}
opts.adapters = {
require("neotest-python")({
dap = { justMyCode = false },
args = { "--log-level", "DEBUG" },
runner = "pytest",
}),
require("neotest-gtest").setup({}),
require("neotest-vim-test")({
ignore_file_types = { "python", "vim", "lua" },
}),
require("rustaceanvim.neotest"),
}
return opts
end,
config = function(_, opts)
require("neotest").setup(opts)
end,
}

View File

@@ -8,6 +8,7 @@ return {
desc = "Open parent directory",
},
},
version = "*",
lazy = false,
opts = {
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`)
@@ -42,7 +43,7 @@ return {
-- Skip the confirmation popup for simple operations
skip_confirm_for_simple_edits = false,
-- Deleted files will be removed with the trash_command (below).
--delete_to_trash = true,
delete_to_trash = true,
-- Change this to customize the command used when deleting to trash
trash_command = "trash-put",
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
@@ -77,12 +78,28 @@ return {
show_hidden = true,
-- This function defines what is considered a "hidden" file
is_hidden_file = function(name, bufnr)
return vim.startswith(name, ".")
local m = name:match("^%.")
return m ~= nil
end,
-- This function defines what will never be shown, even when `show_hidden` is set
is_always_hidden = function(name, bufnr)
return false
end,
-- Sort file names with numbers in a more intuitive order for humans.
-- Can be "fast", true, or false. "fast" will turn it off for large directories.
natural_order = "fast",
-- Sort file and directory names case insensitive
case_insensitive = false,
sort = {
-- sort order can be "asc" or "desc"
-- see :help oil-columns to see which columns are sortable
{ "type", "asc" },
{ "name", "asc" },
},
-- Customize the highlight group for the file name
highlight_filename = function(entry, is_hidden, is_link_target, is_link_orphan)
return nil
end,
},
-- Configuration for the floating window in oil.open_float
float = {

View File

@@ -3,5 +3,22 @@ return {
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
enabled = false,
keys = {
{
"<leader>Ot",
function()
require("otter").open()
end,
desc = "Open Otter",
},
{
"<leader>Oc",
function()
require("otter").close()
end,
desc = "Close Otter",
},
},
opts = {},
}

View File

@@ -3,48 +3,41 @@ return {
version = "^5",
lazy = false,
opts = {
tools = {},
tools = {
hover_actions = {
replace_builtin_hover = false,
},
},
server = {
on_attach = function(_, bufnr)
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
end,
settings = {
-- on_attach = function(client, bufnr)
-- -- you can also put keymaps in here
-- end,
["rust-analyzer"] = {
--- https://github.com/rust-lang/rust-analyzer/blob/master/docs/user/generated_config.adoc
cargo = {
features = "all",
extraEnv = { RUSTC_WRAPPER = "sccache" },
},
completion = {
fullFunctionSignatures = { enable = true },
termSearch = { enable = true },
privateEditable = { enable = true },
},
diagnostics = {
styleLints = { enable = true },
},
inlayHints = {
bindingModeHints = {
enable = false,
},
chainingHints = {
enable = true,
},
closingBraceHints = {
enable = true,
minLines = 25,
},
closureReturnTypeHints = {
enable = true,
},
lifetimeElisionHints = {
enable = "never",
useParameterNames = false,
},
maxLength = 25,
parameterHints = {
enable = true,
},
reborrowHints = {
enable = "never",
},
renderColons = true,
typeHints = {
enable = true,
hideClosureInitialization = false,
hideNamedConstructor = false,
},
bindingModeHints = { enable = true },
closureCaptureHints = { enable = true },
closureReturnTypeHints = { enable = "always" },
discriminantHints = { enable = "always" },
rangeExclusiveHints = { enable = true },
},
},
},
},
dap = {},
},
config = function(_, opts)

View File

@@ -266,6 +266,21 @@ return {
hide_current_buffer = true,
show_scores = true,
},
import = {
insert_at_top = true,
custom_languages = {
-- {
-- extensions = { "js", "ts" },
-- filetypes = { "vue" },
-- insert_at_line = 2,
-- regex = [[^(?:import(?:[\"'\s]*([\w*{}\n, ]+)from\s*)?[\"'\s](.*?)[\"'\s].*)]],
-- },
},
},
package_info = {
-- Optional theme (the extension doesn't set a default theme)
theme = "ivy",
},
},
},
config = function(_, opts)

View File

@@ -1,69 +1,76 @@
return {
"pmizio/typescript-tools.nvim",
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
ft = { "javascriptreact", "typescriptreact", "javascript", "typescript" },
opts = {
handlers = {},
on_attach = function(client)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
end,
settings = {
-- spawn additional tsserver instance to calculate diagnostics on it
separate_diagnostic_server = true,
-- "change"|"insert_leave" determine when the client asks the server about diagnostic
publish_diagnostic_on = "insert_leave",
-- array of strings("fix_all"|"add_missing_imports"|"remove_unused"|
-- "remove_unused_imports"|"organize_imports") -- or string "all"
-- to include all supported code actions
-- specify commands exposed as code_actions
expose_as_code_action = "all",
-- string|nil - specify a custom path to `tsserver.js` file, if this is nil or file under path
-- not exists then standard path resolution strategy is applied
tsserver_path = nil,
-- specify a list of plugins to load by tsserver, e.g., for support `styled-components`
-- (see 💅 `styled-components` support section)
tsserver_plugins = {
"@styled/typescript-styled-plugin",
},
-- this value is passed to: https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes
-- memory limit in megabytes or "auto"(basically no limit)
tsserver_max_memory = "auto",
-- described below
tsserver_format_options = function(ft)
-- Return empty table to disable formatting
return {}
{
"pmizio/typescript-tools.nvim",
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
ft = { "javascriptreact", "typescriptreact", "javascript", "typescript" },
opts = {
handlers = {},
on_attach = function(client)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
end,
tsserver_file_preferences = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayVariableTypeHintsWhenTypeMatchesName = false,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
},
-- locale of all tsserver messages, supported locales you can find here:
-- https://github.com/microsoft/TypeScript/blob/3c221fc086be52b19801f6e8d82596d04607ede6/src/compiler/utilitiesPublic.ts#L620
tsserver_locale = "en",
-- mirror of VSCode's `typescript.suggest.completeFunctionCalls`
complete_function_calls = true,
include_completions_with_insert_text = true,
-- CodeLens
-- WARNING: Experimental feature also in VSCode, because it might hit performance of server.
-- possible values: ("off"|"all"|"implementations_only"|"references_only")
code_lens = "all",
-- by default code lenses are displayed on all referencable values and for some of you it can
-- be too much this option reduce count of them by removing member references from lenses
disable_member_code_lens = true,
-- JSXCloseTag
-- WARNING: it is disabled by default (maybe you configuration or distro already uses nvim-ts-autotag,
-- that maybe have a conflict if enable this feature. )
jsx_close_tag = {
enable = false,
filetypes = { "javascriptreact", "typescriptreact" },
settings = {
-- spawn additional tsserver instance to calculate diagnostics on it
separate_diagnostic_server = true,
-- "change"|"insert_leave" determine when the client asks the server about diagnostic
publish_diagnostic_on = "insert_leave",
-- array of strings("fix_all"|"add_missing_imports"|"remove_unused"|
-- "remove_unused_imports"|"organize_imports") -- or string "all"
-- to include all supported code actions
-- specify commands exposed as code_actions
expose_as_code_action = "all",
-- string|nil - specify a custom path to `tsserver.js` file, if this is nil or file under path
-- not exists then standard path resolution strategy is applied
tsserver_path = nil,
-- specify a list of plugins to load by tsserver, e.g., for support `styled-components`
-- (see 💅 `styled-components` support section)
tsserver_plugins = {
"@styled/typescript-styled-plugin",
},
-- this value is passed to: https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes
-- memory limit in megabytes or "auto"(basically no limit)
tsserver_max_memory = "auto",
-- described below
tsserver_format_options = function(ft)
-- Return empty table to disable formatting
return {}
end,
tsserver_file_preferences = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayVariableTypeHintsWhenTypeMatchesName = false,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
},
-- locale of all tsserver messages, supported locales you can find here:
-- https://github.com/microsoft/TypeScript/blob/3c221fc086be52b19801f6e8d82596d04607ede6/src/compiler/utilitiesPublic.ts#L620
tsserver_locale = "en",
-- mirror of VSCode's `typescript.suggest.completeFunctionCalls`
complete_function_calls = true,
include_completions_with_insert_text = true,
-- CodeLens
-- WARNING: Experimental feature also in VSCode, because it might hit performance of server.
-- possible values: ("off"|"all"|"implementations_only"|"references_only")
code_lens = "all",
-- by default code lenses are displayed on all referencable values and for some of you it can
-- be too much this option reduce count of them by removing member references from lenses
disable_member_code_lens = true,
-- JSXCloseTag
-- WARNING: it is disabled by default (maybe you configuration or distro already uses nvim-ts-autotag,
-- that maybe have a conflict if enable this feature. )
jsx_close_tag = {
enable = false,
filetypes = { "javascriptreact", "typescriptreact" },
},
},
},
},
{
"dmmulroy/ts-error-translator.nvim",
ft = { "javascriptreact", "typescriptreact", "javascript", "typescript" },
},
}

View File

@@ -25,11 +25,12 @@ return {
-- Custom format string to open the output link provided with %s
-- Example: open_cmd = 'firefox %s -P typst-preview --class typst-preview'
open_cmd = "xdg-open %s",
-- open_cmd = "floorp %s -P typst-preview --class typst-preview",
-- Setting this to 'always' will invert black and white in the preview
-- Setting this to 'auto' will invert depending if the browser has enable
-- dark mode
invert_colors = "never",
invert_colors = nil,
-- Whether the preview will follow the cursor in the source file
follow_cursor = true,
@@ -39,7 +40,7 @@ return {
-- required.
dependencies_bin = {
-- if you are using tinymist, just set ['typst-preview'] = "tinymist".
["typst-preview"] = nil,
["typst-preview"] = "tinymist",
["websocat"] = nil,
},
-- A list of extra arguments (or nil) to be passed to previewer.