showkmovenana 外盘内盘是什么意思思

- 1 year ago
Apple’s latest app Photos is now available for free as part of
for Mac. The new app is the future of photo management from Apple with support for iCloud Photo Library, burst photos, slow-mo and time lapse videos, and more. Here’s how to migrate your photo library to the new Photos app from iPhoto or Aperture, both of which will no longer receive support for software updates going forward:
After pressing Get Started in the blue box as seen above, you have two different options. If you are brand new to photo organizing on a Mac and have never used iPhoto or Aperture before, (or if you don’t want to migrate your iPhoto or Aperture library to Photos), you have the option to import pictures from your digital camera or SD card, drag files directly into Photos, import pictures from the File menu or turn on iCloud Photo Library under preferences.
If you were previously using iPhoto or Aperture, after clicking Getting Started, it detects your iPhoto and Aperture libraries. Select which library you want to use with Photos.
Once you select the library, it presents the option to set up iCloud Photo Library, Apple’s iCloud-based photo and video syncing and storage service. This will allow you to sync all the Photos from your Mac and iOS device to each of your other devices, keeping your edits and albums in sync. It then starts to prepare your library to transition to Photos. If you are not sure about putting all of your pictures into iCloud Photo Library, you can always set that up later under Photos’s Preferenc it’s optional and never required unless you want automatic, cloud-based syncing.
Your old photo libraries will still stay on your Mac if you decide you want to use iPhoto or Aperture for doing something. One might still want to use Aperture because it is a lot more advanced with support for plug-ins and more for professional photographers, with powerful editing tools and built-in support to use external editors. However, if you make any changes in those libraries, they will not automatically sync over to your new Photo library.
Most of the data from iPhoto and Aperture will transfer to the Photos app. For example, Faces is still the same. Also, if you were using star ratings, flags and color labels in iPhoto and Aperture, they are still around in Photos, but they are now keywords and assigned to the photos. You’ll notice your Events from your previous photo library is organized alongside albums in the new Photos app preserving your organization.
That is how you move your iPhoto or Aperture library to the new Photos app. If you haven’t done so, make sure you set up . Let us know if you have moved your library from iPhoto or Aperture to Photos and what your impressions are in the comments!
Connecting to %s
Submit a Tip
Submitting a tip constitutes permission to publish and syndicate. Please view ourText Mode Editors: Vim, Emacs, Nano - Hyperpolyglot
Text Mode Editors: Vim, Emacs, Nano
text editing:
dev tools:
programming:
other topics:
$ vim file
$ emacs file
$ nano file
$ vim +100 file
$ emacs +100 file
$ nano +100 file
$ vim +100 -c 'normal 20|' file
$ emacs +100:20 file
$ nano +100,20 file
$ vim -R file
$ nano -v file
$ vim file1 file2 …only fir use :bn and :bp
:ls to list buffers
$ emacs file1 file2 …window is
if more than two files, one of the pa use C-x o
use C-x b to switch buffers
$ nano file1 file2 …only fir use M-& and M-& to change buffers
$ emacs dir
~/.emacs.el
~/.emacs.d/init.el
$ vim -u NONE
$ emacs -q
M-x emacs-version
M-x redraw-display
insert mode:
insert mode:
C-v u 03c0
C-x 8 RET 03c0 RET
M-x ucs-insert 03c0 RET
C-x 8 RET greek small letter pi RET
M-x ucs-insert greek small letter pi RET
M-x describe-char
M-x keyboard-quit
M-x quoted-insert char
M-x hippie-expand
M-x universal-argument n
M-x universal-argument
use menu or OS
C-x C-=, C-x C--
M-x text-scale-adjust
M-x save-buffers-kill-terminal
C-x C-s C-x C-c
M-x save-buffer
M-x save-buffers-kill-terminal
M-x kill-emacs
normal to insert:
a, i, o, Oback to normal:
M-x mode-name
insert, visual, select, and replace indicated on bottom line
displayed on mode line
M-: major-mode
M-x describe-mode
:map key cmd
M-x global-set-key RET key cmd
before cursor, after cursor
above current line, below current line
M-x what-cursor-position
visual mode:
M-x exchange-point-and-mark
M-x goto-line
M-x goto-char
M-x next-line
M-x previous-line
M-x forward-char
M-x right-char
M-x backward-char
M-x left-char
w bigger word: W
e bigger word: E
M-x forward-word
b bigger word: B
M-x backward-word
M-x move-beginning-of-line
M-x back-to-indentation
M-x move-end-of-line
M-x backward-sentence
M-x forward-sentence
M-x backward-paragraph
M-x forward-paragraph
M-x forward-list
M-x backward-list
M-g TAB 20
M-x move-to-column RET 20
M-x scroll-up
M-x scroll-down
M-r M-r M-r C-l
M-r M-r C-l
M-x scroll-other-window
M-x recenter-top-bottom
M-x move-to-window-line-top-bottom
M-x beginning-of-buffer
M-x end-of-buffer
M-x set-mark-command
M-x mark-whole-buffer
M-x delete-char
M-x delete-backward-char
M-x kill-word
M-x backward-kill-word
M-x zap-to-char
M-x kill-line
C-a C-k C-k
point on line:
point on line:
C-e C-dpoint on following line:
vim calls this yank
visual mode:
M-x kill-region
visual mode:
M-x kill-ring-save
emacs calls this yank
M-x yank-pop
if buffer populated by dd or yy:
M-x flush-lines
M-x keep-lines
M-x clipboard-kill-ring-save
M-x clipboard-yank
M-x clipboard-kill-region
M-x find-file
M-x ido-find-file
:view path
M-x find-file-read-only
M-x read-only-mode
:echo bufname("%")
M-: buffer-file-name
M-x list-buffers
M-x buffer-menu
M-x switch-to-buffer
M-x ido-switch-buffer
:w !diff % -
M-x diff-buffer-with-file
M-x save-buffer
M-x save-some-buffer
M-x revert-buffer
M-x write-file
M-x ido-write-file
:w pathDon't remove the '&,'& vim inserts after the colon.
M-x write-region
M-x insert-file
M-x ido-insert-file
enter minibuffer
use command which prompts for an argument
move cursorleft, right
delete previous char
delete previous word
backward-kill-word
go to beginning of command line
move-beginning-of-line
go to end of command line
move-end-of-line
clear buffer
cancel command
abort-recursive-edit
minibuffer-complete
display completions
minibuffer-completion-help
select completions buffer
switch-to-completions
show history
go back in history
previous-history-element
go forward in history
next-history-element
select first match
ido-exit-minibuffer
select input string
ido-select-text
remove directory from input string
ido-delete-backward-updir
put first match at end of list
ido-prev-match
put last match at front of list
ido-next-match
cycle through work directory historynext, previous
ido-next-work-directory
ido-prev-work-directory
remove current directory from work directory history
ido-forget-work-directory
goto root directory
goto home directory
toggle between substring and prefix matching
ido-toggle-prefix
show matches in separate buffer
ido-completion-help
fall back to switch-buffer
fall back to find-file
open in dired
kill buffer or delete file
ido-delete-file-at-head
create directory
ido-make-directory
M-x repeat
none or M-u when invoked with -u flag
move cursor to break undo chain, then
none or M-e when invoked with -u flag
M-x undo-only
1 version ago, 5 versions ago
1 version hence, 5 versions hence
seconds, minutes, days, hours
:earlier 10s
:earlier 10m
:earlier 10h
:earlier 10d
seconds, minutes, days, hours
:later 10s
:later 10m
:later 10h
:later 10d
previous, next
:earlier lf
M-x view-lossage
M-x isearch-forward
M-x isearch-backward
:%s/pat/repl/g
M-x query-replace
M-x exit-recursive-edit
M-x multi-occur
visual mode:
M-x sort-lines
visual mode:
M-x sort-numeric-fields
whitespace delimited
visual mode:
!sort -k 2
C-u 2 M-x sort-fields
place mark at start of field
M-x sort-columns
visual mode:
M-x reverse-region
M-x count-words
M-x count-matches
gUwuppercase line:
M-x upcase-word
guwlowercase line:
M-x downcase-word
M-x capitalize-word
visual mode:
M-x upcase-region
visual mode:
M-x downcase-region
M-x capitalize-region
indent line
indent region
visual mode:&
syntactically indent line
but electric-indent default in 24.4:
M-x indent-for-tab-command
syntactically indent region
M-x indent-region
replace tabs in region with spaces
M-x untabify
fill paragraph
M-x fill-paragraph
justify paragraph
fill region
M-x fill-region
remove all whitespace on left of region
M-x delete-whitespace-rectangle
vertically align parts in region matching regexp
M-x align-regexp
prepend string to each line of rectangle
C-x r t RET str
M-x string-insert
insert blank rectangle
C-v … I … ESC
M-x open-rectangle
delete rectangle
M-x kill-rectangle
paste rectangle
M-x yank-rectangle
clear rectangle
M-x clear-rectangle
spellcheck buffer
M-x ispell
spellcheck mode
:setlocal spell spelllang=en_us
M-x flyspell-mode
vertical split
M-x split-window-vertically
horizontal split
M-x split-window-right
close other panes
M-x delete-other-windows
close current pane
M-x delete-window
move to next pane
C-w h, C-w ←
C-w l, C-w →
C-w j, C-w ↑
C-w k, C-w ↓
M-x other-window
C-u -1 M-x other-window
widen pane
M-x enlarge-window-horizontally
narrow pane
M-x shrink-window-horizontally
make pane taller
M-x enlarge-window
make pane shorter
rotate panes
balance panes
M-x balance-windows
start recording macro
M-x kmacro-start-macro
end recording macro
M-x kmacro-end-macro
M-x kmacro-end-and-call-macro
run macro on each line in region
M-x apply-macro-to-region-lines
insert counter
C-x C-k C-i
M-x kmacro-insert-counter
set counter
C-x C-k C-c
M-x kmacro-set-counter
set counter format
uses printf-style format specifiers:
C-x C-k C-f
M-x kmacro-set-format
query user to continue
user can respond with: y n q
put user in recursive edit
ascii art mode
M-x picture-mode
return to original mode
M-c picture-mode-exit
av bound to C-p only in picture-mode:
M-x picture-move-up
M-x picture-move-down
M-x picture-forward-column
M-x picture-backward-column
beginning of line
M-x picture-beginning-of-line
beginning of next line
M-x picture-newline
move to next non-blank on current line
C-u M-x picture-tab-search
move under next non-blank on previous line
M-x picture-tab-search
set movement to left after insert
M-x picture-movement-left
set movement to right after insert
M-x picture-movement-right
set movement to up after insert
M-x picture-movement-up
set movement to down after insert
M-x picture-movement-down
set movement to up and left after insert
M-x picture-movement-nw
set movement to up and right after insert
M-x picture-movement-ne
set movement to down and left after insert
M-x picture-movement-sw
set movement to down and right after insert
M-x picture-movement-se
move in direction of movement
M-x picture-motion
move opposite direction of movement
M-x picture-motion-reverse
last nonblank on line
M-x picture-end-of-line
insert blank line
M-x picture-open-line
duplicate line
M-x picture-duplicate-line
replace with space
M-x picture-clear-column
move left and replace with space
M-x picture-backward-clear-column
delete char
M-x picture-delete-char
delete to end of line
M-k picture-clear-line
cycle list item visibilityfolded, children, descendants
M-x org-cycle
cycle buffer outline visibilityoverview, contents, all
M-x org-global-cycle
create table
M-x org-table-create-or-convert-from-region
align table columns
M-x org-table-align
move column at point right
M-x org-table-move-column-right
move column at point left
M-x org-table-move-column-left
insert row above point
M-x org-table-insert-row
insert column left of point
M-x org-table-insert-column
insert horizontal line under point
M-x org-table-insert-hline
delete column at point
M-x org-table-delete-column
sort table by column at point
M-x org-sort
import tab delimited file
M-x org-table-import
export tab delimited file
M-x org-table-export
hyperlinks
visit link
M-x org-open-at-point
export as html
C-c C-e h h
M-x org-export-dispatch h h
C-v u 221e
C-x 8 RET infinity
C-x 8 RET 221e
M-x ucs-insert
C-x RET C-\
M-x set-input-method
M-x list-input-methods
M-x toggle-input-method
M-x describe-input-method
M-x quail-show-key
:w ++enc=utf-8 foo.txt
M-x set-buffer-file-coding-system
M-x set-buffer-file-coding-system RET utf-8-unix
M-x set-buffer-file-coding-system RET utf-8-dos
M-x set-buffer-file-coding-system RET utf-8-mac
M-: buffer-file-coding-system
:h encoding-values
M-x list-coding-systems
help (q to exit help mode)
summarize help commands
M-x help-for-help
:!vimtutor
M-x help-with-tutorial
list key bindings
M-x describe-bindings
describe mode
M-x describe-mode
M-x describe-key-briefly
M-x describe-key
function documentation
:help :func
M-x describe-function
variable documentation
:help 'var'
M-x describe-variable
M-x apropos-commandalso variables, properties, functions, and macros:
M-x apropos
visit help link
M-x Info-follow-nearest-node
help link style
|braced by pipe chars|
underlined and blue
go back a help link, forward a help link
M-x Info-history-back
M-x Info-history-forward
navigate info page hierarchy
M-x Info-next
M-x Info-prev
M-x Info-up
M-x man RET ls
display directory in buffer
:e dirpath
search for files recursively by name
M-x find-name-dired
search for files recursively by contents
M-x find-grep-dired
search for files recursively by contents using ag -Q
install ag and ag.el:
M-x ag-dired
M-x ag-project-direct
search for files recursively by contents using ag
M-x ag-dired-regexp
M-x ag-project-direct-regexp
dired-mode
flag for deletion
M-x dired-flag-file-deletion
M-x dired-mark
mark by regex
M-x dired-mark-files-regexp
unflag or unmark
M-x dired-unmark
unflag or unmark all
M-x dired-unmark-all-marks
delete flagged files
M-x dired-do-flagged-delete
mark autosave files for deletion
M-x dired-flag-auto-save-files
mark twiddle files for deletion
M-x dired-flag-backup-files
visit file
M-x dired-find-file
visit file in other window
M-x dired-find-file-other-window
visit parent directory
M-x dired-up-directory
create new file
M-! touch path
create new directory
M-x dired-create-directory
shell command passes file under point as argument
M-x dired-do-shell-argument
show subdirectory
M-x dired-maybe-insert-subdir
hide subdirectory
M-x dired-hide-subdir
hide all subdirectories
M-x dired-hide-all
toggle sort orderfilename or last modification time
M-x dired-sort-toggle-or-edit
M-x shellinstall multi-term:
M-x multi-term
M-x eshell
:!cmd args …
M-x shell-command
M-x shell-command-on-region
shell-mode
recall prev cmd in history
M-x comint-previous-input
recell next cmd in history
M-x comint-next-input
:grep pattern *
grep directories recursively
:grep -r pattern .
M-x find-grep
M-x kill-grep
grep buffer
install ag and ag.vim:
:Ag -Q pattern
install ag and ag-mode:
M-x ag-project
M-x ag-files
M-x ag-project-files
:Ag pattern
M-x ag-regexp
M-x ag-project-regexp
close all ag-mode buffers
M-x ag-kill-buffers
close other ag-mode buffers
M-x ag-kill-other-buffers
next match in source
M-x next-error-no-select
prev match in source
M-x previous-error-no-select
next match in output not in current file
M-x compilation-next-file
prev match in output not in current file
M-x compilation-previous-file
goto match in source
M-x compile-goto-error
M-x kill-compilation
re-run grep
M-x recompile
quit grep mode
M-x quit-window
create tags file
M-! find . -name '*.c' | etags
load tags file
M-x visit-tags-table
M-x find-tag
goto tag at point
open tag in other window
M-x find-tag-other-window
pop tag stack
M-x pop-tag-mark
show tag stack
show tag signature
tag search
M-x tags-searchM-, to go to next occurrence
diff two files
$ vimdiff file file
diff three files
$ vimdiff file file file
M-x ediff3
switch to other window
ediff-mode
apply hunk
apply hunk in reverse
previous hunk
save first file
save second file
diff buffer with version control
M-x vc-diff
revert buffer using version control
M-x vc-revert
git blame on buffer
install vim-fugitive
M-x vc-annotate
use working directory
install vim-fugitive
install magit
M-x magit-status
prompt for project path
C-u M-x magit-status
magit-mode
refresh status
M-x magit-refresh
M-x magit-stage-item
M-x magit-unstage-item
M-x magit-key-mode-popup-committing
M-x magit-key-mode-popup-pushing
add file to .gitignore
M-x magit-ignore-item
show commit history
M-x magit-key-mode-popup-logging
show git process output
M-x magit-display-process
close status buffer
M-x magit-mode-quit-window
magit-commit-mode
submit commit
M-x git-commit-commit
magit-log-mode
M-x compile
stop compilation
M-x kill-compilation
compilation-mode
M-x recompile
next error in output
prev error in output
next error in different source file
prev error in different source file
set breakpoint
M-x gud-break
send ^C to debugger
M-x comint-interrupt-subjob
evaluate in minibuffer
M-x eval-expression
evaluate sexp and insert result after point
M-x eval-print-last-sexp
evaluate sexp and echo result in minibuffer
M-x eval-last-sexp
evaluate region
M-x eval-region
eval buffer
M-x eval-buffer
:syntax enable
M-x font-lock-mode
:syntax of
M-x font-lock-mode
:setlocal syntax?
M-x describe-mode
face at point
M-x describe-face RET
customize face
:hi Comment ctermfg=darkgray
M-x customize-face
list faces
:help group-name
M-x list-faces-display
list colors
:runtime syntax/colortest.vim
M-x list-colors-display
____________________________
_________________________________
_________________________________
__________________________________________________
_________________________________
How to launch the editor from the command line.
How to launch the editor from the command line with a file loaded into a buffer.
How to launch the editor from the command line with a file loaded and the point on line 100 of the buffer.
How to launch the editor from the command line with a file loaded and the point on column 20 of line 100 of the buffer.
How to get the version of the editor.
It is also possible to determine the version from the command line:
$ vim --version
$ emacs --version
$ nano --version
How to make the editor redraw the display.
How to insert the character 'x' into a document.
One must be in insert mode to insert 'x'.
In normal mode keys are bound to commands. The key 'x' is bound to a command which deletes the character under the point.
In Emacs modes used for editing documents, printing characters are inserting by typing the corresponding keys. All printing characters are bound to the Emacs command self-insert-command.
How to insert a character by its 4 hex digit Unicode point.
How to insert a character by its Unicode name.
When typing the Unicode name tab completion is available.
How to get the Unicode point of the character at the point.
Information about the character including location in the buffer, point, Unicode name, and Unicode category is displayed in a separate buffer.
How to abort the current operation.
In all modes except for ex mode, ESC returns Vim to normal mode.
C-g (M-x keyboard-quit) can be used in two situations in Emacs: (1) if you executed a command and are being prompted for input in the minibuffer, but would like to cancel the command without entering input, and (2) to remove an argument that was set with the C-u (M-x universal-argument) command.
If you've entered part of a multi-keystroke command sequence and wish to cancel, C-g can be used because there aren't any multi-keystroke sequences that end with C-g.
How to insert a literal control character.
The control characters are assigned ASCII codes 0 through 31 and 127.
The control characters can be entered by holding down the control key and then pressing the ASCII character with the same code as the control character plus 64 modulo 128. The control character sequences for ASCII 0 through 31 are C-@, C-A, …, C-Z, C-[, C-\, C-], C-^ and for ASCII 127 is C-?. In particular ESC is C-[. Although the ASCII letters are uppercase, it is not necessary to use the shift key when entering the control sequence.
Both Vim and Emacs will display most of the control characters using caret notation: ^@, ^A, …, ^Z, ^[, ^\, ^], ^^, and ^? for DEL.
Some control key combinations are bound to vim commands. To insert a literal control character, precede the combination with C-v.
Most control key combinations are bound to emacs commands. To insert a literal control character into a buffer, precede the combination with C-q.
How to insert a newline in contexts where the RET key won't insert a newline.
The C-v RET mechanism is necessary when using :map to define a key binding for a command sequence containing a newline.
C-q C-j is necessary to put a newline in the either the search pattern or the replacement string of M-x query-replace.
How to auto complete a partially typed word using other words in the buffer.
M-x hippie-expand will use all open buffers to find candidates to complete the word.
How to repeat a command n times.
When in normal mode, any positive integer can be used to repeat a command multiple times.
When given a universal argument of n, many emacs commands will repeat themselves n times, but the behavior is not universal.
How to repeat a command 4 times.
The C-u command defaults to 4 when no argument is provided.
How to repeat a command 16 times.
Typing C-u n times is the same as setting the universal argument to 4n.
How to adjust the font size. This can only be done when the editors are running as GUI applications.
When using MacVim use ?- and ?= to decrease or increase the font size.
When using gVim change the font via the menu system: Edit | Select Font…
Aquamacs will adjust font size in response to ?= and ?- but GNU Emacs will not.
How to exit the editor. If there are unsaved changes the user is prompted whether to save them.
When there are multiple tabs or panes, :q only closes the current tab or pane.
How to save any unsaved changes to the current buffer and exit.
If there are multiple panes or tabs, vim does not exit but instead closes the current tab or pane.
If there are changes to other buffers, emacs will prompt whether they should be saved.
How to discard all unsaved changes and exit.
If there are other tabs or panes, vim does not exit but instead closes the current tab or pane.
description
Also called command mode. Most keys are bound to commands.
-- INSERT --
Keys insert literal text into the buffer.
-- REPLACE --
Like insert mode but existing text is overwritten.
-- VISUAL --
Region between where cursor was at visual mode entry and current position is highlighted. If an operator is selected it will operate on the highlighted region.
-- SELECT --
Highlights like visual mode. Hitting a printable character deletes selection and enters insert mode.
operator-pending
Entered after executing a command which expects motion keys to be used to define a region.
Cursor is in bottom row of window. Line editor commands can be entered.
Like cmdline mode, except that does not return to normal mode after a command is executed.
_______________________
_______________________
Here are some commonly used Emacs modes:
fundamental-mode
markup modes: HTML mode, LaTeX mode, …
programming language source modes: C mode, Python mode, …
dired-mode
shell-mode
lisp-interaction-mode
Each buffer has a mode which in turn determines the keybindings and the values in variables which customize the behavior of Emacs.
When opening a file for editing in a buffer, Emacs uses the following four techniques in succession to determine the correct mode to use:
in first two lines of file: -*- mode: L-*-
interpreter-mode-alist: a mapping from interpreter names in the shebang to modes
magic-mode-alist: usually empty, but can map regexes applied to text in the file to modes
auto-mode-alist: maps regexes applied to the file name to modes. Usually they identify file type by suffix.
The above diagram documents how one moves between modes
Pressing ESC twice returns vim to normal mode except when it is in ex mode. To exit ex mode type vi.
Normally when vim is in insert, visual, select, or replace mode, the mode name is indicated on the bottom line of the screen between double hyphens. This behave can be turned off or on with the commands
:set noshowmode
:set showmode
How to get documentation for the current mode.
:map defines a binding for normal, visual, and operator-pending modes.
The commands :nmap, :imap, :vmap, :omap, and :cmap can be used to define commands specific to normal, insert, visual, operator-pending, and cmdline mode.
global-set-key changes the key binding for all modes. local-set-key can be used to change the key binding for the current major mode. Also global-unset-key and local-unset-key can be used to make a key have no binding.
Here's an example of how to set a key binding in the emacs startup file init.el.
(global-set-key "\C-cb" 'revert-buffer)
The keys for printing characters are bound to the command self-insert-command.
How to enter insert mode on the current line.
Only Vim has insert mode.
How to enter insert mode by creating a new line either above or below the current line.
Only Vim has insert mode.
How to exit ex mode.
Only Vim has ex mode.
Vim calls the point the cursor.
The minor modes line-number and column-number can be used to display the location of the point in the mode line:
M-x column-number-mode
M-x line-number-mode
Vim does not use the term mark. The documentation refers to it as "the other end of the selection".
How to go to a specific line number. The editors number the lines in the buffer starting from one.
If two arguments are provided separated by a comma, they are taken to be the line and column to which the cursor should be moved.
How to go to a character by its position in the buffer.
How to go down one line.
How to go up one line.
How to go forward one character.
In the typical case of left-to-right scripts, M-x forward-char and M-x right-char are synonyms.
In right-to-left scripts such as Arabic M-x forward-char and M-x left-char are synonyms.
How to go back one character.
How to advance to the beginning of the next word.
How to advance to the end of the current word or the end of the next word if already at the end of the current word.
How to go back by one word.
How to go to the beginning of the current line.
How to go to the first non-whitespace character of the current line.
How to go to the end of the current line.
If the point is mid-sentence, how to go to the start of the sentence. If already at the start of the sentence, how to go to the start of the previous sentence.
By default sentence boundaries are defined by periods . or question marks ? followed by whitespace.
The variable sentence-end can be set to a regular expression to customize the definition of a sentence.
If the point is mid-sentence, how to go the the end of the sentence. If already at the end of the sentence, how to go the end of the following sentence.
If the point is mid-paragraph, go to the start of the paragraph. If the point is already at the start of a paragraph, go to the start of the previous paragraph.
Paragraphs are defined by blank lines.
The behavior can be customized by setting the variables paragraph-start and paragraph-separate to appropriate regular expressions.
If the point is mid-paragraph, go to the end of the paragraph. If the point is already at the end of a paragraph, go to the end of the following paragraph.
How to move the point to column 20 of the current line.
How to scroll the window down the buffer by one page.
A page in this context is defined by how much can be displayed in the window. After scrolling down, none of the content that was previously visible in the window will be visible unless the end of the buffer was reached.
After paging down, the point is placed at the top of the window.
If the end of the buffer is already visible, Emacs beeps and does not move the point.
If the end of the buffer is already visible, Vim will place the last line at the top of the window. If the last line is already at the top of the window Vim beeps.
How to scroll the window up the buffer by one page.
How to scroll the window down the buffer by half a page.
How to scroll the window up the buffer by half a page.
How to scroll the window down in a buffer that isn't currently selected.
If a numeric argument is provided, the window scrolls down by that number of lines. If the numeric argument is negative the window scrolls up.
If there is more that one other window, C-M-v operates on each of them in turn.
How to move the window (the visible portion of the buffer) so that the point is centered. The position of the point in the document does not change.
Repeated use of C-l cycles the point through the positions center, top, and bottom of the window. The portion of the buffer visible in the window changes, not the position of the point in the buffer.
How to move the point to the center of the window (the visible portion of the buffer). The portion of the buffer visible in the window does not change.
M moves to the beginning of the line at the
H to the beginning of the first line at t L to the beginning of the first line at the bottom of the window.
Repeated use M-r cycles the point through the positions center, top, and bottom of the window. The point moves in the buffer, but the portion of the buffer visible in the window does not change.
How to move the point to the beginning of the buffer.
How to move the point to the end of the buffer.
Delete all characters to the end of the line.
The character under the cursor is also deleted. If the point is on the last character of the line it is the only character that will be deleted. The end-of-line character between the current and subsequent line is never deleted.
If the point is already at the end of the line, the following line is joined to the end of the current line. Repeated use of C-k can thus be used to remove several adjacent lines.
How to show the current directory.
How to change the current directory.
A current directory is associated with each buffer. If the buffer is visiting a file the current directory will be the directory containing the file. Other buffers will have a default buffer directory which might be the current directory when emacs was launched or the user home directory. The current directory for any buffer can be changed with M-x cd.
How to open a file for editing. A copy of the file is made in a buffer.
Emacs can edit files on remote machines. The format for specifying a remote file is
/USER@MACHINE:/PATH/TO/FILE
The format for editing a file as root is
/sudo::/PATH/TO/FILE
How to open a file for viewing only.
How to show the complete path name for the file the buffer is visiting.
The minibuffer is a line at the bottom of the frame which Emacs uses to prompt the user for an argument.
The Vim analog of the minibuffer is the command line. It also appears at the bottom of the window. The Vim command line is used for entering a command and all of its arguments, whereas the Emacs minibuffer is generally used for entering a single argument. However, in the case of M-: and M-! that argument is a Lisp expression to be evaluated or a shell command to be evaluated.
Both the Emacs minibuffer and the Vim command line offer tab completion.
The Emacs minibuffer is to a certain extent a buffer like any other. Commands used to navigate and edit other buffers are general available in the minibuffer. It is an error to call a command which solicits an argument via the minibuffer when already in the minibuffer.
The Vim command line is a mode distinct from the other Vim modes: command mode, insert mode, and visual mode. It provides its own set of commands for manipulating the text which appears on the command line.
The Ido library ships with Emacs. It modifies the behavior of the minibuffer when prompting for buffer names and file names.
When the minibuffer is in ido-mode, TAB completion is replaced by a match list which is updated each time a character of input is entered. Hitting RET selects the first item in the match list. The arrow keys can be used to bring a different match up to the front of the list.
The rules for finding matches can be customized. By default matches for which the input string is a prefix are listed first, following by matches for which the input string is a substring.
Another feature of ido-mode is the directory history. This is a list of all the directories that have been visited in ido-mode, sorted by time of most recent visit. The directory history is only relevant when searching for files, not buffers. When searching for files the input is divided by ido-mode into the dirname and basename portion. Older directories in the directory history can be recalled with M-p.
To enable ido-mode, put the following in the emacs startup file:.
(require 'ido)
(ido-mode t)
Vim and Emacs keep a history for each buffer. Every command and edit which modifies the buffer can be undone, and every command that was undone can be redone.
As a buffer is being edited, the history of the buffer can be represented as a sequence of buffer versions connected by the commands which were used to transition between them. If the redo command did not have to be supported, the undo operation could be implemented by deleting the most recent version from the buffer history. The redo command introduces complexity which Vim and Emacs handle in different ways.
Vim represents buffer history with a tree of versions. Each version was created from its parent in the tree by a command. A branch is created when a user undoes one or more edits and then starts to edit a non-leaf version. The undo and redo commands only permit moving between version on the current branch, but Vim provides two mechanisms for recovering versions from other branches. Vim numbers versions sequentially in the order in which they were first created. Providing the :undo command with an integer argument will recover the version. One can also use the g- or g+ commands to move to a version number relative to the current version number. Vim also records a timestamp whenever the buffer is changes, permitting the user to recover buffer version that was current 5 minutes ago.
Emacs keeps its buffer version history in a sequential list. Undo is implemented not by deleting from the end of the list, but by adding a new version to the list created by a command which reverses the command which is being undone. Thus the undo command is a redo when the command that is being undone was itself an undo. However, there is a wrinkle which is necessary to make it possible to go back more than one version. When the undo command is issued multiple times in succession, the commands which reverse the commands being undone are not added to the version history until a command other than undo is made. This other command is said to break the undo chain. The
command is useful when one breaks the undo chain accidentally.
How to repeat the last command.
How to undo the last command.
How to redo a command that was just undone.
When using Emacs one may sometimes break the undo chain accidentally. For example, suppose that one wanted to undo the last 8 changes. If one hit undo 7 times and then accidentally moved the cursor, the undo chain would be broken and Emacs would insert 7 undo commands onto the version history. Now the desired version is 15 versions back. The solution is to use M-x undo-only which skips all versions created by the undo command and the versions that were undone by those undo commands.
Put the buffer into the state it had at the specified version.
Vim numbers all versions of the buffer sequentially from 1 in the order that they were first created.
Put the buffer into the state it had the specified number of versions ago.
When not currently at the most recent version, this command puts the buffer in a state a specified number of versions more recent.
Put the buffer in the state it had the specified amount of time ago.
When not currently at the most recent version, this command puts the buffer in state that it had at the specified amount of time after it had the current buffer state.
How to sort the lines in a region.
How to sort the lines in the region numerically.
How to sort the lines in a region by the second field where the fields are whitespace delimited.
How to sort the lines by a column when the columns are fixed width.
How to reverse the lines in a region.
How to count the number of lines, words, and characters in the document.
How to count the number of strings in a region which match a regular expression.
How to insert a unicode character by name or by 4-hex code.
For Unicode characters outside of the BMP, use a capital U and 8 hex characters. This will enter the code for the Egyptian hieroglyph depicting Ra seated with an ankh:
C-v U 0001305b
How to set the input method.
Input methods provide a more convenient method of entering non-English script. Some input methods remap the keyboard to a configuration used in a non-English speaking country. Other input methods preserve the English QWERTY layout but remap digraphs or combining characters to characters which are otherwise unavailable.
List the available input methods.
Emacs 24.1 has 187 input methods. We describe a select few input methods in the following table:
input method
description
Keys mapped in a manner popularized by the . This keyboard places letters in the traditional locations used by Arabic typewriters.
The positions of the lette there is no input method which allows someone who knows the Arabic letters and the QWERTY keyboard to predict the location of the letters.
cyrillic-jcuken
. This is the most common keyboard layout in Russia.
cyrillic-yawerty
Places letters where phonologically similar Latin letters are found on the QWERTY keyboard. Note the following substitutions:
q:я w:в y:ы u:у [:ш ]:щ f:ф h:х j:й x:ь c:ц v:ж
french-azerty
. This is the most common keyboard layout in France.
french-postfix
QWERTY keyboard. Use ` ' ^ " after vowels to create accented vowels. Use , after c to create ce cedille. Use
and && to create guillemots.
. This is the most common keyboard layout in Germany.
german-posfix
QWERTY keyboard. Use ae, oe, ue, and sz digraphs to create the special letters.
german-prefix
QWERTY keyboard. Use double quote " before vowel to create umlaut. Use " before s to create long s.
Places letters where the corresponding Latin letters are found on the QWERTY keyboard. Note the following substitutions:
w:? y:υ u:θ f:φ h:η j:ξ x:χ c:ψ v:ω
Since 1982 modern Greek only uses the acute accent and the dieresis which can
(acute) and : (dieresis) prefixes. T or : use q or Q. U&& for guillemots.
Ancient Greek is written using the polytonic system which also has a grave accent, circumflex, and rough breathing mark. Unicode provides code points for letters marked with these diacritics, but there is no Emacs input method for them.
QWERTY keyboard. Type in romanji and the characters are converted to kana on the fly. In a second pass some of the kana are converted to kanji on the fly.
spanish-keyboard
A layout close to the layout used in
and Latin America.
spanish-postfix
QWERTY keyboard. Use suffix ' ~ " for accents. Double suffix (n~~ -& n~) to prevent accent. Use !/ and ?/ for upside down punctuation.
spanish-prefix
QWERTY keyboard. Use prefix ' ~ " for accents. Use ~! and ~? for upside down punctuation. Use ~& and ~& for guillemots.
____________________
Used to turn off or re-enable an input method.
Document for an input method. By default the current input method is described.
How to show the function invoked by a key.
In Vim the key is the only name for a function. Here is the notation to see the function bound to a control character:
:help CTRL-B
To see the function bound to a command available in insert mode or visual mode:
:help i_CTRL-O
:help v_CTRL-]
describe-key-briefly shows the functio describe-key shows the function and its documentation.
Emac provides two modes for running external shells: shell-mode and term-mode.
shell-mode buffers behave more like Emacs edit buffers. It is possible to use the movement commands and the edit commands to change a previous command. Hitting RET then runs the modified version of the command. It is also possible to edit the results of the commands, which might be useful when cleaning up a shell session before sharing it. The arrow keys are interpreted by Emacs, but M-p and M-n to recall commands from the command history.
By default, the buffer is *shell*. Use C-u M-x shell to be prompted for a different name.
Commands which expect ANSI escape support do not work in a shell-mode buffer, e.g. fish, less, tmux, vi, or emacs itself. For such commands, one can use term-mode. We describe term-mode as it behaves when the 3rd party library multi-term.el is installed. multi-term.el has these advantages:
Can create more than one terminal buffer.
Control and Meta modified keystrokes are sent to Emacs instead of the terminal process.
No toggle between line mode and character mode.
term-mode under multi-term.el has quirks that can be confusing. For example, M-DELETE is interpreted by Emacs and erases part of the current command in the buffer, yet the characters being erased have already been sent to the shell.
Here is a summary of how keystrokes are handled in shell-mode and term-mode with multi-term.el installed:
shell-mode
term-mode w/ multi-term
current line to process
RET to process
C-c to process
C-c to process
C-c KEY to emacs
C-c KEY to emacs
KEY to emacs
KEY to process
M-KEY to emacs
M-KEY to emacs
C-KEY to emacs
C-KEY to emacs
After performing a grep, the :cw or :copen command can be used to open the matching lines in a quickfix buffer. The quickfix buffer can be used to navigate to locations in the source files.
Vim has a command called :vimgrep which can be used in place of :grep. :vimgrep is an internal command and hence it works on systems where :grep is not installed. It does not have any option flags, however.
Running :grep or :vimgrep puts the results in a single quickfix buffer and hence overwrites the results of a previous search. The variants :lgrep and :lvimgrep put the results in a quickfix buffer which is local to the current buffer. The commands for navigating a local quick fix buffer are different: :ln, :lp, :lnf, :lcl.
Emacs provides commands for running grep and displaying the results in a grep-mode buffer. The advantage of displaying the results in grep-mode is that each match is a hyperlink pointing to the location of the match in its original file. grep-mode is a child mode of compilation-mode.
For the hyperlinks in grep-mode to work, the output of the grep must have file names and line numbers, which is whygrep is invoked with the -nH flags.
When invoking M-x grep, Emacs provides the command that it is going to execute and lets the user edit it. The user must add the search term and the name of the files to search. The user can change the flags to search directories recursively, i.e.grep -r. The user can even use a different command entirely, such as a combination of find and xargs grep. The only difference between M-x grep and M-x find-grep is the default choice for the command and flags. These choices can be changed by setting the grep-command and grep-find-command variables.
There is a command line tool ag which can be used as a replacement for grep -r or find | xargs grep. It has simpler syntax for invocation, and will use version control ignore files such as .gitignore to select the files to be searched intelligently. To install ag, look for a package name such as the_silver_searcher or silvesearcher-ag.
ag-mode, which must be installed, invokes ag with the correct arguments so that the matches can be displayed in an Emacs buffer. Whereas M-x grep and M-x find-grep use a single *grep* buffer and replace the results of a previous search, ag-mode will create a new buffer for each search.
How to create emacs tags for all files in dir1 and dir2 with the suffix .rb:
find dir1 dir2 -name '*.rb' | xargs etags
startup script
~/.emacs.d/init.el
execute file
:source foo.vim
M-x load-file foo.el
execute function
M-: (foo)if interactively callable:
execute command
set variable
(setq i 1)
display variable
delete variable
unlet ino error msg if doesn't exist:
show variables
global variable
let g:foo = 42
script local variable
let s:foo = 42
window local variable
let w:foo = 42
file local variable
buffer local variable
let b:foo = 42
end-of-line comment
echo 1 + 1 " addition
(+ 1 1) ; addition
arithmetic and logic
emacs lisp
falsehoods
logical operators
relational operators
== != & & &= &=
conditional expression
x & 0 ? x : -x
(if (& x 0) x (- x))
arithmetic operators
float division of integers
n * 1.0 / m
emacs lisp
"don't say \"no\""
'don''t say "no"'
in double quote:
concatenate
"Hello, " . "World!"
strlen("lorem")
emacs lisp
dictionaries
emacs lisp
emacs lisp
define function
function Add(x, y)
return a:x + a:y
endfunction
(defun add (x y) (+ x y))
invoke function
echo Add(1, 2)outside of expression:
call Add(1, 2)
delete function
delfunction Add
execution control
emacs lisp
echo "i is positive"
while loop
while i & 10
echo "i is" i
let i += 1
for i in range(0, 9)
echo "i is" i
let i += 1
libraries and namespaces
emacs lisp
show load path
:set runtimepath?
append to load path
load library
runtime foo.vim
key binding
A key binding is a mapping from a keystroke or a sequence of keystrokes to an editor command. When the keybinding is in effect, pressing the keystroke(s) invokes the command.
A keystroke is an operating system event generated when the user presses a key on the keyboard, possibly in combination with a modifier key such as shift, control, or meta.
Sometimes there is no key for meta. Emacs will interpret an ESC-followed-by-keystroke sequence as the meta modified version of the keystroke. In the past there were keyboards that had a key labelled Meta, such as the . On a PC keyboard one will usually use the Alt key as the Meta key. On a Mac keyboard one will use the Option key. It may be necessary to specify this mapping. In the Preferences of the Mac Terminal App, there is a checkbox under Settings and Keyboard.
In this document the notation C-x and M-x are used to denote control and meta modified keystrokes. This is the notation used in Emacs documentation. The nano documentation uses ^X and M-X. The Vim documentation uses CTRL-X and nothing for the meta modified keystrokes which are not used by Vim.
On PC and Mac keyboards the control key is in an awkward position. If one is willing to give up CAPS LOCK one can map that key to Control. On Windows make this edit to the registry:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
If the entry does not exist create it with REG_BINARY. A reboot is necessary.
On a Mac the remapping can be performed by going to System Preferences | Keyboard | Modifier Keys …
In Emacs, most control and meta modified keys are mapped to commands, but a few are prefixes. Prefixes permit mapping commands to multiple keystroke sequences. The normal prefixes are C-c, C-h, C-x, M-g, M-o, and M-s.
A set of key bindings. …and also variables which control how text in the buffer is displayed.
In Emacs the mode is chosen automatically for each buffer when a file is opened for editing or viewing. There is usually no reason to change the mode unless Emacs chose the mode incorrectly.
In Vim the user switches between modes frequently during the course of editing a file. The most commonly used modes are normal mode, insert mode, visual mode, and cmdline mode.
A buffer is a sequence of characters which editors use to read file contents into memory. A change to a buffer is immediately rendered on screen if the portion of the buffer that was changed is currently visible.
Some buffers do not contain the contents of a file. Buffers can be used to display directory contents, help screens, error messages, or shell output.
In Emacs if a buffer is not associated with a file, it is given a name containing asterisks, e.g. *scratch*.
Emacs buffers which contain file contents take their name from the basename of the file. When there are buffer name collisions Emacs appends &1&, &2&, etc. to the ends of the buffer names. The uniqify library can change this behavior to use part of the full pathname instead.
The portion of a screen used to display a buffer. In Emacs the mode line and the fringe are considered part of the window.
An Emacs window is not synonymous with the windows provided by the GUI that Emacs is running in. Emacs calls GUI windows frames.
When the editor is running as a GUI application, the frame is the entire canvas provided by the GUI window. When running as a text-mode application in a terminal, the frame is the entire display of the terminal.
Vim documentation calls the frame the screen.
A line at the bottom of a window with information about the buffer. In Emacs it has the buffer and major mode and minor modes currently in effect.
The left and right edge of the window.
In Emacs the fringe is used to indicate lines that were wrapped or truncated.
visible portion of the buffer
The portion of the buffer that is currently displayed in a window. Sometimes we will simply call this portion of the buffer the window.
echo area/minibuffer
An area at the bottom of the frame which Emacs used to display messages and accept arguments. When it is displaying a message it is called the echo area. When it is accepting an argument it is called the minibuffer. The minibuffer is used to enter a buffer name, a file name, a search term, the full name of an emacs command, a lisp expression, or a shell command.
Vim reserves the bottom of the frame for a similar purpose. When a : is typed, one enters command line mode and the line is called the command line. Commands which require an argument such as a file name usually must be entered on the command line. When not in command line mode Vim will sometimes messages on what the documentation calls the "bottom of the screen". Some of these messages are equivalent to information that Emacs would display in the mode line, not echo area.
point (cursor)
The place in the buffer where characters will be inserted or commands will have effect.
mark (the other end of the selection)
When of the buffer is being selecting, it is defined by the current location of the point and an entity called the mark which was the location of the point when the selection process was started.
A GUI window owned by the editor when the editor is being run as a GUI application.
copy/paste/yank?
registers/kill ring
insert text after current line. Use a line with single period . to exit input mode.
delete first line
delete first 10 lines
delete all lines after 10th
sed '11,$d'
delete current line
delete current and all later lines
switch to editing file, but warn if there are unsaved changes
switch to editing file unconditionally
insert text at front of current line. Use a line with a single period . to exit input mode.
append line 2 to the end of line 1
append following line to end of current line
print current line number and its contents
print line numbers for lines 1 thru 10 and their contents. Also move to line 10
display line numbers with lines
don't display line numbers with lines
print first line and move to it
print line 10 and move to it
sed -n 10p
print lines 1,10 and move to line 10
sed -n 1,10p
quit, but warn if there are unsaved changed
quit unconditionally
insert contents of file after line 10
replace first occurrence of foo with bar on first line
:1s/foo/bar/
1s/foo/bar/
sed 1s/foo/bar/
1s/foo/bar/
replace all non-overlapping occurrences of foo with bar on first line
:1s/foo/bar/g
1s/foo/bar/g
sed 1s/foo/bar/g
1s/foo/bar/g
replace foo with bar on first ten lines
:1,10s/foo/bar/
1,10s/foo/bar/
sed 1,10s/foo/bar/
1,10s/foo/bar/
replace foo with bar on current line
:s/foo/bar/
s/foo/bar/
s/foo/bar/
insert a copy lines 1 thru 10 after line 20
in ed 2nd invocat vim and ex keep history
write all lines to file
write lines 1 thru 10 to file
:1,10w file
1,10w file
1,10w file
Vim has a built-in line editor called ex. Editing in ex mode is like running commands in cmdline mode with the colon :. The only difference is that in ex mode one does not return to normal mode after a command finishes.
One can switch to the line editor with the command Q. Once in the line editor the line editing commands can be issued without the preceding colon. If vim is launched using the name ex then it goes immediately into the line editor. The command vi switches back to the visual editor.
A line editor such as ex or ed is the only way to edit a file when working in a terminal which does not support redrawing the screen.
ed is the only way to edit files on ancient versions of Unix such as . ed may be the only editor installed in a resource constrained environment: the Ubuntu vim executable is 1.8M and the ed executable is 48k.
The stream editor sed can be used to apply line editing commands to files at the command line.
Multiplexer Copy Mode
page half down
This command gives Bash Vim-style bindings when editing a command:
This command gives Zsh Vim-style bindings:
bindkey -v
Multiplexer Copy Mode
Browser Textareas
Chrome (Mac)
Firefox (Mac)
Safari (Mac)
Visual Studio
Eclipse (Mac)
move to beginning of line
move forward char
delete forward char
move to end of line
move backward char
delete backward char
insert tab
delete to end of line
move to next line
move to previous line
reverse search of command history
submit form
transpose characters
move backward word
move forward word
delete backward char
delete backward word
delete forward word
To get Emacs style bindings in Visual Studio, one must go to the Tools | Options… | Environment | Keyboard section and set the additional keyboard mapping scheme to Emacs.
To get Emacs style bindings in Eclipse, one must go to Preferences | General | Keys and set the Scheme to Emacs.
content of this page licensed under}

我要回帖

更多关于 xd股票是什么意思 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信