sim

the sim text editor
git clone git://ssnf.xyz/sim
Log | Files | Refs | README

README (3634B)


      1 You can read more info about sim and how to contribute on the project's website:
      2 http://sim.ssnf.xyz
      3 
      4 sim is a simple, interactive, multi-file text editor designed for screens with
      5 monospaced font. It is heavily inspired on the 'vim' and 'sam' text editors,
      6 hence the name sim.
      7 
      8 Requirements
      9 ------------
     10 In order to compile this version of sim, you will need:
     11 	- a C89 compliant C library and compiler.
     12 	- a POSIX.1-2001 compliant system (for the termios.h functions).
     13 	- a system that supports the ioctl TIOCGWINSZ request, for querying the
     14 	terminal's window size.
     15 
     16 I tried to make sim more portable by depending only on the VT100 escape
     17 sequences for terminal size handling. But honestly it was just a pain in the
     18 ass. If I can make it work without any issues, I'll make sure to upstream it.
     19 
     20 In order to *use* sim, you'll need a terminal capable of handling the VT100
     21 escape sequences.
     22 
     23 sim has been successfully compiled and run on Linux using both musl and glibc.
     24 
     25 sim is expected to work without any changes on other Unix-based OSes and C
     26 libraries . If it doesn't, please let me know and I'll make it work.
     27 
     28 Building
     29 ---------
     30 make
     31 or
     32 cc *.c
     33 
     34 Installation
     35 ------------
     36 Just copy sim to somewhere on your PATH.
     37 
     38 Hacking
     39 -------
     40 sim is designed to be extremely flexible. Every keystroke is customizable.
     41 The core system relies on a simple table where you can map a key to a
     42 function and (optionally) give it an argument, which allows for a very
     43 creative usage of keys.
     44 
     45 Adding new features to sim is a breeze. Honestly, sometimes not even I
     46 believe how easy it is. Just create a function that does what you want, map
     47 it to a sane key on your config file, and compile it. *It just works*.
     48 
     49 config.def.h is the default key config file. You're supposed to copy it to
     50 config.h and edit it there, so that you do not lose your changes when a new
     51 patch comes out.
     52 
     53 sim also makes patches made by other people available at the project's site.
     54 You might find them interesting!
     55 
     56 Patches can be downloaded from http://sim.ssnf.xyz/patches
     57 
     58 In order to apply a patch, just use the patch command.
     59 
     60 Commands
     61 --------
     62 Although all commands are customizable, sim comes by default with vim-based
     63 keymaps (without, of course losing sim's charmful differences):
     64 
     65 	- c: change(), selects text and enters insert mode (supports counter)
     66 		- x:  current character
     67 		- c:  until end of line
     68 		- G:  until Bottom
     69 		- g:  from Top
     70 		- w:  word
     71 		- tX: until letter X
     72 	- C: alias to cc
     73 	- r: alias to cx
     74 	- d: delete() (supports counter)
     75 		- x:  current character
     76 		- d:  current line
     77 		- G:  until Bottom
     78 		- g:  from Top
     79 		- w:  word
     80 		- tX: until letter X
     81 	- D: alias to dd
     82 	- x: alias to dx
     83 	- .: dot(), repeats last command
     84 	- Alt + Num || Esc + Num: switch between Files
     85 	- E: file_open()
     86 	- q: file_close()
     87 	- S: file_save()
     88 	- i: insert()
     89 	- I: insert at the start of a line
     90 	- A: insert at the end of a line
     91 	- a: insert after current character
     92 	- o: insert below current line
     93 	- h: move left
     94 	- j: move down
     95 	- k: move up
     96 	- l: move right
     97 	- Ctrl + d: move Half a page down
     98 	- Ctrl + u: move Half a page up
     99 	- $: move to the end of a line
    100 	- G: move to the bottom
    101 	- g: move to the top
    102 	- w: move to the beginning of the next word
    103 	- e: move to the end of the next word
    104 	- b: move to the beginning of the previous word
    105 	- p: paste at current cursor position
    106 	- Q: quit sim
    107 	- /: enter search mode
    108 	- ?: enter reverse search mode
    109 	- n: search for next occurence
    110 	- N: search for previous occurence
    111 	- u: undo
    112 	- Ctrl + r: redo
    113 	- y: yank(), selects text
    114 		- y: current line
    115 		- G: until Bottom
    116 		- g: from Top
    117 		- w: word
    118 		- tX: until letter X