Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 57cb0f7b8f | |||
| 3fc7a94efb | |||
| 19aa1b7a14 | |||
| b644b0c4e1 | |||
| 98db76ce45 | |||
| b768848495 | |||
| e36cc1ec8f | |||
| a87192fb63 |
@@ -91,10 +91,6 @@ cmp.setup.cmdline(":", {
|
|||||||
-- Set up lspconfig.
|
-- Set up lspconfig.
|
||||||
-- require("cmp_nvim_lsp").default_capabilities()
|
-- require("cmp_nvim_lsp").default_capabilities()
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
|
|
||||||
-- require('lspconfig')['<YOUR_LSP_SERVER>'].setup {
|
|
||||||
-- capabilities = capabilities
|
|
||||||
-- }
|
|
||||||
require("lspconfig").clangd.setup({
|
require("lspconfig").clangd.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
@@ -135,7 +131,7 @@ require("lspconfig").gopls.setup({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
require("lspconfig").pyright.setup({
|
require("lspconfig").basedpyright.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
require("lspconfig").nim_langserver.setup({
|
require("lspconfig").nim_langserver.setup({
|
||||||
|
|||||||
@@ -106,13 +106,7 @@ vim.keymap.set("n", "<F1>", ":nohlsearch<CR>", { desc = "Clear Search Highlight"
|
|||||||
vim.keymap.set("n", "<F2>", ":UndotreeToggle<CR>", { desc = "Undo Tree Toggle"})
|
vim.keymap.set("n", "<F2>", ":UndotreeToggle<CR>", { desc = "Undo Tree Toggle"})
|
||||||
vim.keymap.set("n", "<F3>", ":Ranger<CR>", { desc = "Ranger"})
|
vim.keymap.set("n", "<F3>", ":Ranger<CR>", { desc = "Ranger"})
|
||||||
vim.keymap.set("n", "<c-F3>", ":RangerNewTab<CR>", { desc = "Ranger New Tab"})
|
vim.keymap.set("n", "<c-F3>", ":RangerNewTab<CR>", { desc = "Ranger New Tab"})
|
||||||
-- vim.keymap.set("n", "<F4>", ":q<CR>", { desc = "Quit"})
|
|
||||||
-- vim.keymap.set("n", "<F5>", ":bd<CR>", { desc = "Close Buffer"})
|
|
||||||
-- vim.keymap.set("n", "<F6>", ":tabnew<CR>", { desc = "New Tab"})
|
|
||||||
-- vim.keymap.set("n", "<F7>", ":tabclose<CR>", { desc = "Close Tab"})
|
|
||||||
-- vim.keymap.set("n", "<F8>", ":tabnext<CR>", { desc = "Next Tab"})
|
|
||||||
vim.keymap.set("n", "<F9>", ":Telescope live_grep<CR>", { desc = "Live Grep"})
|
vim.keymap.set("n", "<F9>", ":Telescope live_grep<CR>", { desc = "Live Grep"})
|
||||||
-- vim.keymap.set("n", "<F10>", ":b#<CR>", { desc = "Last Buffer"})
|
|
||||||
vim.keymap.set("n", "<F11>", ":setlocal spell! spelllang=en_us<CR>", { desc = "Toggle Spell Check"})
|
vim.keymap.set("n", "<F11>", ":setlocal spell! spelllang=en_us<CR>", { desc = "Toggle Spell Check"})
|
||||||
vim.keymap.set("n", "<F12>", ":setlocal wrap!<CR>", { desc = "Toggle Line Wrap"})
|
vim.keymap.set("n", "<F12>", ":setlocal wrap!<CR>", { desc = "Toggle Line Wrap"})
|
||||||
|
|
||||||
@@ -127,6 +121,12 @@ vim.keymap.set( "v", "<leader>as", "<cmd>ClaudeCodeSend<cr>", {desc = "Send to C
|
|||||||
-- vim.keymap.set( "n", "<leader>as", "<cmd>ClaudeCodeTreeAdd<cr>", {desc = "Add file", ft = { "NvimTree", "neo-tree", "oil", "minifiles" }})
|
-- vim.keymap.set( "n", "<leader>as", "<cmd>ClaudeCodeTreeAdd<cr>", {desc = "Add file", ft = { "NvimTree", "neo-tree", "oil", "minifiles" }})
|
||||||
vim.keymap.set( "n", "<leader>aa", "<cmd>ClaudeCodeDiffAccept<cr>", {desc = "Accept diff" })
|
vim.keymap.set( "n", "<leader>aa", "<cmd>ClaudeCodeDiffAccept<cr>", {desc = "Accept diff" })
|
||||||
vim.keymap.set( "n", "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", {desc = "Deny diff" })
|
vim.keymap.set( "n", "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", {desc = "Deny diff" })
|
||||||
|
-- LSP Related Keys --
|
||||||
|
vim.keymap.set( "n", "<leader>l", "", {desc = "LSP" })
|
||||||
|
vim.keymap.set( "n", "<leader>lo", "", {desc = "LSP Overlays" })
|
||||||
|
vim.keymap.set( "n", "<leader>los", "<cmd>Trouble symbols<cr>", {desc = "Symbols" })
|
||||||
|
vim.keymap.set( "n", "<leader>lod", "<cmd>Trouble diagnostics<cr>", {desc = "Diagnostics" })
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = { "NvimTree", "neo-tree", "oil", "minifiles" },
|
pattern = { "NvimTree", "neo-tree", "oil", "minifiles" },
|
||||||
callback = function()
|
callback = function()
|
||||||
|
|||||||
156
lua/lsp.lua
156
lua/lsp.lua
@@ -1,11 +1,6 @@
|
|||||||
local vim = vim
|
local vim = vim
|
||||||
-- vim.cmd [[
|
|
||||||
-- augroup LspCompletion
|
-- Enable LSP servers with proper configuration
|
||||||
-- autocmd!
|
|
||||||
-- autocmd InsertEnter * setlocal omnifunc=v:lua.vim.lsp.omnifunc
|
|
||||||
-- autocmd TextChangedI * if pumvisible() == 0 | silent! lua vim.fn.complete(vim.fn.col('.'), vim.fn["vim.lsp.omnifunc"]()) | endif
|
|
||||||
-- augroup END
|
|
||||||
-- ]]
|
|
||||||
vim.lsp.enable('lua_ls')
|
vim.lsp.enable('lua_ls')
|
||||||
vim.lsp.enable('gopls', {
|
vim.lsp.enable('gopls', {
|
||||||
settings = {
|
settings = {
|
||||||
@@ -29,30 +24,163 @@ vim.lsp.enable('gopls', {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
vim.lsp.enable('nim_langserver')
|
vim.lsp.enable('nim_langserver')
|
||||||
|
|
||||||
|
-- Fix: Add proper configuration for pyright/basedpyright
|
||||||
|
-- For NixOS with basedpyright:
|
||||||
|
vim.lsp.enable('basedpyright', {
|
||||||
|
settings = {
|
||||||
|
basedpyright = {
|
||||||
|
analysis = {
|
||||||
|
typeCheckingMode = "basic",
|
||||||
|
autoSearchPaths = true,
|
||||||
|
useLibraryCodeForTypes = true,
|
||||||
|
diagnosticMode = "workspace",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Alternative: If you have regular pyright installed
|
||||||
|
-- vim.lsp.enable('pyright', {
|
||||||
|
-- settings = {
|
||||||
|
-- python = {
|
||||||
|
-- analysis = {
|
||||||
|
-- typeCheckingMode = "basic",
|
||||||
|
-- autoSearchPaths = true,
|
||||||
|
-- useLibraryCodeForTypes = true,
|
||||||
|
-- diagnosticMode = "workspace",
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- })
|
||||||
|
|
||||||
|
-- Alternative: Manual LSP start if vim.lsp.enable doesn't work
|
||||||
|
-- vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
-- pattern = 'python',
|
||||||
|
-- callback = function()
|
||||||
|
-- -- Check if basedpyright is available first
|
||||||
|
-- if vim.fn.executable('basedpyright-langserver') == 1 then
|
||||||
|
-- vim.lsp.start({
|
||||||
|
-- name = 'basedpyright',
|
||||||
|
-- cmd = { 'basedpyright-langserver', '--stdio' },
|
||||||
|
-- root_dir = vim.fs.dirname(
|
||||||
|
-- vim.fs.find({ 'pyproject.toml', 'setup.py', '.git' }, { upward = true })[1]
|
||||||
|
-- ),
|
||||||
|
-- settings = {
|
||||||
|
-- basedpyright = {
|
||||||
|
-- analysis = {
|
||||||
|
-- typeCheckingMode = "basic",
|
||||||
|
-- autoSearchPaths = true,
|
||||||
|
-- useLibraryCodeForTypes = true,
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- })
|
||||||
|
-- elseif vim.fn.executable('pyright-langserver') == 1 then
|
||||||
|
-- vim.lsp.start({
|
||||||
|
-- name = 'pyright',
|
||||||
|
-- cmd = { 'pyright-langserver', '--stdio' },
|
||||||
|
-- root_dir = vim.fs.dirname(
|
||||||
|
-- vim.fs.find({ 'pyproject.toml', 'setup.py', '.git' }, { upward = true })[1]
|
||||||
|
-- ),
|
||||||
|
-- settings = {
|
||||||
|
-- python = {
|
||||||
|
-- analysis = {
|
||||||
|
-- typeCheckingMode = "basic",
|
||||||
|
-- autoSearchPaths = true,
|
||||||
|
-- useLibraryCodeForTypes = true,
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- })
|
||||||
|
-- else
|
||||||
|
-- print("Neither basedpyright-langserver nor pyright-langserver found")
|
||||||
|
-- end
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
|
||||||
require("lsp_signature").setup({
|
require("lsp_signature").setup({
|
||||||
debug = false,
|
debug = false,
|
||||||
bind = true, -- registers signature handler
|
bind = true,
|
||||||
doc_lines = 10,
|
doc_lines = 10,
|
||||||
max_height = 12,
|
max_height = 12,
|
||||||
max_width = function() return math.floor(vim.api.nvim_win_get_width(0) * 0.8) end,
|
max_width = function() return math.floor(vim.api.nvim_win_get_width(0) * 0.8) end,
|
||||||
wrap = true,
|
wrap = true,
|
||||||
floating_window = true, -- show the popup
|
floating_window = true,
|
||||||
floating_window_above_cur_line = true,
|
floating_window_above_cur_line = true,
|
||||||
floating_window_off_x = 1,
|
floating_window_off_x = 1,
|
||||||
floating_window_off_y = 0,
|
floating_window_off_y = 0,
|
||||||
|
|
||||||
-- IMPORTANT: don’t inline (you can change later if you want)
|
|
||||||
hint_enable = true,
|
hint_enable = true,
|
||||||
hint_inline = function() return false end,
|
hint_inline = function() return false end,
|
||||||
|
|
||||||
hint_prefix = "🐼 ",
|
hint_prefix = "🐼 ",
|
||||||
hint_scheme = "String",
|
hint_scheme = "String",
|
||||||
hi_parameter = "LspSignatureActiveParameter",
|
hi_parameter = "LspSignatureActiveParameter",
|
||||||
handler_opts = { border = "rounded" },
|
handler_opts = { border = "rounded" },
|
||||||
|
|
||||||
always_trigger = false,
|
always_trigger = false,
|
||||||
extra_trigger_chars = { "(", "," }, -- good default
|
extra_trigger_chars = { "(", "," },
|
||||||
zindex = 200,
|
zindex = 200,
|
||||||
padding = "",
|
padding = "",
|
||||||
timer_interval = 200,
|
timer_interval = 200,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- local vim = vim
|
||||||
|
-- -- vim.cmd [[
|
||||||
|
-- -- augroup LspCompletion
|
||||||
|
-- -- autocmd!
|
||||||
|
-- -- autocmd InsertEnter * setlocal omnifunc=v:lua.vim.lsp.omnifunc
|
||||||
|
-- -- autocmd TextChangedI * if pumvisible() == 0 | silent! lua vim.fn.complete(vim.fn.col('.'), vim.fn["vim.lsp.omnifunc"]()) | endif
|
||||||
|
-- -- augroup END
|
||||||
|
-- -- ]]
|
||||||
|
-- vim.lsp.enable('lua_ls')
|
||||||
|
-- vim.lsp.enable('gopls', {
|
||||||
|
-- settings = {
|
||||||
|
-- gopls = {
|
||||||
|
-- analyses = {
|
||||||
|
-- unusedparams = true,
|
||||||
|
-- unusedwrite = true,
|
||||||
|
-- shadow = true,
|
||||||
|
-- },
|
||||||
|
-- staticcheck = true,
|
||||||
|
-- usePlaceholders = true,
|
||||||
|
-- hints = {
|
||||||
|
-- assignVariableTypes = true,
|
||||||
|
-- compositeLiteralFields = true,
|
||||||
|
-- compositeLiteralTypes = true,
|
||||||
|
-- functionTypeParameters = true,
|
||||||
|
-- parameterNames = true,
|
||||||
|
-- rangeVariableTypes = true,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- })
|
||||||
|
-- vim.lsp.enable('nim_langserver')
|
||||||
|
-- vim.lsp.enable('pyright')
|
||||||
|
-- require("lsp_signature").setup({
|
||||||
|
-- debug = false,
|
||||||
|
-- bind = true, -- registers signature handler
|
||||||
|
-- doc_lines = 10,
|
||||||
|
-- max_height = 12,
|
||||||
|
-- max_width = function() return math.floor(vim.api.nvim_win_get_width(0) * 0.8) end,
|
||||||
|
-- wrap = true,
|
||||||
|
-- floating_window = true, -- show the popup
|
||||||
|
-- floating_window_above_cur_line = true,
|
||||||
|
-- floating_window_off_x = 1,
|
||||||
|
-- floating_window_off_y = 0,
|
||||||
|
--
|
||||||
|
-- -- IMPORTANT: don’t inline (you can change later if you want)
|
||||||
|
-- hint_enable = true,
|
||||||
|
-- hint_inline = function() return false end,
|
||||||
|
--
|
||||||
|
-- hint_prefix = "🐼 ",
|
||||||
|
-- hint_scheme = "String",
|
||||||
|
-- hi_parameter = "LspSignatureActiveParameter",
|
||||||
|
-- handler_opts = { border = "rounded" },
|
||||||
|
--
|
||||||
|
-- always_trigger = false,
|
||||||
|
-- extra_trigger_chars = { "(", "," }, -- good default
|
||||||
|
-- zindex = 200,
|
||||||
|
-- padding = "",
|
||||||
|
-- timer_interval = 200,
|
||||||
|
-- })
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ vim.o.completeopt = "menuone"
|
|||||||
|
|
||||||
vim.o.cursorline = true
|
vim.o.cursorline = true
|
||||||
vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||||
vim.g.netrw_keepdir = 1
|
vim.g.netrw_keepdir = 0
|
||||||
vim.g.netrw_winsize = 20
|
vim.g.netrw_winsize = 20
|
||||||
vim.g.netrw_banner = 0
|
vim.g.netrw_banner = 0
|
||||||
vim.g.netrw_localcopydircmd = 'cp -avr'
|
vim.g.netrw_localcopydircmd = 'cp -avr'
|
||||||
|
|||||||
Reference in New Issue
Block a user