Last active
April 15, 2021 03:29
-
-
Save ilyaigpetrov/cc3874bf4675b79e16a9861c449b0ff5 to your computer and use it in GitHub Desktop.
On tab it inserts 2 spaces, on one more tab this 2 spaces are added with 2 new and total 4 spaces are converted to a tab of the same length
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:set nofixendofline | |
" tabstop: The width of a hard tabstop measured in "spaces" -- effectively the (maximum) width of an actual tab character. | |
:set tabstop=4 | |
" shiftwidth: The size of an "indent". It's also measured in spaces, so if your code base indents with tab characters then you want shiftwidth to equal the number of tab characters times tabstop. This is also used by things like the =, > and < commands. | |
:set shiftwidth=2 | |
" expandtab: Enabling this will make the tab key (in insert mode) insert spaces instead of tab characters. This also affects the behavior of the retab command. | |
":set expandtab | |
" smarttab: Enabling this will make the tab key (in insert mode) insert spaces or tabs to go to the next indent of the next tabstop when the cursor is at the beginning of a line (i.e. the only preceding characters are whitespace). | |
:set smarttab | |
" Highlight unwanted whitespace: https://vim.fandom.com/wiki/Highlight_unwanted_spaces | |
:autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red | |
:highlight ExtraWhitespace ctermbg=red guibg=red | |
:autocmd ColorScheme * highlight Tabs ctermbg=brown guibg=gray60 | |
:highlight Tabs ctermbg=brown guibg=gray60 | |
:match ExtraWhitespace /\s\+\%#\@<!$/ | |
:2match Tabs /\t/ | |
" Aleternative to highlighting: :set list listchars=tab:>\ ,extends:→,precedes:←,nbsp:·,trail:· | |
" Increase buffer (iirc). | |
:set viminfo='20,<1000,s1000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment