nnn.1 | 1 + plugins/README.md | 1 + plugins/suedit | 4 ++-- diff --git a/nnn.1 b/nnn.1 index f5b50185e4aba9eb972373a44c014582f79faf20..0c595cd998d1c1298113ac047c3be9cc7674b0ed 100644 --- a/nnn.1 +++ b/nnn.1 @@ -414,6 +414,7 @@ EXAMPLES: ----------------------------------- + ------------------------------------------------- Key:Command | Description ----------------------------------- + ------------------------------------------------- + e:-!sudo -E vim $nnn* | Edit file as root in vim g:-!git diff | Show git diff h:-!hx $nnn* | Open hovered file in hx hex editor k:-!fuser -kiv $nnn* | Interactively kill process(es) using hovered file diff --git a/plugins/README.md b/plugins/README.md index 0acef1d7f826a70c7fe6b222a2d179694f6cc9db..715cd4e427090c7a4333efbe1cbf9bed4c3c979c 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -170,6 +170,7 @@ #### Some useful key-command examples | Key:Command | Description | |---|---| +| `e:-!sudo -E vim $nnn*` | Edit file as root in vim | | `g:-!git diff` | Show git diff | | `h:-!hx $nnn*` | Open hovered file in [hx](https://github.com/krpors/hx) hex editor | | `k:-!fuser -kiv $nnn*` | Interactively kill process(es) using hovered file | diff --git a/plugins/suedit b/plugins/suedit index e0fdfb5d6633005653c7c63cae8af7d0a045c52e..21dddf4810dc1dafe11f24cc9f3cb2fc718f77fe 100755 --- a/plugins/suedit +++ b/plugins/suedit @@ -8,9 +8,9 @@ EDITOR="${EDITOR:-vim}" if type sudo >/dev/null 2>&1; then - sudo "$EDITOR" "$1" + sudo -E "$EDITOR" "$1" elif type sudoedit >/dev/null 2>&1; then - sudoedit "$1" + sudoedit -E "$1" elif type doas >/dev/null 2>&1; then doas "$EDITOR" "$1" fi