forked from yaf/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
115 lines (89 loc) · 2.64 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
call pathogen#infect()
set nocompatible
filetype off " required by Vundle plumbing
runtime macros/matchit.vim
if has("autocmd")
filetype indent plugin on
endif
" Vundle
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
so ~/.vim/bundle.vim
set showmode
set showcmd " display incomplete commands
set shiftwidth=2
set shiftround
set expandtab
set autoindent
filetype plugin indent on
set ignorecase
set smartcase
set incsearch
set gdefault
set scrolloff=3 " keep 3 lines when scrolling
set hlsearch " highlight searches
set ruler " show the cursor position all the time
"set visualbell t_vb " turn off error beep/flash
set novisualbell " turn off visual bell
set number " show line numbers
set ignorecase " ignore case when searching
set title " show title in console title bar
set ttyfast " smoother changes
set modeline " last lines in document sets vim mode
set modelines=3 " number lines checked for modelines
set showmatch
set encoding=utf-8
" set cursorline
syntax on
set term=xterm-256color
set background=dark
" hi Normal ctermbg=white
colorscheme desert256
set guifont=Inconsolata:h20
set backspace=2
set laststatus=2
set backupdir=/tmp
if has('statusline')
set statusline=%<%f\
set statusline+=%w%h%m%r
set statusline+=\ [%{&ff}/%Y]
set statusline+=\ [%{getcwd()}]
set statusline+=%=%-14.(Line:\ %l\ of\ %L\ [%p%%]\ -\ Col:\ %c%V%)
endif
" vim-rspec mappings
nnoremap <Leader>t :call RunCurrentSpecFile()<CR>
nnoremap <Leader>s :call RunNearestSpec()<CR>
nnoremap <Leader>l :call RunLastSpec()<CR>
let g:rspec_command = "Dispatch zeus rspec {spec}"
noremap <S-space> <C-b>
map <up> {
map <down> }
map <C-left> <ESC>:bNext<CR>
map <C-right> <ESC>:bPrevious<CR>
set switchbuf=newtab
nnoremap <F8> :sbnext<CR>
nnoremap <S-F8> :sbprevious<CR>
nnoremap ; :
" Remove whitespaces
map <f6> :%s/\s\+$//<esc>:nohl<CR>:w<CR>
au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby
au BufNewFile,BufRead *.json set ft=javascript
set backupdir=~/.vim/backup
set directory=~/.vim/backup
set wmw=0
nmap <silent> <A-Up> :wincmd k<CR>
nmap <silent> <A-Down> :wincmd j<CR>
nmap <silent> <A-Left> :wincmd h<CR>
nmap <silent> <A-Right> :wincmd l<CR>
nmap <silent> <C-k> :wincmd k<CR>
nmap <silent> <C-j> :wincmd j<CR>
nmap <silent> <C-h> :wincmd h<CR>
nmap <silent> <C-l> :wincmd l<CR>
autocmd BufWritePre * :%s/\s\+$//e "Remove trailing spaces
" Open new split panes to right and bottom
set splitbelow
set splitright
" Disable auto comments
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Ctrl P
set runtimepath^=~/.vim/bundle/ctrlp.vim