aca-ta / dotfiles

0 stars 0 forks source link

pyenvを読み込まずに`.py` ファイルを開くを開くと has('python3') が0になる #4

Closed aca-ta closed 1 week ago

aca-ta commented 1 week ago

.py以外の拡張子だと has('python3') は1になる。 wilder.nvim が使えないので困る。

aca-ta commented 1 week ago

:chechkealth の結果

nvim: require("nvim.health").check()

Configuration ~
- OK no issues found

Runtime ~
- OK $VIMRUNTIME: /opt/homebrew/Cellar/neovim/0.10.2_1/share/nvim/runtime

Performance ~
- OK Build type: Release

Remote Plugins ~
- WARNING "wilder.nvim" is not registered. (python3 not available)
- OK Up to date
provider.python: require("provider.python.health").check()

Python 3 provider (optional) ~
- pyenv: Path: /opt/homebrew/Cellar/pyenv/2.4.1/libexec/pyenv
- pyenv: Root: /Users/aca-ta/.pyenv
- Using: g:python3_host_prog = ".../.pyenv/versions/3.12.2/bin/python3"
- Executable: .../.pyenv/versions/3.12.2/bin/python3
- Python version: 3.12.2
- pynvim version: 0.5.0
- OK Latest pynvim is installed.

Python virtualenv ~
- OK no $VIRTUAL_ENV
aca-ta commented 1 week ago

https://github.com/aca-ta/dotfiles/blob/6ab9faf52910c7fc11a88401c089107bb83731d0/etc/config/nvim/init.lua#L14

この行をコメントアウトすると再現しなくなる

aca-ta commented 1 week ago

vim.g.python3_host_prog を設定した後に vim.cmd [[syntax enable]] を実行するようにしたら直った

https://github.com/aca-ta/dotfiles/commit/6f1aff9d865aef9e639aa0954cc4d7d3cc7b78c8