-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
131 lines (115 loc) · 3.34 KB
/
vimrc
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
call plug#begin()
Plug 'tpope/vim-sensible'
Plug 'kien/ctrlp.vim'
Plug 'danro/rename.vim'
Plug 'kchmck/vim-coffee-script'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-bundler'
Plug 'tpope/vim-fugitive'
Plug 'thoughtbot/vim-rspec'
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'garbas/vim-snipmate'
Plug 'chriskempson/base16-vim'
Plug 'mustache/vim-mustache-handlebars'
Plug 'preservim/nerdtree'
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'
call plug#end()
"""""""""""""""""""""""""""""""
" General "
"""""""""""""""""""""""""""""""
set nocompatible
filetype plugin indent on
"execute pathogen#infect()
set backspace=indent,eol,start
syntax on
set tags=./tags;
set grepprg=ack
set smarttab
set expandtab
set tabstop=2
set shiftwidth=2
set relativenumber
set spelllang=en_au
set clipboard+=unnamed
set modifiable
"let g:rspec_command = "!spring rspec {spec}"
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
"suppress garbage characters on launching vim
set t_RV=
"""""""""""""""""""""""""""""""
" Colors "
"""""""""""""""""""""""""""""""
if exists('$BASE16_THEME')
\ && (!exists('g:colors_name') || g:colors_name != 'base16-$BASE16_THEME')
let base16colorspace=256
colorscheme base16-$BASE16_THEME
endif
"""""""""""""""""""""""""""""""
" File browser "
"""""""""""""""""""""""""""""""
let g:netrw_browse_split = 2 " Automatically open new files in a vertical split
let g:netrw_banner = 0
let g:netrw_winsize = 20
"""""""""""""""""""""""""""""""
" Key mappings "
"""""""""""""""""""""""""""""""
let mapleader = ","
map <Leader>b :Bundle<cr>
map <Leader>db :! rake db:migrate && rake db:test:clone<cr>
map <Leader>dd :set background=dark<cr>
map <Leader>do :tabe todo.md<cr>
map <Leader>f :Lexplore<cr>
map <Leader>g :tabe Gemfile<cr>
map <Leader>ll :set background=light<cr>
map <Leader>o :call RunNearestSpec()<CR>
map <Leader>p :set paste<cr>:r !pbpaste<cr>:set nopaste<cr>
map <Leader>r :!ruby %<cr>
map <Leader>sm :RSmodel<cr>
map <Leader>sc :RScontroller<cr>
map <Leader>sv :RSview<cr>
map <Leader>su :RSunittest<cr>
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>vc :RVcontroller<cr>
map <Leader>vi :tabe ~/.vimrc<cr>
map <Leader>vm :RVmodel<cr>
map <Leader>vp :tabe ~/.vim/plugin/projections.vim<cr>
map <Leader>vr :source $MYVIMRC<cr>
map <Leader>vu :RVunittest<cr>
map <Leader>vv :RVview<cr>
map <Leader>w <C-w>w
imap <c-q> <esc>:q<cr>
" Open new split panes to right and bottom, which feels more natural
set splitbelow
set splitright
" Quicker window movement
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
"""""""""""""""""""""""""""""""
" Saving and Deleting Files "
"""""""""""""""""""""""""""""""
inoremap <C-W> <esc>:w<cr>
"""""""""""""""""""""""""""""""
" Movements "
"""""""""""""""""""""""""""""""
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
inoremap <Up> <Nop>
inoremap <Down> <Nop>
inoremap <Left> <Nop>
inoremap <Right> <Nop>
"""""""""""""""""""""""""""""""
" CtrlP "
"""""""""""""""""""""""""""""""
set wildignore=*/tmp/*,*/node_modules/*
"""""""""""""""""""""""""""""""
" SnipMate "
"""""""""""""""""""""""""""""""
let g:snipMate = { 'snippet_version' : 1 }