git - 在 git commit 期间固定光标位置
问题描述
我一直在用xed
写我的提交信息。
xed
记住每个文件的最后一个光标位置。由于.git/COMMIT_EDITMSG
每个提交消息都会重用该文件,xed
因此在我提交上一次提交时,光标会在我所在的位置打开。必须手动将光标重新定位回第一行是一个 PITA。
[X]:我希望光标在哪里。
[Y]:光标所在位置。
[X]
# Please enter the commit [Y] message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch develop
# Your branch is up to date with 'origin/develop'.
#
解决方案
可以告诉xed
在某一行打开。在.gitconfig
中,只需替换
[core]
editor = xed
经过
[core]
editor = xed +1
xed +lineNumber
告诉xed
在该行打开文件lineNumber
。
+1
告诉它在第一行打开文件。
推荐阅读
- java - other_user_id 参数在执行时不起作用我不知道为什么
- python - 如何删除具有功能的行?
- c - va_list 总是静态的吗?
- azure - 用于 GetKey 的 Azure KeyVaultClient 机密
- reactjs - 如果在反应单元测试中的返回语句中未采用路径
- laravel - 使用 Laravel 日志文件进行调试
- android - 如何为每个页面加载颤动在 Web 视图中实现进度指示器?
- html - 什么 VSCode 语言配置设置允许 HTML 在输入时在标签中添加额外的行?
- android - React Native 发布崩溃
- angular - 是否可以在 Angular 中覆盖(单击)自定义组件的绑定信息?