I have installed Emacs on my FreeBSD 8.2 box. Everything works fine but I cannot use tabs. When I am editing a file with emacs and hit tab, nothing happens.
What could be causing this?
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.
This is because standard tabs are set to eight spaces. Tabs are special characters.
If you're new to Emacs, you might expect pressing TAB
to insert a literal \T
. For various reasons, that's not the way most Emacs modes work. Most editing modes auto-indent your code as needed (<tab>
is bound toindent-for-tab-command
rather than self-insert
). If the line you're TAB
bing on is already at the correct indentation level, it might seem that nothing happened.
Auto-indenting like this is easier and more consistent than manually indenting, but doesn't give you as much flexibility when it comes to deciding exactly how much whitespace is going to be present at the beginning of each line (and it also causes some problems when you want to, for example, tab-separate some fields). You can auto-indent a region using C-M-\
(that's Ctrl + Alt + \
).
If you absolutely, positively must insert a literal \T
into your code somewhere, you can do so using C-q TAB
(press and release Ctrl + q and then press TAB). Typically, this is done to align columns in other editors; if that's what you're doing, it's probably a better idea to use align-regexp
rather than tab literals.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With