Skip to content

Commit

Permalink
History ignore in zsh.
Browse files Browse the repository at this point in the history
  • Loading branch information
marciotoshio committed Aug 17, 2021
1 parent fde3cb6 commit e1a6990
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ Thumbs.db
# Files that might appear on external disks
.Spotlight-V100
.Trashes

.byebug_history
.orig
13 changes: 13 additions & 0 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,19 @@ unset file;
export HISTCONTROL='ignoreboth:erasedups'
export HISTIGNORE="&:ls:cd:mkdir:cat:mv:cp:rm:exit:pwd:touch:clear:g* checkout:g* branch:source:history:[ \t]*"

setopt HIST_IGNORE_SPACE
setopt HIST_NO_STORE
setopt HIST_NO_FUNCTIONS

# use .zsh_history from Google Drive
SOURCE_FILE=~/Google\ Drive/Settings/.zsh_history

if [[ -f "$SOURCE_FILE" ]]; then
export HISTFILE=$SOURCE_FILE
else
echo "History file does not exist: $SOURCE_FILE"
fi

[[ -e ~/.profile ]] && emulate sh -c 'source ~/.profile'

# Allow call rake with arguments
Expand Down
23 changes: 2 additions & 21 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,12 @@ function doIt() {
--exclude "README.md" \
--exclude "LICENSE-MIT.txt" \
-avh --no-perms . ~;

# link .zsh_history from Google Drive
SOURCE_FILE=~/Google\ Drive/Settings/.zsh_history
LINK_NAME=~/.zsh_history

if [[ -f "$SOURCE_FILE" ]]; then
rm -f $LINK_NAME
ln -fs $SOURCE_FILE $LINK_NAME
echo "History file link created."
ls -la $LINK_NAME
else
echo "History file does not exist: $SOURCE_FILE"
echo "Run again after setting up Google Backup and Sync service."
fi

source ~/.zshrc;

###############################################################################
# Sublime Text #
###############################################################################
echo "Rsynced dot files"

# Install Sublime Text settings
echo "Copying Sublime preferences"
cp -r init/Preferences.sublime-settings ~/Library/Application\ Support/Sublime\ Text*/Packages/User/ 2> /dev/null
cp -r init/Markdown.sublime-settings ~/Library/Application\ Support/Sublime\ Text*/Packages/User/ 2> /dev/null
echo "Copied Sublime preferences"
}

if [ "$1" = "--force" -o "$1" = "-f" ]; then
Expand Down

0 comments on commit e1a6990

Please sign in to comment.