From b70d6aed7adcd90a0321d9604060672eaa1c7fe8 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 12 Jul 2025 23:13:54 +0100 Subject: [PATCH] Using Vim filters --- source/_zets/31.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 source/_zets/31.md diff --git a/source/_zets/31.md b/source/_zets/31.md new file mode 100644 index 000000000..ab7196de8 --- /dev/null +++ b/source/_zets/31.md @@ -0,0 +1,16 @@ +--- +title: Using Vim filters +date: 2025-07-12 23:13:54 +tags: + - vim +--- + +In Vim, insert some text into a file, such as `date`. + +In insert mode, press `!!` to switch to command mode and see a `:.!` prompt. + +Enter a command, like `bash` to execute on the given text. + +The text is replaced with the result from the command - `Sat Jul 12 23:16:29 BST 2025`. + +This also works for other commands, such as typing `1+2+3` and running `:.!bc` will return 6.