Compare commits

..

10 Commits

9 changed files with 532 additions and 15 deletions

View File

@@ -2,3 +2,10 @@
path = ~/.dotfiles/git/configs/common.gitconfig
path = ~/.dotfiles/git/profiles/aim-robotics.gitconfig
[includeIf "gitdir:~/.dotfiles/"]
path = ~/.dotfiles/git/profiles/Dreaded_X.gitconfig
; I don't have my private key on work machines
[commit]
gpgsign = false

View File

@@ -2,3 +2,10 @@
path = ~/.dotfiles/git/configs/common.gitconfig
path = ~/.dotfiles/git/profiles/ALTEN.gitconfig
[includeIf "gitdir:~/.dotfiles"]
path = ~/.dotfiles/git/profiles/Dreaded_X.gitconfig
; I don't have my private key on work machines
[commit]
gpgsign = false

View File

@@ -6,9 +6,11 @@
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
"conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" },
"crates.nvim": { "branch": "main", "commit": "afcd1cc3eeceb5783676fc8464389b9216a29d05" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"eyeliner.nvim": { "branch": "main", "commit": "8f197eb30cecdf4c2cc9988a5eecc6bc34c0c7d6" },
"fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
"gitlab.nvim": { "branch": "develop", "commit": "3d2828a9504b87fc36ee2aca1b0f36cf75003edd" },
"gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" },
"gruvbox.nvim": { "branch": "main", "commit": "334d5fd49fc8033f26408425366c66c6390c57bb" },
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
@@ -20,6 +22,7 @@
"mason-lspconfig.nvim": { "branch": "main", "commit": "a676ab7282da8d651e175118bcf54483ca11e46d" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
"multicolumn.nvim": { "branch": "master", "commit": "a363bdfd422abf26256f343dac4df183031f8e94" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "9d6826582a3e8c84787bd7355df22a2812a1ad59" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-colorizer.lua": { "branch": "master", "commit": "ef211089af881bea206c7aa3f2693a81feee7e90" },

View File

@@ -75,20 +75,20 @@ local function on_attach(client, bufnr)
end
-- Highlight references under cursor
if client:supports_method(methods.textDocument_documentHighlight) then
local lsp_hover_hl = vim.api.nvim_create_augroup("LspHoverHighlight", { clear = false })
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
buffer = bufnr,
group = lsp_hover_hl,
callback = vim.lsp.buf.document_highlight,
})
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
buffer = bufnr,
group = lsp_hover_hl,
callback = vim.lsp.buf.clear_references,
})
end
-- if client:supports_method(methods.textDocument_documentHighlight) then
-- local lsp_hover_hl = vim.api.nvim_create_augroup("LspHoverHighlight", { clear = false })
-- vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
-- buffer = bufnr,
-- group = lsp_hover_hl,
-- callback = vim.lsp.buf.document_highlight,
-- })
--
-- vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
-- buffer = bufnr,
-- group = lsp_hover_hl,
-- callback = vim.lsp.buf.clear_references,
-- })
-- end
end
vim.diagnostic.config({

View File

@@ -0,0 +1,412 @@
-- https://github.com/sindrets/diffview.nvim
--- @module "lazy"
--- @type LazySpec
return {
"sindrets/diffview.nvim",
opts = function()
local actions = require("diffview.actions")
return {
use_icons = false,
-- Disable default keymaps just so we can change <leader>e -> <leader>f
keymaps = {
disable_defaults = true,
view = {
-- The `view` bindings are active in the diff buffers, only when the current
-- tabpage is a Diffview.
{
"n",
"<tab>",
actions.select_next_entry,
{ desc = "Open the diff for the next file" },
},
{
"n",
"<s-tab>",
actions.select_prev_entry,
{ desc = "Open the diff for the previous file" },
},
{
"n",
"[F",
actions.select_first_entry,
{ desc = "Open the diff for the first file" },
},
{
"n",
"]F",
actions.select_last_entry,
{ desc = "Open the diff for the last file" },
},
{
"n",
"gf",
actions.goto_file_edit,
{ desc = "Open the file in the previous tabpage" },
},
{ "n", "<C-w><C-f>", actions.goto_file_split, { desc = "Open the file in a new split" } },
{ "n", "<C-w>gf", actions.goto_file_tab, { desc = "Open the file in a new tabpage" } },
{ "n", "<leader>f", actions.focus_files, { desc = "Bring focus to the file panel" } },
{ "n", "<leader>b", actions.toggle_files, { desc = "Toggle the file panel." } },
{
"n",
"g<C-x>",
actions.cycle_layout,
{ desc = "Cycle through available layouts." },
},
{
"n",
"[x",
actions.prev_conflict,
{ desc = "In the merge-tool: jump to the previous conflict" },
},
{
"n",
"]x",
actions.next_conflict,
{ desc = "In the merge-tool: jump to the next conflict" },
},
{
"n",
"<leader>co",
actions.conflict_choose("ours"),
{ desc = "Choose the OURS version of a conflict" },
},
{
"n",
"<leader>ct",
actions.conflict_choose("theirs"),
{ desc = "Choose the THEIRS version of a conflict" },
},
{
"n",
"<leader>cb",
actions.conflict_choose("base"),
{ desc = "Choose the BASE version of a conflict" },
},
{
"n",
"<leader>ca",
actions.conflict_choose("all"),
{ desc = "Choose all the versions of a conflict" },
},
{ "n", "dx", actions.conflict_choose("none"), { desc = "Delete the conflict region" } },
{
"n",
"<leader>cO",
actions.conflict_choose_all("ours"),
{ desc = "Choose the OURS version of a conflict for the whole file" },
},
{
"n",
"<leader>cT",
actions.conflict_choose_all("theirs"),
{ desc = "Choose the THEIRS version of a conflict for the whole file" },
},
{
"n",
"<leader>cB",
actions.conflict_choose_all("base"),
{ desc = "Choose the BASE version of a conflict for the whole file" },
},
{
"n",
"<leader>cA",
actions.conflict_choose_all("all"),
{ desc = "Choose all the versions of a conflict for the whole file" },
},
{
"n",
"dX",
actions.conflict_choose_all("none"),
{ desc = "Delete the conflict region for the whole file" },
},
},
file_panel = {
{
"n",
"j",
actions.next_entry,
{ desc = "Bring the cursor to the next file entry" },
},
{
"n",
"<down>",
actions.next_entry,
{ desc = "Bring the cursor to the next file entry" },
},
{
"n",
"k",
actions.prev_entry,
{ desc = "Bring the cursor to the previous file entry" },
},
{
"n",
"<up>",
actions.prev_entry,
{ desc = "Bring the cursor to the previous file entry" },
},
{
"n",
"<cr>",
actions.select_entry,
{ desc = "Open the diff for the selected entry" },
},
{
"n",
"o",
actions.select_entry,
{ desc = "Open the diff for the selected entry" },
},
{
"n",
"l",
actions.select_entry,
{ desc = "Open the diff for the selected entry" },
},
{
"n",
"<2-LeftMouse>",
actions.select_entry,
{ desc = "Open the diff for the selected entry" },
},
{
"n",
"-",
actions.toggle_stage_entry,
{ desc = "Stage / unstage the selected entry" },
},
{
"n",
"s",
actions.toggle_stage_entry,
{ desc = "Stage / unstage the selected entry" },
},
{ "n", "S", actions.stage_all, { desc = "Stage all entries" } },
{ "n", "U", actions.unstage_all, { desc = "Unstage all entries" } },
{
"n",
"X",
actions.restore_entry,
{ desc = "Restore entry to the state on the left side" },
},
{ "n", "L", actions.open_commit_log, { desc = "Open the commit log panel" } },
{ "n", "zo", actions.open_fold, { desc = "Expand fold" } },
{ "n", "h", actions.close_fold, { desc = "Collapse fold" } },
{ "n", "zc", actions.close_fold, { desc = "Collapse fold" } },
{ "n", "za", actions.toggle_fold, { desc = "Toggle fold" } },
{ "n", "zR", actions.open_all_folds, { desc = "Expand all folds" } },
{ "n", "zM", actions.close_all_folds, { desc = "Collapse all folds" } },
{ "n", "<c-b>", actions.scroll_view(-0.25), { desc = "Scroll the view up" } },
{ "n", "<c-f>", actions.scroll_view(0.25), { desc = "Scroll the view down" } },
{
"n",
"<tab>",
actions.select_next_entry,
{ desc = "Open the diff for the next file" },
},
{
"n",
"<s-tab>",
actions.select_prev_entry,
{ desc = "Open the diff for the previous file" },
},
{
"n",
"[F",
actions.select_first_entry,
{ desc = "Open the diff for the first file" },
},
{
"n",
"]F",
actions.select_last_entry,
{ desc = "Open the diff for the last file" },
},
{
"n",
"gf",
actions.goto_file_edit,
{ desc = "Open the file in the previous tabpage" },
},
{
"n",
"<C-w><C-f>",
actions.goto_file_split,
{ desc = "Open the file in a new split" },
},
{
"n",
"<C-w>gf",
actions.goto_file_tab,
{ desc = "Open the file in a new tabpage" },
},
{
"n",
"i",
actions.listing_style,
{ desc = "Toggle between 'list' and 'tree' views" },
},
{
"n",
"f",
actions.toggle_flatten_dirs,
{ desc = "Flatten empty subdirectories in tree listing style" },
},
{
"n",
"R",
actions.refresh_files,
{ desc = "Update stats and entries in the file list" },
},
{
"n",
"<leader>f",
actions.focus_files,
{ desc = "Bring focus to the file panel" },
},
{ "n", "<leader>b", actions.toggle_files, { desc = "Toggle the file panel" } },
{ "n", "g<C-x>", actions.cycle_layout, { desc = "Cycle available layouts" } },
{ "n", "[x", actions.prev_conflict, { desc = "Go to the previous conflict" } },
{ "n", "]x", actions.next_conflict, { desc = "Go to the next conflict" } },
{ "n", "g?", actions.help("file_panel"), { desc = "Open the help panel" } },
{
"n",
"<leader>cO",
actions.conflict_choose_all("ours"),
{ desc = "Choose the OURS version of a conflict for the whole file" },
},
{
"n",
"<leader>cT",
actions.conflict_choose_all("theirs"),
{ desc = "Choose the THEIRS version of a conflict for the whole file" },
},
{
"n",
"<leader>cB",
actions.conflict_choose_all("base"),
{ desc = "Choose the BASE version of a conflict for the whole file" },
},
{
"n",
"<leader>cA",
actions.conflict_choose_all("all"),
{ desc = "Choose all the versions of a conflict for the whole file" },
},
{
"n",
"dX",
actions.conflict_choose_all("none"),
{ desc = "Delete the conflict region for the whole file" },
},
},
file_history_panel = {
{ "n", "g!", actions.options, { desc = "Open the option panel" } },
{
"n",
"<C-A-d>",
actions.open_in_diffview,
{ desc = "Open the entry under the cursor in a diffview" },
},
{
"n",
"y",
actions.copy_hash,
{ desc = "Copy the commit hash of the entry under the cursor" },
},
{ "n", "L", actions.open_commit_log, { desc = "Show commit details" } },
{
"n",
"X",
actions.restore_entry,
{ desc = "Restore file to the state from the selected entry" },
},
{ "n", "zo", actions.open_fold, { desc = "Expand fold" } },
{ "n", "zc", actions.close_fold, { desc = "Collapse fold" } },
{ "n", "h", actions.close_fold, { desc = "Collapse fold" } },
{ "n", "za", actions.toggle_fold, { desc = "Toggle fold" } },
{ "n", "zR", actions.open_all_folds, { desc = "Expand all folds" } },
{ "n", "zM", actions.close_all_folds, { desc = "Collapse all folds" } },
{
"n",
"j",
actions.next_entry,
{ desc = "Bring the cursor to the next file entry" },
},
{
"n",
"<down>",
actions.next_entry,
{ desc = "Bring the cursor to the next file entry" },
},
{
"n",
"k",
actions.prev_entry,
{ desc = "Bring the cursor to the previous file entry" },
},
{
"n",
"<up>",
actions.prev_entry,
{ desc = "Bring the cursor to the previous file entry" },
},
{
"n",
"<cr>",
actions.select_entry,
{ desc = "Open the diff for the selected entry" },
},
{
"n",
"o",
actions.select_entry,
{ desc = "Open the diff for the selected entry" },
},
{
"n",
"l",
actions.select_entry,
{ desc = "Open the diff for the selected entry" },
},
{
"n",
"<2-LeftMouse>",
actions.select_entry,
{ desc = "Open the diff for the selected entry" },
},
{ "n", "<c-b>", actions.scroll_view(-0.25), { desc = "Scroll the view up" } },
{ "n", "<c-f>", actions.scroll_view(0.25), { desc = "Scroll the view down" } },
{ "n", "<tab>", actions.select_next_entry, { desc = "Open the diff for the next file" } },
{
"n",
"<s-tab>",
actions.select_prev_entry,
{ desc = "Open the diff for the previous file" },
},
{
"n",
"[F",
actions.select_first_entry,
{ desc = "Open the diff for the first file" },
},
{ "n", "]F", actions.select_last_entry, { desc = "Open the diff for the last file" } },
{
"n",
"gf",
actions.goto_file_edit,
{ desc = "Open the file in the previous tabpage" },
},
{ "n", "<C-w><C-f>", actions.goto_file_split, { desc = "Open the file in a new split" } },
{ "n", "<C-w>gf", actions.goto_file_tab, { desc = "Open the file in a new tabpage" } },
{ "n", "<leader>f", actions.focus_files, { desc = "Bring focus to the file panel" } },
{ "n", "<leader>b", actions.toggle_files, { desc = "Toggle the file panel" } },
{ "n", "g<C-x>", actions.cycle_layout, { desc = "Cycle available layouts" } },
{ "n", "g?", actions.help("file_history_panel"), { desc = "Open the help panel" } },
},
},
}
end,
}

View File

@@ -0,0 +1,39 @@
local window = require("symbols.window")
-- https://github.com/harrisoncramer/gitlab.nvim
--- @module "lazy"
--- @type LazySpec
return {
"harrisoncramer/gitlab.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim",
},
cond = function()
return vim.fn.executable("go") > 0
end,
build = function()
require("gitlab.server").build(true)
end, -- Builds the Go binary
opts = {
discussion_tree = {
draft_mode = true,
},
popup = {
border = window.border,
},
discussion_signs = {
virtual_text = true,
},
keymaps = {
discussion_tree = {
toggle_node = "za",
toggle_all_discussions = "zA",
},
popup = {
perform_action = "w",
discard_changes = "<esc>",
},
},
},
}

View File

@@ -0,0 +1,41 @@
-- https://github.com/aznhe21/fmbarina/multicolumn.nvim
local function enforced(rulers, scope)
return {
rulers = rulers,
scope = scope or "window",
full_column = false,
to_line_end = true,
bg_color = "#691b1b",
fg_color = "#ffd8ad",
}
end
--- @module "lazy"
--- @type LazySpec
return {
"fmbarina/multicolumn.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
base_set = {
full_column = true,
},
sets = {
python = enforced({ 89 }),
rust = enforced({ 101 }),
gitcommit = function(_, win)
local T = function(c, x, y)
if c then
return x
else
return y
end
end
return enforced(
{ T(vim.fn.line(".", win) == 1, 51, 73) },
T(vim.fn.line(".", win) == 1, "line", "window")
)
end,
},
},
}

View File

@@ -14,6 +14,8 @@ set -g history-limit 5000
set -g detach-on-destroy off # don't exit from tmux when closing a session
set -g @fzf-url-fzf-options '-p'
# Setup vi-mode with better keybindings
# TODO: Escape does not work properly for leaving
setw -g mode-keys vi

View File

@@ -39,6 +39,8 @@ HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT=3
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
# Default to insert mode
ZVM_LINE_INIT_MODE=i
# Enable system clipboard
ZVM_SYSTEM_CLIPBOARD_ENABLED=true
# Make p and P use the system clipboard, instead of CUTBUFFER,
@@ -112,6 +114,9 @@ if [ -d "$PNPM_HOME" ]; then
else
unset PNPM_HOME
fi
if (( $+commands[pnpm] )); then
source <(pnpm completion zsh)
fi
export FZF_DEFAULT_OPTS='--tmux'
export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS'
@@ -121,7 +126,8 @@ export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS'
--color=border:#7c6f64,label:#7c6f64
--border="sharp" --border-label-pos="0" --preview-window="border-sharp"
--prompt="> " --marker="◆" --pointer=">" --separator="─"
--scrollbar="│" --info="right"'
--scrollbar="│" --info="right"
--layout="default"'
if (( $+commands[fd] )); then
export FZF_DEFAULT_COMMAND="fd --type f --strip-cwd-prefix"