more README formatting changes. No content changes.
This commit is contained in:
parent
416bd2dbf7
commit
eecd341b8a
190
README.md
190
README.md
@ -184,16 +184,16 @@ ln -s ~/.dotfiles/irb/aprc ~/.aprc
|
||||
|
||||
**Use pry**
|
||||
|
||||
* as irb: 'pry'
|
||||
* as irb: `pry`
|
||||
* as rails console: script/console --irb=pry
|
||||
|
||||
**Pry customizations:**
|
||||
|
||||
* 'clear' command to clear screen
|
||||
* 'sql' command to execute something (within a rails console)
|
||||
* `clear` command to clear screen
|
||||
* `sql` command to execute something (within a rails console)
|
||||
* all objects displayed in readable format (colorized, sorted hash keys) - via awesome_print
|
||||
* a few color modifications to make it more useable
|
||||
* type 'help' to see all the commands
|
||||
* type `help` to see all the commands
|
||||
|
||||
|
||||
### Setup for Git
|
||||
@ -220,16 +220,16 @@ Since the gitconfig doesn't contain the user info, I recommend using env variabl
|
||||
|
||||
**Some of the customizations provided include:**
|
||||
|
||||
* git l - a much more usable git log
|
||||
* git b - a list of branches with summary of last commit
|
||||
* git r - a list of remotes with info
|
||||
* git t - a list of tags with info
|
||||
* git nb - a (n)ew (b)ranch - like checkout -b
|
||||
* git cp - cherry-pick -x (showing what was cherrypicked)
|
||||
* git changelog - a nice format for creating changelogs
|
||||
* `git l` - a much more usable git log
|
||||
* `git b` - a list of branches with summary of last commit
|
||||
* `git r` - a list of remotes with info
|
||||
* `git t` - a list of tags with info
|
||||
* `git nb` - a (n)ew (b)ranch - like checkout -b
|
||||
* `git cp` - cherry-pick -x (showing what was cherrypicked)
|
||||
* `git changelog` - a nice format for creating changelogs
|
||||
* Some sensible default configs, such as improving merge messages, push only pushes the current branch, removing status hints, and using mnemonic prefixes in diff: (i)ndex, (w)ork tree, (c)ommit and (o)bject
|
||||
* Slightly imrpoved colors for diff
|
||||
* git unstage (remove from index) and git uncommit (revert to the time prior to the last commit - dangerous if already pushed) aliases
|
||||
* `git unstage` (remove from index) and `git uncommit` (revert to the time prior to the last commit - dangerous if already pushed) aliases
|
||||
|
||||
|
||||
### Setup for Vim
|
||||
@ -257,117 +257,117 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
|
||||
|
||||
#### Navigation
|
||||
|
||||
* ,z - jump back and forth between last two buffers
|
||||
* Ctrl-j and Ctrl-k to move up and down roughly by functions
|
||||
* Ctrl-o - Old cursor position - this is a standard mapping but very useful, so included here
|
||||
* Ctrl-i - opposite of Ctrl-O (again, this is standard)
|
||||
* `,z` - jump back and forth between last two buffers
|
||||
* `Ctrl-j` and `Ctrl-k` to move up and down roughly by functions
|
||||
* `Ctrl-o` - Old cursor position - this is a standard mapping but very useful, so included here
|
||||
* `Ctrl-i` - opposite of Ctrl-O (again, this is standard)
|
||||
|
||||
#### Marks
|
||||
|
||||
* ,mm - set the next available mark (set a mark with mX where X is a letter, navigate to mark using 'X). Uppercase marks to mark files, lowercase marks to use within a file.
|
||||
* ,ma - clear all marks
|
||||
* ,mh - clear current mark
|
||||
* ,Bt - toggle local anonymous bookmark at current location
|
||||
* ,Bn ,Bp - next and previous anonymous bookmark
|
||||
* ,Bc - clear anonymous bookmarks
|
||||
* `,mm` - set the next available mark (set a mark with `mX` where `X` is a letter, navigate to mark using `'X`). Uppercase marks to mark files, lowercase marks to use within a file.
|
||||
* `,ma` - clear all marks
|
||||
* `,mh` - clear current mark
|
||||
* `,Bt` - toggle local anonymous bookmark at current location
|
||||
* `,Bn` `,Bp` - next and previous anonymous bookmark
|
||||
* `,Bc` - clear anonymous bookmarks
|
||||
|
||||
#### LustyJuggler
|
||||
|
||||
* ,lj - show buffers (LustyJuggler buffer search), just type to fuzzy match a buffer name
|
||||
* `,lj` - show buffers (LustyJuggler buffer search), just type to fuzzy match a buffer name
|
||||
|
||||
#### Rails
|
||||
|
||||
* ,ru - Rails Unittest - synonym for :AV from rails.vim, opens up the corresponding test/spec to the file you're looking for, in a vertical split
|
||||
* ,ss to run specs, ,ll to run a given spec on a line - using my vim-ruby-conque plugin (https://github.com/skwp/vim-ruby-conque)
|
||||
* Cmd-Shift-R to use vim-rspec to run a spec file. Cmd-Shift-L to run from a line (individual it block)
|
||||
* `,ru` - Rails Unittest - synonym for `:AV` from rails.vim, opens up the corresponding test/spec to the file you're looking for, in a vertical split
|
||||
* `,ss` to run specs, `,ll` to run a given spec on a line - using my [vim-ruby-conque plugin](https://github.com/skwp/vim-ruby-conque)
|
||||
* `Cmd-Shift-R` to use vim-rspec to run a spec file. `Cmd-Shift-L` to run from a line (individual it block)
|
||||
|
||||
#### Surround.vim customizations
|
||||
|
||||
* in plugin/settings/surround.vim (this folder contains all my customizations)
|
||||
* the # key now surrounds with #{}, so - ysaw# surround around word #{foo}
|
||||
* = surrounds with <%= erb tag %> and - for <% this %>, so yss= or yss- to wrap code
|
||||
* the `#` key now surrounds with `#{}`, so `ysaw#` (surround around word) `#{foo}`
|
||||
* `=` surrounds with `<%= erb tag %>`; `-` for `<% this %>`. So, `yss=` or `yss-` to wrap code
|
||||
|
||||
#### Search/Code Navigation
|
||||
|
||||
* ,f - instantly Find definition of class (must have exuberant ctags installed)
|
||||
* ,F - same as ,f but in a vertical split
|
||||
* K - GitGrep the current word under the cursor and show results in quickfix window
|
||||
* ,K - GitGrep the current word up to next exclamation point (useful for ruby foo! methods)
|
||||
* Cmd-* - highlight all occurrences of current word (similar to regular * except doesn't move)
|
||||
* ,hl - toggle search highlight on and off
|
||||
* ,gg - GitGrep command line with a quote pretyped (close the quote yourself)
|
||||
* ,gcp - GitGrep Current Partial to find references to the current view partial
|
||||
* // - clear the search
|
||||
* ,q/ - quickfix window with last search (stolen from Steve Losh)
|
||||
* ,qa/ - quickfix Ack last search (Steve Losh)
|
||||
* ,qg/ - quickfix GitGrep last search
|
||||
* ,T - Tag list (list of methods in a class)
|
||||
* `,f` - instantly Find definition of class (must have exuberant ctags installed)
|
||||
* `,F` - same as ,f but in a vertical split
|
||||
* `K` - GitGrep the current word under the cursor and show results in quickfix window
|
||||
* `,K` - GitGrep the current word up to next exclamation point (useful for ruby foo! methods)
|
||||
* `Cmd-*` - highlight all occurrences of current word (similar to regular `*` except doesn't move)
|
||||
* `,hl` - toggle search highlight on and off
|
||||
* `,gg` - GitGrep command line with a quote pretyped (close the quote yourself)
|
||||
* `,gcp` - GitGrep Current Partial to find references to the current view partial
|
||||
* `//` - clear the search
|
||||
* `,q/` - quickfix window with last search (stolen from Steve Losh)
|
||||
* `,qa/` - quickfix Ack last search (Steve Losh)
|
||||
* `,qg/` - quickfix GitGrep last search
|
||||
* `,T` - Tag list (list of methods in a class)
|
||||
|
||||
#### File Navigation
|
||||
|
||||
* ,t - CtrlP fuzzy file selector
|
||||
* ,b - CtrlP buffer selector
|
||||
* Cmd-Shift-P - Clear CtrlP cache
|
||||
* ,jm jump (via CtrlP) app/models
|
||||
* ,jc app/controllers
|
||||
* ,jv app/views
|
||||
* ,jh app/helpers
|
||||
* ,jl lib
|
||||
* ,jp public
|
||||
* ,js spec
|
||||
* ,jf fast_spec
|
||||
* ,jt test
|
||||
* ,jd db
|
||||
* ,jC config
|
||||
* ,jV vendor
|
||||
* ,jF factories
|
||||
* `,t` - CtrlP fuzzy file selector
|
||||
* `,b` - CtrlP buffer selector
|
||||
* `Cmd-Shift-P` - Clear CtrlP cache
|
||||
* `,jm` jump (via CtrlP) to app/models
|
||||
* `,jc` app/controllers
|
||||
* `,jv` app/views
|
||||
* `,jh` app/helpers
|
||||
* `,jl` lib
|
||||
* `,jp` public
|
||||
* `,js` spec
|
||||
* `,jf` fast_spec
|
||||
* `,jt` test
|
||||
* `,jd` db
|
||||
* `,jC` config
|
||||
* `,jV` vendor
|
||||
* `,jF` factories
|
||||
|
||||
#### RSI-reduction
|
||||
|
||||
* Cmd-k and Cmd-d to type underscores and dashes (use Shift), since they are so common in code but so far away from home row
|
||||
* ; instead of : - avoid Shift for common tasks, just hit semicolon to get to ex mode
|
||||
* ,. to go to last edit location instead of '. because the apostrophe is hard on the pinky
|
||||
* Cmd-' and Cmd-" to change content inside quotes
|
||||
* `Cmd-k` and `Cmd-d` to type underscores and dashes (use Shift), since they are so common in code but so far away from home row
|
||||
* `;` in addition to `:` - avoid Shift for common tasks, just hit semicolon to get to ex mode
|
||||
* `,.` to go to last edit location instead of `'.` because the apostrophe is hard on the pinky
|
||||
* `Cmd-'` and `Cmd-"` to change content inside quotes
|
||||
|
||||
#### Tab Navigation
|
||||
|
||||
* Ctrl-H and Ctrl-L - left an right on tabs
|
||||
* Use Cmd-1..Cmd-0 to switch to a specific tab number (like iTerm) - and tabs have been set up to show numbers
|
||||
* `Ctrl-H` and `Ctrl-L` - left an right on tabs
|
||||
* Use `Cmd-1` thru `Cmd-9` to switch to a specific tab number (like iTerm) - and tabs have been set up to show numbers
|
||||
|
||||
#### Window Navigation
|
||||
|
||||
* H L I M - to move left, right, up, down between windows
|
||||
* Q - Intelligent Window Killer. Close window (wincmd c) if there are multiple windows to same buffer, or kill the buffer (bwipeout) if this is the last window into it.
|
||||
* `H` `L` `I` `M` - to move left, right, up, down between windows
|
||||
* `Q` - Intelligent Window Killer. Close window `wincmd c` if there are multiple windows to same buffer, or kill the buffer `bwipeout` if this is the last window into it.
|
||||
|
||||
#### Splits
|
||||
|
||||
* vv - vertical split (Ctrl-w,v)
|
||||
* ss - horizontal split (Ctrl-w,s)
|
||||
* ,qo - open quickfix window (this is where output from GitGrep goes)
|
||||
* ,qc - close quickfix
|
||||
* ,gz - zoom a window to max size and again to unzoom it (ZoomWin plugin, usually C-w,o)
|
||||
* `vv` - vertical split (`Ctrl-w,v`)
|
||||
* `ss` - horizontal split (`Ctrl-w,s`)
|
||||
* `,qo` - open quickfix window (this is where output from GitGrep goes)
|
||||
* `,qc` - close quickfix
|
||||
* `,gz` - zoom a window to max size and again to unzoom it (ZoomWin plugin, usually `C-w,o`)
|
||||
|
||||
#### NERDTree Project Tree
|
||||
|
||||
* Cmd-N - NERDTree toggle
|
||||
* Ctrl-\ - Show current file tree
|
||||
* `Cmd-Shift-N` - NERDTree toggle
|
||||
* `Ctrl-\` - Show current file tree
|
||||
|
||||
#### Utility
|
||||
|
||||
* ,ig - toggle visual indentation guides
|
||||
* ,cf - Copy Filename of current file into system (not vi) paste buffer
|
||||
* ,cc - (Current command) copies the command under your cursor and executes it in vim. Great for testing single line changes to vimrc.
|
||||
* ,yw - yank a word from anywhere within the word (so you don't have to go to the beginning of it)
|
||||
* ,ow - overwrite a word with whatever is in your yank buffer - you can be anywhere on the word. saves having to visually select it
|
||||
* ,w - strip trailing whitespaces
|
||||
* sj - split a line such as a hash {:foo => {:bar => :baz}} into a multiline hash (j = down)
|
||||
* sk - unsplit a link (k = up)
|
||||
* Cmd-Shift-A - align things (type a character/expression to align by, works in visual mode or by itself)
|
||||
* `,ig` - toggle visual indentation guides
|
||||
* `,cf` - Copy Filename of current file into system (not vi) paste buffer
|
||||
* `,cc` - (Current command) copies the command under your cursor and executes it in vim. Great for testing single line changes to vimrc.
|
||||
* `,yw` - yank a word from anywhere within the word (so you don't have to go to the beginning of it)
|
||||
* `,ow` - overwrite a word with whatever is in your yank buffer - you can be anywhere on the word. saves having to visually select it
|
||||
* `,w` - strip trailing whitespaces
|
||||
* `sj` - split a line such as a hash {:foo => {:bar => :baz}} into a multiline hash (j = down)
|
||||
* `sk` - unsplit a link (k = up)
|
||||
* `Cmd-Shift-A` - align things (type a character/expression to align by, works in visual mode or by itself)
|
||||
|
||||
#### Comments
|
||||
|
||||
* Cmd-/ - toggle comments (usually gcc from tComment)
|
||||
* gcp (comment a paragraph)
|
||||
* `Cmd-/` - toggle comments (usually gcc from tComment)
|
||||
* `gcp` (comment a paragraph)
|
||||
|
||||
|
||||
### Included vim plugins
|
||||
@ -386,7 +386,7 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
|
||||
|
||||
#### Git
|
||||
|
||||
* fugitive - "a git wrapper so awesome, it should be illegal..". Try Gstatus and hit '-' to toggle files. Git 'd' to see a diff. Learn more: http://vimcasts.org/blog/2011/05/the-fugitive-series/
|
||||
* fugitive - "a git wrapper so awesome, it should be illegal...". Try Gstatus and hit `-` to toggle files. Git `d` to see a diff. Learn more: http://vimcasts.org/blog/2011/05/the-fugitive-series/
|
||||
* extradite - use :Extradite to get a really great git log browser. Only works when you have a file open.
|
||||
* GitGrep - much better than the grep provided with fugitive; use :GitGrep or hit K to grep current word
|
||||
|
||||
@ -399,7 +399,7 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
|
||||
#### Coding
|
||||
|
||||
* tComment - gcc to comment a line, gcp to comment blocks, nuff said
|
||||
* sparkup - div.foo#bar - hit ctrl-e, expands into <code><div class='foo' id#bar/></code>, and that's just the beginning
|
||||
* sparkup - div.foo#bar - hit `ctrl-e`, expands into `<div class="foo" id="bar"/>`, and that's just the beginning
|
||||
* rails.vim - syntax highlighting, gf (goto file) enhancements, and lots more. should be required for any rails dev
|
||||
* ruby.vim - lots of general enhancements for ruby dev
|
||||
* necomplcache - intelligent and fast complete as you type, and added Command-Space to select a completion (same as Ctrl-N)
|
||||
@ -412,14 +412,14 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
|
||||
|
||||
The things in this section provide new "objects" to work with your standard verbs such as yank/delete/change/=(codeformat), etc
|
||||
|
||||
* textobj-rubyblock - ruby blocks become vim textobjects denoted with 'r'. try var/vir to select a ruby block, dar/dir for delete car/cir for change, =ar/=ir for formatting, etc
|
||||
* textobj-rubyblock - ruby blocks become vim textobjects denoted with `r`. try var/vir to select a ruby block, dar/dir for delete car/cir for change, =ar/=ir for formatting, etc
|
||||
* vim-indentobject - manipulate chunks of code by indentation level (great for yaml) use vai/vii to select around an indent block, same as above applies
|
||||
* argtextobj - manipulation of function arguments as an "a" object, so vaa/via, caa/cia, daa/dia, etc..
|
||||
* textobj-datetime - gives you 'da' (date), 'df' (date full) and so on text objects. useable with all standard verbs
|
||||
* vim-textobj-entire - gives you 'e' for entire document. so vae (visual around entire document), and etc
|
||||
* vim-textobj-rubysymbol - gives you ':' textobj. so va: to select a ruby symbol. da: to delete a symbol..etc
|
||||
* vim-textobj-function - gives you 'f' textobj. so vaf to select a function
|
||||
* next-textobject - from Steve Losh, ability to use 'n' such as vinb (visual inside (n)ext set of parens)
|
||||
* textobj-datetime - gives you `da` (date), `df` (date full) and so on text objects. useable with all standard verbs
|
||||
* vim-textobj-entire - gives you `e` for entire document. so vae (visual around entire document), and etc
|
||||
* vim-textobj-rubysymbol - gives you `:` textobj. so va: to select a ruby symbol. da: to delete a symbol..etc
|
||||
* vim-textobj-function - gives you `f` textobj. so vaf to select a function
|
||||
* next-textobject - from Steve Losh, ability to use `n` such as vinb (visual inside (n)ext set of parens)
|
||||
|
||||
#### Utils
|
||||
|
||||
@ -443,7 +443,7 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
|
||||
* IndexedSearch - when you do searches will show you "Match 2 of 4" in the status line
|
||||
* delimitMate - automatically closes quotes
|
||||
* syntastic - automatic syntax checking when you save the file
|
||||
* repeat - adds '.' (repeat command) support for complex commands like surround.vim. i.e. if you perform a surround and hit '.', it will Just Work (vim by default will only repeat the last piece of the complex command)
|
||||
* repeat - adds `.` (repeat command) support for complex commands like surround.vim. i.e. if you perform a surround and hit `.`, it will Just Work (vim by default will only repeat the last piece of the complex command)
|
||||
* endwise - automatically closes blocks (if/end)
|
||||
* autotag - automatically creates tags for fast sourcecode browsing. use ctrl-[ over a symbol name to go to its definition
|
||||
* matchit - helps with matching brackets, improves other plugins
|
||||
@ -487,9 +487,9 @@ These hacks are Lion-centric. May not work for other OS'es. My favorite mods inc
|
||||
### Other recommended OSX tools
|
||||
|
||||
* NValt - Notational Velocity alternative fork - http://brettterpstra.com/project/nvalt/ - syncs with SimpleNote
|
||||
* Vimium for Chrome - vim style browsing. The 'f' to type the two char alias of any link is worth it.
|
||||
* Vimium for Chrome - vim style browsing. The `f` to type the two char alias of any link is worth it.
|
||||
* QuickCursor - gives you Apple-Shift-E to edit any OSX text field in vim.
|
||||
* brew install autojump - will track your commonly used directories and let you jump there. With the zsh plugin you can just type 'j [dirspec]', a few letters of the dir you want to go to.]'
|
||||
* brew install autojump - will track your commonly used directories and let you jump there. With the zsh plugin you can just type `j [dirspec]`, a few letters of the dir you want to go to.
|
||||
|
||||
|
||||
### Credits
|
||||
@ -515,11 +515,13 @@ Please explore these people's work.
|
||||
|
||||
* Automatic installation setup
|
||||
|
||||
|
||||
### Contributors
|
||||
|
||||
* Initial Version: @skwp
|
||||
* Cleanup, auto installer: @kylewest
|
||||
|
||||
|
||||
### For more tips and tricks
|
||||
|
||||
Follow my blog: http://yanpritzker.com
|
||||
|
Loading…
Reference in New Issue
Block a user