thinca / vim-quickrun Goto Github PK
View Code? Open in Web Editor NEWRun commands quickly.
License: zlib License
Run commands quickly.
License: zlib License
I'm trying out the split option: let b:quickrun_config = { 'outputter/buffer/split': "" }
Terminal vim works as expected. But for MacVim, it seems to ignore my setting.
Update: looks like not only split
but also other options like append
doesn't work on MacVim
いつも使用させていただいてます。
今回のコミット
outputter/buffer: Add outputter_buffer_opened
hook point
function quickrun#command..quickrun#run..148..392..381..189_open_result_window..155..155_s ort_by..353 の処理中にエラーが検出されました: 行 1: E716: 辞書型にキーが存在しません: priority_outputter_buffer_opened E15: 無効な式です: self.config["priority_".a:point]
私が使用している quickrunの設定についてはこちらにあります。
https://github.com/Kocha/dotfiles/blob/master/.vimrc
対処方法教えてください。
端末に文字をちょっと表示して\h
でそれを削除したつもりになっている、そんな邪悪なツールが世の中にたくさんありますが (例: HaskellのQuickCheck) それにも対応したいです。
とりあえずプロトタイプとしてoutputterがbufferであるときのみにうまくいくパッチを作ってみました。
diff --git autoload/quickrun/outputter/buffer.vim autoload/quickrun/outputter/buffer.vim
index 9f5a0f4..ea655bb 100644
--- autoload/quickrun/outputter/buffer.vim
+++ autoload/quickrun/outputter/buffer.vim
@@ -50,12 +50,26 @@ function! s:outputter.finish(session)
call s:open_result_window(self.config.split)
execute self._line
silent normal! zt
+
+ let all = getline(1, '$')
+ silent % delete _
+ call map(all, "s:no_escape_sequence(v:val)")
+ call append(0, all)
+
if !self.config.into
execute winnr 'wincmd w'
endif
redraw
endfunction
+function! s:no_escape_sequence(x)
+ let a = a:x
+ while match(a, '�') != -1
+ let a = substitute(a, '.�', '', '')
+ endwhile
+ return a
+endfunction
+
function! s:open_result_window(sp)
if !exists('s:bufnr')
が、quickrun coreにoutput filterみたいなものを用意して、そこで対処することができるような汎用なシステムを作った方がイケている気がします。
outputter/quickfix
の location_list
版が欲しい。
手元ではこんな感じなのを用意しています。
" location-list {{{
let s:outputter = quickrun#outputter#buffered#new()
let s:outputter.name = "location_list"
let s:outputter.kind = "outputter"
let s:outputter.config = {
\ 'errorformat': '',
\ }
function! s:outputter.init(session)
call call(quickrun#outputter#buffered#new().init, [a:session], self)
let self.config.errorformat = empty(self.config.errorformat) ? &g:errorformat : self.config.errorformat
endfunction
function! s:outputter.finish(session)
try
let errorformat = &g:errorformat
if !empty(self.config.errorformat)
let &g:errorformat = self.config.errorformat
endif
lgetexpr self._result
lwindow
for winnr in range(1, winnr('$'))
if getwinvar(winnr, '&buftype') ==# 'quickfix'
call setwinvar(winnr, 'quickfix_title', 'quickrun: ' .
\ join(a:session.commands, ' && '))
break
endif
endfor
finally
let &g:errorformat = errorformat
endtry
endfunction
call quickrun#module#register(s:outputter, 1)
unlet s:outputter
" }}}
ただし、上記の場合は:QuickRun
が終了したウィンドウに出力されてしまうので、:QuickRun
実行ウィンドウと終了ウィンドウが違っていた場合に問題になります。
回避方法としては、タブページ番号とウィンドウ番号を保持しておいて終了時にそのウィンドウへ移動するというのが考えられますがいまいち。
タブページ番号とウィンドウ番号を指定してlgetexpr
へ出力したい。
次のようなコードを QuickRun -runner vimproc
した場合、1秒毎に出力が行われて欲しいのですが、しばらく出力がされなかった後にまとめて出力が行われます。
puts "hello"
sleep 1
puts ","
sleep 1
puts "world"
sleep 1
quickrun.vim か vimproc が原因なのかはわかりませんがこれを回避する方法とかないでしょうか?
例えば、
:QuickRun -outputter buffer
の場合に処理が中断されるとバッファが開きっぱなしになってしまうので、そういう場合にバッファが閉じるような処理をフックしたいです。
現状では hook.sweep() がそれに近いかと思います。
例えば、
『hook.hook_loaded 時に hook.config の値が無効であれば :QuickRun を中断する』
みたいな処理を行いたいときに有効だと思います。
考えられる機構としては、モジュール内で
a:session.quit == 1
であれば中断みたいな感じですかねぇ。
C++
で OpenCV
のコンパイルを行う場合、多くのライブラリリンクが必要になります。
そのため、 pkg-config --libs opencv
というバッククォート記法でライブラリリンクを行なっています。
cmdopt
に pkg-config --libs opencv
を指定すると、vimproc
で次のようなエラーが発生します。
clang: error: no such file or directory: '&&'
clang: error: no such file or directory: '/home/me/opencv/capture'
quickrun
でvimproc
に渡している文字列は次のようでした。
( autoload/quickrun/runner/vimproc.vim
line 26 )
"/usr/bin/clang++" --std=c++0x `pkg-config --libs opencv` "/home/me/opencv/capture.cpp" -o "/home/me/opencv/capture" && "/home/me/opencv/capture"
&& はコンパイルしたバイナリを起動するために必要です。
それが、なぜか clang に渡されてしまっているようです。
バッククォートを用いない場合、正しくコンパイルされて、バイナリが起動されます。
vimproc
側の問題かもしれませんが、quickrun
で報告させていただきます。
I got this error when I run vim on my terminal.
As far as I know, it's not occurring in MacVim.
Do you have any idea?
$ vim
Error detected while processing /Users/ykiwng/go/src/github.com/creasty/dotfiles/vim/bundle/vim-quickrun/autoload/quickrun/outputter/buffer.vim:
line 136:
E121: Undefined variable: s:save_cpo
E15: Invalid expression: s:save_cpo
line 137:
E108: No such variable: "s:save_cpo"
of Terminal
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled May 4 2015 17:54:03)
MacOS X (unix) version
Included patches: 1-716
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
-browse +folding +mouse_xterm -tcl
++builtin_terms -footer +multi_byte +terminfo
+byte_offset +fork() +multi_lang +termresponse
+cindent -gettext -mzscheme +textobjects
-clientserver -hangul_input +netbeans_intg +title
+clipboard +iconv +path_extra -toolbar
+cmdline_compl +insert_expand +perl +user_commands
+cmdline_hist +jumplist +persistent_undo +vertsplit
+cmdline_info +keymap +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con +lua +rightleft +windows
+diff +menu +ruby +writebackup
+digraphs +mksession +scrollbind -X11
-dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent -xim
+emacs_tags -mouseshape -sniff -xsmp
+eval +mouse_dec +startuptime -xterm_clipboard
+ex_extra -mouse_gpm +statusline -xterm_save
+extra_search -mouse_jsbterm -sun_workshop -xpm
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H -F/usr/local/Frameworks -DMACOS_X_UNIX -Os -w -pipe -march=native -mmacosx-version-min=10.10 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: /usr/bin/clang -L. -L/Users/ykiwng/.rbenv/versions/2.2.0/lib -fstack-protector -L/usr/local/lib -L/usr/local/lib -F/usr/local/Frameworks -Wl,-headerpad_max_install_names -o vim -lm -lncurses -liconv -framework Cocoa -pagezero_size 10000 -image_base 100000000 -L/usr/local/lib -lluajit-5.1 -fstack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -F/usr/local/Cellar/python/2.7.9/Frameworks -framework Python -lruby-static -framework CoreFoundation -lgmp -lobjc -L/Users/ykiwng/.rbenv/versions/2.2.0/lib
of MacVim
:version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled May 3 2015 16:42:59)�MacOS X (unix) version�Included patches: 1-712�Compiled by Homebrew�Huge version with MacVim GUI. Features included (+) or not (-):�+acl +byte_offset +cmdline_info +cursorshape +emacs_tags +find_in_path -gettext +langmap +lua +mouse_dec +mouse_urxvt +odbeditor +profile +ruby +statusline +tcl +transparency +viminfo -X11 -xpm �+arabic +cindent +comments +dialog_con_gui +eval +float -hangul_input +libcall +menu -mouse_gpm +mouse_xterm +path_extra +python +scrollbind -sun_workshop +terminfo +user_commands +vreplace -xfontset �+autocmd +clientserver +conceal +diff +ex_extra +folding +iconv +linebreak +mksession -mouse_jsbterm +multi_byte +perl -python3 +signs +syntax +termresponse +vertsplit +wildignore +xim �+balloon_eval +clipboard +cryptv +digraphs +extra_search -footer +insert_expand +lispindent +modify_fname +mouse_netterm +multi_lang +persistent_undo +quickfix +smartindent +tag_binary +textobjects +virtualedit +wildmenu -xsmp �+browse +cmdline_compl +cscope +dnd +farsi +fork() +jumplist +listcmds +mouse +mouse_sgr -mzscheme +postscript +reltime -sniff +tag_old_static +title +visual +windows -xterm_clipboard �++builtin_terms +cmdline_hist +cursorbind -ebcdic +file_in_path +fullscreen +keymap +localmap +mouseshape -mouse_sysmouse +netbeans_intg +printer +rightleft +startuptime -tag_any_white +toolbar +visualextra +writebackup -xterm_save � system vimrc file: "$VIM/vimrc"� user vimrc file: "$HOME/.vimrc"� 2nd user vimrc file: "~/.vim/vimrc"� user exrc file: "$HOME/.exrc"� system gvimrc file: "$VIM/gvimrc"� user gvimrc file: "$HOME/.gvimrc"�2nd user gvimrc file: "~/.vim/gvimrc"� system menu file: "$VIMRUNTIME/menu.vim"� fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"�Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X_UNIX -F/usr/local/Cellar/python/2.7.7_2/Frameworks -I/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -I/System/Library/Frameworks/Tcl.framework/Headers -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_DARWIN_C_SOURCE=1 �Linking: clang -L. -L/usr/local/lib -L. -L/usr/local/lib -F/usr/local/Cellar/python/2.7.7_2/Frameworks -L/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -framework CoreFoundation -lpython2.7 -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lm -lncurses -liconv -framework Cocoa -pagezero_size 10000 -image_base 100000000 -L/usr/local/lib -lluajit-5.1 -fstack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -F/usr/local/Cellar/python/2.7.7_2/Frameworks -framework Python -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby
https://gist.github.com/yuntan/6326061
このようなコードを書いて保存し,また
https://gist.github.com/yuntan/6326072
(Gistでは見えないですが2行目に空行が入っています)
このような内容のファイルをtest.txtとして保存した後,
:QuickRun <test.txt
または
:QuickRun -input test.txt
を実行しても,bufferの出力が
input:
のままで,プログラムが入力待ちになってしまいます
inputオプションで指定したファイルが正しくプログラムの標準入力に流されていないのだと思うのですが…
vimrcは以下のように設定しています
https://gist.github.com/yuntan/6326118
I've tried let b:quickrun_config = { 'outputter/buffer/close_on_empty': 1 }
and
let g:quickrun_config = {
\ 'outputter': {
\ 'buffer': {
\ 'close_on_empty': 1
\ }
\ }
\ }
on my .vimrc
. The second case doesn't work, the first works, but if I load a session file (my sessionoptions is -=options
), it doesn't work anymore. The thing is, using let b:quickrun_config = { 'outputter/buffer/close_on_empty': 1 }
on my .vimrc
, when I do :let b:quickrun_config
it shows the setting, then, when I load a session with :so Session.vim
, :let b:quickrun_config
tells it's non-existent.
I want to set close_on_empty=1
always, is there a way to configure it?
I wonder if this is possible with quickrun now. To run the buffer or part of it with the same command but at a remote machine over ssh. If this is not supported, can a new runner do this?
-exec
オプションで式を評価したかったので %{}
を使ってみたのですがうまく動作しませんでした。
例えば、
:QuickRun -exec 'echo %{42+42}'
を実行した場合、
42+42}
と出力されます。
これは使い方が間違っているのでしょうか?
shebang の書かれたスクリプトを :Quickrun
で実行する際
quickrun: Error occurred in setup():
Vim(let):E730: using List as a String
function quickrun#command..quickrun#run..211..209..218..236, line 4
のようなエラーが出ます. 255eee8 のバージョンからのようです.
例えば filetype が python で,
print 1
は正常に動作し,1 行目に shebang が入るとその内容や filetype にかかわらず上記のようなエラーが出ています. .vimrc での quickrun に対する設定は特に行なっていません.
quickrun.vim で自動シンタックスチェックを行う際に :QuickRun が実行中には自動シンタックスチェックを行いたくないため、ユーザ側で :QuickRun が実行中かどうかを判断するための機能がほしいです。
現在は下記のような hook を使用して対処しています。
let s:hook = {
\ "name" : "quickrun_running",
\ "kind" : "hook",
\}
function! s:hook.init(...)
if self.config.enable
let g:quickrun_running = 1
endif
endfunction
function! s:hook.on_exit(...)
let g:quickrun_running = 0
endfunction
call quickrun#module#register(s:hook, 1)
unlet s:hook
しかし、上記の hook には問題点があり、 hook.on_exit でフラグを戻しているんですが、
call quickrun#sweep_sessions()
で、:QuickRun を終了させると hook.on_exit が呼ばれない為、正しく処理が行われないケースが発生してしまいます。
It should be as easy as :so % to run a vim script..
but I find in many cases, quickrun does not output anything. It does not even open the buffer window. It is just like nothing happened after I :QuickRun.
Example script to reproduce the bug:
let buflist = tlib#buffer#GetList()
echo buflist
Nice plugin! by the way!
Hope you can take some time to look into it.
it shows this error
C:\Ruby23\bin\ruby.exe: No such file or directory -- /home/username/workspace/hoge.rb (LoadError)
i tried some quickrun_config settings but couldnt figured it out ... 😭
Babun - a windows shell you will love! http://babun.github.io/
いつもお世話になっています。
QuickRun.vim を vimproc を使用して非同期実行できますが、結果の応答が遅い処理の場合、QuickRun が本当に実行できたのか分かり辛いです。
そのため実行されていないと勘違いし、裏で実行中に関わらず QuickRun を何度か実行してしまう時があります。
結果のバッファだけを先に表示する等ユーザに何らかの通知をする事をご検討頂けないでしょうか?
いつも有難く使わせてもらっています。
下記の通り誤記を見つけましたので報告いたします。
quickrun.jax
line 237
ブログラムを実行する際、(buroguramu)
プログラムを実行する際、(puroguramu)line 556
ことで 使えるようになります。(半角空白)
ことで使えるようになります。
また、下記の設定についてご教授いただけると幸いです。
Windows で sbcl を使うため下記のように修正しているのですが、
最後の「'exec': '%c --script %s',」については「'cmdopt': --script',」
のようにした方が良いのでしょうか?
(部分実行はなく、いつもバッファ全体の実行しかしていませんし、引数も渡しません)
\ 'lisp': {
\ 'type': executable('clisp') ? 'lisp/clisp':
\ executable('sbcl') ? 'lisp/sbcl': '',
\ },
\ 'lisp/clisp': {
\ 'command': 'clisp',
\ },
\ 'lisp/sbcl': {
\ 'command': 'sbcl',
\ 'exec': '%c --script %s',
As the title.
The output window should be smaller: when vertical split,ouput window's slim in width,when horizontal split,output window shorter.
version 7.3.260
.vimrcを下記のように設定
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'vundle'
Bundle 'thinca/vim-quickrun'
このように設定してvim-quickrunのプラグインインストールする
その後、ヘルプで2文字の単語を引くとvimが固まりました。
どこに原因があるのかよくわかりませんが、vim-quickrunをコメントアウトしてから動かすと
固まる現象は現れなかったので報告しておきます。
固まったコマンド例
vimのコマンドラインから
:h hi
:h vs
:h ar
:h ee
など実際にあるコマンドの短縮文字が2文字でヘルプを引いた場合固まりました。
(:h aとか:h strなど1文字や3文字の場合は固まりませんでした。)
直接インストールしても固まるかは試していません。
例えば、watchdogs.vim のように g:quickrun_config に設定を追加するようなプラグインに有効です。
他には quicklearn みたいな設定を追加するプラグインを作りたいときにも流用できるかと思います。
例えば、
"cs" : {
\ "type" : ["cs/csc", "cs/dmcs" , "cs/smcs"]
\}
と、設定してあった場合に、cs/csc
のコマンドが見つからなければ、cs/dmcs
を、cs/dmcs
のコマンドが見つからなければ cs/smcs
を…って感じの使用であれば、下記のようなコードが見やすくなるかと思います。
vim-quickrun/autoload/quickrun.vim
Line 104 in c442cbc
I tried to put this in my vimrc: let b:quickrun_config = { 'outputter/buffer/append': 1 }
or :QuickRun -append 1
My output still gets overridden.
e.g: If i run QuickRun on a Python file test.py
print 1
The output is always one line no matter how many times I run QuickRun
quickrun-test.rb
for run#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
puts "Yo Yo"
set up ~/.vimrc.debug
for minimum vimrc
set nocompatible
filetype off " required!
filetype plugin indent off " required!
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim/
call neobundle#rc(expand('~/.vim/bundle/'))
endif
NeoBundle 'thinca/vim-quickrun'
filetype plugin indent on " required!
" ERROR
set wildignore+=**/tmp/*,*.so,*.swp,*.zip
run vim
$ vim -u ~/.vimrc.debug -U NONE ~/.vimrc.debug quickrun-test.rb
and press \r
on quickrun-test.rb
No error and run it.
Yo Yo
I saw this error.
Error detected while processing function quickrun#command..quickrun#run..5..8..45..<SNR>42_open_result
_window:
line 5:
E480: No match: `=a:config.name`
Press ENTER or type command to continue
In file test.rkt
with content below. QuickRun show empty quick-run buffer.
#lang racket
"hello world"
In command line, racket test.rkt
prints helllo world
.
hook/shebang
がデフォルトで有効?になっているため、shebang が存在しているファイル内で、例えば下記のようなコマンドを実行してもecho
ではなく shebang に置き換えられて実行されてしまいます。
: call quickrun#run({"runner": "system", "outputter": "message", "command": "echo", "exec": "%c 'hogehoge'"})
明示的に"hook/shebang/enable": 0
のように指定して実行することで元のコマンドで実行することができますが…
分かりづらいのではないでしょうか。
出来ればcommand
パラメータが存在する場合は shebang で上書きしないか、hook/shebang
をデフォルトで無効にした方が良いのではないでしょうか。
検討違いのことを言っているようでしたらご指摘頂ければと思います。
clang
を使ってOpenCV
のコンパイルをしようとしています。
リンクするライブラリをバッククォートを使用して pkg-config --libs opencv
と設定した場合、次のようなエラーが発生します。
/usr/bin/ld: cannot find -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
clang: error: linker command failed with exit code 1 (use -v to see invocation)
冗長モードでコンパイルしたところ、バッククォートしたコマンドが1つの引数で渡されてしまっているようです。
本来ならば、vimproc
内部で実行されるコードに渡される引数が、バッククォートの命令を実行後、
["-lopencv_core","-lopencv_imgproc","-lopencv_highgui","-lopencv_ml","-lopencv_video","-lopencv_features2d","-lopencv_calib3d","-lopencv_objdetect","-lopencv_contrib","-lopencv_legacy","-lopencv_flann"]
と複数の文字列で渡されるべきところ、
["-lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann"]
と1つの文字列で渡されてしまっているのが問題のようです。
vimproc
側の問題だと思われますが、VimProcBang
/VimProcRead
では発生しませんでした。
そのため、quickrun
側の可能性を考えて、ここで報告させていただきます。
テストコード (コンパイル) は次の通りです。
"/usr/bin/clang++" --std=c++0x `pkg-config --libs opencv` "/home/me/opencv/capture.cpp" -o "/home/me/opencv/capture" && "/home/me/opencv/capture"
runnerはvimprocとする。
sleep 10
とだけ書いたfiletype=shなbufferをquickrunする。すぐにq:
してしばらく待つことで再現可能。
g:quickrun_config の設定方法に関するあれこれを上げる場所。
当方, Linux Mint 17.1でvimprocを利用しているのですが,
下記のような設定で
let g:quickrun_config = {
\ "_": {
\ "runner" : 'vimproc',
\ "runner/vimproc/sleep" : 500,
\ "runner/vimproc/updatetime" : 500,
\},}
以下の検証スクリプトでQuickRunを行うと 非同期に実行されず,
プログラムの実行完了まで待たされてしまいます.
設定等のご助言いただければと思います.
検証スクリプトは以下です.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from time import sleep
for i in range(10):
print i
sleep(2)
autoload/quickrun.vim
372 \ 'r': {
373 \ 'command': 'R',
374 \ 'exec': '%c %o --no-save --slave %a < %s',
375 \ },
runnerがvimprocだとリダイレクトのつもりで使ってる<が引数とみなされてしまうぽいっです。
該当部分で対処するなら、'%c %o --no-save --slave %a < %s'を'sh -c "'%c %o --no-save --slave %a < %s'"'にすれば一応解決します。が、そもそもそこで対処するべきかどうかわからないので、どうでしょう。
.vimrc で以下のように設定しても shebang で実行されてしまいます。
let g:quickrun_config = {
\ '*': {'shebang': '0'},
\ }
自分では下記のように書き換えて使っています。
https://gist.github.com/2dba57cccdb448846a1b
現状はネームスペースが無い状態でないと実行できないので、ある状態でも実行できるようにしたい。
成功の有無で quickfix を閉じたり unite-quickfix を開きたいケースがあります。
その場合 hook の on_success や on_failure で任意の処理を行うのが正しいのですが、on_success/on_failure が quickrun-outputter.finish の前に呼ばれてしまう為 on_success/on_failure で処理を行うことが出来ない場合があります。
(outputter.finish で quickfix ウィンドウを開くので on_success/on_failure で閉じることが出来ない。
現在は on_exit で成功の有無をチェックしているのですが、せっかく on_success/on_failure が用意されているのでこれを使用して処理を行いたいです。
一番簡単なのは処理順を変えてしまうということですが、うーん…。
quickrun#is_running()
のヘルプがありません。
追加していただけるとうれしいです。
次の2つを同時に実現しようとした際に上手く動作しない状況が発生しました。
両立が現状でも可能であればご指摘を頂きクローズして頂ければ幸いです。現状では両立できない場合は対応可能性についてご検討頂ければ幸いです。
宜しくお願い致します。
let g:quickrun_config['_'] =
\ { , 'runner' : 'vimproc'
\ , 'runner/vimproc/updatetime' : 16
\ , 'runmode': 'async:remote:vimproc'
\ }
#include <iostream>
#include <unistd.h>
int main()
{
for(auto n = 3; n; --n)
{
std::cout << "ping" << std::endl;
sleep(1);
}
}
:QuickRun -outputter error -outputter /error/success buffer -outputter/error quickfix<cr>
行 577:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named threading
I want cursor(=focus) stay same window after quickrun at least there is no output.
This issue happens when you have 2 window vertically splitted and run 'quickrun' at right side window.
Off course right side window should not print any output.
The issue happen you specify split as 'botright'.
This cause cursor focused window changed after finished quickrun.
:QuickRun -outputter/buffer/close_on_empty 1 -outputter/buffer/split "botright"
This is no problem
:QuickRun -outputter/buffer/close_on_empty 1 -outputter/buffer/split "split"
Kaoriya版GVimでQuickrunを使用しています。
ソースコード入力後、
:Q -args 2
などで引数を指定してコンパイルすると、コマンドプロンプトが立ち上がります
どうやら引数を渡して処理しているようなのですが、問題はここで処理が止まってしまうことです
具体的には、コマンドプロンプト起動後、そのまま特に進みません。コマンドプロンプト上で引数を再度入力しEnterを押すと、GVimに戻り正常動作します。
しかし、引数を指定しているので、出来ればスムーズにGVim上のみで遷移が終わってほしいのですが、何か問題がございますでしょうか。
以下のコード中で:QuickRunを実行しても、quickrunバッファに何も出力されない。
Test.scala
sealed abstract class Tree
case class Node(x: Int, left: Tree, right: Tree) extends Tree
case object Leaf extends Tree
object Test {
val tree: Tree = Node(1
, Node(2, Leaf, Leaf)
, Node(3, Leaf, Leaf)
)
def main(args: Array[String]): Unit = {
println("ahoge")
println(tree)
}
}
少なくとも私の環境のscalaコマンドだと、以下のコマンドを実行しても、標準出力に何も出力されない。
$ ls
Test.scala
$ scala Test.scala
(no ouput)
$ scala -version
Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL
Scalaを始めたのが最近なので全然わからないですが、以前のscalaコマンドだと上記コマンドを実行するだけで出力がされたのかな?
私の環境の問題(scalaのバージョン等)のせい?
古い記事ですが、#46 でosyo-mangaさんの最後の返信にあるように
http://d.hatena.ne.jp/osyo-manga/20131112/1384255703#c1384690300
上記記事のコメント欄にて、実行プログラム側のバッファのフラッシュ無しに、リアルタイムに出力を得ることができるパッチをichizokさんが公開されていますが、こちらを取り込む予定は無いのでしょうか?
もしすでに議論済みでしたらすみません。
ので、process_managerなrunnerはそれを前提とした設計に変更する必要があるみたいです。
ujihisaさんの代わりに立てました。
http://lingr.com/room/vim/archives/2014/05/18#message-19055161
After this commit: tyru/open-browser.vim@616949c, I can no longer output the file in the browser.
Some incompatibilities must be introduced in that commit. Likely, the file URL format is no longer recognizable by open-browser. But I failed to inspect what's wrong.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.