0

私は独自の dotfile リポジトリを作成しました。これは、すべてのものをロードする install.sh ファイルです。

#!/bin/bash
clear
echo "Installation started"

SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`

cd $SCRIPTPATH && git submodule update -i

echo "Install some useful program"
sudo apt-get install tmux
sudo apt-get install xclip

echo "Replace old ~/.git-prompt.sh"
rm ~/.git-prompt.sh
ln -s $SCRIPTPATH/.git-prompt.sh ~/.git-prompt.sh

echo "Replace old ~/.tmux.conf"
rm ~/.tmux.conf
ln -s $SCRIPTPATH/.tmux.conf ~/.tmux.conf

echo "Replace old ~/.gitconfig"
rm ~/.gitconfig
ln -s $SCRIPTPATH/.gitconfig ~/.gitconfig

echo "Replace old ~/.bashrc file"
rm ~/.bashrc
ln -s $SCRIPTPATH/.bashrc ~/.bashrc

echo "Replace old ~/.profile file"
rm ~/.profile
ln -s $SCRIPTPATH/.profile ~/.profile

echo "Replace old ~/.vim folder"
rm -rf ~/.vim
ln -s $SCRIPTPATH/.vim ~/.vim

echo "Replace old ~/.vimrc file"
rm ~/.vimrc
ln -s $SCRIPTPATH/.vimrc ~/.vimrc

echo "done!"

最後に、これは私の .bashrc ファイルの一部です:

# Prompt colors
Red="\[\e[0;31m\]"
Darkgreen="\[\e[0;32m\]"
Green="\[\e[1;32m\]"
White="\[\e[0;0m\]"
Yellow="\[\e[1;33m\]"

# Show git branch name
source ~/.git-prompt.sh

# Custom prompt
export PS1="${Red}\u ${Yellow}\A ${Darkgreen}\w${Green}$(__git_ps1) \$ ${White}"

# Wondering in folders
alias ..="cd .."
alias ...=".. && .."
alias ....=".. && .. && .."

# Listing 
alias ll="ls -l"
alias la="ls -la"

# Fix git configurations
git config --global core.editor /usr/bin/vim

# Colors
alias grep="grep --color"
alias ls="ls --color"

私はUbuntuを使用しています。ターミナルのアイコンをクリックすると、ターミナルが開きました。しかし.bashrc、この瞬間に読み込まれることはありません。.bashrc次の場合にロードされます。

  • 「source ~/.bashrc」を手動で実行します
  • CTRL+SHIFT+N で新しいターミナルを開きます
  • 私はtmuxを実行します

ubuntu が最初に .bashrc をロードしないのはなぜですか? いくつかの追加情報は次のとおりです。

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:    14.04
Codename:   trusty
4

0 に答える 0