The command palette of Visual Studio Code is enriched by an additional command for opening the active file with Notepad++. Multiple configuration options are available (see below).
A keyboard shortcut Ctrl+K Ctrl+N is set for triggering this command.
The context menus of the VS-Code editor and explorer are extended correspondingly by an additional entry. This can be configured via the extension settings (see below).
Notepad++ needs to be installed. See https://notepad-plus-plus.org/downloads/
The following settings are provided and can conveniently be opened via command Open Settings for 'Open in Notepad++':
openInNpp.extendExplorerContextMenu: Add Open in Notepad++ to the context menu of the VS-Code explorer (default: true)openInNpp.extendEditorContextMenu: Add Open in Notepad++ to the context menu of the VS-Code editor (default: true)openInNpp.decoupledExecution: Run Notepad++ independently of VS-Code, in particular, do not close Notepad++ upon exit of VS-Code (default: true); corresponds to option detached of child process creation
openInNpp.preserveCursorPosition: Let Notepad++ preserve the cursor position of the VS-Code editor (default: true); corresponds to command line parameters -n / -c; if set to false Notepad++ will position the cursor at the beginning of the first line
openInNpp.Executable: Specifies the path of the Notepad++ executable; if not explicitly set a lookup in the following order is made%ProgramFiles%\Notepad++\notepad++.exe%ProgramFiles(x86)%\Notepad++\notepad++.exeC:\Program Files\Notepad++\notepad++.exeC:\Program Files (x86)\Notepad++\notepad++.exenotepad++.exe(fallback lookup via the folders of the Windows %PATH% environment variable)
openInNpp.workingDirectory: Specifies the path of the folder used as working directory during the execution of Notepad++; if not explicitly set the folder containing the file to be opened is enforced as working directory or - when a folder is opened - the folder itself is also used as working directory; if a relative path is specified here it will be based on the first workspace folder of VS-Code
openInNpp.multiInst: Open a separate instance of Notepad++ for each command execution (default: false); corresponds to command line parameter -multiInstopenInNpp.skipSessionHandling: Prevent Notepad++ from loading the previous session and changing its state (default: false); corresponds to command line parameter -nosession
openInNpp.openFolderAsWorkspace: When passing a folder path along to Notepad++ let this folder be handled as a workspace (default: false); corresponds to command line parameter -openFoldersAsWorkspaceopenInNpp.filesInFolderPattern: Instead of passing a folder path along to Notepad++ find all files (relative to this folder) matching the specified glob pattern and let the result list become the arguments of the execution of Notepad++; Notepad++'s default handling of a folder path likely corresponds to applying the pattern**/*.*(i.e. subfolders are recursively taken into account, due to this the pattern*.*is possibly a good choice)
openInNpp.commandLineArguments: Specifies additional arguments to be passed along to Notepad++; a comprehensive overview of the command line parameters of Notepad++ is available hereopenInNpp.spawnOptions: Specifies additional options for child process creation; details are available here
- None Please report @
Sponsored by Icons8