summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-05-03 19:03:16 +0300
committerKyren223 <Kyren223@proton.me>2025-05-03 19:03:16 +0300
commit4d3c4b5ecd937a928bc2b5df3f7451d07439ac1d (patch)
tree2f1c1e3fcf824b5e714a753dfbcb1b55f5f3dfd8
parente55cafbfeb79944bcfdda4b7d582fd0c76bdf1c7 (diff)
A few small changes to nvim config
-rw-r--r--.config/nvim/lsp/asm_lsp.lua1
-rw-r--r--.config/nvim/lsp/clangd.lua3
-rw-r--r--.config/nvim/lsp/zls.lua1
-rw-r--r--.config/nvim/lua/keymaps.lua9
-rw-r--r--.config/nvim/lua/plugins/blink-cmp.lua43
-rw-r--r--.config/nvim/lua/plugins/harpoon.lua6
-rw-r--r--.config/nvim/lua/plugins/octo.lua28
-rw-r--r--.config/nvim/lua/plugins/snacks.lua2
8 files changed, 71 insertions, 22 deletions
diff --git a/.config/nvim/lsp/asm_lsp.lua b/.config/nvim/lsp/asm_lsp.lua
index caddea0..84c633f 100644
--- a/.config/nvim/lsp/asm_lsp.lua
+++ b/.config/nvim/lsp/asm_lsp.lua
@@ -1,7 +1,6 @@
-- https://github.com/bergercookie/asm-lsp
return {
- mason = false,
cmd = { 'asm-lsp' },
filetypes = { 'asm', 'vmasm' },
root_markers = { '.asm-lsp.toml', '.git' },
diff --git a/.config/nvim/lsp/clangd.lua b/.config/nvim/lsp/clangd.lua
index 01ae2e1..dc5519d 100644
--- a/.config/nvim/lsp/clangd.lua
+++ b/.config/nvim/lsp/clangd.lua
@@ -58,7 +58,6 @@ local function symbol_info()
end
return {
- mason = false,
cmd = {
'clangd',
'--background-index',
@@ -100,7 +99,7 @@ return {
symbol_info()
end, { desc = 'Show symbol info' })
- vim.keymap.set('n', 'H', '<cmd>ClangdSwitchSourceHeader<cr>', { desc = '[H]eader and Source Switcher' })
+ vim.keymap.set('n', '<leader>H', '<cmd>ClangdSwitchSourceHeader<cr>', { desc = '[H]eader and Source Switcher' })
vim.keymap.set('n', 'K', '<cmd>lua require("pretty_hover").hover()<cr>', { desc = 'Documentation Hover' })
-- TODO: do I need pretty_hover? maybe that's what causes issues?
end,
diff --git a/.config/nvim/lsp/zls.lua b/.config/nvim/lsp/zls.lua
index 32120d3..94e2d26 100644
--- a/.config/nvim/lsp/zls.lua
+++ b/.config/nvim/lsp/zls.lua
@@ -1,7 +1,6 @@
-- https://github.com/zigtools/zls
return {
- mason = false,
cmd = { 'zls' },
filetypes = { 'zig', 'zir' },
root_markers = { 'zls.json', 'build.zig', '.git' },
diff --git a/.config/nvim/lua/keymaps.lua b/.config/nvim/lua/keymaps.lua
index 3677269..950d212 100644
--- a/.config/nvim/lua/keymaps.lua
+++ b/.config/nvim/lua/keymaps.lua
@@ -51,8 +51,6 @@ set('i', '<C-H>', '<C-w>', { desc = 'Ctrl + Backspace to delete word' })
set('n', '<esc>', '<cmd>nohlsearch<cr>', { silent = true })
set({ 'i', 'c' }, '<C-v>', paste)
set('n', '<leader>z', toggle_zen, { desc = '[Z]en Mode', silent = true })
-set('n', '<S-h>', '<cmd>bprevious<cr>', { desc = 'Prev Buffer' })
-set('n', '<S-l>', '<cmd>bnext<cr>', { desc = 'Next Buffer' })
set('n', '<leader><tab>', '<cmd>e #<cr>', { desc = 'Switch to Other Buffer' })
unbind({ 'i', 'n', 'v' }, '<C-r>')
@@ -123,13 +121,6 @@ local keymaps = {
{ 'n', '<leader>D', cursor_diagnostics, { desc = '[D]iagnostics under cursor' } },
}
-for _, ft in ipairs({ 'c', 'h', 'cpp', 'hpp' }) do
- keymaps[ft] = {
- { 'n', 'H', '<cmd>ClangdSwitchSourceHeader<cr>', { desc = '[H]eader and Source Switcher' } },
- { 'n', 'K', '<cmd>lua require("pretty_hover").hover()<cr>', { desc = 'Documentation Hover' } },
- }
-end
-
local function set_keymaps(tbl, bufnr)
for _, keymap in ipairs(tbl) do
local mode = keymap[1]
diff --git a/.config/nvim/lua/plugins/blink-cmp.lua b/.config/nvim/lua/plugins/blink-cmp.lua
index 08b5f44..14fc978 100644
--- a/.config/nvim/lua/plugins/blink-cmp.lua
+++ b/.config/nvim/lua/plugins/blink-cmp.lua
@@ -71,7 +71,7 @@ return {
lazydev = {
name = 'LazyDev',
module = 'lazydev.integrations.blink',
- score_offset = 100, -- prioritize lazydev
+ score_offset = 100, -- show at a higher priority than lsp
},
git = {
module = 'blink-cmp-git',
@@ -118,12 +118,14 @@ return {
Method = '󰊕',
Function = '󰊕',
Constructor = '󰒓',
+ -- Constructor = " ",
Field = '󰜢',
Variable = '󰆦',
Property = '󰖷',
Class = '󱡠',
+ -- Class = " ",
Interface = '󱡠',
Struct = '󱡠',
Module = '󰅩',
@@ -137,8 +139,11 @@ return {
Constant = '󰏿',
Snippet = '',
+ -- Snippet = "󱄽 ",
Color = '󰏘',
+ -- Color = " ",
File = '󰈔',
+ -- File = " ",
Reference = '󰬲',
Folder = '󰉋',
Event = '󱐋',
@@ -152,3 +157,39 @@ return {
-- TODO: pressing backk (deleting), should re-show completion menu
-- TODO: ghost text only for LLMs?
}
+
+-- From LazyVim
+-- Array = " ",
+-- Boolean = "󰨙 ",
+-- Codeium = "󰘦 ",
+-- Control = " ",
+-- Collapsed = " ",
+-- Copilot = " ",
+-- Enum = " ",
+-- EnumMember = " ",
+-- Event = " ",
+-- Field = " ",
+-- Folder = " ",
+-- Function = "󰊕 ",
+-- Interface = " ",
+-- Key = " ",
+-- Keyword = " ",
+-- Method = "󰊕 ",
+-- Module = " ",
+-- Namespace = "󰦮 ",
+-- Null = " ",
+-- Number = "󰎠 ",
+-- Object = " ",
+-- Operator = " ",
+-- Package = " ",
+-- Property = " ",
+-- Reference = " ",
+-- String = " ",
+-- Struct = "󰆼 ",
+-- Supermaven = " ",
+-- TabNine = "󰏚 ",
+-- Text = " ",
+-- TypeParameter = " ",
+-- Unit = " ",
+-- Value = " ",
+-- Variable = "󰀫 ",
diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua
index 9f20935..b54248d 100644
--- a/.config/nvim/lua/plugins/harpoon.lua
+++ b/.config/nvim/lua/plugins/harpoon.lua
@@ -17,7 +17,11 @@ return {
},
config = function()
local harpoon = require('harpoon')
- harpoon:setup()
+ harpoon:setup({
+ settings = {
+ save_on_toggle = true,
+ },
+ })
vim.keymap.set('n', '<leader>a', function()
harpoon:list():add()
diff --git a/.config/nvim/lua/plugins/octo.lua b/.config/nvim/lua/plugins/octo.lua
index ccb518d..025c488 100644
--- a/.config/nvim/lua/plugins/octo.lua
+++ b/.config/nvim/lua/plugins/octo.lua
@@ -26,10 +26,26 @@ return {
{ '@', '', mode = 'i', ft = 'octo', silent = true },
{ '#', '', mode = 'i', ft = 'octo', silent = true },
},
- opts = {
- enable_builtin = true,
- -- default_to_projects_v2 = true,
- default_merge_method = 'squash',
- picker = 'snacks',
- },
+ opts = function()
+ -- Keep some empty windows in sessions
+ vim.api.nvim_create_autocmd('ExitPre', {
+ group = vim.api.nvim_create_augroup('octo_exit_pre', { clear = true }),
+ callback = function(_)
+ local keep = { 'octo' }
+ for _, win in ipairs(vim.api.nvim_list_wins()) do
+ local buf = vim.api.nvim_win_get_buf(win)
+ if vim.tbl_contains(keep, vim.bo[buf].filetype) then
+ vim.bo[buf].buftype = '' -- set buftype to empty to keep the window
+ end
+ end
+ end,
+ })
+
+ return {
+ enable_builtin = true,
+ -- default_to_projects_v2 = true,
+ default_merge_method = 'squash',
+ picker = 'snacks',
+ }
+ end,
}
diff --git a/.config/nvim/lua/plugins/snacks.lua b/.config/nvim/lua/plugins/snacks.lua
index 112723e..0105947 100644
--- a/.config/nvim/lua/plugins/snacks.lua
+++ b/.config/nvim/lua/plugins/snacks.lua
@@ -134,7 +134,7 @@ return {
{
'<leader>nh',
function()
- Snacks.picker.notifications({ layout = 'telescope' })
+ Snacks.picker.notifications({ layout = 'dropdown' })
end,
desc = '[N]otification [H]istory',
},