Add file compilation / opening shortcut to vim

This commit is contained in:
Marty Oehme 2019-12-03 23:18:47 +01:00
parent c0d6300dcc
commit 87cc2bc2bc

View file

@ -27,6 +27,9 @@ nnoremap <tab> %
inoremap <C-U> <esc>gUiw`]a
inoremap <C-u> <esc>guiw`]a
" let me save stuff as sudo when I forget to call vim with it
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
" yank filename to f buffer
nnoremap yf :let @f = expand("%")<cr>
@ -203,6 +206,8 @@ let g:wiki_mappings_global = {
\ '<plug>(wiki-link-toggle-operator)' : '<leader>======================',
\}
" TODO The following should be put into a prose / compiled mapping module
" Mostly dealing with Prose writing from here on out
" Format current Paragraph (esp useful in prose writing)
nnoremap <silent> <localleader>q gqap
@ -224,3 +229,8 @@ inoremap <silent> @@ <c-g>u<c-o>:call fzf#run(fzf#wrap({
nnoremap <silent> <localleader>cc :CiteRef<cr>
" map <leader>cm to insert markdown prettified citation
nnoremap <silent> <localleader>cm :CiteMarkdown<cr>
" p to comPile a document (or file, works for some languages like go/python/c)
" o to open the resulting document (mostly for pdfs)
nnoremap <localleader>o :!open-compiled <c-r>%<CR><CR>
nnoremap <localleader>p :w! \| !compile <c-r>%<CR>