Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/budimanjojo/dotfiles-installer

Install your dotfiles across your system easier
https://github.com/budimanjojo/dotfiles-installer

base16-google-dark dotfiles installer installer-script nvim tmux vim zsh

Last synced: about 1 month ago
JSON representation

Install your dotfiles across your system easier

Awesome Lists containing this project

README

        

## dotfiles-installer
This repository contains my install script to configure my dotfiles. So I can just run the install script in my computer and I should get the unified looks in my terminals across machines. Please note that this is just my own personal dotfiles. You can fork this repository and use your own zshrc and vimrc by replacing yours with mine and run the install script.
In the future, maybe I will make this customizable for custom changes, but that's when I'm free and not guaranteed. I may not even look at this README again after setting up all my machines.
## Screenshots
Tmux
![render1561745632013](https://user-images.githubusercontent.com/13085918/60362720-d7f53580-9a0b-11e9-9876-79d6d18c998b.gif)

Zsh prompt
![screenshot-2019-06-12_01-05-09](https://user-images.githubusercontent.com/13085918/59295937-0acec800-8caf-11e9-94ed-c88c5703e963.png)

Vim
![screenshot-2019-06-12_01-07-25](https://user-images.githubusercontent.com/13085918/59295949-0dc9b880-8caf-11e9-8617-e4310db78f84.png)

## What Are Included
**Zsh**
This script will install [zinit](https://github.com/zdharma/zinit) and add these plugins:
- [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) as the default framework
- [Powerlevel10K](https://github.com/romkatv/powerlevel10k) as the theme
- [Vi-mode](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/vi-mode) for vi like mode in zsh
- [Zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) for the fish like autosuggestions
- [Fast-syntax-highlighting](https://github.com/zdharma/fast-syntax-highlighting) for the fish like syntax highlighting
- [Zsh-history-substring-search](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/history-substring-search) to fix history up down issue with vi-mode
- [Tmux](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/tmux) for tmux autostart
- [FZF](https://github.com/junegunn/fzf) as the fuzzy file finder

This script will also set up your shell colorschemes to `base16-google-dark` using [base16-shell](https://github.com/chriskempson/base16-shell)

**Vim**
This script will install [Vim-plug](https://github.com/junegunn/vim-plug) and add these plugins:
- [Vim-easy-align](https://github.com/junegunn/vim-easy-align)
- [Vim-colorschemes](https://github.com/flazz/vim-colorschemes)
- [Base16-vim](https://github.com/chriskempson/base16-vim)
- [Vim-airline](https://github.com/vim-airline/vim-airline)
- [Vim-airline-themes](https://github.com/vim-airline/vim-airline-themes)
- [Nerdtree](https://github.com/scrooloose/nerdtree)
- [Nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin)
- [Tcomment](https://github.com/tomtom/tcomment_vim)
- [Vim-fugitive](https://github.com/tpope/vim-fugitive)
- [Ale](https://github.com/w0rp/ale)
- [Coc.nvim](https://github.com/neoclide/coc.nvim)
- [Vim-snippets](https://github.com/honza/vim-snippets)
- [Fzf.vim](https://github.com/junegunn/fzf.vim)

Coc.nvim will have these extensions inside:
- [coc-json](https://github.com/neoclide/coc-json)
- [coc-snippets](https://github.com/neoclide/coc-snippets)
- [coc-pairs](https://github.com/neoclide/coc-pairs)
- [coc-highlight](https://github.com/neoclide/coc-highlight)
- [coc-tsserver](https://github.com/neoclide/coc-tsserver)
- [coc-tslint](https://github.com/neoclide/coc-tslint)
- [coc-html](https://github.com/neoclide/coc-html)
- [coc-css](https://github.com/neoclide/coc-css)
- [coc-phpls](https://github.com/marlonfan/coc-phpls)
- [coc-stylelint](https://github.com/neoclide/coc-stylelint)
- [coc-vimlsp](https://github.com/iamcco/coc-vimlsp)
- [coc-yaml](https://github.com/neoclide/coc-yaml)
- [coc-emmet](https://github.com/neoclide/coc-emmet)

**Note:** You need Vim version >=8.0 or Neovim version >=0.3.1 in order to use Coc.nvim

**Tmux**
This script will add a Tmux config for you. The main feature of our Tmux config is the unified colorscheme with our Zsh and Vim. Also, our preferred prefix key is `Alt+a` instead of the default `Ctrl+b` (Of cource you can change it, read more in [Customization](#customization))

## Dependencies
You need to have these packages installed in your system if you want to set up:
**For Zsh:**
```
zsh
git
silversearcher/ag
chsh
svn
curl/wget
```
**For Vim:**
```
vim/nvim
git
curl
nodejs
```
**For Tmux:**
`tmux`

## Fonts
Powerlevel10K and Vim-airline requires powerline fonts to work. We suggest [Nerd-fonts](https://github.com/ryanoasis/nerd-fonts) because that is what we are using. The font in the screenshot above is using UbuntuMono Nerd Font Regular.
## Installation
Install list of packages needed depending on what you want to setup, if you want to install everything, then this is the command you need:

**Arch Linux and Derivatives**
`sudo pacman -S zsh neovim git nodejs the_silver_searcher curl tmux subversion`

**Ubuntu and Derivatives**
`sudo apt install zsh neovim git nodejs silversearcher-ag curl tmux subversion`

After that, simply git clone this repository and run the install script. It will ask you what do you want to install. If you want to install everything without confirmation, pass the `--all` argument in the command like this:
```
git clone https://github.com/budimanjojo/dotfiles-installer.git ~/.dotfiles-installer && ~/.dotfiles-installer/install.sh --all
```
## Updating
**Zsh**
To update Zsh plugins, simply type in `zinit update` in terminal. To update zinit, type in `zinit self-update` in terminal.

**Vim**
To update Vim plugins, simply do `:PlugUpdate` in your vim. For Coc extensions, you don't have to do anything. It will update by itself everyday.

## Cheatsheet
**Vim**

The prefix key is `Space`. You can override this using your custom `.vimrc.local` file. `` means you need to press prefix key first. If they are not in the table, that means it is using the default Vim keybindings.


Mode
Vim Keypress
Description


Normal
<leader> w
Save file


Normal
<leader> x
Save file and quit vim


Normal
<leader> q
Quit vim


Normal
<leader> qa
Force quit vim without saving file


Normal
<leader> wq
Save file and quit vim


Normal
Y
Yank from cursor to the end of file


Insert
ii
Exit Insert mode


Normal
K
Move Up one paragraph


Normal
J
Move Down one paragraph


Normal
H
Move to the first character in line


Normal
L
Move to the last character in line


Normal
Control+k
Move to the split window above


Normal
Control+j
Move to the split window below


Normal
Control+h
Move to the left split window


Normal
Control+l
Move to the right split window


Normal
<leader> s
Open new horizontal split window


Normal
<leader> v
Open new vertical split window


Insert
Control+k
Move cursor Up


Insert
Control+j
Move cursor Down


Insert
Control+h
Move cursor Left


Insert
Control+l
Move cursor Right


Normal
<leader> tn
Open new tab


Normal
<leader> td
Close tab


Normal
<leader> th
Go to previous tab


Normal
<leader> tl
Go to next tab


Normal
<leader> te
Open new tab with current buffer's path


Normal/Visual
Tab
Indent current line or selection


Normal/Visual
Shift+Tab
De-indent current line or selection


Normal
<leader> h
Toggle search highlight on/off


Normal
F5
Strip whitespaces in file


Normal/Visual
ga
Align text with EasyAlign


All
Control+n
Toggle NERDTree File Manager


Normal
<leader> k
Go to previous syntax error with ALE


Normal
<leader> j
Go to next syntax error with ALE


Normal
<leader> ci
Show diagnostic message using COC.nvim


Normal
<leader> jn
Jump to next diagnostic position using COC.nvim


Normal
<leader> jp
Jump to previous diagnostic position using COC.nvim


Normal
<leader> jd
Jump to definition using COC.nvim


Normal
<leader> jc
Jump to declaration using COC.nvim


Normal
<leader> ji
Jump to implementation using COC.nvim


Normal
<leader> jt
Jump to type definition using COC.nvim


Normal
<leader> jr
Jump to reference using COC.nvim


Normal/Visual
<leader> cf
Format range of word of selection using COC.nvim


Normal
<leader> cr
Rename symbol using COC.nvim


Normal
<leader> cl
Open current link using COC.nvim


Insert
Alt+n
Jump to next snippet placeholder using COC Snippets


Insert
Alt+p
Jump to previous snippet placeholder using COC Snippets


Normal
<leader> ff
Fuzzy file search using FZF


Normal
<leader> fb
Fuzzy buffer search using FZF


Normal
<leader> fw
Fuzzy window search using FZF


Normal
<leader> fl
Fuzzy line search using FZF


Normal
<leader> fh
Fuzzy history search using FZF

**Tmux**

We have override the default keybindings for Tmux to be more reasonable. Prefix key is `Alt+a` for local session and `Alt+z` for nested session. You can of course override this using your custom `.tmux.conf.local` file. `` means you need to press prefix key first, `` means you don't need to press prefix key again after triggering it within `repeat-time` set (default set to 1 second), `` means you must be in copy-mode first. The table below lists all the keybindings set. If they are not in the table, that means it is using the default Tmux keybindings.


Tmux Keypress
Description


<prefix> Alt+e
Edit tmux.conf.local file and reload configuration after saving


<prefix> Alt+r
Reload tmux configuration


<prefix> f
Find session, window, pane from a list


<prefix> Alt+s
Make new horizontal split window


<prefix> Alt+v
Make new vertical split window


<prefix> r
Rename current window

<prefix> R
Rename current session


<prefix> <repeat> h
Move selection to left pane


<prefix> <repeat> j
Move selection to pane below


<prefix> <repeat> k
Move selection to pane above


<prefix> <repeat> l
Move selection to right pane


<prefix> <repeat> >
Swap to the next pane


<prefix> <repeat> <
Swap to the previous pane


<prefix> <repeat> H
Resize current pane to the left


<prefix> <repeat> J
Resize current pane downwards


<prefix> <repeat> K
Resize current pane upwards


<prefix> <repeat> L
Resize current pane to the right


<prefix> <repeat> Alt+n
Move selection to the next window


<prefix> <repeat> Alt+p
Move selection to the previous window


<prefix> <repeat> Tab
Move selection to the next window


<prefix> S
Join current pane to selected window in horizontal split


<prefix> V
Join current pane to selected window in vertical split


<prefix> x
Close current pane


<prefix> X
Close current window


<prefix> Alt+x
Close all other window window


<prefix> a
Go into copy mode


<prefix> p
Paste copied text from the last buffer


<prefix> P
Choose buffer to paste from list


<copy-mode> y
Copy selected text


<copy-mode> Y
Copy the whole line of selected text


<copy-mode> D
Copy untile the end of line from the selected text

## Customization
**ZSH**

To customize your zsh, you can create these files in your `$HOME` directory:
- `.zshrc.before` to add stuffs you want to load before your plugins. For example, to autostart tmux you can add `ZSH-TMUX_AUTOSTART=true` in this file
- `.zshrc.local` to add in your own custom stuffs
- `.zshrc.bundles` to add your own zinit compatible plugins
This script will also add in these files in `$HOME/.zsh` folder:

In normal oh-my-zsh install, you can customize your `~/.zshrc` and your `$ZSH_CUSTOM` folder, but this install script needs to make small changes for FZF and COC Vim to work. So, please don't edit your ~/.zshrc manually, but edit the files inside `~/.zsh` directory instead. This install script will put in 4 files for you to customize:
- `general.zsh` contains your own general settings for oh-my-zsh
- `alias.zsh` contains your own aliases
- `looks.zsh` contains the customization options for Powerlevel10k theme
- `plugs.zsh` contains settings for plugins

To change the included `base16-google-dark` colorscheme, you can type `base16` followed by a tab to perform tab completion.

**Vim**

You can create a new file in your `$HOME` folder call `.vimrc.local` and put in what you want to override in that file.

**Tmux**

You can simply create a new file in your `$HOME` folder call `.tmux.conf.local` and put in what you want to override in that file. After that, source that file in tmux and you are done. You can do it with this keybindings:
- `Alt+a,Alt+e` to edit tmux.conf.local file
- `Alt+a,Alt+r` to re source your tmux
You can also add Tmux plugins into your .tmux.conf.local file normally.

## To do
- [ ] Better way to use custom configs
- [ ] Use separate files instead of one vimrc
- [x] Better way to handle custom Powerlevel9k settings
- [x] Include Tmux config