Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change emacs indentation for cmake?

Tags:

emacs

cmake

For the LIFE of me I can't figure out why emacs indents lines in *.cmake files with 2 spaces per indent rather than what the Standard Indent is set to in customize. I also have c-basic-offset set to 4. I can't find anything with apropos help, google, C-h C-m...

EVERYTHING ELSE works with indentation spacing of 4 -- python, c++, etc. Why does cmake indent to 2 spaces while everything else does 4? How can I change it back to use 4 spaces?

like image 859
djhaskin987 Avatar asked Oct 16 '25 16:10

djhaskin987


1 Answers

From a quick look at cmake-mode, cmake-tab-width is the variable you want to change.
Try (setq cmake-tab-width 4) somewhere in your Emacs startup files.

This is with Emacs 24.3 on Ubuntu 14.04; cmake-mode.el seems to come from CMake 2.8.12.2 (all stock Ubuntu provided packages).

like image 189
Rory Yorke Avatar answered Oct 19 '25 10:10

Rory Yorke