jim wrote:But really, vi is such a powerful editor and so fast and lightweight that when you learn it you use it literally like natural language to where you aren't even thinking about what you are doing, and in fact can't even describe to people what you are doing without actually doing it.
Jeez jim, you described me and vi to a T. Over the years I've tried emacs, Visual Studio, Eclipse. But if it doesn't have a vi emulator, I end up finding a way back because everything else is so damn slow when compared to what I can do in vi. That's why I'm using slickEdit. Adequate vi emulation.
I'm not as bood with some of the navigation, selection slightly more advanced commands as I should be. When I develop now I usually stick to Eclipse when I'm at a IBM/Open Source Shop and Visual Studio at a Windows shop - most of them have their source control and workflow stuff all integrated so it's tough to do anything else.
I just remember learning some of the commands and loved hitting 'dd' to delete a line, d# to delete multiple lines. yy to copy a line, etc.
But I think one of my single favorite features was being able to cut/copy/delete a selection inside ()'s and {}'s. And the auto indent feature - might be the single simplest and most powerful auto indenter out there.
vinsanity wrote:
But I think one of my single favorite features was being able to cut/copy/delete a selection inside ()'s and {}'s. And the auto indent feature - might be the single simplest and most powerful auto indenter out there.
And don't forget your sed interface! Nothing like doing a blanket search/replace with one easy command from the top of the file:
:.,$s/OLD/NEW/g
and you're done!
Antoher one I really like is being able to cut and paste between multiple files - yank from file a, ':e #' to the other file and drop it in.
And finally, any shell command you want to perform with a ':! cmd'. Yessir, you can create new files with shell redirection and get in and edit right away. Or compile the file you're editing to see what happened and edit some more without leaving. Very convenient.
vinsanity wrote:
But I think one of my single favorite features was being able to cut/copy/delete a selection inside ()'s and {}'s. And the auto indent feature - might be the single simplest and most powerful auto indenter out there.
And don't forget your sed interface! Nothing like doing a blanket search/replace with one easy command from the top of the file:
:.,$s/OLD/NEW/g
and you're done!
Antoher one I really like is being able to cut and paste between multiple files - yank from file a, ':e #' to the other file and drop it in.
And finally, any shell command you want to perform with a ':! cmd'. Yessir, you can create new files with shell redirection and get in and edit right away. Or compile the file you're editing to see what happened and edit some more without leaving. Very convenient.
Why go to the top?
:1,$s/OLD/NEW/g
......
My favorite feature is setting tags, so that I can easily hop back and forth. I use qwert ... and will often have several tags set at one time.
So sit on a line, type 'mq' to set your mark, '~q' to go to it. Then you can set mw,me, mr .... etc...
Becasue my line of thought is 'where do I want to be?'. My hand either does '/WHEREIWANTTOBE' or '1G' or whatever and then it's always ':.,$s/....' from there.
Like you say you think it more than do it consciously.
Becasue my line of thought is 'where do I want to be?'. My hand either does '/WHEREIWANTTOBE' or '1G' or whatever and then it's always ':.,$s/....' from there.
Like you say you think it more than do it consciously.
I'm a keystroke minimalist.
But you probably have that 1G followed by the :.,$s/... strategy burned into your brain and do it so fast that you couldn't break yourself if you wanted to.
Becasue my line of thought is 'where do I want to be?'. My hand either does '/WHEREIWANTTOBE' or '1G' or whatever and then it's always ':.,$s/....' from there.
Like you say you think it more than do it consciously.
I'm a keystroke minimalist.
But you probably have that 1G followed by the :.,$s/... strategy burned into your brain and do it so fast that you couldn't break yourself if you wanted to.
Exactly. I'm there before I even consciously think about it.
Becasue my line of thought is 'where do I want to be?'. My hand either does '/WHEREIWANTTOBE' or '1G' or whatever and then it's always ':.,$s/....' from there.
Like you say you think it more than do it consciously.
I'm a keystroke minimalist.
But you probably have that 1G followed by the :.,$s/... strategy burned into your brain and do it so fast that you couldn't break yourself if you wanted to.
Doesn't gg go straight to the top anyway? So it's what, one more stroke?
Becasue my line of thought is 'where do I want to be?'. My hand either does '/WHEREIWANTTOBE' or '1G' or whatever and then it's always ':.,$s/....' from there.
Like you say you think it more than do it consciously.
I'm a keystroke minimalist.
But you probably have that 1G followed by the :.,$s/... strategy burned into your brain and do it so fast that you couldn't break yourself if you wanted to.
Doesn't gg go straight to the top anyway? So it's what, one more stroke?
What's one more stroke? Well, one more. Why? Plus my finger finds the '1' instinctively - the . isn't even on the same hand. Good luck changing that.