macOS下的vim默认打开文件总时显示文件开头,而我们希望能够在vim能够记住上次编辑的位置。 编辑vim配置文件,`~/.vimrc`,添加如下配置: ``` " Uncomment the following to have Vim jump to the last position when " reopening a file au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ``` Loading... macOS下的vim默认打开文件总时显示文件开头,而我们希望能够在vim能够记住上次编辑的位置。 编辑vim配置文件,`~/.vimrc`,添加如下配置: ``` " Uncomment the following to have Vim jump to the last position when " reopening a file au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ``` 最后修改:2024 年 02 月 29 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 如果觉得我的文章对你有用,请随意赞赏