mirror of
https://github.com/mikkelsvartveit/dotfiles.git
synced 2025-12-22 11:12:39 +00:00
Set up LSP and Treesitter for Neovim
This commit is contained in:
parent
25366eb90f
commit
152565a0d4
2 changed files with 74 additions and 28 deletions
|
|
@ -1,27 +1,22 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"auto-session": { "branch": "main", "commit": "aa01054d478c6d3efc0188cb2ed4850e9f475664" },
|
||||
"catppuccin": { "branch": "main", "commit": "4fd72a9ab64b393c2c22b168508fd244877fec96" },
|
||||
"coc.nvim": { "branch": "release", "commit": "69b16f8651b4d92d9ea5d6b000c084f275ed7928" },
|
||||
"code_runner.nvim": { "branch": "main", "commit": "dcedccbf969a0f3bc00db446172b4966e83101dd" },
|
||||
"git-conflict.nvim": { "branch": "main", "commit": "80bc8931d4ed8c8c4d289a08e1838fcf4741408d" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" },
|
||||
"auto-session": { "branch": "main", "commit": "00334ee24b9a05001ad50221c8daffbeedaa0842" },
|
||||
"catppuccin": { "branch": "main", "commit": "56a9dfd1e05868cf3189369aad87242941396563" },
|
||||
"code_runner.nvim": { "branch": "main", "commit": "386bcaa8aa7ae8703281afce4465ecfdb7c44e65" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "8b729e489f1475615dc6c9737da917b3bc163605" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"leap.nvim": { "branch": "main", "commit": "c6bfb191f1161fbabace1f36f578a20ac6c7642c" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"neoscroll.nvim": { "branch": "master", "commit": "4e0428a41c6ec191df543fc95349f6e1c598e53f" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "fd2badc24e675f947162a16c124d395bde80dbd6" },
|
||||
"nvim-scrollbar": { "branch": "main", "commit": "d09f14aa16c9f2748e77008f9da7b1f76e4e7b85" },
|
||||
"neoscroll.nvim": { "branch": "master", "commit": "f957373912e88579e26fdaea4735450ff2ef5c9c" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "b8e7957bde4cbb3cb25a13a62548f7c273b026e9" },
|
||||
"nvim-scrollbar": { "branch": "main", "commit": "5b103ef0fd2e8b9b4be3878ed38d224522192c6c" },
|
||||
"nvim-toggleterm.lua": { "branch": "main", "commit": "a5638b2206c3930a16a24e5c184dddd572f8cd34" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "e14989c0eaa6f9c299d48f7e45ce1ed04b21180f" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "9154484705968658e9aab2b894d1b2a64bf9f83d" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
|
||||
"supermaven-nvim": { "branch": "main", "commit": "b9f1eb32a4ca1782923ca0d4284d5c713583e4d4" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
|
||||
"vim-astro": { "branch": "main", "commit": "9b4674ecfe1dd84b5fb9b4de1653975de6e8e2e1" },
|
||||
"vim-polyglot": { "branch": "master", "commit": "bc8a81d3592dab86334f27d1d43c080ebf680d42" },
|
||||
"vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" },
|
||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||
"vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }
|
||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,57 @@ require("lazy").setup({
|
|||
end
|
||||
},
|
||||
|
||||
-- Treesitter config
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = 'master',
|
||||
lazy = false,
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup {
|
||||
ensure_installed = {
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"css",
|
||||
"html",
|
||||
"svelte",
|
||||
"json",
|
||||
"yaml",
|
||||
"markdown",
|
||||
"toml",
|
||||
"lua",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
}
|
||||
|
||||
end,
|
||||
},
|
||||
|
||||
-- LSP config
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
-- pnpm install -g @vtsls/language-server
|
||||
vim.lsp.enable("vtsls")
|
||||
|
||||
-- pnpm install -g svelte-language-server
|
||||
vim.lsp.enable("svelte")
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(event)
|
||||
local opts = {buffer = event.buf}
|
||||
|
||||
vim.keymap.set("n", "gd", '<cmd>lua vim.lsp.buf.definition()<cr>', opts)
|
||||
vim.keymap.set("n", "gh", '<cmd>lua vim.diagnostic.open_float()<cr>', opts)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Easy commenting/uncommenting
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
|
|
@ -113,7 +164,7 @@ require("lazy").setup({
|
|||
{"<leader>f", "<cmd>Telescope live_grep<CR>", noremap = true, silent = true},
|
||||
{"<leader>b", "<cmd>Telescope buffers<CR>", noremap = true, silent = true},
|
||||
{"<leader>o", "<cmd>Telescope oldfiles<CR>", noremap = true, silent = true},
|
||||
{"<leader>t", "<cmd>Telescope tags<CR>", noremap = true, silent = true},
|
||||
{"<leader>t", "<cmd>Telescope lsp_workspace_symbols<CR>", noremap = true, silent = true},
|
||||
{"<leader>c", "<cmd>Telescope commands<CR>", noremap = true, silent = true},
|
||||
{"<leader>:", "<cmd>Telescope commands<CR>", noremap = true, silent = true},
|
||||
{"<leader>d", "<cmd>Telescope git_status<CR>", noremap = true, silent = true},
|
||||
|
|
@ -181,14 +232,14 @@ require("lazy").setup({
|
|||
},
|
||||
|
||||
-- Live Markdown preview in browser
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
build = "cd app && npm install",
|
||||
ft = "markdown",
|
||||
init = function()
|
||||
vim.g.mkdp_auto_close = 0
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- "iamcco/markdown-preview.nvim",
|
||||
-- build = "cd app && npm install",
|
||||
-- ft = "markdown",
|
||||
-- init = function()
|
||||
-- vim.g.mkdp_auto_close = 0
|
||||
-- end,
|
||||
-- },
|
||||
|
||||
-- Git integration - show modified lines next to line numbers
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue