GithubHelp home page GithubHelp logo

vim-quickrun's People

Contributors

aiya000 avatar beckorz avatar crazymaster avatar ichizok avatar joelmo avatar kuuote avatar machakann avatar matoruru avatar mattn avatar milly avatar mityu avatar miyakogi avatar norahiko avatar osyo-manga avatar philolo1 avatar raa0121 avatar rainerborene avatar rhysd avatar ryunix avatar skanehira avatar statiolake avatar syngan avatar thinca avatar tk0miya avatar tyru avatar ujihisa avatar usagi avatar uu59 avatar yuki-yano avatar zhaocai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-quickrun's Issues

macvim issue

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_opened関連のエラーについて

いつも使用させていただいてます。
今回のコミット

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`を削除として使う邪悪なツールに対応したい

端末に文字をちょっと表示して\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/location_list が欲しい

outputter/quickfixlocation_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へ出力したい。

ruby で sleep が含まれているコードを quickrun した場合

次のようなコードを QuickRun -runner vimproc した場合、1秒毎に出力が行われて欲しいのですが、しばらく出力がされなかった後にまとめて出力が行われます。

puts "hello"
sleep 1

puts ","
sleep 1

puts "world"
sleep 1

quickrun.vim か vimproc が原因なのかはわかりませんがこれを回避する方法とかないでしょうか?

モジュール内で :QuickRun を中断する仕組みが欲しい

例えば、
『hook.hook_loaded 時に hook.config の値が無効であれば :QuickRun を中断する』
みたいな処理を行いたいときに有効だと思います。
考えられる機構としては、モジュール内で

  • call quickrun#quit() 関数を呼ぶ
  • 例外を飛ばす
  • 0 以外の値を返す
  • a:session に対して値を設定する
    • e.g. a:session.quit == 1 であれば中断

みたいな感じですかねぇ。

最新の環境でgoの実行に失敗するようになりました

bb8987e では問題なく実行できていましたが、
c8563b1 で失敗するようになってしまいました。

:QuickRun
すると

function  quickrun#command..quickrun#run..299..306..559 の処理中にエラーが検出されました:
E472: コマンドが失敗しました

と出力されます。

以下が、再現するgoのコードです。

package main

import (
    "fmt"
)

func main() {
    fmt.Printf("Hello, world\n")
}

環境:
Windows 版GVIM Kaoriya 7.4 パッチ 355

バッククォートを使用するとrunner/vimprocのコマンドがおかしくなる

C++OpenCV のコンパイルを行う場合、多くのライブラリリンクが必要になります。
そのため、 pkg-config --libs opencv というバッククォート記法でライブラリリンクを行なっています。

cmdoptpkg-config --libs opencv を指定すると、vimproc で次のようなエラーが発生します。

clang: error: no such file or directory: '&&'
clang: error: no such file or directory: '/home/me/opencv/capture'

quickrunvimprocに渡している文字列は次のようでした。
( 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で報告させていただきます。

Undefined variable: s:save_cpo

What

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"

Versions

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   

inputオプションで標準入力に流すファイルを指定してもプログラムが入力を受け取らない

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

How to set close_on_empty=1 globally?

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?

quickrun at a remote machine with ssh

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 の %{} について

-exec オプションで式を評価したかったので %{} を使ってみたのですがうまく動作しませんでした。
例えば、

:QuickRun -exec 'echo %{42+42}'

を実行した場合、

42+42}

と出力されます。
これは使い方が間違っているのでしょうか?

環境

  • Ubuntu 13.10
  • Vim 7.4.345

shebang の入ったスクリプト実行の際に setup() でエラー

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 が実行中かどうかをユーザ側で取得できる機能が欲しい

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 が呼ばれない為、正しく処理が行われないケースが発生してしまいます。

No output to run some vim scripts

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.

QuickRun が非同期で実行した際に実行開始のようなメッセージを表示して欲しい

いつもお世話になっています。

QuickRun.vim を vimproc を使用して非同期実行できますが、結果の応答が遅い処理の場合、QuickRun が本当に実行できたのか分かり辛いです。

そのため実行されていないと勘違いし、裏で実行中に関わらず QuickRun を何度か実行してしまう時があります。

結果のバッファだけを先に表示する等ユーザに何らかの通知をする事をご検討頂けないでしょうか?

document typo

いつも有難く使わせてもらっています。
下記の通り誤記を見つけましたので報告いたします。

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',

Bundleからインストールしてヘルプを引くと、二文字の場合vimが固まる。

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文字の場合は固まりませんでした。)

直接インストールしても固まるかは試していません。

type に複数の type を設定したい

例えば、

"cs" : {
\ "type" : ["cs/csc", "cs/dmcs" , "cs/smcs"]
\}

と、設定してあった場合に、cs/csc のコマンドが見つからなければ、cs/dmcs を、cs/dmcsのコマンドが見つからなければ cs/smcsを…って感じの使用であれば、下記のようなコードが見やすくなるかと思います。

\ 'type': executable('csc') ? 'cs/csc' :

append option doesn't seem to work

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

error with "set wildignore"

Environments

  • vim version 7.3.429
  • Ubuntu 12.04 LTS

What steps will reproduce the problem?

  1. set up quickrun-test.rb for run
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
puts "Yo Yo"
  1. 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
    
  2. run vim

    $ vim -u ~/.vimrc.debug -U NONE ~/.vimrc.debug quickrun-test.rb
    
  3. and press \r on quickrun-test.rb

What is the expected result?

No error and run it.

Yo Yo

What happens instead?

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

Racket is not supported

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 によって command が上書きされてしまう

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をデフォルトで無効にした方が良いのではないでしょうか。

検討違いのことを言っているようでしたらご指摘頂ければと思います。

バッククォートを使用するとrunner/vimprocのコマンド引数がおかしくなる

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"

"command" option is empty.

上記エラーが出て実行できません。原因は何でしょうか。
:set filetype で filetype=cpp は確認済みです。

環境
Windows8.1 Kaoriya GVim7.4

screenshot_2015-06-17-00-20-05

Linux mintにおいて runner/vimprocが非同期実行されない

当方, 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)

runnerがvimprocだとRをquickrunできない

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'"'にすれば一応解決します。が、そもそもそこで対処するべきかどうかわからないので、どうでしょう。

quickrun-outputter.finish と quickrun-hook-point-success/failure の処理順について

成功の有無で 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 が用意されているのでこれを使用して処理を行いたいです。
一番簡単なのは処理順を変えてしまうということですが、うーん…。

成否によるoutputterの分岐とvimprocによる結果の逐次出力への対応

次の2つを同時に実現しようとした際に上手く動作しない状況が発生しました。

  1. runnerにvimprocを指定し非同期に処理結果を逐次取得したい
  2. outputterにより実行したプログラムの成否に応じた出力先の分岐を行いたい

両立が現状でも可能であればご指摘を頂きクローズして頂ければ幸いです。現状では両立できない場合は対応可能性についてご検討頂ければ幸いです。

宜しくお願い致します。

再現

環境

  • Vim 7.3 (on Linux Mint 14 + Ubuntu Raring repository)
    • plugins
      • vim-quickrun
      • vimproc

.vimrc

let g:quickrun_config['_'] =
  \ { , 'runner' : 'vimproc'
  \ , 'runner/vimproc/updatetime' : 16
  \ , 'runmode': 'async:remote:vimproc'
  \ }

sample.cxx

#include <iostream>
#include <unistd.h>

int main()
{
  for(auto n = 3; n; --n)
  {
    std::cout << "ping" << std::endl;
    sleep(1);
  }
}

QuickRun (→状況発生)

:QuickRun -outputter error -outputter /error/success buffer -outputter/error quickfix<cr>

Mercurial 同梱の python26.dll が threading や subprocess をサポートしておらず quickrun 初回使用時にのみエラーが起きる

環境

  • Windows 7 Home Premium 64bit
  • Mercurial 1.7.3
  • Vim 7.3.105 (KaoriYa)

エラーメッセージ

行  577:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named threading

備考

  • Vim 起動後、最初に quickrun を実行したときのみエラーが表示されます。特に実行に問題はないようです。
  • Mercurial をインストールした場合に PATH で見つかる python26.dll でのエラーで Python を普通にインストールした時に起きるかどうかは検証していません。

cursor focused window changed after quickrun when 'close_on_empty = 1'.

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上のみで遷移が終わってほしいのですが、何か問題がございますでしょうか。

screenshot_2015-06-17-00-20-05
この状態で止まります。引数を入力してEnterすると問題ありませんが、不便です

現在のバージョン?のscalaコマンドで実行すると何も出力されない

問題

 以下のコード中で: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)

私の環境

  • ArchLinux
  • 公式リポジトリからインストールしたパッケージ
    • scala
$ 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さんが公開されていますが、こちらを取り込む予定は無いのでしょうか?
もしすでに議論済みでしたらすみません。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.