Today I Learned
Search…
ctags in Vim - Quick Cheatsheet
Consider using modern stuff like LSP over ctags

Setup

  1. 1.
    Install universal-ctags. Support languages like C/C++, Markdown, HTML, Java, Go, Javascript, Python, Shell scripts
    # Linux
    sudo snap install universal-ctags
    # Mac
    brew install --HEAD universal-ctags/universal-ctags/universal-ctags
  2. 2.
    Run the command ctags -R * inside project folder
  3. 3.
    Optionally Install fzf.vim which offers fuzzy searching over tags available using :Tags command

Usage

  • Ctrl + ]: Jump to tag underneath cursor
  • Ctrl + t: Jump back up in tag stack
  • Ctrl + W Ctrl + ] - Open the definition in a horizontal split
Copy link
Edit on GitHub
On this page
Setup
Usage