Skip to content

Commit

Permalink
feat: Add omni completion
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidz committed Nov 1, 2024
1 parent b9d60aa commit 14527e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions autoload/elin/complete.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function! elin#complete#omni(findstart, base) abort
if a:findstart
let line = getline('.')
let ncol = col('.')
let s = line[0:ncol-2]
return ncol - strlen(matchstr(s, '\k\+$')) - 1
else
return elin#request('elin.handler.complete/complete', [a:base])
endif
endfunction
1 change: 1 addition & 0 deletions plugin/elin.vim
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function! s:init() abort

aug elin_autocmd_group
au!
au FileType clojure setl omnifunc=elin#complete#omni
au BufEnter *.clj,*.cljs,*.cljc,*.cljd call elin#intercept_notify('BufEnter')
au BufNewFile *.clj,*.cljs,*.cljc,*.cljd call elin#intercept_notify('BufNewFile')
au BufRead *.clj,*.cljs,*.cljc,*.cljd call elin#intercept_notify('BufRead')
Expand Down

0 comments on commit 14527e9

Please sign in to comment.