dotfiles/_vimrc

167 lines
4.0 KiB
VimL
Raw Normal View History

" {{{ Vundle
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree.git'
Plugin 'bling/vim-airline'
2017-08-01 10:32:15 +00:00
Plugin 'vim-jp/vim-go-extra'
Plugin 'fatih/vim-go'
2017-10-08 08:19:19 +00:00
Plugin 'posva/vim-vue'
2018-03-04 18:19:32 +00:00
Plugin 'leafgarland/typescript-vim'
Bundle 'chase/vim-ansible-yaml'
" }}}
" {{{ airline
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
" powerline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
set laststatus=2
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#tab_nr_type = 1 " tab number
let g:airline#extensions#tabline#buffer_nr_show = 1
let g:airline#extensions#tabline#show_close_button = 0
let g:airline#extensions#tabline#fnamemod = ':t:.'
" }}}
2015-06-13 07:02:33 +00:00
syntax enable
2017-09-10 08:56:27 +00:00
set history=500
2015-06-13 07:02:33 +00:00
set nu
set cursorline
set ai
set smartindent
2017-09-10 08:56:27 +00:00
" lignes autour du curseur lors d'un déplacement (j/k)
set so=5
2015-06-13 07:02:33 +00:00
" nombre de colonnes pour représenter une tabulation, nombre d'espaces d'une
" tabulation, nombre d'espaces d'une indentation, ne pas remplacer les
" tabulations par des espaces
set ts=4 sts=4 sw=4 noexpandtab
" detection du type de fichier et indentation adequate (touche =)
filetype on
filetype plugin on
filetype indent on
" permet de quiter un buffer modifié sans alerte (avec :bn ou :bp)
" on a toujours l'alerte si on quitte vim
set hidden
" theme de couleur
set t_Co=256
set background=dark
let g:solarized_termtrans=1
let g:solarized_termcolors=256
colorscheme solarized
" recherche avec surbrillance
set incsearch
set showmatch
set hlsearch
2017-09-10 08:56:27 +00:00
" relecture fichier si modif externe
set autoread
2015-06-13 07:02:33 +00:00
" indent javascript
filetype plugin indent on
2017-09-10 08:56:27 +00:00
" completion améliorée, ignore certains fichiers
set wildmenu
set wildignore=*~,*/.git/*
" changement de ligne en fin/debut de ligne pour ces mouvements
set whichwrap+=h,l
" abandon buffer quitté
set hid
2015-06-13 07:02:33 +00:00
" remap <ESC>
inoremap jk <ESC>
" leader key
2016-04-28 15:56:59 +00:00
let mapleader = "\<Space>"
2015-09-15 18:22:09 +00:00
" modeline
set modeline
" tabs
set expandtab
set tabstop=2
set shiftwidth=2
2016-02-23 22:04:51 +00:00
" {{{ Shortcuts
" clear search
2016-05-05 13:22:49 +00:00
nnoremap <Leader>c :nohl<cr>
2016-04-28 15:56:59 +00:00
" NERdTree
nnoremap <Leader>o :NERDTree<cr>
" save
nnoremap <Leader>w :w<CR>
2016-05-05 13:22:49 +00:00
" quit
nnoremap <Leader>q :q<CR>
" navigate buffers
2016-05-22 08:29:52 +00:00
nnoremap <Leader>l :bn<CR>
nnoremap <Leader>h :bp<CR>
2017-09-10 08:56:27 +00:00
nnoremap <Leader>d :bd<CR>
2016-04-28 15:56:59 +00:00
" copy/paste system clipboard
2017-09-10 08:56:27 +00:00
nnoremap <Leader>pp :setlocal paste!<CR>
2016-04-28 15:56:59 +00:00
vmap <Leader>y "+y
vmap <Leader>d "+d
nmap <Leader>p "+p
nmap <Leader>P "+P
vmap <Leader>p "+p
vmap <Leader>P "+P
" enter visual mode
nmap <Leader><Leader> V
" Automatically jump to end of text you pasted
vnoremap <silent> y y`]
vnoremap <silent> p p`]
nnoremap <silent> p p`]
2016-02-23 22:04:51 +00:00
" }}}
2016-04-28 15:56:59 +00:00
" Stop that stupid window from popping up
map q: :q
" {{{ Vundle
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" }}}
2016-02-23 22:04:51 +00:00
2017-10-08 08:19:19 +00:00
" {{{ Go auto-format
2017-08-01 10:32:15 +00:00
autocmd FileType go autocmd BufWritePre <buffer> Fmt
nnoremap <Leader>i :GoImports<cr>
2017-10-08 08:19:19 +00:00
" }}}
" {{{ Vue.js components
autocmd FileType vue syntax sync fromstart
" }}}
2018-03-04 18:19:32 +00:00
" {{{ Typescript
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
" }}}
2018-05-20 12:29:51 +00:00
" {{{ Markdown + spell
au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown
au BufNewFile,BufFilePre,BufRead *.md set spell
au BufNewFile,BufFilePre,BufRead *.md set linebreak
set spelllang=fr
" }}}