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
117
questions
1
vote
1answer
19 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
1answer
19 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
1answer
66 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?
1
vote
0answers
24 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 ...
0
votes
0answers
24 views
GNU nano: C syntax highlighting changes if file has 'conf' in its name
GNU nano: C syntax highlighting changes if file has conf in its name:
Very unexpected behavior.
Why and how to solve (i.e. keep C syntax highlighting if file has conf in its name)?
Note: nano is ...
1
vote
1answer
25 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 ----"...
0
votes
0answers
20 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 ...
2
votes
0answers
41 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 (...
0
votes
0answers
19 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 ...
1
vote
1answer
81 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.
0
votes
0answers
38 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 ...
1
vote
1answer
83 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
1answer
115 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
2answers
77 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 ...
0
votes
2answers
2k 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.
2
votes
0answers
581 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 ...
1
vote
1answer
1k 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 ...
0
votes
2answers
30 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
0answers
36 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
0answers
36 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 ...
1
vote
0answers
97 views
Graphical glitches in Nano when using ssh
I have Windows 10 and I'm using ssh in powershell. Nano editor is very glitchy though, when I'm writing something, the cursor suddenly jumps at random places (especially to the rightmost place at the ...
0
votes
1answer
43 views
How to use nano's Redo shortcut (Meta+E) in MATE terminal
I'm using:
Debian bullseye with its MATE desktop environment
MATE caja 1.22.1
MATE Terminal 1.22.1
GNU nano, version 4.3
In nano, Redo is mapped to Meta+E. In Keyboard Preferences I have selected "...
1
vote
1answer
58 views
mc (midnight commander) view (F3) strange behavior when there is a “.” in the filename
It seems to ignore newline characters in "parsed" view. In raw view everything is fine. Same thing happens in nano "justified" mode.
a) parsed text file
b) same file in raw mode
c) vi with :set ...
2
votes
1answer
264 views
Unwanted trailing white-spaces comes along on copy-paste
I'm using Tmux & Zsh (WSL) and am very frustrated with all the white-spaces that comes with when copy content from a file while using nano.
nano .zshrc
.
When using Shift+Right Mouse Button or ...
0
votes
1answer
473 views
How decrypt a file in nano text editor?
I encrypted a text file in terminal using "gpg -c filename" and got "filename.txt.gpg" created in my file manager. I deleted the original unencrypted file.
Now I want to decrypt it in Nano so I can ...
5
votes
2answers
559 views
Horizontal scrolling in nano editor?
I am using nano on files with long lines.
How could I scroll the nano window horizontally?
Ex:
āāāāāāāāāāāāāā
|Lorem ipsum |dolor sit amet, consectetur adipiscing elit,
|sed do eiusm|od tempor ...
3
votes
1answer
923 views
When I try to load and edit files in nano or vi, it only creates a new blank file. Why is this?
When I try to load any files in nano or vi, it simply creates a blank [New File]. For some reason it won't load any files I'm trying to edit. I'm at a loss. Why would this be?
I open up a terminal ...
0
votes
1answer
626 views
Nano text editor - How to bring back on the syntax coloring?
I am using the Nano text editor.
Before, there was color on every command I typed, but now I don't know what buttons I pressed as there are no more colors.
How to bring back on the syntax coloring?
13
votes
2answers
15k views
How can I set the default editor as nano on my Mac?
I have vim as default editor on my Mac and every time I run commands on Mac terminal, it automatically opens "vim".
How can I set up "nano" instead and make sure the terminal will open "nano" every ...
1
vote
0answers
730 views
Can't create new file with nano, Received SIGHUP or SIGTERM
I found only this question of this subject: Received SIGHUP or SIGTERM: nano cannot edit empty file
I'm configuring my web server. There wasn't any problems earlier and I would like to know exactly ...
0
votes
0answers
61 views
Output in terminal after quitting program
I'm using Kubuntu with i3, and I've recently migrated from Manjaro because things. My terminal emulator is urxvt but, when I use programs such as vim, less or nano in the terminal remains the part of ...
1
vote
2answers
175 views
Nano editor: are Ctrl keybindings actually bitmasked?
I wanted to make Nano have more common shortcuts (i.e. Ctrl-F for search, Ctrl-H for replace, etc) and edited the nanorc file to add:
bind ^F whereis all
bind ^H replace all
bind ^M mark all
...
To ...
0
votes
1answer
190 views
How to override /etc/nanorc systemwide?
I want all users of nano to have tabsize 4 instead of the default 8. What is the best way to achieve this? I would prefer a file that overrides /etc/nanorc at the system level so I don't have to ...
3
votes
2answers
1k views
Prevent Nano from creating .save files?
I have a problem with the Nano editor. If it ever exits unexpectedly, it leaves behind .save files, which are just versions of the edits I was making. Is there a way to disable this behaviour?
6
votes
2answers
4k views
How to delete current word in nano text editor?
How to delete the complete word where cursor is positioned in nano text editor? Or if cursor is on white space, I assume it should delete the next word?
Nano help shows these two functions but they ...
2
votes
0answers
42 views
Interpolated and literal Perl strings in Nano are incorrectly highlighted
I am trying to improve Nano's syntax highlighting for Perl, but I have run into an interesting dilemma. Perl uses single quotes for literal strings, and double quotes for interpolated strings. The ...
1
vote
2answers
817 views
nano text file formatter? [closed]
Is there a SIMPLE way to format nano file text?
My code is getting pretty messy, so it MAY help to format it.
21
votes
1answer
23k views
How to comment multiple lines in nano at once?
I can able to select multiple lines using Esc+A. After this, what shortcut(s) should I use to comment/uncomment the selected lines?
1
vote
1answer
86 views
Mistyped command: sudo nano / -name “supervisor”
Instead of using sudo find / -name "supervisor" I ran sudo nano / -name "supervisor" by mistake, which looked like it opened a blank nano file before I hit CRTL-X...
$ sudo nano / -name "supervisor"
...
11
votes
1answer
10k views
find and replace “tabs” using search and replace in nano
How can I search and replace horizontal-tabs in nano? I've been trying to use [\t] in regex mode, but this only matches every occurrence of the character t?
...just been using sed 's/\t//g' file ...
0
votes
1answer
361 views
How can you bind ^[ or M-[ shortcut to an action in nano?
I have been trying to bind the shortcut CTRL-[ to the unindent function, but it seems like that if you type in bind ^[ unindent main (CTRL-[) into nanorc, the text will be still formatted in red, not ...
3
votes
3answers
3k views
How to constantly show line number when navigating in nano?
I am looking for a keyboard shortcut to show the line numbers in nano editor when navigating up and and down within the file.
I have seen in multiple posts about CTRL+C but this doesn't automatically ...
2
votes
1answer
1k views
How to exit nano from a different terminal?
I was ssh'ing into a Raspberry Pi running Raspbian, editing a file with nano, when I lost my internet connection (by leaving the WiFi zone). After reconnecting an hour later, I found that the pi had ...
4
votes
1answer
4k views
-bash: /usr/bin/nano: No such file or directory
I have this problem on fresh install of Debian 8 (after doing apt upgrade).
nano is installed but when I try to use it to open a file :
nano myfile.txt
I get:
-bash: /usr/bin/nano: No such file or ...
0
votes
1answer
187 views
Can I modify the behaviour of backspace in gnu nano?
I tried to configure my nano to more python friendly editor. I wrote the following to my .nanorc
set tabsize 4
set tabstospaces
I was wondering if I can change the bahavior of backspace such that ...
1
vote
1answer
194 views
cancel a search in nano?
So I'm editing this 1MB file on a slow command-line only Debian machine, and I accidentally forgot to untick a "Search Backwards" mark when searching for something. So now Debian is searching for ...
-2
votes
1answer
473 views
How can I get syntax highlighting on CronTab when using Nano as Editor?
Ubuntu, RaspBian and FreeBSD offer the user to choose editor on first crontab -e execution, so I selected Nano Editor.
But syntax highlighting seems not be enabled.
I tried the same parameter I use ...
0
votes
1answer
970 views
Copy a line of text from nano running in a shell over ssh in order to paste into a local gedit instance
I routinely access remote files using nano in a terminal shell over ssh.
Sometimes I'd like to copy a large amount of text (sometimes one line sometimes a large block) and paste it into a local ...
-1
votes
1answer
3k views
How to open a terminal file in TextEdit
I use nano <file_name> to open/edit files on terminal. However it's very hard to edit so is there a way to open terminal files in TextEdit?
EDIT:
open -a TextEdit <my_file_name> and open ...
76
votes
6answers
135k views
Nano - jump to end of file
I have some long log files. I can view the last lines with tail -n 50 file.txt, but sometimes I need to edit those last lines.
How do I jump straight to the end of a file when viewing it with nano?