Live data from Hacker News

Efficient Editing With vim

jmcpherson.org

91–100 of 125 posts

Re: Efficient Editing With vim

#91
post #13

Earlier quoted context omitted.

gt and gT in command mode also do next tab and previous tab

also #gt will go that tab number. I've changed my tab text to show the number in parenthesis before the name.

This also works with Vimperator. I'm now thinking about installing that Firefox extension that gives all the tabs numbers, for ease of reference. Alas, I don't remember what it was called -- but I'm sure I'll find it again.

Re: Efficient Editing With vim

#92
post #13

Earlier quoted context omitted.

also #gt will go that tab number. I've changed my tab text to show the number in parenthesis before the name.

For those who prefer alt navigation, you can add to your gvimrc " tab navigation map 1gt map 2gt map 3gt map 4gt map 5gt map 6gt map 7gt map 8gt map 9gt map 10gt

What is that heretical "g" doing in front of "vimrc"?

Re: Efficient Editing With vim

#93

vi is my favorite Rogue-like, with NetHack in close second, and my own http://DeadByZombie.com in third. vi is the only Rogue-like where you can get real work done with it. And every time you learn a new trick it's like your XP level or attribs go up, or you've descended down to a new more evil level of the dungeon, with more powerful monsters to fight with your enhanced vi-fu.

. . . and I thought vi(m) was awesome before!

I will never look at the king of all editors quite the same way. You have my thanks, mkramlich. May your life be long and prosperous.

(I totally didn't mean that to sound like a Vulcan blessing, I swear.)

Re: Efficient Editing With vim

#94

Earlier quoted context omitted.

Another nice script I discovered recently is Nerd Tree : http://www.vim.org/scripts/script.php?script_id=1658

Nerd Tree is indeed a good one, and I'll add to this vimfs, which isn't a Vim plugin but rather a CLI file system browser with Vim bindings. I hardly ever actually browse my file system (zfs, grep, and locate do all of the work for me), so I'm not sure how much mileage one can get out of this (especially compared to something like Midnight Commander).

My preference is to use things like cd and ls to browse the filesystem. When I'm feeling really fancy, I might use tree.

Re: Efficient Editing With vim

#95
post #6

I feel silly for only recently discovering tabs in vim. :tabnew file Opens up a new tab, :tabn Goes to the next tab, and :tabp Goes to the previous tab. Works great in both gui and non-gui mode.

gt and gT in command mode also do next tab and previous tab

I never bothered to learn that stuff before I started using Vimperator. I tend to prefer buffers over tabs for dealing with multiple files in a single Vim instance, so I never had much use for tab-related keybindings until I started using a vi-like interface for a tabbed browser.

Maybe that's just me, though.

Re: Efficient Editing With vim

#96
post #39
post #14

Warning: learning Vim makes you look for Vim like commands in any program you interact with using the keyboard. Everything else will be frustrating.

Have you tried vim like browsing? http://vimperator.org/trac/wiki/Vimperator For keyboard lovers.

Can you explain why Vimperator is a good idea. As a vim user myself, I understand vim was designed first and foremost to input and edit text using the keyboard, is bringing those key bindings to browsing the web is a good idea?

For the best navigating experience, I feel Opera does really well. You keep one hand on the keyboard (nearing 1, 2 to switch tab; and z, x to move back & forth in history) and one hand on the mouse to click around & do gestures.

Re: Efficient Editing With vim

#97
post #46
post #43

Earlier quoted context omitted.

plus I still have to see a use for it. Usually I just go linewise or, inside a line, with movements like f) or $.

It's mostly useful for ASCII diagrams, in conjunction with overwrite mode.

. . . or source code formatting, or adding comment characters to multiple lines, or in any other way making an identical change to several adjacent lines at the same time.

Re: Efficient Editing With vim

#99

A decent intro; I'd add to the movement section these: g$ - move cursor to last displayed character of line Tx - move cursor backward and to the right of the first occurrence of x (reverse of tx) And get started with split views: ^ws - horizontal split view ^wv - vertical split view ^w{h,j,k,l} - move to window in respective direction Some decent scripts to get started with: minibufexpl.vim: http://www.vim.org/script…

^[ - Same as Esc (I prefer not reaching so far to Esc)

W - move forward a Word

B - move backward a Word

Re: Efficient Editing With vim

#100
:Ex is a very useful command. And at first I thought that doing 'vim foo' where foo was a folder was just a quirk of UNIX, but eventually I figured that it's a folder browse view.

No more feeling around folder structures with ':e'!

Post reply on HN