Commit 7576f856 authored by Ramses Ladlani's avatar Ramses Ladlani
Browse files

Merge remote-tracking branch 'robyrussel/master' into fix-atom_plugin_for_cygwin

Discarded all previous changes to atom plugin for easier review in next commit.
parents 6e0fcf80 918d26e7
#!/usr/bin/env zsh
# vim:ft=zsh ts=2 sw=2 sts=2
# Note: The heavy_black_heart emoji requires $emoji2[emoji_style]
# to be rendered as the emoji red heart.
_emotty_sets[love]="
green_heart
blue_heart
purple_heart
yellow_heart
heavy_black_heart
broken_heart
heart_with_arrow
heart_with_ribbon
sparkling_heart
two_hearts
revolving_hearts
growing_heart
beating_heart
heart_decoration
couple_with_heart
kiss
man_and_woman_holding_hands
two_women_holding_hands
two_men_holding_hands
kiss_mark
smiling_face_with_heart_shaped_eyes
kissing_face
face_throwing_a_kiss
kissing_face_with_smiling_eyes
kissing_face_with_closed_eyes
smiling_cat_face_with_heart_shaped_eyes
kissing_cat_face_with_closed_eyes
"
#!/usr/bin/env zsh
# vim:ft=zsh ts=2 sw=2 sts=2
_emotty_sets[nature]="
mouse_face
hamster_face
rabbit_face
dog_face
cat_face
tiger_face
bear_face
monkey_face
koala
panda_face
chicken
baby_chick
bird
penguin
cow_face
pig_face
frog_face
boar
wolf_face
horse_face
snail
bug
ant
honeybee
lady_beetle
spouting_whale
dolphin
octopus
fish
tropical_fish
snake
turtle
lemon
tangerine
peach
mushroom
tomato
strawberry
red_apple
cherries
grapes
aubergine
watermelon
banana
pineapple
melon
pear
green_apple
ear_of_maize
sunflower
seedling
herb
four_leaf_clover
"
#!/usr/bin/env zsh
# vim:ft=zsh ts=2 sw=2 sts=2
# NOTE: The following emoji show as $'character' in the title
# white_medium_star
# sparkles
# dizzy_symbol
_emotty_sets[stellar]="
full_moon_symbol
waning_gibbous_moon_symbol
waning_crescent_moon_symbol
last_quarter_moon_symbol
new_moon_symbol
new_moon_with_face
waxing_crescent_moon_symbol
first_quarter_moon_symbol
waxing_gibbous_moon_symbol
full_moon_with_face
sun_with_face
glowing_star
crescent_moon
first_quarter_moon_with_face
last_quarter_moon_with_face
"
#!/usr/bin/env zsh
# vim:ft=zsh ts=2 sw=2 sts=2
_emotty_sets[zodiac]="
aries
taurus
gemini
cancer
leo
virgo
libra
scorpius
sagittarius
capricorn
aquarius
pisces
rat
ox
tiger
rabbit
dragon
snake
horse
goat
monkey
rooster
dog
pig
"
# Use Ctrl-Z to switch back to Vim
I frequently need to execute random command in my shell. To achieve it I pause
Vim by pressing Ctrl-z, type command and press fg<Enter> to switch back to Vim.
The fg part really hurt sme. I just wanted to hit Ctrl-z once again to get back
to Vim. I could not find a solution, so I developed one on my own that
works wonderfully with ZSH
Source: http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/
Credits:
- original idea by @sheerun
- added to OMZ by @mbologna
fancy-ctrl-z () {
if [[ $#BUFFER -eq 0 ]]; then
BUFFER="fg"
zle accept-line
else
zle push-input
zle clear-screen
fi
}
zle -N fancy-ctrl-z
bindkey '^Z' fancy-ctrl-z
......@@ -3,19 +3,20 @@
# Description
# -----------
#
# Completion script for git-extras (http://github.com/visionmedia/git-extras).
# Completion script for git-extras (http://github.com/tj/git-extras).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Alexis GRIMALDI (https://github.com/agrimaldi)
# * spacewander (https://github.com/spacewander)
#
# ------------------------------------------------------------------------------
# Inspirations
# -----------
#
# * git-extras (http://github.com/visionmedia/git-extras)
# * git-extras (http://github.com/tj/git-extras)
# * git-flow-completion (http://github.com/bobthecow/git-flow-completion)
#
# ------------------------------------------------------------------------------
......@@ -30,10 +31,21 @@ __git_command_successful () {
}
__git_commits() {
declare -A commits
git log --oneline -15 | sed 's/\([[:alnum:]]\{7\}\) /\1:/' | while read commit
do
hash=$(echo $commit | cut -d':' -f1)
commits[$hash]="$commit"
done
local ret=1
_describe -t commits commit commits && ret=0
}
__git_tag_names() {
local expl
declare -a tag_names
tag_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
tag_names=(${${(f)"$(_call_program tags git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
__git_command_successful || return
_wanted tag-names expl tag-name compadd $* - $tag_names
}
......@@ -47,31 +59,27 @@ __git_branch_names() {
_wanted branch-names expl branch-name compadd $* - $branch_names
}
__git_feature_branch_names() {
__git_specific_branch_names() {
local expl
declare -a branch_names
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/feature 2>/dev/null)"}#refs/heads/feature/})
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/"$1" 2>/dev/null)"}#refs/heads/$1/})
__git_command_successful || return
_wanted branch-names expl branch-name compadd $* - $branch_names
}
__git_feature_branch_names() {
__git_specific_branch_names 'feature'
}
__git_refactor_branch_names() {
local expl
declare -a branch_names
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/refactor 2>/dev/null)"}#refs/heads/refactor/})
__git_command_successful || return
_wanted branch-names expl branch-name compadd $* - $branch_names
__git_specific_branch_names 'refactor'
}
__git_bug_branch_names() {
local expl
declare -a branch_names
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/bug 2>/dev/null)"}#refs/heads/bug/})
__git_command_successful || return
_wanted branch-names expl branch-name compadd $* - $branch_names
__git_specific_branch_names 'bug'
}
......@@ -92,19 +100,43 @@ __git_author_names() {
_wanted author-names expl author-name compadd $* - $author_names
}
# subcommands
_git-changelog() {
_arguments \
'(-l --list)'{-l,--list}'[list commits]' \
_git-bug() {
local curcontext=$curcontext state line ret=1
declare -A opt_args
_arguments -C \
': :->command' \
'*:: :->option-or-argument' && ret=0
case $state in
(command)
declare -a commands
commands=(
'finish:merge bug into the current branch'
)
_describe -t commands command commands && ret=0
;;
(option-or-argument)
curcontext=${curcontext%:*}-$line[1]:
case $line[1] in
(finish)
_arguments -C \
':branch-name:__git_bug_branch_names'
;;
esac
esac
}
_git-effort() {
_git-changelog() {
_arguments \
'--above[ignore file with less than x commits]' \
'(-l --list)'{-l,--list}'[list commits]' \
}
_git-contrib() {
_arguments \
':author:__git_author_names'
......@@ -135,6 +167,11 @@ _git-delete-tag() {
}
_git-effort() {
_arguments \
'--above[ignore file with less than x commits]'
}
_git-extras() {
local curcontext=$curcontext state line ret=1
declare -A opt_args
......@@ -154,20 +191,7 @@ _git-extras() {
esac
_arguments \
'(-v --version)'{-v,--version}'[show current version]' \
}
_git-graft() {
_arguments \
':src-branch-name:__git_branch_names' \
':dest-branch-name:__git_branch_names'
}
_git-squash() {
_arguments \
':branch-name:__git_branch_names'
'(-v --version)'{-v,--version}'[show current version]'
}
......@@ -199,6 +223,25 @@ _git-feature() {
}
_git-graft() {
_arguments \
':src-branch-name:__git_branch_names' \
':dest-branch-name:__git_branch_names'
}
_git-ignore() {
_arguments -C \
'(--local -l)'{--local,-l}'[show local gitignore]' \
'(--global -g)'{--global,-g}'[show global gitignore]'
}
_git-missing() {
_arguments \
':first-branch-name:__git_branch_names' \
':second-branch-name:__git_branch_names'
}
_git-refactor() {
local curcontext=$curcontext state line ret=1
declare -A opt_args
......@@ -227,59 +270,62 @@ _git-refactor() {
}
_git-bug() {
local curcontext=$curcontext state line ret=1
declare -A opt_args
_arguments -C \
': :->command' \
'*:: :->option-or-argument' && ret=0
_git-squash() {
_arguments \
':branch-name:__git_branch_names'
}
case $state in
(command)
declare -a commands
commands=(
'finish:merge bug into the current branch'
)
_describe -t commands command commands && ret=0
;;
(option-or-argument)
curcontext=${curcontext%:*}-$line[1]:
case $line[1] in
(finish)
_arguments -C \
':branch-name:__git_bug_branch_names'
;;
esac
esac
_git-summary() {
_arguments '--line[summarize with lines other than commits]'
__git_commits
}
_git-undo(){
_arguments -C \
'(--soft -s)'{--soft,-s}'[only rolls back the commit but changes remain un-staged]' \
'(--hard -h)'{--hard,-h}'[wipes your commit(s)]'
}
zstyle ':completion:*:*:git:*' user-commands \
alias:'define, search and show aliases' \
archive-file:'export the current HEAD of the git repository to a archive' \
back:'undo and stage latest commits' \
bug:'create a bug branch' \
changelog:'populate changelog file with commits since the previous tag' \
commits-since:'list commits since a given date' \
contrib:'display author contributions' \
count:'count commits' \
create-branch:'create local and remote branch' \
delete-branch:'delete local and remote branch' \
delete-merged-brancees:'delete merged branches'\
delete-submodule:'delete submodule' \
delete-tag:'delete local and remote tag' \
effort:'display effort statistics' \
extras:'git-extras' \
graft:'merge commits from source branch to destination branch' \
squash:'merge commits from source branch into the current one as a single commit' \
feature:'create a feature branch' \
refactor:'create a refactor branch' \
bug:'create a bug branch' \
summary:'repository summary' \
effort:'display effort statistics' \
repl:'read-eval-print-loop' \
commits-since:'list commits since a given date' \
release:'release commit with the given tag' \
alias:'define, search and show aliases' \
fork:'fork a repo on github' \
fresh-branch:'create empty local branch' \
gh-pages:'create the GitHub Pages branch' \
graft:'merge commits from source branch to destination branch' \
ignore:'add patterns to .gitignore' \
info:'show info about the repository' \
create-branch:'create local and remote branch' \
fresh-branch:'create empty local branch' \
undo:'remove the latest commit' \
local-commits:'list unpushed commits on the local branch' \
lock:'lock a file excluded from version control' \
locked:'ls files that have been locked' \
missing:'show commits missing from another branch' \
pr:'checks out a pull request locally' \
rebase-patch:'rebases a patch' \
refactor:'create a refactor branch' \
release:'commit, tag and push changes to the repository' \
rename-tag:'rename a tag' \
repl:'read-eval-print-loop' \
reset-file:'reset one file' \
root:'show path of root' \
setup:'setup a git repository' \
show-tree:'show branch tree of commit history' \
squash:'merge commits from source branch into the current one as a single commit' \
summary:'repository summary' \
touch:'one step creation of new files' \
obliterate:'Completely remove a file from the repository, including past commits and tags' \
local-commits:'list unpushed commits on the local branch' \
undo:'remove the latest commit' \
unlock:'unlock a file excluded from version control'
......@@ -29,7 +29,10 @@ if [[ -x "${commands[gwhoami]}" ]]; then
'gunexpand' 'guniq' 'gunlink' 'guptime' 'gusers' 'gvdir' 'gwc' 'gwho'
'gwhoami' 'gyes')
# Not part of coreutils, installed separately.
# findutils
gcmds+=('gfind' 'gxargs' 'glocate')
# Not part of either coreutils or findutils, installed separately.
gcmds+=('gsed' 'gtar' 'gtime')
for gcmd in "${gcmds[@]}"; do
......
......@@ -54,23 +54,42 @@ __go_tool_complete() {
'-installsuffix[suffix to add to package directory]:suffix'
'-tags[list of build tags to consider satisfied]:tags'
)
__go_list() {
local expl importpaths
declare -a importpaths
importpaths=($(go list ${words[$CURRENT]}... 2>/dev/null))
_wanted importpaths expl 'import paths' compadd "$@" - "${importpaths[@]}"
__go_packages() {
local gopaths
declare -a gopaths
gopaths=("${(s/:/)$(go env GOPATH)}")
gopaths+=("$(go env GOROOT)")
for p in $gopaths; do
_path_files -W "$p/src" -/
done
}
__go_identifiers() {
compadd $(godoc -templates $ZSH/plugins/golang/templates ${words[-2]} 2> /dev/null)
}
case ${words[2]} in
clean|doc)
_arguments -s -w : '*:importpaths:__go_list'
doc)
_arguments -s -w \
"-c[symbol matching honors case (paths not affected)]" \
"-cmd[show symbols with package docs even if package is a command]" \
"-u[show unexported symbols as well as exported]" \
"2:importpaths:__go_packages" \
":next identifiers:__go_identifiers"
;;
clean)
_arguments -s -w \
"-i[remove the corresponding installed archive or binary (what 'go install' would create)]" \
"-n[print the remove commands it would execute, but not run them]" \
"-r[apply recursively to all the dependencies of the packages named by the import paths]" \
"-x[print remove commands as it executes them]" \
"*:importpaths:__go_packages"
;;
fix|fmt|list|vet)
_alternative ':importpaths:__go_list' ':files:_path_files -g "*.go"'
_alternative ':importpaths:__go_packages' ':files:_path_files -g "*.go"'
;;
install)
_arguments -s -w : ${build_flags[@]} \
"-v[show package names]" \
'*:importpaths:__go_list'
'*:importpaths:__go_packages'
;;
get)
_arguments -s -w : \
......@@ -81,7 +100,7 @@ __go_tool_complete() {
${build_flags[@]} \
"-v[show package names]" \
"-o[output file]:file:_files" \
"*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
"*:args:{ _alternative ':importpaths:__go_packages' ':files:_path_files -g \"*.go\"' }"
;;
test)
_arguments -s -w : \
......@@ -103,7 +122,7 @@ __go_tool_complete() {
"-cpuprofile[write CPU profile to file]:file:_files" \
"-memprofile[write heap profile to file]:file:_files" \
"-memprofilerate[set heap profiling rate]:number" \
"*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
"*:args:{ _alternative ':importpaths:__go_packages' ':files:_path_files -g \"*.go\"' }"
;;
help)
_values "${commands[@]}" \
......
{{with .PDoc}}{{/*
Constants
---------------------------------------
*/}}{{with .Consts}}{{range .}}{{range .Names}}{{.}} {{end}}{{end}}{{end}}{{/*
Variables
---------------------------------------
*/}}{{with .Vars}}{{range .}}{{range .Names}}{{.}} {{end}}{{end}}{{end}}{{/*
Functions
---------------------------------------
*/}}{{with .Funcs}}{{range .}}{{ .Name }} {{end}}{{end}}{{/*
Types
---------------------------------------
*/}}{{with .Types}}{{range .}}{{ $TypeName := .Name }}{{ $TypeName }} {{/*
*/}}{{range .Methods}}{{ $TypeName }}.{{.Name}} {{end}}{{/*
*/}}{{range .Funcs}}{{.Name}} {{end}}{{/*
*/}}{{range .Consts}}{{range .Names}}{{.}} {{end}}{{end}}{{/*
*/}}{{range .Vars}}{{range .Names}}{{.}} {{end}}{{end}}{{end}}{{end}}{{end}}
......@@ -82,7 +82,7 @@ _gradlew_tasks () {
if [ in_gradle ]; then
_gradle_arguments
if _gradle_does_task_list_need_generating; then
gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9:]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
./gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9:]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
fi
compadd -X "==== Gradlew Tasks ====" `cat .gradletasknamecache`
fi
......
#!/usr/bin/env zsh
#
# gulp-autocompletion-zsh
#
# Autocompletion for your gulp.js tasks
#
# Copyright(c) 2014 André König <andre.koenig@posteo.de>
# MIT Licensed
#
#
# André König
# Github: https://github.com/akoenig
# Twitter: https://twitter.com/caiifr
#
#
# Grabs all available tasks from the `gulpfile.js`
# in the current directory.
#
function $$gulp_completion() {
compls=$(grep -Eo "gulp.task\(('(([a-zA-Z0-9]|-)*)',)" gulpfile.js 2>/dev/null | grep -Eo "'(([a-zA-Z0-9]|-)*)'" | sed s/"'"//g | sort)
completions=(${=compls})
compadd -- $completions
}
compdef $$gulp_completion gulp
\ No newline at end of file
# Jira plugin #
CLI support for JIRA interaction
## Description ##
This plugin provides command line tools for interacting with Atlassian's [JIRA](https://www.atlassian.com/software/jira) bug tracking software.
The interaction is all done through the web. No local installation of JIRA is necessary.
In this document, "JIRA" refers to the JIRA issue tracking server, and `jira` refers to the command this plugin supplies.
## Usage ##
This plugin supplies one command, `jira`, through which all its features are exposed. Most forms of this command open a JIRA page in your web browser.
```
jira # performs the default action
jira new # opens a new issue
jira dashboard # opens your JIRA dashboard
jira reported [username] # queries for issues reported by a user
jira assigned [username] # queries for issues assigned to a user
jira ABC-123 # opens an existing issue
jira ABC-123 m # opens an existing issue for adding a comment
```
#### Debugging usage ####
These calling forms are for developers' use, and may change at any time.
```
jira dumpconfig # displays the effective configuration
```
## Setup ##
The URL for your JIRA instance is set by `$JIRA_URL` or a `.jira_url` file.
Add a `.jira-url` file in the base of your project. You can also set `$JIRA_URL` in your `~/.zshrc` or put a `.jira-url` in your home directory. A `.jira-url` in the current directory takes precedence, so you can make per-project customizations.
The same goes with `.jira-prefix` and `$JIRA_PREFIX`. These control the prefix added to all issue IDs, which differentiates projects within a JIRA instance.
For example:
```
cd to/my/project
echo "https://jira.atlassian.com" >> .jira-url
```
(Note: The current implementation only looks in the current directory for `.jira-url` and `.jira-prefix`, not up the path, so if you are in a subdirectory of your project, it will fall back to your default JIRA URL. This will probably change in the future though.)
### Variables ###
* `$JIRA_URL` - Your JIRA instance's URL
* `$JIRA_NAME` - Your JIRA username; used as the default user for `assigned`/`reported` searches
* `$JIRA_PREFIX` - Prefix added to issue ID arguments
* `$JIRA_RAPID_BOARD` - Set to `true` if you use Rapid Board
* `$JIRA_DEFAULT_ACTION` - Action to do when `jira` is called with no arguments; defaults to "new"
### Browser ###
Your default web browser, as determined by how `open_command` handles `http://` URLs, is used for interacting with the JIRA instance. If you change your system's URL handler associations, it will change the browser that `jira` uses.
......@@ -7,6 +7,7 @@ _1st_arguments=(
'dashboard:open the dashboard'
'reported:search for issues reported by a user'
'assigned:search for issues assigned to a user'
'dumpconfig:display effective jira configuration'
)
_arguments -C \
......
# CLI support for JIRA interaction
#
# Setup:
# Add a .jira-url file in the base of your project
# You can also set $JIRA_URL in your .zshrc or put .jira-url in your home directory
# A .jira-url in the current directory takes precedence.
# The same goes with .jira-prefix and $JIRA_PREFIX.
#
# For example:
# cd to/my/project
# echo "https://name.jira.com" >> .jira-url
#
# Variables:
# $JIRA_RAPID_BOARD - set to "true" if you use Rapid Board
# $JIRA_DEFAULT_ACTION - action to do when `jira` is called witn no args
# defaults to "new"
# $JIRA_NAME - Your JIRA username. Used as default for assigned/reported
# $JIRA_PREFIX - Prefix added to issue ID arguments
#
#
# Usage:
# jira # Performs the default action
# jira new # opens a new issue
# jira reported [username]
# jira assigned [username]
# jira dashboard
# jira ABC-123 # Opens an existing issue
# jira ABC-123 m # Opens an existing issue for adding a comment
# See README.md for details
: ${JIRA_DEFAULT_ACTION:=new}
function jira() {
emulate -L zsh
local action=${1:=$JIRA_DEFAULT_ACTION}
local jira_url jira_prefix
......@@ -63,6 +39,12 @@ function jira() {
elif [[ "$action" == "dashboard" ]]; then
echo "Opening dashboard"
open_command "${jira_url}/secure/Dashboard.jspa"
elif [[ "$action" == "dumpconfig" ]]; then
echo "JIRA_URL=$jira_url"
echo "JIRA_PREFIX=$jira_prefix"
echo "JIRA_NAME=$JIRA_NAME"
echo "JIRA_RAPID_BOARD=$JIRA_RAPID_BOARD"
echo "JIRA_DEFAULT_ACTION=$JIRA_DEFAULT_ACTION"
else
# Anything that doesn't match a special action is considered an issue name
local issue_arg=$action
......@@ -84,15 +66,17 @@ function jira() {
function _jira_url_help() {
cat << EOF
JIRA url is not specified anywhere.
error: JIRA URL is not specified anywhere.
Valid options, in order of precedence:
.jira-url file
\$HOME/.jira-url file
JIRA_URL environment variable
\$JIRA_URL environment variable
EOF
}
function _jira_query() {
emulate -L zsh
local verb="$1"
local jira_name lookup preposition query
if [[ "${verb}" == "reported" ]]; then
......@@ -102,12 +86,12 @@ function _jira_query() {
lookup=assignee
preposition=to
else
echo "not a valid lookup: $verb" >&2
echo "error: not a valid lookup: $verb" >&2
return 1
fi
jira_name=${2:=$JIRA_NAME}
if [[ -z $jira_name ]]; then
echo "JIRA_NAME not specified" >&2
echo "error: JIRA_NAME not specified" >&2
return 1
fi
......
......@@ -12,3 +12,6 @@ alias npmS="npm i -S "
# Install and save to dev-dependencies in your package.json
# npmd is used by https://github.com/dominictarr/npmd
alias npmD="npm i -D "
# Execute command from node_modules folder based on current directory
# i.e npmE gulp
alias npmE='PATH="$(npm bin)":"$PATH"'
......@@ -5,29 +5,35 @@
# VERSION: 1.1.0
# ------------------------------------------------------------------------------
function tab() {
local command="cd \\\"$PWD\\\"; clear"
(( $# > 0 )) && command="${command}; $*"
the_app=$(
function _omz_osx_get_frontmost_app() {
local the_app=$(
osascript 2>/dev/null <<EOF
tell application "System Events"
name of first item of (every process whose frontmost is true)
end tell
EOF
)
echo "$the_app"
}
[[ "$the_app" == 'Terminal' ]] && {
osascript 2>/dev/null <<EOF
function tab() {
# Must not have trailing semicolon, for iTerm compatibility
local command="cd \\\"$PWD\\\"; clear"
(( $# > 0 )) && command="${command}; $*"
local the_app=$(_omz_osx_get_frontmost_app)
if [[ "$the_app" == 'Terminal' ]]; then
# Discarding stdout to quash "tab N of window id XXX" output
osascript >/dev/null <<EOF
tell application "System Events"
tell process "Terminal" to keystroke "t" using command down
tell application "Terminal" to do script "${command}" in front window
end tell
tell application "Terminal" to do script "${command}" in front window
EOF
}
[[ "$the_app" == 'iTerm' ]] && {
osascript 2>/dev/null <<EOF
elif [[ "$the_app" == 'iTerm' ]]; then
osascript <<EOF
tell application "iTerm"
set current_terminal to current terminal
tell current_terminal
......@@ -35,29 +41,27 @@ EOF
set current_session to current session
tell current_session
write text "${command}"
keystroke return
end tell
end tell
end tell
EOF
}
else
echo "tab: unsupported terminal app: $the_app"
false
fi
}
function vsplit_tab() {
local command="cd \\\"$PWD\\\""
local command="cd \\\"$PWD\\\"; clear"
(( $# > 0 )) && command="${command}; $*"
the_app=$(
osascript 2>/dev/null <<EOF
tell application "System Events"
name of first item of (every process whose frontmost is true)
end tell
EOF
)
local the_app=$(_omz_osx_get_frontmost_app)
[[ "$the_app" == 'iTerm' ]] && {
osascript 2>/dev/null <<EOF
tell application "iTerm" to activate
if [[ "$the_app" == 'iTerm' ]]; then
osascript <<EOF
-- tell application "iTerm" to activate
tell application "System Events"
tell process "iTerm"
......@@ -65,26 +69,24 @@ EOF
click
end tell
end tell
keystroke "${command}; clear;"
keystroke return
keystroke "${command} \n"
end tell
EOF
}
else
echo "$0: unsupported terminal app: $the_app" >&2
false
fi
}
function split_tab() {
local command="cd \\\"$PWD\\\""
local command="cd \\\"$PWD\\\"; clear"
(( $# > 0 )) && command="${command}; $*"
the_app=$(
osascript 2>/dev/null <<EOF
tell application "System Events"
name of first item of (every process whose frontmost is true)
end tell
EOF
)
local the_app=$(_omz_osx_get_frontmost_app)
[[ "$the_app" == 'iTerm' ]] && {
if [[ "$the_app" == 'iTerm' ]]; then
osascript 2>/dev/null <<EOF
tell application "iTerm" to activate
......@@ -94,11 +96,15 @@ EOF
click
end tell
end tell
keystroke "${command}; clear;"
keystroke return
keystroke "${command} \n"
end tell
EOF
}
else
echo "$0: unsupported terminal app: $the_app" >&2
false
fi
}
function pfd() {
......
......@@ -54,10 +54,12 @@ alias rdrs='rake db:reset'
alias rdtc='rake db:test:clone'
alias rdtp='rake db:test:prepare'
alias rdmtc='rake db:migrate db:test:clone'
alias rlc='rake log:clear'
alias rn='rake notes'
alias rr='rake routes'
alias rrg='rake routes | grep'
alias rt='rake test'
# legacy stuff
alias sstat='thin --stats "/thin/stats" start'
......
## Scaleway CLI autocomplete plugin
[scw](https://github.com/scaleway/scaleway-cli): Manage Bare Metal servers from Command Line (as easily as with Docker)
- Adds autocomplete options for all `scw` commands.
Maintainer : Manfred Touron ([@moul](https://github.com/moul))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment