Question for Vim users: how do you get used to hitting Esc very often? I know some switch Cap with Esc but still clunky.
I use `jk` or `jj` instead of esc. Its so much easier imap jj
Vim – Minimal Setup Explained
41–50 of 114 posts
Re: Vim – Minimal Setup Explained
#42Since I was in university 15 years ago I promised myself to learn Vim commands seriously. Well I see that finally I did my programmer life learning only switching insert mode / edit mode, maybe 5 commands like A x etc...,and :q or :wq!
I relate quite heavily to this when using vi to do all my git-related activities. git rebase -i ... followed by ↓dw ↓←dw ↓←dw ↓←dw ↓←dw ↓←dw i s ↓s ↓s ↓s ↓s ↓s because I keep forgetting :s/pick/s/g is a thing i, a, :q, :wq, dd, xdd, and D are all the ones I remember, but cutting/yanking pasting is still something I don't have the muscle memory for. Shift+G takes me to the bottom of a file, but I don't know how to get…
:%s/^pick/s/
to replace "pick" at the start of line with "s" on all lines? If you execute it once in vim you can recall it later with just typing
:%↑
and confirm with Enter.
As for the top of the file:
gg
I use the mnemonic "go go line" (as in Inspector Gadget's "go go gadget") and since you can prefix it with a line number (e.g. 4gg to go to line number 4), leaving it out gets me as close to line number nothing^Wzero as possible, i.e. line 1.
HTH :)
PS: the % says "on all lines" your trailing "/g" would make it match&replace "pick" multiple times on the (current, since % is missing) line
PPS: As an aside, I use "vim somefile +N" all the time to open somefile at line number N;
especially when there's an error message in the form "error at somefile:N" by typing vim, then double-click-middle-click copy&pasting "somefile:N", Ctrl-E to jump to the end and replacing ":" with " +". I really should write a shell function for that...
EDIT: formatting
Re: Vim – Minimal Setup Explained
#43Question for Vim users: how do you get used to hitting Esc very often? I know some switch Cap with Esc but still clunky.
Re: Vim – Minimal Setup Explained
#44Since I was in university 15 years ago I promised myself to learn Vim commands seriously. Well I see that finally I did my programmer life learning only switching insert mode / edit mode, maybe 5 commands like A x etc...,and :q or :wq!
I relate quite heavily to this when using vi to do all my git-related activities. git rebase -i ... followed by ↓dw ↓←dw ↓←dw ↓←dw ↓←dw ↓←dw i s ↓s ↓s ↓s ↓s ↓s because I keep forgetting :s/pick/s/g is a thing i, a, :q, :wq, dd, xdd, and D are all the ones I remember, but cutting/yanking pasting is still something I don't have the muscle memory for. Shift+G takes me to the bottom of a file, but I don't know how to get…
I know the complement to Shift+G, it's gg. But I can never remember which one goes to the top and which to the bottom, so half the time I press both. :)
Re: Vim – Minimal Setup Explained
#45Since I was in university 15 years ago I promised myself to learn Vim commands seriously. Well I see that finally I did my programmer life learning only switching insert mode / edit mode, maybe 5 commands like A x etc...,and :q or :wq!
Please learn dot ".". It repeats the last edit action. It's so powerful.
Re: Vim – Minimal Setup Explained
#46While the information in there is good, a bunch of the settings are now redundant¹. The ones that jumped out to me were esckeys, ruler and showcmd. Not that I'm saying you can't — or shouldn't — re-set options, just that the linked documentation is a little dated. FWIW, I personally re-set a couple of default options mostly so that I have a point of reference for how an option works when I'm digging about in my confi…
The least desirable property of defaults.vim is also present in sensible or in system-wide vimrcs written by package maintainers: you get a black box where things are added/changed/removed without your knowledge or consent. "Your" so-called minimal setup is going to evolve over time, but not according to "your" needs.
We got so many support request related to that silly mechanism that's not even funny.
Re: Vim – Minimal Setup Explained
#47See also `:h defaults.vim-explained` ( https://vimhelp.org/usr_05.txt.html#05.3 ) which now comes by default. You can either copy the settings you are interested in or source it entirely in your vimrc file: source $VIMRUNTIME/defaults.vim --- Here's some more related resource links: * stackoverflow: useful .vimrc tips - ( https://stackoverflow.com/q/164847/4082052 ) * vi.stackexchange: How do I debug my vimrc file? -…
Re: Vim – Minimal Setup Explained
#48Question for Vim users: how do you get used to hitting Esc very often? I know some switch Cap with Esc but still clunky.
On other keyboards I find fishing for the Esc key with the left ring or sometimes even middle finger good enough since it's so prominently singled out on the top left corner on all the keyboards I had yet to use, but it breaks the flow a bit more.
It probably helps that I'm not typing in proper form for the 10-finger system but only some hodgepodge approximation of it...
Re: Vim – Minimal Setup Explained
#49Earlier quoted context omitted.
Please learn dot ".". It repeats the last edit action. It's so powerful.
I use macros way more often than dot. With a macro I can include the movement action of getting to the correct position before the edit takes place, I'm not sure if this can be done with the dot key alone.
Re: Vim – Minimal Setup Explained
#50I just really really wish my minimal comfortable setup would not need to include
set mouse=
on all "newer" machines/vim versions :-\