Skip to content

Instantly share code, notes, and snippets.

@veirus
Created May 13, 2018 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veirus/c55064f18f5438fc805d75aa8fc448ba to your computer and use it in GitHub Desktop.
Save veirus/c55064f18f5438fc805d75aa8fc448ba to your computer and use it in GitHub Desktop.
Simple mapping to quickly insert default fold marker
nnoremap <expr> <leader><Tab> getline('.') =~ "\"" ? "m1A {{{1<Esc>`1" : "m1A \" {{{1<Esc>`1"
nnoremap <expr> <leader>1<Tab> getline('.') =~ "\"" ? "m2A }}}1<Esc>`2" : "m1A \" }}}1<Esc>`2"
inoremap <expr> <localleader><Tab> getline('.') =~ "\"" ? "<Esc>m1A {{{1<C-o>`1" : "<Esc>m1A\" {{{1<C-o>`1"
inoremap <expr> <localleader>1<Tab> getline('.') =~ "\"" ? "<Esc>m2A }}}1<C-o>`2" : "<Esc>m2A\" }}}1<C-o>`2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment