Update 2024-12-15

This commit is contained in:
2024-12-15 18:06:23 +02:00
parent 41b7eb733a
commit 180d744d94
15 changed files with 311 additions and 88 deletions

View File

@@ -1,6 +1,7 @@
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
enabled = false,
opts = {
disable_filetype = { "TelescopePrompt", "spectre_panel" },
disable_in_macro = true, -- disable when recording or executing a macro

View File

@@ -9,6 +9,7 @@ return {
function()
require("conform").format({ async = true, lsp_fallback = true })
end,
mode = "",
desc = "[F]ormat buffer",
},
},
@@ -38,10 +39,19 @@ return {
yaml = { "yamlfmt" },
["_"] = { "trim_whitespace" },
},
format_on_save = {
lsp_fallback = true,
timeout_ms = 500,
},
format_on_save = function(bufnr)
-- Disable formatting for .bru files
local bufname = vim.api.nvim_buf_get_name(bufnr)
if bufname:match("%.bru$") then
return false
end
-- Return normal format settings for other files
return {
timeout_ms = 500,
lsp_fallback = true,
}
end,
log_level = vim.log.levels.ERROR,
notify_on_error = true,
},

View File

@@ -16,7 +16,7 @@ return {
filetypes = { "norg" },
},
typst = {
enabled = true,
enabled = false,
filetypes = { "typst" },
},
html = {

View File

@@ -31,18 +31,18 @@ return {
-- When enabled, will watch the `.git/` directory for changes and refresh the status buffer in response to filesystem
-- events.
filewatcher = {
interval = 1000,
interval = 500,
enabled = true,
},
-- "ascii" is the graph the git CLI generates
-- "unicode" is the graph like https://github.com/rbong/vim-flog
-- "kitty" is the graph like https://github.com/isakbm/gitgraph.nvim - use https://github.com/rbong/flog-symbols if you don't use Kitty
graph_style = "ascii",
-- Used to generate URL's for branch popup action "pull request".
git_services = {
["github.com"] = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1",
["bitbucket.org"] = "https://bitbucket.org/${owner}/${repository}/pull-requests/new?source=${branch_name}&t=1",
["gitlab.com"] = "https://gitlab.com/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}",
["git.modulation.lv"] = "https://git.modulation.lv/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}",
},
-- Allows a different telescope sorter. Defaults to 'fuzzy_with_index_bias'. The example below will use the native fzf
-- sorter instead. By default, this function returns `nil`.
@@ -80,23 +80,55 @@ return {
-- Change the default way of opening neogit
kind = "tab",
-- Disable line numbers and relative line numbers
disable_line_numbers = true,
disable_line_numbers = false,
-- The time after which an output console is shown for slow running commands
console_timeout = 2000,
console_timeout = 1000,
-- Automatically show console if a command takes more than console_timeout milliseconds
auto_show_console = true,
notification_icon = "󰊢",
status = {
recent_commit_count = 10,
},
commit_editor = {
kind = "auto",
show_head_commit_hash = true,
recent_commit_count = 10,
HEAD_padding = 10,
HEAD_folded = false,
mode_padding = 3,
mode_text = {
M = "modified",
N = "new file",
A = "added",
D = "deleted",
C = "copied",
U = "updated",
R = "renamed",
DD = "unmerged",
AU = "unmerged",
UD = "unmerged",
UA = "unmerged",
DU = "unmerged",
AA = "unmerged",
UU = "unmerged",
["?"] = "",
},
},
commit_select_view = {
kind = "tab",
show_staged_diff = true,
-- Accepted values:
-- "split" to show the staged diff below the commit editor
-- "vsplit" to show it to the right
-- "split_above" Like :top split
-- "vsplit_left" like :vsplit, but open to the left
-- "auto" "vsplit" if window would have 80 cols, otherwise "split"
staged_diff_split_kind = "split",
spell_check = true,
},
commit_view = {
kind = "vsplit",
verify_commit = os.execute("which gpg") == 0, -- Can be set to true or false, otherwise we try to find the binary
verify_commit = vim.fn.executable("gpg") == 1, -- Can be set to true or false, otherwise we try to find the binary
},
log_view = {
kind = "tab",
@@ -108,7 +140,7 @@ return {
kind = "tab",
},
merge_editor = {
kind = "auto",
kind = "tab",
},
tag_editor = {
kind = "auto",
@@ -119,6 +151,12 @@ return {
popup = {
kind = "split",
},
stash = {
kind = "tab",
},
refs_view = {
kind = "tab",
},
signs = {
-- { CLOSED, OPENED }
hunk = { "", "" },
@@ -140,6 +178,11 @@ return {
-- is also selected then telescope is used instead
-- Requires you to have `ibhagwan/fzf-lua` installed.
fzf_lua = nil,
-- If enabled, uses mini.pick for menu selection. If the telescope integration
-- is also selected then telescope is used instead
-- Requires you to have `echasnovski/mini.pick` installed.
mini_pick = nil,
},
sections = {
-- Reverting/Cherry Picking
@@ -193,6 +236,13 @@ return {
["q"] = "Close",
["<c-c><c-c>"] = "Submit",
["<c-c><c-k>"] = "Abort",
["<m-p>"] = "PrevMessage",
["<m-n>"] = "NextMessage",
["<m-r>"] = "ResetMessage",
},
commit_editor_I = {
["<c-c><c-c>"] = "Submit",
["<c-c><c-k>"] = "Abort",
},
rebase_editor = {
["p"] = "Pick",
@@ -209,6 +259,12 @@ return {
["gj"] = "MoveDown",
["<c-c><c-c>"] = "Submit",
["<c-c><c-k>"] = "Abort",
["[c"] = "OpenOrScrollUp",
["]c"] = "OpenOrScrollDown",
},
rebase_editor_I = {
["<c-c><c-c>"] = "Submit",
["<c-c><c-k>"] = "Abort",
},
finder = {
["<cr>"] = "Select",
@@ -218,20 +274,33 @@ return {
["<c-p>"] = "Previous",
["<down>"] = "Next",
["<up>"] = "Previous",
["<tab>"] = "MultiselectToggleNext",
["<s-tab>"] = "MultiselectTogglePrevious",
["<tab>"] = "InsertCompletion",
["<space>"] = "MultiselectToggleNext",
["<s-space>"] = "MultiselectTogglePrevious",
-- ["<s-tab>"] = "MultiselectTogglePrevious",
["q"] = "Close",
["<c-j>"] = "NOP",
["<ScrollWheelDown>"] = "ScrollWheelDown",
["<ScrollWheelUp>"] = "ScrollWheelUp",
["<ScrollWheelLeft>"] = "NOP",
["<ScrollWheelRight>"] = "NOP",
["<LeftMouse>"] = "MouseClick",
["<2-LeftMouse>"] = "NOP",
},
-- Setting any of these to `false` will disable the mapping.
popup = {
["?"] = "HelpPopup",
["A"] = "CherryPickPopup",
["D"] = "DiffPopup",
["d"] = "DiffPopup",
["M"] = "RemotePopup",
["P"] = "PushPopup",
["X"] = "ResetPopup",
["Z"] = "StashPopup",
["i"] = "IgnorePopup",
["t"] = "TagPopup",
["b"] = "BranchPopup",
["B"] = "BisectPopup",
["w"] = "WorktreePopup",
["c"] = "CommitPopup",
["f"] = "FetchPopup",
["l"] = "LogPopup",
@@ -239,32 +308,42 @@ return {
["p"] = "PullPopup",
["r"] = "RebasePopup",
["v"] = "RevertPopup",
["w"] = "WorktreePopup",
},
status = {
["j"] = "MoveDown",
["k"] = "MoveUp",
["o"] = "OpenTree",
["q"] = "Close",
["I"] = "InitRepo",
["1"] = "Depth1",
["2"] = "Depth2",
["3"] = "Depth3",
["4"] = "Depth4",
["Q"] = "Command",
["<tab>"] = "Toggle",
["x"] = "Discard",
["s"] = "Stage",
["S"] = "StageUnstaged",
["<c-s>"] = "StageAll",
["u"] = "Unstage",
["K"] = "Untrack",
["U"] = "UnstageStaged",
["y"] = "ShowRefs",
["$"] = "CommandHistory",
-- ["#"] = "Console",
["Y"] = "YankSelected",
["<c-r>"] = "RefreshBuffer",
["<enter>"] = "GoToFile",
["<cr>"] = "GoToFile",
["<s-cr>"] = "PeekFile",
["<c-v>"] = "VSplitOpen",
["<c-x>"] = "SplitOpen",
["<c-t>"] = "TabOpen",
["{"] = "GoToPreviousHunkHeader",
["}"] = "GoToNextHunkHeader",
["[c"] = "OpenOrScrollUp",
["]c"] = "OpenOrScrollDown",
["<c-k>"] = "PeekUp",
["<c-j>"] = "PeekDown",
},
},
},

View File

@@ -6,6 +6,7 @@ return {
-- the font settings with size and fallback font
font = "JetBrainsMono NF=34",
-- the theme to use, depends on themes available to silicon
-- theme = "Rosé Pine",
theme = "Dracula",
-- the background color outside the rendered os window
background = "#1a1b26",
@@ -17,7 +18,7 @@ return {
-- whether to have the os window rendered with rounded corners
no_round_corner = false,
-- whether to put the close, minimize, maximise traffic light controls on the border
no_window_controls = false,
no_window_controls = true,
-- whether to turn off the line numbers
no_line_number = false,
-- with which number the line numbering shall start, the default is 1, but here a
@@ -48,7 +49,7 @@ return {
return "~/Pictures/screenshots/code/" .. os.date("!%Y_%m_%d-%H_%M_%S") .. ".png"
end,
-- whether to put the image onto the clipboard, may produce an error if run on WSL2
to_clipboard = false,
to_clipboard = true,
-- the silicon command, put an absolute location here, if the command is not in your PATH
command = "silicon",
-- a string or function returning a string that defines the title showing in the image

View File

@@ -5,11 +5,21 @@ return {
"nvim-treesitter/nvim-treesitter-context",
"JoosepAlviste/nvim-ts-context-commentstring",
"nvim-treesitter/nvim-treesitter-textobjects",
"luckasRanarison/tree-sitter-hyprlang",
"kristoferssolo/tree-sitter-bruno",
},
opts = {
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "cpp", "lua", "rust", "python", "markdown", "json", "http", "markdown_inline", "sql" }, -- one of "all" or a list of languages
ensure_installed = {
"cpp",
"lua",
"rust",
"python",
"markdown",
"json",
"http",
"markdown_inline",
"sql",
}, -- one of "all" or a list of languages
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer

View File

@@ -4,6 +4,10 @@ return {
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,
@@ -26,7 +30,10 @@ return {
-- memory limit in megabytes or "auto"(basically no limit)
tsserver_max_memory = "auto",
-- described below
tsserver_format_options = {},
tsserver_format_options = function(ft)
-- Return empty table to disable formatting
return {}
end,
tsserver_file_preferences = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,

View File

@@ -24,6 +24,13 @@ return {
},
{
{ "<leader>C", vim.cmd.bdelete, desc = "[C]lose Buffer" },
{
"<leader>X",
function()
vim.cmd("!chmod +x %")
end,
desc = "Make E[x]ecutable",
},
{ "<leader>c", group = "[C]url", { "<leader>cC", group = "[C]SV" } },
{ "<leader>x", group = "Trouble" },
{ "<leader>g", group = "[G]it" },

View File

@@ -30,19 +30,7 @@ vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
-- Highlight Yanked Text
vim.api.nvim_create_autocmd({ "TextYankPost" }, {
callback = function()
vim.highlight.on_yank({ higroup = "Visual", timeout = 200 })
end,
})
-- Format File on Save
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
callback = function()
local file_path = vim.fs.normalize(vim.fn.expand("%:p")):lower()
local exclude_pattern = "dio"
if not string.match(file_path:lower(), exclude_pattern:lower()) then
vim.lsp.buf.format()
end
vim.highlight.on_yank({ higroup = "Visual", timeout = 100 })
end,
})
@@ -56,7 +44,7 @@ vim.api.nvim_create_autocmd({ "InsertEnter" }, {
vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
pattern = "**/Codnity/**",
callback = function()
vim.opt.colorcolumn = "79"
vim.opt.colorcolumn = "92"
end,
})
@@ -88,15 +76,6 @@ vim.filetype.add({
pattern = {
[".*/hypr/.*%.conf"] = "hyprlang",
},
extension = {
["http"] = "http",
},
})
vim.filetype.add({
pattern = {
["*.bru"] = "js",
},
})
vim.api.nvim_create_autocmd({ "VimEnter" }, {