Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux 程式設計 >> Shell 程式設計

Linux Shell 常用配置:bashrc、vimrc 與 gitconfig

良好的 Shell 與編輯器設定,能明顯提升開發效率。以下整理常見的 .bashrc、.vimrc 與 .gitconfig 設定。

bashrc

alias ls='ls -G --color=auto'
alias ll='ls -alhT'
alias grep='grep --color=auto'

function jgrep() {
  find . -iname "*.java" -print0 | xargs -0 grep --color -n "$@"
}

function xmlgrep() {
  find . -iname "*.xml" -print0 | xargs -0 grep --color -n "$@"
}

vimrc

set nu
syntax enable
set background=dark
set ignorecase

gitconfig

[user]
  name = xxxx
  email = xxxx@yyy.com
[alias]
  st = status
  br = branch
[color]
  ui = auto

這些設定可作為個人環境的起點,再依需求微調。

Copyright © Linux教程網 All Rights Reserved