diff --git a/plugin/ucmake.vim b/plugin/ucmake.vim index 9bc149d..76a65a7 100644 --- a/plugin/ucmake.vim +++ b/plugin/ucmake.vim @@ -46,6 +46,8 @@ if !exists("g:ucmake_cache_entries") let g:ucmake_cache_entries = {} endif +let g:ucmake_disabled = get(g:, 'ucmake_disabled', 0) + function! s:shellslash(path) abort if &shell =~? 'cmd' || exists('+shellslash') && !&shellslash return tr(a:path, '\', '/') @@ -71,6 +73,9 @@ function! s:apply_buffer_macro(string) abort endfunction function! s:setup(path) abort + if g:ucmake_disabled + return + endif let path = s:shellslash(a:path) if isdirectory(path) let path = fnamemodify(path, ':p:s?/$??') @@ -142,3 +147,5 @@ augroup ucmake " autocmd CmdWinEnter * call s:setup(expand('#:p')) augroup END +command! UCmakeToggleDisabled :let g:ucmake_disabled=!g:ucmake_disabled +