-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
101 lines (81 loc) · 3.44 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
"--------------------------------------------------------------
"
" * Vim configuration for Web development
" * Adrian Karbowniczyn (s1amber)
" => Fork me on Github https://github.com/adrian-karbowniczyn/
"
"--------------------------------------------------------------
"--------------------------------------------------------------
" => Plugins
"--------------------------------------------------------------
call plug#begin('~/.vim/plugged')
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'sheerun/vim-polyglot'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'itchyny/lightline.vim'
Plug 'luochen1990/rainbow'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'shime/vim-livedown'
Plug 'terryma/vim-multiple-cursors'
Plug 'mattn/emmet-vim'
Plug 'airblade/vim-gitgutter'
"Plug 'zxqfl/tabnine-vim'
call plug#end()
" Lightline
set laststatus=2
let g:lightline = {
\ 'colorscheme': 'one',
\ }
" Rainbow
let g:rainbow_active = 1
"--------------------------------------------------------------
" => Colors
"--------------------------------------------------------------
set termguicolors
colorscheme dracula " Theme
syntax on " Syntax highlight
"--------------------------------------------------------------
" => General
"--------------------------------------------------------------
set nocompatible " Not compatible with the old-fashion vi mode
set history=50 " Keep 50 lines of command line history
set ruler " Show the cursor position all the time
set autoread " Auto read when file is changed from outside
set number " Always show line numbers
set hlsearch " Search highlighting
set incsearch " Show search matches as you type
set wildmode=longest,list,full " Show a list when pressing tab and complete
set showmatch " Cursor shows matching ) and }
set smarttab " Insert tabs on the start of a line according to context
set nobackup " Do not keep backup files,
set noswapfile " Do not write swap files
filetype on " Enable filetype detection
filetype plugin on " Enable filetype-specific plugins
filetype indent on " Enable filetype-specific indenting
" Auto reload vimrc when editing it
autocmd! bufwritepost .vimrc source ~/.vimrc
" Commit max length = 72
au FileType gitcommit setlocal tw=72
"--------------------------------------------------------------
" => Indentation
"--------------------------------------------------------------
set tabstop=4 " A tab is four spaces
set shiftwidth=2 " Number of spaces to use for autoindenting
set expandtab " Always set autoindenting on
set autoindent " Always set autoindenting on
"--------------------------------------------------------------
" => Custom mappings
"--------------------------------------------------------------
" Open NerdTree
map <F2> :NERDTreeToggle<CR>
" Fix indent
map <F7> gg=G<C-o><C-o>
" WSL yank support
let s:clip = '/mnt/c/Windows/System32/clip.exe' " change this path according to your mount point
if executable(s:clip)
augroup WSLYank
autocmd!
autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif
augroup END
endif