diff --git a/ftplugin/scala.vim b/ftplugin/scala.vim index 2c0361a..38929da 100644 --- a/ftplugin/scala.vim +++ b/ftplugin/scala.vim @@ -31,6 +31,8 @@ setlocal includeexpr=substitute(v:fname,'\\.','/','g') setlocal path+=src/main/scala,src/test/scala setlocal suffixesadd=.scala +let b:undo_ftplugin = "setlocal fo< com< cms< sw< sts< et< inc< inex< pa< sua<" + compiler sbt if globpath(&rtp, 'plugin/fuf.vim') != '' @@ -143,10 +145,13 @@ if globpath(&rtp, 'plugin/fuf.vim') != '' " If you want to disable the default key mappings, write the following line in " your ~/.vimrc " let g:scala_use_default_keymappings = 0 - if get(g:, 'scala_use_default_keymappings', 1) + if !exists("no_plugin_maps") && !exists("no_scala_maps") && get(g:, 'scala_use_default_keymappings', 1) nnoremap ft :FufFile =scala#GetTestDirForFuzzyFinder('%:p:h') nnoremap fs :FufFile =scala#GetMainDirForFuzzyFinder('%:p:h') nnoremap fr :FufFile =scala#GetRootDirForFuzzyFinder('%:p:h') + let b:undo_ftplugin .= " | silent! execute 'nunmap ft'" . + \ " | silent! execute 'nunmap fs'" . + \ " | silent! execute 'nunmap fr'" endif endif @@ -170,7 +175,11 @@ function! s:NextSection(backwards) execute 'silent normal! ' . dir . '\v'.regex endfunction -noremap