putty+screen+vim 远程编程环境配置

虽然同事一般都用SecureCRT,不过我机器上SecureCRT在UTF-8编辑设置下不正常,于是还是换回putty。

支持滚屏、鼠标的配置的关键之处是:.bash_profile中export TERM=xterm,.screenrc中termcapinfo xterm ti@:te@,.vimrc中set ttymouse=xterm2。

另外,vim+cscope确实好用。下面是cscope方面的设置:
  1.   if has("cscope")
  2.       set nocsverb
  3.       if $CSCOPE_DB != ""
  4.           cs add $CSCOPE_DB
  5.       let g:CScopeOut=$CSCOPE_DB
  6.       elseif filereadable("cscope.out")
  7.           cs add cscope.out
  8.       let g:CScopeOut="cscope.out"
  9.       elseif filereadable("../cscope.out")
  10.           cs add ../cscope.out ..
  11.       let g:CScopeOut="../cscope.out"
  12.       elseif filereadable("../../cscope.out")
  13.           cs add ../../cscope.out ../..
  14.       let g:CScopeOut="../../cscope.out"
  15.       elseif filereadable("../../../cscope.out")
  16.           cs add ../../../cscope.out ../../..
  17.       let g:CScopeOut="../../../cscope.out"
  18.       elseif filereadable("../../../../cscope.out")
  19.           cs add ../../../../cscope.out ../../../..
  20.       let g:CScopeOut="../../../../cscope.out"
  21.       elseif filereadable("../../../../../cscope.out")
  22.           cs add ../../../../../cscope.out ../../../../..
  23.       let g:CScopeOut="../../../../../cscope.out"
  24.       elseif filereadable("../../../../../../cscope.out")
  25.           cs add ../../../../../../cscope.out ../../../../../..
  26.       let g:CScopeOut="../../../../../../cscope.out"
  27.       else
  28.       let g:CScopeOut=""
  29.       endif
  30.       set csverb
  31.       nmap <C-_> :cs find 3 <C-R>=expand("<cword>")<CR><CR>
  32.       nmap g<C-]> :cstag <C-R>=expand("<cword>")<CR><CR>
  33.       nmap g<C-/> :cs find 0 <C-R>=expand("<cword>")<CR><CR>
  34.       vmap g<C-/> "zy:cs find 4 <C-R>z<CR>
  35.       function! Myadd_csup(findpath)
  36.           if g:CScopeOut == ""
  37.               return
  38.           endif
  39.           if cscope_connection(4, g:CScopeOut, substitute(g:CScopeOut, "/[^/]*$""""")) || cscope_connection(4, g:CScopeOut)
  40.               exec "cs kill " . g:CScopeOut
  41.               if a:findpath == ""
  42.                   if g:findpath != ""
  43.                       let s:findpath = g:findpath
  44.                   else
  45.                       let s:findpath = substitute(g:CScopeOut, "/[^/]*$""""")
  46.                   endif
  47.               else
  48.                   let s:findpath = a:findpath
  49.               endif
  50.               echo "Finding.."
  51.               let s:temp=system("find " . s:findpath . " -name '*.c' -o -name '*.h' -o -name '*.cpp' -o -name '*.cc' >" . substitute(g:CScopeOut, "out$""files"""))
  52.               echo "Sorting.."
  53.               let s:temp=system("~/.bin/rmdupcsfile " . substitute(g:CScopeOut, "out$""files"""))
  54.               echo "Building.."
  55.               let s:temp=system("cscope -b -i " . substitute(g:CScopeOut, "out$""files""") . " -f " . g:CScopeOut)
  56.               exec "cs add " . g:CScopeOut . " " . substitute(g:CScopeOut, "/[^/]*$""""")
  57.           else
  58.               echo "Cscope update failed"
  59.           endif
  60.       endfunction
  61.       command! Upcs call Myadd_csup("")
  62.   endif


其他的就懒得贴了。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值