# Roc言語を触ってみてる ※2025/10/27時点の情報を元に書いています。情報がすぐに古くなるかもしれません。 最近、[Roc](https://www.roc-lang.org)というプログラミング言語を触っています。 きっかけはRocの作者のRichard Feldmanが書いた、[RocのコンパイラをRustからZigに書き換える記事](https://gist.github.com/rtfeldman/77fb430ee57b42f5f2ca973a3992532f) を読んで面白かったので、そのままRoc自体も気になって見ていました。 まだアルファ版の絶賛開発中の言語ですが、シンプルさとビルドの高速性を意識して作られているのが個人的には好印象で機能も気に入ったので、触ってみています。 簡単に言語の特徴を説明すると、Rocは関数型で静的型付けのコンパイル言語です。 (違う部分も多々ありますが、)Elmを知っている人にはElmのターゲットをブラウザではなく、ネイティブ向けにした言語と言うと伝わりやすいかもしれません。 関数型言語によくある機能(パターンマッチ、Result型、パイプライン演算子など)があり、便利で書いてて楽しい言語です。 私自身は関数型言語にはあまり詳しくなく、Haskellの入門書を読んで、Elmはチュートリアルをちょっと触ったことがあるぐらいの経験しか無いのですが、一通り読んで理解した気になれる[良いチュートリアル](https://www.roc-lang.org/tutorial)が用意されていました。 ## Rocの個人的に好きなポイント ### ビルド速度 言語の目標として「高速にビルドされること」が明確に意識されています。([Fast | Roc](https://www.roc-lang.org/fast)) 私がGo言語を好きな理由の一つに「ビルドが早いこと」があるので、Rocでも好きなポイントです。 ビルドが早くて関数型言語のネイティブバイナリへビルド可能なプログラミング言語がそもそもOCamlぐらいしか存在しないんじゃないかという気がします。(あったら教えてください) ビルドの速度や周辺ツールの重さ、言語自体の重厚さを気にしなければHaskellもありますし、パラダイムとして取り入れてるものも入れればRustも選択肢に上がると思うんですが、ビルド速度が厳しかったするので、やはりビルドが早いのは正義かなと思います。 ### 言語機能 個人的には下記が便利で好きなポイントです。 - パターンマッチ - パイプライン演算子 - Result型 また、他の言語ではあまり見ないRoc独自のポイントとしてPlatformという特徴があります。 PlatformはRocで開発するアプリケーションにI/OのAPIとランタイム的役割を果たす層です。 Platformはライブラリのように簡単に差し替えできるようになっており、作りたいアプリに合わせて選びます。 例えば、CLI開発用のPlatform、Webサーバ用のPlatformが現状公式から提供されています。 ```elm app [main!] { cli: platform "https://github.com/roc-lang/basic-cli/releases/download/0.20.0/X73hGh05nNTkDHU06FHC0YfFaQB1pimX7gncRcao5mU.tar.br" } import cli.Stdout import cli.Arg exposing [Arg] main! : List Arg => Result {} _ main! = |_args| Stdout.line!("Hello, World!") ``` 上記はCLI開発用のPlatform(basic-cli)を利用しています。(1行目の宣言がそれです。) Platformが別れていることで、アプリに合わせてメモリ管理をしたりI/O操作を最適化したりができるようになります。 詳しくは[Platforms and Apps | Roc](https://www.roc-lang.org/platforms)を読んでください。 ## Rocの推せない部分 ほとんどアルファ版であることに起因してます。 ### ライブラリ まだアルファ版なので、それはそうなんですが少ないです。 全く無い訳ではないので、[lukewilliamboswell/roc-awesome: Awesome Roc](https://github.com/lukewilliamboswell/roc-awesome) など見るといくつかありますし、標準ライブラリもそこそこ揃っています。 現状は無いものは作ろうのストロングスタイルです。 ### まだ構文が変わりそう 過渡期なので、変わると明言されているものが幾つかあります。 [Planned Changes | Roc](https://www.roc-lang.org/plans)に書かれています。 変化過程を楽しみたいという人には逆に推せるかもしれません。 ## Rocの現状 [RocのコンパイラをRustからZigに書き換える記事](https://gist.github.com/rtfeldman/77fb430ee57b42f5f2ca973a3992532f)で説明されているコンパイラの書き換えが絶賛進行中のステータスです。 Advent of Code 2025には、新しいコンパイラで取り組めるようにすることを目指しているので、年末を楽しみにしつつAdvent of Code 2025をRocでやってみるのはいかがでしょうか。 ## おわりに 面白い言語だと思うので、新しいもの好きの人には試してもらいたいなぁという気持ちで書きました。是非是非!! --- # Ergo68 を買った ![Ergo68](https://i.gyazo.com/thumb/4027/551d3c255581c1de914781528d9bc838-heic.jpg) ## 購入経緯 9月の始め頃から、左手小指が痛くなってきました。 左手小指が弱く、定期的に痛い時期があるので、スペースキー長押しでCtrlキーとして使ったりと工夫はしていたんですが、過去一の辛さがやってきたのでShiftキーを親指で押せるキーボードを探していました。 Ergo68自体は数年前から認識していたんですが、自作キーボードは組み立てが面倒だな〜と思い避けていました。 ただ、調べているうちにErgo68にははんだ付け済みのキットが存在すること、ホットスワップ対応であること、自作キーボード以外では左右にCtrl, Shiftを親指で押せて矢印キーを配置できるキーボードがほぼ存在しないことが決め手となり、購入に至りました。 購入直前になると、買う前からキーレイアウトを検討するぐらい気になってました。 ![購入前のErgo68 キーレイアウト検討](https://i.gyazo.com/427edb2ed2e0abfdc5013420a4c1f5bd.png) ## 購入、価格 - [はんだ付け済み簡単キット - Ergo68](https://shop.yushakobo.jp/products/3923?variant=47873667825895) - 19,800円 - [TRRSメタルケーブル 0.8m](https://shop.yushakobo.jp/products/8111?variant=47850237001959) - 1,100円 - 両手のキーボードを繋ぐために利用 - [HC Studio HMX Xinhai Linear Switch 37g](https://shop.yushakobo.jp/products/10302?variant=50574640546023) - 2,310円 - 家にあったキーキャップ - 0円 - 家で余っていたキースイッチ複数 - 0円 - 家に転がっていたUSB Type-Cケーブル - 0円 合計約23,000円でした。 若干キースイッチを買い足したぐらいで、家にあるものをなるべく流用しました。 そのため、キーマップとキーキャップの印字が一部ズレてしまっています。 余裕があるときに、揃えたいですね。 ## 組み立てについて 前述の通り、はんだ付けが完了しているものを購入しました。 以前に自作キーボードを組んだのが2018年にHelixを組んでそれっきりだったんですが、今はHelixもはんだ付けが必要なのはProMicroとソケットとスイッチぐらいになっていて、とても簡単になっていました。 Ergo68も同様で、はんだ付け箇所がそこまで少ないのであれば、自分でやっても良かったかもしれません。 最近は子供を見る時間が多いので、積んでしまうことを懸念して一応はんだ付け済みのキットにしました。 届くと、以下のようにダイオードもProMicroも全てはんだ付けが完了しています。 なので、組立作業としてはスイッチをはめてネジ止めをして、キーキャップをはめるぐらいです。 およそ30分程度でできました。簡単です。 ![届いた時の基盤画像](https://i.gyazo.com/thumb/4027/36104c60a90c32dd6d0b12abb933cd7e-heic.jpg) ## 使用感想 購入の目的であった、Shift, Ctrlキーを親指に割り当てることには成功しました。 まだいくつかの記号の割り当て位置については試行錯誤中ですが、概ね満足しています。Shiftキーを親指で押せるようになったことで、左手小指の痛みも緩和されました。 カラムスタッガード配列は初めてだったので、誤タイプが増えないか心配でしたが、Helixのオーソリニアと同じイメージで打てばミスなく打てているので大丈夫そうです。 ## 現状のキーマップ 試行錯誤中ですが、現状以下のようにしています。 レイヤー0にかなり詰め込んで、レイヤー機能をあまり活用できていないので、これから要調整かなと思っています。 ### レイヤー1 ![レイヤー1](https://i.gyazo.com/91924b0083f70053f8da633c8316e1e8.png) ### レイヤー2 ![レイヤー2](https://i.gyazo.com/4441c27335e05a00084bab11aa09a8c8.png) ### レイヤー3 ![レイヤー3](https://i.gyazo.com/5e54fb177ca725701cc96bfeedf4818f.png) --- # 2025-09 # 2025-09-02 ## [RFC の URL はどのドメインで貼るのが良いか | blog.jxck.io](https://blog.jxck.io/entries/2024-03-27/link-to-rfc.html) 読んだ > 結論は www.rfc-editor.org だ。 なるほどね # 2025-09-06 ## Proxmoxを入れてみる ### USBへの書き込み ``` $ diskutil list $ diskutil eraseDisk MS-DOS PROXMOX /dev/disk4 $ diskutil list $ diskutil unmountDisk /dev/disk4 $ sudo dd if=./Downloads/proxmox-ve_9.0-1.iso of=/dev/rdisk4 bs=16m $ diskutil list ``` 200sぐらいだった ### インストールから初期設定まで - [ミニPC(Intel NUC)へのProxmox VEのインストールから初期設定まで #Linux - Qiita](https://qiita.com/yankee/items/1d576f7a25d6f33c6cb5#proxmox%E5%88%9D%E6%9C%9F%E8%A8%AD%E5%AE%9A) 参考にした - 友人に下記教えてもらった - https://community-scripts.github.io/ProxmoxVE/ - [Proxmox VE Post Install](https://community-scripts.github.io/ProxmoxVE/scripts?id=post-pve-install)が良さそうだったので実行 > This script provides options for managing Proxmox VE repositories, including disabling the Enterprise Repo, adding or correcting PVE sources, enabling the No-Subscription Repo, adding the test Repo, disabling the subscription nag, updating Proxmox VE, and rebooting the system. ### 仮想マシンを入れてみる `pveam`がProxmoxの管理コマンドらしい 下記でubuntu-25.04のLXCテンプレートがダウンロードされるので、起動できる ```bash # pveam available # pveam download local ubuntu-25.04-standard_25.04-1.1_amd64.tar.zst ``` 管理画面から諸々の設定値を入れつつ起動したらできた。簡単 # 2025-09-11 - neovim nightlyにした方がいい感じかも - tmux, kitty, neovimの画像表示が問題なく動いてる ``` mise use aqua:neovim@nightly ``` # 2025-09-12 - cmdにワンショットシフトキーいいかもね - home row modsは暴発が多くて厳しかった - スペースキーをレイヤー切り替えにして、home row modsと同じ配置にすると良いのかも # 2025-09-18 - gキーをシフトキーと入れ替える? # 2025-09-19 - gよりvの方が出現頻度的に良いかも - 今日試してみたけど割と良い - コピペぐらいかな - 日本語打っててvはほぼ出ないのが良い # 2025-09-20 - キースイッチ余り31個 ## Ergo68の購入検討 [Ergo68 - 遊舎工房](https://shop.yushakobo.jp/products/3923?_pos=3&_sid=280fede83&_ss=r&variant=47873667825895) めちゃくちゃ欲しくなってきた [Keyboard Layout Editor](https://www.keyboard-layout-editor.com/) でレイアウトまで考えてた ![Ergo68 キーレイアウト検討](https://i.gyazo.com/427edb2ed2e0abfdc5013420a4c1f5bd.png) # 2025-09-21 - [IWE](https://github.com/iwe-org/iwe)が良さそうなので試したい - [GitHub - iwe-org/iwe: LSP for Markdown notes taking](https://github.com/iwe-org/iwe) - 結構良い - フォーマットが余計なお世話なことが結構あるので切っても良さそう - デフォルトのファイルリンクは拡張子を消すっぽい - 今まで付いてたから、つけたままがいいけど… - [iOSで無料のSyncthing「Synctrain」をインストールして使ってみる - torazaemon2016’s blog](https://torazaemon2016.hatenablog.jp/entry/2025/04/27/142918)試してみたい # 2025-09-22 会社の帰りに遊舎工房に寄ってErgo68を触ったらより欲しくなった tofu65のvキーとshiftキーの入れ替えはやっぱり厳しい気持ちになってきたので、vキーをtapでv、長押しでshiftとして扱うようにしてみた # 2025-09-23 - YAMLフロントマターを見てlsしたい - [サプライチェーン攻撃への防御策 | blog.jxck.io](https://blog.jxck.io/entries/2025-09-20/mitigate-risk-of-oss-dependencies.html) - 読んでる - [MACのDocker 環境はcolima にしました - じゃあ、おうちで学べる ](https://syu-m-5151.hatenablog.com/entry/2025/04/16/201211) - colima良さそう - 入れてみた - [Ergo68を買った](https://tkancf.com/blog/bought-ergo68-keyboard) # 2025-09-25 - Ergo68が届いたので、組み立てた - ハンダ付け済みキットにしたので、とても簡単に組み立てれた - 40分程度で全て組めた ![現状のErgo68キーマップ](https://i.gyazo.com/adfb8a837a1f9dbc22bf1e7e8061b2e1.png) # 2025-09-26 - 相変わらずキーマップは迷走しているが、割と慣れてきた感じはする - あとちょっと調整すれば完成な気がしている --- # 栄冠ナインメモ ## 育成手順 ### 内野手 - G消し - ミートD - 走力E - 守備E - ミートC - 走力C - 守備D - ミートA - その他 ### 外野手 - G消し - ミートD - 走力D - 守備F - ミートC - 走力C - 守備D - ミートA ### 投手 - 総変10(6→10) - 一変化を6残りを1ずつ - 最終的に10になればOK - 本番用は3,3,2,2かな - コンE or D - 余裕があればDまで - この段階で先発で行ける - 先発: スタ F、リリーフ: スタD - 球速155 or コンA - 基本はコントロール上げる ## 投球指示 - ミート型(ミート-パワー=10) - 内角 - クサイ - 緩急 - パワー型(パワー-ミート=10) - 外角 - ストライク - 平均 - 外角 - 低め - 上記が低い時、下記なら選ぶ - うたとれが2以上高い - 外角、ストライク、おまかせが3以上高い - 低めが4以上高い ## 育成すごろく ### 効率アップ - 練習効率小UP: 2倍 - 練習効率中UP: 5倍 - 練習効率大UP: 6倍 ### 効率イベント - アイドルパネル : 全員の練習効率UP|3人の練習効率大UP|テンアゲ - 6/26〜7/2、9/8〜9/14: 【青マス/ランダム発生】 - 選択肢により経験値獲得と赤特消去 - 7/21〜7/30、2/1〜2/10: 【青マス/甲子園決定後ランダム発生】 - 選択肢により経験値獲得と特能取得 - 6/11〜6/17、11/18〜11/24、2/18〜2/24: 【白マス/ランダム発生】 - 選択肢により練習効率UP - 8/21: 【甲子園出場していない時】 - 確率で特訓マスが発生する - 12/24: クリスマスイブ - 練習効果アップやテンションアップなどランダムで発生する - 1/1 おみくじを引く - 2/29: 特訓マスが発生する - (うるう年:4で割り切れる年) - 3/15: 世界大会(2006年発生し、以降4年ごと) - 日本代表の結果によって練習効率UP - 4/1: 新2年生と新3年生の練習効率が小アップ --- # mini.nvimを試す [Neovimをはじめよう feat. mini.nvim](https://zenn.dev/kawarimidoll/books/6064bf6f193b51) を読んで使ってみたくなったので試してみました。 mini.files, mini.hipatterns, mini.tabline, mini.surround, mini.sessions, mini.starter, mini.pairs, mini.clueが気に入ったので常用してみようと思っています。 ## mini.nvim導入前の設定 該当commitへのリンク: [tkancf/dotfiles](https://github.com/tkancf/dotfiles/tree/8dfbdb61680f67aa824cb10fa44577de94bfb9ec/dot_config/nvim) を残しておきます。 ## 試したもの いくつか試して、特に気に入ったプラグインのメモ ### mini.files 現状似たプラグインとしてファイラーにはoil.nvimを利用しています。 ファイルの作成・変更をVimの操作のようにできることに加えて、ディレクトリを掘り進めたときにtree状態で表示されるのが好みでした。 oil.nvimから乗り換えて使ってみます。 ### mini.tabline デフォルトのtab表示のように、バッファ一覧が表示されます。 かなり便利で、今までtabを結構多用していたんですが、これを入れてからほぼバッファだけで良くなりました。 ### mini.hipatterns パターンとハイライトカラーを設定すると指定したパターンにマッチした単語をハイライトできる 私はMarkdownファイルでTODO管理をしているので、TODOのステータスを色分けしたくて以下のような設定を入れてみた ```lua -- mini.hipatterns local hipatterns = require('mini.hipatterns') -- mini.extra local hi_words = require('mini.extra').gen_highlighter.words vim.api.nvim_set_hl(0, 'MiniHipatternsTODO', { fg = '#000000', bg = '#ffc0cb', bold = true }) vim.api.nvim_set_hl(0, 'MiniHipatternsWIP', { fg = '#000000', bg = '#4169e1', bold = true }) vim.api.nvim_set_hl(0, 'MiniHipatternsDONE', { fg = '#FFFFFF', bg = '#696969', bold = true }) vim.api.nvim_set_hl(0, 'MiniHipatternsSCHE', { fg = '#000000', bg = '#3cb371', bold = true }) vim.api.nvim_set_hl(0, 'MiniHipatternsNEXT', { fg = '#000000', bg = '#afeeee', bold = true }) vim.api.nvim_set_hl(0, 'MiniHipatternsWAIT', { fg = '#000000', bg = '#f0e68c', bold = true }) vim.api.nvim_set_hl(0, 'MiniHipatternsWILL', { fg = '#000000', bg = '#00ced1', bold = true }) hipatterns.setup({ highlighters = { todo = hi_words({ 'TODO' }, 'MiniHipatternsTODO'), wip = hi_words({ 'WIP' }, 'MiniHipatternsWIP'), done = hi_words({ 'DONE' }, 'MiniHipatternsDONE'), sche = hi_words({ 'SCHE' }, 'MiniHipatternsNOTE'), next = hi_words({ 'NEXT' }, 'MiniHipatternsNEXT'), wait = hi_words({ 'WAIT' }, 'MiniHipatternsWAIT'), will = hi_words({ 'WILL' }, 'MiniHipatternsWILL'), -- Highlight hex color strings (`#rrggbb`) using that color hex_color = hipatterns.gen_highlighter.hex_color(), }, }) ``` ### mini.sessions Neovimのセッション機能をいままで使ったことがなかったが、これとmini.starterを入れてからは便利に使っています。 [mini.sessions|Neovimをはじめよう feat. mini.nvim](https://zenn.dev/kawarimidoll/books/6064bf6f193b51/viewer/86e45d)を参考にセッション管理のコマンドを入れて使っています。 --- # 2025-08 # 2025-08-05 - [君のレポジトリを領域展開 - 次世代バージョン管理システム Jujutsu (jj-vcs/jj)の世界](https://zenn.dev/zetamatta/books/c1e309aea68960) - `jj` 気になってる # 2025-08-12 - [Neovimをはじめよう feat. mini.nvim](https://zenn.dev/kawarimidoll/books/6064bf6f193b51) - 一通り読んで、mini.nvimを使ってみたくなった - [mini.nvimを試す](https://tkancf.com/blog/trying-mini-nvim) # 2025-08-14 - [GitHub - zenarvus/md-agenda.nvim: A Markdown time and task management plugin for NeoVim, inspired by org-agenda.](https://github.com/zenarvus/md-agenda.nvim) - 気になる # 2025-08-17 - 息子に膝貸してあげたら伝い歩きしてた - 横じゃなくて前方向に歩くので、聞いてた話と違ってびっくりした # 2025-08-20 - [Email is Easy](https://e-mail.wtf/) - 面白い - もうちょっと深掘りしてみたい # 2025-08-21 - [テキストの折り畳みを彩る vim.treesitter.foldtext() を使ってみる | Atusy's blog](https://blog.atusy.net/2023/10/26/treesitter-foldtext/) - まじか、知らなかった - [GitHub - atusy/treemonkey.nvim](https://github.com/atusy/treemonkey.nvim) - 良さそう # 2025-08-31 - [【徹底解説】Claude Code UI と Cloudflare Tunnelでスマホから快適にAIコーディング](https://zenn.dev/nogu66/articles/claudecodeui) - あとで読む --- # 2025-07 # 2025-07-01 - 気付いたら7月早すぎる - 毎日暑いね # 2025-07-02 - ウィルス性の結膜炎になった - 流行ってるらしい - 目が痛い # 2025-07-07 - mdtaskができてきた # 2025-07-12 - また別のタスク管理プラグイン作ってる - 色々作ってお試し出来るのが、claude codeのいい所だな - スクラップアンドビルドしやすい # 2025-07-14 - [Claude CodeをMAXプランで試し](https://tkancf.com/blog/testing-claude-code-max)てから1ヶ月がたった # 2025-07-17 - お買い物 - コーリ鋼の短刀がスタンで禁止になって結構下がってたので買った - 2,000円まで下がってた - あわせてタミヨウも2枚買った - これでデュアラン以外のレガシーURが完成した # 2025/07/18 - 栄冠ナインやりたい - G消し - ミートD - 走力E,D - 守備E,F - ミートC - 走力C - 守備D - ミートA - 投手 - 総変10(6→10) - コンE or D - スタ F先発、リリD - 球速155 or コンA # 2025-07-24 - また派手に風邪引いてた - リモートワークになってから明らかに免疫落ちててちょっと外出すると風邪引くようになった気がする # 2025-07-28 - 風邪治ってきた - [Claude Code 対応 Dev Container 環境構築編 - VS Code でもそれ以外でも – uma-chan’s page](https://i9wa4.github.io/blog/2025-07-28-article1-devcontainer.html) - 良さそう # 2025/07/30 - [AIで調査した技術知識を忘れないようにObsidianに自動でまとめ直す - $shibayu36->blog;](https://blog.shibayu36.org/entry/2025/07/30/092458) - 良さそう - [GitHub - oraios/serena: A powerful coding agent toolkit providing semantic retrieval and editing capabilities (MCP server & Agno integration)](https://github.com/oraios/serena) - 気になる --- # Vimで:messagesの内容をコピーする方法 ```vim :let @+ = execute('messages') ``` --- # tmuxで現在のディレクトリ名をwindow名にする設定 `~/.tmux.conf` に下記記載するだけ ``` # ウィンドウ名の自動リネームを有効にする set-window-option -g automatic-rename on # ウィンドウ名のフォーマットを設定(ディレクトリ名のみ表示) set-window-option -g automatic-rename-format '#{b:pane_current_path}' ``` --- # narrowing-nvimを作った ## はじめに Emacsを使っていた頃、Org Modeのnarrowing機能を多用していて、選択した範囲だけを別バッファで編集できるのがとても便利でした。Neovimに移行してからも似たような機能が欲しく、[chrisbra/NrrwRgn](https://github.com/chrisbra/NrrwRgn)というプラグインを使っていたのですが、いくつか不満点があったので、自分でプラグインを作ることにしました。 作ったのがこちらです:[tkancf/narrowing-nvim](https://github.com/tkancf/narrowing-nvim) ## narrowingとは narrowingは、テキストエディタで編集範囲を一時的に絞り込む機能です。例えば、1000行のファイルで100〜200行目だけを編集したい場合、その範囲だけを別のバッファに切り出して編集し、編集が終わったら元のファイルに反映する、といった使い方ができます。 この機能の便利な点は - 大きなファイルの特定部分に集中できる - 誤って他の部分を編集してしまうリスクを減らせる - 編集対象の範囲が明確になる 特に長くなってきたドキュメントの編集時に威力を発揮します。 ## 既存プラグインの課題 NrrwRgnは良いプラグインで、基本的な機能は十分に提供していました。しかし、使っているうちにいくつか改善したい点が出てきました。 ### Floating Windowに非対応 NrrwRgnは従来のsplitウィンドウしかサポートしていなかったため、特に小さい画面での作業時に不便でした。 ### Vimscriptで実装されている NrrwRgnはVimscriptで書かれています。これ自体は問題ではありませんが、最近のNeovimプラグインエコシステムはLuaが主流になってきており、Luaで揃えたいなという気持ちがありました。 ### 個人的に欲しい機能の追加 Vimのfold機能をよく使うので、foldした範囲をnarrowingする機能があると良いなと思っていました。 自作であれば機能追加は好みで取り込めます。 ## narrowing-nvimの実装 アイデアをClaude Codeに依頼したらほぼ作ってくれました。 いくつかエラーが発生した際にエラーメッセージを与えたぐらいしかしてないです。 ### 設定可能なオプション 現状、narrowingした時の表示方法、キーマップのon/off等が設定できます。 しばらくは頻繁に更新予定なので、READMEを読んでいただいた方が良いです。 ```lua require("narrowing").setup({ window = { type = "float", -- "float" または "split" position = "center", -- ウィンドウの配置 width = 0.95, -- 画面幅に対する割合 height = 0.9 -- 画面高さに対する割合 }, keymaps = { enabled = false, -- デフォルトのキーマップを無効化 narrow = "nr", -- カスタムキーマップ }, sync_on_write = true, -- 保存時に自動同期 protect_original = true -- 元のバッファを読み取り専用に }) ``` ## 使い方 ### インストール lazy.nvimを使っている場合 ```lua { "tkancf/narrowing-nvim", config = function() require("narrowing").setup() end, } ``` ### 基本的な使い方 ビジュアルモードで範囲を選択してから ```vim :'<,'>Narrowing ``` narrowingバッファで編集が終わったら、`:w`で保存すると元のバッファに変更が反映されます。 ## 使ってみた感想 実際に数日使ってみて、以下の点で満足しています ### Floating Windowの快適さ 画面全体を使って編集できるので、特に小さい画面のラップトップで作業する時の体験が大幅に改善しました。編集に集中できる環境が簡単に作れるのは想像以上に快適です。 ## 今後の展望 現在の実装で基本的な機能は満たしていますが、今後追加したい機能もいくつかあります。 - Treesitterを使った意味的な範囲選択 - 関数単位 - クラス単位など また、バグ報告や機能要望も歓迎です。GitHubのIssueで気軽にフィードバックいただければと思います。 ## 関連リンク - [tkancf/narrowing-nvim - GitHub](https://github.com/tkancf/narrowing-nvim) - [chrisbra/NrrwRgn - GitHub](https://github.com/chrisbra/NrrwRgn) - [Neovim Lua API Documentation](https://neovim.io/doc/user/lua.html) --- # Claude CodeをMAXプランで試した ## 導入 - 昨今、Claude CodeのMAXプランが良いらしい - 100$とサブスクとしてはお高めだが、定額でコーディングエージェントが(制限はあるものの)使い放題 - しかも使えるモデルがSonnet4とOpus4というプログラミングする上で高く評価されているモデルなので評判になっている - 私自身もSonnet 4のAPIを使ってRoo Codeでプログラミングをしたことがあり、高く評価している - これが定額なら100$でも安いなということで、とりあえず1ヶ月で試してみる ## 試したこと - とりあえずNeovimのプラグインを作らせてみた - [tkancf/telescope-markdown-frontmatter.nvim](https://github.com/tkancf/telescope-markdown-frontmatter.nvim) - 以前から欲しかったTelescopeの拡張でMarkdownのYAMLフロントマターをfuzzy finder検索できるやつ - ![デモ](https://gyazo.com/d65696c4135d8023ab70fe2863537c11.png) - MTGのレガシーで使われているカードの使用数ランキング作成 - [mtg-ranking.tkancf.com](https://mtg-ranking.tkancf.com/) - [narrowing-nvimを作った](https://tkancf.com/blog/built-narrowing-nvim) - [tkancf/mdtask](https://github.com/tkancf/mdtask) - [tkancf/mdtodo-nvim](https://github.com/tkancf/mdtodo-nvim) ## 知見メモ ### 全承認したいとき `claude --dangerously-skip-permissions` とすると全部承認して勝手に実行・編集する 危険 ### 前回の会話の続きを再開したい時 - `claude --continue` とすると前回の会話履歴の続きから開始する - `claude --resume` とするといくつか過去の会話履歴選択肢が出てきて、そこから選べる ### プロジェクトルール - CLAUDE.md をプロジェクトルートに配置すると、それを読む - 会話を開始して、 `/init` すると、自動でプロジェクトの内容を読んで CLAUDE.md を作成してくれる ## 使用量 - ccusage を使うと、どのくらい使ったか見れて楽しい - まだ契約して半月だが、 $598 利用している ```bash ≻ npx ccusage@latest --since 20250615 -b WARN Fetching latest model pricing from LiteLLM... ccusage 22:34:41 ℹ Loaded pricing for 1140 models ccusage 22:34:41 ╭──────────────────────────────────────────╮ │ │ │ Claude Code Token Usage Report - Daily │ │ │ ╰──────────────────────────────────────────╯ ┌──────────────┬───────────────────┬──────────┬──────────┬──────────────┬─────────────┬──────────────┬────────────┐ │ Date │ Models │ Input │ Output │ Cache Create │ Cache Read │ Total Tokens │ Cost (USD) │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 2,877 │ 38,606 │ 1,653,592 │ 25,292,812 │ 26,987,887 │ $27.05 │ │ 06-15 │ - sonnet-4 │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 365 │ 13,649 │ 418,701 │ 4,639,884 │ 5,072,599 │ $15.84 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ sonnet… │ │ 2,512 │ 24,957 │ 1,234,891 │ 20,652,928 │ 21,915,288 │ $11.21 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 1,204 │ 17,068 │ 399,394 │ 6,805,161 │ 7,222,827 │ $14.77 │ │ 06-16 │ - sonnet-4 │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 510 │ 14,905 │ 226,372 │ 5,559,757 │ 5,801,544 │ $13.71 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ sonnet… │ │ 694 │ 2,163 │ 173,022 │ 1,245,404 │ 1,421,283 │ $1.06 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 3,767 │ 79,732 │ 2,686,856 │ 42,890,005 │ 45,660,360 │ $116.65 │ │ 06-17 │ - sonnet-4 │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 3,559 │ 74,373 │ 2,591,679 │ 40,933,036 │ 43,602,647 │ $115.62 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ sonnet… │ │ 208 │ 5,359 │ 95,177 │ 1,956,969 │ 2,057,713 │ $1.03 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 896 │ 34,254 │ 621,947 │ 7,142,307 │ 7,799,404 │ $24.96 │ │ 06-18 │ │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 896 │ 34,254 │ 621,947 │ 7,142,307 │ 7,799,404 │ $24.96 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 222 │ 3,745 │ 277,739 │ 2,540,052 │ 2,821,758 │ $9.30 │ │ 06-19 │ │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 222 │ 3,745 │ 277,739 │ 2,540,052 │ 2,821,758 │ $9.30 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 104 │ 10,919 │ 183,313 │ 2,538,267 │ 2,732,603 │ $8.07 │ │ 06-20 │ │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 104 │ 10,919 │ 183,313 │ 2,538,267 │ 2,732,603 │ $8.07 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 175 │ 3,069 │ 435,885 │ 5,930,001 │ 6,369,130 │ $16.86 │ │ 06-21 │ - sonnet-4 │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 153 │ 2,885 │ 410,815 │ 5,885,429 │ 6,299,282 │ $16.75 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ sonnet… │ │ 22 │ 184 │ 25,070 │ 44,572 │ 69,848 │ $0.11 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 5,270 │ 31,793 │ 1,458,201 │ 30,679,474 │ 32,174,738 │ $40.18 │ │ 06-22 │ - sonnet-4 │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 588 │ 17,584 │ 551,102 │ 13,073,238 │ 13,642,512 │ $31.27 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ sonnet… │ │ 4,682 │ 14,209 │ 907,099 │ 17,606,236 │ 18,532,226 │ $8.91 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 76 │ 4,567 │ 142,662 │ 628,177 │ 775,482 │ $0.96 │ │ 06-23 │ - sonnet-4 │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ sonnet… │ │ 72 │ 4,471 │ 131,957 │ 628,177 │ 764,677 │ $0.75 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 4 │ 96 │ 10,705 │ 0 │ 10,805 │ $0.21 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 1,225 │ 39,352 │ 911,099 │ 12,656,617 │ 13,608,293 │ $33.75 │ │ 06-24 │ - sonnet-4 │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 1,061 │ 36,264 │ 688,352 │ 11,191,844 │ 11,917,521 │ $32.43 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ sonnet… │ │ 164 │ 3,088 │ 222,747 │ 1,464,773 │ 1,690,772 │ $1.32 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 130 │ 5,241 │ 56,485 │ 1,458,747 │ 1,520,603 │ $3.64 │ │ 06-25 │ │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 130 │ 5,241 │ 56,485 │ 1,458,747 │ 1,520,603 │ $3.64 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 147 │ 1,911 │ 99,032 │ 361,972 │ 463,062 │ $2.55 │ │ 06-26 │ │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 147 │ 1,911 │ 99,032 │ 361,972 │ 463,062 │ $2.55 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 576 │ 8,366 │ 279,413 │ 2,500,153 │ 2,788,508 │ $7.81 │ │ 06-27 │ - sonnet-4 │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 510 │ 8,221 │ 189,691 │ 2,114,478 │ 2,312,900 │ $7.35 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ sonnet… │ │ 66 │ 145 │ 89,722 │ 385,675 │ 475,608 │ $0.45 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 3,824 │ 72,580 │ 1,538,457 │ 33,317,710 │ 34,932,571 │ $84.32 │ │ 06-28 │ │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 3,824 │ 72,580 │ 1,538,457 │ 33,317,710 │ 34,932,571 │ $84.32 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 2,561 │ 96,092 │ 2,470,065 │ 78,254,705 │ 80,823,423 │ $170.94 │ │ 06-29 │ │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 2,561 │ 96,092 │ 2,470,065 │ 78,254,705 │ 80,823,423 │ $170.94 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ 2025 │ - opus-4 │ 932 │ 42,615 │ 782,560 │ 12,554,185 │ 13,380,292 │ $36.71 │ │ 06-30 │ │ │ │ │ │ │ │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ └─ opus-4 │ │ 932 │ 42,615 │ 782,560 │ 12,554,185 │ 13,380,292 │ $36.71 │ ├──────────────┼───────────────────┼──────────┼──────────┼──────────────┼─────────────┼──────────────┼────────────┤ │ Total │ │ 23,986 │ 489,910 │ 13,996,700 │ 265,550,345 │ 280,060,941 │ $598.51 │ └──────────────┴───────────────────┴──────────┴──────────┴──────────────┴─────────────┴──────────────┴────────────┘ ``` --- # 2025-06 # 2025-06-12 - [obsidian.nvimとquartzでメモをブログにした](https://tkancf.com/blog/obsidian-nvim-and-quartz-blog) - 書いた # 2025-06-15 - Claude Code MAX契約した - とりあえず1ヶ月試しまくる - [MaxプランでClaude Codeを試した](https://tkancf.com/blog/testing-claude-code-max) - [tkancf/telescope-markdown-frontmatter.nvim](https://github.com/tkancf/telescope-markdown-frontmatter.nvim) を作った # 2025-06-22 - [narrowing-nvimを作った](https://tkancf.com/blog/built-narrowing-nvim) - [tkancf/narrowing-nvim](https://github.com/tkancf/narrowing-nvim) を作った - Emacsにnarrowingという機能があって、Org-modeを使っていた頃にかなり多用していた - [chrisbra/NrrwRgn](https://github.com/chrisbra/NrrwRgn) というVimプラグインがあって、欲しい機能は概ね満たしていたがかなり古くてNeovimのfloating windowなどには対応していない - floating windowに対応して欲しい機能を追加することと合わせて、luaプラグインにするため自作した # 2025-06-24 - [tmuxで現在のディレクトリ名をwindow名にする設定](https://tkancf.com/blog/tmux-window-name-from-directory) ``` # ウィンドウ名の自動リネームを有効にする set-window-option -g automatic-rename on # ウィンドウ名のフォーマットを設定(ディレクトリ名のみ表示) set-window-option -g automatic-rename-format '#{b:pane_current_path}' ``` # 2025-06-27 - 7月に忙しそうな気配を感じる - narrowing-nvimのfoldがバグってたので修正した # 2025-06-28 - 昼過ぎまでずっと寝てた # 2025-06-29 - memd作る # 2025/06/30 - [AWS Certificate Manager がどこでも使用できるエクスポート可能なパブリック SSL/TLS 証明書を導入 | Amazon Web Services ブログ](https://aws.amazon.com/jp/blogs/news/aws-certificate-manager-introduces-exportable-public-ssl-tls-certificates-to-use-anywhere/) - 読んだ - 良さそう - [GitHub - textlint-ja/textlint-rule-preset-ai-writing: textlintプリセット:AIっぽい記述パターンを検出し、より自然な日本語表現を促すルール集](https://github.com/textlint-ja/textlint-rule-preset-ai-writing) - 良い - [claude CodeをMAXプランで試した](https://tkancf.com/blog/testing-claude-code-max) - 追記 - [Vimで:messagesの内容をコピーする方法](https://tkancf.com/blog/vim-copy-messages-output) --- # 2025-05 # 2025/05/23 - [Introducing Claude 4 \ Anthropic](https://www.anthropic.com/news/claude-4) - claude 4が出てた - [Introducing Claude 4 in Amazon Bedrock, the most powerful models for coding from Anthropic | AWS News Blog](https://aws.amazon.com/jp/blogs/aws/claude-opus-4-anthropics-most-powerful-model-for-coding-is-now-in-amazon-bedrock/) - bedrockでも使えるみたい - 試してみたいね - [Mozillaが後で読むサービスの「Pocket」とAIでサクラレビューを検出する「Fakespot」の終了を発表、データが消えるのでエクスポートの必要あり - GIGAZINE](https://gigazine.net/news/20250523-mozilla-pocket-fakespot/) - まじかー、Omnivoreも終わったし、気に入ったサービス終わっちゃうの悲しい。移行どうしようかな # 2025/05/21 - [Anthropic の Claude 3.7 Sonnet が Amazon Bedrock で利用可能に - AWS](https://aws.amazon.com/jp/about-aws/whats-new/2025/02/anthropics-claude-3-7-sonnet-amazon-bedrock/) - 読んだ > Claude 3.7 Sonnet は、米国東部 (バージニア北部)、米国東部 (オハイオ)、米国西部 (オレゴン) の各リージョンの Amazon Bedrock でご利用いただけます。 東京リージョンないの知らずに今日詰まった # 2025/05/19 - [Clineで自社製品のMCPサーバーを作って遊んでみた](https://zenn.dev/dreamarts/articles/9300bc0436d945) - 読んだ # 2025/05/18 - 今日も暑かった - 5月なのに30度だって # 2025/05/17 - 今日、蒸し暑かったー - [第245回 MySQL 9.2と9.3の新機能について | gihyo.jp](https://gihyo.jp/article/2025/05/mysql-rcn0245) - 読んでる # 2025/05/16 - くら寿司行ってきた - にじさんじコラボしてたので - 20皿でびっくらぽん一回も当たらなかったの残念😢 - 課金びっくらぽんしかダメなのかもしれん # 2025/05/15 - [mini.nvimの新モジュールmini.keymapで決めろマルチステップコンボ](https://zenn.dev/vim_jp/articles/9a89ecb5ff14a9) - あとで読む # 2025-05-14 - [《「占星術師」の天球儀》](https://x.com/DimirUB/status/1922056885936492945) - 青単デルバーで使いたい - フェアリーの荒らし屋と入れ替えかな - とりあえず3枚買った - スプライトのドラゴンに近いけど、飛んでないのと、速攻がない代わりに、これ自身が重なっても誘発するのと、ブレストで2個カウンター乗るのは強く使えそう # 2025-05-13 - Volcanic Island届いた!!!! - ![Volcanic Island](https://i.gyazo.com/thumb/3024/00e11a036e0065632581221f8d26b253-heic.jpg) - 最高だ。これだけで酒が飲めるし仕事も頑張れる - [当エンジニアブログで実施したアクセシビリティ改善の方法についての解説](https://tech.plaid.co.jp/how-we-improved-the-accessibility-of-our-engineer-blog) - 読んでる - [初めてNeovimをプラグインを作った話](https://zenn.dev/vim_jp/articles/d582e0d55bceab) - 読んだ - [https://blog.cloudflare.com/introducing-the-cloudflare-vite-plugin/](https://blog.cloudflare.com/introducing-the-cloudflare-vite-plugin/) - 読んだ - [Universe expected to decay in 10⁷⁸ years, much sooner than previously thought](https://phys.org/news/2025-05-universe-decay-years-sooner-previously.html) - 読んでる - これまでは10^1100年だったのが、10^78年に短くなった説らしい # 2025-05-12 - メールのエラー系の問題、要因が多くて難しいな〜の気持ち - ボルカ一枚でいい感じになるレガシーデッキ考えるのおもろい # 2025-05-10 - コウのアイシーが公開されてる!! - 卯月コウを知った時にはもう非公開だったから、ずっと気になってたけど聴く方法がなかった曲なので嬉しい - Volcanic Islandついに買ってしまった - Volcanic Island リバイズド フランス語 ヘビーレア - ¥71,820 - かなり安く買えたと思う # 2025-05-07 - [PR TIMES、不正アクセスによる情報漏えいの可能性に関するお詫びとご報告 | 株式会社PR TIMESのプレスリリース](https://prtimes.jp/main/html/rd/p/000001531.000000112.html) - 読んだ # 2025-05-04 - 朝から味噌汁出汁とって作った。偉すぎ > 関係ない (ちょっとある) けど、Qiitaが記事のURL末尾に .md をつけると Markdown を返してくれたり、GitHub の Pull Request の URL 末尾に .diff をつけると diff を返してくれるのめっちゃ好き > > > 個人的には pull-req の URL 末尾に .patch を付けて > > > > $ curl -s https​://github.com/.../295.patch | git am > > > > するのが好き。 from: https://x.com/mattn_jp/status/1918687721444217124 - これ知らなかった。便利だ --- # obsidian.nvimとquartzでメモをブログにした ## メモの取り方 - 以前はObsidianで取っていた - Obsidianの機能に近いものが使えるobsidian.nvimというNeovimプラグインがあり、最近はこれでメモを取ってる - Obsidianより機能は少ないが、Neovimで使えるのが一番の利点 - 使い慣れたNeovimのプラグインが使えるのはでかい - Obsidianを使っているとObsidianの独自記法 (query, tasks, 埋め込み etc...) が便利 - 便利な一方で可搬性のあるMarkdownという利点が失われてしまうのが気になってしまった ## ブログ記事の管理方法 - メモとブログ記事のMarkdownは完全に分けて管理していた - メモとブログ記事を一緒にすればアウトプットの障壁が減らせそうなので、統合してみた - 現状はいい感じ - アウトプットの閾値イメージとしてはTwitterぐらいの感覚 - 毎月YYYY-MM.mdを用意して、そこに日記みたいなメモを書いてる ## ブログ記事の生成 - 以前まではブログの生成は[HonoのSSGを利用して自作したプログラム](https://tkancf.com/blog/blog-migration-astro-to-hono)でやっていた - よく動いてくれていたが、 [quartz](https://quartz.jzhao.xyz/)を見つけた - quartzはObsidianのメモをほぼそのまま公開することができるSSG - メモをほぼそのまま公開するのであれば、自作のものより良さそうだったので乗り換えた - 現状は気に入っている --- # obsidian.nvimのfork obsidian-nvim/obsidian.nvim について obsidian.nvimという、Neovim上でObsidianのような機能を提供するプラグインがあります。 めちゃくちゃ便利なプラグインで愛用してるんですが、本家のリポジトリ([epwalsh/obsidian.nvim](https://github.com/epwalsh/obsidian.nvim))の更新が2024/08/02から止まっていました。 IssueやPRが溜まっていることからコミュニティフォークという形で[obsidian-nvim/obsidian.nvim](https://github.com/obsidian-nvim/obsidian.nvim)が生まれ、本家で取り込まれず溜まっていたいくつかのPRがマージされていたので少し経緯を追ってみました。 ## 本家との差分 今日(2025/03/06)時点でのPRでマージされた中で、移行判断の要因になりそうなものは以下2つです。 - [feat(completion): blink.cmp support by guspix · Pull Request #5 · obsidian-nvim/obsidian.nvim](https://github.com/obsidian-nvim/obsidian.nvim/pull/5) - blink.cmpのサポート - [blink.nvimでobsidian.nvimの補完を利用する方法](https://tkancf.com/blog/blink-nvim-with-obsidian-completion)の設定でも可能でしたが、obsidian.nvimプラグイン側でサポートされます。 - [implementing snack picker by guspix · Pull Request #4 · obsidian-nvim/obsidian.nvim](https://github.com/obsidian-nvim/obsidian.nvim/pull/4) - [snacks.nvim](https://github.com/folke/snacks.nvim)のpickerサポート - telescope.nvim, fzf-lua, Mini.Pickのみのサポートでしたが、新たにsnacks.nvimを利用できます。 - 個人的にはこれが移行の理由になります。 ## コミュニティフォークまでの経緯 コミュニティフォークが生まれる起因になったIssueは下記です。 [Community fork | Looking for maintainers? · Issue #820 · epwalsh/obsidian.nvim](https://github.com/epwalsh/obsidian.nvim/issues/820) IssueとPRが溜まっていることから、メンテナの追加を提案していますが、epwalshから応答がないのでフォークして進めるということになった経緯みたいです。 epwalshに対してすごい敬意をもって進めている感じがあるので、嫌な感じは全然しないですね。 OSSのモチベーション維持は大変みたいな話はよく聞くので、人気のOSSを維持するのは大変なんだろうな〜と思います。 ## コミュニティフォークの今後の話 今後については、下記Discussionで議論されています。 [Vision for the project, reasons for forking and next steps · obsidian-nvim/obsidian.nvim · Discussion #6](https://github.com/obsidian-nvim/obsidian.nvim/discussions/6) まだforkされたばかりなので未定みたいですが、元のリポジトリでオープンなままのPRを取り込んだりを検討してるみたいです。 --- # 2025-03 # 2025-03-17 # 2025/03/12 - 今日から会社だと思って出勤したら明日からだった --- # homebrew管理のアプリを整理した Macの容量が心もとないのと、最近はツールをなるべくmise管理にしたいので ## 初期状態 `brew info`コマンドで使用料が確認できる ```sh ❰tkan❙~❱✔≻ brew info 181 kegs, 118,165 files, 5.6GB ``` ## brew upgrade `brew upgrade`実行で各アプリアップデートする 実行時に`brew cleanup`も実行される > upgrade [options] [installed_formula|installed_cask ...] > Upgrade outdated casks and outdated, unpinned formulae using the same options they were originally installed with, plus any appended brew formula options. If cask or > formula are specified, upgrade only the given cask or formula kegs (unless they are pinned; see pin, unpin). > > Unless $HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK is set, brew upgrade or brew reinstall will be run for outdated dependents and dependents with broken linkage, > respectively. > > Unless $HOMEBREW_NO_INSTALL_CLEANUP is set, brew cleanup will then be run for the upgraded formulae or, every 30 days, for all formulae. ```sh ❰tkan❙~❱✔≻ brew upgrade ==> Upgrading 49 outdated packages: git-lfs 3.6.0 -> 3.6.1 . . . ``` ↓`brew upgrade`実行後 0.6GB減少した ```sh ❰tkan❙~❱✘≻ brew info 182 kegs, 103,829 files, 5.0GB ``` ## 不要なアプリの削除 41個からかなり減らした ```sh ❰tkan❙~❱✔≻ brew leaves -r chezmoi curl fish git itchyny/tap/mmv mise openjdk openssl@1.1 rconroy293/seventeenlands/seventeenlands tmux trash wget ``` 4GB近く減少した ```sh ❰tkan❙~❱✔≻ brew info 57 kegs, 42,800 files, 997.9MB ``` ## 不要なcaskの削除 `brew list --cask`で確認後、不要なものを削除 ```sh ❰tkan❙~❱✔≻ brew info 54 kegs, 42,722 files, 993.7MB ``` --- # curlでJSONを簡単に送れるようになったらしいので試した 知ったきっかけ↓

curlでJSONを簡単に送れるようになったと聞いて。 pic.twitter.com/5KIYAmjgZm

— うらがみ⛄ (@backpaper0) February 22, 2025
## `--json`オプションについて 以下manページから引用 要するにheaderオプションとかを設定してくれるショートカット的なオプションらしい > --json > (HTTP) Sends the specified JSON data in a POST request to the HTTP server. --json works as a shortcut for passing on these three options: > > --data [arg] > --header "Content-Type: application/json" > --header "Accept: application/json" ## 実際に試してみる goで簡単なAPIを作ってcurlでPOSTリクエストを送ってみる ```go package main import ( "log" "fmt" "encoding/json" "github.com/gofiber/fiber/v2" ) type RequestData struct { Name string `json:"name"` Message string `json:"message"` } type ResponseData struct { Status string `json:"status"` Message string `json:"message"` } func main() { app := fiber.New(fiber.Config{ JSONEncoder: json.Marshal, JSONDecoder: json.Unmarshal, }) app.Post("/api", handlePost) log.Fatal(app.Listen(":8000")) } func handlePost(c *fiber.Ctx) error { var request RequestData if err := c.BodyParser(&request); err != nil { return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{ "error": "Failed to parse request body", }) } response := ResponseData{ Status: "success", Message: fmt.Sprintf("Name: %s Message: %s", request.Name, request.Message), } return c.JSON(response) } ``` いい感じ ```sh ❰tkan❙~/src/github.com/tkancf/json-test❱✔≻ curl --json '{"name":"tkancf", "message":"こんにちは"}' localhost:8000/api {"status":"success","message":"Name: tkancf Message: こんにちは"}⏎ ``` ## いつの間に増えたのか - リリースノート: [curl - Changes in 7.82.0](https://curl.se/ch/7.82.0.html) - Changes in 7.82.0 - 該当のPR: [curl --json by bagder · Pull Request #8314 · curl/curl](https://github.com/curl/curl/pull/8314) - 2年以上前のリリースだった --- # このサイトでllms-full.txtを出力するようにした このサイト (https://tkancf.com/) でllms-full.txtを出すようにしました。https://tkancf.com/llms-full.txt からアクセス可能です。 ## llms.txt、llms-full.txtについて [The /llms.txt file – llms-txt](https://llmstxt.org/)に詳しいです。 ざっくり説明だと、llms.txtにサイト・コンテンツの概要、リンク集を用意。llms-full.txtにサイトの全コンテンツを用意してLLMで便利に使おうよってルールです。 ## 理由 ブログのデータを[Google NotebookLM](https://notebooklm.google.com/)、などに丸っと取り込んで活用できたら便利かな〜というのと、今後AIツールが増えていったときにペラ一のデータで存在していたほうが入力しやすいという状況が発生する機会が増えそうという予測で追加してみました。 ## 実装 このPRで[Add llms-full.txt by tkancf · Pull Request #58 · tkancf/tkancf.com](https://github.com/tkancf/tkancf.com/pull/58/files)追加しています。 現状、このサイトは[quartz](https://quartz.jzhao.xyz/)を使って作ってるんですが、そのquartzのビルドスクリプト内でllms-full.txtを生成してtxt形式で保存しているだけです。 ## お気持ち 各サイトでのスタンダードになったら、LLMへの情報入力で便利そうなので流行って欲しいな〜という気持ちです。 ## 参考 - [The /llms.txt file – llms-txt](https://llmstxt.org/) - [このサイトで llms-full.txt を提供し始めた | Hirotaka Miyagi](https://www.mh4gf.dev/articles/llms-full-txt) --- # snacks.nvimを試したらいい感じ 便利なNeovimプラグインの詰め合わせセット的なプラグインのsnacks.nvimを試しました。 詰め合わせセットですが、部分的に導入することが可能なので「何を入れたのかよく分からなくてモヤモヤする」みたいな状況になりづらくなっています。 各プラグインの完成度がとても高く便利なのでかなりおすすめです。 私は個人的にpickerとScratch bufferで心を掴まれました。 含まれているプラグインの一覧は[snacks.nvimのREADME](https://github.com/folke/snacks.nvim)を見たほうが良いと思うので、個人的に試して良かったプラグインとその推しポイントを紹介します。 ## [picker](https://github.com/folke/snacks.nvim/blob/main/docs/picker.md) ![pickerの画像](https://gyazo.com/639a3c1cf01260d97d8f2837e563fbc9.jpeg) fuzzy finderです。Neovimのfuzzy finderには、他にもtelescope.nvim、fzf-luaなど沢山あるのでどれを選ぶかは好みになってくるんですが、私はsnacks.nvimのpickerが好みでした。 今まではtelescope.nvimを利用していたんですが、デフォルトで提供されているソースの見た目が私好みでした。 - 見た目の違い - telescope.nvimのcommand_history - ![telescope.nvimのcommand_history](https://gyazo.com/950d534520951ef64497fff3f8eb3de0.jpeg) - snacks.nvim pickerのcommand_history - ![snacks.nvim pickerのcommand_history](https://gyazo.com/8961a742d06f8d4dab73f1f37bb9925c.jpeg) 見た目以外の部分では、snacks.nvimの[bufdelete](https://github.com/folke/snacks.nvim/blob/main/docs/bufdelete.md)との組み合わせでバッファの絞り込み画面から、`dd`とするだけでバッファの削除が可能です。 これまでの`:bd`を連打していた生活からはおさらばできそうです。 ![snacks.nvimのbufdelete](https://i.gyazo.com/d3204992c64085056a82269571c5e336.gif) ## [explorer](https://github.com/folke/snacks.nvim/blob/main/docs/explorer.md) ファイルエクスプローラーです。 個人的にはこれまでoil.nvimを使っていて、不満は無いんですがファイルエクスプローラーに絞り込み機能が付属しているのは今まで見たことが無かったので紹介します。(私が知らないだけで、他プラグインもあるかもしれないです) 下記のようにファイルエクスプローラーに絞り込み機能がついており、検索文字をファイル名に含むものだけ一覧表示可能です。 変わらずメインはoil.nvimを使うつもりですが、用途ごとに使い分けるのも良さそうだなと思っています。 ![snacks.nvimのexplorer](https://gyazo.com/32d0cb1e95d6101669b209e21f114a61.jpeg) ## [indent](https://github.com/folke/snacks.nvim/blob/main/docs/indent.md) 現在のインデントの深さに対応して線を引いてくれるプラグインです。 この手のプラグイン、なんとなく入れたことが無かったんですが、有効にするだけなら敷居が低いので入れてみました。入れてみたらめっちゃ便利ですね。 デフォルトだと線が描画されるときにアニメーションが入ってオシャレなんですが、個人的にはさっさと描画されて欲しいのでOFFにしています。 ```lua opts = { indent = { enabled = true, animate = { enabled = false } } } ``` ![snacks.nvimのindent](https://gyazo.com/1968dd50e22f6c05f19638bcd4b04f24.jpeg) ## [lazygit](https://github.com/folke/snacks.nvim/blob/main/docs/lazygit.md) Neovim上でLazygitを触れるようにするプラグインです。 Neovimのカラースキームで起動してくれます。オシャレ!! ![snacks.nvimのlazygit](https://gyazo.com/b3d361058206c578c863e3ef5fca2d7d.jpeg) ## [scratch](https://github.com/folke/snacks.nvim/blob/main/docs/scratch.md) 現在開いているディレクトリをベースに、ちょっとしたコードやメモを書いておくことが出来て、luaのコードならそのまま実行ができます。 ちょっとNeovimの設定用にlua関数試してみるか...とかやってるときにかなり便利です。 ![snacks.nvimのscratch](https://gyazo.com/b90c07663e5023053341a96f90a12c32.jpeg) --- # blink.nvimでobsidian.nvimの補完を利用する方法 obsidian.nvimではリンク先ファイルの補完にnvim-cmpの補完ソースを提供していて、それ以外の保管ソースは用意されていません。 ただ、blink.nvimでは、`saghen/blink.compat`を利用する事でnvim-cmp補完ソースを使えるので、obsidian.nvimの補完が使えます。 どう設定すれば良いかわからず、しばらく試行錯誤したのでメモとして置いておきます。 ## 設定例 最終的に下記設定にすれば、いい感じになります。 ```lua return { { 'saghen/blink.cmp', version = false, dependencies = { { "rafamadriz/friendly-snippets" }, { "saghen/blink.compat", lazy = true, version = false }, { "https://github.com/epwalsh/obsidian.nvim" }, }, ---@module 'blink.cmp' ---@type blink.cmp.Config opts = { -- 'default' for mappings similar to built-in completion -- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate) -- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept -- See the full "keymap" documentation for information on defining your own keymap. keymap = { preset = 'super-tab' }, completion = { list = { selection = { preselect = false, auto_insert = false } } }, appearance = { -- Sets the fallback highlight groups to nvim-cmp's highlight groups -- Useful for when your theme doesn't support blink.cmp -- Will be removed in a future release use_nvim_cmp_as_default = true, -- Set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font' -- Adjusts spacing to ensure icons are aligned nerd_font_variant = 'mono' }, -- Default list of enabled providers defined so that you can extend it -- elsewhere in your config, without redefining it, due to `opts_extend` sources = { default = { "obsidian", "obsidian_new", "obsidian_tags", "lsp", "path", "snippets", "buffer" }, providers = { obsidian = { name = "obsidian", module = "blink.compat.source", }, obsidian_new = { name = "obsidian_new", module = "blink.compat.source", }, obsidian_tags = { name = "obsidian_tags", module = "blink.compat.source", }, }, }, }, opts_extend = { "sources.default" } } } ``` `saghen/blink.compat` をdependenciesに入れて、sourcesのprovidersにobsidianのソースを定義、それをsources.defaultに入れてあげればOKでした。 [obsidian.nvimのこのIssue](https://github.com/epwalsh/obsidian.nvim/issues/770)にQ&Aと関連する修正commitが入っています。 ## 試行錯誤メモ - [blink.nvimでobsidian.nvimの補完を利用する](https://note.tkancf.com/20250110153217) ## 参考資料 - [Support blink.nvim Autocomplete · Issue #770 · epwalsh/obsidian.nvim](https://github.com/epwalsh/obsidian.nvim/issues/770) - [dotfiles/.config/nvim/lua/plugins/blink.lua at edae7c4933300faf024b6cf6585085351840bba1 · rbmarliere/dotfiles](https://github.com/rbmarliere/dotfiles/blob/edae7c4933300faf024b6cf6585085351840bba1/.config/nvim/lua/plugins/blink.lua) --- # 2024年の振り返り もう2月なんですが、振り返ります。 ## 作ったもの・書いたもの等 [はてなブックマークからOmnivoreに移行するためのツールを作ったり](https://zenn.dev/tkancf/articles/c323bf1c64eafb)、[ブログをAstroからHonoのSSGに移行したり](https://tkancf.com/blog/blog-migration-astro-to-hono)と色々やれてました。 5月中頃に妻の妊娠が分かり、それ以降バタバタしていたら何もできなくなってしまったのが残念ですが、12月に無事に産まれたのでもう少し育児が落ち着いたら色々と再開したいと思います。 ### GitHub 下記が2023年の草 ![GitHub Contribution 2023](https://gyazo.com/1cbdc29b57b91024b1ff8b1fc21d465e.jpeg) そして、これが今年(2024年)の草です。 ![GitHub Contribution 2024](https://gyazo.com/0dfc2849822cb089a26558e46083ecd2.jpeg) 前半に頑張りを感じますが、後半の失速具合がすごいですね。 ## 仕事 子供が生まれたら育休に入りたいということで引き継ぎをする必要があり、12月前は過去最高に忙しかったです。 育休に入るのとあわせて、現チームのマネージャーを引き継いで異動希望を出していた別部署への移籍もすることになったので、てんやわんやでした。 久々にマネージャー職から離れて、手を動かす仕事の比率が増えそうなので、気合い入れてやっていこうと思います。 ## プライベート ### イベント 大きなイベントとして、今年は12月に子供が産まれました。 色々と分からんことだらけで困ったりしてますが、会社も快く育休取らせてくれたりと環境には恵まれていると思ってるので頑張りたいですね。 最初の1ヶ月はドッタンバッタン大騒ぎって気持ちでしたが、2ヶ月過ぎてから少し落ち着いてきた気がします。 子育て、なんとなく障害対応に似てる気がするのでバタバタしてるときは、やばいアラート発生したな!って思いながら対応してます。 初めて💩が膝に飛んだときのCRITICALアラート感すごかったです。(今は慣れました。) ### 生活 仕事の残業時間が多い月が増えていた事もあってスーパーの惣菜で終わりみたいな日が多めでした。 12月以降はほぼ毎日自炊出来てるのでいい感じです。クラシルのYouTubeは神。 あともうちょっとだけ、運動量増やしたいです。 概ね健康に生きれたので、継続したいですね。 ### 趣味 Magic: The Gatheringをしてました。 ついにレガシーに手を出してしまい、緑ポストと青単デルバーを組んでしまいました。 いつかデュアランドに手を出してしまいそうで怖いですよ。 2025年はもっとリミテッドやりたいな〜と思っています。 ## 2025年の目標 下記はやりたいなと思っています。 - ブログ書く量を増やす - 子育て頑張る - 筋トレを継続してやる 引き続きよろしくお願いします。 --- # 2025-02 # 2025/02/23 - なんかしばらくObsidianの同期が壊れてたな # 2025-02-15 - Neovimのキーマップ一覧をツリー状で見れるプラグインほしい # 2025/02/06 ## ブログもquartzにしてみる ```bash ❰tkan❙~/src/github.com/tkancf❱✔≻ git clone https://github.com/jackyzha0/quartz.git Cloning into 'quartz'... remote: Enumerating objects: 10425, done. remote: Counting objects: 100% (8/8), done. remote: Compressing objects: 100% (8/8), done. remote: Total 10425 (delta 1), reused 0 (delta 0), pack-reused 10417 (from 2) Receiving objects: 100% (10425/10425), 9.06 MiB | 8.32 MiB/s, done. Resolving deltas: 100% (6613/6613), done. ``` ```bash ❰tkan❙~/src/github.com/tkancf❱✘≻ cp -a quartz/Dockerfile quartz/globals.d.ts quartz/index.d.ts quartz/package-lock.json quartz/package.json quartz/quartz quartz/quartz.config.ts quartz/quartz.layout.ts quartz/README.md quartz/tsconfig.json tkancf.com/ ❰tkan❙~/src/github.com/tkancf❱✔≻ cd tkancf.com/ ``` # 2025/02/05 - [GitHub - bodo-run/yek: A fast tool to read text-based files in a repository or directory, chunk them, and serialize them for LLM consumption.](https://github.com/bodo-run/yek)気になる - [Clineを利用した開発が超快適なので、使っている.clinerulesを解説します](https://zenn.dev/berry_blog/articles/c72564d4d89926)読んだ # 2025-02-02 - [Abacus.AI - Effortlessly Embed Cutting Edge AI In Your Applications.](https://abacus.ai/) のChatLLMを試してみる - まずは1ヶ月 - [lazygit/docs/Custom_Pagers.md at master · jesseduffield/lazygit · GitHub](https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Pagers.md) - `delta --dark --paging=never --line-numbers --hyperlinks --hyperlinks-file-link-format="lazygit-edit://{path}:{line}"` - lazygit慣れてきて良い感じになってきた - [【MTGレガシー】青単デルバー目線のクリーチャー選択|ユウシ](https://note.com/yushi_mtg/n/n667d8e1bb3e7) # 2025-02-01 - [uDesktopMascot v0.1.0 - MidraLab Shop - BOOTH](https://booth.pm/ja/items/6488588) - 面白そうなので、入れてみる --- # image.nvimのセットアップ Neovimで画像表示するために、image.nvimを使いたいのでその設定方法 参考: https://andrewcourter.substack.com/p/render-images-inside-neovim-and-tmux ## imagemagicのインストール ```bash brew install imagemagick ``` ## asdfのインストール ```bash brew install asdf ``` ## lua5.1のインストール ```bash asdf plugin-add lua https://github.com/Stratus3D/asdf-lua.git asdf install lua 5.1 echo "lua 5.1" >> ~/.tool-versions ``` ```bash ❯ cat ~/.tool-versions lua 5.1 ``` ```bash ❯ luarocks --local --lua-version 5.1 install magick Installing https://luarocks.org/magick-1.6.0-1.src.rock magick 1.6.0-1 is already installed in /Users/tkan/.luarocks Use --force to reinstall. ``` ## お試し https://github.com/3rd/image.nvim/blob/master/minimal-setup.lua から、最小設定ファイルをダウンロードしてきて、下記コマンドを実行 ```bash nvim --clean -c ":luafile minimal-setup.lua" ``` 画像表示された! ## 設定追加 ```lua { "vhyrro/luarocks.nvim", priority = 1001, -- this plugin needs to run before anything else opts = { rocks = { "magick" }, }, }, { "3rd/image.nvim", config = function() require("image").setup({ backend = "kitty", integrations = { markdown = { enabled = true, clear_in_insert_mode = false, download_remote_images = true, only_render_image_at_cursor = false, filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here resolve_image_path = function (document_path, image_path, fallback) return fallback(document_path, image_path) end }, html = { enabled = false, }, css = { enabled = false, }, }, max_width = nil, max_height = nil, max_width_window_percentage = nil, max_height_window_percentage = 50, window_overlap_clear_enabled = false, -- toggles images when windows are overlapped window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" }, editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off) hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened }) end } ``` --- # homeshickを試す homeshickはdotfiles管理ツール 試していたけど、途中で[chezmoiを改めて試す](https://tkancf.com/blog/trying-chezmoi-again)をやり始めて、感触が良かったのでchezmoiでの管理に落ち着いた。 ## 公式のInstallationに従ってインストール - https://github.com/andsens/homeshick/wiki/Installation - 環境変数の設定、補完の設定とかもここに記載がある ## とりあえずhelp ```bash ❯❯ ~ ❯ homeshick --help homeshick uses git in concert with symlinks to track your precious dotfiles. Usage: homeshick [options] TASK Tasks: homeshick cd CASTLE # Enter a castle homeshick clone URI.. # Clone URI as a castle for homeshick homeshick generate CASTLE.. # Generate a castle repo homeshick list # List cloned castles homeshick check [CASTLE..] # Check a castle for updates homeshick refresh [DAYS [CASTLE..]] # Refresh a castle at regular intervals homeshick pull [CASTLE..] # Update a castle homeshick link [CASTLE..] # Symlinks all dotfiles from a castle homeshick track CASTLE FILE.. # Add a file to a castle homeshick help [TASK] # Show usage of a task Aliases: ls # Alias to list symlink # Alias to link updates # Alias to check Runtime options: -q, [--quiet] # Suppress status output -s, [--skip] # Skip files that already exist -f, [--force] # Overwrite files that already exist -b, [--batch] # Batch-mode: Skip interactive prompts / Choose the default -v, [--verbose] # Verbose-mode: Detailed status output Note: To check, refresh, pull or symlink all your castles simply omit the CASTLE argument ``` " vim: foldmethod=marker foldlevel=1 --- # chezmoiを改めて試す 昔使ってたけど、あまりちゃんと使えてなかったと思うので改めて しばらくyadmを使っていたけど、fish shellでyadmの補完がおかしい事象があったので代わりを探してみている ## 現状のdotfilesから以降 `.config`→`dot_config` といった形で、chezmoiのファイル名ルールに合わせて変更 https://github.com/tkancf/dotfiles/commit/9501b59ad323528b0dded6b3c5ea6d5eac69e80d これでほぼほぼ終わった ## READMEがデプロイされると微妙なので除外 `.chezmoiignore`ファイルを作成して、README.mdを追加 https://github.com/tkancf/dotfiles/commit/9b9f404aa0a3f8b2e77471834b2f0f6da0751f03 ほぼほぼこれで完成かな --- # luaのソースコードから、コメントを読み取ってドキュメントを生成するツールについて調べる ## 感想メモ - Emacsのorg-modeでtangleして、ドキュメントを生成するのと似た感じで、Luaのソースコードからドキュメントを生成できるかな〜と思ったけど、あれはorg-modeの中に書いたコメントを実行しつつ抽出できるから便利だったので、LDocはそこまで便利ではないかもしれない - README.mdに書いたコメントを抽出して、ドキュメントを生成するのは便利かもしれないけど、それをやると、luaの補完が効かないのが難点になりそう - ちょっと思っていたのと違ったので、今回はここまで ## Feloで調べる > Luaのソースコードからコメントを読み取ってドキュメントを生成するツールには、主に**LuaDoc**と**LDoc**があります。 > > ### **LuaDoc** > > - **概要**: LuaDocはLuaソースコード用のドキュメント生成ツールで、ソースファイル内の宣言やドキュメントコメントを解析し、XHTML形式のドキュメントを生成します。LuaDocは、Lua 5.1に対応しており、自由にカスタマイズ可能なドキュメントコメントの形式を提供します[1][2]。 > > - **機能**: LuaDocは、他のフォーマットも生成できるように新しいドックレットを実装することが可能です。また、LuaFileSystemやLuaLoggingといった外部パッケージに依存しています[2][4]。 > > - **現状**: ただし、LuaDocは現在では古くなっており、使用が推奨されていないため、代わりにLDocを使用することが勧められています[2]。 > > ### **LDoc** > > - **概要**: LDocはLuaDocと互換性のあるドキュメント生成ツールで、Markdownを使用してコメントをレンダリングすることも可能です。これにより、より柔軟で現代的なドキュメント作成が可能になります[11]。 > > - **機能**: LDocは、Luaのソースコードだけでなく、C拡張ソースも処理できるため、より広範な用途に対応しています。Markdownを利用することで、ドキュメントのスタイルを簡単に変更できる点が特徴です[11]。 > > ### **まとめ** > > Luaのソースコードからコメントを読み取ってドキュメントを生成するツールとしては、LuaDocとLDocが存在しますが、現在はLDocの使用が推奨されています。LDocは、より柔軟で使いやすいドキュメント生成を提供し、Markdownのサポートにより、現代的なドキュメント作成が可能です。 > > - [1] https://keplerproject.github.io/luadoc/ > - [2] https://github.com/keplerproject/luadoc > - [3] https://packages-picconi.debian.org/ja/sid/lua-doc > - [4] https://web.tecgraf.puc-rio.br/~tomas/luadoc/luadoc.html > - [5] http://lua-users.org/wiki/DocumentingLuaCode > - [6] https://keplerproject.github.io/luadoc/manual.html > - [7] https://devforum.roblox.com/t/moonreader-yet-another-documentation-generator/2864701 > - [8] https://www.reddit.com/r/lua/comments/pjjv76/an_early_version_of_my_documentation_generator/ > - [9] https://xn--pckzexbx21r8q9b.net/lua_tips/?luatoc > - [10] https://ja.wikibooks.org/wiki/Lua/%E3%83%81%E3%83%A5%E3%83%BC%E3%83%88%E3%83%AA%E3%82%A2%E3%83%AB > - [11] https://github.com/lunarmodules/ldoc > - [12] https://zenn.dev/yutakatay/articles/neovim-plugins-2022 > - [13] https://www.reddit.com/r/lua/comments/18h96qn/document_generator_for_lualanguageserver/ > - [14] https://ifritjp.github.io/documents/lua/ > - [15] https://stackoverflow.com/questions/12388376/how-should-i-document-a-lua-api-object-model-written-in-c-code > - [16] https://gist.github.com/voluntas/8301665 > - [17] https://qiita.com/dauuricus/items/07b576a66e2c89c7247e > - [18] https://alctail.sakura.ne.jp/contents/pg/lang/lua/ > - [19] https://umasupport.jimdofree.com/%E6%8B%A1%E5%BC%B5%E6%A9%9F%E8%83%BD/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%81%AE%E7%B7%A8%E9%9B%86/ > - [20] http://mpu.seesaa.net/article/504491087.html ## LDocを試す ### インストール ```bash luarocks install ldoc ``` ### 設定 config.ldってファイルを用意してあげると、そこに書いた設定でドキュメントを生成してくれる。 ```bash ❯❯ ~/.config/nvim ❯ cat config.ld project = "Neovim Config Documentation" title = "Documentation for Neovim Configuration" file = "." dir = "docs/nvim" format = "markdown" readme = "README.md" prettify_files = true ``` ### 生成 ```bash ldoc . ``` " vim: foldmethod=marker foldlevel=1 --- # LOG: Neovimの起動時間を見直してみる ## 計測のためにvim-startuptimeを使う [rhysd/vim-startuptime: A small Go program for better `vim --startuptime` alternative](https://github.com/rhysd/vim-startuptime) ### miseでインストール ```bash mise use -g "go:github.com/rhysd/vim-startuptime" ``` ## 初回計測 ### vim-startuptime ```bash ❯ vim-startuptime -vimpath nvim Extra options: [] Measured: 10 times Total Average: 95.994600 msec Total Max: 100.352000 msec Total Min: 92.762000 msec AVERAGE MAX MIN ------------------------------ 84.425400 88.763000 81.376000: /Users/tkan/.config/nvim/init.lua 13.132300 13.963000 12.717000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/lexima.vim 10.114550 16.261000 4.174000: require('cmp') 5.743900 6.254000 4.855000: /Users/tkan/.local/share/nvim/lazy/nvim-treesitter/plugin/nvim-treesitter.lua 5.180700 5.587000 4.388000: require('nvim-treesitter') 4.903300 5.987000 3.851000: /Users/tkan/.local/share/nvim/lazy/dial.nvim/plugin/dial.vim 4.716400 5.742000 3.654000: require('dial.map') 4.310800 4.732000 3.700000: require('nvim-treesitter.install') 4.188900 5.279000 3.238000: require('dial.command') 4.173300 5.104000 3.691000: require('cmp.core') 3.925400 5.012000 3.008000: require('dial.config') 3.711800 4.733000 2.861000: require('dial.augend') 3.711300 5.343000 2.836000: require('codecompanion') 3.630700 3.852000 3.034000: /Users/tkan/.local/share/nvim/lazy/onedark.nvim/colors/onedark.lua 3.407000 3.583000 3.271000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/plugin/vsnip.vim 3.249100 3.288000 3.214000: reading ShaDa 2.891400 3.688000 2.383000: /Users/tkan/.local/share/nvim/lazy/nvim-lspconfig/plugin/lspconfig.lua 2.855300 3.047000 2.767000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vsnip.vim 2.651800 3.156000 2.110000: require('nvim-treesitter.parsers') 2.601300 2.790000 2.514000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vsnip/session.vim 2.180000 2.931000 1.786000: require('vim.lsp') 1.957700 2.547000 1.617000: require('codecompanion.utils.log') 1.902600 1.959000 1.722000: expanding arguments 1.751900 1.852000 1.684000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/matchit.vim 1.728700 2.824000 1.326000: require('dial.augend.date') 1.660600 1.799000 1.587000: /Users/tkan/.local/share/nvim/lazy/copilot.vim/autoload/copilot.vim 1.601700 2.252000 1.284000: /Users/tkan/.local/share/nvim/lazy/nvim-cmp/plugin/cmp.lua 1.388000 1.962000 0.879000: require('vim.treesitter') 1.376200 2.080000 0.889000: require('codecompanion.config') 1.371300 1.884000 1.117000: require('plenary.async') 1.318500 1.455000 1.172000: require('lazy.view.commands') 1.252900 2.210000 0.800000: require('mini.icons') 1.215800 3.509000 0.109000: require('which-key') 1.175200 1.759000 0.990000: require('cmp.view') 1.110700 1.261000 1.004000: require('lazy.manage') 1.109700 2.109000 0.789000: require('vim.filetype') 1.107500 1.453000 0.701000: require('onedark.highlights') 1.072200 1.437000 0.911000: require('nvim-treesitter.info') 1.024900 1.383000 0.710000: require('vim.treesitter.languagetree') 0.968900 0.997000 0.914000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vsnip/snippet.vim 0.946900 1.119000 0.812000: require('lazy.core.loader') 0.931800 1.235000 0.784000: require('nvim-treesitter.configs') 0.879400 1.041000 0.762000: require('lazy.manage.runner') 0.853400 0.890000 0.817000: sourcing vimrc file(s) 0.769200 1.048000 0.632000: require('nvim-treesitter.query') 0.754800 0.952000 0.658000: require('cmp.utils.async') 0.735100 1.165000 0.566000: require('cmp.types') 0.724000 0.981000 0.592000: require('plenary.async.async') 0.696300 1.223000 0.492000: require('vim.lsp.util') 0.690600 1.059000 0.433000: require('vim.treesitter.query') 0.684300 0.732000 0.659000: inits 3 0.646700 0.823000 0.558000: require('codecompanion.providers.completion.cmp.slash_commands') 0.642400 0.696000 0.593000: require('lazy') 0.626700 0.827000 0.547000: require('cmp.config') 0.623500 0.950000 0.521000: /Users/tkan/.local/share/nvim/lazy/cmp-buffer/after/plugin/cmp_buffer.lua 0.623500 0.698000 0.520000: require('vim._defaults') 0.619500 0.818000 0.498000: require('cmp.source') 0.619000 0.871000 0.457000: /Users/tkan/.local/share/nvim/lazy/dmacro.nvim/plugin/dmacro.vim 0.606100 0.746000 0.503000: require('lspconfig.util') 0.587800 0.715000 0.476000: /Users/tkan/.local/share/nvim/lazy/denops.vim/plugin/denops.vim 0.577700 0.706000 0.428000: require('lazy.core.plugin') 0.545200 0.811000 0.395000: require('dmacro') 0.539300 0.980000 0.406000: require('vim.lsp.protocol') 0.535600 0.830000 0.450000: require('cmp_buffer') 0.524100 1.161000 0.096000: require('onedark') 0.508800 0.635000 0.411000: require('lazy.manage.task') 0.481500 0.870000 0.256000: require('onedark.colors') 0.473500 0.693000 0.376000: require('cmp.entry') 0.462100 0.564000 0.389000: require('plenary.async.tests') 0.419300 0.536000 0.286000: require('lazy.core.meta') 0.402800 0.666000 0.343000: require('cmp_buffer.source') 0.400100 0.531000 0.329000: require('codecompanion.completion') 0.394500 0.740000 0.255000: require('plenary.path') 0.386300 0.534000 0.311000: require('dial.augend.case') 0.385800 0.457000 0.348000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/lexima/insmode.vim 0.384100 0.631000 0.185000: require('oil') 0.378400 0.464000 0.289000: BufEnter autocommands 0.369500 0.415000 0.317000: require('cmp.utils.feedkeys') 0.369300 0.583000 0.287000: require('plenary.vararg') 0.366300 0.579000 0.304000: require('cmp.view.docs_view') 0.360900 0.454000 0.325000: locale set 0.356300 0.559000 0.278000: require('nvim-treesitter.tsrange') 0.345900 0.438000 0.291000: require('lazy.stats') 0.344500 0.423000 0.295000: require('plenary.async.util') 0.343400 0.533000 0.269000: require('codecompanion.commands') 0.339400 0.765000 0.197000: require('vim.lsp._snippet_grammar') 0.332900 0.522000 0.242000: require('cmp.types.lsp') 0.328900 0.355000 0.318000: init lua interpreter 0.328400 0.379000 0.297000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/vital/_lexima/Data/List.vim 0.326300 0.368000 0.310000: inits 1 0.325900 0.452000 0.271000: require('oil.util') 0.322500 0.414000 0.281000: /Users/tkan/.local/share/nvim/lazy/cmp-nvim-lsp/after/plugin/cmp_nvim_lsp.lua 0.313500 0.429000 0.253000: require('vim.loader') 0.306000 0.326000 0.288000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/syntax/syntax.vim 0.302100 0.462000 0.199000: require('vim.diagnostic') 0.302000 0.472000 0.235000: /Users/tkan/.local/share/nvim/lazy/cmp-cmdline/after/plugin/cmp_cmdline.lua 0.296100 0.309000 0.277000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/vital/_lexima/Data/String.vim 0.295900 0.565000 0.230000: require('cmp.utils.str') 0.291800 0.545000 0.215000: require('vim.lsp._changetracking') 0.283500 0.391000 0.220000: require('codecompanion.strategies') 0.278700 0.284000 0.273000: require('basic') 0.273700 0.366000 0.158000: require('dial.augend.constant') 0.270700 0.445000 0.226000: require('cmp_buffer.buffer') 0.270200 0.379000 0.123000: require('lazy.core.handler.ft') 0.267000 0.584000 0.204000: /Users/tkan/.local/share/nvim/lazy/cmp-path/after/plugin/cmp_path.lua 0.264700 0.456000 0.131000: require('dial.augend.integer') 0.260500 0.302000 0.216000: require('cmp.utils.keymap') 0.258200 0.280000 0.226000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/vsnip.vim 0.256000 0.340000 0.214000: require('cmp_nvim_lsp') 0.247200 0.413000 0.196000: require('cmp.utils.window') 0.245900 0.324000 0.205000: require('cmp.config.default') 0.245100 0.370000 0.207000: require('dial.augend.common') 0.244500 0.315000 0.167000: require('lazy.pkg') 0.242400 0.261000 0.235000: init highlight 0.241300 0.276000 0.224000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/vital/lexima.vim 0.237900 0.319000 0.151000: require('lazy.core.config') 0.234500 0.346000 0.189000: require('plenary.vararg.rotate') 0.232500 0.362000 0.191000: require('cmp.utils.autocmd') 0.222600 0.278000 0.197000: require('plenary.async.control') 0.220300 0.239000 0.207000: /Users/tkan/.local/share/nvim/lazy/copilot.vim/plugin/copilot.vim 0.216600 0.232000 0.209000: require('markdown_highlights') 0.215700 0.244000 0.194000: require('cmp.context') 0.214000 0.230000 0.195000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/vital/_lexima/Prelude.vim 0.210600 0.342000 0.130000: require('dial.augend.paren') 0.210100 0.301000 0.182000: require('vim.uri') 0.210000 0.602000 0.124000: require('vim.lsp.log') 0.206900 0.389000 0.128000: require('nvim-treesitter.ts_utils') 0.202400 0.346000 0.142000: /Users/tkan/.local/share/nvim/lazy/telescope.nvim/plugin/telescope.lua 0.201900 0.326000 0.163000: require('cmp_cmdline') 0.200300 0.327000 0.107000: require('lazy.terminal') 0.197500 0.225000 0.180000: /Users/tkan/.local/share/nvim/lazy/vim-sandwich/plugin/operator/sandwich.vim 0.196900 0.508000 0.118000: require('nvim-treesitter.utils') 0.194900 0.296000 0.128000: require('cmp.utils.snippet') 0.180600 0.189000 0.172000: require('vim._init_packages') 0.178800 0.439000 0.136000: require('cmp_path') 0.177600 0.228000 0.159000: /Users/tkan/.local/share/nvim/lazy/denops.vim/autoload/denops.vim 0.176900 0.363000 0.101000: require('plenary.bit') 0.176800 0.228000 0.109000: require('lazy.core.handler') 0.174700 0.247000 0.116000: require('lazy.core.fragments') 0.172500 0.325000 0.117000: require('onedark.palette') 0.170800 0.301000 0.143000: require('oil.fs') 0.170700 0.213000 0.148000: require('vim.version') 0.169900 0.266000 0.131000: require('vim.lsp.rpc') 0.169900 0.440000 0.105000: require('vim.treesitter.language') 0.165400 0.181000 0.157000: /Users/tkan/.local/share/nvim/lazy/vim-sandwich/plugin/sandwich.vim 0.164400 0.176000 0.153000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim 0.164200 0.204000 0.110000: require('dial.augend.semver') 0.163700 0.197000 0.140000: require('lazy.core.util') 0.162800 0.284000 0.116000: require('nvim-treesitter.shell_command_selectors') 0.162500 0.359000 0.121000: require('cmp.view.custom_entries_view') 0.162100 0.291000 0.109000: require('lazy.manage.process') 0.160150 0.331000 0.037000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/filetype.lua 0.155500 0.232000 0.106000: require('codecompanion.utils.context') 0.155200 0.218000 0.105000: require('lazy.core.handler.keys') 0.154000 0.242000 0.099000: require('nvim-treesitter.query_predicates') 0.153900 0.225000 0.131000: require('onedark.terminal') 0.153600 0.191000 0.113000: require('lazy.core.handler.event') 0.153500 0.230000 0.113000: require('dial.augend.decimal_fraction') 0.153500 0.214000 0.118000: require('lazy.async') 0.149900 0.220000 0.128000: require('cmp.utils.api') 0.148500 0.176000 0.124000: require('vim.iter') 0.147300 0.255000 0.110000: require('onedark.util') 0.146800 0.305000 0.107000: require('cmp.utils.misc') 0.143600 0.301000 0.101000: require('vim.lsp.sync') 0.142400 0.196000 0.100000: require('lazy.core.handler.cmd') 0.140600 0.252000 0.105000: require('oil.constants') 0.139800 0.194000 0.122000: require('cmp.utils.char') 0.139600 0.246000 0.106000: require('cmp.config.mapping') 0.138900 0.218000 0.105000: require('dial.augend.hexcolor') 0.138400 0.247000 0.107000: require('cmp.view.wildmenu_entries_view') 0.138200 0.184000 0.118000: require('oil.config') 0.137900 0.177000 0.108000: require('codecompanion.adapters') 0.136600 0.148000 0.125000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/vital/_lexima/Vim/Guard.vim 0.135400 0.204000 0.092000: require('cmp.utils.event') 0.134800 0.150000 0.119000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/matchparen.vim 0.133700 0.182000 0.094000: require('cmp.utils.highlight') 0.133500 0.211000 0.113000: require('codecompanion.providers.completion.cmp.models') 0.133300 0.190000 0.094000: require('oil.ringbuf') 0.132500 0.148000 0.118000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/LSP/Diff.vim 0.131600 0.225000 0.093000: require('vim.func') 0.131100 0.221000 0.101000: require('vim.highlight') 0.130500 0.175000 0.099000: require('dial.handle') 0.128400 0.237000 0.098000: require('dial.util') 0.128000 0.191000 0.093000: require('nvim-treesitter.caching') 0.127800 0.224000 0.095000: require('dial.augend.user') 0.126600 0.158000 0.102000: require('nvim-treesitter.compat') 0.126200 0.140000 0.112000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/gzip.vim 0.125900 0.193000 0.094000: require('dial.augend.misc') 0.125700 0.196000 0.098000: require('nvim-treesitter.highlight') 0.125500 0.181000 0.095000: require('cmp.matcher') 0.125400 0.157000 0.109000: require('codecompanion.strategies.chat.slash_commands') 0.123500 0.184000 0.099000: require('vim.func._memoize') 0.123400 0.190000 0.097000: require('nvim-treesitter.statusline') 0.123300 0.134000 0.115000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/vital/_lexima/Vim/Buffer.vim 0.122500 0.184000 0.098000: require('codecompanion.utils.adapters') 0.122400 0.147000 0.110000: require('cmp.view.ghost_text_view') 0.121400 0.131000 0.105000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/LSP/TextEdit.vim 0.120600 0.162000 0.103000: require('vim.treesitter._range') 0.120400 0.192000 0.104000: require('cmp_buffer.timer') 0.119700 0.151000 0.106000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/rplugin.vim 0.119500 0.246000 0.095000: require('cmp.types.vim') 0.119000 0.209000 0.089000: require('cmp.utils.options') 0.118700 0.155000 0.098000: require('cmp.config.compare') 0.118000 0.163000 0.092000: require('cmp.utils.buffer') 0.117700 0.196000 0.096000: require('codecompanion.providers.completion.cmp.tools') 0.117400 0.169000 0.101000: require('cmp.config.sources') 0.117300 0.137000 0.102000: require('cmp_nvim_lsp.source') 0.116400 0.154000 0.105000: require('cmp.types.cmp') 0.114600 0.150000 0.098000: require('cmp.view.native_entries_view') 0.113100 0.137000 0.103000: require('codecompanion.providers.completion.cmp.variables') 0.110800 0.168000 0.093000: require('cmp.utils.debug') 0.109900 0.153000 0.094000: require('plenary.functional') 0.108100 0.158000 0.090000: require('plenary.errors') 0.107800 0.139000 0.092000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/Vim/Buffer.vim 0.106700 0.143000 0.093000: require('cmp.utils.pattern') 0.106400 0.140000 0.090000: require('plenary.tbl') 0.105800 0.134000 0.094000: require('plenary.async.structs') 0.105600 0.125000 0.093000: require('cmp.utils.cache') 0.104900 0.133000 0.094000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/vital/_lexima/Data/Dict.vim 0.104800 0.119000 0.091000: require('cmp.config.window') 0.104300 0.109000 0.101000: early init 0.103900 0.115000 0.092000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/zipPlugin.vim 0.103200 0.106000 0.101000: require('vim._editor') 0.102800 0.113000 0.095000: /Users/tkan/.local/share/nvim/lazy/vim-ambiwidth/plugin/ambiwidth.vim 0.095000 0.114000 0.079000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/lexima/cmdmode.vim 0.091100 0.108000 0.079000: /Users/tkan/.local/share/nvim/lazy/vim-asterisk/plugin/asterisk.vim 0.086900 0.107000 0.074000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/vital/_lexima/Vim/Type.vim 0.082000 0.128000 0.064000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/man.lua 0.078700 0.089000 0.072000: /Users/tkan/.local/share/nvim/lazy/vim-sandwich/plugin/textobj/sandwich.vim 0.078600 0.090000 0.070000: opening buffers 0.073700 0.082000 0.066000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/tarPlugin.vim 0.070500 0.078000 0.062000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/editorconfig.lua 0.069400 0.115000 0.052000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/tohtml.lua 0.067000 0.077000 0.063000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/LSP/Position.vim 0.063100 0.076000 0.053000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/osc52.lua 0.061900 0.078000 0.053000: /Users/tkan/.local/share/nvim/lazy/which-key.nvim/plugin/which-key.lua 0.061100 0.072000 0.050000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/syntax/synload.vim 0.056400 0.078000 0.047000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/shada.vim 0.054500 0.058000 0.052000: event init 0.049100 0.079000 0.024000: require('vim.fs') 0.047800 0.053000 0.043000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/plugin/lexima.vim 0.047100 0.061000 0.040000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/LSP/Text.vim 0.045600 0.051000 0.036000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/lexima/charstack.vim 0.043800 0.059000 0.035000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/Vim/Option.vim 0.043700 0.047000 0.041000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/ftplugin.vim 0.043000 0.052000 0.037000: /Users/tkan/.local/share/nvim/lazy/denops.vim/plugin/denops/debug.vim 0.041400 0.048000 0.037000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin.vim 0.036200 0.051000 0.017000: require('ffi') 0.035900 0.037000 0.035000: /Users/tkan/.local/share/nvim/lazy/copilot.vim/autoload/copilot/util.vim 0.035500 0.047000 0.029000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/lexima/endwise_rule.vim 0.035500 0.046000 0.029000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/lexima/sortedlist.vim 0.033100 0.037000 0.031000: require('vim.inspect') 0.032900 0.047000 0.024000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/lexima/string.vim 0.031500 0.048000 0.025000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-branch.vim 0.029800 0.041000 0.024000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-diff.vim 0.029700 0.031000 0.029000: require('vim.shared') 0.028500 0.030000 0.028000: require('vim._options') 0.026900 0.039000 0.022000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-edit.vim 0.026000 0.028000 0.025000: init first window 0.025500 0.034000 0.022000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-log.vim 0.025500 0.038000 0.020000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-status.vim 0.024300 0.033000 0.023000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/indent.vim 0.024300 0.039000 0.019000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-cd.vim 0.023900 0.042000 0.014000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip.vim 0.023200 0.025000 0.021000: /Users/tkan/.local/share/nvim/lazy/plenary.nvim/plugin/plenary.vim 0.022700 0.031000 0.019000: /Users/tkan/.local/share/nvim/lazy/vim-qfreplace/plugin/qfreplace.vim 0.022500 0.029000 0.018000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-browse.vim 0.018000 0.024000 0.013000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/tutor.vim 0.016000 0.019000 0.014000: /Users/tkan/.local/share/nvim/lazy/lexima.vim/autoload/vital/_lexima.vim 0.015900 0.022000 0.012000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/netrwPlugin.vim 0.015900 0.023000 0.012000: /Users/tkan/.local/share/nvim/lazy/lexima-alter-command.vim/autoload/lexima_alter_command.vim 0.015400 0.023000 0.012000: /Users/tkan/.local/share/nvim/lazy/lexima-alter-command.vim/plugin/lexima_alter_command.vim 0.015400 0.026000 0.014000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/spellfile.vim 0.015200 0.018000 0.014000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-chaperon.vim 0.014900 0.021000 0.013000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-patch.vim 0.014700 0.020000 0.014000: --- NVIM STARTED --- 0.014600 0.018000 0.013000: clear screen 0.011300 0.014000 0.010000: window checked 0.009800 0.011000 0.009000: inits 2 0.009700 0.015000 0.007000: /Users/tkan/.local/share/nvim/lazy/denops.vim/autoload/denops/_internal/conf.vim 0.008400 0.012000 0.004000: require('vim.F') 0.006700 0.010000 0.005000: require('vim.keymap') 0.003800 0.004000 0.003000: init default mappings & autocommands 0.003400 0.004000 0.003000: parsing arguments 0.002900 0.005000 0.002000: editing files in windows 0.000000 0.000000 0.000000: --- NVIM STARTING --- ``` Total Average: 95.994600 msec とりあえず20msecを目指してみる ## 改善1 - 不要なデフォルトプラグインの読み込みを抑制 [Add optimization settings · tkancf/dotfiles@4356820](https://github.com/tkancf/dotfiles/commit/4356820152da9cd8dc528aef4bf953f1f4bdbfa4) [Neovimの設定を見直して起動を30倍速にした](https://zenn.dev/kawarimidoll/articles/8172a4c29a6653#%E6%A8%99%E6%BA%96%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%81%AE%E7%84%A1%E5%8A%B9%E5%8C%96)を参考に、以下の設定を追加 ```lua vim.g.did_install_default_menus = 1 vim.g.did_install_syntax_menu = 1 vim.g.did_indent_on = 1 -- vim.g.did_load_filetypes = 1 -- vim.g.did_load_ftplugin = 1 vim.g.loaded_2html_plugin = 1 vim.g.loaded_gzip = 1 vim.g.loaded_man = 1 vim.g.loaded_matchit = 1 vim.g.loaded_matchparen = 1 vim.g.loaded_netrwPlugin = 1 vim.g.loaded_remote_plugins = 1 vim.g.loaded_shada_plugin = 1 vim.g.loaded_spellfile_plugin = 1 vim.g.loaded_tarPlugin = 1 vim.g.loaded_tutor_mode_plugin = 1 vim.g.loaded_zipPlugin = 1 vim.g.skip_loading_mswin = 1 ``` `vim.g.did_load_filetypes`は私の環境だとシンタックスハイライトが消えたのでコメントアウト ### vim-startuptime Total Average: 95.994600 msec → Total Average: 92.954300 msec 若干早くなった? ## 改善2 - プラグインの遅延ロード ### lexima.vim [Add lazy setting to lexima.vim · tkancf/dotfiles@fb23da4](https://github.com/tkancf/dotfiles/commit/fb23da4e53a4d267eb9575ef698bc8cc0484e7b7) Total Average: 92.954300 msec → Total Average: 77.498400 msec めちゃくちゃ早くなった! ``` leximaの遅延ロード ❯❯ ~ ❯ vim-startuptime -vimpath nvim Extra options: [] Measured: 10 times Total Average: 77.498400 msec Total Max: 81.040000 msec Total Min: 74.295000 msec AVERAGE MAX MIN ------------------------------ 66.244900 69.994000 62.891000: /Users/tkan/.config/nvim/init.lua 10.282950 17.000000 4.043000: require('cmp') 5.676600 6.220000 5.083000: /Users/tkan/.local/share/nvim/lazy/nvim-treesitter/plugin/nvim-treesitter.lua 5.190100 5.774000 4.641000: require('nvim-treesitter') 4.370000 5.040000 3.640000: require('nvim-treesitter.install') 4.311800 5.349000 3.451000: /Users/tkan/.local/share/nvim/lazy/dial.nvim/plugin/dial.vim 4.281500 5.343000 3.538000: require('cmp.core') 4.107600 5.058000 3.314000: require('dial.map') 3.618300 4.381000 2.870000: require('dial.command') 3.555900 3.738000 3.321000: /Users/tkan/.local/share/nvim/lazy/onedark.nvim/colors/onedark.lua 3.346500 4.108000 2.617000: require('dial.config') 3.308600 3.430000 3.222000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/plugin/vsnip.vim 3.242300 3.308000 3.163000: reading ShaDa 3.217300 4.316000 2.722000: require('codecompanion') 3.122100 3.854000 2.446000: require('dial.augend') 2.987000 3.490000 2.338000: /Users/tkan/.local/share/nvim/lazy/nvim-lspconfig/plugin/lspconfig.lua 2.861100 3.419000 2.017000: require('nvim-treesitter.parsers') 2.773200 2.826000 2.710000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vsnip.vim 2.523900 2.585000 2.459000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vsnip/session.vim 2.284000 2.804000 1.659000: require('vim.lsp') 1.884600 1.964000 1.793000: expanding arguments 1.769100 2.308000 1.614000: require('codecompanion.utils.log') 1.652400 1.956000 1.285000: /Users/tkan/.local/share/nvim/lazy/nvim-cmp/plugin/cmp.lua 1.647600 1.851000 1.567000: /Users/tkan/.local/share/nvim/lazy/copilot.vim/autoload/copilot.vim 1.624800 2.067000 1.140000: require('vim.treesitter') 1.369300 2.044000 0.790000: require('mini.icons') 1.326800 1.911000 0.945000: require('cmp.view') 1.290900 3.645000 0.116000: require('which-key') 1.286800 1.755000 1.161000: require('plenary.async') 1.217800 1.429000 1.078000: require('lazy.view.commands') 1.215000 1.700000 0.973000: require('dial.augend.date') 1.151900 1.906000 0.748000: require('vim.filetype') 1.151500 1.629000 0.854000: require('vim.treesitter.languagetree') 1.055100 1.414000 0.676000: require('codecompanion.config') 1.037200 1.241000 0.871000: require('lazy.manage') 0.991400 1.212000 0.783000: require('onedark.highlights') 0.962400 0.990000 0.929000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vsnip/snippet.vim 0.956800 1.095000 0.805000: require('nvim-treesitter.info') 0.927700 1.069000 0.838000: require('lazy.core.loader') 0.855000 0.992000 0.803000: sourcing vimrc file(s) 0.827600 0.959000 0.687000: require('nvim-treesitter.configs') 0.822500 1.213000 0.514000: require('vim.lsp.util') 0.800700 1.024000 0.657000: require('lazy.manage.runner') 0.794500 0.970000 0.541000: require('cmp.types') 0.784000 1.070000 0.440000: require('vim.treesitter.query') 0.766800 1.108000 0.625000: require('cmp.utils.async') 0.672900 0.782000 0.619000: require('plenary.async.async') 0.672100 0.801000 0.546000: require('nvim-treesitter.query') 0.651800 0.715000 0.621000: require('lazy') 0.646400 0.972000 0.517000: require('cmp.config') 0.631700 0.724000 0.557000: require('codecompanion.providers.completion.cmp.slash_commands') 0.628000 0.713000 0.573000: require('cmp.source') 0.608000 0.813000 0.478000: require('lspconfig.util') 0.601400 0.698000 0.537000: require('vim._defaults') 0.596000 0.634000 0.550000: require('lazy.core.plugin') 0.585000 0.640000 0.480000: /Users/tkan/.local/share/nvim/lazy/denops.vim/plugin/denops.vim 0.581400 0.845000 0.402000: require('vim.lsp.protocol') 0.566900 0.685000 0.470000: /Users/tkan/.local/share/nvim/lazy/cmp-buffer/after/plugin/cmp_buffer.lua 0.554800 0.692000 0.451000: /Users/tkan/.local/share/nvim/lazy/dmacro.nvim/plugin/dmacro.vim 0.525700 1.247000 0.151000: require('onedark') 0.503400 0.643000 0.345000: inits 3 0.492900 0.606000 0.411000: require('cmp_buffer') 0.478500 0.561000 0.356000: require('cmp.entry') 0.477700 0.823000 0.397000: require('plenary.async.tests') 0.476000 0.611000 0.383000: require('dmacro') 0.472900 0.618000 0.405000: require('lazy.manage.task') 0.449600 0.808000 0.201000: require('vim.lsp._snippet_grammar') 0.429400 0.467000 0.393000: require('lazy.core.meta') 0.413900 0.622000 0.177000: require('oil') 0.389400 0.604000 0.306000: require('dial.augend.case') 0.379900 0.464000 0.330000: require('codecompanion.completion') 0.372400 0.645000 0.306000: require('plenary.async.util') 0.369000 0.494000 0.313000: require('cmp_buffer.source') 0.364000 0.485000 0.295000: require('cmp.view.docs_view') 0.363600 0.463000 0.271000: require('onedark.colors') 0.359200 0.416000 0.300000: require('cmp.utils.feedkeys') 0.352800 0.520000 0.224000: require('cmp.types.lsp') 0.351300 0.426000 0.293000: BufEnter autocommands 0.346500 0.444000 0.304000: require('codecompanion.commands') 0.334400 0.407000 0.295000: require('plenary.vararg') 0.333200 0.348000 0.328000: locale set 0.329500 0.350000 0.312000: init lua interpreter 0.321800 0.413000 0.240000: require('plenary.path') 0.321800 0.425000 0.258000: require('oil.util') 0.320800 0.335000 0.303000: inits 1 0.313700 0.432000 0.237000: require('lazy.stats') 0.305200 0.330000 0.276000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/syntax/syntax.vim 0.304300 0.490000 0.147000: require('dial.augend.constant') 0.300900 0.399000 0.118000: require('lazy.core.handler.ft') 0.297800 0.355000 0.264000: /Users/tkan/.local/share/nvim/lazy/cmp-nvim-lsp/after/plugin/cmp_nvim_lsp.lua 0.296800 0.312000 0.287000: require('basic') 0.291400 0.323000 0.258000: require('vim.loader') 0.290500 0.396000 0.202000: require('vim.diagnostic') 0.277100 0.428000 0.217000: require('nvim-treesitter.tsrange') 0.259400 0.490000 0.151000: require('dial.augend.integer') 0.259300 0.309000 0.199000: require('lazy.pkg') 0.259300 0.346000 0.232000: /Users/tkan/.local/share/nvim/lazy/cmp-cmdline/after/plugin/cmp_cmdline.lua 0.258000 0.310000 0.218000: require('cmp.utils.str') 0.256100 0.336000 0.222000: require('codecompanion.strategies') 0.255200 0.273000 0.227000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/vsnip.vim 0.252100 0.394000 0.199000: require('dial.augend.common') 0.251800 0.377000 0.207000: require('cmp_buffer.buffer') 0.249700 0.311000 0.203000: require('cmp.utils.keymap') 0.249200 0.406000 0.200000: require('cmp.config.default') 0.248100 0.448000 0.197000: require('plenary.async.control') 0.246100 0.298000 0.174000: require('lazy.core.config') 0.245700 0.303000 0.206000: require('vim.lsp._changetracking') 0.245300 0.377000 0.198000: require('cmp.utils.window') 0.239700 0.248000 0.234000: init highlight 0.232700 0.281000 0.210000: require('cmp_nvim_lsp') 0.222400 0.300000 0.201000: require('plenary.vararg.rotate') 0.222200 0.270000 0.192000: require('cmp.utils.autocmd') 0.222200 0.286000 0.190000: require('cmp.context') 0.217000 0.228000 0.208000: require('markdown_highlights') 0.213100 0.278000 0.180000: /Users/tkan/.local/share/nvim/lazy/cmp-path/after/plugin/cmp_path.lua 0.211400 0.227000 0.198000: /Users/tkan/.local/share/nvim/lazy/copilot.vim/plugin/copilot.vim 0.208000 0.320000 0.141000: require('dial.augend.paren') 0.202400 0.413000 0.123000: require('vim.lsp.log') 0.199900 0.374000 0.107000: require('cmp.view.wildmenu_entries_view') 0.199800 0.395000 0.116000: require('cmp.view.custom_entries_view') 0.198200 0.239000 0.183000: require('vim.uri') 0.197700 0.238000 0.141000: require('lazy.core.handler.event') 0.196100 0.226000 0.178000: /Users/tkan/.local/share/nvim/lazy/vim-sandwich/plugin/operator/sandwich.vim 0.193100 0.290000 0.099000: require('vim.treesitter.language') 0.190800 0.273000 0.154000: require('lazy.terminal') 0.186800 0.221000 0.141000: require('lazy.core.util') 0.185400 0.214000 0.157000: /Users/tkan/.local/share/nvim/lazy/telescope.nvim/plugin/telescope.lua 0.180800 0.273000 0.136000: require('vim.lsp.rpc') 0.179300 0.405000 0.114000: require('nvim-treesitter.utils') 0.178200 0.194000 0.160000: require('vim._init_packages') 0.177800 0.274000 0.154000: require('cmp_cmdline') 0.176200 0.289000 0.127000: require('cmp.utils.api') 0.174700 0.216000 0.146000: require('oil.fs') 0.172200 0.211000 0.140000: require('vim.version') 0.172200 0.196000 0.160000: /Users/tkan/.local/share/nvim/lazy/denops.vim/autoload/denops.vim 0.172100 0.260000 0.130000: require('cmp.utils.snippet') 0.172000 0.187000 0.158000: /Users/tkan/.local/share/nvim/lazy/vim-sandwich/plugin/sandwich.vim 0.171900 0.220000 0.144000: require('lazy.core.handler.keys') 0.169800 0.238000 0.134000: require('lazy.core.handler.cmd') 0.169500 0.213000 0.156000: require('lazy.core.fragments') 0.165000 0.234000 0.115000: require('lazy.core.handler') 0.164700 0.272000 0.101000: require('cmp.view.native_entries_view') 0.157900 0.184000 0.112000: require('onedark.util') 0.157200 0.288000 0.115000: require('vim.iter') 0.156900 0.345000 0.094000: require('vim.func') 0.156550 0.299000 0.033000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/filetype.lua 0.152300 0.200000 0.119000: require('onedark.palette') 0.151900 0.214000 0.108000: require('cmp.view.ghost_text_view') 0.149300 0.228000 0.115000: require('oil.config') 0.148600 0.215000 0.124000: require('onedark.terminal') 0.147600 0.268000 0.109000: require('nvim-treesitter.ts_utils') 0.145900 0.238000 0.112000: require('lazy.async') 0.145400 0.240000 0.119000: require('nvim-treesitter.shell_command_selectors') 0.143800 0.207000 0.102000: require('vim.treesitter._range') 0.142100 0.218000 0.112000: require('lazy.manage.process') 0.141500 0.212000 0.119000: require('cmp_path') 0.140000 0.218000 0.102000: require('oil.constants') 0.138600 0.257000 0.107000: require('cmp.utils.misc') 0.138100 0.203000 0.097000: require('nvim-treesitter.compat') 0.134600 0.222000 0.104000: require('cmp.config.mapping') 0.133300 0.184000 0.113000: require('codecompanion.providers.completion.cmp.models') 0.132600 0.167000 0.096000: require('plenary.bit') 0.132000 0.248000 0.095000: require('cmp_buffer.timer') 0.131800 0.165000 0.114000: require('cmp.utils.char') 0.131200 0.180000 0.108000: require('codecompanion.utils.context') 0.130700 0.184000 0.101000: require('oil.ringbuf') 0.129500 0.194000 0.097000: require('codecompanion.utils.adapters') 0.129400 0.172000 0.107000: require('codecompanion.strategies.chat.slash_commands') 0.128800 0.144000 0.110000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/LSP/Diff.vim 0.128600 0.171000 0.102000: require('nvim-treesitter.query_predicates') 0.127800 0.209000 0.097000: require('dial.util') 0.127700 0.208000 0.102000: require('vim.func._memoize') 0.127700 0.219000 0.096000: require('cmp.matcher') 0.127100 0.191000 0.105000: require('cmp.types.cmp') 0.125200 0.206000 0.105000: require('cmp.config.sources') 0.124700 0.249000 0.094000: require('dial.augend.user') 0.124300 0.202000 0.099000: require('cmp.config.compare') 0.123800 0.198000 0.094000: require('dial.augend.misc') 0.123600 0.204000 0.098000: require('vim.highlight') 0.123300 0.225000 0.093000: require('dial.augend.semver') 0.122500 0.190000 0.095000: require('plenary.functional') 0.122400 0.163000 0.094000: require('cmp.utils.highlight') 0.122400 0.176000 0.097000: require('vim.lsp.sync') 0.121700 0.178000 0.092000: require('cmp.utils.cache') 0.121100 0.159000 0.108000: require('codecompanion.adapters') 0.120700 0.237000 0.089000: require('cmp.utils.options') 0.120600 0.182000 0.095000: require('cmp.types.vim') 0.117300 0.139000 0.107000: require('dial.augend.decimal_fraction') 0.117100 0.129000 0.099000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/LSP/TextEdit.vim 0.117000 0.174000 0.094000: require('nvim-treesitter.statusline') 0.115900 0.225000 0.096000: require('dial.handle') 0.115800 0.167000 0.100000: require('nvim-treesitter.highlight') 0.113700 0.165000 0.091000: require('cmp.utils.pattern') 0.113700 0.173000 0.089000: require('cmp.utils.event') 0.112900 0.164000 0.091000: require('cmp.utils.buffer') 0.112600 0.194000 0.094000: require('plenary.async.structs') 0.110400 0.163000 0.091000: require('cmp.utils.debug') 0.109100 0.195000 0.092000: require('plenary.tbl') 0.109000 0.128000 0.103000: require('cmp_nvim_lsp.source') 0.108500 0.145000 0.099000: /Users/tkan/.local/share/nvim/lazy/vim-ambiwidth/plugin/ambiwidth.vim 0.108300 0.125000 0.101000: require('codecompanion.providers.completion.cmp.tools') 0.107200 0.122000 0.094000: require('dial.augend.hexcolor') 0.105200 0.125000 0.095000: require('nvim-treesitter.caching') 0.105200 0.117000 0.097000: require('codecompanion.providers.completion.cmp.variables') 0.103500 0.107000 0.101000: require('vim._editor') 0.103400 0.121000 0.090000: require('plenary.errors') 0.103000 0.109000 0.099000: early init 0.102100 0.108000 0.097000: require('cmp.config.window') 0.101000 0.121000 0.092000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/Vim/Buffer.vim 0.087400 0.093000 0.081000: /Users/tkan/.local/share/nvim/lazy/vim-asterisk/plugin/asterisk.vim 0.081000 0.094000 0.074000: /Users/tkan/.local/share/nvim/lazy/vim-sandwich/plugin/textobj/sandwich.vim 0.072100 0.084000 0.065000: opening buffers 0.068900 0.164000 0.050000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/man.lua 0.068400 0.170000 0.052000: /Users/tkan/.local/share/nvim/lazy/which-key.nvim/plugin/which-key.lua 0.066800 0.080000 0.059000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/editorconfig.lua 0.066100 0.070000 0.064000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/LSP/Position.vim 0.061200 0.073000 0.053000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/syntax/synload.vim 0.056800 0.084000 0.047000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/tohtml.lua 0.055200 0.072000 0.049000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/osc52.lua 0.054000 0.061000 0.051000: event init 0.049400 0.060000 0.041000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/LSP/Text.vim 0.046800 0.052000 0.041000: require('ffi') 0.045700 0.069000 0.038000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin.vim 0.044900 0.070000 0.031000: require('vim.fs') 0.044400 0.054000 0.036000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/Vim/Option.vim 0.044200 0.045000 0.042000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/ftplugin.vim 0.042300 0.053000 0.037000: /Users/tkan/.local/share/nvim/lazy/denops.vim/plugin/denops/debug.vim 0.036000 0.039000 0.035000: /Users/tkan/.local/share/nvim/lazy/copilot.vim/autoload/copilot/util.vim 0.033000 0.036000 0.031000: require('vim.inspect') 0.031200 0.108000 0.021000: /Users/tkan/.local/share/nvim/lazy/plenary.nvim/plugin/plenary.vim 0.029700 0.033000 0.028000: require('vim.shared') 0.029700 0.052000 0.023000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-log.vim 0.028700 0.030000 0.028000: require('vim._options') 0.027400 0.038000 0.024000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-diff.vim 0.026900 0.041000 0.019000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-cd.vim 0.026800 0.039000 0.023000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-edit.vim 0.026600 0.029000 0.025000: init first window 0.026500 0.031000 0.020000: /Users/tkan/.local/share/nvim/lazy/vim-qfreplace/plugin/qfreplace.vim 0.026300 0.029000 0.025000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-branch.vim 0.025300 0.038000 0.023000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/indent.vim 0.023300 0.032000 0.018000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-browse.vim 0.023200 0.032000 0.020000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-status.vim 0.017500 0.034000 0.014000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip.vim 0.016200 0.024000 0.012000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/netrwPlugin.vim 0.016100 0.028000 0.013000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-patch.vim 0.015600 0.024000 0.010000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/gzip.vim 0.014900 0.023000 0.009000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/tarPlugin.vim 0.014800 0.027000 0.008000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/matchparen.vim 0.014800 0.017000 0.014000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-chaperon.vim 0.014700 0.019000 0.013000: clear screen 0.014000 0.015000 0.013000: --- NVIM STARTED --- 0.013200 0.021000 0.010000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/zipPlugin.vim 0.011800 0.020000 0.009000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/matchit.vim 0.011300 0.019000 0.006000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/tutor.vim 0.010800 0.019000 0.006000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/rplugin.vim 0.010600 0.013000 0.010000: window checked 0.010300 0.015000 0.004000: require('vim.F') 0.010200 0.015000 0.007000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/spellfile.vim 0.010100 0.011000 0.009000: inits 2 0.008600 0.015000 0.007000: /Users/tkan/.local/share/nvim/lazy/denops.vim/autoload/denops/_internal/conf.vim 0.007700 0.012000 0.005000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/shada.vim 0.007400 0.010000 0.005000: require('vim.keymap') 0.003800 0.004000 0.003000: init default mappings & autocommands 0.003500 0.005000 0.002000: editing files in windows 0.003100 0.004000 0.003000: parsing arguments 0.000000 0.000000 0.000000: --- NVIM STARTING --- ``` #### diff ```diff diff --git a/.config/nvim/lua/plugins/util.lua b/.config/nvim/lua/plugins/util.lua index 5417673..cc21000 100644 --- a/.config/nvim/lua/plugins/util.lua +++ b/.config/nvim/lua/plugins/util.lua @@ -6,6 +6,7 @@ return { }, { 'https://github.com/cohama/lexima.vim', + event = 'BufRead', config = function() vim.g.lexima_enable_space_rules = 0 end, @@ -21,6 +22,7 @@ return { dependencies = { 'https://github.com/cohama/lexima.vim' }, + event = 'BufRead', config = function() vim.cmd [[ LeximaAlterCommand obw ObsidianWorkspace ``` ### nvim-treesitter Total Average: 77.498400 msec →Total Average: 72.648400 msec ちょっと早くなった [Add lazy setting to nvim-treesitter · tkancf/dotfiles@b9f2b2b](https://github.com/tkancf/dotfiles/commit/b9f2b2be8d107e375ab907539295026c6ae4da4f) ``` ❯ vim-startuptime -vimpath nvim Extra options: [] Measured: 10 times Total Average: 72.648400 msec Total Max: 74.711000 msec Total Min: 70.791000 msec AVERAGE MAX MIN ------------------------------ 61.469600 63.540000 58.864000: /Users/tkan/.config/nvim/init.lua 10.042850 15.925000 4.089000: require('cmp') 4.412700 5.615000 3.302000: require('codecompanion') 4.351000 5.011000 3.668000: require('cmp.core') 4.347900 4.826000 3.411000: /Users/tkan/.local/share/nvim/lazy/dial.nvim/plugin/dial.vim 4.104300 4.603000 3.148000: require('dial.map') 3.646400 4.075000 2.836000: require('dial.command') 3.559300 3.783000 3.278000: /Users/tkan/.local/share/nvim/lazy/onedark.nvim/colors/onedark.lua 3.401300 3.845000 2.627000: require('dial.config') 3.285500 3.435000 3.167000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/plugin/vsnip.vim 3.198200 3.281000 3.143000: reading ShaDa 3.185100 3.634000 2.508000: require('dial.augend') 2.766500 2.882000 2.652000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vsnip.vim 2.560200 3.039000 2.053000: /Users/tkan/.local/share/nvim/lazy/nvim-lspconfig/plugin/lspconfig.lua 2.514600 2.616000 2.401000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vsnip/session.vim 2.210400 2.537000 1.871000: require('codecompanion.utils.log') 1.923700 2.012000 1.837000: expanding arguments 1.907700 2.328000 1.569000: require('vim.lsp') 1.611300 2.084000 1.508000: /Users/tkan/.local/share/nvim/lazy/copilot.vim/autoload/copilot.vim 1.581200 1.925000 1.380000: /Users/tkan/.local/share/nvim/lazy/nvim-cmp/plugin/cmp.lua 1.569700 1.897000 1.412000: require('plenary.async') 1.429100 2.039000 0.873000: require('mini.icons') 1.426900 2.266000 0.678000: require('codecompanion.config') 1.384900 1.699000 0.947000: require('dial.augend.date') 1.304600 1.481000 1.223000: require('lazy.view.commands') 1.287600 3.611000 0.118000: require('which-key') 1.179700 1.607000 0.933000: require('cmp.view') 1.085300 1.262000 0.959000: require('lazy.manage') 1.061100 1.655000 0.782000: require('vim.filetype') 1.051900 1.380000 0.763000: require('onedark.highlights') 0.952000 1.002000 0.924000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vsnip/snippet.vim 0.947900 1.063000 0.768000: require('vim.treesitter') 0.868400 1.004000 0.697000: require('lazy.core.loader') 0.839600 0.870000 0.794000: sourcing vimrc file(s) 0.837200 1.238000 0.659000: require('cmp.utils.async') 0.836400 1.050000 0.729000: require('lazy.manage.runner') 0.828600 0.981000 0.637000: require('plenary.async.async') 0.802800 0.887000 0.653000: require('vim.treesitter.languagetree') 0.704200 0.840000 0.549000: require('cmp.types') 0.698100 1.104000 0.540000: require('cmp.config') 0.639000 0.687000 0.592000: require('lazy') 0.633600 0.744000 0.545000: require('codecompanion.providers.completion.cmp.slash_commands') 0.627800 1.035000 0.466000: require('cmp.source') 0.612400 1.056000 0.464000: /Users/tkan/.local/share/nvim/lazy/cmp-buffer/after/plugin/cmp_buffer.lua 0.602400 0.912000 0.490000: require('vim.lsp.util') 0.580900 0.665000 0.536000: require('vim._defaults') 0.575200 0.866000 0.443000: require('plenary.async.tests') 0.565500 0.662000 0.393000: require('lazy.core.plugin') 0.561900 0.788000 0.410000: require('lspconfig.util') 0.557000 0.715000 0.423000: /Users/tkan/.local/share/nvim/lazy/dmacro.nvim/plugin/dmacro.vim 0.552500 0.634000 0.466000: /Users/tkan/.local/share/nvim/lazy/denops.vim/plugin/denops.vim 0.527800 0.912000 0.400000: require('cmp_buffer') 0.521000 0.663000 0.375000: inits 3 0.513600 0.610000 0.424000: require('vim.treesitter.query') 0.505350 1.102000 0.104000: require('onedark') 0.494700 0.733000 0.368000: require('vim.lsp.protocol') 0.488200 0.596000 0.398000: require('lazy.manage.task') 0.482600 0.800000 0.351000: require('cmp.entry') 0.473200 0.810000 0.267000: require('onedark.colors') 0.468600 0.616000 0.363000: require('dmacro') 0.467000 0.706000 0.307000: require('plenary.path') 0.448200 0.631000 0.332000: require('plenary.async.util') 0.431200 0.925000 0.238000: require('codecompanion.commands') 0.422700 0.645000 0.318000: require('cmp.utils.feedkeys') 0.412000 0.716000 0.192000: require('oil') 0.409000 0.493000 0.254000: require('lazy.core.meta') 0.408800 0.739000 0.304000: require('cmp_buffer.source') 0.386800 0.503000 0.323000: require('codecompanion.completion') 0.379000 0.470000 0.311000: require('plenary.vararg') 0.355700 0.489000 0.293000: require('cmp.view.docs_view') 0.352200 0.588000 0.259000: /Users/tkan/.local/share/nvim/lazy/cmp-nvim-lsp/after/plugin/cmp_nvim_lsp.lua 0.346700 0.397000 0.307000: require('dial.augend.case') 0.340300 0.400000 0.254000: require('lazy.stats') 0.332500 0.356000 0.311000: init lua interpreter 0.331700 0.415000 0.279000: require('oil.util') 0.331700 0.358000 0.318000: locale set 0.330000 0.428000 0.276000: BufEnter autocommands 0.329100 0.445000 0.265000: require('vim.loader') 0.317700 0.419000 0.227000: require('cmp.types.lsp') 0.316000 0.335000 0.307000: inits 1 0.308600 0.329000 0.273000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/syntax/syntax.vim 0.301000 0.767000 0.181000: require('vim.diagnostic') 0.295200 0.301000 0.289000: require('basic') 0.294000 0.457000 0.210000: require('plenary.async.control') 0.289800 0.483000 0.210000: require('cmp.utils.keymap') 0.283000 0.547000 0.199000: require('cmp_buffer.buffer') 0.274500 0.391000 0.221000: require('cmp.utils.str') 0.273200 0.431000 0.103000: require('lazy.core.handler.ft') 0.272700 0.465000 0.205000: require('cmp_nvim_lsp') 0.269000 0.385000 0.219000: require('codecompanion.strategies') 0.267800 0.487000 0.153000: require('dial.augend.constant') 0.266700 0.309000 0.226000: /Users/tkan/.local/share/nvim/lazy/cmp-cmdline/after/plugin/cmp_cmdline.lua 0.264000 0.354000 0.172000: require('dial.augend.integer') 0.262400 0.740000 0.111000: require('vim.iter') 0.261700 0.469000 0.208000: require('cmp.config.default') 0.260100 0.342000 0.211000: require('vim.lsp._changetracking') 0.259600 0.354000 0.201000: require('cmp.utils.autocmd') 0.257400 0.424000 0.185000: /Users/tkan/.local/share/nvim/lazy/cmp-path/after/plugin/cmp_path.lua 0.255600 0.319000 0.201000: require('plenary.vararg.rotate') 0.252500 0.267000 0.228000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/vsnip.vim 0.252400 0.330000 0.191000: require('lazy.core.config') 0.250800 0.468000 0.194000: require('vim.lsp._snippet_grammar') 0.246200 0.308000 0.143000: require('lazy.pkg') 0.243500 0.261000 0.236000: init highlight 0.233600 0.337000 0.194000: require('cmp.utils.window') 0.232900 0.326000 0.185000: require('cmp.context') 0.226200 0.315000 0.191000: require('vim.uri') 0.225900 0.266000 0.200000: require('dial.augend.common') 0.223200 0.242000 0.209000: require('markdown_highlights') 0.213000 0.223000 0.197000: /Users/tkan/.local/share/nvim/lazy/copilot.vim/plugin/copilot.vim 0.210300 0.401000 0.103000: require('plenary.bit') 0.204500 0.270000 0.155000: /Users/tkan/.local/share/nvim/lazy/telescope.nvim/plugin/telescope.lua 0.192300 0.287000 0.133000: require('cmp.utils.snippet') 0.191600 0.208000 0.175000: /Users/tkan/.local/share/nvim/lazy/vim-sandwich/plugin/operator/sandwich.vim 0.191500 0.294000 0.125000: require('oil.config') 0.185600 0.288000 0.121000: require('lazy.core.handler.event') 0.181800 0.267000 0.145000: require('lazy.core.util') 0.178600 0.225000 0.151000: require('cmp_cmdline') 0.176800 0.284000 0.108000: require('lazy.manage.process') 0.175100 0.191000 0.155000: require('vim._init_packages') 0.173900 0.278000 0.102000: require('lazy.core.fragments') 0.170400 0.221000 0.130000: require('dial.augend.paren') 0.170100 0.226000 0.106000: require('lazy.terminal') 0.170100 0.229000 0.138000: require('vim.lsp.rpc') 0.169800 0.189000 0.156000: /Users/tkan/.local/share/nvim/lazy/denops.vim/autoload/denops.vim 0.168000 0.221000 0.109000: require('oil.ringbuf') 0.167400 0.319000 0.120000: require('cmp_path') 0.165000 0.214000 0.143000: require('oil.fs') 0.164100 0.334000 0.130000: require('vim.version') 0.164000 0.212000 0.121000: require('onedark.palette') 0.163850 0.341000 0.033000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/filetype.lua 0.162200 0.300000 0.103000: require('cmp.config.mapping') 0.161700 0.170000 0.156000: /Users/tkan/.local/share/nvim/lazy/vim-sandwich/plugin/sandwich.vim 0.158400 0.248000 0.108000: require('plenary.functional') 0.158100 0.232000 0.115000: require('lazy.core.handler.cmd') 0.153300 0.245000 0.109000: require('cmp.utils.misc') 0.152400 0.218000 0.109000: require('lazy.core.handler.keys') 0.150000 0.195000 0.130000: require('codecompanion.utils.context') 0.150000 0.203000 0.117000: require('lazy.async') 0.146800 0.268000 0.116000: require('vim.lsp.log') 0.146300 0.265000 0.097000: require('plenary.async.structs') 0.144900 0.272000 0.114000: require('cmp.view.wildmenu_entries_view') 0.144600 0.225000 0.115000: require('cmp.view.custom_entries_view') 0.144300 0.228000 0.102000: require('oil.constants') 0.142800 0.242000 0.112000: require('cmp.utils.char') 0.142300 0.203000 0.120000: require('onedark.terminal') 0.141300 0.317000 0.094000: require('cmp_buffer.timer') 0.140700 0.256000 0.090000: require('cmp.utils.buffer') 0.139700 0.196000 0.105000: require('onedark.util') 0.139600 0.190000 0.101000: require('cmp.types.vim') 0.139100 0.210000 0.106000: require('codecompanion.adapters') 0.138900 0.242000 0.103000: require('cmp.utils.highlight') 0.138900 0.198000 0.115000: require('lazy.core.handler') 0.138500 0.249000 0.102000: require('cmp_nvim_lsp.source') 0.138500 0.156000 0.126000: require('cmp.utils.api') 0.136000 0.172000 0.108000: require('dial.augend.decimal_fraction') 0.135700 0.206000 0.099000: require('vim.lsp.sync') 0.134200 0.274000 0.099000: require('cmp.config.compare') 0.133500 0.230000 0.109000: require('cmp.view.ghost_text_view') 0.130800 0.226000 0.095000: require('dial.augend.semver') 0.130500 0.175000 0.117000: require('codecompanion.providers.completion.cmp.models') 0.129800 0.144000 0.117000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/LSP/Diff.vim 0.127400 0.181000 0.096000: require('plenary.tbl') 0.127300 0.232000 0.100000: require('cmp.view.native_entries_view') 0.126000 0.184000 0.095000: require('plenary.errors') 0.125100 0.162000 0.102000: require('codecompanion.utils.adapters') 0.123800 0.218000 0.099000: require('dial.handle') 0.123600 0.192000 0.090000: require('cmp.config.window') 0.123600 0.176000 0.099000: require('vim.highlight') 0.123000 0.174000 0.106000: require('codecompanion.strategies.chat.slash_commands') 0.122300 0.172000 0.099000: require('cmp.utils.debug') 0.120700 0.166000 0.095000: require('dial.augend.hexcolor') 0.118700 0.161000 0.102000: require('cmp.types.cmp') 0.117500 0.136000 0.100000: require('cmp.config.sources') 0.116800 0.155000 0.097000: require('vim.treesitter.language') 0.116400 0.170000 0.096000: require('codecompanion.providers.completion.cmp.tools') 0.115900 0.147000 0.099000: require('dial.augend.misc') 0.115700 0.150000 0.099000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/LSP/TextEdit.vim 0.115700 0.177000 0.093000: require('cmp.utils.cache') 0.113500 0.175000 0.095000: require('codecompanion.providers.completion.cmp.variables') 0.113200 0.148000 0.102000: require('dial.util') 0.111600 0.144000 0.097000: require('vim.treesitter._range') 0.110000 0.163000 0.090000: require('cmp.utils.pattern') 0.109300 0.128000 0.093000: require('dial.augend.user') 0.107600 0.118000 0.096000: require('cmp.matcher') 0.107400 0.180000 0.091000: require('cmp.utils.event') 0.104400 0.135000 0.092000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/Vim/Buffer.vim 0.104200 0.126000 0.090000: require('cmp.utils.options') 0.103600 0.116000 0.095000: /Users/tkan/.local/share/nvim/lazy/vim-ambiwidth/plugin/ambiwidth.vim 0.103400 0.115000 0.093000: require('vim.func._memoize') 0.103200 0.106000 0.099000: require('vim._editor') 0.100500 0.103000 0.098000: early init 0.099200 0.110000 0.088000: require('vim.func') 0.085100 0.089000 0.081000: /Users/tkan/.local/share/nvim/lazy/vim-asterisk/plugin/asterisk.vim 0.079300 0.092000 0.072000: /Users/tkan/.local/share/nvim/lazy/vim-sandwich/plugin/textobj/sandwich.vim 0.072100 0.082000 0.060000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/editorconfig.lua 0.070300 0.093000 0.060000: opening buffers 0.068000 0.076000 0.063000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/LSP/Position.vim 0.067100 0.110000 0.050000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/osc52.lua 0.067100 0.112000 0.054000: /Users/tkan/.local/share/nvim/lazy/which-key.nvim/plugin/which-key.lua 0.066100 0.075000 0.055000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/syntax/synload.vim 0.059300 0.104000 0.048000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/tohtml.lua 0.058700 0.070000 0.052000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/man.lua 0.053800 0.075000 0.042000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/LSP/Text.vim 0.053200 0.057000 0.050000: event init 0.046000 0.073000 0.024000: require('vim.fs') 0.045200 0.049000 0.041000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/ftplugin.vim 0.043400 0.064000 0.037000: /Users/tkan/.local/share/nvim/lazy/denops.vim/plugin/denops/debug.vim 0.040600 0.048000 0.037000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin.vim 0.040000 0.060000 0.036000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip/VS/Vim/Option.vim 0.035500 0.036000 0.035000: /Users/tkan/.local/share/nvim/lazy/copilot.vim/autoload/copilot/util.vim 0.034900 0.049000 0.017000: require('ffi') 0.032700 0.036000 0.031000: require('vim.inspect') 0.032300 0.053000 0.019000: /Users/tkan/.local/share/nvim/lazy/vim-qfreplace/plugin/qfreplace.vim 0.030900 0.043000 0.028000: require('vim.shared') 0.028700 0.036000 0.024000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-branch.vim 0.028500 0.030000 0.027000: require('vim._options') 0.027300 0.048000 0.024000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-diff.vim 0.026700 0.037000 0.022000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-log.vim 0.026200 0.039000 0.022000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-edit.vim 0.026000 0.036000 0.023000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/indent.vim 0.025700 0.026000 0.025000: init first window 0.025400 0.050000 0.020000: /Users/tkan/.local/share/nvim/lazy/plenary.nvim/plugin/plenary.vim 0.024500 0.043000 0.019000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-status.vim 0.020500 0.030000 0.018000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-browse.vim 0.019800 0.021000 0.019000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-cd.vim 0.018200 0.037000 0.014000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-chaperon.vim 0.016400 0.022000 0.014000: /Users/tkan/.local/share/nvim/lazy/vim-vsnip/autoload/vital/_vsnip.vim 0.016300 0.024000 0.013000: /Users/tkan/.local/share/nvim/lazy/gin.vim/plugin/gin-patch.vim 0.016000 0.022000 0.009000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/tarPlugin.vim 0.015800 0.023000 0.011000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/netrwPlugin.vim 0.015600 0.021000 0.013000: clear screen 0.014200 0.015000 0.014000: --- NVIM STARTED --- 0.014000 0.025000 0.011000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/gzip.vim 0.013800 0.022000 0.010000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/zipPlugin.vim 0.012900 0.026000 0.009000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/matchit.vim 0.011800 0.024000 0.006000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/tutor.vim 0.011700 0.015000 0.009000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/matchparen.vim 0.011700 0.040000 0.005000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/shada.vim 0.010900 0.012000 0.009000: inits 2 0.010700 0.040000 0.004000: require('vim.F') 0.010700 0.019000 0.006000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/rplugin.vim 0.010500 0.021000 0.007000: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/plugin/spellfile.vim 0.009900 0.011000 0.009000: window checked 0.008800 0.013000 0.007000: /Users/tkan/.local/share/nvim/lazy/denops.vim/autoload/denops/_internal/conf.vim 0.007900 0.010000 0.006000: require('vim.keymap') 0.004100 0.005000 0.003000: init default mappings & autocommands 0.003800 0.005000 0.002000: editing files in windows 0.003200 0.004000 0.003000: parsing arguments 0.000000 0.000000 0.000000: --- NVIM STARTING --- ``` #### diff ```diff ❯ yadm diff --cached diff --git a/.config/nvim/lua/plugins/ai.lua b/.config/nvim/lua/plugins/ai.lua index 715f8d2..b61f963 100644 --- a/.config/nvim/lua/plugins/ai.lua +++ b/.config/nvim/lua/plugins/ai.lua @@ -3,7 +3,6 @@ return { "olimorris/codecompanion.nvim", dependencies = { "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", }, --config = true, opts = { diff --git a/.config/nvim/lua/plugins/markdown.lua b/.config/nvim/lua/plugins/markdown.lua index 027c32e..08d3756 100644 --- a/.config/nvim/lua/plugins/markdown.lua +++ b/.config/nvim/lua/plugins/markdown.lua @@ -11,10 +11,10 @@ return { ft = "markdown", dependencies = { -- Required. - 'https://github.com/nvim-lua/plenary.nvim', + -- 'https://github.com/nvim-lua/plenary.nvim', -- 'https://github.com/hrsh7th/nvim-cmp', - 'https://github.com/nvim-telescope/telescope.nvim', - 'https://github.com/nvim-treesitter/nvim-treesitter', + -- 'https://github.com/nvim-telescope/telescope.nvim', + -- 'https://github.com/nvim-treesitter/nvim-treesitter', -- see below for full list of optional dependencies 👇 }, opts = { diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua index 19894d6..6935d9d 100644 --- a/.config/nvim/lua/plugins/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -1,6 +1,8 @@ return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", + event = { "BufReadPost" }, + lazy = true, config = function() require 'nvim-treesitter.configs'.setup { highlight = { @@ -10,4 +12,4 @@ return { }, } end, -} \ No newline at end of file +} diff --git a/.config/nvim/lua/plugins/util.lua b/.config/nvim/lua/plugins/util.lua index cc21000..958f6ef 100644 --- a/.config/nvim/lua/plugins/util.lua +++ b/.config/nvim/lua/plugins/util.lua @@ -1,4 +1,8 @@ return { + { + 'https://github.com/nvim-lua/plenary.nvim', + lazy = true, + }, { 'https://github.com/adelarsq/image_preview.nvim', ft = 'markdown', ``` ### leximaをもう一度 Total Average: 72.648400 msec → Total Average: 70.915600 msec [Update lexima lazy setting · tkancf/dotfiles@9878907](https://github.com/tkancf/dotfiles/commit/987890783d7069f17144cc25265aac1d07ece62c) ``` ❯❯ ~ ❯ vim-startuptime -vimpath nvim | head Extra options: [] Measured: 10 times Total Average: 70.915600 msec Total Max: 72.572000 msec Total Min: 69.673000 msec AVERAGE MAX MIN ------------------------------ 59.753200 61.264000 58.678000: /Users/tkan/.config/nvim/init.lua ❯❯ ~ ❯ yadm diff HEAD^ diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index f175d7b..bfe0875 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -4,7 +4,7 @@ "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "codecompanion.nvim": { "branch": "main", "commit": "b9ef54bc8412bae203c42d68e7218ea37fd1e3e0" }, + "codecompanion.nvim": { "branch": "main", "commit": "f9896cc98fbc33942534c5cc23dcc8c4a61c4501" }, "copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" }, "denops.vim": { "branch": "main", "commit": "4ff8f353ee54ee67288c1099242444ccb0ab5b69" }, "dial.nvim": { "branch": "master", "commit": "34bbd9c387c358190e61ce71017faad3dffa7a74" }, @@ -18,8 +18,7 @@ "mini.icons": { "branch": "main", "commit": "1c79feb7478ca773fa3dac5cadf43ced9180e861" }, "nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" }, "nvim-lspconfig": { "branch": "master", "commit": "339ccc81e08793c3af9b83882a6ebd90c9cc0d3b" }, - "nvim-treesitter": { "branch": "master", "commit": "984214ef8e4ca18d77639663319aabdfba89632f" }, - "nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" }, + "nvim-treesitter": { "branch": "master", "commit": "f0c928dbe93533b7e35894a8f957f40150d1f663" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "oil.nvim": { "branch": "master", "commit": "09fa1d22f5edf0730824d2b222d726c8c81bbdc9" }, "onedark.nvim": { "branch": "master", "commit": "67a74c275d1116d575ab25485d1bfa6b2a9c38a6" }, diff --git a/.config/nvim/lua/plugins/util.lua b/.config/nvim/lua/plugins/util.lua index 958f6ef..e5ca701 100644 --- a/.config/nvim/lua/plugins/util.lua +++ b/.config/nvim/lua/plugins/util.lua @@ -6,11 +6,11 @@ return { { 'https://github.com/adelarsq/image_preview.nvim', ft = 'markdown', - --event = 'VeryLazy', }, { 'https://github.com/cohama/lexima.vim', - event = 'BufRead', + event = { 'CmdlineEnter', 'InsertEnter' }, + lazy = true, config = function() vim.g.lexima_enable_space_rules = 0 end, @@ -26,7 +26,7 @@ return { dependencies = { 'https://github.com/cohama/lexima.vim' }, - event = 'BufRead', + event = { 'CmdlineEnter' }, config = function() vim.cmd [[ LeximaAlterCommand obw ObsidianWorkspace ``` ### dial.nvim [Add lazy setting to dial.nvim · tkancf/dotfiles@77e1506](https://github.com/tkancf/dotfiles/commit/77e1506fee214e5c6df657cfe4d0a364e6b8ebfd) Total Average: 70.915600 msec → Total Average: 66.301500 msec ### nvim-cmp [Add lazy setting to nvim-cmp · tkancf/dotfiles@59062c8](https://github.com/tkancf/dotfiles/commit/59062c88bf91627561c7171e0a39a2a387ed1f65) Total Average: 66.301500 msec → Total Average: 55.422100 msec ```diff diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua index 14581b0..6889bea 100644 --- a/.config/nvim/lua/plugins/nvim-cmp.lua +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -3,14 +3,6 @@ return { 'hrsh7th/nvim-cmp', version = false, event = { 'InsertEnter' }, - dependencies = { - 'neovim/nvim-lspconfig', - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline', - { 'hrsh7th/vim-vsnip', lazy = true }, -- Vsnipを利用する場合 - }, opts = function() local cmp = require('cmp') return { @@ -61,4 +53,40 @@ return { }) end, }, + { + 'hrsh7th/vim-vsnip', + event = { 'InsertEnter' }, + lazy = true, + version = false, + }, + { + 'neovim/nvim-lspconfig', + event = { 'InsertEnter' }, + lazy = true, + version = false, + }, + { + 'hrsh7th/cmp-nvim-lsp', + event = { 'InsertEnter' }, + lazy = true, + version = false, + }, + { + 'hrsh7th/cmp-buffer', + event = { 'InsertEnter' }, + lazy = true, + version = false, + }, + { + 'hrsh7th/cmp-path', + event = { 'InsertEnter' }, + lazy = true, + version = false, + }, + { + 'hrsh7th/cmp-cmdline', + event = { 'CmdlineEnter' }, + lazy = true, + version = false, + }, } ``` ### colorscheme Total Average: 55.422100 msec → Total Average: 51.519200 msec [Add lazy setting to color scheme · tkancf/dotfiles@2cffab7](https://github.com/tkancf/dotfiles/commit/2cffab7d2f71ad4a120b6ff6af0f6595440295c3) ```diff ❯ yadm diff diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index bb5e42e..d84f907 100644 --- a/.config/nvim/lua/plugins/colorscheme.lua +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -1,8 +1,7 @@ return { { 'https://github.com/navarasu/onedark.nvim', - lazy = false, -- make sure we load this during startup if it is your main colorscheme - priority = 1000, -- make sure to load this before all the other start plugins + event = 'VimEnter', config = function() require('onedark').setup { style = 'warm' ``` ### codecompanion.nvim [Add lazy setting to codecompanion.nvim · tkancf/dotfiles@4657ef8](https://github.com/tkancf/dotfiles/commit/4657ef8b04a35420df148def16833476dfe7b212) Total Average: 51.519200 msec → Total Average: 33.300700 msec ```diff diff --git a/.config/nvim/lua/plugins/ai.lua b/.config/nvim/lua/plugins/ai.lua index b61f963..d03e3b8 100644 --- a/.config/nvim/lua/plugins/ai.lua +++ b/.config/nvim/lua/plugins/ai.lua @@ -1,12 +1,9 @@ return { { "olimorris/codecompanion.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - }, - --config = true, + event = 'WinEnter', opts = { - language = "Japanese", + language = "日本語", adapters = { ollama = function() return require("codecompanion.adapters").extend("ollama", { @@ -21,7 +18,7 @@ return { strategies = { -- Change the default chat adapter chat = { - adapter = "ollama", + adapter = "copilot", }, inline = { adapter = "copilot", ``` ### copilot.vim [Add lazy setting to copilot.vim · tkancf/dotfiles@0384c2b](https://github.com/tkancf/dotfiles/commit/0384c2b0e85f416373112644743aca0e5f0003e7) Total Average: 33.300700 msec → Total Average: 30.630500 msec ```diff diff --git a/.config/nvim/lua/plugins/ai.lua b/.config/nvim/lua/plugins/ai.lua index d03e3b8..3eabe11 100644 --- a/.config/nvim/lua/plugins/ai.lua +++ b/.config/nvim/lua/plugins/ai.lua @@ -27,6 +27,7 @@ return { }, }, { - "https://github.com/github/copilot.vim" + "https://github.com/github/copilot.vim", + event = 'WinEnter', } ``` ### dmacro.vim [Add lazy setting to dmacro.nvim · tkancf/dotfiles@f00d38e](https://github.com/tkancf/dotfiles/commit/f00d38ec5b0b271ddfb41708915a1befa81d2ffe) Total Average: 30.630500 msec → Total Average: 29.697000 msec ```diff diff --git a/.config/nvim/lua/plugins/util.lua b/.config/nvim/lua/plugins/util.lua index bf1e6f0..93c6a11 100644 --- a/.config/nvim/lua/plugins/util.lua +++ b/.config/nvim/lua/plugins/util.lua @@ -80,6 +80,7 @@ return { }, { 'https://github.com/tani/dmacro.nvim', + event = { 'InsertEnter', 'CursorMoved' }, config = function() vim.keymap.set({ "i", "n" }, '', '(dmacro-play-macro)') end ``` ### denops.vim [Add lazy setting to denops · tkancf/dotfiles@0e51219](https://github.com/tkancf/dotfiles/commit/0e5121917f78652d9fbcc17780d4984aca2061e8) Total Average: 29.697000 msec → Total Average: 26.728800 msec ```diff diff --git a/.config/nvim/lua/plugins/util.lua b/.config/nvim/lua/plugins/util.lua index 93c6a11..99e0e31 100644 --- a/.config/nvim/lua/plugins/util.lua +++ b/.config/nvim/lua/plugins/util.lua @@ -41,9 +41,11 @@ return { }, { 'https://github.com/lambdalisue/gin.vim', - dependencies = { - 'https://github.com/vim-denops/denops.vim', - }, + event = { 'BufRead' }, + }, + { + 'https://github.com/vim-denops/denops.vim', + event = { 'BufRead' }, }, { ``` ### 他色々まとめて [Add lazy setting to some plugins · tkancf/dotfiles@f9fab10](https://github.com/tkancf/dotfiles/commit/f9fab10d5620046fd38fd1116187602e1bcc2146) Total Average: 26.728800 msec →Total Average: 20.772000 msec ```diff diff --git a/.config/nvim/lua/plugins/launcher.lua b/.config/nvim/lua/plugins/launcher.lua index c2db082..54f4aaa 100644 --- a/.config/nvim/lua/plugins/launcher.lua +++ b/.config/nvim/lua/plugins/launcher.lua @@ -1,8 +1,7 @@ return { { 'https://github.com/nvim-telescope/telescope.nvim', - dependencies = { 'https://github.com/nvim-lua/plenary.nvim' }, - event = 'BufWinEnter', + event = 'WinEnter', config = function() local wk = require("which-key") wk.add({ diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index a65160c..549e17b 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -2,10 +2,13 @@ return { { 'https://github.com/stevearc/oil.nvim', event = "BufRead", - dependencies = { { "echasnovski/mini.icons", opts = {} } }, config = function() require("oil").setup() vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) end + }, + { "echasnovski/mini.icons", + opts = {}, + lazy = true, } } diff --git a/.config/nvim/lua/plugins/util.lua b/.config/nvim/lua/plugins/util.lua index 99e0e31..fbeebc7 100644 --- a/.config/nvim/lua/plugins/util.lua +++ b/.config/nvim/lua/plugins/util.lua @@ -16,10 +16,12 @@ return { end, }, { - 'https://github.com/rbtnn/vim-ambiwidth' + 'https://github.com/rbtnn/vim-ambiwidth', + event = { 'VimEnter' }, }, { - 'https://github.com/thinca/vim-qfreplace' + 'https://github.com/thinca/vim-qfreplace', + event = { 'CmdlineEnter' }, }, { 'https://github.com/yuki-yano/lexima-alter-command.vim', @@ -38,6 +40,7 @@ return { }, { 'https://github.com/machakann/vim-sandwich', + enabled = false, }, { 'https://github.com/lambdalisue/gin.vim', @@ -71,6 +74,7 @@ return { }, { 'https://github.com/haya14busa/vim-asterisk', + keys = { '*', '#', 'g*', 'g#' }, config = function() local opts = { noremap = true, silent = true } ``` ## まとめ ここまでの変更で、Total Average: 95.994600 msec → Total Average: 20.772000 msec まで改善できた。 " vim: foldmethod=marker foldlevel=1 --- # Neovimのプラグインマネージャーをlazy.nvimからvim-jetpackに移行する ## 理由 - Lazy.nvimのoptsが暗黙的に何やってるか分からずに、結局config = functionってやることがあって微妙 - [tani/vim-jetpack: The lightning-fast plugin manager, alternative to vim-plug](https://github.com/tani/vim-jetpack) ## 設定 - 設定スタイル選び - Modern packer.nvim/ paq.nvim style - 設定移行 - 一旦設定をinit.lua一つにまとめてみる - 該当commit - https://github.com/tkancf/dotfiles/commit/bbc259c28ddcd766a568eebefae0c1b49d462594 - https://github.com/tkancf/dotfiles/commit/ce5c5c72dbbfb6f8c142080ef026b970e8f8e656 ```lua require('basic') -- vim-jetpack -- Automatic installation vim-jetpack on startup -- https://github.com/tani/vim-jetpack?tab=readme-ov-file#automatic-installation-on-startup local jetpackfile = vim.fn.stdpath('data') .. '/site/pack/jetpack/opt/vim-jetpack/plugin/jetpack.vim' local jetpackurl = "https://raw.githubusercontent.com/tani/vim-jetpack/master/plugin/jetpack.vim" if vim.fn.filereadable(jetpackfile) == 0 then vim.fn.system(string.format('curl -fsSLo %s --create-dirs %s', jetpackfile, jetpackurl)) end vim.cmd('packadd vim-jetpack') require('jetpack.packer').add { {'tani/vim-jetpack'}, -- bootstrap { 'https://github.com/cohama/lexima.vim', config = function() vim.g.lexima_enable_space_rules = 0 end, }, { 'https://github.com/rbtnn/vim-ambiwidth' }, { 'https://github.com/thinca/vim-qfreplace' }, { 'https://github.com/yuki-yano/lexima-alter-command.vim', requires = { 'https://github.com/cohama/lexima.vim' }, config = function() vim.cmd [[ LeximaAlterCommand obw ObsidianWorkspace LeximaAlterCommand obd ObsidianDailies LeximaAlterCommand obt ObsidianToday LeximaAlterCommand obe ObsidianExtractNote ]] end, }, { 'https://github.com/machakann/vim-sandwich', }, { 'https://github.com/lambdalisue/gin.vim', requires = { 'https://github.com/vim-denops/denops.vim', }, }, { 'https://github.com/monaqa/dial.nvim', config = function() vim.keymap.set("n", "", function() require("dial.map").manipulate("increment", "normal") end) vim.keymap.set("n", "", function() require("dial.map").manipulate("decrement", "normal") end) vim.keymap.set("n", "g", function() require("dial.map").manipulate("increment", "gnormal") end) vim.keymap.set("n", "g", function() require("dial.map").manipulate("decrement", "gnormal") end) vim.keymap.set("v", "", function() require("dial.map").manipulate("increment", "visual") end) vim.keymap.set("v", "", function() require("dial.map").manipulate("decrement", "visual") end) vim.keymap.set("v", "g", function() require("dial.map").manipulate("increment", "gvisual") end) vim.keymap.set("v", "g", function() require("dial.map").manipulate("decrement", "gvisual") end) end, }, { 'https://github.com/haya14busa/vim-asterisk', config = function() local opts = { noremap = true, silent = true } vim.api.nvim_set_keymap('', '*', '(asterisk-z*)', opts) vim.api.nvim_set_keymap('', '#', '(asterisk-z#)', opts) vim.api.nvim_set_keymap('', 'g*', '(asterisk-gz*)', opts) vim.api.nvim_set_keymap('', 'g#', '(asterisk-gz#)', opts) end }, { 'https://github.com/tani/dmacro.nvim', config = function() vim.keymap.set({ "i", "n" }, '', '(dmacro-play-macro)') end }, { 'https://github.com/navarasu/onedark.nvim', lazy = false, -- make sure we load this during startup if it is your main colorscheme priority = 1000, -- make sure to load this before all the other start plugins config = function() require('onedark').setup { style = 'warm' } require('onedark').load() end, }, { 'https://github.com/stevearc/oil.nvim', -- Optional dependencies requires = { "nvim-tree/nvim-web-devicons" }, config = function() require("oil").setup() vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) end }, { 'https://github.com/nvim-telescope/telescope.nvim', requires = { 'https://github.com/nvim-lua/plenary.nvim' }, }, { "folke/which-key.nvim", config = function() require("which-key").add({ { "", group = "Telescope" }, { ";", "lua require('telescope.builtin').command_history()", desc = "Command history" }, { "b", "lua require('telescope.builtin').buffers()", desc = "Buffers" }, { "f", "lua require('telescope.builtin').find_files()", desc = "Find Files" }, { "g", "lua require('telescope.builtin').live_grep()", desc = "Live Grep" }, { "h", "lua require('telescope.builtin').help_tags()", desc = "Help Tags" }, { "u", "lua require('telescope.builtin').oldfiles()", desc = "Recent Files" }, }) end }, { 'https://github.com/mattn/vim-maketable', lazy = true, ft = 'markdown', }, { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", config = function() require 'nvim-treesitter.configs'.setup { highlight = { ensure_installed = { "markdown" }, enable = true, additional_vim_regex_highlighting = false, }, } end, }, { "https://github.com/epwalsh/obsidian.nvim", ft = "markdown", requires = { -- Required. 'https://github.com/nvim-lua/plenary.nvim', 'https://github.com/hrsh7th/nvim-cmp', 'https://github.com/nvim-telescope/telescope.nvim', 'https://github.com/nvim-treesitter/nvim-treesitter', -- see below for full list of optional dependencies 👇 }, config = function() require("obsidian").setup({ ui = { enable = true }, attachments = { img_folder = "assets", -- This is the default -- A function that determines the text to insert in the note when pasting an image. -- It takes two arguments, the `obsidian.Client` and an `obsidian.Path` to the image file. -- This is the default implementation. ---@param client obsidian.Client ---@param path obsidian.Path the absolute path to the image file ---@return string img_text_func = function(client, path) path = client:vault_relative_path(path) or path return string.format("![%s](%s)", path.name, path) end, }, -- Base dir of Obsidian vault workspaces = { { name = "Memo", path = "~/Dropbox/Memo", }, { name = "Note", path = "~/Dropbox/Note", }, { name = "note.tkancf.com", path = "~/src/github.com/tkancf/note.tkancf.com/content", }, }, completion = { -- Set to false to disable completion. nvim_cmp = true, -- Trigger completion at 2 chars. min_chars = 2, }, -- Optional, configure key mappings. These are the defaults. If you don't want to set any keymappings this -- way then set 'mappings = {}'. mappings = { -- Overrides the 'gf' mapping to work on markdown/wiki links within your vault. ["gf"] = { action = function() return require("obsidian").util.gf_passthrough() end, opts = { noremap = false, expr = true, buffer = true }, }, -- Toggle check-boxes. ["ch"] = { action = function() return require("obsidian").util.toggle_checkbox() end, opts = { buffer = true }, }, -- Smart action depending on context, either follow link or toggle checkbox. [""] = { action = function() if require("obsidian").util.cursor_on_markdown_link(nil, nil, true) then return "ObsidianFollowLink" end end, opts = { buffer = true, expr = true }, } }, -- Either 'wiki' or 'markdown'. preferred_link_style = "markdown", -- Daily note settings. daily_notes = { -- Optional, if you keep daily notes in a separate directory. folder = "", -- Optional, if you want to change the date format for the ID of daily notes. date_format = "%Y-%m-%d", -- Optional, if you want to automatically insert a template from your template directory like 'daily.md' template = nil }, -- Template settings. templates = { subdir = ".config/template", date_format = "%Y-%m-%d", time_format = "%H:%M", -- A map for custom variables, the key should be the variable and the value a function substitutions = { yesterday = function() return os.date("%Y-%m-%d", os.time() - 86400) end, }, }, -- Optional, customize how note IDs are generated given an optional title. ---@param title string|? ---@return string note_id_func = function(title) -- Generate a unique ID YYYYMMDDHHMMSS format return tostring(os.date("%Y%m%d%H%M%S")) end, -- Optional, alternatively you can customize the frontmatter data. ---@return table note_frontmatter_func = function(note) -- Add the title of the note as an alias. if note.title then note:add_alias(note.title) end -- Create timestamps for created and updated times local created_time = os.date("%Y-%m-%d %H:%M") -- ISO 8601 format local updated_time = created_time -- Initially, created and updated times are the same -- Initialize the frontmatter table local out = { id = note.id, title = note.title, aliases = note.aliases, tags = note.tags, created = created_time, updated = updated_time } -- If note.metadata already has created or updated, use those values instead if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then for k, v in pairs(note.metadata) do out[k] = v end if note.metadata.created then out.created = note.metadata.created end if note.metadata.updated then out.updated = note.metadata.updated end end return out end, -- Optional, by default when you use `:ObsidianFollowLink` on a link to an external -- URL it will be ignored but you can customize this behavior here. ---@param url string follow_url_func = function(url) -- Open the URL in the default web browser. vim.fn.jobstart({ "open", url }) -- Mac OS -- vim.fn.jobstart({"xdg-open", url}) -- linux end, vim.api.nvim_set_keymap('n', 'on', 'ObsidianNew', { noremap = true, silent = true }), vim.api.nvim_set_keymap('n', 'os', 'ObsidianFollowLink hsplit', { noremap = true, silent = true }), vim.api.nvim_set_keymap('n', 'ot', 'ObsidianToday', { noremap = true, silent = true }), vim.api.nvim_set_keymap('n', 'ob', 'ObsidianBacklinks', { noremap = true, silent = true }), }) end }, { "https://github.com/arakkkkk/marktodo.nvim", config = function() require("marktodo").setup() end, }, } -- Automatic plugin installation on startup local jetpack = require('jetpack') for _, name in ipairs(jetpack.names()) do if not jetpack.tap(name) then jetpack.sync() break end end -- -- lazy.nvim -- -- local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -- if not vim.loop.fs_stat(lazypath) then -- vim.fn.system({ -- "git", -- "clone", -- "--filter=blob:none", -- "https://github.com/folke/lazy.nvim.git", -- "--branch=stable", -- latest stable release -- lazypath, -- }) -- end -- vim.opt.rtp:prepend(lazypath) -- require("lazy").setup("plugins") -- -- -- My plugins -- -- vim.api.nvim_set_keymap('n', 'oo', "lua require('markdown_title_picker').open_markdown_by_title()", -- -- { noremap = true, silent = true }) -- require('markdown_highlights').setup() -- require('plugins.tkancf.markdown_title_picker').setup() ``` ## 2025/01/10追記 - vim-jetpackに移行する作業してたら、Lazy.nvimに対する理解も深まったので、逆に差し戻しました。 --- # nvim-cmpとLSPをちゃんと改めて設定してみる - 周辺ツールが色々絡み合ってて難しいけど、下記記事が理解の参考になった - [Neovim の LSP 関係のプラグインの役割](https://zenn.dev/futsuuu/articles/3b74a8acec166e) - 私がとりあえず必要そうなもの - nvim-cmp: 補完 - nvim-lspconfig: 設定集 - mason.nvim: Language Serverのマネージャー - mason-lspconfig: いい感じに設定を組み合わせてくれる君? ## 設定 ```lua return { { 'https://github.com/hrsh7th/nvim-cmp', dependencies = { 'neovim/nvim-lspconfig', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-path', 'hrsh7th/cmp-cmdline', }, lazy = true, config = function() local cmp = require'cmp' cmp.setup({ snippet = { -- REQUIRED - you must specify a snippet engine expand = function(args) vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. -- require('snippy').expand_snippet(args.body) -- For `snippy` users. -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) end, }, window = { -- completion = cmp.config.window.bordered(), -- documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'vsnip' }, -- For vsnip users. -- { name = 'luasnip' }, -- For luasnip users. -- { name = 'ultisnips' }, -- For ultisnips users. -- { name = 'snippy' }, -- For snippy users. }, { { name = 'buffer' }, }) }) -- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below -- Set configuration for specific filetype. -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline({ '/', '?' }, { mapping = cmp.mapping.preset.cmdline(), sources = { { name = 'buffer' } } }) -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline(':', { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } }), matching = { disallow_symbol_nonprefix_matching = false } }) end }, } ``` ## 2025-06-12 追記 - mason.nvim、mason-lspconfigでLSPインストール、管理するのはやめて、miseに全部インストールを任せるようにした --- # Neovim GUIを色々試したメモ ## 各GUI比較 - Neovide - カーソル移動がかっこいい - 煩わしい - 下記設定でOFFにすること可能 ```lua -- GUI (Neovide) if vim.g.neovide then vim.g.neovide_position_animation_length = 0 vim.g.neovide_cursor_animation_length = 0.00 vim.g.neovide_cursor_trail_size = 0 vim.g.neovide_cursor_animate_in_insert_mode = false vim.g.neovide_cursor_animate_command_line = false vim.g.neovide_scroll_animation_far_lines = 0 vim.g.neovide_scroll_animation_length = 0.00 end ``` - 日本語入力時にそのまま入力されず、IMEが確定されるまで日本語が入力されない - 複数ウィンドウ開くと、Mac上で別のアプリケーションとして扱われるので、Dock上にNeovideがたくさん並ぶ - CMD+Tabでアプリ変更のときにも邪魔 - goneovim - 複数ウィンドウ開くと、Mac上で別のアプリケーションとして扱われるので、Dock上にNeovideがたくさん並ぶ - CMD+Tabでアプリ変更のときにも邪魔 - 日本語入力問題なし - シンプル - kを連打すると、アプリウィンドウ左上にkって表示される。謎 - VimR - Mac専用 - 複数ウィンドウ開いても別アプリとして扱われず大変良い - 日本語入力問題なし - 若干UIがダサいけど、我慢できる範囲 - デフォルトで表示されてるファイルツリーも折り畳めるので悪くない - しばらくこれを試してみようかな ## 参考資料 - [github.com/akiyosi/goneovim](https://github.com/akiyosi/goneovim) - [Neovide - Neovide](https://neovide.dev/index.html) - [qvacua/vimr: VimR — Neovim GUI for macOS in Swift](https://github.com/qvacua/vimr) - [Shorthand for disabling animations · Issue #2565 · neovide/neovide](https://github.com/neovide/neovide/issues/2565) --- # 2025-01 # 2025/01/31 - [DeepSeek-R1の論文読んだ?【勉強になるよ】](https://zenn.dev/asap/articles/34237ad87f8511) 後で読む ```bash ❰tkan❙~❱✔≻ fisher install gazorby/fish-abbreviation-tips fisher install version 4.4.5 Fetching https://api.github.com/repos/gazorby/fish-abbreviation-tips/tarball/HEAD Installing gazorby/fish-abbreviation-tips /Users/tkan/.config/fish/functions/__abbr_tips_bind_newline.fish /Users/tkan/.config/fish/functions/__abbr_tips_bind_space.fish /Users/tkan/.config/fish/functions/__abbr_tips_clean.fish /Users/tkan/.config/fish/functions/__abbr_tips_init.fish /Users/tkan/.config/fish/conf.d/abbr_tips.fish Installed 1 plugin/s ``` - atuinを入れる ```bash ❰tkan❙~❱✘≻ brew install atuin ==> Downloading https://formulae.brew.sh/api/formula.jws.json ==> Downloading https://formulae.brew.sh/api/cask.jws.json ==> Downloading https://ghcr.io/v2/homebrew/core/atuin/manifests/18.4.0 #################################################################################################################################################################################################### 100.0% ==> Fetching atuin ==> Downloading https://ghcr.io/v2/homebrew/core/atuin/blobs/sha256:186d1bb3e620de43fd544ba346900eff75967f539a6d2760af15217165d59f29 #################################################################################################################################################################################################### 100.0% ==> Pouring atuin--18.4.0.arm64_sequoia.bottle.tar.gz ==> Caveats fish completions have been installed to: /opt/homebrew/share/fish/vendor_completions.d To start atuin now and restart at login: brew services start atuin Or, if you don't want/need a background service you can just run: /opt/homebrew/opt/atuin/bin/atuin daemon ==> Summary 🍺 /opt/homebrew/Cellar/atuin/18.4.0: 14 files, 28MB ==> Running `brew cleanup atuin`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). ``` config.fishに追加 ```bash # atuin ## https://docs.atuin.sh/ ## Atuin replaces your existing shell history with a SQLite database, and records additional context for your commands. With this context, Atuin gives you faster and better search of your shell history. atuin init fish | source ``` jethrokuan/fzfがキーバインド競合するので削除 - [PatrickF1/fzf.fish: 🔍🐟 Fzf plugin for Fish](https://github.com/PatrickF1/fzf.fish)のほうが良さそうかもお試し ```bash ❰tkan❙~❱✔≻ fisher install PatrickF1/fzf.fish fisher install version 4.4.5 Fetching https://api.github.com/repos/patrickf1/fzf.fish/tarball/HEAD Installing patrickf1/fzf.fish /Users/tkan/.config/fish/functions/_fzf_configure_bindings_help.fish /Users/tkan/.config/fish/functions/_fzf_extract_var_info.fish /Users/tkan/.config/fish/functions/_fzf_preview_changed_file.fish /Users/tkan/.config/fish/functions/_fzf_preview_file.fish /Users/tkan/.config/fish/functions/_fzf_report_diff_type.fish /Users/tkan/.config/fish/functions/_fzf_report_file_type.fish /Users/tkan/.config/fish/functions/_fzf_search_directory.fish /Users/tkan/.config/fish/functions/_fzf_search_git_log.fish /Users/tkan/.config/fish/functions/_fzf_search_git_status.fish /Users/tkan/.config/fish/functions/_fzf_search_history.fish /Users/tkan/.config/fish/functions/_fzf_search_processes.fish /Users/tkan/.config/fish/functions/_fzf_search_variables.fish /Users/tkan/.config/fish/functions/_fzf_wrapper.fish /Users/tkan/.config/fish/functions/fzf_configure_bindings.fish /Users/tkan/.config/fish/conf.d/fzf.fish /Users/tkan/.config/fish/completions/fzf_configure_bindings.fish Updated 1 plugin/s ``` # 2025/01/30 - fish shellの設定してる - fishプラグイン作り方気になる ## [jorgebucaran/fisher](https://github.com/jorgebucaran/fisher)を導入する README通りに導入した。 `~/.config`配下のファイルが更新されたので、そのままdotfilesで管理する ```bash ❰tkan❙~❱✔≻ curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher fisher install version 4.4.5 Fetching https://api.github.com/repos/jorgebucaran/fisher/tarball/HEAD Installing jorgebucaran/fisher /Users/tkan/.config/fish/functions/fisher.fish /Users/tkan/.config/fish/completions/fisher.fish Installed 1 plugin/s ``` fzf連携のプラグインを入れてみる ```bash ❰tkan❙~❱✔≻ fisher install jethrokuan/fzf fisher install version 4.4.5 Fetching https://api.github.com/repos/jethrokuan/fzf/tarball/HEAD Installing jethrokuan/fzf /Users/tkan/.config/fish/functions/__fzf_cd.fish /Users/tkan/.config/fish/functions/__fzf_complete.fish /Users/tkan/.config/fish/functions/__fzf_complete_preview.fish /Users/tkan/.config/fish/functions/__fzf_find_file.fish /Users/tkan/.config/fish/functions/__fzf_get_dir.fish /Users/tkan/.config/fish/functions/__fzf_open.fish /Users/tkan/.config/fish/functions/__fzf_parse_commandline.fish /Users/tkan/.config/fish/functions/__fzf_reverse_isearch.fish /Users/tkan/.config/fish/functions/__fzfcmd.fish /Users/tkan/.config/fish/conf.d/fzf.fish Installed 1 plugin/s ``` # 2025/01/29 - 寿司取った # 2025/01/27 ## あとで読む - [fishプラグイン紹介2025年1月版](https://zenn.dev/yuys13/articles/fish-plugins-2025) - [Webプログラマーのための個人開発 ~ゼロから始めてお金を生み出すまで~](https://zenn.dev/k_dev/articles/4f7b55712d5252) - [DIすると何がいいんだっけ](https://zenn.dev/mj2mkt/articles/2024-12-03-is-di-necessary) - [大企業の幹部がやっている事について - Software Transactional Memo](https://kumagi.hatenablog.com/entry/what-executives-do) # 2025/01/26 - [chezmoiを改めて試す](https://tkancf.com/blog/trying-chezmoi-again) - [GitHub - stevearc/quicker.nvim: Improved UI and workflow for the Neovim quickfix](https://github.com/stevearc/quicker.nvim) 良さそう - 豚キムチ丼つくった # 2025/01/25 - [Dotfiles Management | Hacker News](https://news.ycombinator.com/item?id=34296396) 読んでる - いまはyadm使ってるけど、fish shellの補完でめっちゃ時間がかかるIssueがあるので、乗り換えたい - [Tab completion for `yadm` will freeze fish · Issue #8207 · fish-shell/fish-shell](https://github.com/fish-shell/fish-shell/issues/8207) - homeshick - これ知らなかった - aliasを貼るだけ - chezmoi - NixのHome Manager - [定期的に何度も読み返している個人的名エントリを置いておく - 空の箱](https://blog.inorinrinrin.com/entry/2025/01/25/101859)読んでる - 良いまとめだ。 - ["提案"のレベルを上げる - Konifar's ZATSU](https://konifar-zatsu.hatenadiary.jp/entry/2023/11/01/193210)読んでる - 言語化凄いなぁ - 意識してできるとよさそう ## [homeshickを試す](https://tkancf.com/blog/trying-homeshick) - [chezmoiを改めて試す](https://tkancf.com/blog/trying-chezmoi-again) # 2025/01/24 - [人間によるコーディング禁止の CLINE 縛りでゲームを作らせてみた感想](https://zenn.dev/mizchi/articles/game-with-cline)面白い - ちょっとだけMTG Arena # 2025/01/23 - 夜勤続きだったからめっちゃ寝てた - [OpenRouter](https://openrouter.ai/)良さそう # 2025/01/22 - [Neovimの設定](https://tkancf.com/blog/20250122152315)見直してた - 最近こればっかやってるけど、割といい感じになった # 2025/01/21 - エルドレインの森クイックドラフトした - 7-2 - いい感じに勝てた - レアなしで勝てたのが嬉しい - ![デッキリスト](https://i.gyazo.com/fbd661b91446284d8a595b00d5c307f0.jpg) - [17Lands.comのリンク](https://www.17lands.com/details/b42ca81fe88748019cafc4059dc466c5) # 2025/01/20 - 朝からDSKのプラチナドラフトした - 5-2 - 収支プラスで着地した。いいじゃん - [【AI駆動開発xNext.js】最強ライブラリ25選を本職Webエンジニアが徹底解説!これを見れば全部OK](https://zenn.dev/aimasaou/articles/ae2cc09d2b6988)読んだ - [【MTGアリーナ】17Landsのデータを活用したデータドラフトのすすめ|Ombre](https://note.com/ombre/n/n1f6715d917e5)読んでる - [luaのソースコードから、コメントを読み取ってドキュメントを生成するツールについて調べる](https://tkancf.com/blog/generating-lua-docs-from-comments) - [マスタリーパスを買うべき理由:無課金でレアカードを効率的に集める資産運用方法【MTGアリーナ】 | おじょーゲームズ MTGアリーナブログ](https://ojoegames-mtg.com/buy-mastery-path/)読んでる # 2025/01/18 - [2025年の目標](https://tkancf.com/blog/goals-for-2025) - yadmみたみたいなやつ作りたい - obsidian.nvimみたいなやつLSP使って作りたい - MTGのリミテッドもっとやりたい # 2025/01/17 - [Neovimの起動時間を見直してみる](https://tkancf.com/blog/reviewing-neovim-startup-time) - 引き続き # 2025/01/16 - [Neovimの起動時間を見直してみる](https://tkancf.com/blog/reviewing-neovim-startup-time) - 引き続き # 2025/01/15 - [Neovimの起動時間を見直してみる](https://tkancf.com/blog/reviewing-neovim-startup-time) # 2025/01/14 - [telescope.nvim 拡張機能のつくりかた](https://zenn.dev/sankantsu/articles/af04828900d544) 読んだ - [CodeCompanion.nvim](https://codecompanion.olimorris.dev/) を試してみる - これめちゃくちゃ美味かった。また作る - - [肉吸い風肉豆腐](https://tkancf.com/blog/20250114221213) # 2025/01/13 - [Welcome to CodeCompanion.nvim | CodeCompanion.nvim](https://codecompanion.olimorris.dev/) 気になる # 2025/01/12 - 寒すぎてやばい、米とげない - 頑張って研いだ # 2025/01/11 - [かぼちゃのポタージュ (シロカのブレンダーで)](https://tkancf.com/blog/20250112000545) - 美味しくできた - 抱っこ紐届いた!使うとよく寝てくれる気がする # 2025/01/10 - [blink.nvimでobsidian.nvimの補完を利用する](https://tkancf.com/blog/20250110153217) - nvim-cmpからblink.nvimへの以降を試していて、ここで一番詰まったのでメモ - 抱っこ紐を見に行った - エルゴベビー オムニブリーズが一番良かったのでコレかな # 2025/01/09 - [Neovim の LSP 関係のプラグインの役割](https://zenn.dev/futsuuu/articles/3b74a8acec166e)分かりやすい - [nvim-cmpとLSPをちゃんと改めて設定してみる](https://tkancf.com/blog/configuring-nvim-cmp-and-lsp) - [Neovimのプラグインマネージャーをlazy.nvimからvim-jetpackに移行する](https://tkancf.com/blog/switching-to-vim-jetpack) # 2025/01/08 - nvim-cmpとblink共存させたい - 補完は上手く行ったけど、ファイル作成が上手くいかなかった - 嘘、blinkの補完確定キーマップを勘違いしてただけ # 2025/01/07 - [面倒なスクショ命名はローカルvlmにやらせよう on Mac](https://zenn.dev/wmoto_ai/articles/58e6bcf58d6032) - 面白い ## miseセットアップ miseに良さげなリリースが来てたのでセットアップ ```bash brew install mise echo 'eval "$(/opt/homebrew/bin/mise activate zsh)"' >> ~/.zshrc ``` ## blink.cmpを試す - 結構いい感じ - `list = { selection = { preselect = true, auto_insert = true } },` が上手く動かないのが謎 - [ドキュメント](https://cmp.saghen.dev/configuration/completion.html#list)には記載あるのに... ```lua { 'saghen/blink.cmp', dependencies = 'rafamadriz/friendly-snippets', version = '*', opts = { keymap = { preset = 'super-tab' }, sources = { default = { 'lsp', 'path', 'snippets', 'buffer' }, }, completion = { accept = { auto_brackets = { enabled = true }, }, -- list = { selection = { preselect = true, auto_insert = true } }, list = { selection = "preselect" }, }, }, opts_extend = { "sources.default" }, }, ``` - 上記原因わかった! - 今丁度[このcommit](https://github.com/Saghen/blink.cmp/commit/8126d0e6a2a0e62d3872d718c3d50313f9f7fe3a)がGitHub Actionsでリリースされる前の合間なんだ - v0.9.4でこのcommitがリリースされれば、設定動きそう - それまでは、もとの設定を使おう # 2025/01/06 - karabiner.tsで色々やってる - オプションとシフトキー入れ替えようかなの気持ちありけり - [Epomaker Split 65](https://epomaker.jp/ja/products/epomaker-split-65) - めっちゃ欲しい - ガスケットマウント - ホットスワップ - 65%で矢印あり - 分割式 - VIA対応 - 19800円 # 2025/01/04 - なんかバタバタしてて、年末振り返りと今年の目標決め忘れてたから決めたい - 振り返り - 年始は頑張ってた - 4月ぐらいまではいい感じにコード書いたり、アウトプットしたりしていた - 4月以降一気に出来なくなったのは残念 - 8月末にAWS SAPの資格が期限切れるって状況だったので、7, 8月は慌てて更新試験の勉強してた - 無事、更新成功した - 12月に出産予定だったので、そこから育休取らせてもらうって話を会社としたり、そのタイミングで希望してた部署への移動とか現部署のネージャーを引き継いだりとか、仕事もそこそこ忙しくしてた - 育休明けたら久々にプレイヤーとして手を動かす事が主業務になるので、技術的に成長出来るように頑張りてーってお気持ち - 妻が妊娠してからはそっちの比重が多くなって仕事とMTGしかしなくなった - 12月に無事子供が産まれた - 子育てそこそこ大変だけど、日々進化していく息子見るの面白い - ただ、育休取って2人がかりでこの大変さなの、ワンオペ育児とかしてる人類皆バグってるだろって気持ちになってる - 急に泣きだした原因特定して対応するの仕事の障害対応に似てる - 突発で夜勤が発生する感じとかも似てる - 目標 - 健康大事にしたい - 子供産まれたし、風邪引いて移したりしたくないし - 早速おむつ替えのせいで手荒れて、腕が真っ赤になったけど - 腰、首、手首酷使してるので気をつけていきたい - 子育て頑張りたい - 頑張るよ - 子供見ながらちょっとずつでもインプット、アウトプット積んでいきたい - 抱っこしてると手があかないので、スマホからでも良い感じにメモれる環境を頑張って用意した - このメモも抱っこしながら音声入力と合わせてやってる - 腰を据えてPCに向かったり、本を読んだりは無理そうなので、細切れの時間で上手いことやりたい - 仕事 - 育休明けたら久々にプレイヤーとして手を動かす事が主業務になるので、技術的に成長出来るように頑張りてーってお気持ち # 2025/01/03 - [Release v2024.11.8 · jdx/mise · GitHub](https://github.com/jdx/mise/releases/tag/v2024.11.8) これ最高じゃん > aqua backend by [@jdx](https://github.com/jdx) in [#2995](https://github.com/jdx/mise/pull/2995) - mise、aqua、asdfで悩んで混在しちゃってたけど、miseが良さそう # 2025/01/02 - 息子氏ほぼ寝なかったので夜勤してた - その後昼寝してたら一日終わった - karabiner.tsを試したい - [karabiner.tsがとてもいいぞ](https://zenn.dev/ryoppippi/articles/85373aaf0c92e0) - [evan-liu/karabiner.ts: Write Karabiner-Elements configuration in TypeScript](https://github.com/evan-liu/karabiner.ts) まずは下記からTSに変換していく ```json { "description": "英数・かなキーを他のキーと組み合わせて押したときに、コマンドキーを送信する。", "manipulators": [ { "from": { "key_code": "japanese_eisuu", "modifiers": { "optional": ["any"] } }, "to": [{ "key_code": "left_command" }], "to_if_alone": [{ "key_code": "japanese_eisuu" }], "type": "basic" }, { "from": { "key_code": "japanese_kana", "modifiers": { "optional": ["any"] } }, "to": [{ "key_code": "right_command" }], "to_if_alone": [{ "key_code": "japanese_kana" }], "type": "basic" }, { "from": { "key_code": "right_command", "modifiers": { "optional": ["any"] } }, "to": [{ "key_code": "right_command" }], "to_if_alone": [{ "key_code": "japanese_kana" }], "type": "basic" } ] } ``` - [Neovim GUIを色々試す](https://tkancf.com/blog/neovim-gui-experiments) # 2025/01/01 - 正月!!あけおめ!! - にじさんじのカウントダウンライブ見てた - " vim: foldmethod=marker foldlevel=1 --- # MARCO POLO ROUGE - マルコ ポーロ ルージュ - [MARCO POLO ROUGE / マルコ ポーロ ルージュ | すべての商品 | マリアージュフレール Official Online Tea Emporium](https://www.mariagefreres.co.jp/view/item/000000000027) - ノンカフェインの紅茶 - 気になってる --- # 2024-12-16のMTG禁止改訂予想 禁止改訂があるらしいので、予想しておく よくやるフォーマットはモダンとレガシーなので、それ以外はあんま分かってないよ ### モダン 現環境の印象としてはよくない。エネルギーが強すぎて環境支配してる感じなので、流石に禁止出るんじゃないかなという印象 禁止対象が難しいところ、どこ禁止してもエネルギーはある程度耐えちゃいそうなんだよなぁ〜 魂の導き手は結構影響与えれそうだし個人的な禁止推し 世間的には色めき立つ猛竜が有力そう あと、一つの指輪流石にもうダメでは?と思ってる。流石にあらゆるデッキに入り過ぎだし、指輪だけで試合が捲れるの微妙な気がする - 禁止予想 - 魂の導き手 - 一つの指輪 ### レガシー ちょっと前まではリアニが勝ちすぎてて微妙な環境でしたが、なんかメタが回り始めてて色んなデッキが勝ち始めてる感じがします。 禁止するとしたら超能力蛙。 個人的にはノーチェン予想です。ウィザーズが指輪物語売り切ったしもうええか、ってなった場合はカザド=ドゥームのトロールかな… 苛立たしいガラクタに対するヘイトも結構高そうですが、少なくとも今回は禁止しなさそうな気がします。 ### まとめ モダンホライゾン3発売以降、モダンやる気なくなってレガシー始めたので個人的にはまぁ良いんですけど、モダン専任の人今辛そう。早く禁止改訂きてほしいな。 --- # 気になる紅茶 - [国産紅茶のヤベーやつ、三選|sabasty](https://note.com/sabasty/n/n1a11dbb45197) - 福岡県八女市 千代乃園 - 茨城県猿島市 吉田茶園 - 静岡県島田市 井村園 - [国産紅茶のやべーやつ、リターンズ|sabasty](https://note.com/sabasty/n/n85c16550c760) - 堀口製茶 カクホリ 紅茶べにふうき - マルヒ製茶 香駿 MB204セカンドフラッシュ - 清水園 埼玉夢紅茶 ゆめわかば1st - [MARCO POLO ROUGE - マルコ ポーロ ルージュ](https://tkancf.com/blog/marco-polo-rouge) - [CRAFT BREW TEA– TEA ARTISAN CRAFTED](https://marushichi-tac.com/collections/craft-brew-tea) --- # 美味しい紅茶 - [Midnight Hour Tea | TWG Tea](https://twgtea.com/en/loose-tea/midnight-hour-tea-t6800?srsltid=AfmBOor4Ogjprf7mVrhiNwe5wZ3uxewCJHFoBtVcp6W0-Q_AiNx4QZY-) - カフェインレスなのに、全然そんな感じがしないのでめちゃ良い --- # iPhoneのショートカットで現在開いているページのリンクをMarkdown形式で取得 - 便利 - https://www.icloud.com/shortcuts/8ff6a09d26104b8da98c7d6b166b8f31 - ![iPhoneのショートカット設定 スクショ](https://i.gyazo.com/16b72e30bf2a56dd5b1208d9cae92c39.png) --- # LOG: k3sのセットアップ作業 ## インストール - GitHub: https://github.com/k3s-io/k3s のクイックスタート通りに進める ```bash tkancf@s01:~$ curl -sfL https://get.k3s.io | sh - [sudo] password for tkancf: [INFO] Finding release for channel stable [INFO] Using v1.30.4+k3s1 as release [INFO] Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.30.4+k3s1/sha256sum-amd64.txt [INFO] Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.30.4+k3s1/k3s [INFO] Verifying binary download [INFO] Installing k3s to /usr/local/bin/k3s [INFO] Skipping installation of SELinux RPM [INFO] Creating /usr/local/bin/kubectl symlink to k3s [INFO] Creating /usr/local/bin/crictl symlink to k3s [INFO] Creating /usr/local/bin/ctr symlink to k3s [INFO] Creating killall script /usr/local/bin/k3s-killall.sh [INFO] Creating uninstall script /usr/local/bin/k3s-uninstall.sh [INFO] env: Creating environment file /etc/systemd/system/k3s.service.env [INFO] systemd: Creating service file /etc/systemd/system/k3s.service [INFO] systemd: Enabling k3s unit Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service. [INFO] systemd: Starting k3s ``` ## インストール後の状態確認 ```bash tkancf@s01:~$ sudo kubectl get nodes NAME STATUS ROLES AGE VERSION s01 Ready control-plane,master 65s v1.30.4+k3s1 ``` ## kubectlをローカルのPC(Mac)から実行可能にする - kubectlをMacにインストール ```bash ❯ brew install kubectl ``` - yamlファイル`/etc/rancher/k3s/k3s.yaml`をローカルにコピー - yamlファイル内のIPアドレスをs01サーバのDNSに変更 - tailscaleを利用しているので、`s01` を記載 - こんな感じ↓ ```yaml apiVersion: v1 clusters: - cluster: certificate-authority-data: LS0t(中略) server: https://s01:6443 name: default contexts: - context: cluster: default user: default name: default current-context: default kind: Config preferences: {} users: - name: default user: client-certificate-data: LS0t(中略) client-key-data: LS0(中略) ``` - コピーしてきたyamlファイルを参照するように環境変数を設定 ```bash export KUBECONFIG=./k3s.yaml ``` - うまく行った ```bash ❯ kubectl get nodes NAME STATUS ROLES AGE VERSION s01 Ready control-plane,master 39m v1.30.4+k3s1 ``` --- # LOG: LVMの論理ボリューム拡張 ## 課題 - `df` コマンドで表示されるディスク容量が、物理ディスクの容量と比較して少ない - LVMの未割り当て領域が多くあったので、割り当てた ## 調査結果 - `lsblk` コマンドでディスクの構成を確認したところ、以下のようになっていた: ``` NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS nvme0n1 259:0 0 953.9G 0 disk ├─nvme0n1p1 259:1 0 1G 0 part /boot/efi ├─nvme0n1p2 259:2 0 2G 0 part /boot └─nvme0n1p3 259:3 0 950.8G 0 part └─ubuntu--vg-ubuntu--lv 252:0 0 100G 0 lvm / ``` - 物理ディスク `nvme0n1` 全体のサイズは 953.9GB だが、LVM(論理ボリュームマネージャー)で使用されている容量は 100GB のみ ## 容量の不一致の原因 - LVMの未割り当て領域: `nvme0n1p3` の950.8GBのうち、LVMボリュームとして割り当てられているのは100GBのみ - 残りの容量は未使用の状態 - `df` コマンドは、マウントされているファイルシステムの容量のみを表示するため、物理ディスク全体の容量を反映していない ## 対処方法 1. LVMの状態を確認 ```bash sudo vgdisplay sudo lvdisplay ``` ボリュームグループと論理ボリュームの空き容量を確認する 2. 論理ボリュームのサイズを拡張 LVMの未使用領域を既存の論理ボリュームに追加する ```bash sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv ``` 3. ファイルシステムのサイズを拡張 拡張した論理ボリュームに合わせてファイルシステムを拡張する(例: `ext4` ファイルシステムの場合) ```bash sudo resize2fs /dev/ubuntu-vg/ubuntu-lv ``` --- # n100のミニPCにUbuntu Server 24.04.1 LTSをインストールしてセットアップ ## n100のミニPC - https://www.amazon.co.jp/gp/product/B0CJJ81PJD/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 - 25,776円 ## 初期作業 - 直近のLTSをいれる - Ubuntu公式のガイドにしたがってUSB用意するだけ - BIOS画面に行く方法が分からなかったけど、F1〜F12の間をダーってやったら行けた - Ubuntuインストール - 設定 - サーバ名: s01 - ユーザ名: tkancf - パスワード: ********** ## Wifiの設定 - 下記参照で行ける - https://qiita.com/Yashy/items/2793a5baf6b669663e2c ## 今後の接続 - tailscaleをインストール - これでtailscaleに繋げば、いつでもSSH可能になった ``` Host s01 HostName s01.tail6c6cb.ts.net User tkancf #IdentitiesOnly yes ``` ## ディスク周り - [LVMの論理ボリューム拡張](https://tkancf.com/blog/log-lvm-logical-volume-expansion) ## k3sのインストール [k3sのセットアップ](https://tkancf.com/blog/log-k3s-setup) --- # Macの初期設定 ## Macで三本指ドラッグを有効化 システム環境設定 > アクセシビリティ > トラックパッドオプション ## Google日本語入力をログイン時に起動する設定をON ## アプリケーションのインストール ### Rosettaインストール 先に入れておかないと、Google日本語入力のインストールでこける ```bash sudo softwareupdate --install-rosetta ``` ### HomeBrewインストール HomeBrew本体のインストール ### 他アプリケーションインストール Brewfileのあるディレクトリで下記を実行 [tkancfのBrewfile](https://gist.github.com/tkancf/231b9c11a9a5ea8e93a2fc1a1ea15228#file-brewfile) ```bash brew bundle --file .Brewfile ``` --- # Vimのmodelineを使ってファイルの折りたたみ設定を変更する方法 - modelineを利用すると、ページの上部もしくは下部に設定を記載して、そのファイルにだけ設定を反映させることができる - 例えば、下記のように記載するとfoldの設定をmarkerに変更できる ``` " vim: foldmethod=marker foldlevel=1 ``` ## 参考になる資料 - [モードラインを使って、ファイルごとにvimエディタのオプションを指定する。 — 名無しのvim使い](https://nanasi.jp/articles/howto/file/modeline.html) --- # Kittyのテーマカラー変更方法 Kitty上で下記コマンドを実行するだけ ```bash $ kitty theme ``` --- # 別タイムゾーンの日付をJSTに変更する方法 ## pythonで丁寧に ```python import datetime pdt_time = datetime.datetime(2023, 4, 6, 9, 41, tzinfo=datetime.timezone(datetime.timedelta(hours=-7))) jst_time = pdt_time.astimezone(datetime.timezone(datetime.timedelta(hours=+9))) print("PDT: ", pdt_time) print("JST: ", jst_time) ``` ## 一行で (ワンライナー) ### dateコマンド ```bash TZ=Asia/Tokyo date --date '2023-04-07 09:41:00 PDT' '+%Y-%m-%d %H:%M:%S %Z' 2023-04-08 01:41:00 JST ``` ### python ```bash python -c 'import datetime; jst_time = datetime.datetime(2023, 4, 7, 10, 30, tzinfo=datetime.timezone(datetime.timedelta(hours=-7))).astimezone(datetime.timezone(datetime.timedelta(hours=+9))); print(jst_time)' ``` --- # 2024-12 # 2024-12-01 - 仕事部屋の蛍光灯が切れたので、新しいシーリングライトを買った - 標準配列禁止のタイピングコンテスト【Alternative Typing Contest 2024】 - 面白い - - この動画見ると幸せな気持ちになる - 頭が良いのか悪いのかわからないインコ - - かなり好き。スンスンのスシローコラボ行きたい - 「はじめてのスシロー」メイキング① - - アップルパイ作った!! - レシピ: https://delishkitchen.tv/recipes/177911714413544575 - ![焼きリンゴ](https://i.gyazo.com/b02dc541798aed2c3ba1b5003dab0e56.jpg) - ![アップルパイ](https://i.gyazo.com/952de1a4490c80f37ca9269b00b1692e.jpg) - めっちゃ美味い - コレ良さそう - [nginx 1.27.3でupstreamにresolve指定が可能に](https://zenn.dev/catatsuy/articles/7141756827b4d6) - 公式はコレかな - [Dynamic DNS Resolution Open Sourced in NGINX – NGINX Community Blog](https://blog.nginx.org/blog/dynamic-dns-resolution-open-sourced-in-nginx) - 読んだ - [脳に収まるコードの書き方](https://blog.sushi.money/entry/2024/11/29/235900) - 中心概念と、それの付随する概念が最大6個となるように - なるほど - 読んだ - [弱さを晒け出すマネジメントと弱さを乗り越えるマネジメント](https://note.com/ysk_118/n/n93a3ca380ca0) - 良い - 作った - [iPhoneのショートカットで現在開いているページのリンクをMarkdown形式で取得](https://tkancf.com/blog/iphone-shortcuts-markdown-link) - 読んだ - [爆伸び中のGoライブラリhuma](https://zenn.dev/mercy34/articles/1fa551165d8ac1) - GoからOpenAPI 3.1を生成可能 - ほう - [美味しい紅茶](https://tkancf.com/blog/delicious-tea-notes) - [Midnight Hour Tea | TWG Tea](https://twgtea.com/en/loose-tea/midnight-hour-tea-t6800?srsltid=AfmBOor4Ogjprf7mVrhiNwe5wZ3uxewCJHFoBtVcp6W0-Q_AiNx4QZY-) - カフェインレスなのに、全然そんな感じがしないのでめちゃ良い - [気になる紅茶](https://tkancf.com/blog/teas-on-my-radar) - [国産紅茶のヤベーやつ、三選|sabasty](https://note.com/sabasty/n/n1a11dbb45197) - ここで紹介されてるやつ - [国産紅茶のやべーやつ、リターンズ|sabasty](https://note.com/sabasty/n/n85c16550c760) - あとこれ # 2024-12-02 - [外でもおいしい紅茶が飲みたいんだ!紅茶派が絶賛オススメする「紅茶専門店」のクチコミ集めました【2024年11月最新版】 - Togetter トゥギャッター](https://togetter.com/li/2314850) - 良いかも - 埼玉もあるじゃん # 2024-12-03 - 我が子爆誕!! - 元気で良かった〜 # 2024-12-04 - ヒロアカ最終巻読んだ - 良すぎたな # 2024-12-05 - 息子氏に今日も面会してきた。可愛すぎて語彙力消し飛んだ # 2024-12-08 - 息子氏がお家にやってくる - 今日ISUCONか〜! - 今年は出産と被ったから流石に出なかったけど、来年は参加したいな - 息子氏元気過ぎてほぼ徹夜になった - 世の親みんな偉過ぎてすごい - 意志の力4枚買っちゃった - 合わせてセファブレのパーツも買った # 2024-12-10 - セファブレのパーツ届いた - 育児夜勤慣れてきた - 育児休暇まじで取って良かった # 2024-12-11 - セファブレのパーツスリーブに入れて行くぞい - 済み - 沐浴慣れてきた # 2024-12-12 - セファブレがエターナルウィークエンド2024ヨーロッパで優勝してた - 夜泣きが若干緩和されて、完全夜勤じゃなくても大丈夫かも # 2024-12-13 - [開発環境にCloudflare Accessを導入した話](https://zenn.dev/smartshopping/articles/fd2825c0c61149)読んでる > 特定のホストだけをIPアドレスでアクセス制限したい場合、 > 該当サービスのみDNS ProxyをオフにしてCloudflareを経由させないことで回避しました。 なるほど > curlなどのツールを使用してAPIを呼び出すと、認証画面にリダイレクトされる問題 > Cloudflare Accessのルールを設定する際には、サービストークンを含んだアクセスを許可するルールを設定 ほうほう - [AWS、ノーコードでAmazon S3を操作するWebアプリが作れる「AWS Transfer Family web apps」発表 - Publickey](https://www.publickey1.jp/blog/24/awsamazon_s3webaws_transfer_family_web_apps.html) - コレ良さそう。触ってみたいな - 書いた [2024-12-16のMTG禁止改訂予想](https://tkancf.com/blog/mtg-ban-predictions-20241216) - 読んだ [無自覚にメンバーの心理的安全性を奪っていた経験から得た学び - Speaker Deck](https://speakerdeck.com/lighttiger2505/wu-zi-jue-nimenbanoxin-li-de-an-quan-xing-woduo-tuteitajing-yan-karade-taxue-bi) - めちゃくちゃ良いスライド - 失敗を公開することって難しいんだけど、自制と振り返りが上手いからとても参考になる - オープンレター施策は良さそうなので、取り入れてみようかな - オープンにするかどうかは人、チームにもよるけど、ポジティブフィードバックの一パターンとして使うの良さげ # 2024-12-14 - 息子氏今日は全然寝ない🥺 - 読んでる [Goによるrsc.io/scriptパッケージを用いた独自スクリプトでテストケースを記述するテスト手法紹介 - tomato3713’s blog](https://tomato3713.hatenablog.com/entry/2024/12/11/095858) - 土地基盤まだ妥協しまくってるけど、とりあえずセファブレ形になった - ![セファブレのデッキ画像](https://i.gyazo.com/thumb/3024/cc28d5c178efcbb238cb308ac8f02e70-heic.jpg) - [MARCO POLO ROUGE - マルコ ポーロ ルージュ](https://tkancf.com/blog/marco-polo-rouge)注文してみた - ノンカフェインなので、美味しいと嬉しいな - 何もないのに泣き止まない時、ドライヤーの音、シャワーの音流すと泣き止む時ある # 2024-12-15 - [【中村シェフ】地獄のアラビアータ 作り方・レシピ | クラシル](https://www.kurashiru.com/recipes/0218216b-27a3-4b11-94e4-d7c171c966bb)作る - 美味かった # 2024-12-16 - [グラタンの素 買わなくていい【簡単グラタン】冬の楽しみに是非どうぞ。 - YouTube](https://www.youtube.com/watch?v=76z2hhjZicg&list=PL9YfRGcJzkKbfNqaf00T9db8MJQzRyZ1f&index=47) 作る - [グラタン](https://tkancf.com/blog/20241216124557) ## Re: 個人メモ用のサイトを作ってみた - 以前作った時は失敗だった - エバーグリーンノートにかなり寄せたけどあまり上手くまとめられなかったし、気軽に書く感じも出せなかった - もっと普段のメモをそのまま公開するようなメモサイトにしてみた - スマホからはObsidian - PCからはNeoVim - [Quartz 4](https://quartz.jzhao.xyz/)ってObsidian公開用のツールがあり、これがかなり良さそうだったのでこれを使わせてもらった - 一応、毎回差分が見たいので、デプロイはPCからpushしてる - 個人的なこだわりで、Obsidinそのままだとタイトルとファイル名が密結合していてタイトル変えると、ファイル名も連動して変わるのが嫌だった - quartzがその辺ちゃんとしてて、ファイル名がURL、yamlヘッダーのtitleがページタイトルとして使われるようになってるのでそのまま以降できた - 肉まん食べた - ![Imge from Gyazo](https://i.gyazo.com/20d013f1c91de258ea6103a818897a68.jpg) - [Microsoft の「MarkItDown」で Officeファイルを Markdownファイルに変換【Python】 #office - Qiita](https://qiita.com/youtoy/items/e0495701f03c1875e032)良さそう - [GitHub - microsoft/markitdown: Python tool for converting files and office documents to Markdown.](https://github.com/microsoft/markitdown)良さそう - [RIBAYON ATTACK (リバヨンアタック) - 新日本橋/中華料理/ネット予約可 | 食べログ](https://tabelog.com/tokyo/A1302/A130202/13224686/)クラシルで見て気になった。ランチのお値段もお手頃で良さそう # 2024-12-18 - [2024-12-16のMTG禁止改訂予想](https://tkancf.com/blog/mtg-ban-predictions-20241216) - モダン、ラプターと指輪が禁止で、ゼニス、双子、オパモ、ルーティング解禁 - 解禁多くてびっくりしたな # 2024-12-19 - すき家行ったけどいくら丼売り切れてた # 2024-12-20 - 今日はすき家のいくら丼あったから食べた - すき家のメガいくら丼 ![すき家のメガいくら丼](https://i.gyazo.com/thumb/3024/cc22bc7cd5ac926522189791ea4b2f64-heic.jpg) - めっちゃいくら乗ってて美味しかった # 2024-12-21 - [aqua CLI Version Manager 入門](https://zenn.dev/shunsuke_suzuki/books/aqua-handbook)読んでみるか - homebrewじゃないパッケージマネージャーちゃんと使いたいからな - [ワシの使っているNeovimプラグインは200個近くあるぞ](https://zenn.dev/yutakatay/articles/neovim-plugins-2022) - この辺気になる - [GitHub - nvim-neo-tree/neo-tree.nvim: Neovim plugin to manage the file system and other tree like structures.](https://github.com/nvim-neo-tree/neo-tree.nvim) - [GitHub - lambdalisue/vim-readablefold: A Vim plugin to improve foldtext for better looks](https://github.com/lambdalisue/vim-readablefold) - [GitHub - kevinhwang91/nvim-bqf: Better quickfix window in Neovim, polish old quickfix window.](https://github.com/kevinhwang91/nvim-bqf) - [GitHub - folke/lazy.nvim: 💤 A modern plugin manager for Neovim](https://github.com/folke/lazy.nvim) - [GitHub - rmagatti/auto-session: A small automated session manager for Neovim](https://github.com/rmagatti/auto-session) - [GitHub - zdcthomas/medit: a macro editing vim plugin](https://github.com/zdcthomas/medit) - [GitHub - tyru/capture.vim: Show Ex command output in buffer](https://github.com/tyru/capture.vim) - [GitHub - yutkat/confirm-quit.nvim: Check and then exit from Neovim](https://github.com/yutkat/confirm-quit.nvim) - [GitHub - akinsho/toggleterm.nvim: A neovim lua plugin to help easily manage multiple terminal windows]](https://github.com/akinsho/toggleterm.nvim) # 2024/12/23 - 息子氏久々に全然寝ないな - またオールかな - 04:30には寝てくれた - NeoVimの設定見直したい - モダンでエルドラージランプ組みたい - [xargs の -I オプションとコマンドライン長の制約](https://zenn.dev/sankantsu/articles/ca15e7b0e18387) - GNU findutils 版 xargsだと制限増やす方法無さそうかな? # 2024/12/25 - メリクリー - エルドラージランプのカード類買って揃えた! ``` 4 まき散らす菌糸生物 4 難題の予見者 4 縄張りの選定者 3 世界を壊すもの 3 運命を貪るもの 3 虚構漂い 4 コジレックの命令 2 コジレックの帰還 3 邪悪鳴らし 4 楽園の拡散 2 好奇のタリスマン 2 衝動のタリスマン 1 繁殖池 1 魂の洞窟 4 エルドラージの寺院 5 森 2 霧深い雨林 1 踏み鳴らされる地 4 ウギンの迷宮 4 樹木茂る山麓 2 狼狽の嵐 2 未認可霊柩車 2 石の脳 2 荒景学院の戦闘魔道士 2 神秘の論争 2 溶融 ``` # 2024/12/27 - [今年お世話になった 12 個の Vim (Neovim) プラグインを紹介します](https://zenn.dev/vim_jp/articles/2022-12-12-vim-plugin-thanks) - 参考に - [tani/vim-jetpack: The lightning-fast plugin manager, alternative to vim-plug](https://github.com/tani/vim-jetpack) - lazyの機能使いきれてないから、乗り換えようかな - [git操作プラグインを探しているならgin.vimはどう? - 輪ごむの空き箱](https://wagomu.me/blog/2023-12-12-vim-adventcalendar) - gin.vim使い方もうちょいちゃんと調べたい所 - [Help keymapping based on file type · Issue #135 · folke/which-key.nvim](https://github.com/folke/which-key.nvim/issues/135) # 2024-12-28 - [GitHub - quarylabs/sqruff: Fast SQL formatter/linter](https://github.com/quarylabs/sqruff)SQLのフォーマッタ - 昔探した時、ちょうど良いCLIが見つからなかった記憶あるので期待 - NeoVimの設定をluaにしてるけど、ほぼコピペでやってるのでちゃんと理解するためにlua学んでみる - [NeovimのためのLua入門 Lua基礎編](https://zenn.dev/slin/articles/2020-10-19-neovim-lua1) - 読んだ - ちょっと変わった部分もあるけどシンプルな文法だな - [NeovimのためのLua入門 init.lua編](https://zenn.dev/slin/articles/2020-11-03-neovim-lua2) - 読んだ # 2024/12/29 - [GitHub - nanotee/nvim-lua-guide: A guide to using Lua in Neovim](https://github.com/nanotee/nvim-lua-guide) - 読んだ ## ターミナルを乗り換えられるか比較してみる - 今メインで使っているもの - iTerm2+tmux - 一部NeoVimのプラグインで画像表示がKittyと違ってできない - 管理がしにくい - 最近試してみたもの - WezTerm - tmuxがないと、broadcastモードがない - Kitty - tmuxがないと、broadcastモードがない - 画面分割の方法に癖がある - 画像が表示できる - wezterm + tmuxでしばらく試してみる # 2024/12/31 - [CRAFT BREW TEA– TEA ARTISAN CRAFTED](https://marushichi-tac.com/collections/craft-brew-tea)気になる - [Yet Another Dotfiles Manager - yadm](https://yadm.io/) dotfilesマネージャー。良さそう --- # bashで入力待ち `read -p`でOK ```bash $ read -p "入力してください: " input; echo $input 入力してください: inputだよ inputだよ ``` --- # bashで特定の文字列を含むファイルを削除するワンライナー ```bash for file in *(.); do grep -q '特定の文字列' "$file" && rm "$file"; done ``` --- # 2024-11 # 2024-11-26 ## 作業ログ ### Quartzでメモサイト作成 ``` ❯❯ ~/src/github.com/tkancf ❯ git clone https://github.com/jackyzha0/quartz.git note.tkancf.com Cloning into 'note.tkancf.com'... remote: Enumerating objects: 10108, done. remote: Counting objects: 100% (84/84), done. remote: Compressing objects: 100% (63/63), done. remote: Total 10108 (delta 42), reused 48 (delta 21), pack-reused 10024 (from 1) Receiving objects: 100% (10108/10108), 8.81 MiB | 6.13 MiB/s, done. Resolving deltas: 100% (6353/6353), done. ❯❯ ~/src/github.com/tkancf ❯ cd note.tkancf.com ❯❯ (git:v4) ~/src/github.com/tkancf/note.tkancf.com ❯ npm i added 609 packages, and audited 611 packages in 15s 180 packages are looking for funding run `npm fund` for details 3 vulnerabilities (1 moderate, 2 high) To address all issues, run: npm audit fix Run `npm audit` for details. npm notice npm notice New patch version of npm available! 10.9.0 -> 10.9.1 npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.9.1 npm notice To update run: npm install -g [email protected] npm notice ❯❯ (git:v4) ~/src/github.com/tkancf/note.tkancf.com ❯ npx quartz create ┌ Quartz v4.4.0 │ ◇ Choose how to initialize the content in `/Users/tkan/src/github.com/tkancf/note.tkancf.com/content` │ Empty Quartz │ ◇ Choose how Quartz should resolve links in your content. This should match Obsidian's link format. You can change this later in `quartz.config.ts`. │ Treat links as shortest path │ └ You're all set! Not sure what to do next? Try: • Customizing Quartz a bit more by editing `quartz.config.ts` • Running `npx quartz build --serve` to preview your Quartz locally • Hosting your Quartz online (see: https://quartz.jzhao.xyz/hosting) ❯❯ !(git:v4) ~/src/github.com/tkancf/note.tkancf.com ❯ ❯❯ !(git:v4) ~/src/github.com/tkancf/note.tkancf.com ❯ npx quartz build --serve Quartz v4.4.0 (node:47332) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created) Cleaned output directory `public` in 8ms Found 1 input files from `content` in 13ms Parsed 1 Markdown files in 71ms Filtered out 0 files in 36μs Emitted 13 files to `public` in 163ms Done processing 1 files in 257ms Started a Quartz server listening at http://localhost:8080 hint: exit with ctrl+c [200] / [200] /index.css [200] /prescript.js [200] /postscript.js [200] /static/contentIndex.json [200] /static/icon.png Detected change, rebuilding... Parsed 1 Markdown files in 8ms Filtered out 0 files in 6μs Emitted 13 files to `public` in 134ms Done rebuilding in 145ms ``` # 2024-11-27 - Quartzのメモサイト更新した - ファイル名の方をユニークにしておいて、titleをquartzに拾ってもらうのが良さそう # 2024-11-28 - お仕事がんばっ太郎 - 昨日の朝チンしたベースブレッドがまだ仕事机の上にあったから、今日の昼に食べた - かなり堅かった - レガシーのナドゥはデュアルランド以外良いお値段なの良いかも - https://www.hareruyamtg.com/ja/deck/882069/show/ # 2024-11-29 - ワンパンマンが更新されてたから読んだ - おもろい - http://galaxyheavyblow.web.fc2.com/fc2-imageviewer/?aid=1&iid=153 - [bashで入力待ち](https://tkancf.com/blog/bash-wait-for-input) # 2024-11-30 - [レンジで焼き芋](https://tkancf.com/blog/20241130232532)簡単で旨くて良い " vim: foldmethod=marker foldlevel=1 --- # Zedエディタでdenoのスクリプトを書くときの設定 何も設定しないと、Denoの `import` 、`Deno.args` 等でZed上にエラー警告が出るので、解消するための設定 ## Deno Extensionsのインストール ZedのExtensions一覧を`Deno`で検索してInstallするだけ ## 設定ファイルの配置 ZedのLocal Settingsを開いて、下記設定を追加する Zedの `Settings` → `Open Local Settings` で設定ファイルは開ける ```json { "languages": { "TypeScript": { "language_servers": ["deno", "!typescript-language-server", "!vtsls"] }, "TSX": { "language_servers": ["deno", "!typescript-language-server", "!vtsls"] }, "JavaScript": { "language_servers": ["deno", "!typescript-language-server", "!vtsls"] } }, "formatter": "language_server" } ``` ## 再起動? 設定を書くだけだとエラーが消えないかもしれないので、Zedを再起動すると良い ## あとがき 最近、ちょっとしたスクリプトを書くときは [Zed](https://zed.dev/) を使ってて下記イメージで使い分けてる - Markdownのメモ: Neovim - 複数ファイルあるぐらいのプログラミング: VSCode - 1ファイルぐらいのちょっとしたスクリプト: Zed bashでやるには複雑で、真面目にCLI作るってほどでもない自分用のスクリプトをDenoとdaxで書くみたいな要件とかまさにそれ Vimモードがかなり良く出来てて、VSCodeより軽いので好んで使ってる。 もうちょっと馴染んだらVSCodeから完全に乗り換えられるかも --- # 2024-08 # 2024-08-01 ## 出来事 - アーロンチェアが届いた!! - 足が届くの最高だ - 座り心地まじで神 # 2024-08-03 - 今日からデイリーじゃなくて、マンスリーメモにしてみる # 2024-08-04 - 休みだけど、昼はあまり集中できなかった - 夜はポモドーロ再開してみてる ## 気になる - PasteBar - 使ってみたけど微妙だった # 2024-08-05 ## 今日やったこと - 仕事 - ご飯炊いた (偉い) # 2024-08-11 休日〜〜 ## メモ - CloudFlareの.comドメインが値上がりするので、10年分まとめ買いした # 2024-08-15 - [x] るんちゃんを動かしたい - [x] 爪切りたい - 問題を全部通しでやりたい - 途中までできた # 2024-08-17 - Ergo68のはんだ付け済み簡単キットめっちゃほしいな - https://shop.yushakobo.jp/products/3923?_pos=3&_sid=ef1e6c02c&_ss=r&variant=47873667825895 # 2024-08-22 SAPの問題集、全問題解き終わった〜〜〜!!! # 2024-08-27 - 誕生日!! - 30歳になりました!わいわい - 子供も生まれるし、頑張るぞー! # 2024-08-29 - 妻と満州で餃子食べた # 2024-08-30 - 明日試験だ〜〜 # 2024-08-31 - SAP試験終わり!! - 受かってた〜!!わいわい - ラーメン食べた --- # 個人メモ用のサイトを作ってみた メモ用のツールとしてObsidianとかNotionとか流行ってる中、何が良いのか試しつつメモの管理手法について調べてました。 PKM(Personal Knowledge Management)といって結構色々と手法があるようで、有名なものにZettelkasten、LYT、エバーグリーンノートなんかがあるようです。 一通り有名どころの手法を知ったので、それを活かしつつ公開できるサイトがあると良いな〜と思ったのでこのブログとは別で用意してみました。 作ったサイトは TKM というサイトになってます。 2024-08-05追記: ブログとうまく使い分けられなかったので公開やめました。 HonoのSSGを利用してCloudflareで公開たんですが、ほぼ本ブログのコード使い回しなので制作時間は1時間未満とかです。 Backlinksという、ページ末尾にそのページへリンクされているページの一覧を表示するようにした点だけがこだわりポイントです。 現状は作ったばかりなので数十程度のメモしか置けてないですが、ちょっとずつ育てていけたら面白いかなと思ってます。 ちなみにメモツールは結局Neovimになってます。(Vimのない生活にはどうやっても馴染めなかったよ...) [epwalsh/obsidian.nvim](https://github.com/epwalsh/obsidian.nvim) というプラグインがObsidianのようにメモを作れるNeovimのプラグインになっており、ObsidianもVimも好きな私にはめちゃくちゃフィットしました。おすすめです。 自分のメモの作り方に合うようにちょっとしたプラグインも書いてみたりしました。 久々にVimの設定いじったので満足です。しばらくこの環境で遊んでみようと思います。 --- # Emacsに入門した 2024年 ## イントロ 最近Emacsの設定を頑張っていました。 - 設定したEmacsの設定: https://github.com/tkancf/.emacs.d/blob/main/init.org 10年ぐらいVimmerをやっているんですが、Emacsを羨ましいと思う要素がありました。 下記3つの機能です。 - インラインの画像表示 - dmacro - org-mode このうち、画像表示については[3rd/image.nvim](https://github.com/3rd/image.nvim/github.com/3rd/image.nvim)などを利用してNeovimで画像表示が可能になっています。 dmacroについては、(私が知っている限りでは)Vimに似たプラグインは見つけられませんでした。 org-modeについては、[nvim-orgmode/orgmode](https://github.com/nvim-orgmode/orgmode)というプラグインがかなりよく出来ており、org-modeの大体の機能はこれで利用できます。 ただ、nvim-orgmode/orgmodeでEmacsのorg-modeと完全に同等かというと、Emacsのorg-modeと使い比べてみると細々足りてない機能が気になります。 org-modeを利用したいというのが主目的で、org-modeを利用するからにはその機能を全て使いたくなったので、Emacsに入門してみました。 ## Vim, Neovimでのorg-modeについて org-modeを使う前にVim, Neovimでのorg-modeの状況についても少々調べました。 2024年現在だと以下のような状況かなと思っています。 ### Emacsのorg-modeにしか無さそうな機能 しばらくEmacsのorg-modeを利用して、おそらくEmacsのorg-modeにしか無いなと思っているのは下記機能です。 - スピードコマンド - org-babel - org-babel-tangle - おそらく似たことを出来る環境はあるが、実行対象の豊富さが強い - org-roam - org-exportの出力選択肢 - Emacsのorg-modeは歴史が長いだけあって、出力設定が豊富 - GitHub Flavored Markdown - Hugo Markdown - Zenn Flavored Markdown - [alphapapa/org-web-tools](https://github.com/alphapapa/org-web-tools) - Emacsのブラウザ機能(eww)を利用して、クリップボードのURLのorg-modeリンクを自動で生成したり出来る おそらくどの機能も作れなくは無い or 探せばどこかには似た機能やプラグインが存在するかもしれないんですが、私的にはEmacsを使ったほうが近道に感じました。 ### nvim-orgmode/orgmodeでも実現できること おそらく、これがVimもしくはNeovimのプラグインで一番多機能だと思います。 基本的な機能はあります。 - Markdown的に軽量マークアップ言語としての利用 - org-agenda - org-capture - clock機能 - org-babelライクな使い方 - [michaelb/sniprun](https://github.com/michaelb/sniprun) で似たことは出来そうです - ただ、org-modeでEmacsのinit.elの設定を書いて部分的に評価してVimの設定に反映的なことは難しいかもしれません これで十分という場合も多いと思います。 ### Neovimのnvim-neorg/neorgプラグイン まだ発展途上という感じですが、[nvim-neorg/neorg](https://github.com/nvim-neorg/neorg)というNeovim用にorg-mode likeな機能を提供しようとしているプラグインがあります。 現在はneorgでは未実装のTODO管理機能、clock機能は個人的に外せなかったので選択肢にはならなかったんですが、 neorgファイル用のLSPが存在しており、ファイルへのリンクなどがやりやすく良いプラグインだと思います。 ## Emacsの設定について まだEmacs歴が浅いので、雰囲気でやっている部分もあるんですが下記方針で設定を作っています。 - パッケージ管理にはuse-packageを使う - 設定はorgファイルから生成する - Spacemacs, Doom Emacsのようなディストリビューションは利用しない - 設定の参考にはする - なるべく左手小指、薬指の負担を減らす - Vim likeキーバインドは捨てられないので、evil-modeに頼る ### パッケージ管理にはuse-packageを使う Vimのプラグインマネージャーが多くあるように、Emacsにもパッケージマネージャーがいくつかあるみたいです。 どれが良いのか評価出来るほど理解していませんが、use-packageで設定しているパッケージのREADMEを多く見かけたので、 use-packageを使っています。 多数派に従っていると、ChatGPT, Claude等に設定方法を聞いた時に楽なので多そうなやつにしました。 ### 設定はorgファイルから生成する Emacsには、 `org-babel-tangle` というorgファイルに書いたコードブロックをつなげて一つのファイルにしてくれる機能があります。 これを利用して、 `init.org` というドキュメントにコードブロックとしてEmacs Lispを書いておき、設定をビルドする際にファイルとして書き出します。 更新時に簡単に実行出来るようにMakefileで管理することが多いようです。 他の人の設定を参考にMakefileに以下のようなスクリプトを用意しました。 `make build`を実行することで、`init.org`から`init.el`が生成されて、`init.el` のコンパイルが実行されます。 ```makefile .PHONY: build build: ## Build emacs config @$(EMACS) -Q --batch --eval "(progn (require 'ob-tangle) (org-babel-tangle-file \"./init.org\" \"./init.el\" \"emacs-lisp\"))" @$(EMACS) --batch -Q -f batch-byte-compile init.el ``` このorgファイルから設定ファイルを生成するという体験がかなり便利で、org-mode最高ポイントの一つです。 ### Spacemacs, Doom Emacsのようなディストリビューションは利用しない 一応、2016年ぐらいにSpacemacsを一瞬利用していたことがあります。 よく出来ているんですが、ブラックボックスが多すぎると管理しきれず、何もわからんとなってしまったので今回は一から自分で設定を作っていきました。 どのようなプラグインを利用しているか等の設定の参考には便利だったので、よくソースを見に行きました。 ### 左手小指、薬指の負担を減らす 左手小指、薬指が貧弱なため、Emacsのデフォルトキーバインドをそのまま利用していると、私の指は耐えられません。 evil-mode(Vim likeなキーバインドを提供するパッケージ)の利用である程度緩和できますが、他にも以下のような工夫をしています。 #### スペースキー長押しでCtrlキーにする Karabiner-ElementsでEmacsに限らず設定しています。 ターミナルでもCtrlキーは多様するので、小指の負担がかなり減ります。 #### C-xをC-jにリマップ C-xはデフォルトで様々なコマンドのprefixになっており、頻繁に入力するキーです。 xキーは左手薬指で押す必要があり、何度も入力していると貧弱な私の薬指では耐えられませんでした。 下記のように設定してC-jで元のC-xの挙動をするようにしています。 ```emacs-lisp (define-key key-translation-map (kbd "C-j") (kbd "C-x")) ``` #### Super-jにM-xをリマップ 同様の理由でSuper-jにM-xをリマップしています。 Macなので、SuperキーはCommandキーになり、押しやすいです。 #### Super-kに\*の割当 org-modeで\*を連打してるとShiftキーのせいで左手の小指が痛くなるので設定しています。 Markdownはヘッダが#記号なので、左のShiftキーを押さずに済むんですよね...。 ### Vim likeキーバインドは捨てられないので、evil-modeに頼る テキスト編集はVimが最強だと思っているので、それに近い環境はほしいです。 evil-modeはVimの基本的な機能はちゃんと使えるし、拡張も出来るので満足いく設定をしていけそうです。 ただ、Vimと全く同様で不満が全く無いかというとそんなことは無いです。 ## 困りごと・不満点 ### evil-modeの不満点 設定でなんとかなるかもですが、今のところ困っている部分です。 - `/`検索→`:%s//変換文字列/`のような`/`検索した文字列をそのまま変換する際に検索文字列を省略できない - 少なくともデフォルトだと出来ないです - 設定もしくはEmacs Lisp書いて解決できないか模索中です - Vimのノーマルモード操作をdmacroで繰り返すと、文字入力しようとする - これは単にdmacroがevil-modeなんて知らないというだけだと思いますが、出来たら嬉しいポイントです - 矩形選択→選択範囲の行の末尾に文字を入力がVimと挙動が違う - 「C-v→$→A→入力→Esc」ではなく、「S-v→A→入力→Esc」になります - 代替手段があるので慣れでカバーできそうです ### ex-gfmでMarkdownを出力するとリストの表記が変 ex-gfmに限らずなんですが、リスト表記をMarkdownエクスポートすると、 `-␣文字列` となるはずが、 `-␣␣␣␣文字列`となってしまいます。 設定次第な気がするんですが、見た目が微妙なのでなんとか直したいところです。 ## まとめ ちょっと不満もありますが、Emacs楽しいですね。 常用するかはまだ決めてないんですが、なんとなくEmacs入門の扉は開けたかなと思います。 気に入った機能をVimで再現してみるとかも楽しいかもしれません。もうしばらく遊んでみたいと思います。 --- # ブログをAstroからHonoのSSGに移行しました このブログは元々Astroを使って生成していました。 Astroはサクッとコンテンツメインのサイトが作れて便利なんですが、[Blogを作り、育み、慈しむ ~ Blog Hacks 2024](https://junkyard.song.mu/slides/yapc-hiroshima-2024/#0)というスライドを見て、もうちょっと「好きなもの」を使って作り変えるのも良いかなと思っていました。 同じくらいの時期に[Honoのv4でSSGが可能になり](https://zenn.dev/yusukebe/articles/b20025ebda310a)、触ってみたい気持ちが高まっていたので移行してみました。 Honoは以前、CloudFlare Workersで[LINE botを作ったとき](https://tkancf.com/blog/creating-line-bot-with-cloudflare-workers-d1-and-hono)に使ったんですが、かなり感触が良かったので定期的に状況をウォッチしていました。 Hono自体も良いですし、[作者さん(@yusukebe)](https://github.com/yusukebe)のブログがワクワクする内容で好きなんですよね。 [Honoのv4が2月9日にリリースされます](https://zenn.dev/yusukebe/articles/b20025ebda310a)とか、[OSSで世界と戦うために - ゆーすけべー日記](https://yusukebe.com/posts/2023/oss-against-the-world/)とか。 ## 移行作業について 移行と言いつつ既存のコードはほとんど残っておらず、記事以外はほぼ作り直しになりましたが、Honoはシンプルで公式ドキュメントもexampleが分かりやすく、[先行事例](https://zenn.dev/razokulover/articles/9818ef632f677f)もあったので、大きくハマって悩むこともなく作れました。 ざっくり以下のような流れで作りました。 - [yusukebe/hono-ssg-example](https://github.com/yusukebe/hono-ssg-example/)を参考に最小構成で動くことを確認 - [remark](https://remark.js.org/)を使ってMarkdownからHTML生成→表示確認 - CSSを適用 - sitemapを追加 - RSSフィード作成 - デプロイして動作確認 ## やったこと 私が雑にお試しして試行錯誤しているリポジトリは[GitHub - tkancf/sandbox](https://github.com/tkancf/sandbox/tree/main/hono-ssg)です。 ### 最小構成で動かしてみる まずは、Hono作者さんの[yusukebe/hono-ssg-example](https://github.com/yusukebe/hono-ssg-example/)を参考に別のリポジトリでとりあえず生成できることを確認するだけのコードを用意してみました。 [yusukebe/hono-ssg-example](https://github.com/yusukebe/hono-ssg-example/)はHono v4公開前にpatchを適用して作成しているexampleだったので、改変しつつ動かしてみました。 [この辺りのcommit](https://github.com/tkancf/sandbox/tree/22af695683965d210df1c0d50d87c14ad1b5a1fd/hono-ssg)が最小構成で動くことを確認できた所だと思います。 [Hono v4紹介記事](https://zenn.dev/yusukebe/articles/b20025ebda310a)では、静的ページを生成するために`build.ts`というファイルを作っていましたが、`@hono/vite-ssg`というViteのプラグインを使えば`build.ts`は不要でした。 細かい部分は[該当commit](https://github.com/tkancf/sandbox/tree/22af695683965d210df1c0d50d87c14ad1b5a1fd/hono-ssg)をみてもらうと分かりますが、ポイントを一部抜粋して記載します。 以下が`vite.config.ts`です。 `@hono/vite-ssg`を使うと、`vite build`実行時に各ページを生成してくれます。 ```typescript import { defineConfig } from "vite"; import ssg from "@hono/vite-ssg"; // 追加 import devServer from "@hono/vite-dev-server"; const entry = "src/index.tsx"; export default defineConfig(() => { return { plugins: [devServer({ entry }), ssg({ entry })], // ssg({entry})を追加 }; }); ``` `src/index.tsx`についてはほぼ見た通りで、該当コードは[こちら](https://github.com/tkancf/sandbox/blob/22af695683965d210df1c0d50d87c14ad1b5a1fd/hono-ssg/src/index.tsx)です。 `ssgParams(() => posts),`の部分は、Path Parameterがついた各パスに静的に生成されるパスを割り当てるためのミドルウェアです。 これがないと、`/posts/hoge`みたいなページが生成されません。 私はNext.jsを触ったことがないので知りませんでしたが、Next.jsの[generateStaticPaths](https://nextjs.org/docs/pages/building-your-application/data-fetching/get-static-paths)と似た機能らしいです。 ```typescript app.get( "/posts/:id", ssgParams(() => posts), (c) => { return c.render(

{c.req.param("id")}

); } ); ``` ### Markdownから記事生成 ここはHono関係なく、Astroのブログテンプレートだとデフォルトで用意されていたMarkdown→HTML変換を自前で用意する工程です。 [Astroのドキュメント](https://docs.astro.build/en/guides/markdown-content/)を見ると[remark](https://remark.js.org/)というライブラリを使っていると書いていたので、同じライブラリを使って同様の機能を用意しました。 該当コードは[src/lib/post.ts](https://github.com/tkancf/tkancf.com/blob/bc9f6936b2bd0a73d997281892e1c11c16bfce14/src/lib/post.ts)です。remarkを使えば簡単に用意できました。 こんな感じでパースできます。便利。 ```typescript const content = fs.readFileSync(filePath, { encoding: "utf-8" }); const result = await remark() .use(remarkParse) .use(remarkFrontmatter, [ { type: "yaml", marker: "-", anywhere: false }, ]) .use(remarkExtractFrontmatter, { yaml: yaml.parse, name: "frontMatter", }) .use(remarkExpressiveCode, { theme: "github-light", }) .use(remarkGfm) .use(remarkRehype, { allowDangerousHtml: true }) .use(rehypeStringify, { allowDangerousHtml: true }) .use(remarkGfm) .process(content); ``` ### sitemapの生成 こちらもAstroのブログテンプレートだとデフォルトで用意されていましたが、自前で生成してあげる必要があります。 とは言ってもコード書くまでもなかったです。 `vite-plugin-sitemap`を入れて、`vite.config.ts`に設定を書いてあげるだけで完了しました。 追加後の`vite.config.ts` ```typescript import { defineConfig } from "vite"; import ssg from "@hono/vite-ssg"; import devServer from "@hono/vite-dev-server"; import Sitemap from "vite-plugin-sitemap"; // vite-plugin-sitemapをいれて import { baseURL } from "./src/lib/constants"; const entry = "src/index.tsx"; export default defineConfig(() => { return { plugins: [ devServer({ entry }), ssg({ entry }), Sitemap({ hostname: baseURL, generateRobotsTxt: true }), // ←追加した設定はこの部分 ], }; }); ``` ### RSSフィードの生成 こちらもAstroのブログテンプレートだとデフォルトで用意されていたRSSフィードを生成してあげます。 記事一覧のデータさえ用意出来ていれば`rss`を利用してサクッと作れます。 ```typescript import RSS from "rss"; (中略) const generateFeed = async () => { const rss = new RSS({ title: siteName, site_url: baseURL, description: siteName, feed_url: baseURL + "/feed", generator: siteName, }); posts.forEach(async (post: any) => { const url = baseURL + "/blog/" + post.slug; rss.item({ title: post.title, url: url, date: new Date(post.pubDate), description: post.description, }); }); return rss.xml(); }; app.get("/feed", async (c) => { const feeds = await generateFeed(); return c.text(feeds, 200, { "Content-Type": "text/xml", }); }); ``` ### CSSの適用 Honoには`hono/css`というCSS in JSのヘルパーがあるので、それを利用しました。 グローバルなCSSをどう適用すれば良いのかちょっと試行錯誤しましたが、以下のようにhtmlタグに全体適用したいCSSを付与してあげて、headタグ内に `