Notepad++ and autocompletion - autocomplete

I'm using mainly Notepad++ for my C++ developing and recently i'm in need for some kind of basic autocompletion, nothing fuzzy, just want to type some letters and get my function declaration instead of having a manual opened all of the time..
The integrated autocompletion feature of my Notepad++ version (6.9.2) gives the declaration of basic C functionality like say fopen and parses my current file user defined functions, but without declaration.
I guess it's normal for a text editor to not give easily such information since it has nothing to parse i.e. other files where your declarations are (as it's not an IDE), but i don't want either to mess again with MSVC just for the sake of autocomplete.
Is there an easy, not so-hackish way to add some basic C++ and/or user defined autocomplete?
UPDATE
Adding declarations the "hard way" in some file cpp.xml is a no-no for me as i have a pretty big base of ever changing declarations. Is there a way to just input say some list of h/cpp files and get declarations? or this falls into custom plugin area ?

Edit the cpp.xml file and add all the keywords and function descriptions you'd like. Just make sure you add them in alphabetical order or they will not show up.
Another option is to select Function and word completion in the Auto-Completion area of the Settings-->Preferences dialog. NPP will suggest every "word" in the current file that starts with the first N letters you type (you choose a value for N in the Auto-Completion controls).

Related

Visual Studio Code C++ color formatting in type declarations

As you can see, in C++ type declarations (string and new type), the colors of the types are in normal text color, which I find oddly peculiar, since it isn't the case for java source codes (even using the exact same theme).
I've tried customizing it in user settings:
But all that does is change the color of the type in the type definitions, not in the declarations.
I've also tried out various themes, but it's all the same.
Strangely, this doesn't happen for java source codes as shown in the image below:
I might be missing something. Maybe there's some field or attribute in the user settings that I should change instead of the 'type'.
Does anyone know how?
According to the Developer: Inpsect TM scopes command, the entire string x declaration has the same scopes:
source.cpp - the "base" scope for cpp files that everything in them has
meta.block.c - just tells you that it's inside of a block / {}
Consequently, there's not really anything to target with editor.tokenColorCustomizations, since that's based on scopes.
You could search for an extension that replaces the built-in CPP grammar with one that is better in this regard. Note that the only one I've found so far, Reloaded C/C++, doesn't help. Alternatively, you could search for a better grammar elsewhere - TmLanguage grammars are very commonplace and used in many editors, not just VSCode. Even GitHub uses them for their syntax highlighting.

Only autocomplete on an exact match in Sublime Text 2

I'm making a custom .tmLanguage file to highlight the syntax I'm using correctly and generally make coding with it easier. I'm almost done, and I got the autocompletion working using a .sublime-completions file.
There's just one minor flaw I'd like to change. I have a pretty long list of functions, and almost all of them contain an abbreviation of the word 'parameter', PAR. When I start typing that word, the following are all in the list of completions:
PAR command
DEFPAR command
JDATA command (because the description contains PAR)
SPAA command (because there's a P in the command and an A and an R in the description)
What I want is only for the commands that begin with PAR to show up, so from the list above, only the first item.
So, like this:
In other words, I want the completions to show up based on the literal string I'm typing, and only from the trigger part of my completions file, before the \t only.
That completions file looks like this:
Highlighted in orange is what I want my completions list to be based on.
I hope this is understandable. Any help is greatly appreciated.
This is not possible. By design Sublime's autocomplete feature uses fuzzy matching, so if there are a number of options that all contain the same pattern, but you don't quite remember which one you want, you can type the pattern and have all of the options available. The more you type, the smaller the list of possible options becomes. This is a good thing®, otherwise you'd have to remember the exact command you're looking for, which kind of defeats the purpose of autocomplete and code hinting.

AutoCompletion for my DSL keywords in Geany

Geany(IDE) supports Autocompletion or IntelliSense as you program, but this is done based on the words you've used in the code so far.
Is there any way so I could have Autocompletion for my language keywords?
You can achieve this by writing your own tag file. It should be name like <somename>.<filetype>.tags and can be stored e.g. inside .geany-folder or inside global folders. You can import it via Tools-menu.
The tag file contains of a list of your methods, functions etc of your language as well as optimally some options for these commands used a tooltip. You can find some details inside manual
Of course, you could also check the wiki whether there might be already some tag file available for your language.

Shortcut for clike languages comments not working/implemented?

I'm using the Brackets code editor to code in C++ and I'm having a hard time having the shortcut for lineComment and blockComment working...
The shortcuts are [Ctrl+/] and [Ctrl+Shift+/], they work perfectly for CSS, JS.. etc but not with C++ files.
I looked into the clike.js file in the CodeMirror folder of Brackets, the blockCommentStart, blockCommentEnd and lineComment are correctly defined.
Is it a known issue? has anyone found a workaround?
Before that,I was coding with Notepad++ and this feature was the one I used the most. It's really hard not to have it anymore
You said you saw that blockCommentStart, blockCommentEnd and lineComment are correctly defined in clike.js. From CodeMirror documentation
This file defines, in the simplest case, a lexer (tokenizer) for your
language—a function that takes a character stream as input, advances
it past a token, and returns a style for that token. More advanced
modes can also handle indentation for the language.
It is used to highlight the c++ file. But also it could be used to auto comment line with shortcut. However it is probably not implemented for C++. For this feature comment addon from CodeMirror might be used http://codemirror.net/addon/comment/comment.js since The addon also defines a toggleComment command, which will try to uncomment the current selection, and if that fails, line-comments it.
This was a Brackets bug, but it was fixed in the Sprint 39 release.
(Fwiw though, language metadata in Brackets is defined in a file called languages.json - although Brackets extensions can add to / modify this metadata as well).

How does Geany auto-completion wơrk?

This question might seem a bit odd but I searched for like an hour and didn't find any hit that actually answered my question(s) about the auto-complete features of geany:
does it have auto-complete
for which languages does it have auto-complete (plugins?)
how do i use auto-complete
How about simply put: Ctrl+Space
I know 4 years passed ... but the correct answer is :
Edit->Preferences->Editor->Completions->[Check the "Autocomplete all words in document"]
press (CTRL+SPACE)
Geany does have autocomplete.
The main way autocomplete is used is by typing a long word, and by narrowing that list of autocomplete possibilities down. Let's say you type gtk_combo_box_. It will have a small list of different commands that match this description. Typing eTAB will narrow the search down to gtk_combo_box_entry_. Typing sENTER will then bring it to the proper to gtk_combo_entry_set_text_column. See the Geany manual.
Geany uses own internal engine and currently limited to:
C
Pascal
PHP
HTML
LaTeX
Python
It file format uses 3 types of encoding:
Tagmanager format
Pipe-separated format
CTags format
With CTAGS you can use external and powerful ctags utility that support a lot of langs.
Refer to official docs: http://www.geany.org/manual/current/#tags
Geany surely have autocomplete and can offer a list of possible completions for symbols defined in the tags and for all words in a document.
The autocompletion list for symbols is presented when the first few characters of the symbol are typed or when the Complete word (Ctrl-Space) keybinding is pressed.
When the defined keybinding is typed and the Autocomplete all words in document preference is selected then the autocompletion list will show all matching words previously mentioned in the document, if there are no matching symbols.
Autocompletion also can be based on specific words like keywords and etc. For this you can check this link
As the manual states:
Upon opening, files of supported filetypes are parsed to extract the
symbol information (aka "workspace symbols"). You can also have Geany
automatically load external files containing the symbol information
(aka "global tags files") upon startup, or manually using Tools -->
Load Tags File.
Global tags files are used to provide symbols for autocompletion and
calltips without having to open the source files containing these
symbols. This is intended for library APIs, as the tags file only has
to be updated when you upgrade the library.
Some global tags files are distributed with Geany and will be loaded
automatically when the corresponding filetype is first used. Currently
this includes global tags files for these languages: C, Pascal, PHP,
HTML, LaTeX, Python
For other languages, like Java, you have to download a tag file from here (if available), and load it upon startup or manually.