zsh和oh my zsh 配置

zsh 设置

ohmyzsh安装

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

git extras[https://github.com/tj/git-extras]安装

$ git clone https://github.com/tj/git-extras.git
$ cd git-extras
# checkout the latest tag
$ git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
$ [sudo] make install

bash complete

when building android source, need to source >build/envsetup.sh
will complain "complete not found"

because android build use bash as default,complete is bash embed function

add below to .zshrc
bash
autoload -U compinit && compinit
autoload -U bashcompinit && bashcompinit

if build android source still error, and using bash is ok,
try to use

emulate bash

before make.

just ensure you have "#!/usr/bin/env bash" at the first line of your script

emulate sh -c '. ./myscript.sh'

git 命令卡死,cpu 占用率到100%

http://superuser.com/questions/458906/zsh-tab-completion-of-git-commands-is-very-slow-how-can-i-turn-it-off
添加到.zshrc
bash
__git_files () {
_wanted files expl 'local files' _files
}

autojump

autojump is a faster way to navigate your filesystem. It works by maintaining a database of the directories you use the most from the command line.

Directories must be visited first before they can be jumped to.

https://github.com/wting/autojump
bash
git clone git://github.com/joelthelion/autojump.git
cd autojump
./install.py or ./uninstall.py

add the following line(s) to ~/.zshrc:

[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && source ~/.autojump/etc/profile.d/autojump.sh
autoload -U compinit && compinit -u

linux-server 安装依赖错误

user@XM4002951:~$ sudo apt-get install linux-server

Reading package lists… Done

Building dependency tree

Reading state information… Done

The following packages will be upgraded:

  linux-server

1 upgraded, 0 newly installed, 0 to remove and 382 not upgraded.

1 not fully installed or removed.

Need to get 0 B/1,734 B of archives.

After this operation, 1,024 B of additional disk space will be used.

dpkg: dependency problems prevent configuration of linux-server:

linux-server depends on linux-image-server (= 3.2.0.76.90); however:

  Version of linux-image-server on system is 3.2.0.84.98.

linux-server depends on linux-headers-server (= 3.2.0.76.90); however:

  Version of linux-headers-server on system is 3.2.0.84.98.

dpkg: error processing linux-server (–configure):

dependency problems – leaving unconfigured

No apport report written because the error message indicates its a followup error from a previous failure.

                                                                                                          Errors were encountered while processing:

linux-server

E: Sub-process /usr/bin/dpkg returned an error code (1)

user@XM4002951:~$ sudo dpkg-reconfigure linux-server

/usr/sbin/dpkg-reconfigure: linux-server is broken or not fully installed

继续阅读