Bladeren bron

Add gitignore_global, plus updates

Tom McKenzie 6 jaren geleden
bovenliggende
commit
c3685b265e
7 gewijzigde bestanden met toevoegingen van 42 en 25 verwijderingen
  1. 6 1
      .gitconfig
  2. 0 3
      .rc.d/applications.sh
  3. 11 14
      .rc.d/docker.sh
  4. 13 0
      .zshrc.d/completion.zsh
  5. 1 6
      .zshrc.d/history.zsh
  6. 10 0
      .zshrc.d/zgen.zsh
  7. 1 1
      setup.sh

+ 6 - 1
.gitconfig

@@ -48,7 +48,7 @@
 
 [core]
 	editor = vim
-	excludesfile = ~/.gitignore-global
+	excludesfile = /Users/tom/.gitignore_global
 	whitespace = tab-in-indent,trailing-space,space-before-tab
 	ignorecase = false
 
@@ -58,3 +58,8 @@
 
 [push]
 	default = upstream
+[status]
+	submoduleSummary = true
+[merge "npm-merge-driver"]
+	name = automatically merge npm lockfiles
+	driver = npx npm-merge-driver merge %A %O %B %P

+ 0 - 3
.rc.d/applications.sh

@@ -16,6 +16,3 @@ command -v thefuck 1>/dev/null && eval "$(thefuck --alias)"
 
 # rbenv
 command -v rbenv 1>/dev/null && eval "$(rbenv init -)"
-
-# brew
-command -v brew 1>/dev/null && export PATH="$(brew --prefix qt@5.5)/bin:$PATH"

+ 11 - 14
.rc.d/docker.sh

@@ -1,20 +1,17 @@
 type docker &>/dev/null
 if [ $? -eq 0 ]; then
+  alias dbundle="docker-compose exec api bundle"
+  alias drspec="docker-compose exec -e RAILS_ENV=test api rspec"
   alias dredisflush="docker-compose exec redis redis-cli FLUSHALL"
-  alias dnewmigration="docker-compose exec web bundle exec rails generate migration"
-  alias dmigrate="docker-compose exec web bundle exec rake db:migrate"
-  alias drollback="docker-compose exec web bundle exec rake db:rollback"
-  alias dtestmigrate="docker-compose exec -e RAILS_ENV=test web bundle exec rake db:migrate"
-  alias dbundle="docker-compose exec web bundle"
-  alias dbi="docker-compose exec web bundle install"
-  alias drspec="docker-compose exec -e RAILS_ENV=test web bundle exec rspec"
-  alias dconsole="docker-compose exec web bundle exec rails c"
-  alias dsidekiq="docker-compose restart sidekiq"
-  alias dreset="docker-compose exec web bundle exec rake db:reset"
-  alias dtestreset="docker-compose exec -e RAILS_ENV=test web bundle exec rake db:reset"
-  alias dupdate="dbi && dreset && dtestreset && dredisflush && dsidekiq"
-  alias dswap="sed -i '' \"s/gem 'ap_shared'.*/gem 'ap_shared', path: '\.\.\/ap_shared'/\" Gemfile && dbi"
-  alias pryweb="docker attach $(docker ps -q --filter Name=apiactivepipecom_web_1)"
+
+  alias drails="docker-compose exec api rails"
+  alias dtestrails="docker-compose exec -e RAILS_ENV=test api rails"
+
+  alias dreset="drails db:create db:setup db:migrate data:migrate"
+  alias dtestreset="drailstest db:create db:setup"
+  alias dmigrate="drails db:migrate data:migrate"
+
+  alias pryapi="docker attach $(docker ps -q --filter Name=apiactivepipecom_api_1)"
   alias pryprefs="docker attach $(docker ps -q --filter Name=apiactivepipecom_prefs_1)"
   alias prysidekiq="docker attach $(docker ps -q --filter Name=apiactivepipecom_sidekiq_1)"
 

+ 13 - 0
.zshrc.d/completion.zsh

@@ -1,6 +1,19 @@
+# set up
+if [ ! -d "${HOME}/.zsh/completion" ]; then
+  mkdir -p "${HOME}/.zsh/completion"
+
+  echo 'Downloading completions'
+  curl -L https://raw.githubusercontent.com/docker/compose/1.23.1/contrib/completion/zsh/_docker-compose > ${HOME}/.zsh/completion/_docker-compose
+  curl -L https://raw.githubusercontent.com/docker/cli/18.09/contrib/completion/zsh/_docker > ${HOME}/.zsh/completion/_docker
+fi
+
+fpath=(${HOME}/.zsh/completion $fpath)
+
 # make autocompletion faster by caching
 autoload -Uz compinit
+
 compinit -d "$HOME/.zsh/cache/zcompdump"
+
 zstyle ':completion:*' use-cache on
 zstyle ':completion:*' cache-path $HOME/.zsh/cache
 

+ 1 - 6
.zshrc.d/history.zsh

@@ -4,7 +4,6 @@ SAVEHIST=25000
 
 # TODO: see this gist <https://gist.github.com/matthewmccullough/787142>
 
-
 # ignore duplicates (on find and on history file save)
 setopt HIST_FIND_NO_DUPS
 setopt HIST_SAVE_NO_DUPS
@@ -14,7 +13,7 @@ setopt hist_reduce_blanks
 # shared chronological history in log
 setopt INC_APPEND_HISTORY
 # shared history across shells
-# setopt share_history
+setopt share_history
 
 # list choices on ambiguous completion
 # use BASH_AUTO_LIST to require a second keypress
@@ -23,10 +22,6 @@ setopt AUTO_LIST
 # don't list on unambiguous prefix
 setopt LIST_AMBIGUOUS
 
-# bind to zsh-history-substring-search
-bindkey '^[[A' history-substring-search-up
-bindkey '^[[B' history-substring-search-down
-
 # ^R = pattern-enabled search
 bindkey '^R' history-incremental-pattern-search-backward
 

+ 10 - 0
.zshrc.d/zgen.zsh

@@ -28,6 +28,8 @@ fi
 # customise sfz-prompt
 PROMPT_SFZ_CHAR="›"
 
+setopt TRANSIENT_RPROMPT
+
 prompt_sfz_colors () {
   case $1 in
     grey)     echo "{234}";;
@@ -55,6 +57,14 @@ prompt_sfz_git_dirty() {
   # too expensive
 }
 
+# bind to zsh-history-substring-search
+bindkey '^[[A' history-substring-search-up
+bindkey '^[[B' history-substring-search-down
+
+# customize zsh-autosuggestions
+ZSH_AUTOSUGGEST_USE_ASYNC="true"
+ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE="60"
+
 # customise zsh-history-substring-search
 HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="underline"
 HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND="none"

+ 1 - 1
setup.sh

@@ -1,7 +1,7 @@
 # symlink dotfiles
 dir=~/dotfiles
 olddir=~/dotfiles/bak   # backup directory
-files=".zshrc .zshrc.d .rc.d .bashrc .vimrc .bash_logout .gitconfig .gitignore .gemrc"    # list of files/folders to symlink in homedir
+files=".zshrc .zshrc.d .rc.d .bashrc .vimrc .bash_logout .gitconfig .gitignore_global .gemrc"    # list of files/folders to symlink in homedir
 
 ## create dotfiles_old in homedir
 mkdir -p $olddir