简体   繁体   English

如何将当前的 tig 选项保存到文件中

[英]How can I save the current tig options into a file

I've made several modifications manually in tig, and I want to store them.我在 tig 中手动进行了一些修改,我想存储它们。

How can I save the current set of changed tig options into a file (the ones, that I can toggle using the (o) key in tig) ?如何将当前更改的 tig 选项集保存到文件中(我可以使用 tig 中的 (o) 键切换的文件)?

(I know about .tigrc, so if there is a way to force tig to dump the current settings into its .tigrc file, I guess it will suffice ...) (我知道 .tigrc,所以如果有办法强制 tig 将当前设置转储到其 .tigrc 文件中,我想这就足够了......)

As of version 2.1 of tig this can now be done from within tig by typing : to get into the command mode and then save-options <filename> . tig 2.1版开始,现在可以在tig内输入:命令来完成此操作:进入命令模式,然后save-options <filename>

All options are then dumped to the named file regardless of their state in any of the configuration files. 然后,所有选项都将转储到命名文件中,而不管它们在任何配置文件中的状态如何。

With Tig 2.5.4, the :save-options runtime command saves to "tig-options.txt" in current directory by default在 Tig 2.5.4 中, :save-options运行时命令默认保存到当前目录中的“tig-options.txt”

Its up to you to mv tig-options.txt ~/.tigrc to implement those new options as new global default由您决定mv tig-options.txt ~/.tigrc将这些新选项实现为新的全局默认值

I did run into an error我确实遇到了错误

  tig
tig warning: ~/.tigrc:26: Value must be between 0 and 1024
tig warning: Errors while loading /c/Users/user/.tigrc.

There was some random option (forget name) that was -50, which caused validation failure.有一些随机选项(忘记名称)为 -50,导致验证失败。 I had to remove that part manually.我不得不手动删除该部分。

set main-view = line-number:no,interval=5 id:yes,color=no date:relative-compact,local=no,format= author:abbreviated commit-title:yes,graph=v2,refs=yes,xyz=-50

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM