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