Skip to content

Commit c7e5612

Browse files
author
Sam Kleinman
committed
DOCS-121: shell line editing and other 2.2 features
1 parent 666de16 commit c7e5612

File tree

4 files changed

+224
-161
lines changed

4 files changed

+224
-161
lines changed

draft/shell-line-editing.txt

Lines changed: 0 additions & 159 deletions
This file was deleted.

source/mongo.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Most examples in the :doc:`MongoDB Manual </contents>` use the
1515
</applications/drivers>` provide similar interfaces to MongoDB.
1616

1717
.. toctree::
18-
:maxdepth: 2
18+
:maxdepth: 1
1919

2020
/tutorial/getting-started-with-the-mongo-shell
2121
/core/shell-types

source/reference/mongo-shell.txt

Lines changed: 108 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ displays some common help methods and commands:
100100
- .. versionadded:: 2.3.1
101101
Print a list of all databases on the server.
102102

103-
Basic Shell Javascript Operations
103+
Basic Shell JavaScript Operations
104104
----------------------------------
105105

106106
The :program:`mongo` shell provides numerous
@@ -206,6 +206,113 @@ For more information on performing operations in the shell, see:
206206

207207
- :doc:`/reference/javascript`
208208

209+
Keyboard Shortcuts
210+
------------------
211+
212+
.. versionchanged:: 2.2
213+
214+
The :program:`mongo` shell provides most keyboard shortcuts similar to
215+
those found in the ``bash`` shell or in Emacs. For some functions
216+
:program:`mongo` provides multiple key bindings, to accommodate
217+
several familiar paradigms.
218+
219+
The following table enumerates the keystrokes supported by the
220+
:program:`mongo` shell:
221+
222+
.. list-table::
223+
:header-rows: 1
224+
225+
* - **Keystroke**
226+
- **Function**
227+
* - Up-arrow
228+
- previous-history
229+
* - Down-arrow
230+
- next-history
231+
* - Home
232+
- beginning-of-line
233+
* - End
234+
- end-of-line
235+
* - Tab
236+
- autocomplete
237+
* - Left-arrow
238+
- backward-character
239+
* - Right-arrow
240+
- forward-character
241+
* - Ctrl-left-arrow
242+
- backward-word
243+
* - Ctrl-right-arrow
244+
- forward-word
245+
* - Meta-left-arrow
246+
- backward-word
247+
* - Meta-right-arrow
248+
- forward-word
249+
* - Ctrl-A
250+
- beginning-of-line
251+
* - Ctrl-B
252+
- backward-char
253+
* - Ctrl-C
254+
- exit-shell
255+
* - Ctrl-D
256+
- delete-char (or exit shell)
257+
* - Ctrl-E
258+
- end-of-line
259+
* - Ctrl-F
260+
- forward-char
261+
* - Ctrl-G
262+
- abort
263+
* - Ctrl-J
264+
- accept-line
265+
* - Ctrl-K
266+
- kill-line
267+
* - Ctrl-L
268+
- clear-screen
269+
* - Ctrl-M
270+
- accept-line
271+
* - Ctrl-N
272+
- next-history
273+
* - Ctrl-P
274+
- previous-history
275+
* - Ctrl-R
276+
- reverse-search-history
277+
* - Ctrl-S
278+
- forward-search-history
279+
* - Ctrl-T
280+
- transpose-chars
281+
* - Ctrl-U
282+
- unix-line-discard
283+
* - Ctrl-W
284+
- unix-word-rubout
285+
* - Ctrl-Y
286+
- yank
287+
* - Ctrl-Z
288+
- Suspend (job control works in linux)
289+
* - Ctrl-H (i.e. Backspace)
290+
- backward-delete-char
291+
* - Ctrl-I (i.e. Tab)
292+
- complete
293+
* - Meta-B
294+
- backward-word
295+
* - Meta-C
296+
- capitalize-word
297+
* - Meta-D
298+
- kill-word
299+
* - Meta-F
300+
- forward-word
301+
* - Meta-L
302+
- downcase-word
303+
* - Meta-U
304+
- upcase-word
305+
* - Meta-Y
306+
- yank-pop
307+
* - Meta-[Backspace]
308+
- backward-kill-word
309+
* - Meta-<
310+
- beginning-of-history
311+
* - Meta->
312+
- end-of-history
313+
314+
315+
209316
Queries
210317
-------
211318

0 commit comments

Comments
 (0)