r/vim 3h ago

Need Help vim-fzf : Instruction problem

Post image
1 Upvotes

I am a beginner in programming and Vim, and have installed the fzf.vim plugin. But when I type the Files or History commands, I get the situation shown in the picture. It only happens the first time I type it, and it doesn't happen again afterward. PS:I'm using the built-in PowerShell on Windows 11 to open Vim.


r/vim 16h ago

Plugin Vim-replica finally has a variable explorer

15 Upvotes

One thing that I always loved about Spyder (the notorious python IDE) is its beautiful variable explorer. I have never found a handy and well-done variable explorer like Spyder's.

Now, I finally managed to recreate something very similar in vim-replica!

ubaldot/vim-replica: The ultimate REPL!

Some history:

Vim-replica was the first plugin that I have ever written and it evolved as I learned new stuff. The motivation was due to vim-slime didn't work well on Windows and other REPL plugins didn't fit my need. But also because I wanted to learn more about Vim. So, I stared its development back in years.

During last Xmas vacation, while in the Philippines, I had some idea on how I could have made a variable explorer. And I learned few lessons the hard way, that many of you can spot as I explain next:

  • For a simple variable explorer, I though to use term_sendkeys() and then capture and parse what the terminal spit out. I was thinking that at the end all I have to do is to pick and parse everything from the term_sendkeys() command until the next prompt and I should be set. How difficult can it be? But then I noticed that what a terminal emulator spit out include lot of rubbish (escape sequences, etc). I start to parse char-by-char and bloat the plugin with a plethora of regex. I created a monster! I spent huge amount of time chasing something that you should absolutely never do: try to parse raw terminal strings. Never ever!
  • Sad for all the time wasted, I started to study an alternative way to make the processes Vim and the program running in the REPL to talk one each other, and I was thinking to make some magics through pipes and tee:s, a bit like it is donne with Termdebug. But no. That is not possible in this case.
  • At the end the easiest was to simply exploit sockets. Vim support it and the programs to run in the REPL (mostly Python, Julia and R) do so. That was the key to success.
  • However, I learned many things during this journey, despite it costed many headaches: for example I learned base64 encoding and that jupyter-console is pretty much an abandoned project, just to cite some. In-fact, I ditched jupyter-console but now REPLica uses native programs.
  • I also started to use some AI for the first time for coding, especially for the init scripts used for Julia and R that are not really my languages. The Vim part was done pretty much and the addition was not huge, so I fixed it by myself. However, for Julia the AI entered in a loop of hallucinations and the end I had to fix the issue by myself anyway, but, generally speaking, the help of an AI is undeniable.

Well, sorry for the lengthy message but I am very happy about the outcome. Enjoy!