After years of a love/hate relationship with Vim (I love what it does, but have configuring it), I had an epiphany: by sticking with the defaults, whether they are my preferred choices or not, I can instantly understand how to use Vim in any environment. Once you get used to biting the bullet and hitting escape instead of jj, or ctrl+c, it just works, everywhere. If you abandon the urge to pimp out your Vim with a bi…
I use a bunch of plugins and I've never had trouble remembering the defaults in the odd case I'm unable to use my own config. I don't get why the top comment on all vim threads is always recommending using poor defaults your whole life so you can avoid learning to configure it or avoid a second of confusion when you're ssh'd somewhere. Maybe everyone else besides me spends all their time ssh'd into random servers.
History and Effective Use of Vim
111–120 of 226 posts
Re: History and Effective Use of Vim
#112I realized why Vim has always felt a little off to me. The primary navigational commands are mostly on the right hand, which as a left handed person feels very weird to me. While Emacs commands favor neither hand (if anything they favor the left with C-f, C-b, C-a, C-e, C-x C-s, M-x, etc). Just a small observation.
You may enjoy a dvorak keyboard. Up and down (j and k) are the c and v keys. Left and right (h and l) are j and p.
Re: History and Effective Use of Vim
#113After years of a love/hate relationship with Vim (I love what it does, but have configuring it), I had an epiphany: by sticking with the defaults, whether they are my preferred choices or not, I can instantly understand how to use Vim in any environment. Once you get used to biting the bullet and hitting escape instead of jj, or ctrl+c, it just works, everywhere. If you abandon the urge to pimp out your Vim with a bi…
Which I've never found much important.
If you know Vim basics (modes, basic commands, movements, etc), then you can use vim in any environment that you SSH to or happen to have to work temporarily on.
But why wouldn't you want the Vim on your main driver laptop, which you use every day to not have a nice custom setup, and some good third party plugins (e.g. file search, linting, etc)?
It's not like using them will make you forgot the basic commands, movements, etc, to use vim in some unknown remote machine.
And it's also not like you should optimize for the random remote machine you'll get in, and not where you spend hours programming every day.
So unless one is a sysadmin and has no real "main" machine he uses vim in, this makes no sense to me...
Re: History and Effective Use of Vim
#114Been using vim since 1998 and rarely stray unless I'm typing notes for something unimportant and them I use Nano. Back in the day when I was a Unix admin, we often worked in full screen terminals and when editing a config file didn't like having to close the vim instance to go look at something, so learned about this little gem: :sh (go back to shell and do your thing and leave vim running) Ctrl-d to return to intact…
Re: History and Effective Use of Vim
#115Earlier quoted context omitted.
Just a quick note, you can use Ctrl +[ rather than Escape. Saves your fingers from constantly having to reach for that corner.
I bind my CAPSLOCK to ECAPE that way instead of the escape key killing my hand my left pinky finger can just naturally get me out of insert mode by hitting CAPSLOCK.
Whenever I resume a Vim session (from another window/terminal), I have a habit of automatically pressing the (Escape) key to ensure I'm in Normal mode. However, every now and again, I have to use Vim on someone else's computer and muscle memory would cause me to press CapsLock instead of Escape. Then pressing 'h' moves the cursor all the way to the top of the screen instead of one space to the left, pressing 'j' joins the current line to the following one instead of moving the cursor, etc. Because I'm used to typing normal mode keys in quick succession, I've already entered 4 or 5 normal commands before I realise it's all going horribly wrong. I press 'u' a few times to undo the craziness but successive presses of 'U' only undoes the previous Undo action!
In the end, I retrained myself to use Ctrl-[ which isn't quite as convenient but does work on all platforms I've had to use.
Re: History and Effective Use of Vim
#116Been using vim since 1998 and rarely stray unless I'm typing notes for something unimportant and them I use Nano. Back in the day when I was a Unix admin, we often worked in full screen terminals and when editing a config file didn't like having to close the vim instance to go look at something, so learned about this little gem: :sh (go back to shell and do your thing and leave vim running) Ctrl-d to return to intact…
Or just CTRL+z and then 'fg' to go back.
Re: History and Effective Use of Vim
#117After years of a love/hate relationship with Vim (I love what it does, but have configuring it), I had an epiphany: by sticking with the defaults, whether they are my preferred choices or not, I can instantly understand how to use Vim in any environment. Once you get used to biting the bullet and hitting escape instead of jj, or ctrl+c, it just works, everywhere. If you abandon the urge to pimp out your Vim with a bi…
Yup. I've been using vi[m] on an almost daily basis since about 1989...wow, that's 30 years. In those decades, I have resisted putting anything in my .vi[m]rc except: set tabstop=4 set expandtab set shiftwidth=4 set shiftround That's it. And I agree with you, it's a very happy place for me.
Re: History and Effective Use of Vim
#118Earlier quoted context omitted.
I also find it important to set encoding=utf-8. I'm not working with Latin-1 files.
Yes, this is a good idea, although I'd like to note there is more nuance. * `encoding` is what vim uses internally -- the way buffers and registers are stored in memory. Default value is latin1 as you mention, but it will also pick up on the $LANG environment variable. It's more effective in general to set that variable than directly tweak `encoding`. (Mine is en_US.UTF-8 due to my locale.) * `fileencoding` is the en…
Re: History and Effective Use of Vim
#119I rarely ever use actual vim, mostly when I'm in the terminal. But I have vim plugins for most IDEs I use (VS code, intellij, XCode). It makes editing so much faster. When I have to get by without it I feel as if someone put weights around my wrists. The reason I don't use Vim is because it's frankly not a smooth experience for most languages (unless you fiddle around a lot, and even then I found Ide+vim plug-in supe…
After a several month effort to learn vim bindings and use them full-time, I eventually ended up weaning myself back off because the plugins for the editors I actually use all seemed to come with considerable downsides. vscode-vim caused odd performance issues, and I encountered significant bugs with the undo stack (namely hitting 'u' would sometimes take out the last 10-15 changes instead of just one). IDEAvim would…
I'm pretty broken by Vim. I don't really want to invest the time to get really good at a non-modal text editor.
Re: History and Effective Use of Vim
#120Been using vim since 1998 and rarely stray unless I'm typing notes for something unimportant and them I use Nano. Back in the day when I was a Unix admin, we often worked in full screen terminals and when editing a config file didn't like having to close the vim instance to go look at something, so learned about this little gem: :sh (go back to shell and do your thing and leave vim running) Ctrl-d to return to intact…
In nvi (at least), one can also open a buffer and :script to run a shell inside vi and have all the yank/paste/navigation/all-the-things features of vi. Mind you need to i[nsert] or a[ppend] after the prompt to issue your commands.