Code Completion
Although already offers a good completion mode, Kile extends code completion to support some special methods especially for LATEX. Five different modes are integrated. Three of them work on demand, the other two are autocompletion modes. All modes can be configured to work very differently at Settings Configure Kile....

Automatic Environment Completion
When you begin a new environment, typing \begin{environment}, Kile will automatically add an \end{environment} command, with a line in between for your text.
Autocompletion can be turned off in the LATEX section of Settings Configure Kile... LaTeX Environments.
Completing an Equation Environment
Completing an Equation Environment
Completing an Equation Environment

LATEX Commands
When you type some letters, you can activate this completion mode for LATEX commands and normal words with Edit Complete (La)TeX Command or the keyboard shortcut Space. Kile first reads the letters from the current cursor position to the left and stops at the first non-letter character or a backslash. If this pattern begins with a backslash, Kile will enter completion mode for TEX or LATEX commands. Otherwise it enters normal dictionary mode, where you will not find any LATEX commands. Depending on the chosen mode, a completion box will be opened. You will see all commands or words whose beginning matches the current pattern. You can navigate with the cursor keys through this list and select one entry with or a double click with the mouse.
Completing a LaTeX Command
Completing a LaTeX Command
When you push the key, the last letter of your pattern will be deleted, and the completion list may grow. On the other hand, if you type another letter it will expand the pattern and the visible word list may shrink.
If you decide not to select any of the suggestions, you can leave this dialog with .
You will see that all commands are written with a short description of their parameters. These descriptions are of course stripped when you select a command. Optionally you can let Kile insert bullets at these places, so that you can easily jump to these positions with Edit Bullets Next Bullet and insert the parameter you want.
Completing a LaTeX Command
Completing a LaTeX Command
Go to Settings Configure Kile... Kile Complete to configure one or more of these lists. You can choose different word lists for TEX and LATEX commands and dictionary mode for normal words.
If you choose the option Show Latex commands, the entries of all chosen compressed word list (cwl) files for LATEX command completion are shown in a separate view of Kile's sidebar. You will see which commands are available and what parameters and options must or can be given for a completion. You can also simply select one entry with a mouse click and it will be inserted into the document, with all named parameters and options stripped.
LaTeX commands in the sidebar
LaTeX commands in the sidebar
As each chosen word list will be shown in a separate view of its own, there could be too many views, so that Kile's main window may be larger than a small screen allows. As this looks very ugly, Kile works with a maximum number of allowed views, which by default is set to 10. If this value is too big for your screen, you should reduce it.

Environments
The command mode is not useful for code completion of environments. You always have to type some letters of \begin, and invoking the completion mode will result in a huge list of environment tags. On the other hand, environments are so often used that Kile offers a special mode for code completion of environments. Forget the opening tag and write, for example, al.
When you call the completion mode with Edit Complete Environment or keyboard shortcut Space, the opening tag is automatically added and you will see \begin{al}. After this change, the completion list is much less cluttered.
Completing a LaTeX Command
Completing a LaTeX Command
Now select an environment, and you will see that it is also automatically closed. Even more, if Kile recognizes it as a list environment, it will also insert a first \item tag.
Completing a LaTeX Command
Completing a LaTeX Command
Go to Settings Configure Kile... Kile Complete to configure one or more of these lists. This mode uses the same word lists as the completion mode for TEX and LATEX commands.

Abbreviations
Kile supports user defined lists of abbreviations, which are replaced on demand by longer text strings. Look at Settings Configure Kile... Kile Complete to configure one or more of these lists. For the example given here, the abbreviation list in example.cwl must be chosen. In this file you will find, for example, the entry L=\LaTeX.
For example, type only the letter L. Now invoke the abbreviation mode of word completion with Edit Complete Abbreviation or keyboard shortcut Space, and the letter L is replaced by the string \LaTeX.
Abbreviation completion also supports newline %n and %C to place the cursor, if these characters are present in the expansion text. So if you have the entry

en1=\begin{enumerate}%n\item %C%n\end{enumerate}%n

in the completion file, and invoke the abbreviation completion, the expansion looks as below, where x shows the final cursor position.

\begin{enumerate}
	\item x
\end{enumerate}

Abbreviations
If you choose Show abbreviations, all possible abbreviations are shown in a view of the sidebar. So you will have a good survey of all possible abbreviations.

Autocompletion Modes

LATEX Commands
You can also enable an autocompletion mode for LATEX commands. When a given threshold of letters (default: 3) is entered, a popup window opens with a list of all matching LATEX commands. You can select one of these commands, or ignore this window and type further letters. The entries of the completion box will always change and match your currently typed word.
Go to Settings Configure Kile... Kile Complete to enable or disable this mode or to change the threshold.
Completing an Equation Environment
Completing an Equation Environment

Document Words
Large dictionaries are not useful in autocompletion mode. But, we have seen that a lot of words in a document are typed more than once. So Kile offers a completion for all words from the document that the user has already typed. You can manually invoke this completion, if you press Space. Note that this mode is different from the completion mode for LATEX commands.
If you want to turn this mode on or off, go to Settings Configure Kile... Editor Editing Auto Completion. In this dialog you can configure if completion mode for document words should be enabled. There is also an additional autocompletion mode, where a completion box pops up, when a certain threshold is reached.

Writing Own Completion Files
The latest specification of the completion file format can found in the CWL file format specification.
Completion files can be installed in a user's home folder under the ~/.kde/share/apps/kile/complete/<mode>/ subdirectory, where <mode> either stands for abbreviation, dictionary or tex.