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
    1
    # Linux
    2
    sudo snap install universal-ctags
    3
    # Mac
    4
    brew install --HEAD universal-ctags/universal-ctags/universal-ctags
    Copied!
  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
Contents
Setup
Usage