Skip to content

Instantly share code, notes, and snippets.

@giovtorres
Created February 25, 2016 02:10
Show Gist options
  • Save giovtorres/a3fab16353baae26aff2 to your computer and use it in GitHub Desktop.
Save giovtorres/a3fab16353baae26aff2 to your computer and use it in GitHub Desktop.
My VIM rc file
set background=dark
set number
set cursorline
set showmatch
" default
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autoindent
set encoding=utf-8
let python_highlight_all = 1
syntax on
" Key mappings
map <F6> 0i#<ESC>j
map <F7> 0xj
map <F8> 0i//<ESC>j
map <F9> 02xj
" New skeleton file for lua modulefiles
:au BufNewFile *.lua r ~/.vim/templates/template.lua
" Change color of highlight
:hi Search term=reverse ctermbg=12
" Enable folding
"set foldmethod=indent
"set foldlevel=99
" Enable folding with the spacebar
nnoremap <space> za
" Add proper PEP8 indentation
au BufNewFile,BufRead *.py set tabstop=4
au BufNewFile,BufRead *.py set softtabstop=4
au BufNewFile,BufRead *.py set shiftwidth=4
au BufNewFile,BufRead *.py set textwidth=79
au BufNewFile,BufRead *.py set expandtab
au BufNewFile,BufRead *.py set autoindent
au BufNewFile,BufRead *.py set fileformat=unix
" Full stack development
au BufNewFile,BufRead *.js,*.html,*.css set tabstop=2
au BufNewFile,BufRead *.js,*.html,*.css set softtabstop=2
au BufNewFile,BufRead *.js,*.html,*.css set shiftwidth=2
au BufNewFile,BufRead *.js,*.html,*.css set expandtab
au BufNewFile,BufRead *.js,*.html,*.css set autoindent
" Flag unnecessary whitespace
"au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment