updates
This commit is contained in:
+19
-37
@@ -76,7 +76,7 @@ opt.clipboard = opt.clipboard + {"unnamedplus"}
|
|||||||
opt.foldenable = false
|
opt.foldenable = false
|
||||||
opt.foldmethod = "expr"
|
opt.foldmethod = "expr"
|
||||||
|
|
||||||
opt.completeopt = "menu,menuone,noselect"
|
opt.completeopt = "menu,menuone,noinsert"
|
||||||
|
|
||||||
-- ----------------------------------------
|
-- ----------------------------------------
|
||||||
-- AUTOCOMMANDS
|
-- AUTOCOMMANDS
|
||||||
@@ -175,7 +175,7 @@ require("packer").startup {function(use)
|
|||||||
use {"farmergreg/vim-lastplace"} -- keep location upon reopening
|
use {"farmergreg/vim-lastplace"} -- keep location upon reopening
|
||||||
|
|
||||||
-- smooth scrolling
|
-- smooth scrolling
|
||||||
use {"psliwka/vim-smoothie"}
|
-- use {"psliwka/vim-smoothie"}
|
||||||
|
|
||||||
-- tables
|
-- tables
|
||||||
use {"dhruvasagar/vim-table-mode"}
|
use {"dhruvasagar/vim-table-mode"}
|
||||||
@@ -491,16 +491,22 @@ use {"nvim-treesitter/nvim-treesitter",
|
|||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
mapping = {
|
mapping = {
|
||||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
['<C-n>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
['<C-p>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
['<tab>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||||
["<C-e>"] = cmp.mapping.close(),
|
['<S-tab>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||||
["<cr>"] = cmp.mapping.confirm({ select = true }),
|
['<Down>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
|
||||||
|
['<Up>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
|
||||||
|
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
['<esc>'] = cmp.mapping.close(),
|
||||||
|
['<cr>'] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true, })
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
{ name = "path" },
|
-- { name = "path" },
|
||||||
-- { name = "nvim_lua" },
|
-- { name = "nvim_lua" },
|
||||||
},
|
},
|
||||||
sorting = {
|
sorting = {
|
||||||
@@ -597,8 +603,7 @@ use {"nvim-treesitter/nvim-treesitter",
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
use {"glepnir/lspsaga.nvim",
|
use {"neovim/nvim-lspconfig",
|
||||||
requires = {"neovim/nvim-lspconfig"},
|
|
||||||
run = ":TSUpdate",
|
run = ":TSUpdate",
|
||||||
config = function()
|
config = function()
|
||||||
-- see https://github.com/lukas-reineke/dotfiles/blob/master/vim/lua/lsp/init.lua
|
-- see https://github.com/lukas-reineke/dotfiles/blob/master/vim/lua/lsp/init.lua
|
||||||
@@ -619,21 +624,18 @@ use {"nvim-treesitter/nvim-treesitter",
|
|||||||
-- popups
|
-- popups
|
||||||
bmap(bufnr, "n", "<M-x>", "<cmd>lua vim.lsp.buf.signature_help()<cr>", opts)
|
bmap(bufnr, "n", "<M-x>", "<cmd>lua vim.lsp.buf.signature_help()<cr>", opts)
|
||||||
bmap(bufnr, "i", "<M-x>", "<cmd>lua vim.lsp.buf.signature_help()<cr>", opts)
|
bmap(bufnr, "i", "<M-x>", "<cmd>lua vim.lsp.buf.signature_help()<cr>", opts)
|
||||||
bmap(bufnr, "n", "<C-f>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<cr>", opts)
|
|
||||||
bmap(bufnr, "n", "<C-b>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<cr>", opts)
|
|
||||||
-- other
|
-- other
|
||||||
if client.resolved_capabilities.goto_definition then
|
if client.resolved_capabilities.goto_definition then
|
||||||
bmap(bufnr, "n", "gd", ":Lspsaga preview_definition<cr>", opts)
|
bmap(bufnr, "n", "gd", ":lua vim.lsp.buf.definition()<cr>", opts)
|
||||||
bmap(bufnr, "n", "gD", ":lua vim.lsp.buf.definition()<cr>", opts)
|
|
||||||
end
|
end
|
||||||
if client.resolved_capabilities.find_references then
|
if client.resolved_capabilities.find_references then
|
||||||
bmap(bufnr, "n", "gr", ":Lspsaga lsp_finder<cr>", opts)
|
bmap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<cr>", opts)
|
||||||
end
|
end
|
||||||
if client.resolved_capabilities.hover then
|
if client.resolved_capabilities.hover then
|
||||||
bmap(bufnr, "n", "K", ":Lspsaga hover_doc<cr>", opts)
|
bmap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", opts)
|
||||||
end
|
end
|
||||||
if client.resolved_capabilities.rename then
|
if client.resolved_capabilities.rename then
|
||||||
bmap(bufnr, "n", "<M-r>", ":Lspsaga rename<cr>", opts)
|
bmap(bufnr, "n", "<M-r>", "<cmd>lua vim.lsp.buf.rename()<cr>", opts)
|
||||||
end
|
end
|
||||||
if client.resolved_capabilities.document_formatting or client.resolved_capabilities.document_range_formatting then
|
if client.resolved_capabilities.document_formatting or client.resolved_capabilities.document_range_formatting then
|
||||||
vim.api.nvim_command [[augroup Format]]
|
vim.api.nvim_command [[augroup Format]]
|
||||||
@@ -644,26 +646,6 @@ use {"nvim-treesitter/nvim-treesitter",
|
|||||||
vim.api.nvim_command [[augroup END]]
|
vim.api.nvim_command [[augroup END]]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
use_saga_diagnostic_sign = true
|
|
||||||
require("lspsaga").init_lsp_saga {
|
|
||||||
max_preview_lines = 20,
|
|
||||||
finder_action_keys = {
|
|
||||||
quit = {"<esc>", "C-c"},
|
|
||||||
open = "<cr>",
|
|
||||||
vsplit = "v",
|
|
||||||
split = "s",
|
|
||||||
scroll_down = "<C-f>",
|
|
||||||
scroll_up = "<C-b>"
|
|
||||||
},
|
|
||||||
code_action_keys = {
|
|
||||||
quit = {"<esc>", "C-c"},
|
|
||||||
exec = "<cr>"
|
|
||||||
},
|
|
||||||
rename_action_keys = {
|
|
||||||
quit = {"<esc>", "C-c"},
|
|
||||||
exec = "<cr>"
|
|
||||||
},
|
|
||||||
}
|
|
||||||
local nvim_lsp = require("lspconfig")
|
local nvim_lsp = require("lspconfig")
|
||||||
-- sudo npm install -g typescript typescript-language-server
|
-- sudo npm install -g typescript typescript-language-server
|
||||||
nvim_lsp.tsserver.setup{}
|
nvim_lsp.tsserver.setup{}
|
||||||
|
|||||||
Reference in New Issue
Block a user