Did you know that you can navigate the posts by swiping left and right?
I, personally, have been struggled with this issue for some time. I am kinda person who has a really poor memory, but i am pretty sure iāve googled it for at least twice, and each time, has spent decent amount of time on researching.
I really missed the old days When i was a (Notepad++āāāSublime Text2āļøāor Atomāļøāļø) user who has a spirit of sticking to the original (default settings). But once you fell into some other āLinux/Unix bornā š» editors, like Vi/Vim or Emacs, you normally will only have 2 choice, endless of suffering or save yourself.
expandtab
: applies to write mode only. Set/convert vimās <tab>
to <space>
in insertion mode. If set, it implies that that only space will be used for insertion all the time.ts
: aka. tabstop, applies to read mode only. It denotes (# of columns) the <tab>
character visually displays/appears in vim, by default itās 8 in most Unix/Linux Systems and NOT recommended to be changed for some printing and cross platform reasons.sts
: aka. softtabstop, applies to write mode. It represents , in insertion
mode, that pressing a <tab>
key (# of columns) will be inserted.
<tab>
as possible and fill the rest with <space>
to represents a <tab>
press in insertion
mode, for eg.setlocal sts = 20 ts = 8, then vim uses 2 <tab>
+ 4 <space>
to represent a <tab>
press.<space>
when pressing a <tab>
in insertion
mode.sw
: aka. shiftwidth, denotes # of columns >>
or <<
equals to.stab
: aka. smarttab, it tells vim to use sw
for indention at the beginning of each line, whereas ātabstopā and āsofttabstopā are used elsewhere.From Vim wiki:
Create file html.vim(~/.vim/after/ftplugin/html.vim) with contents:
setlocal shiftwidth=2
setlocal tabstop=2
and file python.vim with contents:
setlocal expandtab
setlocal shiftwidth=4
setlocal softtabstop=4
or if .vimrc
is preferred,
autocmd FileType html setlocal shiftwidth=2 tabstop=2
autocmd FileType python setlocal expandtab shiftwidth=4 softtabstop=4
My personal funky .vimrc
settings
autocmd FileType * setlocal noexpandtab tabstop=4 shiftwidth=4 smarttab
autocmd BufNewFile,BufRead *.py setlocal expandtab tabstop=4 shiftwidth=4
autocmd BufNewFile,BufRead *.js setlocal expandtab shiftwidth=2 softtabstop=2
In fact, the debate among space or tab is just like single quote or double quote, semicolon or nosemicolon. Itās mainly a stylish problem which heavily relies on personal taste. Kinda like vim or emacs, years of debate will not help bring them to an end. From my personal shallow intuitive perspective, i will just follow something i am in favor of. As iāve been using <space>
over <tab>
for some time(notice, iām a js citizen, to be more precise, a js newbieš¶), i find it could be fun to switch to the tribe of <tab>
for a while.