Skip to content

Commit

Permalink
Version 1.2.2: * so/fcitx.vim: update environment check
Browse files Browse the repository at this point in the history
  • Loading branch information
lilydjwg authored and vim-scripts committed Nov 8, 2013
1 parent 9c757c1 commit dd15078
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 8 additions & 2 deletions README
Expand Up @@ -4,9 +4,10 @@ Keep and restore fcitx state for each buffer separately when leaving/re-entering

Requires: fcitx 3.6 or later, 4.0 or later will be better.

Developing: It's a part of https://github.com/lilydjwg/dotvim
Settings: environment variable $FCITX_SOCKET specifies a socket to connect instead of figuring out itself. This can be an abstract socket address starting with "@" from version 1.2.4 on.

A mirror repo: https://github.com/vim-scripts/fcitx.vim
Git repo: https://github.com/lilydjwg/fcitx.vim
www.vim.org: http://www.vim.org/scripts/script.php?script_id=3764

Warning:
1, It will be faster and better with Python (3 or 2) enabled Vim. But some old version Vim enabled both Python 2 & 3 may have some issues.
Expand All @@ -16,6 +17,11 @@ Warning:

要求: fcitx 版本 3.6 以上,建议 fcitx 4.0 以上。

配置:环境变量 $FCITX_SOCKET 指定要连接的套接字路径,而非默认的。自版本 1.2.4 起,此变量若以 "@" 字符开头,则被认为是抽象套接字地址。

Git 仓库: https://github.com/lilydjwg/fcitx.vim
www.vim.org: http://www.vim.org/scripts/script.php?script_id=3764

注意事项:
1. Vim 如有 Python 3或2 支持可以获得更快更好的效果。但对于较旧的 Vim 版本,如果同时编译了 Python 2 & 3 支持,因为此 Vim 不能同时运行两个版本的 Python,而本脚本首先检查 Python 3,所以会导致出错或者 Python 2 不可用。
2. 终端下请设置 Vim 'ttimeoutlen' 选项为较小值(如100),否则退出插入模式时会有较严重的延迟。同样会造成延迟的还有 screen 的 maptimeout 选项以及 tmux 的 escape-time 选项。
Expand Down
6 changes: 4 additions & 2 deletions plugin/fcitx.vim
@@ -1,11 +1,13 @@
scriptencoding utf-8
" fcitx.vim remember fcitx's input state for each buffer
" Author: lilydjwg
" Version: 1.2
" Version: 1.2.2
" URL: http://www.vim.org/scripts/script.php?script_id=3764
" ---------------------------------------------------------------------
" Load Once:
if &cp || exists("g:loaded_fcitx") || !exists('$DISPLAY') || exists('$SSH_TTY') || has('gui_macvim')
if &cp || exists("g:loaded_fcitx") || (
\ (!exists('$DISPLAY') || exists('$SSH_TTY') || has('gui_macvim'))
\ && !exists('$FCITX_SOCKET'))
finish
endif
if has("python3")
Expand Down
4 changes: 1 addition & 3 deletions so/fcitx.vim
@@ -1,16 +1,14 @@
" fcitx.vim 记住插入模式小企鹅输入法的状态
" Author: lilydjwg
" Maintainer: lilydjwg
" Last Change: 2010-11-18
" Note: 另有使用 Python3 接口的新版本
" ---------------------------------------------------------------------
" Load Once:
if (has("win32") || has("win95") || has("win64") || has("win16"))
" Windows 下不要载入
finish
endif
if !exists('$DISPLAY')
" 没有 X,不要载入
if !exists('$DISPLAY') || exists('$SSH_TTY') || has('gui_macvim')
finish
endif
if &cp || exists("g:loaded_fcitx") || !executable("fcitx-remote")
Expand Down

0 comments on commit dd15078

Please sign in to comment.