vim 编辑 python代码 为什么会回到开头

会自动回到第一行第一个字
2025-05-09 05:50:02
推荐回答(3个)
回答1:

vim /etc/vimrc
不要去看有没有这个文件
在里面写:
function HeaderPython()
call setline(1, "#!/usr/bin/env python")
call append(1, "#-*- coding:utf8 -*-")
normal G
normal o
normal o
endf
autocmd bufnewfile *.py call HeaderPython()

回答2:

……你先确定是不是insert模式

回答3:

有没有先按i或a?