Interactive setup for Bash LSP development environment
Sets up bash-language-server, shellcheck, and shfmt for Bash/Shell development. Use this to enable LSP features like autocompletion, linting, and formatting for shell scripts.
/plugin marketplace add zircote/bash-lsp/plugin install bash-lsp@zircote-lspThis command will configure your Bash/Shell development environment with bash-language-server and essential tools.
First, verify Node.js is installed:
node --version
npm --version
npm install -g bash-language-server
# Linting
brew install shellcheck
# Formatting
brew install shfmt
bash-language-server --version
shellcheck --version
shfmt --version
export ENABLE_LSP_TOOL=1
Test the LSP integration:
# Create a test file
cat > test_lsp.sh << 'EOF'
#!/bin/bash
greet() {
local name="$1"
echo "Hello, $name!"
}
greet "World"
EOF
# Run ShellCheck
shellcheck test_lsp.sh
# Run shfmt
shfmt -w test_lsp.sh
# Clean up
rm test_lsp.sh