Skip to content

Commit

Permalink
Change tabstop from 4 to 8
Browse files Browse the repository at this point in the history
This won't affect 4-space indentation in any way.

While the chance we find tab characters inside Rust sources is slim, it
is best to have the tab character displayed in accordance to terminals
and printers, where tabstop=8.

Even Vim doc says:

    Note: Setting 'tabstop' to any other value than 8 can make your file
    appear wrong in many places (e.g., when printing it).

Here's the full spec of settings for 4-space indentation in Vim:

set tabstop=8                   "A tab is 8 spaces
set expandtab                   "Always uses spaces instead of tabs
set softtabstop=4               "Insert 4 spaces when tab is pressed
set shiftwidth=4                "An indent is 4 spaces

More details:

    https://www.reddit.com/r/vim/wiki/tabstop
  • Loading branch information
da-x committed Jun 28, 2018
1 parent 5244fee commit 46bfb18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ftplugin/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ setlocal smartindent nocindent

if get(g:, 'rust_recommended_style', 1)
let b:rust_set_style = 1
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
setlocal tabstop=8 shiftwidth=4 softtabstop=4 expandtab
setlocal textwidth=99
endif

Expand Down

0 comments on commit 46bfb18

Please sign in to comment.