Skip to the content.

6. Editors


This chapter is referenced in the LFS book for those wishing to use other editors on their LFS system. You’re also shown how some LFS installed programs benefit from being recompiled after GUI libraries have been installed.

6.1 Bluefish-2.2.12


Introduction to Bluefish

Bluefish is a GTK+ text editor targeted towards programmers and web designers, with many options to write websites, scripts and programming code. Bluefish supports many programming and markup languages, and it focuses on editing dynamic and interactive websites.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Bluefish Dependencies

Required

GTK+-2.24.33 or GTK+-3.24.36 (If both are installed, configure defaults to using GTK+ 3)

desktop-file-utils-0.26 (for updating the desktop database)

Optional

enchant-2.3.3 (for spell checking), Gucharmap-15.0.2, PCRE-8.45 and Jing

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/bluefish

Installation of Bluefish

Install Bluefish by running the following commands:

./configure --prefix=/usr --docdir=/usr/share/doc/bluefish-2.2.12 &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Note

This package installs icon files into the /usr/share/icons/hicolor hierarchy and desktop files into the /usr/share/applications hierarchy. You can improve system performance and memory usage by updating /usr/share/icons/hicolor/icon-theme.cache and /usr/share/applications/mimeinfo.cache. To perform the update you must have desktop-file-utils-0.26 (for the desktop cache) and issue the following commands as the root user:

gtk-update-icon-cache -t -f --include-image-data /usr/share/icons/hicolor &&
update-desktop-database

Contents

Installed Program: bluefish

Installed Libraries: several under /usr/lib/bluefish/

Installed Directories: /usr/lib/bluefish, /usr/share/bluefish, /usr/share/doc/bluefish-2.2.12, and /usr/share/xml/bluefish

Short Descriptions

bluefish is a GTK+ text editor for markup and programming.

6.2 Ed-1.19


Introduction to Ed

Ed is a line-oriented text editor. It is used to create, display, modify and otherwise manipulate text files, both interactively and via shell scripts. Ed isn’t something which many people use. It’s described here because it can be used by the patch program if you encounter an ed-based patch file. This happens rarely because diff-based patches are preferred these days.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Ed Dependencies

Required to uncompress the tarball

libarchive-3.6.2 (for bsdtar)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/ed

Installation of Ed

Install Ed by running the following commands:

./configure --prefix=/usr &&
make

To test the results, issue: make check.

Now, as the root user:

make install

Contents

Installed Programs: ed and red

Installed Libraries: None

Installed Directories: None

Short Descriptions

ed is a line-oriented text editor

red is a restricted ed—it can only edit files in the current directory and cannot execute shell commands.

6.3 Emacs-28.2


Introduction to Emacs

The Emacs package contains an extensible, customizable, self-documenting real-time display editor.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Emacs Dependencies

HarfBuzz-7.0.0, giflib-5.2.1, GnuTLS-3.8.0, jansson-2.14, and libtiff-4.5.0

Optional

a graphical environment, alsa-lib-1.2.8, Cairo-1.17.6, dbus-1.14.6, GConf-3.2.6, gobject-introspection-1.74.0, gsettings-desktop-schemas-43.0, GPM-1.20.7, GTK+-2.24.33 or GTK+-3.24.36, ImageMagick-7.1.0-61, Little CMS-2.14, libjpeg-turbo-2.1.5.1, libpng-1.6.39, librsvg-2.54.5, libxml2-2.10.3, MIT Kerberos V5-1.20.1, Valgrind-3.20.0, intlfonts, libungif, libotf, and m17n-lib - to correctly display such complex scripts as Indic and Khmer, and also for scripts that require Arabic shaping support (Arabic and Farsi), mailutils, and libXaw3d

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/emacs

Installation of Emacs

Install Emacs by running the following commands:

./configure --prefix=/usr &&
make

This package does not come with a test suite. If make succeeds, you can test the result by running src/emacs -Q, which is the program that will be installed, with its auxiliary files. This should start and display the application opening screen.

Now, as the root user:

make install &&
chown -v -R root:root /usr/share/emacs/28.2

Note

This package installs icon files into the /usr/share/icons/hicolor hierarchy and you can improve system performance and memory usage by updating /usr/share/icons/hicolor/index.theme. To perform the update you must have GTK+-2.24.33 or GTK+-3.24.36 installed and issue the following command as the root user:

gtk-update-icon-cache -qtf /usr/share/icons/hicolor

Command Explanations

--with-imagemagick: Use this if you have installed ImageMagick-7.1.0-61 and wish to link against it.

--with-gif=no: Use this if you have not installed giflib-5.2.1 or libungif.

--with-tiff=no: Use this if you have not installed libtiff-4.5.0.

--with-gnutls=no: Use this if you have not installed GnuTLS-3.8.0.

--without-harfbuzz: Use this if you have not installed HarfBuzz-7.0.0.

--with-json=no: Use this if you have not installed jansson-2.14.

Contents

Installed Programs: ctags, ebrowse, emacs (symlink), emacs-28.2, emacsclient, and etags

Installed Libraries: None

Installed Directories: /usr/libexec/emacs and /usr/share/emacs

Short Descriptions

ctags creates cross-reference tagfile database files for source code

ebrowse permits browsing of C++ class hierarchies from within emacs

emacs is an editor

emacsclient attaches an emacs session to an already running emacsserver instance

etags is another program to generate source code cross-reference tagfiles.

6.4 Gedit-44.2


Introduction to Gedit

The Gedit package contains a lightweight UTF-8 text editor for the GNOME Desktop.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Gedit Dependencies

Required

git-2.39.2, gsettings-desktop-schemas-43.0, gtksourceview4-4.8.4, itstool-2.0.7, libpeas-1.34.0, and tepl-6.4.0

gspell-1.12.0, Gvfs-1.50.3 (runtime), ISO Codes-4.12.0, and PyGObject-3.42.2 (Python 3 module)

Optional

GTK-Doc-1.33.2, Vala-0.56.4, and zeitgeist

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/gedit

Installation of Gedit

Install Gedit by running the following commands:

mkdir gedit-build &&
cd    gedit-build &&

meson setup --prefix=/usr       \
            --buildtype=release \
            -Dgtk_doc=false     \
            .. &&
ninja

To test the results, issue: ninja test.

Now, as the root user:

ninja install

Note

If you installed the package to your system using a “DESTDIR” method, /usr/share/glib-2.0/schemas/gschemas.compiled was not updated/created. Create (or update) the file using the following command as the root user:

glib-compile-schemas /usr/share/glib-2.0/schemas

Command Explanations

--buildtype=release: Specify a buildtype suitable for stable releases of the package, as the default may produce unoptimized binaries.

-Dgtk_doc=false: This switch disables generating the API documentation. Omit this switch if you have GTK-Doc-1.33.2 installed and wish to generate the API documentation.

Contents

Installed Program: gedit

Installed Libraries: libgedit-44.so

Installed Directories: /usr/include/gedit-44 and /usr/{lib,share,share/help/*}/gedit

Short Descriptions

gedit is a lightweight text editor integrated with the GNOME Desktop.

6.5 JOE-4.6


Introduction to JOE

JOE (Joe’s own editor) is a small text editor capable of emulating WordStar, Pico, and Emacs.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/joe

Installation of JOE

Install JOE by running the following commands:

./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --docdir=/usr/share/doc/joe-4.6 &&
make

This package does not come with a test suite.

Now, as the root user:

make install &&

install -vm 755 joe/util/{stringify,termidx,uniproc} /usr/bin

Configuring JOE

Config Files

/etc/joe/jmacsrc, /etc/joe/joerc, /etc/joe/jpicorc, /etc/joe/jstarrc, /etc/joe/rjoerc, and ~/.joerc

Contents

Installed Programs: jmacs, joe, jpico, jstar, rjoe, stringify, termidx, and uniproc

Installed Libraries: None

Installed Directories: /etc/joe, /usr/share/joe, and /usr/share/doc/joe-4.6

Short Descriptions

jmacs is a symbolic link to joe used to launch Emacs emulation mode

joe is a small text editor capable of emulating WordStar, Pico, and Emacs

jpico is a symbolic link to joe used to launch Pico emulation mode

jstar is a symbolic link to joe used to launch WordStar emulation mode

rjoe is a symbolic link to joe that restricts JOE to editing only files which are specified on the command-line

stringify is a program used by joe to convert rc and .jsf files into a C file (see /usr/share/doc/joe-4.6/util/README)

termidx is a program used by joe to generate the termcap index file (see /usr/share/doc/joe-4.6/util/README)

uniproc is a program used by joe to generate joe’s unicode database file unicat.c from Blocks.txt CaseFolding.txt EastAsianWidth.txt and UnicodeData.txt (find them at /usr/share/doc/joe-4.6/util; see usr/share/doc/joe-4.6/util/README)

6.6 Kate-22.12.2


Introduction to Kate

The Kate package contains an advanced KF5 based graphical text editor.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Kate Dependencies

Required

KDE Frameworks-5.103.0

Optional

libgit2

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/kate5

Installation of Kate

Install Kate by running the following commands:

mkdir build &&
cd    build &&

cmake -DCMAKE_INSTALL_PREFIX=$KF5_PREFIX  \
      -DCMAKE_BUILD_TYPE=Release          \
      -DBUILD_TESTING=OFF                 \
      -Wno-dev .. &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents

Installed Programs: kate and kwrite

Installed Libraries: Several plugins under $KF5_PREFIX/lib/plugins

Installed Directories: $KF5_PREFIX/lib/plugins/ktexteditor, $KF5_PREFIX/lib/plugins/plasma/dataengine, $KF5_PREFIX/share/doc/HTML/*/{kate,katepart,kwrite}, $KF5_PREFIX/share/{kateproject,katexmltools}, and $KF5_PREFIX/share/plasma/plasmoids/org.kde.plasma.katesessions

Short Descriptions

kate is an advanced text editor for kde

kwrite is a text editor for KDE, that is a light version of kate.

6.7 Mousepad-0.5.10


Introduction to Mousepad

Mousepad is a simple GTK+ 3 text editor for the Xfce desktop environment.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Mousepad Dependencies

Required

gtksourceview4-4.8.4

Optional

DConf-0.40.0 (runtime) and dbus-glib-0.112

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/mousepad

Installation of Mousepad

Install Mousepad by running the following commands:

./configure --prefix=/usr --enable-keyfile-settings &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Command Explanations

--enable-keyfile-settings: Use the GSettings keyfile backend rather than the default DConf-0.40.0.

Contents

Installed Program: mousepad

Installed Libraries: None

Installed Directories: None

Short Descriptions

mousepad is a simple GTK+ 3 text editor.

6.8 Nano-7.2


Introduction to Nano

The Nano package contains a small, simple text editor which aims to replace Pico, the default editor in the Pine package.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/Nano

Installation of Nano

Install Nano by running the following commands:

./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --enable-utf8     \
            --docdir=/usr/share/doc/nano-7.2 &&
make

This package does not come with a test suite.

Now, as the root user:

make install &&
install -v -m644 doc/{nano.html,sample.nanorc} /usr/share/doc/nano-7.2

Command Explanations

--enable-utf8: This switch enables unicode support in Nano.

Configuring nano

Config Files

/etc/nanorc and ~/.nanorc

Configuration Information

Example configuration (create as a system-wide /etc/nanorc or a personal ~/.nanorc file)

set autoindent
set constantshow
set fill 72
set historylog
set multibuffer
set nohelp
set positionlog
set quickblank
set regexp

Check the sample.nanorc file in the installed documentation directory. It includes color configurations and has some documentation included in the comments.

Syntax highlighting is provided for several file types, in /usr/share/nano/ directory. E.g., for shell scripts, you can insert include /usr/share/nano/sh.nanorc in the personal or global configuration file. If you wish highlighting for all supported files, use include /usr/share/nano/*.nanorc. This include does not descend into the extra directory. Move required files one level up.

Contents

Installed Programs: nano and rnano (symlink)

Installed Libraries: None

Installed Directories: /usr/share/nano and /usr/share/doc/nano-7.2

Short Descriptions

nano is a small, simple text editor which aims to replace Pico, the default editor in the Pine package

rnano is a restricted mode for nano.

6.9 Vim-9.0.1273


Introduction to Vim

The Vim package, which is an abbreviation for VI IMproved, contains a vi clone with extra features as compared to the original vi.

The default LFS instructions install vim as a part of the base system. If you would prefer to link vim against X, you should recompile vim to enable GUI mode. There is no need for special instructions since X support is automatically detected.

Note

The version of vim changes daily. To get the latest version, go to https://github.com/vim/vim/releases.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Vim Dependencies

a graphical environment and GTK+-3.24.36

Optional

GPM-1.20.7, Lua-5.4.4, rsync-3.2.7, and Ruby-3.2.1

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/vim

Installation of Vim

Note

If you recompile Vim to link against X and your X libraries are not on the root partition, you will no longer have an editor for use in emergencies. You may choose to install an additional editor, not link Vim against X, or move the current vim executable to the /bin directory under a different name such as vi.

Install Vim by running the following commands:

Note

If you intend to run the tests and have not installed Xorg in /usr, append LDFLAGS=’-L$XORG_PREFIX/lib’ to the configure line below.

echo '#define SYS_VIMRC_FILE  "/etc/vimrc"' >>  src/feature.h &&
echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&

./configure --prefix=/usr        \
            --with-features=huge \
            --enable-gui=gtk3    \
            --with-tlib=ncursesw &&
make

Note

If the global configuration file /etc/vimrc references the VIMRUNTIME environment variable, some tests may complain about being unable to find the corresponding directory and wait for user input. If this is the case, this file should be saved and removed before running the tests.

To test the results, issue: make -j1 test. Even if one of the tests fails to produce the file test.out in src/testdir, the remaining tests will still be executed. If all goes well, the log will report ALL DONE. Some tests labelled as “flaky” may fail occasionally and can be ignored. The tests are known to fail if the output is redirected to a file, and also if they are run in a ‘screen’ session.

Note

Some color tests expect to be executed under the xterm terminal emulator.

Now, as the root user:

make install

By default, Vim’s documentation is installed in /usr/share/vim. The following symlink allows the documentation to be accessed via /usr/share/doc/vim-9.0.1273, making it consistent with the location of documentation for other packages:

ln -snfv ../vim/vim90/doc /usr/share/doc/vim-9.0.1273

If you wish to update the runtime files, issue the following command (requires rsync-3.2.7):

rsync -avzcP --exclude="/dos/" --exclude="/spell/" \
    ftp.nluug.nl::Vim/runtime/ ./runtime/

To install the runtime files and regenerate the tags file, as the root user issue:

make -C src installruntime &&
vim -c ":helptags /usr/share/doc/vim-9.0.1273" -c ":q"

Command Explanations

--with-features=huge: This switch enables all the additional features available in Vim, including support for multibyte characters.

--with-tlib=ncursesw: This switch forces Vim to link against the libncursesw library.

--enable-gui=no: This will prevent compilation of the GUI. Vim will still link against X, so that some features such as the client-server model or the x11-selection (clipboard) are still available.

--without-x: If you prefer not to link Vim against X, use this switch.

--enable-luainterp, --enable-perlinterp, --enable-python3interp=dynamic, --enable-tclinterp --with-tclsh=tclsh, --enable-rubyinterp: These options include the Lua, Perl, Python3, Tcl, or Ruby interpreters that allow using other application code in vim scripts. All the --enable-... options can accept =dynamic to dynamically load the interpreter when needed. This is required for Python 3 to prevent segmentation faults. For tcl, it is necessary to indicate the name of the tclsh executable, since configure only searches versioned names with old versions.

Configuring Vim

Config Files

/etc/vimrc and ~/.vimrc

###

Configuration Information

Vim has an integrated spell checker which you can enable by issuing the following in a vim window:

:setlocal spell spelllang=ru

This setting will enable spell checking for the Russian language for the current session.

By default, Vim only installs spell files for the English language. If a spell file is not available for a language, then Vim will call the $VIMRUNTIME/plugin/spellfile.vim plugin and will try to obtain the *.spl and optionally *.sug from the vim ftp server, by using the $VIMRUNTIME/plugin/netrwPlugin.vim plugin.

Alternatively you can manually download the *.spl and *.sug files from: ftp://ftp.vim.org/pub/vim/runtime/spell/ and save them to ~/.vim/spell or in /usr/share/vim/vim90/spell/.

To find out what’s new in Vim-9.0.1273 issue the following command:

:help version-9.0.1273

For additional information on setting up Vim configuration files, see The vimrc Files and https://vim.fandom.com/wiki/Example_vimrc.

Contents

A list of the reinstalled files, along with their short descriptions can be found in the LFS Vim Installation Instructions.

Installed Programs: gview, gvim, gvimdiff, gvimtutor, rgview, and rgvim

Installed Libraries: None

Installed Directory: /usr/share/vim

Short Descriptions

gview starts gvim in read-only mode

gvim is the editor that runs under X and includes a GUI

gvimdiff edits two or three versions of a file with gvim and shows the differences

gvimtutor teaches the basic keys and commands of gvim

rgview is a restricted version of gview

rgvim is a restricted version of gvim.