我最近了解到在vim中折叠,并且您可以使用:mkview
来保存文档中的折叠。但是,vim正试图在C:\Program Files (x86)\vim\
目录路径中保存视图,这需要Admin权限才能保存到...因为这是一个企业Win7工作机器,我需要说服vim它想要在其他地方保存视图。
我需要在_vimrc
文件中包含一个命令才能让vim将视图保存在其他地方吗?或者另一种控制这种行为的方法?
答案 0 :(得分:2)
设置viewdir
。
来自:help mkview
:
When [file] is omitted or is a number from 1 to 9, a name is generated and 'viewdir' prepended.
:help 'viewdir'
给出:
*'viewdir'* *'vdir'*
'viewdir' 'vdir' string (default for Amiga, MS-DOS, OS/2 and Win32:
"$VIM/vimfiles/view",
for Unix: "~/.vim/view",
for Macintosh: "$VIM:vimfiles:view"
for VMS: "sys$login:vimfiles/view"
for RiscOS: "Choices:vimfiles/view")
global
{not available when compiled without the |+mksession|
feature}
Name of the directory where to store files for |:mkview|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.