summaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2017-09-14 18:16:09 +0100
committerUrbain Vaes <urbain@vaes.uk>2017-10-14 16:28:18 +0200
commitcce7a634641855132e10f3304875862058fc6b6d (patch)
treea3c98588389ca4ac15ec7960299faa39dd18bd20 /vim
parentc541ec2dcd39d32bcf9f289632d16b792c81746e (diff)
Add termite colors
Diffstat (limited to 'vim')
-rw-r--r--vim/.vimrc9
1 files changed, 5 insertions, 4 deletions
diff --git a/vim/.vimrc b/vim/.vimrc
index e7e8251..fda3a68 100644
--- a/vim/.vimrc
+++ b/vim/.vimrc
@@ -304,10 +304,11 @@ nnoremap <Leader>d :bd!<cr>
nmap gs :set opfunc=Search<cr>g@
xmap gs :<c-u>call Search(visualmode())<cr>
-function! Search(vt)
- let l=getline(a:0 ? "'<" : "'[")
- let [line1,col1] = getpos(a:0 ? "'<" : "'[")[1:2]
- let [line2,col2] = getpos(a:0 ? "'>" : "']")[1:2]
+function! Search(vm)
+ let is_visual=(a:vm == "v")
+ let l=getline(is_visual ? "'<" : "'[")
+ let [line1,col1] = getpos(is_visual ? "'<" : "'[")[1:2]
+ let [line2,col2] = getpos(is_visual ? "'>" : "']")[1:2]
call feedkeys(':Grepper -tool git -query "' . l[col1 - 1: col2 - 1] . '"')
endfunction