Questions tagged [nano]

GNU nano is an open source, curses-based text editor for Unix systems. It is a clone of [tag:pico], the proprietary Pine e-mail client editor.

Nano is a simple, small, lightweight text editor for written in . It was created in 1999 under the name TIP ("this isn't pico"). It was renamed to avoid conflit with the tip command in 2000 and officially joined the GNU project in 2001.

Nowadays, nano supports interaction through mouse, syntax highlight, -based search, customization of key bindings and (experimental) undo/redo support. More about it can be read in its homepage.

250 questions
172
votes
6 answers

How to make the tab character 4 spaces instead of 8 spaces in nano?

When I press TAB in nano editor, the cursor will jump with 8 spaces like this: def square(x): return x * x def cube(y): return y * y * y how can I set the tab stop width to 4 spaces to display like this: def square(x): return x…
Fallen Satan
  • 1,727
  • 2
  • 11
  • 4
118
votes
10 answers

nano error: Error opening terminal: xterm-256color

After the installation of OSX Lion, I tried to: nano /etc/apt/sources.list But I get this error: Error opening terminal: xterm-256color If I try to switch terminal.app preferences to open terminal windows in "xterm color" instead of xterm-256color…
Luke
  • 2,696
  • 6
  • 31
  • 42
118
votes
6 answers

jump to line X in nano editor

Does the Nano minimal text editor have a keyboard shortcut feature to jump to a specified line? Vim provides several analogs.
David Shaked
  • 2,524
  • 3
  • 17
  • 27
72
votes
1 answer

Move whole line up/down shortcut in nano (analogue to intelliJ or Visual Studio)

How to move a line of text up/down in Nano linux command line editor? Is there any analogue way to do that as in IntelliJ Idea: Place the caret at the line to be moved. Do one of the following: On the main menu, choose Code | Move Line Up or Code…
Blaise
  • 6,244
  • 4
  • 38
  • 53
69
votes
14 answers

Copy text from nano editor to shell

Is it possible to copy text from a file, opened with nano, to the shell? I have a text file, and I want to copy several lines to the console, but I cannot find a keyboard shortcut to copy the text.
manuel
  • 887
  • 1
  • 6
  • 13
60
votes
3 answers

How Do I Clear The Credentials In AWS Configure?

I have deleted the AWS credentials in sudo nano ~/.aws/config. But, the credentials are still in aws configure. Is there a way to reset aws configure with clear state?
ebertbm
  • 2,817
  • 8
  • 27
  • 43
58
votes
3 answers

Unix: what modifier key does "M-" refer to (e.g. M-C)

I'm trying to do a case-sensitive search in Nano. The help menu at the bottom of the screen says I can toggle case-sensitivity by typing M-C. ^G Get Help ^Y First Line ^T Go To Line ^W Beg of Par M-J FullJstify M-B…
dB'
  • 6,904
  • 12
  • 54
  • 92
45
votes
2 answers

How to install nano on boot2docker

I'm running the boot2docker VM in windows and need to modify the init scripts within the VM. Currently my only option is VI, and it's a pain. I'd just like to use nano, but it's not available. It's running: docker@boot2docker:/c$ uname -a Linux…
phazei
  • 5,127
  • 5
  • 37
  • 46
34
votes
3 answers

How to commit a change in git when git commit opens Nano?

I'm new to git and I'm trying to commit my first changes on a Windows machine. However, when I type in $git commit it takes me to a different screen than any online tutorials show or than what is mentioned in Pro Git. No online searching yields an…
Guy
  • 602
  • 1
  • 9
  • 20
30
votes
4 answers

How to open multiple files and switch between them in nano text editor?

In emacs, you can open new files with Ctrl+X, Ctrl+F And go to the previous file with Ctrl+B, and go to the next file with Ctrl+N. How to do this in nano text editor? While nano is launched, and then open new files, and how to switch between the…
s-hunter
  • 17,762
  • 11
  • 67
  • 105
29
votes
1 answer

nano editor on OS X - How to type M-U for undo?

I am using nano 2.5.3 on OS X Yosemite, and I see commands at the bottom such as: M-U Undo M-E Redo So far, I have not been able to figure out which key or keys that M is referring to. What would be M on OS X?
GreenSaguaro
  • 2,015
  • 2
  • 17
  • 27
28
votes
6 answers

Nano syntax highlighting in Mac OS X 10.7 (Lion)?

How to enable syntax highlighting for nano in Mac OS X 10.7 (Lion)? According to what I found so far on Google is that it has got to do with /.nanorc file. I have no idea how to get it or make it? When I try to find nano in my terminal this is what…
sukhvir
  • 4,483
  • 6
  • 34
  • 43
25
votes
4 answers

Regex-based matching and sustitution with nano?

I am aware of nano's search and replace functionality, but is it capable of using regular expressions for matching and substitution (particularly substitutions that use a part of the match)? If so, can you provide some examples of the syntax used…
Daniel Standage
  • 7,189
  • 14
  • 61
  • 101
25
votes
1 answer

Python - Saving a File being edited in GNU Nano 2.2.4

I'm very new to programming and playing around with a Raspberry Pi and following tutorials on Youtube. I have opened a file in GNU Nano 2.2.6 e.g: nano my_File.py and changed some of the data. I'm struggling on how to overwrite the file (or save it)…
binary101
  • 973
  • 3
  • 20
  • 32
24
votes
1 answer

Nano keyboard shortcut to go through line faster?

Is there an shortcut in nano for moving through a line faster? I have some log files with gigantic lines and getting to the middle of them is awful. I know I could use a different text editor that doesn't have this particular problem (less will wrap…
quantka
  • 874
  • 1
  • 9
  • 15
1
2 3
16 17