diff --git a/.vimrc b/.vimrc index 310f9ca..0ee2c09 100644 --- a/.vimrc +++ b/.vimrc @@ -1,8 +1,8 @@ -" _ _ ____ _ _ _ _ _ -" | | _ _| | _____ / ___| _ __ ___ (_) |_| |__ ( )___ __ _(_)_ __ ___ _ __ ___ -" | | | | | | |/ / _ \ \___ \| '_ ` _ \| | __| '_ \|// __| \ \ / / | '_ ` _ \| '__/ __| -" | |__| |_| | < __/ ___) | | | | | | | |_| | | | \__ \ \ V /| | | | | | | | | (__ -" |_____\__,_|_|\_\___| |____/|_| |_| |_|_|\__|_| |_| |___/ \_/ |_|_| |_| |_|_| \___| +" _ +" __ _(_)_ __ ___ _ __ ___ +" \ \ / / | '_ ` _ \| '__/ __| +" \ V /| | | | | | | | | (__ +" \_/ |_|_| |_| |_|_| \___| let mapleader =" " " Load Pathogen for plugins: @@ -46,7 +46,7 @@ let mapleader =" " nnoremap S :%s//g " Open corresponding.pdf - map p :!mupdf %pdf & + map p :!zathura %pdf & " Compile document map c :!compiler % @@ -61,6 +61,9 @@ let mapleader =" " " Make calcurse notes markdown compatible: autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown +" Readmes autowrap text: + autocmd BufRead,BufNewFile *README.md set tw=79 + " Get line, word and character counts with F3: map :!wc % @@ -79,9 +82,11 @@ let mapleader =" " " Use urlview to choose and open a url: :noremap u :wsilent !urlview + :noremap ,, :wsilent !urlview " Copy selected text to system clipboard (requires gvim installed): - vnoremap "*y :let @+=@* + vnoremap "*Y :let @+=@* + map "+P " Goyo plugin makes text more readable when writing prose: map :Goyo @@ -120,7 +125,6 @@ let mapleader =" " inoremap /<++>"_c4l vnoremap /<++>"_c4l map /<++>"_c4l - inoremap ;gui <++> " For normal mode when in terminals (in X I have caps mapped to esc, this replaces it when I don't have X) inoremap jw @@ -141,122 +145,92 @@ let mapleader =" " autocmd FileType tex inoremap :!xelatex%a autocmd FileType tex nnoremap :!xelatex% " Code snippets - autocmd FileType tex inoremap ;fr \begin{frame}\frametitle{}<++>\end{frame}<++>6kf}i - autocmd FileType tex inoremap ;fi \begin{fitch}\end{fitch}<++>3kA - autocmd FileType tex inoremap ;exe \begin{exe}\ex\end{exe}<++>3kA - autocmd FileType tex inoremap ;em \emph{}<++>T{i - autocmd FileType tex inoremap ;bf \textbf{}<++>T{i - autocmd FileType tex vnoremap ; ``>2la}?\\{a - autocmd FileType tex inoremap ;it \textit{}<++>T{i - autocmd FileType tex inoremap ;ct \textcite{}<++>T{i - autocmd FileType tex inoremap ;cp \parencite{}<++>T{i - autocmd FileType tex inoremap ;glos {\gll<++>\\<++>\\\trans{``<++>''}}2k2bcw - autocmd FileType tex inoremap ;x \begin{xlist}\ex\end{xlist}kA - autocmd FileType tex inoremap ;ol \begin{enumerate}\end{enumerate}<++>3kA\item - autocmd FileType tex inoremap ;ul \begin{itemize}\end{itemize}<++>3kA\item - autocmd FileType tex inoremap ;li \item - autocmd FileType tex inoremap ;ref \ref{}<++>T{i - autocmd FileType tex inoremap ;tab \begin{tabular}<++>\end{tabular}<++>4kA{}i - autocmd FileType tex inoremap ;ot \begin{tableau}\inp{<++>}\const{<++>}<++><++>\end{tableau}<++>5kA{}i - autocmd FileType tex inoremap ;can \cand{}<++>T{i - autocmd FileType tex inoremap ;con \const{}<++>T{i - autocmd FileType tex inoremap ;v \vio{}<++>T{i - autocmd FileType tex inoremap ;a \href{}{<++>}<++>2T{i - autocmd FileType tex inoremap ;sc \textsc{}<++>T{i - autocmd FileType tex inoremap ;chap \chapter{}<++>2kf}i - autocmd FileType tex inoremap ;sec \section{}<++>2kf}i - autocmd FileType tex inoremap ;ssec \subsection{}<++>2kf}i - autocmd FileType tex inoremap ;sssec \subsubsection{}<++>2kf}i - autocmd FileType tex inoremap ;st F{i*f}i - autocmd FileType tex inoremap ;beg \begin{DELRN}<++>\end{DELRN}<++>4k0fR:MultipleCursorsFindDELRNc - autocmd FileType tex inoremap ;up /usepackageo\usepackage{}i - autocmd FileType tex nnoremap ;up /usepackageo\usepackage{}i - autocmd FileType tex inoremap ;tt \texttt{}<++>T{i - autocmd FileType tex inoremap ;bt {\blindtext} - autocmd FileType tex inoremap ;nu $\varnothing$ - autocmd FileType tex inoremap ;col \begin{columns}[T]\begin{column}{.5\textwidth}\end{column}\begin{column}{.5\textwidth}<++>\end{column}\end{columns}5kA - autocmd FileType tex inoremap ;rn (\ref{})<++>F}i - -"""LATEX Logical symbols - autocmd FileType tex inoremap ;m $$<++>2T$i - autocmd FileType tex inoremap ;M $$$$<++>2k$hi - autocmd FileType tex inoremap ;neg {\neg} - autocmd FileType tex inoremap ;V {\vee} - autocmd FileType tex inoremap ;or {\vee} - autocmd FileType tex inoremap ;L {\wedge} - autocmd FileType tex inoremap ;and {\wedge} - autocmd FileType tex inoremap ;ra {\rightarrow} - autocmd FileType tex inoremap ;la {\leftarrow} - autocmd FileType tex inoremap ;lra {\leftrightarrow} - autocmd FileType tex inoremap ;fa {\forall} - autocmd FileType tex inoremap ;ex {\exists} - autocmd FileType tex inoremap ;dia {\Diamond} - autocmd FileType tex inoremap ;box {\Box} - autocmd FileType tex inoremap ;gt {\textgreater} - autocmd FileType tex inoremap ;lt {\textless} -"""LaTeX Linguistics Shortcuts - autocmd Filetype tex inoremap ;nom {\textsc{nom}} - autocmd FileType tex inoremap ;acc {\textsc{acc}} - autocmd FileType tex inoremap ;dat {\textsc{dat}} - autocmd FileType tex inoremap ;gen {\textsc{gen}} - autocmd FileType tex inoremap ;abl {\textsc{abl}} - autocmd FileType tex inoremap ;voc {\textsc{voc}} - autocmd FileType tex inoremap ;loc {\textsc{loc}} - autocmd Filetype tex inoremap ;inst {\textsc{inst}} - autocmd FileType tex inoremap ;tipa \textipa{}<++>T{i + autocmd FileType tex inoremap ,fr \begin{frame}\frametitle{}<++>\end{frame}<++>6kf}i + autocmd FileType tex inoremap ,fi \begin{fitch}\end{fitch}<++>3kA + autocmd FileType tex inoremap ,exe \begin{exe}\ex\end{exe}<++>3kA + autocmd FileType tex inoremap ,em \emph{}<++>T{i + autocmd FileType tex inoremap ,bf \textbf{}<++>T{i + autocmd FileType tex vnoremap , ``>2la}?\\{a + autocmd FileType tex inoremap ,it \textit{}<++>T{i + autocmd FileType tex inoremap ,ct \textcite{}<++>T{i + autocmd FileType tex inoremap ,cp \parencite{}<++>T{i + autocmd FileType tex inoremap ,glos {\gll<++>\\<++>\\\trans{``<++>''}}2k2bcw + autocmd FileType tex inoremap ,x \begin{xlist}\ex\end{xlist}kA + autocmd FileType tex inoremap ,ol \begin{enumerate}\end{enumerate}<++>3kA\item + autocmd FileType tex inoremap ,ul \begin{itemize}\end{itemize}<++>3kA\item + autocmd FileType tex inoremap ,li \item + autocmd FileType tex inoremap ,ref \ref{}<++>T{i + autocmd FileType tex inoremap ,tab \begin{tabular}<++>\end{tabular}<++>4kA{}i + autocmd FileType tex inoremap ,ot \begin{tableau}\inp{<++>}\const{<++>}<++><++>\end{tableau}<++>5kA{}i + autocmd FileType tex inoremap ,can \cand{}<++>T{i + autocmd FileType tex inoremap ,con \const{}<++>T{i + autocmd FileType tex inoremap ,v \vio{}<++>T{i + autocmd FileType tex inoremap ,a \href{}{<++>}<++>2T{i + autocmd FileType tex inoremap ,sc \textsc{}<++>T{i + autocmd FileType tex inoremap ,chap \chapter{}<++>2kf}i + autocmd FileType tex inoremap ,sec \section{}<++>2kf}i + autocmd FileType tex inoremap ,ssec \subsection{}<++>2kf}i + autocmd FileType tex inoremap ,sssec \subsubsection{}<++>2kf}i + autocmd FileType tex inoremap ,st F{i*f}i + autocmd FileType tex inoremap ,beg \begin{DELRN}<++>\end{DELRN}<++>4k0fR:MultipleCursorsFindDELRNc + autocmd FileType tex inoremap ,up /usepackageo\usepackage{}i + autocmd FileType tex nnoremap ,up /usepackageo\usepackage{}i + autocmd FileType tex inoremap ,tt \texttt{}<++>T{i + autocmd FileType tex inoremap ,bt {\blindtext} + autocmd FileType tex inoremap ,nu $\varnothing$ + autocmd FileType tex inoremap ,col \begin{columns}[T]\begin{column}{.5\textwidth}\end{column}\begin{column}{.5\textwidth}<++>\end{column}\end{columns}5kA + autocmd FileType tex inoremap ,rn (\ref{})<++>F}i """PHP/HTML - autocmd FileType php,html inoremap ;b <++>FbT>i - autocmd FileType php,html inoremap ;i <++>FeT>i - autocmd FileType php,html inoremap ;h1

<++>2kf<++>2kf<++>2kf

<++>02kf>a - autocmd FileType php,html inoremap ;a href=""><++><++>14hi - autocmd FileType php,html inoremap ;e target="_blank"href=""><++><++>14hi - autocmd FileType php,html inoremap ;ul
<++>03kfo
  • F>a - autocmd FileType php,html inoremap ;ol
    <++>03kfclass="image">href="pix/<++>">src="pix/<++>"width="<++>"><++>4kf>a - autocmd FileType php,html inoremap ;td <++>Fdcit - autocmd FileType php,html inoremap ;tr <++>kf<++>Fhcit - autocmd FileType php,html inoremap ;tab
    O - autocmd FileType php,html inoremap ;gr F>a - autocmd FileType php,html inoremap ;rd F>a - autocmd FileType php,html inoremap ;yl F>a - autocmd FileType php,html inoremap ;dt
    <++>
    <++>2kcit - autocmd FileType php,html inoremap ;dl
    <++>3kcc - "autocmd FileType php,html inoremap -- – - "autocmd FileType php,html inoremap --- — + autocmd FileType php,html inoremap ,b <++>FbT>i + autocmd FileType php,html inoremap ,it <++>FeT>i + autocmd FileType php,html inoremap ,1

    <++>2kf<++>2kf<++>2kf

    <++>02kf>a + autocmd FileType php,html inoremap ,a href=""><++><++>14hi + autocmd FileType php,html inoremap ,e target="_blank"href=""><++><++>14hi + autocmd FileType php,html inoremap ,ul
    <++>03kfo
  • F>a + autocmd FileType php,html inoremap ,ol
    <++>03kf<++>Fcf"a + autocmd FileType php,html inoremap ,td <++>Fdcit + autocmd FileType php,html inoremap ,tr <++>kf<++>Fhcit + autocmd FileType php,html inoremap ,tab
    O + autocmd FileType php,html inoremap ,gr F>a + autocmd FileType php,html inoremap ,rd F>a + autocmd FileType php,html inoremap ,yl F>a + autocmd FileType php,html inoremap ,dt
    <++>
    <++>2kcit + autocmd FileType php,html inoremap ,dl
    <++>3kcc + autocmd FileType php,html inoremap & & """.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) - autocmd Filetype markdown,rmd inoremap ;n --- - autocmd Filetype markdown,rmd inoremap ;b ****<++>F*hi - autocmd Filetype markdown,rmd inoremap ;s ~~~~<++>F~hi - autocmd Filetype markdown,rmd inoremap ;e **<++>F*i - autocmd Filetype markdown,rmd inoremap ;h ====<++>F=hi - autocmd Filetype markdown,rmd inoremap ;i ![](<++>)<++>F[a - autocmd Filetype markdown,rmd inoremap ;a [](<++>)<++>F[a - autocmd Filetype markdown,rmd inoremap ;1 #<++>kA - 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%--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 + autocmd Filetype markdown,rmd inoremap ,n --- + autocmd Filetype markdown,rmd inoremap ,b ****<++>F*hi + autocmd Filetype markdown,rmd inoremap ,s ~~~~<++>F~hi + autocmd Filetype markdown,rmd inoremap ,e **<++>F*i + autocmd Filetype markdown,rmd inoremap ,h ====<++>F=hi + autocmd Filetype markdown,rmd inoremap ,i ![](<++>)<++>F[a + autocmd Filetype markdown,rmd inoremap ,a [](<++>)<++>F[a + autocmd Filetype markdown,rmd inoremap ,1 #<++>kA + autocmd Filetype markdown,rmd inoremap ,2 ##<++>kA + autocmd Filetype markdown,rmd inoremap ,3 ###<++>kA + autocmd Filetype markdown,rmd inoremap ,l -------- + autocmd Filetype rmd inoremap ,r ```{r}```2kO + autocmd Filetype rmd inoremap ,p ```{python}```2kO + autocmd Filetype rmd inoremap ,c ``````2kO """.xml - 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" + autocmd FileType xml inoremap ,e <item><Enter><title><++>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() nmap ++ vip++