" settings if ! filereadable(system('echo -n "$HOME/.vim/autoload/plug.vim"')) silent !mkdir -p $HOME/.vim/autoload/ silent !curl --silent "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > $HOME/.vim/autoload/plug.vim autocmd VimEnter * PlugInstall endif set laststatus=2 set shiftwidth=4 set softtabstop=4 set tabstop=4 au BufWritePre * let &bex = '@' . strftime("%F.%H:%M") " plugins call plug#begin('~/.vim/plugged') Plug 'scrooloose/nerdtree', "{ 'on': 'NERDTreeToggle' } Plug 'nmante/vim-latex-live-preview' Plug 'lervag/vimtex' Plug 'junegunn/goyo.vim' call plug#end() " Status-line set statusline= set statusline+=%#IncSearch# set statusline+=\ %y set statusline+=\ %r set statusline+=%#CursorLineNr# set statusline+=\ %F set statusline+=%= "Right side settings set statusline+=%#Search# set statusline+=\ %l/%L set statusline+=\ [%c] set nocompatible set hlsearch set incsearch set noshowmode set cursorline set cmdheight=1 let g:livepreview_previewer = 'mupdf' syntax on filetype plugin indent on set encoding=utf-8 " line numbers set number set ruler set title " indent set backspace=indent,eol,start set shiftwidth=4 set expandtab " editing runtime! macros/matchit.vim set backspace=indent,eol,start " visual feedback set laststatus=2 set showmode set showcmd " disable pcspkr beep set visualbell set t_vb= " searching set incsearch set smartcase " cursor let &t_SI = "\[5 q" let &t_SR = "\[5 q" let &t_EI = "\[2 q" " colors colorscheme desert hi CursorLine cterm=NONE term=NONE ctermbg=NONE guibg=NONE hi CursorLine ctermbg=235 " map nnoremap S :%s//g nnoremap ee :!mupdf $(echo % \| sed 's/tex$/pdf/') & disown map :NERDTreeToggle nnoremap :tabnew nnoremap :Goyo nnoremap :tabprevious nnoremap :tabnext nnoremap :GoRun command W :execute ':silent w !sudo tee % > /dev/null' | :edit! " latex autocmd BufWritePost *.tex silent! execute "!pdflatex --shell-escape -synctex=1 -interaction=nonstopmode % > /dev/null " | redraw! autocmd BufWritePost *.tex silent! execute "!latexmk -pdf -silent % > /dev/null" | redraw! autocmd BufWritePost *.tex silent! execute "!sudo rm -rf *.fls *.ilg *.nav *.snm *.toc *.idx *.lof *.lot *.synctex.gz *.aux *.fdb_latexmk *.fls *.log *.out > /dev/null" | redraw! autocmd BufWritePost *.tex silent! execute "!sudo pkill -HUP mupdf > /dev/null" | redraw! 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 ,bf \textbf{}T{i autocmd FileType tex inoremap ,co \coun{}\\T{i autocmd FileType tex inoremap ,nbf \noindent\textbf{}\\T{i autocmd FileType tex inoremap ,noi \noindentT{i autocmd FileType tex inoremap ,ln \par\noindent \line(1,0){400}\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 ,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 ,a \href{}{<++>}<++>2T{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 ,tt \texttt{}<++>T{i autocmd FileType tex inoremap ,bt {\blindtext} autocmd FileType tex inoremap ,rn (\ref{})<++>F}i