This commit is contained in:
newbie 2024-01-10 23:21:52 +08:00
parent ec42df6ac5
commit 56c11a3501
3 changed files with 13 additions and 2 deletions

4
lua/lsp/json.lua Normal file
View File

@ -0,0 +1,4 @@
return {
on_attach = function()
end
}

View File

@ -56,6 +56,13 @@ G.au({ "InsertEnter" }, {
end, end,
}) })
G.au({ "VimEnter" }, {
pattern = { "*.code-snippets" },
callback = function()
G.cmd("setfiletype json")
end,
})
-- G.au({ -- G.au({
-- {"CmdlineEnter"}, -- {"CmdlineEnter"},
-- { -- {

View File

@ -14,7 +14,7 @@ return {
require 'lspconfig'.pyright.setup(require('lsp.pyright')) require 'lspconfig'.pyright.setup(require('lsp.pyright'))
require 'lspconfig'.yamlls.setup(require('lsp.yaml')) require 'lspconfig'.yamlls.setup(require('lsp.yaml'))
require 'lspconfig'.gopls.setup(require('lsp.go')) require 'lspconfig'.gopls.setup(require('lsp.go'))
require 'lspconfig'.jsonls.setup {} require 'lspconfig'.jsonls.setup(require('lsp.json'))
G.map({ G.map({
@ -139,7 +139,7 @@ return {
'onsails/lspkind-nvim', 'onsails/lspkind-nvim',
}, },
config = function() config = function()
G.g.vsnip_snippet_dir = G.fn.stdpath("config") .. "/sinppets/" G.g.vsnip_snippet_dir = G.fn.stdpath("config") .. "/sinppets/acm/"
local has_words_before = function() local has_words_before = function()
unpack = unpack or table.unpack unpack = unpack or table.unpack
local line, col = unpack(G.api.nvim_win_get_cursor(0)) local line, col = unpack(G.api.nvim_win_get_cursor(0))