Open two instances of Notepad++

49.1k views Asked by At

I would like to have two Notepad++ shortcuts in desktop, imagine to have two Notepad++ installed each with their exe icon shortcut, that is what I want, so I will can work in two projects,

I have tried all with instances, and "multiins" or "atl + f6", but it does not work as I want,

again, this is different to another questions with the same title, I want to have two shortcut icons of notepad++, each one opening their files opened,

if it is not possible, I will need to use notepad++ and sublime-text at the same time, but that will be a very ugly option

Thanks, I am using notepad++ 5.9.6

(imagine to open notepad++ and sublimetext, working different project in each one, I want to do that but only with notepad++ opening two notepads++, :P)

7

There are 7 answers

5
Dan Donoghue On BEST ANSWER

When you open the second file, whilst it opens as a second tab you can just grab the tab and drag it out of Notepad++ to open it in a second session. Sort of like how Firefox, Chrome and IE do it with tabs.

0
haper On

Notepad++ runs on a single instance even while running on different windows.You can find another example of such application in Microsoft Office's Excel. You open files windows, but it runs exactly on one process (EXCEL.EXE).

2
GYBE On

From the documentation:

You can launch Notepad++ with the -multiInst Command Line Switches. This will enable launching extra instances when opening files by double click or right click. Any command line will do, including the one that you can access from the Properties of the desktop shortcut.

You can always send a document being edited to another instance from the View menu or the tab right click menu, or call Run -> Open in another instance, regardless of this setting.

To force one file per instance Notepad-like behaviour, see Notepad-like Behaviour. This will hide the tab bar, but you can restore it from Settings -> Preferences -> Tab bar.

You can also access the properties of the Explorer Context Menu, and plug the -multiInst switch in the command line available there.

The Settings -> Preferences -> Multi-Instance preference widget allows choosing between the way Notepad++ handles multiple instances:

  • by default, us single instance mode
  • always use multiple instances
  • open session in new instance
0
Deqing On

Finally found how to do it:

  1. Settings > Preferences > Multi-Instance > Always in multi-instance mode
  2. If new a file, multi-instance is not working. Need to save this file first and then move the tab out of window.
0
Serve Laurijssen On

The github repo of notepadd++

https://github.com/notepad-plus-plus/notepad-plus-plus

shows what happens. it sets a bool based on the multi instance setting:

const NppGUI & nppGUI = nppParameters.getNppGUI();
if (nppGUI._multiInstSetting == multiInst)
{
    isMultiInst = true;
    // Only the first launch remembers the session
    if (!TheFirstOne)
        cmdLineParams._isNoSession = true;
}

If not multi instance the code searches for another instance and copies the new data into that one:

    if ((!isMultiInst) && (!TheFirstOne))
    {
        HWND hNotepad_plus = ::FindWindow(Notepad_plus_Window::getClassName(), NULL);
....
        COPYDATASTRUCT paramData;
        paramData.dwData = COPYDATA_PARAMS;
        paramData.lpData = &dto;
        paramData.cbData = sizeof(dto);
        ::SendMessage(hNotepad_plus, WM_COPYDATA, reinterpret_cast<WPARAM>(hInstance), reinterpret_cast<LPARAM>(&paramData));

So yeah, just set multi-instance in settings

2
Lucy Lu On

I just drag and drop a tab from existing session onto the desktop and it opens another instance.

3
NAVIN ROY On

There is a shortcut to open in new instance Alt + F6. Also if you want to open always in new instance than go to settings->prefrences->Multi-instance , here you can select option to always in multi-instance mode.