nvim: after/ftplugin/sh: Add language server for bash

This commit is contained in:
Sanchayan Maity 2022-12-06 12:19:07 +05:30
parent 66cd6aee69
commit a328fe3c5d
2 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,14 @@
vim.lsp.start({
name = "bashls",
cmd = { 'bash-language-server', 'start' },
root_dir = vim.fn.getcwd(),
filetypes = { 'sh' },
single_file_support = true,
cmd_env = {
-- Prevent recursive scanning which will cause issues when opening a file
-- directly in the home directory (e.g. ~/foo.sh).
--
-- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)".
GLOB_PATTERN = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)',
},
})

View File

@ -1 +0,0 @@
autocmd! BufWritePost <buffer> lua require('lint').try_lint()