diff --git a/aliases b/aliases index 7566e2e..173beb9 100644 --- a/aliases +++ b/aliases @@ -1,3 +1,8 @@ +# +# Note: this may contain windows line ended. If you're going to use it in Linux then you'll need +# to remove those with: sed -i 's/\r//' +# + # Handle the fact that this file will be used with multiple OSs platform=`uname` if [[ $platform == 'Linux' ]]; then @@ -121,7 +126,8 @@ alias rcc='rclone copy' function reload { if [[ $platform == 'Linux' || $platform == 'Darwin' ]]; then - source ~/.zshrc + #source ~/.zshrc + test -f ~/.aliases && . ~/.aliases else test -f ~/.aliases && . ~/.aliases fi @@ -347,6 +353,7 @@ alias gfix="git commit --amend -C HEAD" alias gfixx="git commit --amend -C HEAD ; gp -f" alias gfixs="git commit -S -a --amend -C HEAD" # signed alias gfo='git fetch origin' +alias gfu='git fetch up' alias gfm='git fetch origin master' alias gfup='git fetch upstream' alias ggrep='git log --all --oneline | grep ' diff --git a/windows/bash_profile b/bash/bash_profile similarity index 100% rename from windows/bash_profile rename to bash/bash_profile diff --git a/windows/bashrc b/bash/bashrc similarity index 75% rename from windows/bashrc rename to bash/bashrc index a8f4b95..4d56d26 100644 --- a/windows/bashrc +++ b/bash/bashrc @@ -3,9 +3,6 @@ # Unbreak broken, non-colored terminal export TERM=xterm-256color -# Don't use ^D to exit -set -o ignoreeof - # For Windows setup test -f ~/.functions && . ~/.functions test -f ~/.aliases && . ~/.aliases @@ -64,3 +61,27 @@ cd ~ export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +# Don't use ^D to exit +set -o ignoreeof + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# colored GCC warnings and errors +export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' diff --git a/windows/inputrc b/bash/inputrc similarity index 100% rename from windows/inputrc rename to bash/inputrc diff --git a/install b/install index b142d31..a6430cc 100644 --- a/install +++ b/install @@ -1,14 +1,16 @@ #!/bin/bash -source "script_helpers/all.sh" +source "$HOME/.dotfiles/script_helpers/all.sh" set -e cwd=$PWD platform=`uname` +echo platform: $platform + os_is_windows is_windows -if [[ $is_windows -eq 0 ]]; then +if [[ $is_windows -eq 1 ]]; then error "This is only supported on Linux or MacOS.\n" exit 1 fi @@ -43,6 +45,9 @@ setup_git() { setup_zsh() { printf "Setting up zsh...\n" + + sudo apt install zsh + TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)') if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then if hash chsh >/dev/null 2>&1; then @@ -85,7 +90,6 @@ setup_misc() { FILES=() FILES+=('curlrc') - FILES+=('racketrc') for file in "${FILES[@]}" do diff --git a/linux/gitconfig.platform b/linux/gitconfig.platform index caad4c1..1924e15 100644 --- a/linux/gitconfig.platform +++ b/linux/gitconfig.platform @@ -1,2 +1,4 @@ [code] editor = vim +[core] + autocrlf = true diff --git a/script_helpers/file_ops.sh b/script_helpers/file_ops.sh index 57cb9f4..b2ffc4e 100644 --- a/script_helpers/file_ops.sh +++ b/script_helpers/file_ops.sh @@ -186,8 +186,8 @@ link_file() { ! test -d "$source_path" && ! test -e "$source_path" && error "Source path '$source_path' doesn't exist!" && abort # Verify that the dest path doesn't already exist. - test -d "$dest_path" && error "Dest folder '$dest_path' already exists!" && abort - test -e "$dest_path" && error "Dest file '$dest_path' already exists!" && abort + test -d "$dest_path" && error "Dest folder '$dest_path' already exists!\n" && return + test -e "$dest_path" && error "Dest file '$dest_path' already exists!\n" && return if [[ $is_windows -eq 1 ]]; then source_path=$(unix_to_windows_path "$source_path") diff --git a/vimrc b/vimrc index ebcee4a..54de329 100644 --- a/vimrc +++ b/vimrc @@ -226,7 +226,8 @@ if IsWindows() " Just assume we don't have a zsh shell set shell=bash else - set shell=zsh + "set shell=zsh + set shell=bash endif set t_ti= t_te= " Prevent Vim from clobbering the scrollback buffer. See http://www.shallowsky.com/linux/noaltscreen.html diff --git a/windows/readme.md b/windows/readme.md index 2ecdb66..0643874 100644 --- a/windows/readme.md +++ b/windows/readme.md @@ -95,6 +95,10 @@ processor time and is generally useless. * Setup git completions for bash: * `curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash` +### 32-bit dev tools +* Load a 32-bit shell +* Install toolchain: `pacman -S mingw-w64-i686-toolchain` + ## Setting up dev tools * Download the Windows 2003 Resource Kit in order to get tools like `list.exe` (command line hex diff --git a/zshrc b/zshrc index 1ed6389..e1da854 100644 --- a/zshrc +++ b/zshrc @@ -40,9 +40,9 @@ prompt grb # Linux specific config if [[ $platform == 'Linux' ]]; then # Set caps to ctrl - setxkbmap -option 'caps:ctrl_modifier' + #setxkbmap -option 'caps:ctrl_modifier' # Make caps act as Esc when tapped. Require `xcape` package. - xcape -e 'Caps_Lock=Escape' + #xcape -e 'Caps_Lock=Escape' fi # Autoload things before calling compinit