Is there any way to enable code completion for Perl in vim?

前端 未结 8 932
情歌与酒
情歌与酒 2021-02-01 04:07

Surprisingly as you get good at vim, you can code even faster than standard IDEs such as Eclipse. But one thing I really miss is code completion, especially for long variable na

8条回答
  •  星月不相逢
    2021-02-01 04:58

    The .vimrc clip in one of the other answers is slightly wrong. To turn your tab key into an auto-complete key, use this code:

    inoremap  =InsertTabWrapper()
    
    function! InsertTabWrapper()
        let col = col('.') - 1
        if !col || getline('.')[col - 1] !~ '\k'
            return "\"
        else
            return "\"
        endif
    endfunction
    

    You can find this, and tons of other vim tricks in this thread at Perlmonks--which links to even more threads with lots more customizations.

提交回复
热议问题