Skip to content

Commit 26a260e

Browse files
committed
Multi edit demo
1 parent 2f73171 commit 26a260e

File tree

3 files changed

+31
-23
lines changed

3 files changed

+31
-23
lines changed

README.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,62 @@
33

44
PyPadPlusPlus is an interactive Python environment based on Notepad++ (https://notepad-plus-plus.org/) and PythonScript (https://github.com/bruderstein/PythonScript/).
55

6-
Its special property is a fusion of the interactive Python shell with the editor to one single tool. This means that the editor can be used for both interactive testing of code and storing the commands permanently as part of your algorithm. So, you never have to copy code lines again from the editor to the shell or back. The output appears in a second frame, which is an output-only area, while the editor is an input-only area.
6+
Its special property is a fusion of the interactive Python shell with the editor to one single tool. This means that the editor can be used for both interactive testing and storing the final code. So, you never have to copy code lines again from the editor to the shell or back. The output appears in a second frame, which is an output-only area, while the editor is an input-only area.
77

8-
To execute one line or a piece of code press `<Shift> + <Enter>`. This executes the current line or the smallest number of lines belonging syntatically to the selection. No precise selection is required in order to execute valid parts of the code. The whole script can be executed with the selection of all by `<Ctrl> + <A>`. Cells of code can be optionally defined by special comments starting with `#%%`. In any case you have the choice whether you want to execute cells, single lines or code selections. With the mouse wheel button you can execute any line or piece of code by one click. The output is shown in an output console frame. The console has an undo buffer for every execution that produced some output.
8+
To execute one line or a piece of code press `<Shift> + <Enter>`. This executes the current line or the smallest number of lines belonging syntatically to the selection. No precise selection is required in order to execute valid parts of the code. The whole script can be executed with the selection of all lines by `<Ctrl> + <A>`. Cells of code can be optionally defined by special comments starting with `#%%`. In any case you have the choice whether you want to execute cells, single lines or code selections. With the mouse wheel button you can execute any line or piece of code by one click. The output is shown in an output console frame. The console has an undo buffer for every execution that produced some output.
99

10-
By selecting a variable and hovering over it with the mouse or pressing `<Shift> + <Ctrl> + <Space>` will show a popup with information about its current type and value. Autocompletion lists for objects and dictionaries allows you to explore the current run-time information of a variable.
10+
Selecting a variable and hovering over it with the mouse or selecting any expresion and pressing `<Alt> + <Space>` will show a popup with information about its current type and value. This also supports numpy shape information. Autocompletion lists for objects and dictionaries allows you to explore the current run-time information of a variable.
1111

1212
The extension comes with another little feature that fits perfectly in the workflow of PyPadPlusPlus. It allows you to log small pieces of code you wish to keep but don't know where to store. Just select any piece of code and press the keyboard shortcut `<Alt> + <S>`. The selection will be added to a file `codeSnippetsLog.txt` with the time and date in a comment line. Pressing the shortcut again without any selection opens this file. It acts as a kind of "Python diary" for code snippets.
1313

14-
<img src="https://raw.githubusercontent.com/bitagoras/PyPadPlusPlus/master/demo/pyPadDemo.gif">
14+
<img src="https://raw.githubusercontent.com/bitagoras/PyPadPlusPlus/master/demo/pyPadDemo.gif">
1515

1616
#### Features
1717

1818
* Run Python code line-by-line with `<Shift> + <Enter>`
1919
* Run selected Python code (intelligent selection, no accurate selection is required)
2020
* Run line or selection with middle mouse button
2121
* Run line or selection multiple times while cursor does not propagate (`<Shift> + <Ctrl> + <Enter>`)
22-
* Run cells of python code defined by `#%%` comments with `<Shift> + <Enter>`
22+
* Run cells of python code defined by `#%%` comments with `<Shift> + <Enter>` whey the cursor is at this comment line
2323
* A color marker highlights last executed lines
2424
* Animated color marker for active lines
25-
* Tooltip for run-time variable and object inspection of selected items and mouse hover or `<Shift> + <Ctrl> + <Space>`
25+
* Tooltip for run-time variable and object inspection of selected items and mouse hover or `<Alt> + <Space>`.
26+
* Evaluate variables below the cursor or any selected expression with `<Alt> + <Space>`, even some code is still running
2627
* Special Tooltip with size and shape information of numpy arrays
27-
* Evaluate variables or any selected expression (e.g. with `<Shift> + <Ctrl> + <Space>`), even if some code is still running
2828
* Code auto completion for run-time defined object properties, dictionary keys, function calls
2929
* Calltip for function calls, doc string and module help
30-
* Special Tooltip to switch quickly between `True` and `False`
30+
* Special Tooltip to quickly switch between `True` and `False`
3131
* Click on any Tooltip to show full string or help text in output console
3232
* Output console has an undo buffer (click inside and press `<Ctrl> + <z>`)
3333
* Clear output console with `<Shift> + <Ctrl> + <C>`.
34-
* Internal or external Python distribution can be used, including Python 3 kernels.
35-
* Take controll over Notepad++ with the Npp module provided by PythonScript (only available when using the internal Python. Load with `import Npp`)
36-
* Reset and restart Python kernel with `<Alt> + <R>`, e.g. when stuck in endless loop. (only available when using an external Python)
34+
* Internal or external Python distribution can be used for Python 3 kernels.
35+
* Take controll over Notepad++ with the Npp module provided by PythonScript (only available when using the internal Python. Load library with `import Npp`)
36+
* Reset and restart Python kernel with `<Alt> + <R>`, e.g. when stuck in endless loop. (only available when using an external Python, otherwise this only performs a variable reset)
3737
* Matplotlib event handler to hold multiple active plot windows
3838

39-
#### Roadmap
40-
Planned feature:
41-
* Remote kernel mode to run the code via network on any remote server that has Python installed, e.g. on raspberry PI.
42-
4339
#### Download
4440

45-
PyPadPlusPlus requires Notepad++ and PythonScript. Since the installation is quite cumbersome you can download the [latest release](https://github.com/bitagoras/PyPadPlusPlus/releases/latest) ready-to-play in a bundle with Notepad++ v7.8.1 and PythonScript v1.5.2.0 as portable version:
46-
* Download [`Npp7.8.1_32bit_PyPadPlusPlus1.2.2.zip`](https://github.com/bitagoras/PyPadPlusPlus/releases/download/v1.2.2/Npp7.8.1_32bit_PyPadPlusPlus1.2.2.zip), unzip it into a folder and start `notepad++.exe`.
41+
PyPadPlusPlus requires Notepad++ and PythonScript. Since the installation is quite cumbersome you can download the [latest release](https://github.com/bitagoras/PyPadPlusPlus/releases/latest) ready-to-play in a bundle with Notepad++ v7.9.5, PythonScript v3.0.8.0 and Python 3.9 as portable version:
42+
* Download [`Npp7.9.5_32bit_PyPadPlusPlus1.3.0.zip`](https://github.com/bitagoras/PyPadPlusPlus/releases/download/v1.3.0/Npp7.9.5_32bit_PyPadPlusPlus1.3.0.zip), unzip it into a folder and start `notepad++.exe`.
43+
44+
This version also includes multi cursor edit known from Sublimetext or VSCode:
45+
* select next: `<Ctrl> + <D>`
46+
* select next whole word: `<Shift> + <Ctrl> + <D>`
47+
* undo select next: `<Ctrl> + <U>`
48+
* skip and select next: `<Ctrl> + <E>`
49+
* select all: `<Shift> + <Ctrl> + <L>`
50+
51+
<img src="https://raw.githubusercontent.com/bitagoras/PyPadPlusPlus/master/demo/multiedit.gif">
4752

4853
#### Installation
4954

5055
If you need to install PyPadPlusPlus in another version of Notepad++ you have to go the hard way:
5156

52-
1. Install Python Script from [PythonScript releases](https://github.com/bruderstein/PythonScript/releases) or from the plugin manager of Notepad++.
53-
2. Download the sources or the latest [PyPadPlusPlus release](https://github.com/bitagoras/PyPadPlusPlus/releases) and extract the files into the script folder of PythonScript:
57+
1. Install Python Script from https://github.com/bruderstein/PythonScript/releases/ or in the plugin manager of Notepad++.
58+
2. Download the sources or the latest [release](https://github.com/bitagoras/PyPadPlusPlus/releases) of PyPadPlusPlus and extract the files into the script folder of PythonScript:
5459
<br>`notepad++\plugins\PythonScript\scripts\` ("machine scripts")
5560
<br>or `notepad++\plugins\config\PythonScript\scripts\` ("user scripts")
56-
3. If you want to use the Python installation of your system, open the file `pyPadStart.py` and set the variable `pythonPath` to the path that contains your `pythonw.exe` file.
61+
3. Open the file `pyPadStart.py` and set `pythonPath` to the path of your pythonw.exe file.
5762
4. Start Notepad++ and go to the menu "Plugins → Python Script → Configuration..."
5863
5. Select "Machine Scripts" (or "User Scripts") and add the scripts to Menu items:
5964
* `pyPadClear.py` clears the console output
@@ -72,4 +77,6 @@ If you need to install PyPadPlusPlus in another version of Notepad++ you have to
7277
* `codeSnippetsLog.py <Alt> + <S>`
7378
7. When Notepad++ does not allow you to define a shortcut on `<Shift> + <Enter>`, use `<Shift> + <Alt> + <Enter>` as preliminary shortcut. Then go to "Settings / Shortcut mapper / Scintilla commands" and unset `<Shift> + <Enter>` for `SCI_NEWLINE`. Now open `shortcuts.xml` in the Notepad++ Folder. Check if there is a line `<ScintKey ScintID="2329" menuCmdID="0" Ctrl="no" Alt="no" Shift="no" Key="13" />`. If not try to find it in the `C:\Users\<user name>\AppData\Roaming\Notepad++\` or `C:\Users\<user name>\AppData\Local\Notepad++\` folder when Notepad++ was installed with the installer. Now search the line
7479
* `<PluginCommand moduleName="PythonScript.dll" internalID="8" Ctrl="no" Alt="yes" Shift="yes" Key="13" />`
75-
* The `internalID` can differ from yours. Then change the `Alt="yes"` into `Alt="no"`.
80+
* The `internalID` can differ from yours. Then change the `Alt="yes"` into `Alt="no"`.
81+
8. If you want to use the Python installation of your system, open the file
82+
`notepad++\plugins\PythonScript\scripts\` and set the variable `pythonPath` to the path that contains `pythonw.exe`.

demo/multiedit.gif

211 KB
Loading

pyPadStart.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545
#
4646
popupForSelectedExpression = False
4747

48-
# The latter two options are recommended to be set to false. The two features
49-
# are allways active for the defined keyboard shortcut to script pyPadCalltip.py.
48+
# The latter two options are recommended to be set to false to prevent unintentional
49+
# code execution. The two features are allways active for the defined keyboard shortcut
50+
# linked to script pyPadCalltip.py (e.g. <Alt> + <Space>).
5051

5152
# Start pyPadPlusPlus
5253
import Npp, pyPad

0 commit comments

Comments
 (0)