/Dotfiles

My personal Mac OSX and Linux dotfiles

Primary LanguageShell

Personal Configuration for space-vim, ZSH, dotfiles

Installation

The root directory should be ~/Dotfiles/

  1. Clone the repository to local machine:
    git clone https://github.com/ztlevi/Dotfiles.git ~/Dotfiles
        
  2. Install GNU stow
    # OSX
    brew install stow
    # Ubuntu
    sudo apt install stow
        
  3. Put the dotfiles in the home directory:
    cd ~/Dotfiles
    ./install.sh
        

Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install necessary utilities:

brew install git curl wget

space-vim

./screenshots/space-vim.jpg

  1. Install git, vim/neovim, curl first.
    • vim vim --version to check your vim has +clipboard and +python/python3 support
      • For Mac: brew install macvim --with-override-system-vim
      • For Linux, install gvim instead of vim (with +clipboard support)
    • neovim Python support script is already written in installspace-vim.sh. Make sure you have Python 2 or 3 installed.
      • For Mac: brew install neovim
  2. Install space-vim:
    cd ~/Dotfiles
    ./installspace-vim.sh
        
  3. Update the plugin with :PlugUpdate
  4. Note: Python3 must be enabled before updating remote plugins If Deoplete was installed prior to Python support being added to Neovim, :UpdateRemotePlugins should be executed manually in order to enable auto-completion.
  5. Add clipboard support on Ubuntu by installing:
    sudo apt install xclip
        

ZSH

./screenshots/terminal.jpg

  1. Install zsh first, instructions here.
    # set zsh as default, this one does not need root
    chsh -s $(which zsh)
    # alternative for Linux
    sudo usermod -s /usr/bin/zsh <username>
        
  2. Install oh-my-zsh:
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
        
  3. Some instructions is in OhMyZSH.org

Tmux

  1. Install Tumx using system package manager like homebrew, apt-get, pacman.
    brew install tmux
        
  2. tmux-yank package requirements here. Mac: brew install reattach-to-user-namespace Linux: pacman -S xsel
  3. Key bindings
    • tmux-resurrect: prefix + Ctrl-s - save, prefix + Ctrl-r - restore
    • prefix: I set it to C-x
    • prefix + I: Installs new plugins from GitHub or any other git repository. Refreshes TMUX environment
    • prefix + U: updates plugin(s)
    • prefix + alt + u: remove/uninstall plugins not on the plugin list

Grep, Rg

brew install grep ripgrep

fzf

  • Homebrew or Linuxbrew
    brew install fzf
    
    # To install useful key bindings and fuzzy completion:
    $(brew --prefix)/opt/fzf/install
        

Node, NVM

Use Node Installer to install node.js.

  • Optional: Use nvm as node version manager.
    nvm install 8
        
    nvm use 8
    
    # set the node8 as default node
    nvm alias default 8
    # OR
    # set the system as default node
    nvm alias default system
        

Aspell personal dictionary

  1. Follow the link
  2. .aspell.lang.pws: The second part of simply a word list with one word per line.
  3. .aspell.lang.prepl: The second part simply a list of replacements with one replacement per line with each replacement pair has the following format: misspelled_word correction

Other Dependencies

  1. System package manager dependencies:
    brew install fd ranger p7zip screenfetch asciinema tree pandoc
        
  2. NPM dependencies here, and you will need to install python.
    npm i -g npm yarn prettier trash-cli live-server hexo-cli reveal-md phantomjs \
        eslint babel-eslint eslint-plugin-babel eslint-plugin-react \
        eslint-plugin-import eslint-plugin-prettier eslint-config-prettier \
        typescript tslint
        
  3. Pip Make sure your pip is the one you want to use. Options are from anaconda, python2 or python3.
    python3 -m pip install pipenv 'python-language-server[all]'
        

    Note: (optional) If you are using Python 2.7 and want to enable multiprocessing:

    python2 -m pip install futures
        
  4. C++
    brew install gcc@7 cmake ninja clang-format
        
  5. Latex
    brew cask install basictex
    sudo tlmgr update --self
    sudo tlmgr install latexmk multirow
        
  6. Mac quick look (Preview)
    brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json webpquicklook suspicious-package quicklookase qlvideo
        
  7. Cask applications
    # Install jdk8
    brew cask install java
    
    # anaconda
    brew cask install anaconda
    
    # Install Others
    brew cask install typora slack skype dropbox neteasemusic obs iina firefox google-chrome kap \
        cakebrew keycastr intel-power-gadget karabiner-elements \
        iterm2 jetbrains-toolbox visual-studio-code virtualbox gitbook-editor vimr
        

    Brew cask upgrade:

    brew tap buo/cask-upgrade
    # Upgrade with
    brew cu
        

Mac Keybindings

Settings are described in Mac\_keybindings/ReadMe.md

Homebrew Backup

  • Backup
    brew bundle dump --force --file="~/Library/Mobile Documents/com~apple~CloudDocs/PackageManagerLists/Brewfile"
        
  • Restore
    brew bundle --file="~/Library/Mobile Documents/com~apple~CloudDocs/PackageManagerLists/Brewfile"
        
  • Clean up
    brew bundle cleanup --file="~/Library/Mobile Documents/com~apple~CloudDocs/PackageManagerLists/Brewfile"
        

Fonts

  1. Roboto Mono for Powerline
  2. Ubuntu Mono and the one for Powerline
  3. Source Code Pro for Powerline
  4. Operator Mono and Lig
  5. Monofur for Powerline
  6. Menlo - Regular

Notes

  1. Xmodmap file is used for key tweak on linux.
  2. NPM global packages’ path is set to be ~/.npm-global