Add LSP stuff

This commit is contained in:
William McVicar
2024-01-08 00:07:57 +01:00
parent 37bd8c801e
commit 0643da425f
5 changed files with 94 additions and 24 deletions

14
nvim/lazy-lock.json Normal file
View File

@@ -0,0 +1,14 @@
{
"catppuccin": { "branch": "main", "commit": "5e36ca599f4aa41bdd87fbf2c5aae4397ac55074" },
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
"lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "0989bdf4fdf7b5aa4c74131d7ffccc3f399ac788" },
"mason.nvim": { "branch": "main", "commit": "e110bc3be1a7309617cecd77bfe4bf86ba1b8134" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "77d9f484b88fd380386b46ed9206e5374d69d9d8" },
"nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" },
"nvim-lspconfig": { "branch": "master", "commit": "796394fd19fb878e8dbc4fd1e9c9c186ed07a5f4" },
"nvim-web-devicons": { "branch": "master", "commit": "db0c864375c198cacc171ff373e76bfce2a85045" },
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }
}

View File

@@ -0,0 +1,36 @@
return
{
{
"williamboman/mason.nvim",
config = function()
require("mason").setup({
path = "append",
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
})
end
},
{
"williamboman/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup {
ensure_installed = { "lua_ls" },
}
end
},
{
"neovim/nvim-lspconfig",
config = function()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({})
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
vim.keymap.set({'n', 'v'}, '<leader>ca', vim.lsp.buf.code_action, {})
end
}
}

View File

@@ -1,4 +1,5 @@
return {
{
'nvim-telescope/telescope.nvim', tag = '0.1.5',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
@@ -6,5 +7,22 @@ return {
vim.keymap.set('n', '<C-S-o>', builtin.find_files, {})
vim.keymap.set('n', '<C-S-s>', builtin.live_grep, {})
end
}
},
{
'nvim-telescope/telescope-ui-select.nvim',
config = function()
require("telescope").setup {
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown {
}
}
}
}
-- 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
}
}

View File

@@ -1,20 +1,20 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local install = require("nvim-treesitter.install")
local configs = require("nvim-treesitter.configs")
-- "nvim-treesitter/nvim-treesitter",
-- build = ":TSUpdate",
-- config = function()
-- local install = require("nvim-treesitter.install")
-- local configs = require("nvim-treesitter.configs")
install = {
compilers = { clang },
prefer_git = false,
}
-- install = {
-- compilers = { clang },
-- prefer_git = false,
-- }
configs.setup({
ensure_installed = { "c", "cpp", "lua", "vim", "vimdoc", "cmake", "query" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end
-- configs.setup({
-- ensure_installed = { "c", "cpp", "lua", "vim", "vimdoc", "cmake", "query" },
-- sync_install = false,
-- highlight = { enable = true },
-- indent = { enable = true },
-- })
-- end
}

View File

@@ -1,7 +1,9 @@
vim.cmd("syntax on")
vim.cmd("set expandtab")
vim.cmd("set tabstop=4")
vim.cmd("set softtabstop=4")
vim.cmd("set shiftwidth=4")
vim.cmd("set nu")
vim.g.mapleader = " "