I\'m using Notepad++ for some projects and miss Visual Studio\'s Ctrl + X, Ctrl + C functionality that cuts or copies the entire curr
Go to Settings->Shortcut Mapper and click on the "Scintilla commands" tab at the top. Under there you should be able to change the Ctrl + L command to Ctrl + X.
you can write a program with a global key event hook, which every time you make a Ctrl + X checks if notepad++ is the foremost application running, grabs the screen, checks if any text is selected (by looking at the screenshot and your notepad++ color settings), and sends a WM_KEYPRESS message to the notepad++ window simulating a Ctrl + L (assuming you're using windows).
(this won't put the line into the clipboard though, you'll have to make some character recognition to allow it)
There is a plugin for it at https://github.com/kbilsted/NppPluginCutNCopyLine its open source and the code is easy to modify if you have extra needs.
The plugin from MackieChan: notepad-visual studio line copy
has to be still setup-ed as follow:
Put it into notepad++/plugin folder
open notepad++ (restart)
in Settings -> Shortcut Mapper
under Scintilla Commands, remove the existing associations for Ctrl + C,X
under Plugin commands, find the scripts you just created and map your shortcuts to them.
Create this python script using the menu Plugins -> Python Script -> New script:
if editor.getSelectionStart() == editor.getSelectionEnd():
editor.lineCut()
else:
editor.cut()
Restart notepad++ (important)
Go to Menu Settings -> Shortcut Mapper -> Plugin commands
Find the script you just created in the list and set CTRL+X shortcut for it
Enjoy!
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