What is your favorite text editor?

One benefit of vi(1) is that the navigational commands under less(1) are based on them:
Commands are based on both more and vi. Commands may be preceded by a
decimal number, called N in the descriptions below.
less is also used as the default pager for man(1), which means man commands are based on vi's also:
-P pager
Use specified pager. Defaults to “less -sR” if color support is
enabled, or “less -s”. Overrides the MANPAGER environment
variable, which in turn overrides the PAGER environment variable.
MANPAGER
...
If unset, and color support is enabled, “less -sR” is used.
The commands still vary, and could be better for all mentioned.
 
ee/FreeBSD.
joe/Slackware.
nano/other Linux distros.

I try to adapt to the "way of", and especially to have a non-Vi editor installed by default with the base system.
I hate when I have to redraw the screen in ee to display the chars correctly. I guess it's the legacy of "ready for" unstable remote connections, such as Vi.
 
Last edited:
I would like to know which text editor you use in FreeBSD

editors/vim

because it is a straightforward do-it-all tool and a good brain-trainer.

Once you get the basics, it is comfortable and flexible. Started with vimtutor(1) and two good reference books: Practical Vim (Drew Neil), and Mastering Vim Quickly (Jovica ILic). Follow @vim_tricks and @MasteringVim at the X-site and their newsletters to get goot tips!

To make print output in PDF, I use daring fireball markdown and a bit of LaTeX (Leslie Lamport; Goossens e.a. references) and textproc/hs-pandoc to process the `.md` file. There is no combination that can beat that -- in the ease of texting and typography/layout.
 
... and a good brain-trainer.
Agreed. If anyone having not at all knowledges about vi accidentally invoked vi (or something else blindly invoke it to edit something for it), the person should panic as of no knowledge about how to exit from it.
vi teaches very, very important knowledge, "Read its man pages carefully from top to bottom before invoking it!".
 
nano hands down.

I prefer to avoid installing extra crap if I can help it though, so usually just learn whatever comes with the base OS.

I still remember the first time I encountered vi thinking "WTF is this?" -- insert how do I exit vi meme :D

Can't help thinking we might be losing a good chunk of potential users by not having a more user friendly default text editor though. Then again, maybe it's for the best -- if you can't bother to figure out vi maybe that's a good thing -- go to Windows.

Anyway, long story short I learned how to exit vi so I'm happy :)
 
Maybe there are some improvements we could adopt as a community that were NOT invented 50 years ago?

Old tech doesn't need to be bad per se. Some things invented a long time ago might still have a day to day purpose.

Once I read a discussion wether sysutils/screen or sysutils/tmux is better. The argument was that tmux is under active development and screen not, so tmux was better. That argument is BS IMHO -- screen still does what it needs to do and has no issues, no need for new features. So development stops. Because the software is still good.

As with text editors, some might argue to add new frills. But are they necessary for the core of that where the software is aimed at? Doubtful. With vi(1) etc, we talk basic pocket knives here. The ones without a can opener or screwdriver. Suitable for TTY.

As with editors/vim the core still uses HJKL-navigation from the 1970-ies. So what? If you feel the urge to use more modern shortcuts, you can install a plugin. Ready to use Ctrl-C, Ctrl-V when you like. Or emacsisize navigation. Customized instead of modernized.

'Innovation' with ribbons, hidden menu's and doing spreadsheets in a text processor isn't core texting. Developments as such should be left to Redmond and other do-it-all office software. Even in those cases proper development is a laugh -- MS Word suggests it can do layout of documents, but makes it a bigger mess every release. The program isn't suited for pre print layout. Not even in a simple business office environment. Apart from the keybinds that are far from consistent.

In a commercial environment, 'development' is used to keep sales up, as Joe Doe wants tho have the newest features (even when he doesn't use them). In some FOSS corners, it is used to keep pole position on the number of users (often with bloathed results like Firefox). Old fashioned programs aren't interested in that rat race and keep their core functionality.

So respect the core of functionality. Even if it was invented decades ago.
 
… 15.0-CURRENT WITHOUT_VI. …

Simpler than building WITHOUT_VI: use pkgbase, then (below) delete the packages.

Code:
root@mowa219-gjp4-zbook-freebsd:~ # pkg delete FreeBSD-vi FreeBSD-vi-dbg FreeBSD-vi-man
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 3 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        FreeBSD-vi: 15.snap20240202190806
        FreeBSD-vi-dbg: 15.snap20240202190806
        FreeBSD-vi-man: 15.snap20240125183519

Number of packages to be removed: 3

The operation will free 1 MiB.

Proceed with deinstalling packages? [y/N]: y
[1/3] Deinstalling FreeBSD-vi-man-15.snap20240125183519...
[1/3] Deleting files for FreeBSD-vi-man-15.snap20240125183519: 100%
[2/3] Deinstalling FreeBSD-vi-dbg-15.snap20240202190806...
[2/3] Deleting files for FreeBSD-vi-dbg-15.snap20240202190806: 100%
[3/3] Deinstalling FreeBSD-vi-15.snap20240202190806...
[3/3] Deleting files for FreeBSD-vi-15.snap20240202190806: 100%
root@mowa219-gjp4-zbook-freebsd:~ #
 
Simpler than building WITHOUT_VI: use pkgbase, then (below) delete the packages.
If you are going to Frankenstein your install, just a simple:

# rm /usr/bin/vi

would have sufficed.

If PkgBase ever becomes the norm, this forums should probably add a "Non-standard Installs" section.
 
also worth mentioning that there are a lot of plugins available for vim. and i mean lot!

there is the vimawesome page for example, and with a plugin
manager like vim-plug the majority of plugin installation is often doable by adding one line to the vimrc file.

probably the most versatile editor available. i've customized it to do spell checking, code auto completion, syntax highlighting, and others depending on my needs. apart from that, every time I switched to another editor, I would return to vim because of how genius the macro capabilities are. of course vs code and friends can handle search and replace, etc, but having to rumage around the gui to find the button that does what I want is annoying, especially since most of the time I just want to employ a one time series of text transformations that it wouldn't make sense to include button for.

and one other thing - mouse independence :)
 
pkg info -D turbo
Code:
* `xsel' or `xclip' for clipboard support in X11 environments
pkg install xclip
and
turbo /tmp/test
type text, then select text -> Ctrl-C
in terminal
xclip -out -selection clipboard

in terminal
echo TEXT | xclip -in -selection clipboard
in turbo
Ctrl-V

Edit: pkg install xsel-conrad
xsel --output --clipboard
echo TEXT1 | xsel --input --clipboard

# This is a post for #442, but #442 has been edited several times.
# Is it to ignore me. I'm not looking for a response.
 
Last edited:
On vty (vt, not sc), selection (by dragging) and paste (by middle click) with mouse caused first 1 character only to be pasted. Unfortunately, unusable here. Maybe some gadgets or key binding of shells used would be needed.

On X, attached non-default configurtion of deskutils/clipit looks not so bad.
Selection by dragging on su'ed window (started with regular user, then su(1)) could be pasted by ^v on editors/turbo (another window, regular user).
The same operations worked for copying from a window invoked with sudo mate-terminal.
ClipIt_Preferences.png
 


editors/joe

joe(1) <https://man.freebsd.org/cgi/man.cgi?query=joe&sektion=1&manpath=freebsd-ports>, strangely appears without the section number when installed:

Code:
% man -P cat 1 joe
JOE()                                                                    JOE()

NAME
       JOE - Joe´s Own Editor

Syntax
       joe [global-options] [ [local-options] filename ]...
       jstar [global-options] [ [local-options] filename ]...
       jmacs [global-options] [ [local-options] filename ]...
       rjoe [global-options] [ [local-options] filename ]...
       jpico [global-options] [ [local-options] filename ]...

Description
       JOE is a powerful console screen editor. It has a "mode-less" user
       interface which is similar to many user-friendly PC editors. Users of
       …

– please, someone should make a report (the second of the two bug icons in FreshPorts).

In Novice-friendly alternatives to ee (easy editor) in Discord, JOE is suggested. I was disoriented, edits messed up through guessing what's required to quit, in the absence of a menu.

Eventually I found a way out:

1708251203658.png
 
I've become a big fan of emacs over the last few months even though it can be frustrating to use it sometimes because it's so complicated, although love learning new possbilities that it offers. But one thing I would like to change is how to mark, copy, paste, delete.

I'd much rather use shift + cursor keys to mark an area and then C-ins to copy and S-ins to paste.

Anyone know how to bind keys to do that?
 
I think ee is pretty easy and simple. I was using nano when I was running Linux. I think neovim seem really good with the config of nvchad project. For example, you can see hex colors directly in the editor. I use neovim for now.
 
I use vi/vim, because when I was a baby sysadmin, my mentor said "you can use whatever editor you want, but at the end of the day, when you are trying to recover a machine, and world is on fire, emacs is not going to be available....So at least be familiar with vi."

Like aliases, I don't do a whole lot of vim mods, beyond basic editing templates for, say, yaml to ease writing ansible playbooks, because I am on multiple machines every day, where my vim mods may or may not be available.
 
because I am on multiple machines every day, where my vim mods may or may not be available.
It would be what your mentor really wanted to teach you. ;)
My vote is that vi is worth learning, but not as the default editor of default installation.
My guess for FreeBSD nowadays is that vi shouldn't be the default but learning bare minimum usages are mandatory AFTER INSTALLING AND CONFIGURING WHATEVER YOU AND OTHER USERS NEED AND RUNNING.
Even me remember i, ESC, h,j,k,l, BS, ZZ and :q!.
 
Back
Top