Contents
How to enable tabs and spaces in Emacs?
If you’d like to also activate these functions on the fly, using M-x, you can use the (interactive) function in Emacs Lisp. Here’s the documentation. First thing we do in the enable-tabs function is set the TAB key to tab-to-tab-stop.
When to use indent-tabs-mode nil Stack Exchange?
I use (setq-default indent-tabs-mode nil) in my init file so to avoid using TABs but when I write some files (like C++ files) then it allows me to insert TABs if I am in an if-statement for example… Stack Exchange Network
When to use tabchars instead of spcchars in Emacs?
Non-nilindent-tabs-modemeans that Emacs can use TABchars instead of a number of consecutive SPCchars. If the value is nilin a given buffer then indentation by Emacs (e.g. automatic indentation) uses only SPCchars. But even in that case there is nothing preventing you from inserting a TABchar (e.g., using C-q TAB).
When to use evil shift width in Emacs?
This is only useful if you are using the Evil package to get Vim-like keybindings instead of using glorious Emacs keybindings. evil-shift-width controls the tab size when you’re using the >> or << motion to indent or de-indent text. Something that was driving me nuts was Emacs electric-indent indenting the previous line when I press enter.
Is there such thing as indentation in Lisp?
The concept of indentation really doesn’t exist in Lisp. It’s all about alignment, and tabs will screw up the precise alignment that Lisp requires. Remember not to define the variable custom-tab-width twice! It should be defined above your enable/disable tabs functions.
Do you use tabs or spaces in Lisp?
Prog-mode is a nice hook to use if you want to make settings for pretty much all code filetypes. After that we disable tabs (use spaces) in Lisp and ELisp files. Lisp is a special type of programming language that really doesn’t work well with tabs, so I HIGHLY recommend spaces. Why is that exactly?