vim encoding change issue

Encoding is always a headache issue.

After change the encoding to utf-8, I can't switch tabbar by alt-k.

There're many docs about vim encoding and alt/meta issue.

I find a solution. mapping it after change encoding:

hook the encoding change by:

:au EncodingChanged * :call <SID>Set_Tab_switch_shortcut()
implementate Set_Tab_switch_shortcut:

function! s:Set_Tab_switch_shortcut()
if mapcheck('^[1') == "" && mapcheck('<M-1>') == ""     "if unique is used by mapping, need these judgements.

...  " copy the mapping from tabbar.vim

endif " %%
endfunction

useful links:

http://vim.wikia.com/wiki/Get_Alt_key_to_work_in_terminal

http://vim.wikia.com/wiki/Mapping_fast_keycodes_in_terminal_Vim

http://hi.baidu.com/cs_peanuts/blog/item/3cee4ff0c0cd4a19b17ec5f3.html

 

still have encode issue after change encoding. 

It's the encoding of console and dialog output.

add the following code in Set_Tab_switch_shortcut():

if &encoding == "utf-8"
    language message zh_CN.utf-8
endif

if &encoding == "cp936"
    language message zh_CN
endif

 

useful link:

http://vimcdoc.sourceforge.net/doc/mbyte.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值