vim: add ctrl-b to create backticks

This commit is contained in:
Jason Swank
2026-01-13 13:05:08 -05:00
parent 9ec3e1124b
commit fd47330e6d

View File

@@ -69,6 +69,9 @@ au FileType markdown setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4 wra
" typing idate inserts the current date " typing idate inserts the current date
iab idate <c-r>=strftime("%Y-%m-%d")<cr> iab idate <c-r>=strftime("%Y-%m-%d")<cr>
" insert triple backticks for markdown code blocks with Ctrl-b
inoremap <C-b> ```<CR>```<Esc>O
" use \ toc to insert a table of contents for markdown from the current line to EOF " use \ toc to insert a table of contents for markdown from the current line to EOF
" nmap <leader>toc <cmd>.put =execute('.,$write !gh-md-toc --hide-header --hide-footer')<cr> " nmap <leader>toc <cmd>.put =execute('.,$write !gh-md-toc --hide-header --hide-footer')<cr>
nmap <leader>toc :put =system('gh-md-toc --hide-header --hide-footer --indent=4', getline('.', '$'))<cr> nmap <leader>toc :put =system('gh-md-toc --hide-header --hide-footer --indent=4', getline('.', '$'))<cr>