-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnano.txt
57 lines (47 loc) · 2.4 KB
/
nano.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
https://www.nano-editor.org/dist/v6/cheatsheet.html # etc
# basically check the line at the bottom, myeah?
# different versions of nano support different things, but for those that do..
# if Alt is not available or does weird stuff, Esc can be used as separate keypress instead
Alt-a set start- and end-marks for copy/cutting; Shift-cursor keys might also work!
Alt-delete removes a marked area without putting it into the cut buffer; With set zap or $ nano -Z
regular delete and backspace work too.
While a selection is active, Ctrl-O turns into "Write Selection to File: " with no filename
Ctrl-k cut marked text or line (including trailing newline) into (nano) buffer
Ctrl-u un-cut buffer to cursor position
Alt-6 copy marked text or line into buffer
Ctrl-/ find/replace; you can find regex but replace only accepts strings, HOWEVER..
Ctrl-t pipe buffer or selection through command. Start the command with \e[32;1m|\e[0m to pipe throught, I guess.
\e[32;1m| sed\e[0m wants \e[32;1m-z\e[0m to use null character instead of newline to delimit, for some reason.
Alt-u undo
Alt-e redo
Ctrl-up/down no idea what version this was added, but this moves the cursor to the previous/next paragraph
Alt-+/- scrolls without moving the caret (until the caret hits the top/bottom, then it scrolls along)
# comment. I forgot what was going to be here.
Ctrl-r read new file into current or new buffer
Ctrl-r-t cursorable file chooser! o.o why am I discovering this by accident??
Alt-f toggle between current/new buffer for Ctrl-r behaviour above, for newer nanos
this only works while in the Ctrl-r "dialog"
Alt-. (or Esc, '.') go to next buffer
Alt-c toggle cursor position display
Alt-# toggle line numbers on the left (Alt-Shift-3)
Alt-o toggle tab -> spaces ('set tabsize 4' or so in .nanorc)
Alt-y toggle syntax highlighting
Alt-s toggle wrapping long lines (or: Esc, s)
# read different .nanorc:
$ nano --rcfile blaa.nanorc
# syntax hilighting is guessed by extension, tell it what to use with -Y:
$ nano -Y php foobar
# If syntax highlighting still doesn't work, or is just regular/bold instead of colors, experiment
# with your TERM variable.
### my config:
include "/usr/share/nano/*.nanorc"
include "/home/<user>/.config/nanophpsyntax"
set softwrap
set tabsize 4
set tabstospaces
set multibuffer
set constantshow
set zap
set autoindent
set trimblanks
###