Context sensitive syntax help while editing
-
New to npp but have been using various ide for some time. I like many things in npp, but one thing I really miss is context sensitive syntax help - based upon the file type being edited (.ahk, .py, .php, .html, etc).
Ideally, I’d like to hit F1 (or similar) and grab the word under the cursor to send to an appropriate help file for that language. None of my searches have found a way of handling anything like this. I’ve seen that I can run a Python script from npp, but no way that I can see to pass the selected word along with the file extension to the script. Has anyone come up with a solution for this kind of thing?
-
Forgot to add that I have tried the Language Help plugin with some success, but although it asks for the extension of the file in the setup, I still have to select the specific for the language I want help on.
-
no way that I can see to pass the selected word
editor.getCurrentWord()
if the cursor is on a single word.editor.getSelText()
if you want to do the whole selectionalong with the file extension
notepad.getCurrentFilename()
and then use standard python to extract just the extension.Alternately, instead of going based off of extension, you can go off of what language Notepad++ associates with the current file:
notepad.getCurrentLang()
(which returns a value from the LANGTYPE enum)You can look up any of these in the PythonScript help files.
-
Terry,
When you are using PythonScript, it has its own context-sensitive help. If your caret is on
editor.xxx()
ornotepad.xxx()
and you invoke it, you will get help on whatever functionxxx
is.Since you are considering some scripting (I think) for your own context-sensitive help application, you might want to consider keeping that functionality even if you integrate something else for non-PythonScript Python.