如何在当前文件上快捷菜单

时间:2018-06-27 02:43:55

标签: windows-10

因此,当前文件就是我单击的文件,我想按一下,即:F11使用特定的上下文菜单(例如:Edit with Notepadd++)打开该文件

注意:程序属性中的Shortcut key并没有帮助,因为它只是调用程序本身,而不是针对当前文件。 (也许我很累吗?)

系统:gvim 8.1 / Windows10

1 个答案:

答案 0 :(得分:1)

我在vimrc中有以下映射,这将打开一个浏览器窗口,其中包含当前文件。

nnoremap <F11> :!start explorer /select,%:p<cr>

作为后续操作,您可以按 Shift + F10 打开浏览器上下文菜单。

完整的上下文

  if has('win32')
    " MS-Windows
    if $USERPROFILE != ''
      let localvimrc = $USERPROFILE . '\_vimrc.local'
    endif

    " Open Windows explorer with current buffer selected
    nnoremap <F11> :!start explorer /select,%:p<cr>
  endif