From 87cc2bc2bca35fa41b76a1fba919cd73739df853 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 3 Dec 2019 23:18:47 +0100 Subject: [PATCH] Add file compilation / opening shortcut to vim --- .config/nvim/maps.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.config/nvim/maps.vim b/.config/nvim/maps.vim index 4875168..a289baf 100644 --- a/.config/nvim/maps.vim +++ b/.config/nvim/maps.vim @@ -27,6 +27,9 @@ nnoremap % inoremap gUiw`]a inoremap 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' edit! + " yank filename to f buffer nnoremap yf :let @f = expand("%") @@ -203,6 +206,8 @@ let g:wiki_mappings_global = { \ '(wiki-link-toggle-operator)' : '======================', \} +" 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 q gqap @@ -224,3 +229,8 @@ inoremap @@ u:call fzf#run(fzf#wrap({ nnoremap cc :CiteRef " map cm to insert markdown prettified citation nnoremap cm :CiteMarkdown + +" 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 o :!open-compiled % +nnoremap p :w! \| !compile %