Skip to content

Commit

Permalink
Remove custom implementation for completion-nvim and suggest using om…
Browse files Browse the repository at this point in the history
…ni mode.
  • Loading branch information
kristijanhusak committed Jun 29, 2021
1 parent 93b2df8 commit 0cb2a5a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 21 deletions.
4 changes: 2 additions & 2 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
},
}
```
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
},
}
```
Expand Down
4 changes: 2 additions & 2 deletions doc/orgmode.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
},
}
<
Expand Down
15 changes: 0 additions & 15 deletions lua/orgmode/org/autocompletion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0cb2a5a

Please sign in to comment.