Add ability to list file metadata...

(Based on a change by github.com/apbarrero))
Add menu/list command to display file metadata
Support OSX as well as Unix
This commit is contained in:
Jonathan Seidel 2015-11-02 11:30:16 -08:00
parent 0b44415a33
commit 88104d26ac

View File

@ -34,6 +34,10 @@ if g:NERDTreePath.CopyingSupported()
call NERDTreeAddMenuItem({'text': '(c)opy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
endif
if has("unix") || has("osx")
call NERDTreeAddMenuItem({'text': '(l)ist the current node', 'shortcut': 'l', 'callback': 'NERDTreeListNode'})
endif
"FUNCTION: s:echo(msg){{{1
function! s:echo(msg)
redraw
@ -267,4 +271,14 @@ function! NERDTreeExecuteFile()
endif
endfunction
function! NERDTreeListNode()
let treenode = g:NERDTreeFileNode.GetSelected()
if treenode != {}
let metadata = split(system('ls -ld ' . shellescape(treenode.path.str())), '\n')
call s:echo(metadata[0])
else
call s:echo("No information avaialable")
endif
endfunction
" vim: set sw=4 sts=4 et fdm=marker: