Skip to content

Commit

Permalink
Feat jump to current file when jumping
Browse files Browse the repository at this point in the history
fixes #2
  • Loading branch information
saccarosium committed Aug 24, 2024
1 parent 4fde4b4 commit a70ed91
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ftplugin/netrw.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ vim9script

# Imports: {{{

import autoload "../import/config.vim"
import "netrw_salad/config.vim"

# }}}
# File Helpers: {{{
Expand Down
File renamed without changes.
11 changes: 9 additions & 2 deletions plugin/netrw-salad.vim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
vim9script

import autoload "../import/config.vim"
import "netrw_salad/config.vim"

var conf = config.Get()

Expand All @@ -10,6 +10,13 @@ if (conf.configure_netrw)
g:netrw_altfile = 1
endif

def Explore()
Explore
exec $":/{escape(expand("#:t"), &shellslash ? '\' : '/')}/"
enddef

nnoremap <Plug>NetrwSaladExplore <scriptcmd>Explore()<CR>
if (config.CanMap())
nnoremap - :Explore<CR>
nnoremap <nowait> - <Plug>NetrwSaladExplore
endif

0 comments on commit a70ed91

Please sign in to comment.