All Projects → jsit → vim-customcpt

jsit / vim-customcpt

Licence: other
Easily create custom completion menus using any json or tab-separated file

Programming Languages

Vim Script
2826 projects

Projects that are alternatives of or similar to vim-customcpt

Ansible Completion
Basic bash completion for Ansible
Stars: ✭ 128 (+509.52%)
Mutual labels:  completion
Codeigniter Phpstorm
PhpStorm Code Completion to CodeIgniter
Stars: ✭ 194 (+823.81%)
Mutual labels:  completion
cljs-tooling
[DEPRECATED] Tooling support for ClojureScript
Stars: ✭ 58 (+176.19%)
Mutual labels:  completion
Coc Sources
Additional common sources of coc.nvim
Stars: ✭ 135 (+542.86%)
Mutual labels:  completion
Evans
Evans: more expressive universal gRPC client
Stars: ✭ 2,710 (+12804.76%)
Mutual labels:  completion
Yarn Completion
Bash completion for Yarn
Stars: ✭ 210 (+900%)
Mutual labels:  completion
Auto Complete
Emacs auto-complete package
Stars: ✭ 1,622 (+7623.81%)
Mutual labels:  completion
vim-complimentary
Better completion for Vim builtins
Stars: ✭ 21 (+0%)
Mutual labels:  completion
3d Pointcloud
Papers and Datasets about Point Cloud.
Stars: ✭ 179 (+752.38%)
Mutual labels:  completion
gradle-dependencies-plugins-helper-plugin
This is an IntelliJ IDEA plugin for searching dependencies/plugins from JCentral/GradlePlugins inside Gradle projects.
Stars: ✭ 33 (+57.14%)
Mutual labels:  completion
Swiper
Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!
Stars: ✭ 1,948 (+9176.19%)
Mutual labels:  completion
Github Complete.vim
Vim input completion for GitHub
Stars: ✭ 161 (+666.67%)
Mutual labels:  completion
fish-elm-completions
Elm related completions for the friendly interactive shell
Stars: ✭ 21 (+0%)
Mutual labels:  completion
Bash Completion
Programmable completion functions for bash
Stars: ✭ 1,913 (+9009.52%)
Mutual labels:  completion
amx
An alternative M-x interface for Emacs.
Stars: ✭ 136 (+547.62%)
Mutual labels:  completion
Bash Argsparse
An high level argument parsing library for bash
Stars: ✭ 128 (+509.52%)
Mutual labels:  completion
Haoide
Stop upgrade, most of features were delivered in https://github.com/xjsender/haoide-vscode
Stars: ✭ 194 (+823.81%)
Mutual labels:  completion
classNameToCss
A VS Code extension that provides HTML class name completion for CSS
Stars: ✭ 21 (+0%)
Mutual labels:  completion
asyncomplete-nextword.vim
Provides intelligent English autocomplete for asyncomplete.vim via nextword
Stars: ✭ 43 (+104.76%)
Mutual labels:  completion
npm-completion
A @npm tab completion for @PowerShell.
Stars: ✭ 38 (+80.95%)
Mutual labels:  completion

vim-customcpt

Easily create custom completion menus using any dictionary/json file, in the format:

{ "word(" : { "kind" : "f", "menu" : "menu", "info" : "info" } }

Or a tab-separated values file, like this:

word kind menu info

So, for instance, a WordPress function (a full example wordpress.json file is included in this repo):

{
  "get_bloginfo(" : {
    "kind" : "f",
    "menu" : "string $show, string $filter | string",
    "info" : "Retrieves information about the current site.",
  }
}

Or, as tab-separated values:

get_bloginfo( f string $show, string $filter | string Retrieves information about the current site.

See :help complete-items for more info:

word		the text that will be inserted, mandatory
kind		single letter indicating the type of completion
menu		extra text for the popup menu, displayed after "word"
            or "abbr"
info		more information about the item, can be displayed in a
            preview window

Your custom completion file will show up as a "full" complete menu similar to the omnicomplete menu, like so:

Options

By itself, this plugin does nothing. Only by setting a couple dictionaries in your .vimrc will <C-X><C-U> use the completion function generated by your file.

g:customcpt_funcs (required): A Dictionary with a function name for a key and a List of files to use for completion with it

let g:customcpt_funcs = {
		\ "WPComplete" : [
			\ $HOME . "/.vim/wordpress.json",
		\ ]
	\ }
endif

g:customcpt_types (optional): A Dictionary with a comma-separated list of filetypes as keys and the name of a completion function to use with them

let g:customcpt_types =  {
        \ "php,php.html" : "WPComplete",
	\ }
endif

Alternatively, you could just do something like this in your .vimrc:

au FileType php,php.html setlocal completefunc=WPComplete

Thanks

This plugin is heavily based on @aaronspring’s cdo_lazy_vim plugin. Thanks Aaron! 👋

Thanks also to Steve Losh’s Learn Vimscript the Hard Way and the Stack Exchange community.


Related: CompleteHelper

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].