This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### リターンコードチェック関数 | |
function common_func_CheckRC(){ | |
if [ $# -eq 1 ]; then | |
if [ $1 -ne 0 ]; then | |
echo "情報取得に失敗しました。出力ファイルを確認して下さい。" | |
echo "リターンコード : "$1"" | |
exit 1 | |
fi | |
else | |
echo "引数が足りません。" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" change default search engine | |
" unmap t | |
" map t :tabnew duckduckgo<space> | |
"Settings | |
let barposition = "top" | |
let blacklists = ["https://*.vultr.com/*", "https://docs.google.com/*", "https://*.qmk.fm/*", "https://thetypingcat.com/*", "https://remotedesktop.google.com/*"] | |
let fullpagescrollpercent = 100 | |
let hintcharacters = "asdfghjkl" | |
let locale = "jp" | |
let mapleader = "," |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/hmac" | |
"crypto/sha256" | |
"encoding/hex" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"net/url" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#bindkey '^R' history-incremental-pattern-search-backward | |
setopt hist_ignore_all_dups | |
function peco_select_history() { | |
local tac | |
if which tac > /dev/null; then | |
tac="tac" | |
else | |
tac="tail -r" | |
fi | |
BUFFER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#bindkey '^B' select branch for Peco | |
function peco-branch () { | |
local branch=$(git branch -a | peco | tr -d ' ' | tr -d '*') | |
if [ -n "$branch" ]; then | |
if [ -n "$LBUFFER" ]; then | |
local new_left="${LBUFFER%\ } $branch" | |
else | |
local new_left="$branch" | |
fi | |
BUFFER=${new_left}${RBUFFER} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#bindkey '^g' list ghq src | |
function peco-ghq () { | |
local selected_dir=$(ghq list -p | peco --query "$LBUFFER") | |
if [ -n "$selected_dir" ]; then | |
BUFFER="cd ${selected_dir}" | |
zle accept-line | |
fi | |
zle clear-screen | |
} | |
zle -N peco-ghq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fzf-ghq() { | |
local selected_dir=$(ghq list |fzf --prompt="Git Repos > " --preview "bat --color=always --style=header,grid --line-range :80 $(ghq root)/{}/README.*") | |
if [ -n "$selected_dir" ]; then | |
BUFFER="cd $(ghq root)/${selected_dir}" | |
zle accept-line | |
fi | |
zle reset-prompt | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fzf-branch() { | |
local selected_branch=$(git for-each-ref --format='%(refname)' --sort=-committerdate refs/heads | perl -pne 's{^refs/heads/}{}' | fzf --query "$LBUFFER" --prompt="Git Branch > ") | |
if [ -n "$selected_branch" ]; then | |
BUFFER="git checkout ${selected_branch}" | |
zle accept-line | |
fi | |
zle reset-prompt | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fzf-ssh () { | |
local selected_host=$(grep "Host " ~/.ssh/ssh_config | grep -v '*' | cut -b 6- | fzf --query "$LBUFFER" --prompt="SSH Remote > ") | |
if [ -n "$selected_host" ]; then | |
BUFFER="ssh ${selected_host}" | |
zle accept-line | |
fi | |
zle reset-prompt | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setopt hist_ignore_all_dups | |
function fzf-history() { | |
BUFFER=$(history -n -r 1 | fzf --no-sort +m --query "$LBUFFER" --prompt="History > ") | |
CURSOR=$#BUFFER | |
zle clear-screen | |
} | |
zle -N fzf-history | |
bindkey '^r' fzf-history |
OlderNewer