mirror of
https://github.com/nvim-lua/kickstart.nvim.git
synced 2026-03-30 01:31:30 +00:00
Compare commits
No commits in common. "1f4c21f4637eb7af77c34ac87c739e378043a336" and "a6dcf6874b54b294d0c2c4009161bdebd55183ef" have entirely different histories.
1f4c21f463
...
a6dcf6874b
23
init.lua
23
init.lua
@ -598,6 +598,12 @@ require('lazy').setup({
|
||||
end,
|
||||
})
|
||||
|
||||
-- LSP servers and clients are able to communicate to each other what features they support.
|
||||
-- By default, Neovim doesn't support everything that is in the LSP specification.
|
||||
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
|
||||
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
|
||||
-- Enable the following language servers
|
||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||
-- See `:help lsp-config` for information about keys and how to configure
|
||||
@ -661,6 +667,7 @@ require('lazy').setup({
|
||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||
|
||||
for name, server in pairs(servers) do
|
||||
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||
vim.lsp.config(name, server)
|
||||
vim.lsp.enable(name)
|
||||
end
|
||||
@ -875,7 +882,6 @@ require('lazy').setup({
|
||||
lazy = false,
|
||||
build = ':TSUpdate',
|
||||
branch = 'main',
|
||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro`
|
||||
config = function()
|
||||
local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
|
||||
require('nvim-treesitter').install(parsers)
|
||||
@ -884,20 +890,9 @@ require('lazy').setup({
|
||||
local buf, filetype = args.buf, args.match
|
||||
|
||||
local language = vim.treesitter.language.get_lang(filetype)
|
||||
if not language then return end
|
||||
if not vim.tbl_contains(parsers, language) then return end
|
||||
|
||||
-- check if parser exists and load it
|
||||
if not vim.treesitter.language.add(language) then return end
|
||||
-- enables syntax highlighting and other treesitter features
|
||||
vim.treesitter.start(buf, language)
|
||||
|
||||
-- enables treesitter based folds
|
||||
-- for more info on folds see `:help folds`
|
||||
-- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||
-- vim.wo.foldmethod = 'expr'
|
||||
|
||||
-- enables treesitter based indentation
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
vim.treesitter.start()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user