V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
9
V2EX  ›  Vim

Vim 的 YouCompleteMe 插件怎么设置跳转到 PHP 的函数定义呢?

  •  
  •   9 · 2014-03-26 10:09:57 +08:00 · 11384 次点击
    这是一个创建于 3685 天前的主题,其中的信息可能已经有所发展或是发生改变。
    费了半天劲装了 YouCompleteMe, 发现配置比安装更难。难道要先生成 tag 吗?
    10 条回复    2015-10-12 09:31:42 +08:00
    timonwong
        1
    timonwong  
       2014-03-26 13:21:32 +08:00
    YCM不提供除了C系和Python的Goto definition。。。
    用ctags吧。

    或者省事找个IDE
    banbanchs
        2
    banbanchs  
       2014-03-26 15:20:04 +08:00
    http://vim.wikia.com/wiki/Go_to_definition_using_g

    这个vim就可以做到了吧,不过没在php上试过
    9
        3
    9  
    OP
       2014-03-26 21:57:15 +08:00
    @timonwong 悲剧,看了官方说明,YCM 提供了 API, 可以自己写解析器,可惜难度太高。

    @banbanchs 这个太弱了。。
    henices
        4
    henices  
       2014-03-27 09:06:32 +08:00
    .vimrc 中添加上

    nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>


    c/c++ 管用,不知道对PHP对否生效。
    xwsoul
        5
    xwsoul  
       2015-03-29 15:20:59 +08:00
    照说 java php 应该都算 C 系吧
    9
        6
    9  
    OP
       2015-03-30 00:08:13 +08:00
    @xwsoul 大神,你挖的一手好坟。 ^0^
    xwsoul
        7
    xwsoul  
       2015-03-31 11:17:35 +08:00
    @9 我错了...Orz 求原谅
    nevernet
        8
    nevernet  
       2015-09-23 13:54:52 +08:00
    这个问题解决了吗?
    9
        9
    9  
    OP
       2015-09-25 00:08:09 +08:00
    @nevernet 囧,没有,期待其他大神解答吧。
    nevernet
        10
    nevernet  
       2015-10-12 09:31:42 +08:00   ❤️ 1
    @9 跟 YCM 的开发者聊了下, php 没有跳转的功能。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2889 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 09:28 · PVG 17:28 · LAX 02:28 · JFK 05:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.