From 5bec17769e83c652de6371c47059cd0edf843851 Mon Sep 17 00:00:00 2001 From: Gotbletu Date: Thu, 28 Mar 2013 12:16:55 -0700 Subject: [PATCH] extra notes --- google_text_to_speech.txt | 21 +++++++++++++++++ podbeuter_podqueue_function.txt | 4 ++++ vim_copy_paste_to_x_clipboard.txt | 9 +++++++ zsh_vim_mode.txt | 39 +++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 google_text_to_speech.txt create mode 100644 podbeuter_podqueue_function.txt create mode 100644 vim_copy_paste_to_x_clipboard.txt create mode 100644 zsh_vim_mode.txt diff --git a/google_text_to_speech.txt b/google_text_to_speech.txt new file mode 100644 index 0000000..f1fd7a3 --- /dev/null +++ b/google_text_to_speech.txt @@ -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 + # 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 + # 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 ;} diff --git a/podbeuter_podqueue_function.txt b/podbeuter_podqueue_function.txt new file mode 100644 index 0000000..e07096b --- /dev/null +++ b/podbeuter_podqueue_function.txt @@ -0,0 +1,4 @@ +# send link to podbeuter queue + +podqueue() { echo "$1 \"$HOME/Downloads/$(echo "$1" | awk -F'/' '{ print $NF }')\"" >> ~/.newsbeuter/queue ;} + diff --git a/vim_copy_paste_to_x_clipboard.txt b/vim_copy_paste_to_x_clipboard.txt new file mode 100644 index 0000000..70cf42a --- /dev/null +++ b/vim_copy_paste_to_x_clipboard.txt @@ -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 :!xclip -f -sel clip +map mz:-1r !xclip -o -sel clip`z + diff --git a/zsh_vim_mode.txt b/zsh_vim_mode.txt new file mode 100644 index 0000000..50c432f --- /dev/null +++ b/zsh_vim_mode.txt @@ -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" +