bonyuta0204 / dotfiles

repository for dotfiles
1 stars 0 forks source link

neovimでのLSP関連機能の設定 #27

Open fs-yuta-nakamura opened 2 years ago

fs-yuta-nakamura commented 2 years ago

やりたいこと

neovimでLSPが使いたい。

やりたいこと

参考

LSPの公式ページ

bonyuta0204 commented 2 years ago

実現方法

必要なライブラリ

選択肢

LSP clinent

補完ライブラリ

bonyuta0204 commented 2 years ago

現状整理

補完

bonyuta0204 commented 2 years ago

neovimのbuilt-in lspの利用

必要ライブラリのインストール

nvim-lsp は組み込みではあるものの、そのままだと扱いづらいため実質必須となるプラグインがあります。

nvim-lspconfig (https://github.com/neovim/nvim-lspconfig) nvim-lsp-installer (https://github.com/williamboman/nvim-lsp-installer)

neovim built-in lspの設定方法

以下のドキュメントに倣って設定した https://github.com/neovim/nvim-lspconfig

vim-lsp-installer

LSPのインストールを簡単の行うためのプラグイン

こちらを参考に設定

vim-lsp-installerを利用してインストールを行ったlspのサーバーは、 vimrcで個別の設定を書く必要がない。

原則、新規のLSPサーバーは、全てvim-lsp-installer経由で行うようにする

bonyuta0204 commented 2 years ago

キーバインディング

以下のキーバインディングでLSPの機能を利用できる状態にした https://github.com/bonyuta0204/dotfiles/blob/f7d8f18c06a6a468e9bb6bf9d6b7f29c6bdcde40/rc/vimrc#L284-L302

bonyuta0204 commented 2 years ago

nvim-cmp の導入

公式ドキュメントに合わせて設定

bonyuta0204 commented 2 years ago

TODO

LspInstallでのLSPのインストールをスクリプトにかけていないので、手動でインストールする必要がある