Comments (16)
Hi, I'm an issue opener. I will check and return feedback.
from vim-conda.
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.
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.
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.
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.
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.
I'm the original author. Would love a PR to fix this! :)
from vim-conda.
I think we just favour python3 if found first. Otherwise fallback to others.
from vim-conda.
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.
I actually found some time this morning and I just issued a PR. :)
from vim-conda.
I don't know, I wasn't the issue opener :)
from vim-conda.
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.
-
It took ~2-3 seconds to run at startup. It is within acceptable range but I believe startup time can improve for the better
-
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
- Changing env but linting doesn't recognize.
from vim-conda.
Hi!
-
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".
-
The second does not look like an error message but rather a notification. What you get when you type
:messages
after Vim started up? -
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.
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.
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.
@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.
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)
- Python 3 support? HOT 18
- Improve documentation page for vim HOT 2
- Enable root conda environment HOT 4
- Suppress Message on Startup HOT 5
- Massive error log on startup HOT 21
- msg_suppress not defined HOT 5
- python 2 & 3 compatibility HOT 2
- E887: Sorry, this command is disabled, the Python's site module could not be loaded. HOT 1
- vim-conda is not compatible with the latest conda env activation mechanism HOT 5
- Issue with Jedi after install vim-condo HOT 3
- Had Error: "UnboundLocalError: local variable 'current_env' referenced before assignment" at line 336 in conda_change_env, fixed it myself, here is what I did. HOT 1
- Showing name Error. I have installed spacevim and anaconda as well, but I don't know why this error is showing. HOT 2
- Set environment in vimrc HOT 1
- How to set default conda env $CONDA_DEFAULT_ENV?
- Startup errors in Neovim on windows HOT 3
- Source conda.sh on startup? HOT 2
- how to set CONDA_EXE on MS Windows? HOT 2
- Activating the environment that was active during vim startup fails HOT 1
- The Issue about :CondaChangeEnv HOT 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-conda.