KEEP K.I.S.S.

tk's blog

XP 下 GVim 工作目录问题

tk posted @ Jan 09, 2013 05:04:41 PM in 业余 with tags vim , 3379 阅读

用GVim打开文件,工作目录就是文件所在目录。

点击桌面上快捷方式打开GVim,工作目录是桌面,用 :pwd 命令检测。

把快捷方式加到桌面任务栏的快速启动栏中,“一般”情况下,快速启动的GVim工作目录是 ~ 下,也就是用户目录下。

但是如果你打开过 Windows字体目录(C:\WINDOWS\Fonts),之后再用快速启动打开GVim,工作目录会变成 C:\WINDOWS\Fonts ,多少次都是如此。重启后会恢复正常。

因为GVim安装后默认添加的桌面快捷方式属性中只有目标位置,而起始位置为空,这里面起始位置就会被设定为起始的工作目录(一开始的,如果打开文件,工作目录就会被修改为文件所在目录)。将快捷方式属性中的起始位置设置后,快速启动的GVim的工作目录就是设置的位置。

我的猜测:在快捷方式属性起始位置为空的情况下,在未打开 Windows字体目录前,Windows 会将快速启动栏中程序默认工作目录设置为用户目录,但是在打开 Windows字体目录后,快速启动栏中程序默认的工作目录就变成了 Windows字体目录。不知道算不算一个 bug。

这里当然也学到了一点收获,那就:生成快捷方式的时候,不要留空起始位置属性

  • 无匹配
Avatar_small
亚弥 说:
Jan 10, 2013 06:23:36 AM

其实真正的原因是在留空的时候,新的进程会继承父进程的当前工作目录。

你开了一个explorer,自然工作目录就是explorer显示的那个了……

这很正常……

Avatar_small
tisyang 说:
Jan 10, 2013 10:42:58 AM

@亚弥: 从快速启动栏中启动的程序继承的工作目录(如果起始位置留空)只是特定的几个目录,而非 explorer 打开的目录,如果打开过 C:\Windows\Fonts,而且这就像一种感染,持续性的。我测试过, win7 快速启动栏也有这种情况。

Avatar_small
tisyang 说:
Jan 10, 2013 10:45:52 AM

@亚弥: 打开过 C:\Windows\Fonts ,之后关闭,再打开其他目录并没有效果,默认打开的gvim 工作目录还是字体目录

CBSE Class 6 English 说:
Sep 25, 2022 02:34:51 PM

To gain a thorough understanding of the topic, every student in sixth grade must study their first language, English. Self-practice and frequent review will have a significant influence on students' test performance at both the board and school levels. CBSE Class 6 English Question Paper For Class 6th Standard Term 1 & Term 2 and Regular Exams, the CBSE Board has developed a Sample Paper to help students understand the new or updated test structure.

SEO 说:
Jun 12, 2023 03:24:49 PM

I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often. 토토사이트

sophia 说:
Jun 19, 2023 01:44:09 PM

I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. 인천출장마사지

sophia 说:
Aug 21, 2023 02:20:36 AM

I appreciate everything you have added to my knowledge base.Admiring the time and effort you put into your blog and detailed information you offer.Thanks. BLACKHORN 209 POWDER

sophia 说:
Aug 29, 2023 04:55:30 PM

I admit, I have not been on this web page in a long time... however it was another joy to see It is such an important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues. เว็บแทงบอลดีที่สุดUFABET

Dave 说:
Sep 07, 2023 02:06:42 AM

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. bubbles game

Dave 说:
Sep 17, 2023 01:05:41 AM

I wish more authors of this type of content would take the time you did to research and write so well. I am very impressed with your vision and insight. Double carport nz

seo akc 说:
Oct 07, 2023 06:38:12 PM

I invite you to the page where you can read with interesting information on similar topics. <a href="https://www.cbdflex.com/product/30ct-cbd-gummy-bears-300mg/">Buy CBD Gummy Bears</a>

Dave 说:
Oct 09, 2023 01:43:38 PM

thanks this is good blog. LIFT DETOX CAPS

Dave 说:
Oct 26, 2023 01:00:18 AM

Attractive, post. I just stumbled upon your weblog and wanted to say that I have liked browsing your blog posts. After all, I will surely subscribe to your feed, and I hope you will write again soon! Private key recovery

wallpaper singapore 说:
Nov 02, 2023 05:26:34 PM

A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. Sajta de Pollo

wallpaper singapore 说:
Nov 03, 2023 02:23:59 PM

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. wallpaper singapore

Dave 说:
Nov 14, 2023 01:28:18 PM

The pencils are stars, and the packaging is the grand stage – enhancing the overall experience. pencil packing work from home

Dave 说:
Nov 17, 2023 12:00:25 AM

Hi there! Nice post! Please tell us when I will see a follow up! temazepam te koop

Dave 说:
Nov 25, 2023 02:22:48 PM

Thank you again for all the knowledge you distribute,Good post. I was very interested in the article, it's quite inspiring I should admit. I like visiting you site since I always come across interesting articles like this one.Great Job, I greatly appreciate that.Do Keep sharing! Regards, crimsafe logan

Dave 说:
Dec 22, 2023 09:20:31 PM

Wonderful blog! I found it while surfing around on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Appreciate it. roket288

Dave 说:
Dec 24, 2023 07:58:20 PM

An fascinating discussion is value comment. I think that it is best to write extra on this matter, it won’t be a taboo topic however generally people are not enough to talk on such topics. To the next. Cheers fake id belgie

jack 说:
Dec 26, 2023 01:41:30 AM

Such sites are important because they provide a large dose of useful information ... <a href="https://metric-calculator.com/convert-cu-cm-to-gal.htm">cu cm to gal</a>

Dave 说:
Jan 07, 2024 04:10:41 PM

Good post but I was wondering if you could write a litte more on this subject? I’d be very thankful if you could elaborate a little bit further. Appreciate it! hasch online

seo service london 说:
Jan 16, 2024 02:44:02 PM

Great webpage brother I am gona inform this to all my friends and contacts

mubashir 说:
Jan 20, 2024 09:16:05 PM

I can recommend primarily decent and even responsible tips, as a result view it: profile-backlinks

jsimitseo 说:
Feb 02, 2024 10:19:24 PM

Astounding, this is awesome as you need to take in more, I welcome to This is my page.  concierge doctor naples

Dave 说:
Feb 09, 2024 01:55:45 PM

This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!. hasch online

seo service UK 说:
Feb 22, 2024 08:44:22 PM

Oh my goodness! an excellent post dude. Thanks However We’re experiencing problem with ur rss . Don’t know why Can not sign up to it. Possibly there is any person getting identical rss problem? Anybody who knows kindly respond. Thnk


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter