could we add the stata do files
this seems to work
function StataSourceLines(lines) call writefile(a:lines, g:cmdline_tmp_dir . "/lines.do") call VimCmdLineSendCmd('do ' . g:cmdline_tmp_dir . '/lines.do') endfunction
let b:cmdline_nl = "\r\n" let b:cmdline_app = "stata" let b:cmdline_quit_cmd = "exit" let b:cmdline_source_fun = function("StataSourceLines") let b:cmdline_send_empty = 0
nmap
exe 'autocmd VimLeave * call delete(g:cmdline_tmp_dir . "/lines.do")'
I don't have stata, so I don't want to be responsible for this. If you could do a pull request, I would merge it. The syntax script is also required to add support for a new interpreter.
Dear Jackson,
I understand ! I am not a level where I could maintain anything or add support, but the stata version works nicely for me with the three files in ftplugin, plugin and syntax
best regards
Thomas On Mon, 8 Jan 2018, Jakson Alves de Aquino wrote:
I don't have stata, so I don't want to be responsible for this. If you could do a pull request, I would merge it. The syntax script is also required to add support for a new interpreter.
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/jalvesaq/vimcmdline/issues/32#issuecomment-356031881
You have pasted the ftplugin/stata_cmdline.vim script, but the syntax/cmdlineoutput_stata.vim script is still missing, and it is required to colorize the output when running in the Neovim builtin terminal.
The syntax script will not be required if Stata already colorizes the output.
I do not have a coloring scheme for the output, but getting the "do-editor" in vim is still very convenient.
On Tue, 9 Jan 2018, Jakson Alves de Aquino wrote:
The syntax script will not be required if Stata already colorizes the output.
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/jalvesaq/vimcmdline/issues/32#issuecomment-356267448
I'm sorry, but this is not enough. The two main purposes of vimcmdline are: (1) send lines to interpreters; (2) colorize the output. Of course, we don't need to colorize stata's output if it is already colorized. I know that Stata GUI colorizes the output, but I could not find any screenshot of Stata running in a terminal emulator to know whether it colorizes the output or not.
ok, and stata is not colorized in a standard terminal emulator.
On Tue, 9 Jan 2018, Jakson Alves de Aquino wrote:
I'm sorry, but this is not enough. The two main purposes of vimcmdline are: (1) send lines to interpreters; (2) colorize the output. Of course, we don't need to colorize stata's output if it is already colorized. I know that Stata GUI colorizes the output, but I could not find any screenshot of Stata running in a terminal emulator to know whether it colorizes the output or not.
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/jalvesaq/vimcmdline/issues/32#issuecomment-356287156
I have seen in screenshots that the prompt is a dot followed by an empty space. So, I already know how to highlight the input. Are error messages prefixed by a constant string? I still need this information.
Could you install Neovim and try this syntax/cmdlineoutput_stata.vim:
" Vim syntax file
" Language: No language. Output additionals for stata
runtime syntax/cmdlineoutput.vim
" Input
syn match cmdlineInput "^\. .*"
I have neovim and tried it out, and the syntax file does no harm but the output is not colorized, an error has no prefix as far as I know
. use sperm
. . sum
Variable | Obs Mean Std. Dev. Min Max
-------------+-------------------------------------------------------- obsnr | 61 31 17.75293 1 61 year | 61 1975.82 14.5333 1938 1990 n | 61 245.0328 647.0091 7 4435 meanage | 61 17.22951 16.46064 -2 47.9 meanabs | 61 -.8560656 2.249506 -2 6.9 -------------+-------------------------------------------------------- meanvol | 61 2.140328 1.864066 -1 4.5 meanct | 61 82.47508 23.20457 48 145 medct | 19 68.50263 18.30302 42.45 102 usa | 61 .4590164 .502453 0 1
. . pctile meanct, nq(4) meanct already defined r(110);
. . return list
scalars: r(N) = 61 r(sum_w) = 61 r(mean) = .459016393442623 r(Var) = .2524590163934426 r(sd) = .5024529991884242 r(min) = 0 r(max) = 1 r(sum) = 28
.
Are you running stata in the Neovim terminal?
nvim stata.do
is that a neovim terminal ? On Tue, 9 Jan 2018, Jakson Alves de Aquino wrote:
Are you running stata in the Neovim terminal?
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/jalvesaq/vimcmdline/issues/32#issuecomment-356302757
No. You get a terminal if you do:
:terminal
And vimcmdline starts the interpreter in a Neovim terminal by default. Did you put let cmdline_in_buffer = 0 in your init.vim?
without the let cmdline_in_buffer = 0 in my init.vim !!!
and just > nvim stata.do
now things are nice and colorized, cool ! thanks
Could you do a pull request, please?
will try ! Thanks
managed to fork the vimcmdline and have added the two files for stata support, when I then install my version scheike/vimcmdline (using vim-Plug)
then I get Error detected while processing function VimCmdLineStartApp[6]..VimCmdLineCreateMaps:
this error goes away when I copy the vimcmdline.vim file into .config/nvim/plugin
Another issue is that the first time some output is viewed in the stata-console it seems that I need to go into input-mode in this window to get the full output (it does not produce the prompt "." before that), so even though output is produces it seems to be waiting. After this there are no problems.
On Tue, 9 Jan 2018, Jakson Alves de Aquino wrote:
Could you do a pull request, please?
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/jalvesaq/vimcmdline/issues/32#issuecomment-356312788
Error detected while processing function VimCmdLineStartApp[6]..VimCmdLineCreateMaps:
What error? Please, do :messages to see again error messages. Anyway, be careful to not have vimcmdline scripts copied in more than one place.
Another issue is that the first time some output is viewed in the stata-console it seems that I need to go into input-mode in this window to get the full output
python3 has the same problem, and I don't know how to fix it.
without the vimcmdline in the plugin I get the messages:
Error detected while processing function
VimCmdLineStartApp[6]..VimCmdLineCreateMaps:
line 14:
E121: Undefined variable: b:cmdline_filetype
E15: Invalid expression: 'nmap
Error detected while processing function VimCmdLineStartApp[6]..VimCmdLineCreateMaps:
What error? Please, do
:messagesto see again error messages. Anyway, be careful to not have vimcmdline scripts copied in more than one place.Another issue is that the first time some output is viewed in the stata-console it seems that I need to go into input-mode in this window to get the full output
python3has the same problem, and I don't know how to fix it.-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/jalvesaq/vimcmdline/issues/32#issuecomment-356562525
You have to put this in the beginning of ftplugin/stata_cmdline.vim:
" Ensure that plugin/vimcmdline.vim was sourced
if !exists("g:cmdline_job")
runtime plugin/vimcmdline.vim
endif
Regarding the need of going to input mode in stata, I fixed the issue with python3 by deleting my ~/.inputrc.
Perhaps, before doing the pull request you will have to rebase your repository. I'm not good with git commands, but maybe these commands will work:
git remote add upstream https://github.com/jalvesaq/vimcmdline.git
git fetch upstream
git checkout master
git rebase upstream/master
git push -f origin master