Notepad++ right-click to open file in a new window - windows

How can I configure Notepad++ to open a file in a new window when I right-click it and select Edit with Notepad++ ? I already know I have to launch the program with the -multiInst switch, I just don't know how to add that to the registry mapping for the right-click.

If you want to fix the right-click behavior of "Edit with Notepad++", first go to:
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Notepad++
If the default value is:
{00F3C2EC-A6EE-11DE-A03A-EF8F55D89593}
then go to:
HKEY_CLASSES_ROOT\CLSID\{00F3C2EC-A6EE-11DE-A03A-EF8F55D89593}\Settings
Among the items should be Custom REG_SZ and nothing after it. Change the value to -nosession -multiInst.
It should now read Custom REG_SZ -nosession -multiInst. If you already have custom arguments defined, then just add a space and append -nosession -multiInst to the list.
References
Context Menu - Notepad++ Wiki
Multiple Instances - Notepad++ Wiki
Extending Shortcut Menus (Windows)
Shell.ShellExecute method (Windows)
Default Programs (Windows)

I use a 2016 version of the NotePad++ installer. It natively includes Plugin Manager, context menu support and right click > Open of many files without any issues.
After installing, I go to Help > Update and the helpful settings remain in the upgrade.

Related

Copy path to opened file in PL SQL developer

When I open files in PL SQL developer I want to copy file path so I can go directly to the directory I need.
One way is to hover on the file and wait for tool tip to appear. But I have to wait a few seconds and I am not able to copy the path. Can I know the path in any other way?
Go to Configure > Tools
New
Define a tool as:
Executable/Script: cmd
Parameters: /c echo "#path" & pause
for the image I picked Tree View.png from the default selection.
The new tool will appear in the Tools menu under "User-defined tools" (briefcase icon).
Add it to the menu bar using More Buttons/Customize Quick Access Toolbar > More Commands > Commands tab > User Tools, then drag and drop (if using the Ribbon), or Right-click on toolbar, Customize > Commands tab > User Tools (if using the classic toolbar).
Or if you prefer, follow the same steps to add a custom tool calling explorer.exe passing #dir, the directory path of the current editor file. Selecting this custom tool from the menu will open Windows Explorer at the current file's location.
More suggestions and screenshots here: https://www.williamrobertson.net/documents/plsqldeveloper-setup-1.html#tools

How to set PowerShell 7 as default and remove other versions

I want to set PowerShell 7 as the default shell. So when I shift right click in File Explorer and click on "Open PowerShell window here" in the context menu, I want PowerShell 7 to come up.
And I want to remove completely the other versions.
Is there anyway to do that?
Follow these steps:
Click on the down arrow and press settings
A json file will open, and you will see a line near the top that has a parameter called defaultProfile with a UUID.
Also you will see a line representing the UUID of the PowerShell 7.0
Copy that UUID and put it in for defaultProfile
Good Luck!
Source:
https://www.codyhosterman.com/2020/05/defaulting-windows-terminal-to-powershell-7-x-core/
If you have Windows Terminal: Follow these steps:
Click the dropdown and go to Settings
On the General Tab, you will see default profile, click the dropdown and select the profile you would like to be default
to change powerShell version in windows 11, follow these steps
Open powerShell and go to setting by clicking down arrow
in Profiles tab (left side in menu) choose Windows PowerShell
edit the Command Line to powerShell Directory Like C:/Program Files/PowerShell/7/pwsh.exe
Save settings
that's it

Changing the default path of Visual Studio Code's integrated terminal

I'm trying to change the default path of the integrated terminal in Visual Studio Code, but I'm not sure how to. I do know how to change it in the windows command prompt, but not in Visual Studio Code. I looked in user settings, but I can't find anything there to change.
The current default path is C:\Users\User_Name.
I'd like to change it to C:\Project.
How do I do this in Visual Studio Code?
Short answer
Edit the user preference "terminal.integrated.cwd": "" to the path that you want the integrated terminal to open to.
Long answer
The same answer, but the long step-by-step version,
In Visual Studio Code go to:
Menu File → Preferences → Settings
Now that you are in the "User Settings", using the "Search Settings" bar across the top of the window paste or type this:
terminal.integrated.cwd
It will list the following as a result:
// An explicit start path where the terminal will be launched, this is used
as the current working directory (cwd) for the shell process. This may be
particularly useful in workspace settings if the root directory is not a
convenient cwd.
"terminal.integrated.cwd": "",
You will notice that it will not let you type here to change this setting. That is because you can't change the default setting. You instead need to change your personal settings. Here's how...
Click the pencil icon to the left of the this option and then the "Copy to Settings" option that pops-up.
You should have a split screen in which the right side of the screen has the heading Place your settings here to overwrite the Default Settings. This is the correct place for you to make changes. You might already have a few personalized settings listed here.
When you clicked "Copy to Settings" it automatically added this line for you:
"terminal.integrated.cwd": ""
Notice that whichever item is last in this list will not have a trailing comma but any items before it in the list will require one.
FYI: you could have simply typed or copy/pasted this into the personalized settings yourself, but following these steps is the process to learn for changing other preferences as needed.
Now you are able to type to set the path you want to use. Make sure to use \\ in place of \ and you do not need the trailing \. For example including this line would always start your terminal in the baz directory:
{
"terminal.integrated.cwd": "C:\\Users\\foo\\bar\\baz"
}
To apply the change, simply Save and restart Visual Studio Code.
As others have already explained, you can add a setting to change the default folder for your integrated terminal to start in. This setting also accepts Visual Studio Code variables, so to make a relative path from the root folder of your workspace you can use ${workspaceFolder}.
For example, for your terminal to always start in the subfolder mystart, your setting would be:
"terminal.integrated.cwd": "${workspaceFolder}/mystart"
Thanks for the original answer from Peter. Definitely helped !
It has now slightly changed in more recent versions of VS Code.
Navigate to File -> Preferences -> Settings
Type cwd in search
Choose Terminal > Integrated: Cwd settings
Type the default path you want to set in the text block below (simply, no need for double hashes to escape)
No need for saving, It's automatic
Restart VS Code
terminal cwd screen
Try this option in the "Intergrated Terminal" section of Settings.
"terminal.integrated.cwd": "",
You can also set it to a relative path to the open folder with
"terminal.integrated.cwd": "./example"
So if you do menu File → Open Folder... → project, and open the terminal with your keyboard shortcut, it will open to ~/project/example automatically.
It can be a general folder like src you would always use, or a specific one (but then it would be best to save it in file .vscode/settings.json).
The below option will help you do this.
Menu File → Preferences → Settings.
Add or edit the below setting.
terminal.integrated.shell.windows": ""
From the next terminal it will be reflected.
And add file .profile to your default shell, and add the default path to it.
More information can be found
at Integrated Terminal.

Vim as the default editor

I'm on Windows XP and I just installed GVim 7.3. How do I make the default editor? How can I make it run using the command prompt
e.g.
c:\Windows>gvim boot.ini
open this file in gvim.
Thanks a lot
Add Gvim to your PATH variable
To be able to call Gvim from the command line, you have to add the installation directory of Vim to your PATH variable. To do that, right click on My Computer on the desktop (or in Explorer) → Properties → Advanced Tab → Click on Button Environment Variables.
In the Dialog, go to the User Variables field and search if there is already a PATH variable. If there is a PATH Variable, select it, click Edit and change it as follows:
%PATH%;C:/Program Files/Vim/Vim73
(or whatever the installation directory of Gvim is).
If there is no PATH variable set, create a new one with the content written above.
Confirm everything with OK, then open a new command window (important!), navigate to the desired directory and type
gvim somefile.txt
This should bring up your favourite editor.
Set Gvim as default editor for a certain file type
Adding Gvim to your PATH doesn't make Gvim the default editor for a certain file type. This can be achieved the following way:
In Explorer, right click on any file and select Open With → Choose Program
in the upcoming window, select Vi improved - A Text Editor or browse for gvim.exe if the entry is not already there
select the Always use the selected program ... checkbox and click OK
from now on, every time you double-click the file, it will be opened with Gvim
The easiest way
If you install Gvim, be sure to check the Add to context menu option. If you did that, you can right click on any file in the Windows Explorer and select Edit with Vim.
Right click the any file you want to open -> select Open or Open With ->check always open with the following editor.
After installing vim the "Edit with vim..." menu item appears in the context menu (RMB click on any file to check). Thus you can edit any file (not only text file) with just selecting this menu item
Add gvim to the PATH variable and you can run it right as you want:
c:\Windows>gvim boot.ini

In Visual Studio when viewing a changeset, how can I change the view of cs files?

In Visual Studio with TFS as source control, when I view the history and double click a cs file, the file is loaded in notepad. How can i change the application to be notepad++?
I also would like the OS's default application for the file to still be visual studio
After pouring over ProcessMonitor logs I think I found the solution!
You need to change the what the Windows shell (explorer) thinks the "Edit" action for text files. I was able to change this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\text\shell\edit\command
to something other than Notepad (in my case notepad2). Now Visual Studio's TFS's changeset dialog opens cs files with that editor.
This will probably change the edit option for not just cs files, but everything considered "text'. The registry entries for file associations are pretty complicated. I suspect that it would be possible to disassociate .cs files from this common "text" category and make this change only for cs files (but I'm not that ambitious). Also, I wouldn't be surprised if people's file associations / shell commands (open, edit, etc...) vary from machine to machine (OS versions, tools installed, etc) - so YMMV.
The only way I found is to replace notepad with notepad++. This article describes how to do it. Don't forget to check the comments to get a link to the "little exe" that comes with notepad++.
Works like a charm on W7 x64.
Cheers,
Phil
\I was able to configure this by adding new value to the registry.
OS: Windows 7 Enterprise x64
Steps on how to do it.
Run: Regedit (alt + r, type regedit)
Look for HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations
Right click "SystemFileAssociation" -> add new key then name it as .cs
Right click .cs and add new key then name it as shell
Right click shell and add new keys name it as edit and open 6
Right click edit and add new key command then change the default value to point to the file exe you want it to run.
ex: C:\Program Files (x86)\Notepad++\notepad++.exe %1
Don't forget to add the %1 at the end of the .exe
do the same for open
Hope it helps.
I don't see any options in Visual Studio for changing that, so I'm guessing it uses the system's default text editor.
Try assigning Notepad++ as the default handler for *.cs files.
You can do this from withing Notepad++ by going to Settings/Preference/File Association.
You can also do it by right-clicking on a .cs file in explorer, go to Open With/Choose Program..., then select Notepad++ and check the "Always use the selected program to open this kind of file" box before hitting OK.
The only thing that works for me is when I set the default program for the particular file type in Windows Explorer to open with the VS IDE:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
This opens the code in a new instance of VS. Not ideal, but at least it's easier to read.

Resources