diff --git a/vim/plugins_config.vim b/vim/plugins_config.vim index b85a2de..18abb11 100644 --- a/vim/plugins_config.vim +++ b/vim/plugins_config.vim @@ -55,6 +55,13 @@ let g:ale_linters = { \} let g:ale_linter_aliases = {'vue': ['vue', 'javascript']} + +" disable gradle signs/loclist as they conflict with ALE (vim-android) +let g:gradle_loclist_show = 0 +let g:gradle_show_signs = 0 + +let g:ale_java_eclipselsp_path = '~/git/eclipse.jdt.ls' + let g:ale_yaml_yamllint_options = '--config .editorconfig' let g:ale_open_list = 0 @@ -65,6 +72,13 @@ let g:ale_lint_on_enter = 1 " uncomment if you do not want to lint files on open let g:ale_lint_on_insert_leave = 0 let g:ale_lint_on_text_changed = 0 let g:ale_lint_delay = 2500 " lint 2.5 seconds after text has changed + +augroup androiddev + " avoid death by gradle + autocmd! FileType java,kotlin let g:ale_lint_on_insert_leave = 0 +augroup END + + let g:ale_fix_on_save = 1 let g:ale_completion_enabled = 1 " let g:ale_completion_autoimport = 1 @@ -161,6 +175,42 @@ let g:airline_section_x=' %{tagbar#currenttag("%s", "", "f")}' let g:airline#extensions#tagbar#flags = 's' let g:airline#extensions#tagbar#searchmethod = 'scoped-stl' +" only these functions will only be defined when lightline#gradle#... funtions +" are defined, which happens when vim-android is loaded +if exists('lightline#gradle#running') + call airline#parts#define_function( + \ 'gradle-running', + \ 'lightline#gradle#running' + \) + + call airline#parts#define_function( + \ 'gradle-errors', + \ 'lightline#gradle#errors' + \) + + call airline#parts#define_function( + \ 'gradle-warnings', + \ 'lightline#gradle#warnings' + \) + + call airline#parts#define_function( + \ 'gradle-project', + \ 'lightline#gradle#project' + \) + + let g:airline_section_x= airline#section#create_right([ + \ 'filetype', + \ 'gradle-running', + \ 'gradle-errors', + \ 'gradle-warnings' + \]) + let g:gradle_glyph_gradle = '' + let g:gradle_glyph_android = '' + let g:gradle_glyph_error = '' + let g:gradle_glyph_warning = '' + let g:gradle_glyph_building = '' +endif + " These are the default mappings for vim-multi-cursor let g:multi_cursor_start_word_key = '' diff --git a/vim/plugs.vim b/vim/plugs.vim index 3cbf263..c641e83 100644 --- a/vim/plugs.vim +++ b/vim/plugs.vim @@ -74,6 +74,11 @@ Plug 'https://github.com/leafoftree/vim-vue-plugin', {'for': 'vue'} Plug 'https://github.com/hashivim/vim-terraform', {'for': 'terraform'} Plug 'https://github.com/fatih/vim-go', {'for': 'go'} +if executable('adb') && executable('gradle') + Plug 'https://github.com/udalov/kotlin-vim', {'for': 'kotlin'} + Plug 'https://github.com/hsanson/vim-android', {'for': 'java'} +endif + " Plug 'epheien/termdbg' Plug 'https://github.com/alfredodeza/pytest.vim', {'for': 'python'} diff --git a/vim/shortcuts.vim b/vim/shortcuts.vim index d86250b..2d2b6af 100644 --- a/vim/shortcuts.vim +++ b/vim/shortcuts.vim @@ -155,3 +155,8 @@ autocmd FileType python nnoremap T :Pytest function --pdb " Ultisnips map ue :UltiSnipsEdit + + +nmap :Gradle assembleDebug +nmap :AndroidInstall debug +nmap :AndroidLaunch debug