From 79501cb239d7c6225baed6c81d76a0aa887f9b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Fl=C3=BCgge?= Date: Sat, 15 Jun 2024 16:10:50 +0200 Subject: [PATCH] Add documentation for Org Roam Select Include hint to disable completion. --- DOCS.org | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/DOCS.org b/DOCS.org index 0eaf380..2dd1e4b 100644 --- a/DOCS.org +++ b/DOCS.org @@ -1045,6 +1045,52 @@ - Press == to refresh the buffer. This can be handy if some information has changed in the database. +** Org Roam Select + + When within the select buffer, you can filter the list by typing. + - Press == to confirm the selection + - Press == to confirm the typed title if no selection is available + (e.g. when using [[#find-node][Find Node]]) + - Press == or == to select the next item in the list + - Press == or == to select the next item in the list + +*** Disable nvim-cmp completion in org-roam-select + + If you use buffer completions with + [nvim-cmp](https://github.com/hrsh7th/nvim-cmp), you might want to disable + them in the org-roam-select buffer. This can be done by implementing the + =enabled= function in nvim-cmp's options. + + The simplest implementation would be to look for the =nofile= buffer type + + #+begin_src lua + require('nvim-cmp').setup({ + enabled = function() + local buftype = vim.api.nvim_get_option_value("buftype", { buf = 0 }) + if buftype == "nofile" then -- or buftype == "nofile" then + return false + end + -- ... handling other conditions + end + }) + #+end_src + + If for some reason you don't want to disable completion for all =nofile= + buffers, you can also specifically identify the selection buffer by it's + name. + + #+begin_src lua + require('nvim-cmp').setup({ + enabled = function() + local bufname = vim.api.nvim_buf_get_name(0) + if bufname:match("org%-roam%-select$") ~= nil then + return false + end + -- ... + end + }) + #+end_src + * API ** Add Alias