-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
neovim: Add configs #206
Comments
Install `lazy.nvim` at startup when it hasn't installed yet. https://lazy.folke.io/installation Why is `lazy-lock.json` included into this commit? -> See at LazyVim/LazyVim#850 refs #206
Currently there is no plugins under the directory, so I make disable to load from them. (It causes an error when startup) refs #206
I was not sure how to migrate vimsettings written by vimscript to lua. Vimscriptの設定をLuaに変換する場合、以下のように書くことができます: vim.g.cheatsheet_cheat_file = '~/dotfiles/vim/cheatsheet.md' 説明:
この設定は、init.luaやその他のLua設定ファイルに記述することができます。 Lazy.nvimのプラグインスペックの形式で書くと、以下のようになります: return {
"reireias/vim-cheatsheet",
config = function()
vim.g.cheatsheet_cheat_file = '~/dotfiles/vim/cheatsheet.md'
end,
} 説明:
オプションとして、以下のような追加設定も可能です: return {
"reireias/vim-cheatsheet",
lazy = true, -- 必要時に遅延読み込み
keys = { -- キーマッピングを指定すると、その時に読み込まれます
{ "<leader>?", "<cmd>Cheatsheet<cr>", desc = "Open Cheatsheet" },
},
config = function()
vim.g.cheatsheet_cheat_file = '~/dotfiles/vim/cheatsheet.md'
end,
} エラーの原因は変数名の変換が適切でなかったことにあります。修正した設定は以下になります: return {
"reireias/vim-cheatsheet",
config = function()
-- #を含む元の変数名をそのまま使用
vim.g['cheatsheet#cheat_file'] = '~/dotfiles/vim/cheatsheet.md'
end,
} 説明:
この修正により、 補足として、この事例から学べる重要なポイントをまとめておきます:
今後も他のVimscript設定をLuaに移行する際に、同様のケースがありましたらこの方法を活用してください。 |
This is based on: https://namileriblog.com/mac/lazy_nvim_lsp/ refs #206
I plan to migrate from Vim to Neovim
The text was updated successfully, but these errors were encountered: