在终端中永久设置默认编辑器
我已使用此 接受的答案 在终端中设置我的编辑器。不幸的是,它只设置一个会话,这意味着每次我重新打开终端时,我都必须再次设置它。
我想设置一次,就再也不用设置了。请注意,我正在使用 GNU Nano。
谢谢!
I have used this accepted answer to set my editor in Terminal. Unfortunately it only sets for a single session which means every time I reopen Terminal I have to set it again.
I would like to set it once and never have to do it again. Just so you are aware, I'm using GNU Nano.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将命令放入您的
~/.bashrc
文件中。Put the command into your
~/.bashrc
file.我想,如果我错了,我会迅速而迂腐地纠正,但是;将其放入 ~/.profile 将由任何 shell 执行, ~/.bash_profile 将由 bash 执行
我通常只在 Mac 上编辑我的 .profile,或者在 Linux 上编辑我的 .bashrc...
根据我的理解,bashrc 和 bash_profile 之间的区别是,bashrc 会在新的交互式终端或启动 bash 时被调用...甚至从bash,并且 bash_profile 被调用用于登录终端......
I think, and I will be swiftly and pedantically corrected if I am wrong, but; putting that in your ~/.profile will be executed by any shell, ~/.bash_profile will be executed by bash
I generally only ever edit my .profile on Mac ,or my .bashrc on Linux...
From my understanding the difference between bashrc and bash_profile, is that the bashrc gets called for new interactive terminals or when you start bash... Even from bash, and bash_profile is called for login terminals...