Config

Szerkesszük vagy a ~/.nanorc, vagy a ~/.config/nano/nanorc konfigot.

# colors
set titlecolor brightwhite,cyan
set statuscolor brightwhite,green
set errorcolor brightwhite,red
set keycolor yellow
set functioncolor white
# preferences
set tabsize 4
set tabstospaces
set smarthome
# backup
set backup
set backupdir ~/.local/share/nano/
# includes
include ~/.config/nano/*.nanorc

Ugyanezt eljátszhatjuk a root-nál is (/root/.nanorc), ott használhatunk más színeket.

set titlecolor brightwhite,magenta
set statuscolor magenta,white
set errorcolor brightwhite,red
set keycolor brightmagenta
set functioncolor white
# stb...

Includes

Lehúzhatunk további szintaxiskiemeléseket:

$ URL=https://raw.githubusercontent.com/scopatz/nanorc/master
$ wget $URL/dotenv.nanorc -P ~/.config/nano/
$ wget $URL/fish.nanorc -P ~/.config/nano/
$ wget $URL/json.nanorc -P ~/.config/nano/
$ wget $URL/yaml.nanorc -P ~/.config/nano/

Billentyűkombók

A meta elvileg alt, gyakorlatilag egyes esetekben esc. Cheatsheet.

  • ctrl + 6: set mark
  • M + 6: copy
  • ctrl + k: cut
  • ctrl + u: uncut (paste)
  • M + u: undo
  • M + 3: comment/uncomment
  • crtl + w: find
  • M + w: find next

Argumentumok

  • -l: display line numbers
  • -q: display a “scrollbar”
  • -v: just view the file (read-only mode)
  • -x: don’t show the help lines at the bottom
$ nano -lqvx myfile.txt