A language server for Bash
Clone or download
mads-hartmann Merge pull request #84 from maximbaz/patch-1
Mention security risks of using explainshell
Latest commit 592e0e0 Oct 24, 2018

README.md

Bash Language Server

Bash language server implementation based on Tree Sitter and its grammar for Bash with explainshell integration.

Features

  • Jump to declaration
  • Find references
  • Code Outline & Show Symbols
  • Highlight occurrences
  • Code completion
  • Simple diagnostics reporting
  • Documentation for flags on hover
  • Rename symbol

Installation

npm i -g bash-language-server

Clients

The following editors and IDEs have available clients:

  • Visual Studio Code (Bash IDE)
  • Atom (ide-bash)
  • Vim (see below)
  • Neovim (see below)
  • Oni (see below)

Vim

For Vim 8 or later install the plugin prabirshrestha/vim-lsp and add the following configuration to .vimrc:

if executable('bash-language-server')
  au User lsp_setup call lsp#register_server({
        \ 'name': 'bash-language-server',
        \ 'cmd': {server_info->[&shell, &shellcmdflag, 'bash-language-server start']},
        \ 'whitelist': ['sh'],
        \ })
endif

For Vim 8 or NeoVim using w0rp/ale add the following configuration to your .vimrc:

let g:ale_linters = {
    \ 'sh': ['language_server'],
    \ }

Neovim

Install the plugin autozimu/LanguageClient-neovim and add the following configuration to init.vim:

let g:LanguageClient_serverCommands = {
    \ 'sh': ['bash-language-server', 'start']
    \ }

Oni

On the config file (File -> Preferences -> Edit Oni config) add the following configuration:

"language.bash.languageServer.command": "bash-language-server",
"language.bash.languageServer.arguments": ["start"],

Development Guide

Please see docs/development-guide for more information.