File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 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
354354
355355g:sneak#map_netrw = 1
356356
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).
358359
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.
361363
362364g:sneak#streak = 0
363365
Original file line number Diff line number Diff line change @@ -369,16 +369,17 @@ xmap <Plug>VSneakPrevious <Plug>SneakPrevious
369369
370370if g: sneak #opt .map_netrw && -1 != stridx (maparg (" s" , " n" ), " Sneak" )
371371 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.
375376 silent ! exe ' nunmap <buffer> ' .a: key
376377 endif
377378 endf
378379
379380 augroup SneakPluginNetrw
380381 autocmd !
381- autocmd FileType netrw autocmd SneakPluginNetrw CursorMoved <buffer>
382+ autocmd FileType netrw,filebeagle autocmd SneakPluginNetrw CursorMoved <buffer>
382383 \ call <sid> map_netrw_key (' s' ) | call <sid> map_netrw_key (' S' ) | autocmd ! SneakPluginNetrw * <buffer>
383384 augroup END
384385endif
You can’t perform that action at this time.
0 commit comments