sled

Једноставни уређивач текста
git clone https://git.sr.ht/~strahinja/sled
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

README (4186B)


      1 sled - Simple text editor
      2 =========================
      3 
      4 For installation instructions, see the file INSTALL.
      5 
      6 
      7 Q&A
      8 ---
      9 
     10 Q: Why?
     11 A: - Because newcomers don't find vi(m) comfortable. Something akin to EDIT.COM
     12      is usually perceived as more familiar: type text straight away, C-S to
     13      save, then C-Q. (Sled still has vim-like behavior, but it is "reverse" -
     14      default is insert mode, from which you can enter command mode.)
     15    - Because nano/joe are still relatively complicated.
     16    - As an exercise in programming in C, and to create an editor to my own
     17      liking, closer to suckless principles.
     18 
     19 Q: Why can't sled open the file "read only" even if modification is disallowed?
     20 A: A text editor's purpose should be to *edit* text files. For just *viewing*
     21    text files, there's less(1). This avoids the situation when opening a file
     22    one is not allowed to write to with an editor like vi(1), only to have write
     23    operation denied after making numerous edits.
     24 
     25    Of course, one could argue that screen editors like vi already double as
     26    text file viewers, but I think of displaying the contents of a writable file
     27    as being separate from displaying the contents of a non-writable file.
     28 
     29    If this bothers you, you can use something like the included shell script
     30    sledv.
     31 
     32 Q: Is editing multiple files planned?
     33 A: No, and this is by design. You can edit multiple files at the same time by
     34    running multiple instances of sled. You can arrange them on screen through a
     35    terminal multiplexer like GNU screen(1) or tmux(1), or just open several
     36    terminal emulators like st(1) and have your window manager arrange their
     37    windows. Inter-process "clipboard" can be managed by a terminal multiplexer
     38    or X.Org itself.
     39 
     40 Q: Is there a ~/.config/sled/config or ~/.sledrc?
     41 A: No, and never will be. sled is intended to be configured through editing
     42    config.h and recompilation, like suckless software.
     43 
     44 Q: Are plugins planned?
     45 A: No. Like suckless software, sled is meant to be extended through patches.
     46 
     47 Q: Why doesn't sled have feature X from text editor Y?
     48 A: Most likely because it is not essential to editing text files. However, you
     49    are free to offer a patch supporting the feature, which will be included in
     50    the repository, with credits to the author.
     51 
     52 Q: How can I configure sled if I installed it (from AUR|through my distro's
     53    package manager)?
     54 A: You don't. If you want customization/configuration, clone the git repo,
     55    customize and compile it from source, just like with suckless software. Some
     56    options can be set/overridden per session on the command line, for example -B
     57    turns off backups for that session, and -b turns them on.
     58 
     59 Q: Why am I getting a "Permission denied" when trying to edit a file?
     60 A: You either can't access the directory for writing and search (execute bit)
     61    and haven't disabled the creation of backups nor set backup_fail to 0, or
     62    can't access the file itself for writing.
     63 
     64 Q: How to get crontab -e to work?
     65 A: Set the backup_fail to 0 in config.h. If that fails, set create_backups to 0
     66    in that file.
     67 
     68 Q: Why are some wide characters covering the dialogs (help, search, replace)?
     69 A: This is due to how wide characters work. The character is probably one cell
     70    to the left of the border, and it needs two cells to be displayed. Writing
     71    the border character one cell to the right is not enough, the previous
     72    character would need to be overwritten by a single-cell character like Space.  
     73    Currently, termbox doesn't support getting the character from its display
     74    buffer, which would enable testing for this case and handling it (but see
     75    [1]).
     76 
     77 
     78 [1]: https://github.com/termbox/termbox2/pull/65
     79 
     80 
     81 License
     82 -------
     83 
     84 sled - Simple text editor
     85 Copyright (C) 2022-2026  Страхиња Радић
     86 
     87 This program is free software: you can redistribute it and/or modify it under
     88 the terms of the GNU General Public License as published by the Free Software
     89 Foundation, either version 3 of the License, or (at your option) any later
     90 version.
     91 
     92 File termbox.h is based on termbox2 TUI library, (c) 2021 termbox developers,
     93 which is released under the terms of Expat license, see the file
     94 LICENSE.termbox.