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).
Support for displaying virtual documents as described below by the corresponding configuration options
Notepad++ needs to be installed. See https://notepad-plus-plus.org/downloads/
The following settings are provided and can conveniently be accessed 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++.exe
C:\Program Files\Notepad++\notepad++.exe
C:\Program Files (x86)\Notepad++\notepad++.exe
notepad++.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.virtualDocumentsDirectory
: When a file does not exist in the local filesystem as it is actually a virtual document a shadow copy of this document will automatically be created in the specified folder and then shown in Notepad++. If no folder is specified here an info message will present the options to either accept a file path comprising the Windows standard temporary folder %TEMP% or to perform a File-Save-As selection.openInNpp.virtualDocumentsFileReuse"
: When file reuse is enabled all VS-Code editor instances referring to the same virtual document will share a common file shadow for being opened in Notepad++. Note that VS-Code editor instances may show different versions of the same virtual document and hence their contents may not be identical. As a consequence the contents of the shadow file will be overwritten to always reflect the particular version to be opened in Notepad++.
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 hereopenInNpp.developerTrace
: Specifies whether extended information is logged to the Developer Tools consoleopenInNpp.Executable
: the value { shell: true } for option openInNpp.spawnOptions
is required when specifying a Windows shortcut pointing to the Notepad++ executableNone: Please report here
Good to know for expert setting openInNpp.spawnOptions
:
Issue windowsverbatimarguments
Sponsored by Icons8