Vimamsa

Vi/Vim -inspired experimental GUI-oriented text editor written with Ruby and GTK.

Requirements

  • Ruby 2.0+
  • GTK 3

Installation

On Ubuntu:

sudo apt install ruby-dev
sudo gem install vimamsa

Run:

vimamsa

Packages for optional features:

sudo apt install ack-grep clang-format

For customization, edit dot_vimamsarc.rb and copy to ~/.vimamsarc

Key bindings

Key bindings are very much like in VIm. For details, see file lib/vimamsa/key_bindings.rb and lib/vimamsa/default_bindings.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
KeyAction
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 Fuzzy filename search
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 ~/.vimamsarc
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"