Giter VIP home page Giter VIP logo

nvim-compe's Introduction

Warning

nvim-compe is now deprecated. Please use nvim-cmp the successor of nvim-compe.

nvim-compe still works but new feature and bugfixes will be stopped.

nvim-compe

Auto completion plugin for nvim.

Table Of Contents

Concept

  • Simple core
  • No flicker
  • Lua source & Vim source
  • Better matching algorithm
  • Support LSP completion features (trigger character, isIncomplete, expansion)
  • Respect VSCode/LSP API design

Features

  • VSCode compatible expansion handling
    • rust-analyzer's Magic completion
    • vscode-html-languageserver-bin's closing tag completion
    • Other complex expansion are supported
  • Flexible Custom Source API
    • The source can support documentation / resolve / confirm
  • Better fuzzy matching algorithm
    • gu can be matched get_user
    • fmodify can be matched fnamemodify
    • See matcher.lua for implementation details
  • Buffer source carefully crafted
    • The buffer source will index buffer words by filetype specific regular expression if needed

Usage

Detailed docs in here or :help compe.

Prerequisite

Neovim version 0.5.0 or above.

You must set completeopt to menuone,noselect which can be easily done as follows.

Using Vim script

set completeopt=menuone,noselect

Using Lua

vim.o.completeopt = "menuone,noselect"

The source option is required if you want to enable but others can be omitted.

Vim script Config

let g:compe = {}
let g:compe.enabled = v:true
let g:compe.autocomplete = v:true
let g:compe.debug = v:false
let g:compe.min_length = 1
let g:compe.preselect = 'enable'
let g:compe.throttle_time = 80
let g:compe.source_timeout = 200
let g:compe.resolve_timeout = 800
let g:compe.incomplete_delay = 400
let g:compe.max_abbr_width = 100
let g:compe.max_kind_width = 100
let g:compe.max_menu_width = 100
let g:compe.documentation = v:true

let g:compe.source = {}
let g:compe.source.path = v:true
let g:compe.source.buffer = v:true
let g:compe.source.calc = v:true
let g:compe.source.nvim_lsp = v:true
let g:compe.source.nvim_lua = v:true
let g:compe.source.vsnip = v:true
let g:compe.source.ultisnips = v:true
let g:compe.source.luasnip = v:true
let g:compe.source.emoji = v:true

Lua Config

require'compe'.setup {
  enabled = true;
  autocomplete = true;
  debug = false;
  min_length = 1;
  preselect = 'enable';
  throttle_time = 80;
  source_timeout = 200;
  resolve_timeout = 800;
  incomplete_delay = 400;
  max_abbr_width = 100;
  max_kind_width = 100;
  max_menu_width = 100;
  documentation = {
    border = { '', '' ,'', ' ', '', '', '', ' ' }, -- the border option is the same as `|help nvim_open_win|`
    winhighlight = "NormalFloat:CompeDocumentation,FloatBorder:CompeDocumentationBorder",
    max_width = 120,
    min_width = 60,
    max_height = math.floor(vim.o.lines * 0.3),
    min_height = 1,
  };

  source = {
    path = true;
    buffer = true;
    calc = true;
    nvim_lsp = true;
    nvim_lua = true;
    vsnip = true;
    ultisnips = true;
    luasnip = true;
  };
}

Mappings

inoremap <silent><expr> <C-Space> compe#complete()
inoremap <silent><expr> <CR>      compe#confirm('<CR>')
inoremap <silent><expr> <C-e>     compe#close('<C-e>')
inoremap <silent><expr> <C-f>     compe#scroll({ 'delta': +4 })
inoremap <silent><expr> <C-d>     compe#scroll({ 'delta': -4 })

If you use cohama/lexima.vim

" NOTE: Order is important. You can't lazy loading lexima.vim.
let g:lexima_no_default_rules = v:true
call lexima#set_default_rules()
inoremap <silent><expr> <C-Space> compe#complete()
inoremap <silent><expr> <CR>      compe#confirm(lexima#expand('<LT>CR>', 'i'))
inoremap <silent><expr> <C-e>     compe#close('<C-e>')
inoremap <silent><expr> <C-f>     compe#scroll({ 'delta': +4 })
inoremap <silent><expr> <C-d>     compe#scroll({ 'delta': -4 })

If you use Raimondi/delimitMate

inoremap <silent><expr> <C-Space> compe#complete()
inoremap <silent><expr> <CR>      compe#confirm({ 'keys': "\<Plug>delimitMateCR", 'mode': '' })
inoremap <silent><expr> <C-e>     compe#close('<C-e>')
inoremap <silent><expr> <C-f>     compe#scroll({ 'delta': +4 })
inoremap <silent><expr> <C-d>     compe#scroll({ 'delta': -4 })

If you use windwp/nvim-autopairs

inoremap <silent><expr> <C-Space> compe#complete()
inoremap <silent><expr> <CR>      compe#confirm(luaeval("require 'nvim-autopairs'.autopairs_cr()"))
inoremap <silent><expr> <C-e>     compe#close('<C-e>')
inoremap <silent><expr> <C-f>     compe#scroll({ 'delta': +4 })
inoremap <silent><expr> <C-d>     compe#scroll({ 'delta': -4 })

Highlight

You can change documentation window's highlight group via following.

highlight link CompeDocumentation NormalFloat

Built-in sources

Common

  • buffer
  • path
  • tags
  • spell
  • calc
  • omni (Warning: It has a lot of side-effect.)

Neovim-specific

  • nvim_lsp
  • nvim_lua

External-plugin

External sources

Known issues

You can see the known issues in here.

Note: The next-version means nvim-cmp now.

FAQ

Can't get it work.

If you are enabling the omni source, please try to disable it.

Incredibly lagging.

If you are enabling the treesitter source, please try to disable it.

Does not work function signature window.

The signature help is out of scope of compe. It should be another plugin e.g. lsp_signature.nvim

If you are enabling the treesitter source, please try to disable it.

How to remove Pattern not found?

You can set set shortmess+=c in your vimrc.

How to use LSP snippet?

  1. Set snippetSupport=true for LSP capabilities.

    local capabilities = vim.lsp.protocol.make_client_capabilities()
    capabilities.textDocument.completion.completionItem.snippetSupport = true
    capabilities.textDocument.completion.completionItem.resolveSupport = {
      properties = {
        'documentation',
        'detail',
        'additionalTextEdits',
      }
    }
    
    require'lspconfig'.rust_analyzer.setup {
      capabilities = capabilities,
    }
  2. Install vim-vsnip

    Plug 'hrsh7th/vim-vsnip'

    or snippets.nvim

    Plug 'norcalli/snippets.nvim'

    or UltiSnips

    Plug 'SirVer/ultisnips'

    or LuaSnip

    Plug 'L3MON4D3/LuaSnip'

How to use tab to navigate completion menu?

Tab and S-Tab keys need to be mapped to <C-n> and <C-p> when completion menu is visible. Following example will use Tab and S-Tab (shift+tab) to navigate completion menu and jump between vim-vsnip placeholders when possible:

local t = function(str)
  return vim.api.nvim_replace_termcodes(str, true, true, true)
end

local check_back_space = function()
    local col = vim.fn.col('.') - 1
    return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil
end

-- Use (s-)tab to:
--- move to prev/next item in completion menuone
--- jump to prev/next snippet's placeholder
_G.tab_complete = function()
  if vim.fn.pumvisible() == 1 then
    return t "<C-n>"
  elseif vim.fn['vsnip#available'](1) == 1 then
    return t "<Plug>(vsnip-expand-or-jump)"
  elseif check_back_space() then
    return t "<Tab>"
  else
    return vim.fn['compe#complete']()
  end
end
_G.s_tab_complete = function()
  if vim.fn.pumvisible() == 1 then
    return t "<C-p>"
  elseif vim.fn['vsnip#jumpable'](-1) == 1 then
    return t "<Plug>(vsnip-jump-prev)"
  else
    -- If <S-Tab> is not working in your terminal, change it to <C-h>
    return t "<S-Tab>"
  end
end

vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})

How to expand snippets from completion menu?

Use compe#confirm() mapping, as described in section Mappings.

How to automatically select the first match?

compe#confirm() with the select option set to true will select the first item when none has been manually selected. For example:

vim.api.nvim_set_keymap("i", "<CR>", "compe#confirm({ 'keys': '<CR>', 'select': v:true })", { expr = true })

ESC does not close the completion menu

Another plugin might be interfering with it. vim-autoclose does this. You can check the mapping of <ESC> by running

imap <ESC>

vim-autoclose's function looks similar to this:

<Esc> *@pumvisible() ? '<C-E>' : '<C-R>=<SNR>110_FlushBuffer()<CR><Esc>'

In the particular case of vim-autoclose, the problem can be fixed by adding this setting:

let g:AutoClosePumvisible = {"ENTER": "<C-Y>", "ESC": "<ESC>"}

Other plugins might need other custom settings.

Demo

Auto Import

auto import

lsp

Buffer Source Completion

buffer

Calc Completion

calc

Nvim Lua Completion

nvim lua

Vsnip Completion

vsnip

Snippets.nvim Completion

snippets.nvim

Treesitter Completion

treesitter.nvim

Tag Completion

tag

Spell Completion

spell

nvim-compe's People

Contributors

00sapo avatar carlitux avatar cbarrete avatar ckipp01 avatar comfortablynick avatar elianiva avatar folke avatar fsouza avatar gegoune avatar glepnir avatar guidocella avatar hrsh7th avatar ii14 avatar iron-e avatar iwfan avatar jony255 avatar kamalmarhubi avatar kkharji avatar kristijanhusak avatar l3mon4d3 avatar lukas-reineke avatar nanotee avatar nlueb avatar phongnh avatar rishabhrd avatar runiq avatar srafi1 avatar stensipma avatar timbedard avatar z4m1n0 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

nvim-compe's Issues

[Feature request]: keep completion window on backspace

Hey @hrsh7th, hope your having a great weekend so far.

I wonder if it possible to keep completion window refreshed on backspace. I found myself trying to narrow down something and hitting wrong letter then hit backspace and the completion gone :D.

I'd appreciate it if this feature would be something you'd consider adding an option for.

Should source have filetype parameter?

I notice coc provide filetype praameter when regesting sources. Is this something to consider. I'm not sure

function! coc#source#iced#init() abort
  return {
        \ 'priority': 3,
        \ 'shortcut': 'iced',
        \ 'filetypes': ['clojure'],
        \ }
endfunction

Add source debug API

My random thoughts are...

  1. s:get_metadata can return `'debug': v:true'
  2. show invoke completion with keyword_pattern_offset, trigger_character_offset, input, items.

attempt to index a nil value

When using telescope with preview master

Error executing vim.schedule lua callback: ...ite/pack/packer/opt/nvim-compe/lua/compe_buffer/init.lua:63: attempt to index a nil value

How to activate lsp source in another filetype

Hey @hrsh7th , I'm starting to use luapad again, and I noticed that completion source is disabled . The filetype is lua.luapad, I tried adding the file type to nvim_lsp setup function:

  require'nvim_lsp'.sumneko_lua.setup({
    on_attach = on_attach,
    filetypes = {'lua', 'lua.luapad'}})

But It didn't fix the issue, so I guess it has something to do with nvim_compe, vsnip source and path sources works fine though.

Thanks

nvim_lsp support

It would be awesome to have preview functionality. Any ideas?

how to trigger golang lsp snippet completion

I've enabled vsnip completion by adding the following to my vimrc:

`call compe#source#vim_bridge#register('vsnip', compe_vsnip#source#create())`

and also added the following 2 plugins:

Plug 'hrsh7th/vim-vsnip'
Plug 'hrsh7th/vim-vsnip-integ'

golang lsp server has a snippet to add parentheses after a function call completion , but how do I trigger this snippet? Nothing happens after a function name is auto completed.

Hide completion window if not item is selected

Hey @hrsh7th , hope your doing great.

It would be nice if somehow completion popup will hide when there is one completion suggestion and it the word is typed fully.
For example: Say you type the full word function and the completion list has only one item: function then it better stop suggesting. I don't know if this possible but is something that will make completion experience better. What do you think?

Issues completion with /

Hey @hrsh7th I'm thinking there some issues with completion when typing / . You can see in the gif that typing str/ stop completion but pasting str/ bring the completion back for items under the prefix.

Do you think something builtin is conflicting with the source?

Thanks

preselect misbehaving

(don't know if the issue title is correct)

Maybe related to this comment

https://streamable.com/ttvto9
As you can see, it preselect the item even though I set compe_auto_preselect to false and sometimes I can't delete the word.

Here's my minimal vimrc to reproduce.

call plug#begin("~/.loca/share/nvim/plugged")
  Plug 'hrsh7th/nvim-compe'
call plug#end()

let g:compe_enabled = v:true
let g:compe_auto_preselect = v:false

inoremap <expr><CR>  compe#confirm('<CR>')
inoremap <expr><C-e> compe#close('<C-e>')
inoremap <silent><C-Space> <C-r>=compe#complete()<CR>

lua require'compe':register_lua_source('buffer', require'compe_buffer')
call compe#source#vim_bridge#register('path', compe_path#source#create())

But the weird thing is, it only applies to some filetypes (yaml has this, but lua doesn't have this issue (well, sometimes it has but it's so rare))
My neovim version is NVIM v0.5.0-880-gdd00c7473.
Ask me if you need more details. Thanks!

Improve stability.

In my impression, nvim-compe is a bit unstable now.

So probably, we should refactor some of the codes.

Error executing vim.schedule callback

Hi there! I have this issue which came up pretty inconsistently. Here's the error message.

Error executing vim.schedule lua callback: ...pack/packer/opt/nvim-compe/lua/compe/utils/character.lua:31: attempt to perform arithmetic on local 'byte1' (a nil value)

I think it happens when there's not enough screen to display the documentation from a completion item.
Here's how to reproduce it.

  • use this minimal init.vim
  • open this file on the left and a split on the right. I suppose you could use whatever file but I couldn't reproduce it unless I use this file (out of several ones that I have)
  • try to add + Math. on line 7, this is where the error happens
  • if it didn't happen, remove the . and add it back

Screenshot using minimal init.vim:
image

Thanks in advance!

lua version of plugin setup?

I'm trying to convert the plugin setup in README to lua, what's the lua version of the follow vim script call?

call compe#source#vim_bridge#register('path', compe_path#source#create())

I read the article "Getting started using Lua in Neovim" and tried the following, but it didn't work:

vim.fn['compe#source#vim_bridge#register']('path', vim.fn['compe_path#source#create']())

Force preselect to be false

I have a slight issue with nvim-compe when using it against gopls. I think the LSP is forcing nvim-compe to preselect the first match, the other sources doesn't have this issue. Is it possible to force it not to preselect the first item? Or is it have to be done in the lsp level? I can't find any lsp setting for gopls that can disable this behaviour. Here's a video to make it clearer..

https://streamable.com/9wtp5r

..and here's a minimal vimrc to reproduce. Thanks in advance!

call plug#begin("~/.local/share/nvim/plugged")
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/nvim-compe'
call plug#end()

lua << EOF
require"lspconfig".gopls.setup{
  root_dir = function() return vim.loop.cwd() end,
  settings = {
    gopls = {
      analyses = {
        unusedparams = true,
      },
      staticcheck = true,
      usePlaceholders = true,
    },
  }
}

local remap = vim.api.nvim_set_keymap

require'compe'.setup {
  enabled = true;
  debug = false;
  min_length = 2;
  auto_preselect = false;
  source_timeout = 200;
  incomplete_delay = 400;
  allow_prefix_unmatch = false;
  source = {
    path = true;
    buffer = true;
    vsnip = true;
    nvim_lsp = true;
  };
}

remap(
  'i', '<Tab>',
  'pumvisible() ? "<C-n>" : v:lua.Util.check_backspace() ? "<Tab>" : compe#confirm(lexima#expand("<LT>CR>", "i"))',
  { silent = true, noremap = true, expr = true }
)
EOF

compe_nvim_lsp/source.lua:60: attempt to index local 'result' (a nil value)

Hi @hrsh7th,
I got to say, after going through many completion plugins yours offered the best experience. am amazed of how light and fast it feels, also NO FLICKERING which is so amazing.

During testing i got the following error whenever I do one of the following

  • type ./... to complete file path
  • after completing lsp source function and opening paren (..
Error executing vim.schedule lua callback: ...pack/packer/opt/nvim-compe/lua/compe_nvim_lsp/source.lua:60: attempt to index local 'result' (a nil value)

My configuration:

  vim.o.pumheight = 10
  vim.cmd('set completeopt=menuone,noinsert,noselect')
  vim.cmd('packadd nvim-compe')
  vim.cmd'let g:compe_enabled = v:true'
  vim.cmd'let g:compe_min_length = 1'
  require'compe_nvim_lsp'.attach()
  require'compe':register_lua_source('buffer', require'compe_buffer')
  vim.cmd[[call compe#source#vim_bridge#register('path', compe_path#source#create())]]
  bind.i({
    {'<cr>', [[compe#confirm('<CR>')]], {expr = true}},
    {'<C-e>', [[compe#close('<C-e>'))]], {expr = true}},
    {'<C-Space>', [[<C-r>=compe#complete()<CR>]], {expr = true}},
    {'<C-j>', [[pumvisible() ? "\<C-n>" : "\<C-j>"]], { expr = true}},
    {'<C-k>', [[pumvisible() ? "\<C-p>" : "\<C-k>"]], { expr = true}},
    {'<Tab>', [[pumvisible() ? "\<C-n>" : "\<Tab>"]], { expr = true}},
    {'<S-Tab>', [[pumvisible() ? "\<C-p>" : "\<S-Tab>"]], { expr = true}},
  })

I'm using nvim built in lsp

Seriously amazing plugin and I believe it might be the next best thing. Looking forward to develop sources for it

weird backspace behavior

Hello @hrsh7th , thanks for the really cool plugin. I shifted from completion-nvim and I feel it has the abstractions that people really want from an auto-completion setup.

Just I found the backspace behavior a little weird. When I leave some suggestion for my own text and then do a backspace it inserts the (left) suggestion text automatically. Very similar to android autocorrection ๐Ÿ˜…
I have attached a gif that should explain my words more clearly.
backspace
I don't know if it is the intended feature. If it is then is there any option to disable it.

Also, sometimes backspace deletes a big amount of text (like 2 or 3 words) instead of a character.
This gif would show the behavior:
backmore

(Bottom right of gif shows my keypress in case of any ambiguity)

Thanks

error when manually triggering completion

I'm trying to use tab to manually trigger completion, and I have the following key mapping:

check_backspace = function()
  local col = vim.fn.col('.') - 1
  if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
    return true
  else
    return false
  end
end

vim.api.nvim_set_keymap(
  'i', '<Tab>',
  'pumvisible() ? "<C-n>" : v:lua.check_backspace() ? "<Tab>" : <C-r>=compe#complete()<CR>',
  { noremap=true, expr=true }
)

I get an error as following every time I use tab to trigger completion manually:

E15: Invalid expression: ^R=compe.completion()^M

Steps to reproduce:

  1. type something, completion is automatically triggered
  2. stop completion with C-e
  3. type tab to trigger completion manually

I guess there's something wrong with my key mapping here, any help would be appreciated.

Vsnip source

Hey @hrsh7th, while using vsnip source, I noticed that typing rg gets only LSP source, where as I have a snippet with rguse. It should show both Snippet source and LSP source.

Only when typing rgu I get rguse.

Not sure why?

Also I have fun snippet prefix, when I type fun, I only see lsp source

Thanks

How to pass regex in the new api?

Hey @hrsh7th I'm trying to fix a broken source after updating. My old determine function:

function! s:datermine(context) abort
  let l:offset = compe#pattern#get_offset(a:context, '[[:alnum:]!$&*\-_=+:<>./?]\+$')
  if l:offset > 0
    return {
    \   'keyword_pattern_offset': l:offset,
    \   'trigger_character_offset': index(['/'], a:context.before_char) >= 0 ? a:context.col : -1
    \ }
  end
  return {}
endfunction
function! s:datermine(context) abort
  return compe#helper#datermine(a:context,  {
        \ 'trigger_character_offset': index(['/'], a:context.before_char) >= 0 ? a:context.col : -1
        \ })
endfunction

The new one works, but the trigger no longer works as before. Could you please give a clue to what changes I need to make. Thanks

Any chance of adding ultisnips builtin completion-source?

Hello @hrsh7th , currently nvim-compe supports vim-vsnip for snippet completion.

Although Ultisnips is considered to be slow, it remains to be very popular due to pre-available snippet solutions like vim-snippets. This makes it configurable in almost no time with a lot of handy snippets and hence many people still use it.

So, having Ultisnips completion builtin can interest a big user-base. (Maybe I am much opinionated on it)

The only problem with Ultisnips is, its code is not much public-accessible and hence something like getting a raw snippet string would result in a huge increase in the codebase. However, something like available snippets at the moment can be provided very easily without increasing the codebase drastically.

If you feel like adding it, I would submit a PR that would implement the feature.

Documents are not displayed correctly

The first time it works fine, but after the second time it does not seem to display correctly.

compe_issue

  • nvim --version: NVIM v0.5.0-dev+941-g9c56d8e5f
  • Operating system/version: Ubuntu 18.04 (WSL2)

vimrc

set encoding=utf-8
scriptencoding utf-8

filetype plugin indent on
if has('vim_starting')
  let s:pluin_manager_dir='~/.config/nvim/.plugged/vim-plug'
  execute 'set runtimepath+=' . s:pluin_manager_dir
endif

call plug#begin('~/.config/nvim/.plugged')
Plug 'hrsh7th/nvim-compe'
Plug 'neovim/nvim-lspconfig'
Plug 'sainnhe/gruvbox-material'
call plug#end()

set nobackup
set nowritebackup
set noswapfile
set updatecount=0
set backspace=indent,eol,start
language messages en_US.utf8

set termguicolors

set bg=dark
colorscheme gruvbox-material

lua << EOF
require'compe'.setup {
  enabled = true,

  source = {
    nvim_lsp = true,
  }
}

require'lspconfig'.vimls.setup{}
EOF

Is there something I'm missing in the settings?

Please take a look when you have time.

always in ComplMode?

I'm in this ComplMode mode as soon as I type something in insert mode, even in markdown files where I have no lsp server configured.

Does this mean I'm always in the middle of auto completion? I thought auto completion should be trigger by some trigger character.

Below is my config of nvim-compe:

compe.setup = function()

  -- vim settings
  vim.api.nvim_set_option('completeopt', 'menuone,noinsert,noselect')
  vim.cmd [[set shortmess+=c]]

  -- compe settings
  vim.g.compe_enabled = true
  vim.g.compe_min_length = 1
  -- there's flickering with `compe_auto_preselect = true`, ref issue: #32
  vim.g.compe_auto_preselect = false
  vim.g.compe_source_timeout = 200
  vim.g.compe_incomplete_delay = 400

  -- enable path completion
  vim.cmd [[call compe#source#vim_bridge#register('path',  compe_path#source#create())]]

  -- enable vsnip completion
  vim.cmd [[call compe#source#vim_bridge#register('vsnip', compe_vsnip#source#create())]]
end

Confirming selection without enter?

Hey @hrsh7th hope your having a great week.

My configuration

local options = {
  compe_enabled = true,
  compe_min_length = 1,
  compe_auto_preselect = false,
}

Issue:

Selecting an item with <c-p> or <c-n> doesn't confirm selection, so if I want to have a <space> or add ( after pressing <c-n/p> on highlighted item in the popup, I'd need to press the letter twice, which very annoying to be honest.

expected behavior

When an item is selected it should be confirmed so that pressing any letter afterwards won't be blocked or need to be pressed twice.

nvim_lsp must be explicitly enabled as source now?

Auto completion suddenly stopped working this morning, I came here and saw a major change in plugin setup.
So nvim_lsp must be explicitly enabled as source now if I want auto completion from lsp servers?
I don't have nvim_lsp as source in my old config.

Docs: create new source

Some documentation or wiki entries on creating new source it needed

For example, I use @liquidz 's awesome plugin for clojure development 'vim-iced' and it has omnifunc. Here is omnifunc is supported by default in nvim-compe, or a source needed be created.

Also I see he create custom source for coc source and asyncomplete. How can I create and port these sources using nvim-compe.

This something the wiki should answer

Error: buffer id not valid

I'm having issue with buffer id not valid

I add this around line 54 and still testing it, i'm not sure it would fix the problem though

      if not vim.api.nvim_buf_is_valid(self.bufnr) then return end

image

Compatible to newer vim.

  • vim.inspect
  • vim.tbl_extend
  • vim.g
  • vim.schedule
  • vim.schedule_wrap
  • vim.regex
  • vim.NIL
  • vim.loop.new_timer

Support multiple start offset

We should support multiple start_offset.

For example, In the below state, nvim-compe should work two different sources.

some.wor|
โ†‘    โ†‘
โ†‘    source1 offset
โ†‘
source2 offset

Feature request: resolve path alias

I don't know if this possible or not, but basically, I want to be able to get path completion when using an alias. e.g "@/components/stu| <- cursor" will be treated as if it looks like "{cwd}/src/components/stu| <- cursor" where the alias replacement ({cwd}/src) can be just defined by the user. Again, I don't know if this is possible or not, so feel free to close this issue if it's not possible. Thanks! :)

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.