[neovim] Initial LSP configuration
This commit is contained in:
@@ -119,8 +119,15 @@ map("n", "<leader>lc", function()
|
|||||||
vim.wo.list = not vim.wo.list
|
vim.wo.list = not vim.wo.list
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- Hightlight copied text
|
||||||
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
|
callback = function() vim.highlight.on_yank() end
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
-- [[ PLUGINS ]] --
|
-- [[ PLUGINS ]] --
|
||||||
|
|
||||||
|
-- Install plugins
|
||||||
vim.pack.add({
|
vim.pack.add({
|
||||||
-- Colorscheme
|
-- Colorscheme
|
||||||
"https://github.com/blazkowolf/gruber-darker.nvim",
|
"https://github.com/blazkowolf/gruber-darker.nvim",
|
||||||
@@ -131,9 +138,6 @@ vim.pack.add({
|
|||||||
-- Fuzzy finder
|
-- Fuzzy finder
|
||||||
"https://github.com/echasnovski/mini.pick",
|
"https://github.com/echasnovski/mini.pick",
|
||||||
|
|
||||||
-- Advanced undo tree
|
|
||||||
"https://github.com/mbbill/undotree",
|
|
||||||
|
|
||||||
-- Git integration
|
-- Git integration
|
||||||
"https://github.com/tpope/vim-fugitive",
|
"https://github.com/tpope/vim-fugitive",
|
||||||
"https://github.com/lewis6991/gitsigns.nvim",
|
"https://github.com/lewis6991/gitsigns.nvim",
|
||||||
@@ -154,10 +158,17 @@ vim.pack.add({
|
|||||||
{ src = "https://github.com/nvim-neo-tree/neo-tree.nvim", version = vim.version.range("3") },
|
{ src = "https://github.com/nvim-neo-tree/neo-tree.nvim", version = vim.version.range("3") },
|
||||||
"https://github.com/nvim-lua/plenary.nvim",
|
"https://github.com/nvim-lua/plenary.nvim",
|
||||||
"https://github.com/MunifTanjim/nui.nvim",
|
"https://github.com/MunifTanjim/nui.nvim",
|
||||||
"https://github.com/nvim-tree/nvim-web-devicons"
|
"https://github.com/nvim-tree/nvim-web-devicons",
|
||||||
})
|
|
||||||
|
|
||||||
-- Load plugins
|
-- LSP
|
||||||
|
"https://github.com/neovim/nvim-lspconfig",
|
||||||
|
"https://github.com/mason-org/mason.nvim",
|
||||||
|
"https://github.com/mason-org/mason-lspconfig.nvim",
|
||||||
|
})
|
||||||
|
vim.cmd.packadd("nvim.undotree")
|
||||||
|
vim.cmd.packadd("nvim.difftool")
|
||||||
|
|
||||||
|
-- Configure plugins
|
||||||
cmd.colorscheme("gruber-darker")
|
cmd.colorscheme("gruber-darker")
|
||||||
require("mini.pick").setup()
|
require("mini.pick").setup()
|
||||||
require("multiple-cursors").setup()
|
require("multiple-cursors").setup()
|
||||||
@@ -173,12 +184,35 @@ require("neo-tree").setup({
|
|||||||
width = 32
|
width = 32
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
require("mason").setup()
|
||||||
|
require("mason-lspconfig").setup()
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
version = "LuaJIT",
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
globals = {
|
||||||
|
"vim",
|
||||||
|
"require"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
},
|
||||||
|
telemetry = {
|
||||||
|
enable = false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
-- Plugin keymaps
|
-- Plugin keymaps
|
||||||
map("n", "<leader>f", ":Pick files<CR>")
|
map("n", "<leader>f", ":Pick files<CR>")
|
||||||
map("n", "<leader>b", ":Pick buffers<CR>")
|
map("n", "<leader>b", ":Pick buffers<CR>")
|
||||||
|
|
||||||
map("n", "<leader>u", ":UndotreeToggle<CR>")
|
map("n", "<leader>u", ":Undotree<CR>")
|
||||||
map("n", "<leader>gs", ":Git<CR>")
|
map("n", "<leader>gs", ":Git<CR>")
|
||||||
|
|
||||||
map("n", "<leader>gt", ":Gitsigns toggle_signs<CR>")
|
map("n", "<leader>gt", ":Gitsigns toggle_signs<CR>")
|
||||||
|
|||||||
Reference in New Issue
Block a user