lambdalisue / jupyter-vim-binding

Jupyter meets Vim. Vimmer will fall in love.
2.1k stars 136 forks source link

mapping ctrl-d to single shift+tab #154

Open lucantan opened 4 years ago

lucantan commented 4 years ago

Summary

in VIM, i am using ctrl-d to enable single shift+tab in insert mode (default vim behavior) is there anyway to enable that?

default ctrl-d currently is to remove all empty spaces of current line and moved the cursor to the beginning of the line

Environment

Behavior

ctrl-d in vim is default to single shift+tab

Expected

expected to have same behavior for ctrl-d in vim and vim_binding in jupyter notebook

Actual

currently when we do ctrl-d, it is deleting all empty spaces and move cursor to beginning of the line

Step by step procedure

  1. Start local Jupyter Notebook by jupyter notebook

  2. Access http://localhost:8888/

  3. create a cell

  4. enter 3 tabs

  5. enter ctrl-d now, the cursor will be moved to beginning of the line

  6. enter 3 tabs

  7. enter shift-tab now the cursor will be moved one tab space to the left

What you have done to solve the issue

added below in ~/.jupyter/custom/custom.js without help

CodeMirror.Vim.map("Ctrl-D", "shift-tab", "insert"); or CodeMirror.Vim.map("C-D", "shift-tab", "insert"); or CodeMirror.Vim.map("Ctrl-D", "Shift-Tab", "insert"); or CodeMirror.Vim.map("C-D", "Shift-Tab", "insert");