Signed-off-by: d0zingcat <leewtang@gmail.com>
This commit is contained in:
d0zingcat
2024-06-14 23:41:44 +08:00
parent bcb7f6e648
commit 7c98cab801
6 changed files with 158 additions and 3 deletions

2
.zshrc
View File

@@ -203,6 +203,8 @@ alias kns='kubens'
alias kctx='kubectx'
alias kd='kubectl debug'
alias kk='kubectl krew'
alias kzeus='kubectl --context zeus '
alias khybrid='kubectl --context hybrid'
alias kget='kubectl get'
alias kdesc='kubectl describe'
alias klog='kubectl logs'

View File

@@ -6,5 +6,5 @@ function OpenFinder()
local current_path = vim.fn.expand('%:p:h')
vim.cmd('!open ' .. current_path)
end
vim.api.nvim_set_keymap('n', '<leader>of', ':lua OpenFinder()<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>of', ':lua OpenFinder()<CR>', { noremap = true, silent = true })

View File

@@ -15,7 +15,7 @@ vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
{ import = 'plugins' },
{ import = 'plugins.lsp' },
-- { import = 'plugins.lsp' },
},
ui = {
border = 'rounded',

View File

@@ -0,0 +1,149 @@
return {
'junnplus/lsp-setup.nvim',
dependencies = {
'neovim/nvim-lspconfig',
'williamboman/mason.nvim', -- optional
'williamboman/mason-lspconfig.nvim', -- optional
'folke/neodev.nvim'
},
init = function()
vim.lsp.set_log_level('debug')
require('vim.lsp.log').set_format_func(vim.inspect)
local rounded = { border = 'rounded' }
vim.diagnostic.config({ float = rounded })
local with_rounded = function(handler)
return vim.lsp.with(handler, rounded)
end
vim.lsp.handlers['textDocument/hover'] = with_rounded(vim.lsp.handlers.hover)
vim.lsp.handlers['textDocument/signatureHelp'] = with_rounded(vim.lsp.handlers.signature_help)
end,
opts = {
mappings = {
gd = function() require('telescope.builtin').lsp_definitions() end,
gi = function() require('telescope.builtin').lsp_implementations() end,
gr = function() require('telescope.builtin').lsp_references() end,
['<space>f'] = vim.lsp.buf.format,
},
inlay_hints = {
enabled = true,
debug = true,
},
servers = {
eslint = {},
pylsp = {
settings = {
pylsp = {
-- PylspInstall python-lsp-black
-- PylspInstall pyls-isort
configurationSources = { 'flake8' },
plugins = {
pycodestyle = {
enabled = false,
},
mccabe = {
enabled = false,
},
pyflakes = {
enabled = false,
},
flake8 = {
enabled = true,
},
black = {
enabled = true,
}
}
}
}
},
yamlls = {
settings = {
yaml = {
keyOrdering = false
}
}
},
jsonls = {},
bashls = {},
tsserver = {
settings = {
typescript = {
inlayHints = {
includeInlayParameterNameHints = 'all',
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayVariableTypeHintsWhenTypeMatchesName = false,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
}
},
}
},
dockerls = {},
-- jsonnet_ls = {},
helm_ls = {},
gopls = {
settings = {
gopls = {
gofumpt = true,
-- staticcheck = true,
usePlaceholders = true,
codelenses = {
gc_details = true,
},
hints = {
rangeVariableTypes = true,
parameterNames = true,
constantValues = true,
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
functionTypeParameters = true,
},
},
},
},
-- bufls = {},
-- html = {},
lua_ls = {
settings = {
Lua = {
workspace = {
checkThirdParty = false,
},
hint = {
enable = true,
arrayIndex = 'Disable',
},
}
}
},
['rust_analyzer@nightly'] = {
settings = {
['rust-analyzer'] = {
diagnostics = {
disabled = { 'unresolved-proc-macro' },
},
cargo = {
loadOutDirsFromCheck = true,
},
procMacro = {
enable = true,
},
inlayHints = {
closureReturnTypeHints = {
enable = true
},
},
cache = {
warmup = false,
}
},
},
}
}
},
}

View File

@@ -0,0 +1,5 @@
return {
'ray-x/lsp_signature.nvim',
event = 'VeryLazy',
config = true,
}

View File

@@ -1 +0,0 @@
return {}