nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] Some useful .nanorc scripts


From: Trevor Lalish-Menagh
Subject: [Nano-devel] Some useful .nanorc scripts
Date: Wed, 08 Sep 2004 18:38:02 +0900
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Hi guys,

I just thought I would post a couple useful scripts I use to change my .nanorc settings on the fly:
----
#!/bin/ksh

# Make a backup in case we mess up
cp ~/.nanorc ~/.nanorcbackup

if [[ $(grep -c '^set nowrap' ~/.nanorc) != 0 ]] ; then
        sed s/"^set nowrap"/"\#set nowrap"/g ~/.nanorc >temp
  print WordWrap ON
else
        sed s/"\#set nowrap"/"set nowrap"/g ~/.nanorc >temp
  print WordWrap OFF
fi

mv temp ~/.nanorc
----
and
----
#!/bin/ksh

# Make a backup in case we mess up
cp ~/.nanorc ~/.nanorcbackup

if [[ $(grep -c '^set autoindent' ~/.nanorc) != 0 ]] ; then
        sed s/"^set autoindent"/"\#set autoindent"/g ~/.nanorc >temp
  print AutoIndent OFF
else
        sed s/"\#set autoindent"/"set autoindent"/g ~/.nanorc >temp
  print AutoIndent ON
fi

mv temp ~/.nanorc
----

(I've started the JA translation as well)

Yours,
trv




reply via email to

[Prev in Thread] Current Thread [Next in Thread]