feat: add vim tricks

main
sudo pacman -Syu 2023-08-09 16:53:49 +07:00
parent ba13f993b7
commit 68eb372ca1
2 changed files with 14 additions and 0 deletions

View File

@ -74,6 +74,12 @@
<div class="highlight highlight-source-viml"> <div class="highlight highlight-source-viml">
<pre>:<span class="pl-c1">g</span><span class="pl-sr">/word/</span><span class="pl-c1">d</span></pre> <pre>:<span class="pl-c1">g</span><span class="pl-sr">/word/</span><span class="pl-c1">d</span></pre>
</div> </div>
<p>Delete all lines <strong>not</strong> contain word:</p>
<div class="highlight highlight-source-viml">
<pre>:<span class="pl-c1">g</span><span class="pl-k">!</span><span class="pl-sr">/word/</span><span class="pl-c1">d</span>
:<span class="pl-c1">v</span><span class="pl-sr">/word/</span><span class="pl-c1">d</span></pre>
</div>
<p>Sort lines (after selecting lines):</p> <p>Sort lines (after selecting lines):</p>
<div class="highlight highlight-source-viml"> <div class="highlight highlight-source-viml">
<pre>:<span class="pl-c1">sort</span> <span class="pl-k">-</span><span class="pl-c1">u</span></pre> <pre>:<span class="pl-c1">sort</span> <span class="pl-k">-</span><span class="pl-c1">u</span></pre>

View File

@ -26,6 +26,14 @@ Delete all lines contain word:
:g/word/d :g/word/d
``` ```
Delete all lines **not** contain word:
```vim
:g!/word/d
:v/word/d
```
Sort lines (after selecting lines): Sort lines (after selecting lines):
```vim ```vim