syntax on set number set ruler set showcmd set autoindent "keep same indent as current line on unknown/new filetypes set shiftwidth=4 set softtabstop=4 set tabstop=8 set nocompatible set smartcase " search function ignores case set showmatch " show matching closing bracket set hlsearch " highlight search results set incsearch " start showing search results immediately set backspace=2 " allow linewraps using ENTF across lines set textwidth=78 set formatoptions+=t "automatically wrap text that exceeds textwidth chars set shiftwidth=4 set softtabstop=4 set tabstop=8 set cul hi CursorLine term=none cterm=none ctermbg=4 set nomodeline "disable modelines (frequest security vulns in the past) set nostartofline "stop certain movements from going to the line start set visualbell set t_vb= colorscheme torte " center word on search when using n or b map n nzz map N Nzz if has("autocmd") au BufNewFile,BufRead *.sgml,*.ent,*.xsl,*.xml call Set_SGML() au BufNewFile,BufRead *.[1-9] call ShowSpecial() endif " has(autocmd) function Set_Highlights() "match ExtraWhitespace /^\s* \s*\|\s\+$/ highlight default link OverLength ErrorMsg match OverLength /\%71v.\+/ return 0 endfunction function ShowSpecial() setlocal list listchars=tab:>>,trail:*,eol:$ hi def link nontext ErrorMsg return 0 endfunction " ShowSpecial() function Set_SGML() setlocal number syn match sgmlSpecial "&[^;]*;" setlocal syntax=sgml setlocal filetype=xml setlocal shiftwidth=2 setlocal textwidth=70 setlocal tabstop=8 setlocal softtabstop=2 setlocal formatprg="fmt -p" setlocal autoindent setlocal smartindent " Rewrap paragraphs noremap P gqj " Replace spaces with tabs noremap T :s/ /\t/ call ShowSpecial() call Set_Highlights() return 0 endfunction " Set_SGML()