Issue with 'asNotepad.xml' file.
-
I do use notepad.exe by the way, for opening .txt files for example.
But, I don’t use that for programming.Notepad++ is better for that purpose, but I just can not warm up to its tabbed browsing features, I feel it is worse for my productivity etc.
So, yeah, how can we open every file in single instance mode then and disable tabbed browsing? If you know how, please share. thanks. : )
-
If you know how, please share
I don’t…maybe someone else.
Often on this site, I’ll delve into other people’s raised issues and look into solutions, mainly because I find it interesting and possibly useful to me as well. This one I just can’t get into because I have no interest in it and see no value in “pulling the wheels” off of such a core Notepad++ feature. Good luck in your investigation.
-
Hello, @salviasage, @scott-sumner and All,
Not completely sure, but you don’t need the zero-length
asNotepad.xml
file ! Simply :-
Close any instance of N++, first
-
Open a CMD console window
-
Type in the command
notepad++ -nosession -notabbar
and valid
Note :
The
new 1
file is opened, by default !Cheers,
guy038
-
-
Great idea. Here are a few possible tweaks:
-
If you add in
-multiInst
, then it doesn’t matter if you have another N++ window already open:notepad++ -nosession -notabbar -multiInst
. -
If you don’t want to have to open a CMD or PowerShell console window, you can just use the windows Run menu (START menu, type
run
; or just typeWinKey+R
) -
If you edit your file association(s) and/or right-click context menu entries in the registry from
"c:\program files (x86)\Notepad++\notepad++.exe" "%1"
to"c:\program files (x86)\Notepad++\notepad++.exe" -nosession -notabbar -multiInst "%1"
, then it will become your default behavior
-
-
yeah but, those do not launch the file, still the file 1 gets opened… which is wrong because i am clicking on “edit with notepad++” on a specific file, that file just gets opened at another tab, so the tabbed browsing feature is still there, only hidden.
So, there is no way to disable tabbed browsing:?
Or perhaps, you could make a suggestion on using tabs differently. -
I didn’t change my association… but when I did those from the command line or the run menu, they opened the file in a new instance
-
Did you try just the registry, just the command line, just the run menu, or some of all. What were the exact commands you used? (maybe come up with dummy paths/names, if you need to keep such information confidential… but make sure it’s easy for us to distinguish: “file 1” and “specific file” aren’t very helpful in telling which is which.)
If you tried the registry change: Which registry entry / entries did you change? And to what, exactly? Maybe you missed one (which happened to be the critical one), or had a typo.
-
I experimented a bit this morning, and this replicated the behavior that I believe you want:
- Run
regedit
- Navigate to
KEY_CLASSES_ROOT\*\shell
- LeftPane: RightClick on
shell
, New > Key =SingleTabNotepad++
- LeftPane: LeftClick (select)
SingleTabNotepad++
- RightPane: set
(Default)
toOpen with new Single-tabbed Notepad++ instance
- LeftPane: RightClick on
SingleTabNotepad++
, New > Key =command
, and select - LeftPane: LeftClick (select)
command
- RightPane: set
(Default)
to"c:\program files (x86)\Notepad++\notepad++.exe" -nosession -notabbar -multiInst "%1"
(make sure to include the shown capitalization of options, and the quotes around the executable path [if it has spaces] and around the%1
[because filename will often have spaces]) - Exit registry editor
- You may have to log off and back on, or reboot (or, if you have NirSoft’s nircmd tool, you can use
nircmd shellrefresh
andnircmd sysrefresh
to force registry changes to take effect immediately)
At this point, whether I have my normal multi-tabbled single-instance Notepad++ currently running or not:
- if I right click on a file in Windows Explorer, and select
Open with new Single-tabbed Notepad++ instance
, it opens that one file in a new instance of Notepad++ without a tabbar - if I ctrl-click on two different files in Windows Explorer, and select
Open with new Single-tabbed Notepad++ instance
, it opens those two files in two separate insatance of Notepad++ without tabbars - if I drag a file into my normal tabbed instance of Notepad++, it properly opens it in that instance
There is a caveat to doing it this way – as there will be in any configuration when you’re trying to avoid the normal functionality of an application:
- if you try to use File > Open in one of the single-tabbed instances of Notepad++, it will open the new file in the same instance of your single-tabbed Notepad++, hiding your older file. Both are accessible through that instance’s Window menu.
I had hoped that combining that with the asNotepad.xml would give a more-unified notepad-like experience, where each File>Open would also open a new instance.
I thought maybe changing Settings > Preferences > Multi-Instance to “always in multi-instance” would do it… but no.
I did a quick search through the source code for the asNotepad.xml, and all that does is set three parameters
if (pNppParameters->asNotepadStyle()) { isMultiInst = true; cmdLineParams._isNoTab = true; cmdLineParams._isNoSession = true; }
The
isMultiInst
appears to only be used during theWinMain()
function, so only when it’s deciding whether to create a brand-new window, or attach to an existing window; so that won’t be triggered during File > Open.At this point, if the workarounds listed here do not do what you want, you’ll have to add a feature request. If you do, be explicit about what you want. If it were me who wanted such a feature (and I don’t; I think tabbed browsing is significantly more efficient than multiple independent windows: if I have 10 files open in Notepad++, I’d much rather the organizing of those 10 files is handled inside of Notepad++, rather than having to go to the task bar and look through the 10 instances of Notepad++ stacked there to find the one file I want) – but if it were me, I’d try to phrase it something like “I like the idea of the asNotepad.xml feature, where Notepad++ is automatically launched in
-multiInst -nosession -notabbar
mode, but I’d also like it to have the additional features that 1) when I right click in Windows Explorer and select Open In Notepad++, that it would open in another new single-tabbed instance of Notepad++ (currently, it adds it to one of my existing instances, which hides the tab that was already open, defeating the purpose of the asNotepad.xml, IMHO); also, that when I use File>Open from one of thes asNotepad.xml windows, it should open it in a new instance rather than in the existing instance, for similar reasons.”.I don’t guarantee this will get implemented*, but it’s your best chance for it, if the workarounds presented here are not sufficient for you. (*: in fact, given that the
asNotepad.xml
feature was added in v4.8 back in 2008, I doubt much effort will be added to that ancient feature.) - Run
-
(okay, so reading it some time later, I actually should have included the “2)” in my example phrasing… I am sure you can tell where it was intended.)
-
Wow. Great post @PeterJones.
You may not know this, but editing the windows registry is one of my strongest areas on computers. So it was a breeze for me to recreate what you have said here.
This method is superior to creating a
asNotepad.xml
file in the Notepad++ directory because that does not open the file that you want to open in the viewing tab but only loads it into the tab bar so you are left staring at an older file that you opened which is definitely not what the user wants.Also, this option still allows you to open things in the regular, sessioned and tabbed notepad++ while giving you another option in the right click menu to open things in a single tabbed format just like notepad.exe
So, if you also want notepad++ to work like this, I created a .reg file, just create a file that ends with the
.reg
extension and copy paste the following in to it.Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\SingleTabNotepad++] @ = "Edit with Notepad++ (Single Tab)" "Icon"=hex(2):63,00,3a,00,5c,00,70,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\ 00,66,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\ 4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\ 00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00 [HKEY_CLASSES_ROOT\*\shell\SingleTabNotepad++\command] @ = "\"c:\\program files (x86)\\Notepad++\\notepad++.exe\" -nosession -notabbar -multiInst \"%1\""
This will give you an option on top of the default “Edit with Notepad++” to use notepad++ without the sessions or tabs and will open the files separately just like in notepad.exe (without changing any default notepad++ behaviour)
Thanks to everyone who replied!