\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Blyzz} \pdfinfo{ /Title (nano.pdf) /Creator (Cheatography) /Author (Blyzz) /Subject (nano Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{C7C7C7} \definecolor{LightBackground}{HTML}{F8F8F8} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{nano Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Blyzz} via \textcolor{DarkBackground}{\uline{cheatography.com/203555/cs/43360/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Blyzz \\ \uline{cheatography.com/blyzz} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 11th May, 2024.\\ Updated 11th May, 2024.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{.nanorc}} \tn % Row 0 \SetRowColor{LightBackground} set afterends & Make Ctrl+Right and Ctrl+Delete stop at word ends instead of beginnings \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} set autoindent & Automatically indent a newly created line to the same number of tabs and/or spaces as the previous line (or as the next line if the previous line is the beginning of a paragraph). \tn % Row Count 13 (+ 9) % Row 2 \SetRowColor{LightBackground} set constantshow & Constantly display the cursor position in the status bar. \tn % Row Count 16 (+ 3) % Row 3 \SetRowColor{white} set cutfromcursor & Use \seqsplit{cut-from-cursor-to-end-of-line} by default, instead of cutting the whole line \tn % Row Count 20 (+ 4) % Row 4 \SetRowColor{LightBackground} set guidestripe {\emph{number}} & Draw a vertical stripe at the given column, to help judge the width of the text. \tn % Row Count 24 (+ 4) % Row 5 \SetRowColor{white} set stripecolor {[}bold,{]}{[}italic,{]}{\emph{fgcolor,bgcolor}} & Use this color combination for the vertical guiding stripe \tn % Row Count 27 (+ 3) % Row 6 \SetRowColor{LightBackground} set keycolor {[}bold,{]}{[}italic,{]}{\emph{fgcolor,bgcolor}} & Use this color combination for the shortcut key combos in the two help lines at the bottom of the screen \tn % Row Count 33 (+ 6) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{.nanorc (cont)}} \tn % Row 7 \SetRowColor{LightBackground} set linenumbers & play line numbers to the left of the text area. \tn % Row Count 3 (+ 3) % Row 8 \SetRowColor{white} set numbercolor {[}bold,{]}{[}italic,{]}{\emph{fgcolor,bgcolor}} & Use this color combination for line numbers \tn % Row Count 6 (+ 3) % Row 9 \SetRowColor{LightBackground} set mouse & Enable mouse support, if available for your system \tn % Row Count 9 (+ 3) % Row 10 \SetRowColor{white} set nohelp & Don't display the two help lines at the bottom of the screen \tn % Row Count 13 (+ 4) % Row 11 \SetRowColor{LightBackground} set saveonexit & Save a changed buffer automatically \tn % Row Count 15 (+ 2) % Row 12 \SetRowColor{white} set scrollercolor {\emph{fgcolor,bgcolor}} & Use this color combination for the indicator alias "scrollbar \tn % Row Count 19 (+ 4) % Row 13 \SetRowColor{LightBackground} set selectedcolor {[}bold,{]}{[}italic,{]}{\emph{fgcolor,bgcolor}} & Use this color combination for selected text. \tn % Row Count 22 (+ 3) % Row 14 \SetRowColor{white} set speller "{\emph{program {[}argument ...}}{]}" & Use the given program to do spell checking and correcting \tn % Row Count 25 (+ 3) % Row 15 \SetRowColor{LightBackground} set stateflags & Use the top-right corner of the screen for showing some state flags \tn % Row Count 29 (+ 4) % Row 16 \SetRowColor{white} set statuscolor {[}bold,{]}{[}italic,{]}{\emph{fgcolor,bgcolor}} & Use this color combination for the status bar \tn % Row Count 32 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{.nanorc (cont)}} \tn % Row 17 \SetRowColor{LightBackground} set tabsize {\emph{number}} & Use a tab size of number columns \tn % Row Count 2 (+ 2) % Row 18 \SetRowColor{white} set titlecolor {[}bold,{]}{[}italic,{]}{\emph{fgcolor,bgcolor}} & Use this color combination for the title bar \tn % Row Count 5 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Extra Info}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Editing the \textasciitilde{}/.nanorc}} file will enable changes to your nano when you open it. \newline % Row Count 2 (+ 2) {\bf{Stateflags:}} I when auto-indenting, M when the mark is on, L when hard-wrapping (breaking long lines), R when recording a macro, and S when soft-wrapping \newline % Row Count 6 (+ 4) {\bf{Valid names for the foreground and background colours}} are: red, green, blue, magenta, yellow, cyan, white, and black. Each of these eight names may be prefixed with the word light to get a brighter version of that colour. The word grey or gray may be used as a synonym for lightblack. On a Linux console, light does not have any effect for a background colour. On terminal emulators that can do at least 256 colours, other valid (but unprefixable) colour names are: pink, purple, mauve, lagoon, mint, lime, peach, orange, latte, rosy, beet, plum, sea, sky, slate, teal, sage, brown, ocher, sand, tawny, brick, crimson, and normal -{}- where normal means the default foreground or background colour. On such emulators, the colour may also be specified as a three-digit hexadecimal number prefixed with \#, with the digits representing the amounts of red, green, and blue, respectively. This tells nano to select from the available palette the colour that approximates the given values.% Row Count 26 (+ 20) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.09494 cm} x{3.88206 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Most Used}} \tn % Row 0 \SetRowColor{LightBackground} Ctrl-G (F1) & Display the help text \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Ctrl-O (F3) & Write the current file to disk \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Ctrl-X (F2) & Close the current file buffer / Exit from nano \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} Ctrl-R (F5) & Insert another file into the current one \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} Ctrl-L & Refresh (redraw) the current screen \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} Ctrl-Y (F7) & Go to previous screen \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} Ctrl-V (F8) & Go to next screen \tn % Row Count 14 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.64701 cm} x{4.32999 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Editing Text}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{Ctrl-I} & Insert a tab at the cursor position \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{Ctrl-M} & Insert a newline at the cursor position \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Esc-V & Insert the next keystroke verbatim \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} \seqsplit{Ctrl-D} & Delete the character under the cursor \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} \seqsplit{Ctrl-H} & Delete the character to the left of the cursor \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} Esc-T & Cut from the cursor position to the end of the file \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} Esc-D & Count the number of words, lines, and characters \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} \seqsplit{Ctrl-Z} & Suspend the editor (if suspend is enabled) \tn % Row Count 15 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.64241 cm} x{3.33459 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Search and replace}} \tn % Row 0 \SetRowColor{LightBackground} Ctrl-W (F6) & Search for a string or a regular expression \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Ctrl-\textbackslash{} (F14) (Esc-R) & Replace a string or a regular expression \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Esc-W (F16) & Repeat last search \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.74655 cm} x{4.23045 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Toggles}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{(Esc-X)} & Help mode enable/disable \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{(Esc-C)} & Constant cursor position display enable/disable \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{(Esc-O)} & Use of one more line for editing enable/disable \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \seqsplit{(Esc-S)} & Smooth scrolling enable/disable \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} \seqsplit{(Esc-P)} & Whitespace display enable/disable \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} \seqsplit{(Esc-Y)} & Colour syntax highlighting enable/disable \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} \seqsplit{(Esc-H)} & Smart home key enable/disable \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} \seqsplit{(Esc-I)} & Auto indent enable/disable \tn % Row Count 16 (+ 2) % Row 8 \SetRowColor{LightBackground} \seqsplit{(Esc-K)} & Cut to end enable/disable \tn % Row Count 18 (+ 2) % Row 9 \SetRowColor{white} \seqsplit{(Esc-L)} & Long line wrapping enable/disable \tn % Row Count 20 (+ 2) % Row 10 \SetRowColor{LightBackground} \seqsplit{(Esc-Q)} & Conversion of typed tabs to spaces enable/disable \tn % Row Count 22 (+ 2) % Row 11 \SetRowColor{white} \seqsplit{(Esc-B)} & Backup files enable/disable \tn % Row Count 24 (+ 2) % Row 12 \SetRowColor{LightBackground} \seqsplit{(Esc-F)} & Multiple file buffers enable/disable \tn % Row Count 26 (+ 2) % Row 13 \SetRowColor{white} \seqsplit{(Esc-M)} & Mouse support enable/disable \tn % Row Count 28 (+ 2) % Row 14 \SetRowColor{LightBackground} \seqsplit{(Esc-N)} & No conversion from DOS/Mac format enable/disable \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{p{0.74655 cm} x{4.23045 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Toggles (cont)}} \tn % Row 15 \SetRowColor{LightBackground} \seqsplit{(Esc-Z)} & Suspension enable/disable \tn % Row Count 2 (+ 2) % Row 16 \SetRowColor{white} \seqsplit{(Esc-\$)} & Soft line wrapping enable/disable \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.4931 cm} x{3.4839 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Copy and Paste}} \tn % Row 0 \SetRowColor{LightBackground} Ctrl-K (F9) & Cut the current line and store it in the cut buffer \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Ctrl-U (F10) & Uncut from the cut buffer into the current line \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Esc-Ctrl- (Esc-6) & Copy the current line and store it in the cut buffer \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} Esc-\textbackslash{}\textbackslash{}\textless{} (Esc-,) & Switch to the previous file buffer \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} Esc-\textgreater{} (Esc-.) & Switch to the next file buffer \tn % Row Count 10 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.89126 cm} x{3.08574 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Moving Around}} \tn % Row 0 \SetRowColor{LightBackground} Ctrl-F & Go forward one character \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Ctrl-B & Go back one character \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Ctrl-Space & Go back one word \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} Ctrl-P & Go to previous line \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} Ctrl-N & Go to next line \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} Ctrl-A & Go to beginning of current line \tn % Row Count 7 (+ 2) % Row 6 \SetRowColor{LightBackground} Ctrl-E & Go to end of current line \tn % Row Count 9 (+ 2) % Row 7 \SetRowColor{white} Ctrl-C (F11) & Display the position of the cursor \tn % Row Count 11 (+ 2) % Row 8 \SetRowColor{LightBackground} Esc-( (Esc-9) & Go to beginning of paragraph; then of previous paragraph \tn % Row Count 14 (+ 3) % Row 9 \SetRowColor{white} Esc-) (Esc-0) & Go just beyond end of paragraph; then of next paragraph \tn % Row Count 17 (+ 3) % Row 10 \SetRowColor{LightBackground} Esc-{]} & Go to the matching bracket \tn % Row Count 19 (+ 2) % Row 11 \SetRowColor{white} Esc-\textbackslash{} (Esc-|) & Go to the first line of the file \tn % Row Count 21 (+ 2) % Row 12 \SetRowColor{LightBackground} Esc-/ (Esc-?) & Go to the last line of the file \tn % Row Count 23 (+ 2) % Row 13 \SetRowColor{white} Ctrl-\_ (F13) (Esc-G) & Go to line and column number \tn % Row Count 25 (+ 2) % Row 14 \SetRowColor{LightBackground} Esc– (Esc-\_) & Scroll up one line without scrolling the cursor \tn % Row Count 27 (+ 2) % Row 15 \SetRowColor{white} Esc-+ (Esc-=) & Scroll down one line without scrolling the cursor \tn % Row Count 30 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{1.89126 cm} x{3.08574 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Moving Around (cont)}} \tn % Row 16 \SetRowColor{LightBackground} Ctrl-Ctrl- (F15) (Esc-A) & Mark text at the cursor position \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.39356 cm} x{3.58344 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Formatting}} \tn % Row 0 \SetRowColor{LightBackground} Esc-\} & Indent the current line \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Esc-\{ & Un-indent the current line \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Ctrl-J (F4) & Justify the current paragraph \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} Esc-J & Justify the entire file \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.19448 cm} x{3.78252 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Spelling}} \tn % Row 0 \SetRowColor{LightBackground} Ctrl-T (F12) & Invoke the spell checker, if available \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}