Maintainer:
Version:
Last Change:
set nocompatible
function! MySys()
if has("win32")
return "windows"
else
return "linux"
endif
endfunction
if MySys() == 'windows'
if has("autocmd")
au GUIEnter * simalt ~x
endif
set diffexpr=MyDiff()
function! MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
endif
source $VIMRUNTIME/mswin.vim
behave mswin
filetype on
filetype plugin on
filetype indent on
let mapleader = ","
let g:mapleader = ","
if has('printer')
if has('win32')
set printfont=MS_Gothic:h9:cSHIFTJIS
elseif has("unix")
set guifont=IPA\ モナー\ ゴシック\ 12
set printencoding=euc-jp
if exists('&printmbcharset')
set printmbcharset=JIS_X_1983
set printmbfont=r:Ryumin-Light,b:Ryumin-Light,a:yes,c:yes
endif
endif
endif
if $OSTYPE=='cygwin' || $TERM=='cygwin' || exists("$HOMEDRIVE")
set fileformats+=mac
endif
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
if &term=="xterm"
set t_Co=8
set t_Sb=^[[4%dm
set t_Sf=^[[3%dm
endif
if has("gui_running")
colorscheme desert
else
colorscheme desert_term
endif
function! Change_curr_dir()
let _dir = expand("%:p:h")
exec "cd " . _dir
unlet _dir
endfunction
set nobackup
set noswapfile
set iminsert=0
set imsearch=0
set statusline=%<%f\ %m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}%=%l,%c%V%8P
set nowrapscan
set laststatus=2
set fencs=ucs-bom,utf-8,euc-jp,cp932,big5,cp936,iso-2022-jp
set go-=T
set go-=m
set ts=4
set sw=4
set smarttab
set expandtab
set ai
set si
set ignorecase
set backspace=eol,start,indent
set lz
set noerrorbells
set novisualbell
set t_vb=
set mouse=a
set incsearch
set completeopt=longest,menu
function! VisualSearch(direction) range
let l:saved_reg = @"
execute "normal! vgvy"
let l:pattern = escape(@", '\\/.*$^~[]')
let l:pattern = substitute(l:pattern, "\n$", "", "")
if a:direction == 'b'
execute "normal ?" . l:pattern . "^M"
else
execute "normal /" . l:pattern . "^M"
endif
let @/ = l:pattern
let @" = l:saved_reg
endfunction
vnoremap <silent> * :call VisualSearch('f')<CR>:let &hlsearch=&hlsearch<CR>
vnoremap <silent> # :call VisualSearch('b')<CR>:let &hlsearch=&hlsearch<CR>
inoremap <C-D> <C-R>=strftime("%Y-%m-%d")<CR>
inoremap <C-T> <C-R>=strftime("%H:%M:%S")<CR>
map <F2> :noh<CR>
nmap <silent> <leader>t :tabnew<cr>
function! SwitchToBuf(filename)
let fullfn = substitute(a:filename, "^\\~/", $HOME . "/", "")
let bufwinnr = bufwinnr(fullfn)
if bufwinnr != -1
exec bufwinnr . "wincmd w"
return
else
tabfirst
let tab = 1
while tab <= tabpagenr("$")
let bufwinnr = bufwinnr(fullfn)
if bufwinnr != -1
exec "normal " . tab . "gt"
exec bufwinnr . "wincmd w"
return
endif
tabnext
let tab = tab + 1
endwhile
exec "tabnew " . fullfn
endif
endfunction
if MySys() == 'linux'
map <silent> <leader>ss :source ~/.vimrc<cr>
map <silent> <leader>ee :call SwitchToBuf("~/.vimrc")<cr>
autocmd! bufwritepost .vimrc source ~/.vimrc
elseif MySys() == 'windows'
map <silent> <leader>ss :source ~/_vimrc<cr>
map <silent> <leader>ee :call SwitchToBuf("~/_vimrc")<cr>
autocmd! bufwritepost _vimrc source ~/_vimrc
endif
func! DeleteTrailingWS()
%s/\s\+$//ge
endfunc
nmap <silent> <leader>ws :call DeleteTrailingWS()<cr>:w<cr>
nmap <silent> <leader>dr :%s/\r//g<cr>:w<cr>
set viminfo='10,\"100,:20,n~/.viminfo
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
if has("autocmd") && exists("+omnifunc")
autocmd Filetype *
\if &omnifunc == "" |
\ setlocal omnifunc=syntaxcomplete#Complete |
\endif
endif
inoremap <expr> <C-J> pumvisible()?"\<PageDown>\<C-N>\<C-P>":"\<C-X><C-O>"
inoremap <expr> <C-K> pumvisible()?"\<PageUp>\<C-P>\<C-N>":"\<C-K>"
let g:netrw_list_hide= '^\..*, *.swp'
nmap <silent> <leader>fe :call Change_curr_dir() <cr>: tabnew .<cr>
nmap <BS> :Explore<cr>
autocmd FileType js,java :set shiftwidth=4 | set expandtab | set ts=4
autocmd FileType jsp,html,vm,xml :set shiftwidth=2 | set expandtab | set ts=2
autocmd BufRead *.log :setl nowrap
autocmd BufRead *.log :setl guioptions+=b
autocmd FileType c,cpp setl fdm=syntax | setl fen
map <F11> :call ToggleSketch()<CR>
let g:sqlutil_align_where = 1
let g:sqlutil_align_comma = 1
vmap <silent>sf <Plug>SQLU_Formatter<CR>
if MySys() == "windows"
let Tlist_Ctags_Cmd = "ctags"
elseif MySys() == "linux"
let Tlist_Ctags_Cmd = "/usr/bin/ctags"
endif
let Tlist_Show_One_File = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_Use_Right_Window = 1
map <silent> <leader>tl :TlistToggle<cr>
nmap <silent> <leader>hl <Plug>MarkSet
vmap <silent> <leader>hl <Plug>MarkSet
nmap <silent> <leader>hh <Plug>MarkClear
vmap <silent> <leader>hh <Plug>MarkClear
nmap <silent> <leader>hr <Plug>MarkRegex
vmap <silent> <leader>hr <Plug>MarkRegex
let showmarks_enable = 1
let showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
let showmarks_ignore_type = "hqm"
let showmarks_hlline_lower = 1
let showmarks_hlline_upper = 1
nmap <silent> <leader>mk :MarksBrowser<cr>
let g:LookupFile_MinPatLength = 2
let g:LookupFile_PreserveLastPattern = 0
let g:LookupFile_PreservePatternHistory = 0
let g:LookupFile_AlwaysAcceptFirst = 1
let g:LookupFile_AllowNewFiles = 0
if filereadable("/home/uprush/workspace/sukekun/filenametags")
let g:LookupFile_TagExpr = '"/home/uprush/workspace/sukekun/filenametags"'
endif
nmap <silent> <leader>lt :tabnew<cr>:LookupFile<cr>
nmap <silent> <leader>lk :LookupFile<cr>
nmap <silent> <leader>ll :LUBufs<cr>
nmap <silent> <leader>lw :LUWalk<cr>
function! LookupFile_IgnoreCaseFunc(pattern)
let _tags = &tags
try
let &tags = eval(g:LookupFile_TagExpr)
let newpattern = '\c' . a:pattern
let tags = taglist(newpattern)
catch
echohl ErrorMsg | echo "Exception: " . v:exception | echohl NONE
return ""
finally
let &tags = _tags
endtry
let files = map(tags, 'v:val["filename"]')
return files
endfunction
let g:LookupFile_LookupFunc = 'LookupFile_IgnoreCaseFunc'
let xml_use_xhtml = 1
let html_use_css = 1
let html_number_lines = 0
let use_xhtml = 1
let g:SuperTabRetainCompletionType = 1
let g:SuperTabDefaultCompletionType = "<C-X><C-P>"
let g:proj_flags="imstvcg"