Vim regex for search and replace cheat scrot

Folks, doncha just hate it when you have to fire up firefox and its quarter-pounder-with-cheese bloat just to see some small reference on a complex search/replace you want to do with vim? I do.

Here is a screenshot that captures just what I need. sxiv it w/ a shortcut, and you don’t need firefox during those long vim sessions (you do need coffee/tea/beer/wine, pl. don’t forego that).

Thanks, and love y’all at AL. Live free!


Nice work @vinay

Could also do

:h pattern-overview

vim provides it’s own great docs after all

1 Like

Yes, totally. I prefer (at times) to have a separate picture or something explaining that way my vim is not affected (usually the s/r I am doing is on many lines that span a page, so if I :h it cuts into that; that’s why prefer to have this sheet either printed out somewhere, or as a sxiv on some other screen; also don’t mind the html rendering over pure text)… Both are fine though:-) Whatever is useful…

Hey, is this OK:

(it says 2 likes, but only one heart). Isn’t like == heart?

I hope if anyone on this forum is in Vienna, they are doing OK. Scary stuff going on there …

You’re title post’s likes are counted separate from the amount of likes in the thread overall.

Ahh… I see. Thanks for the clarification.

Hey @natemaia I have been having difficulty getting the history based zsh completion working. meaning, say I type “systemc” and then up/down arrow key, I would like it to complete to various systemctl (for ex) commands.

This is not out of the box in AL config’d zsh, right? Should it be? I have the 2019/5 AL download.

Not sure but you can add this to your zshrc

autoload -U terminfo     # terminfo keys
autoload -U up-line-or-beginning-search; zle -N up-line-or-beginning-search
autoload -U down-line-or-beginning-search; zle -N down-line-or-beginning-search

[[ -n ${terminfo[kcuu1]} ]] && bindkey -- "${terminfo[kcuu1]}" up-line-or-beginning-search   # up arrow
[[ -n ${terminfo[kcud1]} ]] && bindkey -- "${terminfo[kcud1]}" down-line-or-beginning-search # down arrow

This is using built-in stuff but there are fancy plugins that do a bit more work, the former is enough for me.

1 Like

Thanks man! It works fine.