20.7.15

Dev setup for languages (i.e. golang) that don't have IDEs

Since I came  to Red Hat, I've been fighting the urge to use eclipse for EVERYTHING.

The reason is that I tend to spin up clusters with Docker containers, VMs, and so on, often needing to tail logs while editing files at the same time. 

However I miss a few features of my IDEs.  I'll summarize the features and then explain, in order, how to set these up.

1) Tree browsing.  

For this, I've used NERDTree.  Nerd tree allows you to go "up" and "down" like you do in your IDE. When you open a file, it pops up on the right.  Like this...



2) Compilation window attached to my editor.

Once you have a nice tree editor, the next thing you miss is a compilation window.  For this, I run NERDTree inside of tmux.  Tmux can be installed using "yum" or "brew" or whatever.  Now you can expand your window out, a little bit, like so...


3) Next up : Most IDE's have awesome free text searching.  Typically they show snippets of relevant code.  For this, you need CtrlS.  CtrlS allows you to grep a code base, but it conveniently pops a window up inside of vim.  Using the "let g:ctrolsf_position ='bottom'" option (added to your vimrc), you can have that pop up right at the bottom of your VIM window, so that you can see the full horizontal (NERDTree browsing window takes up some space, so you don't want to split it vertically twice).

Putting it all together, this is what you get !


How do you set this up ? 

First, read about, and understand TMUX and pathogen.

Then, install both.

Next: Install NERDTree using pathogen.

Finally, install CtrlS like so...  (cd ~/.vim/bundle && git clone git://github.com/dyng/ctrlsf.vim)  )

Then edit your ~/.vimrc file to use the horizontal split for pathogen ...let g:ctrlsf_position = 'bottom' .

Thats all !


SHORTCUTS
  • In nerdtree, you split windows by doing Ctrl+w, then go to the tree and hit the "i" or "s".
  • In nerdtree, you may need to open lots of windows and copy / paste between them.  To do this, C-w =  (hit Ctrl+w, then hit the =). 

No comments:

Post a Comment