当前位置:   article > 正文

Fitten code插件(AI代码补全插件)在vim上的使用(Vim插件下载和使用)(plug下载报错)(vim更新)_error detected while processing vimenter auto comm

error detected while processing vimenter auto commands for "*":

1.Fitten code是一个vim的ai插件可以通过注释或上下文自动补全代码

下载代码如下

  1. # github install
  2. mkdir -p ~/.vim/plugin
  3. curl -o ~/.vim/plugin/fittencode.vim https://raw.githubusercontent.com/FittenTech/fittencode.vim/master/plugin/fittencode.vim

2.下载后使用vim时报错

  1. Error detected while processing VimEnter Autocommands for "*"..function FittenMa
  2. pping:
  3. line 1:
  4. E117: Unknown function: keytrans
  5. Press ENTER or type command to continue
  6. Error detected while processing VimEnter Autocommands for "*"..function FittenMa
  7. pping:
  8. line 3:
  9. E117: Unknown function: keytrans
  10. Press ENTER or type command to continue

这是因为vim插件管理问题

3.可以下载管理器vim-plug

sudo curl -fLo ~/.vim/autoload/plug.vim --create-dirs     https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

如果报错

  1. curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 61 ms: Connection refused
  2. bash: syntax error near unexpected token `7'

这是因为github 的一些域名的 DNS 解析被污染

具体而言:

    打开 https://www.ipaddress.com/ 输入访问不了的域名,获得对应的IP。

    使用vim /etc/hosts命令打开不能访问的机器的hosts文件,添加如下内容:

  1. 199.232.68.133 raw.githubusercontent.com
  2. 199.232.68.133 user-images.githubusercontent.com
  3. 199.232.68.133 avatars2.githubusercontent.com
  4. 199.232.68.133 avatars1.githubusercontent.com

    注:上面内容中199.232.68.133是raw.githubusercontent.com所在的服务器IP(通过 https://www.ipaddress.com/ 获知)。

    保存该文件,再使用即可正常访问。引用自

http://t.csdnimg.cn/QEC6d

重新下载vim-plug

4.如果继续报错

  1. Error detected while processing VimEnter Autocommands for "*"..function FittenMa
  2. pping:
  3. line 1:
  4. E117: Unknown function: keytrans
  5. Press ENTER or type command to continue
  6. Error detected while processing VimEnter Autocommands for "*"..function FittenMa
  7. pping:
  8. line 3:
  9. E117: Unknown function: keytrans
  10. Press ENTER or type command to continue

可能是因为vim版本过低,下载vim8(非官方下载有一定风险)(官方没有将此版本加入更新包)

  1. sudo add-apt-repository ppa:jonathonf/vim
  2. sudo apt-get update
  3. sudo apt-get install vim

5.如果报错

  1. E: The repository 'https://ppa.launchpadcontent.net/fcitx-team/nightly/ubuntu jammy Release' does not have a Release file.
  2. N: Updating from such a repository can't be done securely, and is therefore disabled by default.
  3. N: See apt-secure(8) manpage for repository creation and user configuration details.

进入到 /etc/apt/sources.list.d 目录下

sudo vim fossfreedom-ubuntu-indicator-sysmonitor-jammy.list

修改

fossfreedom-ubuntu-indicator-sysmonitor-jammy.list文件(文件名因系统版本而异,大体相似即可)

  1. deb https://ppa.launchpadcontent.net/fossfreedom/indicator-sysmonitor/ubuntu/ jammy main
  2. # deb https://ppa.launchpadcontent.net/fossfreedom/indicator-sysmonitor/ubuntu/ jammy main

引用http://t.csdnimg.cn/tpD6r

再重新下载vim8

  1. sudo add-apt-repository ppa:jonathonf/vim
  2. sudo apt-get update
  3. sudo apt-get install vim

下载成功后再使用vim报错消失,插件成功加载

6.使用

fitten code 连接完成键入

:Fittenlogin 用户名 密码

显示

Login successful, API key saved  

成功接入

在代码补充处<ctrl+l>自动补全,<tab>接受补全,<ctrl+n>补全列表,目前仅有以上功能。(可以用注释说明需求)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/寸_铁/article/detail/783520
推荐阅读
相关标签
  

闽ICP备14008679号