Chinaunix首页 | 论坛 | 博客
  • 博客访问: 145522
  • 博文数量: 54
  • 博客积分: 2682
  • 博客等级: 少校
  • 技术积分: 580
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-24 20:56
文章分类
文章存档

2012年(2)

2011年(10)

2010年(28)

2009年(14)

我的朋友

分类: Java

2010-03-18 10:42:57

花了一天时间把vim for c, java的ide搭建起来了,有很多不错的功能,大致能让我从eclipse上转过来了。可以方便的看linux源码和hadoop源码了。嘿嘿
 
但是目前我的java自动补全只能支持jdk的类,不支持我的类。谁知道有好的办法的请留言,感激。
 
主要从这两个链接学习的:
 
我的cat ~/.vimrc
 

[dachuan@dachuanvm branch-0.1-trace]$ cat ~/.vimrc
"for normal setting
set encoding=gb2312
syn on
set guifont=Luxi\ Mono\ 9
set tabstop=4
set shiftwidth=4
set autoindent
set backspace=2
set smartindent
set ai!
set nu!
set showmatch
set ruler
set incsearch
set vb t_vb=

syntax enable
syntax on
"
colorscheme desert

"for taglist
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1

"
for winmanager
let g:winManagerWindowLayout='FileExplorer|TagList'
nmap wm :WMToggle<cr>

"for cscope
set cscopequickfix=s-,c-,d-,i-,t-,e-

nmap s :cs find s =expand("
<cword>")
nmap g :cs find g =expand("
<cword>")
nmap c :cs find c =expand("
<cword>")
nmap t :cs find t =expand("
<cword>")
nmap e :cs find e =expand("
<cword>")
nmap f :cs find f =expand("
<cfile>")
nmap i :cs find i ^=expand("
<cfile>")$
nmap d :cs find d =expand("
<cword>")

"
for minibuffer
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1

"for a: c/h
nnoremap :A

"
for grep
nnoremap <silent> <F3> :Grep<CR>

"for omni-complete
"
these two following lines are for c/c++ code completion only.
"and with ctrl+x ctrl+o support.
"
no code completion for c/c++ without these two lines
"filetype plugin indent on
"
set completeopt=longest,menu

"for supertab
"
let g:SuperTabRetainCompletionType=2
"let g:SuperTabDefaultCompletionType="<C-X><C-O>"

"
for javacomplete
" Only do this part when compiled with support for autocommands.
"
:if has("autocmd")
": autocmd Filetype java setlocal omnifunc=javacomplete#Complete
"
:endif

":setlocal completefunc=javacomplete#CompleteParamsInfo

"
for vjde
":let g:vjde_completion_key=''

"
for vim ant
"autocmd BufRead *.java set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#
"
autocmd BufRead set makeprg=ant\ -find\ build.xml


"for vim java src code. ctags
"
this is for normal javaproject
"autocmd FileType java set tags=/home/dachuan/jdk1.6.0_18/.tags
"
this is for branch-0.1-trace java project
:set tags=~/jdk1.6.0_18/.tags,~/branch-0.1-trace/.tags


"for vim java src code. cscope
"
this is for branch-0.1-trace java project
:cs add ~/branch-0.1-trace/cscope.out ~/branch-0.1-trace


"for tab auto-completion, copy from web. http://blog.vinceliu.com/2008/12/tab-completion-for-vim-updated.html
"
Modified tab completion. It works fine now.
 My_TabComplete()
let line = getline('.') " curline
let substr = strpart(line, -1, col('.')+1) "
from start to cursor
let substr = matchstr(substr, "[^ \t]*$") " word till cursor
if (strlen(substr)==0) "
nothing to match on empty string
  return "\"
endif
let bool = match(substr, '\.') " position of period, if any
if (bool==-1)
  return "
\<C-X>\<C-P>" " existing text matching
else
return "\\"

 

我的tree ~/.vim


 

[dachuan@dachuanvm branch-0.1-trace]$ tree ~/.vim
/home/dachuan/.vim
|-- autoload
| `-- xml
| |-- jsf_c.vim
| |-- jsf_h.vim
| |-- stl_c.vim
| |-- stl_fmt.vim
| |-- stl_sql.vim
| |-- stl_x.vim
| |-- tc.vim
| `-- tx.vim
|-- compiler
| `-- javac_ex.vim
|-- doc
| |-- arabic.cnx
| |-- autocmd.cnx
| |-- change.cnx
| |-- cmdline.cnx
| |-- debug.cnx
| |-- debugger.cnx
| |-- develop.cnx
| |-- diff.cnx
| |-- digraph.cnx
| |-- editing.cnx
| |-- eval.cnx
| |-- farsi.cnx
| |-- filetype.cnx
| |-- fold.cnx
| |-- ft_ada.cnx
| |-- ft_sql.cnx
| |-- gui.cnx
| |-- gui_w16.cnx
| |-- gui_w32.cnx
| |-- gui_x11.cnx
| |-- hangulin.cnx
| |-- hebrew.cnx
| |-- help.cnx
| |-- howto.cnx
| |-- if_cscop.cnx
| |-- if_mzsch.cnx
| |-- if_ole.cnx
| |-- if_perl.cnx
| |-- if_pyth.cnx
| |-- if_ruby.cnx
| |-- if_sniff.cnx
| |-- if_tcl.cnx
| |-- indent.cnx
| |-- index.cnx
| |-- insert.cnx
| |-- intro.cnx
| |-- map.cnx
| |-- mbyte.cnx
| |-- message.cnx
| |-- mlang.cnx
| |-- motion.cnx
| |-- netbeans.cnx
| |-- options.cnx
| |-- os_390.cnx
| |-- os_amiga.cnx
| |-- os_beos.cnx
| |-- os_dos.cnx
| |-- os_mac.cnx
| |-- os_mint.cnx
| |-- os_msdos.cnx
| |-- os_os2.cnx
| |-- os_qnx.cnx
| |-- os_risc.cnx
| |-- os_unix.cnx
| |-- os_vms.cnx
| |-- os_win32.cnx
| |-- pattern.cnx
| |-- pi_getscript.cnx
| |-- pi_gzip.cnx
| |-- pi_netrw.cnx
| |-- pi_paren.cnx
| |-- pi_spec.cnx
| |-- pi_tar.cnx
| |-- pi_vimball.cnx
| |-- pi_zip.cnx
| |-- print.cnx
| |-- quickfix.cnx
| |-- quickref.cnx
| |-- quotes.cnx
| |-- recover.cnx
| |-- remote.cnx
| |-- repeat.cnx
| |-- rileft.cnx
| |-- russian.cnx
| |-- scroll.cnx
| |-- sign.cnx
| |-- spell.cnx
| |-- sponsor.cnx
| |-- starting.cnx
| |-- supertab.txt
| |-- syntax.cnx
| |-- tabpage.cnx
| |-- taglist.txt
| |-- tags
| |-- tags-cn
| |-- tagsrch.cnx
| |-- term.cnx
| |-- tips.cnx
| |-- todo.cnx
| |-- uganda.cnx
| |-- undo.cnx
| |-- usr_01.cnx
| |-- usr_02.cnx
| |-- usr_03.cnx
| |-- usr_04.cnx
| |-- usr_05.cnx
| |-- usr_06.cnx
| |-- usr_07.cnx
| |-- usr_08.cnx
| |-- usr_09.cnx
| |-- usr_10.cnx
| |-- usr_11.cnx
| |-- usr_12.cnx
| |-- usr_20.cnx
| |-- usr_21.cnx
| |-- usr_22.cnx
| |-- usr_23.cnx
| |-- usr_24.cnx
| |-- usr_25.cnx
| |-- usr_26.cnx
| |-- usr_27.cnx
| |-- usr_28.cnx
| |-- usr_29.cnx
| |-- usr_30.cnx
| |-- usr_31.cnx
| |-- usr_32.cnx
| |-- usr_40.cnx
| |-- usr_41.cnx
| |-- usr_42.cnx
| |-- usr_43.cnx
| |-- usr_44.cnx
| |-- usr_45.cnx
| |-- usr_90.cnx
| |-- usr_toc.cnx
| |-- various.cnx
| |-- vcde.txt
| |-- version4.cnx
| |-- version5.cnx
| |-- version6.cnx
| |-- version7.cnx
| |-- vi_diff.cnx
| |-- visual.cnx
| |-- vjde.txt
| |-- windows.cnx
| |-- winmanager.txt
| `-- workshop.cnx
|-- plugin
| |-- a.vim
| |-- autoclose.vim
| |-- grep.vim
| |-- minibufexpl.vim
| |-- taglist.vim
| |-- visualmark.vim
| |-- vjde
| | |-- genvimdata.rb
| | |-- jcommenter.vim
| | |-- project.vim
| | |-- readtags
| | |-- readtags.exe
| | |-- tipswnd.dll
| | |-- tld2xmldata.rb
| | |-- tlds
| | | |-- gtkdoc.txt
| | | |-- java.iab
| | | |-- java.vjde
| | | |-- permittedTaglibs.tld
| | | |-- scriptfree.tld
| | | |-- xdoclet.def
| | | |-- xsd.def
| | | |-- xsl.def
| | | |-- xul.def
| | | `-- xul_ref.def
| | |-- vjde.jar
| | |-- vjde_completion.rb
| | |-- vjde_completion.vim
| | |-- vjde_cpp_completion.vim
| | |-- vjde_cpp_doc_reader.rb
| | |-- vjde_cs_completion.vim
| | |-- vjde_ctags_completion.vim
| | |-- vjde_ctags_support.rb
| | |-- vjde_ctags_support.vim
| | |-- vjde_html_cfu.rb
| | |-- vjde_iab.vim
| | |-- vjde_java_completion.vim
| | |-- vjde_java_iab.vim
| | |-- vjde_java_utils.vim
| | |-- vjde_javadoc.rb
| | |-- vjde_javadoc.vim
| | |-- vjde_menu_def.vim
| | |-- vjde_preview.vim
| | |-- vjde_ruby_completion.vim
| | |-- vjde_struts2.rb
| | |-- vjde_tag_loader.vim
| | |-- vjde_taglib_cfu.rb
| | |-- vjde_template.rb
| | |-- vjde_template.vim
| | |-- vjde_template_tool.vim
| | |-- vjde_window.vim
| | |-- vjde_xml_cfu.rb
| | `-- wspawn.exe
| |-- vjde.vim
| |-- vjde_floatingwin.vim
| |-- vjde_todolist.vim
| |-- vjde_util.vim
| |-- winfileexplorer.vim
| |-- winmanager.vim
| `-- wintagexplorer.vim
`-- syntax
    |-- c.vim
    |-- preview.vim
    `-- vjde.vim

8 directories, 206 files


阅读(1330) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~