Page 1 of 1

nanorc

Posted: Wed Aug 28, 2013 2:18 pm
by machinebacon
nano is better than no nano - especially if you place a customized .nanorc into your home directory.

Code: Select all

# get one line moar!
set morespace
# one tab is 4 spaces
set tabsize 4
# bold
set boldtext
# walk don't run
set smooth
# what is a comment?
syntax "comments" ".*"
# what calah shall it be?
color cyan "^#.*"
# indent cleverly?
set autoindent
# backup file creation
set backup
# actually useless: clear the statusbar after single keystroke
set quickblank
# wrap long lines softly with this song
set softwrap
# pressing home key jumps to line beginning 
set smarthome
# Apple ispell ;)
set speller ispell

## inlcudes from the default
## Nanorc files
include "/usr/share/nano/nanorc.nanorc"
## C/C++
include "/usr/share/nano/c.nanorc"
## HTML
include "/usr/share/nano/html.nanorc"
## TeX
include "/usr/share/nano/tex.nanorc"
## Quoted emails (under e.g. mutt)
include "/usr/share/nano/mutt.nanorc"
## Patch files
include "/usr/share/nano/patch.nanorc"
## Manpages
include "/usr/share/nano/man.nanorc"
## Groff
include "/usr/share/nano/groff.nanorc"
## Perl
include "/usr/share/nano/perl.nanorc"
## Python
include "/usr/share/nano/python.nanorc"
## Ruby
include "/usr/share/nano/ruby.nanorc"
## Java
include "/usr/share/nano/java.nanorc"
## Assembler
include "/usr/share/nano/asm.nanorc"
## Bourne shell scripts
include "/usr/share/nano/sh.nanorc"
## POV-Ray
include "/usr/share/nano/pov.nanorc"
see also the manpage or http://www.nano-editor.org/dist/v2.1/nanorc.5.html

Re: nanorc

Posted: Wed Aug 28, 2013 5:54 pm
by DebianJoe
Thanks for sharing. As I've been playing with nano recently, I've found that it can be pretty sweet with a bit of work. It's not vim or emacs, but also it's NOT emacs or vim. It's light and snappy, and auto-highlights whitespace at the end of lines, which is awesome.

Re: nanorc

Posted: Sat Aug 31, 2013 3:29 pm
by gutterslob
In case you need more .nanorc themes; https://github.com/craigbarnes/nanorc

Never tried them personally (I hardly use nano), but I'm impressed the dude has taken the time to create that many. You have lisp.nanorc which I think the default nano install doesn't provide in /usr/share/nano, though I suppose lispers wouldn't be caught dead using anything other than emacs. Then you have themes for newer languages, like go.nanorc. There's even a mpdconf.nanorc. WTF?!

Re: nanorc

Posted: Sat Aug 31, 2013 7:54 pm
by DebianJoe
Nano doesn't match parenthetical statements...thus would be insane to write lisp with, for example...a short scheme statement to create a function that handles matrix scalar multiplication:

Code: Select all

(define mul
  (lambda (x y)
    ;; mat-sca-mul multiplies a matrix by a scalar.
    (define mat-sca-mul
       (lambda (m x)
          (let* ((nr (matrix-rows m))
                 (nc (matrix-columns m))
                 (r  (make-matrix nr nc)))
             (do ((i 0 (+ i 1)))
                 ((= i nr) r)
                 (do ((j 0 (+ j 1)))
                     ((= j nc))
                     (matrix-set! r i j
                        (* x (matrix-ref m i j)))))))) 
Nano should be nano, which edits little text files well. I don't think I'd use it for lisp...but I may give it a shot just to see how that works out.

Re: nanorc

Posted: Sat Nov 12, 2016 11:33 pm
by machinebacon
To get rid of the inverted buttons in the menu...

Code: Select all

## Paint the interface elements of nano.
## These are examples; by default there are no colors.
set titlecolor brightwhite,blue
set numbercolor cyan
set statuscolor blue
set keycolor blue
set functioncolor yellow

Re: nanorc

Posted: Sun Nov 13, 2016 10:16 am
by noo_b_nomnoms
I use nano almost exclusively because I find it pretty easy to work with. I don't use emacs or vim (still a long way out from figuring what emacs even is, lols).
With most of the config files I work on it tends to be just right for me :)
I might take this little config around the block a few times!
Thanks!