Next: How to add a new module, Previous: Gnulib licensing, Up: Contributing to Gnulib [Contents][Index]
We use space-only indentation in nearly all files. This includes all
*.h, *.c, *.y files, except for the regex
module. Makefile and ChangeLog files are excluded, since TAB
characters are part of their format.
In order to tell your editor to produce space-only indentation, you can use these instructions.
;; In Gnulib, indent with spaces everywhere (not TABs). ;; Exceptions: Makefile and ChangeLog modes. (add-hook 'find-file-hook '(lambda () (if (and buffer-file-name (string-match "/gnulib\\>" (buffer-file-name)) (not (string-equal mode-name "Change Log")) (not (string-equal mode-name "Makefile"))) (setq indent-tabs-mode nil))))
" Don't use tabs for indentation. Spaces are nicer to work with. set expandtab
For Makefile and ChangeLog files, compensate for this by adding this to your $HOME/.vim/after/indent/make.vim file, and similarly for your $HOME/.vim/after/indent/changelog.vim file:
" Use tabs for indentation, regardless of the global setting. set noexpandtab
If you use the GNU indent program, pass it the option --no-tabs.