File tree 2 files changed +10
-7
lines changed
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -354,10 +354,12 @@ g:sneak#use_ic_scs = 0
354
354
355
355
g:sneak#map_netrw = 1
356
356
357
- 0 : Don't do any special handling of | netrw | buffers.
357
+ 0 : Don't do any special handling of "file manager" buffers (such as
358
+ | netrw | or filebeagle).
358
359
359
- 1 : Set up Sneak mappings (s and S) in | netrw | buffers (| :Ex | , | :Vex | ), and
360
- move netrw's default s and S mappings to <leader> s and <leader> S.
360
+ 1 : Set up Sneak mappings (s and S) in "file manager" buffers (| :Ex | ,
361
+ | :Vex | , filebeagle) and replace the default buffer-local s and
362
+ S mappings with <leader> s and <leader> S.
361
363
362
364
g:sneak#streak = 0
363
365
Original file line number Diff line number Diff line change @@ -369,16 +369,17 @@ xmap <Plug>VSneakPrevious <Plug>SneakPrevious
369
369
370
370
if g: sneak #opt .map_netrw && -1 != stridx (maparg (" s" , " n" ), " Sneak" )
371
371
func ! s: map_netrw_key (key )
372
- if -1 != stridx (maparg (a: key ," n" ), " _Net" )
373
- exec ' nnoremap <buffer> <silent> <leader>' .a: key .' ' .maparg (a: key ,' n' )
374
- " unmap netrw's buffer-local mapping to allow Sneak's global mapping.
372
+ let expanded_map = maparg (a: key ,' n' )
373
+ if expanded_map = ~# ' _Net\|FileBeagle'
374
+ exec ' nnoremap <buffer> <silent> <leader>' .a: key .' ' .expanded_map
375
+ " unmap the default buffer-local mapping to allow Sneak's global mapping.
375
376
silent ! exe ' nunmap <buffer> ' .a: key
376
377
endif
377
378
endf
378
379
379
380
augroup SneakPluginNetrw
380
381
autocmd !
381
- autocmd FileType netrw autocmd SneakPluginNetrw CursorMoved <buffer>
382
+ autocmd FileType netrw,filebeagle autocmd SneakPluginNetrw CursorMoved <buffer>
382
383
\ call <sid> map_netrw_key (' s' ) | call <sid> map_netrw_key (' S' ) | autocmd ! SneakPluginNetrw * <buffer>
383
384
augroup END
384
385
endif
You can’t perform that action at this time.
0 commit comments