Vimamsa
Vi/Vim -inspired experimental GUI-oriented text editor written with Ruby and GTK.
Requirements
- Ruby 3.0+
- GTK 4
Installation
On Ubuntu:
sudo apt install ruby-dev
sudo gem install vimamsa
Other install options
Install from sources:
git clone https://github.com/SamiSieranoja/vimamsa.git
cd vimamsa
gem build vimamsa.gemspec
sudo gem install --local vimamsa-0.1.*.gem
Older version for GTK3:
sudo gem install vimamsa -v 0.1.10
Run
vimamsa
Install packages for optional features:
sudo apt install ack-grep clang-format
gem install ripl ripl-multi_line differ parallel listen rufo language_server-protocol
For customization, edit ~/.vimamsa/custom.rb
Screenshots
Key bindings
Key bindings are very much like in VIm. For details, see file lib/vimamsa/key_bindings.rb and lib/vimamsa/key_bindings_vimlike.rb
Keys that work somewhat similarly as in Vim:
In Command mode:
j k l h w b p P G f F ; 0 $ v i o J * / a A I u ctrl-r x
zz dd dw gg <linenum>G r<char>
In Visual mode:
d y gU gu
Keys that work differently to Vim are documented in the tables below
Syntax:
ctrl! means press and immediate release of ctrl key. Triggered by key up event.
ctrl-x means press and hold ctrl key, press x
Command mode keys | |||
---|---|---|---|
Key | Action | ||
ctrl! | switch between command and insert modes | ||
z | enter into BROWSE mode | ||
shift! | save file | ||
s | Easy jump (Similar to Vim EasyMotion https://github.com/easymotion/vim-easymotion ) | ||
tab | switch betwen current and previous buffer/file | ||
enter | (when cursor on link) open url in browser | ||
enter | (when cursor on /path/to/file.txt:linenum ) open file in editor, jump to linenum | ||
,a | Search for string using ack | ||
,b | Switch buffer (jump to other open file) | ||
,g | search for input string inside current buffer | ||
,f | File finder | ||
space c | insert character "c" |
Insert mode keys (similar to bash or emacs) | |||
---|---|---|---|
ctrl! OR esc | Switch to command mode | ||
ctrl-n | Move to next line | ||
ctrl-p | Move to previous line | ||
ctrl-a | Move beginning of line | ||
ctrl-e | Move to end of line | ||
ctrl-b | Move backward one char | ||
ctrl-f | Move forward one char | ||
alt-f | Move forward one word | ||
alt-b | Move backward one word |
Browse mode keys | |||
---|---|---|---|
h | jump to previous buffer in history | ||
l | jump to next buffer in history | ||
q | jump to previous edited position | ||
w | jump to next edited position | ||
j OR esc | switch from browse to command mode |
Bindings can be customized in ~/.vimamsa/custom.rb For example, to bind ctrl-n to action "create new file":
bindkey 'C ctrl-n', 'create_new_file()'
Current limitations
- UTF8 only
- Line endings with "\n"