Vim Tips Wiki
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
Vim Tips Wiki
1,649
pages
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
Editing
Omni completion
Back to page
Edit
Edit source
View history
Talk (0)
Edit Page
Omni completion
We recommend that you
log in
before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your
Watchlist
.
Creating an account
is quick and free.
The edit appears to have already been undone.
Anti-spam check. Do
not
fill this in!
{{TipNew |id=1591 |previous=1590 |next=1592 |created=February 16, 2008 |complexity=basic |author=Metacosm |version=7.0 |subpage=/200802 |category1=Omnicomplete |category2= }} Omni completion provides smart autocompletion for programs. When invoked, the text before the cursor is inspected to guess what might follow. A popup menu offers word completion choices that may include struct and class members, system functions, and more. A similar feature in Microsoft Visual Studio is known as IntelliSense. ==Overview== Omni completion is not usually enabled by default. To turn on omni completion, add the following to your [[vimrc]]: <pre> filetype plugin on set omnifunc=syntaxcomplete#Complete </pre> Various programming languages are supported in Vim 7. For many languages such as SQL, HTML, CSS, JavaScript and PHP, omni completion will work out of the box. Other languages such as C and PHP will also take advantage of a tags file - if one exists. Omni completion using a tags file will complete the names of defined constants, functions, classes and other names from included and other external files. Omni completion scripts can be written to support other languages, and to customize behavior. {{help|new-omni-completion}} {{help|compl-omni}} When generating a tags file, [http://ctags.sourceforge.net/ Exuberant Ctags] should be used. Windows users need to install a recent version of [http://ctags.sourceforge.net/ Exuberant Ctags] (Ctags 5.7, released September 2007, or newer, is recommended). {{help|ft-c-omni}} ==Using omni completion== To use omni completion, type <code><C-X><C-O></code> while open in Insert mode. If matching names are found, a pop-up menu opens which can be navigated using the <code><C-N></code> and <code><C-P></code> keys. ==Related tips== {{todo}} *This is to be an overview of omnicompletion, with links to more detailed tips as required. *Need to make sense of related tips, and probably merge a few. *Meanwhile, keep the following list as a useful reference for readers and editors. '''Popup menu and mappings''' *[[VimTip102|102 Smart mapping for tab completion]] *[[VimTip1228|1228 Improve completion popup menu]] *[[VimTip1257|1257 Ctrl-p - autocomplete]] *[[VimTip1386|1386 Make Vim completion popup menu work just like in an IDE]] *[[VimTip1486|1486 Omni completion popup menu]] '''Random thoughts on IDE''' *[[VimTip1439|1439 Using vim as an IDE all in one]] '''Usage with C++''' * See [[VimTip1608|C++ code completion]] for omni completion in C++ programs. '''Usage with Python''' *[[VimTip1311|1311 Compile a separate copy of Vim for Python coding]] *[[VimTip1548|1548 Continue omnicompletion for python modules]] '''[http://insenvim.sourceforge.net/ Insenvim]''' *[[VimTip835|835 Have Intellisense search current directory]] ==Comments==
Summary:
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Help
(
view source
)
Template:Navigation
(
view source
)
Template:TipNew
(
view source
)
Template:Todo
(
view source
)
Follow on IG
TikTok
Join Fan Lab