Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 171 lines (135 sloc) 4.398 kb
4076211 @badboy vimrc now under version control, symlink in home
authored
1 set nocompatible " We're running Vim, not Vi!
2 set title
3
a74208c @badboy boosted my vim setup!
authored
4 " Use pathogen to easily modify the runtime path to include all
5 " plugins under the ~/.vim/bundle directory
6 call pathogen#helptags()
7 call pathogen#runtime_append_all_bundles()
8
994e324 @badboy , is a better leader!
authored
9 let mapleader = ","
10
a74208c @badboy boosted my vim setup!
authored
11 " hide buffers instead of closing them
12 set hidden
13
7ffdba0 @badboy added a few options
authored
14 set wrap " wrap lines
a74208c @badboy boosted my vim setup!
authored
15
16 set history=1000 " remember more commands and search history
17 set undolevels=1000 " use many muchos levels of undo
18 set wildignore=*.swp,*.bak,*.pyc,*.rbc,*.class
19
20 set pastetoggle=<F2>
21
71c6a68 @badboy always show statusbar
authored
22 " always show the status bar
23 set laststatus=2
24
4076211 @badboy vimrc now under version control, symlink in home
authored
25 set shell=/bin/zsh
26 set nu
27 set formatoptions-=o
28 set ignorecase
29 set smartcase
7ffdba0 @badboy added a few options
authored
30 set gdefault " applies substitutions globally on lines (like /g)
31 set ruler " show me where the cursor is
4076211 @badboy vimrc now under version control, symlink in home
authored
32 set rulerformat=%l/%L(%p%%),%c " a better ruler
33 "set hlsearch
e746a47 @badboy do not bell! → no urgency hint
authored
34 set visualbell
35 set noerrorbells
36 set t_vb=
4076211 @badboy vimrc now under version control, symlink in home
authored
37
38 set tabstop=4
39 set softtabstop=4
40 set shiftwidth=4
41 set expandtab
42
62ee2a0 @badboy wildmenu=on !
authored
43 " instead of :lcd %:p:h
44 " to change directories upon opening a file
45 "set autochdir
46
47 " set wildmenu on
48 set wmnu
49
e746a47 @badboy do not bell! → no urgency hint
authored
50 " swap file directory
51 set directory^=~/.vim/swap
52
53 " don't store .viminfo in $HOME
54 set viminfo+=n~/.vim/viminfo
55
4076211 @badboy vimrc now under version control, symlink in home
authored
56 " enable display of invisible whitespace
57 set list
58 " toggle invisible whitespace display
59 nmap <leader>l :set list!<CR>
60 set listchars=tab:\ ,eol:¬
61
62 colorscheme vibrantink
63
64 " nnoremap F :w<Enter>:colorscheme vibrantink<Enter>
65
66 " for use with :Gist
67 "" clipboard fix
68 let g:gist_clip_command = 'xclip -selection clipboard'
69 " open browser!
70 let g:gist_open_browser_after_post = 1
7121366 @badboy now that I use chromium, open it there if an instance is running
authored
71 let g:gist_browser_command = 'choose_browser.sh %URL% &'
4076211 @badboy vimrc now under version control, symlink in home
authored
72
7ffdba0 @badboy added a few options
authored
73 syntax on " Enable syntax highlighting
74 filetype on " Enable filetype detection
4076211 @badboy vimrc now under version control, symlink in home
authored
75 filetype indent on " Enable filetype-specific indenting
76 filetype plugin on " Enable filetype-specific plugins
7ffdba0 @badboy added a few options
authored
77 compiler ruby " Enable compiler support for ruby
4076211 @badboy vimrc now under version control, symlink in home
authored
78
79 " autocmd
80 "" delete trailing whitespace on save
81 "" via http://gist.github.com/227361 (defunkt)
82 "" and
83 "" http://vimcasts.org/episodes/tidying-whitespace/
84 function! <SID>StripTrailingWhitespaces()
85 " Preparation: save last search, and cursor position.
86 let _s=@/
87 let l = line(".")
88 let c = col(".")
89 " Do the business:
90 %s/\s\+$//e
91 " Clean up: restore previous search history, and cursor position
92 let @/=_s
93 call cursor(l, c)
94 endfunction
ebe78c1 @badboy no one needs trailing spaces in javascript
authored
95 autocmd BufWritePre *.c,*.rb,*.erl,*.tex,*.xml,*.java,*.js :call <SID>StripTrailingWhitespaces()
4076211 @badboy vimrc now under version control, symlink in home
authored
96
97 "" C files
98 au FileType c let $MANSECT="3,2,7,5,1,8"
99 au FileType c set tabstop=8
100 au FileType c set softtabstop=8
101 au FileType c set shiftwidth=8
102 au FileType c set expandtab
103
104 "" LaTex Compile //& Open -
105 "au FileType tex nnoremap Y :w<Enter>:!rake && xpdf %<.pdf<Enter>
106 au FileType tex nnoremap Y :w<CR>:!rake<CR>
107
108 "" erlang files
109 au FileType erlang setlocal foldmethod=manual
110
111 "" PKGBUILD files
a74208c @badboy boosted my vim setup!
authored
112 "" needs cleanup, maybe own file?
4076211 @badboy vimrc now under version control, symlink in home
authored
113 au BufEnter PKGBUILD nested imap <F6> <C-O>mt<C-O>gg<C-O>/^[
114 \t]*md5sums=/<CR><C-O>0<C-O>vf(%d<C-O>dd<C-O>k<C-O>:r!makepkg -g 2>/dev/null<CR><C-O>:nohlsearch<CR><C-O>`t|
115 \ map <silent><F6> mtgg/^[
116 \t]*md5sums=/<CR>0vf(%dddk:r!makepkg -g 2>/dev/null<CR>:nohlsearch<CR>`t
117
118 function! InsertTabWrapper()
119 let col = col('.') - 1
120 if !col || getline('.')[col - 1] !~ '\k'
121 return "\<tab>"
122 else
123 return "\<c-p>"
124 endif
125 endfunction
126 inoremap <tab> <c-r>=InsertTabWrapper()<cr>
127
7ffdba0 @badboy added a few options
authored
128 " fix Vim’s horribly broken default regex “handling”
129 nnoremap / /\v
130 vnoremap / /\v
131
132 nnoremap <leader>a :Ack
133
e746a47 @badboy do not bell! → no urgency hint
authored
134 " enable :W
a74208c @badboy boosted my vim setup!
authored
135 command! W w
136
4076211 @badboy vimrc now under version control, symlink in home
authored
137 " disable highlights of last search
a74208c @badboy boosted my vim setup!
authored
138 "imap <F2> <C-O><F2>
139 "map <silent><F2> :nohlsearch<CR>
7ffdba0 @badboy added a few options
authored
140 nmap <silent> <leader><space> :nohlsearch<CR>
a74208c @badboy boosted my vim setup!
authored
141
4076211 @badboy vimrc now under version control, symlink in home
authored
142 " simple switch for cursor{line,column}
143 imap <F4> <C-O><F4>
144 imap <F5> <C-O><F5>
145 map <silent><F4> :set invcursorline<CR>
146 map <silent><F5> :set invcursorcolumn<CR>
a74208c @badboy boosted my vim setup!
authored
147
4076211 @badboy vimrc now under version control, symlink in home
authored
148 " apply rot13 for people snooping over shoulder, good fun
a74208c @badboy boosted my vim setup!
authored
149 map ,8 <ESC>ggg?G``
4076211 @badboy vimrc now under version control, symlink in home
authored
150
a74208c @badboy boosted my vim setup!
authored
151 map <F9> :TlistToggle <CR>
4076211 @badboy vimrc now under version control, symlink in home
authored
152 map <F10> :tabnew <CR>
153 map <F12> :NERDTreeToggle<CR>
154
155 " Easy split window navigation
156 " use ALT+ArrowKeys to switch split windows
a74208c @badboy boosted my vim setup!
authored
157 nmap <silent> <A-Up> :wincmd k<CR>
158 nmap <silent> <A-Down> :wincmd j<CR>
159 nmap <silent> <A-Left> :wincmd h<CR>
4076211 @badboy vimrc now under version control, symlink in home
authored
160 nmap <silent> <A-Right> :wincmd l<CR>
a74208c @badboy boosted my vim setup!
authored
161
162 cmap w!! w !sudo tee % > /dev/null
7ffdba0 @badboy added a few options
authored
163
164 nnoremap j gj
165 nnoremap k gk
166
167 " no one needs help
168 inoremap <F1> <ESC>
169 nnoremap <F1> <ESC>
170 vnoremap <F1> <ESC>
Something went wrong with that request. Please try again.