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
2answers
72 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.
1
vote
0answers
57 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 ...
0
votes
1answer
132 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
15 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
34 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
32 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
47 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
22 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
32 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 ...
1
vote
1answer
59 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
0answers
12 views

How to determine what my bookmarks were after browser reset to default?

I blew out my browser when I improperly restarted my desktop. I was able to to find my bookmarks in Nano, but because they were in folders, their urls are not available to see in Nano. Below are the ...
0
votes
1answer
195 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 ...
3
votes
1answer
188 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
139 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
378 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?
5
votes
1answer
5k 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
491 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
54 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
103 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
126 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 ...
2
votes
2answers
517 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?
3
votes
2answers
2k 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
38 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
257 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.
15
votes
1answer
11k 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
67 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" ...
4
votes
1answer
4k 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
177 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 ...
1
vote
1answer
1k 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
579 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 ...
3
votes
1answer
3k 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
143 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
108 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
330 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
542 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 ...
0
votes
1answer
733 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 ...
41
votes
6answers
81k 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?
2
votes
2answers
1k views

Why is /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed not modifiable by sudo emacs?

I would like to edit /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed to change its content from 800000 to 1600000. I first try with emacs $ sudo emacs -nw /sys/devices/system/cpu/cpu0/cpufreq/...
0
votes
2answers
184 views

Echo something to console each time you quit crontab

To edit the root crontab in Debian I do for example sudo crontab -e. To exit from the preferred text editor (Nano), I do CTLR+X. So far so good, but what if I want that each time I exit crontab, a ...
2
votes
1answer
92 views

How to make 'emacs' indent with tabs exactly how 'nano' does…?

How can I configure ~/.emacs so that I indent how nano does by default? Uses a tab character instead of 5 spaces I can add as many tabs to a line as I please
0
votes
1answer
164 views

How to edit files in text editor and not terminal when using nano command? [closed]

So when I use nano it opens a little interface to edit the file. However, is there a way to open the file with text editor?, as that is much easier to edit, navigate and save.
27
votes
3answers
4k views

How to get rid of “nano not found” warnings, without installing nano?

Installed Debian Stretch (9.3). Installed Vim and removed Nano. Vim is selected as the default editor. Every time I run crontab -e, I get these warnings: root@franklin:~# crontab -e no crontab for ...
-1
votes
1answer
2k views

Cannot Save ~/.bash_profile file

As the attached picture shows, Ctrl+O or Ctrl+X does not save the ~/.bash_profile file. Notice the dot on the red circle for closing the window. I also tried other editors such as vim and emacs and ...
4
votes
2answers
8k views

GNU nano 2: DOS Format or Mac Format on Linux

Which format (Mac or DOS) should I use on Linux PCs/Clusters? I know the difference: DOS format uses "carriage return" (CR or \r) then "line feed" (LF or \n). Mac format uses "carriage return" (CR ...
2
votes
1answer
110 views

Use keyboard shortcut automatically in nano? [duplicate]

I'd like the line numbers to show automatically whenever I use nano. I've seen the set const command in ~/.nanorc but I want to see the line numbers in the column to the left, activated by meta-# ...
-1
votes
2answers
513 views

Re-bind alt left/right in nano

I'd like to rebind the alt-left and alt-right keybindings in nano, can't seem to get it to work. I'm on ubuntu 16.04 my ~/.nanorc file: bind M-right nextword main bind M-left prevword main version ...
2
votes
4answers
1k views

How do I make nano act like vi when it comes to text wrapping?

When using vi and long lines, the text are wrap but vi doesn't insert a CR/LF at the end of the line. With nano, if I start typing and the line becomes too long, it will insert CR/LF at the end of the ...
1
vote
1answer
1k views

nano - soft wrap at 80 characters

I would like nano to soft-wrap at 80 characters. That is, as I keep typing, the text should flow to the next line beyond 80 characters, without nano insert a \n newline at 80 characters. set softwrap ...
1
vote
1answer
977 views

How to copy and paste in nano editor with mouse enabled? [duplicate]

In normal mode, I can use mouse left button to copy and right button to paste, but not with mouse mode: -m --mouse Enable the use of the mouse Is copy/paste still possible with mouse ...
1
vote
2answers
848 views

Arch linux + I3 + URXVT: ROFI opens nano editor in bash instead of URXVT

The bash script that uses ROFI is: xdg-open "$(locate home | rofi threads 0 -dmenu -i -p "locate:")" This works fine from URXVT (command line), but when I bind this to a key and open ROFI, Every ...