Skip to content

Instantly share code, notes, and snippets.

Created September 20, 2017 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbechrd/52d893c4c23ab8e072d0053686cabc21 to your computer and use it in GitHub Desktop.
Save dbechrd/52d893c4c23ab8e072d0053686cabc21 to your computer and use it in GitHub Desktop.
My .vimrc
" maximize window on start
if has("gui_running")
"set lines=999 columns=999
autocmd GUIEnter * simalt ~x
set nocompatible " No vi compatibility
set autoindent " use autoindentation
set autoread " reload changed files automatically
set background=dark " colorscheme will assume dark background
set backspace=2 " allow backspace to delete newlines and beyond the start of the insertion point
set nobackup " disable auto-backup
set noexpandtab " don't replace tabs with spaces
set nofoldenable " disable code folding
set guifont=Courier_New:h9:cANSI:qDRAFT
"set hid " allow hidden buffers
":help 'highlight'
"hi SpecialKey bold
"hi NonText NONE
"hi Directory bold
"hi ErrorMsg standout
"hi Search bold
"hi MoreMsg bold
"hi ModeMsg NONE
"hi LineNr underline
"hi Question standout
"hi StatusLine reverse
"hi Title bold
"hi Visual reverse
"hi WarningMsg standout
set highlight=8b,@-,db,es,lb,mb,M-,n-,rs,sr,tb,vr,ws
set hlsearch " highlight all search results
set incsearch " set incremental search
set nojoinspaces " don't add two spaces after ., ?, !
set number " enable line numbers
set ruler " show the ruler
set shiftwidth=4 " ???
set so=10 " start scrolling at 10 lines from edge
set softtabstop=4 " ???
set splitbelow " horizontal split down
set splitright " vertical split right
set tabstop=4 " ???
set ttyfast " we have a fast terminal connection
set wildmode=longest,list " wildmode: complete to longest match, list on second tab
set nowrap " do not wrap lines
" highlight text wider than 80 chars in red (for specified file extensions)
highlight OverLength ctermbg=darkred ctermfg=white guibg=#AA4444 guifg=white
fun! UpdateMatch()
if &ft =~ '^\%(c\|cpp\|h\|hpp\)$'
match OverLength /\%>80v.\+/
match NONE
autocmd BufEnter,BufWinEnter * call UpdateMatch()
highlight Search ctermbg=darkred ctermfg=white guibg=#293134 guifg=#ffff00
highlight IncSearch ctermbg=darkred ctermfg=white guibg=#293134 guifg=#ffff00
"highlight Search ctermbg=darkred ctermfg=white guifg=#ff0000 guibg=#00ff00
"highlight IncSearch ctermbg=darkred ctermfg=white guifg=#ff0000 guibg=#00ff00
" auto-reload .vimrc
autocmd BufWritePost ~/.vimrc source %
" Colors, and syntax highlighting
colorscheme mustang
syntax on
if version >= 600
filetype plugin on
filetype indent on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment