diff options
author | William Carroll <wpcarro@gmail.com> | 2017-06-23T17·01-0400 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2017-06-23T17·01-0400 |
commit | f344f2e370fbf88a0306b6a01c99f386a13953c7 (patch) | |
tree | 81c19178bdc8986b59d3bca5e91efd9f01690941 | |
parent | e51d11e4bc344f624ec90afd299ac1dcb5e6e1fb (diff) |
Adds os detection for bootstrapping configs
-rw-r--r-- | configs/linux/.xinitrc (renamed from configs/.xinitrc) | 0 | ||||
-rw-r--r-- | configs/os_x/.slate.js (renamed from configs/.slate.js) | 0 | ||||
-rwxr-xr-x | configs/setup_configs.sh | 87 | ||||
-rw-r--r-- | configs/shared/.ctags (renamed from configs/.ctags) | 0 | ||||
-rw-r--r-- | configs/shared/.emacs (renamed from configs/.emacs) | 5 | ||||
-rw-r--r-- | configs/shared/.tmux.conf (renamed from configs/.tmux.conf) | 0 | ||||
-rw-r--r-- | configs/shared/.vimrc (renamed from configs/.vimrc) | 0 | ||||
-rw-r--r-- | configs/shared/.zsh_profile (renamed from configs/.zsh_profile) | 0 | ||||
-rw-r--r-- | emacs/wc-ansi-term-functions.el | 11 | ||||
-rw-r--r-- | tmux-256color-italic (renamed from configs/tmux-256color-italic) | 0 |
10 files changed, 50 insertions, 53 deletions
diff --git a/configs/.xinitrc b/configs/linux/.xinitrc index a0e8dea3a363..a0e8dea3a363 100644 --- a/configs/.xinitrc +++ b/configs/linux/.xinitrc diff --git a/configs/.slate.js b/configs/os_x/.slate.js index 21557111bc78..21557111bc78 100644 --- a/configs/.slate.js +++ b/configs/os_x/.slate.js diff --git a/configs/setup_configs.sh b/configs/setup_configs.sh index 734acedf428f..28dceff38126 100755 --- a/configs/setup_configs.sh +++ b/configs/setup_configs.sh @@ -1,62 +1,47 @@ #!/usr/bin/env bash - pc_settings_path="${HOME}/pc_settings" +configs_dir="${pc_settings_path}/configs" +shared_configs="${configs_dir}/shared" +if [[ $(uname) == 'Darwin' ]]; then + os_specific_configs="${configs_dir}/os_x" +elif [[ $(uname) == 'Linux' ]]; then + os_specific_configs="${configs_dir}/linux" +fi -config_files=( \ - ".zsh_profile" \ - ".tmux.conf" \ - ".ctags" \ - ".vimrc" \ - ".emacs" \ -) +function symlink_configs () { + configs_dir=$1 -for i in {1..5}; do - cf="${config_files[i]}" - echo "\"${cf}\": " + for cf in $(find $configs_dir -type f -name ".*"); do + filename=$(grep -o "[^\/]+$" <<<$cf) + echo "$filename: " - if [ -f "${HOME}/${cf}" ] && [ ! -L "${HOME}/${cf}" ]; then - echo -n "Backing up ${cf} ... " && \ - mv "${HOME}/${cf}" "${HOME}/${cf}.bak" && \ - echo "Done." - fi + if [ -f "${HOME}/${filename}" ] && [ ! -L "${HOME}/${filename}" ]; then + echo -n "Backing up ${filename} ... " && \ + mv "${HOME}/${filename}" "${HOME}/${filename}.bak" && \ + echo "Done." + fi - if [ -L "${HOME}/${cf}" ]; then - if [ $(readlink "${HOME}/${cf}") = "${pc_settings_path}/configs/${cf}" ]; then - echo "Already properly symlinked to \"${pc_settings_path}/configs\"." + if [ -L "${HOME}/${filename}" ]; then + if [ $(readlink "${HOME}/${filename}") = $cf ]; then + echo "Already properly symlinked to ${configs_dir}." + else + echo "Already symlinked but NOT to the proper location. Aborting..." + fi else - echo "Already symlinked but NOT to the proper location. Aborting..." + echo -n "Symlinking to ${filename} ... " && \ + ln -s $cf "${HOME}/${filename}" && \ + echo "Done." fi - else - echo -n "Symlinking to ${pc_settings_path}/configs/${cf} ... " && \ - ln -s "${pc_settings_path}/configs/${cf}" "${HOME}/${cf}" && \ - echo "Done." - fi - echo "" -done - - -# Fish Shell is a special case -# cf_dir="${HOME}/.configs/fish" -# cf="config.fish" - -# if [ -f "${cf_dir}/${cf}" ] && [ ! -L "${cf_dir}/${cf}" ]; then -# echo -n "Backing up ${cf} ... " && \ -# mv "${cf_dir}/${cf}" "${HOME}/${cf}.bak" && \ -# echo "Done." -# fi - -# if [ -L "${cf_dir}/${cf}" ]; then -# if [ $(readlink "${cf_dir}/${cf}") = "${pc_settings_path}/configs/${cf}" ]; then -# echo "Already properly symlinked to \"${pc_settings_path}/configs\"." -# else -# echo "Already symlinked but NOT to the proper location. Aborting..." -# fi -# else -# echo -n "Symlinking to ${pc_settings_path}/configs/${cf} ... " && \ -# ln -s "${pc_settings_path}/configs/${cf}" "${cf_dir}/${cf}" && \ -# echo "Done." -# fi -# echo "" + echo "" + done +} + + +# handle shared configs +symlink_configs $shared_configs + +# handle os-specific configs +symlink_configs $os_specific_configs diff --git a/configs/.ctags b/configs/shared/.ctags index c018567f2041..c018567f2041 100644 --- a/configs/.ctags +++ b/configs/shared/.ctags diff --git a/configs/.emacs b/configs/shared/.emacs index 2ff8906259a9..8c66c3c1592c 100644 --- a/configs/.emacs +++ b/configs/shared/.emacs @@ -246,6 +246,7 @@ :init (load "~/.emacs.d/wc-dired-functions.el") :bind (:map dired-mode-map + ("C-p" . helm-ag-neotree-node) ("e" . wdired-change-to-wdired-mode) ("c" . find-file) ("RET" . dired-find-alternate-file) @@ -337,11 +338,11 @@ ;; center search results (defadvice evil-search-next - (after center-evil-search-next) + (after center-evil-search-next activate) (call-interactively 'evil-scroll-line-to-center)) (defadvice evil-search-previous - (after center-evil-search-previous) + (after center-evil-search-previous activate) (call-interactively 'evil-scroll-line-to-center)) (add-hook 'org-mode-hook 'evil-local-mode)) diff --git a/configs/.tmux.conf b/configs/shared/.tmux.conf index 9d1d151bcecd..9d1d151bcecd 100644 --- a/configs/.tmux.conf +++ b/configs/shared/.tmux.conf diff --git a/configs/.vimrc b/configs/shared/.vimrc index e0476e3f12d1..e0476e3f12d1 100644 --- a/configs/.vimrc +++ b/configs/shared/.vimrc diff --git a/configs/.zsh_profile b/configs/shared/.zsh_profile index f533036acf9f..f533036acf9f 100644 --- a/configs/.zsh_profile +++ b/configs/shared/.zsh_profile diff --git a/emacs/wc-ansi-term-functions.el b/emacs/wc-ansi-term-functions.el new file mode 100644 index 000000000000..aae9e0c6c238 --- /dev/null +++ b/emacs/wc-ansi-term-functions.el @@ -0,0 +1,11 @@ +;; if in a project + ;; if ansi-term is an existing process for the current project + ;; ok + ;; create an ansi-term buffer for the current project + ;; if ansi-term is an open window + ;; if number of open windows == 1, visit MRU source code buffer + ;; if number of open windows > 1, (delete-window ansi-term-window) + ;; if ansi-term is not an open window + ;; open ansi-term other-window +;; else + ;; (message "You are not currently in a project.") diff --git a/configs/tmux-256color-italic b/tmux-256color-italic index f6f795e42377..f6f795e42377 100644 --- a/configs/tmux-256color-italic +++ b/tmux-256color-italic |