nanorc

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

nanorc

Unread post by machinebacon » Wed Aug 28, 2013 2:18 pm

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
..gnutella..

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: nanorc

Unread post by DebianJoe » Wed Aug 28, 2013 5:54 pm

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.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
gutterslob
Resident Tranny
Posts: 1124
Joined: Thu Aug 08, 2013 7:13 pm

Re: nanorc

Unread post by gutterslob » Sat Aug 31, 2013 3:29 pm

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?!

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: nanorc

Unread post by DebianJoe » Sat Aug 31, 2013 7:54 pm

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.
Last edited by DebianJoe on Sat Aug 31, 2013 7:58 pm, edited 1 time in total.
Reason: removed a ")" just to mess with anyone reading this.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: nanorc

Unread post by machinebacon » Sat Nov 12, 2016 11:33 pm

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
..gnutella..

User avatar
noo_b_nomnoms
MILF
Posts: 522
Joined: Sat Jan 09, 2016 5:13 pm
Location: USA

Re: nanorc

Unread post by noo_b_nomnoms » Sun Nov 13, 2016 10:16 am

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!
Sir! Put down the hammer and slowly step away from the computer.

Post Reply