Skip to content

Instantly share code, notes, and snippets.

@paulsonkoly
Created April 11, 2018 07:34
Show Gist options
  • Save paulsonkoly/7a6493e267cf8186ed373fcf79c9ba70 to your computer and use it in GitHub Desktop.
Save paulsonkoly/7a6493e267cf8186ed373fcf79c9ba70 to your computer and use it in GitHub Desktop.
<style type="text/css"> body { margin: 1em; width: 80%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; } kbd { display: inline-block; margin: 0 .1em; padding: .1em .6em; font-family: Arial,"Helvetica Neue",Helvetica,sans-serif; font-size: 11px; line-height: 1.4; color: #242729; text-shadow: 0 1px 0 #FFF; background-color: #e1e3e5; border: 1px solid #adb3b9; border-radius: 3px; box-shadow: 0 1px 0 rgba(12,13,14,0.2),0 0 0 2px #FFF inset; white-space: nowrap; } table { border-collapse: collapse; width: 100% } th, td { padding: 10px; border-bottom: solid 1px grey; } td:first-child { width: 30% } </style>

Vim stuff to remember

Keystrokes

Keystroke Command Plugin
q: Command window -
Ctrl-s) Parenthesis pair Surround
gc Comment Commentrary
gq Fit text to column -
ga Easy align Easy align
\h-s Stage hunk Gitgutter
\m Add # => to EOL vim-ruby-xmpfilter
\r Run xmpfilter on % vim-ruby-xmpfilter
z= Fix spell error -
gv Reselect -
@: Re-run last command -
Ctrl-a Increase number -
Ctrl-x Decrease number -
  • Command window : edit last line to enter new commands then .
  • Parenthesis pair : close parenthesis for no surround spaces, open parenthesis for surround spaces. Any parenthesis type works.
  • Reselect : reselects last selection.
  • Hunks : \-h followed by
    • s : staging
    • p : preview
    • u : undo
  • Easy align: invoke with selection, or give motion/text object. At prompt * means all matches (optional) followed by separator to align. There are many options to change, ie margins.

Snippets

Snippet Function
def function
defi initialize with automatic instance variables
cla class
module module
req require
reqr require relative
do do block
reqra require 'rspec/autorun'
RS RSpec.descibe do ... end
iiexp it { is_expected.to ... }

Text objects

Mnemonic Text object
r ruby block
t html tags

Jump points

Jump points work with the [ or ] followed by mnemonic. [ jumps backwards, ] jumps forwards.

Mnemonic Target
c git hunk
s spell error

FZF

Command List
Files [PATH] Files
GFiles [OPTS] Git files
GFiles? Git files
Buffers Open buffers
Colors Color schemes
Ag [PATTERN] search result
Lines [QUERY] Lines in loaded buffers
BLines [QUERY] Lines in the current buffer
Tags [QUERY] Tags in the project
BTags [QUERY] Tags in the current buffer
Marks Marks
Windows Windows
Locate PATTERN locate command output
History v:oldfiles and open buffers
History: Command history
History/ Search history
Snippets Snippets
Commits Git commits
BCommits Git commits for the current buffer
Commands Commands
Maps Normal mode mappings
Helptags Help tags
Filetypes File types

Ag doesn't seem to work in $HOME but works fine in sub folders. When needed use :grep and then the quick fix window (:copen) instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment