Giter VIP home page Giter VIP logo

.dotfiles's Introduction

Set Up

  • Create a .dotfiles folder to track dotfiles
git init --bare $HOME/.dotfiles
  • Add an alias dotfiles to your .zshrc
alias dotfiles='/usr/local/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
  • Set git status to hide untracked files
dotfiles config --local status.showUntrackedFiles no

Usage

dotfiles status

# .zshrc
dotfiles add $HOME/.zshrc
dotfiles commit -m 'feat: add .zshrc'

# ZSH_CONFIG
dotfiles add $HOME/ZSH_CONFIG/*
dotfiles commit -m 'feat: add ZSH_CONFIG files'

# nvim
dotfiles add $HOME/.config/nvim/coc-settings.json
dotfiles add $HOME/.config/nvim/init.vim
dotfiles commit -m 'feat: add coc-settings, init.vim'

dotfiles remote add origin [email protected]:USERNAME/.dotfiles.git
dotfiles push -u origin master

Neovim Shortcuts

customized shortcuts

  • Switch to next tab
    • In NORMAL mode, press Ctrl + e
  • Switch to previous tab
    • In NORMAL mode, press Ctrl + w
  • Close tab
    • In NORMAL mode, press Ctrl + q
  • Auto compile file
    • In NORMAL mode, press F5
  • Save file
    • In INSERT mode, press Ctrl + s

tpope/vim-surround

  • ds: Delete brackets
    • Press ds "

      "Hello world!"
      

      to change it to

      Hello world!
      
  • cs: Replace brackets
    • Press cs "(
      "Hello world!"
      
      to change it to
      (Hello world!)
      
  • cS: Replace brackets and add text in new line
    • Press cS "{
      "Hello world!"
      
      to change it to
      {
          Hello world!
      }
      
  • ys: Add brackets
    • With the cursor on "Hello", press ys w [
      Hello world!
      
      to change it to
      [Hello] world!
      
  • yS: Add brackets and add text in new line
    • With the cursor on "Hello", press ys w [
      Hello world!
      
      to change it to
      [
          Hello
      ] world!
      

preservim/nerdtree

  • Toggle NERDTree
    • In NORMAL mode, press -

terryma/vim-multiple-cursors

  • Use multiple cursors
    • Select lines in VISUAL mode, press Ctrl + n

scrooloose/nerdcommenter

  • Add comments
    • Select lines in VISUAL mode, press \ cc
  • Uncomments
    • Select lines in VISUAL mode, press \ cu

majutsushi/tagbar

  • Toggle NERDTree
    • In NORMAL mode, press =

ludovicchabant/vim-gutentags

  • Go to tag/function/class
    • In NORMAL mode, press Ctrl + ]
  • Go back to previos function
    • In NORMAL mode, press Ctrl + t
  • Search for a particular tag
    • In NORMAL mode, type :ts <tag>

junegunn/fzf

  • Search lines in all buffers
    • In NORMAL mode, press \ fl
  • Search lines in current buffer
    • In NORMAL mode, press \ fb
  • Search files
    • In NORMAL mode, press \ ff
  • Search git files (git ls-files)
    • In NORMAL mode, press \ fg
  • Search git files (git status)
    • In NORMAL mode, press \ f?
  • Use tag to search files
    • In NORMAL mode, press \ ft
  • Use tag to search files
    • In NORMAL mode, press \ ft
  • Search git commits (Requires fugitive.vim)
    • In NORMAL mode, press \ fc
  • Search MRU file
    • In NORMAL mode, press \ fh
  • Search history commands
    • In NORMAL mode, press \ `fh?

References

.dotfiles's People

Contributors

kirintwn avatar lesley-tw avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

kirintwn

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.