File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed
Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -187,8 +187,6 @@ export def DetectWorkspace()
187187 nnoremap <silent> gb <Plug> (bazel-goto-build)
188188 nnoremap <silent> b<C-G> <Plug> (bazel-print-rel)
189189 nnoremap <silent> <leader> p <Plug> (bazel-print-label)
190- autocmd FileType bzl nnoremap <silent> <buffer> gd <Plug> (bazel-definition)
191- autocmd FileType bzl nnoremap <silent> <buffer> gr <Plug> (bazel-references)
192190 endif
193191
194192 set errorformat ^= % t %* [^:]:\ % f :% l: % c :\ % m # recognize error type in " <TYPE>: <file><lnum>:<col>: <message>" form
Original file line number Diff line number Diff line change 1+ vim9script
2+
3+ if exists (" b:did_ftplugin" )
4+ finish
5+ endif
6+ b: did_ftplugin = 1
7+
8+ bazel#DetectWorkspace ()
9+
10+ if ! exists (' g:bazel_no_default_mappings' ) || ! g: bazel_no_default_mappings
11+ nnoremap <silent> <buffer> gd <Plug> (bazel-definition)
12+ nnoremap <silent> <buffer> gr <Plug> (bazel-references)
13+ endif
Original file line number Diff line number Diff line change @@ -13,6 +13,5 @@ import autoload 'bazel.vim'
1313
1414augroup Bazel
1515 autocmd !
16- autocmd FileType bzl if expand (' %:t' ) == ' BUILD' | bazel#DetectWorkspace () | endif
17- autocmd DirChanged * bazel#DetectWorkspace ()
16+ autocmd VimEnter ,BufEnter * bazel#DetectWorkspace ()
1817augroup END
You can’t perform that action at this time.
0 commit comments