-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnpp-newlisp-info.txt
112 lines (75 loc) · 3.31 KB
/
npp-newlisp-info.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
Add newlisp syntax highlighting
===============================
Copy all the text of the file: newlisp-udl.xml
and paste it inside the section: <NotepadPlus> ... </NotepadPlus>
of the file: userDefineLang.xml (located at: c:\Users\<username>\AppData\Roaming\Notepad++\)
Example
<NotepadPlus>
<UserLang name="newLISP" ext="lsp" udlVersion="2.1">
...
</UserLang>
</NotepadPlus>
The newlisp keywords from primes.h (newlisp source).
The actual highlight colors are for "obsidiane" theme of notepad++.
You can change (easily) the colors as you like.
Open newlisp help from notepad++
================================
Add the line: <Command name="newLISP Help" Ctrl="yes" Alt="yes" Shift="no" Key="112">chrome file:///C:/Program%20Files%20(x86)/newlisp/newlisp_manual.html#$(CURRENT_WORD)</Command>
inside the section: <UserDefinedCommands> ... </UserDefinedCommands>
of the file: shortcut.xml (located at: c:\Users\<username>\AppData\Roaming\Notepad++\)
Example
<UserDefinedCommands>
<Command name="newLISP Help" Ctrl="yes" Alt="yes" Shift="no" Key="112">chrome file:///C:/Program%20Files%20(x86)/newlisp/newlisp_manual.html#$(CURRENT_WORD)</Command>
</UserDefinedCommands>
Note: change the path to point to your newlisp help file
Now you can select a word and press Ctrl+Alt+F1 to open newlisp help file.
The shortcut is Ctrl+Alt+F1, but you can change it.
Execute newlisp code from notepad++
===================================
Download and install autohotkey (www.autohotkey.com).
Run the script npp-newlisp.ahk (double click it).
Run notepad++
Press Win+F12 to start newlisp REPL
Now, from notepad++, you can:
1) Execute the expression of current line pressing: Left-Shift + Enter
2) Execute a selected block of expression pressing: Right-Shift + Enter
After the execution of the expressions, notepad++ is the active application.
Note:
When selecting a block of expression be sure to begin and end the selection
with a blank line (or use [cmd] [/cmd]).
Evaluate newlisp expression within notepad
==========================================
Select an expression and press Ctrl+F8.
This run the command: newlisp -e "expression"
and return the result on notepad++ console.
How to do:
Install NppExec plugin
Menu: Plugin -> NppExec -> Console Output... (set both console to UTF8)
Menu: Plugin -> NppExec -> Execute...
insert text: newlisp -e "$(CURRENT_WORD)"
Press "Save" button and name it "eval newLISP".
Close and restart notepad++
Menu: Plugin -> NppExec -> Advanced Options...
Press "Associated Script" and select "eval newLISP"
Set "Item Name" to "eval newLISP".
Press "Add/Modify" button.
Activate the checkbox "Place to the Macros submenu".
Close and restart notepad++
Menu: Settings -> Shortcut Mapper...
Press "Plugin" button and search the processing item.
Select the command "eval newLISP".
Press Modify and Assign a shortcut.
Now you can eval selected expression from Macro menu or with the shortcut.
A shortcut to insert [cmd] [/cmd]
Ctrl + Alt + =
=================================
You can easily register a macro to insert:
[cmd]
[/cmd]
and put the cursor between them.
Then you can assigna shortcut to your macro.
NOTE:
=====
The script npp-newlisp.ahk exchange the brackets () and [] in the keyboard.
You can edit the file to disable this (you must comment two lines).
The script also enable other shortcuts... see the source.