" messagesをクリップボードに map <C-r>m :redir @*:silent messages:redir END
|
||||||
" messagesをクリップボードに map <C-r>m :redir @*:silent messages:redir END pythonのdoctestが凄くいい。 ただ、以下のテストを実行してみるとわかるのですが、 # encoding: utf-8 def doctestJapan(no): """ >>> doctestJapan(0) u'tiro finale' >>> doctestJapan(1) こんなの絶対おかしいよ >>> doctestJapan(2) # わけがわからないよ u'\u308f\u3051\u304c\u308f\u304b\u3089\u306a\u3044\u3088' >>> doctestJapan(3) u'わけがわからないよ' """ if no == 0: return u'tiro finale' elif no == 1: print u'こんなの絶対おかしいよ' elif no == 2: return u'わけがわからないよ' if __name__ == "__main__": import doctest doctest.testmod() こんな実行結果
**********************************************************************
File "C:\Users\xxxxxx\.vim_junk\2012\2012-02-08-071611.py", line 10, in __main__.doctestJapan
Failed example:
doctestJapan(2)
Expected:
u'わけがわからないよ'
Got:
u'\u308f\u3051\u304c\u308f\u304b\u3089\u306a\u3044\u3088'
**********************************************************************
1 items had failures:
1 of 4 in __main__.doctestJapan
***Test Failed*** 1 failures.
上記を見ると、ふつうにu’わけがわからないよ’と書いた部分はテストが通っていない。 結論:doctestで日本語を使うときは、printを指定して望みどおりに表示されているかを確認すると吉。windows7環境で、Chromeを指定する方法。 " 外部ブラウザ let QFixHowm_OpenURIcmd = '!start ' . $HOMEPATH . '\AppData\Local\Google\Chrome\Application\chrome.exe %s --disk-cache-dir="R:\Temp\Chrome"' 環境変数$HOMEPATHが設定されていない場合は、適宜読み替えて設定する。 vimテクニックバイブルで紹介されていたqfixhowmというプラグインを使い始めています。 メモの記録や、TODO管理などで便利すぎてたまりません。 qfixhowmでg,dした時のカーソル位置が]の左ではなく右側にあって欲しい通常のマッピング n g,d * :<C-U>call qfixmemo#InsertDate('Date')<CR> 右を動かすように上書き nmap g,d :<C-U>call qfixmemo#InsertDate('Date')<CR><Right> nmap g,T :<C-U>call qfixmemo#InsertDate('Time')<CR><Right> 自分はLeaderにfをマッピングしているので、実際にはfd,fTのコマンドとして利用しています。 Vimテクニックバイブル ~作業効率をカイゼンする150の技
posted with amazlet at 12.01.08
Vimサポーターズ
技術評論社 売り上げランキング: 12628 下準備。 ココからが難しいとこ Mingw-toolsのインストール(makeのインストール)http://jaist.dl.sourceforge.net/project/mingw/Installer/mingw-get-inst/mingw-get-inst-20111118/mingw-get-inst-20111118.exe C:\MinGW-tools\msys\1.0\bin pathに追加 Mingw-64bitのインストール解凍したファイルを移動して、C:\mingw-w64\ に名前変更 C:\mingw-w64\bin pathに追加 C:\mingw-w64\bin\x86_64-w64-mingw32-gcc.exe を gcc.exeに名前変更 ※上記のMingw-tools、及びMingw-64bitは以下を参考に最新をダウンロードするといい。 コマンドプロンプトを起動して、こんな感じで出る c:\>make -v GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i686-pc-msys c:\>gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/mingw-w64/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.0/lto -wrapper.exe Target: x86_64-w64-mingw32 Configured with: ../../../build/gcc/src/configure --target=x86_64-w64-mingw32 -- prefix=/c/bb/vista64-mingw32/mingw-x86-x86_64/build/build/root --with-sysroot=/c /bb/vista64-mingw32/mingw-x86-x86_64/build/build/root --enable-languages=all,obj -c++ --enable-fully-dynamic-string --disable-multilib Thread model: win32 gcc version 4.7.0 20111220 (experimental) (GCC) vimprocのコンパイルc:\>cd c:\Users\xxxxxx\.vim\bundle\vimproc
c:\Users\xxxxxx\.vim\bundle\vimproc>make -f make_mingw.mak
gcc -O2 -Wall -shared -o autoload/proc.dll autoload/proc_w32.c -lwsock32
autoload/proc_w32.c:31:0: warning: "WINVER" redefined [enabled by default]
In file included from c:\mingw-w64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../..
/../../x86_64-w64-mingw32/include/stdio.h:9:0,
from autoload/proc_w32.c:22:
c:\mingw-w64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-ming
w32/include/_mingw.h:240:0: note: this is the location of the previous definitio
n
autoload/proc_w32.c:32:0: warning: "_WIN32_WINNT" redefined [enabled by default]
In file included from c:\mingw-w64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../..
/../../x86_64-w64-mingw32/include/stdio.h:9:0,
from autoload/proc_w32.c:22:
c:\mingw-w64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-ming
w32/include/_mingw.h:244:0: note: this is the location of the previous definitio
n
autoload/proc_w32.c: In function 'vp_pipe_open':
autoload/proc_w32.c:499:33: warning: cast from pointer to integer of different s
ize [-Wpointer-to-int-cast]
autoload/proc_w32.c:501:33: warning: cast from pointer to integer of different s
ize [-Wpointer-to-int-cast]
autoload/proc_w32.c:504:37: warning: cast from pointer to integer of different s
ize [-Wpointer-to-int-cast]
autoload/proc_w32.c: In function 'ExitRemoteProcess':
autoload/proc_w32.c:648:33: warning: cast to pointer from integer of different s
ize [-Wint-to-pointer-cast]
autoload/proc_w32.c: In function 'vp_open':
autoload/proc_w32.c:949:9: warning: cast from pointer to integer of different si
ze [-Wpointer-to-int-cast]
In file included from autoload/proc_w32.c:44:0:
autoload/proc_w32.c: At top level:
autoload/vimstack.c:42:19: warning: 'vp_stack_null' defined but not used [-Wunus
ed-variable]動作確認 |
||||||
|
Copyright © 2012 wp.krks.net - All Rights Reserved |
||||||