Skip to content

Commit

Permalink
Add ClapOnInitialize hook (#653)
Browse files Browse the repository at this point in the history
* Add ClapOnInitialize hook

Close #139

* Update doc
  • Loading branch information
liuchengxu authored Mar 11, 2021
1 parent c558950 commit 67787f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Added

- Add user autocmd `ClapOnInitialize`, can be used to ignore some buffers when opening clap. #653
- Add `g:clap_provider_colors_ignore_default` to ignore the default colors in `VIMRUNTIME`. #632
- Support neovim floating_win based action menu. #655

Expand Down
2 changes: 2 additions & 0 deletions autoload/clap.vim
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ function! clap#for(provider_id_or_alias) abort

call clap#selection#init()

silent doautocmd <nomodeline> User ClapOnInitialize

" This flag is used to slience the autocmd events for NeoVim, e.g., on_typed.
" Vim doesn't have these issues as it uses noautocmd in most cases.
"
Expand Down
7 changes: 7 additions & 0 deletions doc/clap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,13 @@ g:clap.display *g:clap.display*
the buffer number specified to the display buffer.


ClapOnInitialize *ClapOnInitialize-autocmd*
*ClapOnInitialize*

This |User| autocommand is triggered after the initialization is done.
Useful for not opening clap window in some special buffers like nerdtree.


ClapOnEnter *ClapOnEnter-autocmd*
*ClapOnEnter*

Expand Down

0 comments on commit 67787f4

Please sign in to comment.