Text editors to use

Hello.
I am new to linux (not used ever) and Qubes (almost 6 months now). About 15 days back I switched to minimal templates and I am using gedit as my text editor. My question is somewhat not related to Qubes directly but I wanted to ask it here.
I wanted to use more lightweight text editor then gedit. I tried nano but I’m not comfortable in that. So I wanted a suggestion for text editor which is really light weight and with not many dependancies. It should allow clipboard paste like basic tasks.
One more thing does it matter that softwares we use, are written in memory safe languages?

I suggest Vi[m].

1 Like

Hum. Nano is pretty basic once you get the hang of ctrl+x and then “Y” for saving it. Vim is more challenging to get started. But vim exists by default on all templates.

I second @adw’s suggestion Vim is a good baseline to learn as not just on Qubes but other systems all generally will have vi or vim installed by default. Pretty sure there are good cheatsheets on the web to help you learn it in a timely fashion. Good luck.

This is a good cheat sheet.

Absolutely the best introduction to vi is Jim Dennis answer on Stack
Overflow

It gives you a good view of using vi(m) and many useful pointers.

Jon Beltran de Heredia has another useful piece to help you get started
with vi(m)
Why, oh WHY, do those #?@! nutheads use vi

Because vi runs in the terminal, it supports use of the clipboard.

There are two major schools of thought when it comes to editors: vi and emacs.

You should carefully choose your side, because these two operate on a very different way, and jumping from one to another makes normal people insane.

Luckily, in Qubes dom0 there is something available both of these camps: vim for vi people and nano for emacs folks.

I’m definitely emacs guy, but I also know vi quite well. Some environments really have only vi, so it’s good to know basics. It’s just so difficult to switch the mindset from one to another. Many of us know what I’m talking about: start editing something in vi and hit ctrl+a (or some other emacs key) and the editor goes nuts. Or the other way around: in nano try to do :w or similar.

So pick your poison and choose it wisely: vim or nano.

Hi there again fellas,
So I tried to learn Vi. It was quite good to learn. I learnt many things and now I can create text files in Vi with all basic things. Then again the original issue remains.
I have tried many online resources to know how to paste from VM clipboard to Vi text file, but no success yet. No online info about that. Can someone well versed in Vi please provide me with, how to do that?
Any help is highly appreciated, Thanks.
Regards

shift+ins works fine for me.

Hi @mebraska ,

To complete the @fsflover answer…

Vi commands for copy/paste are dd, dw, p, … See the vi documentation for these commands.
BUT theses commands are for copy/paste inside vi (vi internal clipboard). You want to copy/paste from Qubes clipboard. I imagine you already know Shift-Ctrl-C and Shift-Ctrl-V.
Now you should understand how to do a copy/paste from/to your terminal (which run vi). So it depends on your terminal application: xterm (copy: selection, paste: middle click), gnome-terminal (see Edit menu), … So see the documentation of your terminal.

@mebraska , read also the below topic:

turkja via Qubes OS Forum qubes_os@forum.qubes-os.org writes:

There are two major schools of thought when it comes to editors: vi and emacs.

You should carefully choose your side, because these two operate on a very different way, and
jumping from one to another makes normal people insane.

Luckily, in Qubes dom0 there is something available both of these camps: vim for vi people and
nano for emacs folks.

I’m definitely emacs guy, but I also know vi quite well. Some environments really have only vi, so
it’s good to know basics. It’s just so difficult to switch the mindset from one to another. Many of
us know what I’m talking about: start editing something in vi and hit ctrl+a (or some other emacs
key) and the editor goes nuts. Or the other way around: in nano try to do :w or similar.

So pick your poison and choose it wisely: vim or nano.

Emacs is also available, you only need to install it with
sudo qubes-update-dom0 emacs
And you have emacs-25 in dom0. You can have earliest versions in AppVMs.

Emacs is a text editor but also a Lisp interpreter and a platform to
build and use softwares. So it is not as minimalist as Vi(m)? but provides
much more usages. For instance I send this mail using mu4e within Emacs.
(Not all my AppVM have this soft installed.)

I live happily with emacs compiled from source in all the VMs where I
need it, it slowly eat most of my needs since 2 years. Wait another year
it maybe would have eat myself. :wink:

If you want a better nano, I highly recommend micro, it has a very natural keyboard bindings that it feels like you’re using a GUI editor, and its mouse support is great.

The middle mouse button is generally a pretty reliable way to paste in a Linux environment.

But make sure you’re in text entry mode in Vi[m] first. For example, press i first.

1 Like