ubuntu10.04 vim的插件 taglist 使用出错

Vim、Emacs配置和使用
回复
noreasona
帖子: 26
注册时间: 2010-04-01 17:23

ubuntu10.04 vim的插件 taglist 使用出错

#1

帖子 noreasona » 2010-05-31 20:49

输入:Tlist后,提示如下的错误:
处理 function <SNR>11_Tlist_Window_Toggle..<SNR>11_Tlist_Window_Open..<SNR>11_Tlist_Window_Refresh..<SNR>11_Tli
st_Window_Refresh_File..<SNR>11_Tlist_Process_File 时发生错误:
第 83 行:
E484: 无法打开文件 /tmp/vGHNbqw/0
Taglist: Failed to generate tags for /home/justin/NEW/program.c
请按 ENTER 或其它命令继续

请问各位这是什么原因?
头像
lilydjwg
论坛版主
帖子: 4258
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: ubuntu10.04 vim的插件 taglist 使用出错

#2

帖子 lilydjwg » 2010-05-31 22:40

etags 安装正常否?
noreasona
帖子: 26
注册时间: 2010-04-01 17:23

Re: ubuntu10.04 vim的插件 taglist 使用出错

#3

帖子 noreasona » 2010-06-01 9:18

lilydjwg 写了:etags 安装正常否?
先安装了新立得里面的exuberant-ctags,再安装taglist的
头像
呼文彪
帖子: 338
注册时间: 2009-03-13 20:31
来自: cnblogs.com/open_source

Re: ubuntu10.04 vim的插件 taglist 使用出错

#4

帖子 呼文彪 » 2010-06-04 22:42

是不是没有生成tags

代码: 全选

'(("OS" . "Fedora")
  ("editor" . "Emacs"))
  ("blog" . "http://www.cnblogs.com/open_source")
noreasona
帖子: 26
注册时间: 2010-04-01 17:23

Re: ubuntu10.04 vim的插件 taglist 使用出错

#5

帖子 noreasona » 2010-06-04 22:54

有生成tags,ctags -R
有没有人用Ubuntu10.04成功安装taglist的呢?
能不能把安装方法分享一下
网上的安装方法试了好多次了,都不行,好郁闷啊 :em20
头像
lilydjwg
论坛版主
帖子: 4258
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: ubuntu10.04 vim的插件 taglist 使用出错

#6

帖子 lilydjwg » 2010-06-05 11:48

noreasona 写了: 有没有人用Ubuntu10.04成功安装taglist的呢?
能不能把安装方法分享一下
网上的安装方法试了好多次了,都不行,好郁闷啊 :em20
我也郁闷了,真不知道你是怎么弄的。

在 taglist.vim 的约 606 行设置

代码: 全选

let s:tlist_debug = 1
let s:tlist_debug_file = 'somefile.log'
然后再尝试,把记录的日志贴上来。
noreasona
帖子: 26
注册时间: 2010-04-01 17:23

Re: ubuntu10.04 vim的插件 taglist 使用出错

#7

帖子 noreasona » 2010-06-05 14:54

lilydjwg 写了:
noreasona 写了: 有没有人用Ubuntu10.04成功安装taglist的呢?
能不能把安装方法分享一下
网上的安装方法试了好多次了,都不行,好郁闷啊 :em20
我也郁闷了,真不知道你是怎么弄的。

在 taglist.vim 的约 606 行设置

代码: 全选

let s:tlist_debug = 1
let s:tlist_debug_file = 'somefile.log'
然后再尝试,把记录的日志贴上来。
记录的日志如下:

14:48:13: Tlist_Window_Toggle()
14:48:13: Tlist_Window_Open()
14:48:13: Tlist_Window_Create()
14:48:13: Tlist_Window_Init()
14:48:13: Tlist_Buffer_Removed (/home/justin/NEW/__Tag_List__)
14:48:13: Tlist_Window_Refresh()
14:48:13: Tlist_Window_Refresh_File (/home/justin/NEW/cd_db)
14:48:13: Tlist_Process_File (/home/justin/NEW/cd_db, sh)
14:48:13: Tlist_FileType_Init (sh)
14:48:13: Tlist_Init_File (/home/justin/NEW/cd_db)
14:48:13: Cmd: /usr/bin/ctags -f - --format=2 --excmd=pattern --fields=nks --sort=no --language-force=sh --sh-types=f "/home/justin/NEW/cd_db"
14:48:22: Tlist_Refresh (Skip_Refresh = 0, __Tag_List__)
14:48:23: Tlist_Post_Close_Cleanup()
头像
lilydjwg
论坛版主
帖子: 4258
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: ubuntu10.04 vim的插件 taglist 使用出错

#8

帖子 lilydjwg » 2010-06-05 15:58

noreasona 写了: 记录的日志如下:

14:48:13: Tlist_Window_Toggle()
14:48:13: Tlist_Window_Open()
14:48:13: Tlist_Window_Create()
14:48:13: Tlist_Window_Init()
14:48:13: Tlist_Buffer_Removed (/home/justin/NEW/__Tag_List__)
14:48:13: Tlist_Window_Refresh()
14:48:13: Tlist_Window_Refresh_File (/home/justin/NEW/cd_db)
14:48:13: Tlist_Process_File (/home/justin/NEW/cd_db, sh)
14:48:13: Tlist_FileType_Init (sh)
14:48:13: Tlist_Init_File (/home/justin/NEW/cd_db)
14:48:13: Cmd: /usr/bin/ctags -f - --format=2 --excmd=pattern --fields=nks --sort=no --language-force=sh --sh-types=f "/home/justin/NEW/cd_db"
14:48:22: Tlist_Refresh (Skip_Refresh = 0, __Tag_List__)
14:48:23: Tlist_Post_Close_Cleanup()
在 shell 里执行以下代码看输出(在/home/justin/NEW/cd_db存在的时候)

代码: 全选

/usr/bin/ctags -f - --format=2 --excmd=pattern --fields=nks --sort=no --language-force=sh --sh-types=f "/home/justin/NEW/cd_db"
noreasona
帖子: 26
注册时间: 2010-04-01 17:23

Re: ubuntu10.04 vim的插件 taglist 使用出错

#9

帖子 noreasona » 2010-06-05 19:16

lilydjwg 写了:
noreasona 写了: 记录的日志如下:

14:48:13: Tlist_Window_Toggle()
14:48:13: Tlist_Window_Open()
14:48:13: Tlist_Window_Create()
14:48:13: Tlist_Window_Init()
14:48:13: Tlist_Buffer_Removed (/home/justin/NEW/__Tag_List__)
14:48:13: Tlist_Window_Refresh()
14:48:13: Tlist_Window_Refresh_File (/home/justin/NEW/cd_db)
14:48:13: Tlist_Process_File (/home/justin/NEW/cd_db, sh)
14:48:13: Tlist_FileType_Init (sh)
14:48:13: Tlist_Init_File (/home/justin/NEW/cd_db)
14:48:13: Cmd: /usr/bin/ctags -f - --format=2 --excmd=pattern --fields=nks --sort=no --language-force=sh --sh-types=f "/home/justin/NEW/cd_db"
14:48:22: Tlist_Refresh (Skip_Refresh = 0, __Tag_List__)
14:48:23: Tlist_Post_Close_Cleanup()
在 shell 里执行以下代码看输出(在/home/justin/NEW/cd_db存在的时候)

代码: 全选

/usr/bin/ctags -f - --format=2 --excmd=pattern --fields=nks --sort=no --language-force=sh --sh-types=f "/home/justin/NEW/cd_db"
代码输出如下:

set_menu_choice /home/justin/NEW/cd_db /^set_menu_choice() {$/;" f line:10
add_records /home/justin/NEW/cd_db /^add_records() {$/;" f line:29
get_confirm /home/justin/NEW/cd_db /^get_confirm() {$/;" f line:64
insert_title /home/justin/NEW/cd_db /^insert_title() {$/;" f line:82
add_record_tracks /home/justin/NEW/cd_db /^add_record_tracks() {$/;" f line:87
insert_track /home/justin/NEW/cd_db /^insert_track() {$/;" f line:113
remove_records /home/justin/NEW/cd_db /^remove_records() {$/;" f line:119
find_cd /home/justin/NEW/cd_db /^find_cd() {$/;" f line:139
get_return /home/justin/NEW/cd_db /^get_return() {$/;" f line:199
list_tracks /home/justin/NEW/cd_db /^list_tracks() {$/;" f line:205
update_cd /home/justin/NEW/cd_db /^update_cd() {$/;" f line:228
count_cds /home/justin/NEW/cd_db /^count_cds() {$/;" f line:249
头像
lilydjwg
论坛版主
帖子: 4258
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: ubuntu10.04 vim的插件 taglist 使用出错

#10

帖子 lilydjwg » 2010-06-05 23:30

奇怪了。

在第 2289 行 let cmd_output = system(ctags_cmd) 后加入 echo $cmd_output 看能不能 echo 出你直接执行 ctags 得到的结果。

另外,你的 shell 选项以及 Vim 文档中关于此选项给出的相关选项的值改过没有?目前值是什么?
noreasona
帖子: 26
注册时间: 2010-04-01 17:23

Re: ubuntu10.04 vim的插件 taglist 使用出错

#11

帖子 noreasona » 2010-06-07 9:19

lilydjwg 写了:奇怪了。

在第 2289 行 let cmd_output = system(ctags_cmd) 后加入 echo $cmd_output 看能不能 echo 出你直接执行 ctags 得到的结果。

另外,你的 shell 选项以及 Vim 文档中关于此选项给出的相关选项的值改过没有?目前值是什么?
在第 2289 行 let cmd_output = system(ctags_cmd) 后加入 echo $cmd_output ,然后执行ctags -R,没有输出。
shell选项,我装了fish,在高级用户设置中,将/bin/sh改为了/usr/bin/fish
头像
lilydjwg
论坛版主
帖子: 4258
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: ubuntu10.04 vim的插件 taglist 使用出错

#12

帖子 lilydjwg » 2010-06-07 11:07

原来是这样啊~~~

Vim和bash、zsh配合没问题,但是对于语法奇特的fish就不行了。把shell设为bash吧。
noreasona
帖子: 26
注册时间: 2010-04-01 17:23

Re: ubuntu10.04 vim的插件 taglist 使用出错

#13

帖子 noreasona » 2010-06-07 13:00

lilydjwg 写了:原来是这样啊~~~

Vim和bash、zsh配合没问题,但是对于语法奇特的fish就不行了。把shell设为bash吧。
嗯,对了,我把默认的shell换成/bin/sh就可以用了。但是必须要用到sudo才行,要是不用sudo的话,还是会提示之前的错误。
头像
lilydjwg
论坛版主
帖子: 4258
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: ubuntu10.04 vim的插件 taglist 使用出错

#14

帖子 lilydjwg » 2010-06-09 17:59

noreasona 写了:
lilydjwg 写了:原来是这样啊~~~

Vim和bash、zsh配合没问题,但是对于语法奇特的fish就不行了。把shell设为bash吧。
嗯,对了,我把默认的shell换成/bin/sh就可以用了。但是必须要用到sudo才行,要是不用sudo的话,还是会提示之前的错误。
检查文件权限,特别是 /tmp,权限应为 1777。

另外,你是在哪里使用 sudo 的?
回复