Skip to content

Instantly share code, notes, and snippets.

@ilyabrin
Created March 27, 2021 19:57
Show Gist options
  • Save ilyabrin/5978cada6a69cddbdc18bf923b2acdd0 to your computer and use it in GitHub Desktop.
Save ilyabrin/5978cada6a69cddbdc18bf923b2acdd0 to your computer and use it in GitHub Desktop.
MacOS nano editor syntax highlighting

1. Install

brew install nano

2. Add alias to ~/.bashrc or ./zshrc

alias nano='/usr/local/bin/nano'

3. Apply changes

source ./zshrc

4. Add config for nano

Open/create nano ~/.nanorc and add some settings

set tabsize 4
set tabstospaces
set autoindent
set trimblanks
set linenumbers
set constantshow
set titlecolor white,red
set keycolor cyan
set functioncolor cyan
set numbercolor yellow
set mouse
include /usr/local/share/nano/*.nanorc

5. Profit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment