mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
Added nano plugin
This commit is contained in:
parent
df0305aba5
commit
a990c4ff76
1 changed files with 14 additions and 0 deletions
14
plugins/nano/nano.plugin.zsh
Normal file
14
plugins/nano/nano.plugin.zsh
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
# Nano
|
||||
# Sudo nano if files are not writeable for current user
|
||||
|
||||
alias nano='nano'
|
||||
|
||||
function nano () {
|
||||
if [[ (-G $1) || (-O $1) ]]
|
||||
then
|
||||
nano $1
|
||||
else
|
||||
sudo nano $1
|
||||
fi
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue