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
0 votes
0 answers
74 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 ...
0 votes
2 answers
25 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 ...
0 votes
1 answer
34 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 ...
  • 1,086
0 votes
1 answer
51 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 ...
  • 1
1 vote
1 answer
224 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 ...
0 votes
1 answer
219 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 ...
0 votes
0 answers
38 views

Nano: is there anyway to add space between marked lines?

It's easy to justify and indent lines, but is there a way to add spaces between them for clarity like in a double spaced word document?
0 votes
1 answer
51 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?
1 vote
2 answers
144 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 ...
0 votes
1 answer
48 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 ...
2 votes
1 answer
365 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 ...
0 votes
1 answer
23 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 ...
  • 103
0 votes
1 answer
43 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 ...
7 votes
4 answers
1k 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....
  • 1,875
0 votes
1 answer
392 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 ...
  • 13
0 votes
1 answer
207 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
1 vote
0 answers
150 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 ...
  • 457
0 votes
1 answer
880 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 ...
  • 3
0 votes
0 answers
57 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 ...
  • 442
0 votes
2 answers
693 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
1 vote
1 answer
209 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 ...
0 votes
0 answers
134 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?
  • 2,859
0 votes
1 answer
61 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 ...
0 votes
3 answers
213 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) ...
3 votes
5 answers
661 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)?
3 votes
1 answer
192 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. ...
  • 131
2 votes
1 answer
622 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
161 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 ...
  • 193
0 votes
0 answers
80 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?
  • 457
2 votes
0 answers
305 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 ...
1 vote
1 answer
71 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?
1 vote
1 answer
127 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 ...
0 votes
1 answer
163 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 ...
0 votes
1 answer
460 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?
  • 131
1 vote
0 answers
45 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 ...
1 vote
1 answer
51 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 ----"...
  • 11
0 votes
0 answers
461 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 ...
  • 148
2 votes
0 answers
279 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 (...
  • 21
0 votes
0 answers
26 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 ...
4 votes
1 answer
1k views

Line length marker in nano

How can I highlight a given column using nano? I'm using a fairly large terminal but I would like a mark to know if my code exceeds the limit of let's say 80 characters.
user avatar
0 votes
0 answers
73 views

Terminal editor/pager that allows jumping to particular line based on external command or file?

I'd like to script something so that an existing process viewing a listing file jumps to a particular line. The process might be less or nano or, if need be, another pager or editor. I would, if ...
  • 121
3 votes
1 answer
558 views

Display full path in title bar of nano editor

The nano editor by default displays only the filename being edited, but not its full path. This can be a problem, if I need to edit old vs new versions of files by the same name. Does anyone know of ...
1 vote
1 answer
1k views

How to toggle nano softwrap on mac

I tried the following recommended approaches unsuccessfully to toggle softwrap in nano on MacOS Catalina: I can't do Alt+S as in the manual, it gives ß on my keyboard. Esc-S gives "Smooth scrolling ...
0 votes
3 answers
404 views

How to solve the issue where nano screen text is scrambled when using su - admin

In Terminal I su - admin while in my user account to brew update, modify .bashrc, etc. I have noticed that when in my user session changing the size of the window while running nano doesn't scramble ...
  • 145
1 vote
2 answers
6k views

Bad regex : Invalid range end

Can you help with this regex in my sourceslist.nanorc ? Regex: cdrom:\[[a-zA-Z0-9\._-\(\) ]+\]/ Error: Bad regex "cdrom:\[[a-zA-Z0-9\._-\(\) ]+\]/": Invalid range end Thank you.
  • 113
3 votes
1 answer
2k views

sudo: unable to initialize PAM: No such file or directory after editing pam.d

I was playing around with the pam.d file in nano and for some reason along the way I lost root access. Whenever I try to use the sudo command, I get an error like this: [redacted]@[redacted] ~ % sudo ...
user avatar
4 votes
1 answer
3k views

Nano - highlight trailing whitespaces

I use nano as my standard editor for a file type it has no build in syntax-highlighting for LilyPond. It is nothing I really need, though I'm missing out quite a lot of white-space characters at the ...
  • 5,270
0 votes
2 answers
111 views

Bash script's array element can't act as a filename for nano, some kind of encoding error

I'm looking to write a bash script that recursively searches directories, find a particular string, then opens to that string in that particular file. I call this function exert because it takes away ...
1 vote
0 answers
38 views

Can I open an editor as part of a piping command to edit the piped string? [duplicate]

I would like to do this: git --git-dir=../navcl/.git format-patch -k -1 --stdout 607780ee9 \ | nano \ | git am -3 -k The issue is, in my other git dir, a file path is different, so I need to ...
0 votes
0 answers
108 views

is there a way to invoke nano <filename> so it will fail if <filename> doesn't exist?

I am creating a set of instructions like nano /home/username/preexisting-file.txt where, of course, we tell people to replace "username" with their own username. But people still forget, and they ...
  • 101