https://github.com/smileart/omg
One More Gear set to follow DRY principle and stop doing things again and again (just a nice name for my dotfiles)
https://github.com/smileart/omg
dotfiles shell
Last synced: 6 months ago
JSON representation
One More Gear set to follow DRY principle and stop doing things again and again (just a nice name for my dotfiles)
- Host: GitHub
- URL: https://github.com/smileart/omg
- Owner: smileart
- License: mit
- Created: 2014-09-12T12:42:21.000Z (almost 12 years ago)
- Default Branch: develop
- Last Pushed: 2019-01-31T17:10:24.000Z (over 7 years ago)
- Last Synced: 2025-10-12T10:48:52.350Z (8 months ago)
- Topics: dotfiles, shell
- Language: Shell
- Homepage:
- Size: 4.05 MB
- Stars: 34
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
```
_____ _ _ _______ _
/ ____| (_) | ____ |__ __( )
| (___ _ __ ___ _| | ___ / __ \ _ __| | |/ ___
\___ \| '_ ` _ \| | |/ _ \ / / _` | '__| | / __|
____) | | | | | | | | __/ | | (_| | | | | \__ \
__|_____/|_| |_|_|_|_|_|\___| \ \__,_|_| |_| _|___/
/ __ \| \/ |/ ____| | |_ _| \____/ | | | | |
| | | | \ / | | __| | | | _ __ ___| |_ __ _| | | ___ _ __
| | | | |\/| | | |_ | | | | | '_ \/ __| __/ _` | | |/ _ \ '__|
| |__| | | | | |__| |_| _| |_| | | \__ \ || (_| | | | __/ |
\____/|_| |_|\_____(_) |_____|_| |_|___/\__\__,_|_|_|\___|_|
* One More Gear Set v.0.0.2
```
WARNING!
===============
Before using any of these scripts, make sure you have read the code and agree with every action it's going to do on your system!
This set of scripts is distributed with the hope of being useful, but is provided AS IS with ABSOLUTELY NO WARRANTY!
Moreover, I think you shouldn't and probably not going to use it as it is. The best way to make it useful for yourself is to sneak a snippet of code here and there or to get inspired by some key bindings/aliases/tools/functions/technics being used and make use of them in your own dotfiles configuration. Also I hope some things in this README file also could be used as a reference/memo for those of you who like myself always tend to forget this and that while using just a small bit of all this goodness. Anyway, tanks for coming by ;)
What
===============






Why
===============
Just one more handcrafted gear set to follow DRY principle and stop doing things again and again.

(๏ 。๏) <( OMG! )
How
===============
Prerequirements:
** Before usage on a freshly installed MacOS you have to install XCode from the Appstore! **
** It is also may be needed to install `tools` and `system` packages first to proceed! **
Some common ways of packages installation:
```
./install packages.sh # install ALL the basic packages
./install package_name # install one package
./install package_name --force # install the package even if it's already exists (overwrite .files)
./install package_name package2_name # install a couple of packages
./update # to update oh-my-zsh, vim bundles, brew, ruby gems, npm…
```
How to override .vimrc
```
# just run vim like that (or create alias in ~/.user.aliases)
vim -u ~/.your_own_vim_rc # where you could source my .vimrc or do anything you want
```
Files & folders
===============
* `~/.omg_aliases/` — folder for git, mc, vim, etc. aliases and functions
* `~/.vimrc` — vim compound config (`C-w gf` — to open files from it in vim)
* `~/.vim/.rcs/` — folder for vimrc files
* `~/.omgzsh` — ZSH config for OMG
* `~/.tmux/` — tmux files and "plugins"
* `~/.tmux.conf` — tmux config file
* `~/.user.aliases` — your own personal aliases and preferences
* `~/.user.env` — a good place for your own environment variables
* `~/.smileart.zsh-theme` — ZSH theme file (default for OMG)
tmux
===============
OMG uses `tmux` as your usual working environment and as a pairing instrument. All your `zsh` or `vim` sessions are supposed to run nested inside `tmux` session.
OMG's `tmux` comes with a nice panel and a bunch of useful tools and bindings.

Actually the only binding you need to remember is `C-a ?` which lists all the other bindings. There you can use `/` to search and `N` or `n` to navigate trough search results. After, press `q` to quit. But here are some useful bindings you should know to use `tmux` in the most efficient way:
````
$ \tmux # start new session
$ \tmux new -s session_name # start new session with name
$ \tmux a
$ \tmux at
$ \tmux attach # attach to existent session
$ \tmux a -t myname # attach to named session
$ \tmux ls # list sessions
$ \tmux kill-session -t session_name
````
**Global bindings WITHOUT `Ctrl+a` prefix**
`^D` — Ctrl+D — detach client sesslion (shows list)
**All the bindings below are supposed to be used after `Ctrl+a`**
* `s` — list sessions
* `$` — rename session
* `d` — detach current session
---
* `c` — new window
* `a` — send command to nested tmux
* `n` — go to next window
* `p` — go to previous window
* `` — go to window with
* `,` — name window
* `w` — list windows
* `f` — find window
* `&` — kill window
* `.` — move window - asks position number (0 — first position)
* `^a` — Ctrl+a — go to first/last window
* `Ctrl + Shift + ←/→` — swap adjacent windows
---
* `%` or `b` — split pane horizontally
* `"` or `v` — split pane vertically
* `^o` — swap panes
* `q` — show pane numbers
* `x` — kill current pane
* `_` — space - toggle next panes layout
* `o` — go to another pane
* `!` — move the pane to a separate window
* `@` — join a pane from a window #n
* `^o` — Ctrl+o — swap panes
* `z` — zoom/zoom out pane (!!!)
* `←` `↓` `↑` `→` — move between panes (`h` `j` `k` `l`)
* `^↑` `^↓` — Ctrl+Arrows — resize current pane
* `}` `{` — move pane right/left
---
* `t` — clock "screensaver"
* `[` — go to copy mode (like Vim visual `v` — select mode, `y` — yank, `C-v ` — visual block etc.)
* `]` — paste text which was copied in copy mode
**All commands below are supposed to be used after `Ctrl+a :`**
* `new ⏎` — start new named session from current tmux — asks for name
* `movew ⏎` — move window to the end of windows list
* `movew -t ⏎` — set window's new number (move it to position)
* `rename-window new_name ⏎` — rename window to "new name"
* `detach ⏎` — detach current session
* `copy-mode ⏎` — toggle copy-mode
* `setw synchronize-panes` — sync input in all opened panes
**Panes resizing**
* `resize-pane <###>` — resizes the current pane down by 1 line or ### lines
* `resize-pane -U <###>` — resizes the current pane upward
* `resize-pane -L <###>` — resizes the current pane left
* `resize-pane -R <###>` — resizes the current pane right
* `resize-pane -t 2 <###>` — resizes the pane with the id of 2 down by ### lines
* `resize-pane -t -L <###>` — resizes the pane with the id of 2 left by ### cols
### Tips
For vim/tmux windows/sessions/buffers/panes visual reference see [vim/tmux windows](/images/vim_tmux_windows.png)
git
===============
Git in OMG is packed with a bunch of tools and presets. First of all it's aliases for convenient and fast everyday work and also a couple of nice utilities to make routines and custom tasks even more simple.
### Aliases
````
# Git Aliases
alias gs='git status'
alias gstsh='git stash'
alias gst='git stash'
alias gshw='git show'
alias gshow='git show'
alias gi='vim .gitignore'
alias gcm='git ci -m'
alias gcim='git ci -m'
alias gci='git ci'
alias gco='git co'
alias gcp='git cp'
alias ga='git add -A'
alias guns='git unstage'
alias gunc='git uncommit'
alias gm='git merge'
alias gms='git merge --squash'
alias gam='git amend --reset-author'
alias grv='git remote -v'
alias grr='git remote rm'
alias grad='git remote add'
alias gr='git rebase'
alias gra='git rebase --abort'
alias ggrc='git rebase --continue'
alias gbi='git rebase --interactive'
alias gl='git pull'
alias glg='git l'
alias glog='git l'
alias co='git co'
alias gf='git fetch'
alias gfch='git fetch'
alias gd='git diff'
alias gdsf='git diff --color | diff-so-fancy'
alias gb='git b'
alias gbd='git b -D -w'
alias gdc='git diff --cached -w'
alias gpub='grb publish'
alias gtr='grb track'
alias gpl='git pull'
alias gplr='git pull --rebase'
alias gps='git push'
alias gpsh='git push'
alias gnb='git nb' # new branch aka checkout -b
alias grs='git reset'
alias grsh='git reset --hard'
alias gcln='git clean'
alias gclndf='git clean -df'
alias gclndfx='git clean -dfx'
alias gsm='git submodule'
alias gsmi='git submodule init'
alias gsmu='git submodule update'
alias gt='git t'
alias gbg='git bisect good'
alias gbb='git bisect bad'
alias gbmv='git branch -m'
# Stash (s)
alias gsa='git stash apply'
alias gsx='git stash drop'
alias gsX='git-stash-clear-interactive'
alias gsl='git stash list'
alias gsL='git-stash-dropped'
alias gsd='git stash show --patch --stat'
alias gsp='git stash pop'
alias gsr='git-stash-recover'
alias gss='git stash save --include-untracked'
alias gsS='git stash save --patch --no-keep-index'
alias gsw='git stash save --include-untracked --keep-index'
````
### [git-extras](https://github.com/tj/git-extras)
GIT utilities -- repo summary, repl, changelog population, author commit percentages and more.
Gives you such commands as (read about each [here](https://github.com/tj/git-extras)):
````
git extras
git squash
git summary
git effort
git changelog
git commits-since
git count
git create-branch
git delete-branch
git delete-submodule
git delete-tag
git delete-merged-branches
git fresh-branch
git graft
git alias
git ignore
git info
git fork
git release
git contrib
git repl
git undo
git gh-pages
git setup
git touch
git obliterate
git feature
git refactor
git bug
git local-commits
git archive-file
git missing
git lock
git locked
git unlock
git reset-file
git pr
git root
````
### [git-up](http://aanandprasad.com/git-up/)
git pull has two problems:
* It merges upstream changes by default, when it's really more polite to rebase over them, unless your collaborators enjoy a commit graph that looks like bedhead.
* It only updates the branch you're currently on, which means git push will shout at you for being behind on branches you don't particularly care about right now.
Solve them once and for all.
````
$ git up
````
### [git-open](https://github.com/paulirish/git-open)
Type git open to open the repo website (GitHub, GitLab, Bitbucket) in your browser.
```sh
$ git open [remote-name] [branch-name]
$ git open issue
```
```sh
$ git open
# opens https://github.com/REMOTE_ORIGIN_USER/CURRENT_REPO/tree/CURRENT_BRANCH
$ git open upstream
# opens https://github.com/REMOTE_UPSTREAM_USER/CURRENT_REPO/tree/CURRENT_BRANCH
$ git open upstream master
# opens https://github.com/REMOTE_UPSTREAM_USER/CURRENT_REPO/tree/master
$ git open issue
# If branches use naming convention of issues/#123,
# opens https://github.com/REMOTE_UPSTREAM_USER/CURRENT_REPO/issues/123
```
### [GitUp](http://gitup.co)
Work quickly, safely, and without headaches. The Git interface you've been missing all your life has finally arrived.
### [gitsu](http://drrb.github.io/gitsu/)
Little tool which helps to manage your projects' Git users by making it easy to switch between users.
Gitsu lets you:
* quickly switch between Git users
* switch to multiple users at once for paring
````
$ git su --add "John Galt "
User 'John Galt ' added to users
$ git su --add "Raphe Rackstraw "
User 'Raphe Rackstraw ' added to users
$ git su jg
Switched to user John Galt
$ git su raphe
Switched to user Raphe Rackstraw
$ git su jg rr
Switched to user 'John Galt and Raphe Rackstraw '
````
### [Legit](http://www.git-legit.org/)
Legit is a complementary command-line interface for Git, optimized for workflow simplicity. It is heavily inspired by GitHub for Mac.
````
$ git sync
# Syncronizes current branch. Auto-merge/rebase, un/stash.
$ git switch
# Switches to branch. Stashes and restores unstaged changes.
$ git publish
# Publishes branch to remote server.
$ git unpublish
# Removes branch from remote server.
$ git branches
# Nice & pretty list of branches + publication status.
````
### [git-semantic-commits](https://github.com/fteem/git-semantic-commits)
Simple git commands aimed to help git users to write better git commit messages. Inspired by Sparkbox's awesome article on: [semantic commit messages](http://seesparkbox.com/foundry/semantic_commit_messages).
````
git feat "commit-message-here" # -> git commit -m 'feat: commit-message-here'
git docs "commit-message-here" # -> git commit -m 'docs: commit-message-here'
git ch "commit-message-here" # -> git commit -m 'chore: commit-message-here'
git fix "commit-message-here" # -> git commit -m 'fix: commit-message-here'
git rf "commit-message-here" # -> git commit -m 'refactor: commit-message-here'
git style "commit-message-here" # -> git commit -m 'style: commit-message-here'
git test "commit-message-here" # -> git commit -m 'test: commit-message-here'
git localize "commit-message-here" # -> git commit -m 'localize: commit-message-here'
# If you would still like to use your text editor
# for your commit messages you can omit the message,
# and do your commit message in your editor.
git feat # -> git commit -m 'feat: ' -e
````
### More
In addition there are also some useful commands to use with git:
* `git fix` — add currnet fixes to the commit (`git add -A; git-commit -v --amend` alias)
* `git git stash-unapply` — undo stash applay (`!git stash show -p | git apply -R` alias. Works only for stash apply finished without conflicts.)
* `git dsf` or `gdsf` — fancy git diff using [`diff-so-fancy`](https://github.com/so-fancy/diff-so-fancy)
* `git permissions-reset` — reset git's file permissions changes
### Docs
* [`Git How To`](https://githowto.com) — guided tour that walks through the fundamentals of Git
* [`Learn Git Branching`](http://learngitbranching.js.org) — the most visual and interactive way to learn Git + [bonus](https://onlywei.github.io/explain-git-with-d3/)
* [`Ry’s Git Tutorial`](http://rypress.com/tutorials/git/index) — a complete introduction to distributed version control
* [`Git Immersion`](http://gitimmersion.com) — a guided tour that walks through the fundamentals of git
* [`Oh shit, git!`](http://ohshitgit.com) — how to undo things in git (also see `git undo` & `git unpublish`)
Also OMG's ZSH `antigen` plugins provide convenient and pretty smart autocompletion for git commands, branches, remote branches and so on. And allow you to use such branch conventions as [git-flow](https://github.com/nvie/gitflow).
Vim
===============
One of the core features of OMG is a preconfigured vim editor with 40+ plugins and custom settings. You could use it as it is or setup your own configuration to match your needs.
###Plugins
Here is the current plugins list with short explanation for each one:
* [`neobundle.vim`](https://github.com/Shougo/neobundle.vim) — NeoBundle is a next generation Vim **plugin manager**.
* [`vim-colorschemes`](https://github.com/flazz/vim-colorschemes) — one **colorscheme pack** to rule them all (Frankly speaking, personaly I prefer [`neverland-darker`](https://github.com/trapd00r/neverland-vim-theme) scheme)
* [`vim-airline`](https://github.com/bling/vim-airline) — lean & mean **status**/**tabline** for vim that's light as air
* [`ctrlp.vim`](http://ctrlpvim.github.io/ctrlp.vim/) — **Fuzzy** file, buffer, mru, tag, etc **finder**.
* [`nerdtree`](https://github.com/scrooloose/nerdtree) — A **tree explorer** plugin for vim.
* [`vim-easymotion`](https://github.com/Lokaltog/vim-easymotion) — Vim **motions** on speed!
* [`tagbar`](https://github.com/majutsushi/tagbar) — Vim plugin that displays **tags** in a window, ordered by scope
* [`csv.vim`](https://github.com/chrisbra/csv.vim) — A Filetype plugin for **csv files**
* [`syntastic`](https://github.com/scrooloose/syntastic) — **Syntax checking** hacks for vim
* [`vim-indent-guides`](https://github.com/nathanaelkane/vim-indent-guides) — A Vim plugin for visually displaying **indent levels** in code
* [`vimproc`](https://github.com/Shougo/vimproc.vim) — Interactive **command execution** in Vim.
* [`ZoomWin`](https://github.com/vim-scripts/ZoomWin) — **Zoom** in/out of **windows** (toggle between one window and multi-window)
* [`vim-choosewin`](https://github.com/t9md/vim-choosewin) — land to **window** you **choose** like tmux's 'display-pane'
* [`tabular`](https://github.com/godlygeek/tabular) — Vim script for **text** filtering and **alignment**
* [`nerdcommenter`](https://github.com/scrooloose/nerdcommenter) — Vim plugin for intensely **orgasmic commenting**
* [`vim-misc`](https://github.com/xolox/vim-misc) — Miscellaneous **auto-load Vim scripts**
* [`vim-session`](https://github.com/xolox/vim-session) — Extended **session management** for Vim (:mksession on steroids)
* [`vim-move`](https://github.com/matze/vim-move) — Plugin to **move lines** and selections up and down
* [`trailertrash.vim`](https://github.com/csexton/trailertrash.vim) — Identify and **Irradicate unwanted whitespace** at the end of the line
* [`YankRing.vim`](https://github.com/vim-scripts/YankRing.vim) — Maintains a **history of previous yanks**, changes and delete
* [`ctrlp-extensions.vim`]() — **Plugins for ctrlp.vim** (cmdline history, yank history, extension selector menu)
* [`ctrlp-mark`](https://github.com/mattn/ctrlp-mark) — **Show** all **marks** in **CtrlP** menu
* [`undotree`](https://github.com/mbbill/undotree) — Display your **undo history** in a graph.
* [`vim-surround`](https://github.com/tpope/vim-surround) — surround.vim: **quoting/parenthesizing** made simple
* [`delimitMate`](https://github.com/Raimondi/delimitMate) — Vim plugin, provides insert mode **auto-completion for quotes, parens, brackets**, etc.
* [`vim-fugitive`](https://github.com/tpope/vim-fugitive) — fugitive.vim: a Git wrapper so awesome, it should be illegal
* [`vim-togglelist`](https://github.com/milkypostman/vim-togglelist) — Functions to **toggle** the Location List and the Quickfix **List windows**.
* [`vim-eunuch`](https://github.com/tpope/vim-eunuch) — eunuch.vim: **helpers for UNIX**
* [`vim-markology`](https://github.com/jeetsukumaran/vim-markology) — Vim **mark visualization**, navigation and management
* [`vim-wipeout`](https://github.com/artnez/vim-wipeout) — **Destroy** all **buffers that are not open** in any tabs or windows.
* [`tabman.vim`](https://github.com/kien/tabman.vim) — **Tab management** for Vim
* [`vim-signify`](https://github.com/mhinz/vim-signify) — Show a **VCS diff** using Vim's **sign column**.
* [`nerdtree-chmod`](https://github.com/EvanDotPro/nerdtree-chmod) — A plugin for **NERD Tree** that allows for **chmod**'ing files
* [`matchit.zip`](https://github.com/vim-scripts/matchit.zip) — **extended % matching** for HTML, LaTeX, and many other languages
* [`OpenUrl.vim`](https://github.com/FuDesign2008/OpenUrl.vim) — **Open URL** in vim
* [`sensible.vim`](https://github.com/tpope/vim-sensible) — Defaults everyone can agree on
* [`opinion.vim`](https://github.com/rstacruz/vim-opinion) — an almost-universal set of defaults that most people can agree on
* [`sleuth.vim`](https://github.com/tpope/vim-sleuth) — plugin which automatically adjusts 'shiftwidth' and 'expandtab' heuristically
* [`smartpairs.vim`](https://github.com/gorkunov/smartpairs.vim) — Fantastic selection for VIM
* [`incsearch.vim`](https://github.com/haya14busa/incsearch.vim) — Improved incremental searching for Vim
* [`neosnippet`](https://github.com/Shougo/neosnippet) — modern snippets plugin + `vim-snippets` & `neosnippet-snippets` sets
* [`context_filetype.vim`](https://github.com/Shougo/context_filetype.vim) — context filetype library for Vim script
* [`vim-json`](https://github.com/elzr/vim-json) — a better JSON for Vim
* [`ferret`](https://github.com/wincent/ferret) — Enhanced multi-file search for Vim
--------
**Front-end Bundle** (works on js/css/html files only)
* [`vim-javascript-syntax`](https://github.com/jelera/vim-javascript-syntax) — Enhanced javascript syntax file for Vim
* [`emmet.vim`](https://github.com/mattn/emmet-vim) — [`emmet`](http://emmet.io) for vim
* [`vim-css3-syntax`](https://github.com/hail2u/vim-css3-syntax) — Add CSS3 syntax support to vim's built-in `syntax/css.vim`
* [`javascript-libraries-syntax.vim`](https://github.com/othree/javascript-libraries-syntax.vim) — Syntax for JavaScript libraries
* [`vim-css-color`](https://github.com/ap/vim-css-color) — Preview colours in source code while editing
* [`tern_for_vim`](https://github.com/marijnh/tern_for_vim) — [`Tern`](http://ternjs.net) plugin for Vim
--------
**Ruby Bundle** (works on rb files only)
* [`vim-ruby/vim-ruby`](https://github.com/vim-ruby/vim-ruby) — Vim/Ruby Configuration Files
* [`tpope/vim-rails`](https://github.com/tpope/vim-rails) — rails.vim: Ruby on Rails power tools
* [`vim-scripts/rubycomplete.vim`](https://github.com/vim-scripts/rubycomplete.vim) — ruby omni-completion
### Vim essentials (@TODO Section in progress…)
#### Bindings
* `f ` `F ` — go to symbol in row forward/backward
* `s ` `S ` — 2-character search, similar to vim-seek/vim-sneak
* ` w` — vim-easymotion plugin binding to go forward
* ` p` — paste clipboard in PASTE mode
* `C-/` — toggle comment for block or line
* `C-\` — toggle NERDTree (auto synchronised between tabs)
* `CTRL-]` — go to definition, `CTRL-t` — go back
* `mt` — open/close tabs manager
* `Tab` / `S-Tab` — navigate through tabs
* `g` — GOTO anything with CtrlP (files, buffers, mru, commands, etc.), look for internal bindings [HERE](http://kien.github.io/ctrlp.vim/)
* `t` — toggle tags menu
* `q` — exit from any dialog pane or list
* `h` — toggle UndoTree pane (history)
* `b` — open the bundle page (on the GitHub)
* `u` — open the URL under the cursor
* `gf` — "go to file", opens path under cursor in the same window
* `C-w gf` — open path under cursor in new tab
* `C-k` `C-j` — move current line or selection UP and DOWN
* `-` — quickly choose a window!
* `C-ww` — go to next window
* `C-l` — hide the last search highlights
* `C-d` — expand an Emmet pattern
* `C-k` — expand snippet
* `Tab` — expand snippet from snippets list
* `/ cgn gn .` — multicursor-like text replacement
#### Commands
* `:Wipe` — destroy all buffers that are not open in any tabs or windows
* `:ListLeaders` — full `` bindings list (!!!)
* `:UpdateTags -R ` — recursively update ctags for project
* `:'<,'>Tabularize /=` — align selected lines by "="
* `:'<,'>Tabularize /:\zs` — align selected lines by ":" without moving ":"
* `:SaveSession ` — save session with name "session_name"
* `:OpenSession ` — open session with name "session_name"
* `:set hls` && `:nohls` — enable/disable search highlight
* `:set paste` && `:set nopaste` — enable/disable paste mode (to keep indents on paste)
* `:YRGetElem` — view list of prev yanks and paste any
* `:nohls` — disable search results higlight
* `:SudoWrite` — write current file as superuser (substitute user)
* `:Ack keyword` — search for 'keyword' in all files
* `:Acks /keyword/replacement/` — replace 'keyword' in all files
* `:NeoBundleUpdate` — it's a good practice to run it occasionally
* `:AirlineRefresh` — redraw Airline bars
* `set et|retab` — replace tabs with spaces
##### "Split" commands and bindings
* `:sp` — will split the Vim window horizontally. Can be written out entirely as :split
* `:vsp` — will split the Vim window vertically. Can be written out as :vsplit
* `Ctrl-w` — Ctrl-w moves between Vim viewports
* `Ctrl-w j` — moves one viewport down
* `Ctrl-w k` — moves one viewport up
* `Ctrl-w h` — moves one viewport to the left
* `Ctrl-w l` — moves one viewport to the right
* `Ctrl-w =` — tells Vim to resize viewports to be of equal size
* `Ctrl-w -` — reduce active viewport by one line
* `Ctrl-w +` — increase active viewport by one line
* `Ctrl-w q` — will close the active window
* `Ctrl-w r` — will rotate windows to the right
* `Ctrl-w R` — will rotate windows to the left
* `Ctrl-w o` — show this window `only`
##### "Spell Check" commands and bindings
* `:setlocal spell spelllang=ru,en` — turn spell check ON (will suggest to download dics)
* `:set spelllang=ru_ru` — set spell check lang or install dict for a language
* `:set spell!` — turn spell check on/off while working
* `]s` — next misspelled word
* `[s` — prev misspelled word
* `zg` — mark as good word
* `zw` — mark as wrong word
* `zug` and `zuw` — undo word add
* `zG` — ignore word (internal wordlist)
* `z=` — suggest corrections
* `:help spell` — further reading
##### "Macro" commands and bindings
* `q` — start recording macros to register ``
* `q` — stop macros recording
* `()@` — execute macros in register `` (`` times)
* `()@@` — execute last macros once again
* `"p` — paste register `` into the current cursor position
* `:let @=''` — set macros with `` for `` with command
### Color themes
* [`Neverland Vim Theme`](https://github.com/trapd00r/neverland-vim-theme) — default theme for OMG
* [`Vim Colorscheme Gallery`](http://cocopon.me/app/vim-color-gallery/)
* [`OR create your own…`](http://bytefluent.com/vivify/)
### Docs
* [`vim-galore`](https://github.com/mhinz/vim-galore) — 🎓 All things Vim!
* [`A vim Tutorial and Primer`](https://danielmiessler.com/study/vim/)
* [`Vim Text Objects: The Definitive Guide`](http://blog.carbonfive.com/2011/10/17/vim-text-objects-the-definitive-guide/)
### Tips
* For vim/tmux windows/sessions/buffers/panes visual reference see [vim/tmux windows](/images/vim_tmux_windows.png)
* For htop visual reference see [this link](https://codeahoy.com/2017/01/20/hhtop-explained-visually/)
ZSH
===============
#### Plugins
##### ZSH by itself
````
antigen.zsh, zsh-users/zsh-syntax-highlighting, zsh-users/zsh-history-substring-search, gnu-utils, gem, node, npm, osx, python, vagrant, brew
````
##### With git package
````
git, git-extras, git-flow, git-hubflow, git-remote-branch, gitfast
````
##### With Ruby
````
bundler, ruby, rbenv, rake, gem
````
#### Commands
* `ext_ip` — returns external IP address of your machine
* `lan_ip` — returns LAN IP address of your access point
* `rpi_ip` — returns LAN IP address of Raspberry Pi (if found)
* `list_ports` — returns ports list with statuses and services
* `ccat ` — cats file with syntax highlights
* [`z `](https://github.com/rupa/z) — allows you to go to any previously visited dir by pattern
* `r` — convenient alias for `reset` command to clear screen
* ` ↓ ↑` — search for pattern in history (even in substring meaning)
* [`ack `](http://beyondgrep.com/) — for super-quick file or stream search (instead of `grep`)
* `offline` / `online` — (**MacOS only!**) enable/disable networking (nice feature for testing something)
* `spoof_mac` — (**MacOS only!**) a nice function for the airports WiFis (you know what I mean ;) + pay attention to `rig` tool ;)
* `spoof` — a bit more advanced tool (as opposed to my simple function above) + Linux support!
* `b.system.random32` — (WAT?! --> pice of my OMG's bash module) to generate random 32 symbol string (like password or anything)
* `b.system.random32_alphanum` — same as `b.system.random32` but only with alphanumeric symbols only
* `add_pair_user ` / `delete_pair_user ` — add or delete new SSH user for `wemux` (READ "Pairing" section)
* `sys_info` — lists useful info about system/hardware/soft/CPU/memory/core/etc.
* `disk_list` — prints disks list (both in Debian and MacOS)
* `whiteboard .jpg .png` — clean up whiteboard photos ([original gist](https://gist.github.com/lelandbatey/8677901))
* `pushover ` — send message with pushover API (for more details see `pushover` tool in `Tools` section)
* `k` — list directory ([legend and help](https://github.com/supercrabtree/k))
* `tldr ` — simplified man page with examples
* `black_n_white` — useful script to get rid of ANSI Escape sequences could be used like: `cat colourful.patch | black_n_white > bw.patch`
* `hl ` — take a source code from the clipboard, higlight it and put back (MacOS only, great to use with OmniOutliner)
* `mov2gif ` — convert .mov file (screencast filmed with QuickTime or [Screeny](https://itunes.apple.com/ua/app/screeny/id440991524?mt=12) to an animated GIF
* `m` — Swiss Army Knife for macOS! (**MacOS only!**) + [man](https://github.com/rgcr/m-cli)
* `istats` — list MacOS stats (**MacOS only!**) + [man](https://github.com/Chris911/iStats)
* `fuck` — correct your previous console command
* `pru` — process any command output with pure Ruby
* `transfer` — share file publicly using [transfer.sh](https://transfer.sh)
* `curl | jid` — incrementally dig any JSON
* `borg ""` — search for a bash snippet
* `mac help` — to see all the [mac](https://github.com/guarinogabriel/mac-cli/) commands
* `cd ⏎` / `cd ..` / `cd -` — to cd somewhere with an interactive filter
* `echo 'error ok' | h error ok` — [highlight](https://github.com/paoloantinori/hhighlighter) any output with colours (depends on `ack`)
* `gen ` — generate README.md, LICENSE, contributing.md in one command!
* `rtop @` — connect to the remote server to monitor it with [`rtop`](http://www.rtop-monitor.org)
* `echo | clipboard` / `clipboard` — put/get some text to/from the clipboard
* `ktimez convert 16:20 UTC to CEST PST EDT` — convert time zones [see docs](https://github.com/hellais/kill-time-zones)
* `wttr ` — check the weather from the terminal. [see docs](https://github.com/chubin/wttr.in)
* `googler ` or `googler -N ` — Let me google that for you :) [see docs](https://github.com/jarun/googler)
#### Key bindings
**FZY Bindings**
- `CTRL-T` - Paste the selected files and directories onto the command line
- `CTRL-R` - Paste the selected command from history onto the command line
#### MacOS / Debian tools
* [`curl`](http://curl.haxx.se/) — a command line tool for transferring data with URL syntax
* [`tree`](http://mama.indstate.edu/users/ice/tree/) — lists dir structure as ASCII tree
* [`feh`](http://feh.finalrewind.org/) — simple cli-oriented image viewer (not in CLI itself)
* [`ack`](http://beyondgrep.com/) — is a tool like grep, optimized for programmers
* [`pv`](http://www.cyberciti.biz/open-source/command-line-hacks/pv-command-examples/) — aka pipe-viewer — streaming/pipe progress bar for CLI tasks
* [`unar`](http://unarchiver.c3.cx/commandline) — universal one-command unarchiver to unpack them all!
* [`archey`](https://github.com/Gary00/OSXey) — A script for MacOS to display system info (**MacOS only**)
* [`watch`](http://sveinbjorn.org/watch_macosx) — runs command repeatedly, displaying its output
* [`wget`](http://www.gnu.org/software/wget/) — package for retrieving files using HTTP, HTTPS and FTP
* [`figlet`](http://www.figlet.org/) — FIGlet is a program for making large letters out of ordinary text
* [`toilet`](http://caca.zoy.org/wiki/toilet) — The TOIlet project attempts to create a free replacement for the FIGlet utility
* [`aview`](http://aa-project.sourceforge.net/aview/) — aview is an high quality ascii-art image(pnm) browser and animation(fli/flc) player
* [`rig`](http://sourceforge.net/projects/rig/) — RIG stands for Random Identity Generator.
* [`pygmentize`](http://pygments.org/) — a generic syntax highlighter for general use in all kinds of software
* [`k`](https://github.com/supercrabtree/k) — better directory listings for ZSH
* [`youtube-dl`](https://github.com/rg3/youtube-dl/) — small command-line program to download videos from YouTube.com and other video sites
* [`pushover`](https://github.com/jnwatts/pushover.sh) — small tool to send push notification with [pushover.net](https://pushover.net) (if you installed pushover.sh with tools OMG-package)
* [`tldr`](https://github.com/tldr-pages/tldr) — simplified and community-driven man pages
* `pinboard -a ` — search for [Pinboard](https://github.com/badboy/pinboard-cli) entry
* [`multitail`](http://www.vanheusden.com/multitail/) — for monitoring multiple log files
* [`m-cli`](https://github.com/rgcr/m-cli) — Swiss Army Knife for macOS! (**MacOS only**)
* [`jq`](https://stedolan.github.io/jq/) — a lightweight and flexible command-line JSON processor
* [`jid`](https://github.com/simeji/jid) — JSON Incremental Digger
* [`jd`](https://github.com/tidwall/jd) — Interactive JSON Editor
* [`iStats`](https://github.com/Chris911/iStats) — a tool for your mac stats (**MacOS only**)
* [`puma-dev`](https://github.com/puma/puma-dev) — a fast, zero-config development server for MacOS and Linux
* [`fzy`](https://github.com/jhawthorn/fzy) — a better fuzzy finder
* [`thefuck`](https://github.com/nvbn/thefuck) — magnificent app which corrects your previous console command
* [`pru`](https://github.com/grosser/pru) — Pipeable Ruby - forget about grep / sed / awk / wc ... use pure, readable Ruby!
* [`kap`](https://github.com/wulkano/kap) — an open-source screen recorder built with web technology (**MacOS only**)
* `localepurge` — to delete unnecessary locales (**Debian only**)
* [`iterm2term`](https://github.com/hdra/itermcolors2terminator) `.itermcolors` — convert itermcolors to Terminator Color Theme (with Python) then look at `~/.config/terminator/config` (**Debian only**)
* [`borg`](https://github.com/ok-borg/borg) — Search and save shell snippets without leaving your terminal
* [`mac`](https://github.com/guarinogabriel/mac-cli/) — macOS command line tools for developers (**MacOS only**)
* [`enhancd`](https://github.com/b4b4r07/enhancd) — A next-generation cd command with an interactive filter
* [`generate`](https://github.com/generate) — command line tool and developer framework for scaffolding out GitHub projects
* [`cloc`](https://github.com/AlDanial/cloc) — cloc counts blank lines, comment lines, and physical lines of source code in many programming languages
* [`mitmproxy`](https://mitmproxy.org) — an interactive console program that allows traffic flows to be intercepted, inspected, modified and replayed
* [`rtop`](http://www.rtop-monitor.org) — Remote Server Monitoring over SSH
* [`icdiff`](http://www.jefftk.com/icdiff) — improved colored diff
* [`clipboard-cli`](https://github.com/sindresorhus/clipboard-cli) — Access the system clipboard (copy/paste) - cross-platform
* [`hecate`](https://github.com/evanmiller/hecate) — a terminal hex editor unlike any you've ever seen
* [`spoof`](https://github.com/feross/spoof) — Easily spoof your MAC address in OS X & Linux!
* [`keybase`](https://keybase.io) — Crypto for everyone! (see [CLI docs](https://keybase.io/docs/command_line))
* [`googler`](https://github.com/jarun/googler) — Google Search, Google Site Search, Google News from the terminal.
* [`task`](https://taskwarrior.org) — Free and Open Source Software that manages your TODO list from the command line
* [`fkill`](https://github.com/sindresorhus/fkill-cli) — Fabulously kill processes. Cross-platform
* [`ncdu`](https://dev.yorhel.nl/ncdu) — a disk usage analyser with an ncurses interface
* [`wuzz`](https://github.com/asciimoo/wuzz) — Interactive cli tool for HTTP inspection
* [`timg`](https://github.com/hzeller/timg) — Terminal Image Viewer
* [`hotel`](https://github.com/typicode/hotel) — simple process manager for developers (\w proxy auto-config)
* [`hub`](https://hub.github.com) — command-line wrapper for git that makes you better at GitHub (**MacOS only**)
* [`serve`](https://github.com/zeit/serve) — Static file serving and directory listing
* [`httplab`](https://github.com/gchaincl/httplab) — an interactive web server
* [`cheat`](https://github.com/chrisallenlane/cheat) — interactive cheatsheets on the command-line (at the moment in OMG it's **MacOS only**)
#### [MoreUtils](https://joeyh.name/code/moreutils/)
* `chronic` — runs a command quietly unless it fails
* `combine` — combine the lines in two files using boolean operations
* `errno` — look up errno names and descriptions
* `ifdata` — get network interface info without parsing ifconfig output
* `ifne` — run a program if the standard input is not empty
* `isutf8` — check if a file or standard input is utf-8
* `lckdo` — execute a program with a lock held
* `mispipe` — pipe two commands, returning the exit status of the first
* `parallel` — run multiple jobs at once
* `pee` — tee standard input to pipes
* `sponge` — soak up standard input and write to a file
* `ts` — timestamp standard input
* `vidir` — edit a directory in your text editor
* `vipe` — insert a text editor into a pipe
* `zrun` — automatically uncompress arguments to command
#### Color Themes
* [`thayer`](https://github.com/baskerville/iTerm-2-Color-Themes#thayer) iTerm 2 Color Theme (**recommended**)
* [`More themes`](http://iterm2colorschemes.com/)
* [`Even more themes`](https://github.com/zdj/themes)
Dev
===============
### Apps
* [`pgAdmin 4`](https://pgadmin.org) — the most popular and feature rich Open Source administration and development platform for PostgreSQL
* [`Robomongo `](https://robomongo.org) — native and cross-platform MongoDB manager
* [`Redis-Commander`](http://joeferner.github.io/redis-commander/) — a node.js web application used to view, edit, and manage a Redis Database
* [`usql`](https://github.com/knq/usql) — a universal command-line interface for SQL databases
### DB's
* [`Redis`](https://redis.io) — an open source, in-memory data structure store, used as a database, cache and message broker.
* [`PostgreSQL`](https://www.postgresql.org) — The world's most advanced open source database ©
* [`MongoDB`](https://www.mongodb.com) — a document database with the scalability and flexibility that you want with the querying and indexing that you need
Pairing
===============
OMG allows you easily setup pairing sessions to work remotely on the same task. Here is basic workflow to setup and start pairing on your OMG environment
### If you are firewall/router admin ###
````
> add_pair_user test # create new user for remote session with 'name' login
Added user: test
User password: KVBK8CFO@pi$&I3JMrCnP&^exm3F+(80 # save this!!!
> wemux # to login yourself to the wemux session and/or start server
> ext_ip # to print your external IP …… OR ……
> local_ip # to print your local IP
> ssh test@ # to login your pair user on LAN
> ssh test@ # to login your pair user from outside the LAN
> wemux users # to list currently connected users inside wemux session
> delete_pair_user test # delete user with name 'test'
````
Edit user's `.bash_profile` file to change default client mode (default configured mode is: mirror). Other modes could be: pair — to allow user to work with you; rogue — to allow user to create his own windows.
WARNING: DO NOT delete `; exit` command after default mode in user's `.bash_profile` which disconnects him on detachment.
### If you are NOT firewall/router admin ###
Another way to pair with remote user in OMG is to use `tmate` command. Before it you have to quit your current tmux session with `C-d`. After that run `tmate` command and execute `tmate show-messages` to copy/paste SSH line for read-only or full pair modes. Send that command to your mate and… enjoy. To finish session use `C-d` again.
Assorted tips
===============
### Unix diff and patches
````
# Files
> diff -u > patch.diff # create patch
> patch < patch.diff # apply patch
> patch -R < patch.diff # revert patch
# Git
> git format-patch feature --stdout > feature.patch # create a patch file
> git format-patch - # generate separate patch files for the last commits
> git apply --stat feature.patch # git patch info
> git apply --check feature.patch # check patch integrity
> git am --signoff < feature.patch # actually apply patch file to the current working tree
````
### CLI multitasking
````
> nohup & # run process in background
> kill -19 # or C-z on running process to suspend it
> jobs # list background processes
> bg % # resumes execution of a suspended process without bringing it to the foreground AKA kill -18
> fg % # resumes execution of a suspended process by bringing it to the foreground
> kill % # terminate process with number
````
### Simple scheduling
````
> | at 1245 today # run command today at 12:45
> at 1245 oct 10 # schedule list of commands C-d to finish & save
> atq # queue of scheduled commands
> at -c # shows the environment and job at the bottom
> atrm # terminate scheduled command in queue
> pushover "Buy milk!" | at 1830 today # set scheduled push notification (for more details see `pushover` tool in `Tools` section)
````