kludge "Reveal"
This commit is contained in:
parent
4baccf1f8b
commit
490c1cd331
2 changed files with 19 additions and 15 deletions
|
|
@ -1,20 +1,23 @@
|
|||
-- RevealInFinder
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
||||
-- set this to leader-e
|
||||
vim.cmd([[
|
||||
function! s:RevealInFinder()
|
||||
if filereadable(expand("%"))
|
||||
let l:command = "open -R %"
|
||||
elseif getftype(expand("%:p:h")) == "dir"
|
||||
let l:command = "open %:p:h"
|
||||
else
|
||||
let l:command = "open ."
|
||||
endif
|
||||
execute ":silent! !" . l:command
|
||||
redraw!
|
||||
endfunction
|
||||
command! Reveal call <SID>RevealInFinder()
|
||||
function! s:RevealInFinder()
|
||||
if filereadable(expand("%"))
|
||||
let l:command = "xdg-open -R %"
|
||||
elseif getftype(expand("%:p:h")) == "dir"
|
||||
let l:command = "xdg-open %:p:h"
|
||||
else
|
||||
let l:command = "xdg-open ."
|
||||
endif
|
||||
execute ":silent! !" . l:command
|
||||
redraw!
|
||||
endfunction
|
||||
|
||||
command! Reveal call <SID>RevealInFinder()
|
||||
]])
|
||||
|
||||
return {}
|
||||
vim.keymap.set('n', '<leader>R', ":Reveal<CR>", { noremap = true, desc = '[R]eveal with xdg-open' })
|
||||
|
||||
return {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue