Comments (8)
Thank you for your help @Shougo.
You are right, omnifunc is actually working even though it's shown as unavailable in CmpStatus.
Just for reference.
This is the final vimrc that I was testing with:
if has('vim_starting')
set encoding=utf-8
endif
scriptencoding utf-8
if &compatible
set nocompatible
endif
filetype plugin on
set omnifunc=syntaxcomplete#Complete
let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/autoload/plug.vim')
execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end
execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-omni'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/vim-vsnip'
Plug 'neovim/nvim-lspconfig'
call plug#end()
PlugInstall | quit
" Setup global configuration. More on configuration below.
lua << EOF
local cmp = require "cmp"
cmp.setup {
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = {
['<CR>'] = cmp.mapping.confirm({ select = true }),
["<C-y>"] = cmp.mapping.confirm({ select = true }),
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "buffer" },
{
name = 'omni',
option = {
disable_omnifuncs = { 'v:lua.vim.lsp.omnifunc' }
}
}
}),
}
EOF
lua << EOF
local capabilities = require('cmp_nvim_lsp').default_capabilities()
require'lspconfig'.cssls.setup {
capabilities = capabilities,
}
EOF
from nvim-cmp.
cmp-omni
is installed?
from nvim-cmp.
Plug 'hrsh7th/cmp-omni'
should install cmp-omni, right?
Is there something else that I should check to see if installation happened?
from nvim-cmp.
I think it is installed under s:plug_dir
.
NOTE: Why you use /tmp
directory for plugins? It is removed when you reboot the machine.
from nvim-cmp.
I have pretty much copied the suggested vimrc from this link and added the two mentioned lines.
I think it should be installing all plugins everytime I start up vim with this config.
from nvim-cmp.
if !filereadable(s:plug_dir .. '/plug.vim')
It must be:
if !filereadable(s:plug_dir .. '/autoload/plug.vim')
from nvim-cmp.
I am wondering what the word "unavailable" actually means.
I have read the source code.
It means: the source does not work in current buffer
.
Adding cmp-omni results in omni listed under unavailable source names.
Because omnifunc
option is not set in current buffer.
from nvim-cmp.
Please read the documentation.
*CmpStatus*
Describes statuses and states of sources.
Sometimes `unknown` will be printed - this is expected.
For example, `cmp-nvim-lsp` registers itself on InsertEnter autocommand
so the status will be shown as `unknown` when running the command.
I have read the code. The source is only registered when LSP server is configured on the buffer with InsertEnter
autocmd.
So it is the feature. The issue should be closed.
from nvim-cmp.
Related Issues (20)
- auto completion change to manual completion occasionally HOT 2
- error when using completion with gopls language server in neovim 0.10.0
- how to config vsnip with native nvim-jdtls
- How to disable background transport HOT 5
- matcher issue HOT 1
- Markdown stylization of completion documentation throws error (pylsp)
- No actions can be done to the autocomplete window when opened HOT 4
- disallow_prefix_unmatching not working consistently with jdtls language server HOT 5
- Completion tips are returned in a different order from the `lsp` service.
- Custom Entries Error after 'get-selected' api HOT 8
- Navigation through code completion does not work anymore HOT 10
- cmp.select_next_item() gets error "attempt to perform arithmetic on local 'cursor' HOT 5
- When attempting to navigate suggestion list getting E5108 Error executing lua: .../custom_entries_view.lua:328: attempt to perform arithmetic on local 'cursor' (a nil value) HOT 3
- GLFW_PROFILE doesn't match GLFW_OPENGL_PROFILE but it does when we write GLFW_OP first
- Update "Advanced techniques" in the Wiki HOT 1
- Improperly sized windows HOT 1
- Diagnostics window always opens from behind HOT 3
- Feature Request: complete on close HOT 2
- [Question] How would I fetch the current word that nvim cmp is completing against externally?
- preselection not working in command mode HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-cmp.