Skip to content

Commit

Permalink
add tmux zshrc
Browse files Browse the repository at this point in the history
  • Loading branch information
makotan committed Jul 11, 2015
1 parent 68eb729 commit a2031e2
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .tmux.conf
@@ -0,0 +1,40 @@
#-----------------------------------------------
# 普通の設定
#-----------------------------------------------
# 表示をUTF-8に変更
#set-window-option -g utf8 on
set -g status-utf8 on
# window内の選ばれたプロセスにリネームするのを無効にする
# set-window-option -g automatic-rename off
# 256色ターミナル
set-option -g default-terminal "screen-256color"

set-option -g default-shell "/usr/local/bin/zsh"

# デフォルトのPrefix(C-b)を解除
unbind C-b
# Prefix
set-option -g prefix C-t
bind-key C-t send-prefix

# ウィンドウ選択画面
bind Space choose-window
# 分割していたペインそれぞれをWindowに
bind b break-pane
# ペインの縦分割
bind | split-window -h -c "#{pane_current_path}"
# ペインの横分割
bind - split-window -v -c "#{pane_current_path}"

# ペインの移動2
# Shift + 上下左右でペインを移動できるようにする。
bind -n S-left select-pane -L
bind -n S-down select-pane -D
bind -n S-up select-pane -U
bind -n S-right select-pane -R

# ペインの移動(ローテート)
bind -n C-o select-pane -t :.+

source /usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf

93 changes: 93 additions & 0 deletions .zshrc
@@ -0,0 +1,93 @@
# Path to your oh-my-zsh installation.
export ZSH=/Users/makotan/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)

# User configuration

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
# export MANPATH="/usr/local/man:$MANPATH"

source $ZSH/oh-my-zsh.sh

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

export PGDATA=/usr/local/var/postgres
alias z=/Users/makotan/.mac/git/rupa/z/z.sh

. /usr/local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh

if [ -z $TMUX ] ; then
if [ -z `tmux ls` ] ; then
tmux
else
tmux attach
fi
fi
56 changes: 55 additions & 1 deletion init.el
Expand Up @@ -23,6 +23,50 @@
(package-install 'clojure-mode))


(when (require 'helm-config nil t)
(helm-mode 1)

(define-key global-map (kbd "M-x") 'helm-M-x)
(define-key global-map (kbd "C-x C-f") 'helm-find-files)
(define-key global-map (kbd "C-x C-r") 'helm-recentf)
(define-key global-map (kbd "M-y") 'helm-show-kill-ring)
(define-key global-map (kbd "C-c i") 'helm-imenu)
(define-key global-map (kbd "C-x b") 'helm-buffers-list)

(define-key helm-map (kbd "C-h") 'delete-backward-char)
(define-key helm-find-files-map (kbd "C-h") 'delete-backward-char)
(define-key helm-find-files-map (kbd "TAB") 'helm-execute-persistent-action)
(define-key helm-read-file-map (kbd "TAB") 'helm-execute-persistent-action)

;; Disable helm in some functions
(add-to-list 'helm-completing-read-handlers-alist '(find-alternate-file . nil))

;; Emulate `kill-line' in helm minibuffer
(setq helm-delete-minibuffer-contents-from-point t)
(defadvice helm-delete-minibuffer-contents (before helm-emulate-kill-line activate)
"Emulate `kill-line' in helm minibuffer"
(kill-new (buffer-substring (point) (field-end))))

(defadvice helm-ff-kill-or-find-buffer-fname (around execute-only-if-exist activate)
"Execute command only if CANDIDATE exists"
(when (file-exists-p candidate)
ad-do-it))

(defadvice helm-ff-transform-fname-for-completion (around my-transform activate)
"Transform the pattern to reflect my intention"
(let* ((pattern (ad-get-arg 0))
(input-pattern (file-name-nondirectory pattern))
(dirname (file-name-directory pattern)))
(setq input-pattern (replace-regexp-in-string "\\." "\\\\." input-pattern))
(setq ad-return-value
(concat dirname
(if (string-match "^\\^" input-pattern)
;; '^' is a pattern for basename
;; and not required because the directory name is prepended
(substring input-pattern 1)
(concat ".*" input-pattern)))))))


(require 'popwin)
(setq display-buffer-function 'popwin:display-buffer)

Expand All @@ -48,7 +92,7 @@
(push '(direx:direx-mode :position left :width 40 :dedicated t)
popwin:special-display-config)

(require 'alchemist)
;(require 'alchemist)
(setq alchemist-project-compile-when-needed t)


Expand All @@ -58,3 +102,13 @@
(setq company-idle-delay 0.3)
(setq company-minimum-prefix-length 2)

(defun elixir-mode-compile-on-save ()
"Elixir mode compile files on save."
(and (file-exists (buffer-file-name))
(file-exists (elixir-mode-compiled-file-name))
(elixir-cos-mode t)))
(add-hook 'elixir-mode-hook 'elixir-mode-compile-on-save)
(add-hook 'elixir-mode-hook 'alchemist-mode)



0 comments on commit a2031e2

Please sign in to comment.