Closed ysl2 closed 3 years ago
"i": ["wait", "expandable?", "cd", "open"],
"I": ["wait", "gotoParent"],
@weirongxu 老哥,原来您是中国的,太好了,我英语不太行,刚才我没说明白
我现在的状况是:
按i
和I
能正常的进入目录和退出目录,但是我在shell下的位置依然始终在原地没动(一直保持在vim打开时的路径)。我想让我当前在shell下的路径也跟着i
和I
变化。
通过explorer打开某个文件以后,如果收缩explorer再重新展开explorer,我当前在explorer里的路径会直接跟随到当前打开文件的位置。我想始终保持在explorer的项目位置,而不是这种跟随的方式。
上述过程中,我在shell下的路径始终没改变。
我想达到的效果:
explorer的根目录只与i
和I
有关,与当前打开文件的动作无关。
在通过按i
和I
改变explorer的根路径的时候,我在当前shell下的路径也会跟着一起变化。
多谢老哥帮忙,谢谢 :-)
The current status:
1, I can change directory normally by i
and I
, but the real directory in shell still keep in the path where I open vim. I want my shell path changed together with explorer.
My shell path still in the path where I open vim.
The expection I want:
The root directory in explorer is only relative with i
and I
, insted of the open-file motion.
The shell path will automatically changed then pressing i
and I
Thanks for your help :-)
按i和I能正常的进入目录和退出目录,但是我在shell下的位置依然始终在原地没动(一直保持在vim打开时的路径)。我想让我当前在shell下的路径也跟着i和I变化。
这应该是 shell 的限制,我没找到办法在 vim 里修改 shell 的工作目录
通过explorer打开某个文件以后,如果收缩explorer再重新展开explorer,我当前在explorer里的路径会直接跟随到当前打开文件的位置。我想始终保持在explorer的项目位置,而不是这种跟随的方式。
收缩展开 explorer 不会跟随文件,你可能指的是 打开关闭
CocCommand explorer --root-strategies keep
"explorer.file.revealWhenOpen": false
@weirongxu 老哥,我现在有点事,出门了。刚才在一边走一边看,我发现一条下面这个coc-json设置,不知道能不能用这个达到切换shell目录的效果?
explorer.file.cdCommand: "cd"
@weirongxu 老哥,我现在有点事,出门了。刚才在一边走一边看,我发现一条下面这个coc-json设置,不知道能不能用这个达到切换shell目录的效果?
explorer.file.cdCommand: "cd"
这个是切换 vim 内部的 cwd
目录 :help pwd
老哥,刚才问题解决了。我的设置如下:
init.vim
=====
nmap <silent> \e :CocCommand explorer --root-strategies reveal<CR>
coc-settings.json
=============
"explorer.file.showHiddenFiles": false,
"explorer,file.cdCommand": "cd",
"explorer.keyMappings.global": {
"i": ["wait", "expandable?", "cd", "open"],
"I": ["wait", "gotoParent"],
}
Hello, I tried my best to figure out which setting could achieve my expection but failed.
I want to use
i
andI
to change my root directory (and pwd), and the root will not be auto modified. But now when I open a file, my directory auto changed.This is part of my personal setting items relative to the directory settings.
I would be very appreciate if you could help me, Thanks :-)