diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index c3d4d43..3105a38 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -85,7 +85,8 @@ set clipboard=unnamedplus " Ensure files are read as what I want: let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'} - let g:vimwiki_list = [{'path': '~/vimwiki', 'syntax': 'markdown', 'ext': '.md'}] + map v :VimwikiIndex + let g:vimwiki_list = [{'path': '~/repos/writings', 'syntax': 'markdown', 'ext': '.md'}] autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff autocmd BufRead,BufNewFile *.tex set filetype=tex @@ -95,132 +96,17 @@ set clipboard=unnamedplus map "+P " Enable Goyo by default for mutt writting - " Goyo's width will be the line limit in mutt. autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80 - autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo \| set bg=light + autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo | set bg=light " Automatically deletes all trailing whitespace on save. autocmd BufWritePre * %s/\s\+$//e -" When shortcut files are updated, renew bash and vifm configs with new material: - autocmd BufWritePost ~/.config/bmdirs,~/.config/bmfiles !shortcuts - +" When shortcut files are updated, renew bash and ranger configs with new material: + autocmd BufWritePost *bmdirs,*bmfiles !shortcuts " Run xrdb whenever Xdefaults or Xresources are updated. autocmd BufWritePost *Xresources,*Xdefaults !xrdb % - -" Navigating with guides - inoremap /<++>"_c4l - vnoremap /<++>"_c4l - map /<++>"_c4l - -"""LATEX - " Word count: - autocmd FileType tex map w :w !detex \| wc -w - " 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 - -"""HTML - autocmd FileType html inoremap ,b <++>FbT>i - autocmd FileType html inoremap ,it <++>FeT>i - autocmd FileType html inoremap ,1

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

<++>02kf>a - autocmd FileType html inoremap ,a href=""><++><++>14hi - autocmd FileType html inoremap ,e target="_blank"href=""><++><++>14hi - autocmd FileType html inoremap ,ul
<++>03kfo
  • F>a - autocmd FileType html inoremap ,ol
    <++>03kf<++>Fcf"a - autocmd FileType html inoremap ,td <++>Fdcit - autocmd FileType html inoremap ,tr <++>kf<++>Fhcit - autocmd FileType html inoremap ,tab
    O - autocmd FileType html inoremap ,gr F>a - autocmd FileType html inoremap ,rd F>a - autocmd FileType html inoremap ,yl F>a - autocmd FileType html inoremap ,dt
    <++>
    <++>2kcit - autocmd FileType html inoremap ,dl
    <++>3kcc - autocmd FileType html inoremap & & - autocmd FileType html inoremap á á - autocmd FileType html inoremap é é - autocmd FileType html inoremap í í - autocmd FileType html inoremap ó ó - autocmd FileType html inoremap ú ú - autocmd FileType html inoremap ä ä - autocmd FileType html inoremap ë ë - autocmd FileType html inoremap ï ï - autocmd FileType html inoremap ö ö - autocmd FileType html inoremap ü ü - autocmd FileType html inoremap ã ã - autocmd FileType html inoremap ẽ &etilde; - autocmd FileType html inoremap ĩ ĩ - autocmd FileType html inoremap õ õ - autocmd FileType html inoremap ũ ũ - autocmd FileType html inoremap ñ ñ - autocmd FileType html inoremap à à - autocmd FileType html inoremap è è - autocmd FileType html inoremap ì ì - autocmd FileType html inoremap ò ò - autocmd FileType 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 - -"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 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" +" Update binds when sxhkdrc is updated. + autocmd BufWritePost *sxhkdrc !pkill -USR1 sxhkd +" Update dwmbar when changed. + autocmd BufWritePost *dwmbar !killall dwmbar; setsid dwmbar &