Browse Source

Merge branch 'master' of github.com:10sr/dotfiles

pull/1/head
10sr 11 years ago
parent
commit
2cdcde52df
4 changed files with 33 additions and 62 deletions
  1. +13
    -8
      bashrc
  2. +18
    -5
      emacs.el
  3. +0
    -48
      tmux.conf
  4. +2
    -1
      tmux.conf.pl

+ 13
- 8
bashrc View File

@@ -146,10 +146,10 @@ null type e3em && alias e3=e3em
#alias dirs="dirs -v -l | \grep -v \$(printf '%s$' \$PWD)"
alias po=popd
alias pu=pushd
alias sudo="sudo " # use aliases through sudo
alias sudoe="sudoedit"
alias halt="sudo halt"
alias reboot="sudo reboot"
null type sudo && alias sudo="sudo " # use aliases through sudo
null type sudoedit && alias sudoe="sudoedit"
null type halt && alias halt="sudo halt"
null type reboot && alias reboot="sudo reboot"
null type dbus-send && {
alias suspend="dbus-send --system --print-reply --dest=org.freedesktop.UPower \
/org/freedesktop/UPower org.freedesktop.UPower.Suspend"
@@ -261,7 +261,12 @@ fi

alias setup.py="sudo python3 setup.py install --record files.txt"

clock(){
ssh(){
__my_set_screen_title ssh
command ssh "$@"
}

clk(){
local tformat="%Y/%m/%d %H:%M:%S %z"
cal
while true
@@ -760,8 +765,8 @@ ${__my_c4}:: ${__my_cdef}[${__my_c2}\u@\H${__my_cdef}:${__my_c1}\w/${__my_cdef}]
${__my_c4}:: ${__my_cdef}l${SHLVL}n\#j\js\$? $(__my_ps1_scale) \D{%T} $(__my_ps1_script)\$ "
PS1=$_PS1

__my_set_tmux_title(){
if test -n "$TMUX"
__my_set_screen_title(){
if test -n "$TMUX" && test -z "$INSIDE_EMACS"
then
echo -ne "\033k$1\033\\"
fi
@@ -779,7 +784,7 @@ __my_set_title(){
esac
}
PROMPT_COMMAND="__my_set_title \${USER}@\${HOSTNAME}\:\${PWD};
__my_set_tmux_title \"\$(basename \$PWD)/\""
__my_set_screen_title \"\$(basename \$PWD)/\""

# copied from https://wiki.archlinux.org/index.php/X_resources
invader(){


+ 18
- 5
emacs.el View File

@@ -280,9 +280,9 @@ found, otherwise returns nil."
system-name
(abbreviate-file-name default-directory)))

(run-with-idle-timer 3
t
'my-message-current-info)
;; (run-with-idle-timer 3
;; t
;; 'my-message-current-info)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; minibuffer
@@ -360,13 +360,15 @@ found, otherwise returns nil."
trailing ; trailing blanks
newline ; newlines
newline-mark ; use display table for newline
tab-mark
empty ; empty lines at beg or end of buffer
lines-tail ; lines over 80
))
;; (setq whitespace-newline 'font-lock-comment-face)
(add-to-list 'whitespace-display-mappings
`(newline-mark ?\n ,(vconcat "$\n"))
)
`(newline-mark ?\n ,(vconcat "$\n")))
(add-to-list 'whitespace-display-mappings ; not work
`(tab-mark ?\t ,(vconcat "^I\t")))
(global-whitespace-mode t)
(when (eq (display-color-cells)
256)
@@ -653,6 +655,17 @@ found, otherwise returns nil."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; some modes and hooks

;; todo: reg major mode when set explicitly

;; Detect file type from shebang and set major-mode.
(add-to-list 'interpreter-mode-alist
'("python3" . python-mode))
(add-to-list 'interpreter-mode-alist
'("python2" . python-mode))

;; (add-hook default-majorg-mode
;; 'my-detect-major-mode-from-shebang)

;; http://fukuyama.co/foreign-regexp
'(and (fetch-library
"https://raw.github.com/k-talo/foreign-regexp.el/master/foreign-regexp.el"


+ 0
- 48
tmux.conf View File

@@ -1,48 +0,0 @@
# soruce ~/.dotfiles/tmux.conf

unbind C-b
set -g prefix C-z
bind-key C-z send-prefix
bind-key c command-prompt "new-window '%%'"

set -g base-index 1
set -g pane-base-index 1

setw -g mode-keys vi
set -g default-command /bin/bash
#set -g default-terminal screen-256color
#set -g default-terminal screen-16color
set default-path "${HOME}" # not work as i expected
set -g set-titles on
set -g display-panes-time 5000

#set -g status-left ""
#set -g status-right "#H | %a, %d %b %Y %T %z #(tmux -V)"
set -g status-right "${USER}@#H | #(tmux -V) "

# default-color
set -g status-bg green
set -g status-fg white
set -g mode-bg green
set -g mode-fg white

if "test `hostname` = arch-aspireone" \
"set -g status-bg blue; set -g status-fg white; \
set -g mode-bg blue; set -g mode-fg white; \
set -g pane-active-border-fg blue;"
if "test `hostname` = darwin-mba.local" \
"set -g status-bg yellow; set -g status-fg black; \
set -g mode-bg yellow; set -g mode-fg black; \
set -g pane-active-border-fg yellow;"
if "test `hostname` = newkiwi" \
"set -g status-bg magenta; set -g status-fg white; \
set -g mode-bg magenta; set -g mode-fg white; \
set -g pane-active-border-fg magenta;"

# face of currently active window name in status bar
setw -g window-status-current-fg black
setw -g window-status-current-bg white
setw -g window-status-current-attr bold

set message-bg white
set message-fg black

+ 2
- 1
tmux.conf.pl View File

@@ -19,7 +19,7 @@ sub tmux {
push(@command, @_);
# print "@command, \n";
system(@command) == 0
or die "system @command failed: $?";
or warn "system @command failed: $?";
}

sub set {
@@ -45,6 +45,7 @@ sub set_prefs {
# this does not workd because `run' do script asyncly
set("base-index", "1");
set("pane-base-index", "1");
set("renumber-windows", "on");
setw("mode-keys", "vi");
set("default-command", "/bin/bash");
set("default-path", $ENV{"HOME"});


Loading…
Cancel
Save