Live data from Hacker News

Vim After 11 Years

statico.github.com

111–120 of 254 posts

Re: Vim After 11 Years

#111
Recently, I made the switch to vim from Sublime Text and I have installed some of the same tools. So far, I've committed to vim, but I have found that the plugins for file searching, linting, etc. are easier to use, more intuitive, and less painful to setup in Sublime Text.

Re: Vim After 11 Years

#112
post #20

Earlier quoted context omitted.

iterm2 supports mouse input, terminal.app does not.

Using a mouse? In Vim?

Vim sure, more for tmux for me to be honest. Its quicker to resize panes/select things with the mouse at times.

People that take keyboard only to the extreme strike me as adhering to the letter of the law rather than the intent. Whichever works faster for a person is better.

Re: Vim After 11 Years

#113
post #108
post #88

Some small vim tweaks I've recently been using myself that I find very nice: nmap :write cabbrev w nope Re-map enter to save the file. If you try to do a :w it will yell at you until you take out the cabbrev so you can retrain your muscle memory. Took me about a day to retrain. let g:EasyMotion_leader_key = ';' nmap s ;w nmap S ;b Remap s and S to be easymotion forward and backward. I never use s, since it's largely…

Space is my leader key.

solid!

Re: Vim After 11 Years

#114
post #88

Some small vim tweaks I've recently been using myself that I find very nice: nmap :write cabbrev w nope Re-map enter to save the file. If you try to do a :w it will yell at you until you take out the cabbrev so you can retrain your muscle memory. Took me about a day to retrain. let g:EasyMotion_leader_key = ';' nmap s ;w nmap S ;b Remap s and S to be easymotion forward and backward. I never use s, since it's largely…

I use space for toggling folding: " space toggles the fold state under the cursor. nnoremap :exe 'normal! za'.(foldlevel('.')?'':'l') " space expands with zO map zO

same here, but use

   nnoremap  za   
   vnoremap  za
also, for folding in general I'd recommend using

  set foldmethod=marker
which has the benefit of making folds more 'transparent' in your code, and also persistent across vim sessions

Re: Vim After 11 Years

#115
Instead of NERDTree you might want to try Vimpanel, it's based on NERDTree but much more evolved, and instead of using :bprev/:bnext you might want to try Bufstop, it uses history instead of the buffer list to get you to the previous buffer. I made these to get around some limitations for some plugins that everyone seems to suggest.

https://github.com/mihaifm/vimpanel https://github.com/mihaifm/bufstop

Re: Vim After 11 Years

#116
post #80

My single greatest tip to make vim even more amazing is to run it in a tmux session: It makes it super easy to split panes and create new windows for related things you need to do (git stuff, compilation, running tests, running a REPL, etc.)

i use terminator for that. works wonderfully.

http://www.tenshu.net/p/terminator.html

Re: Vim After 11 Years

#117
post #75

Earlier quoted context omitted.

Why for?

You seem to be conflating Vim and Terminal. Vim is just one of the many things you can run in a terminal, and just one of the many things you can do with a terminal.

No. I know what the difference is between the two.

And I know that I never use mouse in one or the other. I don't use it for scrolling, I don't use it for pointing and clicking, I don't use for selecting stuff…

REPL? no use for the mouse. htop? no use for the mouse. git/svn/hg? no use for the mouse.

Re: Vim After 11 Years

#118
post #20
post #9

Why do people keep suggesting iTerm2? The built-in terminal app on the Mac does Unicode and 256 colors just fine.

iterm2 supports mouse input, terminal.app does not.

iterm2 does not let me go forward/backward by word (with the option key). anyone know how to fix this?

Re: Vim After 11 Years

#119
post #91

Earlier quoted context omitted.

All of that can be done much more efficiently without the mouse: - scrolling with a mouse wheel :h scroll.txt - selecting/resizing a split window :h window-resize :h window-move-cursor - jumping to a specific place in the code /foo or the myriad of cool things in :h motion.txt - making a selection v{motion}

I agree on most points, but there is no way that wacking Ctrl-W +/-/>/ You can of course make nicer mappings, but even then it isn't as nice.

All these commands take a count:

    10
But I tend to keep windows at equal width anyway.

Re: Vim After 11 Years

#120

Can vim do the following? I'm editing some project with 10000 C++ files. There is some C++ file I currently don't have open, say "palette.cpp" which is in a subdirectory "project/graphics/algorithms/color/". Now I want to open palette.cpp without ever having to type, not even with tab autocompletion, that path. IntelliJ (which I do use for C++ ;)) can do this easily: just press CTRL+R, then palette.cpp, ENTER, and th…

> IntelliJ (which I do use for C++ ;))

If I may ask, how do you use it? The C/C++ plugin was unusable, last time I tried it.

Post reply on HN