Various changes

[nvim] New plugins; formatting in the old config
[zsh] ssh-agent
This commit is contained in:
Adam Cooper 2025-02-18 20:35:30 -05:00
parent 38aab12b16
commit ef2f0ecdbe
4 changed files with 681 additions and 774 deletions

View file

@ -44,39 +44,31 @@ vim.g.netrw_winsize = 25 -- width of the file explorer
vim.g.netrw_liststyle = 3 -- tree style listing vim.g.netrw_liststyle = 3 -- tree style listing
-- Sane vim split naviagation (via Gaslight blog) -- Sane vim split naviagation (via Gaslight blog)
vim.keymap.set("n", "<c-j>", "<c-w>j", { noremap = true, desc = 'Go to window below' }) vim.keymap.set("n", "<c-j>", "<c-w>j", { noremap = true, desc = "Go to window below" })
vim.keymap.set("n", "<c-k>", "<c-w>k", { noremap = true, desc = 'Go to window above' }) vim.keymap.set("n", "<c-k>", "<c-w>k", { noremap = true, desc = "Go to window above" })
vim.keymap.set("n", "<c-h>", "<c-w>h", { noremap = true, desc = 'Go to window to the left' }) vim.keymap.set("n", "<c-h>", "<c-w>h", { noremap = true, desc = "Go to window to the left" })
-- N.B. This conflicts with the NetRW directory refresh command. Use the alternative `:e .`. -- N.B. This conflicts with the NetRW directory refresh command. Use the alternative `:e .`.
-- TODO: This seems not to work for netrw. -- TODO: This seems not to work for netrw.
vim.keymap.set("n", "<c-l>", "<c-w>l", { noremap = true, desc = 'Go to window to the right' }) vim.keymap.set("n", "<c-l>", "<c-w>l", { noremap = true, desc = "Go to window to the right" })
vim.keymap.set("t", "<c-j>", "<c-\\><c-n><c-w>j", { noremap = true, desc = 'Go to window below' }) vim.keymap.set("t", "<c-j>", "<c-\\><c-n><c-w>j", { noremap = true, desc = "Go to window below" })
vim.keymap.set("t", "<c-k>", "<c-\\><c-n><c-w>k", { noremap = true, desc = 'Go to window above' }) vim.keymap.set("t", "<c-k>", "<c-\\><c-n><c-w>k", { noremap = true, desc = "Go to window above" })
vim.keymap.set("t", "<c-h>", "<c-\\><c-n><c-w>h", { noremap = true, desc = 'Go to window to the left' }) vim.keymap.set("t", "<c-h>", "<c-\\><c-n><c-w>h", { noremap = true, desc = "Go to window to the left" })
vim.keymap.set("t", "<c-l>", "<c-\\><c-n><c-w>l", { noremap = true, desc = 'Go to window to the right' }) vim.keymap.set("t", "<c-l>", "<c-\\><c-n><c-w>l", { noremap = true, desc = "Go to window to the right" })
vim.keymap.set( vim.keymap.set({ "n", "t" }, "<leader>z", function()
{ "n", "t" },
"<leader>z",
function()
-- This restores the UI to the saved layout 'idelayout' (if it exists) -- This restores the UI to the saved layout 'idelayout' (if it exists)
if vim.fn.exists("idelayout") ~= 0 then if vim.fn.exists("idelayout") ~= 0 then
vim.cmd("exec idelayout") vim.cmd("exec idelayout")
end end
end, end, { desc = "Revert window layout" })
{ desc = "Revert window layout" }
)
local terminalgroup = vim.api.nvim_create_augroup("TerminalGroup", { clear = true }) local terminalgroup = vim.api.nvim_create_augroup("TerminalGroup", { clear = true })
vim.api.nvim_create_autocmd( vim.api.nvim_create_autocmd({ "TermOpen", "TermEnter" }, {
{ "TermOpen", "TermEnter" },
{
group = terminalgroup, group = terminalgroup,
pattern = "*", pattern = "*",
command = "set nonumber" command = "set nonumber",
} })
)
-- lazy.nvim -- lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
@ -100,7 +92,7 @@ require("lazy").setup({
priority = 1000, priority = 1000,
config = function() config = function()
vim.cmd.colorscheme("vibrantink2") vim.cmd.colorscheme("vibrantink2")
end end,
}, },
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
@ -115,7 +107,7 @@ require("lazy").setup({
require("nvim-surround").setup({ require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults -- Configuration here, or leave empty to use defaults
}) })
end end,
}, },
{ {
"folke/which-key.nvim", "folke/which-key.nvim",
@ -144,7 +136,9 @@ require("lazy").setup({
"ray-x/lsp_signature.nvim", "ray-x/lsp_signature.nvim",
event = "VeryLazy", event = "VeryLazy",
opts = {}, opts = {},
config = function(_, opts) require 'lsp_signature'.setup(opts) end config = function(_, opts)
require("lsp_signature").setup(opts)
end,
}, },
{ {
"folke/lazydev.nvim", "folke/lazydev.nvim",
@ -312,8 +306,7 @@ require("lazy").setup({
{ {
"microsoft/vscode-js-debug", "microsoft/vscode-js-debug",
-- After install, build it and rename the dist directory to out -- After install, build it and rename the dist directory to out
build = build = "npm install --legacy-peer-deps --no-save && npx gulp vsDebugServerBundle && rm -rf out && mv dist out",
"npm install --legacy-peer-deps --no-save && npx gulp vsDebugServerBundle && rm -rf out && mv dist out",
version = "1.*", version = "1.*",
}, },
{ {
@ -369,8 +362,7 @@ require("lazy").setup({
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
{ {
"nvim-telescope/telescope-fzf-native.nvim", "nvim-telescope/telescope-fzf-native.nvim",
build = build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
"cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
}, },
}, },
}, },
@ -404,14 +396,14 @@ require("lazy").setup({
--{ "monkoose/parsley", event = "VeryLazy" }, --{ "monkoose/parsley", event = "VeryLazy" },
{ "monkoose/nvlime", ft = { "lisp" }, dependencies = { "monkoose/parsley" } }, { "monkoose/nvlime", ft = { "lisp" }, dependencies = { "monkoose/parsley" } },
{ {
'MeanderingProgrammer/markdown.nvim', "MeanderingProgrammer/markdown.nvim",
-- name = 'render-markdown', -- Only needed if you have another plugin named markdown.nvim -- name = 'render-markdown', -- Only needed if you have another plugin named markdown.nvim
dependencies = { dependencies = {
'nvim-treesitter/nvim-treesitter', -- Mandatory "nvim-treesitter/nvim-treesitter", -- Mandatory
'nvim-tree/nvim-web-devicons', -- Optional but recommended "nvim-tree/nvim-web-devicons", -- Optional but recommended
}, },
config = function() config = function()
require('render-markdown').setup({}) require("render-markdown").setup({})
end, end,
}, },
{ "jparise/vim-graphql" }, { "jparise/vim-graphql" },
@ -422,41 +414,41 @@ Mason manages external editor plugins such as LSP servers, DAP servers,
linters, and formatters. There are further recommended plugins for better linters, and formatters. There are further recommended plugins for better
integration. integration.
--]] --]]
require('mason').setup() require("mason").setup()
require('mason-lspconfig').setup() require("mason-lspconfig").setup()
--[[ lualine --[[ lualine
Lualine provides the status bar as well as the tabline. Lualine provides the status bar as well as the tabline.
--]] --]]
require('lualine').setup { require("lualine").setup({
options = { theme = 'dracula' }, options = { theme = "dracula" },
tabline = { tabline = {
lualine_a = { lualine_a = {
{ {
'buffers', "buffers",
mode = 4, mode = 4,
}, },
}, },
}, },
} })
--[[ Telescope --[[ Telescope
Telescope provides lists, pickers, etc. This section includes just the Telescope provides lists, pickers, etc. This section includes just the
functions bound to keymaps. functions bound to keymaps.
--]] --]]
local builtin = require('telescope.builtin') local builtin = require("telescope.builtin")
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope: find files' }) vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Telescope: find files" })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope: live grep' }) vim.keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "Telescope: live grep" })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope: buffers' }) vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Telescope: buffers" })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope: help tags' }) vim.keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "Telescope: help tags" })
require "lsp_signature".setup() require("lsp_signature").setup()
--[[ nvim-cmp --[[ nvim-cmp
nvim-cmp is a text completion engine. nvim-cmp is a text completion engine.
]] ]]
local cmp = require 'cmp' local cmp = require("cmp")
cmp.setup({ cmp.setup({
snippet = { snippet = {
@ -470,46 +462,46 @@ cmp.setup({
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4), ["<C-b>"] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ["<C-f>"] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ["<C-Space>"] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(), ["<C-e>"] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. ["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = "nvim_lsp" },
{ name = 'vsnip' }, -- For vsnip users. { name = "vsnip" }, -- For vsnip users.
}, { }, {
{ name = 'buffer' }, { name = "buffer" },
{ name = 'nvim_lsp_signature_help' }, { name = "nvim_lsp_signature_help" },
}) }),
}) })
-- Set configuration for specific filetype. -- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', { cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). { name = "git" }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}, { }, {
{ name = 'buffer' }, { name = "buffer" },
}) }),
}) })
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, { cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = { sources = {
{ name = 'buffer' } { name = "buffer" },
} },
}) })
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', { cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'path' } { name = "path" },
}, { }, {
{ name = 'cmdline' } { name = "cmdline" },
}) }),
}) })
--[[ nvim-lspconfig --[[ nvim-lspconfig
@ -540,45 +532,43 @@ local lua_ls_setup = {
}, },
} }
local capabilities = require('cmp_nvim_lsp').default_capabilities() local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lspconfig = require('lspconfig') local lspconfig = require("lspconfig")
lspconfig.gopls.setup { capabilities = capabilities } lspconfig.gopls.setup({ capabilities = capabilities })
lspconfig.lua_ls.setup(lua_ls_setup) lspconfig.lua_ls.setup(lua_ls_setup)
lspconfig.pyright.setup { capabilities = capabilities } lspconfig.pyright.setup({ capabilities = capabilities })
-- lspconfig.tsserver.setup { capabilities = capabilities } -- lspconfig.tsserver.setup { capabilities = capabilities }
lspconfig.ts_ls.setup { capabilities = capabilities } lspconfig.ts_ls.setup({ capabilities = capabilities })
lspconfig.rust_analyzer.setup { lspconfig.rust_analyzer.setup({
-- Server-specific settings. See `:help lspconfig-setup` -- Server-specific settings. See `:help lspconfig-setup`
capabilities = capabilities, capabilities = capabilities,
settings = { settings = {
['rust-analyzer'] = {}, ["rust-analyzer"] = {},
}, },
} })
-- Enable (broadcasting) snippet capability for completion -- Enable (broadcasting) snippet capability for completion
local capabilities_html = vim.lsp.protocol.make_client_capabilities() local capabilities_html = vim.lsp.protocol.make_client_capabilities()
capabilities_html.textDocument.completion.completionItem.snippetSupport = true capabilities_html.textDocument.completion.completionItem.snippetSupport = true
require 'lspconfig'.html.setup { require("lspconfig").html.setup({
capabilities = capabilities_html, capabilities = capabilities_html,
} })
-- Global mappings : Diagnostics -- Global mappings : Diagnostics
-- See `:help vim.diagnostic.*` for documentation on any of the below functions -- See `:help vim.diagnostic.*` for documentation on any of the below functions
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, { desc = 'Diagnostic: open float' }) vim.keymap.set("n", "<space>e", vim.diagnostic.open_float, { desc = "Diagnostic: open float" })
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Diagnostic: go to previous' }) vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Diagnostic: go to previous" })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Diagnostic: go to next' }) vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Diagnostic: go to next" })
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, { desc = 'Diagnostic: set loclist' }) vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, { desc = "Diagnostic: set loclist" })
-- Add a border to LSP windows -- Add a border to LSP windows
local _border = "single" local _border = "single"
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
vim.lsp.handlers.hover, { border = _border,
border = _border })
}
)
-- TODO: Is this necessary? Or is signature help being handled with LSPSaga? -- TODO: Is this necessary? Or is signature help being handled with LSPSaga?
--[[ --[[
@ -589,81 +579,81 @@ vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
) )
--]] --]]
vim.diagnostic.config { vim.diagnostic.config({
float = { border = _border, max_width = 120 } float = { border = _border, max_width = 120 },
} })
-- Use LspAttach autocommand to only map the following keys -- Use LspAttach autocommand to only map the following keys
-- after the language server attaches to the current buffer -- after the language server attaches to the current buffer
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup('UserLspConfig', {}), group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev) callback = function(ev)
-- Enable completion triggered by <c-x><c-o> -- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
-- Buffer local mappings. -- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions -- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = function(desc) local opts = function(desc)
return { buffer = ev.buf, desc = desc } return { buffer = ev.buf, desc = desc }
end end
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts('LSP: go to declaration')) vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts("LSP: go to declaration"))
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts('LSP: go to definition')) vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts("LSP: go to definition"))
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts('LSP: hover')) vim.keymap.set("n", "K", vim.lsp.buf.hover, opts("LSP: hover"))
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts('LSP: go to implementation')) vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts("LSP: go to implementation"))
-- This setting steps on my split navigation setting, so I changed it -- This setting steps on my split navigation setting, so I changed it
-- to the probably harmless F9. -- to the probably harmless F9.
-- vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts('')) -- vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts(''))
vim.keymap.set('n', '<F9>', vim.lsp.buf.signature_help, opts('LSP: signature help')) vim.keymap.set("n", "<F9>", vim.lsp.buf.signature_help, opts("LSP: signature help"))
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts('LSP: add workspace folder')) vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, opts("LSP: add workspace folder"))
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts('LSP: remove workspace folder')) vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, opts("LSP: remove workspace folder"))
vim.keymap.set('n', '<space>wl', function() vim.keymap.set("n", "<space>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders())) print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts('LSP: list workspace folder')) end, opts("LSP: list workspace folder"))
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts('LSP: go to type definition')) vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, opts("LSP: go to type definition"))
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts('LSP: rename token')) vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts("LSP: rename token"))
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts('LSP: code action')) vim.keymap.set({ "n", "v" }, "<space>ca", vim.lsp.buf.code_action, opts("LSP: code action"))
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts('LSP: go to references')) vim.keymap.set("n", "gr", vim.lsp.buf.references, opts("LSP: go to references"))
vim.keymap.set('n', '<space>f', function() vim.keymap.set("n", "<space>f", function()
vim.lsp.buf.format { async = true } vim.lsp.buf.format({ async = true })
end, opts('LSP: format')) end, opts("LSP: format"))
end, end,
}) })
require('gitsigns').setup({ require("gitsigns").setup({
signs = { signs = {
add = { text = '' }, add = { text = "" },
change = { text = '' }, change = { text = "" },
delete = { text = '_' }, delete = { text = "_" },
topdelete = { text = '' }, topdelete = { text = "" },
changedelete = { text = '~' }, changedelete = { text = "~" },
untracked = { text = '' }, untracked = { text = "" },
}, },
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl` numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl` linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = { watch_gitdir = {
follow_files = true follow_files = true,
}, },
attach_to_untracked = true, attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = { current_line_blame_opts = {
virt_text = true, virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
delay = 1000, delay = 1000,
ignore_whitespace = false, ignore_whitespace = false,
}, },
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>', current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
sign_priority = 6, sign_priority = 6,
update_debounce = 100, update_debounce = 100,
status_formatter = nil, -- Use default status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines) max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = { preview_config = {
-- Options passed to nvim_open_win -- Options passed to nvim_open_win
border = 'single', border = "single",
style = 'minimal', style = "minimal",
relative = 'cursor', relative = "cursor",
row = 0, row = 0,
col = 1 col = 1,
}, },
-- [2024-09-10] This is invalid, suddenly. -- [2024-09-10] This is invalid, suddenly.
-- yadm = { enable = false }, -- yadm = { enable = false },
@ -677,63 +667,77 @@ require('gitsigns').setup({
end end
-- Navigation -- Navigation
map('n', ']c', function() map("n", "]c", function()
if vim.wo.diff then return ']c' end if vim.wo.diff then
vim.schedule(function() gs.next_hunk() end) return "]c"
return '<Ignore>' end
end, { expr = true, desc = 'GitSigns: go to next hunk' }) vim.schedule(function()
gs.next_hunk()
end)
return "<Ignore>"
end, { expr = true, desc = "GitSigns: go to next hunk" })
map('n', '[c', function() map("n", "[c", function()
if vim.wo.diff then return '[c' end if vim.wo.diff then
vim.schedule(function() gs.prev_hunk() end) return "[c"
return '<Ignore>' end
end, { expr = true, desc = 'GitSigns: go to previous hunk' }) vim.schedule(function()
gs.prev_hunk()
end)
return "<Ignore>"
end, { expr = true, desc = "GitSigns: go to previous hunk" })
-- Actions -- Actions
map('n', '<leader>hs', gs.stage_hunk, { desc = 'GitSigns: stage hunk' }) map("n", "<leader>hs", gs.stage_hunk, { desc = "GitSigns: stage hunk" })
map('n', '<leader>hr', gs.reset_hunk, { desc = 'GitSigns: reset hunk' }) map("n", "<leader>hr", gs.reset_hunk, { desc = "GitSigns: reset hunk" })
map('v', '<leader>hs', function() gs.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end, map("v", "<leader>hs", function()
{ desc = 'GitSigns: stage hunk' }) gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
map('v', '<leader>hr', function() gs.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end, end, { desc = "GitSigns: stage hunk" })
{ desc = 'GitSigns: reset hunk' }) map("v", "<leader>hr", function()
map('n', '<leader>hS', gs.stage_buffer, { desc = 'GitSigns: stage buffer' }) gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
map('n', '<leader>hu', gs.undo_stage_hunk, { desc = 'GitSigns: undo stage hunk' }) end, { desc = "GitSigns: reset hunk" })
map('n', '<leader>hR', gs.reset_buffer, { desc = 'GitSigns: reset_buffer' }) map("n", "<leader>hS", gs.stage_buffer, { desc = "GitSigns: stage buffer" })
map('n', '<leader>hp', gs.preview_hunk, { desc = 'GitSigns: preview hunk' }) map("n", "<leader>hu", gs.undo_stage_hunk, { desc = "GitSigns: undo stage hunk" })
map('n', '<leader>hb', function() gs.blame_line { full = true } end, { desc = 'GitSigns: blame line' }) map("n", "<leader>hR", gs.reset_buffer, { desc = "GitSigns: reset_buffer" })
map('n', '<leader>tb', gs.toggle_current_line_blame, { desc = 'GitSigns: toggle current line blame' }) map("n", "<leader>hp", gs.preview_hunk, { desc = "GitSigns: preview hunk" })
map('n', '<leader>hd', gs.diffthis, { desc = 'GitSigns: diff this' }) map("n", "<leader>hb", function()
map('n', '<leader>hD', function() gs.diffthis('~') end, { desc = 'GitSigns: diff this' }) gs.blame_line({ full = true })
map('n', '<leader>td', gs.toggle_deleted, { desc = 'GitSigns: toggle deleted' }) end, { desc = "GitSigns: blame line" })
end map("n", "<leader>tb", gs.toggle_current_line_blame, { desc = "GitSigns: toggle current line blame" })
map("n", "<leader>hd", gs.diffthis, { desc = "GitSigns: diff this" })
map("n", "<leader>hD", function()
gs.diffthis("~")
end, { desc = "GitSigns: diff this" })
map("n", "<leader>td", gs.toggle_deleted, { desc = "GitSigns: toggle deleted" })
end,
}) })
--[[ --[[
-- LSPSaga : provides a diverse basket of utilities -- LSPSaga : provides a diverse basket of utilities
--]] --]]
require('lspsaga').setup({ require("lspsaga").setup({
beacon = { beacon = {
enable = true, enable = true,
frequency = 7, frequency = 7,
} },
}) })
vim.keymap.set('n', '<leader>si', '<cmd>Lspsaga incoming_calls<CR>') vim.keymap.set("n", "<leader>si", "<cmd>Lspsaga incoming_calls<CR>")
vim.keymap.set('n', '<leader>so', '<cmd>Lspsaga outgoing_calls<CR>') vim.keymap.set("n", "<leader>so", "<cmd>Lspsaga outgoing_calls<CR>")
vim.keymap.set('n', '<leader>ca', '<cmd>Lspsaga code_action<CR>') vim.keymap.set("n", "<leader>ca", "<cmd>Lspsaga code_action<CR>")
vim.keymap.set('n', '<leader>sd', '<cmd>Lspsaga peek_definition<CR>') vim.keymap.set("n", "<leader>sd", "<cmd>Lspsaga peek_definition<CR>")
vim.keymap.set('n', '<leader>sp', '<cmd>Lspsaga peek_type_definition<CR>') vim.keymap.set("n", "<leader>sp", "<cmd>Lspsaga peek_type_definition<CR>")
vim.keymap.set('n', '<leader>sx', '<cmd>Lspsaga goto_definition<CR>') vim.keymap.set("n", "<leader>sx", "<cmd>Lspsaga goto_definition<CR>")
vim.keymap.set('n', '<leader>sg', '<cmd>Lspsaga goto_type_definition<CR>') vim.keymap.set("n", "<leader>sg", "<cmd>Lspsaga goto_type_definition<CR>")
vim.keymap.set('n', '[e', '<cmd>Lspsaga diagnostic_jump_prev<CR>') vim.keymap.set("n", "[e", "<cmd>Lspsaga diagnostic_jump_prev<CR>")
vim.keymap.set('n', ']e', '<cmd>Lspsaga diagnostic_jump_next<CR>') vim.keymap.set("n", "]e", "<cmd>Lspsaga diagnostic_jump_next<CR>")
vim.keymap.set('n', '<leader>sK', '<cmd>Lspsaga hover_doc<CR>') vim.keymap.set("n", "<leader>sK", "<cmd>Lspsaga hover_doc<CR>")
vim.keymap.set('n', '<leader>sm', '<cmd>Lspsaga finder imp<CR>') vim.keymap.set("n", "<leader>sm", "<cmd>Lspsaga finder imp<CR>")
vim.keymap.set('n', '<leader>sf', '<cmd>Lspsaga finder<CR>') vim.keymap.set("n", "<leader>sf", "<cmd>Lspsaga finder<CR>")
vim.keymap.set('n', '<leader>sl', '<cmd>Lspsaga outline<CR>') vim.keymap.set("n", "<leader>sl", "<cmd>Lspsaga outline<CR>")
vim.keymap.set('n', '<leader>rn', '<cmd>Lspsaga rename<CR>') vim.keymap.set("n", "<leader>rn", "<cmd>Lspsaga rename<CR>")
vim.keymap.set('n', '<leader>st', '<cmd>Lspsaga term_toggle<CR>') vim.keymap.set("n", "<leader>st", "<cmd>Lspsaga term_toggle<CR>")
require('dap-go').setup() require("dap-go").setup()
local dap, dapui = require("dap"), require("dapui") local dap, dapui = require("dap"), require("dapui")
dapui.setup() dapui.setup()
@ -762,7 +766,7 @@ vim.api.nvim_create_autocmd(
--]] --]]
-- Treesitter -- Treesitter
require('nvim-treesitter.configs').setup({ require("nvim-treesitter.configs").setup({
modules = {}, modules = {},
highlight = { highlight = {
enable = true, enable = true,
@ -774,7 +778,19 @@ require('nvim-treesitter.configs').setup({
enable = true, enable = true,
module_path = "nvim-treesitter.indent", module_path = "nvim-treesitter.indent",
}, },
ensure_installed = { "bash", "comment", "go", "html", "javascript", "json", "kdl", "lua", "python", "typescript", "yaml" }, ensure_installed = {
"bash",
"comment",
"go",
"html",
"javascript",
"json",
"kdl",
"lua",
"python",
"typescript",
"yaml",
},
sync_install = false, sync_install = false,
auto_install = false, auto_install = false,
ignore_install = {}, ignore_install = {},
@ -782,7 +798,7 @@ require('nvim-treesitter.configs').setup({
vim.treesitter.language.register("html", "handlebars") vim.treesitter.language.register("html", "handlebars")
require('mini.icons').setup() require("mini.icons").setup()
-- Tweak GitSigns blame color -- Tweak GitSigns blame color
-- This differentiates the cursorline from the git blame text -- This differentiates the cursorline from the git blame text
@ -796,28 +812,22 @@ window and :Gvdiffsplit window(s). To kill the winbar (the top line where
the breadcrumbs and this blame title live), enter `:set winbar&`. the breadcrumbs and this blame title live), enter `:set winbar&`.
--]] --]]
local blamegroup = vim.api.nvim_create_augroup("fugitiveSagaBlameConflict", { clear = true }) local blamegroup = vim.api.nvim_create_augroup("fugitiveSagaBlameConflict", { clear = true })
vim.api.nvim_create_autocmd( vim.api.nvim_create_autocmd("FileType", {
'FileType',
{
group = blamegroup, group = blamegroup,
pattern = 'fugitiveblame', pattern = "fugitiveblame",
callback = function() callback = function()
vim.api.nvim_set_option_value('winbar', 'fugitive', { scope = 'local' }) vim.api.nvim_set_option_value("winbar", "fugitive", { scope = "local" })
end, end,
} })
)
local diffgroup = vim.api.nvim_create_augroup("fugitiveSagaDiffConflict", { clear = true }) local diffgroup = vim.api.nvim_create_augroup("fugitiveSagaDiffConflict", { clear = true })
vim.api.nvim_create_autocmd( vim.api.nvim_create_autocmd("BufReadCmd", {
'BufReadCmd',
{
group = diffgroup, group = diffgroup,
pattern = "fugitive://*", pattern = "fugitive://*",
callback = function() callback = function()
vim.api.nvim_set_option_value('winbar', 'fugitive', { scope = 'local' }) vim.api.nvim_set_option_value("winbar", "fugitive", { scope = "local" })
end, end,
} })
)
--[[ --[[
let g:nvlime_cl_impl = "ros" let g:nvlime_cl_impl = "ros"

View file

@ -1,166 +1,54 @@
{ {
"LazyVim": { "LazyVim": { "branch": "main", "commit": "45d94b3197eaf3f35754b8ecb7adebfcebe5160d" },
"branch": "main", "SchemaStore.nvim": { "branch": "main", "commit": "97b08f928d355bd6d5dee595fdf667b5bfb6329f" },
"commit": "45d94b3197eaf3f35754b8ecb7adebfcebe5160d" "blink.cmp": { "branch": "main", "commit": "b6f11a0aa33e601c469a126e3ed6e35208fe3ea3" },
}, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"SchemaStore.nvim": { "catppuccin": { "branch": "main", "commit": "0b2437bcc12b4021614dc41fcea9d0f136d94063" },
"branch": "main", "conform.nvim": { "branch": "master", "commit": "8ed162b0637d4c4f69ebe3e8e49b35662a82e137" },
"commit": "97b08f928d355bd6d5dee595fdf667b5bfb6329f" "crates.nvim": { "branch": "main", "commit": "1d92a7f449a2a76d8f4c3459bd98f450e76d2ea3" },
}, "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
"blink.cmp": { "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"branch": "main", "fzf-lua": { "branch": "main", "commit": "8633175d4e74cd6013f75af7682c7e8ac133056a" },
"commit": "b6f11a0aa33e601c469a126e3ed6e35208fe3ea3" "gitsigns.nvim": { "branch": "main", "commit": "2bc3b472bbc2484214549af4d9f38c127b886a55" },
}, "grug-far.nvim": { "branch": "main", "commit": "3a8690461afac34c0e5bacb0f7b4bc3066aab665" },
"bufferline.nvim": { "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
"branch": "main", "lazydev.nvim": { "branch": "main", "commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" },
"commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" "lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" },
}, "mason-lspconfig.nvim": { "branch": "main", "commit": "a8e6efcf623b86bae6d2223eede7c43883329f80" },
"catppuccin": { "mason-nvim-dap.nvim": { "branch": "main", "commit": "26ea08fd5c7028ea54a3347ac139fc916baf1aa9" },
"branch": "main", "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"commit": "0b2437bcc12b4021614dc41fcea9d0f136d94063" "mini.ai": { "branch": "main", "commit": "6e01c0e5a15554852546fac9853960780ac52ed4" },
}, "mini.icons": { "branch": "main", "commit": "ec61af6e606fc89ee3b1d8f2f20166a3ca917a36" },
"conform.nvim": { "mini.pairs": { "branch": "main", "commit": "1a3e73649c0eaef2f6c48ce1e761c6f0a7c11918" },
"branch": "master", "mini.surround": { "branch": "main", "commit": "f90069c7441a5fb04c3de42eacf93e16b64dd3eb" },
"commit": "8ed162b0637d4c4f69ebe3e8e49b35662a82e137" "neo-tree.nvim": { "branch": "main", "commit": "e96fd85bf18bc345dab332b345098fa5460dffac" },
}, "neotest": { "branch": "master", "commit": "d66cf4e05a116957f0d3a7755a24291c7d1e1f72" },
"crates.nvim": { "neotest-golang": { "branch": "main", "commit": "131e0402e63966692d340861c58756853913ada3" },
"branch": "main", "neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" },
"commit": "1d92a7f449a2a76d8f4c3459bd98f450e76d2ea3" "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
}, "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
"flash.nvim": { "nvim-dap": { "branch": "master", "commit": "52302f02fea3a490e55475de52fa4deb8af2eb11" },
"branch": "main", "nvim-dap-go": { "branch": "main", "commit": "07739481317d36ddb3e3e8fbdfcd8f90b4167d73" },
"commit": "3c942666f115e2811e959eabbdd361a025db8b63" "nvim-dap-python": { "branch": "master", "commit": "34282820bb713b9a5fdb120ae8dd85c2b3f49b51" },
}, "nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" },
"friendly-snippets": { "nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" },
"branch": "main", "nvim-lint": { "branch": "master", "commit": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8" },
"commit": "efff286dd74c22f731cdec26a70b46e5b203c619" "nvim-lspconfig": { "branch": "master", "commit": "31226f6736a8150e323b346e4748e3c9bdd6bef5" },
}, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"gitsigns.nvim": { "nvim-treesitter": { "branch": "master", "commit": "80e6de9d24eec68d82d5f4e6feae94c9c753ebd6" },
"branch": "main", "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" },
"commit": "2bc3b472bbc2484214549af4d9f38c127b886a55" "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
}, "nvlime": { "branch": "master", "commit": "228e4fa8c7d10b1ed07b1649a63743613b77a828" },
"grug-far.nvim": { "one-small-step-for-vimkind": { "branch": "main", "commit": "b9def31568d20b16f7da9479a4174d165046fe8a" },
"branch": "main", "paredit": { "branch": "master", "commit": "60203e50698ed2211b4434a66ab2258a1a6ac3b5" },
"commit": "3a8690461afac34c0e5bacb0f7b4bc3066aab665" "parsley": { "branch": "main", "commit": "c4100aa449bfa971dcfc56ffe4206ba034db08cc" },
}, "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
"lazy.nvim": { "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"branch": "main", "rustaceanvim": { "branch": "master", "commit": "f03035fa03ccb36cd26d0792c946fbacba1d1a39" },
"commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" "snacks.nvim": { "branch": "main", "commit": "eb81468b475f6251f5850ae956e19547e8f533ec" },
}, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"lazydev.nvim": { "tokyonight.nvim": { "branch": "main", "commit": "84ea0b5f4651afdf50ececaf6f110fe9d9dc9458" },
"branch": "main", "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" "ts-comments.nvim": { "branch": "main", "commit": "872dcfa0418f4a33b7437fb4d9f4e89f2f000d74" },
}, "which-key.nvim": { "branch": "main", "commit": "0e76a87ac51772569aec678dc74baa8e2a86100c" }
"lualine.nvim": {
"branch": "master",
"commit": "f4f791f67e70d378a754d02da068231d2352e5bc"
},
"markdown-preview.nvim": {
"branch": "master",
"commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee"
},
"mason-lspconfig.nvim": {
"branch": "main",
"commit": "a8e6efcf623b86bae6d2223eede7c43883329f80"
},
"mason.nvim": {
"branch": "main",
"commit": "e2f7f9044ec30067bc11800a9e266664b88cda22"
},
"mini.ai": {
"branch": "main",
"commit": "6e01c0e5a15554852546fac9853960780ac52ed4"
},
"mini.icons": {
"branch": "main",
"commit": "ec61af6e606fc89ee3b1d8f2f20166a3ca917a36"
},
"mini.pairs": {
"branch": "main",
"commit": "1a3e73649c0eaef2f6c48ce1e761c6f0a7c11918"
},
"mini.surround": {
"branch": "main",
"commit": "f90069c7441a5fb04c3de42eacf93e16b64dd3eb"
},
"noice.nvim": {
"branch": "main",
"commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59"
},
"nui.nvim": {
"branch": "main",
"commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46"
},
"nvim-lint": {
"branch": "master",
"commit": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8"
},
"nvim-lspconfig": {
"branch": "master",
"commit": "31226f6736a8150e323b346e4748e3c9bdd6bef5"
},
"nvim-treesitter": {
"branch": "master",
"commit": "80e6de9d24eec68d82d5f4e6feae94c9c753ebd6"
},
"nvim-treesitter-textobjects": {
"branch": "master",
"commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595"
},
"nvim-ts-autotag": {
"branch": "main",
"commit": "1cca23c9da708047922d3895a71032bc0449c52d"
},
"nvlime": {
"branch": "master",
"commit": "228e4fa8c7d10b1ed07b1649a63743613b77a828"
},
"paredit": {
"branch": "master",
"commit": "60203e50698ed2211b4434a66ab2258a1a6ac3b5"
},
"parsley": {
"branch": "main",
"commit": "c4100aa449bfa971dcfc56ffe4206ba034db08cc"
},
"persistence.nvim": {
"branch": "main",
"commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d"
},
"plenary.nvim": {
"branch": "master",
"commit": "857c5ac632080dba10aae49dba902ce3abf91b35"
},
"render-markdown.nvim": {
"branch": "main",
"commit": "e05a9f22f31c088ece3fa5928daf546a015b66ee"
},
"rustaceanvim": {
"branch": "master",
"commit": "f03035fa03ccb36cd26d0792c946fbacba1d1a39"
},
"snacks.nvim": {
"branch": "main",
"commit": "eb81468b475f6251f5850ae956e19547e8f533ec"
},
"todo-comments.nvim": {
"branch": "main",
"commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5"
},
"tokyonight.nvim": {
"branch": "main",
"commit": "84ea0b5f4651afdf50ececaf6f110fe9d9dc9458"
},
"trouble.nvim": {
"branch": "main",
"commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3"
},
"ts-comments.nvim": {
"branch": "main",
"commit": "872dcfa0418f4a33b7437fb4d9f4e89f2f000d74"
},
"which-key.nvim": {
"branch": "main",
"commit": "0e76a87ac51772569aec678dc74baa8e2a86100c"
}
} }

View file

@ -1,13 +1,15 @@
{ {
"extras": [ "extras": [
"lazyvim.plugins.extras.coding.mini-surround", "lazyvim.plugins.extras.coding.mini-surround",
"lazyvim.plugins.extras.dap.core",
"lazyvim.plugins.extras.dap.nlua",
"lazyvim.plugins.extras.lang.git", "lazyvim.plugins.extras.lang.git",
"lazyvim.plugins.extras.lang.go", "lazyvim.plugins.extras.lang.go",
"lazyvim.plugins.extras.lang.markdown",
"lazyvim.plugins.extras.lang.python", "lazyvim.plugins.extras.lang.python",
"lazyvim.plugins.extras.lang.rust", "lazyvim.plugins.extras.lang.rust",
"lazyvim.plugins.extras.lang.toml", "lazyvim.plugins.extras.lang.toml",
"lazyvim.plugins.extras.lang.yaml", "lazyvim.plugins.extras.lang.yaml",
"lazyvim.plugins.extras.test.core",
"lazyvim.plugins.extras.vscode" "lazyvim.plugins.extras.vscode"
], ],
"news": { "news": {

View file

@ -158,3 +158,10 @@ rga-fzf() {
xdg-open "$file" xdg-open "$file"
} }
# ssh-agent
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent -t 1h > "$XDG_RUNTIME_DIR/ssh-agent.env"
fi
if [[ ! -f "$SSH_AUTH_SOCK" ]]; then
source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null
fi