Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 234 lines (190 sloc) 7.336 kb
6d4f6ee @rainerborene refactored vimrc
authored
1 " ---------------------------------------------------------------------------
2 " General
3 " ---------------------------------------------------------------------------
4
5 filetype off " necessary on some Linux distros for pathogen to properly load bundles
6 set nocompatible " use Vim settings, rather then Vi settings (much better!)
7 set history=1000 " store lots of :cmdline history
8 set autoread " reload files (local changes only)
9 set hidden " hide buffers when not displayed
10 set spelllang=pt,en " spell checking languages
b7d228c @rainerborene Update commentary bundle, aliases and vimrc.
authored
11 set encoding=utf-8 " default encoding
12 set nobomb
03a6956 @rainerborene tracked main files
authored
13
14 call pathogen#runtime_append_all_bundles()
15 call pathogen#helptags()
16
6d4f6ee @rainerborene refactored vimrc
authored
17 filetype plugin on
18 filetype indent on
03a6956 @rainerborene tracked main files
authored
19
6d4f6ee @rainerborene refactored vimrc
authored
20 " ---------------------------------------------------------------------------
b7d228c @rainerborene Update commentary bundle, aliases and vimrc.
authored
21 " UI
6d4f6ee @rainerborene refactored vimrc
authored
22 " ---------------------------------------------------------------------------
23
24 syntax on " turn on syntax highlighting
25 set cursorline " highlight current line
26 set backspace=indent,eol,start " allow backspacing over everything in insert mode
27 set showcmd " show incomplete cmds down the bottom
28 set showmode " show current mode down the bottom
29 set wildmenu " turn on wild menu
30 set wildmode=list:longest " make cmdline tab completion similar to bash
3a658c0 @rainerborene Update CoffeeScript bundle and vimrc.
authored
31 set wildignore+=*~,.git,*.pyc,tags " stuff to ignore when searching and tab completing
6d4f6ee @rainerborene refactored vimrc
authored
32 set t_Co=256 " tell the term has 256 colors
91d392d @rainerborene Updated vimrc.
authored
33 set title " show the filename in the window titlebar
b7d228c @rainerborene Update commentary bundle, aliases and vimrc.
authored
34 set number
01f3d5a @rainerborene vimrc changes and modified color scheme
authored
35 set numberwidth=5
03a6956 @rainerborene tracked main files
authored
36 set showbreak=...
78bd36e @rainerborene Update vim font size and bundles
authored
37 set background=dark
2ffe1e6 @rainerborene changed some config files and completion stuff
authored
38
3a658c0 @rainerborene Update CoffeeScript bundle and vimrc.
authored
39 if has('mouse')
40 set mouse=a
41 endif
42
d569ed3 @rainerborene solarized for both modes
authored
43 if has("gui_running")
6d4f6ee @rainerborene refactored vimrc
authored
44 set guioptions-=T " don't show toolbar in the GUI
45 set guioptions-=r " turn off right scroll bar
46 set guioptions-=L " turn off left scroll bar
b7d228c @rainerborene Update commentary bundle, aliases and vimrc.
authored
47 set lines=999 columns=999
deeee3e gitcofig options, and updated vimrc
Webcitizen authored
48 colorscheme ir_black
e55dba1 @rainerborene open with full window
authored
49
a251fa2 @rainerborene using monaco on mac
authored
50 if has("mac")
78bd36e @rainerborene Update vim font size and bundles
authored
51 set guifont=Menlo:h12
a251fa2 @rainerborene using monaco on mac
authored
52 elseif has("unix")
4589201 @rainerborene install script and new readme
authored
53 set guifont=bitstream\ vera\ sans\ mono\ 11
a251fa2 @rainerborene using monaco on mac
authored
54 endif
78bd36e @rainerborene Update vim font size and bundles
authored
55 else
56 colorscheme tir_black
57 end
816adeb @rainerborene some changes on vimrc
authored
58
6d4f6ee @rainerborene refactored vimrc
authored
59 " ---------------------------------------------------------------------------
60 " Backups
61 " ---------------------------------------------------------------------------
7520150 @rainerborene vimrc changes and new colorscheme
authored
62
6d4f6ee @rainerborene refactored vimrc
authored
63 set backupdir=$HOME/.dotfiles/vim/tmp
64 set directory=$HOME/.dotfiles/vim/tmp
03a6956 @rainerborene tracked main files
authored
65
6d4f6ee @rainerborene refactored vimrc
authored
66 " ---------------------------------------------------------------------------
67 " Visual Cues
68 " ---------------------------------------------------------------------------
69
70 set visualbell t_vb= " disable visual bell
71 set ignorecase " case insensitive
72 set smartcase " sensitive with capitals
73 set foldmethod=indent " fold based on indent
74 set foldnestmax=3 " deepest fold is 3 levels
75 set nofoldenable " dont fold by default
76 set laststatus=2 " always show status line
77 set incsearch " find the next match as we type the search
78 set hlsearch " highlight searches by default
b7d228c @rainerborene Update commentary bundle, aliases and vimrc.
authored
79 set nostartofline " don't reset cursor to start of line when moving around
03a6956 @rainerborene tracked main files
authored
80 set scrolloff=3
81 set sidescrolloff=7
82 set sidescroll=1
6d4f6ee @rainerborene refactored vimrc
authored
83 set listchars=tab:\ ,eol:¬
48e0820 @rainerborene vim updates.
authored
84 set statusline=[%n]\ %<%.99f\ %h%w%m%r%y\ %{fugitive#statusline()}%=%-16(\ %l,%c-%v\ %)%P
03a6956 @rainerborene tracked main files
authored
85
6d4f6ee @rainerborene refactored vimrc
authored
86 " ---------------------------------------------------------------------------
87 " Text Formatting
88 " ---------------------------------------------------------------------------
a379fb8 @rainerborene added gemrc and some changes on vimrc and install
authored
89
6d4f6ee @rainerborene refactored vimrc
authored
90 set autoindent
91 set smartindent
92 set tabstop=4
93 set shiftwidth=2
94 set softtabstop=2
95 set expandtab
96 set nosmarttab
b7d228c @rainerborene Update commentary bundle, aliases and vimrc.
authored
97 set textwidth=80
6d4f6ee @rainerborene refactored vimrc
authored
98 set formatoptions=qrn1
99 set linespace=4
d8a0c32 @rainerborene Use par for formatting and other updates.
authored
100 set nojoinspaces
6d4f6ee @rainerborene refactored vimrc
authored
101 set wrap linebreak nolist
03a6956 @rainerborene tracked main files
authored
102
d8a0c32 @rainerborene Use par for formatting and other updates.
authored
103 if executable("par")
104 set formatprg=par\ -w80
105 endif
106
6d4f6ee @rainerborene refactored vimrc
authored
107 " ---------------------------------------------------------------------------
108 " Auto Commands
109 " ---------------------------------------------------------------------------
03a6956 @rainerborene tracked main files
authored
110
6d4f6ee @rainerborene refactored vimrc
authored
111 autocmd FileType html,css,scss,ruby,pml,yaml,coffee,vim,js setlocal ts=2 sts=2 sw=2 expandtab
112 autocmd FileType php,apache,sql setlocal ts=4 sts=4 sw=4 noexpandtab
113 autocmd FileType python setlocal ts=4 sts=4 sw=4 expandtab
b7d228c @rainerborene Update commentary bundle, aliases and vimrc.
authored
114 autocmd FileType markdown setlocal wrap linebreak nolist
6d4f6ee @rainerborene refactored vimrc
authored
115 autocmd FileType gitcommit setlocal spell
b7d228c @rainerborene Update commentary bundle, aliases and vimrc.
authored
116 autocmd FileType html,xml,js,css,php autocmd BufWritePre <buffer> :call StripWhitespace()<CR>
b2730c0 @rainerborene added compiler settings and vim-bundler
authored
117 autocmd FileType java silent! compiler javac | setlocal makeprg=javac\ %
118 autocmd FileType ruby silent! compiler ruby
6a2b394 @rainerborene vimgrep mappings
authored
119
d8a0c32 @rainerborene Use par for formatting and other updates.
authored
120 autocmd BufNewFile,BufRead *.rss setfiletype xml
121 autocmd BufNewFile,BufRead *.json setfiletype javascript
0ce9f6a @rainerborene New color schemes and updated vimrc
authored
122 autocmd BufNewFile,BufRead {Rakefile,Guardfile,Capfile,Thorfile,Gemfile,config.ru} setfiletype ruby
6d4f6ee @rainerborene refactored vimrc
authored
123 autocmd BufReadPost fugitive://* set bufhidden=delete
124 autocmd BufWritePost .vimrc source $MYVIMRC
cf2f441 @rainerborene wipe all buffers on closing gitv
authored
125
4c1ab22 @rainerborene Restore cursor position, and few other things.
authored
126 " Restore cursor position
127 autocmd BufReadPost *
128 \ if line("'\"") > 1 && line("'\"") <= line("$") |
129 \ exe "normal! g`\"" |
130 \ endif"
131
6d4f6ee @rainerborene refactored vimrc
authored
132 " ---------------------------------------------------------------------------
133 " Mappings
134 " ---------------------------------------------------------------------------
f324718 @rainerborene added nerdcommenter bundle
authored
135
6d4f6ee @rainerborene refactored vimrc
authored
136 " using another leader mapping
b8d0a99 @rainerborene changed leader mapping
authored
137 let mapleader = ","
138
6d4f6ee @rainerborene refactored vimrc
authored
139 " delete a buffer without closing the window
6c59f75 @rainerborene remapped buffer removal
authored
140 nmap <leader>q <Plug>Kwbd
03a6956 @rainerborene tracked main files
authored
141
6d4f6ee @rainerborene refactored vimrc
authored
142 " wipe all buffers which are not active
77c7b40 @rainerborene CloseHiddenBuffers functionality
authored
143 nmap <leader>hq <Plug>CloseHiddenBuffers
144
6d4f6ee @rainerborene refactored vimrc
authored
145 " markdown to html
504649b @rainerborene markdown stuff
authored
146 nmap <leader>md :%!Markdown.pl --html4tags <cr>
147
6d4f6ee @rainerborene refactored vimrc
authored
148 " don't use Ex mode; use Q for formatting
5658335 @rainerborene Y and Q for something more useful
authored
149 map Q gqj
150
6d4f6ee @rainerborene refactored vimrc
authored
151 " make Y consistent with C and D
b7d228c @rainerborene Update commentary bundle, aliases and vimrc.
authored
152 nnoremap Y y$
5658335 @rainerborene Y and Q for something more useful
authored
153
3a658c0 @rainerborene Update CoffeeScript bundle and vimrc.
authored
154 " for saving files that requires root privileges
155 cmap w!! w !sudo tee % >/dev/null
156
6d4f6ee @rainerborene refactored vimrc
authored
157 " speed up buffer switching
c0b5673 @rainerborene buffer switching
authored
158 map <C-k> <C-W>k
159 map <C-j> <C-W>j
160 map <C-h> <C-W>h
161 map <C-l> <C-W>l
162
6d4f6ee @rainerborene refactored vimrc
authored
163 " sane movement with wrap turned on
7520150 @rainerborene vimrc changes and new colorscheme
authored
164 nnoremap j gj
165 nnoremap k gk
01f3d5a @rainerborene vimrc changes and modified color scheme
authored
166 vnoremap j gj
167 vnoremap k gk
168 nnoremap <Up> gk
169 nnoremap <Down> gj
170 vnoremap <Up> gk
171 vnoremap <Down> gj
172 inoremap <Up> <C-o>gk
173 inoremap <Down> <C-o>gj
7520150 @rainerborene vimrc changes and new colorscheme
authored
174
6d4f6ee @rainerborene refactored vimrc
authored
175 " handful abbreveations
176 cab W w
177 cab Wq wq
178 cab wQ wq
179 cab WQ wq
180 cab Q q
181
182 " because escape is too far away
183 imap jj <ESC>
816adeb @rainerborene some changes on vimrc
authored
184
6d4f6ee @rainerborene refactored vimrc
authored
185 " key mapping for tab navigation
186 nmap <Tab> gt
187 nmap <S-Tab> gT
26dd990 @rainerborene local vimrc and autocmd changes
authored
188
6d4f6ee @rainerborene refactored vimrc
authored
189 " clear search highlight
3a658c0 @rainerborene Update CoffeeScript bundle and vimrc.
authored
190 nmap <silent> <leader>/ :silent :nohlsearch<CR>
23059e2 @rainerborene pattern list for hiding files
authored
191
6d4f6ee @rainerborene refactored vimrc
authored
192 " map to bufexplorer
193 map <silent> <F11> :if exists(":BufExplorer")<Bar>exe "BufExplorer"<Bar>else<Bar>buffers<Bar>endif<CR>
e0c6a2e @rainerborene ack is better than grep
authored
194
6d4f6ee @rainerborene refactored vimrc
authored
195 " ack searching
91d392d @rainerborene Updated vimrc.
authored
196 map <Leader>a <Esc>:Ack <cword><CR>
6d4f6ee @rainerborene refactored vimrc
authored
197
198 " open directory dirname of current file
199 map <Leader>e :e <C-R>=expand("%:p:h") . '/' <CR>
200
201 " map to CommandT TextMate style finder
202 nnoremap <leader>t :CommandT<CR>
203
204 " some toggle commands
205 map <Leader>u :GundoToggle<CR>
206 map <silent> <Leader>n :NERDTreeToggle<CR>
26dd990 @rainerborene local vimrc and autocmd changes
authored
207
b7d228c @rainerborene Update commentary bundle, aliases and vimrc.
authored
208 " strip trailing whitespace
209 function! StripWhitespace()
210 let save_cursor = getpos(".")
211 let old_query = getreg('/')
212 :%s/\s\+$//e
213 call setpos('.', save_cursor)
214 call setreg('/', old_query)
215 endfunction
216
217 noremap <leader>ss :call StripWhitespace()<CR>
218
6d4f6ee @rainerborene refactored vimrc
authored
219 " ---------------------------------------------------------------------------
220 " Global Variables
221 " ---------------------------------------------------------------------------
222
91d392d @rainerborene Updated vimrc.
authored
223 let g:CommandTMaxHeight=10
6d4f6ee @rainerborene refactored vimrc
authored
224 let g:CommandTMatchWindowAtTop=0
deeee3e gitcofig options, and updated vimrc
Webcitizen authored
225 let g:NERDCreateDefaultMappings=0
fbaa582 @rainerborene less options, aliases and vimrc updates.
authored
226 let g:NERDTreeDirArrows=1
deeee3e gitcofig options, and updated vimrc
Webcitizen authored
227 let g:NERDSpaceDelims=1
228 let g:Gitv_WipeAllOnClose=1
6d4f6ee @rainerborene refactored vimrc
authored
229 let g:ackprg="ack-grep -H --nocolor --nogroup --column"
cf2f441 @rainerborene wipe all buffers on closing gitv
authored
230
26dd990 @rainerborene local vimrc and autocmd changes
authored
231 if filereadable(expand("~/.vimrc.local"))
232 source ~/.vimrc.local
233 endif
Something went wrong with that request. Please try again.