I'm using Notepad++ for some projects and miss Visual Studio's Ctrl + X, Ctrl + C functionality that cuts or copies the entire current line when no text is selected. The cut line shortcut seems to be Ctrl + L, which is not as convenient as Ctrl + X and the copy shortcut seems to be Ctrl + D, Ctrl + L, which is even less convenient.
Although a similar question has been asked before, the way to do this in Notepad++ was not provided and I cannot find a solution on the Notepad++ site or on its forums.
use shortcut Ctrl + Alt + M. or press F1 and then select/type Stop Code Run.
On the menu bar, choose Tools > Options. Expand Environment, and then choose Keyboard. Optional: Filter the list of commands by entering all or part of the name of the command, without spaces, in the Show commands containing box. In the list, choose the command to which you want to assign a keyboard shortcut.
I've created a Notepad++ plugin that does this (without the need of python). It can be found at https://bitbucket.org/zastrowm/notepad-visualstudiolinecopy.
Synthesizing all other answers and comments, plus some additional necessary steps that haven't been mentioned:
Scintilla provides a "copyAllowLine" command that does this. Notepad++ doesn't expose that command in the shortcut mapper, but you can call it from a Python script and map Ctrl + C to that script. There is no corresponding command for "cutAllowLine", but a bit of extra Python code will do it. These scripts must be added to the menu and Notepad++ must restart before they will become available in the shortcut mapper.
Install Python Script plugin(can be done with Notepad++ Plugin Manager)
Create the following two python scripts using the menu Plugins -> Python Script -> New script
editor.copyAllowLine()
if editor.getSelectionStart() == editor.getSelectionEnd(): editor.lineCut() else: editor.cut()
Python Script -> Configuration
Restart notepad++ (important)
Settings -> Shortcut Mapper...
under Scintilla Commands, remove the existing associations for Ctrl + C and Ctrl + X.
under Plugin commands, find the scripts you just created and map your shortcuts to them.
Note: when installed via plugin manager, version 1.0.6 was installed. When I attempted to run anything python related in Notepad++ I got an unknown exception from plugin manager. The solution was to manually download and install the 1.0.8 .msi from here: 1.0.8 installer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With