2016-01-24 19:32:42 +01:00
|
|
|
set nocompatible
|
2021-11-12 12:30:00 +01:00
|
|
|
syntax on
|
2019-10-04 12:30:18 +02:00
|
|
|
let VIMHOME = split(&rtp, ",")[0]
|
|
|
|
let $VIMHOME = VIMHOME
|
|
|
|
|
|
|
|
" vim-plug
|
|
|
|
call plug#begin(VIMHOME."/plugs")
|
2021-11-12 12:30:00 +01:00
|
|
|
" Plug 'OmniSharp/omnisharp-vim'
|
|
|
|
Plug 'Valloric/YouCompleteMe'
|
|
|
|
Plug 'vimwiki/vimwiki'
|
|
|
|
Plug 'rhysd/vim-grammarous'
|
2019-10-04 12:30:18 +02:00
|
|
|
Plug 'ConradIrwin/vim-bracketed-paste'
|
2021-11-12 12:30:00 +01:00
|
|
|
Plug 'NLKNguyen/papercolor-theme'
|
2019-10-04 12:30:18 +02:00
|
|
|
Plug 'Shougo/deoplete.nvim'
|
|
|
|
Plug 'christoomey/vim-tmux-navigator'
|
|
|
|
Plug 'cohama/lexima.vim', {'do': 'sed -i \"s/has(.nvim.) && //\" autoload/lexima/insmode.vim'}
|
|
|
|
Plug 'editorconfig/editorconfig-vim'
|
|
|
|
Plug 'gmarik/Vundle.vim'
|
|
|
|
Plug 'hdima/python-syntax'
|
|
|
|
Plug 'jeetsukumaran/vim-buffergator'
|
|
|
|
Plug 'kien/ctrlp.vim'
|
|
|
|
Plug 'kristijanhusak/vim-hybrid-material'
|
2021-11-12 12:30:00 +01:00
|
|
|
Plug 'lervag/vimtex'
|
|
|
|
" Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'yarn install --frozen-lockfile'}
|
|
|
|
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
|
|
|
Plug 'neovimhaskell/haskell-vim'
|
2019-10-04 12:30:18 +02:00
|
|
|
Plug 'nixprime/cpsm', {'do': './install.sh'}
|
2021-11-12 12:30:00 +01:00
|
|
|
Plug 'nvie/vim-flake8'
|
2019-10-04 12:30:18 +02:00
|
|
|
Plug 'octol/vim-cpp-enhanced-highlight'
|
|
|
|
Plug 'pangloss/vim-javascript'
|
2021-11-12 12:30:00 +01:00
|
|
|
Plug 'posva/vim-vue'
|
|
|
|
Plug 'roxma/nvim-yarp'
|
|
|
|
Plug 'roxma/vim-hug-neovim-rpc'
|
2019-10-04 12:30:18 +02:00
|
|
|
Plug 'tmux-plugins/vim-tmux'
|
|
|
|
Plug 'tmux-plugins/vim-tmux-focus-events'
|
|
|
|
Plug 'tomtom/tcomment_vim'
|
|
|
|
Plug 'vim-airline/vim-airline'
|
|
|
|
Plug 'vim-airline/vim-airline-themes'
|
2021-11-12 12:30:00 +01:00
|
|
|
Plug 'vim-scripts/indentpython.vim'
|
2019-10-04 12:30:18 +02:00
|
|
|
call plug#end()
|
|
|
|
|
|
|
|
let g:ycm_global_ycm_extra_conf = '~/.vim/.ycm_extra_conf.py'
|
2016-01-24 19:32:42 +01:00
|
|
|
|
|
|
|
let mapleader=","
|
|
|
|
|
2016-09-03 15:46:24 +02:00
|
|
|
:command W w
|
|
|
|
:command Q q
|
|
|
|
:command WQ wq
|
|
|
|
:command Wq wq
|
2017-01-06 16:48:51 +01:00
|
|
|
nnoremap j gj
|
|
|
|
nnoremap k gk
|
2016-09-03 15:46:24 +02:00
|
|
|
|
2017-01-06 16:48:51 +01:00
|
|
|
" don't store .swp files in the file's own directory
|
|
|
|
" neither for .ext~ files
|
2021-11-12 12:30:00 +01:00
|
|
|
set directory=/home/user/.vim/tmp/
|
|
|
|
set backupdir=/home/user/.vim/tmp/
|
|
|
|
|
|
|
|
" VimWiki
|
|
|
|
let g:vimwiki_key_mappings = { 'table_mappings': 0 }
|
|
|
|
let g:vimwiki_markdown_link_ext = 1
|
|
|
|
autocmd FileType vimwiki setlocal shiftwidth=2 softtabstop=2 expandtab
|
2016-09-03 15:46:24 +02:00
|
|
|
|
|
|
|
" Autoindent for filetype
|
2016-01-24 19:32:42 +01:00
|
|
|
filetype plugin indent on
|
|
|
|
set autoindent
|
|
|
|
|
|
|
|
set encoding=utf-8
|
2016-09-03 15:46:24 +02:00
|
|
|
set scrolloff=5
|
|
|
|
set sidescrolloff=10
|
|
|
|
|
|
|
|
set completeopt-=preview
|
|
|
|
|
|
|
|
set backspace=indent,eol,start
|
|
|
|
|
2019-10-04 12:30:18 +02:00
|
|
|
" Splits
|
|
|
|
set splitbelow
|
|
|
|
set splitright
|
|
|
|
|
2016-09-03 15:46:24 +02:00
|
|
|
" CtrlP
|
|
|
|
let g:ctrlp_match_func = {'match': 'cpsm#CtrlPMatch'}
|
2019-10-04 12:30:18 +02:00
|
|
|
nnoremap <silent> <C-o> :CtrlPBuffer<CR>
|
2016-09-03 15:46:24 +02:00
|
|
|
let g:cpsm_unicode=1
|
|
|
|
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
|
2016-01-24 19:32:42 +01:00
|
|
|
|
|
|
|
" Unsaved buffer switching
|
|
|
|
set hidden
|
|
|
|
|
|
|
|
" Line numbering
|
|
|
|
set number
|
2016-09-03 15:46:24 +02:00
|
|
|
set numberwidth=4
|
|
|
|
:set mouse=a
|
|
|
|
|
2017-01-06 16:48:51 +01:00
|
|
|
" Allow xterm-key usage inside tmux
|
|
|
|
execute "set <xUp>=\e[1;*A"
|
|
|
|
execute "set <xDown>=\e[1;*B"
|
|
|
|
execute "set <xRight>=\e[1;*C"
|
|
|
|
execute "set <xLeft>=\e[1;*D"
|
2016-01-24 19:32:42 +01:00
|
|
|
|
|
|
|
" Persistent undo
|
2016-09-03 15:46:24 +02:00
|
|
|
set undodir=~/.vim/undodir/
|
2016-01-24 19:32:42 +01:00
|
|
|
set undofile
|
|
|
|
set undolevels=1000
|
|
|
|
set undoreload=10000
|
|
|
|
|
|
|
|
" Searching
|
|
|
|
set ignorecase
|
|
|
|
set smartcase
|
|
|
|
set incsearch
|
|
|
|
set hlsearch
|
|
|
|
nnoremap <leader><space> :noh<CR>
|
|
|
|
|
|
|
|
" Text wrapping
|
|
|
|
set lbr
|
|
|
|
|
2021-11-12 12:30:00 +01:00
|
|
|
" Vimtex
|
|
|
|
|
|
|
|
let g:tex_flavor = 'latex'
|
|
|
|
|
2016-01-24 19:32:42 +01:00
|
|
|
" Tabs
|
|
|
|
if has("autocmd")
|
|
|
|
filetype plugin indent on
|
|
|
|
autocmd FileType make set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab
|
|
|
|
endif
|
|
|
|
|
2016-09-03 15:46:24 +02:00
|
|
|
" Quickfix
|
2019-10-04 12:30:18 +02:00
|
|
|
nnoremap <silent> <leader>f :YcmCompleter FixIt<CR>:cexpr []<CR>:cclose<CR>
|
2017-01-06 16:48:51 +01:00
|
|
|
nnoremap <silent> <leader>g :YcmCompleter GoTo<CR>
|
|
|
|
|
2016-09-03 15:46:24 +02:00
|
|
|
|
2016-01-24 19:32:42 +01:00
|
|
|
" Terminal colors
|
|
|
|
set t_Co=256
|
2019-10-04 12:30:18 +02:00
|
|
|
set background=dark
|
2017-01-06 16:48:51 +01:00
|
|
|
let g:airline_theme="solarized"
|
2019-10-04 12:30:18 +02:00
|
|
|
let g:airline_solarized_bg="dark"
|
2016-01-24 19:32:42 +01:00
|
|
|
|
|
|
|
set tabstop=4
|
|
|
|
set shiftwidth=4
|
|
|
|
set softtabstop=4
|
|
|
|
set expandtab
|
|
|
|
|
2017-01-06 16:48:51 +01:00
|
|
|
" Commenting
|
|
|
|
nnoremap <silent> <leader>c :TComment<CR>
|
|
|
|
nnoremap <silent> <leader>C :TCommentBlock<CR>
|
|
|
|
vnoremap <silent> <leader>c :TCommentInline<CR>
|
|
|
|
vnoremap <silent> <leader>C :TCommentBlock<CR>
|
|
|
|
|
2016-01-24 19:32:42 +01:00
|
|
|
" Tab completion
|
|
|
|
set wildmode=longest,list
|
|
|
|
set wildmenu
|
|
|
|
|
|
|
|
set guifont=Ubuntu\ Mono\ derivative\ Powerline\ 13
|
|
|
|
let g:airline_powerline_fonts = 1
|
|
|
|
set laststatus=2
|
|
|
|
set ttimeoutlen=50
|
|
|
|
|
2016-09-03 15:46:24 +02:00
|
|
|
" Color scheme
|
2016-01-24 19:32:42 +01:00
|
|
|
syntax enable
|
2016-09-03 15:46:24 +02:00
|
|
|
let python_highlight_all=1
|
2016-01-24 19:32:42 +01:00
|
|
|
let g:solarized_termcolors=256
|
2019-10-04 12:30:18 +02:00
|
|
|
colorscheme hybrid_material
|
|
|
|
|
|
|
|
" Remap u to y
|
|
|
|
vnoremap u y
|
|
|
|
|
|
|
|
" Save clipboard on quit
|
|
|
|
autocmd VimLeave * call system("xsel -ib", getreg('+'))
|
|
|
|
|
|
|
|
" Automatically remove trailing spaces
|
2021-11-12 12:30:00 +01:00
|
|
|
let blacklist = ['vimwiki']
|
|
|
|
autocmd BufWritePre * if index(blacklist, &ft) < 0 | :%s/\s\+$//e
|
2019-10-04 12:30:18 +02:00
|
|
|
|
|
|
|
" Use deoplete.
|
|
|
|
autocmd FileType python let g:deoplete#enable_at_startup = 1
|
|
|
|
|
|
|
|
" VPW: set filetype for .py3
|
|
|
|
autocmd BufRead,BufNewFile *.py3 set filetype=python
|
|
|
|
|
|
|
|
" Vue indent
|
|
|
|
autocmd FileType vue setlocal shiftwidth=2 softtabstop=2 expandtab
|
|
|
|
autocmd FileType javascript setlocal shiftwidth=2 softtabstop=2 expandtab
|
|
|
|
autocmd FileType vue syntax sync fromstart
|
|
|
|
|
|
|
|
" Disable shift+k for manual lookup
|
|
|
|
map <S-k> <Nop>
|
|
|
|
|
|
|
|
" Prolog: set filetype for .pl
|
|
|
|
autocmd BufRead,BufNewFile *.pl set filetype=prolog
|
|
|
|
|
|
|
|
" Disable modelines, fix CVE
|
|
|
|
set modelines=0
|
|
|
|
set nomodeline
|
|
|
|
|
|
|
|
" Coc extensions
|
|
|
|
let g:coc_global_extensions = []
|
|
|
|
command! -nargs=1 Ext :call add(g:coc_global_extensions, <args>)
|
|
|
|
|
|
|
|
Ext 'coc-snippets'
|
|
|
|
Ext 'coc-emoji'
|
|
|
|
Ext 'coc-highlight'
|
|
|
|
Ext 'coc-emmet'
|
2021-11-12 12:30:00 +01:00
|
|
|
Ext 'coc-omnisharp'
|
2019-10-04 12:30:18 +02:00
|
|
|
Ext 'coc-vimtex'
|
|
|
|
Ext 'coc-json'
|
|
|
|
Ext 'coc-java'
|
|
|
|
|
|
|
|
delc Ext
|
2017-01-06 16:48:51 +01:00
|
|
|
|
2019-10-04 12:30:18 +02:00
|
|
|
" Tab for completion
|
2017-01-06 16:48:51 +01:00
|
|
|
|
2019-10-04 12:30:18 +02:00
|
|
|
" use <tab> for trigger completion and navigate to the next complete item
|
2021-11-12 12:30:00 +01:00
|
|
|
" function! s:check_back_space() abort
|
|
|
|
" let col = col('.') - 1
|
|
|
|
" return !col || getline('.')[col - 1] =~ '\s'
|
|
|
|
" endfunction
|
|
|
|
"
|
|
|
|
" inoremap <silent><expr> <Tab>
|
|
|
|
" \ pumvisible() ? "\<C-n>" :
|
|
|
|
" \ <SID>check_back_space() ? "\<Tab>" :
|
|
|
|
" \ coc#refresh()
|