Download:
child 4:ca30a5bb823a
parent 2:7493e26a3304
3:b876b898560b
Anton Shestakov <engored@ya.ru>, Sun, 14 Sep 2014 23:07:17 +0900
Split cheatsheets into vim and python, build separately.

4 файлов изменено, 364 вставок(+), 345 удалений(-) [+]
Makefile file | annotate | diff | comparison | revisions
python.rst file | annotate | diff | comparison | revisions
source.rst file | annotate | diff | comparison | revisions
vim.rst file | annotate | diff | comparison | revisions
--- a/Makefile Sun Sep 14 22:33:16 2014 +0900
+++ b/Makefile Sun Sep 14 23:07:17 2014 +0900
@@ -1,7 +1,20 @@
-all: html png
+all: vim python
+
+vim: vim.html vim.png
+
+vim.html:
+ ./rst2cheatsheet.py vim.rst > vim.html
+
+vim.png: vim.html
+ ./html2png.py "file://$(realpath vim.html)" vim.png
-html:
- ./rst2cheatsheet.py source.rst > cheatsheet.html
+python: python.html python.png
+
+python.html:
+ ./rst2cheatsheet.py python.rst > python.html
-png:
- ./html2png.py "file://$(realpath cheatsheet.html)" wallcheat.png
+python.png: python.html
+ ./html2png.py "file://$(realpath python.html)" python.png
+
+clean:
+ rm {vim,python}.{html,png}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/python.rst Sun Sep 14 23:07:17 2014 +0900
@@ -0,0 +1,108 @@
+Column 1
+========
+
+
+Formatting %
+------------
+
+.. %, mapping, conversion, min width, precision, length, type
+
+``%[(<name>)]`` *|* ``[#0- +][<min width 0-9*>][.<0-9*>][<length>]dioxXeEfFgGcrs``
+
+``#``
+ the value conversion will use the “alternate form” (where defined below)
+
+``0``
+ the conversion will be zero padded for numeric values
+
+``-``
+ the converted value is left adjusted (overrides the '0' conversion if both
+ are given)
+
+``␣``
+ (a space) a blank should be left before a positive number (or empty string)
+ produced by a signed conversion
+
+``+``
+ a sign character ('+' or '-') will precede the conversion (overrides a
+ “space” flag)
+
+``d`` ``i``
+ signed integer decimal
+
+``o``
+ signed octal value
+
+``x`` ``X``
+ signed hexadecimal *lowercase*, *uppercase*
+
+``e`` ``E``
+ floating point exponential format *lowercase*, *uppercase*
+
+``f`` ``F``
+ floating point decimal format
+
+``g`` ``G``
+ floating point format. Uses *lowercase*, *uppercase* exponential format if
+ exponent is less than -4 or not less than precision, decimal format
+ otherwise
+
+``c``
+ single character (accepts integer or single character string)
+
+``r``
+ string (converts any Python object using repr())
+
+``s``
+ string (converts any Python object using str())
+
+
+Column 2
+========
+
+
+re Extensions
+-------------
+
+.. raw:: html
+
+ <div style="max-width: 600px;">
+
+``(?iLmsux)``
+ the group matches the empty string; the letters set the corresponding flags
+
+``(?:...)``
+ a non-capturing version of regular parentheses
+
+``(?P<name>...)``
+ the substring matched by the group is accessible via the symbolic group
+ name
+
+``(?P=name)``
+ matches whatever text was matched by the earlier named group named
+ (backreference)
+
+``(?#...)``
+ the contents of the parentheses are simply ignored
+
+``(?=...)``
+ lookahead assertion: matches next, but doesn't consume any of the string
+
+``(?!...)``
+ negative lookahead assertion
+
+``(?<=...)``
+ lookbehind assertion: matches a preceding string
+
+``(?<!...)``
+ negative lookbehind assertion, patterns which start with it may match at
+ the beginning of the string being searched
+
+.. break the list
+
+``(?(id/name)yes-pattern|no-pattern)``
+ sorcery. ``(<)?(\w+@\w+(?:\.\w+)+)(?(1)>)``
+
+.. raw:: html
+
+ </div>
--- a/source.rst Sun Sep 14 22:33:16 2014 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,340 +0,0 @@
-Column 1
-========
-
-
-Moving
-------
-
-`{` `}`
- beginning of *previous*, *next* paragraph
-
-`(` `)`
- beginning of *previous*, *next* sentence
-
-`0` `gm`
- *beginning*, *middle* of line
-
-`^` `$`
- *first*, *last* character of line
-
-`ngg` `nG` `:n`
- line n, default the *first*, *last*
-
-`n%`
- percentage n of the file
-
-`n|`
- column n of current line
-
-`%`
- match of next brace, bracket, comment, #define
-
-`nH` `nL`
- line n from *start*, *bottom* of window
-
-`M`
- middle line of window
-
-
-Folding
--------
-
-`zfm`
- create fold of movement m
-
-`:rfo`
- create fold for range r
-
-`zd` `zE`
- delete fold at cursor, all in window
-
-`zo` `zc` `zO` `zC`
- *open*, *close* one fold; *recursively*
-
-`[z` `]z`
- move to *start*, *end* of current open fold
-
-`zj` `zk`
- move *down*, *up* to *start*, *end* of next fold
-
-
-Editing
--------
-
-`i` `a`
- insert *before*, *after* cursor
-
-`I` `A`
- insert at *beginning*, *end* of line
-
-`gI`
- insert text in first column
-
-`o` `O`
- open a new line *below*, *above* the current line
-
-`cc` `S`
- change current line
-
-`C`
- change to the end of line
-
-`gum` `gUm`
- *lowercase*, *uppercase* text of movement m
-
-
-Copying
--------
-
-`yy` `Y`
- yank current line into register
-
-`p` `P`
- put register *after*, *before* cursor position
-
-`]p` `[p`
- like `p`, `P` with indent adjusted
-
-`gp` `gP`
- like `p`, `P` leaving cursor after new text
-
-
-Column 2
-========
-
-
-Ex Commands
------------
-
-`:wn` `:wN`
- write file and edit *next*, *previous* one
-
-`:n` `:N`
- edit *next*, *previous* file in list
-
-`:r f`
- insert content of file f below cursor
-
-`:r! c`
- insert output of command c below cursor
-
-
-Multiwindowing
---------------
-
-`^Ws` `:split`
- split window in two
-
-`^Wv` `:vsplit`
- vsplit window in two
-
-`^Wn` `:new`
- create new empty window
-
-`^Wo` `:on`
- make current window one on screen
-
-`^Wj` `^Wk`
- move to window *below*, *above*
-
-`^Ww` `^W^W`
- move to window *below*, *above* (wrap)
-
-`^Wq`
- close current window
-
-
-Misc
-----
-
-`K`
- lookup keyword under cursor with man
-
-`:make`
- start make, read errors and jump to first
-
-`:cn` `:cp`
- display the *next*, *previous* error
-
-`:cl` `:cf`
- list all errors, read errors from file
-
-`^L` `^G`
- redraw screen, show filename and position
-
-`g^G`
- show cursor column, line, and character position
-
-`ga`
- show ASCII value of character under cursor
-
-`gf`
- open file which filename is under cursor
-
-
-Insert Mode
------------
-
-`^N` `^P`
- complete text *before*, *after* cursor
-
-`^X^F`
- complete filename
-
-`^X^L`
- complete line
-
-`^X^P`
- extend completion
-
-`^D` `^T`
- shift *left*, *right* one shift width
-
-
-Column 3
-========
-
-
-VIM Regex
----------
-
-``\\_.``
- ``.`` and eol
-
-``*``
- 0 or more
-
-``\+``
- 1 or more
-
-``\=``
- 0 or 1
-
-``\{n,m}``
- from n to m
-
-``\{n}``
- exactly n
-
-``\{n,}``
- at least n
-
-``\{,m}``
- at most m
-
-``\{-}``
- non-greedy ``*``
-
-``\{-n,m}``
- non-greedy ``\{n,m}``
-
-``\{-n,}``
- non-greedy ``\{n,}``
-
-``\{-,m}``
- non-greedy ``\{,m}``
-
-``\v``
- very magic
-
-
-Formatting %
-------------
-
-.. %, mapping, conversion, min width, precision, length, type
-
-``%[(<name>)]`` *|* ``[#0- +][<min width 0-9*>][.<0-9*>][<length>]dioxXeEfFgGcrs``
-
-``#``
- the value conversion will use the “alternate form” (where defined below)
-
-``0``
- the conversion will be zero padded for numeric values
-
-``-``
- the converted value is left adjusted (overrides the '0' conversion if both
- are given)
-
-``␣``
- (a space) a blank should be left before a positive number (or empty string)
- produced by a signed conversion
-
-``+``
- a sign character ('+' or '-') will precede the conversion (overrides a
- “space” flag)
-
-``d`` ``i``
- signed integer decimal
-
-``o``
- signed octal value
-
-``x`` ``X``
- signed hexadecimal *lowercase*, *uppercase*
-
-``e`` ``E``
- floating point exponential format *lowercase*, *uppercase*
-
-``f`` ``F``
- floating point decimal format
-
-``g`` ``G``
- floating point format. Uses *lowercase*, *uppercase* exponential format if
- exponent is less than -4 or not less than precision, decimal format
- otherwise
-
-``c``
- single character (accepts integer or single character string)
-
-``r``
- string (converts any Python object using repr())
-
-``s``
- string (converts any Python object using str())
-
-
-re Extensions
--------------
-
-.. raw:: html
-
- <div style="max-width: 600px;">
-
-``(?iLmsux)``
- the group matches the empty string; the letters set the corresponding flags
-
-``(?:...)``
- a non-capturing version of regular parentheses
-
-``(?P<name>...)``
- the substring matched by the group is accessible via the symbolic group
- name
-
-``(?P=name)``
- matches whatever text was matched by the earlier named group named
- (backreference)
-
-``(?#...)``
- the contents of the parentheses are simply ignored
-
-``(?=...)``
- lookahead assertion: matches next, but doesn't consume any of the string
-
-``(?!...)``
- negative lookahead assertion
-
-``(?<=...)``
- lookbehind assertion: matches a preceding string
-
-``(?<!...)``
- negative lookbehind assertion, patterns which start with it may match at
- the beginning of the string being searched
-
-.. break the list
-
-``(?(id/name)yes-pattern|no-pattern)``
- sorcery. ``(<)?(\w+@\w+(?:\.\w+)+)(?(1)>)``
-
-.. raw:: html
-
- </div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim.rst Sun Sep 14 23:07:17 2014 +0900
@@ -0,0 +1,238 @@
+Column 1
+========
+
+
+Moving
+------
+
+`{` `}`
+ beginning of *previous*, *next* paragraph
+
+`(` `)`
+ beginning of *previous*, *next* sentence
+
+`0` `gm`
+ *beginning*, *middle* of line
+
+`^` `$`
+ *first*, *last* character of line
+
+`ngg` `nG` `:n`
+ line n, default the *first*, *last*
+
+`n%`
+ percentage n of the file
+
+`n|`
+ column n of current line
+
+`%`
+ match of next brace, bracket, comment, #define
+
+`nH` `nL`
+ line n from *start*, *bottom* of window
+
+`M`
+ middle line of window
+
+
+Folding
+-------
+
+`zfm`
+ create fold of movement m
+
+`:rfo`
+ create fold for range r
+
+`zd` `zE`
+ delete fold at cursor, all in window
+
+`zo` `zc` `zO` `zC`
+ *open*, *close* one fold; *recursively*
+
+`[z` `]z`
+ move to *start*, *end* of current open fold
+
+`zj` `zk`
+ move *down*, *up* to *start*, *end* of next fold
+
+
+Editing
+-------
+
+`i` `a`
+ insert *before*, *after* cursor
+
+`I` `A`
+ insert at *beginning*, *end* of line
+
+`gI`
+ insert text in first column
+
+`o` `O`
+ open a new line *below*, *above* the current line
+
+`cc` `S`
+ change current line
+
+`C`
+ change to the end of line
+
+`gum` `gUm`
+ *lowercase*, *uppercase* text of movement m
+
+
+Copying
+-------
+
+`yy` `Y`
+ yank current line into register
+
+`p` `P`
+ put register *after*, *before* cursor position
+
+`]p` `[p`
+ like `p`, `P` with indent adjusted
+
+`gp` `gP`
+ like `p`, `P` leaving cursor after new text
+
+
+Column 2
+========
+
+
+Ex Commands
+-----------
+
+`:wn` `:wN`
+ write file and edit *next*, *previous* one
+
+`:n` `:N`
+ edit *next*, *previous* file in list
+
+`:r f`
+ insert content of file f below cursor
+
+`:r! c`
+ insert output of command c below cursor
+
+
+Multiwindowing
+--------------
+
+`^Ws` `:split`
+ split window in two
+
+`^Wv` `:vsplit`
+ vsplit window in two
+
+`^Wn` `:new`
+ create new empty window
+
+`^Wo` `:on`
+ make current window one on screen
+
+`^Wj` `^Wk`
+ move to window *below*, *above*
+
+`^Ww` `^W^W`
+ move to window *below*, *above* (wrap)
+
+`^Wc`
+ close current window
+
+
+Misc
+----
+
+`K`
+ lookup keyword under cursor with man
+
+`:make`
+ start make, read errors and jump to first
+
+`:cn` `:cp`
+ display the *next*, *previous* error
+
+`:cl` `:cf`
+ list all errors, read errors from file
+
+`^L` `^G`
+ redraw screen, show filename and position
+
+`g^G`
+ show cursor column, line, and character position
+
+`ga`
+ show ASCII value of character under cursor
+
+`gf`
+ open file which filename is under cursor
+
+
+Insert Mode
+-----------
+
+`^N` `^P`
+ complete text *before*, *after* cursor
+
+`^X^F`
+ complete filename
+
+`^X^L`
+ complete line
+
+`^X^P`
+ extend completion
+
+`^D` `^T`
+ shift *left*, *right* one shift width
+
+
+Column 3
+========
+
+
+VIM Regex
+---------
+
+``\\_.``
+ ``.`` and eol
+
+``*``
+ 0 or more
+
+``\+``
+ 1 or more
+
+``\=``
+ 0 or 1
+
+``\{n,m}``
+ from n to m
+
+``\{n}``
+ exactly n
+
+``\{n,}``
+ at least n
+
+``\{,m}``
+ at most m
+
+``\{-}``
+ non-greedy ``*``
+
+``\{-n,m}``
+ non-greedy ``\{n,m}``
+
+``\{-n,}``
+ non-greedy ``\{n,}``
+
+``\{-,m}``
+ non-greedy ``\{,m}``
+
+``\v``
+ very magic