Skip to content

Instantly share code, notes, and snippets.

@yuuki
Created June 11, 2011 17:28
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 yuuki/1020775 to your computer and use it in GitHub Desktop.
Save yuuki/1020775 to your computer and use it in GitHub Desktop.
My .vimrc
" set file encoding type "
set encoding=utf-8
set fileencodings=utf-8,iso-2022-jp,sjis,euc-jp
set fileformats=unix,mac
set number
set tabstop=4
set showtabline=2
set ignorecase
set wildmenu
set showmatch
set matchtime=3
set backspace=indent,eol,start
set browsedir=buffer
set history=100
" set opend file directory into current directory "
au BufEnter * execute ":lcd " . expand("%:p:h")
syntax on
filetype on
filetype plugin on
filetype plugin indent on
" C++ Indent setting "
autocmd FileType cpp setl cindent cino=>2
autocmd FileType cpp setl expandtab tabstop=4 shiftwidth=4 softtabstop=2 textwidth=80
" Python Indent setting "
autocmd FileType python setl autoindent
autocmd FileType python setl smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
autocmd FileType python setl expandtab tabstop=8 shiftwidth=4 softtabstop=4 textwidth=80
" Python code complete "
autocmd FileType python let g:pydiction_location = '~/.vim/pydiction/complete-dict'
" Execute python script C-P
function! s:ExecPy()
exe "!" . &ft . " %"
:endfunction
command! Exec call <SID>ExecPy()
autocmd FileType python map <silent> <C-P> :call <SID>ExecPy()<CR>
" Ruby t setting "
autocmd FileType ruby setl nocompatible
autocmd FileType ruby setl autoindent
" autocmd FileType ruby setl smartindent cinwords=if,else,while,def,class,when,unless
autocmd Filetype ruby setl expandtab tabstop=2 shiftwidth=2 softtabstop=2 textwidth=80
autocmd FileType ruby compiler ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment