diff --git a/vim/.vim/config/base.vim b/vim/.vim/config/base.vim new file mode 100644 index 0000000..739c066 --- /dev/null +++ b/vim/.vim/config/base.vim @@ -0,0 +1,118 @@ +" Lines number +set number + +" Always show the statusline +set laststatus=2 + +" Necessary to show Unicode glyphs +set encoding=utf8 + +" smart tab +set smartindent + +" Tab to..? +set shiftround + +" Display edition mode +set showmode + +" Ignore case in search mode +set ignorecase + +" Override the 'ignorecase' option if the search pattern +" contains upper case characters. +set smartcase + +" Display uncomplete commands (??) +set showcmd + +" Vim file name completion relative to current file +set autochdir + +" While typing a search command, show immediately where the +" so far typed pattern matches. +set incsearch + +" Use to clear the highlighting of :set hlsearch. +set hlsearch +if maparg('', 'n') ==# '' + nnoremap :nohlsearch=has('diff')?'diffupdate':'' +endif + +" Turn on the WiLd menu +set wildmenu + +" Ignore compiled files +set wildignore=*.o,*~,*.pyc,*.swp + +" Wrap lines +set wrap + +" Turn backup off, since most stuff is in SVN, git et.c anyway... +set nobackup +set noswapfile + +" Having relative number for lines +set relativenumber + +" Display tab and ends of lines +" Shortcut to rapidly toggle `set list` +nmap L :set list! + +" Behaviour of tab +set tabstop=4 +set shiftwidth=4 +set softtabstop=4 +set expandtab + +" Folding +set foldmethod=indent + +" Use the same symbols as TextMate for tabstops and EOLs +" set listchars=tab:▸\ ,eol:¬ +set listchars=nbsp:¤,tab:··,trail:¤,extends:▶,precedes:◀ + +" allow backspacing over everything in insert mode +set backspace=indent,eol,start + +set history=50 " keep 50 lines of command line history +set ruler " show the cursor position all the time +" +" In many terminal emulators the mouse works just fine, thus enable it. +if has('mouse') + set mouse=a +endif + +" Decorations +" ==================== +" Switch syntax highlighting on, when the terminal has colors +" Also switch on highlighting the last used search pattern. +if &t_Co > 2 || has("gui_running") + syntax on +endif + +" When set to "dark", Vim will try to use colors that look +" good on a dark background. When set to "light", Vim will +" try to use colors that look good on a light background. +" Any other value is illegal. +set background=dark + +" Color Scheme +colorscheme zenburn + +set cursorline + +" Align blocks of text and keep them selected +vmap < >gv + +" Spelling +" set spelllang=fr +autocmd BufRead,BufNewFile *.{md,tex,rst} setlocal spell spelllang=fr +autocmd FileType tex,latex,markdown,md,rst setlocal spell spelllang=fr + +" Remove trailing whitespace at the end of lines +autocmd BufWritePre * %s/\s\+$//e + +" Different color for far columns +execute "set colorcolumn=" . join(range(81,335), ',') diff --git a/vim/.vim/config/plugins.vim b/vim/.vim/config/plugins.vim new file mode 100644 index 0000000..899425e --- /dev/null +++ b/vim/.vim/config/plugins.vim @@ -0,0 +1,24 @@ +" lightline -> no need showmod +set noshowmode +let g:lightline = { + \ 'colorscheme': 'selenized_dark', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ] + \ }, + \ 'component_function': { + \ 'gitbranch': 'FugitiveHead' + \ }, + \ } + +" Supertab +let g:SuperTabDefaultCompletionType = "context" + +" Airline +let g:airline_powerline_fonts = 1 +let g:tmuxline_powerline_separators = 0 + +" Nerdtree +let NERDTreeIgnore = ['.pyc$'] +"autocmd VimEnter * NERDTree + diff --git a/vim/.vimrc b/vim/.vimrc new file mode 100644 index 0000000..35ee041 --- /dev/null +++ b/vim/.vimrc @@ -0,0 +1,61 @@ +set nocompatible " be iMproved, required +noremap +map +let mapleader = "\" +let localleader = "\" + +" set the runtime path to include plug.com and initialize +call plug#begin('~/.vim/plugged') + +"" plug.vim management +Plug 'junegunn/vim-plug' + +" Airline statusline +Plug 'itchyny/lightline.vim' + + +"" Basic config for vim +Plug 'tpope/vim-sensible' + +" Git integration +Plug 'tpope/vim-fugitive' + +" Nerdtree +Plug 'scrooloose/nerdtree' +Plug 'Xuyuanp/nerdtree-git-plugin' + + +" Change surround +Plug 'tpope/vim-surround' + +" Clever substitute +Plug 'tpope/tpope-vim-abolish' + +" Repeat +Plug 'tpope/vim-repeat' + +" Git on lines +Plug 'airblade/vim-gitgutter' + +" Polyglot synthax hightlight autodetect +Plug 'sheerun/vim-polyglot' + +" Show indent lines +Plug 'Yggdroot/indentLine' + +" Tmux integration +Plug 'christoomey/vim-tmux-navigator' + +"" Color scheme +Plug 'jnurmine/Zenburn' + +" All of your Plugs must be added before the following line +call plug#end() " required +" + +" import config from ./config +" runtime! config/**/*.vim +"runtime! config/*.vim +runtime! config/base.vim +runtime! config/plugins.vim +set conceallevel=0