From adeafb708fddd8d1289b54818973c51d6828519f Mon Sep 17 00:00:00 2001 From: hellerve Date: Tue, 18 Jul 2017 23:24:28 -0400 Subject: [PATCH] added erc --- Makefile | 5 ++++- erc | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ vimrc | 1 + zshrc | 9 ++++++--- 4 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 erc diff --git a/Makefile b/Makefile index 09ac0fb..099b6e5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -all: bash cardinal ghc git input python sbcli scripts tmux valgrind vim zepto zsh +all: bash cardinal e ghc git input python sbcli scripts tmux valgrind vim zepto zsh bash: cp bash_profile ~/.bash_profile @@ -6,6 +6,9 @@ bash: cardinal: cp cardinalrc ~/.cardinalrc +e: + cp erc ~/.erc + ghc: cp -r cabal/config ~/.cabal/config cp ghci ~/.ghci diff --git a/erc b/erc new file mode 100644 index 0000000..377c6a6 --- /dev/null +++ b/erc @@ -0,0 +1,56 @@ +set_tab(2) + +function starts(String,Start) + return string.sub(String,1,string.len(Start))==Start +end + +meta_commands["blame"] = function() + _, y = get_coords() + handle = io.popen("git blame --porcelain -L"..tostring(math.floor(y)+1)..","..tostring(math.floor(y)+1).." "..get_filename()) + lines = handle:read("*a") + handle:close() + + author = string.match(lines, "author (%a+)") + + message(author) +end + +keys["%"] = function() + s = get_text() + count = 0 + + for word in s:gmatch("%w+") do count = count + 1 end + + message(count .. " words") +end + +keys["!"] = function() + command = prompt("shell command: %s") + command = string.gsub(command, "%$", get_filename()) + handle = io.popen(command) + result = handle:read("*a") + handle:close() + + result = string.gsub(result, "\n", " ") + message(result) +end + +function get_meta_commands() + res = "" + + for k, _ in pairs(meta_commands) do + res = res .. k .. ", " + end + + return res +end + +function get_keys() + res = "" + + for k, _ in pairs(keys) do + res = res .. k .. ", " + end + + return res +end diff --git a/vimrc b/vimrc index 442dec5..c29da62 100644 --- a/vimrc +++ b/vimrc @@ -89,6 +89,7 @@ Bundle 'Twinside/vim-hoogle' Bundle 'digitaltoad/vim-jade' Bundle 'zepto-lang/zepto-vim' Bundle 'hellerve/luna-vim' +Bundle 'tikhomirov/vim-glsl' Plugin 'rust-lang/rust.vim' " Custom bundles diff --git a/zshrc b/zshrc index b1ca009..6c7e70c 100644 --- a/zshrc +++ b/zshrc @@ -36,9 +36,9 @@ export JAVA_HOME=`/usr/libexec/java_home -v 1.8` export GH_HOME=~/Documents/Code/Github export EDITOR=vim alias dob="git branch --merged | grep -vE '(\*)|(master)|(dev)' | xargs -n 1 git branch -d" -alias vi="stty stop '' -ixoff ; vim" -alias gcc="gcc-6" -alias g++="g++-6" +alias vi="stty stop '' -ixoff ; stty erase '^?'; vim" +alias gcc="gcc-7" +alias g++="g++-7" alias increment_version="zepto ~/.scripts/vincr.zp" alias mk="make" alias psh="perl ~/.scripts/psh" @@ -210,6 +210,7 @@ save_dotfiles(){ cp -r ~/.scripts ${DOTPATH} cp ~/.bash_profile ${DOTPATH}bash_profile cp ~/.cardinalrc ${DOTPATH}cardinalrc + cp ~/.erc ${DOTPATH}erc cp ~/.ghci ${DOTPATH}ghci cp ~/.gitconfig ${DOTPATH}gitconfig cp ~/.gitignore ${DOTPATH}gitignore @@ -322,4 +323,6 @@ function zeptosay () { fortune | zeptosay +eval `opam config env` + source ~/.zshrc.priv