-
Notifications
You must be signed in to change notification settings - Fork 0
Neovim: Markdownファイルで最初から拡張レンダリングを有効化 #105
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: aiya000 <4897842+aiya000@users.noreply.github.com>
|
@copilot 例えば どちらかというと、 |
…ling Co-authored-by: aiya000 <4897842+aiya000@users.noreply.github.com>
調査した結果、問題の原因を特定しました。
neoscrollに これにより:
|
|
@copilot
|
Co-authored-by: aiya000 <4897842+aiya000@users.noreply.github.com>
問題を理解しました。これは検索ハイライトの問題ではなく、Markdownレンダリングの問題でした。 再現手順から判明したこと:
修正内容(コミット: a9ca38a):
これでMarkdownファイルを開いた時点から「ハイライトB」が適用されます。 |
Markdownファイルを開いた際、通常のハイライトが表示され、スクロール操作(
<C-f>,<C-b>,<C-u>,<C-d>)後にrender-markdown.nvimの拡張レンダリングに切り替わる問題を修正。最初から拡張レンダリングを有効にするように変更。変更内容
主要な修正
.config/nvim/lua/plugins.lua:render-markdown.nvimの設定を変更し、Markdownファイルを開いた時点で拡張レンダリングを有効化{ 'MeanderingProgrammer/render-markdown.nvim', dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons', }, ft = 'markdown', -- Markdownファイル読み込み時にロード opts = { enabled = true, -- デフォルトでレンダリングを有効化 }, keys = { { '<C-h>r', '<Cmd>RenderMarkdown toggle<CR>', desc = 'Toggle Markdown Rendering', ft = 'markdown', }, }, }副次的な変更(検索ハイライトの改善)
.config/nvim/lua/plugins.lua:nvim-hlslensのcalm_downオプションをfalseに変更.config/nvim/lua/plugins.lua:neoscroll.nvimにpost_hookを追加技術的な説明
以前の設定では
render-markdown.nvimがkeysのみで遅延読み込みされていたため、Markdownファイルを開いた時点では通常のハイライトが適用され、何らかのトリガー(スクロール操作など)で初めてプラグインが読み込まれ、拡張レンダリングが有効化されていました。今回の変更で:
ft = 'markdown'により、Markdownファイルを開いた時点でプラグインがロードenabled = trueにより、ロード時点でレンダリングが有効化<C-h>rでのトグル機能は引き続き利用可能です。検索ハイライトの改善については、
calm_down = falseで検索ハイライトを常時表示し、post_hookでスクロール後のカウンター表示を更新します。Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.