Merge pull request 'LSP Integration' (#19) from lsp-integration into main
Reviewed-on: #19
This commit was merged in pull request #19.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
nvim/dot-config/nvim/lazy-lock.json
|
nvim/dot-config/nvim/lazy-lock.json
|
||||||
|
nvim/dot-config/nvim/.luarc.json
|
||||||
|
|||||||
39
nvim/dot-config/nvim/lua/plugins/lsp-config.lua
Normal file
39
nvim/dot-config/nvim/lua/plugins/lsp-config.lua
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
config = function ()
|
||||||
|
require("mason").setup()
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
config = function ()
|
||||||
|
require("mason-lspconfig").setup({
|
||||||
|
ensure_installed = {
|
||||||
|
"clangd",
|
||||||
|
"cmake",
|
||||||
|
"lua_ls",
|
||||||
|
"pyright",
|
||||||
|
"rust_analyzer",
|
||||||
|
"taplo",
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
lspconfig.clangd.setup({})
|
||||||
|
lspconfig.cmake.setup({})
|
||||||
|
lspconfig.lua_ls.setup({})
|
||||||
|
lspconfig.pyright.setup({})
|
||||||
|
lspconfig.rust_analyzer.setup({})
|
||||||
|
lspconfig.taplo.setup({})
|
||||||
|
|
||||||
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
|
||||||
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
|
||||||
|
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, {})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,10 +1,43 @@
|
|||||||
return {
|
return {
|
||||||
'nvim-telescope/telescope.nvim',
|
{
|
||||||
branch = '0.1.x',
|
'nvim-telescope/telescope.nvim',
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
branch = '0.1.x',
|
||||||
config = function()
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
local builtin = require('telescope.builtin')
|
config = function()
|
||||||
vim.keymap.set('n', '<C-p>', builtin.find_files, {})
|
local builtin = require('telescope.builtin')
|
||||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
vim.keymap.set('n', '<C-p>', builtin.find_files, {})
|
||||||
end
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'nvim-telescope/telescope-ui-select.nvim',
|
||||||
|
config = function ()
|
||||||
|
-- This is your opts table
|
||||||
|
require("telescope").setup {
|
||||||
|
extensions = {
|
||||||
|
["ui-select"] = {
|
||||||
|
require("telescope.themes").get_dropdown {
|
||||||
|
-- even more opts
|
||||||
|
}
|
||||||
|
-- pseudo code / specification for writing custom displays, like the one
|
||||||
|
-- for "codeactions"
|
||||||
|
-- specific_opts = {
|
||||||
|
-- [kind] = {
|
||||||
|
-- make_indexed = function(items) -> indexed_items, width,
|
||||||
|
-- make_displayer = function(widths) -> displayer
|
||||||
|
-- make_display = function(displayer) -> function(e)
|
||||||
|
-- make_ordinal = function(e) -> string
|
||||||
|
-- },
|
||||||
|
-- -- for example to disable the custom builtin "codeactions" display
|
||||||
|
-- do the following
|
||||||
|
-- codeactions = false,
|
||||||
|
-- }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-- To get ui-select loaded and working with telescope, you need to call
|
||||||
|
-- load_extension, somewhere after setup function:
|
||||||
|
require("telescope").load_extension("ui-select")
|
||||||
|
end
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user