-
Notifications
You must be signed in to change notification settings - Fork 2
/
.vimrc
133 lines (100 loc) · 3.18 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
" Enable Syntax Highlight And Color Scheme
syntax enable
let g:rehash256 = 1
colorscheme molokai
" Disable bells!
set noerrorbells visualbell t_vb=
" Spell Check (Thank God...)
set spell spelllang=en_us
set complete+=kspell
" CMD Auto Completion
set noic
" Line Numbers
set number
" Backspace
set backspace=indent,eol,start
" Clipboard mode
set pastetoggle=<F2>
" Tab Switch
nnoremap <Tab>1 :tabprevious<CR>
nnoremap <Tab>2 :tabnext<CR>
nnoremap <silent> m<Tab>1 :execute 'silent! tabmove ' . (tabpagenr()-2)<CR>
nnoremap <silent> m<Tab>2 :execute 'silent! tabmove ' . (tabpagenr()+1)<CR>
" Window Switch
noremap <silent> <Tab><left> :wincmd h<CR>
noremap <silent> <Tab><down> :wincmd j<CR>
noremap <silent> <Tab><up> :wincmd k<CR>
noremap <silent> <Tab><right> :wincmd l<CR>
" Re Render
noremap <silent> <C-\> :redraw!<CR>
" Split Configuration
set splitright
" Change Split To Vertical
noremap <silent> <tab>m <c-w>t<c-w>H
noremap <silent> <tab>M <c-w>t<c-w>K
" Indentations Sane
" set tabstop=4
" set shiftwidth=4
" set softtabstop=0 noexpandtab
set tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttab
" Wrapping Configuration
set textwidth=120
set wrap
" Enable Plugin loader
call plug#begin('~/.vim/plugged')
" File Searching
Plug 'wincent/command-t', { 'do': 'cd ruby/command-t && ruby extconf.rb && make' }
map <C-l> :CommandT<CR>
" Directory Structure
Plug 'scrooloose/nerdtree'
map <C-o> :NERDTreeToggle<CR>
" > When no files specified open directory tree
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
" Relative Line Numbers
set number relativenumber
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
" Git Diff Gutter
Plug 'airblade/vim-gitgutter'
" Auto Close
Plug 'tpope/vim-surround'
" White space tool
Plug 'ntpeters/vim-better-whitespace'
autocmd BufEnter * EnableStripWhitespaceOnSave
" Multi-cursor
Plug 'terryma/vim-multiple-cursors'
" Status Line
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
let g:airline_theme='simple'
" Code Completion
Plug 'valloric/youcompleteme', { 'do': './install.py --clang-completer --gocode-completer --tern-completer' }
" ES6 Support
Plug 'othree/yajs.vim', { 'for': 'javascript' }
" Coffee-Script Support
Plug 'kchmck/vim-coffee-script'
filetype plugin indent on
Plug 'b4b4r07/vim-hcl'
Plug 'tomlion/vim-solidity'
" Load Plugins
call plug#end()
" NOTE: Call `:PlugInstall` to install plugins...
"" Notes On Commands:
"
" Fix File Indent - gg=G
" Select Code Block Contents - vi{
" Select Code Block - va{
" Open New Buffer - :enew
" Open Nerd Tree Split Right - s (on the file name)
" Reverse Selected Text - '<,'>!gtac
" Search and replace to flip cmd args and rename: %s/cmd(\(.\{-}\),\(.\{-}\))/cmd(\2,\1)/g
" Paste from clipboard - "+p
" Copy To Clipboard - "+y
" Run On Every buffer: :bufdo execute "cmd"
" Open Every Git File Containing Console.log in a tab: vim -p $(git grep --files-with-matches console.log *)
"