-
Notifications
You must be signed in to change notification settings - Fork 31
/
flutter.vim
41 lines (35 loc) · 1.35 KB
/
flutter.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
if exists('g:loaded_flutter')
finish
else
let g:loaded_flutter=1
endif
if !exists('g:flutter_command!')
let g:flutter_command='flutter'
endif
if !exists('g:flutter_hot_reload_on_save')
let g:flutter_hot_reload_on_save=1
endif
command! FlutterDevices call flutter#devices()
command! FlutterEmulators call flutter#emulators()
command! -nargs=1 FlutterEmulatorsLaunch call flutter#emulators_launch(<f-args>)
command! -nargs=* FlutterRun call flutter#run(<f-args>)
command! FlutterHotReload call flutter#hot_reload()
command! FlutterHotRestart call flutter#hot_restart()
command! FlutterQuit call flutter#quit()
command! FlutterVisualDebug call flutter#visual_debug()
if g:flutter_hot_reload_on_save
autocmd FileType dart autocmd BufWritePost <buffer> call flutter#hot_reload_quiet()
endif
command! FlutterSplit :split __Flutter_Output__
command! FlutterVSplit :vsplit __Flutter_Output__
command! FlutterTab :tabnew __Flutter_Output__
function! FlutterMenu() abort
menu Flutter.Run :FlutterRun<CR>
menu Flutter.Hot\ Reload :FlutterHotReload<CR>
menu Flutter.Hot\ Restart :FlutterHotRestart<CR>
menu Flutter.Open\ Output.In\ &Split :FlutterSplit<CR>
menu Flutter.Open\ Output.In\ &VSplit :FlutterVSplit<CR>
menu Flutter.Open\ Output.In\ &Tab :FlutterTab<CR>
menu Flutter.Quit :FlutterQuit<CR>
menu Flutter.View\ Devices :FlutterDevices<CR>
endfunction