LoginSignup
0
0

More than 5 years have passed since last update.

Cygwin環境作成、その3(hg/git設定、minttyテーマ)

Last updated at Posted at 2017-01-14

前回に続いてCygwin環境の設定を続けようと思います。
1.git/hg設定
2.minttyのテーマ

git/hgの設定

git

~/.gitconfigを以下のように設定する。

[user]
    name = last first
    email = myname@domain.com
[core]
    preloadindex = true
    autoCRLF = input
    safecrlf = true
    editor = vim -c "set fenc=utf-8"
    quotepath = false
[color]
    diff = auto
    status = auto
    branch = auto

git設定の確認

$ git config --list
user.name=last first
user.email=myname@domain.com
core.preloadindex=true
core.autocrlf=input
core.safecrlf=true
core.editor=vim -c set fenc=utf-8
core.quotepath=false
color.diff=auto
color.status=auto
color.branch=auto

hg

gitに比べマイナーだが、僕はmercurialも好きだ。gitは変更したファイルをaddしてからcommitする。hgはいきなりcommitできて手軽です。またglobalな設定ファイルにパスワードを入れられるのも便利で捗ります。gitはリポジトリ毎の設定に追記したりsshでやるんだっけ? ほかの違いについては、以下を参照。
1. Mercurial 対 Git:なぜ Mercurial を選ぶのか? | Atlassian Blogs
2. 操作体系から見る、GitとMercurialの8つの違い: ニュースの社会科学的な裏側

~/.hgrcに以下設定する。

[ui]
username = First Last <myname@domain.com>

[auth]
bb.prefix = https://bitbucket.org/myname/
bb.username = myname
bb.password = password

hg設定を確認するといろいろ出てきます。

$ hg config
auth.bb.prefix=https://bitbucket.org/myname/
auth.bb.username=myname
auth.bb.password=password
merge-tools.kdiff3.args=--auto --L1 base --L2 local --L3 other $base $local $other -o $output
 :
 :
(以下略)

minttyのテーマ設定

その前にminttyのショートカット作成

"…\cygwin64\bin\mintty.exe --position 20,20 --size 120,45 -i /Cygwin-terminal.ico /bin/bash --login -i"
CraftLaunchを使っているとこうなる。

( u"mintty", window.ShellExecuteCommand(None, portdir + u"cygwin64/bin/mintty.exe", "--position 20,20 --size 120,45 -i /Cygwin-Terminal.ico /bin/bash --login -i", "") ),

solarizedをダウンロード、起動時設定

1.自分の作業用フォルダの作成
2.gitで取得

mkdir ~/my_work
cd mywork
git clone https://github.com/mavnn/mintty-colors-solarized

3./etc/bash.bashrcの変更

echo "source ~/my_work/mintty-colors-solarized/sol.light" >> /etc/bash.bashrc

4.minttyを再起動するとsoloarized lightが適用されています。

参考先

Gitをインストールしたら真っ先にやっておくべき初期設定 - Qiita
hgrc - How to save username and password with Mercurial? - Stack Overflow
CygwinのターミナルにカラースキームSolarizedを適用する - Qiita

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0