vim:config:indentation:indentation_with_mixed_tabs_and_spaces
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
vim:config:indentation:indentation_with_mixed_tabs_and_spaces [2022/10/08 14:08] – created peter | vim:config:indentation:indentation_with_mixed_tabs_and_spaces [2022/10/08 14:12] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== VIM - Config - Indentation - Indentation with mixed tabs and spaces ====== | ====== VIM - Config - Indentation - Indentation with mixed tabs and spaces ====== | ||
+ | To indent with mixed tabs and spaces. | ||
+ | |||
+ | < | ||
+ | set shiftwidth=2 | ||
+ | set softtabstop=2 | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * The principle is to set **set shiftwidth** and **set softtabstop** to the same value, leave **expandtab** at its default (**noexpandtab**). | ||
+ | * Usually, **tabstop** is left at its default value as well. | ||
+ | |||
+ | * **shiftwidth** affects what happens when you press **>> | ||
+ | * It also affects how automatic indentation works. | ||
+ | |||
+ | * **softtabstop** affects what happens when you press the **< | ||
+ | * Its default value is the same as the value of **tabstop**, | ||
+ | * If **expandtab** is unset, and **tabstop** is different from **softtabstop**, | ||
+ | * For instance, if **tabstop** is 8, and the amount of consecutive space inserted is 20, two TAB characters and four spaces will be used. | ||
+ | </ | ||
+ | |||
+ | |||
+ | ---- |
vim/config/indentation/indentation_with_mixed_tabs_and_spaces.1665238095.txt.gz · Last modified: 2022/10/08 14:08 by peter