Giter Site home page Giter Site logo

dotfiles's Introduction

dotfiles

Hidden config files

Setup

Source: Dotfiles: Best Way to Store in a Bare Git Repository

The technique consists in storing a Git bare repository in a "side" folder (like $HOME/.cfg or $HOME/.myconfig) using a specially crafted alias so that commands are run against that repository and not the usual .git local folder, which would interfere with any other Git repositories around.

Create bare repo + setup dotconfig alias.

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

From that point, use the dotconfig alias as the git command:

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

Restore

dotconfig command

OSX uses by default zsh, but .zshrc contains:

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

Hence, added to .bash_aliases:

alias dotconfig='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'

Source the configuration again:

source ~/.zshrc

Clone

Clone this repo into a bare version:

git clone --bare [email protected]:stijnme/dotfiles.git $HOME/.cfg

Checkout

Checkout the bare repo into the current "workdir":

cd ~
dotconfig checkout
dotconfig config --local status.showUntrackedFiles no

nvim

Prerequisite

  • For nvimtree and nvim-web-devicons a nerdfont is required (has extra icons included): Nerdfonts download
  • To use live grep in Telescope, the external tool ripgrep is required: Install ripgrep
sudo apt-get install ripgrep
  • For certain tree-sitter parsers, the tree-sitter-cli is required (and should be added to PATH):
npm -g install tree-sitter-cli

Install

After clonin the files in the .config/nvim folder, start nvim and execute following commands:

:PackerSync

To install the nvim packages with Packer. Next is launching Mason to install the necessary LSP, linter and formatting packages:

:Mason

Credits

nvim

nvim config heavily inspired by Josean

dotfiles's People

Contributors

stijnme avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.