Updating lsp to use ts_ls instead of tsserver(deprecated). And updated
whichkey
This commit is contained in:
parent
85a938e71a
commit
6ee3d5f407
4
after/ftplugin/vue.lua
Normal file
4
after/ftplugin/vue.lua
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
vim.bo.tabstop = 2 -- size of a hard tabstop (ts).
|
||||||
|
vim.bo.shiftwidth = 2 -- size of an indentation (sw).
|
||||||
|
vim.bo.expandtab = true -- always uses spaces instead of tab characters (et).
|
||||||
|
vim.bo.softtabstop = 2 -- number of spaces a <Tab> counts for. When 0, feature is off (sts).
|
@ -41,6 +41,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|||||||
-- Execute a code action, usually your cursor needs to be on top of an error
|
-- Execute a code action, usually your cursor needs to be on top of an error
|
||||||
-- or a suggestion from your LSP for this to activate.
|
-- or a suggestion from your LSP for this to activate.
|
||||||
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||||
|
map('<leader>cf', vim.lsp.buf.format, '[C]ode [F]ormat')
|
||||||
|
|
||||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||||
-- For example, in C this would take you to the header.
|
-- For example, in C this would take you to the header.
|
||||||
@ -59,13 +60,13 @@ local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|||||||
|
|
||||||
require('mason').setup({})
|
require('mason').setup({})
|
||||||
require('mason-lspconfig').setup({
|
require('mason-lspconfig').setup({
|
||||||
ensure_installed = {'lua_ls', 'pyright', 'rust_analyzer', 'clangd', 'tsserver', },
|
ensure_installed = {'lua_ls', 'pyright', 'rust_analyzer', 'clangd', 'ts_ls', },
|
||||||
handlers = {
|
handlers = {
|
||||||
require('lspconfig').clangd.setup({
|
require('lspconfig').clangd.setup({
|
||||||
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto","hpp"},
|
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto","hpp"},
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}),
|
}),
|
||||||
require('lspconfig').tsserver.setup({
|
require('lspconfig').ts_ls.setup({
|
||||||
init_options = {
|
init_options = {
|
||||||
plugins = {
|
plugins = {
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
-- Document existing key chains
|
-- Document existing key chains
|
||||||
require('which-key').register {
|
require('which-key').add {
|
||||||
['<leader>f'] = { name = '[F]ind', _ = 'which_key_ignore' },
|
{ "<leader>f", group = "[F]ind" },
|
||||||
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
{ "<leader>f_", hidden = true },
|
||||||
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
{ "<leader>h", group = "Git [H]unk" },
|
||||||
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
|
{ "<leader>h_", hidden = true },
|
||||||
['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' },
|
{ "<leader>s", group = "[S]earch" },
|
||||||
|
{ "<leader>s_", hidden = true },
|
||||||
|
{ "<leader>t", group = "[T]oggle" },
|
||||||
|
{ "<leader>t_", hidden = true },
|
||||||
|
{ "<leader>w", group = "[W]orkspace" },
|
||||||
|
{ "<leader>w_", hidden = true },
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ require("lazy").setup({
|
|||||||
{'xiyaowong/transparent.nvim'},
|
{'xiyaowong/transparent.nvim'},
|
||||||
{ 'numToStr/Comment.nvim', opts = {} },
|
{ 'numToStr/Comment.nvim', opts = {} },
|
||||||
{ 'mg979/vim-visual-multi' },
|
{ 'mg979/vim-visual-multi' },
|
||||||
|
{ 'xorid/asciitree.nvim' },
|
||||||
{
|
{
|
||||||
'stevearc/aerial.nvim',
|
'stevearc/aerial.nvim',
|
||||||
opts = {},
|
opts = {},
|
||||||
|
Loading…
Reference in New Issue
Block a user