1 |
on 05/02/2011 01:05 PM Mick wrote the following: |
2 |
> Another thing I found, is some incongruity about the file in which the $EDITOR |
3 |
> and $PAGER should be defined. |
4 |
> |
5 |
> The migration guide says: |
6 |
> |
7 |
> "The EDITOR variable is no longer found in /etc/rc.conf. Both EDITOR and PAGER |
8 |
> are set by default in /etc/profile. You should change this as needed in your |
9 |
> ~/.bashrc (or equivalent) file or create */etc/env.d/99editor* and set the |
10 |
> system default there." |
11 |
> |
12 |
> On the other hand the /etc/profile file seems to recommend /etc/profile.d/ |
13 |
> |
14 |
> "# You should override these in your ~/.bashrc (or equivalent) for per-user |
15 |
> # settings. For system defaults, you can add a new file in /etc/profile.d/. |
16 |
> export EDITOR=${EDITOR:-/bin/nano} |
17 |
> export PAGER=${PAGER:-/usr/bin/less}" |
18 |
> |
19 |
> Which one is the authoritative place to define a system wide editor? |
20 |
All above are consistent. The system default is set in a file like |
21 |
/etc/env.d/99editor |
22 |
I use eselect (app-admin/eselect) to set the system defaults. |
23 |
eg I have: |
24 |
# cat /etc/env.d/99editor |
25 |
# Configuration file for eselect |
26 |
# This file has been automatically generated. |
27 |
EDITOR="/usr/bin/vi" |
28 |
VISUAL="/usr/bin/vi" |
29 |
|
30 |
But on a per user basis, a user should define those environment |
31 |
variables in his ~/.bashrc or ~/.bash_profile (or equivalent) shell |
32 |
initialization files. |