Skip to content

Instantly share code, notes, and snippets.

@Rud5G
Last active September 28, 2020 22:21
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save Rud5G/2316255 to your computer and use it in GitHub Desktop.
Save Rud5G/2316255 to your computer and use it in GitHub Desktop.
dotfile: .vimrc
"
" https://gist.github.com/Rud5G/2316255
"
" mkdir -p ~/.vim/{backup,syntax,tmp}
"
set autoindent " lines following an indented line will have the same indentation as the previous line.
set expandtab " resplace tabs with actuall spaces
set shiftwidth=4 " softtabs width 4.
set tabstop=4 " tabs are 4 spaces
" those 4 are needed to use :%retab
set background=dark " duh.
set backup " keep a backup file
set backupdir=~/.vim/backup " location backup files
set directory=~/.vim/tmp " location tmp files
" execute: mkdir -p ~/.vim/{backup,syntax,tmp}
set foldmethod=manual " manual is default, syntax
set history=350 " keep 350 lines of command line history
set hlsearch
set ignorecase smartcase " case-insensitvice search unless upper-case letters
set laststatus=2
set nocompatible
set showcmd " display incomplete commands
set showmatch
set showmode
set smartcase
set statusline=%<[%n]\ %F\ %m%r%y%=%-14.(%l,%c%V%)\ %P
set timeoutlen=500
set textwidth=120 " i want 120 chars of text.
set wildmenu
set wildmode=list:longest,full
syntax on
" Remove unwanted spaces
autocmd BufWritePre *.css :%s/\s\+$//e
autocmd BufWritePre *.conf :%s/\s\+$//e
autocmd BufWritePre *.md :%s/\s\+$//e
autocmd BufWritePre *.php :%s/\s\+$//e
autocmd BufWritePre *.rb :%s/\s\+$//e
autocmd BufWritePre *.xml :%s/\s\+$//e
autocmd BufWritePre *.yml :%s/\s\+$//e
autocmd Filetype gitcommit setlocal spell textwidth=72
" Bash aliases
au BufNewFile,BufRead .bash_aliases call SetFileTypeSH("bash")
" Varnish syntax
au BufRead,BufNewFile *.vcl :set ft=vcl
" au! Syntax vcl source ~/.vim/syntax/vcl.vim
" Varnish syntax, download:
" http://cvs.pld-linux.org/cgi-bin/viewvc.cgi/cvs/packages/vim-syntax-vcl/vcl.vim?view=markup
" uncomment: au! Syntax vcl source ~/.vim/syntax/vcl.vim
" http://vim.wikia.com/wiki/Remove_unwanted_spaces
" autocmd FileType c,cpp,java,php autocmd BufWritePre <buffer> :%s/\s\+$//e
" Mastering the VI editor
" http://www.eng.hawaii.edu/Tutor/vi.html
" set wrap
" set linebreak
" set showbreak=>\ \ \
" set fileformats=unix,dos,mac
" support all three, in this order
" set smartindent
" set cindent
" set noexpandtab
" set tabstop=4
" set softtabstop=4
" set si
"
"the_END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment