How do I make Sublime Text 4 the default text editor
After installing Sublime Text 4 , write in the terminal
whereis subl
My result
/usr/bin/subl
Next
export EDITOR=/usr/bin/subl
update-alternatives --install /usr/bin/editor editor /usr/bin/subl 5
Next
select-editor
Select the desired number and press enter.
Start Sublime Text4 from the launcher as root
Enter as a normal user in the terminal
sudo subl
Enter your password
If you see an error
Username is not in the sudoers file. This incident will be reported
Next, open the file sudoers as root.
Since the sudoers file is read-only even for the root, it must be edited using the command visudo
visudo /etc/sudoers
And add this line to it
username ALL=(ALL) ALL
Where username is your username