From 88104d26ac5935d256e2b2800a5704461529eda5 Mon Sep 17 00:00:00 2001 From: Jonathan Seidel Date: Mon, 2 Nov 2015 11:30:16 -0800 Subject: [PATCH] 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 --- nerdtree_plugin/fs_menu.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nerdtree_plugin/fs_menu.vim b/nerdtree_plugin/fs_menu.vim index e99a85b..7caa6cc 100644 --- a/nerdtree_plugin/fs_menu.vim +++ b/nerdtree_plugin/fs_menu.vim @@ -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: