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 markM + 6: copyctrl + k: cutctrl + u: uncut (paste)M + u: undoM + 3: comment/uncommentcrtl + w: findM + 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