-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
73 lines (60 loc) · 2.04 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
source $VIMRUNTIME/defaults.vim
execute pathogen#infect()
syntax on
filetype plugin on
"set background=dark
"colorscheme solarized
set t_Co=256
set background=dark
colorscheme grb256
augroup vimrcEx
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
augroup END
set expandtab
set shiftwidth=4
set softtabstop=4
set autoindent
autocmd FileType ruby,haml,eruby,yaml,html,sass,cucumber set ai sw=2 sts=2 et
set number relativenumber
set ignorecase smartcase
set hlsearch
nnoremap <CR> :nohlsearch<CR>
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" MULTIPURPOSE TAB KEY
" Indent if we're at the beginning of a line. Else, do completion.
" Creator: Gary Bernhardt
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <expr> <tab> InsertTabWrapper()
inoremap <s-tab> <c-n>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Move up and down in autocomplete with <c-j> and <c-k>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
inoremap <expr> j pumvisible() ? '<C-n>' : 'j'
inoremap <expr> k pumvisible() ? '<C-p>' : 'k'
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Training mode baby!
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <Left> :echo "Discipline yourself!"<CR>
map <Right> :echo "Discipline yourself!"<CR>
map <Up> :echo "Discipline yourself!"<CR>
map <Down> :echo "Discipline yourself!"<CR>
let g:vimwiki_list = [{'path': '~/.vim/vimwiki'}]
map <Leader><CR> :VimwikiVSplitLink<CR>
map <Leader>n :NERDTreeToggle<CR>
map <Leader>rt :!clear && bundle exec rspec %<CR>
map <Leader>rb :!clear && bundle exec cucumber<CR>