forked from ryanb/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvimrc.fork
106 lines (81 loc) · 2.48 KB
/
vimrc.fork
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
UnBundle 'gorodinskiy/vim-coloresque'
UnBundle 'scrooloose/syntastic'
set nofoldenable
set nospell
if has("gui_mac") || has("gui_macvim")
set guifont=Inconsolata\ for\ Powerline:h16
set guioptions-=r
set guioptions-=L
set columns=180
set lines=999 columns=999
endif
" Remove annoying timeout on escape
set ttimeoutlen=10
augroup FastEscape
autocmd!
au InsertEnter * set timeoutlen=0
au InsertLeave * set timeoutlen=1000
augroup END
" Disable visual/audio bell
set vb t_vb=
" Sketch plugin files and jstalk files are just javascript
au BufNewFile,BufRead *.jstalk,*.sketchplugin set ft=javascript
" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
au BufNewFile,BufRead {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby
" JSON is javascript
au BufNewFile,BufRead *.json set ft=javascript
" Snipmate config
let g:snips_author = 'Tisho Georgiev <[email protected]>'
" Esc means esc, even if the omnicomplete popup is visible
inoremap <expr> <Esc> "\<Esc>"
"CtrlP shortcut
nnoremap <silent> <D-O> :CtrlP<CR>
" Use Cmd-0/Cmd-9 to move between buffers
nmap <D-0> :bnext<CR>
nmap <D-9> :bprev<CR>
" Softtabs, 2 spaces
set tabstop=2
set shiftwidth=2
set softtabstop=2
" Duplicate a selection
" Visual mode: D
vmap D y'>p
" Bufexplorer mappings
nnoremap <leader>m :BufExplorer<CR>
" Command-/ to toggle comments
map <D-/> <plug>NERDCommenterToggle<CR>
" Insert ’ for proper apostrophes in HTML
imap <M-"> ’
" Emulate TextMate-style indentation shortcuts
nmap <D-[> <<
nmap <D-]> >>
vmap <D-[> <gv
vmap <D-]> >gv
" Jump to a specific buffer by pressing F5 + Number/Filename
map <F5> :ls<CR>:b
" NERDTree mappings
silent! nmap <silent> <Leader>p :NERDTreeToggle<CR>
nnoremap <silent> <C-f> :NERDTreeFind<CR>
" NERDTree options
let NERDTreeMinimalUI=1
let NERDTreeDirArrows=1
let NERDTreeIgnore=['\.DS_Store$', '\.vim$']
let NERDTreeQuitOnOpen=0
" Strip all trailing whitespace
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
" Remove the Windows ^M - when the encodings gets messed up
" "noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
" Reselect pasted text
nnoremap <leader>V V`]
" Sane mappings for moving between windows
map <C-J> <C-W>j
map <C-K> <C-W>k
map <C-L> <C-W>l
map <C-H> <C-W>h
" Make neosnippet behave like supertab
imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: pumvisible() ? "\<C-n>" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: "\<TAB>"