How do I enable syntax-based completion without plugins using completefunc?
:set completefunc=syntaxcomplete#Complete
If omnifunc is unavailable for a filetype, Vim can still offer meaningful completion by using syntax groups.
:set completefunc=syntaxcomplete#Complete
If omnifunc is unavailable for a filetype, Vim can still offer meaningful completion by using syntax groups.
vim.filetype.add()
vim.
:doautocmd FileType
When you change a buffer's filetype mid-session — say with :set filetype=python — Vim updates the filetype option but does not automatically re-run the File
# vim: set tabstop=2 shiftwidth=2 expandtab :
A modeline is a specially formatted comment that Vim reads when it opens a file and applies as local settings — no plugin or project-level vimrc required.
filetype plugin indent on
This command enables filetype detection, loading of filetype plugins, and filetype-specific indentation.
autocmd FileType python setlocal tabstop=4 expandtab
Use autocmd FileType to set buffer-local options for specific filetypes.
~/.vim/after/ftplugin/{filetype}.vim
Vim's after directory (~/.
<C-x><C-o>
The keystroke triggers omni completion, Vim's built-in language-aware completion system.
vim-polyglot
The vim-polyglot plugin is a curated collection of language packs for Vim that provides syntax highlighting, indentation, filetype detection, and compiler suppo
autocmd FileType {lang} setlocal {options}
Vim's autocmd FileType lets you apply settings that only take effect when editing a specific file type.