diff options
author | Teddy Wing | 2019-12-14 17:20:53 +0100 |
---|---|---|
committer | Teddy Wing | 2019-12-14 17:25:45 +0100 |
commit | 7c9b04778a88926e2349770a5e8e3e8c09221bc7 (patch) | |
tree | 9918348b8638c4acace895389b62d06da6f2266e | |
parent | abbb118307779a07067427ccd611f71719da143b (diff) | |
download | vim-nohai-7c9b04778a88926e2349770a5e8e3e8c09221bc7.tar.bz2 |
Add descriptions to script functions
-rw-r--r-- | plugin/nohai.vim | 8 |
1 files changed, 8 insertions, 0 deletions
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 <CR> in command mode to run `nohlsearch` after accepting the command. function! s:AddMapping() silent! cnoremap <expr> <CR> <SID>CRAndNohlsearch() endfunction +" Removes the Nohai <CR> cmap. function! s:RemoveMapping() silent! cunmap <CR> endfunction +" Deactivates the Nohai <CR> 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 <CR>. function! s:CRAndNohlsearch() return "\<CR>:nohlsearch\<CR>" 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() |