Outils pour utilisateurs

Outils du site


operating-system:linux:nano

L'éditeur de texte GNU nano

Configuration de base

Pour tous les utilisateurs → Modifier le fichier nanorc : nano /etc/nanorc

Pour un utilisateur unique → Créer/Modifier le fichier nanorc : nano /home/$user/.nanorc

Décommenter les lignes ci-dessous :

set autoindent
set backup
set linenumbers
set mouse ## Si non fonctionnel, installer le paquet "gpm"
set nonewlines
set smarthome
set suspend
set tabsize 4
set titlecolor brightwhite,blue
set statuscolor brightwhite,green
set errorcolor brightwhite,red
set selectedcolor brightwhite,magenta
set numbercolor cyan
set keycolor cyan
set functioncolor green

Inclure ensuite les lignes ci-dessous :

include "/usr/share/nano/asm.nanorc"
include "/usr/share/nano/autoconf.nanorc"
include "/usr/share/nano/awk.nanorc"
include "/usr/share/nano/changelog.nanorc"
include "/usr/share/nano/cmake.nanorc"
include "/usr/share/nano/c.nanorc"
include "/usr/share/nano/css.nanorc"
include "/usr/share/nano/debian.nanorc"
include "/usr/share/nano/default.nanorc"
include "/usr/share/nano/elisp.nanorc"
include "/usr/share/nano/fortran.nanorc"
include "/usr/share/nano/gentoo.nanorc"
include "/usr/share/nano/go.nanorc"
include "/usr/share/nano/groff.nanorc"
include "/usr/share/nano/guile.nanorc"
include "/usr/share/nano/html.nanorc"
include "/usr/share/nano/java.nanorc"
include "/usr/share/nano/javascript.nanorc"
include "/usr/share/nano/json.nanorc"
include "/usr/share/nano/lua.nanorc"
include "/usr/share/nano/makefile.nanorc"
include "/usr/share/nano/man.nanorc"
include "/usr/share/nano/markdown.nanorc" 
include "/usr/share/nano/mgp.nanorc"
include "/usr/share/nano/mutt.nanorc"
include "/usr/share/nano/nanohelp.nanorc"
include "/usr/share/nano/nanorc.nanorc"
include "/usr/share/nano/nftables.nanorc"
include "/usr/share/nano/objc.nanorc"
include "/usr/share/nano/ocaml.nanorc"
include "/usr/share/nano/patch.nanorc"
include "/usr/share/nano/perl.nanorc"
include "/usr/share/nano/php.nanorc"
include "/usr/share/nano/po.nanorc"
include "/usr/share/nano/postgresql.nanorc"
include "/usr/share/nano/pov.nanorc"
include "/usr/share/nano/python.nanorc"
include "/usr/share/nano/ruby.nanorc"
include "/usr/share/nano/rust.nanorc"
include "/usr/share/nano/sh.nanorc"
include "/usr/share/nano/spec.nanorc"
include "/usr/share/nano/tcl.nanorc"
include "/usr/share/nano/tex.nanorc"
include "/usr/share/nano/texinfo.nanorc"
include "/usr/share/nano/xml.nanorc"

Créer un fichier “markdown.nanorc” dans : /usr/share/nano

markdown.nanorc
Markdown synthaxe (markdown.nanorc) :
 
syntax "Markdown" "\.(md|mkd|mkdn|markdown)$"
 
# Tables (Github extension)
color cyan ".*[ :]\|[ :].*"
 
# quotes
color brightblack  start="^>" end="^$"
color brightblack  "^>.*"
 
# Emphasis
color green "(^|[[:space:]])(_[^ ][^_]*_|\*[^ ][^*]*\*)"
 
# Strong emphasis
color brightgreen "(^|[[:space:]])(__[^ ][^_]*__|\*\*[^ ][^*]*\*\*)"
 
# strike-through
color red "(^|[[:space:]])~~[^ ][^~]*~~"
 
# horizontal rules
color brightmagenta "^(---+|===+|___+|\*\*\*+)\s*$"
 
# headlines
color brightmagenta  "^#{1,6}.*"
 
# lists
color blue   "^[[:space:]]*[\*+-] |^[[:space:]]*[0-9]+\. "
 
# leading whitespace
color black    "^[[:space:]]+"
 
# misc
color magenta   "\(([CcRr]|[Tt][Mm])\)" "\.{3}" "(^|[[:space:]])\-\-($|[[:space:]])"
 
# links
color brightblue "\[[^]]+\]"
color brightblue "\[([^][]|\[[^]]*\])*\]\([^)]+\)"
 
# images
color magenta "!\[[^][]*\](\([^)]+\)|\[[^]]+\])"
 
# urls
color brightyellow "https?://[^ )>]+"
 
# code
color yellow   "`[^`]*`|^ {4}[^-+*].*"
# code blocks
color yellow start="^```[^$]" end="^```$"
color yellow "^```$"
 
## Trailing spaces
color ,green "[[:space:]]+$"
operating-system/linux/nano.txt · Dernière modification : 2022/01/10 17:22 de m1k3