2020-05-09 13:43:39 +02:00
|
|
|
" settings
|
2020-05-31 14:50:54 +02:00
|
|
|
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
|
|
|
|
|
2020-05-09 13:43:39 +02:00
|
|
|
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')
|
2020-09-01 11:39:56 +02:00
|
|
|
Plug 'preservim/nerdtree'
|
|
|
|
Plug 'nmante/vim-latex-live-preview'
|
|
|
|
Plug 'lervag/vimtex'
|
|
|
|
Plug 'junegunn/goyo.vim'
|
|
|
|
Plug 'jceb/vim-orgmode'
|
|
|
|
Plug 'tpope/vim-speeddating'
|
|
|
|
Plug 'prettier/vim-prettier', { 'do': 'npm install --force' }
|
|
|
|
Plug 'iamcco/markdown-preview.nvim', { 'do': 'npm install --force' }
|
2020-10-29 22:08:29 +01:00
|
|
|
Plug 'vim-ruby/vim-ruby'
|
2020-09-04 13:12:40 +02:00
|
|
|
Plug 'vim-syntastic/syntastic'
|
2020-10-29 22:08:29 +01:00
|
|
|
Plug 'Shougo/deoplete.nvim'
|
|
|
|
Plug 'takkii/Bignyanco'
|
|
|
|
Plug 'roxma/nvim-yarp'
|
|
|
|
Plug 'roxma/vim-hug-neovim-rpc'
|
2020-09-01 11:39:56 +02:00
|
|
|
" Problem with vim-prettier
|
|
|
|
" git checkout -b test origin/feature/issue-232-add-support-for-prettier-2.x;
|
|
|
|
" npm install --force
|
2020-05-09 13:43:39 +02:00
|
|
|
call plug#end()
|
|
|
|
|
2020-10-29 22:08:29 +01:00
|
|
|
let g:rubycomplete_buffer_loading = 1
|
|
|
|
let g:rubycomplete_rails = 1
|
|
|
|
|
|
|
|
|
2020-05-09 13:43:39 +02:00
|
|
|
" 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 cmdheight=1
|
|
|
|
syntax on
|
|
|
|
filetype plugin indent on
|
|
|
|
set encoding=utf-8
|
|
|
|
|
2020-09-01 11:39:56 +02:00
|
|
|
" livepreviewer
|
|
|
|
let g:livepreview_previewer = 'mupdf'
|
|
|
|
|
2020-09-04 12:09:43 +02:00
|
|
|
" markdown preview
|
|
|
|
let g:mkdp_browser = '/home/yorune/.local/bin/browser-x'
|
|
|
|
let g:mkdp_echo_preview_url = 1
|
|
|
|
|
2020-05-09 13:43:39 +02:00
|
|
|
" line numbers
|
|
|
|
set number
|
|
|
|
set ruler
|
|
|
|
set title
|
|
|
|
|
|
|
|
" indent
|
|
|
|
set backspace=indent,eol,start
|
|
|
|
set shiftwidth=4
|
|
|
|
set expandtab
|
|
|
|
|
|
|
|
" editing
|
|
|
|
runtime! macros/matchit.vim
|
2020-09-01 11:39:56 +02:00
|
|
|
set backspace=indent,eol,start
|
2020-05-09 13:43:39 +02:00
|
|
|
|
|
|
|
" visual feedback
|
|
|
|
set laststatus=2
|
|
|
|
set showmode
|
|
|
|
set showcmd
|
|
|
|
|
2020-06-06 22:41:49 +02:00
|
|
|
" off mouse
|
|
|
|
set mouse-=a
|
|
|
|
|
2020-05-09 13:43:39 +02:00
|
|
|
" disable pcspkr beep
|
|
|
|
set visualbell
|
|
|
|
set t_vb=
|
|
|
|
|
|
|
|
" searching
|
|
|
|
set smartcase
|
2020-09-27 01:34:30 +02:00
|
|
|
set ic
|
2020-05-09 13:43:39 +02:00
|
|
|
|
2020-05-31 15:53:43 +02:00
|
|
|
" cursor
|
2020-05-31 16:13:14 +02:00
|
|
|
let &t_SI = "\<esc>[6 q"
|
2020-05-31 15:53:43 +02:00
|
|
|
let &t_EI = "\<esc>[2 q"
|
|
|
|
|
2020-05-09 13:43:39 +02:00
|
|
|
" colors
|
2020-09-18 10:18:29 +02:00
|
|
|
set bg=dark
|
2020-09-01 11:39:56 +02:00
|
|
|
hi CursorLine cterm=NONE term=NONE ctermbg=NONE guibg=NONE
|
|
|
|
hi CursorLine ctermbg=235
|
2020-05-09 13:43:39 +02:00
|
|
|
|
|
|
|
" map
|
2020-05-31 14:50:54 +02:00
|
|
|
nnoremap S :%s//g<Left><Left>
|
2020-09-01 11:39:56 +02:00
|
|
|
nnoremap ee :!mupdf $(echo % \| sed 's/tex$/pdf/') & disown<CR><CR>
|
2020-05-09 13:43:39 +02:00
|
|
|
map <C-n> :NERDTreeToggle<CR>
|
|
|
|
nnoremap <silent> <C-t> :tabnew <CR>
|
2020-09-01 11:39:56 +02:00
|
|
|
nnoremap <F11> :Goyo <CR>
|
2020-05-09 13:43:39 +02:00
|
|
|
nnoremap <F7> :tabprevious<CR>
|
|
|
|
nnoremap <F8> :tabnext<CR>
|
|
|
|
|
2020-08-27 22:20:14 +02:00
|
|
|
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
|
2020-08-30 15:13:25 +02:00
|
|
|
|
2020-09-01 11:39:56 +02:00
|
|
|
" 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
|
2020-09-16 23:18:00 +02:00
|
|
|
autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo
|
2020-09-01 11:39:56 +02:00
|
|
|
autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR>
|
|
|
|
autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q!<CR>
|
|
|
|
|
2020-08-30 15:13:25 +02:00
|
|
|
" Automatically deletes all trailing whitespace and newlines at end of file on save.
|
|
|
|
autocmd BufWritePre * %s/\s\+$//e
|
|
|
|
autocmd BufWritepre * %s/\n\+\%$//e
|
2020-09-01 11:39:56 +02:00
|
|
|
|
|
|
|
" Autoformating markdown
|
2020-09-21 16:07:52 +02:00
|
|
|
autocmd BufWritePost *.md :Prettier
|