11*easycomplete.txt* Vim-EasyComplete Plugin
22
3- Copyright (c) 2020-2024 @Jayli
3+ Copyright (c) 2020-2026 @Jayli
44 More Info: https://github.com/jayli/vim-easycomplete
55
66EasyComplete *easycomplete*
@@ -16,12 +16,12 @@ a bunch of Node modules unless you’re a js/ts programmer.
1616
1717Vim-Easycomplete is easy to install and use. It contains these features:
1818
19- - Buffer Keywords/Directory support
20- - LSP support
21- - Easy to install LSP Server with one command
22- - Written in pure vim script for vim8 and neovim
23- - Snippet support with ultisnips .
24- - Brand New UI Design.
19+ - Keywords/Directory support
20+ - Implemented based on pure vimscript
21+ - Snippet support.
22+ - Fast performance
23+ - AI coding assistant via [tabnine](#TabNine-Support) .
24+ - cmdline completion support
2525
2626==============================================================================
2727
@@ -34,17 +34,82 @@ Neovim >= 0.7.0 or Vim >= 8.2
3434Installation
3535
3636Easycomplete requires Vim 8.2 and higher version with MacOS/Linux/FreeBSD.
37- For neovim users, 0.4.4 is required (Of course, latest is recommended).
37+ For neovim users, 0.7.0 and upper version is required (Of course, latest is
38+ recommended).
39+
40+ Sample Useages
41+
42+ Lua config with Packer.nvim:>
43+
44+ -- lua
45+ use { 'jayli/vim-easycomplete', requires = {'L3MON4D3/LuaSnip'}}
46+ -- For snippet support, 'SirVer/ultisnips' is an alternative option
47+ -- Tabnine aicoding support, default is 1
48+ -- You should install tabnine first by ":InstallLspServer tabnine"
49+ vim.g.easycomplete_tabnine_enable = 1
50+ -- Tabnine coding suggestion, default is 0
51+ vim.g.easycomplete_tabnine_suggestion = 0
52+ -- Using nerdfont for lsp icons, default is 0
53+ vim.g.easycomplete_nerd_font = 1
54+ -- Add window border for pum, default is 1 (for nvim 0.11 or higher)
55+ vim.g.easycomplete_winborder = 1
56+ -- Pmenu format, default is {"abbr", "kind", "menu"}
57+ vim.g.easycomplete_pum_format = {"kind", "abbr", "menu"}
58+ -- Useful keymap
59+ vim.keymap.set('n', 'gr', ':EasyCompleteReference<CR>')
60+ vim.keymap.set('n', 'gd', ':EasyCompleteGotoDefinition<CR>')
61+ vim.keymap.set('n', 'rn', ':EasyCompleteRename<CR>')
62+ -- Plugin has already bind shift-k to `:EasyCompleteHover`
63+ -- vim.keymap.set('n', 'gh', ':EasyCompleteHover<CR>')
64+ vim.keymap.set('n', 'gb', ':BackToOriginalBuffer<CR>')
3865
39- Configuration
66+ -- cmdline completion
67+ vim.g.easycomplete_cmdline = 1
68+
69+ -- close pum keymap
70+ -- vim.keymap.set('i', '<C-M>', '<Plug>EasycompleteClosePum')
4071
41- It use Tab to trigger completion suggestions. You can change this setting by >
72+ -- Select next/previous pum items Keymap
73+ -- vim.g.easycomplete_tab_trigger = "<C-J>"
74+ -- vim.g.easycomplete_shift_tab_trigger = "<C-K>"
4275
43- let g:easycomplete_tab_trigger="<c-space>"
76+ -- Redefine CR action
77+ -- vim.g.easycomplete_use_default_cr = 0
78+ -- vim.keymap.set('i', '<C-L>', '<Plug>EasycompleteCR')
4479<
45- There are four build-in popup menu themes for default styles confliction: `dark`,
46- `light`,`rider` and `sharp`. (`let g:easycomplete_scheme="sharp"`). This config
47- can be ignored in most cases.
80+
81+ Run `:PackerInstall`
82+
83+ Lua style setup with `require("easycomplete").setup()`:>
84+
85+ -- lua style setup
86+ -- `tabnine_enable = 0` alias `vim.g.easycomplete_tabnine_enable = 0`
87+ require("easycomplete").setup({
88+ cmdline = 1,
89+ pum_noselect = 0,
90+ tabnine_enable = 0,
91+ nerd_font = 1,
92+ enable = 1,
93+ winborder = 1,
94+ ghost_text = 1,
95+ menu_abbr = 0,
96+ pum_format = {"abbr", "kind", "menu"}
97+ })
98+ <
99+
100+ Configuration
101+
102+ - `Tab`/`S-Tab`: select next/previous matched items.
103+ - `Ctrl-]`: definition jumping
104+ - `Ctrl-t`: jumping back (Same as tags jumping).
105+ - `Ctrl-N`/`Shift-Ctrl-N`: jump to the next/previous diagnostic position.
106+ - `Ctrl-E`: close complete menu.
107+
108+ Other optional configurations:
109+
110+ - `set updatetime=150` (lua: `vim.opt.updatetime = 150`) is highly recommended.
111+ - Menu noselected by default: `setlocal completeopt+=noselect`
112+ (lua: `vim.cmd('setlocal completeopt+=noselect')`)
48113
49114===============================================================================
50115
@@ -80,6 +145,7 @@ All commands:
80145| `:EasyCompleteGotoDefinition` | Goto definition position |
81146| `:EasyCompleteReference` | Find references |
82147| `:EasyCompleteRename` | Rename |
148+ | `:EasyCompleteHover` | Hover to get more information |
83149| `:EasyCompleteCheck` | Checking LSP server |
84150| `:EasyCompletePreviousDiagnostic` | Goto Previous diagnostic |
85151| `:EasyCompleteNextDiagnostic` | Goto Next diagnostic |
@@ -91,41 +157,97 @@ All commands:
91157| `:DenoCache` | Do Deno Cache for downloading modules |
92158| `:CleanLog` | close quickfix window |
93159
160+ Global configurations:
161+
162+ | Global Configure | Default | Description |
163+ |--------------------------------------|---------------|---------------------------------------------------------------|
164+ | `g:easycomplete_nerd_font` | 0 | Using nerdfont for lsp icons |
165+ | `g:easycomplete_menu_skin` | `{}` | Menu skin. |
166+ | `g:easycomplete_sign_text` | `{}` | Sign icons. |
167+ | `g:easycomplete_lsp_type_font` | ... | lsp icons configuration |
168+ | `g:easycomplete_tabnine_suggestion` | 0 | Tabnine inline suggestion(for nvim only) |
169+ | `g:easycomplete_lsp_checking` | 1 | Check whether the lsp is installed while opening a file |
170+ | `g:easycomplete_tabnine_enable` | 1 | Enable Tabnine |
171+ | `g:easycomplete_directory_enable` | 1 | Directory complete |
172+ | `g:easycomplete_tabnine_config` | `{}` | [TabNine Configuration](#ai-coding-via-tabnine-support) |
173+ | `g:easycomplete_filetypes` | `{}` | [Custom filetyps configuration](#language-support) |
174+ | `g:easycomplete_enable` | 1 | Enable this plugin |
175+ | `g:easycomplete_tab_trigger` | `<Tab>` | Use tab to trigger completion and select next item |
176+ | `g:easycomplete_shift_tab_trigger` | `<S-Tab>` | Use s-tab to select previous item |
177+ | `g:easycomplete_cursor_word_hl` | 0 | Highlight the symbol when holding the cursor |
178+ | `g:easycomplete_signature_offset` | 0 | Signature offset |
179+ | `g:easycomplete_diagnostics_next` | `<C-N>` | Goto next diagnostic position |
180+ | `g:easycomplete_diagnostics_prev` | `<S-C-n>` | Goto previous diagnostic position |
181+ | `g:easycomplete_diagnostics_enable` | 1 | Enable diagnostics |
182+ | `g:easycomplete_signature_enable` | 1 | Enable signature |
183+ | `g:easycomplete_diagnostics_hover` | 1 | Gives a diagnostic prompt when the cursor holds |
184+ | `g:easycomplete_winborder` | 1 | Add window border for pum (for nvim 0.11 or higher) |
185+ | `g:easycomplete_ghost_text` | 1 | Ghost text |
186+ | `g:easycomplete_pum_maxheight` | 20 | Pum window max height |
187+ | `g:easycomplete_pum_format` | `["abbr", "kind", "menu"]`| Pmenu format |
188+ | `g:easycomplete_menu_abbr` | 0 | Show abbr(shortname) at pum `menu` position, or show fullname |
189+ | `g:easycomplete_custom_snippet` | `""` | Custom snippets path |
190+ | `g:easycomplete_use_default_cr` | 1 | enable or disable default cr action |
191+ | `g:easycomplete_pum_pretty_style` | 1 | Adjust the pum style with border automatically |
192+ | `g:easycomplete_cmdline` | 1 | Commandline complete |
193+ | `g:easycomplete_pum_maxlength` | 35 | Max length of mathing word in pum list |
194+ | `g:easycomplete_pum_noselect` | `&cot =~ "noselect"` | Autoselect first matched item or not. Same as `set &completeopt+=noselect` |
195+
94196===============================================================================
95197
96- Configuration
198+ Language Support
97199
98- Example configuration with lua:>
200+ There are tow ways to install lsp server.
99201
100- -- Highlight the symbol when holding the cursor if you need it
101- vim.g.easycomplete_cursor_word_hl = 1
102- -- Using nerdfont is highly recommended
103- vim.g.easycomplete_nerd_font = 1
104-
105- -- GoTo code navigation
106- vim.keymap.set('n', 'gr', ':EasyCompleteReference<CR>')
107- vim.keymap.set('n', 'gd', ':EasyCompleteGotoDefinition<CR>')
108- vim.keymap.set('n', 'rn', ':EasyCompleteRename<CR>')
109- vim.keymap.set('n', 'gb', ':BackToOriginalBuffer<CR>')
202+ 1. vim/nvim: Via command`:InstallLspServer`.
203+ 2. nvim: Via [mason.nvim](https://github.com/mason-org/mason.nvim), Do>
110204
205+ :MasonInstall {lsp-server-name}
111206<
112207
113- Example configuration with vim script:>
208+ LSP Server will all be installed in local path: `~/.config/vim-easycomplete/servers`.
114209
115- " Highlight the symbol when holding the cursor
116- let g:easycomplete_cursor_word_hl = 1
117- " Using nerdfont is highly recommended
118- let g:easycomplete_nerd_font = 1
210+ `InstallLspServer` command: Both of the following useage are ok:
119211
120- " GoTo code navigation
121- noremap gr :EasyCompleteReference<CR>
122- noremap gd :EasyCompleteGotoDefinition<CR>
123- noremap rn :EasyCompleteRename<CR>
124- noremap gb :BackToOriginalBuffer<CR>
212+ - `:InstallLspServer`
213+ - `:InstallLspServer lua`
214+
215+ All supported languages:
216+
217+ | Plugin Name | Languages | Language Server | Installer | Requirements | URL |
218+ |-------------|-----------|:------------------------:|:------------------:|:------------:|:---:|
219+ | directory | directory | No Need | Integrated | None | |
220+ | buf | buf & dict| No Need | Integrated | None | |
221+ | snips | Snippets | ultisnips/LuaSnip | Integrated | python3/lua | |
222+ | ts | js/ts | tsserver | Yes | node/npm | |
223+ | deno | js/ts | denols | Yes | deno | |
224+ | tn | TabNine | TabNine | Yes | None | |
225+ | vim | Vim | vimls | Yes | node/npm | |
226+ | cpp | C/C++/OC | clangd | Yes | None | |
227+ | css | CSS | cssls | Yes | node/npm | |
228+ | html | HTML | html | Yes | node/npm | |
229+ | yml | YAML | yamlls | Yes | node/npm | |
230+ | xml | Xml | lemminx | Yes | java/jdk | |
231+ | sh | Bash | bashls | Yes | node/npm | |
232+ | json | JSON | json-languageserver | Yes | node/npm | |
233+ | php | php | intelephense | Yes | node/npm | |
234+ | dart | dart | dartls | Yes | None | |
235+ | py | Python | pylsp | Yes | python3/pip3 | |
236+ | java | Java | jdtls | Yes | java11/jdk | |
237+ | go | Go | gopls | Yes | go | |
238+ | r | R | r-languageserver | Yes | R | |
239+ | rb | Ruby | solargraph | Yes | ruby/bundle | |
240+ | lua | Lua | `sumneko_lua` | Yes | Lua | |
241+ | nim | Nim | nimls | Yes | nim/nimble | |
242+ | rust | Rust | `rust_analyzer` | Yes | None | |
243+ | kt | Kotlin | `kotlin_language_server` | Yes | java/jdk | |
244+ | grvy | Groovy | groovyls | Yes | java/jdk | |
245+ | cmake | cmake | cmake | Yes | python3/pip3 | |
246+ | c# | C# | omnisharp-lsp | Yes | None | |
247+ | zig | zig | zls | Yes | zig | |
248+ | docker | docker |dockerfile-language-server| Mason | node/npm |[easycomplete-docker](https://github.com/jayli/easycomplete-docker) |
125249
126- <
127250
128- `set updatetime=300` (in lua `vim.opt.updatetime = 300`) is highly recommended.
129251
130252===============================================================================
131253
@@ -177,13 +299,27 @@ All supported languages:
177299| php | php | intelephense | Yes |
178300| cs | C# | omnisharp-lsp | Yes |
179301
180- EasyComplete needs ultisnips for snippets support if you want.
181- This plugin is compatible with Vim-EasyComplete out of the box. Install with
182- vim-plug: >
302+ The snippet completion of Vim-EasyComplete relies on ultisnip or luasnip.
303+ They are both compatible with Vim-EasyComplete by simply place it in the dependent
304+ field. UltiSnips required python3 installed. You can use your own snippets path
305+ to replace the default snippets.
183306
184- Plug 'SirVer/ultisnips'
307+ vimscript>
308+
309+ " vim
310+ let g:easycomplete_custom_snippet = "./path/to/your/snippets"
185311<
186312
313+ luascript>
314+
315+ -- lua
316+ vim.g.easycomplete_custom_snippet = "./path/to/your/snippets"
317+ <
318+
319+ You can alse add your own snippet directory to `&runtimepath`.
320+
321+ [LuaSnip](https://github.com/L3MON4D3/LuaSnip) is better choice for nvim.
322+
187323Install TabNine language server: `InstallLspServer tabnine` or `InstallLspServer tn`
188324
189325Set `let g:easycomplete_tabnine_enable = 0` to disable TabNine. Config TabNine via
0 commit comments