J Travis Lindsey
2016-Jul-06 19:27 UTC
[libvirt-users] Permanently change default virsh editor
Hello, I found in the docs that I can change the editor I use on a per vm bases with the following: *EDITOR=$your-favorite-editor virsh edit $your-vm-name* But how do I change it permanently so when I run: *virsh edit $your-vm-name* It defaults to my favorite editor (vim)? Ref: http://wiki.libvirt.org/page/FAQ
Cole Robinson
2016-Jul-06 19:31 UTC
Re: [libvirt-users] Permanently change default virsh editor
On 07/06/2016 03:27 PM, J Travis Lindsey wrote:> Hello, I found in the docs that I can change the editor I use on a per vm > bases with the following: > *EDITOR=$your-favorite-editor virsh edit $your-vm-name* > > But how do I change it permanently so when I run: > *virsh edit $your-vm-name* > > It defaults to my favorite editor (vim)?EDITOR is just a shell environment variable, so if you're using bash shell drop something like export EDITOR=your-favorite-editor in ~/.bashrc, and it will be set for all future shell sessions - Cole
J Travis Lindsey
2016-Jul-06 19:40 UTC
Re: [libvirt-users] Permanently change default virsh editor
Awesome. Thank you that worked great. On Wed, Jul 6, 2016 at 3:31 PM, Cole Robinson <crobinso@redhat.com> wrote:> On 07/06/2016 03:27 PM, J Travis Lindsey wrote: > > Hello, I found in the docs that I can change the editor I use on a per vm > > bases with the following: > > *EDITOR=$your-favorite-editor virsh edit $your-vm-name* > > > > But how do I change it permanently so when I run: > > *virsh edit $your-vm-name* > > > > It defaults to my favorite editor (vim)? > > EDITOR is just a shell environment variable, so if you're using bash shell > drop something like > > export EDITOR=your-favorite-editor > > in ~/.bashrc, and it will be set for all future shell sessions > > - Cole > >
Michal Privoznik
2016-Jul-07 09:46 UTC
Re: [libvirt-users] Permanently change default virsh editor
On 06.07.2016 21:27, J Travis Lindsey wrote:> Hello, I found in the docs that I can change the editor I use on a per vm > bases with the following: > *EDITOR=$your-favorite-editor virsh edit $your-vm-name* > > But how do I change it permanently so when I run: > *virsh edit $your-vm-name* > > It defaults to my favorite editor (vim)?This is distribution dependent. For instance, I'm unaware of any system-wide approach in Fedora (except for what Cole suggested, which will work everywhere). But for instance in gentoo you can: # eselect editor set vi Michal
Roland Everaert
2016-Jul-07 09:56 UTC
Re: [libvirt-users] Permanently change default virsh editor
Normally, you can set environment variables in .bashrc or .bash_profile and if I am not mistaken in /etc, there is alos a bashrc file that is system-wide, maybehave a look at it. After changing one of those file execute the following command to update your current console configuration source <path/to/file> exemple: source ~/.bashrc Regards, Roland. On Thu, Jul 7, 2016 at 11:46 AM, Michal Privoznik <mprivozn@redhat.com> wrote:> On 06.07.2016 21:27, J Travis Lindsey wrote: > > Hello, I found in the docs that I can change the editor I use on a per vm > > bases with the following: > > *EDITOR=$your-favorite-editor virsh edit $your-vm-name* > > > > But how do I change it permanently so when I run: > > *virsh edit $your-vm-name* > > > > It defaults to my favorite editor (vim)? > > This is distribution dependent. For instance, I'm unaware of any > system-wide approach in Fedora (except for what Cole suggested, which > will work everywhere). But for instance in gentoo you can: > > # eselect editor set vi > > Michal > > _______________________________________________ > libvirt-users mailing list > libvirt-users@redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users >