Emacs: Insert tab instead of spaces

pic11 picture pic11 · Feb 28, 2011 · Viewed 13.9k times · Source

For several reasons I prefer to configure my editor to insert spaces when TAB is pressed.

But recently I discovered that tabs should remain as tabs in make files.

How do I insert tab (\t, not " ") without reconfiguring editors each time I need to write make files?

I use the following editors: Emacs, Kate, gedit, and the Visual Studio editor.

Answer

Wayne Conrad picture Wayne Conrad · Feb 28, 2011

To manually insert a tab in Emacs, use ctrl-Q TAB. control-Q causes the next key to be inserted rather than interpreted as a possible command.