2015-07-12 17:50:37 +02:00
|
|
|
" VIM Configuration - Geoffrey FROGEYE
|
|
|
|
"
|
|
|
|
|
|
|
|
set nocompatible
|
|
|
|
filetype off
|
|
|
|
|
|
|
|
""" PLUGINS MANAGEMENT """
|
|
|
|
|
2018-06-24 18:27:20 +02:00
|
|
|
" NOTE 18-06-24 Got rid of Vundle in favor of vim-plug (why: more recent, supports
|
|
|
|
" Neovim, simpler). Commented out plugins that seemed useless, feel free to
|
|
|
|
" uncomment them again if you need to
|
2017-02-13 06:40:24 +01:00
|
|
|
|
2018-06-24 18:27:20 +02:00
|
|
|
" Auto-install vim-plug
|
|
|
|
if empty(glob('~/.vim/autoload/plug.vim'))
|
|
|
|
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
|
|
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
|
|
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
|
|
|
endif
|
2017-02-13 06:40:24 +01:00
|
|
|
|
2018-06-24 18:27:20 +02:00
|
|
|
" Plugin definition
|
|
|
|
call plug#begin()
|
|
|
|
|
|
|
|
" Plug 'L9'
|
|
|
|
" Plug 'rstacruz/sparkup', {'rtp': 'vim/'}
|
|
|
|
Plug 'tomasr/molokai'
|
2018-07-10 14:50:07 +02:00
|
|
|
Plug 'tpope/vim-surround'
|
2018-06-24 18:27:20 +02:00
|
|
|
" Plug 'tpope/vim-fugitive'
|
|
|
|
" Plug 'tpope/vim-repeat'
|
2018-07-10 14:50:07 +02:00
|
|
|
Plug 'tpope/tpope-vim-abolish'
|
2018-06-24 18:27:20 +02:00
|
|
|
Plug 'vim-airline/vim-airline'
|
|
|
|
Plug 'vim-airline/vim-airline-themes'
|
|
|
|
Plug 'airblade/vim-gitgutter'
|
|
|
|
Plug 'mbbill/undotree'
|
|
|
|
Plug 'xolox/vim-misc' " Required for 'xolox/vim-easytags'
|
|
|
|
Plug 'xolox/vim-easytags'
|
|
|
|
Plug 'majutsushi/tagbar'
|
2018-07-10 14:50:07 +02:00
|
|
|
Plug 'wellle/targets.vim'
|
2018-06-24 18:27:20 +02:00
|
|
|
Plug 'Chiel92/vim-autoformat'
|
|
|
|
Plug 'tomtom/tcomment_vim'
|
|
|
|
" Plug 'Shougo/denite.nvim'
|
|
|
|
" Plug 'tomlion/vim-solidity'
|
|
|
|
" Plug 'godlygeek/tabular'
|
|
|
|
" Plug 'jrozner/vim-antlr'
|
|
|
|
Plug 'maralla/completor.vim'
|
|
|
|
Plug 'python-mode/python-mode', { 'branch': 'develop' }
|
|
|
|
Plug 'junegunn/fzf', {'do': './install --bin'}
|
|
|
|
Plug 'junegunn/fzf.vim'
|
2018-07-10 14:50:07 +02:00
|
|
|
Plug 'ervandew/supertab'
|
|
|
|
Plug 'dpelle/vim-LanguageTool'
|
2018-06-24 18:27:20 +02:00
|
|
|
|
|
|
|
call plug#end()
|
2015-07-12 17:50:37 +02:00
|
|
|
|
2018-06-24 18:27:20 +02:00
|
|
|
""" UNDOTREE """
|
2015-07-12 17:50:37 +02:00
|
|
|
|
2018-06-24 18:27:20 +02:00
|
|
|
nmap <F7> :UndotreeToggle<CR>
|
2017-07-26 09:42:41 +02:00
|
|
|
|
2017-02-13 06:40:24 +01:00
|
|
|
""" TAGBAR """
|
|
|
|
|
|
|
|
nmap <F8> :TagbarToggle<CR>
|
|
|
|
|
2015-07-12 17:50:37 +02:00
|
|
|
""" VIM-AIRLINE """
|
|
|
|
|
|
|
|
set noshowmode
|
|
|
|
set laststatus=2
|
|
|
|
let g:airline_powerline_fonts = 1
|
2017-01-14 16:46:30 +01:00
|
|
|
" let g:airline#extensions#syntastic#enabled = 1
|
2015-07-12 17:50:37 +02:00
|
|
|
let g:airline#extensions#tabline#enabled = 1
|
|
|
|
|
|
|
|
let g:airline_section_a = airline#section#create(['mode'])
|
|
|
|
let g:airline_section_b = airline#section#create(['branch', 'hunks'])
|
|
|
|
let g:airline_section_z = airline#section#create(['%B', '@', '%l', ':', '%c'])
|
2017-02-12 07:45:14 +01:00
|
|
|
let g:airline_theme = 'wombat'
|
2015-07-12 17:50:37 +02:00
|
|
|
|
2017-07-26 09:42:41 +02:00
|
|
|
""" AUTOFORMAT """
|
|
|
|
nmap <F3> :Autoformat<CR>
|
2017-01-14 16:46:30 +01:00
|
|
|
|
2018-06-24 18:27:20 +02:00
|
|
|
""" PYMODE """
|
|
|
|
|
2018-07-10 14:50:07 +02:00
|
|
|
let g:pymode_lint_ignore = ["W0401"]
|
2018-06-24 18:27:20 +02:00
|
|
|
let g:pymode_lint_cwindow = 0
|
|
|
|
|
2018-07-10 14:50:07 +02:00
|
|
|
" TODO Even with magic pymod_motion complains about the option `magic&` being not set :/
|
|
|
|
let g:pymode_motion = 0
|
|
|
|
set magic
|
|
|
|
|
2018-06-24 18:27:20 +02:00
|
|
|
""" FZF """
|
|
|
|
|
|
|
|
let g:fzf_layout = { 'down': '~100%' }
|
|
|
|
let g:fzf_colors =
|
|
|
|
\ { 'fg': ['fg', 'Normal'],
|
|
|
|
\ 'bg': ['bg', 'Normal'],
|
|
|
|
\ 'hl': ['fg', 'Comment'],
|
|
|
|
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
|
|
|
|
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
|
|
|
|
\ 'hl+': ['fg', 'Statement'],
|
|
|
|
\ 'info': ['fg', 'PreProc'],
|
|
|
|
\ 'border': ['fg', 'Ignore'],
|
|
|
|
\ 'prompt': ['fg', 'Conditional'],
|
|
|
|
\ 'pointer': ['fg', 'Exception'],
|
|
|
|
\ 'marker': ['fg', 'Keyword'],
|
|
|
|
\ 'spinner': ['fg', 'Label'],
|
|
|
|
\ 'header': ['fg', 'Comment'] }
|
|
|
|
|
|
|
|
nmap gF :Files<CR>
|
|
|
|
nmap gf :GFiles<CR>
|
|
|
|
nmap gb :Buffers<CR>
|
|
|
|
nmap gL :Lines<CR>
|
|
|
|
nmap gl :BLines<CR>
|
|
|
|
nmap gT :Tags<CR>
|
|
|
|
nmap gt :BTags<CR>
|
|
|
|
nmap gm :Marks<CR>
|
|
|
|
nmap gw :Windows<CR>
|
|
|
|
nmap gh :History<CR>
|
|
|
|
nmap gH :History:<CR>
|
|
|
|
nmap gS :History/<CR>
|
|
|
|
nmap gs :Snippets<CR>
|
2017-02-13 06:40:24 +01:00
|
|
|
|
2018-07-10 14:50:07 +02:00
|
|
|
" TODO `gd` → go to tag matching selected word, or show a list with that
|
|
|
|
" of tags pre-filtered with that word
|
|
|
|
|
|
|
|
""" SUPERTAB """
|
|
|
|
|
|
|
|
let g:SuperTabDefaultCompletionType = "<c-n>" " Go down when completing
|
|
|
|
let g:SuperTabContextDefaultCompletionType = "<c-n>"
|
|
|
|
|
|
|
|
""" LanguageTool """
|
|
|
|
|
|
|
|
let g:languagetool_jar = "/usr/share/java/languagetool/languagetool-commandline.jar"
|
|
|
|
|
2016-02-20 23:53:40 +01:00
|
|
|
|
2015-07-12 17:50:37 +02:00
|
|
|
""" VIM SETTINGS """
|
|
|
|
|
|
|
|
set encoding=utf-8
|
|
|
|
set title
|
|
|
|
|
|
|
|
set number
|
|
|
|
set ruler
|
|
|
|
set wrap
|
|
|
|
|
|
|
|
set scrolloff=5
|
|
|
|
|
|
|
|
set ignorecase
|
|
|
|
set smartcase
|
|
|
|
|
|
|
|
set incsearch
|
|
|
|
|
|
|
|
set hlsearch
|
|
|
|
|
2015-11-20 14:03:59 +01:00
|
|
|
set tabstop=4
|
|
|
|
set shiftwidth=4
|
|
|
|
set expandtab
|
|
|
|
|
2015-07-12 17:50:37 +02:00
|
|
|
set visualbell
|
|
|
|
set noerrorbells
|
|
|
|
|
|
|
|
set backspace=indent,eol,start
|
|
|
|
|
|
|
|
set hidden
|
2016-02-20 23:53:40 +01:00
|
|
|
set updatetime=250
|
2015-07-12 17:50:37 +02:00
|
|
|
|
2017-01-14 16:46:30 +01:00
|
|
|
set cursorcolumn
|
|
|
|
|
2018-07-10 14:50:07 +02:00
|
|
|
set splitbelow
|
|
|
|
|
2015-07-12 17:50:37 +02:00
|
|
|
syntax enable
|
|
|
|
|
|
|
|
set background=dark
|
2017-02-12 07:45:14 +01:00
|
|
|
colorscheme molokai
|
2017-07-02 22:06:24 +02:00
|
|
|
let g:molokai_original = 1
|
2016-02-20 23:53:40 +01:00
|
|
|
|
2016-03-16 14:23:03 +01:00
|
|
|
" From http://stackoverflow.com/a/5004785/2766106
|
|
|
|
set list
|
|
|
|
set listchars=tab:╾╌,trail:·,extends:↦,precedes:↤,nbsp:_
|
2016-08-03 20:01:24 +02:00
|
|
|
set showbreak=↪
|
2015-07-12 17:50:37 +02:00
|
|
|
|
|
|
|
filetype on
|
|
|
|
filetype plugin on
|
|
|
|
filetype indent on
|
|
|
|
|
2018-06-24 18:27:20 +02:00
|
|
|
set wildmode=longest,list
|
|
|
|
set showcmd
|
|
|
|
|
2016-01-12 14:05:27 +01:00
|
|
|
" Put plugins and dictionaries in this dir (also on Windows)
|
|
|
|
let vimDir = '$HOME/.vim'
|
|
|
|
let &runtimepath.=','.vimDir
|
|
|
|
|
|
|
|
" Keep undo history across sessions by storing it in a file
|
|
|
|
if has('persistent_undo')
|
|
|
|
let myUndoDir = expand(vimDir . '/undodir')
|
|
|
|
" Create dirs
|
|
|
|
call system('mkdir ' . vimDir)
|
|
|
|
call system('mkdir ' . myUndoDir)
|
|
|
|
let &undodir = myUndoDir
|
|
|
|
set undofile
|
|
|
|
endif
|
|
|
|
|
2017-07-26 09:42:41 +02:00
|
|
|
" Allow saving of files as sudo when I forgot to start vim using sudo.
|
|
|
|
" From https://stackoverflow.com/a/7078429
|
|
|
|
cmap w!! w !sudo tee > /dev/null %
|
|
|
|
|
2017-01-14 16:46:30 +01:00
|
|
|
imap jk <Esc>
|
2018-07-10 14:50:07 +02:00
|
|
|
vmap <Enter> <Esc>
|
2018-06-24 18:27:20 +02:00
|
|
|
|
|
|
|
nmap <Enter> o<Esc>
|
2017-09-01 18:39:06 +02:00
|
|
|
nmap <C-H> :bp<CR>
|
|
|
|
nmap <C-L> :bn<CR>
|
|
|
|
nmap <C-K> kkkkkkkkkkkkkkkkkkkkk
|
|
|
|
nmap <C-J> jjjjjjjjjjjjjjjjjjjjj
|
2017-07-26 09:42:41 +02:00
|
|
|
|
2015-07-12 17:50:37 +02:00
|
|
|
|