google / google/vim-codefmt

Add example to override = mappings in codefmt docs

オープン
#12 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Vim Script
スター
1.1k
フォーク
102
PR マージ指標
30日以内にマージされた PR はありません

説明

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:

``` VimL
function s:AddCodefmtEqualMapping() abort
" Replace all the various ={motion} keys to codefmt
nnoremap = :set opfunc=codefmt#FormatMapg@
nnoremap == :FormatLines
vnoremap = :FormatLines
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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。