extra notes

pull/1/head
Gotbletu 11 years ago
parent 19f74ca7fe
commit 5bec17769e

@ -0,0 +1,21 @@
say() {
# limit to 100 character or less
# language code: http://developers.google.com/translate/v2/using_rest#language-params
# useage: say <language code> <phase>
# example: say es come with me
mplayer -user-agent Mozilla \
"http://translate.google.com/translate_tts?ie=UTF-8&tl="$1"&q=$(echo "$@" \
| cut -d ' ' -f2- | sed 's/ /\+/g')" > /dev/null 2>&1 ;}
say-translation() {
# by: gotbletu
# requires: http://www.soimort.org/google-translate-cli/
# limit to 100 character or less
# language code: http://developers.google.com/translate/v2/using_rest#language-params
# useage: say-translation <language code> <phase>
# example: say-translation es come with me
lang=$1
trans=$(translate {=$lang} "$(echo "$@" | cut -d ' ' -f2- | sed 's/ /\+/g')" )
echo $trans
mplayer -user-agent Mozilla \
"http://translate.google.com/translate_tts?ie=UTF-8&tl=$lang&q=$trans" > /dev/null 2>&1 ;}

@ -0,0 +1,4 @@
# send link to podbeuter queue
podqueue() { echo "$1 \"$HOME/Downloads/$(echo "$1" | awk -F'/' '{ print $NF }')\"" >> ~/.newsbeuter/queue ;}

@ -0,0 +1,9 @@
" ~/.vimrc
" copy or paste from X11 clipboard
" http://vim.wikia.com/wiki/GNU/Linux_clipboard_copy/paste_with_xclip
" requires: xclip
" usage: visual mode select then hit F6 to copy
" hit F7 to paste from GUI to vim without formating issues
vmap <F6> :!xclip -f -sel clip<CR>
map <F7> mz:-1r !xclip -o -sel clip<CR>`z

@ -0,0 +1,39 @@
##### for ~/.zshrc
# enable vim mode on commmand line
bindkey -v
# show vim status
# http://zshwiki.org/home/examples/zlewidgets
function zle-line-init zle-keymap-select {
RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}"
RPS2=$RPS1
zle reset-prompt
}
zle -N zle-line-init
zle -N zle-keymap-select
# add missing vim hotkeys
# fixes backspace deletion issues
# http://zshwiki.org/home/zle/vi-mode
bindkey -a u undo
bindkey -a '^R' redo
bindkey '^?' backward-delete-char
bindkey '^H' backward-delete-char
# history search in vim mode
# http://zshwiki.org./home/zle/bindkeys#why_isn_t_control-r_working_anymore
bindkey -M viins '^s' history-incremental-search-backward
bindkey -M vicmd '^s' history-incremental-search-backward
##### for ~/tmux.conf
# Lowers the delay time between the prefix key and other keys - fixes pausing in vim
set -sg escape-time 1
# reload .tmux.conf
bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded"
Loading…
Cancel
Save