-
Notifications
You must be signed in to change notification settings - Fork 786
HTML editing
Jan-Jaap Korpershoek edited this page Nov 12, 2020
·
7 revisions
Based on https://github.com/JJK96/kakoune-config/blob/master/autoload/html.kak
define-command -hidden html-auto-close-tag %{
evaluate-commands -draft -itersel -save-regs '"^' %{
try %{
# Check if last entered characters are ""
execute-keys -draft hH
# Get tag
execute-keys -save-regs '' Z[
execute-keys -with-maps t
execute-keys -save-regs '' ey
# Paste tag
execute-keys -save-regs '' zh
# Close tag
execute-keys -with-hooks a
}
}
}
hook global WinSetOption filetype=(xml|html|php) %{
# Credits to mawww for this mapping
map -docstring "xml tag object" global object t %{c([\w.]+)\b[^>]*?(?!/)>,/([\w.]+)\b[^>]*?(?!/)>}
hook window InsertChar '/' html-auto-close-tag
}
- Normal mode commands
- Avoid the escape key
- Implementing user mode (Leader key)
- Kakoune explain
- Kakoune TV
