metakirby5 / codi.vim Goto Github PK
View Code? Open in Web Editor NEW:notebook_with_decorative_cover: The interactive scratchpad for hackers.
License: MIT License
:notebook_with_decorative_cover: The interactive scratchpad for hackers.
License: MIT License
The screencast still uses the non-async version of Codi, so it's a bit slow. I plan on updating this at some point, but it's not a priority. Putting this issue up in case someone wants to beat me to it ๐
On my some environments (Ubuntu, CentOS), the script
command works wrong by the codi.vim's call.
$ uname -vpo
#57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86_64 GNU/Linux
$ script --version
script from util-linux 2.27.1
$ script -feqc python -q /dev/null # Codi.vim call
-c: can't open input file: python
$ echo python -q >/tmp/cmd && script -feqc /tmp/cmd /dev/null
>>> 0
0
>>>
this is my commit to resolve the problem:
cympfh@7cdf9ad
I'm seeing two issues with filtering/processing output from ghci:
Loaded GHCi configuration from /home/dkasak/.ghci
in the very first line of its output which is a line ghci prints out at startup.Prelude>
but can be e.g. Prelude Control.Monad>
. Furthermore, there is a different prompt for continuation lines which is printed when you start a block (for instance, an if-then-else expression after you've entered if expr<ENTER>
). This prompt exchanges >
with |
.An example session:
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/dkasak/.ghci
Prelude> let a = 3
Prelude|
Prelude> if a > 2
Prelude| then a + 1
Prelude| else 42
4
Prelude> import Control.Monad
Prelude Control.Monad> if a == 3
Prelude Control.Monad| then [1, 2, 3]
Prelude Control.Monad| else []
[1,2,3]
Regarding the second problem, I think it would be better to simply consider everything up to (and including) a >
or |
character to be the prompt, by default.
Entering a long comment (I think it happens with others kinds of long lines too, but I couldn't reproduce it by entering a long integer literal, for instance) in a Python buffer makes a part of that line get echoed in Codi's window. The threshold length for this behaviour seems to be 74 chars. I haven't tested other languages.
Codi log snippet which demonstrates that the line gets broken which causes the issue:
[21:11:16.292494] <SNR>149_codi_do_update[25]: Starting job for buffer 10
[21:11:16.295624] <SNR>149_user_au[1]: Doing autocommand CodiEnterPost
[21:11:16.375917] <SNR>149_codi_handle_data[9]: async line: # Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
[21:11:16.376491] <SNR>149_codi_handle_data[9]: async line: Python 3.5.2 (default, Jun 28 2016, 08:46:01)
[21:11:16.376716] <SNR>149_codi_handle_data[9]: async line: [GCC 6.1.1 20160602] on linux
[21:11:16.376939] <SNR>149_codi_handle_data[9]: async line: Type "help", "copyright", "credits" or "license" for more information.
[21:11:16.377255] <SNR>149_codi_handle_data[9]: async line: >>> # Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
[21:11:16.377624] <SNR>149_codi_handle_data[9]: async line: eirmod
[21:11:16.377827] <SNR>149_codi_handle_data[9]: async line: ...
[21:11:16.377944] <SNR>149_stop_job_for_buf[8]: Stopping job for buffer 10
NVIM 0.1.6
Build type: RelWithDebInfo
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -Wconversion -O2 -g -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.1.6/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser```
Optional features included (+) or not (-): +acl +iconv +jemalloc +tui
For differences from Vim, see :help vim-differences
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
Working perfectly in neovim, but in vim when inserting a snippet and going to the next tabstop, Codi seems to automatically replace what text is there with 'gg'.
Maybe make it a special autocommand value ('Visual') and have it actually trigger on the 'CursorMoved' autocommand?
Using codi in OCaml, it works fine for several lines. However, once I go up and change a value in a previous line, the output isn't changed, and in fact, it seems to lose all synchronization.
Tried on both vim 8.0 and neovim.
OS/X El Capitan, Neovim v0.1.3-350-gc94575f.
Codi inside of a virtual environment seems to be broken. I did a quick search for virtualenv and didn't see anything. Unfortunately this is a bit of a show-stopper for python :/
Please excuse my messy typing, I just woke up
I've even tried doing pip install neovim
inside of a virtualenv to no avail.
Interestingly, #45 doesn't occur within the virtualenv.
Really, this should have been here from the start, but I was lazy ๐ I need to look into this a bit, but in the meantime, please chime in with any suggestions.
It's just a feature request. It seems it would be nice if errors could be reported following a kind of Syntastic pattern, using the gutter, location list, etc, since sometimes error messages are quite long to display in a short single line. This way, the Scratch buffer could simply omit the error messages (for which gutter and location list can do a better job).
function CodiAutoDetect()
execute "Codi!! ".&filetype
endfunction
nmap <leader>r :call CodiAutoDetect()<cr>
Right now I have this hack. Can we have a better solution in codi itself?
When I'm using Codi while editing a Lua file in MacVim, if the file is not modified, Codi updates every time I move the cursor. This is in contrast to what happens when the file is modified, when Codi updates every time the text changes (when TextChanged
or TextChangedI
fires). As far as I can tell, this only happens with Lua files.
Steps to reproduce:
mvim foo.lua
print(os.date())
:w
):Codi
)print("foo")
)u
)'modified'
, and erratic behaviour resumes.After modifing the buffer the first time after saving (here with print("foo")
), Codi works as expected, even after saving again, until I use u
to undo into a state where the buffer is not modified.
Other undesirable behaviours include syntax highlighting flickering off and on whenever Codi is erratically updating, and the undo history sometimes (seemingly randomly) being clobbered.
Running macOS Sierra (10.12.1)
Last line of script
manpage is BSD December 4 2013
The log file is over two thousand lines long, generated in about 30 seconds. Almost every keypress generates several log lines when this issue is happening, which may make the log hard to read.
Output of mvim --version
:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 9 2016 17:45:26)
MacOS X (unix) version
Included patches: 1-27
Compiled by [email protected]
Huge version with MacVim GUI. Features included (+) or not (-):
+acl +find_in_path -mouse_sysmouse -tag_any_white
+arabic +float +mouse_urxvt -tcl
+autocmd +folding +mouse_xterm +termguicolors
+balloon_eval -footer +multi_byte +terminfo
+browse +fork() +multi_lang +termresponse
++builtin_terms +fullscreen -mzscheme +textobjects
+byte_offset -gettext +netbeans_intg +timers
+channel -hangul_input +num64 +title
+cindent +iconv +odbeditor +toolbar
+clientserver +insert_expand +packages +transparency
+clipboard +job +path_extra +user_commands
+cmdline_compl +jumplist +perl/dyn +vertsplit
+cmdline_hist +keymap +persistent_undo +virtualedit
+cmdline_info +lambda +postscript +visual
+comments +langmap +printer +visualextra
+conceal +libcall +profile +viminfo
+cryptv +linebreak +python/dyn +vreplace
+cscope +lispindent +python3/dyn +wildignore
+cursorbind +listcmds +quickfix +wildmenu
+cursorshape +localmap +reltime +windows
+dialog_con_gui +lua/dyn +rightleft +writebackup
+diff +menu +ruby/dyn -X11
+digraphs +mksession +scrollbind -xfontset
+dnd +modify_fname +signs +xim
-ebcdic +mouse +smartindent -xpm
+emacs_tags +mouseshape +startuptime -xsmp
+eval +mouse_dec +statusline -xterm_clipboard
+ex_extra -mouse_gpm -sun_workshop -xterm_save
+extra_search -mouse_jsbterm +syntax
+farsi +mouse_netterm +tag_binary
+file_in_path +mouse_sgr +tag_old_static
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"
defaults file: "$VIMRUNTIME/defaults.vim"
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 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lm -lncurses -liconv -framework Cocoa -fstack-protector -L/System/Library/Perl/5.16/darwin-thread-multi-2level/CORE
v.s.
script
(if you don't know, just paste the last line of thevim --version
:h g:codi#log
), preferably in a pastebin[14:23:24.384979] <SNR>86_codi_do_update[29]: Starting job for buffer 1
[14:23:24.386429] <SNR>86_codi_do_update[66]: [INPUT] class Test:
[14:23:24.386584] <SNR>86_codi_do_update[66]: [INPUT]
[14:23:24.386857] <SNR>86_codi_do_update[66]: [INPUT] def __init__(self):
[14:23:24.386980] <SNR>86_codi_do_update[66]: [INPUT] pass
[14:23:24.387113] <SNR>86_codi_do_update[66]: [INPUT]
[14:23:24.387514] <SNR>86_codi_do_update[68]: Expecting 5 prompts
[14:23:24.426404] <SNR>86_codi_handle_data[9]: [DATA] class Test:
[14:23:24.427028] <SNR>86_codi_handle_data[9]: [DATA] def __init__(self):
[14:23:24.427668] <SNR>86_codi_handle_data[9]: [DATA] pass
[14:23:24.428336] <SNR>86_codi_handle_data[9]: [DATA] Python 2.7.13 (default, Dec 30 2016, 00:29:36)
[14:23:24.428715] <SNR>86_codi_handle_data[9]: [DATA] [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
[14:23:24.429077] <SNR>86_codi_handle_data[9]: [DATA] Type "help", "copyright", "credits" or "license" for more information.
[14:23:24.429429] <SNR>86_codi_handle_data[9]: [DATA] >>> class Test:
[14:23:24.429561] <SNR>86_codi_handle_data[14]: Matched prompt
[14:23:24.429828] <SNR>86_codi_handle_data[9]: [DATA] ...
[14:23:24.430038] <SNR>86_codi_handle_data[14]: Matched prompt
[14:23:24.430323] <SNR>86_codi_handle_data[9]: [DATA] File "<stdin>", line 2
[14:23:24.430606] <SNR>86_codi_handle_data[9]: [DATA]
[14:23:24.430926] <SNR>86_codi_handle_data[9]: [DATA] ^
[14:23:24.431206] <SNR>86_codi_handle_data[9]: [DATA] IndentationError: expected an indented block
[14:23:24.431463] <SNR>86_codi_handle_data[9]: [DATA] >>> def __init__(self):
[14:23:24.431578] <SNR>86_codi_handle_data[14]: Matched prompt
[14:23:24.431804] <SNR>86_codi_handle_data[9]: [DATA] File "<stdin>", line 1
[14:23:24.432049] <SNR>86_codi_handle_data[9]: [DATA] def __init__(self):
[14:23:24.432279] <SNR>86_codi_handle_data[9]: [DATA] ^
[14:23:24.432531] <SNR>86_codi_handle_data[9]: [DATA] IndentationError: unexpected indent
[14:23:24.432767] <SNR>86_codi_handle_data[9]: [DATA] >>> pass
[14:23:24.432879] <SNR>86_codi_handle_data[14]: Matched prompt
[14:23:24.433105] <SNR>86_codi_handle_data[9]: [DATA] File "<stdin>", line 1
[14:23:24.433342] <SNR>86_codi_handle_data[9]: [DATA] pass
[14:23:24.433568] <SNR>86_codi_handle_data[9]: [DATA] ^
[14:23:24.433818] <SNR>86_codi_handle_data[9]: [DATA] IndentationError: unexpected indent
[14:23:24.434727] <SNR>86_codi_handle_data[9]: [DATA] >>>
[14:23:24.434857] <SNR>86_codi_handle_data[14]: Matched prompt
[14:23:24.434964] <SNR>86_codi_handle_data[17]: All prompts received
[14:23:24.435078] <SNR>86_stop_job_for_buf[8]: Stopping job for buffer 1
[14:23:24.453559] <SNR>86_user_au[1]: Doing autocommand CodiUpdatePost
[14:27:09.729271] <SNR>86_user_au[1]: Doing autocommand CodiUpdatePre
[14:27:09.731909] <SNR>86_codi_do_update[29]: Starting job for buffer 1
[14:27:09.733856] <SNR>86_codi_do_update[66]: [INPUT] class Test:
[14:27:09.734059] <SNR>86_codi_do_update[66]: [INPUT] def __init__(self):
[14:27:09.734196] <SNR>86_codi_do_update[66]: [INPUT] pass
[14:27:09.734328] <SNR>86_codi_do_update[66]: [INPUT]
[14:27:09.734636] <SNR>86_codi_do_update[68]: Expecting 4 prompts
[14:27:09.741461] <SNR>86_codi_handle_data[9]: [DATA] class Test:
[14:27:09.741960] <SNR>86_codi_handle_data[9]: [DATA] def __init__(self):
[14:27:09.742350] <SNR>86_codi_handle_data[9]: [DATA] pass
[14:27:09.786274] <SNR>86_codi_handle_data[9]: [DATA] Python 2.7.13 (default, Dec 30 2016, 00:29:36)
[14:27:09.786743] <SNR>86_codi_handle_data[9]: [DATA] [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
[14:27:09.787266] <SNR>86_codi_handle_data[9]: [DATA] Type "help", "copyright", "credits" or "license" for more information.
[14:27:09.790801] <SNR>86_codi_handle_data[9]: [DATA] >>> class Test:
[14:27:09.790986] <SNR>86_codi_handle_data[14]: Matched prompt
[14:27:09.791278] <SNR>86_codi_handle_data[9]: [DATA] ... def __init__(self):
[14:27:09.791427] <SNR>86_codi_handle_data[14]: Matched prompt
[14:27:09.791749] <SNR>86_codi_handle_data[9]: [DATA] ... pass
[14:27:09.791912] <SNR>86_codi_handle_data[14]: Matched prompt
[14:27:09.792283] <SNR>86_codi_handle_data[9]: [DATA] ...
[14:27:09.792431] <SNR>86_codi_handle_data[14]: Matched prompt
[14:27:09.792565] <SNR>86_codi_handle_data[17]: All prompts received
[14:27:09.792678] <SNR>86_stop_job_for_buf[8]: Stopping job for buffer 1
[14:27:09.809692] <SNR>86_user_au[1]: Doing autocommand CodiUpdatePost
I'm using it for Node's code, is working well.
But it's possible to work for fetch's response? like setTimeout
, ajax
, Promise
, etc?
When I use this to run JavaScript code in node, the scratch buffer is showing undefined
in strange places. When I run the same code in node, I don't get any warnings or errors.
Last time Codi worked for me was something like 5 days ago. Now it opens the window but does not output anything there.
My gvim version is 8.0.331 and Codi version is 25d4742 (latest as of writing). I suspect that updating Vim broke Codi as it just suddenly stopped working even without any other plugins and with clean .vimrc.
I tested Codi with the default Python interpreter and my own custom Django interpreter, but neither works (they both used to work like 5-7 days ago, can't remember exactly). Log output:
[17:15:20.186298] <SNR>128_user_au[1]: Doing autocommand CodiUpdatePre
[17:15:20.187171] <SNR>128_codi_do_update[29]: Starting job for buffer 1
[17:15:20.190219] <SNR>128_stop_job_for_buf[8]: Stopping job for buffer 1
[17:15:20.190650] <SNR>128_codi_do_update[65]: [INPUT] 5 + 5^@25 + 10^@30 + 8^@^M^D^D^M
[17:15:20.190907] <SNR>128_codi_do_update[66]: Expecting 4 prompts
[17:15:20.199622] <SNR>128_codi_handle_data[9]: [DATA] 5 + 5
[17:15:20.200129] <SNR>128_codi_handle_data[9]: [DATA] 25 + 10
[17:15:20.200560] <SNR>128_codi_handle_data[9]: [DATA] 30 + 8
[17:15:20.456832] <SNR>128_codi_handle_data[9]: [DATA] The file โ/tmp/cmdโ is not executable by this user
[17:15:20.457111] <SNR>128_codi_handle_data[9]: [DATA] fish: /tmp/cmd
[17:15:20.457402] <SNR>128_codi_handle_data[9]: [DATA] ^
I tried chmod 777 /tmp/cmd
but Codi still does not work. Log output:
[17:18:11.748449] <SNR>128_user_au[1]: Doing autocommand CodiUpdatePre
[17:18:11.749678] <SNR>128_codi_do_update[29]: Starting job for buffer 1
[17:18:11.753600] <SNR>128_stop_job_for_buf[8]: Stopping job for buffer 1
[17:18:11.753941] <SNR>128_codi_do_update[65]: [INPUT] 5 + 5^@25 + 10^@30 + 8^@^M^D^D^M
[17:18:11.754127] <SNR>128_codi_do_update[66]: Expecting 4 prompts
[17:18:11.762501] <SNR>128_codi_handle_data[9]: [DATA] 5 + 5
[17:18:11.763220] <SNR>128_codi_handle_data[9]: [DATA] 25 + 10
[17:18:11.763869] <SNR>128_codi_handle_data[9]: [DATA] 30 + 8
A PHP code file typically start with <?php
as the first line. PsySH is not expecting this because php has already started. Therefore, the first bit of output from codi for that line is PHP Parse error: Syntax error, unexepcted '<' on line 1
. Does codi have any existing features that could be used to alter the buffer content input before it gets sent to the REPL? I would like to simply not send that line to PsySH if that exact string is the first line in the buffer. if such a feature does not yet exist in codi, I may try to add it, but I wanted to get your input first.
This is an issue with BSD's script
, with no known workaround.
I've installed ultisnips plugin, and it worked well without codi.vim.
But while using codi.vim, ultisnips' jumpforward and backward do not work totally.
I have these config in my .vimrc file:
let g:UltiSnipsExpandTrigger = "<Tab>"
let g:UltiSnipsJumpForwardTrigger = "<Tab>"
let g:UltiSnipsJumpBackwardTrigger = "<S-Tab>"
I'm wondering if there is a way that the two plugins co-work well?
I'm not having success trying a setup for PureScript (the plugin is working for Python as expected). I've put this snippet in my .vimrc
:
let g:codi#interpreters = {
\ 'purescript': {
\ 'bin': ['pulp', 'psci'],
\ 'prompt': '^> ',
\ },
\ }
When I open vim and execute :Code purescript
I get a message "No matching autocommands" and nothing happens when I write code. An example session of PureScript REPL is like the following:
โฏโฏโฏ pulp psci
PSCi, version 0.9.2
Type :? for help
> import Prelude
> 2 + 2
4
> foo
Error found:
in module $PSCI
at line 1, column 1 - line 1, column 1
Unknown value foo
See https://github.com/purescript/purescript/wiki/Error-Code-UnknownName for more information,
or to contribute content related to this error.
>
Any help appreciated!
Installed with vim-plug and ran using OSX El Capitan (10.11.6). Running ":Codi python" from vim results in the following errors for a short time, then the plugin loads:
Error detected while processing /Users/kedean/.vim/plugged/codi.vim/autoload/codi.vim
line 119:
E216: No such group or event: QuitPre * call s:codi_autoclose()
Once the plugin loads, evaluation is extremely slow. Evaluating just "foobar"
takes around 5 or 6 seconds. This happens with the default python-2.7.10 that comes with El Capitan and with python-3.5.2 from Homebrew.
Thanks for the awesome tool!
I added Clojure via lein repl
. Works well though really slow.
Is this to be expected?
Implement an optional attribute which allows preconditions to be specified for an interpreter. For example, the PureScript pulp psci
interpreter requires pulp init
to have been run in the working tree.
cc: @oblitum
Also it's not working with JSON.stringify(object)
Codi works well, see my previous issue #72.
First, I think you are on to something very useful here! Thanks!
I think it would be very convenient to either add some user autocmds or function hooks upon entering and closing a Codi session. This would, for instance, allow to set the VertSplit
highlighting differently when using codi. I like showing the splits clearly in general, but I can see how the right aligned buffer without visual clutter can be useful for codi.
NVim has a different asynchronous job API, and Codi should support it ๐
I'm using Neovim. When in python mode, I type:
import subprocess
subprocess
Then, I stop being able to type as soon as I finish "subprocess." The cursor still blinks, so it's still running, but something is stopping me from typing, presumably a subprocess. Honestly, I find this bug quite funny. I laughed when it first happened.
Is there a way for Codi to break a longer list up onto multiple lines? I've been using Codi with pwntools for exploitation (It's actually working fairly well!) and commonly some of the lists have 20 or so strings and it's off the screen. Thoughts?
I'm on OS X, with a compiled-from-source vim 8. Basically my entire vimrc, minus Vundle stuff for codi, is commented out. When I try opening with a filename, I can't type anything. If the filename happens to be an existing file, I can type, but nothing shows up in the codi righthand side (this isn't shown in the screencast).
https://asciinema.org/a/0s5bg7nndgc5cn96s01dbrrwk
Script:
BSD December 4, 2013 BSD
Vim version: http://pastebin.com/pcQ34Nba
Codi log (for the error case): http://pastebin.com/i2xZuEh9
On OS/X El Capitan using NeoVim v0.1.3-350-gc94575f, I get the following error when using Codi!
:
Error detected while processing function <SNR>118_codi_nvim_callback[16]..<SNR>118_codi_handle_data[17]..<SNR>118_codi_handle_done:
line 24:
Zero count: keepjumps keepalt buf! 0
Codi still seems to work fine but it forces me to hit Enter before I can do anything else again and for whatever reason silent!
doesn't seem to fix it.
I think it might be useful to put all output into the scratch buffer in case the expected prompt was not found.
This would help with issues, where e.g. rlwrap
complains rlwrap: error: My terminal reports width=0 (is it emacs?) I can't handle this, sorry!
.
In this case the scratch buffer could have a note that something failed and provide that output (which means to remove the input that codi sent itself, if it was echoed).
(btw: I have noticed the rlwrap
problem with Vim, but not Neovim btw. Likely related to the not yet implemented "term" option (see :h job-term
).)
It would be helpful for me to have the REPL start from the directory of the file being edited instead of starting it from Vim's current working directory, at least for node. This would allow the script to require() files using a path relative to that file, which is what node programmers normally do. This might be a good default for other REPLs as well, but I am not sure. Perhaps there could be an option for both behaviors.
I am having problems installing codi (with pathogen). After installation, it doesn't seem to work (opens only the second split, but doesn't print there anything, despite using :CodiUpdate
). I also don't see anything in codi-introduction-gotchas
.
Do you have an idea what could have gone wrong?
.vimrc
that will reproduce the issue:execute pathogen#infect()
vim
:vim a.py
:Codi python
$ uname -a
Linux thinkpad 3.13.0-123-generic #172-Ubuntu SMP Mon Jun 26 18:04:35 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
script
:$ script --version
script from util-linux 2.20.1
:h g:codi#log
)$ cat ~/codi.log
[10:35:18.104803] <SNR>41_user_au: Doing autocommand CodiLeavePost
I thought it was working better in Neovim for me, but that didn't last very long. It is hard to say exactly what does not work right because even the reproduce case that I originally provided is not consistently working to reproduce that issue now. In general after using codi in Neovim for any length of time the behavior of Neovim just becomes generally wonky. I realize that is not exactly a helpful bug report, but I just want to know if other people are using this in Neovim and not having lots of issues? I mean I know if you just start it up and test one little thing in Neovim it might work ok, but if you actually use codi for real world things does it work well for other people? If not, it should not be that difficult to reproduce this behavior. I think I will help try to debug it because I really need it fixed. I'm not sure if I will understand the code enough though. I might want to start with contributing in some smaller way. Anyway, we don't have to talk about that here, I just mentioned that here because I don't want you to feel like I'm just providing non useful bug reports, I am willing to help. We can continue the conversation about contributing elsewhere, you will see a pull request from me soon that will provide more details.
I gave it a try and got "Codi does not support Windows yet." Big stacktrace when I try to use it.
Found the code in autoload/codi.vim and tried to modify, but nothing happens in the new split after I :Codi
and modify python.
else
if executable('script')
function! s:scriptify(bin)
return 'script -qfec '.shellescape(a:bin, 1).' /dev/null'
endfunction
else
call s:err('Codi does not support Windows without Cygwin yet.')
endif
endif
I checked my version of script and it seems like that should work:
$ script --version
script from util-linux 2.25.2
$ script --help
Usage:
script [options] [file]
Options:
-a, --append append the output
-c, --command <command> run command rather than interactive shell
-e, --return return exit code of the child process
-f, --flush run flush after each write
--force use output file even when it is a link
-q, --quiet be quiet
-t, --timing[=<file>] output timing data to stderr (or to FILE)
-V, --version output version information and exit
-h, --help display this help and exit
But I've never used script and I'm not sure how it works.
I think we also need this line changed:
let s:magic = "\n\<cr>\<c-z>\<cr>" " to get out of REPL
C-z + CR exits the python repl on Windows, but I don't know if that's consistent across interpreters.
Regardless, all that prevents me from seeing any errors or any functionality (aside from the split appearing).
I'm also not sure how cygwin's script interacts with python (I'm using python3 for Windows from python.org).
Using vim 7.4.1832 from vim/vim-win32-installer.
These seems like a really cool plugin, but I understand Windows support can be tough (and a whole new set of problems).
:CodiUpdate
or something...
Codi hangs when writing the following piece of code in JavaScript:
while (true) {
console.log();
}
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 19 2016 20:38:47)
MacOS X (unix) version
Included patches: 1-5
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm +termguicolors
-browse -footer +multi_byte +terminfo
++builtin_terms +fork() +multi_lang +termresponse
+byte_offset -gettext -mzscheme +textobjects
+channel -hangul_input +netbeans_intg +timers
+cindent +iconv +num64 +title
-clientserver +insert_expand +packages -toolbar
+clipboard +job +path_extra +user_commands
+cmdline_compl +jumplist +perl +vertsplit
+cmdline_hist +keymap +persistent_undo +virtualedit
+cmdline_info +lambda +postscript +visual
+comments +langmap +printer +visualextra
+conceal +libcall +profile +viminfo
+cryptv +linebreak +python +vreplace
+cscope +lispindent -python3 +wildignore
+cursorbind +listcmds +quickfix +wildmenu
+cursorshape +localmap +reltime +windows
+dialog_con -lua +rightleft +writebackup
+diff +menu +ruby -X11
+digraphs +mksession +scrollbind -xfontset
-dnd +modify_fname +signs -xim
-ebcdic +mouse +smartindent -xpm
+emacs_tags -mouseshape +startuptime -xsmp
+eval +mouse_dec +statusline -xterm_clipboard
+ex_extra -mouse_gpm -sun_workshop -xterm_save
+extra_search -mouse_jsbterm +syntax
+farsi +mouse_netterm +tag_binary
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o vim -lncurses -liconv -framework Cocoa -mmacosx-version-min=10.11 -fstack-protector-strong -L/usr/local/lib -L/usr/local/Cellar/perl/5.24.0_1/lib/perl5/5.24.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -F/usr/local/Cellar/python/2.7.12/Frameworks -framework Python -lruby.2.3.0 -lobjc -L/usr/local/Cellar/ruby/2.3.1/lib
According to the documentation, g:codi#interpreters
is a dictionary of user defined interpreters. It also says it will not erase the internal default interpreters. Does this mean there is currently no supported way of customizing how the built in interpreters work? As in If I make my own javascript interpreter, it will have no effect because it will not overwrite the built in one? The reason I ask is I want to change the way node is started to pass a custom parameter to it. Passing to node the name of a .js file which creates it's own REPL object is a standard way of writing your own REPL in node which is needed in order to bring variables into context at the start of the REPL session. This feature will be used by anyone who uses my living-tests node testing framework, which will also rely on codi to work. Thanks for the help and this awesome plugin!
Hello. When I run :Codi
from a .js file written for node, the extra buffer does appear on the right, but it just stays blank. At first I thought this was because I was using Neovim. But then I tried it in Vim and got the same result.
I'm not sure if this is just an incompatibility problem with vim-repeat or the repeat command in general.
Sometimes codi can't replicate the last operation with the dot command.
I can reproduce the issue everytime using vim-unimpaired's ]e
to swap lines
With codi off:
https://gfycat.com/VapidUnfitCopperhead
With codi on:
https://gfycat.com/PoliticalSereneBettong
But it has happened with when replacing matches with cgn
, instead of replacing the match, it deletes a couple of lines.
For all non-dict options, the interpreter dict should support overriding the global options.
Use case: for extraordinarily slow languages, maybe you only want to evaluate manually, but still want to retain instant evaluation for Python.
Haskell language pragmas (GADTs, UnicodeSyntax, etc) aren't functioning.
Vim version: 7.4
script
version: December 4, 2013
Steps to reproduce:
.vimrc
(besides plugin + Codi setup)vim
:Codi javascript
Vim error bell is triggered on every text change event.
Problem: Codi only displays the last line of the response.
Behavior of Codi:
Expected behavior:
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy import *
>>> init_printing()
>>> f, x = symbols('f x')
>>> f = exp(x)
>>> diff(f)
x
โฏ
>>> print('a\nb')
a
b
>>>
Minimal test case:
print('a\nb')
Same for javascript:
~node
> console.log('test')
test
undefined
>
Using Codi, only the last line, undefined
, is shown.
How could this be resolved?
Thank you for this great plugin!
Vim complains about the channel being closed even though its status is buffered. Cause unknown.
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.