Add bashls and format using formatter built into lua lsp

This commit is contained in:
Fabian Schmidt 2022-10-18 17:42:03 +02:00
parent a8818ea92a
commit fe9da6af57
8 changed files with 84 additions and 80 deletions

View File

@ -1,6 +1,6 @@
-- init.lua -- init.lua
require'plugins' require('plugins')
require'settings'.init() require('settings').init()
require'maps'.init() require('maps').init()
require'commands' require('commands')

View File

@ -1,7 +1,7 @@
-- plugin.lua -- plugin.lua
require "paq" { require 'paq' {
-- Handle itself -- Handle itself
'savq/paq-nvim'; 'savq/paq-nvim';

View File

@ -1,8 +1,8 @@
-- Completion -- Completion
local completion = {} local completion = {}
local cmp = require'cmp' local cmp = require('cmp')
local lspkind = require'lspkind' local lspkind = require('lspkind')
vim.opt.shortmess:append 'c' vim.opt.shortmess:append 'c'

View File

@ -38,10 +38,10 @@ end
function settings.init() function settings.init()
settings.initMisc() settings.initMisc()
settings.initVimWiki() settings.initVimWiki()
require'settings.theme'.init() require('settings.theme').init()
require'settings.lsp'.init() require('settings.lsp').init()
require'settings.completion' require('settings.completion')
require'settings.tree' require('settings.tree')
end end
return settings return settings

View File

@ -20,11 +20,11 @@ local lsp_attach = function(client, buf)
end end
function lsp.init() function lsp.init()
require'mason'.setup() require('mason').setup()
require'mason-lspconfig'.setup() require('mason-lspconfig').setup()
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
local lspconfig = require'lspconfig' local lspconfig = require('lspconfig')
lspconfig.sumneko_lua.setup { lspconfig.sumneko_lua.setup {
capabilities = capabilities, capabilities = capabilities,
@ -56,6 +56,10 @@ function lsp.init()
standalone = false standalone = false
} }
}) })
lspconfig.bashls.setup {
capabilities = capabilities,
on_attach = lsp_attach
}
end end
return lsp return lsp

View File

@ -7,11 +7,11 @@ function theme.initFont()
end end
function theme.lsp_status() function theme.lsp_status()
require'fidget'.setup {} require('fidget').setup {}
end end
function theme.initStatusline() function theme.initStatusline()
require'lualine'.setup { require('lualine').setup {
options = { options = {
theme = 'onedark' theme = 'onedark'
} }

View File

@ -2,7 +2,7 @@
local tree = {} local tree = {}
require'nvim-tree'.setup { require('nvim-tree').setup {
disable_netrw = true, disable_netrw = true,
hijack_netrw = true, hijack_netrw = true,
open_on_setup = false, open_on_setup = false,