From ae7f65acd81feea971d6196bb5f7a9e37784e33e Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Fri, 22 Mar 2019 16:59:24 +0000 Subject: [PATCH 1/2] Default to rustfmt for formatcmd in rust `rustfmt` is the de facto standard for formatting in rust so setting it by default would be nice. https://github.com/mawww/kakoune/issues/2801 --- rc/filetype/rust.kak | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index 9cbca842..b11c9da6 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -86,3 +86,8 @@ hook global WinSetOption filetype=rust %[ hook window InsertChar \} -group rust-indent rust-indent-on-closing-curly-brace hook -once -always window WinSetOption filetype=.* %{ remove-hooks window rust-.+ } ] + +# Configuration +# ‾‾‾‾‾‾‾‾‾‾‾‾‾ + +set window formatcmd 'rustfmt' From ac4ad861ab4ab70369cff6a774ae85e953cf9f69 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Sat, 23 Mar 2019 15:48:12 +0000 Subject: [PATCH 2/2] Fix hook --- rc/filetype/rust.kak | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index b11c9da6..f32264ee 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -90,4 +90,6 @@ hook global WinSetOption filetype=rust %[ # Configuration # ‾‾‾‾‾‾‾‾‾‾‾‾‾ -set window formatcmd 'rustfmt' +hook global WinSetOption filetype=rust %[ + set window formatcmd 'rustfmt' +]