-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.oldvimrc
93 lines (69 loc) · 1.7 KB
/
.oldvimrc
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
set background=dark
syntax on
"colorscheme solarized
colorscheme twilight
set tabstop=3
set shiftwidth=3
set guifont=Monaco:h14
set smartindent
set autoindent
set cindent
set wildmode=list:longest
set antialias
set encoding=utf-8
set guioptions-=T
set lines=55 columns=180
"hide right scrollbar
set guioptions-=r
set number
set ruler
set numberwidth=5
set splitbelow
set splitright
nmap <D-[> <<
nmap <D-]> >>
vmap <D-[> <gv
vmap <D-]> >gv
nmap <space> :
nmap ,v :e ~/.vimrc<cr>
nmap ,s :so ~/.vimrc<cr>
imap kj <esc>
nmap ,nt :NERDTreeToggle
au FileType php set ft=php.cakephp
"Break lines with CTRL J
nnoremap <NL> i<CR><ESC>
"Coda/Textmate-like text editing
"Move lines up & down
nmap <A-Up> ddkP
nmap <A-Down> ddp
"Multiple lines
vmap <A-Up> xkP`[V`]
vmap <A-Down> xp`[V`]
"Duplicate lines
nmap <C-A-Up> yyP
nmap <C-A-Down> yyp
vmap <C-A-Up> yp`[V`]
vmap <C-A-Down> yp`[V`]
"To do automatic Tabularize
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
function! s:align()
let p = '^\s*|\s.*\s|\s*$'
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
Tabularize/|/l1
normal! 0
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
endif
endfunction
let mapleader = ","
"Nice maps from Jrom
map <leader>tt :tabnew<cr>
map <leader>te :tabedit
map <leader>tc :tabclose<cr>
map <leader>to :tabonly<cr>
map <leader>tn :tabnext<cr>
map <leader>tp :tabprevious<cr>
map <leader>tf :tabfirst<cr>
map <leader>tl :tablast<cr>
map <leader>tm :tabmove