0
0

More than 3 years have passed since last update.

最小限の.bashrc, .vimrc, .tmux.conf

Last updated at Posted at 2021-09-19

.bashrc

~/.bashrc
# alias
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ll='ls -l'
alias la='ls -a'
alias bashrc='vim ~/.bashrc'
alias vimrc='vim ~/.vimrc'
alias tmuxconf='vim ~/.tmux.conf'
alias ..='cd ..'
alias ...='cd ../..'
alias reload='exec $SHELL -l'

# alias for git
alias gs='git status'
alias ga='git add'
alias gd='git diff'
alias gds='git diff --staged'
alias gcm='git commit -m'
alias gl='git log --oneline --graph --decorate'
alias gp='git push origin HEAD'
alias gc='git checkout'

# prompt
export PS1="[\u@\h] \w \$ "

# execute ls after cd
cd ()
{
  builtin cd "$@" && ls --color=auto
}

if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

.vimrc

~/.vimrc
" 新しい行のインデントを現在の行と同じインデントにする
set autoindent
" vi互換を切る
set nocompatible
" タブの代わりに空白文字を挿入する
set expandtab
" インクリメンタルサーチを行う
set incsearch
" 行番号を表示する
set number
" 行番号を現在の行からの相対的な番号にする
set relativenumber
" 対応する括弧を表示する
set showmatch
" 検索時に大文字を含んでいたら大文字/小文字を区別する
set smartcase
" マウスを有効にする
set mouse=a
" シフト移動幅
set shiftwidth=2
" タブの空白数
set tabstop=2

" 文字化け対策
set encoding=utf-8
set fileencodings=iso-2022-jp,euc-jp,sjis,utf-8
set fileformats=unix,dos,mac

" 行番号のカラーを変更
highlight LineNr ctermfg=DarkGray

.tmux.conf

~/.tmux.conf
# prefixキーをC-aに変更する
set -g prefix C-a

# C-bのキーバインドを解除する
unbind C-b

# \ でペインを縦に分割する
bind \ split-window -h

# - でペインを横に分割する
bind - split-window -v

# マウス操作を有効にする
set-option -g mouse on

# 次のペインに移動
bind -n C-o select-pane -t :.+

# vimのキーバインドでペインをリサイズする
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5

# ウィンドウの切り替え
bind -n S-left previous-window
bind -n S-right next-window

# ステータスバーの全体の色を変更
setw -g status-style fg=colour255,bg=colour234

# ステータスバーの中央パネルの色を変更
setw -g window-status-current-format '#[bg=colour2]#[fg=colour255]#{?client_prefix,#[bg=colour3],} #I #W '
setw -g window-status-format '#[fg=colour242] #I #W '

# 左パネルの設定
set -g status-left ""

# 右パネルの設定
set -g status-right ""

# ウィンドウリストの位置 (right/left/centre)
set -g status-justify right

# ステータスバーの位置 (bottom/top)
set -g status-position bottom
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