-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
172 lines (148 loc) · 5.7 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
set nocompatible
" *********************************************
" Vundle Plugins
" *********************************************
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'Chiel92/vim-autoformat'
Plugin 'xolox/vim-notes'
Plugin 'xolox/vim-misc'
Plugin 'StanAngeloff/php.vim'
Plugin 'chr4/nginx.vim'
Plugin 'rizzatti/dash.vim'
Plugin 'Shougo/deoplete.nvim'
Plugin 'VundleVim/Vundle.vim'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'airblade/vim-gitgutter'
Plugin 'rakr/vim-one'
Plugin 'bogado/file-line'
Plugin 'christoomey/vim-sort-motion' " gs{motions}
Plugin 'christoomey/vim-system-copy' " cp{motion}, cP, cv
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'dbeecham/ctrlp-commandpalette.vim'
Plugin 'gabrielelana/vim-markdown'
Plugin 'janko-m/vim-test'
Plugin 'jiangmiao/auto-pairs'
Plugin 'jlanzarotta/bufexplorer'
Plugin 'junegunn/vim-easy-align'
Plugin 'kana/vim-operator-user'
Plugin 'kana/vim-textobj-line' " object l, il, al
Plugin 'kana/vim-textobj-user' " requires bt vim-textobj-quotes
Plugin 'kristijanhusak/vim-carbon-now-sh'
Plugin 'leafgarland/typescript-vim'
Plugin 'ludovicchabant/vim-gutentags'
Plugin 'machakann/vim-highlightedyank'
Plugin 'majutsushi/tagbar'
Plugin 'mattn/emmet-vim'
Plugin 'mileszs/ack.vim'
Plugin 'ngmy/vim-rubocop'
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'jelera/vim-javascript-syntax'
Plugin 'posva/vim-vue'
Plugin 'qpkorr/vim-bufkill'
Plugin 'romainl/vim-qf'
Plugin 'scrooloose/nerdtree'
Plugin 'simeji/winresizer' " To enter resizing mode : ctrl+e, and exit by enter
Plugin 'stephpy/vim-yaml'
Plugin 'szw/vim-maximizer'
Plugin 't9md/vim-ruby-xmpfilter'
Plugin 'tmhedberg/SimpylFold'
Plugin 'tmux-plugins/vim-tmux-focus-events'
Plugin 'tpope/vim-abolish'
Plugin 'tpope/vim-bundler'
Plugin 'tpope/vim-commentary' " gc{motion}, v_gc, {number}gcc
Plugin 'tpope/vim-dispatch'
Plugin 'tpope/vim-endwise'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-repeat' " 'solve repeated the last native command inside that map, rather than the map as a whole'
Plugin 'tpope/vim-rhubarb'
Plugin 'tpope/vim-surround' " cs, ds, ys + {motion}
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'wellle/targets.vim'
Plugin 'wellle/visual-split.vim'
call vundle#end()
" *********************************************
" General Configurations
" *********************************************
filetype off
syntax enable
syntax on
set cursorline
set hidden " All hiding unsaved buffer, and move on
set number
set numberwidth=4
set backspace=indent,eol,start " Make backspace works like most program
set laststatus=2 " Show the status line all the time
set lazyredraw
set nopaste
set showcmd
set ttyfast
set visualbell " Disable sound
filetype plugin indent on
set autowrite " autoload write
set autoread " autoload read
" au CursorHold,CursorHoldI,BufEnter * checktime
" au BufWritePost,BufReadPost * checktime | NERDTreeFocus | execute 'normal R' | wincmd p
set autoindent
set expandtab
set shiftwidth=2
set smartindent
set smarttab
set softtabstop=2
set tabstop=2
set foldnestmax=3 " Folding: deepest fold is 3 levels
set nofoldenable " Folding: dont fold by default
set nowrap " Don't wrap lines
set linebreak " Wrap lines at convenient points
set noswapfile " turn off swap file
set nobackup " turn off backup file
set nowb
" Search
set incsearch " Search: Find as you type search
set hlsearch " Search: Highlight search terms
set ignorecase " Search: Case-insensitive searching.
set smartcase " Search: But case-sensitive if expression contains a capital letter.
" Ex-command completion - If you’re used to the autocomplete menu provided by zsh,
set wildmenu
set wildmode=full
set wildignore=*.o,*.obj,*~ " Stuff to ignore when tab completing
" *********************************************
" Plugin Customization
" *********************************************
if filereadable($HOME . "/.vim/custom/plugin_customizations.vim")
source ~/.vim/custom/plugin_customizations.vim
endif
" *********************************************
" Keys mapping
" *********************************************
" Change default leader to ,
let mapleader=','
" Save file
nmap <leader>w :w!<CR>
" Clean up search hightlight
nmap <Space> :noh<CR>
" Easier navigation between split windows
nmap <c-j> <c-w>j
nmap <c-k> <c-w>k
nmap <c-h> <c-w>h
nmap <c-l> <c-w>l
" vim-one
" The first two lines forces true colour on, since vim can’t detect it within tmux.
" The last line on its own will work outside tmux, but result in no colours inside tmux.
let &t_8f="\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b="\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
" let g:one_allow_italics = 1
set background=dark
colorscheme one
highlight LineNr guifg=grey
"" Running Rubocop with auto-correct
let g:vimrubocop_keymap = 0
map <leader>ac :w<CR> :RuboCop --auto-correct %<CR><leader>q
" *********************************************
" Vim Better Whitespace
" *********************************************
let g:strip_whitespace_on_save=1
let g:better_whitespace_filetypes_blacklist=['vimrc']