You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

491 lines
19 KiB

"==plugins-start
""""""""""""""""""""""""""""
" => Plug
""""""""""""""""""""""""""""
call plug#begin('$HOME/.vim/plugged-remote')
Plug 'https://github.com/JuliaEditorSupport/julia-vim'
Plug 'https://github.com/airblade/vim-gitgutter'
Plug 'https://github.com/glts/vim-textobj-comment'
Plug 'https://github.com/itchyny/lightline.vim'
Plug 'https://github.com/junegunn/fzf.vim'
Plug 'https://github.com/junegunn/goyo.vim'
Plug 'https://github.com/kana/vim-textobj-indent'
Plug 'https://github.com/kana/vim-textobj-line'
Plug 'https://github.com/kana/vim-textobj-user'
Plug 'https://github.com/machakann/vim-sandwich'
Plug 'https://github.com/tommcdo/vim-lion'
Plug 'https://github.com/tpope/vim-commentary'
Plug 'https://github.com/tpope/vim-fugitive'
Plug 'https://github.com/vim-scripts/ReplaceWithRegister'
call plug#end()
""""""""""""""""""""""""""""
" => Plugins
""""""""""""""""""""""""""""
" FZF
command! -bang -nargs=? -complete=dir Files
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)
map <leader>ff :Files<CR>
map <leader>fm :Marks<CR>
map <leader>fw :Windows<CR>
map <leader>fb :Buffers<CR>
map <leader>fh :History<CR>
map <leader>fg :Tags<CR>
map <leader>ft :BTags<CR>
" goyo
let g:goyo_width=100
let g:goyo_margin_top=2
let g:goyo_margin_bottom=2
nnoremap <silent> <leader>z :Goyo<CR>
" lightline
let g:lightline = {
\ 'colorscheme': 'quantum',
\ 'active': {
\ 'left': [ ['mode', 'paste'],
\ ['fugitive', 'readonly', 'filename', 'modified'] ],
\ 'right': [ [ 'lineinfo' ], ['percent'] ]
\ },
\ 'component': {
\ 'readonly': '%{&filetype=="help"?"":&readonly?"🔒":""}',
\ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}',
\ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'
\ },
\ 'component_visible_condition': {
\ 'readonly': '(&filetype!="help"&& &readonly)',
\ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))',
\ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'
\ },
\ 'separator': { 'left': ' ', 'right': ' ' },
\ 'subseparator': { 'left': ' ', 'right': ' ' }
\ }
" gitgutter
let g:gitgutter_enabled = 0
map <leader>d :GitGutterToggle<CR>
" julia
let g:latex_to_unicode_auto = 1
let g:default_julia_version = "1.0"
"==plugins-end
""""""""""""""""""""""""""""
" => General
""""""""""""""""""""""""""""
" fix vim-plug and vim7 compatibility
let g:plug_threads=1
set scrolloff=7
set fileformats=unix,dos,mac
set path+=**
set spellfile=$HOME/.vim/spell/en.utf-8.add
set thesaurus+=$HOME/.vim/spell/mthesaur.txt
" 1 tab == 2 spaces
set expandtab
set shiftwidth=2
set tabstop=2
set softtabstop=2
" set listchars
set list
set listchars=tab:→\ ,trail,extends:›,precedes:‹,nbsp:␣
" set printoptions
set printoptions=number:y,duplex:off,paper:letter
" language
let $LANG='en'
set langmenu=en
" no backups
set nobackup
set nowritebackup
set noswapfile
" linebreak at 500 characters
set linebreak
set textwidth=80
set wrap
" go to last position on open
augroup startup
autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
augroup END
" persistent undo
try
set undodir=$XDG_CACHE_HOME/undodir
set undofile
catch
endtry
" disable indent on latex files
augroup markup
autocmd FileType tex setlocal indentexpr=
autocmd FileType rmd setlocal indentexpr=
augroup END
" Treat Markdeep .md.html files as markdown
augroup markdeep
autocmd BufNewFile,BufRead *.md.html setlocal filetype=markdown
augroup END
" define leader key
let mapleader = " "
let g:mapleader = " "
""""""""""""""""""""""""""""
" => VIM Interface
""""""""""""""""""""""""""""
set ruler
set number
" set relativenumber
set showbreak=..
set fillchars+=vert:│
set hidden
set lazyredraw
set showmatch
set matchtime=2
set foldmethod=indent
set foldnestmax=10
set nofoldenable
set foldlevel=2
set foldcolumn=2
set conceallevel=0
set wildignore=*.o,*~,*.pyc,*/.gi/*,*/.hg/*,*/.cvn/*,*/.DS_Store
" backspace functionality
set whichwrap+=<,>,h,l
" search
set ignorecase
set smartcase
" no sounds on errors
set noerrorbells
set novisualbell
set t_vb=
set timeoutlen=500
" Colorscheme
colorscheme quantum
" Status line
set noshowmode
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l\ \ Column:\ %c
function! HasPaste() abort
if &paste
return 'PASTE MODE '
endif
return ''
endfunction
" netrw
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_browse_split = 4
let g:netrw_altv = 1
let g:netrw_winsize = 20
map <leader>nn :call ToggleNetrw()<CR>
let g:NetrwIsOpen=0
function! ToggleNetrw() abort
if g:NetrwIsOpen
let i = bufnr("$")
while (i >= 1)
if (getbufvar(i, "&filetype") == "netrw")
silent exe "bwipeout " . i
endif
let i-=1
endwhile
let g:NetrwIsOpen=0
else
let g:NetrwIsOpen=1
silent Vexplore
endif
endfunction
""""""""""""""""""""""""""""
" => Remaps
""""""""""""""""""""""""""""
map 0 ^
map <leader>pp :setlocal paste!<CR>
"" Defining guides
inoremap ,, <esc>/<++><CR>"_c4l
vnoremap <leader><leader> <esc>/<++><CR>"_c4l
map <leader><leader> <esc>/<++><CR>"_c4l
inoremap ;mk <++>
" date and time shortcuts
iabbrev xdate <C-r>=strftime("%m/%d/%y")<CR>
iabbrev fdate <C-r>=strftime("%B %d, %Y")<CR>
iabbrev xtime <C-r>=strftime("%H:%M")<CR>
iabbrev ftime <C-r>=strftime("%H:%M:%S")<CR>
iabbrev dts <C-r>=strftime("%Y/%m/%d %H:%M:%S -")<CR>
" tab goes to last buffer
map <TAB> <C-^>
" control-space for autocomplete
inoremap <C-Space> <C-n>
" insert tab with Shift-Tab
inoremap <S-Tab> <C-V><Tab>
" Map auto complete of (, ", ', [
vnoremap ;( <esc>`>a)<esc>`<i(<esc>
vnoremap ;[ <esc>`>a]<esc>`<i[<esc>
vnoremap ;{ <esc>`>a}<esc>`<i{<esc>
vnoremap ;' <esc>`>a'<esc>`<i'<esc>
vnoremap ;" <esc>`>a"<esc>`<i"<esc>
vnoremap ;` <esc>`>a`<esc>`<i`<esc>
inoremap ;( ()<esc>i
inoremap ;[ []<esc>i
inoremap ;{ {<esc>o}<esc>O
inoremap ;' ''<esc>i
inoremap ;" ""<esc>i
inoremap ;` ``<esc>i
" auto closing tags
inoremap </ </<C-x><C-o><C-n><CR>
" search highlighted in visual mode
vnoremap <silent> * :<C-u>call VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
vnoremap <silent> # :<C-u>call VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>
" disable highlight
map <silent> <CR> :set hlsearch!<CR>
" remap escape
inoremap jf <esc>
inoremap fj <esc>
" spell check
map <leader>ss :setlocal spell! spelllang=en_us<CR>
" better incrementing/decrementing
noremap + <C-a>
noremap - <C-x>
xnoremap + g<C-a>
xnoremap - g<C-x>
" better pane navigation
map <C-h> <C-W>h
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-l> <C-W>l
" tab management
map <leader>tn :tabnew<CR>
map <leader>to :tabonly<CR>
map <leader>tc :tabclose<CR>
map <leader>t<leader> :tabnext<CR>
" go to last tab
let g:lasttab = 1
nmap <leader>tl :exe "tabn ".g:lasttab<CR>
augroup tabs
autocmd TabLeave * let g:lasttab = tabpagenr()
augroup END
" use arrow keys to resize
nnoremap <Up> :resize +5<CR>
nnoremap <Down> :resize -5<CR>
nnoremap <Left> :vertical resize -5<CR>
nnoremap <Right> :vertical resize +5<CR>
" move split to new tab and close tab binding
nmap to :tab sp<CR>
augroup graphviz
autocmd BufNewFile,BufRead *.gv,*.dot inoremap ;ep &epsilon;
augroup END
""""""""""""""""""""""""""""
" => Commands
""""""""""""""""""""""""""""
" commands to retab document to different tab width
command TTF :set ts=2 sts=2 noet | retab! | set ts=4 sts=4 et | retab
command FTT :set ts=4 sts=4 noet | retab! | set ts=2 sts=2 et | retab
command Print :hardcopy > %:p:r.ps | !ps2pdf %:p:r.ps %:p:r.pdf && rm %:p:r.ps
" toggle colorcolumn
let s:activatedcc=0
function! ToggleColorcolumn()
if s:activatedcc == 0
let s:activatedcc=1
match ColorColumn '\%81v'
else
let s:activatedcc=0
match none
endif
endfunction
map <leader>cc :call ToggleColorcolumn()<CR>
" toggle colorcolumn
command! ToggleConceal :let &conceallevel = &conceallevel == '2' ? 0 : 2
map <leader>cl :ToggleConceal<CR>
" sudo save with :W
command W w !sudo tee % > /dev/null
" write tags
command! MakeTags AsyncRun ctags -R .
""""""""""""""""""""""""""""
" => Autocommands
""""""""""""""""""""""""""""
" Auto remove whitespace
augroup whitespace
autocmd BufWritePre * :%s/\s+$//e
augroup END
" Setup documentation
augroup pythonapi
autocmd Filetype python set keywordprg=pydoc
augroup END
augroup groff
autocmd BufRead,BufNewFile *.ms,*.me,*.mom set filetype=groff
augroup END
" Markdown Settings
augroup markup
" set tab to 4
autocmd BufNewFile,BufRead *.md,*.rmd setlocal tabstop=4 shiftwidth=4
" set word wrap
autocmd BufNewFile,BufRead *.md,*.rmd setlocal textwidth=80
" turn on spell check
autocmd BufNewFile,BufRead *.md,*.rmd setlocal spell spelllang=en_us
" enable justify package
autocmd BufNewFile,BufRead *.md,*.rmd packadd justify
augroup END
" => Java
augroup java
autocmd FileType java inoremap <buffer> ;fr for(;<++>;<++>) {<CR><++><CR>}<CR><++><Esc>3k^f;i
autocmd FileType java inoremap <buffer> ;fe for(: <++>) {<CR><++><CR>}<CR><++><Esc>3k^f:i
autocmd FileType java inoremap <buffer> ;wl while() {<CR><++><CR>}<CR><++><Esc>3k^f)i
autocmd FileType java inoremap <buffer> ;dw do {<CR>;<CR>} while (<++>);<CR><++><Esc>2k^xA
autocmd FileType java inoremap <buffer> ;if if() {<CR><++><CR>}<CR><++><Esc>3k^f)i
autocmd FileType java inoremap <buffer> ;ie if() {<CR><++><CR>} else {<CR><++><CR>}<CR><++><Esc>5k^f)i
autocmd FileType java inoremap <buffer> ;ii if() {<CR><++><CR>} else <++><Esc>2k^f)i
autocmd FileType java inoremap <buffer> ;pc public class {<CR><++><CR>}<Esc>2k^f{hi
autocmd FileType java inoremap <buffer> ;cl class {<CR><++><CR>}<Esc>2k^f{hi
autocmd FileType java inoremap <buffer> ;fn public <++>(<++>) {<CR><++><CR>}<CR><++><Esc>3k^fc2li
autocmd FileType java inoremap <buffer> ;pf public <++>(<++>) {<CR><++><CR>}<CR><++><Esc>3k^fc2li
autocmd FileType java inoremap <buffer> ;rf private <++>(<++>) {<CR><++><CR>}<CR><++><Esc>3k^fc2li
autocmd FileType java inoremap <buffer> ;mn public static void main(String[] args) {<CR>;<CR>}<CR><++><Esc>2k^xA
autocmd FileType java inoremap <buffer> ;rt return
autocmd FileType java inoremap <buffer> ;st static
autocmd FileType java inoremap <buffer> ;pr System.out.println();<CR><++><Esc>k^f)i
autocmd FileType java inoremap <buffer> ;ip <Esc>?import<CR>oimport ;<Esc>i
autocmd FileType java nnoremap <buffer> ;ip ?import<CR>oimport ;<Esc>i
augroup END
" => Python
augroup python
autocmd FileType python inoremap <buffer> ;fr for in <++>:<CR><++><CR><C-D><++><Esc>2k^fihi
autocmd FileType python inoremap <buffer> ;wl while():<CR><++><CR><C-D><++><Esc>2k^f)i
autocmd FileType python inoremap <buffer> ;we while():<CR><++><CR><C-D>else:<CR><++><CR><C-D><++><Esc>4k^f)i
autocmd FileType python inoremap <buffer> ;if if :<CR><++><CR><C-D><++><Esc>2k^f:i
autocmd FileType python inoremap <buffer> ;ie if :<CR><++><CR><C-D>else:<CR><++><CR><C-D><++><Esc>4k^f:i
autocmd FileType python inoremap <buffer> ;ii if :<CR><++><CR><C-D>el<++><Esc>2k^f:i
autocmd FileType python inoremap <buffer> ;cl class :<CR><++><Esc>k^f:i
autocmd FileType python inoremap <buffer> ;fn def (<++>):<CR><++><CR><C-D><++><Esc>2k^f(i
autocmd FileType python inoremap <buffer> ;mn def main():<CR>;<CR><CR><C-D>if __name__ == "__main__":<CR>main()<Esc>3k^xA
autocmd FileType python inoremap <buffer> ;rt return
autocmd FileType python inoremap <buffer> ;pr print()<CR><++><Esc>k^f)i
autocmd FileType python inoremap <buffer> ;ip <Esc>?import<CR>oimport
autocmd FileType python nnoremap <buffer> ;ip ?import<CR>oimport
augroup END
" => LaTeX
augroup markup
autocmd FileType tex inoremap <buffer> ;fr \begin{frame}<CR>\frametitle{}<CR><CR><++><CR><CR>\end{frame}<CR><CR><++><Esc>6kf}i
autocmd FileType tex inoremap <buffer> ;fi \begin{fitch}<CR><CR>\end{fitch}<CR><CR><++><Esc>3kA
autocmd FileType tex inoremap <buffer> ;exe \begin{exe}<CR>\ex<Space><CR>\end{exe}<CR><CR><++><Esc>3kA
autocmd FileType tex inoremap <buffer> ;em \emph{}<Space><++><Esc>T{i
autocmd FileType tex inoremap <buffer> ;bf \textbf{}<Space><++><Esc>T{i
autocmd FileType tex inoremap <buffer> ;it \textit{}<Space><++><Esc>T{i
autocmd FileType tex inoremap <buffer> ;ct \textcite{}<Space><++><Esc>T{i
autocmd FileType tex inoremap <buffer> ;cm ~\cite{}<++><Esc>T{i
autocmd FileType tex inoremap <buffer> ;cp \parencite{}<Space><++><Esc>T{i
autocmd FileType tex inoremap <buffer> ;glos {\gll<Space><++><Space>\\<CR><++><Space>\\<CR>\trans{``<++>''}}<Esc>2k2bcw
autocmd FileType tex inoremap <buffer> ;x \begin{xlist}<CR>\ex<Space><CR>\end{xlist}<Esc>kA<Space>
autocmd FileType tex inoremap <buffer> ;ol \begin{enumerate}<CR><CR>\end{enumerate}<CR><CR><++><Esc>3kA\item<Space>
autocmd FileType tex inoremap <buffer> ;ul \begin{itemize}<CR><CR>\end{itemize}<CR><CR><++><Esc>3kA\item<Space>
autocmd FileType tex inoremap <buffer> ;li <CR>\item<Space>
autocmd FileType tex inoremap <buffer> ;ref \ref{}<Space><++><Esc>T{i
autocmd FileType tex inoremap <buffer> ;tab \begin{tabular}<CR><++><CR>\end{tabular}<CR><CR><++><Esc>4kA{}<Esc>i
autocmd FileType tex inoremap <buffer> ;a \href{}{<++>}<Space><++><Esc>2T{i
autocmd FileType tex inoremap <buffer> ;sc \textsc{}<Space><++><Esc>T{i
autocmd FileType tex inoremap <buffer> ;sec \section{}<CR><CR><++><Esc>2kf}i
autocmd FileType tex inoremap <buffer> ;ssec \subsection{}<CR><CR><++><Esc>2kf}i
autocmd FileType tex inoremap <buffer> ;sssec \subsubsection{}<CR><CR><++><Esc>2kf}i
autocmd FileType tex inoremap <buffer> ;st <Esc>F{i*<Esc>f}i
autocmd FileType tex inoremap <buffer> ;beg \begin{%DELRN%}<CR><++><CR>\end{%DELRN%}<CR><CR><++><Esc>4kfR:MultipleCursorsFind<Space>%DELRN%<CR>c
autocmd FileType tex inoremap <buffer> ;up <Esc>/usepackage<CR>o\usepackage{}<Esc>i
autocmd FileType tex nnoremap <buffer> ;up /usepackage<CR>o\usepackage{}<Esc>i
autocmd FileType tex inoremap <buffer> ;tt \texttt{}<Space><++><Esc>T{i
autocmd FileType tex inoremap <buffer> ;bt {\blindtext}
autocmd FileType tex inoremap <buffer> ;nu $\varnothing$
autocmd FileType tex inoremap <buffer> ;col \begin{columns}[T]<CR>\begin{column}{.5\textwidth}<CR><CR>\end{column}<CR>\begin{column}{.5\textwidth}<CR><++><CR>\end{column}<CR>\end{columns}<Esc>5kA
autocmd FileType tex inoremap <buffer> ;ent \gloss{}{<++>}{<++>}<CR><++><Esc>k0f}i
" Logical Symbols
autocmd FileType tex inoremap <buffer> ;m $$<Space><++><Esc>2T$i
autocmd FileType tex inoremap <buffer> ;M $$$$<CR><CR><++><Esc>2k$hi
autocmd FileType tex inoremap <buffer> ;neg {\neg}
autocmd FileType tex inoremap <buffer> ;V {\vee}
autocmd FileType tex inoremap <buffer> ;or {\vee}
autocmd FileType tex inoremap <buffer> ;L {\wedge}
autocmd FileType tex inoremap <buffer> ;and {\wedge}
autocmd FileType tex inoremap <buffer> ;ra {\rightarrow}
autocmd FileType tex inoremap <buffer> ;la {\leftarrow}
autocmd FileType tex inoremap <buffer> ;lra {\leftrightarrow}
autocmd FileType tex inoremap <buffer> ;fa {\forall}
autocmd FileType tex inoremap <buffer> ;ex {\exists}
autocmd FileType tex inoremap <buffer> ;dia {\Diamond}
autocmd FileType tex inoremap <buffer> ;box {\Box}
" smallcaps
autocmd Filetype tex inoremap <buffer> ;nom {\textsc{nom}}
autocmd FileType tex inoremap <buffer> ;acc {\textsc{acc}}
autocmd FileType tex inoremap <buffer> ;dat {\textsc{dat}}
autocmd FileType tex inoremap <buffer> ;gen {\textsc{gen}}
autocmd FileType tex inoremap <buffer> ;abl {\textsc{abl}}
autocmd FileType tex inoremap <buffer> ;voc {\textsc{voc}}
autocmd FileType tex inoremap <buffer> ;loc {\textsc{loc}}
autocmd Filetype tex inoremap <buffer> ;inst {\textsc{inst}}
autocmd Filetype tex inoremap <buffer> ;gls \gls{} <++><Esc>F}i
autocmd Filetype tex inoremap <buffer> ;Gls \Gls{} <++><Esc>F}i
autocmd Filetype tex inoremap <buffer> ;glsp \glspl{} <++><Esc>F}i
autocmd Filetype tex inoremap <buffer> ;Glsp \Glspl{} <++><Esc>F}i
autocmd Filetype tex inoremap <buffer> ;gle \newglossaryentry{}{%<CR><TAB>name={<++>},<CR>description={<++>}<CR><BS>}<Esc>3kf}i
autocmd Filetype tex inoremap <buffer> ;gla \newglossaryentry{}{%<CR><TAB>name={<++>},<CR>description={<++>},<CR>first={<++>},<CR>text={<++>}<CR><BS>}<Esc>5kf}i
" => HTML
autocmd FileType html inoremap <buffer> ;b <b></b><Space><++><Esc>FbT>i
autocmd FileType html inoremap <buffer> ;i <em></em><Space><++><Esc>FeT>i
autocmd FileType html inoremap <buffer> ;1 <h1></h1><CR><CR><++><Esc>2kf<i
autocmd FileType html inoremap <buffer> ;2 <h2></h2><CR><CR><++><Esc>2kf<i
autocmd FileType html inoremap <buffer> ;3 <h3></h3><CR><CR><++><Esc>2kf<i
autocmd FileType html inoremap <buffer> ;p <p></p><CR><CR><++><Esc>02kf>a
autocmd FileType html inoremap <buffer> ;a <a<Space>href=""><++></a><Space><++><Esc>F"i
autocmd FileType html inoremap <buffer> ;ul <ul><CR><li></li><CR></ul><CR><CR><++><Esc>03kf<i
autocmd FileType html inoremap <buffer> ;li <Esc>o<li></li><Esc>F>a
autocmd FileType html inoremap <buffer> ;ol <ol><CR><li></li><CR></ol><CR><CR><++><Esc>03kf<i
" => Bib
autocmd FileType bib inoremap <buffer> ;a @article{,<CR>author<Space>=<Space>"<++>",<CR>year<Space>=<Space>"<++>",<CR>title<Space>=<Space>"<++>",<CR>journal<Space>=<Space>"<++>",<CR>volume<Space>=<Space>"<++>",<CR>pages<Space>=<Space>"<++>",<CR>}<CR><++><Esc>8kf,i
autocmd FileType bib inoremap <buffer> ;b @book{,<CR>author<Space>=<Space>"<++>",<CR>year<Space>=<Space>"<++>",<CR>title<Space>=<Space>"<++>",<CR>publisher<Space>=<Space>"<++>",<CR>}<CR><++><Esc>6kf,i
autocmd FileType bib inoremap <buffer> ;c @incollection{,<CR>author<Space>=<Space>"<++>",<CR>title<Space>=<Space>"<++>",<CR>booktitle<Space>=<Space>"<++>",<CR>editor<Space>=<Space>"<++>",<CR>year<Space>=<Space>"<++>",<CR>publisher<Space>=<Space>"<++>",<CR>}<CR><++><Esc>8kf,i
" => Markdown
autocmd Filetype markdown,rmd inoremap <buffer> ;td - [ ]<Space>
autocmd Filetype markdown,rmd inoremap <buffer> ;b ****<Space><++><Esc>F*hi
autocmd Filetype markdown,rmd inoremap <buffer> ;s ~~~~<Space><++><Esc>F~hi
autocmd Filetype markdown,rmd inoremap <buffer> ;e **<Space><++><Esc>F*i
autocmd Filetype markdown,rmd inoremap <buffer> ;i ![](<++>)<Space><++><Esc>F[a
autocmd Filetype markdown,rmd inoremap <buffer> ;a [](<++>)<Space><++><Esc>F[a
autocmd Filetype markdown,rmd inoremap <buffer> ;1 #<Space><CR><CR><++><Esc>2kA
autocmd Filetype markdown,rmd inoremap <buffer> ;2 ##<Space><CR><CR><++><Esc>2kA
autocmd Filetype markdown,rmd inoremap <buffer> ;3 ###<Space><CR><CR><++><Esc>2kA
autocmd Filetype markdown,rmd inoremap <buffer> ;4 ####<Space><CR><CR><++><Esc>2kA
autocmd Filetype markdown,rmd inoremap <buffer> ;5 #####<Space><CR><CR><++><Esc>2kA
autocmd Filetype markdown,rmd inoremap <buffer> ;6 ######<Space><CR><CR><++><Esc>2kA
autocmd Filetype markdown,rmd inoremap <buffer> ;l ---<CR>
autocmd Filetype markdown inoremap <buffer> ;c ```<CR><++><CR>```<CR><CR><++><Esc>4kA
autocmd Filetype rmd inoremap <buffer> ;c ```{, eval = FALSE}<CR><++><CR>```<CR><CR><++><Esc>4k^f,i
augroup END