浏览代码

auto open with coc explorer

Chris 4 年之前
父节点
当前提交
4613860a32
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      plug-config/coc/coc.vim

+ 6 - 0
plug-config/coc/coc.vim

@@ -163,3 +163,9 @@ let g:coc_snippet_prev = '<c-k>'
 
 " Use <C-j> for both expand and jump (make expand higher priority.)
 imap <C-j> <Plug>(coc-snippets-expand-jump)
+
+augroup MyCocExplorer
+  autocmd!
+  autocmd VimEnter * sil! au! FileExplorer *
+  autocmd BufEnter * let d = expand('%') | if isdirectory(d) | silent! bd | exe 'CocCommand explorer ' . d | endif
+augroup END