How can I enable auto complete support in Notepad++? - autocomplete

I am trying to add simple syntax highlighting and auto completion for a simple scripting language...
I added syntax highlighting using this article
Now I want to know how to enable auto completion with Notepad ++ for my custom language. Does anyone know how to do that?

The link provided by Mark no longer works, but you can go to:
Notpad++ 6.6.9
Settings -> Preferences -> Auto-Completion -> Enable auto-completion on each input.
I find it very annoying though, since a big autocomplete block is always coming up and I would just like to see autocomplete when I press tab or a key combination. I am fairly new to Notepad++ though. If you know of such a key combination, please feel free to reply. I found this question via Google, so we can always help others.

For basic autocompletion, have a look at the files in %ProgramFiles%\Notepad++\plugins\APIs. It's basically just an XML file with keywords in. If you want calltips ("function parameters hint"), check out these instructions.
I've never found any more documentation, but cpp.xml has a calltip for fopen, while php.xml is quite complete.

Go to
Settings -> Preferences -> Backup/Autocompletion
Check Enable auto-completion on each input. By default the radio button for Function completion gets checked, that will complete related function name as you type. But when you are editing something other than code, you can check for Word completion.
Check Function parameters hint on input, if you find it difficult to remember function parameters and their ordering.

Autocomplete in Notepad++ is as simple as hitting Ctrl + Enter or Ctrl + Space in the interface.
Ctrl + Enter - as simple as that!
This, for many people, will be better than autocompleting on everything.

Don't forget to add your libraries & check your versions. Good information is in Using Notepad Plus Plus as a script editor.

You can also add your own suggestion.
Open this path:
C:\Program Files\Notepad++\plugins\APIs
And open the XML file of the language, such as php.xml. Here suppose, you would like to add addcslashes, so just add this XML code.
<KeyWord name="addcslashes" func="yes">
<Overload retVal="void">
<Param name="void"/>
</Overload>
</KeyWord>

It is very easy:
Find the XML file with unity keywords
Copy only lines with "< KeyWord name="......" / > "
Go to C:\Program Files\Notepad++\plugins\APIs and find cs.xml for example
Paste what you copied in 1., but be careful: Don't delete any line of it cs.xml
Save the file and enjoy autocompleting :)

Open Notepad++ and Settings -> Preferences -> Auto-Completion -> Check the Auto-insert options you want.
this link will help alot: http://docs.notepad-plus-plus.org/index.php/Auto_Completion

Related

Eclipse autocomplete parentheses in control structures

I have a quick question that might save me a few seconds of annoyance every day. I know that eclipse can do a lot of autocomplete magic, so this might be possible:
As a programmer who learned with python, I constantly forget to surround contitions in control structures (like if or while) with parentheses. How do I make eclipse autocomplete opening and closing parentheses when I finish typing while or if?
I am aware that I can autocomplete whole structures with ctrl-space, but how can I configure eclipse to do this by itself?
Any help is appreciated.
So in stock Eclipse, the usual way to bring up assisted content is to type Ctrl+Space. The problem with this is that it brings up both Help Proposals and Template Proposals, with the Help Proposals displayed first. You end up wasting time scrolling down to find what you actually want from the Template Proposals. And there's just that much more clutter to choose from.
The solution is this:
Go Window->Preferences->General->Keys. In the type filter text search for "Template". This should bring up a "C++ Content Assist (Template Proposal)" line. Click on it. Now map this to whatever shortcut you'd like (I did Shift+Space because that's an easy one to do while typing). Make sure to click on the "Binding" option to do this. Click "Ok" and you're done!
If you ever want to add or change what is brought up by that shortcut, and for which specific strings it works, just go Window->Preferences->C/C++->Editor->Templates and you can edit those to do exactly what you'd like when using that newly assigned shortcut.
Hope this helps.
EDIT: I am unable verify if this works for PyDev, as I'm running Eclipse Oxygen, which doesn't currently offer PyDev or the Eclipse Marketplace Client plugin. However, my guess is this would still work in PyDev. Best of luck!
Sources:
Setting auto complete shortcuts in Eclipse
How to change the Control+Space autocomplete shortcut keys in Eclipse for Android
Thanks for any help, but the only thing that seems to work are workarounds. My prefered "solution" is to change the Auto activation triggers for Java in Preferences>Java>Editor>Content Assist from . to .iwfs, so that the autocomplete dialog automatically pops up when I start typing if, while, for or switch. Then hitting enter will do exactly what I needed.

Netbeans automatic code completion of variables

I found an interesting Stackoverflow topic, but it is an old one and I'm afraid people won't be reacting anymore, so I hope it is ok to create a new one.
First of, I am using Netbeans 7.2 and I want to use automatic code completion more. It works nice on methods/classes with the '.' already, but I would like it for the variable names aswell.
So I found this topic: How can I make auto completion in netbeans include both variables as well as methods? , more precisly the accepted answer.
This is what I have always wanted! Except one issue, it decides to automatically insert the name if only one result is available, while I am still typing unaware of that fact.
I have tried disabling Insert Single Proposals Automatically (Tools -> Options -> Editor -> Code Completion), and it does kind of work. But once I type the next letter, it still decides to complete it automatically.
Does anyone know a fix for this or another way to achieve the same?
Regards.
Ah, I found it now: If you want it as I described in the opening post, then set this for Completion Selectors in Java:
[.,;:([+-=] (Note the extra white space on the end, it is important.
Now it will not autocomplete on any character anymore, but still give you the suggestions box.
Go to (Tools -> Options -> Editor -> Code Completion)
Select Language Java
add tick to Auto Popup on Typing Any Java Identifier Part
and you can tick Subword Completion

Eclipse auto suggesting and filling in variable names

Okay, so my issue is when I am creating a variable, lets say for example "Object o" while I am typing "o" it'll suggest something like "object". Which is okay but when I press space it auto fills in the new name. Basically I don't want to turn off auto completion I just want to disable space auto filling the suggestion in. Even to disable variable naming suggestions would work.
I'm using Eclipse Juno Service Release 1.
I know it's an old question but since non of the answers here worked for me, and this problem was really annoying me too, I am adding solution that helped me.
In your Eclipse go to:
Window/Preferences/Java/Editor/Content Assist
and enable:
Disable insertion triggers except 'Enter'
screen/shotted
Hopefully that will work for everyone!)
As there isn't any definitive solution for this yet, what I find works best is to disable the alphabetic characters from triggers:
Windows > Prefereces > Java > Editor > Content Assist > Auto activation triggers for Java
This will mean no class name / type completion, but method name completion will still be suggested when you pressed dot, however at least Eclipse stop messing with my variable name
Go to Window/Preferences/Java/Editor/Content Assist and choose settings that works for you.
I realize this is a 3 year old post, but...
From what I can gather, there isn't an option to disable this, it was hard coded into the content assist feature. But there is a plugin that you can download from the answer to this stack overflow question that will disable this feature
Window -> Preferences -> Java -> Editor -> Content Assist -> Advanced
I turned off Java Type Proposals and made sure Java Proposals is turned on. By the way this is in Spring Tool Suite I haven't checked using eclipse.

How can I make "Windows Metafile" my default paste special option in Word 2007?

I am doing a lot of copying from Visio to Word 2007. I have found that Windows Metafile is the most space efficient choice of the Paste Special options available. How can I make "Windows Metafile" my default paste special option in Word?
I was also looking for this but MicroSoft knows that nobody needs this and so it seems not to be possible. If you dare to disagree with the wisdom of Microsoft, you have the option of a workaround - like I did ...
Create a macro (obviously you find the macros in the View and not the Developer ribbon ...):
Sub PasteSpecialMetafile()
Selection.PasteSpecial Link:=False, DataType:=wdPasteEnhancedMetafile, _
Placement:=wdInLine, DisplayAsIcon:=False
End Sub
And then assign a special shortcut (simply and intuitively via File -> Options -> Customize Ribbon -> Keyboard Shortcuts: Customize) to the macros.
There might be a command which directly opens the PasteSpecial dialog ... but this is well hidden.
The macro works only, if the clipboard content can be converted to a metafile (and you get an error when the clipboard contains text). So there is room for improvement :)
Just FYI, default shortcut for the PasteSpecial is Ctrl+Alt+V. Full list of MS Word shortcuts is available in the Word Help, here is the direct link for convenience.
Thank you for your answers. They were very useful.
It worked in Word 2003 as well :).
I found another way. After you do all the clicks to do the paste special\picture(metafile) and paste your first picture, copy the next one (from excel or any other place) then go to Word and press Ctrl+Y to repeat the previous command.
Don't do anything else after you do the paste special in Word, the final action needs to be the paste special\picture.

how modify the already installed content-assist?

First of, how can I see what plugin manages the CTRL + SPACE content-assist? And how can I modify it in other to add my own stuff. Any help/idea is gladly welcome.
Thanks.
I think you're looking for "Templates". Assuming you're using Java, this is in the Windows -> Preferences menu, then Java->Editor->Templates. For example, the screenshot below shows the CTRL-SPACE content assist when you type "sysout".
If i would have this task, I would go to preferences. Look for content assist settings. Write down some specific text you see in dialog box. Then go to plugins folder, and start to search inside archives. When match is present, open the plugin.xml of that plugin, and you will see the extension points of the plugin. Based on its name, I am pretty sure you will find the appropiate one. Then you can either google it, or look for plugins extending the extension point. Using JDGui or fetching source code of the extension example plugin will help you in disassembling. Eclipse usually not well documented as for extension points, so i do it this way.