What is your favorite text editor?

MC is great because of colors. Old school
Didn't realized that Midnight Commander worked as an editor .... ;)

I use everything at least once:
VI
VIM
NeoVIM
EE
ED
MC
Gnu Emac
Doom Emac
Nedit
Notepad++
Nano rarely.... Was the first one I used when starting on Linux/Unix systems... Back then VI/VIM seem like dark voodoo aka too complex at that time...

Now I strictly use vi/vim (I am lazy) as my go to, as it's easiest to use amongst multiple OS (no installation required)....
 
I'm no expert but I've used emacs and vim as my main go to text editor when doing things. I found freebsd and been using ee very simple and easy. Emacs keys are a go.
 
I'm using notepad on Xorg and ee on ttyv* consoles.
For heavier usage, I still cannot find suitable editors/IDEs.
What I, at minimum, want is to navigate properly on FreeBSD sources.
Essentially, look for definitions of functions, macros, variables, constants and types automatically by analysing source file, header files included and makefiles they are picked from.
If I recall correctly, devel/sourcenav, which is abandoned upstream, broken for a while and deleted from ports, could do the job AS A VIEWER.
 
Acme, and occasionally sam or ed.

See the acme screencast at
https://research.swtch.com/acme

Acme and sam are very (three-button-)mouse-centric in a way that, to this user, feels exactly right, especially if sam is patched to use acme's mouse chords; and the edit commands work with structural regular expressions.

Both were written by Rob Pike and are included in the Plan 9 operating
system. For FreeBSD they are available through devel/plan9port, or
directly from https://github.com/9fans/plan9port.

There is documentation at
http://acme.cat-v.org/
http://sam.cat-v.org/
http://doc.cat-v.org/bell_labs/structural_regexps/se.pdf

Mark.
This is exactly what I use. Acme is a great editor and I recommend everyone trying it for a few days, it won't click immediately and you will get frustrated. I use it mainly and vi when I'm in the terminal. I've been trying to use micro in the terminal, but honestly vi is faster to use with the hotkeys.
 
Didn't realized that Midnight Commander worked as an editor .... ;)

I've been using MC's builtin file editor, mcedit for years and it's fine for minor changes, although you can configure mc to use ee, or anything else if you wish. But I've finally decided I need to learn a proper text editor like emacs, although it takes a lot of learning and it is defintely hard work and I regret not putting lots of time into getting to grips with it years ago.
 
I use vi, but there's one thing I don't like about it, that to edit the beginning or end of a line, every time, I have to reset the function to reinsert text. When I move the cursor to the first or last letter or character in a line, it goes from insert mode to command mode, and I have to set it back to insert mode every time. This can be a little annoying when I have to insert or remove hashtags out of multiple lines, for instance in KERNCONF files.

Other than that and the occasional accidentally running a command when I wanted to type the letter in insert text mode, I'm accustomed to it. I also have to configure it, so it will tell me in the bottom right corner, which mode it's in. This has been covered many times, and perhaps also in here, but I have to have this set when using vi: ~/.nexrc
Code:
set showmode
set verbose
 
Does Code - OSS come close? (I'm clueless.)
Unfortunately, it didn't work as desired, at least on FreeBSD.
I found a printed magazine introducing vscode here in Japan, and according to it, vscode seemed to support my wanted feature, but installing and trying it, didn't worked as described in the article. It was, if I recall correctly, around half a year ago.
 
I use vi, but there's one thing I don't like about it, that to edit the beginning or end of a line, every time, I have to reset the function to reinsert text. When I move the cursor to the first or last letter or character in a line, it goes from insert mode to command mode, and I have to set it back to insert mode every time. This can be a little annoying when I have to insert or remove hashtags out of multiple lines, for instance in KERNCONF files.

Other than that and the occasional accidentally running a command when I wanted to type the letter in insert text mode, I'm accustomed to it. I also have to configure it, so it will tell me in the bottom right corner, which mode it's in. This has been covered many times, and perhaps also in here, but I have to have this set when using vi: ~/.nexrc
Code:
set showmode
set verbose
From what I understand if you are moving the cursor, you just entered Command mode? Or am I misunderstanding your issue?
 
From what I understand if you are moving the cursor, you just entered Command mode? Or am I misunderstanding your issue?
If you move the cursor to the beginning [←], or end [→] of a line to enter text there, vi goes into command mode. Only if you move it to the ends of a line, and also which happens less often, moving the cursor to the top or bottom of a text page. There's an exception, if you get to command mode (often through that way), then use the insert command, it lets you use the keypad once to go to the end, and stay in insert text (or append) mode. This doesn't happen simply by moving the cursor with the directional pad to anywhere else.

#hashtags in configuration files are commonly at the beginning of lines. Removing or adding them, requires using the directional pad to get there to the start of that line or row. It doesn't happen at the start of every character or word, it's only applicable if that's at the beginning of a line.
 
Seems like a bug;
vi has always been like that since I have used FreeBSD, as far back as FreeBSD 6. Not sure if this is how vi acted under Linux or any other OS as well, but I think it was. I didn't know it was a bug, but could be seen as a bug, as it could use an improvement.

What would be a solution on how to enter command line mode automatically, using the arrow key at the end of a line 5 or 10 times, instead of once? Or simply removing the ability to get to command mode by using the directional pad at the start or end of a line, or top or bottom of text page. If that functionality were removed from going left to the beginning of a line in itself would make it better than other versions.

I would file a bug for that, even if it's not an actual bug and could use the improvement alone. Some discussion beforehand on a good way to make the program run would help.

Also, a bug report to hopefully add .nexrc options to show the mode as default. Considering that the editor was replaced as default, they may not accept this one for that no longer default program, as it would no longer be used by default for installs. They might accept a bug for system wide nexrc, in /etc/, /etc/rc.conf or /usr/local/etc/. I would like that, at least.
 
vim handles this as you'd expect (though I don't use it so didn't test it thoroughly).
vi has always been like that since I have used FreeBSD, as far back as FreeBSD 6.
The behavior *is* surprising so I'd consider it a bug. May be not a feature people care enough about to report it.
 
Emacs.

There are few things better than Emacs with a dotfile full of customizations and gadgets accumulated over decades.
 
  • Thanks
Reactions: dnb
Seems like a bug; would you mind filing a bug report?
The behavior *is* surprising so I'd consider it a bug.
PR 275400. I was thinking if that was how it was meant to work before, as it's worked like that since over a decade, it can be improved, similarly to how sh's functionality has been improved.
May be not a feature people care enough about to report it.
I think they cared, it's just that it was the norm and they thought it as so. That's how I saw it, not as the traditional definition of bug, but still as an annoyance.


As for vi(1) showing the status of insert/append, or command, I've found that I can move the contents of ~/.nexrc to /etc/vi.exrc for system wide settings. It would make more sense to make the status display to be the default, if vi were still used with the installer. I thought about making a bug report for this, but using a system wide location is what I wanted, vi is no longer the default for the installer, and a change like might not be accepted. It would still be good to have this as a default. I could make a bug report for this too, if it makes sense for others.


I also edited how I have my vi configuration file, /etc/vi.exrc:
Code:
set verbose showmode ruler
All in one line, and added so that it shows the row and column. I wanted one to show the file and directory name, for the few times I forget which file under which directory I'm editing, but the argument available only adds a filename to the window.
 
The behavior *is* surprising so I'd consider it a bug. May be not a feature people care enough about to report it.
That is the vi, namely nvi, that I know. And vi is, as far as I know, a POSIX standard.

On OpenBSD nvi has the same behaviour. I think, the original vi is in Solaris, but I do not have a
machine running Solaris.

Perhaps someone could test this:


I have the link from Wikipedia.
 
IIRC, the original vi didn't allow navigation while in insert modei, as you had to use h,j,k,l commands (because LSI ADM-3A terminals had directional arrows on these 4 keys). Navigation in insert mode was probably first added in nvi -- you'll have to ask Bostic.
 
but I do not have a machine running Solaris.
There's no more Solaris or OpenSolaris. They ended and became OpenIndiana.

I looked up OpenIndiana's manpages, and vi and other vi related entries refer to vim,: http://openindiana.polarhome.com/service/man/?qf=vi&tf=2&of=OpenIndiana&sf=1. There's also two packages one for vi and another for vim. I don't know what it means, when they have two packages (one possibly in base as labeled under the locale category), and there's only one manpage. I don't know how to look at which vi is in their base system, and if that one is locale. Though, it doesn't matter, because there's an answer for on FreeBSD.


bakul it seems like you were unaware of vi's behavior that's been this way for a long time, about the arrow keys, but later know more about the function of a previous version of vi.
IIRC, the original vi didn't allow navigation while in insert modei, as you had to use h,j,k,l commands (because LSI ADM-3A terminals had directional arrows on these 4 keys).
 
[FONT=monospace]bakul[/FONT] it seems like you were unaware of vi's behavior that's been this way for a long time, about the arrow keys, but later know more about the function of a previous version of vi.
I started with vi on Unix version 7 so I automatically hit escape if in insert mode if I want to move the cursor!

One reason for not using motion commands while in insert mode: the "." (redo) command only redoes the insertion in the last line (*if* escape was hit in that line and not after moving the cursor). Most everything else (designed by Bill Joy) fits together very well but this is unintuitivei It also not a very useful command -- forces you to go line or character at a time between insertions in separate places. An expert vi user willy usually use the right (sequence of) command(s) to quickly reach the location he wants.
 
After more than 10 years of using vi, I have come to the conclusion that its use is conceptually incorrect. In other words, it is not needed at all.

An important feature of vi and vim is a special way of controlling movement through the code and actions with text using modes like hjkl and other hotkeys.

Over the years, this way of working with text was copied by everyone who was not too lazy to do it, and it was integrated into various IDEs and other editors. For example, there is an implementation of a package in Emacs that I could not find any shortcomings compared to vim (I decided against using this package for ideological and performance reasons).

So this particular vi-like way of controlling is no longer the highlight of vi or vim. What's left? The presence of vi in any minimalistic, freshly installed system out of the box, so that you can initially correct the configuration (for example, enable access via ssh)?

For this purpose there is ed(1), which is the standard Unix text editor.

I've personally checked for ed(1) on all common BSD systems out of the box: FreeBSD, NetBSD, OpenBSD, DragonflyBSD have it installed right out of the box. I also checked its presence in various Linux distributions, although this is not relevant: if it suddenly did not appear in Linux distro, then what?

After ed(1) has done its job of, for example, configuring network access to the machine, Emacs, located on the control machine, takes over.

So I don't think it's necessary to use vi or vim at all. The only feature I like is vimdiff, a very reliable diff tool.
 
I've personally checked for ed(1) on all common BSD systems out of the box: FreeBSD, NetBSD, OpenBSD, DragonflyBSD have it installed right out of the box. I also checked its presence in various Linux distributions, although this is not relevant: if it suddenly did not appear in Linux distro, then what?
Annoyingly I can't find the specific mail from the lists. They removed ed from the Debian "base" for a very vague reasons of something along the lines of:

Users wouldn't be astonished if ed was not in base
- approved SomeDev

This didn't quite sit well with me. I only rarely use ed (mostly when in a very limited ramdisk environment or when using a dodgy serial connection). However removing it so flippantly just contributes to the Linux ratty duct tape nature.
 
Back
Top