:help section
states:
The "]" and "[" commands stop at the '{' or '}' in the first column. This is useful to find the start or end of a function in a C program.
Is it possible to change the [
and ]
commands to jump to a different character or pattern. For example in Markdown, I would like sections defined as titles, lines beginning with #
aka the pattern ^#
. Similarly in Haskell, I would like it to jump to the next/previous type definition (line containing ::
). Both would be set in their respective ftplugin
files.
I have tried using map ]] /^#<CR>w
but this does not seem to work as expected and leaves text highlighted. It seems like there would be a better way to achieve this.
Is this possible and if so, how would I achieve this?