Skip to content
Newer
Older
100644 260 lines (212 sloc) 6.98 KB
c22e9a4 @arunagw more love to submodules.
authored
1 set nocompatible " Use Vim settings, rather then Vi settings
2 set nobackup
3 set nowritebackup
4 set noswapfile " http://robots.thoughtbot.com/post/18739402579/global-gitignore#comment-458413287
5 set history=50
6 set ruler " show the cursor position all the time
7 set showcmd " display incomplete commands
8 set incsearch " do incremental searching
5977d1b @arunagw Few things updated
authored
9 set hlsearch
10 set ignorecase
11 set smartcase
c22e9a4 @arunagw more love to submodules.
authored
12 set laststatus=2 " Always display the status line
1b354cf @arunagw LustyExplorer added!
authored
13 set hidden
5977d1b @arunagw Few things updated
authored
14 set scrolloff=5
2c8608a @arunagw More addone
authored
15
16 " To load proper ruby
17 set shell=/bin/sh
18
c22e9a4 @arunagw more love to submodules.
authored
19 " Switch syntax highlighting on, when the terminal has colors
20 " Also switch on highlighting the last used search pattern.
21 if (&t_Co > 2 || has("gui_running")) && !exists("syntax_on")
22 syntax on
23 endif
24
25 " Declare bundles are handled via Vundle
26 filetype off " required!
d808e50 @arunagw Using Plugin
authored
27 set rtp+=~/.vim/bundle/Vundle.vim
28 call vundle#begin()
c22e9a4 @arunagw more love to submodules.
authored
29
30 " Let Vundle manage Vundle
d808e50 @arunagw Using Plugin
authored
31 Plugin 'gmarik/Vundle.vim'
c22e9a4 @arunagw more love to submodules.
authored
32
33 " Define bundles via Github repos
d808e50 @arunagw Using Plugin
authored
34 Plugin 'Shougo/neocomplete.vim'
35 Plugin 'airblade/vim-gitgutter'
36 Plugin 'altercation/vim-colors-solarized'
37 Plugin 'bling/vim-airline'
38 Plugin 'cakebaker/scss-syntax.vim'
39 Plugin 'croaky/vim-colors-github'
40 Plugin 'danro/rename.vim'
41 Plugin 'hail2u/vim-css3-syntax'
42 Plugin 'henrik/vim-open-url'
43 Plugin 'itspriddle/vim-marked'
44 Plugin 'jpo/vim-railscasts-theme'
45 Plugin 'jtratner/vim-flavored-markdown'
46 Plugin 'kchmck/vim-coffee-script'
47 Plugin 'kien/ctrlp.vim'
48 Plugin 'mattn/gist-vim'
49 Plugin 'mattn/webapi-vim'
50 Plugin 'mileszs/ack.vim'
51 Plugin 'myusuf3/numbers.vim'
52 Plugin 'nanki/treetop.vim'
53 Plugin 'nathanaelkane/vim-indent-guides'
54 Plugin 'nono/jquery.vim'
e616df3 @arunagw Plugin update
authored
55 Plugin 'nono/vim-handlebars'
d808e50 @arunagw Using Plugin
authored
56 Plugin 'ntpeters/vim-better-whitespace'
57 Plugin 'othree/html5.vim'
58 Plugin 'pbrisbin/vim-mkdir'
59 Plugin 'rizzatti/dash.vim'
60 Plugin 'rizzatti/funcoo.vim'
61 Plugin 'rking/ag.vim'
62 Plugin 'scrooloose/nerdcommenter'
63 Plugin 'scrooloose/nerdtree'
64 Plugin 'scrooloose/syntastic'
65 Plugin 'slim-template/vim-slim'
66 Plugin 'thoughtbot/vim-rspec'
67 Plugin 'timcharper/textile.vim'
68 Plugin 'tomtom/tcomment_vim'
69 Plugin 'tpope/vim-bundler'
70 Plugin 'tpope/vim-cucumber'
d72e93b @arunagw Few updates
authored
71 Plugin 'tpope/vim-dispatch'
d808e50 @arunagw Using Plugin
authored
72 Plugin 'tpope/vim-endwise'
73 Plugin 'tpope/vim-fugitive'
74 Plugin 'tpope/vim-haml'
75 Plugin 'tpope/vim-markdown'
76 Plugin 'tpope/vim-rails'
77 Plugin 'tpope/vim-surround'
78 Plugin 'vim-ruby/vim-ruby'
79 Plugin 'vim-scripts/Auto-Pairs'
80 Plugin 'vim-scripts/LustyExplorer'
81 Plugin 'vim-scripts/ctags.vim'
82 Plugin 'vim-scripts/greplace.vim'
83 Plugin 'vim-scripts/tComment'
84 Plugin 'xenoterracide/html.vim'
85 Plugin 'xolox/vim-misc'
d75c8c2 @arunagw vim-airline
authored
86
1038f03 @arunagw New plugins and few updates
authored
87 " EmberJS
88 Plugin 'dsawardekar/ember.vim'
89 Plugin 'mustache/vim-mustache-handlebars'
90
91 " Javascript
92 Plugin 'pangloss/vim-javascript'
93
d808e50 @arunagw Using Plugin
authored
94 call vundle#end()
c22e9a4 @arunagw more love to submodules.
authored
95 filetype plugin indent on
73e080f @arunagw nerdcommenter
authored
96 filetype plugin on
c22e9a4 @arunagw more love to submodules.
authored
97
98 augroup vimrcEx
99 au!
100
101 " For all text files set 'textwidth' to 78 characters.
102 autocmd FileType text setlocal textwidth=78
103
104 " When editing a file, always jump to the last known cursor position.
105 " Don't do it when the position is invalid or when inside an event handler
106 " (happens when dropping a file on gvim).
107 autocmd BufReadPost *
108 \ if line("'\"") > 0 && line("'\"") <= line("$") |
109 \ exe "normal g`\"" |
110 \ endif
111 augroup END
ccb09a0 @arunagw Adding vimrc for VIM
authored
112
113 " Softtabs, 2 spaces
114 set tabstop=2
115 set shiftwidth=2
116 set expandtab
117
c22e9a4 @arunagw more love to submodules.
authored
118 " Display extra whitespace
119 set list listchars=tab:»·,trail:·
120
121 " Use Ag (https://github.com/ggreer/the_silver_searcher) instead of Grep when
122 " available
4afe8eb @arunagw new plugins
authored
123 if executable('ag')
124 " Use Ag over Grep
c22e9a4 @arunagw more love to submodules.
authored
125 set grepprg=ag\ --nogroup\ --nocolor
4afe8eb @arunagw new plugins
authored
126
127 " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
128 let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
129
130 " ag is fast enough that CtrlP doesn't need to cache
131 let g:ctrlp_use_caching = 0
c22e9a4 @arunagw more love to submodules.
authored
132 endif
133
134
135 " Numbers
136 set number
137 set numberwidth=5
138
3594777 @arunagw More color
authored
139 set wildmode=longest,list
140
e01aa20 @arunagw Split defaults to below and right
authored
141 " Splits
142 set splitbelow
143 set splitright
144
c22e9a4 @arunagw more love to submodules.
authored
145 " Snippets are activated by Shift+Tab
146 let g:snippetsEmu_key = "<S-Tab>"
147
52f3647 @arunagw Updates and tweaks
authored
148 "checking on (set spell)
149 set complete+=kspell
150
c22e9a4 @arunagw more love to submodules.
authored
151 " Tab completion
152 " will insert tab at beginning of line,
153 " will use completion if not at beginning
154 set wildmode=list:longest,list:full
155 set complete=.,w,t
156 function! InsertTabWrapper()
157 let col = col('.') - 1
158 if !col || getline('.')[col - 1] !~ '\k'
159 return "\<tab>"
160 else
161 return "\<c-p>"
162 endif
163 endfunction
164 inoremap <Tab> <c-r>=InsertTabWrapper()<cr>
165
166 " Exclude Javascript files in :Rtags via rails.vim due to warnings when parsing
167 let g:Tlist_Ctags_Cmd="ctags --exclude='*.js'"
168
169 " Index ctags from any project, including those outside Rails
170 map <Leader>ct :!ctags -R .<CR>
171
172 " Cucumber navigation commands
173 autocmd User Rails Rnavcommand step features/step_definitions -glob=**/* -suffix=_steps.rb
174 autocmd User Rails Rnavcommand config config -glob=**/* -suffix=.rb -default=routes
175
176 " Switch between the last two files
177 nnoremap <leader><leader> <c-^>
178
162d273 @arunagw Private gist by default
authored
179 " Keep all gist by default private
180 let g:gist_post_private = 1
181
a70e6b2 @arunagw Few updated and changes
authored
182 " Open browser after creating a gist
183 let g:gist_open_browser_after_post = 1
ccb09a0 @arunagw Adding vimrc for VIM
authored
184
c22e9a4 @arunagw more love to submodules.
authored
185 " Treat <li> and <p> tags like the block tags they are
186 let g:html_indent_tags = 'li\|p'
ccb09a0 @arunagw Adding vimrc for VIM
authored
187
5a52935 @arunagw Adding Git Gutter
authored
188 " Git Gutter
189 let g:gitgutter_eager = 0
2f4b072 @arunagw Plugins updated
authored
190 let g:gitgutter_realtime = 0
5a52935 @arunagw Adding Git Gutter
authored
191
20dedf4 @arunagw NeoComplete vim
authored
192 " Neocomplete options
38c1c1c @arunagw Socks added
authored
193 " let g:neocomplete#enable_at_startup = 1
194 " let g:neocomplete#enable_smart_case = 1
195 " let g:neocomplete#sources#syntax#min_keyword_length = 3
196 " let g:neocomplete#max_list = 10
197 " let g:neocomplete#auto_completion_start_length = 3
198 " let g:neocomplete#force_overwrite_completefunc = 1
5e0725b @arunagw Updated plugins
authored
199
c22e9a4 @arunagw more love to submodules.
authored
200 " Markdown files end in .md
201 au BufRead,BufNewFile *.md set filetype=markdown
ccb09a0 @arunagw Adding vimrc for VIM
authored
202
c22e9a4 @arunagw more love to submodules.
authored
203 " Enable spellchecking for Markdown
204 au BufRead,BufNewFile *.md setlocal spell
ccb09a0 @arunagw Adding vimrc for VIM
authored
205
c22e9a4 @arunagw more love to submodules.
authored
206 " Automatically wrap at 80 characters for Markdown
207 au BufRead,BufNewFile *.md setlocal textwidth=80
ccb09a0 @arunagw Adding vimrc for VIM
authored
208
3594777 @arunagw More color
authored
209 " Auto save file when lost focus from the file
210 autocmd BufLeave,FocusLost * silent! wall
5b6699e @arunagw Nerdtree which i want.
authored
211
52f3647 @arunagw Updates and tweaks
authored
212 " completion for Markdown and git commit
213 autocmd FileType gitcommit setlocal spell
214 autocmd FileType markdown setlocal spell
215
5e0725b @arunagw Updated plugins
authored
216 " Numbers.vim
217 nnoremap <F3> :NumbersToggle<CR>
218 nnoremap <F4> :NumbersOnOff<CR>
219
3594777 @arunagw More color
authored
220 " NERDTree for projects
5b6699e @arunagw Nerdtree which i want.
authored
221 map <leader>n :NERDTreeToggle<CR>
222
6e1085f @arunagw Updated vimrc
authored
223 " Open MarkedApp
a46c754 @arunagw Few updates
authored
224 let g:marked_app = "Marked"
6e1085f @arunagw Updated vimrc
authored
225 map <leader>m :MarkedOpen<CR>
226
a70e6b2 @arunagw Few updated and changes
authored
227 " Fix the difficult-to-read default setting for diff text highlighting. The
228 " " bang (!) is required since we are overwriting the DiffText setting. The
229 " highlighting
230 " " for "Todo" also looks nice (yellow) if you don't like the "MatchParen"
231 " colors.
232 highlight! link DiffText MatchParen
233
52f3647 @arunagw Updates and tweaks
authored
234 " More indent for html.erb
235 "
236 let g:html_indent_tags += '\|article\|aside\|audio\|bdi\|canvas\|command\|datalist\|details\|figcaption\|figure\|footer\|header\|hgroup\|mark\|meter\|nav\|output\|progress\|rp\|rt\|ruby\|section\|summary\|time\|video'
237
a86a2cb @arunagw More plugins
authored
238 " Get off my lawn
239 nnoremap <Left> :echoe "Use h"<CR>
240 nnoremap <Right> :echoe "Use l"<CR>
241 nnoremap <Up> :echoe "Use k"<CR>
242 nnoremap <Down> :echoe "Use j"<CR>
243
c22e9a4 @arunagw more love to submodules.
authored
244 " Local config
245 if filereadable($HOME . "/.vimrc.local")
246 source ~/.vimrc.local
6e8431c @arunagw ack added.
authored
247 endif
e01aa20 @arunagw Split defaults to below and right
authored
248
160f137 @arunagw Welcome xvimrc for xcode
authored
249 " The Silver Searcher
250 let g:ackprg = 'ag --nogroup --nocolor --column'
251
e01aa20 @arunagw Split defaults to below and right
authored
252 " Rspec.vim mappings
253 map <Leader>t :call RunCurrentSpecFile()<CR>
254 map <Leader>s :call RunNearestSpec()<CR>
255 map <Leader>l :call RunLastSpec()<CR>
256 map <Leader>a :call RunAllSpecs()<CR>
99026a1 @arunagw ip changed to use ipinfo
authored
257
258 colorscheme github
d72e93b @arunagw Few updates
authored
259 inoremap <c-e> <c-o>A
Something went wrong with that request. Please try again.