Files
nvim-shellspec/README.md

1.6 KiB

Neovim ShellSpec DSL Support

Language support and formatter for ShellSpec DSL testing framework.

Installation

With lazy.nvim

{
  "ivuorinen/nvim-shellspec",
  ft = "shellspec",
}

With vim-plug

Plug 'ivuorinen/nvim-shellspec'

Manual Installation

git clone https://github.com/ivuorinen/nvim-shellspec.git ~/.config/nvim/pack/plugins/start/nvim-shellspec

Features

  • Syntax highlighting for all ShellSpec DSL keywords
  • Automatic indentation for block structures
  • Filetype detection for *_spec.sh, *.spec.sh, and spec/*.sh
  • Formatting commands with proper indentation

Usage

Commands

  • :ShellSpecFormat - Format entire buffer
  • :ShellSpecFormatRange - Format selected lines

Auto-format

Add to your config to enable auto-format on save:

let g:shellspec_auto_format = 1

File Types

Plugin activates for files matching:

  • *_spec.sh
  • *.spec.sh
  • spec/*.sh
  • test/*.sh

Configuration

" Enable auto-formatting on save
let g:shellspec_auto_format = 1

" Custom keybindings
autocmd FileType shellspec nnoremap <buffer> <leader>f :ShellSpecFormat<CR>
autocmd FileType shellspec vnoremap <buffer> <leader>f :ShellSpecFormatRange<CR>

Contributing

Contributions welcome! Please open issues and pull requests at: https://github.com/ivuorinen/nvim-shellspec

License

MIT License - see repository for details.

  • ShellSpec - BDD testing framework for shell scripts