update
This commit is contained in:
parent
d5927286ab
commit
be12cae2f9
@ -39,23 +39,22 @@ return {
|
||||
{
|
||||
-- lsp的config
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function ()
|
||||
require'lspconfig'.lua_ls.setup(require('lsp.lua'))
|
||||
require'lspconfig'.clangd.setup(require('lsp.c'))
|
||||
require'lspconfig'.bash_ls.setup(require('lsp.bash'))
|
||||
require'lspconfig'.pyright.setup(require('lsp.pyright'))
|
||||
config = function()
|
||||
require 'lspconfig'.lua_ls.setup(require('lsp.lua'))
|
||||
require 'lspconfig'.clangd.setup(require('lsp.c'))
|
||||
-- require'lspconfig'.bash_ls.setup(require('lsp.bash'))
|
||||
require 'lspconfig'.pyright.setup(require('lsp.pyright'))
|
||||
G.map({
|
||||
{'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>'},
|
||||
{ 'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>' },
|
||||
|
||||
{'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>'},
|
||||
{'n', 'gh', '<cmd>lua vim.lsp.buf.hover()<CR>'},
|
||||
{'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>'},
|
||||
{'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>'},
|
||||
{'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>'},
|
||||
{'n', '<c-s-i>', '<cmd>lua vim.lsp.buf.formatting()<CR>'},
|
||||
{ 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>' },
|
||||
{ 'n', 'gh', '<cmd>lua vim.lsp.buf.hover()<CR>' },
|
||||
{ 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>' },
|
||||
{ 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>' },
|
||||
{ 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>' },
|
||||
{ 'n', '<c-I>', '<cmd>lua vim.lsp.buf.format()<CR>' },
|
||||
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
},
|
||||
@ -67,9 +66,9 @@ return {
|
||||
end
|
||||
},
|
||||
{ --
|
||||
'simrat39/symbols-outline.nvim',
|
||||
config = function ()
|
||||
local opts = {
|
||||
'simrat39/symbols-outline.nvim',
|
||||
config = function()
|
||||
local opts = {
|
||||
highlight_hovered_item = true,
|
||||
show_guides = true,
|
||||
auto_preview = false,
|
||||
@ -86,7 +85,7 @@ return {
|
||||
fold_markers = { '', '' },
|
||||
wrap = false,
|
||||
keymaps = { -- These keymaps can be a string or a table for multiple keys
|
||||
close = {"<Esc>", "q"},
|
||||
close = { "<Esc>", "q" },
|
||||
goto_location = "<Cr>",
|
||||
focus_location = "o",
|
||||
hover_symbol = "<C-space>",
|
||||
@ -130,12 +129,13 @@ return {
|
||||
TypeParameter = { icon = "𝙏", hl = "@parameter" },
|
||||
Component = { icon = "", hl = "@function" },
|
||||
Fragment = { icon = "", hl = "@constant" },
|
||||
},}
|
||||
require("symbols-outline").setup(opts)
|
||||
G.map({
|
||||
{"n", "<leader>o", ":SymbolsOutline<cr>"},
|
||||
})
|
||||
end
|
||||
},
|
||||
}
|
||||
require("symbols-outline").setup(opts)
|
||||
G.map({
|
||||
{ "n", "<leader>o", ":SymbolsOutline<cr>" },
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
-- lsp补全
|
||||
@ -158,7 +158,7 @@ return {
|
||||
end,
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'vnsip'},
|
||||
{ name = 'vnsip' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'path' },
|
||||
@ -193,7 +193,7 @@ return {
|
||||
with_text = true,
|
||||
maxwidth = 50,
|
||||
mode = 'symbol',
|
||||
before = function (entry, vim_item)
|
||||
before = function(entry, vim_item)
|
||||
vim_item.kind = kind_icons[vim_item.kind]
|
||||
vim_item.menu = ({
|
||||
buffer = "[Buffer]",
|
||||
@ -206,47 +206,46 @@ return {
|
||||
}
|
||||
cmp.setup.cmdline('/', {
|
||||
view = {
|
||||
entries = {name = 'wildmenu', separator = '|' }
|
||||
entries = { name = 'wildmenu', separator = '|' }
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
-- 语法高亮 --
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
config = function()
|
||||
require'nvim-treesitter.configs'.setup{
|
||||
ensure_installed = {},
|
||||
indent = { enable = true },
|
||||
sync_install = false,
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function(lang, buf)
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(G.loop.fs_stat, G.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
{
|
||||
-- 语法高亮 --
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
config = function()
|
||||
require 'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = {},
|
||||
indent = { enable = true },
|
||||
sync_install = false,
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function(lang, buf)
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(G.loop.fs_stat, G.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
parsers = {
|
||||
html = {
|
||||
install_info = {
|
||||
url = "https://github.com/ikatyang/tree-sitter-vue",
|
||||
files = {"src/parser.c"},
|
||||
branch = "main"
|
||||
end
|
||||
end,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
parsers = {
|
||||
html = {
|
||||
install_info = {
|
||||
url = "https://github.com/ikatyang/tree-sitter-vue",
|
||||
files = { "src/parser.c" },
|
||||
branch = "main"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
},
|
||||
end
|
||||
},
|
||||
},
|
||||
{
|
||||
""
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user