From 2b5388832ca4e9903539aa8a9bfc87603e19bc79 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 10 Apr 2018 17:48:59 -0700 Subject: [PATCH] vimrc updates --- .vimrc | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/.vimrc b/.vimrc index 890fa9b..9d09aab 100644 --- a/.vimrc +++ b/.vimrc @@ -4,6 +4,7 @@ " | |__| |_| | < __/ ___) | | | | | | | |_| | | | \__ \ \ V /| | | | | | | | | (__ " |_____\__,_|_|\_\___| |____/|_| |_| |_|_|\__|_| |_| |___/ \_/ |_|_| |_| |_|_| \___| +let mapleader =" " " Load Pathogen for plugins: execute pathogen#infect() execute pathogen#helptags() @@ -27,6 +28,12 @@ map k map l +" Open file as suckless sent presentation + map s :!sent% 2>/dev/null & + +" View an image for a suckless sent presentation: + map v $F@ly$:!feh --scale-down --auto-zoom --image-bg black " & + " Open my bibliography file in split map :vsp~/Documents/LaTeX/uni.bib @@ -38,6 +45,12 @@ " Replace all is aliased to S. nnoremap S :%s//g +" Open corresponding.pdf + map p :!mupdf %pdf & + +" Compile document + map c :!compiler % + "For saving view folds: "au BufWinLeave * mkview "au BufWinEnter * silent loadview @@ -48,6 +61,9 @@ " Make calcurse notes markdown compatible: autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown +" Get line, word and character counts with F3: + map :!wc % + " Spell-check set to F6: map :setlocal spell! spelllang=en_us,es @@ -66,6 +82,7 @@ " Goyo plugin makes text more readable when writing prose: map :Goyo + map f :Goyo inoremap :Goyoa " Enable Goyo by default for mutt writting @@ -210,9 +227,9 @@ """.bib - autocmd FileType bib inoremap ;a @article{author="<++>",year="<++>",title="<++>",journal="<++>",volume="<++>",pages="<++>",}<++>8kA,i - autocmd FileType bib inoremap ;b @book{author="<++>",year="<++>",title="<++>",publisher="<++>",}<++>6kA,i - autocmd FileType bib inoremap ;c @incollection{author="<++>",title="<++>",booktitle="<++>",editor="<++>",year="<++>",publisher="<++>",}<++>8kA,i + autocmd FileType bib inoremap ;a @article{author="<++>",year="<++>",title="<++>",journal="<++>",volume="<++>",pages="<++>",}<++>8kA,i + autocmd FileType bib inoremap ;b @book{author="<++>",year="<++>",title="<++>",publisher="<++>",}<++>6kA,i + autocmd FileType bib inoremap ;c @incollection{author="<++>",title="<++>",booktitle="<++>",editor="<++>",year="<++>",publisher="<++>",}<++>8kA,i "MARKDOWN autocmd Filetype markdown,rmd map w yiWi[Ea](pa) @@ -227,14 +244,14 @@ autocmd Filetype markdown,rmd inoremap ;2 ##<++>kA autocmd Filetype markdown,rmd inoremap ;3 ###<++>kA autocmd Filetype markdown,rmd inoremap ;l -------- - autocmd Filetype markdown map :!pandoc%-o%.pdf + autocmd Filetype markdown map :!pandoc%--pdf-engine=xelatex-o%.pdf autocmd Filetype rmd map :!echo"require(rmarkdown);render('%')"\|R--vanilla autocmd Filetype rmd inoremap ;r ```{r}```2kO autocmd Filetype rmd inoremap ;p ```{python}```2kO """.xml "autocmd FileType xml inoremap ;e <++>:put=strftime('%c')A<++><++> - autocmd FileType xml inoremap ;e <++>:put=strftime('%c')A<++>]]>5kcit + autocmd FileType xml inoremap ;e <++>isPermaLink="false"><++>:put=strftime('%a, %d %b %Y %H:%M:%S %z')kJA<++>]]>?<enter>cit autocmd FileType xml inoremap ;a <a href="<++>"><++></a><++><Esc>F"ci" vmap <expr> ++ VMATH_YankAndAnalyse() @@ -244,3 +261,5 @@ vnoremap K xkP`[V`] vnoremap J xp`[V`] vnoremap L >gv vnoremap H <gv + +map <enter><enter> yi[:e <c-r>"<cr>