let s:rules = [] let s:rules += [ \ {'char': '', 'at': '"""\%#"""', 'input': '', 'input_after': '', }, \ {'char': '', 'at': '<\%#>', 'input': '', 'delete': 1, }, \ ] "" ruby let s:rules += [ \ {'filetype': 'ruby', 'char': '', 'at': '\(do\|{\)\s*\%#', 'input': '', 'input_after': '', }, \ {'filetype': 'ruby', 'char': '', 'at': '|\%#|', 'input': '', 'delete': 1, }, \ ] "" markdown let s:rules += [ \ {'filetype': 'markdown', 'char': '', 'at': '```\w*\%#```', 'input': '', 'input_after': ''}, \ {'filetype': 'markdown', 'char': '#', 'at': '^\%#', 'input': '#',}, \ {'filetype': 'markdown', 'char': '#', 'at': '^#\+\s\%#', 'input': '#',}, \ {'filetype': 'markdown', 'char': '', 'at': '^#\s\%#', 'input': '',}, \ {'filetype': 'markdown', 'char': '', 'at': '^#\{2,}\s\%#', 'input': '',}, \ {'filetype': 'markdown', 'char': '', 'at': '^\s*-\s\w.*\%#', 'input': '-',}, \ ] "" vim let s:rules += [ \ {'filetype': 'vim', 'char': '', 'at': '[\[{]\s\?\%#[\]}]$', 'input': '\', 'input_after': '\',}, \ {'filetype': 'vim', 'char': '', 'at': '^\s*\\.\+\%#', 'input': '\',}, \ ] "" shell let s:rules += [ \ {'filetype': ['sh', 'zsh', 'bash', 'fish'], 'char': '[', 'at': 'if\s\%#', 'input': '[', 'input_after': ']',}, \ {'filetype': ['sh', 'zsh', 'bash'], 'char': '[', 'at': 'if\s[\s\%#', 'input': '[', 'input_after': ']', 'delete': 1,}, \ {'filetype': ['sh', 'zsh', 'bash'], 'char': '', 'at': '^\s*if\%#', 'input': '', 'input_after': ';then',}, \ ] "" fish let s:rules += [ \ {'filetype': 'fish', 'char': '', 'at': '\s*if.*\%#', 'input': '', 'input_after': 'end'}, \ ] "" Python let s:rules += [ \ {'filetype': 'python', 'char': '%', 'at': '^#\s%\%#', 'input_after': '# %%',}, \ ] "" HTML let s:rules += [ \ { 'filetype': ['html', 'htmldjango'], 'char': '%', 'at': '{\%#}', 'input': '%', 'input_after': '%',}, \ { 'filetype': ['html', 'htmldjango', 'vue'], 'char': '', 'at': '>\%#<', 'input': '', 'input_after': '',}, \ ] "" latex let s:rules += [ \ { 'filetype': ['tex', 'plaintex'], 'char': '$', 'at': '[^\$]*\%#', 'input': '$', 'input_after': '$', }, \ { 'filetype': ['tex', 'plaintex'], 'char': '$', 'at': '\$\%#\$', 'input': '$', 'input_after': '$', 'priority': 10 }, \ { 'filetype': ['tex', 'plaintex'], 'char': '', 'at': '\$\%#\$', 'input': '', 'delete': 1, }, \ { 'filetype': ['tex', 'plaintex'], 'char': '', 'at': '^\s*\\item\s.\+\%#$', 'input': '\item ', }, \ { 'filetype': ['tex', 'plaintex'], 'char': '', 'at': '\\begin{\(\w\+\*\?\)}\%#$', 'input': '', 'input_after': '\\end{\1}', 'with_submatch': v:true }, \ ] for s:rule in s:rules call lexima#add_rule(s:rule) endfor