Code Monkey home page Code Monkey logo

vim-easycomplete's Introduction

Vim-EasyComplete

A Fast and Minimalism Style Completion Plugin for vim/nvim.

Why

There are many excellent vim auto-completion plugins such as nvim-cmp, vim-lsp, YouCompleteMe and coc.nvim etc. However I still want a simpler plugin without any redundant configurations. And it's a good idea to incorporate an AI coding assistant as well.

What

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.

vim-easycomplete.mov

It contains these features:

  • AI coding assistant via tabnine. (Highly Recommend!)
  • Buffer Keywords/Directory support
  • LSP(language-server-protocol) support. Easy to install LSP Server with one command
  • Written in pure vim script for vim8 and neovim
  • Snippet support
  • Fast performance

Installation

Easycomplete requires Vim 8.2 or higher version with MacOS/Linux/FreeBSD. For neovim users, 0.6.0 or higher is required.

Vimscript config with vim-plug:

Plug 'jayli/vim-easycomplete'
Plug 'SirVer/ultisnips'

Run :PlugInstall.

Lua config with Packer.nvim:

use { 'jayli/vim-easycomplete', requires = {'SirVer/ultisnips'}}

Run :PackerInstall

Full configuration example.

Commands

All commands:

Command Description
:EasyCompleteInstallServer Install LSP server for current fileytpe
:InstallLspServer Same as EasyCompleteInstallServer
:EasyCompleteDisable Disable EasyComplete
:EasyCompleteEnable Enable EasyComplete
:EasyCompleteGotoDefinition Goto definition position
:EasyCompleteReference Find references
:EasyCompleteRename Rename
:EasyCompleteCheck Checking LSP server
:EasyCompletePreviousDiagnostic Goto Previous diagnostic
:EasyCompleteNextDiagnostic Goto Next diagnostic
:EasyCompleteProfileStart Start record diagnostics message
:EasyCompleteProfileStop Stop record diagnostics message
:EasyCompleteLint Do diagnostic
:LintEasyComplete Do diagnostic
:BackToOriginalBuffer Return to the position before the reference jump
:DenoCache Do Deno Cache for downloading modules
:CleanLog close quickfix window

Configuration

The plugin is out of box and config nothing. (If you want full features, please refer to my full configuration). 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).

Lua configuration:

-- Highlight the symbol when holding the cursor if you need it
vim.g.easycomplete_cursor_word_hl = 1
-- Using nerdfont is highly recommended
vim.g.easycomplete_nerd_font = 1

-- GoTo code navigation
vim.keymap.set('n', 'gr', ':EasyCompleteReference<CR>')
vim.keymap.set('n', 'gd', ':EasyCompleteGotoDefinition<CR>')
vim.keymap.set('n', 'rn', ':EasyCompleteRename<CR>')
vim.keymap.set('n', 'gb', ':BackToOriginalBuffer<CR>')

Vimscript configuration:

" Highlight the symbol when holding the cursor
let g:easycomplete_cursor_word_hl = 1
" Using nerdfont is highly recommended
let g:easycomplete_nerd_font = 1

" GoTo code navigation
noremap gr :EasyCompleteReference<CR>
noremap gd :EasyCompleteGotoDefinition<CR>
noremap rn :EasyCompleteRename<CR>
noremap gb :BackToOriginalBuffer<CR>

set updatetime=300 (in lua vim.opt.updatetime = 300) is highly recommended.

Global configurations:

Global Configure Default Description
g:easycomplete_nerd_font 0 Using nerdfont for lsp icons
g:easycomplete_menu_skin {} Menu skin.
g:easycomplete_sign_text {} Sign icons.
g:easycomplete_lsp_type_font ... lsp icons configuration
g:easycomplete_tabnine_suggestion 1 Tabnine inline suggestion(for nvim only)
g:easycomplete_lsp_checking 1 Check whether the lsp is installed while opening a file
g:easycomplete_tabnine_enable 1 Enable Tabnine
g:easycomplete_directory_enable 1 Directory complete
g:easycomplete_tabnine_config {} TabNine Configuration
g:easycomplete_filetypes {} Custom filetyps configuration
g:easycomplete_enable 1 Enable this plugin
g:easycomplete_tab_trigger <Tab> Use tab to trigger completion and select next item
g:easycomplete_shift_tab_trigger <S-Tab> Use s-tab to select previous item
g:easycomplete_cursor_word_hl 0 Highlight the symbol when holding the cursor
g:easycomplete_signature_offset 0 Signature offset
g:easycomplete_diagnostics_next <C-N> Goto next diagnostic position
g:easycomplete_diagnostics_prev <S-C-n> Goto previous diagnostic position
g:easycomplete_diagnostics_enable 1 Enable diagnostics
g:easycomplete_signature_enable 1 Enable signature
g:easycomplete_diagnostics_hover 1 Gives a diagnostic prompt when the cursor holds
g:easycomplete_pum_format ["abbr", "kind", "menu"] Pmenu format

Typing :h easycomplete for help.

Language Support

There are tow ways to install lsp server.

  1. For vim/nvim: via integrated installer by :InstallLspServer.
  2. For nvim only: via nvim-lsp-installer by :LspInstall
Plug 'williamboman/nvim-lsp-installer'

LSP Server will all be installed in ~/.config/vim-easycomplete/servers.

You can give a specified plugin name for InstallLspServer command. Both of the following useage are avilable:

  • :InstallLspServer
  • :InstallLspServer lua

All supported languages:

Plugin Name Languages Language Server Installer Requirements nvim-lsp-installer support
directory directory No Need Integrated None -
buf buf & dict No Need Integrated None -
snips Snippets ultisnips Integrated python3 -
ts js/ts tsserver Yes node/npm Yes
deno js/ts denols Yes deno Yes
tn TabNine TabNine Yes None No
vim Vim vimls Yes node/npm Yes
cpp C/C++/OC clangd Yes None Yes
css CSS cssls Yes node/npm Yes
html HTML html Yes node/npm Yes
yml YAML yamlls Yes node/npm Yes
xml Xml lemminx Yes java/jdk Yes
sh Bash bashls Yes node/npm Yes
json JSON json-languageserver Yes node/npm No
php php intelephense Yes node/npm Yes
dart dart dartls Yes None Yes
py Python pylsp Yes python3/pip3 Yes
java Java jdtls Yes java11/jdk Yes
go Go gopls Yes go Yes
r R r-languageserver Yes R No
rb Ruby solargraph Yes ruby/bundle No
lua Lua sumneko_lua Yes Lua Yes
nim Nim nimls Yes nim/nimble Yes
rust Rust rust_analyzer Yes None Yes
kt Kotlin kotlin_language_server Yes java/jdk Yes
grvy Groovy groovyls Yes java/jdk Yes
cmake cmake cmake Yes python3/pip3 Yes
c# C# omnisharp-lsp Yes None No

More info about semantic completion for each supported language:

Add filetypes whitelist for specified language plugin:

let g:easycomplete_filetypes = {
      \   "sh": {
      \     "whitelist": ["shell"]
      \   },
      \   "r": {
      \     "whitelist": ["rmd", "rmarkdown"]
      \   },
      \ }

Snippet Support

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.

Solution of "E319: No python3 provider found" Error in neovim 0.4.4 with ultisnips

AI Coding via TabNine Support

Install TabNine: :InstallLspServer tabnine. Then restart your vim/nvim.

Set let g:easycomplete_tabnine_enable = 0 to disable TabNine. You can config TabNine by g:easycomplete_tabnine_config witch contains two properties:

  • line_limit: The number of lines before and after the cursor to send to TabNine. If the option is smaller, the performance may be improved. (default: 1000)
  • max_num_result: Max results from TabNine. (default: 3)
let g:easycomplete_tabnine_config = {
    \ 'line_limit': 1000,
    \ 'max_num_result' : 3,
    \ }

TabNine works well without APIKey. If you have a Tabnine's Pro API key or purchased a subscription license. To configure, you'll need to use the TabNine' magic string. Type Tabnine::config in insert mode to open the configuration panel.

Disable TabNine inline suggestion: let g:easycomplete_tabnine_suggestion = 0.


Beautify completion menu

Set g:easycomplete_nerd_font = 1 to enable default nerdfonts configuration.

If you want to customize the kind icon, you can modify the configuration with https://nerdfonts.com installed. Examples.

You can add custom Pmenu styles by defining these highlight groups:

  • EasyFuzzyMatch: highlight fuzzy matching character. It links to "Constant" by default if it's not defined.
  • EasyPmenu: Pmenu style. It links to "Pmenu" by default.
  • EasyPmenuKind: PmenuKind style. It links to "PmenuKind" by default.
  • EasyPmenuExtra: PmenuExtra style. It links to "PmenuExtra" by default.
  • EasyFunction: Function kind icon style. links to "Conditional" by default.
  • EasySnippet: Snippet kind icon style. links to "Number" by default.
  • EasyTabNine: TabNine kind icon style. links to "Character" by default.
  • EasySnippets: TabNine snippets suggestion style. links to "LineNr" by default

More examples here: full config example

My custom config:my-custom-config

截屏2023-12-30 20 25 06

Add custom completion plugin

add custom completion plugin

Issues

[WIP] If you have bug reports or feature suggestions, please use the issue tracker. 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

More Examples:

TabNine snippets inline suggestion

Update Deno Cache via :DenoCache

Directory selecting:

Handle backsapce typing

Snip Support

Diagnostics jumping

Signature

TabNine supporting:

License

MIT

vim-easycomplete's People

Contributors

feishiheng avatar jayli avatar phongnh avatar ultirequiem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-easycomplete's Issues

安装插件之后启动 vim 时将报错。

安装完插件之后启动 vim 将有如下报错:
error_easycomplete

使用的 vim 插件管理器是 vimplug
.vimrc 文件:

" ------------------------------------------
" vim-plug
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'

" auto install vim-plu
if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

call plug#begin('~/.vim/plugged')

" Make sure you use single quotes

" Graphviz
Plug 'liuchengxu/graphviz.vim'
let g:graphviz_output_format = 'svg'

" LaTeX
Plug 'lervag/vimtex', { 'for': 'latex'}

" Fortran
let fortran_free_source = 1
Plug 'rudrab/vimf90', { 'for': 'fortran'}
"Plug 'vim-scripts/fortran_line_length'

" Markdown Syntax
Plug 'plasticboy/vim-markdown', { 'for': 'markdown'}

" Markdown Preview with Mathjax Support
Plug 'iamcco/mathjax-support-for-mkdp', { 'on': 'MarkdownPreview', 'for': 'markdown'}
Plug 'iamcco/markdown-preview.vim', { 'on': 'MarkdownPreview', 'for': 'markdown'}
let g:mkdp_path_to_chrome = "/usr/bin/qutebrowser" " use qutebrowser as default preview browwer

" Syntax check
Plug 'w0rp/ale'

" SnipMate 携带的四个插件
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'garbas/vim-snipmate'
Plug 'honza/vim-snippets'

" EasyComplete 插件和 Dictionary 词表(依赖 SnipMate
Plug 'jayli/vim-easycomplete'
Plug 'jayli/vim-dictionary'

"" Code Completion
"" Require packages: build-essential cmake python3-dev
"" run `./install.py --clang-completer` after install 
"function! BuildYCM(info)
"  " info is a dictionary with 3 fields
"  " - name:   name of the plugin
"  " - status: 'installed', 'updated', or 'unchanged'
"  " - force:  set on PlugInstall! or PlugUpdate!
"  if a:info.status == 'installed' || a:info.force
"    !./install.py
"  endif
"endfunction
"Plug 'Valloric/YouCompleteMe', { 'do': function('BuildYCM')}

" NERD tree with git status support
Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }
Plug 'Xuyuanp/nerdtree-git-plugin', { 'on':  'NERDTreeToggle' }

" Status Bar
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
let g:airline_powerline_fonts = 1
let g:airline_theme='minimalist'

" Rainbow Patentheses
" Plug 'kien/rainbow_parentheses.vim'
" au VimEnter * RainbowParenthesesToggle
" au Syntax * RainbowParenthesesLoadRound
" au Syntax * RainbowParenthesesLoadSquare
" au Syntax * RainbowParenthesesLoadBraces
Plug 'luochen1990/rainbow'
let g:rainbow_active = 1 "0 if you want to enable it later via :RainbowToggle

" Initialize plugin system
call plug#end()

" -----------------------------------------
" Hollow's vim config
" Reference on https://dougblack.io/words/a-good-vimrc.html

" Colors
"colorscheme blackboard
syntax enable " enable syntax processing

" Spaces & Tabs
set tabstop=4 " number of visual spaces per TAB
set softtabstop=4 " number of spaces in tab when editing
set expandtab " tabs are spaces
set shiftwidth=4 " numbers of space to indent

" UI Config
set number " show line numbers
set showcmd " show command in bottom bar
"set cursorline " highlight current line
filetype indent on " load filetype-specific indent files
set wildmenu " visual autocomplete for command menu
set lazyredraw " redraw only when we need to, seemed to cause latency, reference on StacksOverflow
set showmatch " highlight matching [{()}]

" Searching 
set incsearch " search as characters are entered
set hlsearch " highlight matches
" turn off search highlight 
nnoremap <leader><space> :nohlsearch<CR>

" Folding
set foldenable " enable folding
set foldlevelstart=10 " open most folds by defaults
set foldnestmax=10 " 10 nested fold max
" space open/closes folds
nnoremap <space> za
set foldmethod=indent " fold based on indent level(Run ':help foldmethod' for more details)

" Movement
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" replacing $/^ with B/E to movr to the beginning/end of line
nnoremap B ^
nnoremap E $
nnoremap ^ <nop>
nnoremap & <nop>
" highlight last inserted text
nnoremap gV `[v`]

" Leader Shortcuts
let mapleader ="," " leader is comma
let maplocalleader = "\\" " localleader is \\
" jk is escape
"inoremap jk <esc>
" toggle gundo
nnoremap <leader>u :GundoToggle<CR>
" edit vimrc/fishrc and load vimrc bindings
nnoremap <leader>ev :vsp $MYVIMRC<CR>
nnoremap <leader>ef :vsp ~/.config/fish/config.fish
nnoremap <leader>sv :source $MYVIMRC<CR>
" save session, reopen with 'vim -S'
nnoremap <leader>s :mksession<CR>
" open ag.vim, which is a fantastic line tool to search source code without leaving Vim and pulls the results into a quickfix window
nnoremap <leader>a :Ag

" input custom symbols 『』, 「」 with ^', ^;
inoremap <F6> 『』<Esc>i
inoremap <F7> 「」<Esc>i

" txt 中文 乱码
" set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1
set enc=utf8
set fencs=utf8,gbk,gb2312,gb18030

vim version:

VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun  5 2019 14:31:35)
Included patches: 1-1467
Compiled by Arch Linux
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               +extra_search      +mouse_netterm     -tag_old_static
+arabic            -farsi             +mouse_sgr         -tag_any_white
+autocmd           +file_in_path      -mouse_sysmouse    +tcl/dyn
+autochdir         +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
+balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
+browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +textprop
+byte_offset       -hangul_input      +num64             +timers
+channel           +iconv             +packages          +title
+cindent           +insert_expand     +path_extra        +toolbar
+clientserver      +job               +perl/dyn          +user_commands
+clipboard         +jumplist          +persistent_undo   +vartabs
+cmdline_compl     +keymap            +postscript        +vertsplit
+cmdline_hist      +lambda            +printer           +virtualedit
+cmdline_info      +langmap           +profile           +visual
+comments          +libcall           +python/dyn        +visualextra
+conceal           +linebreak         +python3/dyn       +viminfo
+cryptv            +lispindent        +quickfix          +vreplace
+cscope            +listcmds          +reltime           +wildignore
+cursorbind        +localmap          +rightleft         +wildmenu
+cursorshape       +lua/dyn           +ruby/dyn          +windows
+dialog_con_gui    +menu              +scrollbind        +writebackup
+diff              +mksession         +signs             +X11
+digraphs          +modify_fname      +smartindent       -xfontset
+dnd               +mouse             +startuptime       +xim
-ebcdic            +mouseshape        +statusline        -xpm
+emacs_tags        +mouse_dec         -sun_workshop      +xsmp_interact
+eval              +mouse_gpm         +syntax            +xterm_clipboard
+ex_extra          -mouse_jsbterm     +tag_binary        -xterm_save
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi-3.2.1/include -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/uuid -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/libdrm -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread  -D_FORTIFY_SOURCE=2  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.30/core_perl/CORE  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0  -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lelf -lnsl    -lacl -lattr -lgpm -ldl   -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.30/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/perl5/5.30/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc   -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm

启用插件后vim启动过慢,open buffers这是阶段用时过长

这是启用时的部分日志:
351.000 005.000: clearing screen
418.000 042.000 042.000: sourcing C:\Vim\vim81\ftplugin\python.vim
431.000 001.000 001.000: sourcing C:\Vim\vim81\syntax\python.vim
439.000 000.000 000.000: sourcing C:\Vim\vim81\indent\python.vim
5920.000 5526.000: opening buffers
5921.000 001.000: BufEnter autocommands
5921.000 000.000: editing files in windows
5925.000 001.000 001.000: sourcing C:\Users\My.vim\bundle\vim-easycomplete\autoload\easycomplete.vim
5926.000 004.000: VimEnter autocommands
5926.000 000.000: before starting main loop
5927.000 001.000: first screen update
5927.000 000.000: --- VIM STARTED ---

这是注释掉后的部分日志:
8210.000 049.000 049.000: sourcing C:\Vim\vim81\ftplugin\python.vim
8219.000 001.000 001.000: sourcing C:\Vim\vim81\syntax\python.vim
8225.000 001.000 001.000: sourcing C:\Vim\vim81\indent\python.vim
8227.000 036.000: opening buffers
8227.000 000.000: BufEnter autocommands
8227.000 000.000: editing files in windows
8228.000 001.000: VimEnter autocommands
8228.000 000.000: before starting main loop
8229.000 001.000: first screen update
8229.000 000.000: --- VIM STARTED ---

vim版本: 8.1
vim-easycomplete安装方式:vundle

python 补全报错

环境

  • Ubuntu 21.04
  • Python 3.9.4
  • neovim 0.4.4

依赖

已安装 vim-easycomplete 和 python-language-server.
image
image

错误

Error detected while processing function easycomplete#typing[21]..easycomplete#FireCondition[1]..<SNR>92_NormalTrigger:
line   10:
E117: Unknown function: str2list

image

shell脚本中无法补全vim-snippets中的#!代码片段

在shell脚本中输入

#!<tab>

后无法补全为

#!/usr/bin/env sh

做了如下修改可以实现

diff --git a/autoload/easycomplete.vim b/autoload/easycomplete.vim
index b50cdc3..02dea4f 100644
--- a/autoload/easycomplete.vim
+++ b/autoload/easycomplete.vim
@@ -98,7 +98,7 @@ function! easycomplete#CleverTab()
         "   前一个字符是空格
         "   空行
         return "\<Tab>"
-    elseif match(strpart(getline('.'), 0 ,col('.') - 1)[0:col('.')-1],
+    elseif &filetype != "sh" && match(strpart(getline('.'), 0 ,col('.') - 1)[0:col('.')-1],
                                             \ "\\(\\w\\|\\/\\|\\.\\)$") < 0
         " 如果正在输入一个非字母,也不是'/'或'.'
         return "\<Tab>"
@@ -640,7 +640,7 @@ function! easycomplete#CompleteFunc( findstart, base )
             return start
         endif

-        while start > 0 && line[start - 1] =~ '[a-zA-Z0-9_#]'
+        while start > 0 && line[start - 1] =~ '[a-zA-Z0-9_#!]'
             let start -= 1
         endwhile
         return start

请jayli看一下是否ok。

snipmate优化

是否可以在snipmate 唯一匹配的时候自动展开呢,每次即使只有一个匹配也需要回车选择一下

谢谢您的插件

popup 窗口限宽的问题

set completepopup=width:90,highlight:Pmenu,border:off,align:menu

这里的宽度设置不好使,原因不明

文件路径补全无法识别关键词 `~/`

复现过程:

  1. 创建空文本 test.txt
  2. 在其中输入 ~/ 后按下 tab 键无法进行文件路径补全。( vim 自带的 C-X C-F 可以识别)

另,输入 ./ 后按下 tab 键可进行文件路径补全。

安装插件后遇到错误

mac上使用neovim的vim-plug插件管理器
按照示例安装
打开后报错

line   25:
E121: Undefined variable: g:pmenu_scheme
Press ENTER or type command to continue
Error detected while processing function easycomplete#Enable:
line   25:
E15: Invalid expression: g:pmenu_scheme == 'default'
Press ENTER or type command to continue

cpp 的补全为什么会把函数返回类型也给补全出来

环境

  • Ubuntu 20.04 desktop
  • vim 8.2

编译安装ccls的步骤

根据从官方下载预编译包安装的clang+llvm

# 下载ccls源码
git clone https://github.com/MaskRay/ccls
cd ccls
# 在ccls根目录下执行
# 第0步,下载第三方依赖(主要是rapidjson)
git submodule update --init --recursive
# 第一步,下载llvm的二进制包
# 这一步可以用任何下载工具代替,只要使用的是这个网址的结果即可
wget -c https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz
# 解压二进制包
tar xf clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz
# 在当前文件目录下执行cmake 执行结果保存到Release文件夹中
cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$PWD/lang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04
cmake --build Release
# 开始编译并安装
cd Release
# 这里使用4线程编译,当然如果你的电脑够强的话,可以直接-j或者使用更搞核数加快编译
make -j4
# 编译完成,安装
sudo make install

问题

运行单个cpp文件,tab补全会把定义也一块补在后面。
image
str.clear()之后,会跟着补全->void

断网机器 tab 补全

处理 function easycomplete#CompleteFunc..18_GetKeywords..18_GetBufKeywordsList 时发生错误:
第 2 行:
E15: 无效的表达式: getbufinfo()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.