Post AbAeVuObdVIeHCKnoW by stardot@mastodon.me.uk
(DIR) More posts by stardot@mastodon.me.uk
(DIR) Post #AbAMgPjeApGfC82IEa by b0rk@social.jvns.ca
2023-10-26T14:26:17Z
0 likes, 0 repeats
did a fun exercise with a vim-using friend where we went through the alphabet (abcdefghijklmnopqrstuvwxyz.'@^$%”) and compared which vim commands each of usethese were my results, unsurprisingly each of us had a slightly different set of commands we use and both of us learned some new tricks
(DIR) Post #AbAMgRD6gmQXlmpKnA by pelavarre@social.vivaldi.net
2023-10-26T14:51:05Z
0 likes, 0 repeats
@b0rk oh wowhow do you live still now without f F t T ?do you mouse a lot ?and what do you do in place of Z Q and Z Z ?but aye studying what they made easy quick to type reveals what they felt must be easy quick to sayas i rewrite Vi as Python on GitHub, i study the shift keys as well, so above we’re talking of F ⇧F T ⇧T ⇧Z⇧Q ⇧Z⇧Zi hope you’ve made friends with the three chord sequence Q Q @Q⌃L and ⌃G and ⌃V matter early in the Normal/View Mode, and ⌃V again while Insert/ Replacei want to see your Vi Zine : -)
(DIR) Post #AbAMgT5jh9ifbVOTa4 by penguin42@mastodon.org.uk
2023-10-26T15:31:44Z
0 likes, 0 repeats
@pelavarre @b0rk I think everyone uses vi(m) differently :-) While I do use fFtT a bit, not that often. and I'm a :wq! rather than a Zer. What do the Q's and ^L, ^G and ^V do ?
(DIR) Post #AbAQdmkMYo8fVmNAwa by pelavarre@social.vivaldi.net
2023-10-26T16:16:00Z
0 likes, 0 repeats
@penguin42 @b0rk > everyone differentaye many fashions, while not infinitely many - Julia Evans can zine this sceneVi D T is huge for me, it’s ⌥Z in Emacs & Zsh zap-to-charVi Q is its record/ replay toggle@ Q then replays once5 @ Q replays five timeslike if you record Q 0 I A B C Esc J then repeating it will insert “abc” at left of each Line, and proceed to next LineVi Macro writing is an art - a good strong pattern in it is this style of init, then do, then next ⌃G updates Status with many details⌃L repairs Screen after damage, such as Ssh interpreting Return ~ ?that Return ~ ? test works only inside Vi inside Ssh at Lines that are empty or don’t begin with white space ⌃V from Normal/View edits Screen as 2D not 1D - me i only memorise its ⇧… Esc Esc for inserting same across many Linrs and its ⇧X to cut and ⇧P to paste⌃V Tab from Insert/Replace is how i force a b"\x09" Hard Tab in place of more ordinary b”\x20" Spaces
(DIR) Post #AbARQ2G0CFeBW3BB0y by pelavarre@social.vivaldi.net
2023-10-26T16:24:47Z
0 likes, 0 repeats
@penguin42 @b0rk > i'm a :wq! rather than a Zerme likewise, i was team ⌃L : Q ! for years, but i took Windows work for hire 2008..2015when i came back to macOS Terminal Sh, i studied the Vi keyboard like Julia Evans above then i could feel it talkingit says oh i should come learn ⇧Z ⇧Qso then i didp.s.the ⌃L in this is only needed when you play around with: vim -ywhich i guess practically nobody does? that obscure standard mode blocks Esc and ⌃C from exiting Insert/Replace Mode, so then you have to resort to ⌃L ⇧Z ⇧Q or ⌃O ⇧Z ⇧Q or ⌃O : Q ! or whatever
(DIR) Post #AbAVwBU3pKFTDQL9qi by penguin42@mastodon.org.uk
2023-10-26T17:15:26Z
0 likes, 0 repeats
@pelavarre @b0rk Ah yes, macro writing; I've not used Q though (I think mostly because I'm old school vi rather than vim at heart), I tend to hand write them. I knew ^G and ^L, although never hit the sshism you refer to, how do you run into it?Ah, and yes, I should learn the ^V mode stuff.
(DIR) Post #AbAWGiLZLuqmvj9qqm by b0rk@social.jvns.ca
2023-10-26T17:16:37Z
0 likes, 0 repeats
@penguin42 TIL you can hand write a macro
(DIR) Post #AbAXgm5OAo900fa1fU by penguin42@mastodon.org.uk
2023-10-26T17:35:03Z
0 likes, 0 repeats
@b0rk Sure you can, you can load a string of characters into a register by using Y or similar, and then execute them using @.e.g. in an empty buffer insert iabcd^vescapethen do "a^y$ to yank that line into the 'a' register.Then you can do @a to insert abcd, or repeat it with @@
(DIR) Post #AbAb9gfZgpydTIz3uC by b0rk@social.jvns.ca
2023-10-26T17:37:36Z
0 likes, 0 repeats
@penguin42 very cool thanks!
(DIR) Post #AbAbXe7wnI28XKgBnc by stardot@mastodon.me.uk
2023-10-26T18:18:12Z
0 likes, 0 repeats
@penguin42 @b0rk as a very casual vim user I think this is how people with a bit of English feel when faced with broad Scots
(DIR) Post #AbAeAB96gBXPr3iu92 by penguin42@mastodon.org.uk
2023-10-26T18:47:37Z
0 likes, 0 repeats
@stardot @b0rk In which case, I think the following (in a commit message of a patch I'm working on) is probably something like broad scouse: into register A put: :+2,+2s/const_cast<SvxMSDffVertPair\*>[(]\([^)]*\)[)],.*/o3tl::span<const SvxMSDffVertPair>(\1),/ and do: :%g/^const mso_C.*=/@a
(DIR) Post #AbAeVuObdVIeHCKnoW by stardot@mastodon.me.uk
2023-10-26T18:51:31Z
0 likes, 0 repeats
@penguin42 @b0rk my wife and her family are Scouse so this looks accurate to me
(DIR) Post #AbAf6qybJQloNymsqm by penguin42@mastodon.org.uk
2023-10-26T18:58:13Z
0 likes, 0 repeats
@stardot @b0rk So anyway, that was solving a problem for me where I wanted to do a search and replace (which I put in register A) on 2 lines everywhere after I found another pattern (which I passed to %g)
(DIR) Post #AbAfydpiOYGFGBHNVw by stardot@mastodon.me.uk
2023-10-26T19:07:55Z
0 likes, 0 repeats
@penguin42 @b0rk is this something you do so often that having a vim macro makes sense over using awk or something that might make it look less like my cat coded it while begging for supper?
(DIR) Post #AbAl1l3mTvNSJUAE8e by penguin42@mastodon.org.uk
2023-10-26T20:04:33Z
0 likes, 0 repeats
@stardot @b0rk I'm not sure it would be that less nauseous with awk; this was a one-off to fix up some code; the tricky part is the search/replace being on a a different line to the original search which I don't think is easy in awk either. Most of the mess is the escaping of the search term in the :s which I suspect you'd need in awk as well.
(DIR) Post #AbBVCZWuHqVJd6sjse by pelavarre@social.vivaldi.net
2023-10-27T04:41:54Z
0 likes, 0 repeats
@penguin42 > the sshismSsh defaults to take the ~ after a Return to itselfyou can see the slow echo in Bash if you press Return and then make your next line begin with the two keychords ~/likewise in Vimthe three keychordsReturn ~ ?they definitely work if you start above a blank line or a line that doesn’t begin with an indent - i retested this today morning in a macOS Terminal Ssh to Linux Vimaybe they work more often than that and i’ve forgottenwhen they work they splash Ssh Help Lines all over the Screenhave you got it repro’ing for you now?then you need Vi ⌃L
(DIR) Post #AbC2I1mvwlOdCuaUG8 by penguin42@mastodon.org.uk
2023-10-27T10:52:39Z
0 likes, 0 repeats
@pelavarre yes I can reproduce it, I'm curious though when you found yourself typing that sequence accidentally.
(DIR) Post #AbCMXmfTvfhc1stOPA by pelavarre@social.vivaldi.net
2023-10-27T14:39:33Z
0 likes, 0 repeats
@penguin42 > Ssh defaults to take the ~ after a Return to itself> > the sshism> > when you found yourself typing that sequence accidentallycd ~/repo2/~/repo1/bin/tool $PWDthe 3 chords of: Return ~ /come to me naturally when i speak the name of a File found from Home as a Sh Command Verbthey come more often when i reconfigure Sh to stop making me type the nearly worthless "cd " part of that dialog~/repo2/~/repo1/bin/tool $PWDbut these Return ~ only show me the slow Echo, not the wrong Echo> > the sshism> > when you found yourselfthe louder disruption of Return ~ ? maybe i have only ever seen on purpose?another context in which i've needed Vi ⌃L is the Sh Command Line of wall their surprise inspection is starting nowbut i've not much shared a single machine with other living people since like forty years agoVi ⌃L never does much more for me than ⇧Z⇧Z to save-and-quit, and then relaunching Vi would do for meVi ⌃L does help me quit: vim -yTerminal Screens do sometimes just not work right, i do see failures i can't repro reliably> > the sshism> > when you found yourselfi fear i keep on missing what question we're asking?