Any VIM users in the house

fez

fez

Caporegime
Joined
22 Aug 2008
Posts
25,795
Location
Tunbridge Wells
I have recently decided to really give VIM a go as my main editor instead of sublime text and to be honest I am starting to see why lots of people rave about it. When you get used to the shortcuts and the navigation etc its pretty sharp.

The biggest issue I am having is when I am using 3-4+ files at the same time. Split pane is fine but once you get more than 2 panes its getting a little small and fiddly. What are some of the techniques people use to quickly handle 4 or more open buffers without getting confused / slowing down your workflow.
 
Associate
Joined
16 Aug 2010
Posts
1,373
Location
UK
Could try GVIM. Have tabs then.

Do you have YouCompleteMe for VIM?

I still find a good IDE such as VS or those by JetBrains to be better generally for productivity. My only usage of VIM these days is connecting to servers via SSH and editing small things. Gone are the days I'd write C and C++ in it.
 
Soldato
Joined
18 Oct 2002
Posts
7,087
Location
Melksham
You can use tabs without using GVIM, just open the files with "':tabe <filename>", and use :tabprev and :tabnext to move through them, although I've remapped F7 and F8 for that as well. I also have an alias for vim that always includes the -p flag so multiple files specified on the command line open in seperate tabs.

I also found it easier, most of the time (e.g. when working on systems that I've put my .vimrc on), to remap ; and :, only in command mode obviously.

But yeah, takes some getting used to but it's now my primary editor. Definitely spend the time to create a custom .vimrc, makes things so much better. I added the ability to open the vimrc with "\ev" and then "\sv" to source it, made tweaking it at the start much nicer.
 
Associate
Joined
24 Aug 2004
Posts
385
Location
Glasgow
Aye tabs might be the way to go to group logical sets of files into window splits if you need side-by-side view

You can obvs load any buffer into a tab:
Code:
:ls
:b <number> OR <filename + tab complete>

You can save the session and reload it later:
Code:
:mksession ~/.vim/my-session.vim
:so ~/.vim/my-session.vim

Note that mksession won't save your buffers to file...

To find/open a file quickly try some glob pattern with tab complettion e.g.
Code:
:ed **/http2_test.go <tab complete>

If you use something like Vundle to manage your plugins it's a breeze to try out additional functionality https://github.com/VundleVim/Vundle.vim

For file browsing definitely recommend NERDTree plugin... other basic "must-haves" are:

https://github.com/tpope/vim-fugitve
https://github.com/scrooloose/syntastic
 
Back
Top Bottom