Skip to content

This repository contains a cheat sheet for using nano editor for my own purposes.

Notifications You must be signed in to change notification settings

cardboardcode/quick_nano

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 

Repository files navigation

What Is This?

This document contains a simplified cheat sheet showing users how to use nano efficiently.

Why Use Nano? 📖

Although you can use your own IDE, nano is a lightweight text editor that comes in-built into default Ubuntu.

In other words, if you need to edit files frequently in Docker images like me, you will find nano far more convenient.

Docker does not support GUIs inherently and it is a pain to configure it to support that. 🩸

Terminal Tricks 💻

nano <file_name> -l: Show the line number when nano editor is used.

nano <file_name> --mouse: Allow scrolling and clicking to be done via the mouse.

nano <file_name> --softwrap: Display overlong lines on multiple rows.

Keyboard Shortcuts ⌨️

Ctrl + o: Write to the file.

Ctrl + x: Exit nano editor.

Ctrl + k: Cut the line which the cursor is on out.

Ctrl + u: Paste the line that was cut earlier.

Ctrl + w: Register a string to search.

Alt + w: Repeat previously-registered search term.

Ctrl + v: Page down or skip multiple lines at one go.

Alt + u: Undo previous edit.

Alt + p: Display whitespace characters. Useful for mindful python programming.

Syntax Highlighting 🌈

Follow the instructions below to include specific code-specific syntax highlighting features.

Markdown

sudo wget https://github.com/serialhex/nano-highlight/raw/master/markdown.nanorc -P /usr/share/nano/

Python

sudo wget https://github.com/serialhex/nano-highlight/raw/master/python.nanorc -P /usr/share/nano/

C/C++

sudo wget https://github.com/serialhex/nano-highlight/raw/master/c.nanorc -P /usr/share/nano/

Bash

sudo wget https://github.com/serialhex/nano-highlight/raw/master/bash.nanorc -P /usr/share/nano/

TODO 📜

  • Include instructions on how to have code-specific syntax highlighting.
  • Include instructions on how to navigate in nano editor for swiftly.
  • Include instructions/commands to edit /etc/nanorc to include soft-wrap and other features.
  • Display whitespace in editor so as to avoid python.

About

This repository contains a cheat sheet for using nano editor for my own purposes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published