sublime text2 and autocomplete for latex - autocomplete

I like using Sumlime Text2 for programming, and these days I also want to write documents in Latex in Sublime Text2. I followed the tutorial online to install latextools and I can edit and generate files successful.
However, I found the auto-complete does not work: e.g.
if I type in \begin{enumerate} and ENTER, in other application like texmaker, the \end{enumerate} will auto-completed;
or I type in \sec, there should be some suggestion like \section{}.
Does sublime text2 latextools has related functions? or other solutions?

I have the same need. latextools may not be fully developed yet. At least the autocompletion part is not completely done compared to the one I used. (I had been using AUCTeX in Emacs.)
For now, you may reduce your typing by using ctrl+l, e command for creating environments.
type the name of an environment, such as 'enumerate', and then type ctrl+l, e. That should complete the block.

Related

Notepad++ and autocompletion

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).

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.

how to invoke easy templates in org-mode of Emacs

I have tried to type a 'c' in org-mode(actually in a org file) of Emacs, expecting the easy templates as instructed in org-mode manual. But there is nothing coming out. Would anyone please tell me the correct way to invoke easy templates in org-mode. Thank you very much.
I was also having problems getting this to work. What I discovered is that you have to be at the beginning of a blank line and then you can type <cTAB (using the TAB key, not typing the word) and it works as documented.
I suspect that people who use easy templates have forgotten the caveat that you must be at the beginning of a line and just do it because they have gotten into the habit of doing it that way
From http://orgmode.org/manual/Easy-Templates.html:
"To insert a structural element, type a ‘<’, followed by a template selector and ."
That means you don't type c, you type >c then press TAB. This works for me in Org 8.2. You may well have an older version of org (v7), and I don't know whether this works in org 7.

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.