Huh. I know almost all of those key bindings in vim, because I have to use vim when I'm editing over ssh. And that brings me to about 20% efficiency compared to what I can do with a modern text editor (I don't use Sublime, but another GUI IDE -- which one doesn't matter, except that it's not Eclipse). So I guess there are different levels of "proficiency" of editor use?
On a related note: I've never understood the fixation with being able to enter numbers into vim. I almost never know the exact number of characters or lines I need to move/delete/indent/whatever, but key repeat is fast enough to "replay" or redo an action that I'm likely done with it before I would have figured out the exact number.
I like the general concept of being able to "program" an editor with strings of commands. But in practice I'm much faster with the GUI approach. As a bonus, all of the commands I need to know to edit text in a Firefox window, or in any other window in a GUI-based OS, also follow the GDI standards, so I get a base level of efficiency in whatever program I need to enter text in.
VIM is great for editing over ssh. When I have no choice. But I feel seriously handicapped having to use ONLY the basics to move around, copy, paste, and edit, when I'm used to having much more powerful functionality at my fingertips.
I guess it's also one thing to know them, and one thing to be comfortable typing them in a nonstop flow of text. My keystroke speed rarely changes from insert mode to control mode; vim commands have become an integral part of my typing process. I feel severely gimped whenever I can't use my vim controls.
As for knowing the number of lines you need to jump, either do :set number and be quick at math, or you can modify the numbers to be relative to your current line.
I took me probably a week to be able to actually get anything done in vim, and a month to prefer vim to anything else.
That being said, I know far more commands than the ones I listed. Those commands got me to my first month, though.
I think the number thing can be confusing, and it is hard to think in terms of 'delete the following 5 lines'. For those things I tend to use visual mode and highlight (still think keyboard-based selection is faster than with a mouse most times).
I also have a shortcut for a 3-way toggle using F2 - so I can either see absolute, relative or no line numbers at all. I don't use it much, but it can be handy at times.
function! NumberToggle()
if(g:numberstate == 0)
set number
let g:numberstate=1
elseif(g:numberstate == 1)
set relativenumber
let g:numberstate=2
else
set nonumber
set norelativenumber
let g:numberstate=0
endif
set foldcolumn=0
endfunc
let g:numberstate=0
nnoremap <F2> :call NumberToggle()<CR>
You can get rid of the global variable by testing the actual settings instead:
function! NumberToggle()
if (!&number && !&relativenumber)
set number
set norelativenumber
elseif (&number && !&relativenumber)
set relativenumber
else
set nonumber
set norelativenumber
endif
set foldcolumn=0
endfunc
Numbers are useful for repeating actions in a deterministic way: I'd take 6p over Cmd+v-Cmd+v-Cmd+v-Cmd+v-Cmd+v-Cmd+v any time.
Numbers are also a good way to limit haphazard movements that have nothing to do with what you are trying to do. Do you want to "move the current line to after line 13" or do you want to "move to the first column of the current line, select to the EOL, cut, move down, down, down, down, down, down, open a new line and paste"?
:t13<CR>
Anyway, you don't need to use {count} for everything.
Do you want to "group together all the variable declarations scattered around the current function at the top" or do you want to "move your cursor to the line of the next variable declaration, move the cursor to the first column, select to the EOL, cut, move up, up, up to the top of the function, open a new line, paste and repeat that nonsense for every variable declaration in that code block"?
vi{ " visually select the function
:g/var/m?funct<CR> " move every var declaration right under the function declaration
You'd be blind to not see any value in all that. Being able to do (almost) exactly what you have in mind rather than a long and awkward combination of unrelated actions is an incredible boost.
You have many "more powerful functionalities" at your fingertips. Being lazy or incredulous doesn't make Vim an overrated tool, it makes you an inefficient user.
Using Vim efficiently is a very valuable goal but it's not a goal that can be reached without a little bit of work. You won't get any benefit if you refuse to do any investment.
"Normal" editors/IDEs don't require that much learning because they don't offer much in the first place. You can become a TextMate/Sublime Text power-user in a week because there's not much to them. Becoming a Vim power-user is a life-long experience: it's your choice if you want to take that path or not.
That said, nobody (I hope) is forcing you to like it or learn it. Keep using what works for you, there's absolutely no problem with that.
The guy I was replying to claimed that one could use it "proficiently" with just those commands. I disagreed, and you didn't contradict that assertion.
> I'd take 6p over Cmd+v-Cmd+v-Cmd+v-Cmd+v-Cmd+v-Cmd+v any time.
Does Cmd+V not repeat? If so, I'll add that to the list of reasons I could never be happy on a Mac. I will happily hold down Ctrl-V for as long as I need rather than trying to think in numbers, yes, absolutely, ESPECIALLY when the number I need is some number between, say 20 and 30. Thinking in exact number of things that I'll need interferes with the (mental) registers I'm using to hold all of the code I'm thinking about. This is also true of the more complex vim commands I've seen, including the ones you've quoted.
Nice trick, though, with the "move var declarations" example you gave. Considering I tend to do the opposite (moving variable declarations to be as late as possible), that particular trick isn't something I'd need, but I see how it could be useful in general.
Thing is, if I had a similar task, I'd create a macro that would do the right thing. There's a skill to creating macros like that, of course, but really learning to use a powerful GUI editor is a life-long experience. It just happens to have a shorter and almost infinitely less painful learning curve at the beginning than vim.
The problem is that some people (such as apparently the developer I was replying to) learn the basics and never any more. That's true of users of all editors, I'm sure. But just because 95%+ of GUI editor users don't ever go beyond the basics doesn't mean that there isn't power hidden under the surface. Maybe more vim users delve deep into its power, statistically speaking. I submit that says more about the kind of person who would use vim than it does about the power of vim relative to (modern) GUI editors.
I plateaued very quickly with TextMate. I'd say after 5 months. I'm 3+ years in with Vim and I learn new things every day.
Those numbers are obviously bothering you but they are definetely not needed. Stop focusing on that. They are only one way, largely inherited from vi's ancestry, but there are so many other ways. I don't use counts much for the same reason as you (and I find that counting breaks my train of thought) but I use search and "advanced" motions a lot and quite naturally. The ability to jump to arbitrary positions in my code and directly work (without selection) on things like inner parenthesis and other text-objects have been extremely useful in my day to day work.
Once you are used to those text-objects and motions, using any other editor is a monumental pain in the ass, however advanced and modern they are.
But, as I alluded at the end of my comment, I don't mean to convince you or anyone of the superiority of Vim because I don't care: I have no interest in the success or failure of Vim. I use Vim and a couple of IDEs in my work and I'm totaly fine with you using and prefering other tools.
On a related note: I've never understood the fixation with being able to enter numbers into vim. I almost never know the exact number of characters or lines I need to move/delete/indent/whatever, but key repeat is fast enough to "replay" or redo an action that I'm likely done with it before I would have figured out the exact number.
I like the general concept of being able to "program" an editor with strings of commands. But in practice I'm much faster with the GUI approach. As a bonus, all of the commands I need to know to edit text in a Firefox window, or in any other window in a GUI-based OS, also follow the GDI standards, so I get a base level of efficiency in whatever program I need to enter text in.
VIM is great for editing over ssh. When I have no choice. But I feel seriously handicapped having to use ONLY the basics to move around, copy, paste, and edit, when I'm used to having much more powerful functionality at my fingertips.