Skip to content

Customisation for the textadept editor to make it a bit more like vim.

License

Notifications You must be signed in to change notification settings

erig0/textadept-vi

 
 

Repository files navigation

textadept-vi

Some customisation for textadept to make it feel a bit like vim. I like vim's keyboard handling but textadept's scriptability, so this is the solution. The aim is for my trained fingers to keep working, while (at least eventually) making good use of textadept's features.

It requires a recent textadept (7.8 at time of writing).

I use this as my default editor, and it implements the common features of vi/vim that I used to use; there are many less common features I haven't implemented.

Usage

I suggest cloning textadept-vi into ~/.textadept, and setting it up with the following:

package.path = "/home/username/.textadept/textadept-vi/?.lua;" .. package.path
package.cpath = "/home/username/.textadept/textadept-vi/?.so;" .. package.cpath
_G.vi_mode = require 'vi_mode'

Textadept-vi also uses a slightly modified textredux (with support for using the Scintilla-based command entry in recent Textadept versions): https://github.com/jugglerchris/textredux.git

I think it's likely that textredux will add this support (possibly a bit differently), at which point textadept-vi will switch back to upstream textredux.

Support

For any questions, issues, requests or complaints, please use the issue tracker.

What works

  • Movement commands: h,j,k,l,w,b,e,H,M,L,%,^,_,$,0,G,{,}
  • Selection motions: aw,iw
  • Simple mark/jump: m, ', `
  • Numeric prefix
  • Basic text entry commands: i,a,A,o,O,r,R,~
  • Editing: d,D,c,C,x,p,P,y
  • More complex editing commands: J,gq,>,<,=
  • Undo/redo/repeat: u,^r,.
  • Searching: /,?,n,N,*,#
  • Tags: c-],c-t, :tag, :tn, :tp, :tsel
  • Buffers: c-w c-w, c-^, :split, :vsplit, :only
  • Folds: zo, zc, zM, zR
  • Compiling/Quickfix: basic :make, :cb, :cn, :cp, :clist, :lgrep (grep with Lua patterns)
  • Other ex-mode commands with completion: :e, :w, :wq, :q, :b, :bdelete, :find, @:
  • Misc: ^Z to suspend (with the included "kill" Lua extension)
  • Esc to return to command mode
  • In insert mode: ^p to find matching completions in the current buffer.

What doesn't

Everything else, and some of the above. I mainly use the curses version under Linux (modified to support split views; see below).

Dependencies

Besides Textadept (currently tested on 7.8):

Testing

There is a slowly growing set of regression tests. They run using textadept-curses inside a recent tmux (>=1.8). To run, just type "make" from the textadept-vi/test directory.

About

Customisation for the textadept editor to make it a bit more like vim.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Lua 98.9%
  • Other 1.1%