public
Description:
Homepage:
Clone URL: git://github.com/jamesgolick/dotfiles.git
dotfiles / vimrc
100644 103 lines (80 sloc) 2.486 kb
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
autocmd BufRead,BufNewFile *.py on
autocmd BufRead,BufNewFile *.py set ai
:syntax on
filetype plugin indent on
augroup myfiletypes
  " Clear old autocmds in group
  autocmd!
  " autoindent with two spaces, always expand tabs
  autocmd FileType ruby,haml,eruby,yaml set ai sw=2 sts=2 et
  autocmd FileType javascript set nosmarttab indentexpr=
  autocmd BufNewFile,BufRead *.json_builder setf ruby
  autocmd BufNewFile,BufRead *.red setf ruby
augroup END
set ai
set sts=2
set sw=2
set autoindent
set smarttab
set number
 
augroup mkd
  autocmd BufRead *.mkd set ai formatoptions=tcroqn2 comments=n:>
augroup END
 
imap <C-l> <space>=><space>
 
map <leader>t :FuzzyFinderTextMate<CR>
let g:fuzzy_matching_limit=60
let g:fuzzy_ceiling=20000
 
" Configuration option: g:fuzzy_ignore
" A delimited list of file glob patterns to ignore. Entries may be delimited
" with either commas or semi-colons.
if !exists('g:fuzzy_ignore')
  let g:fuzzy_ignore = "vendor/**/*.rb"
endif
 
set go-=T
 
" MacVim appearance settings
set bg=dark
if &background == "dark"
    hi normal guibg=black
endif
 
" Map \r to run current file with ruby, and \rf to run test by current word
nmap <leader>r :!ruby %<CR>
nmap <leader>rs :Scratch 'ruby ' . expand('%')<CR>
nmap <leader>rf :Execruby expand('%') . " --name='/" . RubyShouldName() . "/'"<CR>
nmap <leader>rc :Execruby expand('%') . " --name='/" . RubyContextName() . "/'"<CR>
 
" Make a new line, and then jump back to ctrl mode
nmap <leader>o o<Esc>
 
" Activate yaml plugin on .yaml or .yml
au BufNewFile,BufRead *.yaml,*.yml so ~/.vim/plugin/yaml.vim
 
" Make it way easier to switch windows (<leader>w)
nmap <leader>w <C-w><C-w>_
 
" jump out of brackets or quotes
imap <C-o> <Esc>la
 
" search next/previous -- center in page
nmap n nzz
nmap N Nzz
nmap * *Nzz
nmap # #nzz
 
" align plugin stuff
call Align#AlignCtrl('=p1P0')
nmap <leader>a :Align : =><CR>
vmap <leader>a :Align : =><CR>
 
" window splitting mappings
nmap <leader>v :vsplit<CR> <C-w><C-w>
nmap <leader>s :split<CR> <C-w><C-w>
 
" nerd tree
map <leader>d :execute 'NERDTreeToggle ' . getcwd()<CR>
 
:colorscheme vividchalk
 
set wildmenu
set incsearch
set hls
 
map ; :nohlsearch<CR>
 
" remap motions to the ones from the camelcase motions plugin so that w b and
" e motions don't suck so bad
"
map <silent> w <Plug>CamelCaseMotion_w
map <silent> b <Plug>CamelCaseMotion_b
map <silent> e <Plug>CamelCaseMotion_e
 
" map ^ to H
map H ^
 
let &t_SI = "\<Esc>]14;purple\x7"
let &t_EI = "\<Esc>]12;blue\x7"