Vim

personal snipetts – under construction

Vim src build

1. prerequirements

  • RHEL/CentOS/Fedora
    • git
    • gcc
    • make
    • autoconf
    • ncurses-devel
    • lua-devel
    • luajit-devel
    • gtk2-devel
    • libXt-devel
  • Debian/Ubuntu
    • git
    • gcc
    • make
    • autoconf
    • libncurses5-dev
    • libacl1-dev
    • libgpm-dev
    • lua5.2
    • luajit
    • liblua5.2-dev
    • libluajit-5.1-dev

2. check latest version

$ git ls-remote -h git://github.com/vim/vim.git

3. cmmi

$ git clone --depth 1 -b v7.4.2263 git://github.com/vim/vim.git vim-v7.4.2263
$ cd vim-v7.4.2263/src
$ make configure
$ /configure --prefix=/path/to/vim/v7.4.2263 \
  --with-features=huge --without-x --disable-gui --enable-multibyte \
  --enable-luainterp=dynamic --with-luajit --enable-gpm --enable-cscope \
  --enable-fontset --enable-fail-if-missing
$ make
$ make install

良い感じに適当にファイルを修正できるモードライン

2行書く。

vim:list lcs=tab\:>-,extends\:<,trail\:-,eol\:$ fdm=marker:
vim:ts=4 sts=4 sw=4 tw=0 fenc=utf-8 ff=unix:

Vim で cp932 のファイルを開く

$ alias edit='vim -c ":e ++enc=cp932"'
$ edit file_of_cp932.txt

OSX kaoriya Vim で各言語の拡張について利用したいものを指定する

let $PERL_DLL = "/usr/local/opt/perl/lib/5.20.1/darwin-thread-multi-2level/CORE/libperl.dylib"
let $PYTHON_DLL = "/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib"
let $PYTHON3_DLL="/Library/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5.dylib"
let $RUBY_DLL = "/usr/local/homebrew/Cellar/ruby21/2.1.5/lib/libruby.2.1.dylib"
let $LUA_DLL="/usr/local/homebrew/opt/lua/lib/liblua.5.2.3.dylib"