来世ガチャ乱数調整日記

Lily, Bass & Programing

ンホンホ町会議

こんにちは、びしょ〜じょです。
さて、Arch公式リポジトリVimは着々と更新されていっているが、if_luaが使えず、暗黒補完プラギンのneocompleteが使えないので毎回自分でビルドしている。ビルドの後にversionオプションをつけてluaが+になっているのを確認するが、よく見ると全く使っていない機能なども+になっていてなんか嫌だなーこわいなーって。

でもconfigureで--with-features=tinyにすると色々破滅する。でもできるだけ小さくしたい。など。
言ってしまうとできるだけ小さくしてvim-overなどで使われているconcealを+にしたい。これはオプションなどでは--with-features=big以上にしないと有効にできない。どうするか。

とりあえずビルドしているディレクトリでag +concealなどクソ雑に調べてみるとvim/src/feature.hというものがあたり、どうやらこいつがビルド時にFeaturesの+/-を決めているっぽい。
Feature.hの530行あたりに色々ある。

/*
 * +conceal        'conceal' option.  Needs syntax highlighting
 *                        as this is how the concealed text is defined.
 */

#if defined(FEAT_BIG) && defined(FEAT_SYN_HL)
# define FEAT_CONCEAL
#endif

Vim原理主義派が回りにいないことを確認した後に、`#if defined(FEAT_BIG) && defined(FEAT_SYN_HL)`と`#endif`をコメントアウトするなり消す(非推奨)なりする。
ここで気合が切れた(C/C++力がまったくなかった)ため、normal未満でconcealを有効にすることはできなかった。こんな感じでconfigure

./configure \
--with-features=normal \                     #明示しなくてもデフォルトでは--with-features=normalが選択される
--enable-luainterp=dynamic \                 #lua+
--enable-rubyinterp=dynamic \                #ruby+
--enable-multibyte \                         #マルチバイト文字対応(明示の必要なし?)
--disable-darwin \                           #Macのアレ
--disable-gpm \                              #Linux系でぃすとろのマウス関係
--disable-gtktest \                          #gui modeは使わない方向
--enable-gui=no \                                 
--disable-netbeans \                          #使わん
--disable-selinux \                           #SELinuxってぇ、Linuxディストリビューションですかぁ?
--disable-sysmouse \                          #BSD系のマウス関係
--disable-xsmp \                              #これもgui系
--disable-xsmp-interact \
--without-x \                                          
--enable-cscope \                             #なんかCのやつ
--enable-fail-if-missing \
--prefix=/usr/

心なしかVimの動作が速くなった気がする。

%vim --version
.....
+acl             -farsi           -mouse_sgr       +tag_binary
-arabic          +file_in_path    -mouse_sysmouse  +tag_old_static
+autocmd         +find_in_path    -mouse_urxvt     -tag_any_white
-balloon_eval    +float           -mouse_xterm     -tcl
-browse          +folding         +multi_byte      +terminfo
+builtin_terms   -footer          +multi_lang      +termresponse
+byte_offset     +fork()          -mzscheme        +textobjects
+cindent         +gettext         -netbeans_intg   +title
-clientserver    -hangul_input    +path_extra      -toolbar
-clipboard       +iconv           -perl            +user_commands
+cmdline_compl   +insert_expand   +persistent_undo +vertsplit
+cmdline_hist    +jumplist        +postscript      +virtualedit
+cmdline_info    -keymap          +printer         +visual
+comments        -langmap         -profile         +visualextra
+conceal         +libcall         -python          +viminfo
+cryptv          +linebreak       -python3         +vreplace
+cscope          +lispindent      +quickfix        +wildignore
+cursorbind      +listcmds        +reltime         +wildmenu
+cursorshape     +localmap        -rightleft       +windows
+dialog_con      +lua/dyn         +ruby/dyn        +writebackup
+diff            +menu            +scrollbind      -X11
+digraphs        +mksession       -signs           -xfontset
-dnd             +modify_fname    +smartindent     -xim
-ebcdic          -mouse           -sniff           -xsmp
-emacs_tags      -mouse_dec       +startuptime     -xterm_clipboard
+eval            -mouse_gpm       +statusline      -xterm_save
+ex_extra        -mouse_jsbterm   -sun_workshop    -xpm
+extra_search    -mouse_netterm   +syntax

こんな感じになる。