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]
[b]Add multi-byte support:[/b]
[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]
[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]
[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]