lk/system/editors.md

25 lines
481 B
Markdown
Raw Normal View History

2022-01-16 18:20:39 +00:00
---
title: "$EDITOR"
2025-02-12 14:01:15 +00:00
tags: [ "system" ]
2022-01-16 18:20:39 +00:00
---
2022-01-26 22:35:07 +00:00
The System's default text editor can be defined within /etc/profile. It's given the variable `EDITOR`.
2020-01-02 17:44:54 +00:00
2025-02-12 14:01:15 +00:00
Add these lines to `/etc/profile.d/custom.sh`:
2020-01-02 17:44:54 +00:00
2025-02-12 14:01:15 +00:00
```sh
echo 'export EDITOR=vim' >> /etc/profile.d/custom.sh
echo 'export VISUAL=$EDITOR' >> /etc/profile.d/custom.sh
2020-01-02 17:44:54 +00:00
```
Then reload that profile with:
2025-02-12 14:01:15 +00:00
```sh
source /etc/profile
```
2020-01-02 17:44:54 +00:00
If you want to ensure `nano` never appears again:
2020-01-02 17:44:54 +00:00
2025-02-12 14:01:15 +00:00
```sh
sudo ln -sf $(which vim) $(which nano)
```