Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] can't change pacman.conf in nano (Read 1011 times) previous topic - next topic
0 Members and 5 Guests are viewing this topic.

[SOLVED] can't change pacman.conf in nano

Hi is there a special way to edit config files in artix?
I can't save any files because the usual keyboard shortcuts aren't working

Re: can't change pacman.conf in nano

Reply #1
There's no special way. You can just pick whatever text editor is your favorite. I have no idea what "the usual keyboard shorcuts aren't working" means, but you could try vim or something I guess.

Re: can't change pacman.conf in nano

Reply #2
you could try vim or something I guess.
If by "usual" the OP means close to Apple's shortcuts adopted in slightly modified form by Microsoft, or IBM CUA shortcut keys, or WordStar keys, he should try nano or joe (TUI), or kwrite or gedit (GUI).

vi is included by default on installation media, so it doesn't require installing (non-base install) like other listed editors might.

Re: can't change pacman.conf in nano

Reply #3
Hi is there a special way to edit config files in artix?
I can't save any files because the usual keyboard shortcuts aren't working
Nano has its own set of keyboard shortcuts. There is no problem in using these, most commonly used shortcuts are listed in the bottom of the screen, and you can access inline help by pressing Ctrl-G.

The only thing you must consider is that Nano uses terminal-specific shortenings for key combinations. E.g. '^' stands for 'Ctrl-' and 'M-' stands for 'Alt-'.

Re: can't change pacman.conf in nano

Reply #4
If you want to set a default editor, for user(s) add "export EDITOR=vim" for example, in your shell config or you can do it in /etc/profile.d/editor.sh for system wide

Re: can't change pacman.conf in nano

Reply #5
thanks for the responses. for example control plus x should close the file but nothing happens. will setung the default editor solve that?

Re: can't change pacman.conf in nano

Reply #6
thanks for the responses. for example control plus x should close the file but nothing happens. will setung the default editor solve that?
Read carefully what the editor tells you in the bottom of the screen. There is info area and prompt line out there. It seems that you are trying to close the editor while changes you made to the file are still not saved, so it prompts you whether you want to save, discard or cancel exiting.

E.g. Ctrl-O will save the changes, and the editor prompts you to enter the file name. You may just press enter to save the changes into the existing file, or type in another name (same as 'Save as...' option in GUI editors).

And yeah, if you are running Artix in VirtualBox, you must use left Ctrl, because right Ctrl is used as a 'host' key in VirtualBox by default.

Re: can't change pacman.conf in nano

Reply #7
thanks for the responses. for example control plus x should close the file but nothing happens. will setung the default editor solve that?
You can't edit files you don't have write access to. You should read up on file permissions and ownership in GNU/Linux.

For system configuration files such as /etc/pacman.conf, you need to open root shell or use sudo or doas:
Code: [Select]
$ su
# nano /etc/pacman.conf
or
Code: [Select]
$ sudo nano /etc/pacman.conf
or
Code: [Select]
$ doas nano /etc/pacman.conf

Re: can't change pacman.conf in nano

Reply #8
it was my keyboard.