From d7a9783cebd68fae2f2c1151cec25b35904266c2 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 25 Feb 2022 15:36:31 +0100 Subject: [PATCH] home: vim: keep space after shell redirections --- home/vim/after/ftplugin/bash.vim | 5 +++-- home/vim/after/ftplugin/sh.vim | 5 +++-- home/vim/after/ftplugin/zsh.vim | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/home/vim/after/ftplugin/bash.vim b/home/vim/after/ftplugin/bash.vim index 03f3f9f..cb85c8f 100644 --- a/home/vim/after/ftplugin/bash.vim +++ b/home/vim/after/ftplugin/bash.vim @@ -12,8 +12,9 @@ null_ls.register({ extra_args = { "-s", "bash", "-o", "avoid-nullary-conditions" }, }), null_ls.builtins.formatting.shfmt.with({ - -- Indent with 4 spaces, simplify the code, indent switch cases, use bash dialect - extra_args = { "-i", "4", "-s", "-ci", "-ln", "bash" }, + -- Indent with 4 spaces, simplify the code, indent switch cases, + -- add space after redirection, use bash dialect + extra_args = { "-i", "4", "-s", "-ci", "-sr", "-ln", "bash" }, }), }) EOF diff --git a/home/vim/after/ftplugin/sh.vim b/home/vim/after/ftplugin/sh.vim index f80f25a..442ebcb 100644 --- a/home/vim/after/ftplugin/sh.vim +++ b/home/vim/after/ftplugin/sh.vim @@ -12,8 +12,9 @@ null_ls.register({ extra_args = { "-o", "avoid-nullary-conditions" }, }), null_ls.builtins.formatting.shfmt.with({ - -- Indent with 4 spaces, simplify the code, indent switch cases, use POSIX - extra_args = { "-i", "4", "-s", "-ci", "-ln", "posix" }, + -- Indent with 4 spaces, simplify the code, indent switch cases, + -- add space after redirection, use POSIX + extra_args = { "-i", "4", "-s", "-ci", "-sr", "-ln", "posix" }, }), }) EOF diff --git a/home/vim/after/ftplugin/zsh.vim b/home/vim/after/ftplugin/zsh.vim index 03f3f9f..cb85c8f 100644 --- a/home/vim/after/ftplugin/zsh.vim +++ b/home/vim/after/ftplugin/zsh.vim @@ -12,8 +12,9 @@ null_ls.register({ extra_args = { "-s", "bash", "-o", "avoid-nullary-conditions" }, }), null_ls.builtins.formatting.shfmt.with({ - -- Indent with 4 spaces, simplify the code, indent switch cases, use bash dialect - extra_args = { "-i", "4", "-s", "-ci", "-ln", "bash" }, + -- Indent with 4 spaces, simplify the code, indent switch cases, + -- add space after redirection, use bash dialect + extra_args = { "-i", "4", "-s", "-ci", "-sr", "-ln", "bash" }, }), }) EOF