Compare commits

...

3 Commits

Author SHA1 Message Date
3b04aaf8be
add string substitution 2025-05-06 16:41:57 +02:00
1dfdac516b
add basic vim requirements to vim 2025-04-30 15:39:11 +02:00
63e4c409bb
fix missing links 2025-04-30 15:39:05 +02:00
9 changed files with 30 additions and 6 deletions

View File

@ -142,4 +142,3 @@ You can ensure omemo automatcally turns on:
``` ```
--- ---
'OTR' encryption is mostly dead, but you can find the old instructions [here](profanity-otr).

View File

@ -0,0 +1,19 @@
---
title: "Interactive String Substitution"
tags: [ "data", "vim", "substitution" ]
---
Want to find and replace, but also confirm each instance?
```sh
vim -c "%s/${pattern}/${replacement}/gc" -c 'wq' ${file}
```
Notice that double-quotes (`"`) in the first command (`-c`).
Alternatively, check with an example string:
```sh
sed "s/${pattern}/ARGLEBARGLE/g" ${file} | grep 'ARGLEBARGLE'
```

View File

@ -57,5 +57,5 @@ brightnessctl s 10%+
- [autologin](autologin.md) - [autologin](autologin.md)
- [services](sv.md) - [services](sv.md)
- [wifi](wpa_cli.md) - [wifi](../../networking/wpa_supplicant.md)

View File

@ -10,7 +10,8 @@ tags: [ "vim", "basic" ]
## Extras ## Extras
- [Navigation](navigate.md) - [Navigation](vim/navigate.md)
- [Completion](vim-completion.md) - [Completion](vim/completion.md)
- [Search](vim-search.md) - [Search](vim/search.md)
- [Window Splits](vim-windows.md) - [Window Splits](vim/windows.md)
- [Use vim bindings in bash](vim/vim_in_bash.md)

View File

@ -1,6 +1,7 @@
--- ---
title: "vim completion" title: "vim completion"
tags: [ "vim", "completion" ] tags: [ "vim", "completion" ]
requires: [ "vim basics" ]
--- ---
Complete the word by searching for the *n*ext similar word: Complete the word by searching for the *n*ext similar word:

View File

@ -1,6 +1,7 @@
--- ---
title: "vim navigation" title: "vim navigation"
tags: [ "vim", "navigation" ] tags: [ "vim", "navigation" ]
requires: [ "vim basics" ]
--- ---
| Move | Command | | Move | Command |

View File

@ -1,6 +1,7 @@
--- ---
title: "vim search" title: "vim search"
tags: [ "vim", "search" ] tags: [ "vim", "search" ]
requires: [ "vim basics" ]
--- ---
Search for the next and or previous occurrence of the word under your cursor with `*` and `#`. Search for the next and or previous occurrence of the word under your cursor with `*` and `#`.

View File

@ -1,6 +1,7 @@
--- ---
title: "vim in bash" title: "vim in bash"
tags: [ "vim", "bash", "inputrc" ] tags: [ "vim", "bash", "inputrc" ]
requires: [ "vim basics" ]
--- ---
Put bash in vim mode! Put bash in vim mode!

View File

@ -1,6 +1,7 @@
--- ---
title: "vim windows" title: "vim windows"
tags: [ "vim" ] tags: [ "vim" ]
requires: [ "vim basics" ]
--- ---
| Command | Keys | | Command | Keys |