5

我没有看到Copy命令的菜单选项。这是我在 Windows 7 机器上看到的菜单:

NERDTree Menu. Use j/k/enter and the shortcuts indicated
==========================================================
> (a)dd a childnode
  (m)ove the curent node
  (d)elete the curent node

根据插件文档Copy并非所有平台都支持该命令。

A textual filesystem menu is provided which allows you to create/delete/move file 
and directory nodes as well as copy (for supported OSs)

有没有人设法让它在 Windows 中工作?

4

2 回答 2

2

The root cause for the issue is discussed in detail(rather colorfully) in this blog post.(ht romainl). I managed to find a solution by using the cp.exe shipped with msygit.

Ensure cp.exe is in your path

The cp.exe file can be found in <GIT_HOME>\bin directory. My path didn't not contain the ``\bindirectory. So I copiedcp.exeandmsys-1.0.dll` to a directory in my path.

Set the g:NERDTreeCopyCmd variable

Add the line below to the end of the _vimrc file

let g:NERDTreeCopyCmd= 'cp -r '

Fix the implementation of s:Path.copy function.

Replace the lines 2297-2299 of ~/vimfiles/bundle/nerdtree/plugin/NERD_tree.vim (assuming you used pathogen for managing vim plugins)

  • Replace the lines 2297-2299

    let dest = s:Path.WinToUnixPath(a:dest)
    
    let cmd = g:NERDTreeCopyCmd . " " . escape(self.str(), s:escape_chars) . " " . escape(dest, s:escape_chars)
    
  • With the lines below

    let dest = a:dest
    let cmd = 0
    if s:running_windows
        let cmd = g:NERDTreeCopyCmd . '"' . self.str() . '" "' . dest . '"'
    else
        let cmd = g:NERDTreeCopyCmd . " " . escape(self.str(), s:escape_chars) . " " . escape(dest, s:escape_chars)
    endif
    
于 2012-06-30T23:40:18.637 回答
2

我通过安装Gow让它工作了

choco install -y gow

然后将此行添加到vim

let g:NERDTreeCopyCmd= 'cp -r'

谢谢:https ://github.com/scrooloose/nerdtree/issues/152

PS:choco命令来自https://chocolatey.org/

于 2016-04-22T14:59:07.943 回答