Last active
March 19, 2024 13:07
-
-
Save voltrue2/8e76e5a9aba5e437139b2f19eb38a61a to your computer and use it in GitHub Desktop.
.vimrc
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
" enable syntax highlighting | |
syntax enable | |
" spell checks | |
set spell spelllang=en_us | |
hi clear SpellRare | |
hi SpellRare cterm=underline | |
hi clear SpellLocal | |
hi SpellLocal cterm=underline | |
hi clear SpellCap | |
hi SpellCap cterm=underline | |
hi clear SpellBad | |
hi SpellBad ctermfg=009 ctermbg=011 guifg=#ff0000 guibg=#ffff00 | |
" set unix as the standard file type | |
set ffs=unix,dos,mac | |
" set default encoding to be UTF-8 | |
set encoding=utf-8 | |
" display the full file path at the bottom | |
set statusline+=%F | |
set ls=2 | |
" tab as 2 spaces | |
set tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttab | |
" for C# tabs | |
autocmd FileType cs set autoindent expandtab tabstop=4 shiftwidth=4 | |
" for golang tabs | |
autocmd FileType go set autoindent noexpandtab tabstop=2 shiftwidth=2 | |
" use tabs in Makefile | |
let _curfile=expand("%:r") | |
if _curfile == 'Makefile' | |
set noexpandtab | |
endif | |
" show a whitespace at the end of each line as a ~ | |
set listchars=tab:..,trail:~,extends:>,precedes:< | |
set list | |
" set the background color of whitespaces to be red and char color to be white | |
hi SpecialKey ctermfg=darkgrey guifg=None ctermbg=None | |
" code block holding: press [a + z] to fold and ufold | |
set foldmethod=indent | |
set foldnestmax=10 | |
set nofoldenable | |
set foldlevel=2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment