Compile Vim In Ubuntu with multi-byte and xterm_clipboard Feature

tag: vim ubuntu make multi-byte encoding xterm clipboard

[b]Reference:[/b]

[url=http://vim.wikia.com/wiki/Building_Vim]http://vim.wikia.com/wiki/Building_Vim[/url]
[url=http://vim.wikia.com/wiki/Clipboard]http://vim.wikia.com/wiki/Clipboard[/url]
[url=http://www.linuxforums.org/forum/newbie/144575-problems-copying-pasting-vim.html]http://www.linuxforums.org/forum/newbie/144575-problems-copying-pasting-vim.html[/url]


[b]Preface:[/b]

I'm a Linux starter who like pure command line interface. So I just installed Ubuntu 10.04 without GUI. And later I installed fluxbox environment under the instructions [url=http://wiki.dennyhalim.com/ubuntu-minimal-desktop]here[/url]. This article describes how to compile a multi-byte and xterm_clipboard (system clipboard) supported vim.

Why multi-byte?
I need to work with Chinese files
Why xterm_clipboard?
It will be easy for you copy and paste around in X system. And it is faster than build-in registers when the content is bigger.

[b]Get latest Vim source code:[/b]

Pls follow the instructions on Vim's main page

[b]To quickly build a vim:[/b]
cd /usr/local/src/vim/src
./configure
# you'd better remove original vim package on you machine before this step
sudo make install


[b]Add multi-byte support:[/b]
#replace ./configure with following
./configure --with-features=big


[b]Add xterm_clipboard Support:[/b]

Check if your vim supports xterm_clipboard:
[list]
[*]":version" vim command
[*]"vim --version"
[/list]
There will be a string "-xterm_clipboard or +xterm_clipboard"

Install build dependencies:
"sudo apt-get install" or "sudo aptitude install":
[list]
[*]libncurses5-dev
[*]libgtk2.0-dev
[*]libatk1.0-dev
[*]libx11-dev
[*]libxt-dev
[/list]
.configure --with-features=big --enable-gui=gtk2
.make
sudo make install


[b]Clipboard Operation:[/b]

When you have a [i]+xterm_clipboard[/i] version of vim, you can use following commands to operate system clipboard.
[list]
[*]"+yy or "*yy to copy to clipboard
[*]"+p or "*p to paste from clipboard
[/list]
[b]Notes:[/b]
[list]
[*]With a multi-byte supported Vim, you also need a correctly configed x-term emulator (encoding). Or the Chinese characters will still be a mess.
[*]I did not get a gvim through this process. And I don't know how to do that. But I'm happy because what I need is just s light weight, fast vim in terminal.
[*]If you need a vim-gnome, please refer to the first reference link
[*]System clipboard will be associated with different vim register on different platforms. It will always be "*" in windows version. And "+" in the build discussed here.
[/list]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值