From 8e74da7b1637d4217bd7c433d7d8b0a247387274 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Sat, 9 Aug 2014 03:22:38 -0400 Subject: [PATCH 1/2] more plugins --- .emacs.d/Cask | 5 +++++ .emacs.d/init.el | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/.emacs.d/Cask b/.emacs.d/Cask index a1ffcea..2fb7ab5 100644 --- a/.emacs.d/Cask +++ b/.emacs.d/Cask @@ -17,15 +17,20 @@ (depends-on "exec-path-from-shell") (depends-on "flx-ido") (depends-on "flycheck") +(depends-on "git-gutter") (depends-on "go-autocomplete") (depends-on "go-mode") +(depends-on "go-mode") (depends-on "grizzl") (depends-on "jedi") (depends-on "key-chord") (depends-on "magit") (depends-on "neotree") (depends-on "pallet") +(depends-on "powerline") +(depends-on "powerline-evil") (depends-on "projectile") +(depends-on "relative-buffers") (depends-on "tabbar") (depends-on "yasnippet") (depends-on "zenburn-theme") \ No newline at end of file diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 524811a..4670578 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -7,6 +7,10 @@ (and (char-or-string-p obj) (not (stringp obj))))) (fset 'yes-or-no-p 'y-or-n-p) +(menu-bar-mode -1) + +(setq tab-width 4) +(setq indent-tabs-mode nil) ;; Package Manager ;; See ~Cask~ file for its configuration @@ -23,6 +27,7 @@ (setq root-dir (file-name-directory (or (buffer-file-name) load-file-name))) (setq make-backup-files nil) +(setq auto-save-default nil) (add-to-list 'custom-theme-load-path "~/.emacs.d/themes/") ;; Don't show startup screen @@ -50,6 +55,42 @@ (require 'exec-path-from-shell) (when (memq window-system '(mac ns)) (exec-path-from-shell-initialize)) +(global-relative-buffers-mode) + +;; Tabbar +(defun autohide-tabbar () + "Make tabbar briefly show itself while you are switching + buffers with shortcuts. Tested with GNU Emacs 23." + (defvar *tabbar-autohide-delay* 3) + (interactive) + (tabbar-mode nil) + (defvar *tabbar-autohide-timer* nil) + (defun renew-tabbar-autohide-timer () + (if (timerp *tabbar-autohide-timer*) + (cancel-timer *tabbar-autohide-timer*)) + (setf *tabbar-autohide-timer* + (run-with-timer + 3 nil (lambda () + (tabbar-mode -1) + (setf *tabbar-autohide-timer* + nil))))) + (global-set-key + [C-next] + (lambda () + (interactive) + (if tabbar-mode + (tabbar-forward) + (tabbar-mode 1)) + (renew-tabbar-autohide-timer))) + (global-set-key + [C-prior] + (lambda () + (interactive) + (if tabbar-mode + (tabbar-backward) + (tabbar-mode 1)) + (renew-tabbar-autohide-timer)))) + (autohide-tabbar) ;; Evil! (require 'evil-leader) @@ -69,6 +110,11 @@ (eval-after-load 'magit (progn '(global-set-key (kbd "C-x g") 'magit-status))) +;; gitgutter +(global-git-gutter-mode) +(custom-set-variables + '(git-gutter:hide-gutter t)) + ;; flx-ido completion system, recommended by Projectile (require 'flx-ido) (require 'grizzl) @@ -111,12 +157,27 @@ (require 'key-chord) (require 'tabbar) + +;; Functions +(defun move-cursor-next-pane () + "Move cursor to the next pane." + (interactive) + (other-window 1)) + +(defun move-cursor-previous-pane () + "Move cursor to the previous pane." + (interactive) + (other-window -1)) ;; Evil Key Defines (define-key evil-normal-state-map "gc" 'kill-buffer-and-window) (define-key evil-normal-state-map "gn" 'tabbar-forward-tab) (define-key evil-normal-state-map "gp" 'tabbar-backward-tab) (define-key evil-normal-state-map (kbd "C-e") 'move-end-of-line) (define-key evil-normal-state-map (kbd "C-a") 'move-beginning-of-line) +(define-key evil-normal-state-map (kbd "C-j") 'move-cursor-next-pane) +(define-key evil-normal-state-map (kbd "C-k") 'move-cursor-previous-pane) + + (define-key evil-insert-state-map (kbd "C-e") 'move-end-of-line) (define-key evil-insert-state-map (kbd "C-a") 'move-beginning-of-line) ;(setq key-chord-two-keys-delay 0.5) @@ -138,6 +199,8 @@ ;; |_\__,_|_||_\__, |\_,_\__,_\__, \___/__/ ;; |___/ |___/ (add-hook 'go-mode-hook (lambda () + (add-hook 'before-save-hook #'gofmt-before-save) + (setq indent-tabs-mode t) (set (make-local-variable 'company-backends) '(company-go)) (company-mode))) From 74e288699877a1e4ab3821c1c904049661539595 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Thu, 11 Sep 2014 15:20:03 -0400 Subject: [PATCH 2/2] update aliases bench and task --- .bash_aliases | 5 +++++ .bashrc | 11 +++++++++++ .taskrc | 10 +++++----- .vimrc | 4 ++++ bin/benchx.awk | 11 +++++++++++ 5 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 bin/benchx.awk diff --git a/.bash_aliases b/.bash_aliases index 72bd4f1..5c2242b 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -90,6 +90,11 @@ alias srsly="orly -s" alias whothefuckis='finger' alias whoami="echo 24601" +dobenchx() { + benchcmp $1 $2 | awk -f $HOME/bin/benchx.awk +} +alias benchx=dobenchx + #function gvim () { #`which gvim` $* &> /dev/null #} diff --git a/.bashrc b/.bashrc index 065799a..8f76c72 100644 --- a/.bashrc +++ b/.bashrc @@ -136,3 +136,14 @@ if [ -n "`which fortune`" ]; then fortune fi + +# The next line updates PATH for the Google Cloud SDK. + +if [ -f ~/local/google-cloud-sdk/path.bash.inc ]; then + . ~/local/google-cloud-sdk/path.bash.inc +fi + +# The next line enables bash completion for gcloud. +if [ -f ~/local/google-cloud-sdk/completion.bash.inc ]; then + . ~/local/google-cloud-sdk/completion.bash.inc +fi diff --git a/.taskrc b/.taskrc index 2d7e54e..6784657 100644 --- a/.taskrc +++ b/.taskrc @@ -12,8 +12,6 @@ # Files data.location=~/.task -pull.default.uri=barak@miranda.barakmich.com:/fs/home/barak/.task/ -push.default.uri=barak@miranda.barakmich.com:/fs/home/barak/.task/ # Color theme (uncomment one to use) #include /usr/share/doc/task/rc/light-16.theme @@ -27,6 +25,8 @@ push.default.uri=barak@miranda.barakmich.com:/fs/home/barak/.task/ #include /usr/share/doc/task/rc/dark-yellow-green.theme #include /usr/share/doc/task/rc/dark-gray-256.theme -taskd.server=localhost:6544 -taskd.credentials=Barakmich.com\/barak\/6982469b-087e-4243-a1b7-1f411bc68194 -taskd.certificate=\/home\/barak\/.task\/client.cert.pem +taskd.server=freecinc.com:53589 +taskd.credentials=FreeCinc\/freecinc_d9da621f\/9b20be7a-db4e-45a3-aa6e-61173f5988e4 +taskd.certificate=\/home\/barak\/.task\/freecinc_d9da621f.cert.pem +taskd.key=\/home\/barak\/.task\/freecinc_d9da621f.key.pem +taskd.ca=\/home\/barak\/.task\/freecinc_d9da621f.ca.pem diff --git a/.vimrc b/.vimrc index 6dd9fd1..ccd0cad 100644 --- a/.vimrc +++ b/.vimrc @@ -494,6 +494,8 @@ nnoremap j nnoremap k nnoremap l nnoremap h +"nnoremap w +"nnoremap W inoremap j inoremap k inoremap l @@ -510,6 +512,8 @@ inoremap jj " Leader key functions " See quickfix. nnoremap ff :QFix +" See quickfix. +nnoremap ss :SyntasticSetLoclist " Next quickfix. nnoremap fn :cnext " Prev quickfix. diff --git a/bin/benchx.awk b/bin/benchx.awk new file mode 100644 index 0000000..c3a1c3d --- /dev/null +++ b/bin/benchx.awk @@ -0,0 +1,11 @@ +{ + x = substr($4, 1,1) + v = substr($4, 2, length($4) - 2) + if (x == "+") { + printf "%s\t%s%.2fx\n", $0, x, (100 + v) / 100; + } else if (x == "-") { + printf "%s\t%s%.2fx\n", $0, x, (100 / (100 - v)); + } else { + printf "%s\t%s\n", $0, "mult" + } +}