Vim dotfiles

This commit is contained in:
Bertrand Benjamin 2018-08-23 16:41:22 +02:00
parent 8343fe1a9c
commit 63b994861c
7 changed files with 362 additions and 0 deletions

6
files/vim/.netrwhist Normal file
View File

@ -0,0 +1,6 @@
let g:netrw_dirhistmax =10
let g:netrw_dirhist_cnt =4
let g:netrw_dirhist_1='/home/lafrite/Cours/Prof/Enseignements/2017-2018/6e'
let g:netrw_dirhist_2='/home/lafrite/Cours/Prof/Enseignements/2017-2018/6e/Nombres_Calculs'
let g:netrw_dirhist_3='/home/lafrite/Cours/Prof/Enseignements/2017-2018/6e/Nombres_Calculs/Numerations_divers'
let g:netrw_dirhist_4='/home/lafrite/scripts/config/vim/bundle/TTCoach/macros/ttcoach/en'

View File

@ -0,0 +1,19 @@
snippet todo "A python todo mark" b
# TODO: ${1:desc} |`date`
endsnippet
snippet tvar "testing a variable" b
print("${1:Varname} -> ", $1)
endsnippet
# Unittest
snippet deftest "test function without docstrings" b
def test_${1:function}(`!p
if snip.indent:
snip.rv = 'self' `):
${0:pass}
endsnippet

123
files/vim/config/base.vim Normal file
View File

@ -0,0 +1,123 @@
" Lines number
set number
" Always show the statusline
set laststatus=2
" Necessary to show Unicode glyphs
set encoding=utf8
" tab length
set tabstop=4
" 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 <C-L> to clear the highlighting of :set hlsearch.
set hlsearch
if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
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 <leader>L :set list!<CR>
" 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
vmap > >gv
" Spelling
set spelllang=fr
" Set and unset spelling correction
map <silent> <F7> "<Esc>:silent setlocal spell! spelllang=en<CR>"
map <silent> <F6> "<Esc>:silent setlocal spell! spelllang=fr<CR>"
autocmd BufRead,BufNewFile *.{md,tex,rst} setlocal spell
execute "set colorcolumn=" . join(range(81,335), ',')
" Show what is written!
set conceallevel=0

View File

@ -0,0 +1,72 @@
" Supertab
let g:SuperTabDefaultCompletionType = "context"
" Ultisnips
let g:ultisnips_python_style='sphinx'
let g:UltiSnipsEditSplit='vertical'
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
" let g:UltiSnipsExpandTrigger="tab"
let g:UltiSnipsExpandTrigger="<c-k>"
" Airline
let g:airline_powerline_fonts = 1
let g:tmuxline_powerline_separators = 0
" Nerdtree
let NERDTreeIgnore = ['.pyc$']
"autocmd VimEnter * NERDTree
" Vim-notes
let g:notes_directories = ['~/Documents/Notes']
let g:notes_suffix = '.md'
" Ale
let g:ale_sign_column_always = 1
let g:ale_sign_error = '⚑'
let g:ale_sign_warning = '⚐'
" fzf
" Search and switch buffers
nmap <leader>b :Buffers<cr>
" Find files by name under the current directory
nmap <leader>f :Files<cr>
" Find files by name under the home directory
nmap <leader>h :Files ~/<cr>
" Search content in the current file
" nmap <leader>l :BLines<cr>
" Search content in the current file and in files under the current directory
" nmap <leader>g :Ag<cr>
" IndentLine
let g:indentLine_fileTypeExclude = ['tex']
" let g:indentLine_concealcursor = ''
" let g:indentLine_conceallevel = 1
"
" Vim-polyglot
" let g:LatexBox_no_mappings = 1
let g:polyglot_disabled = ["latex"]
" Vimtex
let g:vimtex_compiler_latexmk = {
\ 'backend' : 'jobs',
\ 'background' : 1,
\ 'build_dir' : '',
\ 'callback' : 0,
\ 'continuous' : 1,
\ 'options' : [
\ '-pdf',
\ '-verbose',
\ '-file-line-error',
\ '-synctex=1',
\ '-interaction=nonstopmode',
\ '-silent',
\ '-shell-escape',
\ ],
\}
" Les fichiers sty et cls sont vus comme des fichiers tex
autocmd BufRead,BufNewFile *.{sty,cls} setlocal syntax=tex
autocmd FileType latex unmap <leader>ll
autocmd FileType latex nmap <leader>ll <plug>(vimtex-compile)

View File

@ -0,0 +1,14 @@
#!/usr/bin/env python
# encoding: utf-8
__all__ = []
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del

106
files/vimrc Normal file
View File

@ -0,0 +1,106 @@
set nocompatible " be iMproved, required
" set the runtime path to include plug.com and initialize
call plug#begin('~/.vim/plugged')
" Airline statusline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
"" plug.vim management
Plug 'junegunn/vim-plug'
"" Basic config for vim
Plug 'tpope/vim-sensible'
" Git integration
Plug 'tpope/vim-fugitive'
" Nerdtree
Plug 'scrooloose/nerdtree'
"Plug 'jistr/vim-nerdtree-tabs'
" Supertab (tab instead of ctrl-n or p
Plug 'ervandew/supertab'
" Special autocompletion
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
"Plug 'ctrlpvim/ctrlp.vim'
"Plug 'Valloric/YouCompleteMe'
" Change surround
Plug 'tpope/vim-surround'
"" Plug vimtex
Plug 'lervag/vimtex'
" Asynchronous Lint Engine
Plug 'w0rp/ale'
" Completion for python
Plug 'davidhalter/jedi-vim'
" Vim note taking plugin
Plug 'xolox/vim-misc'
Plug 'xolox/vim-notes'
" vuejs syntax
Plug 'posva/vim-vue'
" Clever substitute
Plug 'tpope/tpope-vim-abolish'
" Repeat
Plug 'tpope/vim-repeat'
" Git on lines
Plug 'airblade/vim-gitgutter'
" Emmet
Plug 'mattn/emmet-vim'
" Polyglot synthax hightlight autodetect
Plug 'sheerun/vim-polyglot'
" Show indent lines
Plug 'Yggdroot/indentLine'
" fzf
Plug 'junegunn/fzf.vim'
" Tmux integration
Plug 'christoomey/vim-tmux-navigator'
" Touch typing
" Plug 'vim-scripts/TTCoach'
""Plug 'edkolev/tmuxline.vim'
"Plug 'nvie/vim-flake8'
"Plug 'chriskempson/base16-vim'
"Plug 'chase/vim-ansible-yaml'
"Plug 'tmhedberg/SimpylFold'
"Plug 'vim-pandoc/vim-pandoc'
"Plug 'vim-pandoc/vim-pandoc-syntax'
"Plug 'Rykka/riv.vim'
"Plug 'aperezdc/vim-template'
"
"
"" Color scheme
"Plug 'vim-scripts/Wombat'
"Plug 'fugalh/desert.vim'
Plug 'jnurmine/Zenburn'
"Plug 'altercation/vim-colors-solarized'
"Plug 'blockloop/vim-codeschool'
"Plug 'ryanoasis/vim-devicons'
" 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

View File

@ -34,9 +34,31 @@
template:
src: files/tmux.conf
dest: /home/{{ item.username }}/.tmux.conf
owner: {{ item.username }}
with_items: "{{ me }}"
- name: Install tmuxinator
gem:
name: tmuxinator
state: latest
- name: Download plug.vim
get_url:
url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
dest: /home/{{ item.username }}/.vim/autoload/plug.vim
owner: {{ item.username }}
with_items: "{{ me }}"
- name: Copy vimrc
template:
src: files/vimrc
dest: /home/{{ item.username }}/.vimrc
owner: {{ item.username }}
with_items: "{{ me }}"
- name: Copy .vim/
template:
src: files/vim/
dest: /home/{{ item.username }}/.vim/
owner: {{ item.username }}
with_items: "{{ me }}"