How to customize Nano Editor?

I recently had to get well acquainted with the Nano editor used in the default QubesOS stock build, and started to wonder how to tweak a few things.

I am currently attempting to have the cursor stay blinking forever, instead of stopping at a certain interval. However, the instructions I found don’t seem to work for that as the instructions claimed it would do.

I am also attempting to show the line numbers, but I am unsure how to test if what I did so far works or not.

This is what I got thus far:

The only other thing I would like to know is how to customize the Nano editor to launch and open up at the size I want it to so not to have to manually resize it to my liking every time I have to do stuff in CLI.

Thus, 3 custom settings I would like to start me off comfortably in my Qubes journey:

  1. make the cursor never stop blinking (it stops, I don’t want it to stop)
  2. I want line numbers on the left hand side to appear
  3. I want to open the Terminal and have it open at the exact window sizing of my choosing (height and width)

I have no idea how to do this but I know it can be done, because I found some sources to try but the other thing is I have no idea how to proof if what I did is working — other than my cursor still stops so maybe these changes are not working :frowning:

Look at a text editor called " Micro", it is in some ways better then nano and Highly Customizable.

1 Like

I currently do not have “safe” internet access for my computers yet (recovering from a nasty Cyber Attack), so I can’t install anything right now until fully setup. Plus due to my Threat Model when I get back fully online I am hesitant to install programs from an ecosystem I am brand new to, as I am new to QubesOS and all its accessories/ecosystem — granted I am familiar with various Debian distros apps such as GIMP and Inkscape.

I would have to do research on whatever I install to make sure it isn’t an easy exploit for someone to break through to the Dom0/ROOT

Hmmmm

Sorry, I know you are helping but I want to try to stay with the default Nano because Qubes team must have chosen it for a reason I am guessing and I need to stay both private and secure as my attacker is still actively trying to Cyber Stalk me

With that said when all this drama dies down and/or if I feel safe with the security and privacy of my newly hardened setup, I noticed in my research an Editor app called “White Rabbit Neo” but would have to make sure it’s attack surface is minimal and/or what exploits it currently suffers from to feel confident in mitigating anything … I am aware that Qubes does a lot to keep me safe but I don’t want to compromise the hard work baked into QubesOS by choosing the wrong apps that might erode such a security masterpiece for now (maybe later).

I was thinking of “White Rabbit Neo” only because I like doing front-end web dev stuff, but am a visual person so wanted something similar to how Dreamweaver auto color codes various code like it automatically detects HTML vs CSS vs scripts like JavaScript etc (doesn’t seem to color code PHP though sadly). I been using Dreamweaver since before Adobe bought them out, and once I am reset up wanted a similar thing on Linux but not sure if that will ever happen. Anyway, the Terminal is different for me so I don’t care about the Dreamwaver stuff there and can live with Nano if I have to — it would be really nice to have Line Numbers in the Terminal when it spits out long listed return info though and a resizing preset upon launching the Terminal window.

Thank you, hope you better understand why I am for now sticking with Nano (nothing is online, I am on a phone on cellular data and this phone will also never touch my new equipment in case he ever finds this phone like he did my previous phones and phone numbers)

Not a real answer, just a suggestion: if you’re looking to customize a text editor already present in Qubes OS, I think that vim may be an alternative to nano? It’s highly customizable though it could be painful to learn how to use it. If you want to try it, run the offline tutorial with:

vimtutor

Type :q to quit

About this:

I am also attempting to show the line numbers, but I am unsure how to test if what I did so far works or not.

What do you mean? Restarting nano should show you the line numbers.

1 Like

Hello there!

That might be true, however, it could also just be coincidence IMHO. Some implementations might have been made that aren’t completely understandable with current view of some people, e.g.:

But I would definitely agree with you that installing unnecessary / untrusted apps into dom0 poses an unnecessary risk! I wouldn’t install any other text editors than already preinstalled in dom0.

Are you sure that you want these settings applied in dom0? You shouldn’t be doing there all to much anyway.

For your cursor problem:
I would suggest, this is very likely an xfce4-terminal setting, rather than nano.
Actually, stopping the cursor seems to be literally a “power saving” feature…
So here the workaround (adapted from here):

  1. enter xfce4-settings-editor in the appvm (or in dom0 i guess)
  2. select “xsettings” on the left side
  3. click on “add” on the lower part
  4. enter as property “/Gtk/CursorBlinkTimeout”
  5. set the Type to “Int”
  6. enter as Value a large number, but less than 2 billion
  7. click save
  8. enjoy your cursor:)

But again, please think well if you want to make such configs in dom0 at all.

1 Like

I currently lack internet connectivity for my Qubes laptop until I finish setting it up along with my new hardened network (will take a while, as I will be deploying LAN firewalls that I am also new to along with being new to Qubes). So I am only using Nano for now, and for security reasons might just stick with Nano as it is the stock default in Qubes (there has to be a reason/logic as to why the Qubes team picked this over other Editors to deploy on stock default is my guess)

As for loading the line numbers, I don’t know how to check. What method can I do to run a check in the Nano editor / Terminal so to see if it is now enabled? I haven’t been seeing line numbers, but I haven’t dared opened up a new file yet either as I mostly been in the Terminal. Does this “line number” feature only apply to file editing and not to Terminal emulated outputs?

I have no idea what I am doing btw, I am new here.

Just for your information: vim is also included by default.

2 Likes

Next problem: Line Numbers
Turns out (i am also new to this using vim), you have a config file in /etc/nanorc AND in ~/.nanorc. If the template copies its home directory with the settings to the vm the first time it also includes the config files I guess (not sure if this thought is correct).

BTW: if you have settings in the ~/.nanorc, they will overwrite the settings in /etc/nanorc

to enable line numbers: in the .nanorc file write: “set linenumbers”

For a general example of a nanorc file I found: Some Useful GNU nano Settings

1 Like

I was unaware of VIM being in the stock default build, wow! I hear VIM is like super advanced and has a learning curve. I just yesterday barely learned how to exit and save in Nano lol, as I had no idea “^” meant “cntrl” until I read documentation after being frustrated.

BTW,
will try your instructions here soon-ish.

And yes, I don’t plan on installing “White Rabbit Neo” into Dom0, likely will install it into a Debian Template later when I get up and running so to finally work on my NFT website again.

alright, good luck with all that! Seems like you have a lot of learning ahead…
If you have any questions just ask!
Also: I made a mistake in the last post: its not /etc/.nanorc but /etc/nanorc
There should already be a line with set linenumbers that you can uncomment

Edited it to make it correct in the first post as well

1 Like

Just a general advice: create a test-terminal-things or whatever you want, open a terminal in it and play with it as much as you want. At any time, you can delete the VM and start a fresh one, or run several VM like this, it’s Qubes so don’t be afraid to do that, as long as your experiments stay inside the test VM.

2 Likes

actually I did exactly this with a disposable vm!
nice tip!

1 Like

Good idea!!! Thank you

:smiley:

Regarding the last question (size): you can just change that in the terminal settings:

  1. open menu “edit”
  2. open menu “preferences”
  3. open tab “appearance”
  4. under default geometry, enter your wanted size.

Now thinking again… maybe the home directory gets copied to its children as well (at the first time), which would make it possible to edit all this in the template in the home directory (not in root) and still have the inheritance effect.

1 Like

Yes, /etc/skel from template is used to create /home/user in AppVM.

2 Likes

Had no idea, now I know to open up the old one to see what I should copy over lol

THANKS :hugs:

Having a few tweaks will make my new admin account environment feel homey to at least take the stress off a bit from what I am having to deal with especially when needing to perform admin tasks which I hate CLI as I am a GUI fan but know not everything is in the GUI so I just have to deal with CLI

I know this isn’t important, but this is for keeping my own sanity alive lol

Thank you so much

taking notes here and locally
:slight_smile:

Yes, because I have succumbed to being required to do certain things in CLI as ROOT while setting up the admin account as well as attempting to figure out how to lock down the 2nd and 3rd accounts to restrict them from su, sudo, and ROOT escalation while still somehow keeping the top bar and qube Templates loading by still having it come from the “qubes” usergroup but like that user group is part if the sudoers so like I am currently trying to figure out what to do via other threads on this Forum and sources given to me so far … the point is, I am unfortunately working a lot right in Dom0 Terminal as ROOT setting things up how I need/want them to be after this I likely will never have to revisit here until I make my rounds for security purposes … I will eventually just use a text editor in my “web dev” qube Template lol and likely that is it until I make $ back. Once I am sitting on a cushion of living funds again, I will one day make a new user with a qube template to learn more programing stuff as I haven’t finished learning Node.js yet for example — none of which should ever require Dom0

I am just temporarily right now a lot in Dom0 during the initial setup phase kinda thing

Was unaware of its use to save power, in that case I guess I will keep the curser as is. It is just I am use to it always blinking on other OSs so when I see it not blinking my mind jumps to “oh no my screen froze” but I guess I will just get use to not thinking this then so to save on battery use and battery lifespan

However, are these the same directions to make this custom tweak inside a Templated qube Nano text editor?

The place I would want it most is in the qube Template I plan to do text editor stuff in once I finish the admin stuff and move on to actually using my new computer to function and make an income again

.
.
.

Now, Linenumbers is what I want anywhere I go be it Dom0 or in my qube Templates. This is for my own sanity :sweat_smile: thank you again so much

From the source you gave

Blockquote

set constantshow    # Displays useful information e.g. line number and position in the bottom bar.

That appears to also be an option to implement

I finally have line numbers in Dom0!

Oddly though, now this is showing how a prefer in Dom0 but when I am in ROOT it does not show. So now I think I need to actually follow all the directions you gave for “xfce4” above. But I been in Dom0 mostly not ROOT except in a few command things when I was trying to repair the damage I did renaming the 1000 ID admin so like maybe I don’t HAVE TO have it in ROOT as I been mostly in Dom0. Plus, when I open the file as seen in the image, at the bottom be I in Dom0 or ROOT it says that the nanorc file for ROOT cannot be “written” to. Again, is the work around the “xfce4” instructions you gave then?

Moving on,

This worked!

For the more visual people, here are the instructions @boreas gave in images:

Then CLOSE and re-open:
(example of new “resize” default upon open)

AND DONE all to my liking
:slight_smile:
THANK YOU SO MUCH :pray:t3:

I am still perplexed as to why I can’t make the linenumbers show up when opening nanorc file as ROOT, it has #linenumbers enabled I saw but apparently fails to “write” to implement the settings?

Again, all the instructions given worked for Dom0 and likely even qubes (I haven’t set my qubes up yet)
YET
for some reason the same exact preferences don’t save and/or execute while in ROOT for ROOT’s Terminal settings using Nano editor

See:

ROOT

vs

Dom0


(Dom0 now shows everything I asked for help here, but ROOT does not)

I am unsure why but this Forum Thread is not letting me pick any posts here to mark as “solved”

:frowning:

You were in “General Discussion”, I moved it to “User Support”. You should now be able to mark it as solved.