refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / vim-whitespace / README.md
1 ---
2 title: vim-whitespace
3 homepage: https://webinstall.dev/vim-whitespace
4 tagline: |
5   vim whitespace sets tab, whitespace, trailing whitespace rules to reasonable values
6 ---
7
8 To update (replacing the current version) run `webi vim-whitespace`.
9
10 ## Cheat Sheet
11
12 The idea that tabs should be 8 spaces wide is redonkulous.
13
14 This vim-whitespace plugin sets tabs to spaces (4 wide), trim trailing
15 whitespace, and makes whitespace handling consistent.
16
17 ### How to configure manually
18
19 Create the file `~/.vim/plugins/whitespace.vim`. Add the same contents as
20 <https://github.com/webinstall/webi-installers/blob/master/vim-whitespace/whitespace.vim>.
21
22 That will look something like this:
23
24 ```vim
25 " handle tabs as 4 spaces, in every direction, consintently
26 set tabstop=4
27 set shiftwidth=4
28 set smarttab
29 set expandtab
30 set softtabstop=4
31
32 " remove trailing whitespace on save
33 autocmd BufWritePre * :%s/\s\+$//e
34 ```
35
36 You'll then need to update `~/.vimrc` to source that plugin:
37
38 ```vim
39 " Tabs & Whitespace: reasonable defaults from webinstall.dev/vim-whitespace
40 source ~/.vim/plugins/whitespace.vim
41 ```