Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/theoomoregbee/dotfiles

Personal dotfile with git hook to manage brew packages (brewfile)
https://github.com/theoomoregbee/dotfiles

bash-profile brew brewfile development dotfiles oh-my-zsh vim zsh

Last synced: 3 months ago
JSON representation

Personal dotfile with git hook to manage brew packages (brewfile)

Awesome Lists containing this project

README

        

# dotfiles
Personal dotfiles

## Cloining / replicating
```sh
git clone --recursive https://github.com/theo4u/dotfiles.git
```

## Configuration / Automation
* **Setup Mac** importing, just simply run `./setup-mac.sh`, which run through the following sequence
- check if brew is installed, install it
- Oh my Zsh installation
- link dotfiles to home directory
- install packages from `Brewfile`
- run through mac default configurations (hide/show dock)
* **Syncing Files** keeping files updated for dotfiles and brew installed packages
- `cd ~/dotfiles` commit the changes
- for keeping track of installed brew packages, using a git hook to auto update and commit `Brewfile`(no need to think of this)
- then `git push` to push the changes and the auto committed `Brewfile`
- For vim plugin syncing which is my main focus check below

## GIT

Git aliases like
* `gp` for `git pull`
* `gpush` for `git push`
* `gco branchname` for `git checkout branchname`
* `gcb branchname` for `git checkout -b branchname`
* `gbd branchname` for `git branch -D branchname`
* etc. more in [.bash_profile](https://github.com/theo4u/dotfiles/blob/cde99ee917cf76c72003cf3ae4b2fc1de57fc302/.bash_profile#L14)

## Export secure Content

To export secure content like `NPM_TOKEN` you can create `~/.bash_profile_secure` and it will be automatically exported. check [.bash_profile](https://github.com/theo4u/dotfiles/blob/master/.bash_profile#L11)

## VIM
### Adding Plugins via Pathogen
```sh
cd ./.vim/bundle
git submodule add http://github.com/tpope/vim-fugitive.git
```
Using git hook to auto commit the submodule added using the `repo-name` like so `added ${repo_name} plugin`. So, anytime we decide to push we can push the new update

### Managing Plugins
#### Single Update
```sh
cd ~/.vim/bundle/${pluginName}
git pull origin master
```
#### All Update
```sh
git submodule foreach git pull origin master
```
#### Remove Update
```sh
cd ~/.vim/bundle
git submodule deinit
git rm
```
Using git hook to auto commit the submodule after triggering `git submodule update` automatically too (keeping check of the current state of submodules)
* removed using the `repo-name` like so `removed ${repo_name} plugin`.
* any submodule changes like so `Updated Plugins`.
So, anytime we decide to push we can push the new update

## Term/ITerm theme
* [Space Gray](theme/spacegray.itermcolors)
* [Profile](/iterm_profile.json)

> Profile requires roboto powerline font to be installed. See https://github.com/powerline/fonts#quick-installation

## VIM Cheat sheet
### VIM SESSION
* `:mks ~/sessions/name of project.vim` : The next time you’re ready to start working on that project, source that session file within vim `:source ~/sessions/rooster.vim` Or open it when you run vim in terminal using the **-S** flag: `vim -S ~/.vim/sessions/rooster.vim`
Boom. Everything will be exactly as you left it: the working directory, your windows, splits, and buffers, and any options you’ve :set. When the cycle repeats as you rearrange the furniture, just overwite the old session by using `:mks!`.

### VIM TABS
* gt (or :tabn) to go to next tab
* gT (or :tabp or :tabN) to go to previous tab
* #gt (or :tabn #) to go to #th tab
* :tabr to go to first tab
* :tabl to go to last tab
* :tabm to move the current tab to the last position
* :tabm # to move the current tab to the #th position

### Goto Definition using g
Place the cursor on any variable in your program.
* gd will take you to the local declaration.
* gD will take you to the global declaration.
* g* search for the word under the cursor (like *, but g* on 'rain' will find words like 'rainbow').
* g# same as g* but in backward direction.
* gg goes to the first line in the buffer (or provide a count before the command for a specific line).
* G goes to the last line (or provide a count before the command for a specific line).
* gf will go to the file under the cursor
* g] and other commands will jump to a tag definition (a tag can be a function or variable name, or more).
* gf - Edit existing file under cursor in same window
* C-Wf - Edit existing file under cursor in split window
* C-WC-F - Edit existing file under cursor in vertically split window
* C-Wgf - Edit existing file under cursor in new tabpage

### Surround
http://www.futurile.net/2016/03/19/vim-surround-plugin-tutorial/