The frustration is that probably there are fixes for all these things, which if I were an expert I would know. But meanwhile I can use an ordinary visual text editor and I don't have to learn anything new.
The frustration is that probably there are fixes for all these things, which if I were an expert I would know. But meanwhile I can use an ordinary visual text editor and I don't have to learn anything new.
The modal nature of Vim is one of it's key features and makes a lot of sense. If you consider the keyboard the primary, if not singular, means of interaction, then there will be times you want to use the keyboard to type text and times you want to use the keyboard to control the editor behavior. In a "normal" editor, you have to use modifier keys to enter commands. In Vim, you do it by changing modes. It's actually quite powerful but you can't get past your own assumptions about efficiency.
Is that a fact, or you just parroted other people who made similar claim?
I still use the mouse from time to time when editing text mind you. But for most actions, I would not think of moving my hand to the mouse, because it is slow.
Even before vim, I made gratuitous use of end of line navigation via keyboard (home/end buttons; cmd+arrow keys). vim is just a more powerful version of those buttons.
I make no claim that vim is the MOST efficient platform ever created, but it's a lot faster than mouse+keyboard and/or out of the box editing methods.
https://ux.stackexchange.com/questions/30682/are-there-any-r...
I always found this “faster” claim somewhat stretched and zealous. I don’t need to type fast. I need the editing routine to gtfo of my mind when I’m programming.
> I don’t have to plan ahead how many times to press an arrow
Usually, I'll just do something, e.g., hit dd to delete a line and then even though I could hit "3." to delete three more lines, I'd usually just repeatedly tap . to repeat that dd action. It doesn't really matter if the action is deleting a line or commenting/uncommenting it or changing capitalization or modifying a word in a certain way. The general strategy of doing the action you want and then repeating with . it is very useful.
> Also, why do I have to have a special mode to insert things?
First and foremost Vim is a modal text editor. If you don't like that Vim is probably not for you. Your comment is kind of like saying I'm really trying to like chocolate, but I don't like the flavour.
There's a Vim way of doing things, if you really take the time to learn it then the questions you are asking will all be resolved.
I do, I hate accidental wrapping on left/right so much and see absolutely no use to it.
But you may configure it, :help 'whichwrap'
Also, why do I have to have a special mode to insert things?
Because if your alphabet keys do always insert, you have to hold some control key to enter commands and movements, and not if not. That’s the point of being modal. Otherwise there are plenty of emacs-alikes to train pinkies on, and no need for yet another notepad+.
No, because those are features, not bugs. If don't want them - you don't have to even think about them.
>Like, why can't I hit right at the end of a line, and move to the next line? Who thinks that is a good idea?
It's not that you can't. The idea behind vim-like navigation is that you don't press those arrows (or hjkl for that matter) in a consecutive manner (or hold) unless you really have to. 99% of the time you jump to some place in the text (a character, or line, a word, a nth line etc).
Funnily enough, Vim is short for "Vi IMproved", and its predecessor vi is short for "visual"!
---
Taking the time to learn Vim yields significant rewards if you're willing to meet it on its own terms. I certainly grant you that it's not for everyone. It's the agony and the ecstasy of deep tools. No pain, no gain.
> The frustration is that probably there are fixes for all these things, which if I were an expert I would know.
I would submit that if you were an expert, you would not have the same list of gripes. To wit:
> Like, why can't I hit right at the end of a line, and move to the next line?
This is a fair complaint, but one that's actually never occurred to me as a Vim user, because:
> Why do I have to have a special mode to insert things?
It's a core part of Vim's design! In fact, insert mode is The other mode (Normal mode) is where the real power is. It's not so much about moving chunks of text around with the keyboard as about moving the cursor.
Vim divides normal mode key commands into motions and operators. operators add/remove/change text, and motions move the cursor.
For instance:
- `d` is an operator deletes text.
- `w` is a motion that moves the cursor to the start of the next word
- `12w` does this 12 times (practically every motion can be repeated like this)
But the rubber really meets the road when you combine them.
If you hit `d` once in normal mode, nothing happens: you've started a command but Vim is waiting for you to finish it by entering a motion. `dw` deletes from the cursor up to the start of the next word (you can guess what `d12w` does).
> And why does the help system never tell me what I want?
Perhaps start with `:help help` :)
set -o vi
And get vim in your bash shell. Then you wonder what the default mode is, and it turns out it’s emacs and you can do wild things like ctrl-A to go to the beginning of the line.
And now I cringe when ever I see someone painstakingly left-arrow for 30 seconds to edit something at the beginning of their bash prompt.
A million thanks!
* Ctrl-u: clear line and start from the beginning * Ctrl-a: go to the beginning of line * Ctrl-e: go to the end of line * Ctrl-b: move backwards * Ctrl-f: move forwards * Ctrl-c: leave the command as it is, just cancel the command and start with new line * Ctrl-w: delete a word before cursor * Ctrl-h: delete a character before before cursor * Ctrl-d: delete a character after cursor * Ctrl-t: swap last 2 characters (this is one of my favourites in terms of lulz, I actually trained myself to use it :D) * ...
Pulled these out of my fingers, but there are more. Don't know the correct source to point to.
What's good about those is that they work by default and behind every computer.
Unless you’re super into vim, it makes more sense to learn the basic emacs keybinds ‘cause like you said, it’s almost everywhere.
I know this is probably something that sounds like someone too far down the rabbit-hole to see where they came from, but I'm not sure why you'd want to do that. The horizontal movement is probably adjacent to the vertical movement on your keyboard. Just use the appropriate movement to get where you want to go?
> Also, why do I have to have a special mode to insert things?
Because then you can use the regular keyboard, i.e. keys that would normally insert characters, as control inputs.
> But meanwhile I can use an ordinary visual text editor and I don't have to learn anything new.
You don't have to learn anything new because you don't want to do anything new.
You're absolutely right. You do sound far down the rabbit hole! I am used to being able to hold down the right key and traverse my entire document, as far as I like. Why would I want to stop at the end of a line? Any time I'm editing multiline text - like, say, English - that is essentially arbitrary.
The regular keyboard... right... but what if there were some kind of special key that could be pressed to issue controls? Why is that worse than having a special key that goes into control mode? This is analogous to having caps lock, but no shift key.
Again, you're right, I don't want to do anything new. Why would I? I want to get on with my job. If the response to my complaints is "the problem is with you, my son", without any idea of the ultimate benefits I might gain from changing, then yeah, I'll pass. Honestly, this applies not just to you, but to all the responses below... they're all like "if you try it, one day you will understand". That's probably what people say about Morris Dancing.
You might still spend more time editing than writing, and Vim's modal approach makes editing more comfortable to me.
> Why is that worse than having a special key that goes into control mode? This is analogous to having caps lock, but no shift key.
The assumption is that modal editing is more comfortable and powerful. I can traverse the text and make modifications and replacements without holding chords between Ctrl, Alt and letter or arrow keys for long periods of time. Vim's model with text objects also makes some things easier to do than what you can accomplish with chords on editors liks VS Code.
If you spend a significant amount of time writing in all caps, you might benefit from having a Caps Lock key instead of shift.
> I don't want to do anything new. Why would I? I want to get on with my job.
Vim is something that's radically different from other text editors. If you think the learning curve is not worth it, it's up to you. It might not be; it's not like it will turn you into a better writer or programmer. But its uniqueness was enticing enough for me to give it a go, and I realised I enjoyed working with it.
> "if you try it, one day you will understand"
I don't think you should try Vim because it will magically make you a better professional. That's a fantasy some people use to justify the time investment they made to adapt to Vim. I think you should learn it if you're curious, and it's fine if you start learning and decide it's not worth your time. Have you never learnt something just for the fun of it?
PS: If you use VS Code or a JetBrains IDE, I don't recommend switching to Vim. Just do Vimtutor and go back to your regular IDE with a Vim plug-in. VS Code's is pretty good. This is the best of both worlds: you get all the powerful extensions and general IDE goodness while having Vim's Normal and Visual modes. As a bonus, you can still use the regular navigation and editing shortcuts while in Insert mode in VS Code. E.g. navigiating and selecting with Shift, Alt and Command plus arrow keys works like normal, so you don't need to switch modes for small things.
I mean chances are, if you're holding down a key in vim, you're doing an inefficient movement. That's kinda the point: it's a keyboard language that turns complex actions into compound, simple actions. If you're still using the simple movement and complaining about it not doing what you want, you're just not using vim correctly.
I'm not sure why people get this defensive, though. People like vim, people like editors-that-aren't-vim. Is that not okay? If you don't want to learn to use vim, this link isn't for you.
> but what if there were some kind of special key that could be pressed to issue controls?
This works for a limited number of shortcuts, and when you only want to issue a few. The point is that you can now issue a large number of "command" inputs, very quickly, without holding down a key.
> Again, you're right, I don't want to do anything new. Why would I? I want to get on with my job.
Then uh... don't use vim? Do you post on every "I wrote xyz course for abc language/tool/technology" expressing that you don't want to use it?
This is clearly a great fit for programming in most languages, but it also works well for natural language. You can put one sentence per line or even split up long sentences into clauses. Then you use the line-manipulation commands to make big edits quickly. Of course, this only works for formats like LaTeX and HTML where consecutive nonempty lines are merged into one line for rendering.
Under the "array of lines" mental model, it doesn't make sense to hold down the right arrow key and traverse the entire document. You move to the desired line first, then move to the desired position in the line.
I agree the two models are basically incompatible. I don't like editing text in non-vim interfaces and will generally open vim for anything longer than this comment.
What do you mean by this? Do you mean the right arrow key?
The mode paradigm was definitely weird to me too at first, but it eventually makes sense, especially when you start using macros.
I agree about the help system - it hasn't been very helpful to me either. I usually am better off consulting stackoverflow or vim's wiki for how to do something.
Vim took me quite a bit of time to learn beyond the basics, but once I learned it, it became a productivity boon. It's nice to have the same powerful text editor available wherever I ssh to, right in the terminal, in the same place I'm using all my shell commands.
You don't really move a caret around in vim, you process units of text and lines.
set whichwrap+=<,>,h,l,[,]
Source: https://vim.fandom.com/wiki/Automatically_wrap_left_and_righ...
Then do that?
:h whichwrap