Bash
which stylua
which black
which goimports
which gopls
which pyright
which bash-language-server
which shfmt
which clang-format
which jq
which sql-formatter
which prettierd
which ctags
Ubuntu 24 + Neovim 開発環境¶
Neovim で使用する formatter / LSP / ツール追加手順まとめ
あなたの現在の構成:
- Ubuntu 24
- Neovim 0.13-dev 系
lazy.nvimconform.nvimmason.nvim~/.npm-global~/go/bin~/.cargo/bin- Python venv/uv 環境
に合わせています。
1. PATH の整理¶
~/.bash_aliases
Bash
# PATH設定
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/go/bin:$PATH"
export PATH="$HOME/.npm-global/bin:$PATH"
export PATH="$HOME/.local/bin:$HOME/scripts:$PATH"
# Rust
source "$HOME/.cargo/env"
反映:
確認:
2. Rust 環境(stylua 用)¶
公式 rustup インストール¶
反映:
確認:
stylua¶
Lua formatter
確認:
3. Python formatter¶
black¶
現在の venv / uv 環境で:
または:
確認:
4. Go¶
goimports¶
Go formatter
gopls¶
Go LSP
確認:
5. npm 系ツール¶
npm global path¶
~/.bash_aliases
反映:
pyright¶
Python LSP
bash-language-server¶
Bash LSP
sql-formatter¶
SQL formatter
prettierd¶
JS/TS/CSS/HTML formatter
確認¶
6. apt 系¶
shfmt¶
Shell formatter
clang-format¶
C/C++/Java formatter
jq¶
JSON formatter
確認¶
7. 最終確認¶
Bash
which stylua
which black
which goimports
which gopls
which pyright
which bash-language-server
which shfmt
which clang-format
which jq
which sql-formatter
which prettierd
8. Neovim 側確認¶
Neovim 起動:
確認:
特に:
- mason
- lsp
- conform
- treesitter
を確認。
9. 現在おすすめの formatter 構成¶
| 言語 | formatter |
|---|---|
| Lua | stylua |
| Python | black |
| Go | goimports |
| Shell | shfmt |
| JSON | jq |
| SQL | sql-formatter |
| JS/TS | prettierd |
| C/C++ | clang-format |
| Java | clang-format or google-java-format |
10. あなたの構成との相性¶
現在のあなたの環境:
- Neovim 0.13-dev
- conform.nvim
- lazy.nvim
- mason.nvim
- Ubuntu 24
- uv
- cargo
- npm-global
はかなりモダンで強い構成です。
特に:
- Rust 系 formatter
- Go 系 LSP
- npm 系 LSP
- Python uv
- format on save
との相性が良いです。