vim - 输入 :make 后恢复光标位置
问题描述
我.vimrc
在重新打开文件后使用以下内容来恢复光标位置:
" Copied from defaults.vim
" Put these in an autocmd group, so that you can revert them with:
" ":augroup vimStartup | au! | augroup END"
augroup vimStartup
au!
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid, when inside an event handler
" (happens when dropping a file on gvim) and for a commit message (it's
" likely a different one than last time).
autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
\ | exe "normal! g`\""
\ | endif
augroup END
问题是当我输入时:make
,光标位置没有恢复;光标仅出现在键入之前所在行的开头:make
。
您对如何解决此问题有任何建议吗?谢谢你的帮助。
解决方案
推荐阅读
- doxygen - Doxygen 重复文本
- node.js - 如何通过 https 请求从 Node 调用 Azure 客户端?
- django - django模板中列表中的列表
- zabbix - Zabbix 3.4 比特接收和发送
- dataframe - PySpark 中 Panda 的 value_counts() 相当于什么?
- firebase - 使用 BigQuery 获取 Firebase Analytics 历史数据
- webpack - nodemon 未重新启动 [同构 Web 应用程序]
- python - 如何使用 TensorFlow 正确创建估算器
- azure-sql-database - 使用 Java SDK 更新 Azure Sql 数据库标签
- c++ - c++递归类依赖