Created
November 21, 2019 13:05
-
-
Save morxa/2ca15ab2d0387af4044ab40d4f81836f to your computer and use it in GitHub Desktop.
My vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'tpope/vim-git' | |
"Plugin 'git://git.code.sf.net/p/vim-latex/vim-latex' | |
"Plugin 'ap/vim-templates' | |
"Plugin 'drbeco/vimtemplates' | |
Plugin 'aperezdc/vim-template' | |
Plugin 'adimit/prolog.vim' | |
"Plugin 'tmhedberg/SimpylFold' | |
Plugin 'vim-scripts/indentpython.vim' | |
Plugin 'lervag/vimtex' | |
"Plugin 'Shougo/neocomplete.vim' | |
"Plugin 'fatih/vim-go' | |
"Plugin 'jceb/vim-orgmode' | |
Plugin 'chrisbra/csv.vim' | |
" Colors | |
Plugin 'exitface/synthwave.vim' | |
Plugin 'ayu-theme/ayu-vim' | |
Plugin 'Valloric/YouCompleteMe' | |
Plugin 'Glench/Vim-Jinja2-Syntax' | |
Plugin 'maksimr/vim-jsbeautify' | |
Plugin 'rhysd/committia.vim' | |
Plugin 'tell-k/vim-autopep8' | |
"Plugin 'w0rp/ale' | |
"Plugin 'zxqfl/tabnine-vim' | |
Plugin 'NLKNguyen/papercolor-theme' | |
Plugin 'scrooloose/nerdtree' | |
" All of your Plugins must be added before the following line | |
call vundle#end() " required | |
filetype plugin indent on " required | |
" To ignore plugin indent changes, instead use: | |
"filetype plugin on | |
" | |
" Brief help | |
" :PluginList - lists configured plugins | |
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate | |
" :PluginSearch foo - searches for foo; append `!` to refresh local cache | |
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal | |
" | |
" see :h vundle for more details or wiki for FAQ | |
" Put your non-Plugin stuff after this line | |
set grepprg=grep\ -nH\ $* | |
let g:tex_flavor = "latex" | |
let g:Tex_DefaultTargetFormat='pdf' | |
"let g:Tex_MultipleCompileFormats='dvi,pdf' | |
"let g:Tex_CompileRule_pdf='pdflatex -shell-escape -interaction=nonstopmode $*' | |
let g:Tex_CompileRule_pdf='latexmk -pdf -shell-escape $*' | |
let g:Tex_GotoError = 0 | |
let g:Tex_IgnoredWarnings = | |
\"Underfull\n". | |
\"Overfull\n". | |
\"specifier changed to\n". | |
\"You have requested\n". | |
\"Missing number, treated as zero.\n". | |
\"There were undefined references\n" | |
\"Citation %.%# undefined\n" | |
\"'LaTeX Font Warning:'" | |
" Set the warning messages to ignore. | |
let g:Tex_IgnoredWarnings = | |
\"Underfull\n". | |
\"Overfull\n". | |
\"specifier changed to\n". | |
\"You have requested\n". | |
\"Missing number, treated as zero.\n". | |
\'LaTeX Font Warning:'". | |
\"There were undefined references\n". | |
\"Citation %.%# undefined\n" | |
let g:Tex_IgnoreLevel = 6 | |
let g:Tex_FoldedCommands = "appendix" | |
" vim-template options | |
let g:user = "Till Hofmann" | |
let g:email = "[email protected]" | |
let g:dateformat = "%c" | |
" vimtex | |
"let g:vimtex_view_method = 'mupdf' | |
"let g:vimtex_view_general_viewer = 'qpdfview' | |
" add mappings | |
call vimtex#imaps#add_map({ | |
\ 'lhs' : 'v', | |
\ 'rhs' : '\vec' | |
\}) | |
call vimtex#imaps#add_map({ | |
\ 'lhs' : 'i', | |
\ 'rhs' : '\item ', | |
\ 'wrapper' : 'vimtex#imaps#wrap_environment', | |
\ 'context' : ["itemize", "enumerate"], | |
\}) | |
call vimtex#imaps#add_map({ | |
\ 'lhs': '(', | |
\ 'rhs': '\mleft(' | |
\}) | |
call vimtex#imaps#add_map({ | |
\ 'lhs': ')', | |
\ 'rhs': '\mright)' | |
\}) | |
let g:vimtex_fold_enabled=0 | |
"let g:vimtex_latexmk_callback=0 | |
" vimtex + neocomplete | |
if !exists('g:neocomplete#sources#omni#input_patterns') | |
let g:neocomplete#sources#omni#input_patterns = {} | |
endif | |
let g:neocomplete#sources#omni#input_patterns.tex = | |
\ '\v\\%(' | |
\ . '\a*cite\a*%(\s*\[[^]]*\]){0,2}\s*\{[^}]*' | |
\ . '|\a*ref%(\s*\{[^}]*|range\s*\{[^,}]*%(}\{)?)' | |
\ . '|hyperref\s*\[[^]]*' | |
\ . '|includegraphics\*?%(\s*\[[^]]*\]){0,2}\s*\{[^}]*' | |
\ . '|%(include%(only)?|input)\s*\{[^}]*' | |
\ . '|\a*(gls|Gls|GLS)(pl)?\a*%(\s*\[[^]]*\]){0,2}\s*\{[^}]*' | |
\ . '|includepdf%(\s*\[[^]]*\])?\s*\{[^}]*' | |
\ . '|includestandalone%(\s*\[[^]]*\])?\s*\{[^}]*' | |
\ . ')' | |
" vimtex + YouCompleteMe | |
if !exists('g:ycm_semantic_triggers') | |
let g:ycm_semantic_triggers = {} | |
endif | |
let g:ycm_semantic_triggers.tex = g:vimtex#re#youcompleteme | |
" rust with YouCompleteMe | |
let g:ycm_rust_src_path = '/usr/lib/rustlib/src/rust/src/' | |
set tabstop=2 | |
set sw=2 | |
"set textwidth=80 | |
"set colorcolumn=81 | |
highlight ColorColumn ctermbg=7 | |
set et | |
set iskeyword+=: | |
set winaltkeys=no | |
set autochdir | |
"set <m-i>=i | |
syntax on | |
set background=dark | |
set wildmode=longest,list,full | |
set wildmenu | |
" Set -j for make | |
set makeprg=make\ -j`nproc`\ uncolored-all | |
nmap <C-m> :make<CR> | |
" Set prolog as default filetype for .pl files | |
au BufRead,BufNewFile *.pl set filetype=prolog | |
"set termguicolors " enable true colors support | |
"let ayucolor="light" " for light version of theme | |
"let ayucolor="mirage" " for mirage version of theme | |
"let ayucolor="dark" " for dark version of theme | |
"colorscheme ayu | |
" YCM setttings | |
nnoremap <leader>g :YcmCompleter GoTo<CR> | |
nnoremap <leader>r :YcmCompleter GotoReferences<CR> | |
nnoremap <leader>f :YcmCompleter FixIt<CR> | |
" committia | |
let g:committia_hooks = {} | |
function! g:committia_hooks.edit_open(info) | |
" Additional settings | |
setlocal spell | |
" If no commit message, start with insert mode | |
if a:info.vcs ==# 'git' && getline(1) ==# '' | |
startinsert | |
endif | |
" Scroll the diff window from insert mode | |
" Map <C-n> and <C-p> | |
imap <buffer><C-n> <Plug>(committia-scroll-diff-down-half) | |
imap <buffer><C-p> <Plug>(committia-scroll-diff-up-half) | |
endfunction | |
" color scheme PaperColor | |
set background=light | |
colorscheme PaperColor | |
function! OneSentencePerLineFormatExpr(start, end) | |
"let l:pos = getcurpos(".") | |
silent execute a:start.','.a:end.'s/[.!?]\zs /\r/g' | |
"call setpos(".", l:pos) | |
:norm $ | |
endfunction | |
set modelineexpr | |
"autocmd FileType tex set formatexpr=OneSentencePerLineFormatExpr(v:lnum,v:lnum+v:count-1) | |
autocmd FileType tex set colorcolumn=0 | |
autocmd FileType tex set textwidth=0 | |
autocmd FileType spec set textwidth=0 | |
autocmd FileType spec set colorcolumn=0 | |
autocmd FileType csv set colorcolumn=0 | |
autocmd FileType csv set textwidth=0 | |
autocmd FileType jinja set colorcolumn=0 | |
autocmd FileType jinja set textwidth=0 | |
autocmd FileType clips set noexpandtab | |
map <C-K> :py3f /usr/share/clang/clang-format.py<cr> | |
imap <C-K> <c-o>:py3f /usr/share/clang/clang-format.py<cr> | |
map <C-n> :NERDTreeToggle<CR> | |
"autocmd FileType tex let b:ycm_largefile=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment