[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
How to use vim
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 18
Thread images: 2
File: vimlogo.png (90 KB, 1022x1024) Image search: [Google]
vimlogo.png
90 KB, 1022x1024
So I've been trying vim lately. I really see how it can be useful, but then I don't fucking get it. I don't need a list of key bindings, I have that. The problem is that none of that can be combined in a practical way that would be any faster than just using the mouse in a modern text editor. Examples of things that annoy me in vim:

>Backspace doesn't work in insert mode (might be a problem specific to my installation though)
>You can't use shortcuts to navigate in insert mode, so when you are writing code, and want to move to the end of the line, I need to do Ctrl+c, $, i, which is fucking spastic.
>I never fucking know where paste puts the fucking text. Maybe I'm too stupid, but it always surprises me where it puts the text. Super annoying
>Say I copied some text with y, then I want to paste it. Now I can't delete any fucking thing before I do that, because everything I delete will also be copied which is fucking stupid
>Again, I copied something, but now I want to add a few tabs or something before I paste it. I again, need to go into insert mode, make the fucking tab, go out of insert mode again with that ridiculous "shortcut" and paste it.

Now, I know you will probably post something like "Kys retard", but Jesus, I don't fucking get the enthusiasm for this shitty tool. I really tried, but none of that makes any sense to me. No matter how much I exercise, I'm still at least twice as fast with any other more modern text editor. It's crazy. I'm absolutely willing to see that I'm just too stupid to use vim, but please show me the way if you can. How do you solve above problems?
>>
>Backspace doesn't work in insert mode (might be a problem specific to my installation though)
Works fine on my version, might be caused by something else

>You can't use shortcuts to navigate in insert mode, so when you are writing code, and want to move to the end of the line, I need to do Ctrl+c, $, i, which is fucking spastic.
The End key still works, also Ctrl+c? why not Esc? and how Ctrl+c, one of the most common hotkeys spastic?

>I never fucking know where paste puts the fucking text. Maybe I'm too stupid, but it always surprises me where it puts the text. Super annoying
paste puts the text after the character you're cursor is on. that one messes me up all the time too, but its easy to fix with u, h, p. Yeah, its key combinations but it's not exactly complex.

>Say I copied some text with y, then I want to paste it. Now I can't delete any fucking thing before I do that, because everything I delete will also be copied which is fucking stupid
you have multiple registers that you can paste into. Give http://usevim.com/2012/04/13/registers/ a glance

>Again, I copied something, but now I want to add a few tabs or something before I paste it. I again, need to go into insert mode, make the fucking tab, go out of insert mode again with that ridiculous "shortcut" and paste it.
do you want to indent first? >> indents the line you're on.

If you can't get your head around the modal system or you're just not happy there's nobody saying you have to use vim. Except the assholes in the text editor wars but who cares what they think.
>>
>>55009509
i hate this editor.. always forget to quit edit mode and break config files
>>
>>55009509
>I haven't read the manual: The post
>>
:wq!
>>
>>55009509
>>Backspace doesn't work in insert mode (might be a problem specific to my installation though)

You are not supposed to use backspace but delete in the main mode. You should stay in the main mode as much as possible honestly.

However backspace does work on many machines only my new small laptop built for battery life seem to give me this problem. Something about the compact keyboard.

You can keybind it though it might be a good idea to figure out why it isnt working in the first place.

>>55009509
>>You can't use shortcuts to navigate in insert mode, so when you are writing code, and want to move to the end of the line, I need to do Ctrl+c, $, i, which is fucking spastic.
Yo need to hit esc and move back into insert mode only when typing. I reccomend learning the multiple ways to o back into insert mode like end of line and into insert mode or create a empty line above or below and drop into insert mode.

>>55009509
>>I never fucking know where paste puts the fucking text. Maybe I'm too stupid, but it always surprises me where it puts the text. Super annoying
You are likely not entering insert mode before hitting paste. So it interprets the letter as key presses until you reach an i and then it goes into insert mode to drop the rest wherever the cursor is.

>>55009509
>Now, I know you will probably post something like "Kys retard", but Jesus, I don't fucking get the enthusiasm for this shitty tool. I really tried, but none of that makes any sense to me. No matter how much I exercise, I'm still at least twice as fast with any other more modern text editor. It's crazy. I'm absolutely willing to see that I'm just too stupid to use vim, but please show me the way if you can. How do you solve above problems?
You need to get used to it. You should basically live in the main mode if you are using it right which is why most of the power is there. Itll be great if you get used to it.
>>
>>55009509
>Backspace doesn't work in insert mode (might be a problem specific to my installation though)
This should work, dunno what's up with yours.

>You can't use shortcuts to navigate in insert mode, so when you are writing code, and want to move to the end of the line, I need to do Ctrl+c, $, i, which is fucking spastic.
You shouldn't be navigating in insert mode very much, if at all. Insert mode is for typing in text in short bursts. You should be doing most of your navigating and editing in normal mode.
>>
It takes some practice OP. You'll be unproductive until you get more used to it, but it will be worth it once you do.
>>
>>55010144
i have but i dont remember all keys because i only use it on embedded devices that do not have anything better
>>
>>55010345
>i have
>lying: the post
>>
>>55010361
i just keep this open when i need to use that shit
http://www.lagmonster.org/docs/vi.html
>>
>>55010345

Do the vimtutor a few times a week to drill the muscle memory. And try to stay out of insert mode. Regular mode (i forget what it is even called command mode maybe) has many movement keys for charecters by charecter, word by word, sentence by sentence, paragraph page and top and bottom of the entire document.

You will want to learn those if you are sshing as you wont be able to use an addon like easy motion.
>>
>>55009509
>You can't use shortcuts to navigate in insert mode, so when you are writing code, and want to move to the end of the line, I need to do Ctrl+c, $, i, which is fucking spastic.
Just do ESC A.

My rule when learning Vim was that if something feels like it takes too long to do in Vim, I'm almost certainly not doing it in the most efficient way. That turned out to always be the case.
>>
>>55009791
>>You can't use shortcuts to navigate in insert mode, so when you are writing code, and want to move to the end of the line, I need to do Ctrl+c, $, i, which is fucking spastic.
>The End key still works, also Ctrl+c? why not Esc? and how Ctrl+c, one of the most common hotkeys spastic?
I think OP was referring to the whole act of exiting insert mode, going to the end of the line, and re-entering insert mode as spastic. Yeah, the end key still works and I'm not sure why OP is such a tard to forget about it, but I agree with him that having to exit insert mode just to do some retardedly basic task just to re-enter insert mode kind of sucks.
>>
>>55009509
First of all, anytime anyone has trouble with the insert mode, it means they dont get how vim is supposed to be used. In your specific case, stuff like
>navigate in insert mode
makes any vim user recoil in disgust. You dont navigate in insert mode, period. On that note, getting back to normal mode should be easy. C-c is kinda stupid. People usually swap esc and caps lock, or map esc to `jj` or `jk`. Check the wikia for other ideas.
>Backspace doesn't work
It should work, troubleshoot that. Also, you might wanna use C-h for backspace in insert mode or C-w to delete a word. I find those much more convenient than backspace or C-backspace. Dont listen to that anon who said that you have to get to normal mode to do delete a single goddamn character, that's retarded.
>I never fucking know where paste
:h p, :h P, honestly. Please don't be THAT stupid.
>Say I copied some text with y...
Anything you explicitly yank is conveniently stored in the "0 register, meaning that you can indeed keep deleting as much shit as you like, and it won't make a difference. To paste whatever you copied you have 2 options
1) from normal mode "0p
2) from insert mode C-r 0
Shit you delete gets sequentially stored in the numbered regs, from 1 to 9, so that you can paste that as well. Now, ain't that cool, anon?
>Again, I copied something, but now ...
Tabbing with tab is retarded. You can do >> from normal mode to indent. I like to do >>...... if i have to indent a lot. Also, look into = (i.e :h =)
>Jesus, I don't fucking get the enthusiasm for this shitty tool.
considering you cant even figure out how to use the simplest features, i honestly dont see how you could.
>I really tried,
i like to believe this is bullshit cause i usually give people the benefit of the doubt.
i really dont wanna give you any further help dude, learn how to google or some shit. there's a ridiculous amount of documentation out there, even youtube videos for special kids.
>>
File: 255.png (4 KB, 222x211) Image search: [Google]
255.png
4 KB, 222x211
>>55009509

Rebind caps lock to escape. It makes using Vim so much better.
>Backspace doesn't work in insert mode (might be a problem specific to my installation though)
Don't use vi.

>You can't use shortcuts to navigate in insert mode, so when you are writing code, and want to move to the end of the line, I need to do Ctrl+c, $, i, which is fucking spastic.
Escape, A. Takes less than half a second. A puts you at the end of the line in insert mode.

>I never fucking know where paste puts the fucking text. Maybe I'm too stupid, but it always surprises me where it puts the text. Super annoying
P to paste in front of the cursor, p to paste behind. if you yy a line, remember that the newline character gets yanked too.

>Say I copied some text with y, then I want to paste it. Now I can't delete any fucking thing before I do that, because everything I delete will also be copied which is fucking stupid
Use x, or better yet, yank into specific registers. If you want to delete 20 characters, you don't have to enter select mode, select the shit and press d, you can just do "20 x"

Again, I copied something, but now I want to add a few tabs or something before I paste it. I again, need to go into insert mode, make the fucking tab, go out of insert mode again with that ridiculous "shortcut" and paste it.
Use >> to indent, or you can paste it and do I, which puts you at the beginning of the line in insert mode.
>>
>>55010150

You won't need the !.
>>
>>55009509

If you have some sort of Linux, do the Vimtutor a few times until you get the hang.


As for your questions:

Yes, at the beginner you are A LOT slower as with a "normal" text editor. However, after a so time you will get a lot faster than you could with a normal text editor.

Just learn the usually comands (I mentioned the Vimtutor). After that you can add macros.

Trust me, Vim will be rewarding if you have the patience to survive the first few weeks.
Thread replies: 18
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.