Skip to Content
Mastering Vim
book

Mastering Vim

by Ruslan Osipov
November 2018
Beginner
330 pages
7h 21m
English
Packt Publishing
Content preview from Mastering Vim

Automatically updating the tags

You probably don't want to have to manually run the ctags -R . command every time you make changes to the code. The simplest way to address this is to add the following to your .vimrc file:

" Regenerate tags when saving Python files.autocmd BufWritePost *.py silent! !ctags -R &

The preceding snippet runs ctags -R every time you save a Python file.

You can replace the preceding *.py extension with different file extensions depending on the language you'd like to work with. For example, the following will generate a tags file for C++ files: autocmd BufWritePost *.cpp,*.h silent! !ctags -R &
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Vim

Mastering Vim

Damian Conway
Vim Masterclass

Vim Masterclass

Jason Cannon
Modern Vim

Modern Vim

Drew Neil

Publisher Resources

ISBN: 9781789341096Supplemental Content