compiler go noremap :silent make redraw let g:ale_linters = { \ 'go': ['gopls'], \} " let g:ale_completion_enabled = 1 " Map ee to insert Go error handling if condition nnoremap ee :call InsertGoErrorHandling() function! InsertGoErrorHandling() let err_handling = "if err != nil { \r return err \r}" let save_cursor = getpos(".") execute "normal! a" . err_handling normal! jjj$ normal! $o startinsert endfunction