From 7c9b04778a88926e2349770a5e8e3e8c09221bc7 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 14 Dec 2019 17:20:53 +0100 Subject: Add descriptions to script functions --- plugin/nohai.vim | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugin') diff --git a/plugin/nohai.vim b/plugin/nohai.vim index a0dbbb2..3129ad0 100644 --- a/plugin/nohai.vim +++ b/plugin/nohai.vim @@ -1,20 +1,25 @@ +" Remaps in command mode to run `nohlsearch` after accepting the command. function! s:AddMapping() silent! cnoremap CRAndNohlsearch() endfunction +" Removes the Nohai cmap. function! s:RemoveMapping() silent! cunmap endfunction +" Deactivates the Nohai cmap and turns off the augroup. function! s:Deactivate() call s:RemoveMapping() call s:AutocmdOff() endfunction +" Expr mapping function that runs the `nohlsearch` command after pressing . function! s:CRAndNohlsearch() return "\:nohlsearch\" endfunction +" Turn on Nohai autocmds. function! s:AutocmdOn() augroup nohai autocmd! @@ -24,10 +29,13 @@ function! s:AutocmdOn() augroup END endfunction +" Removes the Nohai augroup. function! s:AutocmdOff() autocmd! nohai endfunction +" Expr mapping function that turns on Nohai and starts the search command +" specified by `command`, either '/' or '?'. function! s:Search(command) call s:AutocmdOn() -- cgit v1.2.3