|# Install Nano Editor (https://www.nano-editor.org) with syntax highlighting on the Mac|
|# Version 4.0 ("Thy Rope of Sands") released March 24th 2019|
|tar -xvf nano-4.0.tar.gz|
|mv nano-4.0 .nano|
|sudo make install|
|cat > "~/.nanorc" <<EOF|
|# Enable syntax highlighting in Nano|
More syntax highlighting options can be found here: https://github.com/scopatz/nanorc
You can create a folder called "syntax_improved" inside ~./nano/ and copy all .nanorc files there, then simply extend your .nanorc file to read these new definitions as well with:
Nice! (Updated: April/16/2019)
Just merged all of your solutions and tips on a single-updated script, also, it doesn't require wget nor brew to be used... Since I made it partially variable-oriented, on future nano versions we will be able to re-use this script...
Error in /Users/andreas/.nanorc on line 2: Error reading ~/.nano/syntax/*.nanorc: No such file or directory
Error in /Users/andreas/.nanorc on line 3: Error reading ~/.nano/syntax_improved/*.nanorc: No such file or directory
even though the directories and files are there.
I changed the order of the way the PATHs are loaded in
I also got error as @a3igner reported.
My prescription is set alias nano at
It's good to go.
Really nice script. made some fixes for macOS Catalina. works perfect with my setup
#!/usr/bin/env bash # Install nano editor https://www.nano-editor.org/dist/v4/nano-4.9.3.tar.xz Modified: 2020 May 23 VERSION="4.9.3" NANO_SHORT="nano-$VERSION" NANO_SRC="$NANO_SHORT.tar.xz" NANO_URL="https://www.nano-editor.org/dist/v4" NANO_EXTRA="https://github.com/scopatz/nanorc" cd ~/ wget $NANO_URL/$NANO_SRC tar -zxvf $NANO_SRC mv $NANO_SHORT .nano && cd .nano/ ./configure && make && sudo make install git clone --depth=1 $NANO_EXTRA syntax_improved cd ~/ && touch .nanorc echo "# Enable syntax highlighting in Nano\ninclude ~/.nano/syntax/*.nanorc\ninclude ~/.nano/syntax_improved/*.nanorc" >> ~/.nanorc rm -vf $NANO_SRC print "\nEXit terminal and reopen using $NANO_SHORT\nTo unistall it and revert to old:\ncd ~/.nano && sudo make" exit
no aliases no path problems. reload your terminal and good to go. at least that was my case.