From bae893a736c213f87e7f05dd4743ce8222ee9472 Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Thu, 25 May 2023 15:43:03 -0700 Subject: [PATCH] Convert rust from stow to chezmoi --- .chezmoiignore | 2 -- dot_config/profile/profile.d/rust.sh.tmpl | 7 +++++++ dot_config/vim/ftplugin/rust.vim.tmpl | 3 +++ .../plug.d/rust.vim => dot_config/vim/plug.d/rust.vim.tmpl | 2 ++ rust/.config/profile/profile.d/rust.sh | 5 ----- rust/.config/vim/ftplugin/rust.vim | 1 - 6 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 dot_config/profile/profile.d/rust.sh.tmpl create mode 100644 dot_config/vim/ftplugin/rust.vim.tmpl rename rust/.config/vim/plug.d/rust.vim => dot_config/vim/plug.d/rust.vim.tmpl (54%) delete mode 100644 rust/.config/profile/profile.d/rust.sh delete mode 100644 rust/.config/vim/ftplugin/rust.vim diff --git a/.chezmoiignore b/.chezmoiignore index 556fca5..00846a5 100644 --- a/.chezmoiignore +++ b/.chezmoiignore @@ -1,8 +1,6 @@ /hellotech/ /install-scripts/ /old-scripts/ -/ruby/ -/rust/ /starship/ /tmux/ /vim-fancy/ diff --git a/dot_config/profile/profile.d/rust.sh.tmpl b/dot_config/profile/profile.d/rust.sh.tmpl new file mode 100644 index 0000000..5dda599 --- /dev/null +++ b/dot_config/profile/profile.d/rust.sh.tmpl @@ -0,0 +1,7 @@ +{{ if lookPath "cargo" -}} +#!/usr/bin/env bash + +if [ -f "${HOME}/.cargo/env" ]; then + . "${HOME}/.cargo/env" +fi +{{- end }} diff --git a/dot_config/vim/ftplugin/rust.vim.tmpl b/dot_config/vim/ftplugin/rust.vim.tmpl new file mode 100644 index 0000000..4621727 --- /dev/null +++ b/dot_config/vim/ftplugin/rust.vim.tmpl @@ -0,0 +1,3 @@ +{{ if lookPath "rustc" -}} +let g:rustfmt_autosave = 1 +{{- end }} diff --git a/rust/.config/vim/plug.d/rust.vim b/dot_config/vim/plug.d/rust.vim.tmpl similarity index 54% rename from rust/.config/vim/plug.d/rust.vim rename to dot_config/vim/plug.d/rust.vim.tmpl index bd1e9d7..1a53f08 100644 --- a/rust/.config/vim/plug.d/rust.vim +++ b/dot_config/vim/plug.d/rust.vim.tmpl @@ -1 +1,3 @@ +{{ if lookPath "rustc" -}} Plug 'rust-lang/rust.vim', { 'for': 'rust' } +{{- end }} diff --git a/rust/.config/profile/profile.d/rust.sh b/rust/.config/profile/profile.d/rust.sh deleted file mode 100644 index fe789ca..0000000 --- a/rust/.config/profile/profile.d/rust.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -if [ -f "${HOME}/.cargo/env" ]; then - . "${HOME}/.cargo/env" || exit 1 -fi diff --git a/rust/.config/vim/ftplugin/rust.vim b/rust/.config/vim/ftplugin/rust.vim deleted file mode 100644 index 4ef03d1..0000000 --- a/rust/.config/vim/ftplugin/rust.vim +++ /dev/null @@ -1 +0,0 @@ -let g:rustfmt_autosave = 1