-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc.orig
170 lines (138 loc) · 4.22 KB
/
.vimrc.orig
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
set autowriteall
set number
au FocusLost * silent! wa
set nocompatible " be iMproved
filetype off " required!
"VUNDLE CONFIG
"============================================
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
"COLOR SCHEMES
"=========================================================
Bundle 'https://github.com/altercation/vim-colors-solarized'
"Color Scheme Config
"---------------------------------------------------------
colorscheme solarized
set background=dark
set guifont=Monaco:h13
"SETTINGS
"=========================================================
syntax enable
set tabstop=2
set shiftwidth=2
set softtabstop=2
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.gz
autocmd FileType javascript setlocal expandtab shiftwidth=2 softtabstop=2
autocmd FileType html setlocal expandtab shiftwidth=2 softtabstop=2
set mouse=a
" PLUGINS
"=========================================================
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'tpope/vim-rails'
Bundle "pangloss/vim-javascript"
Bundle 'skalnik/vim-vroom'
Bundle 'jelera/vim-javascript-syntax'
Bundle 'wookiehangover/jshint.vim'
Bundle 'vim-ruby/vim-ruby'
Bundle 'taglist.vim'
Bundle 'tpope/vim-surround'
Bundle 'tpope/vim-ragtag'
Bundle 'tpope/vim-endwise'
Bundle 'kien/ctrlp.vim'
Bundle 'ddollar/nerdcommenter'
Bundle 'scrooloose/nerdtree'
Bundle 'rking/ag.vim'
Bundle 'bling/vim-airline.git'
Bundle 'techlivezheng/vim-plugin-minibufexpl'
Bundle 'vim-scripts/ctags.vim.git'
Bundle 'mattn/emmet-vim'
Bundle 'Rename.vim'
filetype plugin indent on " required!
" MY KEYBINDINGS
" ==================================================
let mapleader =","
map <leader>rlv :source ~/.vimrc
" kj - The intuitive way to get out of insert mode
imap kj <Esc>
imap jj <Esc>
" Split screen
map <leader>v :vsp<CR>
map <leader>h :sp<CR>
" Auto-indent whole file
nmap <leader>= gg=G``
map <silent> <F7> gg=G``:echo "Reformatted."<CR>
" Search
nmap <leader>s :%s/
vmap <leader>s :s/
:set hidden
"Clear search
map <Space> :noh<cr>
nmap <silent> <A-Up> :wincmd k<CR>
nmap <silent> <A-Down> :wincmd j<CR>
nmap <silent> <A-Left> :wincmd h<CR>
nmap <silent> <A-Right> :wincmd l<CR>
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
"Moving lines around
"=================================================
" Normal mode
nnoremap <C-j> :m .+1<CR>==
nnoremap <C-k> :m .-2<CR>==
" Insert mode
inoremap <C-j> <ESC>:m .+1<CR>==gi
inoremap <C-k> <ESC>:m .-2<CR>==gi
" Visual mode
vnoremap <C-j> :m '>+1<CR>gv=gv
vnoremap <C-k> :m '<-2<CR>gv=gv
"PLUGIN CUSTOMIZATIONS
"=================================================
"
"Emmet
let g:user_emmet_expandabbr_key = '<Tab>'
" CTRLP
"-------------------------------------------------
map <leader>f :CtrlP<CR>
imap <leader>f <ESC>:CtrlP<CR>
let g:ctrlp_custom_ignore = '\v/vendor|/bin|/node_modules|/public/assets|/log'
let g:ctrlp_cmd= 'CtrlP'
let g:ctrlp_show_hidden = 1
noremap <D-r> :CtrlPTag<CR>
"NERDCommenter
"-------------------------------------------------
map <leader>/ <plug>NERDCommenterToggle
map <D-/> <plug>NERDCommenterToggle
imap <D-/> <Esc><plug>NERDCommenterToggle i
"NERDTreeToggle
"-------------------------------------------------
map \ :NERDTreeToggle<CR>
"Taglist
"-------------------------------------------------
map <F2> :TlistToggle<CR>
"EasyMotion
"-------------------------------------------------
let g:EasyMotion_leader_key = '<space>'
"Silver Searcher
"-------------------------------------------------
ca Ag Ag!
" VUNDLE HELP
" "===========================================================
" Brief help
" :BundleList - list configured bundles
" :BundleInstall(!) - install (update) bundles
" :BundleSearch(!) foo - search (or refresh cache first) for foo
" :BundleClean(!) - confirm (or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle commands are not allowed.
"CUSTOM FUNCTIONS
"======================================================================
"Autosave on lost focus
"-----------------------
function! FocusLost_SaveFiles()
exe ":au FocusLost" expand("%") ":wa"
endfunction
:call FocusLost_SaveFiles()