Enable clangd, typescript-tools

This commit is contained in:
Le Viet Dat 2024-07-21 11:47:38 +07:00
parent 0f1b19712c
commit a00e9e2602
1 changed files with 25 additions and 41 deletions

View File

@ -372,18 +372,9 @@ require('lazy').setup({
{ 'folke/neodev.nvim', opts = {} }, { 'folke/neodev.nvim', opts = {} },
}, },
config = function() config = function()
-- Brief aside: **What is LSP?**
--
-- LSP is an initialism you've probably heard, but might not understand what it is.
--
-- LSP stands for Language Server Protocol. It's a protocol that helps editors -- LSP stands for Language Server Protocol. It's a protocol that helps editors
-- and language tooling communicate in a standardized fashion. -- and language tooling communicate in a standardized fashion.
-- --
-- In general, you have a "server" which is some tool built to understand a particular
-- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers
-- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone
-- processes that communicate with some "client" - in this case, Neovim!
--
-- LSP provides Neovim with features like: -- LSP provides Neovim with features like:
-- - Go to definition -- - Go to definition
-- - Find references -- - Find references
@ -512,19 +503,11 @@ require('lazy').setup({
-- - settings (table): Override the default settings passed when initializing the server. -- - settings (table): Override the default settings passed when initializing the server.
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = { local servers = {
-- clangd = {}, clangd = {},
-- gopls = {}, -- gopls = {},
pyright = {}, pyright = {},
rust_analyzer = {}, rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
--
-- Some languages (like typescript) have entire language plugins that can be useful:
-- https://github.com/pmizio/typescript-tools.nvim
--
-- But for many setups, the LSP (`tsserver`) will work just fine
-- tsserver = {},
--
lua_ls = { lua_ls = {
-- cmd = {...}, -- cmd = {...},
-- filetypes = { ...}, -- filetypes = { ...},
@ -670,8 +653,6 @@ require('lazy').setup({
-- For an understanding of why these mappings were -- For an understanding of why these mappings were
-- chosen, you will need to read `:help ins-completion` -- chosen, you will need to read `:help ins-completion`
--
-- No, but seriously. Please read `:help ins-completion`, it is really good!
mapping = cmp.mapping.preset.insert { mapping = cmp.mapping.preset.insert {
-- Select the [n]ext item -- Select the [n]ext item
['<C-n>'] = cmp.mapping.select_next_item(), ['<C-n>'] = cmp.mapping.select_next_item(),
@ -729,25 +710,6 @@ require('lazy').setup({
} }
end, end,
}, },
-- { -- You can easily change to a different colorscheme.
-- -- Change the name of the colorscheme plugin below, and then
-- -- change the command in the config to whatever the name of that colorscheme is.
-- --
-- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
-- 'folke/tokyonight.nvim',
-- priority = 1000, -- Make sure to load this before all the other start plugins.
-- init = function()
-- -- Load the colorscheme here.
-- -- Like many other themes, this one has different styles, and you could load
-- -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
-- vim.cmd.colorscheme 'tokyonight-night'
--
-- -- You can configure highlights by doing something like:
-- vim.cmd.hi 'Comment gui=none'
-- end,
-- },
{ {
'catppuccin/nvim', 'catppuccin/nvim',
name = 'catppuccin', name = 'catppuccin',
@ -758,7 +720,12 @@ require('lazy').setup({
}, },
-- Highlight todo, notes, etc in comments -- Highlight todo, notes, etc in comments
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, {
'folke/todo-comments.nvim',
event = 'VimEnter',
dependencies = { 'nvim-lua/plenary.nvim' },
opts = { signs = false },
},
{ -- Collection of various small independent plugins/modules { -- Collection of various small independent plugins/modules
'echasnovski/mini.nvim', 'echasnovski/mini.nvim',
@ -806,6 +773,11 @@ require('lazy').setup({
}, },
}, },
}, },
{
'pmizio/typescript-tools.nvim',
dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' },
opts = {},
},
{ {
'Exafunction/codeium.nvim', 'Exafunction/codeium.nvim',
dependencies = { dependencies = {
@ -820,7 +792,19 @@ require('lazy').setup({
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate', build = ':TSUpdate',
opts = { opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc', 'ron', 'rust' }, ensure_installed = {
'bash',
'c',
'diff',
'html',
'lua',
'luadoc',
'markdown',
'vim',
'vimdoc',
'ron',
'rust',
},
-- Autoinstall languages that are not installed -- Autoinstall languages that are not installed
auto_install = true, auto_install = true,
highlight = { highlight = {