From 0cb2a5a7f7875f3fcec4ff3235841c43b13b9ee8 Mon Sep 17 00:00:00 2001 From: Kristijan Husak Date: Tue, 29 Jun 2021 23:33:18 +0200 Subject: [PATCH] Remove custom implementation for completion-nvim and suggest using omni mode. --- DOCS.md | 4 ++-- README.md | 4 ++-- doc/orgmode.txt | 4 ++-- lua/orgmode/org/autocompletion.lua | 15 --------------- 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/DOCS.md b/DOCS.md index 603362460..2a766642c 100644 --- a/DOCS.md +++ b/DOCS.md @@ -407,11 +407,11 @@ If you use [nvim-compe](https://github.com/hrsh7th/nvim-compe) add this to compe }) ``` -For [completion.nvim](https://github.com/nvim-lua/completion-nvim), add this to your completion nvim config: +For [completion.nvim](https://github.com/nvim-lua/completion-nvim), just add `omni` mode to chain complete list: ```lua vim.g.completion_chain_complete_list = { org = { - { complete_items = {'orgmode'}}, + { mode = 'omni'}, }, } ``` diff --git a/README.md b/README.md index 0cadeaf6a..097962085 100644 --- a/README.md +++ b/README.md @@ -58,11 +58,11 @@ require'compe'.setup({ }) ``` -For [completion.nvim](https://github.com/nvim-lua/completion-nvim), add this to your completion nvim config: +For [completion.nvim](https://github.com/nvim-lua/completion-nvim), just add `omni` mode to chain complete list: ```lua vim.g.completion_chain_complete_list = { org = { - { complete_items = {'orgmode'}}, + { mode = 'omni'}, }, } ``` diff --git a/doc/orgmode.txt b/doc/orgmode.txt index 32d60db5e..c70ae85e6 100644 --- a/doc/orgmode.txt +++ b/doc/orgmode.txt @@ -582,11 +582,11 @@ If you use nvim-compe (https://github.com/hrsh7th/nvim-compe) add this to compe }) < -For completion.nvim (https://github.com/nvim-lua/completion-nvim), add this to your completion nvim config: +For completion.nvim (https://github.com/nvim-lua/completion-nvim), just add `omni` mode to chain complete list: > vim.g.completion_chain_complete_list = { org = { - { complete_items = {'orgmode'}}, + { mode = 'omni'}, }, } < diff --git a/lua/orgmode/org/autocompletion.lua b/lua/orgmode/org/autocompletion.lua index 3d0404d31..3e97da147 100644 --- a/lua/orgmode/org/autocompletion.lua +++ b/lua/orgmode/org/autocompletion.lua @@ -127,19 +127,4 @@ if has_compe then compe.register_source('orgmode', CompeSource) end -local has_completion_nvim, completion_nvim = pcall(require, 'completion') -if has_completion_nvim then - local CompletionNvim = {} - vim.cmd[[set iskeyword+=:,#,+]] - CompletionNvim.item = function(prefix) - local items = Autocompletion.omni(0, prefix) - for _, item in pairs(items) do - item.dup = 0 - end - - return items - end - completion_nvim.addCompletionSource('orgmode', CompletionNvim) -end - return Autocompletion