Difference between revisions of "Notepad++"

From wiki
Jump to navigation Jump to search
m
 
Line 2: Line 2:
 
:What you would expect (remove line breaks)
 
:What you would expect (remove line breaks)
  
;Search and replace with regular experssions
+
;Search and replace with regular expressions
 
:Searchbox: <code>^(.*?)A</code>; Find the first 'A'
 
:Searchbox: <code>^(.*?)A</code>; Find the first 'A'
 
:Replacebox: <code>\1B</code>; Replace the 'A' with 'B' leave all in front if it untouched.
 
:Replacebox: <code>\1B</code>; Replace the 'A' with 'B' leave all in front if it untouched.
Line 11: Line 11:
 
;Notepad++ in trouble because you opened a very big file
 
;Notepad++ in trouble because you opened a very big file
 
:Remove it from C:\Users\<username>\AppData\Roaming\Notepad++\session.xml (use another text-editor)
 
:Remove it from C:\Users\<username>\AppData\Roaming\Notepad++\session.xml (use another text-editor)
 +
 +
;Implement own scripts with NppExec
 +
NOTE: for below you must have installed pycodestyle <code> pip install pycodestyle</code>
 +
* Install NppExec plugin
 +
* F6 to open script editor and put in:
 +
NPP_SAVE
 +
cd "$(FULL_CURRENT_PATH)"
 +
env_set PYTHONIOENCODING=utf-8
 +
python -u -m pycodestyle "$(FULL_CURRENT_PATH)"
 +
* Save as PyCodeStyle (or anything you want)
 +
* Clicking OK will execute the script.

Latest revision as of 10:38, 25 January 2023

Edit-Line Operations-Join Lines
What you would expect (remove line breaks)
Search and replace with regular expressions
Searchbox: ^(.*?)A; Find the first 'A'
Replacebox: \1B; Replace the 'A' with 'B' leave all in front if it untouched.
Where to edit commands in the run-menu
C:\Users\<username>\AppData\Roaming\Notepad++\shortcuts.xml
Notepad++ in trouble because you opened a very big file
Remove it from C:\Users\<username>\AppData\Roaming\Notepad++\session.xml (use another text-editor)
Implement own scripts with NppExec

NOTE: for below you must have installed pycodestyle pip install pycodestyle

  • Install NppExec plugin
  • F6 to open script editor and put in:
NPP_SAVE
cd "$(FULL_CURRENT_PATH)"
env_set PYTHONIOENCODING=utf-8
python -u -m pycodestyle "$(FULL_CURRENT_PATH)"
  • Save as PyCodeStyle (or anything you want)
  • Clicking OK will execute the script.