Various updates

This commit is contained in:
Michael Campagnaro 2020-03-15 14:44:36 -04:00
parent f1cbe81655
commit f02cb843aa
10 changed files with 51 additions and 12 deletions

View File

@ -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//' <file>
#
# Handle the fact that this file will be used with multiple OSs # Handle the fact that this file will be used with multiple OSs
platform=`uname` platform=`uname`
if [[ $platform == 'Linux' ]]; then if [[ $platform == 'Linux' ]]; then
@ -121,7 +126,8 @@ alias rcc='rclone copy'
function reload { function reload {
if [[ $platform == 'Linux' || $platform == 'Darwin' ]]; then if [[ $platform == 'Linux' || $platform == 'Darwin' ]]; then
source ~/.zshrc #source ~/.zshrc
test -f ~/.aliases && . ~/.aliases
else else
test -f ~/.aliases && . ~/.aliases test -f ~/.aliases && . ~/.aliases
fi fi
@ -347,6 +353,7 @@ alias gfix="git commit --amend -C HEAD"
alias gfixx="git commit --amend -C HEAD ; gp -f" alias gfixx="git commit --amend -C HEAD ; gp -f"
alias gfixs="git commit -S -a --amend -C HEAD" # signed alias gfixs="git commit -S -a --amend -C HEAD" # signed
alias gfo='git fetch origin' alias gfo='git fetch origin'
alias gfu='git fetch up'
alias gfm='git fetch origin master' alias gfm='git fetch origin master'
alias gfup='git fetch upstream' alias gfup='git fetch upstream'
alias ggrep='git log --all --oneline | grep ' alias ggrep='git log --all --oneline | grep '

View File

@ -3,9 +3,6 @@
# Unbreak broken, non-colored terminal # Unbreak broken, non-colored terminal
export TERM=xterm-256color export TERM=xterm-256color
# Don't use ^D to exit
set -o ignoreeof
# For Windows setup # For Windows setup
test -f ~/.functions && . ~/.functions test -f ~/.functions && . ~/.functions
test -f ~/.aliases && . ~/.aliases test -f ~/.aliases && . ~/.aliases
@ -64,3 +61,27 @@ cd ~
export NVM_DIR="$HOME/.nvm" export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads 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 [ -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'

10
install
View File

@ -1,14 +1,16 @@
#!/bin/bash #!/bin/bash
source "script_helpers/all.sh" source "$HOME/.dotfiles/script_helpers/all.sh"
set -e set -e
cwd=$PWD cwd=$PWD
platform=`uname` platform=`uname`
echo platform: $platform
os_is_windows is_windows 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" error "This is only supported on Linux or MacOS.\n"
exit 1 exit 1
fi fi
@ -43,6 +45,9 @@ setup_git() {
setup_zsh() { setup_zsh() {
printf "Setting up zsh...\n" printf "Setting up zsh...\n"
sudo apt install zsh
TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)') TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
if hash chsh >/dev/null 2>&1; then if hash chsh >/dev/null 2>&1; then
@ -85,7 +90,6 @@ setup_misc() {
FILES=() FILES=()
FILES+=('curlrc') FILES+=('curlrc')
FILES+=('racketrc')
for file in "${FILES[@]}" for file in "${FILES[@]}"
do do

View File

@ -1,2 +1,4 @@
[code] [code]
editor = vim editor = vim
[core]
autocrlf = true

View File

@ -186,8 +186,8 @@ link_file() {
! test -d "$source_path" && ! test -e "$source_path" && error "Source path '$source_path' doesn't exist!" && abort ! 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. # Verify that the dest path doesn't already exist.
test -d "$dest_path" && error "Dest folder '$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!" && abort test -e "$dest_path" && error "Dest file '$dest_path' already exists!\n" && return
if [[ $is_windows -eq 1 ]]; then if [[ $is_windows -eq 1 ]]; then
source_path=$(unix_to_windows_path "$source_path") source_path=$(unix_to_windows_path "$source_path")

3
vimrc
View File

@ -226,7 +226,8 @@ if IsWindows()
" Just assume we don't have a zsh shell " Just assume we don't have a zsh shell
set shell=bash set shell=bash
else else
set shell=zsh "set shell=zsh
set shell=bash
endif endif
set t_ti= t_te= " Prevent Vim from clobbering the scrollback buffer. See http://www.shallowsky.com/linux/noaltscreen.html set t_ti= t_te= " Prevent Vim from clobbering the scrollback buffer. See http://www.shallowsky.com/linux/noaltscreen.html

View File

@ -95,6 +95,10 @@ processor time and is generally useless.
* Setup git completions for bash: * Setup git completions for bash:
* `curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.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 ## Setting up dev tools
* Download the Windows 2003 Resource Kit in order to get tools like `list.exe` (command line hex * Download the Windows 2003 Resource Kit in order to get tools like `list.exe` (command line hex

4
zshrc
View File

@ -40,9 +40,9 @@ prompt grb
# Linux specific config # Linux specific config
if [[ $platform == 'Linux' ]]; then if [[ $platform == 'Linux' ]]; then
# Set caps to ctrl # Set caps to ctrl
setxkbmap -option 'caps:ctrl_modifier' #setxkbmap -option 'caps:ctrl_modifier'
# Make caps act as Esc when tapped. Require `xcape` package. # Make caps act as Esc when tapped. Require `xcape` package.
xcape -e 'Caps_Lock=Escape' #xcape -e 'Caps_Lock=Escape'
fi fi
# Autoload things before calling compinit # Autoload things before calling compinit