Merge pull request #7 from mortang2410/master

Added alternative variable "g:bclose_no_plugin_maps" to disable mapping
This commit is contained in:
Rasmus Bang Grouleff 2018-10-10 16:40:06 +02:00 committed by GitHub
commit 99018b4a2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -8,7 +8,7 @@ The reason for adding it here is to be able to add it to an existing Janus bundl
## Bindings
BClose binds `<Leader>bd` to `:Bclose` unless `g:no_plugin_maps` exists and is `true`.
BClose binds `<Leader>bd` to `:Bclose` unless `g:bclose_no_plugin_maps` or `g:no_plugin_maps` is set to `true`.
## Contributing

View File

@ -70,6 +70,11 @@ function! s:Bclose(bang, buffer)
execute wcurrent.'wincmd w'
endfunction
command! -bang -complete=buffer -nargs=? Bclose call <SID>Bclose('<bang>', '<args>')
if !exists ("g:no_plugin_maps") || !g:no_plugin_maps
nnoremap <silent> <Leader>bd :Bclose<CR>
if exists ("g:bclose_no_plugin_maps") && g:bclose_no_plugin_maps
"do nothing
elseif exists ("g:no_plugin_maps") && g:no_plugin_maps
"do nothing
else
nnoremap <silent> <Leader>bd :Bclose<CR>
endif