fortunes_movement : Movement over email fortunes with ]] etc.
| script karma
Downloaded by 447
Comments, bugs, improvements
script versions (upload new version)
This filetype plugin provides movement commands and text objects for email
fortunes, i.e. blocks of text delimited by /^-- \?$/.
Move around fortunes:
]] Go to [count] next start of a fortune.
][ Go to [count] next end of a fortune.
[[ Go to [count] previous start of a fortune.
 Go to [count] previous end of a fortune.
if "inner fortune" text object, select [count] fortunes,
excluding the fortune separator.
af "a fortune" text object, select [count] fortunes, including
the preceding fortune separator.
This script is packaged as a vimball. If you have the "gunzip" decompressor
in your PATH, simply edit the *.vba.gz package in Vim; otherwise, decompress
the archive first, e.g. using WinZip. Inside Vim, install by sourcing the
vimball or via the :UseVimball command.
To uninstall, use the :RmVimball command.
- Requires Vim 7.0 or higher.
- Requires the CountJump plugin (vimscript #3130), version 1.30.
The commands and text objects are only active when 'filetype' is set to
You need to make sure that the filetype is properly detected, for example via
the following fragment in .vim/filetype.vim:
" Fortunes files.
autocmd BufNewFile,BufRead fortunes.txt,*/fortunes/*.txt setf fortunes
or manually set the filetype every time via
If you want to use this plugin also for other filetypes, e.g. "txt", create a
file ftplugin/txt_movement.vim in your 'runtimepath' (usually ~/.vim) with the
This is more maintainable than simply renaming fortunes_movement.vim.
Click on the package to download.
ip used for rating: 18.104.22.168
||Switched definition of motion mappings from patterns to begin and end to a region of continguous lines defined by a non-matching pattern (representing the fortune separator line). This should make it more correct with corner cases. Requires CountJump version 1.30.