Notepad ++设置,用于禁用自动打开以前的文件

本文翻译自:Notepad++ Setting for Disabling Auto-open Previous Files

在此处输入图片说明

How do I stop Notepad++ from loading all files from the past session? 如何停止Notepad ++加载上一个会话中的所有文件?

Every time I open a file I have 10 other open tabs with all my past files. 每次打开文件时,我都会打开其他10个选项卡,其中包含所有过去的文件。 I don't want that. 我不要 When I hit the close button I expect the program to do what I want and close it. 当我按下关闭按钮时,我希望程序执行我想要的操作并关闭它。 If I wanted to save a session I would use the built in session save feature. 如果要保存会话,则可以使用内置的会话保存功能。 I don't want to hit the gray x 20 times when I am done so next time I don't have a bunch of files opening and taking up memory. 我不想在完成操作后达到灰色x 20倍,因此下一次我没有一堆文件打开并占用内存。

I tried the -nosession parameter and that works. 我尝试了-nosession参数,并且有效。 But it only works if I use the shortcut. 但这仅在我使用快捷方式的情况下有效。 It won't work if I use the right-click edit method. 如果使用右键单击编辑方法,它将不起作用。 How do I set Notepad++ to do this? 如何设置Notepad ++来做到这一点?


#1楼

参考:https://stackoom.com/question/jCeu/Notepad-设置-用于禁用自动打开以前的文件


#2楼

In Notepad++ v6.6 this setting is moved to the Backup tab of the Preferences menu. 在Notepad ++ v6.6中,此设置将移至“首选项”菜单的“备份”选项卡。

在此处输入图片说明


#3楼

My problem was that Notepad++ was crashing on a file I had previously opened; 我的问题是Notepad ++在我以前打开的文件上崩溃了。 I was unable to open the application at all. 我根本无法打开该应用程序。 This blog post (no longer valid) discusses how to delete the data from the "Sessions" file so that Notepad++ will open without having any prior files open: 这篇博客文章 (不再有效)讨论了如何从“会话”文件中删除数据,以便在不打开任何先前文件的情况下打开Notepad ++:

From the blog post: 从博客文章:

Method 1 - edit session.xml 方法1-编辑session.xml

  1. Open file session.xml in C:\\Users\\Username\\AppData\\Roaming\\Notepad++ or %APPDATA%\\Notepad++ 在C:\\ Users \\ Username \\ AppData \\ Roaming \\ Notepad ++或%APPDATA%\\ Notepad ++中打开文件session.xml
  2. Delete its contents and save it 删除其内容并保存
  3. Run Notepad++ , session.xml will get new content automatically 运行Notepad ++,session.xml将自动获取新内容

Method 2 - add the -nosession parameter to Notepad++ shortcut 方法2-将-nosession参数添加到Notepad ++快捷方式

  1. Create a desktop shortcut referring to your Notepad++ program, eg C:\\Program Files\\Notepad++\\notepad++.exe 创建引用您的Notepad ++程序的桌面快捷方式,例如C:\\ Program Files \\ Notepad ++ \\ notepad ++。exe
  2. Right click on this shortcut 右键单击此快捷方式
  3. In the "Target" field add the -nosession parameter so the target field looks exaxtly like (apostrophes included too): "C:\\Program Files\\Notepad++\\notepad++.exe" -nosession 在“目标”(Target)字段中添加-nosession参数,以便目标字段看上去很像(也包括撇号):“ C:\\ Program Files \\ Notepad ++ \\ notepad ++。exe” -nosession
  4. Save and run Notepad++ from this shortcut icon with no recent files 从此快捷方式图标保存并运行Notepad ++,没有最近的文件

Note: This is not a permanent setting, this simply deletes the prior session's information / opened files and starts over. 注意:这不是永久性的设置,只会删除上一个会话的信息/打开的文件并重新开始。

Alternatively, if you know the file which is causing notepad++ to hang, you can simply rename the file and open notepad++. 另外,如果您知道导致notepad ++挂起的文件,则可以简单地重命名该文件并打开notepad ++。 This will solve the problem. 这样可以解决问题。

I hadn't seen this solution listed when I was googling my problem so I wanted to add it here! 谷歌搜索我的问题时,我没有看到此解决方案列出,所以我想在这里添加它!


#4楼

I read the answers. 我读了答案。 Then I noticed for me that the check box was already unchecked , but it still always reloaded the files. 然后我为我注意到该复选框已经取消选中 ,但是它仍然总是重新加载文件。 This is the Settings->Preferences->MISC->"Remember current session for next launch" check box on version 6.3.2. 这是版本6.3.2上的“设置”->“首选项”->“ MISC”->“记住当前会话以便下次启动”复选框。 The following got rid of the problem: 以下摆脱了这个问题:

1. Check the check box.
2. Exit the program.
3. Start the program again.
4. Uncheck the checkbox.

#5楼

Use the menu item Settings>Preferences . 使用菜单项设置>首选项

On the MISC tab of the resulting dialog, uncheck "Remember current session for next launch." 在出现的对话框的 MISC”选项卡上,取消选中“记住当前会话以进行下一次启动”。


#6楼

For versions 6.6+ you need to uncheck "Remember the current session for next launch" on Settings -> Preferences -> Backup . 对于6.6+版本,您需要在Settings -> Preferences -> Backup上取消选中“记住下次启动时的当前会话”。

这是6.6+

For older versions you need to uncheck "Remember the current session for next launch" on Settings -> Preferences . 对于较旧的版本,您需要在Settings -> Preferences上取消选中“记住当前会话以供下次启动”。

就是这个

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值