~kiril/vimfiles

39c0030bcccd6fe15c88f27a9ba3f3188192d871 — Kiril Vladimirov 1 year, 1 day ago fd376d8
Install ALE again and use some of its LSP goodies
7 files changed, 27 insertions(+), 25 deletions(-)

M ftplugin/go.vim
M ftplugin/perl.vim
M ftplugin/python.vim
M plugs.vim
M startup/mappings.vim
M startup/plugins.vim
M vimrc
M ftplugin/go.vim => ftplugin/go.vim +6 -17
@@ 5,31 5,20 @@ setlocal shiftwidth=8
setlocal makeprg=go\ run\ %
setlocal listchars=tab:\ \ ,trail:.,extends:#,nbsp:.

let g:go_highlight_operators = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_build_constraints = 1
let g:go_fmt_autosave = 0
let g:ale_fix_on_save = 1
let g:go_def_mapping_enabled = 0

let g:go_highlight_format_strings = 1
let g:go_highlight_generate_tags = 1
let g:go_doc_balloon = 1
let g:go_doc_popup_window = 1

au FileType go nmap <Leader>K <Plug>(go-doc-vertical)
au FileType go nmap <Leader>S <Plug>(go-implements)
au FileType go nmap <Leader>i <Plug>(go-info)
au FileType go nmap <Leader>I :exe "GoImport ". expand('<cword>') <cr>
au FileType go nmap <Leader>I <Plug>(go-info)
au FileType go nmap <Leader>a <Plug>(go-alternate-edit)
au FileType go nmap <Leader>A <Plug>(go-alternate-vertical)
au FileType go nmap gD        <Plug>(go-def-vertical)
au FileType go nmap <Leader>B <Plug>(go-doc-browser)
au FileType go nmap gP        :GoDeclsDir<CR>

RunCommand !go run % <args>

let b:ale_linters =  ['gobuild', 'gofmt', 'govet']
let b:ale_linters =  ['gopls']
let b:ale_fixers =  ['goimports']

let g:tagbar_type_go = {
    \ 'ctagstype' : 'go',

M ftplugin/perl.vim => ftplugin/perl.vim +3 -0
@@ 12,3 12,6 @@ endfunction

noremap <silent><leader><c-a> :call <SID>PlanNumberFeed("\<C-a>")<cr>
noremap <silent><leader><c-x> :call <SID>PlanNumberFeed("\<C-x>")<cr>

let b:ale_linters =  ['perltidy']
let b:ale_fixers =  ['perltidy', 'trim_whitespace']

M ftplugin/python.vim => ftplugin/python.vim +2 -7
@@ 35,13 35,8 @@ let g:switch_custom_definitions =
    \   ['assertIsInstance', 'assertNotIsInstance'],
    \ ]

if executable('pyls')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pyls',
        \ 'cmd': {server_info->['pyls']},
        \ 'whitelist': ['python'],
        \ })
endif
let b:ale_linters =  ['flake8']
let b:ale_fixers =  ['black']

RunCommand     !python    % <args>
ConsoleCommand !python -i % <args>

M plugs.vim => plugs.vim +3 -0
@@ 111,6 111,9 @@ Plug 'teppey/popdef'
" interesting words highligting
Plug 'lfv89/vim-interestingwords'

" asynchonous lint, fix and LSP engine
Plug 'dense-analysis/ale'

""" filetypes

" git

M startup/mappings.vim => startup/mappings.vim +7 -0
@@ 133,3 133,10 @@ if exists('$WAYLAND_DISPLAY')
    nnoremap <leader>p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p
  endif
endif

" ALE
nmap <Leader>i <Plug>(ale_hover)
nmap <Leader>I <Plug>(ale_import)
nmap gd        <Plug>(ale_go_to_definition)
nmap gD        <Plug>(ale_go_to_definition_in_vsplit)
nmap <Leader>B <Plug>(ale_documentation)

M startup/plugins.vim => startup/plugins.vim +5 -0
@@ 86,3 86,8 @@ let g:vista_sidebar_width = 50

" interesting words
let g:interestingWordsRandomiseColors = 1

" ALE
let g:ale_completion_enabled = 0
set omnifunc=ale#completion#OmniFunc
let g:ale_floating_preview = 1

M vimrc => vimrc +1 -1
@@ 140,7 140,7 @@ endif

" Completion options
set completefunc=syntaxcomplete#Complete
set completeopt=longest,menuone,preview
set completeopt=longest,menuone

" Don't leave spaces between joined lines
set nojoinspaces