Skip to content

Instantly share code, notes, and snippets.

@klodio
Created August 31, 2012 02:59
Show Gist options
  • Save klodio/3548386 to your computer and use it in GitHub Desktop.
Save klodio/3548386 to your computer and use it in GitHub Desktop.
set t_Co=256
:colorscheme borland
:syntax on
set ruler
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set showmatch
set number
"set virtualedit=all
set so=999
set nocp
filetype plugin on
au FileType xhtml,xml so ~/.vim/ftplugin/html_autoclosetag.vim
set ww=b,s,<,>,[,]
" = no messing up with cache files everywhere =
set backup
set backupdir=~/.vim/backupfiles
set directory=~/.vim/tmpfiles
"and now I'm getting crazy, I WANT TO AUTOCLOSE STUFF
"comments
inoremap /*<CR> /**<CR>*<CR>*<CR>*<CR>*/<CR><Esc>4kA
"brackets
inoremap { {}<Left>
inoremap {<CR> {<CR>}<Esc>O
inoremap {{ {
inoremap {} {}
"Parenthesis
inoremap ( ()<Left>
inoremap (<CR> (<CR>)<Esc>O
inoremap (( (
inoremap () ()
"Crochets
inoremap [ []<Left>
inoremap [<CR> [<CR>]<Esc>O
inoremap [[ [
inoremap [] []
"quotes
inoremap " ""<Left>
inoremap "" "
inoremap "" ""
"Ruby def
au FileType ruby inoremap def<Space> def<CR><CR>end<Esc>kkA<Space>()<Left><Left>
au FileType ruby inoremap class<Space> class<CR>end<Esc>kA<Space>
"ImpactJS home-baked stuff
au FileType javascript inoremap igm<Tab> ig.module(<CR>'game.entities.<C-R>=expand("%:t:r")<CR>'<CR>).requires(<CR>''<CR>).defines(function () {<CR><CR>});<Esc>3k$hiau FileType javascript inoremap igc<Tab> <Space>=ig.Class.extend({<CR>init: function(){<CR><Tab><CR>}<CR>});<Esc>4kIau FileType javascript inoremap ige<Tab> = ig.Entity.extend({<CR>type: ig.Entity.TYPE.NONE,<CR>checkAgainst: ig.Entity.TYPE.NONE,<CR>collides: ig.Entity.COLLIDES.NEVER,<CR><CR>size: {<CR>x: 8,<CR>y: 8<CR>},<CR><CR>animSheet: new ig.AnimationSheet('media/sprite<C-R>=expand("%:t:r")<CR>.png', 8, 8),<CR><CR>init: function (x, y, settings) {<CR>this.parent( x, y, settings );<CR>this.addAnim( 'idle', 1, [0] );<CR>},<CR><CR>update: function () {<CR>this.parent();<CR>}<CR>});<Esc>20kI<C-R>=expand("%:t:r")<CR><Space><Esc>bguw~l<Esc>IEntity
"Javascript stuff (need to create functions for that!)
au FileType javascript inoremap \jsd<Tab> /**<CR><Space>@param<CR>@description<CR>/<Esc>2kA
au FileType javascript inoremap ##jsf<Tab> /**<CR><Space>@param<CR>@description<CR>/<CR>var = function(){<CR><Tab><CR>};<Esc>2kela
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment