User Tools

Site Tools


vim:config:indentation:indentation_with_mixed_tabs_and_spaces

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
vim:config:indentation:indentation_with_mixed_tabs_and_spaces [2022/10/08 14:09] petervim:config:indentation:indentation_with_mixed_tabs_and_spaces [2022/10/08 14:12] (current) peter
Line 9: Line 9:
  
 <WRAP info> <WRAP info>
-**NOTE:**  These settings will cause as many hard tabs as possible being used for indentation, and spaces will be used to fill in the rest. +**NOTE:**  These settings will result in a mix of tabs and spaces being used for indentation.
- +
-  * If you want to distinguish between "indentation" and "alignment", i.e., the number of hard tabs equals the indentation level, use the Smart Tabs plug-in+
  
   * The principle is to set **set shiftwidth** and **set softtabstop** to the same value, leave **expandtab** at its default (**noexpandtab**).   * 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.+    * Usually, **tabstop** is left at its default value as well.
  
 +  * **shiftwidth** affects what happens when you press **>>**, **<<** or **==**.
 +    * It also affects how automatic indentation works.
 +
 +  * **softtabstop** affects what happens when you press the **<TAB>** or **<BS>** keys.
 +    * Its default value is the same as the value of **tabstop**, but when using indentation without hard tabs or mixed indentation, you want to set it to the same value as **shiftwidth**.
 +    * If **expandtab** is unset, and **tabstop** is different from **softtabstop**, the **<TAB>** key will minimize the amount of spaces inserted by using multiples of TAB characters.
 +      * For instance, if **tabstop** is 8, and the amount of consecutive space inserted is 20, two TAB characters and four spaces will be used.
 </WRAP> </WRAP>
 +
  
 ---- ----
vim/config/indentation/indentation_with_mixed_tabs_and_spaces.1665238142.txt.gz · Last modified: 2022/10/08 14:09 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki