-
Notifications
You must be signed in to change notification settings - Fork 0
/
pair_vimrc
89 lines (80 loc) · 1.93 KB
/
pair_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
"VIMRC FOR PAIRING
filetype off
"initialise pathogen
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
syntax on
set nocompatible
let mapleader = ","
let maplocalleader = ","
let g:ackprg="ack-grep -H --nocolor --nogroup --column"
set grepprg=/usr/bin/ack
set autowrite
set ruler
set nu
set nowrap
set timeoutlen=250
set history=256
set mousehide
set mouse=a
set ts=2
set bs=2
set shiftwidth=2
set autoindent
set smarttab
set expandtab
set guioptions-=m
set guioptions-=T
set guioptions-=r
set guioptions-=l
set guioptions-=b
set showmatch
set shell=/bin/sh
set splitright
set backupdir=/home/cgemmell/.vim_backup
set noerrorbells
set novisualbell
set lcs=tab:\ \ ,eol:$,trail:~,extends:>,precedes:<
map <Leader>e :e. <CR>
map <Leader>E :E <CR>
map <C-H> <C-W>h
map <C-J> <C-W>j
map <C-K> <C-W>k
map <C-L> <C-W>l
"custom mappings
map <silent> <LocalLeader>w <ESC>:w<CR>
nnoremap <Leader>r G=gg<C-o><C-o>
nnoremap <Leader>P "+p<CR>
vnoremap <Leader>Y "+y<CR>
nnoremap <Leader>YY "+yy<CR>
vnoremap <silent>[ ^
vnoremap <silent>] $
nnoremap <silent>[ ^
nnoremap <silent>] $
nnoremap <F5> :GundoToggle<CR>
nnoremap <Leader>o o<ESC>
nnoremap <Leader>O O<ESC>
inoremap ` <ESC>
map <silent> <LocalLeader>rb :RunAllRubyTests<CR>
map <silent> <LocalLeader>rc :RunRubyFocusedContext<CR>
map <silent> <LocalLeader>rt :RunRubyFocusedUnitTest<CR>
"diff options
:set diffopt+=iwhite
" Strip trailing whitespace
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
autocmd! bufwritepost .vimrc source ~/.vimrc
autocmd BufWritePost,FileWritePost * silent call AutoTag ()
"set colour scheme
colorscheme vividchalk