File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change 18
18
19
19
if exists (" *jobstart" ) " NeoVim async method
20
20
21
- function ! bettergrep#Grep (cmd, ... )
21
+ function ! bettergrep#Grep (cmd, ... ) abort
22
22
23
23
let s: cmd = a: cmd
24
24
@@ -47,7 +47,7 @@ else " regular blocking method
47
47
" Thanks to RomainL's gist
48
48
" https://gist.github.com/romainl/56f0c28ef953ffc157f36cc495947ab3
49
49
50
- function ! bettergrep#Grep (cmd, ... )
50
+ function ! bettergrep#Grep (cmd, ... ) abort
51
51
execute a: cmd . " " . " system(join([g:bettergrepprg] + [expandcmd(join(a:000, ' '))], ' '))"
52
52
endfunction
53
53
Original file line number Diff line number Diff line change @@ -8,27 +8,19 @@ if exists('g:bettergrep_loaded')
8
8
endif
9
9
let g: bettergrep_loaded = 1
10
10
11
- " Options
12
- if ! exists (' g:bettergrep_no_mappings' )
13
- let g: bettergrep_no_mappings = 0
14
- endif
15
- if ! exists (' g:bettergrep_no_abbrev' )
16
- let g: bettergrep_no_abbrev = 0
17
- endif
18
-
19
11
" Commands
20
12
command ! -nargs =+ -complete =file_in_path - bar Grep call bettergrep#Grep (' cgetexpr' , <f-args> )
21
13
command ! -nargs =+ -complete =file_in_path - bar LGrep call bettergrep#Grep (' lgetexpr' , <f-args> )
22
14
command ! -nargs =+ -complete =file_in_path - bar Grepadd call bettergrep#Grep (' caddexpr' , <f-args> )
23
15
command ! -nargs =+ -complete =file_in_path - bar LGrepadd call bettergrep#Grep (' laddexpr' , <f-args> )
24
16
25
17
" Mappings
26
- if ! g: bettergrep_no_mappings
18
+ if ! get ( g: , ' bettergrep_no_mappings' , 0 )
27
19
nnoremap <C-g> :Grep
28
20
endif
29
21
30
22
" Abbreviations
31
- if ! g: bettergrep_no_abbrev
23
+ if ! get ( g: , ' bettergrep_no_abbrev' , 0 )
32
24
cnoreabbrev <expr> gr (getcmdtype () == # ' :' && getcmdline () == # ' gr' ) ? ' Grep' : ' gr'
33
25
cnoreabbrev <expr> lgr (getcmdtype () == # ' :' && getcmdline () == # ' lgr' ) ? ' LGrep' : ' lgr'
34
26
cnoreabbrev <expr> gre (getcmdtype () == # ' :' && getcmdline () == # ' gre' ) ? ' Grep' : ' gre'
You can’t perform that action at this time.
0 commit comments