Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [nano]

nano is a text editor from the GNU project; apply this tag if you are asking about features or functionality of the editor

Filter by
Sorted by
Tagged with
1 vote
1 answer
31 views

nano command execution stuck

In nano v8.0 there's an option to send selection to X clipboard in the nanorc: "{execute}|xsel -ib{enter}{undo}" which does perfectly. I tried using xclip utility instead: "{execute}|...
Multifix's user avatar
  • 125
0 votes
1 answer
24 views

Show a title in nano text editor

I'm doing some setup script and I want to open the nano editor. In addition I want to show a title (or a TODO message) on the as a title in the terminal. Something like this: +-------------------------...
powerpete's user avatar
  • 231
0 votes
1 answer
40 views

Nano path to save cursor position and searchs

Anytime I exit the nano editor, I get an error like this: Unable to create directory /home/oloco/.config/local/share/nano/: No such file or directory It is required for saving/loading search history ...
FueraDeServicio's user avatar
8 votes
4 answers
2k views

When should "rnano" be used in place of "nano"?

I like nano and use it a lot. A related application is rnano. From the rnano manual: DESCRIPTION rnano runs the nano editor in restricted mode. This allows editing only the ...
Digger's user avatar
  • 403
0 votes
1 answer
27 views

The key combination Alt + 6 for copy in nano does not work in GNOME terminal emulator Tilix

The key combination Alt + 6 for copy in nano does not work in tilix Does anyone know how to fix this? I had a look through all the key commands, but did not find any entry for Alt + 6 being already in ...
nath's user avatar
  • 5,784
0 votes
0 answers
53 views

Why is Nano refusing to use syntax colouration?

I am running Alpine Linux 3.18. I have installed nano 7.2 and nano-syntax 7.2, and my $TERM is set to "xterm-256color", but I'm not getting any syntax colours in Nano. The file is a Ruby &...
Sod Almighty's user avatar
2 votes
0 answers
55 views

How to best define nano & terminal colour scheme for light Windows terminals (cmd)?

It has been a usual thing for me to log into my Debian servers via a Windows cmd terminal during daylight. This is why the terminal has white background and black text. Now, when editing a file with ...
bomben's user avatar
  • 499
0 votes
2 answers
312 views

How do I get rid of this leading space highlighting in Nano (Ubuntu)?

Here's an image: Every time I type something with a leading tab, I get this obnoxious green/teal background until I type a value in for that line. Also, for some reason on line 27, the color I ...
fmotion1's user avatar
1 vote
1 answer
199 views

How to handle caret + character options in GNU nano editor in Ubuntu

Extremely simple question. In the attached image the majority of options seem to entail typing ^ and another character at the same time. The problem is that to type ^ I need to press Shift + 6, at ...
JAP's user avatar
  • 113
0 votes
1 answer
38 views

nano unhighlight string if a quote is escaped

I'm trying to unhighlight string if one of the quotes is escaped. sh.nanorc regex is as follows: color brightyellow ""(\\.|[^"])*"" I'm having success with the closing quote ...
Multifix's user avatar
  • 125
1 vote
0 answers
42 views

Is is possible to configure cppcheck as your linter for nano?

Good debugging tools can save you a lot of time when you are writing code. In nano, it's nice that with bash scripts, you can just hit alt+b to find syntax errors before you try running it. However, I ...
thinksinbinary's user avatar
1 vote
1 answer
440 views

resolvconf package create corrupt /etc/resolv.conf file

I'm having a weird issue under debian 11 with resolvconf package. No matter what kind of configuration I throw in, the /etc/resolv.conf file created by resolvconf service is kinda corrupt. Dig says: ...
user3450548's user avatar
  • 2,944
0 votes
0 answers
1k views

nano - include: command not found

I am trying to edit my .nanorc file to include the syntax highlighting profiles located in /etc/share/nano/ folder. When I have the first line as 'set tabsize 4', I get an error: 'set: Variable name ...
Sincplicity's user avatar
1 vote
2 answers
310 views

delete from and to cursor in "nano"

I use nano, and I want to use control + k and control + u to delete to and from the cursor how it is in the regular shell, but they have different functions in nano by default. 1 - Does nano have a ...
Alchemy's user avatar
  • 11
0 votes
1 answer
75 views

Keybindings in nanorc won't work in AWS EC2 Linux

I'm connected to a aws linux vm via ssh as you can see below. I want rebind key codes in .nanorc e.g. bind ^C copy main. But if I reopen nano I got message that there are mistakes in .nanorc. Those ...
Hölderlin's user avatar
  • 1,188
0 votes
1 answer
133 views

how to bind a `key chord` to more than one `function` in `nano`?

I'm configuring nano to make quick edits while using sublime text for working on bigger projects. I ran into some issues, one of which is not able to bind a single key chord to multiple functions. I ...
user avatar
1 vote
1 answer
762 views

nano change line numbers color

How can I change the actual editor theme in .nanorc, I am not speaking about the syntax highlighting but editor elements such as titlebar or line numbers color/background color? For instance, I would ...
Alexandre Daubricourt's user avatar
1 vote
1 answer
915 views

Why does nano indent pasted text or code improperly?

When I copy and paste text from the clipboard, the code looks like [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ...
siralbert's user avatar
0 votes
1 answer
310 views

Which argument in Nano saves the file automatically?

I'm trying to saves the file automatically in Nano but didn't succeed. what is the option to do this?
netanel shteren's user avatar
1 vote
2 answers
377 views

Why does nano have two different copy/pastes?

Without mouse support enabled (my default), you can drag your mouse over text and do standard "copy/paste" with right click, which enables you to paste the test anywhere on your operating ...
thinksinbinary's user avatar
0 votes
1 answer
197 views

Nano: can the escape key be mapped?

I've been playing with the keyboard mapping in the .nanorc file some today, and you can map the F keys like...bind F3 cancel all, however, i haven't had any luck with trying find how nano recognizes ...
thinksinbinary's user avatar
4 votes
1 answer
1k views

Nano: how to just open a new file buffer inside of nano without altering the current one?

I love the nano feature that enables you to open multiple files at once and the fact that switching between them is very easy: nano file1 file2 etc. However, when I try to open a new file while ...
thinksinbinary's user avatar
0 votes
1 answer
83 views

nano highlighting fails in matching shell array brackets

The last two array expansions don't get proper highlighting: This is the setting in sh.nanorc that defines it: # More complicated variable names; handles braces and replacements and arrays. color ...
Multifix's user avatar
  • 125
0 votes
1 answer
164 views

Nano can not find previous occurrence while searching with alt+Q shortcut

I was trying to find a text with nano. Ctrl+W shows the text and with alt+W I can go the next occurrence but when I try to go to the previous occurrence with alt+Q, I see a message Conversion of ...
mahfuj asif's user avatar
7 votes
4 answers
2k views

Save file changes if you forgot to use sudo [duplicate]

I am using Nano. Sometimes I make changes to a file and then after attempting to save I realize that I need sudo permissions. Then I need to close the file, reopen it as sudo and make my changes again....
Black's user avatar
  • 2,088
0 votes
1 answer
926 views

What are the weird characters from an image file?

So i am pretty new to linux and i am learning basic commands. I am also very interested to know how things work under the hood, so sometime after i learned both the cat and nano commands, i tried ...
Konstei's user avatar
  • 13
0 votes
1 answer
392 views

Is it possible to easily switch between tabs and spaces in nano on MAC?

Is it possible to easily switch between tabs and spaces in nano on MAC. I have seen here how to do that but this doesn't work, maybe because I am working with a mac machine
Manuel Dominguez Becerra's user avatar
2 votes
0 answers
286 views

xargs nano leads to Received SIGHUP or SIGTERM while xargs less is OK

Scenario: $ cat t0.txt t1.txt $ cat t1.txt xxx $ sed -n 1p t0.txt | xargs less # OK $ sed -n 1p t0.txt | xargs nano Received SIGHUP or SIGTERM dvl-linux64 $ nano --version GNU nano, version 2.5.3 ...
pmor's user avatar
  • 619
0 votes
1 answer
2k views

I need to run ~$ sudo nano in order write and save a file and can't do so with just the nano command. How do I change this?

To make the question better understood -> I currently have to run nano with sudo when i just want to run nano to edit a file. So while I was fiddling with Ubuntu 20.04 in a VM I had everything more ...
Peter's user avatar
  • 3
0 votes
0 answers
86 views

Export nano's syntax highlighting

I like how nano highlights bash scripts and I often use GNOME terminal's "Copy as HTML" option to copy/paste the color highlights to LibreOffice when writing documentation. That works fine ...
A. Que's user avatar
  • 643
2 votes
2 answers
1k views

Sorting lines in nano?

Is it possible to sort a selected area of text alphabetically using the nano editor? ( similar to the F10 in xed ) I use Linux Mint 20 , nano 4.8 Thank you
UncleOilybag's user avatar
1 vote
1 answer
384 views

Syntax highlighting combinations of strings and comments in nano

I was wondering if anyone could tell me if it possible to configure syntax highlighting in .nanorc so that in the following text ... Dim s$ = "foo ' bar" ' bar "foo" ... the ...
Tom Williams's user avatar
1 vote
0 answers
690 views

Jump to line in nano

When using nano in any of several terminal emulators Ctrl + / invokes Enter line number, column number: dialog. However when working from a virtual terminal e.g. Ctrl + Alt + F4 nothing happens. Why?
Vorac's user avatar
  • 3,107
0 votes
1 answer
96 views

Tmux changes to default preinstalled nano version instead of newly installed homebrew one

When i use nano in the terminal without enabling tmux, it shows the path for the brew version nano is an alias for /opt/homebrew/Cellar/nano However when i use tmux, type nano shows the same path but ...
Vanillamice's user avatar
0 votes
3 answers
376 views

How to combine the commands "find" and "nano"

How can I combine the "find" command with the "nano" command? For example, find . -name "helloworld.py" | nano How to open that file (first out of several lets say) ...
user395980's user avatar
3 votes
5 answers
760 views

How to search for Debian CLI packages?

I recently installed Debian for CLI purposes. I am looking to install CLI packages, I want to know how to search for packages (CLI packages such as nano)?
user487583's user avatar
3 votes
1 answer
222 views

Synology ipkg nano - line numbers are wrong, and sometimes appear on the wrong side of the file

update I submitted a bug report and the conclusion is that the nano version that's available through ipkg is 3 years outdated, and has been incorrectly modified or a dependency is broken. ...
aSemy's user avatar
  • 131
2 votes
1 answer
1k views

Which linters are supported by nano?

In my latex.nanorc file, I have the following instructions: syntax "LaTeX" "\.(la)?tex$" linter lacheck However, when I press the keyboard shortcut to run the linter, I get an ...
user avatar
0 votes
0 answers
250 views

Why I can't open text files when execetue "x" permission is on?

for example I have test_file and I run sudo chmod 775 test_file so now while I'm the owner I can read,write and execute it but with graphical interface it doesn't work, I don't have any error messages ...
pjk's user avatar
  • 323
0 votes
0 answers
306 views

Nano: keyboard shortcut to move cursor to the beginning of the next empty line?

In nano text editor: what is the keyboard shortcut to move cursor to the beginning of the next empty line? If there is no default one, then what would be the right one?
pmor's user avatar
  • 619
2 votes
0 answers
545 views

Nano c.nanorc format

I like portability between systems and I was trying to make my nano editor look as much as possible like Sublime Text (on Linux Mint). I want to color function names too. So far I managed to make it ...
Spiritus's user avatar
1 vote
1 answer
87 views

Is it possible to show a vim cheatsheet like in Nano at the bottom of the page?

I am using Debian GNU/Linux. Are there any options or extensions to vim that give me the possibility to display a cheat sheet in vim as shown in Nano?
MySurmise's user avatar
1 vote
1 answer
228 views

Using multiple .nanorc files

I am not sure if this can be done or not. I have two different .nanorc files (.nanorc1 and .nanorc2). Each file has different settings. For example one has tabs set to 9 spaces and the other has ...
Patrickw99's user avatar
0 votes
1 answer
252 views

How to use locally installed latest version of nano (on CentOS 7) by default? (No admin privileges)

I compiled the nano editor (version 5.3) on CentOS 7. However, which nano gives /usr/bin/nano. nano --version gives GNU nano version 2.3.1. I have locally installed ~/.local/bin/nano --version GNU ...
jaguar022's user avatar
0 votes
1 answer
556 views

Basic linux commands (sudo/apt-get/nano) not found

I'm using Linux sa515 on this application processor but I can't seem to run any of the following commands: sudo apt-get nano It says the corresponding command is not found. Am I missing something?
xyf's user avatar
  • 141
1 vote
0 answers
128 views

paste content in nano removes new lines

I have this strange behavior in nano using the Tilix terminal (works in another terminal) where, if I paste something, the new lines are completely removed, content is wrapped and new lines are ...
Romeo Mihalcea's user avatar
1 vote
1 answer
67 views

need help with my menu program

i'm having issue with the script, the selection 2 and 3 doesn't show anything when executing. #!/bin/bash while true do clear echo "========================" echo "Menu ----"...
h97's user avatar
  • 11
0 votes
0 answers
637 views

Restore empty docker-compose file

I was working on a sizeable docker-compose file using the nano editor. Upon saving it told me I was out of disk space. Without hesitating, I quit nano, extended my LVM and resized the FS as I have ...
schneida's user avatar
  • 148
2 votes
0 answers
464 views

Is there a way to have nano to pipe output to another program's input?

I have a program A that pipes its input to nano this way: program_a | nano -. I want to make edits with nano and pipe it again to another program B, without having nano to write anything on the disk (...
Loutr_'s user avatar
  • 21
0 votes
0 answers
35 views

How to save gedit changes right along with nano changes, instead of appending ~?

I've got a .nanorc file that I love, records all changes to files when using nano. Gedit, on the other hand, just writes out a file next to the live version with a ~ appended. Is there some bit of ...
listenlight's user avatar