" 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' Plug 'vimwiki/vimwiki' Plug 'nmante/vim-latex-live-preview' Plug 'lervag/vimtex' Plug 'junegunn/goyo.vim' Plug 'jceb/vim-orgmode' Plug 'prettier/vim-prettier', { 'do': 'npm install --force' } Plug 'iamcco/markdown-preview.nvim', { 'do': 'npm install --force' } " Problem with vim-prettier " " git checkout -b test origin/feature/issue-232-add-support-for-prettier-2.x; " npm install --force call plug#end() " Vim wiki let wiki = {} let wiki.path = '~/git/notes/' let wiki.path_html = '~/vimwiki_html/' let wiki.syntax = 'default' let wiki.ext = '.wiki' let g:vimwiki_list = [wiki] let g:vimwiki_table_mappings = 0 " 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 syntax on filetype plugin indent on set encoding=utf-8 " livepreviewer let g:livepreview_previewer = 'mupdf' " 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 " off mouse set mouse-=a " disable pcspkr beep set visualbell set t_vb= " searching set incsearch set smartcase " cursor let &t_SI = "\[6 q" let &t_EI = "\[2 q" " colors colorscheme desert hi CursorLine cterm=NONE term=NONE ctermbg=NONE guibg=NONE hi CursorLine ctermbg=235 " markdown preview let g:mkdp_browser = '/home/yorune/.local/bin/browser-x' let g:mkdp_echo_preview_url = 1 " map nnoremap S :%s//g nnoremap ee :!mupdf $(echo % \| sed 's/tex$/pdf/') & disown map :NERDTreeToggle nnoremap :tabnew nnoremap :Goyo nnoremap :tabprevious nnoremap :tabnext cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' edit! " latex let g:tex_flavor = "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! " 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* map ZZ :Goyo\|x! autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q! " Auto add notes git au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown "autocmd BufWritePost *.md :Prettier "autocmd BufWritePost *.md execute '!git add % && git commit -m "Auto-commit: saved %" && git push' | redraw!