Giter Site home page Giter Site logo

vim-ripple's Introduction

Hello, world!

I am a researcher (Inria Starting Faculty Position) in the MATHERIALS group, a joint research team of Inria and École des Ponts ParisTech. My research focus within MATHERIALS is on the development and analysis of efficient and robust sampling methods in high dimensions, particularly for applications related to statistical inverse problems and computational statistical physics.

Most of the scientific software I wrote for my research is available on this Github page. This includes

  • A Python library for Fourier/Hermite spectral methods;

  • A library of Python scripts implementing interacting particle methods for Bayesian inverse problems;

  • A FreeFem++ code for the Cahn-Hilliard equation;

  • A Julia code for calculating the effective diffusion coefficient associated with standard Langevin dynamics, using a variance reduction approach based on control variates.

My GitHub stats

vim-ripple's People

Contributors

acdifran avatar alter2000 avatar averms avatar boomskats avatar gpanders avatar urbainvaes avatar xmgplays 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

Watchers

 avatar  avatar  avatar  avatar  avatar

vim-ripple's Issues

First output printing to IPython before exectuing

First of all, great plugin, thanks for making this!

I'm running into a very minor issue. It doesn't seem to affect the functionality of the plugin at all, so it's not a big deal, but wanted to see if it's possible to fix.

When I run yrr for the first time to start up a repl and send a piece of code, the copied code and prepend and append strings are all printed to the top of the IPython session. Any ideas what's going on here?

Screen Shot 2021-03-19 at 3 43 36 PM

How to deal with __name__ == "__main__"?

Hi,

in python scripts it is best practice usually to put all code to be executed behind "if" statement or in a "main" function

def main():
    my_code1
    my_code2

if __name__ == "__main__": 
    do_this()
    do_that()
    main()

In ripple, this causes issues when I only want to send a few lines of the code and not the whole "if" block, as the spaces at the beginning of the code lines are also being sent, and the resulting code in the terminal is invalid due to indentation. A similar situation exists if I pack all the code to be executed into a separate "main" function, as I then also have the indent.

To explain in the code above .... how would I only execute the "do_that" statement? Or only the "my_code2" and remove exactly 1 level of indentation before sending?

And thanks - very nice plugin you wrote!

Send motion causes the REPL window to become unbearably small?

Hi!

Your plugin looks awesome and should be easily replacing the codi plugin I've used.

yr (nmap)
yp (nmap)
R (xmap)

Tried the python and bash version and seems like its same what to use. The repl window first starts as taking 50% of the size but then when I use a REPL by sending motion by those keystrokes. The window suddenly becomes very small.

Send word to IPython

Hi Urbain, first of all thanks for the great plugin.

I have been using it for some time with IPython and neovim on MacOS but I never managed to get it to send a word (often a variable in my code) to the REPL. Recently I did manage to get it to do so by adding another <cr> into my ripple_repls configuration (see string below before the 1) combined with the following mapping:

let g:ripple_repls = { "python": ["ipython", "\<c-u>\<esc>[200~", "\<esc>[201~\<cr>", 1] }
nmap <LocalLeader>w <Plug>(ripple_send_motion)iw

My question is, am I doing this right? I feel like I'm missing a trick here and it should be easier to configure vim-ripple to send words to the IPython REPL.

Support setting REPL local to buffer

Hey, thanks for your work on this great plugin, it's the only REPL plugin that works the way I want, and I love how simple it is.

I have a use case where I want to change the REPL command for a filetype depending on context. For some <filetype> I usually want to use command <repl>, but when I'm editing an <filetype> file in a certain directory (for example), I want to add a flag to the command: <repl> -lorem ipsum.

Right now, I'm handling that by overriding g:ripple_repls["<filetype>"] with an autocommand, but it would be cleaner and probably more Vim-like to be able to set a buffer-local REPL command. That also helps avoid unexpected behavior after we override the global config, but open a file where the override shouldn't apply.

Here's how I'd imagine it working: I could set b:ripple_repl in any buffer where I'd like a custom command. When opening a REPL, ripple would check for a command in this priority order:

  1. b:ripple_repl
  2. g:ripple_repls["<filetype>"]
  3. s:default_repls["<filetype>"]

If you think this fits the spirit of the plugin and doesn't add too much complexity, I'd be happy to go ahead and implement it, write the docs, and file a pull request. But, I wanted to make sure you think it would be a good addition before going ahead.

is there a way to set shell as a default repl if it doesn't recognize the filetype?

Thanks for the great plugin. Your plugin made me switch from neoterm because I encountered some problem when sending a python function and I would need to go to the terminal to hit .

I'm not too sure if I'm asking the right question or not. Probably explaining my workflow will help you understand what I'm currently having a hard time with. There are 2 primary languages that I deal with daily : python and scala-spark. With python, it works perfectly fine. But with scala-spark I can't really figure out how. Normally I would open another terminal window within nvim, and run a docker container to have ipython (with scala-spark kernel) there. Then I could send commands from one window to the other and see the results.

Any suggestion would be very welcome, and let me know if you need more details.
Thanks in advance

How to send Ctrl-D?

My vim / terminal skills are limited. I'm not sure what the correct way to send Ctrl-D to the terminal. Is this possible?

Recent commit breaks chunk send to Radian repl in nvim

I have nvim 0.5.0 (stable) and it looks like the new update, specifically:

call chansend(getbufvar('%', '&channel'), a:formatted)

Breaks the chunk send to my radian repl. Switching back to

put =a:formatted

seems to have fixed the problem.

Upgrading neovim causes 134 error

Hi, thanks for the plugin: the simplicity and ease of use are great.

I recently updated from neovim "NVIM v0.5.0-715-gc5ceefca7" to "NVIM v0.5.0-dev+1062-gcc1851c9f". Now when I start the REPL I immediately get the following error:

[Process exited 134]

My only ripple related configuration is

let newline = "\<cr>"
let g:ripple_enable_mappings = 0
let g:ripple_winpos = 'below'
nmap <LocalLeader>ro <Plug>(ripple_open_repl)
vmap <LocalLeader>rs <Plug>(ripple_send_selection)
nmap <LocalLeader>rm <Plug>(ripple_send_motion)
nmap <LocalLeader>rp <Plug>(ripple_send_previous)
nmap <LocalLeader>a <Plug>(ripple_send_motion)ae
nmap <LocalLeader>p <Plug>(ripple_send_motion)ap
nmap <LocalLeader>l <Plug>(ripple_send_motion)_
nmap <LocalLeader><CR> :call ripple#command(0, 0, newline)<CR>
nmap <LocalLeader>w <Plug>(ripple_send_motion)iw

I'm not sure if this is a ripple or neovim issue. Any advice on debugging or a fix would be most welcome.

Is it possible to add these 2 extra features ?

Thanks again for this plugin. I have been using it for the past days, and there is something that I think it would be great to have:

  1. When you close terminal window, you can't reopen it unless you leave that vim instance.
  2. Could it be a side effect from the first question, I was expecting to have different terminals for different vim tabs but it seems that for each vim instance, we can only have one kind of terminal ?

Make the terminal split more configurable.

Right now, you can only specify if you want to have a vertical split or not. It is not possible to, for example, give the split a width or special name. I was wondering if you could maybe implement this? I would suggest using term_start() to achieve this (g:ripple_winpos becomes redundant of course, you could replace it with g:ripple_config). I am willing to implement this if you don't have the time (although it should be a rather small change).

Send motion to REPL not appending necessary strings to the code

Hi, thanks very much for making this plugin!

I'm currently writing a lot of Hy code. Hy being a lisp, the command yrab is really useful to send an S-expression to the REPL. Also, something like yriw is nice to just look at the value of a variable.

However any command of the form yra* or yri* doesn't seem to append the strings defined in the configuration or an extra <cr>, so the nothing is run in the REPL until I manually enter <cr>.

Note that using yrr does append an a <cr> at the end, so the code is actually executed in the REPL.

This is the relevant config:

let g:ripple_repls = {  "hy": ["hy --spy", "", "\n", 1]   }

A simple example, file test.hy, cursor positioned at |:

(|print 5)

When I do yrr, the entire line is sent to the REPL along with multiple extra newlines, but for yrab, the S-expression is sent, but not run.

Is there a way for me to set it up so that using yrab would also allow me to run the expression in the REPL?

Send ripple issue

Hey, thanks for this plugin - exactly what I'm looking for to expedite development!

I'm on Windows and neovim, and when sending the motion two differences to the gif animation happen:

  1. I get a ^U at the start of each code block sent. I guess this is related to the windows clipboard. I've had a look at the code abut don't know enough to help unfortunately.

  2. The sent lines do not get executed. Is this because there is no <cr> in the ripple.vim mapping?

Issue #1 is the main one to fix as it is easy to move to the terminal and hit enter.

Enable opening an isolated REPL

For a buffer number x of filetype ft, first check if x is in s:term_buffer_nr, then check if ft is in s:term_buffer_nr.

Mapping?

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.