Sorry, my English is poor...:( If you can read Japanese, it is better to read japanese.
This is a plugin for neovim to use repl, for example, python, node.js, haskell and so on.
In case of vimplug
Plug 'uesseu/vimnotebook'
Incase of dein
call dein#add('uesseu/vimnotebook')
Write as this
extend(vimnotebook#end_codes, {"python": "exit", "node": ".exit"})
extend(vimnotebook#lang_names, {"python": "exit", "node", "javascript"})
nnoremap g<Up> :NoteBook python<CR>
nnoremap g<Down> :RunYank<CR>
nnoremap g<Left> :RunLine<CR>
nnoremap g<Right> :EndNoteBook<CR>
And then, your vim can run interpreter. Logfile willbe written as "log"
Command to start is
:NoteBook [command]
for example, type
:NoteBook python
and python interpreter run. Other interpreter can run in the same way.
It is just name of interpreter. If your name of interpreter is not name of language, type like this.
extend(vimnotebook#lang_names, {"python": "exit", "node", "javascript"})
:RunLine
:RunYank
First, you should ending command of interpreter to use.
extend(vimnotebook#end_codes, {"python": "exit", "node": ".exit"})
for example...
extend(end_codes, {"python": "exit"}
(End code of python is already set :)
:EndNoteBook
There is no such function ;) You can yank paragraph by...
{V}y
This plugin automatically makes logfile. If you dont want to make it, type this.
if g:vimnotebook#save_log == 0
By default, it uses register @l. If you want to use other register, use this option.
let g:vimnotebook#note_reg = "r"
This set @r to use.
This plugin only send key to terminal. And so, you cannot send such words like "".
If you use neovim, there is no such limitation.
英語うまく書けないお(´・ω・`)
これはvimでreplを使う為のプラグインです。 pythonとかnode.jsとか、そういうのをvimでやります。
普通です。下記がわかんないなら、vimplugやdeinでググってください。
vimplug
Plug 'uesseu/vimnotebook'
dein
call dein#add('uesseu/vimnotebook')
例えばこんな風に書いてしまいます。
extend(vimnotebook#end_codes, {"python": "exit", "node": ".exit"})
extend(vimnotebook#lang_names, {"python": "exit", "node", "javascript"})
nnoremap g<Up> :NoteBook python<CR>
nnoremap g<Down> :RunYank<CR>
nnoremap g<Left> :RunLine<CR>
nnoremap g<Right> :EndNoteBook<CR>
そうすると、自分の使いたいreplをg+矢印で使えるんじゃね? というふうなやつです。
こんなふうにします。
:NoteBook [command]
例えばインタプリタがpythonならこうです。 あくまでインタプリタの名前です。
:NoteBook python
そうすると、新たなターミナルが開いて、replが使えるのです。
インタプリタと言語の紐付けはこうします。
extend(vimnotebook#lang_names, {"python": "exit", "node", "javascript"})
:RunLine
:RunYank
まず、終わりの言葉を入れてあげる必要があります。
extend(vimnotebook#end_codes, {"python": "exit", "node": ".exit"})
例えばpythonならこうです。
extend(end_codes, {"python": "exit"})
(pythonの終わりの言葉は既に入れています その上で、こうです。
:EndNoteBook
段落を入れたいときのコマンドは用意していませんが、 下記で段落はヤンク出来るから良いのではないでしょうか?
{V}y
このぷらぎんは勝手にログを取ります。 うざいならこうしてください。
if g:vimnotebook#save_log == 0
このぷらぎんはデフォルトで@lレジスタを使います。 もし別のレジスタを…@rを使いたいならこのようにしてください。
let g:vimnotebook#note_reg = "r"
これ、vimだとキーストロークをそのまま反映するから、 みたいな文字列は改行として受け取られます。 neovimなら大丈夫と思います、多分。