From adb93f97e43702251d48f30972acdd804b0fdef4 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 27 Oct 2021 15:26:56 +0300 Subject: nvim: buku omnifunc --- .config/nvim/autoload/bukutagcomplete.vim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .config/nvim/autoload/bukutagcomplete.vim (limited to '.config/nvim/autoload') diff --git a/.config/nvim/autoload/bukutagcomplete.vim b/.config/nvim/autoload/bukutagcomplete.vim new file mode 100644 index 0000000..3049905 --- /dev/null +++ b/.config/nvim/autoload/bukutagcomplete.vim @@ -0,0 +1,18 @@ +function! bukutagcomplete#Complete(findstart, base) + if a:findstart == 1 + let line = getline('.') + let idx = col('.') + while idx > 0 + let idx -= 1 + let c = line[idx] + if c == ':' || c == '>' + return idx + 2 + else + continue + endif + endwhile + return idx + else + return split(system('buku --stag --np | pcregrep -o1 " ([a-zA-Z ]+) (?=\()" | grep ' . a:base), '\n') + endif +endfunction -- cgit v1.2.3-70-g09d2