Vishesh Duggar bio photo

Vishesh Duggar

5x founder. Co-founder & CTO Product @vamstar. 15+ years building and advising startups of all sizes. If you're building something cool, I'd love to hear about it.

Looking for advice on product, strategy or engineering?

Book Appointment

Subscribe to my mailing list


Vamstar LinkedIn Twitter Github

GGTS or STS or Eclipse or any other IDE for that matter is too bulky and slows your machine. But more importantly if you are someone like me who would rather use a keyboard than a mouse then using vim instead of an IDE is going to be even more fun. The speed with which I can manipulate files, check for syntax, format code and use information from git version history is pretty slick.

Some of the features that are absolutely fabulous within GGTS or STS include

  1. Content Assistant: suggests auto-completions as we type.
  2. Get declaration/implementation of variable/method in a single click (ctrl + click)
  3. Auto import and fix imports
  4. Git compare/commit files
  5. Searching within a project
  6. Renaming files, methods
  7. Project specific settings

Let us look at the alternatives available for each of these and how well one can do these things in Vim

Get declaration/implementation of variable/method in a single click (ctrl + click) and code completion

This can be done using Ctags, Tagbar and few .vimrc configurations.

Ctags

For Mac OS X brew install ctags

For Debian-based systems sudo apt-get install exuberant-ctags

For Red Hat based systems sudo yum install ctags

Tagbar

Add the following to your .vimrc (Installing using vundle) Bundle majutsushi/tagbar

Keyboard shortcuts to find function and class definitions

Ctrl+] - go to definition Ctrl+T - Jump back from the definition. Ctrl+W Ctrl+] - Open the definition in a horizontal split

Add the following to .vimrc

map <C-\> :tab split<CR>:exec("tag ".expand("<cword>"))<CR>
map <A-]> :vsp <CR>:exec("tag ".expand("<cword>"))<CR>

Read more about ctags at.

Git compare/commit files.

Git support is pretty neat and the author of the plugin is not wrong in claiming this to be the best git wrapper of all time. Git grep, move, rename, checkout, diff and more. More info at github.

Searching within the project and optionally replace what matched or perform other operation

You can use git grep using fugitive again

:Ggrep [args]

The search results are listed in the quickfix list. Any operations can be performed on this list using Qdo command available in a neatly packaged plugin Qargs, inspired by a stackoverflow answer.

:Ggrep findme
:Qdo %s/findme/baz | update

This does require you to type the search string twice but does the job. The raw speed you get with vim for searching and other tasks is totally worth it.

Renaming a file

Find and open a file

:CtrlP
<filename>

Locate the file in NerdTree a file browser plugin

:NerdTreeFind

Once you located the file, press m to modify the filename

Auto import and fix imports

Again using vundle install the grails import plugin

Bundle 'sjurgemeyer/vim-grails-import

Project specific vim config

set exrc at the top of your .vimrc set secure at the very end of your .vimrc

More about project specific settings

15+ Years strategising and delivering growth, engineering, customer value and more. I have served as a CTO to multiple organizations, including Vamstar, AtruHelp, Billaway, SuperSehat, and more.

If you're a founder or CEO eager to move faster and seek tailored strategies for your unique challenges, don't navigate this journey alone. Reach out to me. Together, we can dissect, refine, and optimize your enterprise's trajectory to withstand the tests of time and innovation. Let's make your vision not just a goal, but an impending reality.

I have limited open hours. Book Appointment