Hacker Newsnew | comments | show | ask | jobs | submit login

I took the dive into Vim about a year ago. I was at the stage where I'd become proficient with some command-line tools in Linux, but I didn't yet have an editor I could use fluently from the command line. I tried out both Vim and Emacs, and found Vim to be slightly easier to grok, plus my pinkie got kind of sore from holding down the Ctrl key in Emacs.

I changed my default editor at work to be Vim, and started doing all my dev work at home through Vim. I started off just using the arrow keys to move and just using insert mode to edit text the normal way. Each day I tried to add one new command to my repertoire; I learned about how to structure vim commands (c-change i-in w-word, etc.) and move using hjkl and the higher order movement commands like w and b. Now I can maneuver my way around vim quite confidently, and although when I started off I was much slower in Vim than other editors, I now find that Vim is just as fast or faster for most tasks, particularly where I can make use of Macros.

At the moment I still have to get my head around markers and a few other concepts, but I've definitely become proficient enough for it to be worth the effort and time invested so far.

My tips for anyone learning to use vim for everyday development would be some common tab commands: :tabnew <path> to open a file in a new tab, :tab sball to show all currently open buffers in separate tabs, gt and gT to jump to the next/previous tabs.




Yea, tabs are a very useful feature in vim that many people don't seem to use. I know people that use the panes. This isn't really useful for me though. I use tmux as my window manager for my terminal, so I have not use for panes in vim. I just have a bunch of vim processes running and use tmux for the window management. The great thing about this is my development environment completely mirrors my production environment. I have found that one of the best productivity gains you can get is having one mental model for everything. Unfortunately I'm still coding in PHP (don't think PHP fits into this idea).

-----


> Yea, tabs are a very useful feature in vim that many people don't seem to use. I know people that use the panes.

I don't use tabs because I don't find them useful at all. If I need to see 2 files at once, split panes it is; if I am switching between files, I have them open as buffers(NERDTree and BufExplorer makes it pleasant).

> I use tmux as my window manager for my terminal, so I have not use for panes in vim.

I use tmux as well. The only times I use tmux panes is when I need to run shell in the same window.

> I just have a bunch of vim processes running and use tmux for the window management.

And I have one vim process running for one project root. Coding rails? Open vim in top folder and open all files from there using rails.vim navigation commands(:Rcontroller, :Rmodel...) or NERDTree and switch between them using BufExplorer.

-----


Opening two files in a split-pane in Vim is different from opening two Vim's and panning them with a window manager.

This is because all the state is shared within a single Vim: buffers, copy-paste information, and so on.

-----


I use tmux too, but I prefer the way vim handles panes. When I'm in mental-vim mode, it's easier for me to not have to jump out to thinking in tmux terms when editing several files.

-----


attach/dtach/dvtm perhaps then......

-----




Applications are open for YC Winter 2016

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: