feat: setup LSPs
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"diagnostics.globals": [
|
||||||
|
"vim"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
|
|
||||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||||
|
|
||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
vim.api.nvim_echo({
|
vim.api.nvim_echo({
|
||||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
|
|||||||
+6
-2
@@ -1,11 +1,15 @@
|
|||||||
{
|
{
|
||||||
"github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" },
|
"github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
|
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
|
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "e942edf5c85b6a2ab74059ea566cac5b3e1514a4" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "e6645ecfcba3e064446a6def1c10d788c9873f51" },
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "e6645ecfcba3e064446a6def1c10d788c9873f51" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
|
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "f0c928dbe93533b7e35894a8f957f40150d1f663" },
|
"nvim-lspconfig": { "branch": "master", "commit": "339ccc81e08793c3af9b83882a6ebd90c9cc0d3b" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "fd59f984416f696d85119fd4d15ce0965b179944" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" },
|
"nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
|
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
|
||||||
|
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }
|
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
config = function()
|
||||||
|
require("mason").setup()
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
config = function()
|
||||||
|
require("mason-lspconfig").setup({
|
||||||
|
ensure_installed = { "lua_ls", "ts_ls" }
|
||||||
|
})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
lspconfig.lua_ls.setup({})
|
||||||
|
lspconfig.ts_ls.setup({})
|
||||||
|
|
||||||
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, { desc = "Display symbol info" })
|
||||||
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, { desc = "Go to declaration" })
|
||||||
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { desc = "Go to definition" })
|
||||||
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, { desc = "Go to implementation" })
|
||||||
|
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, { desc = "Get signature help" })
|
||||||
|
vim.keymap.set({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, { desc = "Get code actions" })
|
||||||
|
end
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
return {
|
return {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("lualine").setup()
|
require("lualine").setup({
|
||||||
options = { theme = "dracula" }
|
options = { theme = "dracula" }
|
||||||
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
+27
-10
@@ -1,13 +1,30 @@
|
|||||||
return {
|
return {
|
||||||
'nvim-telescope/telescope.nvim',
|
{
|
||||||
tag = '0.1.8',
|
'nvim-telescope/telescope.nvim',
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
tag = '0.1.8',
|
||||||
config = function()
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
local builtin = require('telescope.builtin')
|
config = function()
|
||||||
|
local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
vim.keymap.set('n', '<C-p>', builtin.find_files, { desc = 'Telescope find files' })
|
vim.keymap.set('n', '<C-p>', builtin.find_files, { desc = 'Telescope find files' })
|
||||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
|
||||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
|
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
|
||||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
|
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
|
||||||
end
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope-ui-select.nvim",
|
||||||
|
config = function()
|
||||||
|
require("telescope").setup({
|
||||||
|
extensions = {
|
||||||
|
["ui-select"] = {
|
||||||
|
require("telescope.themes").get_dropdown {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
require("telescope").load_extension("ui-select")
|
||||||
|
end
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user