From 68eb372ca10dc82883682019f202a453b77b992d Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Wed, 9 Aug 2023 16:53:49 +0700 Subject: [PATCH] feat: add vim tricks --- docs/2023-05-03-neovim.html | 6 ++++++ posts/2023-05-03-neovim.md | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/docs/2023-05-03-neovim.html b/docs/2023-05-03-neovim.html index 217bd20..dbdfddf 100644 --- a/docs/2023-05-03-neovim.html +++ b/docs/2023-05-03-neovim.html @@ -74,6 +74,12 @@
:g/word/d
+

Delete all lines not contain word:

+
+
:g!/word/d
+
+:v/word/d
+

Sort lines (after selecting lines):

:sort -u
diff --git a/posts/2023-05-03-neovim.md b/posts/2023-05-03-neovim.md index 06df19f..d272279 100644 --- a/posts/2023-05-03-neovim.md +++ b/posts/2023-05-03-neovim.md @@ -26,6 +26,14 @@ Delete all lines contain word: :g/word/d ``` +Delete all lines **not** contain word: + +```vim +:g!/word/d + +:v/word/d +``` + Sort lines (after selecting lines): ```vim