A simple modal text editor, written in Go
or
This is my editor. There are many like it, but this one is mine.
To build and install ry
on your computer simply run
go get github.com/kiasaki/ry
.
make run # builds and runs ry
ry
is a text editor aiming to provide an editing environment similar to vim
in terms of key bindings and modal editing while being as easily extended
as emacs
. It's is built with the day-to-day usage of the original author in
mind but hopefully flexible enough for anybody with Vim experience to adopt and
mold to their image.
Currently implemented keybindings:
- Normal Mode
- C-q Quits editor
- : Enters command mode
- C-c Cancels keys entered
- C-g Cancels keys entered
- ESC ESC Cancels keys entered
- h Moves cursor left
- h Moves cursor right
- j Moves cursor down
- k Moves cursor up
- 0 Moves cursor to the beginning of the line
- $ Moves cursor to the beginning of the line
- g g Moves to the beginning of the buffer
- G Moves to the end of the buffer
- C-u Move 15 lines up
- C-d Moves 15 lines down
- z z Centers current line in view
- w Moves forward to next beginning of a word
- e Moves forward to next end of a word
- b Moves backwards to next beginning of a word
- i Enters insert-mode
- I Enters insert-mode at beginning of line
- a Enters insert-mode then moves right 1 character
- A Enters insert-mode then moves to the end of the line
- o Enters insert-mode and creates a new line under the current one
- O Enters insert-mode and creates a new line on top of the current one
- u Undo last change
- C-r Redo last change
- x Delete char under cursor
- d d Deletes line under cursor
- y y Copies line under cursor
- p Pastes from clipboard
- m $alpha Set mark at cursor
- ' $alpha Jump to mark
- v Enter visual mode
- V Enter visual line mode
- C-w s Splits buffer horizontally
- C-w v Splits buffer vertically
- C-w h Move to the window to the left
- C-w j Move to the window to the bottom
- C-w k Move to the window to the top
- C-w l Move to the window to the right
- SPC b Runs
buffers
command - SPC f Runs
edit
command on current file's directory - SPC n Runs
clearsearch
command
- Insert mode
- $any Inserts character at cursor's position
- BAK Deletes character to the left
- RET Inserts a new line at cursor position
- ESC Enters normal mode
- Prompt mode
- $any Inserts character
- BAK Deletes character
- C-c Enters normal mode
- ESC Enters normal mode
- RET Execute command and go back to normal mode
- C-u Clear entered command
- Visual mode
- ESC Exit visual mode
- y Yank selection
- d Delete selection
- p Paste selection
- Buffers mode
- q Close buffer
- RET Open selected buffer in current window
- Directory mode
- q Close buffer
- RET Open selected file in current window
Currently implemented commands:
edit <filename>
(aliased ase
) Edit a file in a new buffer (shows file selector on directories)write <filename?>
(aliased asw
) Write buffer to disk, optionally setting it's pathquit
(aliased asq
) Close current buffer (making sure it's saved before)quit!
(aliased asq!
) Close current buffer (ignoring unsaved changes)writequit
(aliased aswq
) Writes buffer to disk then closes itclearsearch (aliased as
cs`) Hides search result highlightsbuffers
(aliased asb
) Shows a list of buffers in current window
See LICENSE
file.