← Back to blog

Best Bash Editor for Writing Runbooks and Automation

· 4 min read · Stew Team
basheditorrunbookautomation

Writing runbooks requires more than a basic bash editor. You need tools that help you create, test, and maintain operational procedures.

This guide focuses on bash editor features that matter for runbook authors. For runbook structure best practices, see how to write a runbook.

What Runbook Authors Need

Runbooks combine prose with executable commands. Your bash editor should handle both.

Essential features:

  • Markdown support for documentation
  • Bash syntax highlighting
  • Easy command testing
  • Version control integration
  • Remote file editing

VS Code: The Runbook Author’s Choice

VS Code excels for runbook development.

Setup for Runbooks

Install essential extensions:

code --install-extension mads-kristensen.markdown-all-in-one
code --install-extension timonwong.shellcheck
code --install-extension ms-vscode-remote.remote-ssh

Workspace Configuration

Create .vscode/settings.json:

{
  "files.associations": {
    "*.md": "markdown"
  },
  "[markdown]": {
    "editor.wordWrap": "on",
    "editor.quickSuggestions": false
  },
  "shellcheck.enable": true,
  "markdown.preview.breaks": true
}

Writing Runbooks in VS Code

VS Code provides:

  • Split view: Edit markdown while previewing
  • Integrated terminal: Test commands immediately
  • Snippets: Create templates for common patterns
  • ShellCheck: Catch bash errors in code blocks

Custom Snippets for Runbooks

Add to your markdown snippets:

{
  "Bash Code Block": {
    "prefix": "bash",
    "body": [
      "```bash",
      "$1",
      "```"
    ]
  },
  "Runbook Step": {
    "prefix": "step",
    "body": [
      "## Step ${1:N}: ${2:Description}",
      "",
      "```bash",
      "$3",
      "```"
    ]
  }
}

Vim for Runbook Editing

Vim works well for runbook authoring with the right plugins.

Essential Plugins

Using vim-plug:

Plug 'preservim/vim-markdown'
Plug 'dense-analysis/ale'

Configuration

" Markdown settings
let g:vim_markdown_fenced_languages = ['bash=sh', 'python', 'yaml']
let g:vim_markdown_folding_disabled = 1

" ALE for shellcheck in markdown
let g:ale_linters = {'markdown': ['shellcheck']}

" Easy code block insertion
autocmd FileType markdown inoremap <buffer> ;b ```bash<CR><CR>```<Up>

Running Commands from Vim

Select a bash block and run it:

" Visual select lines and run as bash
vnoremap <leader>r :w !bash<CR>

Obsidian for Knowledge-Focused Runbooks

Obsidian combines note-taking with bash editing.

Strengths:

  • Bi-directional linking between runbooks
  • Graph view shows runbook relationships
  • Local markdown files
  • Works offline

Limitations:

  • No command execution
  • Limited syntax checking
  • No remote editing

Best for: Teams building interconnected documentation.

Browser-Based Bash Editors

For quick edits without local setup.

GitHub.dev

Press . on any GitHub repository to open a web-based VS Code.

https://github.dev/your-org/your-runbooks

Best for: Quick edits to committed runbooks.

GitLab Web IDE

Similar functionality built into GitLab.

Best for: Teams using GitLab for runbook storage.

Comparing Bash Editors for Runbooks

FeatureVS CodeVimObsidianGitHub.dev
Markdown previewPlugin
Bash highlighting
ShellCheck integrationPlugin
Remote editing
Command executionTerminal
Git integrationPluginPlugin
Offline support

The Gap in Bash Editors

Every bash editor treats code blocks as static text. You write commands, but to run them you:

  1. Copy the command
  2. Open a terminal
  3. Paste and execute
  4. Document the output separately

This friction means runbooks don’t get updated, tested, or used.

Beyond Editing: Executable Runbooks

Stew closes this gap. Your bash editor creates markdown files. Stew makes them executable.

# Database Backup Runbook

## Check disk space
​```bash
df -h /backup
​```

## Run backup
​```bash
pg_dump production > /backup/prod-$(date +%Y%m%d).sql
​```

## Verify backup
​```bash
ls -lh /backup/*.sql | tail -5
​```

In Stew, each block runs with a click. Output is captured. Your runbook becomes a living document.

Join the waitlist and transform how you use bash in documentation.