Geany -- autocomplete in code html

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
arivas_2005
Posts: 212
Joined: Sun 25 Feb 2007, 14:39

Geany -- autocomplete in code html

#1 Post by arivas_2005 »

Cheers...
I ask about geany to encode html (autocomplete ..)
Where I find the file for html autocomplete in geany
I want to add tags
The suggested ones are not HTML. Example for 'di' comes out 'distributed' and 'detals' .... and they are not html tags.
I already looked at '... /geany/filetype.html' but those tags are not suggested.
suggestions..
thanks

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

Re: Geany -- autocomplete in code html

#2 Post by MochiMoppel »

Depends what you mean by "autocomplete".
In Preferences you can set "XML/HTML tag auto-closing", which will add a closing tag as soon as you have typed an opening tag. This works.

What you probably are looking for is "Snippet completion". You can access the snippets.conf file from the Geany menu: Tools -> Configuration Files -> snippets.conf
In my Geany there is not much defined for HTML. The [HTML] section in snippets.conf contains only

Code: Select all

table=<table>\n\t<tr>\n\t\t<td>%cursor%</td>\n\t</tr>\n</table>
This means when I edit a HTML file and type table and then press the Tab key, Geany will turn this into
<table>
<tr>
<td></td>
</tr>
</table>

For other tags you will have to add definitions by yourself. Read the explanations and examples. It's not difficult. Maybe other Geany versions come with more HTML tag definitions that you can copy.

arivas_2005
Posts: 212
Joined: Sun 25 Feb 2007, 14:39

#3 Post by arivas_2005 »

thanks for answering
I already discovered that from snippets.conf
My query is related to the options that appear while the tag is typed.
I set in Preferences> editor> Completion --Character to type autocompletion- to 1.
Well .. by typing 'b', a list of fon be, body, but, by.
They are 4 words but by, be and but they are not tags to my knowledge.
So, what I try is to locate the file that has that list of words that appear while the 'tag' is typed as suggestions, as a drop-down menu.
But it is not the snippets.conf. It must be another but I can't locate it. I have reviewed the flat files in '... / geany / *' but none have such words ...
Attachments
capture-geany.png
(5.35 KiB) Downloaded 127 times

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#4 Post by MochiMoppel »

arivas_2005 wrote:So, what I try is to locate the file that has that list of words that appear while the 'tag' is typed
There is no file. This list is compiled by Geany on-the-fly from all words already existing in your document. You will see no list when starting to type in an empty document. For this feature to work you must have activated "Autocomplete all words in document", did you?

The problem is not only that the tag you are trying to autocomplete must already exist. The bigger problem is that a tag is not a word. Words are delimited by word boundaries, and '<' and '>' are such boundaries. In your tag <body>, only body is recognized as a word, and this is what you will get in your list the next time you type a 'b'. While you can configure Geany to accept '<' and '>' as part of a word and not as boundaries, this will not help to reach your goal. It will make matters worse.

Use a dedicated HTML editor or use snippets.

Post Reply