Skip to content

Instantly share code, notes, and snippets.

@pyk
Created July 18, 2015 00:12
Show Gist options
  • Save pyk/b42858ee2806f9e053b7 to your computer and use it in GitHub Desktop.
Save pyk/b42858ee2806f9e053b7 to your computer and use it in GitHub Desktop.
Use vim for IDE

This is bunch of vim tips that I gather from the internet.

Project-specific configuration

" forces vim to source .vimrc file if it present in working directory
set exrc
" restrict usage of some commands in non-default .vimrc files
set secure

Navigate source code

Install exuberant-ctags

sudo apt-get install exuberant-ctags

Generate tag file for vim

ctags .

or use this command if source code distributed on specific directory

ctags -R .

open file relative on cwd, for example

vim src/grep.c

press CTRL+] for navigate definition of function under the cursor and CTRL+T for back in the last cursor position.

References

  1. Vim for C Programmers
  2. Using Vim as C/C++ IDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment