summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim/config
diff options
context:
space:
mode:
authortriethyl <triethylammonium@pm.me>2025-08-07 13:29:18 -0400
committertriethyl <triethylammonium@pm.me>2025-08-07 13:29:18 -0400
commitc37d47e19df8559f5b7dcd40aca832623a6fa9b0 (patch)
treebf5aca2a488f3400a3be80b77a840626ee7b7b6b /pkgs/custom-neovim/config
parentbf773a2df0ccb96d7539b379585e1ef59d80892c (diff)
neovim: idek
Diffstat (limited to 'pkgs/custom-neovim/config')
-rw-r--r--pkgs/custom-neovim/config/init.lua2
-rw-r--r--pkgs/custom-neovim/config/lua/lsp.lua (renamed from pkgs/custom-neovim/config/lua/plugins/lspconfig.lua)36
-rw-r--r--pkgs/custom-neovim/config/lua/options.lua2
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/cmp.lua1
4 files changed, 21 insertions, 20 deletions
diff --git a/pkgs/custom-neovim/config/init.lua b/pkgs/custom-neovim/config/init.lua
index 306a76b..857aa37 100644
--- a/pkgs/custom-neovim/config/init.lua
+++ b/pkgs/custom-neovim/config/init.lua
@@ -9,6 +9,7 @@ require("colorschemes")
require("neovide")
require("mappings")
require("statusline")
+require("lsp")
-- Require plugin configs.
-- UI Plugins:
@@ -23,7 +24,6 @@ require("plugins.auto-session")
require("plugins.gitsigns")
-- LSP Plugins:
-require("plugins.lspconfig")
require("plugins.actions-preview")
-- Utility Plugins:
diff --git a/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua b/pkgs/custom-neovim/config/lua/lsp.lua
index fbb35bf..7511004 100644
--- a/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua
+++ b/pkgs/custom-neovim/config/lua/lsp.lua
@@ -14,36 +14,36 @@ vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
-- Enable completion triggered by <c-x><c-o>
- vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
-
- -- Buffer local mappings.
- -- See `:help vim.lsp.*` for documentation on any of the below functions
+ -- vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
local mapkey = Utils.mapkey
- mapkey('n', 'gD', "Go to declaration", vim.lsp.buf.declaration)
- mapkey('n', 'gd', "Go to definition", vim.lsp.buf.definition)
- mapkey('n', 'gy', "Go to type definition", vim.lsp.buf.type_definition)
- mapkey('n', 'gi', "Go to implementation", vim.lsp.buf.implementation)
- mapkey('n', '<M-k>', "Signature Help", vim.lsp.buf.signature_help)
- mapkey('i', '<M-k>', "Signature Help", vim.lsp.buf.signature_help)
- mapkey('n', "<space>o", "Manage LSP workspace", "")
- mapkey('n', '<space>oa', "Add Workspace Folder", vim.lsp.buf.add_workspace_folder)
- mapkey('n', '<space>or', "Remove Workspace Folder", vim.lsp.buf.remove_workspace_folder)
- mapkey('n', '<space>ol', "List Workspace Folders", function()
+ -- Workspace management
+ mapkey('n', "<leader>o", "Manage LSP workspace", "")
+ mapkey('n', '<leader>oa', "Add Workspace Folder", vim.lsp.buf.add_workspace_folder)
+ mapkey('n', '<leader>or', "Remove Workspace Folder", vim.lsp.buf.remove_workspace_folder)
+ mapkey('n', '<leader>ol', "List Workspace Folders", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end)
- mapkey('n', '<space>r', "Rename Symbol", vim.lsp.buf.rename)
- mapkey("n", "<leader>s", "Open symbol picker", ":lua Snacks.picker.lsp_symbols()<cr>")
- mapkey("n", "<leader>S", "Open workspace symbol picker", ":lua Snacks.picker.lsp_workspace_symbols()<cr>")
-- LSP Pickers
mapkey('n', "<leader>a", "Perform code action", ":lua require('actions-preview').code_actions()<cr>")
mapkey("n", "<leader>I", "Open workspace diagnostic picker", ":lua Snacks.picker.diagnostics()<cr>")
mapkey("n", "<leader>i", "Open diagnostic picker", [[:lua Snacks.picker.diagnostics_buffer()<cr>]])
+ mapkey("n", "<leader>s", "Open symbol picker", ":lua Snacks.picker.lsp_symbols()<cr>")
+ mapkey("n", "<leader>S", "Open workspace symbol picker", ":lua Snacks.picker.lsp_workspace_symbols()<cr>")
+
+ -- Goto Keys
+ mapkey('n', 'gD', "Go to declaration", vim.lsp.buf.declaration)
+ mapkey('n', 'gd', "Go to definition", vim.lsp.buf.definition)
+ mapkey('n', 'go', "Go to type definition", vim.lsp.buf.type_definition)
+ mapkey('n', 'gi', "Go to implementation", vim.lsp.buf.implementation)
+ -- Other LSP Keys
+ mapkey('n', 'gs', "Signature Help", vim.lsp.buf.signature_help)
mapkey('n', 'gr', "Buffer References", vim.lsp.buf.references)
- mapkey('n', '<localleader>f', "Format Buffer", function()
+ mapkey('n', '<leader>r', "Rename Symbol", vim.lsp.buf.rename)
+ mapkey('n', '<leader>h', "Format Buffer", function()
vim.lsp.buf.format { async = true }
end)
end,
diff --git a/pkgs/custom-neovim/config/lua/options.lua b/pkgs/custom-neovim/config/lua/options.lua
index ef80186..5698594 100644
--- a/pkgs/custom-neovim/config/lua/options.lua
+++ b/pkgs/custom-neovim/config/lua/options.lua
@@ -8,7 +8,7 @@ vim.o.icm = 'split'
vim.o.cia = 'abbr,kind,menu'
vim.o.mouse = ""
vim.o.number = true -- set absolute numbered lines
-vim.o.relativenumber = true -- set relative numbered lines
+-- vim.o.relativenumber = true -- set relative numbered lines
vim.o.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor
vim.o.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time
vim.o.clipboard = "unnamedplus" -- use system clipboard
diff --git a/pkgs/custom-neovim/config/lua/plugins/cmp.lua b/pkgs/custom-neovim/config/lua/plugins/cmp.lua
new file mode 100644
index 0000000..2ef2cca
--- /dev/null
+++ b/pkgs/custom-neovim/config/lua/plugins/cmp.lua
@@ -0,0 +1 @@
+require("nvim-cmp").setup()