4 ms·
Cute, but I can do the exact same thing in Vim. It has built-in commands :Pick, :Reword etc that change the current line, and I've just defined my own ftplugin/
by eridius 10y ago
Cute, but I can do the exact same thing in Vim. It has built-in commands :Pick, :Reword etc that change the current line, and I've just defined my own ftplugin/gitrebase.vim file that looks like:
nnoremap <buffer> <silent> <LocalLeader>p :Pick<CR>
nnoremap <buffer> <silent> <LocalLeader>s :Squash<CR>
nnoremap <buffer> <silent> <LocalLeader>e :Edit<CR>
nnoremap <buffer> <silent> <LocalLeader>r :Reword<CR>
nnoremap <buffer> <silent> <LocalLeader>f :Fixup<CR>
nnoremap <buffer> <silent> <LocalLeader>c :Cycle<CR>
This way I just press e.g. "\p" or "\f" (my localleader is \) to change the line, which makes it just one more keypress than your command, but I have the full power of Vim and I don't have to go about changing my editor.
- saurik 10y agoSo this is just "change the word at the beginning of the line to squash"? All of the commands can be replaced by one-character aliases, so I just use "cws<esc>" to like, "change to squash". What is proving these (much longer and less general) commands like ":Squash<enter>"?
- tekknolagi 10y agoYou know, I have these too and I'm not sure. I can't find "Squash" or "Fixup" in my vim init directory. And yet, when I `vim -u NONE`, they don't exist...
- eridius 10y agoThey're defined in ftplugin/gitrebase.vim in the vim runtime files.
- eridius 10y agoSure, you could do that, but if you're going down the list making changes to 12 lines, it's much easier just to say something like \fj\ejj\sj\sj\fjjj\e instead of ciwfixup<esc>jciwedit<esc>jjciwsquash<esc>jciwsquash<esc>jciwfixup<esc>jjjciwedit<esc>
- deleted 10y ago[deleted]
- csswizardry 10y agoRelated: https://twitter.com/csswizardry/status/843040649666596865 https://twitter.com/csswizardry/status/843040649666596865
- sjurba 10y agoAwesome. I know Vim is super awesome, flexible and very configurable (like emacs). I guess I never got around to learning it properly.. If you compare the time I spent writing this app to the time I would spend configuring and learning Vim, it might make me feel a bit stupid.. But then again, because of github and npm it is so easy to share the work I done, so that so many others don't have to spend that time at all. Also I tried to make this app to have it do only one thing and do that one thing well. With no config, and no learning how to use it. Arrows to find your line, custom keys to change the action-word. Shift to select multiple lines, Ctrl to move/reorder line(s) and some extra niceties like undo/redo. Of course you can do all that and much more with vim. My point is that it is a strength of the app that it doesn't do anything else. I don't need it to do anything else. It only needs to do interactive rebase. But of course I don't expect vim and emacs aficionados to take much interest in this app. My core audience are those who have to google 'how to exit vim' every time they venture a rebase. ;)
- eridius 10y agoThe time you spent writing this app is probably good experience for writing other things though. And of course someone who's using nano or pico as their editor might find this useful.
- anaganisk 10y agoNot everyone is a vim user.