# Argument names for autocompletion in Kile

Let say I created the following command in my latex document

\newcommand{\red}[1]{
\textcolor{red}{#1}
}

When working with the LaTeX editor Kile, the autocompletion gives me something like

\red{x} %[Proposed by Kile (autocompletion)]

But instead of 'x', I would like Kile propose to me something like

\red{text} %[Proposed by Kile (autocompletion)]

That could be useful when I have to deal with commands requiring a bunch of arguments. For instance, if I created a command using \newcommand requiring 8 arguments, the autocompletion of kile will propose to me something like :

\mycommand{x}{x}{x}{x}{x}{x}{x}{x} %[Proposed by Kile (autocompletion)]

...but after some times, you do not know who is who! So it would be nice to define 'argument names' so that the autocompletion propose to me something like :

To summarize, I would like to change this :

to this :

-
Welcome to TeX.sx! –  Andrew Swann Nov 2 '12 at 10:52
I'm afraid I don't understand what this has to do with auto-completion. As defined by you, the command \red takes a single argument -- be it a single letter ("x") or a longer string ("text") -- while the command \mycommand would appear to take eight separate arguments. TeX's syntax rules determine what constitutes a separate argument. –  Mico Nov 2 '12 at 11:07
Thank you Mico for your comments.I may have not well explained what I'm really looking for. I enhance my question accordingly. Let me know if it makes more sense. –  Palimpseste Nov 2 '12 at 11:40
I think that your question is not clear and I can't figure out what the problem is –  karathan Nov 2 '12 at 11:42
I put the word "kile" in the title as I think it's necessary to make that clear right from the start. –  Loop Space Nov 2 '12 at 12:02

This can be achieved by creating a custom auto completion file. Such a file has the extension cwl and (on my systom) has to be saved under ~/.kde4/share/apps/kile/completion/tex. The # is a comment char in such a file. In such a file you write the commands with the text you want to appear in the arguments.

# custom auto-completion file
#