ページ

ラベル Emacs の投稿を表示しています。 すべての投稿を表示
ラベル Emacs の投稿を表示しています。 すべての投稿を表示

2011年7月27日水曜日

MacPortsからHomeBrewに移行

MacPorts関連のものをアンインストール&削除
% sudo port -f uninstall installed
% sudo rm -rf \
/opt/local \
/Applications/DarwinPorts \
/Applications/MacPorts \
/Library/LaunchDaemons/org.macports.* \
/Library/Receipts/DarwinPorts*.pkg \
/Library/Receipts/MacPorts*.pkg \
/Library/StartupItems/DarwinPortsStartup \
/Library/Tcl/darwinports1.0 \
/Library/Tcl/macports1.0 \
~/.macports

HomeBrewをインストール
$ ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"

.zshrcを編集して、/usr/local/binの優先度を上げた。
export PATH=/usr/local/bin:$PATH

MacPortsで入れていたemacs23も消え去ったので入れ直す。

brew install emacs --cocoa
したらなんかコケる。
LionのせいなのかXcode4のせいなのか、はたまた両方か。

HEADならいけるっぽいので、あんまり気乗りはしなかったけどemacs24をインストール。
HEADをインストールするにはbazaarが必要らしいのでそれも先に。

brew install bazaar
brew install emacs --HEAD --cocoa

/usr/local/Cellar/emacs/HEAD/ にemacs.appがあるので、それを/Applicationsにコピー。

ターミナルのemacsで-nwを付けないとGUIのほうが起動するようになっていたので、zshrcに以下を追加
alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs -nw'

この部分、なんかもっといい方法なかったっけ。

参考:
MacPortsからhomebrewに移行した - RENAISSANCE
Terminal.app+Visorの色設定とか、homebrewでのemacsとか - steuims bulkre

2011年2月14日月曜日

さくらのVPSにemacs、zsh、Git、tigをインストール

viに慣れるのもいいかと思ってたんだけど、やっぱり煩わしいことが多いので
% sudo yum install emacs
でemacsをインストール。

zshのインストールは



を参考に(というかほぼ丸写し)して

% sudo yum -y install zsh
% emacs ~/.bash_profile
# use zsh
if [ -f /bin/zsh ]; then
exec /bin/zsh
fi

zshrcもとりあえずはコピペ

% emacs ~/.zshrc
#
# alias設定
#

# 基本的なこと
alias ls='ls -AF'
alias ll='ls -l'
alias df="df -h"
alias du="du -h"

# vim関連
alias vi=vim

# 検索を便利にする
alias rgrep="grep -R"
alias rgrepsvn="rgrep --exclude=\"*.svn*\""

#
# zsh的な設定
#

## 補完時に大小文字を区別しない
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
zstyle ':completion:*' menu select=1

autoload -U compinit && compinit

## options
setopt bash_auto_list
setopt list_ambiguous
setopt list_packed # つめて表示されるようになる
setopt correct # コマンドの間違いを自動修正
setopt auto_pushd # 自動でディレクトリをPUSH
setopt nolistbeep # beep音を鳴らさない

## history
HISTFILE="$HOME/.zsh_history"
HISTSIZE=10000
SAVEHIST=10000
setopt hist_ignore_all_dups
setopt hist_reduce_blanks
setopt share_history

# emacs
bindkey -e


続いてGitのインストール

参考:

% rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-1.noarch.rpm

したら

can’t create transaction lock on /var/lib/rpm/__db.000

とかいうエラーが出た。

rootでやらないといけないってことらしいので、
% su -
してもっかいやったらできた。

で、
% sudo yum install --enablerepo=webtatic git


そしてtigをインストール
% yum install ncurses-devel.`uname -i` -y
% cd /tmp
% wget http://jonas.nitro.dk/tig/releases/tig-0.16.2.tar.gz
% tar -zxvf tig-0.16.2.tar.gz
% cd tig-0.16.2/
% ./configure
% make
% make install
% cd ../
% rm -rf tig-0.16.2.tar.gz
% rm -rf tig-0.16.2

おしまい。