-
Notifications
You must be signed in to change notification settings - Fork 112
/
data.vimrc
79 lines (64 loc) · 1.57 KB
/
data.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
set nowrap
set showcmd
set nosol
set ve=all
hi ColorColumn ctermbg=lightgreen
set cursorline cursorcolumn
"hi CursorColumn ctermbg=lightblue
hi CursorColumn ctermfg=red
set isk=@,48-57,124,192-255
map ,0 mx:%s/0/_/g:nohl`x
map ,1 mx:%s/_/0/g:nohl`x
map ,7 :let &l:colorcolumn = join(range(1,999,16),',')
map ,8 :let &l:colorcolumn = join(range(1,999,32),',')
map ,9 :let &l:colorcolumn = join(range(93,999,33),',')
map ,p :%s/ //g:%s/^\[//g:%s/]$//:%s/0/_/g/^[^1]*$:.,$!uniq -c 1G/^[_\|]*1[_\|]*\|
function! DoSort() range abort
let col = col(".")
execute "%! sort -t '' -k 1.".col
endfunction
map ,s mx:call DoSort()`x
function! DoCol() range abort
let col = col(".")
let &l:colorcolumn = col
echo "marking" col
endfunction
function! DoVisCol() range abort
let [lnum1, col1] = getpos("'<")[1:2]
let [lnum2, col2] = getpos("'>")[1:2]
let &l:colorcolumn = join(range(col1,999,col2-col1+1),',')
echo "start @" col1 "repeat" (col2-col1+1)
endfunction
nnoremap ,c :call DoCol()<CR>
vnoremap ,c mx:call DoVisCol()<CR>`x
"function! Pcol(...) abort
" let a:above = get(a:, 1, 0)
" let l:col = virtcol('.')
" execute 'normal!' a:above ? 'P' : 'p'
" call cursor('.', l:col)
"endfunction
function! Pcol() abort
let l:col = virtcol('.')
execute 'normal!' 'p'
call cursor('.', l:col)
endfunction
function! Pcolup() abort
let l:col = virtcol('.')
execute 'normal!' 'P'
call cursor('.', l:col)
endfunction
nnoremap <silent> p :call Pcol()<CR>
nnoremap <silent> P :call Pcolup()<CR>
" stay in column while creating a new line
nnoremap <silent> o mxo`xji