-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
84 lines (73 loc) · 2.22 KB
/
Copy pathvimrc
File metadata and controls
84 lines (73 loc) · 2.22 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
let mapleader = " "
set nocompatible " Use Vim settings, rather then Vi settings
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Plugin 'gmarik/vundle'
Plugin 'vim-ruby/vim-ruby'
Plugin 'tpope/vim-rails.git'
Plugin 'tpope/vim-rake.git'
Plugin 'tpope/vim-projectionist.git'
Plugin 'tpope/vim-cucumber'
Plugin 'tpope/vim-fugitive'
Plugin 'kchmck/vim-coffee-script'
Plugin 'elzr/vim-json'
Plugin 'PProvost/vim-ps1'
Plugin 'thoughtbot/vim-rspec'
Plugin 'DrTom/fsharp-vim'
filetype plugin indent on " required!
filetype on
syntax enable
set nobackup
set noswapfile
set nowritebackup
set history=500
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set laststatus=2 " Always display the status line
" Softtabs, 2 spaces
set tabstop=2
set shiftwidth=2
set expandtab
set tabpagemax=30
set rulerformat=%55(%{strftime('%a\ %b\ %e\ %I:%M\ %p')}\ %5l,%-6(%c%V%)\ %P%)
set autowrite " write on running commands
" Display extra whitespace
set list listchars=tab:»·,trail:·
autocmd User Rails Rnavcommand step features/step_definitions -glob=**/* -suffix=_steps.rb
autocmd User Rails Rnavcommand config config -glob=**/* -suffix=.rb -default=routes
nnoremap <leader><leader> <c-^>
au BufRead,BufNewFile *.md set filetype=markdown
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>
let g:rspec_command = "!bundle exec rspec {spec}"
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <Tab> <c-r>=InsertTabWrapper()<cr>
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
function RunLinter()
if &filetype == "scss"
execute "!bundle exec scss-lint %"
elseif &filetype == "haml"
execute "!bundle exec haml-lint %"
else
execute "!bundle exec rubocop %"
endif
endfunction
map <Leader>f :!foodcritic %<CR>
map <Leader>h :!bundle exec haml-lint %<CR>
map <Leader>r :call RunLinter()<CR>
map <Leader>c :!xbuild<CR>
set backspace=indent,eol,start