1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-12-22 15:21:30 +01:00

vim: ale: add basic android dev configuration

This commit is contained in:
bretello 2023-09-14 23:06:56 +02:00
parent 90c870b91d
commit a0c5985009
Signed by: brethil
GPG Key ID: 876AAC6290170FE7
3 changed files with 60 additions and 0 deletions

View File

@ -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 = '<C-n>'

View File

@ -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'}

View File

@ -155,3 +155,8 @@ autocmd FileType python nnoremap T :Pytest function --pdb<CR>
" Ultisnips
map <Leader>ue :UltiSnipsEdit<cr>
nmap <F5> <ESC>:Gradle assembleDebug<CR>
nmap <F6> <ESC>:AndroidInstall debug<CR>
nmap <F7> <ESC>:AndroidLaunch debug<CR>