-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
executable file
·140 lines (105 loc) · 4.27 KB
/
vimrc
File metadata and controls
executable file
·140 lines (105 loc) · 4.27 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
" Use Vim settings, rather then Vi settings.
set nocompatible
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'https://github.com/wincent/command-t'
Plugin 'git://github.com/scrooloose/nerdtree.git'
Plugin 'git://github.com/nathanaelkane/vim-indent-guides.git'
Plugin 'git://github.com/mileszs/ack.vim.git'
Plugin 'git@github.com:kchmck/vim-coffee-script.git'
Plugin 'git@github.com:t9md/vim-ruby-xmpfilter.git'
Plugin 'https://github.com/Chiel92/vim-autoformat.git'
Plugin 'git@github.com:tpope/vim-rails.git'
" Snippets
Plugin 'https://github.com/MarcWeber/vim-addon-mw-utils'
Plugin 'https://github.com/tomtom/tlib_vim'
Plugin 'https://github.com/garbas/vim-snipmate'
Plugin 'https://github.com/honza/vim-snippets'
call vundle#end() " required
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
autocmd VimEnter * :IndentGuidesEnable
" iTerm 256 colors
set t_Co=256
set background=dark
colorscheme ir_black
syntax on " Syntax highlighting
let mapleader = "["
" CommandT
map <Leader>t :CommandT<CR>
map <Leader>rt :CommandTFlush<CR>
" In some terminals such as xterm the Escape key misbehaves, so Command-T
" doesn't set up a mapping for it.
if &term =~ "xterm" || &term =~ "screen"
let g:CommandTCancelMap = ['<ESC>', '<C-c>']
" fix up/down arrow sequences in console version
let g:CommandTSelectNextMap = ['<C-j>', '<ESC>OB']
let g:CommandTSelectPrevMap = ['<C-k>', '<ESC>OA']
endif
" NERDTree mappings
map <Leader>n :NERDTreeToggle<CR> " toggling for project tree window
map <Leader>f :NERDTreeFind<CR> " find current file in nerd tree
" Show file path in status line
set statusline+=%F
set laststatus=2
command Fixrubyhash :%s/:\([^ ]*\)\(\s*\)=>/\1:/g
" Indent lines with only whitespace
:inoremap <CR> <CR>x<BS>
let g:NERDTreeWinSize = 50
au BufNewFile,BufRead *.jst set filetype=html
" tabs
set expandtab
set shiftwidth=2
set softtabstop=2
" Dont create swp and backups
set noswapfile
set nobackup
set number
filetype plugin indent on
set autoindent
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set cursorline " highlight the line that the cursor is on
nnoremap <silent> <C-Right> <c-w>l
nnoremap <silent> <C-Left> <c-w>h
nnoremap <silent> <C-Up> <c-w>k
nnoremap <silent> <C-Down> <c-w>j
set nobackup
set nowritebackup
set noswapfile
set wildignore+=*.png,*.jpg,*.jpeg,*.sp*,*.gif,tmp/*,*.keep,public/**,log/*
let g:xmpfilter_cmd = "seeing_is_believing"
autocmd FileType ruby nmap <buffer> <Leader>r <Plug>(seeing_is_believing-mark)
autocmd FileType ruby xmap <buffer> <Leader>r <Plug>(seeing_is_believing-mark)
autocmd FileType ruby imap <buffer> <Leader>r <Plug>(seeing_is_believing-mark)
autocmd FileType ruby nmap <buffer> <Leader>c <Plug>(seeing_is_believing-clean)
autocmd FileType ruby xmap <buffer> <Leader>c <Plug>(seeing_is_believing-clean)
autocmd FileType ruby imap <buffer> <Leader>c <Plug>(seeing_is_believing-clean)
" xmpfilter compatible
autocmd FileType ruby nmap <buffer> <Leader>rr <Plug>(seeing_is_believing-run_-x)
autocmd FileType ruby xmap <buffer> <Leader>rr <Plug>(seeing_is_believing-run_-x)
autocmd FileType ruby imap <buffer> <Leader>rr <Plug>(seeing_is_believing-run_-x)
" auto insert mark at appropriate spot.
autocmd FileType ruby nmap <buffer> <Leader>x <Plug>(seeing_is_believing-run)
autocmd FileType ruby xmap <buffer> <Leader>x <Plug>(seeing_is_believing-run)
autocmd FileType ruby imap <buffer> <Leader>x <Plug>(seeing_is_believing-run)
" Key mappings for inline running of ruby code
" nmap <buffer> <Leader>ee <Plug>(xmpfilter-run)
" xmap <buffer> <Leader>ee <Plug>(xmpfilter-run)
" imap <buffer> <Leader>ee <Plug>(xmpfilter-run)
"
" nmap <buffer> <Leader>e <Plug>(xmpfilter-mark)
" xmap <buffer> <Leader>e <Plug>(xmpfilter-mark)
" imap <buffer> <Leader>e <Plug>(xmpfilter-mark)
" disable vim auto adding comment character at the beginning of line
" autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
let g:CommandTMaxFiles=500000
" Make navigating vim windows easier
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l