Live data from Hacker News

Vim After 11 Years

statico.github.com

191–200 of 254 posts

Re: Vim After 11 Years

#191
post #98

I recently switched to Vundle from Pathogen and it is a joy to use. Best part: you can bootstrap[1] Vundle from your .vimrc, turning the two-part "vimrc & plugins" configuration into a one-part "vimrc" configuration. https://github.com/gmarik/vundle/blob/master/test/vimrc

Thanks! This was always a pain, figured there must be an easy way to setup a fresh dotfile pull.

Re: Vim After 11 Years

#192
post #82
post #42

I'm not sure why the author advocates job control (ie ctrl-z/fg/bg) instead of using tmux/screen. A multiplexer offers far more flexibility, and most importantly does not lose state even if your session ends (eg ssh connection drops).

While that's true, clipboard interaction through tmux is awful.

http://grota.github.com/blog/2012/05/08/tmux-clipboard-integ...

Re: Vim After 11 Years

#193
post #58
post #40

Lots of people seem to declare ; or , to be useless keys and remap them. They're two of my most used movement keys in certain circumstances. I used to have , remapped to but switched back when I realised what I was missing out on. I'd advise anybody else to reconsider if they've made the same mistake I did.

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.

For me it's often fp ;. ;. ;. ;.

For example if I have a longer line I would like I could do something like f,ak,.k,.k,.k,.k,.k,.

Re: Vim After 11 Years

#195
post #40

Lots of people seem to declare ; or , to be useless keys and remap them. They're two of my most used movement keys in certain circumstances. I used to have , remapped to but switched back when I realised what I was missing out on. I'd advise anybody else to reconsider if they've made the same mistake I did.

What is the default behavior for ","?

Re: Vim After 11 Years

#196
post #79

Earlier quoted context omitted.

The "step back in time" feature is sort of gimmicky, but does mean you can rewind even Curses terminal applications. Rarely actually useful, but it has saved me a huge amount of hassle a few times.

Vim also has history via the undo-branches feature. e.g. ":earlier 15m" to go back 15 minutes.

And the Gundo plugin extends that even more with a history graph and preview pane that shows diffs. A must-have plugin for me.

Re: Vim After 11 Years

#197
post #24

Every time I read an article like this, it's how a power user installs an array of plugins and customizations to really soup up Vim, which to me kind of misses the point. If you want that level whiz-bang, use Coda or Sublime Text 2 or Eclipse or whatever. I don't recall where I saw this, but someone advised disabling syntax coloring in your editor to remove a crutch (and, secondarily, to visually simplify your enviro…

It is funny, I use vim pretty much everyday for a decade. I install vim, I use "write", "close", "quit". I semi pretty vimrc file with line numbers and syntax highlighting.

I am still not very good at opening multiple buffers, I just close vim and open the other file.

But that is about it. I felt I have doing it wrong. But I can get work done and it is easier everytime I install a new server.

Re: Vim After 11 Years

#198
post #124

Earlier quoted context omitted.

One thing NERDTree does that netrw doesn't (IIRC, haven't looked very deeply into this) is open files you select in a different window than the one that contains the file listing. I happen to find that convenient, YMMV, of course.

o does that. :h netrw-browse-maps

Almost, but not quite. o opens a new window with the selected file, while nerdtree opens the file in the most recently used non-nerdtree window.

Also, there doesn't seem to be a way to tell netrw to create a vertical split rather than a horizontal split, which is inconvenient on modern wide screen monitors.

Re: Vim After 11 Years

#199
post #101

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…

CtrlP takes care of that. Ctrl+P and then Ctrl+F (cycle to buffers list—you can also map this to anything you want) and it will list buffers with a + next to the buffers with local edits. Ctrl+D and it will change from full path to file name search. You can cycle between buffers, files, mru files and even more (tags, etc.) with extensions.

I've mapped Ctrl+T to open CtrlP in tag mode.

Re: Vim After 11 Years

#200
post #180

Earlier quoted context omitted.

It doesn't hurt these "anyone" to be pointed at better ways to do what they do.

There is no "better", young padawan.

Yes, there is. "Best" is a harder subject to tackle, but there's always "better".

di{ is obviously both quicker and more precise than reaching to the mouse, pointing at the beginning of the code block, extending the selection until the end of the code block and hitting backspace.

One may think these keybindings are awkward or hard to remember (I did, at first, they are not) but they are both faster, more efficient and more deterministic by nature. But I may be a control freak. :-)

Post reply on HN