razputnik: (Default)
[personal profile] razputnik
I noticed a few people making posts about editing their shell history with vi - so I thought I'd contribute this little trick that someone may or may not have mentioned already:

If you add "set -o vi" to the end of your .bashrc, it changes your command line editing mode to vi keybindings, meaning you can use hjkl to navigate through your history and edit lines using vi oldies but goldies like cw and c$. It's a bit of a pain to get used to at first, but it's good if you're the type who keeps typing cw when you want to change an argument and then get annoyed when it just inserts that as text.

:wq
jadelennox: Demonic Tutor, Jadelennox: my Magic card (demonic tutor)
[personal profile] jadelennox
I consider myself a vi power user, but after all these years there is still a ton I have to learn. Introducing the blog The Daily Vim, syndicated at [syndicated profile] dailyvim_feed. It's not even remotely daily (which is good -- it means I have time to learn its various tricks between posts) but it is handy for all kinds of editing and command line tricks. For example Easier command line editing teaches us this bash trick:

Start typing on the command line and then type Ctrl-x Ctrl-e, it should drop you into your system's default editor (hopefully Vim) and allow you to edit the command line from there. Once finished, save the command line, and bash will run the command.

Doesn't help me, because I'm a tcsh user, but I'm contemplating making the big switch back to bash.
foxfirefey: A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders. (geek)
[personal profile] foxfirefey
We were talking about vi/[community profile] emacs in #dw and avid emacs user [personal profile] mocker reluctantly mentioned vimtutor to me, and so I'm mentioning it to you all here, in case some of you wanted to start learning vim. You should be able to use it just by typing vimtutor on the command line of a system that has vim installed.
foxfirefey: Fox stealing an egg. (Default)
[personal profile] foxfirefey
So, vi(m) is a great command line editor if you've started to outgrow nano. But, if you are copy pasting chunks of things into it, sometimes it does some...creative reformatting. You can stop this if you use this command before you do your i (insert letter) and paste:

:set paste

Profile

command_liners: A command line prompt with a blinking cursor after it, green against black. (Default)
Command Liners

September 2014

S M T W T F S
 123456
78910111213
1415 1617181920
21222324252627
282930    

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 21st, 2017 02:48 am
Powered by Dreamwidth Studios