您的位置:首页 > 其它

git show/diff 界面操作

2015-11-13 15:03 489 查看
http://blog.csdn.net/n289950578/article/details/24254227

最近发现在git show或者git diff的界面,也就是显示对比差异的时候,无法编辑,很不爽,在网上也找不到类似说明:

        


仔细研究后发现有很多快捷键说明,部分如下:

(区分大小写)

q ,Q:退出显示

H,h:命令帮助(有了这个,其他的都不用看了)

y,k:上一行

e,j,回车:下一行

z,b:上一页

f,space:下一页

小键盘的Home,End,PgUp,PgDn,上,下键对应相应的功能。

今天不小心点击了H显示出来的,很HAPPY,完整如下,点击H/h都可以显示:

                   SUMMARY OF LESS COMMANDS

[html] view
plaincopy





      Commands marked with * may be preceded by a number, N.  

      Notes in parentheses indicate the behavior if N is given.  

  

  h  H                 Display this help.  

  q  :q  Q  :Q  ZZ     Exit.  

 ---------------------------------------------------------------------------  

  

                           MOVING  

  

  e  ^E  j  ^N  CR  *  Forward  one line   (or N lines).  

  y  ^Y  k  ^K  ^P  *  Backward one line   (or N lines).  

  f  ^F  ^V  SPACE  *  Forward  one window (or N lines).  

  b  ^B  ESC-v      *  Backward one window (or N lines).  

  z                 *  Forward  one window (and set window to N).  

  w                 *  Backward one window (and set window to N).  

  ESC-SPACE         *  Forward  one window, but don't stop at end-of-file.  

  d  ^D             *  Forward  one half-window (and set half-window to N).  

  u  ^U             *  Backward one half-window (and set half-window to N).  

  ESC-)  RightArrow *  Left  one half screen width (or N positions).  

  ESC-(  LeftArrow  *  Right one half screen width (or N positions).  

  F                    Forward forever; like "tail -f".  

  r  ^R  ^L            Repaint screen.  

  R                    Repaint screen, discarding buffered input.  

        ---------------------------------------------------  

        Default "window" is the screen height.  

        Default "half-window" is half of the screen height.  

 ---------------------------------------------------------------------------  

  

                          SEARCHING  

  

  /pattern          *  Search forward for (N-th) matching line.  

  ?pattern          *  Search backward for (N-th) matching line.  

  n                 *  Repeat previous search (for N-th occurrence).  

  N                 *  Repeat previous search in reverse direction.  

  ESC-n             *  Repeat previous search, spanning files.  

  ESC-N             *  Repeat previous search, reverse dir. & spanning files.  

  ESC-u                Undo (toggle) search highlighting.  

  &pattern          *  Display only matching lines  

        ---------------------------------------------------  

        Search patterns may be modified by one or more of:  

        ^N or !  Search for NON-matching lines.  

        ^E or *  Search multiple files (pass thru END OF FILE).  

        ^F or @  Start search at FIRST file (for /) or last file (for ?).  

        ^K       Highlight matches, but don't move (KEEP position).  

        ^R       Don't use REGULAR EXPRESSIONS.  

 ---------------------------------------------------------------------------  

  

                           JUMPING  

  

  g  <  ESC-<       *  Go to first line in file (or line N).  

  G  >  ESC->       *  Go to last line in file (or line N).  

  p  %              *  Go to beginning of file (or N percent into file).  

  t                 *  Go to the (N-th) next tag.  

  T                 *  Go to the (N-th) previous tag.  

  {  (  [           *  Find close bracket } ) ].  

  }  )  ]           *  Find open bracket { ( [.  

  ESC-^F <c1> <c2>  *  Find close bracket <c2>.  

  ESC-^B <c1> <c2>  *  Find open bracket <c1>  

        ---------------------------------------------------  

...skipping...  

                  Squeeze multiple blank lines.  

  -S  ........  --chop-long-lines  

                  Chop long lines.  

  -t [tag]  ..  --tag=[tag]  

                  Find a tag.  

  -T [tagsfile] --tag-file=[tagsfile]  

                  Use an alternate tags file.  

  -u  -U  ....  --underline-special  --UNDERLINE-SPECIAL  

                  Change handling of backspaces.  

  -V  ........  --version  

                  Display the version number of "less".  

  -w  ........  --hilite-unread  

                  Highlight first new line after forward-screen.  

  -W  ........  --HILITE-UNREAD  

                  Highlight first new line after any forward movement.  

  -x [N[,...]]  --tabs=[N[,...]]  

                  Set tab stops.  

  -X  ........  --no-init  

                  Don't use termcap init/deinit strings.  

                --no-keypad  

                  Don't use termcap keypad init/deinit strings.  

  -y 
  ....  --max-forw-scroll=
  

                  Forward scroll limit.  

  -z 
  ....  --window=
  

                  Set size of window.  

  -" [c[c]]  .  --quotes=[c[c]]  

                  Set shell quote characters.  

  -~  ........  --tilde  

                  Don't display tildes after end of file.  

  -# 
  ....  --shift=
  

                  Horizontal scroll amount (0 = one half screen width)  

      ........  --no-keypad  

                  Don't send keypad init/deinit sequence.  

      ........  --follow-name  

                  The F command changes files if the input file is renamed.  

  

  

 ---------------------------------------------------------------------------  

  

                          LINE EDITING  

  

        These keys can be used to edit text being entered  

        on the "command line" at the bottom of the screen.  

  

 RightArrow                       ESC-l     Move cursor right one character.  

 LeftArrow                        ESC-h     Move cursor left one character.  

 CNTL-RightArrow  ESC-RightArrow  ESC-w     Move cursor right one word.  

 CNTL-LeftArrow   ESC-LeftArrow   ESC-b     Move cursor left one word.  

 HOME                             ESC-0     Move cursor to start of line.  

 END                              ESC-$     Move cursor to end of line.  

 BACKSPACE                                  Delete char to left of cursor.  

 DELETE                           ESC-x     Delete char under cursor.  

 CNTL-BACKSPACE   ESC-BACKSPACE             Delete word to left of cursor.  

 CNTL-DELETE      ESC-DELETE      ESC-X     Delete word under cursor.  

 CNTL-U           ESC (MS-DOS only)         Delete entire line.  

 UpArrow                          ESC-k     Retrieve previous command line.  

 DownArrow                        ESC-j     Retrieve next command line.  

 TAB                                        Complete filename & cycle.  

 SHIFT-TAB                        ESC-TAB   Complete filename & reverse cycle.  

 CNTL-L                                     Complete filename, list all.  

转载请说明原文地址:http://blog.csdn.net/n289950578/article/details/24254227
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: