Skip to content

My personal dotfiles like vimrc, tmux, zsh and gdbinit...

License

Notifications You must be signed in to change notification settings

ONGOING-Z/dotfiles

Repository files navigation

dotfiles

dotfiles

存放文本三巨头zshvimtmux的设置文件.

Shell生产力环境恢复

dotfiles管理方法1

  1. 新建一个dotfiles/文件夹
$ mkdir dotfiles; cd dotfiles; git init
  1. 将本机家目录下的需要备份的dotfiles移入上边新建的dotfiles/文件夹
$ cd # 回到家目录
$ mv .vimrc dotfiles/vimrc
$ mv .zshrc dotfiles/zshrc
$ mv .tmux.conf dotfiles/tmux.conf
  1. 将系统下的dotfile链接到新建dotfiles文件夹里的文件
$ ln -s dotfiles/vimrc .vimrc
$ ln -s dotfiles/zshrc .zshrc
$ ln -s dotfiles/tmux.conf .tmux.conf
  1. 换电脑后,需要恢复自己的配置
  2. 首先删除原机上的.vimrc/.zshrc...
  3. 链接到自己的dotfiles

dotfiles管理方法2(推荐)

使用dotbot

Zsh

1. 安装

  • 查看shell列表

    cat /etc/shells
  • 查看当前shell: echo $SHELL

  • 安装zsh

    $ sudo apt-get install zsh  # ubuntu installation

之后使用chsh -s /bin/zsh将默认的shell改为zsh. 这之后需要logout一下,不然即使重开一个terminal也没有生效。

2. 安装oh-my-zsh

第一种方法: 通过curl

$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

第二种方法: 通过wget

$ sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Tmux

在ubuntu下的安装

$ sudo apt install tmux

tmux的升级

当前以tmux 3.1c版本为例

  1. 首先到tmux release页面下载自己的版本,这里下载的是tmux 3.1c
  2. 解压这个.tar.gz
  3. cd tmux-3.1c
  4. 运行./configure
  5. 这时可能会出现error: libevent not found的错误,因为这个没有安装 解决: sudo apt-get install libevent-dev 安装完成后重新执行./configure
  6. 运行make
  7. sudo make install
  8. 重启终端后输入tmux -V检查版本是否正确.

更新tmux.conf: tmux source ~/.tmux.conf

Git

git diff美化工具diff-so-fancy

在命令行中对于用户更加友好.

安装: npm install -g diff-so-fancy

参考

  1. 为初学者准备的 ln 命令教程(5 个示例)
  2. 文本三巨头:zsh、tmux 和 vim