Skip to content

Latest commit

 

History

History
172 lines (114 loc) · 3.37 KB

README.md

File metadata and controls

172 lines (114 loc) · 3.37 KB

Software

Shell (zsh)

Files

  • $HOME/.zshrc

Plugins

  • git
  • zsh-autosuggestions
  • zsh-syntax-highlighting
# git
# zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
# zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

Installation required

Terminal (Termite)

Files

  • $HOME/.config/termite/config

Text Editor (neovim)

Vim plugin manager: vim-plug

junegunn/vim-plug ==> https://github.com/junegunn/vim-plug#

Files

File to load vim configuration

$HOME/.config/nvim/init.vim

Main configuration file

$HOME/.config/.vimrc

Import plugins

$HOME/.vim/plugins.vim

Plugin configuration

$HOME/.vim/plugin-config.vim

Key mapping

$HOME/.vim/maps.vim

Instructions

In the file $HOME/.vim/plugins.vim you must execute :PlugInstall to install the imported plugins

Dotfiles with a bare Git repository

Bare Git repository setup

$ git init --bare $HOME/.dotfiles
$ alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
$ config config --local status.showUntrackedFiles no
$ echo "alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> $HOME/.zshrc

Show Status

config status

Add files

config add .vimrc
config commit -m "Add vimrc"
config add .bashrc
config commit -m "Add bashrc"
config push

Install your dotfiles onto a new system

Confirm that the alias has been assigned to either .bashrc or .zshrc:

$ alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'

The repository should ignore the folder where it will be cloned, this will avoid recursion problems:

$ echo ".dotfiles" >> .gitignore

Now clone your dotfiles into a bare repository in a "dot" folder of your $HOME:

$ git clone --bare <git-repo-url> $HOME/.dotfiles

Add the alias in the shell:

$ alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'

Review the repository content:

$ config checkout

Reviewing may generate the following error:

error: The following untracked working tree files would be overwritten by checkout:
    .bashrc
    .gitignore
Please move or remove them before you can switch branches.
Aborting

The error occurs because there may be files that the repository will overwrite, we can do the following:

  • Delete the files to replace
  • Make a backup of those files

The following code allows to backup those files:

mkdir -p .config-backup && \
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \
xargs -I{} mv {} .config-backup/{}

Re-run the check out if you had problems:

config checkout

Set the flag showUntrackedFiles to no on this specific (local) repository:

config config --local status.showUntrackedFiles no

Configure commands for adding and updating files:

config status
config add .vimrc
config commit -m "Add vimrc"
config add .bashrc
config commit -m "Add bashrc"
config push

Reference