spruce up vimrc with comments and some features

This commit is contained in:
James Dixon 2023-01-13 11:16:31 -05:00
parent 36dea09be6
commit b14e6acda4

View File

@ -1,48 +1,60 @@
" "--------------
" minimal vimrc with no (extra) plugins " a minimal vimrc
" "--------------
"load system defaults "load system defaults
"--------------------
if filereadable(expand('$VIMRUNTIME/defaults.vim')) if filereadable(expand('$VIMRUNTIME/defaults.vim'))
unlet! g:skip_defaults_vim unlet! g:skip_defaults_vim
source $VIMRUNTIME/defaults.vim source $VIMRUNTIME/defaults.vim
endif endif
"regular settings "regular settings
"---------------- "----------------
" ui " ui
set number set number " line numbers
set ruler set ruler " line # in the statusline
set wildmenu set wildmenu " vim command completion menu
set showcmd set showcmd " show the current normal mode command
set showmatch set showmatch " show matching symbols like (), {}
set hidden " allow unsaved buffers in background
" encoding/format " encoding/format
set encoding=utf-8 set encoding=utf-8 " utf-8 (basically) standard
set fileformats=unix,dos,mac set fileformats=unix,dos,mac " controls newline styles
" searching " searching
set hlsearch set hlsearch " highlight all matches for a search
set incsearch set incsearch " incremental search by character
set ignorecase set ignorecase " ignore alphabetical case of search
set smartcase set smartcase " ignore unless there is a capital letter
" indent " tab/space indent and whitespace
set shiftwidth=4 set tabstop=2 " tabstop is the num to use for a tab character
set tabstop=4 set softtabstop=2 " softtabstop makes up the difference between tab and space
set softtabstop=4 set shiftwidth=2 " shiftwidth applies to indenting with < and >
set autoindent set expandtab " use space characters to indent instead of tab characters
set autoindent " try to autoindent based on context
set backspace=indent,eol,start " lets you backspace over anything
" key timeout values " key timeout values
set esckeys set esckeys " allow <ESC> to be registered instantly
set ttimeoutlen=20 set timeoutlen=1000 " keymap timeout value (1 second in ms)
set timeoutlen=1000 set ttimeoutlen=20 " time out for keycodes (20ms)
" allow syntax and filetype plugins " allow syntax and filetype plugins
syntax enable syntax enable
filetype plugin indent on filetype plugin indent on
runtime macros/matchit.vim runtime macros/matchit.vim
" keybinds
"----------
let mapleader = " "
nnoremap <leader>l :set list!<CR>
nnoremap <leader>t2 :set ts=2 sts=2 sw=2 expandtab<CR>
nnoremap <leader>t4 :set ts=4 sts=4 sw=4 expandtab<CR>
nnoremap <leader>t4t :set ts=4 sts=4 sw=4 noexpandtab<CR>
" autocmds " autocmds
"--------- "---------
augroup general augroup general
@ -58,7 +70,7 @@ augroup languages
autocmd! autocmd!
autocmd BufNewFile,BufRead *.bash set syntax=sh autocmd BufNewFile,BufRead *.bash set syntax=sh
autocmd FileType python xnoremap <leader>r <esc>:'<,'>:w !python3<CR> autocmd FileType python xnoremap <leader>r <esc>:'<,'>:w !python3<CR>
autocmd FileType go set noexpandtab autocmd FileType go setlocal noexpandtab ts=4 sts=4 sw=4
autocmd FileType html :syntax sync fromstart autocmd FileType html :syntax sync fromstart
autocmd FileType html,javascript,css,json,yaml,sh autocmd FileType html,javascript,css,json,yaml,sh
\ setlocal ts=2 sts=2 sw=2 expandtab \ setlocal ts=2 sts=2 sw=2 expandtab