1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 05:20:04 +08:00

Add support for SPC s F

This commit is contained in:
wsdjeg 2018-01-22 20:26:15 +08:00
parent 6f5bdefbed
commit 4a56eda631
3 changed files with 6 additions and 5 deletions

View File

@ -73,13 +73,13 @@ func! s:self._handle_input(...) abort
call call(self._function_key[char], [])
continue
endif
if char ==# "\<Right>" || char == 6
if char ==# "\<Right>"
let self._prompt.begin = self._prompt.begin . self._prompt.cursor
let self._prompt.cursor = matchstr(self._prompt.end, '^.')
let self._prompt.end = substitute(self._prompt.end, '^.', '', 'g')
call self._build_prompt()
continue
elseif char ==# "\<Left>" || char == 2
elseif char ==# "\<Left>"
if self._prompt.begin !=# ''
let self._prompt.end = self._prompt.cursor . self._prompt.end
let self._prompt.cursor = matchstr(self._prompt.begin, '.$')

View File

@ -181,8 +181,9 @@ function! SpaceVim#mapping#space#init() abort
call SpaceVim#mapping#space#def('nnoremap', ['s', 'f'], "call SpaceVim#plugins#flygrep#open({'input' :"
\ . " input(\"grep pattern:\"), 'dir' : input(\"arbitrary dir:\", '', 'dir')})",
\ 'grep in arbitrary directory', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'F'], "execute 'Unite grep:::' . expand(\"<cword>\") . ' -start-insert'",
\ 'grep in arbitrary directory', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'F'], "call SpaceVim#plugins#flygrep#open({'input' :"
\ . " expand(\"<cword>\"), 'dir' : input(\"arbitrary dir:\", '', 'dir')})",
\ 'grep cursor word in arbitrary directory', 1)
" Searching in project
call SpaceVim#mapping#space#def('nnoremap', ['s', 'p'], "call SpaceVim#plugins#flygrep#open({'input' : input(\"grep pattern:\")})",
\ 'grep in project', 1)

View File

@ -137,7 +137,7 @@ function! s:get_search_cmd(exe, expr) abort
elseif !empty(s:grep_dir)
return ['rg', '-H', '-n', '-i', a:expr] + [s:grep_dir]
else
return ['rg', '-H', '-n', '-i', a:expr, s:grep_dir]
return ['rg', '-H', '-n', '-i', a:expr]
endif
else
return [a:exe, a:expr]