Sujet : Re: Système D
De : candycanearter07 (at) *nospam* candycanearter07.nomail.afraid (candycanearter07)
Groupes : comp.os.linux.advocacyDate : 24. Apr 2024, 05:00:01
Autres entêtes
Organisation : the-candyden-of-code
Message-ID : <v09sjh$23fuq$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : slrn/pre1.0.4-9 (Linux)
rbowman <
bowman@montana.com> wrote at 02:32 this Wednesday (GMT):
On Tue, 23 Apr 2024 21:32:50 -0000 (UTC), candycanearter07 wrote:
>
rbowman <bowman@montana.com> wrote at 21:26 this Tuesday (GMT):
On Tue, 23 Apr 2024 21:20:06 -0000 (UTC), candycanearter07 wrote:
>
I thought the paste key was p?
>
'.' repeats the last action so if you go into insert, add ' ha', and
exit insert mode '.' will insert ' ha'. 'p' inserts whatever is in
the default buffer.
Interesting, I didn't know that.
>
It can be handy. Suppose you want to change 'some_word' to 'some_phrase'
but not in every case and you don't want to change just 'word'
>
/word
>
will find all instances of 'word'. When you come to a 'some_word' that you
want to change, 'cw', edit it to 'phrase' and hit Esc to go back to
command mode. 'n' will take you to the next instance of 'word'. When you
get to a 'some_word' that you want to change, the cursor will be on 'w'.
'.' will repeat the 'cw' and replace 'word' with phrase.
>
This is sort of a contrived example but it's very useful to replay the
last command selectively where %s/_word/_phrase/g would change
everything.
Neat! I probably won't remember this, but maybe I'll write it down. Vim
has so much that it feels a bit overwhelming ^^.
Like everything else vim has a lot of tricks, a subset of which I use
frequently and some of which I'm completely ignorant about or have to look
up. There's usually different ways to skin the cat too and all the macros
you can set up in .vimrc or .gvimrc.
I don't set up a .vimrc, I know I'll fall into a rabbit hole and keep
tweaking it for hours.
-- user <candycane> is generated from /dev/urandom