-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
g:quickrun_config の設定方法を改善/改良する #59
Comments
現状の quickrun_config の適用順
|
|
そんな仕様ありましたっけ…? |
ありませんでしたっけ? |
なかったはず。 |
あ、今まで勘違いしていた気が…。 |
一瞬thincaさんよりおしょーさんの方がquickrunの仕様に熟知しているのかと思って戦慄しました。 |
それができてるなら |
|
最悪現行と互換性がなくなってもある程度はいいかと思っています。設定なしの人がそのまま移行できればいいかな、くらい。 |
現状、C++ では複数の処理系があり、更に環境によって使用されているバージョンも違うため、下記のように細かく設定しています。 let g:quickrun_config = {
\ "cpp/g++4.7.2" : {
\ "command" : $GCCS_ROOT."/gcc4_7_2/bin/g++",
\ "exec" : "%c %o %s -o %s:p:r ",
\ "cmdopt" : " -std=gnu++0x",
\ "hook/boost_link/enable" : 0,
\ "outputter/quickfix/errorformat" : '%f:%l:%c:\ %t%*[^:]:%m,%f:%m',
\ "outputter/location_list/errorformat" : '%f:%l:%c:\ %t%*[^:]:%m,%f:%m',
\ },
\
\ "cpp/g++4.8" : {
\ "command" : $GCCS_ROOT."/gcc4_8/bin/g++.exe",
\ "exec" : "%c %o %s -o %s:p:r ",
\ "cmdopt" : " -std=gnu++0x",
\ "hook/boost_link/enable" : 1,
\ "outputter/quickfix/errorformat" : '%f:%l:%c:\ %t%*[^:]:%m,%f:%m',
\ "outputter/location_list/errorformat" : '%f:%l:%c:\ %t%*[^:]:%m,%f:%m',
\ },
\
\ "cpp/msvc2010" : {
\ "command" : "cl",
\ "exec" : "%c %o %s:p",
\ "cmdopt" : "/D_DEBUG /D_CONSOLE /D_UNICODE /DUNICODE",
\ "hook/output_encode/encoding" : "sjis",
\ "hook/msvc_compiler/enable" : 1,
\ "hook/msvc_compiler/target" : "C:/Program Files/Microsoft Visual Studio 10.0",
\ },
\
\ "cpp/msvc2008" : {
\ "command" : "cl",
\ "exec" : "%c %o %s:p",
\ "cmdopt" : "/D_DEBUG /D_CONSOLE /D_UNICODE /DUNICODE",
\ "hook/output_encode/encoding" : "sjis",
\ "hook/msvc_compiler/enable" : 1,
\ "hook/msvc_compiler/target" : "C:/Program Files/Microsoft Visual Studio 9.0",
\ },
\
\ "cpp/clang++3.0" : {
\ "command" : $LLMV_WORK_ROOT."/BUILD_3_0/bin/clang++",
\ "exec" : "%c %o %s -o %s:p:r ",
\ "cmdopt" : "-std=gnu++0x ",
\ "outputter/quickfix/errorformat" : '%f:%l:%c:\ %t%*[^:]:%m,%m\ %f:%l:',
\ "outputter/location_list/errorformat" : '%f:%l:%c:\ %t%*[^:]:%m',
\ },
\
\ "cpp/clang++3.1" : {
\ "command" : $LLMV_WORK_ROOT."/BUILD_3_1/bin/clang++",
\ "exec" : "%c %o %s -o %s:p:r ",
\ "cmdopt" : "-std=gnu++0x ",
\ "outputter/quickfix/errorformat" : '%f:%l:%c:\ %t%*[^:]:%m,%m\ %f:%l:',
\ "outputter/location_list/errorformat" : '%f:%l:%c:\ %t%*[^:]:%m',
\ },
\} 上記の設定は一部だけなんですがここら辺の設定がだいぶアレな感じになってしまっているのでどうにかしたいんですよねぇ…。 |
案1 let g:quickrun_config = {
\ "cpp/g++" : {
\ "cmdopt" : " -std=gnu++0x",
\ "exec" : "%c %o %s -o %s:p:r ",
\ "hook/boost_link/enable" : 0,
\ "outputter/quickfix/errorformat" : '%f:%l:%c:\ %t%*[^:]:%m,%f:%m',
\ "outputter/location_list/errorformat" : '%f:%l:%c:\ %t%*[^:]:%m,%f:%m',
\ }
\
\ "cpp/g++/4.7.2" : {
\ "command" : $GCCS_ROOT."/gcc4_7_2/bin/g++",
\ },
\
\ "cpp/g++/4.8" : {
\ "command" : $GCCS_ROOT."/gcc4_8/bin/g++.exe",
\ },
\
\
\ "cpp/msvc" : {
\ "command" : "cl",
\ "exec" : "%c %o %s:p",
\ "cmdopt" : "/D_DEBUG /D_CONSOLE /D_UNICODE /DUNICODE",
\ "hook/output_encode/encoding" : "sjis",
\ "hook/msvc_compiler/enable" : 1,
\ },
\
\ "cpp/msvc/2010" : {
\ "hook/msvc_compiler/target" : "C:/Program Files/Microsoft Visual Studio 10.0",
\ },
\
\ "cpp/msvc2008" : {
\ "hook/msvc_compiler/target" : "C:/Program Files/Microsoft Visual Studio 9.0",
\ },
\
\
\ "cpp/clang++" : {
\ "exec" : "%c %o %s -o %s:p:r ",
\ "cmdopt" : "-std=gnu++0x ",
\ "outputter/quickfix/errorformat" : '%f:%l:%c:\ %t%*[^:]:%m,%m\ %f:%l:',
\ "outputter/location_list/errorformat" : '%f:%l:%c:\ %t%*[^:]:%m',
\ },
\
\ "cpp/clang++/3.0" : {
\ "command" : $LLMV_WORK_ROOT."/BUILD_3_0/bin/clang++",
\ },
\
\ "cpp/clang++3.1" : {
\ "command" : $LLMV_WORK_ROOT."/BUILD_3_1/bin/clang++",
\ },
\} こんな感じの設定になると思います。 |
その場合、 |
はい、それはいまわたしもどうしようか考えていました。どうしよかな。 |
let g:quickrun_config = {
\ "cpp" : {
\ "type" "cpp/g++/4.8"
\ }
... gcc や msvc の設定
\}
" この場合、どのように適用するか。
:QuickRun cpp |
今までの例は C++ の場合だったんですが、こんな感じで設定が多くなる言語とかって他にありますかね。 |
処理系が複数ある言語はそれなりにありますね。バージョン違いまで含めると、ほとんどの言語で該当しそうな予感です。 |
あと、これを入れるとしたら次期バージョンになるわけですが、次期バージョンでは quickrun 自体の連続実行も視野に入れてます。つまり、コンパイルと実行を別々の設定にしておいて、それらを連続実行させる、などを考えてます。この場合も設定をどうするか、結構悩ましいです。 |
連続して実行する場合は、現行のように |
あとわたしはコンパイルと実行を別々に設定しているんですが、次のように let g:quickrun_config = {
\ "cpp/g++" : {
...
\ }
\
\ "run/vimproc" : {
...
\ },
\
\ "cpp" : {
\ "type" : "cpp/g++",
\ "subtype" : "run/vimproc"
\ }
\}
<Leader>r : cpp.type を呼び出す(コンパイル)
<Leader>R : cpp.subutype を呼び出す(実行) |
g:quickrun_config の設定方法に関するあれこれを上げる場所。
The text was updated successfully, but these errors were encountered: