From 3340b11176d467961ae8426091d53c6ad1a01d2c Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 4 Aug 2022 13:16:12 -0600 Subject: Add Fall.vim --- plugin/fall.vim | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 plugin/fall.vim (limited to 'plugin') diff --git a/plugin/fall.vim b/plugin/fall.vim new file mode 100644 index 0000000..3fba6d5 --- /dev/null +++ b/plugin/fall.vim @@ -0,0 +1,26 @@ +" Fall through whitespace. +noremap k fall#fall('k', '^\s*$') +noremap j fall#fall('j', '^\s*$') + +" Text object to fall through whitepacea +onoremap k :exec "normal! V" . fall#fall('k', '^\s*$') +onoremap j :exec "normal! V" . fall#fall('j', '^\s*$') + +" Text object to fall though whitespace, but exclude the last line. +onoremap ik :exec "normal! V" . fall#fall('k', '^\s*$') . "j" +onoremap ij :exec "normal! V" . fall#fall('j', '^\s*$') . "k" + +" Text object to fall though whitespace, but exclude the last line. +onoremap ik :exec "normal! V" . fall#fall('k', '^\s*$') . "j" +onoremap ij :exec "normal! V" . fall#fall('j', '^\s*$') . "k" + +" Text objects to describe "falling" down, and then "falling" up. Equivalent to +" VkOj +onoremap ai :exec "normal! V" + \ . fall#fall('j', '^\s*$') + \ . "O" + \ . fall#fall('k', '^\s*$') +onoremap ii :exec "normal! V" + \ . fall#fall('j', '^\s*$') + \ . "kO" + \ . fall#fall('k', '^\s*$') . 'j' -- cgit