Neovim
checkhealthの警告を潰していく
nvim-treesitter のこれ
nvim-treesitter: require("nvim-treesitter.health").check()
Installation ~
- WARNING `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
- OK `node` found v21.6.2 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `gcc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: gcc (x86_64-posix-seh-rev1, Built by MinGW-Builds project) 13.2.0
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.
とNode.jsのこれ
Node.js provider (optional) ~
- Node.js: v21.6.2
- WARNING Missing "neovim" npm (or yarn, pnpm) package.
- ADVICE:
- Run in shell: npm install -g neovim
- Run in shell (if you use yarn): yarn global add neovim
- Run in shell (if you use pnpm): pnpm install -g neovim
- You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim
tree-sitterの方
- gcc.exeが入ってない場合、
scoop install mingw
でいれる - tree-sitterもscoopでいれる。
scoop install tree-sitter
node.jsの方
- nodejsが入ってない場合
scoop install nodejs
で入れる - neovimというnode.jsパッケージが必要なので
npm install neovim
で入れる
入った後の表示
tree-sitterはこうなる
Installation ~
- OK `tree-sitter` found 0.22.2 (fc15f621334a262039ffaded5937e2844f88da61) (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v21.7.1 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `gcc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: gcc (x86_64-posix-seh-rev1, Built by MinGW-Builds project) 13.2.0
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.
nodejeはこう
Node.js provider (optional) ~
- Node.js: v21.7.1
- Nvim node.js host: D:\Users\(名前)\scoop\persist\nodejs\bin\node_modules/neovim/bin/cli.js
- OK Latest "neovim" npm/yarn/pnpm package is installed: 5.1.0
Pythonデバッグ環境つくる
いままでずっとpdb.set_traceで止めてきたけどもういい加減うんざりだ
でもまた今度にしよう
RRのリソースファイルを読みこむツール
PCに入れるとここに入ってるやつら、文字列があれこれ入っている
※ 今右側のパネルで開いているのはLocalizationDataEnglish.binというファイル
バイナリなのでYAMLにする
json?嫌いやねん
ファイルのフォーマットについて
仮説
- キーワードの文字列長+
0x80
- キーワード(ASCII)
-
00
とか区切り文字(次の文字列が長いときはちょっと複雑) - キーワード本文の文字列長+
0x80
- 文字列
という感じで並んでいるように思える
あまり難しくなさそう
これなんてフォーマットなんだろう?MsgPackというのに似てるけど
参考: MessagePack: It's like JSON. but fast and small.
例1、簡単なの
たとえば、最初のところだと
�in_event_desc□�Event
8D 69 6E 5F 65 76 65 6E 74 5F 64 65 73 63 00 85
45 76 65 6E 74
となっている
-
0x8D
から0x80
を引いて0xD
=13文字 - キーワードは13文字、
in_event_desc
- で次に
00
が区切り文字 -
0x85
から0x80
を引いて0x5
=5文字 - 文字列は5文字、
Event
仮説通りだ
例2、長いの
めちゃくちゃ文字列が長いやつだと、4番目が1バイト(最大FF、80引くと127文字)に収まらないので、ちょっと変わってくる
つまり仮説通りではない
たとえば、342文字の場合だと
�spring_mod_BasketWithFlowers_desc□□V□A Magic Flower
appears near the field. You can move a unit onto it to
exchange it for a Blossom after <color=#2b83e7>{0}s</color>.
A1 73 70 72 69 6E 67 5F 6D 6F 64 5F 42 61 73 6B
65 74 57 69 74 68 46 6C 6F 77 65 72 73 5F 64 65
73 63 01 02 56 01 41 20 4D 61 67 69 63 20 46 6C
6F 77 65 72 20 61 70 70 65 61 72 73 20 6E 65 61
72 20 74 68 65 20 66 69 65 6C 64 2E 20 59 6F 75
20 63 61 6E 20 6D 6F 76 65 20 61 20 75 6E 69 74
20 6F 6E 74 6F 20 69 74 20 74 6F 20 65 78 63 68
61 6E 67 65 20 69 74 20 66 6F 72 20 61 20 42 6C
6F 73 73 6F 6D 20 61 66 74 65 72 20 3C 63 6F 6C
6F 72 3D 23 32 62 38 33 65 37 3E 7B 30 7D 73 3C
2F 63 6F 6C 6F 72 3E 2E
キーワード
キーワードは127文字を超えるものがない、と思うのでたぶん問題ない
今まで通りである
-
0xA1
-0x80
=0x21
、DECだと33文字 - キーワードの
spring_mod_BasketWithFlowers_desc
の長さと一致する
しかしその後の区切り文字が00
でない
区切り文字と文字列長
35バイト目の01
から区切り文字、00
ではなく01
になっている
文字列長まで含めると01 02 56 01
だ
文字列の長さはA Magic Flower appears near the field. You can move a unit onto it to exchange it for a Blossom after <color=#2b83e7>{0}s</color>.
なので、342文字、HEXにして0x80
足すと0x156
で3~4バイトの56 01
と合致する
もっと長い文章があれば確実なんだろうけど、おそらくここは単純に逆順に格納している
リトルエンディアンとかそんなやつだと思う、よくわからないけど
ここからは仮説だけど、01 02
の02
は文字列長のバイト数を示していると思う
そして01
は文字列長のバイト数を示す02
のバイト数を示しているのでは、と思う
区切り文字が00
のときは、何バイトが文字列長に使われるか考える必要なく、直後の1バイトを文字列長として扱う
01
~0n
などのときは直後の1~nバイトを読んで、何バイトが文字列長の長さを示すバイト数に使われるのか、判別している、んだろうと思う
最終的なフォーマット(おそらくこれが正しい)
- キーワードの文字列長+
0x80
- キーワード(ASCII)
- キーワード本文の文字列長を示すバイト部分
- 127文字までは
00
- それを超える場合、65407文字までは
01 02
- 127文字までは
- キーワード本文の文字列長+
0x80
- 127文字以上になる場合は2バイト使って表す。さらにリトルエンディアン方式で格納される
- 文字列
キーワードはたぶん127文字を超えるものがないんだろう、、、たぶん
いまのところ、enchantment_common_fightingexcitement_short_description
の55文字が最長
とりあえず今日はここまで
MS Edgeのグーグルアカウント、関連付けについて
起動するたびにいつも別のアカウントになっていて、都度ログインしなおしをしていた
めんどいなあとおもって調べると以下の手順でデフォルトアカウントを変更できるらしい
やってみたら治った、感謝!
参考: PCでブラウザ(Microsoft Edge)のデフォルトアカウントの変更の仕方を教えてほしいです - Google アカウント コミュニティ
PowerShell改善
gowやめてuutils-coreutilsを使う
Rust製だそうだ、ステキ
scoop install uutils-coreutils-lean
で入れるけど、そのままだとcoreutils ls
とめんどいのでちょっといい感じにする
@"
arch, base32, base64, basename, cat, cksum, comm, cp, cut, date, df, dircolors, dirname,
echo, env, expand, expr, factor, false, fmt, fold, hashsum, head, hostname, join, link, ln, ls,
md5sum, mkdir, mktemp, more, mv, nl, nproc, od, paste, printenv, printf, ptx, pwd,
readlink, realpath, relpath, rm, rmdir, seq, sha1sum, sha224sum, sha256sum, sha3-224sum,
sha3-256sum, sha3-384sum, sha3-512sum, sha384sum, sha3sum, sha512sum, shake128sum,
shake256sum, shred, shuf, sleep, sort, split, sum, sync, tac, tail, tee, test, touch, tr,
true, truncate, tsort, unexpand, uniq, wc, whoami, yes
"@ -split ',' |
ForEach-Object { $_.trim() } |
Where-Object { ! @('tee', 'sort', 'sleep').Contains($_) } |
ForEach-Object {
$cmd = $_
if (Test-Path Alias:$cmd) { Remove-Item -Path Alias:$cmd }
$fn = '$input | uutils ' + $cmd + ' $args'
Invoke-Expression "function global:$cmd { $fn }"
}
参考:【0からのWindows環境構築】Powershellの操作をできるだけLinux/Macの操作感に近づける (Linuxコマンド導入+α)
ただし、いろいろ重要ツールがたりない
- cdの代わりにzoxide
- grepの代わりはripgrep
- findのかわりにfd
- sedのかわりはsd
chmln/sd: Intuitive find & replace CLI (sed alternative) - awkの代わりは、、、frawkというのがあるけど初見、ビルドしないと使えないっぽい
ezrosent/frawk: an efficient awk-like language
途中で見つけたこのサイト便利すぎる
Rewritten in Rust: Modern Alternatives of Command-Line Tools · Zaiste Programming
coreutilsでもfzfでコマンド履歴
gowのツール群つかっていちおう対応していた
# Fzf + Ctrl-r
Set-PSReadLineKeyHandler -Chord Ctrl+r -ScriptBlock {
Get-Content (Get-PSReadLineOption).HistorySavePath > $ENV:USERPROFILE/tmp/ctrlr
$command = tac $ENV:USERPROFILE/tmp/ctrlr | awk '!a[$0]++' | fzf -e +s
Remove-Item $ENV:USERPROFILE/tmp/ctrlr
[Microsoft.PowerShell.PSConsoleReadLine]::InvokePrompt()
if (!$command) { return }
[Microsoft.PowerShell.PSConsoleReadLine]::Insert($command)
}
が、awkがないのでエラーになる、そこでInstall-Module -Name PSFzf
して、$profileを変更した
# Fzf + Ctrl-r
Set-PsFzfOption -PSReadlineChordReverseHistory 'Ctrl+r'
え、超らくちん...
参考:【macOS で PowerShell Core】PSFzf でコマンド履歴を曖昧検索する | DevelopersIO
posh-git
こないだも書いた気がするけどposh-git
zoxideとか別にpromptを定義しているとやってくれないので事前に宣言されているなら削除するようにした
try {
(get-command -Name 'prompt' -ErrorAction Stop) | out-null
Remove-Item function:prompt
}
catch {
# Nothing to do
}
Import-Module posh-git