2017-04-22 16:53:37 +03:00
|
|
|
" set the runtime path to include Vundle and initialize
|
|
|
|
"call has('python3')
|
2017-05-23 21:29:06 +03:00
|
|
|
" Start plugins
|
|
|
|
call plug#begin('~/.vim/plugged')
|
2018-07-03 23:04:46 +03:00
|
|
|
" Sensible defaults
|
|
|
|
Plug 'tpope/vim-sensible'
|
|
|
|
|
2017-04-22 16:53:37 +03:00
|
|
|
" Javascript
|
2017-05-23 21:29:06 +03:00
|
|
|
Plug 'heavenshell/vim-jsdoc', {'for': 'javascript'}
|
2017-10-31 20:42:47 +02:00
|
|
|
Plug 'sheerun/vim-polyglot'
|
2017-05-23 21:29:06 +03:00
|
|
|
" C/C++
|
2017-12-22 23:14:27 +02:00
|
|
|
Plug 'vim-scripts/DoxygenToolkit.vim', {'for': 'cpp'}
|
2018-11-02 01:05:38 +02:00
|
|
|
" Rust
|
|
|
|
Plug 'rust-lang/rust.vim', {'for': 'rust'}
|
2018-12-22 11:28:01 +02:00
|
|
|
"Plug 'racer-rust/vim-racer', {'for': 'rust'}
|
2017-04-22 16:53:37 +03:00
|
|
|
|
|
|
|
" Syntax checking
|
2018-12-22 11:28:01 +02:00
|
|
|
Plug 'Valloric/YouCompleteMe' " alternative #1, full-blown
|
|
|
|
"Plug 'w0rp/ale',
|
2017-04-22 16:53:37 +03:00
|
|
|
|
|
|
|
" Useful plugins
|
2017-05-23 21:29:06 +03:00
|
|
|
Plug 'Raimondi/delimitMate'
|
|
|
|
Plug 'scrooloose/nerdcommenter'
|
|
|
|
Plug 'scrooloose/nerdtree'
|
|
|
|
Plug 'jlanzarotta/bufexplorer'
|
|
|
|
Plug 'ctrlpvim/ctrlp.vim'
|
2017-07-03 11:15:13 +03:00
|
|
|
Plug 'ervandew/supertab'
|
2017-10-06 22:50:36 +03:00
|
|
|
Plug 'reedes/vim-lexical'
|
2018-11-02 01:05:38 +02:00
|
|
|
Plug 'majutsushi/tagbar'
|
2017-05-23 21:29:06 +03:00
|
|
|
|
|
|
|
" Snippets
|
|
|
|
Plug 'sirver/ultisnips'
|
|
|
|
Plug 'honza/vim-snippets'
|
2017-04-22 16:53:37 +03:00
|
|
|
|
|
|
|
" Themes
|
2017-05-23 21:29:06 +03:00
|
|
|
"Plug 'Lokaltog/vim-distinguished'
|
|
|
|
"Plug 'altercation/vim-colors-solarized'
|
|
|
|
"Plug 'tomasr/molokai'
|
|
|
|
"Plug 'flazz/vim-colorschemes'
|
|
|
|
"Plug 'morhetz/gruvbox'
|
|
|
|
Plug 'chriskempson/base16-vim'
|
2017-04-22 16:53:37 +03:00
|
|
|
|
|
|
|
" Airline
|
2017-05-23 21:29:06 +03:00
|
|
|
Plug 'vim-airline/vim-airline'
|
|
|
|
Plug 'vim-airline/vim-airline-themes'
|
|
|
|
|
2017-04-22 16:53:37 +03:00
|
|
|
let g:airline_theme='base16_default'
|
|
|
|
let g:airline_powerline_fonts = 1
|
|
|
|
|
2017-05-23 21:29:06 +03:00
|
|
|
" Initialize plugin system
|
|
|
|
call plug#end()
|
|
|
|
filetype plugin indent on
|
2017-04-22 16:53:37 +03:00
|
|
|
|
2018-07-03 23:04:46 +03:00
|
|
|
" Magical color setup
|
2017-04-22 16:53:37 +03:00
|
|
|
set t_Co=256
|
|
|
|
set background=dark
|
|
|
|
syntax on
|
|
|
|
let base16colorspace=256
|
|
|
|
colorscheme base16-default-dark
|
2018-07-03 23:04:46 +03:00
|
|
|
|
|
|
|
" Other
|
2018-11-02 01:05:38 +02:00
|
|
|
set encoding=utf-8
|
2017-04-22 16:53:37 +03:00
|
|
|
set autoindent " Automatically indent
|
|
|
|
set cindent " Indentation for c
|
|
|
|
set number " Add line numbers
|
|
|
|
set hlsearch " Highlight search
|
2018-07-03 23:04:46 +03:00
|
|
|
"set sessionoptions=blank,buffers,curdir,folds,globals,help,localoptions,options,resize,tabpages,winsize,winpos
|
|
|
|
set autochdir " Change directory automatically
|
2017-04-22 16:53:37 +03:00
|
|
|
"set backupdir=~/.vim/temp/ " Save temporary backups to temp dir
|
|
|
|
"set directory=~/.vim/temp/ " Save temporary files to temp dir
|
2018-07-03 23:04:46 +03:00
|
|
|
"set hidden " Allow changing buffers eventhough they're not saved
|
2017-04-22 16:53:37 +03:00
|
|
|
"set autowrite " Automatically save the buffer when changing to another buffers
|
|
|
|
"set autowriteall " Automatically save ALL buffers when changing to another buffers
|
2018-07-03 23:04:46 +03:00
|
|
|
"set wildchar=<Tab> wildmenu wildmode=full " Show possible commands by pressing TAB
|
|
|
|
"set wildcharm=<C-Z> " This will allow you to access bufferlist with wildcard by pressing F10
|
|
|
|
set colorcolumn=80
|
|
|
|
" Set GUI parameters
|
|
|
|
if has("gui_running")
|
|
|
|
" GUI options.
|
|
|
|
set guioptions-=m " remove menu bar
|
|
|
|
set guioptions-=T " remove toolbar
|
|
|
|
set guioptions-=r " remove right-hand scroll bar
|
|
|
|
set guioptions-=L " remove left-hand scroll bar
|
|
|
|
set guifont=Fura\ Code\ Nerd\ Font\ 10
|
|
|
|
set guiheadroom=0
|
|
|
|
endif
|
2017-04-22 16:53:37 +03:00
|
|
|
|
2018-07-03 23:04:46 +03:00
|
|
|
" Keybindings
|
|
|
|
" Long list following
|
2017-04-22 16:53:37 +03:00
|
|
|
" Indentation
|
|
|
|
map <F7> mzgg=G`z
|
|
|
|
map <F3> %s<cr>
|
2018-07-03 23:04:46 +03:00
|
|
|
|
2017-04-22 16:53:37 +03:00
|
|
|
" NerdTree
|
|
|
|
map <F2> :NERDTreeToggle<cr>
|
|
|
|
imap <F2> <esc>:NERDTreeToggle<cr>i
|
2018-07-03 23:04:46 +03:00
|
|
|
|
2017-04-22 16:53:37 +03:00
|
|
|
" NerdCommenter
|
|
|
|
map <C-c> <leader>ci
|
|
|
|
inoremap <F9> <C-O>za
|
|
|
|
nnoremap <F9> za
|
|
|
|
onoremap <F9> <C-C>za
|
|
|
|
vnoremap <F9> zf
|
|
|
|
|
|
|
|
" tab navigation like firefox
|
|
|
|
nnoremap <C-S-tab> :tabprevious<CR>
|
|
|
|
nnoremap <C-tab> :tabnext<CR>
|
|
|
|
nnoremap <C-t> :tabnew<CR>
|
|
|
|
inoremap <C-S-tab> <Esc>:tabprevious<CR>i
|
|
|
|
inoremap <C-tab> <Esc>:tabnext<CR>i
|
|
|
|
inoremap <C-t> <Esc>:tabnew<CR>
|
|
|
|
|
2018-07-03 23:04:46 +03:00
|
|
|
" Session parameters
|
2017-04-22 16:53:37 +03:00
|
|
|
set ssop-=options " do not store global and local values in a session
|
|
|
|
set ssop-=folds " do not store folds
|
|
|
|
|
|
|
|
" Toggle number
|
|
|
|
:nmap <C-N><C-N> :set invnumber<CR>
|
|
|
|
|
|
|
|
" Toggle hlsearch
|
|
|
|
:nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
|
|
|
|
|
|
|
|
" Configure for jsdoc
|
|
|
|
let g:jsdoc_enable_es6 = 1
|
|
|
|
|
|
|
|
" Remove trailing whitespace automatically
|
|
|
|
autocmd BufWritePre *.js %s/\s\+$//e
|
|
|
|
autocmd BufWritePre *.cpp %s/\s\+$//e
|
|
|
|
|
2018-07-03 23:04:46 +03:00
|
|
|
" Set sane defaults for tabs
|
2017-05-23 21:29:06 +03:00
|
|
|
autocmd Filetype python setlocal ts=4 sw=4 sts=0 expandtab
|
2017-04-22 16:53:37 +03:00
|
|
|
autocmd Filetype cpp setlocal ts=4 sw=4 sts=0 expandtab
|
2018-07-03 23:04:46 +03:00
|
|
|
autocmd Filetype javascript setlocal ts=2 sw=2 sts=0 expandtab
|
|
|
|
autocmd Filetype vue setlocal ts=2 sw=2 sts=0 expandtab
|
|
|
|
autocmd Filetype json setlocal ts=2 sw=2 sts=0 expandtab
|
2018-11-02 01:05:38 +02:00
|
|
|
autocmd Filetype lua setlocal ts=2 sw=2 sts=0 expandtab
|
2018-07-03 23:04:46 +03:00
|
|
|
autocmd Filetype html setlocal ts=4 sw=4 sts=0 expandtab
|
2017-05-23 21:29:06 +03:00
|
|
|
|
2018-07-03 23:04:46 +03:00
|
|
|
" ultisnips
|
2017-05-23 21:29:06 +03:00
|
|
|
let g:UltiSnipsExpandTrigger="<c-tab>"
|
|
|
|
let g:UltiSnipsJumpForwardTrigger="<c-b>"
|
|
|
|
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
|
2017-10-06 22:50:36 +03:00
|
|
|
|
|
|
|
augroup lexical
|
|
|
|
autocmd!
|
|
|
|
autocmd FileType markdown,mkd call lexical#init()
|
|
|
|
autocmd FileType textile call lexical#init()
|
|
|
|
autocmd FileType text call lexical#init({ 'spell': 0 })
|
|
|
|
augroup END
|
2018-02-16 23:18:34 +02:00
|
|
|
|
2018-11-02 01:05:38 +02:00
|
|
|
let g:ale_linters = {
|
|
|
|
\ 'javascript': ['standard'],
|
|
|
|
\ 'vue': ['standard --plugin html "**/*.{js,vue}"']
|
|
|
|
\}
|
2018-12-22 11:28:01 +02:00
|
|
|
let g:racer_experimental_completer = 1
|
|
|
|
set completeopt+=preview
|