set runtimepath+=~/vimfiles
syntax on
filetype on
filetype plugin on
filetype indent on
set nonu
colorscheme torte
set nobackup
set hidden
set scrolloff=3
set ambiwidth=double
set list
set listchars=tab:>.
set backspace=indent,eol,start
set smartindent
set ignorecase
set smartcase
set wrapscan
set noincsearch
set hlsearch
set showmatch
set cmdheight=2
set laststatus=2
set statusline=%y%{GetStatusEx()}%F%m%r%=<%l-%c(%p%%)>
function! GetStatusEx()
let str = ''
let str = str . '[' . &fileformat . ']'
if has('multi_byte') && &fileencoding != ''
let str = '[' . &fileencoding . '] :' . str
endif
return str
endfunction
set wildmode=list:longest
nmap j gj
nmap k gk
vmap j gj
vmap k gk
nnoremap gh :nohlsearch<Return>
autocmd FileType javascript :set dictionary=~/vimfiles/dic/js.dict
setlocal omnifunc=syntaxcomplete#Complete
autocmd FileType javascript :set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType css :set omnifunc=csscomplete#CompleteCSS
autocmd FileType html :set omnifunc=htmlcomplete#CompleteTags
highlight Pmenu ctermbg=black ctermfg=22
highlight Pmenusel term=standout ctermbg=22
function! ShebangExecute()
let m = matchlist(getline(1), '#!\(.*\)')
if(len(m) > 2)
execute '!'. m[1] . ' %'
else
execute '!' &ft ' %'
endif
endfunction
nmap ,e :call ShebangExecute()<CR>
autocmd BufNewFile *.user.js 0r ~/vimfiles/templates/skel.js
autocmd BufNewFile *.pl 0r ~/vimfiles/templates/skel.pl
autocmd BufNewFile *.html,*.htm 0r ~/vimfiles/templates/skel.html
autocmd bufnewfile *.rb 0r ~/vimfiles/templates/skel.rb
autocmd BufNewFile,BufRead *.io set filetype=io
autocmd BufNewFile,BufRead *.as set filetype=actionscript
autocmd BufNewFile,BufRead *.yaml,*.yml so ~/vimfiles/syntax/yaml.vim
au FileType ruby call RubySetting()
function! RubySetting()
setlocal ts=2 sts=2 sw=2
setlocal et
iabbrev edn end
endfunction
let g:surround_{char2nr('f')} = "function \1function\1 () { \r }"
let mapleader = "^F"
nmap <Space> :MBEbn<CR>
nmap ,1 :e #1<CR>
nmap ,2 :e #2<CR>
nmap ,3 :e #3<CR>
nmap ,4 :e #4<CR>
nmap ,5 :e #5<CR>
nmap ,6 :e #6<CR>
nmap ,7 :e #7<CR>
nmap ,8 :e #8<CR>
nmap ,9 :e #9<CR>
nmap ,y :YRShow<CR>
nmap ,h :MRU<CR>
:let MRU_Max_Entries=30