1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-10-11 20:11:16 +02:00

nvim: setup automatic loading with mason and other plugins

This commit is contained in:
2023-01-14 05:12:21 +01:00
parent f2f39c84e8
commit 802d769a9c
5 changed files with 83 additions and 30 deletions

View File

@@ -0,0 +1 @@
require("nvim-autopairs").setup {}

View File

@@ -1,4 +1,26 @@
-- hrsh7th/nvim-cmp
-- mason package manager
require("mason").setup()
require("mason-lspconfig").setup({
-- automatically install language servers setup below for lspconfig
automatic_setup = true,
})
-- jose-elias-alvarez/null-ls.nvim
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.autopep8,
null_ls.builtins.formatting.nimpretty,
},
})
require("mason-null-ls").setup({
automatic_installation = true
})
-- Add additional capabilities supported by nvim-cmp
capabilities = require("cmp_nvim_lsp").default_capabilities()
@@ -94,7 +116,7 @@ local nvim_lsp = require('lspconfig')
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = { "pyright", "bashls", "tsserver", "texlab", "ccls", "gopls", "hls", "nimls", "marksman" }
local servers = { "pyright", "bashls", "texlab", "ccls", "nimls", "marksman" }
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
on_attach=on_attach,

View File

@@ -0,0 +1,19 @@
-- nvim-treesitter/nvim-treesitter
local ts_config = require "nvim-treesitter.configs"
ts_config.setup {
ensure_installed = {
"bash",
"c",
"cpp",
"css",
"html",
"java",
"markdown",
"latex",
"python",
},
autotag = { enable = true },
}