-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
202 lines (162 loc) · 5.5 KB
/
init.vim
File metadata and controls
202 lines (162 loc) · 5.5 KB
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
call plug#begin('~/.vim/plugged')
set rtp+=/usr/local/opt/fzf
Plug 'airblade/vim-gitgutter'
Plug 'altercation/vim-colors-solarized'
Plug 'bling/vim-airline'
Plug 'chaoren/vim-wordmotion'
Plug 'digitaltoad/vim-jade'
Plug 'easymotion/vim-easymotion'
Plug 'elzr/vim-json'
Plug 'ervandew/supertab'
Plug 'flazz/vim-colorschemes'
Plug 'godlygeek/tabular'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'junegunn/fzf.vim'
Plug 'kchmck/vim-coffee-script'
Plug 'mhinz/vim-signify'
Plug 'neomake/neomake'
Plug 'othree/html5.vim'
Plug 'pangloss/vim-javascript'
Plug 'plasticboy/vim-markdown'
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree'
Plug 'terryma/vim-smooth-scroll'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-unimpaired'
Plug 'vim-scripts/Conque-Shell'
Plug 'wavded/vim-stylus'
Plug 'valloric/youcompleteme', { 'do': './install.py' }
call plug#end()
syntax on
filetype plugin indent on
let mapleader=','
let g:ConqueTerm_StartMessages=0
let g:ConqueTerm_InsertOnEnter=0
let NERDTreeShowHidden=1
let NERDTreeWinSize=35
let g:NERDChristmasTree=1
let g:nerdtree_tabs_open_on_gui_startup=1
let g:nerdtree_tabs_synchronous_focus=0
let g:nerdtree_tabs_focus_on_files=1
let $FZF_DEFAULT_COMMAND='Ag --hidden
\--ignore-dir=.git
\--ignore-dir=node_modules
\--ignore-dir=dist
\--ignore-dir=build -g ""'
let g:fzf_action = { 'enter': 'tab split' }
let g:fzf_height = '25%'
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set number
set ignorecase
set smartcase
set autoindent
set smartindent
set colorcolumn=120
set switchbuf=usetab,newtab
set wildignore=node_modules/**,dist/**,build/**,vendor/**,lib/**,*/tmp/*,*.so,*.swp,*.zip,*.orig
set directory=~/.vim/tmp,/var/tmp,/tmp
set clipboard=unnamed
set number
set ruler
set laststatus=2
set incsearch
set hlsearch
set backup
set backupdir=~/.vim/backups
set directory=~/.vim/tmp,/var/tmp,/tmp
set undodir^=~/.vim/undo
colorscheme hybrid
set background=dark
" Use ctrl-[hjkl] to select the active split
nnoremap <silent> <C-k> :wincmd k<CR>
nnoremap <silent> <C-j> :wincmd j<CR>
nnoremap <silent> <C-h> :wincmd h<CR>
nnoremap <silent> <C-l> :wincmd l<CR>
nnoremap <silent> <Leader>k :wincmd k<CR>
nnoremap <silent> <Leader>j :wincmd j<CR>
nnoremap <silent> <Leader>h :wincmd h<CR>
nnoremap <silent> <Leader>l :wincmd l<CR>
noremap <silent> <D-j> 10j
noremap <silent> <D-k> 10k
noremap <silent> <S-D-j> 20j
noremap <silent> <S-D-k> 20k
" Change word with buffer contents
nmap <silent> cp "_cw<C-R>"<Esc>
nnoremap <A-j> :m .+1<CR>==
nnoremap <A-k> :m .-2<CR>==
inoremap <A-j> <Esc>:m .+1<CR>==gi
inoremap <A-k> <Esc>:m .-2<CR>==gi
vnoremap <A-j> :m '>+1<CR>gv=gv
vnoremap <A-k> :m '<-2<CR>gv=gv
nnoremap <silent> <Tab> <C-w>w
noremap <F10> :call RunMochaOnFile()<CR>
noremap <F4> :silent Ggrep <cword><CR> :copen<CR>
nnoremap <F6> :buffers<CR>:buffer<Space>
inoremap <silent> jj <Esc>
nnoremap <silent> ; :
noremap <silent> <Leader>n :NERDTreeTabsToggle<CR>
noremap <silent> <Leader>f :NERDTreeFind<Cr>:vertical resize 40<CR>
"autocmd VimEnter * NERDTree | wincmd p
"autocmd BufRead * NERDTreeFind | wincmd p
" Lint on save
autocmd! BufWritePost,BufEnter * Neomake
" Remove trailing whitespace on save
autocmd FileType c,cpp,java,php,javascript,coffee,pug,stylus autocmd BufWritePre <buffer> :%s/\s\+$//e
" Set filetypes
autocmd BufRead,BufNewFile,BufReadPre *.coffee,*._coffee set filetype=coffee
autocmd BufRead,BufNewFile,BufReadPre *.jade set filetype=pug
autocmd BufRead,BufNewFile,BufReadPre *.styl set filetype=stylus
noremap <silent> <Leader>q :q!<CR>
noremap <silent> <Leader>w :wq!<CR>
noremap <silent> <Leader>bd :bd<CR>
noremap <silent> <Leader>cc :CoffeeCompile<CR>
noremap <silent> <Leader>nh :noh<CR>
noremap <silent> <Leader>s :vsplit<CR>
noremap <silent> <Leader>v :so $MYVIMRC<CR>
noremap <silent> <Leader>cd :cd %:p:h<CR>
noremap <silent> <Leader>j :%!python -m json.tool<CR>
noremap <silent> <Leader>gk :!gitk %:p<CR>
noremap <silent> <Leader>p :let @+=expand("%:p")<CR>
nmap <Leader>g :silent Ggrep -C2<space>
noremap <silent> <Leader>t :FZF --reverse<CR>
inoremap <C-c> <ESC>
nnoremap <C-c> :nohl<CR>
nmap <Leader>a= :Tabularize /=<CR>
vmap <Leader>a= :Tabularize /=<CR>
nmap <Leader>a: :Tabularize /:\zs<CR>
vmap <Leader>a: :Tabularize /:\zs<CR>
cmap w!! w !sudo tee % >/dev/null
noremap <silent> <c-u> :call smooth_scroll#up(40, 20, 6)<CR>
noremap <silent> <c-d> :call smooth_scroll#down(40, 20, 6)<CR>
" smooth_scroll is broken in visual mode currently - unmap
vnoremap <silent> <c-u> <c-u>
vnoremap <silent> <c-d> <c-d>
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
set termguicolors
endif
endif
if has('gui_macvim')
set guifont=Menlo\ Regular:h16
set macmeta
endif
function RunMochaOnFile()
execute "ConqueTermSplit mocha" bufname('%')
endfunction
autocmd QuickFixCmdPost *grep* cwindow