From 7925b5eeb9444f9d3fa7a12fd9745a48acc0eda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 28 Apr 2019 04:27:36 +0200 Subject: [PATCH] I haz colors again --- config/vim/pluginconfig | 84 ++++++++++++++ config/vim/plugins | 60 ++++++++++ config/vim/vimconfig | 87 +++++++++++++++ config/vim/vimrc | 239 +--------------------------------------- 4 files changed, 236 insertions(+), 234 deletions(-) create mode 100644 config/vim/pluginconfig create mode 100644 config/vim/plugins create mode 100644 config/vim/vimconfig diff --git a/config/vim/pluginconfig b/config/vim/pluginconfig new file mode 100644 index 0000000..c9595bc --- /dev/null +++ b/config/vim/pluginconfig @@ -0,0 +1,84 @@ +""" ALE """ + +nmap :ALEFix + +let g:ale_sign_error = '×' +let g:ale_sign_warning = '!' +let g:ale_completion_enabled = 1 +let g:ale_fixers = ['shfmt', 'uncrustify', 'remove_trailing_lines', 'trim_whitespace', 'phpcbf'] +let g:ale_php_phpcs_standard = '/srv/http/machines/ruleset.xml' + +" For PHP, install https://pear.php.net/package/PHP_CodeSniffer + + +""" UNDOTREE """ + +nmap :UndotreeToggle + +""" TAGBAR """ + +nmap :TagbarToggle + +""" VIM-AIRLINE """ + +set noshowmode +set laststatus=2 +let g:airline_powerline_fonts = 1 +" let g:airline#extensions#syntastic#enabled = 1 +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']) +let g:airline_theme = 'base16_monokai' +let g:airline#extensions#ale#enabled = 1 + +""" FZF """ + +let g:fzf_layout = { 'down': '~40%' } +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 +nmap gf :GFiles +nmap gb :Buffers +nmap gL :Lines +nmap gl :BLines +nmap gT :Tags +nmap gt :BTags +nmap gm :Marks +nmap gw :Windows +nmap gh :History +nmap gH :History: +nmap gS :History/ +nmap gs :Snippets + +" 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 = "" " Go down when completing +let g:SuperTabContextDefaultCompletionType = "" + +""" LanguageTool """ + +let g:languagetool_jar = "/usr/share/java/languagetool/languagetool-commandline.jar" + +""" vim-pandoc """ +let g:pandoc#modules#disabled = ["folding"] +let g:pandoc#spell#enabled = 0 +let g:pandoc#syntax#conceal#use = 0 + diff --git a/config/vim/plugins b/config/vim/plugins new file mode 100644 index 0000000..4af9816 --- /dev/null +++ b/config/vim/plugins @@ -0,0 +1,60 @@ +""" PLUGINS MANAGEMENT """ + +" 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 + +" Auto-install vim-plug +if empty(glob('~/.cache/vim/autoload/plug.vim')) + silent !curl -fLo ~/.cache/vim/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC +endif + +" Plugin definition +call plug#begin('~/.cache/vim/plugged') + +" Plug 'L9' +" Plug 'rstacruz/sparkup', {'rtp': 'vim/'} +Plug 'chriskempson/base16-vim' +Plug 'tpope/vim-surround' +" Plug 'tpope/vim-fugitive' +" Plug 'tpope/vim-repeat' +Plug 'tpope/tpope-vim-abolish' +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' +Plug 'airblade/vim-gitgutter' +Plug 'mbbill/undotree' +Plug 'ludovicchabant/vim-gutentags' +Plug 'majutsushi/tagbar' +Plug 'wellle/targets.vim' +" 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' +" if has('nvim') +" Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +" else +" Plug 'Shougo/deoplete.nvim' +" Plug 'roxma/nvim-yarp' +" Plug 'roxma/vim-hug-neovim-rpc' +" endif +" Plug 'zchee/deoplete-jedi' + +" Plug 'python-mode/python-mode', { 'branch': 'develop' } +Plug 'junegunn/fzf', {'do': './install --bin'} +Plug 'junegunn/fzf.vim' +Plug 'ervandew/supertab' +Plug 'dpelle/vim-LanguageTool' +Plug 'terryma/vim-smooth-scroll' +Plug 'vim-pandoc/vim-pandoc' +Plug 'vim-pandoc/vim-pandoc-syntax' +Plug 'idanarye/vim-vebugger' +Plug 'w0rp/ale' + +call plug#end() + diff --git a/config/vim/vimconfig b/config/vim/vimconfig new file mode 100644 index 0000000..bfb4bf7 --- /dev/null +++ b/config/vim/vimconfig @@ -0,0 +1,87 @@ +""" VIM SETTINGS """ + +set encoding=utf-8 +set title + +set number +set ruler +set wrap + +set scrolloff=10 + +set ignorecase +set smartcase + +set incsearch + +set hlsearch + +set tabstop=4 +set shiftwidth=4 +set expandtab + +set visualbell +set noerrorbells + +set backspace=indent,eol,start + +set hidden +set updatetime=250 + +set cursorcolumn + +set splitbelow + +set number relativenumber + +syntax enable + +" From http://stackoverflow.com/a/5004785/2766106 +set list +set listchars=tab:╾╌,trail:·,extends:↦,precedes:↤,nbsp:_ +set showbreak=↪ + +filetype on +filetype plugin on +filetype indent on + +set wildmode=longest,list +set showcmd + +" Put plugins and dictionaries in this dir (also on Windows) +let vimDir = '$HOME/.cache/vim' +let &runtimepath.=','.vimDir + +" theme +source $HOME/.cache/vim/colorscheme.vim + +" 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 + +" 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 % + +imap jk +vmap + +nmap o +nmap :bp +nmap :bn +if has('nvim') + " nmap 20k + " nmap 20j + noremap :call smooth_scroll#up(20, 5, 1) + noremap :call smooth_scroll#down(20, 5, 1) +else + nmap kkkkkkkkkkkkkkkkkkkkk + nmap jjjjjjjjjjjjjjjjjjjjj +endif + diff --git a/config/vim/vimrc b/config/vim/vimrc index 921811f..4dcfe5e 100644 --- a/config/vim/vimrc +++ b/config/vim/vimrc @@ -2,241 +2,12 @@ " set nocompatible -filetype off +filetype on -set runtimepath=~/.config/vim,~/.cache/vim +set runtimepath+=~/.config/vim,~/.cache/vim set viminfo+=n~/.cache/vim/viminfo -""" PLUGINS MANAGEMENT """ - -" 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 - -" Auto-install vim-plug -if empty(glob('~/.cache/vim/autoload/plug.vim')) - silent !curl -fLo ~/.cache/vim/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - autocmd VimEnter * PlugInstall --sync | source $MYVIMRC -endif - -" Plugin definition -call plug#begin('~/.cache/vim/plugged') - -" Plug 'L9' -" Plug 'rstacruz/sparkup', {'rtp': 'vim/'} -Plug 'chriskempson/base16-vim' -Plug 'tpope/vim-surround' -" Plug 'tpope/vim-fugitive' -" Plug 'tpope/vim-repeat' -Plug 'tpope/tpope-vim-abolish' -Plug 'vim-airline/vim-airline' -Plug 'vim-airline/vim-airline-themes' -Plug 'airblade/vim-gitgutter' -Plug 'mbbill/undotree' -Plug 'ludovicchabant/vim-gutentags' -Plug 'majutsushi/tagbar' -Plug 'wellle/targets.vim' -" 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' -" if has('nvim') -" Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } -" else -" Plug 'Shougo/deoplete.nvim' -" Plug 'roxma/nvim-yarp' -" Plug 'roxma/vim-hug-neovim-rpc' -" endif -" Plug 'zchee/deoplete-jedi' - -" Plug 'python-mode/python-mode', { 'branch': 'develop' } -Plug 'junegunn/fzf', {'do': './install --bin'} -Plug 'junegunn/fzf.vim' -Plug 'ervandew/supertab' -Plug 'dpelle/vim-LanguageTool' -Plug 'terryma/vim-smooth-scroll' -Plug 'vim-pandoc/vim-pandoc' -Plug 'vim-pandoc/vim-pandoc-syntax' -Plug 'idanarye/vim-vebugger' -Plug 'w0rp/ale' - -call plug#end() - -""" ALE """ - -nmap :ALEFix - -let g:ale_sign_error = '×' -let g:ale_sign_warning = '!' -let g:ale_completion_enabled = 1 -let g:ale_fixers = ['shfmt', 'uncrustify', 'remove_trailing_lines', 'trim_whitespace', 'phpcbf'] -let g:ale_php_phpcs_standard = '/srv/http/machines/ruleset.xml' - -" For PHP, install https://pear.php.net/package/PHP_CodeSniffer - - -""" UNDOTREE """ - -nmap :UndotreeToggle - -""" TAGBAR """ - -nmap :TagbarToggle - -""" VIM-AIRLINE """ - -set noshowmode -set laststatus=2 -let g:airline_powerline_fonts = 1 -" let g:airline#extensions#syntastic#enabled = 1 -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']) -let g:airline_theme = 'base16_monokai' -let g:airline#extensions#ale#enabled = 1 - -""" FZF """ - -let g:fzf_layout = { 'down': '~40%' } -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 -nmap gf :GFiles -nmap gb :Buffers -nmap gL :Lines -nmap gl :BLines -nmap gT :Tags -nmap gt :BTags -nmap gm :Marks -nmap gw :Windows -nmap gh :History -nmap gH :History: -nmap gS :History/ -nmap gs :Snippets - -" 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 = "" " Go down when completing -let g:SuperTabContextDefaultCompletionType = "" - -""" LanguageTool """ - -let g:languagetool_jar = "/usr/share/java/languagetool/languagetool-commandline.jar" - -""" vim-pandoc """ -let g:pandoc#modules#disabled = ["folding"] -let g:pandoc#spell#enabled = 0 -let g:pandoc#syntax#conceal#use = 0 - - -""" VIM SETTINGS """ - -set encoding=utf-8 -set title - -set number -set ruler -set wrap - -set scrolloff=10 - -set ignorecase -set smartcase - -set incsearch - -set hlsearch - -set tabstop=4 -set shiftwidth=4 -set expandtab - -set visualbell -set noerrorbells - -set backspace=indent,eol,start - -set hidden -set updatetime=250 - -set cursorcolumn - -set splitbelow - -set number relativenumber - -syntax enable - -" From http://stackoverflow.com/a/5004785/2766106 -set list -set listchars=tab:╾╌,trail:·,extends:↦,precedes:↤,nbsp:_ -set showbreak=↪ - -filetype on -filetype plugin on -filetype indent on - -set wildmode=longest,list -set showcmd - -" Put plugins and dictionaries in this dir (also on Windows) -let vimDir = '$HOME/.cache/vim' -let &runtimepath.=','.vimDir - -" theme -source $HOME/.cache/vim/colorscheme.vim - -" 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 - -" 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 % - -imap jk -vmap - -nmap o -nmap :bp -nmap :bn -if has('nvim') - " nmap 20k - " nmap 20j - noremap :call smooth_scroll#up(20, 5, 1) - noremap :call smooth_scroll#down(20, 5, 1) -else - nmap kkkkkkkkkkkkkkkkkkkkk - nmap jjjjjjjjjjjjjjjjjjjjj -endif - +source ~/.config/vim/plugins +source ~/.config/vim/pluginconfig +source ~/.config/vim/vimconfig