0

I am used to using emacs (I know bad habit), and Git opens vim for commit messages. I enter my commit message and hit ctrl-x, ctrl-c out of habit and it always freezes up the shell (I am using putty).

  • Why does it freeze up the whole shell?
  • Can I configure ctrl-x, ctrl-c to be the same as :x in vim?
  • Can I configure git to use emacs?
  • Should I just stop using emacs and get on the vim wagon?
Ehvince
  • 17,274
  • 7
  • 58
  • 79
ajon
  • 7,868
  • 11
  • 48
  • 86

2 Answers2

4

Why does it freeze up the whole shell?

It doesn't, but it also doesn't quit vim so it could appear that way.

Can I configure ctrl-x, ctrl-c to be the same as :x in vim?

Yes, but it's a really, really bad solution to this problem.

Can I configure git to use emacs?

Yes, easily. Also, if you had formally set emacs as your editor, git would already be using it (as would crontab, vipw and all other commands that invoke editors).

Should I just stop using emacs and get on the vim wagon?

Not because of this. Just set emacs as your default editor.

Community
  • 1
  • 1
that other guy
  • 116,971
  • 11
  • 170
  • 194
  • Using it from Putty it does freeze up the entire session. I can not type anything or get the session to respond in anyway (that I know of) – ajon Oct 27 '15 at 06:56
  • @ajon Putty doesn't do that for me. Is it similar to the effect when pressing Ctrl-S? – that other guy Oct 27 '15 at 16:23
  • You are a genious. It was actually Ctrl-S that freezes up Vim. I was in the habit of typing Ctrl-x Ctrl-s Ctrl-x Ctrl-c really quickly to save in emacs. I didn't realize Ctrl-s locks the screen in vim and Ctrl-q releases it. THANKS for this tip. I have been using vim exclusively since yesterday and have learned a lot. – ajon Oct 28 '15 at 18:52
0

(mandatory answer: a note about Magit)

You have your workflow with git within the shell. Fine. Can I suggest to use git from within emacs, with the Magit package ?

http://wikemacs.org/wiki/Magit

http://magit.vc/

Magit allows to do many many stuff with a few keys and an interactive interface. Maybe my favorite one is the interactive rebase. In the shell, I'd type something like (sorry I forgot the precise syntax!)

git rebase -i HEAD~~~~

right ? Then I replace every "pick" with another keyword.

With magit, I'll call the magit status (M-x magit-status, or my custom S-g). I'm displayed a nice window from where I can explore the repo and fire actions:

magit status

I call ll to see a short list of commits. I put the cursor on the one I want to rebase from and I either see the menu either type r. I'm displayed a little menu with different options. I choose e for interactive. I'm displayed the commits with "pick" in front of them and at each one I type f to fixup, r to reword, etc.

It's so handy, hope you didn't know about it and that you'll like it.

Ehvince
  • 17,274
  • 7
  • 58
  • 79