declare-user-mode fmt
map global user 'F' ': enter-user-mode<space>fmt<ret>' -docstring "fmt - simple optimal text formatter"
map global fmt 'a' '| fmt --split-only --uniform-spacing --width=102<ret>' -docstring "fmt - '\h' whitespace selection"
map global fmt 'b' '| fmt --prefix="#" --split-only --uniform-spacing --width=102<ret>' -docstring "fmt - '#' prefixed selection"
map global fmt 'c' '| fmt --prefix="*" --split-only --uniform-spacing --width=102<ret>' -docstring "fmt - '*' prefixed selection"
map global fmt 'd' '| fmt --prefix="/*" --split-only --uniform-spacing --width=102<ret>' -docstring "fmt - '/*' prefixed selection"
map global fmt 'e' '| fmt --prefix="/**" --split-only --uniform-spacing --width=102<ret>' -docstring "fmt - '/**' prefixed selection"
map global fmt 'f' '| fmt --prefix="//" --split-only --uniform-spacing --width=102<ret>' -docstring "fmt - '//' prefixed selection"
You’ll make it work the way you wan’t:
- GNU 2020, ‘4.1 fmt: Reformat paragraph text’, Coreutils - GNU core utilities manual, viewed 11 April 2021, https://www.gnu.org/software/coreutils/manual/html_node/fmt-invocation.html#fmt-invocation
And support a local:
- Merejkowsky, D 2020, ‘dmft: format paragraphs, comments and doc strings’, dmerejkowsky, viewed 11 April 2021, https://github.com/dmerejkowsky/dfmt
- @dmerejkowsky discuss.kakoune post Smarter replacement for coreutils' fmt
Go get some. Bye .