vim-style text line editing in JS