Skip to content

Commit 9e95434

Browse files
committed
bugfix
1 parent c858ee0 commit 9e95434

File tree

1 file changed

+59
-58
lines changed

1 file changed

+59
-58
lines changed

README.md

Lines changed: 59 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,49 @@
11
# Vim-EasyComplete
22

3-
It's a Fast and Minimalism Style Completion Plugin for vim/nvim. There are many excellent vim auto-completion plugins such as [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) and [coc.nvim](https://github.com/neoclide/coc.nvim) etc. But I want a simpler plugin without any redundant configurations.
3+
It's a Fast and Minimalism Style Completion Plugin for vim/nvim.
44

55
![](https://img.shields.io/badge/VimScript-Only-orange.svg?style=flat-square) ![](https://img.shields.io/badge/MacOS-available-brightgreen.svg?style=flat-square) ![](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square) ![](https://img.shields.io/github/workflow/status/jayli/vim-easycomplete/easycomplete.CI?style=flat-square)
66

77
## What
88

9-
Vim-easycomplete is a fast and minimalism style completion plugin for vim/nvim. It aims to be available out of the box on linux and mac. It is implemented in pure VimScript and is extremely simple to configure without installing Node and a bunch of Node modules.
9+
Vim-easycomplete is a fast and minimalism style completion plugin for both vim and nvim. It aims to be available out of the box on linux and mac. It is implemented in pure VimScript and is extremely simple to configure without installing Node and a bunch of Node modules. Thank [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) and [coc.nvim](https://github.com/neoclide/coc.nvim). They inspired me a lot.
1010

1111
https://github.com/jayli/vim-easycomplete/assets/188244/5fdef6cb-ef1d-4428-960e-d9802cbc2a84
1212

1313
It contains these features:
1414

15-
- AI coding assistant via [tabnine](#TabNine-Support).
16-
- Buffer Keywords/Directory support
17-
- LSP([language-server-protocol](https://github.com/microsoft/language-server-protocol)) support. Easy to install LSP Server with one command
18-
- Written in pure vim script for vim8 and neovim
19-
- Snippet support
15+
- Full [lsp]([language-server-protocol](https://github.com/microsoft/language-server-protocol)) support. Easy to install LSP Server with one command
16+
- Keywords/Directory support
17+
- Implemented based on pure vimscript
18+
- Snippet support via [Snippets](https://github.com/neovim/nvim-lspconfig/wiki/Snippets).
2019
- Fast performance
20+
- AI coding assistant via [tabnine](#TabNine-Support).
2121

2222
## Installation
2323

24-
Easycomplete requires Vim 8.2 or higher version with MacOS/Linux/FreeBSD. For neovim users, 0.6.0 or higher is required.
24+
Requires Vim 8.2 or higher version on MacOS/Linux/FreeBSD. Neovim 0.6.0 or higher.
2525

2626
Lua config with Packer.nvim:
2727

2828
```lua
2929
use { 'jayli/vim-easycomplete', requires = {'SirVer/ultisnips'}}
30+
-- Tabnine aicoding support, default is 1
31+
-- You should install tabnine first by ":InstallLspServer tabnine"
32+
vim.g.easycomplete_tabnine_enable = 1
33+
-- Tabnine coding suggestion, default is 1
34+
vim.g.easycomplete_tabnine_suggestion = 1
35+
-- Using nerdfont for lsp icons, default is 0
36+
vim.g.easycomplete_nerd_font = 1
37+
-- Add window border for pum, default is 1 (for nvim 0.11 or higher)
38+
vim.g.easycomplete_winborder = 1
39+
-- Pmenu format, default is {"abbr", "kind", "menu"}
40+
vim.g.easycomplete_pum_format = {"kind", "abbr", "menu"}
41+
-- Useful keymap
42+
vim.keymap.set('n', 'gr', ':EasyCompleteReference<CR>')
43+
vim.keymap.set('n', 'gd', ':EasyCompleteGotoDefinition<CR>')
44+
vim.keymap.set('n', 'rn', ':EasyCompleteRename<CR>')
45+
vim.keymap.set('n', 'gb', ':BackToOriginalBuffer<CR>')
46+
3047
```
3148
Run `:PackerInstall`
3249

@@ -35,11 +52,36 @@ Vimscript config with vim-plug:
3552
```vim
3653
Plug 'jayli/vim-easycomplete'
3754
Plug 'SirVer/ultisnips'
55+
" Tabnine aicoding support, default is 1
56+
" You should install tabnine first by ":InstallLspServer tabnine"
57+
let g:easycomplete_tabnine_enable = 1
58+
" Tabnine coding suggestion, default is 1
59+
let g:easycomplete_tabnine_suggestion = 1
60+
" Using nerdfont for lsp icons, default is 0
61+
let g:easycomplete_nerd_font = 1
62+
" Add window border for pum, default is 1 (for nvim 0.11 or higher)
63+
let g:easycomplete_winborder = 1
64+
" Pmenu format, default is ["abbr", "kind", "menu"]
65+
let g:easycomplete_pum_format = ["kind", "abbr", "menu"]
66+
" Useful keymap
67+
noremap gr :EasyCompleteReference<CR>
68+
noremap gd :EasyCompleteGotoDefinition<CR>
69+
noremap rn :EasyCompleteRename<CR>
70+
noremap gb :BackToOriginalBuffer<CR>
3871
```
3972
Run `:PlugInstall`.
4073

4174
[Full configuration example](custom-config.md).
4275

76+
## Useage
77+
78+
Use `Tab` to trigger the completion suggestions and select matched items. Use `Ctrl-]` for definition jumping, `Ctrl-t` for jumping back (Same as tags jumping).
79+
80+
Other optional configurations:
81+
82+
- `set updatetime=150` (lua: `vim.opt.updatetime = 150`) is highly recommended.
83+
- Menu noselected by default: `setlocal completeopt+=noselect`, (lua: `vim.cmd('setlocal completeopt+=noselect')`)
84+
4385
## Commands
4486

4587
All commands:
@@ -64,41 +106,6 @@ All commands:
64106
| `:DenoCache` | Do Deno Cache for downloading modules |
65107
| `:CleanLog` | close quickfix window |
66108

67-
## Configuration
68-
69-
The plugin is out of box and config nothing. Use `Tab` to trigger the completion suggestions and select matched items. By default use `Ctrl-]` for definition jumping, `Ctrl-t` for jumping back (Same as tags jumping).
70-
71-
Simple Lua configuration:
72-
73-
```lua
74-
-- Using nerdfont is highly recommended
75-
vim.g.easycomplete_nerd_font = 1
76-
77-
-- GoTo code navigation
78-
vim.keymap.set('n', 'gr', ':EasyCompleteReference<CR>')
79-
vim.keymap.set('n', 'gd', ':EasyCompleteGotoDefinition<CR>')
80-
vim.keymap.set('n', 'rn', ':EasyCompleteRename<CR>')
81-
vim.keymap.set('n', 'gb', ':BackToOriginalBuffer<CR>')
82-
```
83-
84-
Vimscript configuration:
85-
86-
```vim
87-
" Using nerdfont is highly recommended
88-
let g:easycomplete_nerd_font = 1
89-
90-
" GoTo code navigation
91-
noremap gr :EasyCompleteReference<CR>
92-
noremap gd :EasyCompleteGotoDefinition<CR>
93-
noremap rn :EasyCompleteRename<CR>
94-
noremap gb :BackToOriginalBuffer<CR>
95-
```
96-
97-
Other optional configurations:
98-
99-
- `set updatetime=150` (lua: `vim.opt.updatetime = 150`) is highly recommended.
100-
- Menu noselected by default: `setlocal completeopt+=noselect`, (lua: `vim.cmd('setlocal completeopt+=noselect')`)
101-
102109
Global configurations:
103110

104111
| Global Configure | Default | Description |
@@ -132,16 +139,12 @@ Typing `:h easycomplete` for help.
132139

133140
There are tow ways to install lsp server.
134141

135-
1. For vim/nvim: via integrated installer by `:InstallLspServer`.
136-
2. For nvim only: via [nvim-lsp-installer](https://github.com/williamboman/nvim-lsp-installer) by `:LspInstall`
142+
1. For vim/nvim: use command`:InstallLspServer`.
143+
2. For nvim only: use [nvim-lsp-installer](https://github.com/williamboman/nvim-lsp-installer) by `:LspInstall`
137144

138-
```vim
139-
Plug 'williamboman/nvim-lsp-installer'
140-
```
141-
142-
LSP Server will all be installed in `~/.config/vim-easycomplete/servers`.
145+
LSP Server will all be installed in local path: `~/.config/vim-easycomplete/servers`.
143146

144-
You can give a specified plugin name for `InstallLspServer` command. Both of the following useage are fine:
147+
You can give a specified plugin name for `InstallLspServer` command. Both of the following useage are ok:
145148

146149
- `:InstallLspServer`
147150
- `:InstallLspServer lua`
@@ -179,7 +182,7 @@ All supported languages:
179182
| cmake | cmake | cmake | Yes | python3/pip3 | Yes |
180183
| c# | C# | omnisharp-lsp | Yes | None | No |
181184

182-
More info about semantic completion for each supported language:
185+
More info about supported language:
183186

184187
- JavaScript & TypeScript: [tsserver](https://github.com/microsoft/TypeScript) required.
185188
- Python: There are 2 avilable python-language-server branches:
@@ -209,7 +212,7 @@ More info about semantic completion for each supported language:
209212
- R: [r-languageserver](https://github.com/REditorSupport/languageserver) required.
210213
- TabNine: [TabNine](https://www.tabnine.com/)
211214

212-
Add filetypes whitelist for specified language plugin. Most of the time, it is not necessary to do so:
215+
You can add filetypes whitelist for specified language plugin. In most cases, it is not necessary to do so:
213216

214217
```vim
215218
let g:easycomplete_filetypes = {
@@ -224,7 +227,7 @@ let g:easycomplete_filetypes = {
224227

225228
### Snippet Support
226229

227-
Vim-EasyComplete does not support snippets by default. If you want snippet integration, you will first have to install `ultisnips`. UltiSnips is compatible with Vim-EasyComplete out of the box. UltiSnips required python3 installed.
230+
Vim-EasyComplete does not integration snippets by default. If you want snippet support, please install `ultisnips`. UltiSnips is compatible with Vim-EasyComplete. UltiSnips required python3 installed.
228231

229232
> [Solution of "E319: No python3 provider found" Error in neovim 0.4.4 with ultisnips](https://github.com/jayli/vim-easycomplete/issues/171)
230233
@@ -269,6 +272,8 @@ You can add custom Pmenu styles by defining these highlight groups:
269272
- `EasyTabNine`: TabNine kind icon style. links to "Character" by default.
270273
- `EasySnippets`: TabNine snippets suggestion style. links to "LineNr" by default
271274

275+
When `g:easycomplete_winborder` is set to `1`. The guibg of Pmenu will be set to be the same as the Normal guibg.
276+
272277
More examples here: [full config example](custom-config.md)
273278

274279
![截屏2023-12-30 20 25 06](https://github.com/jayli/vim-easycomplete/assets/188244/597db686-d4fe-4b25-8c39-d9b90db184cb)
@@ -277,10 +282,6 @@ More examples here: [full config example](custom-config.md)
277282

278283
[add custom completion plugin](add-custom-plugin.md)
279284

280-
## Issues
281-
282-
[WIP] If you have bug reports or feature suggestions, please use the [issue tracker](https://github.com/jayli/vim-easycomplete/issues/new). In the meantime feel free to read some of my thoughts at <https://zhuanlan.zhihu.com/p/366496399>, <https://zhuanlan.zhihu.com/p/425555993>, [https://medium.com/@lijing00333/vim-easycomplete](https://dev.to/jayli/how-to-improve-your-vimnvim-coding-experience-with-vim-easycomplete-29o0)
283-
284285
## More Examples:
285286

286287
TabNine snippets inline suggestion

0 commit comments

Comments
 (0)