Live data from Hacker News

Vim After 11 Years

statico.github.com

91–100 of 254 posts

Re: Vim After 11 Years

#91
post #64

Earlier quoted context omitted.

Here are few things how I use it: - scrolling with a mouse wheel - selecting/resizing a split window - jumping to a specific place in the code - making a selection

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.

Re: Vim After 11 Years

#92
post #39

The author mentioned CtrlP for fuzzy filename matching. Its great because it's in pure Vimscript, but in my experience it becomes unusably slow for moderately sized projects. A month or two ago, I switched back to CommandT (requires Vim to be compiled with Ruby support, engine written in C) and haven't thought twice about it since then.

I have a repo with 3000+ files and I can't notice any delay searching with CtrlP. I have the following custom file listing command in my vimrc:

    let g:ctrlp_user_command = {
      \ 'types': {
        \ 1: ['.git/', 'cd %s && git ls-files'],
        \ 2: ['.hg/', 'hg --cwd %s locate -I .'],
        \ },
      \ 'fallback': 'find %s -type f'
      \ }

Re: Vim After 11 Years

#94

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…

re: git changes, after seeing such a plugin for sublime (https://github.com/jisaacks/GitGutter) I went ahead and implemented the same thing for Vim (https://bitbucket.org/sirpengi/iwilldiffer). The plugin is still in beta status yet with compatibility, and I should make it easier to install with the various plugin managers as well as make the feature async (right now, the UI blocks waiting on the diff command). But otherwise, I'm using it daily and it supports mercurial as well as git.

Re: Vim After 11 Years

#95
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 have space mapped to execute the macro in 'q':

  noremap  @q
This lets me set a macro by first wacking qq, then q to finish, and then replay it by wacking space. I find myself using quick throw-away macros that only have a use for maybe 10 seconds far more often with this setup. (Plus wailing on the spacebar to get work done can be really satisfying ;)

Re: Vim After 11 Years

#96
> With a modern, 256-color terminal like iTerm2 or Gnome Terminal, it will even look like gVim

Uh, I use xterm...

It's obsolete, I know, but it's still the fastest.

Re: Vim After 11 Years

#99
post #95
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 have space mapped to execute the macro in 'q': noremap @q This lets me set a macro by first wacking qq, then q to finish, and then replay it by wacking space. I find myself using quick throw-away macros that only have a use for maybe 10 seconds far more often with this setup. (Plus wailing on the spacebar to get work done can be really satisfying ;)

This ain't bad but you know you can re-execute last macro with @@? So it ends up being @q and then hold down the @ key to repeat.

Re: Vim After 11 Years

#100
post #58

Earlier quoted context omitted.

I've had ; mapped to : forever. Is there a use for `;` I'm missing out on? `;` just seems to be for stuff like "`fp` -- Oh wait, I didn't see all the p's between my cursor and the p I wanted. ; ; ; ;." Now I use easymotion.vim which obviates that scenario.

I created vim-seek exactly for this reason, it's like f but takes always two characters, way faster than easymotion within the line (though I still use easymotion for longer distances) http://github.com/goldfeld/vim-seek

Cool! Until I found easymotion.vim, I was sort of doing a poor man's vim-seek with `/` and two chars.
Post reply on HN