Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

99 lines (81 sloc) 2.232 kb
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sets the default encoding
set fencs=utf-8,gb2312,gbk,big5
" Sets how many lines of history VIM has to remember
set history=700
set nocompatible
set wildmenu " Turn on WiLd menu
set wildmode=list:longest,full
set modelines=1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Utilities
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
fun! MySys()
return "windows"
endfun
" Used in Status Bar Display
function! CurDir()
let curdir = substitute(getcwd(), '/Users/amir/', "~/", "g")
return curdir
endfunction
function! HasPaste()
if &paste
return 'PASTE MODE '
else
return ''
endif
endfunction
func! Cwd()
let cwd = getcwd()
return "e " . cwd
endfunc
func! CurrentFileDir(cmd)
return a:cmd . " " . expand("%:p:h") . "/"
endfunc
func! DeleteTillSlash()
let g:cmd = getcmdline()
if MySys() == "linux" || MySys() == "mac"
let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*", "\\1", "")
else
let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\]\\).*", "\\1", "")
endif
if g:cmd == g:cmd_edited
if MySys() == "linux" || MySys() == "mac"
let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "")
else
let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\\]\\).*\[\\\\\]", "\\1", "")
endif
endif
return g:cmd_edited
endfunc
function! CmdLine(str)
exe "menu Foo.Bar :" . a:str
emenu Foo.Bar
unmenu Foo
endfunction
function! QFixToggle(forced)
if exists("g:qfix_win") && a:forced == 0
cclose
unlet g:qfix_win
else
copen 10
let g:qfix_win = bufnr("$")
endif
endfunction
command -bang -nargs=? QFix call QFixToggle(<bang>0)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Misc Settings
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" No sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" When vimrc is edited, reload it
autocmd! bufwritepost vimrc source ~/.vim/vimrc
" setup the bash manually
set shell=/bin/bash
" detect mouse usage, avoid selection on linenumbers
set mouse=a
Jump to Line
Something went wrong with that request. Please try again.