Git Product home page Git Product logo

Comments (16)

hungpham3112 avatar hungpham3112 commented on June 12, 2024 2

Hi, I'm an issue opener. I will check and return feedback.

from vim-conda.

cjrh avatar cjrh commented on June 12, 2024 1

Unrelated: at startup, I get the following message:

Very possible. I haven't personally used vim-conda in a very long time. I will still merge PRs though so if you can fix it to be better for how conda is today, I'll happily accept that.

from vim-conda.

ubaldot avatar ubaldot commented on June 12, 2024 1

I was thinking to do that but in-spite the code looks very neat and not super hard to understand that would require me to study how to use Python in a different context than "data-science" + how to vimscript with python (I only used 100% vim9script) = lot of time which unfortunately at the moment I don't have (other life's priorities).

Nevertheless, if I will find some time in the future I will definitely try to send some PR :)

from vim-conda.

cjrh avatar cjrh commented on June 12, 2024 1

Thank you, I merged the PR and sent you an invite to be a collaborator on this project. Can this issue be closed now?

from vim-conda.

hungpham3112 avatar hungpham3112 commented on June 12, 2024 1

I wrote a new plugin due to that this plugin is not being maintained anymore (but still accept PR:s) and because conda has changed throughout the years, Vim script has substantially improved. So, I thought it would have been easier to rewrite it in Vim9. I hope it does not bother :)

I checked your plugin. It's nice and clean with popup feature, I love that.
@cjrh How about adding new reference to README.md to help new people know about @ubaldot plugin? It would be good for community. Thanks

from vim-conda.

knowblesse avatar knowblesse commented on June 12, 2024

I've run into the very same problem today.
While debugging the code, I found that if the system both respond to the 'python' and 'python3' then the initialization prosess does not begin in the plug in.
Check this commend
:echo !has('python3') && !has('python')
if it returns 1, then the plugin would just exit without running.

I guess the original author designed this way when the plugin does not sure which python to use.(I gave up too. this is really annoying problem)

from vim-conda.

cjrh avatar cjrh commented on June 12, 2024

I'm the original author. Would love a PR to fix this! :)

from vim-conda.

cjrh avatar cjrh commented on June 12, 2024

I think we just favour python3 if found first. Otherwise fallback to others.

from vim-conda.

ubaldot avatar ubaldot commented on June 12, 2024

I've run into the very same problem today. While debugging the code, I found that if the system both respond to the 'python' and 'python3' then the initialization prosess does not begin in the plug in. Check this commend :echo !has('python3') && !has('python') if it returns 1, then the plugin would just exit without running.

I guess the original author designed this way when the plugin does not sure which python to use.(I gave up too. this is really annoying problem)

This is the way it should be, isn't it?
If you don't have python3 nor python how the plugin is supposed to run?
Note that with the exception of the plugin script, the whole plugin is basically written in Python.

As it is today (2023) I guess you should have python3, therefore be sure that :echo has('python3') returns 1.
If not, then you should set your pythonthreedll option in vim.
This is the way I set it on my .vimrc (based on this : https://stackoverflow.com/questions/74718716/how-to-get-my-vim-and-macvim-to-find-python3) :

if has("gui_win32") || has("win32")
    set pythonthreehome=$HOME."\\Miniconda3"
    set pythonthreedll=$HOME."\\Miniconda3\\python39.dll"
elseif has("mac")
    &pythonthreehome = fnamemodify(trim(system("which python")), ":h:h")
    &pythonthreedll = trim(system("which python"))
endif

Also, try to run :python3 print('Hello world') and see what happens.

Unrelated: at startup, I get the following message:

Could not find a matching env in the list. 
This probably means that you are using a local 
(prefix) Conda env.
 
This should be fine, but changing to a named env 
may make it difficult to reactivate the prefix env.

may that be because in conda now the default environment is called base instead of root?

from vim-conda.

ubaldot avatar ubaldot commented on June 12, 2024

I actually found some time this morning and I just issued a PR. :)

from vim-conda.

ubaldot avatar ubaldot commented on June 12, 2024

I don't know, I wasn't the issue opener :)

from vim-conda.

hungpham3112 avatar hungpham3112 commented on June 12, 2024

I'm tested with Windows 11 terminal vim , the plugin works correctly when apply Lazy load in plug.vim settings.

Plug 'https://github.com/cjrh/vim-conda.git', {'for': ['python']}

I have some concerns towards the performance.

  1. It took ~2-3 seconds to run at startup. It is within acceptable range but I believe startup time can improve for the better

  2. The plugin will show the message and I have to confirm if not lazy load.

vim-terminal:

bandicam.2023-05-23.12-24-38-478.mp4

in the video, first time I loaded plugin without lazy behavior, then I set it back so we can see the different result.

gvim:

bandicam.2023-05-23.12-28-13-836.mp4
  1. Changing env but linting doesn't recognize.

from vim-conda.

ubaldot avatar ubaldot commented on June 12, 2024

Hi!

  1. Same here. I think that is the combination of two factors: conda itself is not very fast in changing environment and the plugin is written in Python which is notoriously slow. I think that this plugin is super useful and perhaps today it could be rewritten in VimScript for at least two reasons that come on top my head: Vim9 is faster and Vim9Script is much easier to write; Conda has changed in the meantime; we have LSP today so we don't need to consider a dedicated path for Jedi perhaps. I am personally considering to rewrite it "as-is" in Vim9script but don't hold your breath because I don't know "if" nor "when".

  2. The second does not look like an error message but rather a notification. What you get when you type :messages after Vim started up?

  3. For the linting I suggest you to use this. You can give the LSP server complete path so you don't have to bother about changing environment. You can check my .vimrc profile that I store in my github profile to take some inspiration, but if you have any question feel free to ask.

from vim-conda.

hungpham3112 avatar hungpham3112 commented on June 12, 2024
2. The second does not look like an error message but rather a notification. What you get when you type `:messages` after Vim started up?

Yes, it's a notification. It's show base at the first time I open vim if I'm in conda base. My thought in here is another way to this message because opening without lazy load cause you have to confirm to enter vim, it's noisy.
image

How about adding option to VimEnter?
Pseudo code: ```

autocmd VimEnter * silent call ActivateEnv()

function! ActivateEnv()
" Your function code here
echo "base"
endfunction

from vim-conda.

ubaldot avatar ubaldot commented on June 12, 2024

@hungpham3112 You could try this: https://github.com/ubaldot/vim-conda-activate
It is brand new so it will most likely have some bugs, and it has been tested only on OSX.
You could give it a shot anyway, it should be faster as it is 99% in VimScript.

I wrote a new plugin due to that this plugin is not being maintained anymore (but still accept PR:s) and because conda has changed throughout the years, Vim script has substantially improved. So, I thought it would have been easier to rewrite it in Vim9. I hope it does not bother :)

from vim-conda.

cjrh avatar cjrh commented on June 12, 2024

I suggested same to @ubaldot in the other issue. He is a collaborator on this project and I've encouraged him to add at reference in the README. Higher up is better.

from vim-conda.

Related Issues (20)

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.