From 222981a57dcb873ce4c5e8e3422568c82cbac2ba Mon Sep 17 00:00:00 2001 From: tdro Date: Tue, 28 Mar 2023 05:55:06 -0400 Subject: .vim/vimrc: Fix ruby setup --- .config/nixpkgs/config.nix | 2 +- .vim/vimrc | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.config/nixpkgs/config.nix b/.config/nixpkgs/config.nix index 0c552a9..0070e86 100644 --- a/.config/nixpkgs/config.nix +++ b/.config/nixpkgs/config.nix @@ -549,7 +549,7 @@ in Ruby = pkgs.buildEnv { name = "ruby"; - paths = [ rufo rubocop ruby ]; + paths = [ rubocop ruby ]; }; C = pkgs.buildEnv { diff --git a/.vim/vimrc b/.vim/vimrc index 32e5d1e..e36809f 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -293,10 +293,10 @@ augroup AutoCommands autocmd FileType css autocmd! BufWritePost exe 'Notify(''prettier --write --parser css ' . expand('%') . ' 2>&1'')' | :e autocmd FileType html autocmd! BufWritePost exe 'Notify(''prettier --write --parser html ' . expand('%') . ' 2>&1'')' | :e autocmd FileType python autocmd! BufWritePost exe 'Notify(''black ' . expand('%') . ' 2>&1 && pylint ' . expand('%') . ' 2>&1'')' | :e - autocmd FileType ruby autocmd! BufWritePost exe 'Notify(''rufo ' . expand('%') . ' 2>&1 && rubocop ' . expand('%') . ' 2>&1'')' | :e autocmd FileType nim autocmd! BufWritePost exe 'Notify(''nimpretty ' . expand('%') . ' 2>&1 && printf "Nim OK: ' . expand('%') . '"'')' | :e autocmd FileType rust autocmd! BufWritePost exe 'Notify(''rustfmt ' . expand('%') . ' 2>&1 && printf "rustfmt OK: ' . expand('%') . '"'')' | :e autocmd FileType json autocmd! BufWritePost exe 'Notify(''jsonlint -i ' . expand('%') . ' 2>&1 && printf "JSON OK: ' . expand('%') . '"'')' | :e + autocmd FileType ruby autocmd! BufWritePost exe 'Notify(''rubocop --fix-layout ' . expand('%') . ' 2>&1 && rubocop ' . expand('%') . ' 2>&1'')' | :e autocmd FileType javascript autocmd! BufWritePost exe 'Notify(''eslint --fix ' . expand('%') . ' 2>&1 && printf "JavaScript OK: '. expand('%') . '"'')' | :e autocmd FileType elixir autocmd! BufWritePost exe 'Notify(''mix format ' . expand('%') . ' 2>&1 && printf "Elixir Format OK: ' . expand('%') . '"'')' | :e autocmd FileType haskell autocmd! BufWritePost exe 'Notify(''hlint ' . expand('%') . ' 2>&1 && brittany --write-mode inplace ' . expand('%') . ' 2>&1'')' | :e @@ -310,7 +310,7 @@ augroup AutoCommands autocmd FileType bindzone autocmd! BufWritePost exe 'Notify(''file="' . expand('%') . '" && named-checkzone "$(head --lines=1 "$file" | cut --delimiter=" " --fields=2 | perl -ple "chop")" $file'')' | :e autocmd FileType awk autocmd! BufWritePost exe 'Notify(''awk -g -f ' . expand('%') . ' 2>&1 && awk -o- -f ' . expand('%') . ' | sponge ' . expand('%') . ' && printf "AWK OK: ' . expand('%') . '"'')' | :e autocmd FileType yaml autocmd! BufWritePost exe 'Notify(''yaml round-trip --indent 2 --save ' . expand('%') . ' 2>&1 && yamllint -s ' . expand('%') . ' 2>&1 && printf "YAML OK: ' . expand('%') . '"'')' | :e - autocmd FileType typescript autocmd! BufWritePost exe 'Notify(''deno fmt ' . expand('%') . ' 2>&1 && NO_COLOR=true deno lint ' . expand('%') . ' 2>&1'')' | :e | :only | :term ++rows=10 deno run --config tsconfig.json --allow-all --location https://example.com/ % + autocmd FileType typescript autocmd! BufWritePost exe 'Notify(''deno fmt ' . expand('%') . ' 2>&1 && NO_COLOR=true deno lint ' . expand('%') . ' 2>&1'')' | :e | :only | :term ++rows=10 deno run --allow-all --location https://example.com/ % autocmd FileType sql autocmd! BufWritePost exe 'Notify(''sqlint ' . expand('%') . ' 2>&1 && pg_format --type-case 2 --inplace ' . expand('%') . ' 2>&1 && sqlfluff lint --exclude-rules L003,L016 --dialect postgres ' . expand('%') . ' 2>&1 && printf "SQL OK: ' . expand('%') . '"'')' | :e " Linting extension post write commands. @@ -348,9 +348,10 @@ augroup AutoCommands autocmd FileType sh set formatprg=shfmt\ - autocmd FileType typescriptreact set formatprg=deno\ fmt\ - autocmd FileType typescript set formatprg=deno\ fmt\ - - autocmd FileType javascript set formatprg=prettier\ --parser\ babel\ --stdin-filepath\ % autocmd FileType html set formatprg=prettier\ --parser\ html\ --stdin-filepath\ % + autocmd FileType javascript set formatprg=prettier\ --parser\ babel\ --stdin-filepath\ % autocmd FileType markdown set formatprg=prettier\ --parser\ markdown\ --stdin-filepath\ % + autocmd FileType ruby set formatprg=rubocop\ --autocorrect\ --stderr\ --stdin\ %\ 2>\ \/dev\/null " Set file types. autocmd BufRead,BufNewFile *.nims set filetype=nim -- cgit v1.2.3