" Klammertext filetype plugin: comment format, the structural commands, and " (when Vim has +python3) fast in-process indentation and live delimiter " match highlighting. The implementations are in autoload/klammertext.vim; " the algorithms themselves are the shared Python core " (klammertext_edit.py — see doc/edit/README.md for how it is located). " " Commands (buffer-local): " :[range]KlammertextReindent reindent the range (default: whole buffer) " :KlammertextAlign align the @table enclosing the cursor " :KlammertextJumpToMatch jump between a klammer application's " opening and closing delimiter " :KlammertextCheck unbalanced/mismatched delimiters -> the " location list " " Default mappings (set g:klammertext_no_mappings to define none): " i reindent the current line (visual: the selection) " a align the enclosing table " j jump to the matching delimiter " " Reindentation is EXPLICIT-ONLY: whitespace is content in Klammertext, so " indentkeys is emptied and nothing reformats as a side effect of typing. " With +python3 the ftplugin also sets 'indentexpr', so the = operator " (e.g. ==, gg=G) reindents through the same shared implementation. if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 setlocal commentstring=#\ %s setlocal comments=b:# setlocal indentkeys= command! -buffer -range=% KlammertextReindent \ call klammertext#Reindent(, ) command! -buffer KlammertextAlign call klammertext#AlignTable() command! -buffer KlammertextJumpToMatch call klammertext#JumpToMatch() command! -buffer KlammertextCheck call klammertext#Check() if !exists("g:klammertext_no_mappings") nnoremap i :.KlammertextReindent xnoremap i :KlammertextReindent nnoremap a :KlammertextAlign nnoremap j :KlammertextJumpToMatch endif let b:undo_ftplugin = "setlocal commentstring< comments< indentkeys<" \ . " | delcommand KlammertextReindent" \ . " | delcommand KlammertextAlign" \ . " | delcommand KlammertextJumpToMatch" \ . " | delcommand KlammertextCheck" " With +python3 the shared core runs in-process: 'indentexpr' makes the = " operator work, and the matching delimiter is highlighted live as the " cursor sits on one (the show-paren equivalent; a mismatch shows in red " with a message). Without +python3 the commands above still work — they " shell out to python3 — and Neovim users can get live matching from the " language server instead (see doc/edit/README.md). if has('python3') setlocal indentexpr=klammertext#IndentExpr() let b:undo_ftplugin .= " | setlocal indentexpr<" call klammertext#SetupMatchHighlight() endif