Add example to override = mappings in codefmt docs
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 55/100
- Issue 類型
- 文件
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- vim
研究方向
從 codefmt 說明文件及其現有的格式化指南開始。加入所提供的、用於覆寫 = mappings 的 VimL 範例,然後說明使用者應有的預期,以及將其套用至選定 filetype 時的注意事項;確認範例易於閱讀,並且與周圍的說明文字一致。
由索引模型根據 Issue 內容生成。
描述
Some filetypes have terrible default indenting logic (using the = mapping) and also have a formatter fast enough and robust enough to drop in as the formatting implementation for the = mapping. You can do this by adding something like the following to your vimrc:
function s:AddCodefmtEqualMapping() abort
" Replace all the various ={motion} keys to codefmt
nnoremap <buffer> = :set opfunc=codefmt#FormatMap<CR>g@
nnoremap <buffer> == :FormatLines<CR>
vnoremap <buffer> = :FormatLines<CR>
endfunction
augroup codefmt_equal
autocmd FileType cpp,proto call s:AddCodefmtEqualMapping()
augroup END
We should add an example like this into the codefmt help and explain what to expect + caveats when you use it.
- 主要語言
- Vim Script
- 星號
- 1.1k
- 分支
- 103
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
google/vim-codefmt 的其他 Issue
-
enhancement
難度 1/5 1-3 小時 新手友好度 68/100
google/vim-codefmt#53 ·
-
難度 3/5 1-2 天 新手友好度 45/100
google/vim-codefmt#247 ·
-
Add meson format未關閉new formatter
難度 3/5 1-2 天 新手友好度 45/100
google/vim-codefmt#243 ·
-
難度 3/5 1-2 天 新手友好度 52/100
google/vim-codefmt#240 · 1 則留言 ·
-
enhancement
難度 5/5 一週以上 新手友好度 35/100
google/vim-codefmt#234 · 2 則留言 ·
查看 google/vim-codefmt 的全部 Issue
相似的 Issue
-
automated issue linkchecker report
難度 2/5 1-3 小時 新手友好度 66/100
QuantEcon/lecture-python.myst#1098 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 82/100
OpenShot/openshot-qt#6230 ·
維護者通常 1 天內回覆
-
area: docs difficulty: easy documentation first-timers-only good first issue help wanted
難度 2/5 1-3 小時 新手友好度 88/100
hayagrivai-labs/phantom#123 ·
維護者通常 1 天內回覆
-
self-driving
難度 1/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 68/100
yazi-rs/yazi-rs.github.io#438 ·