Answers for "repeat current line shortcut jupyter notebook linux"

0

repeat current line shortcut jupyter notebook linux

CodeMirror.keyMap.pcDefault["Ctrl-Down"] = function(cm){

    // get a position of a current cursor in a current cell
    var current_cursor = cm.doc.getCursor();

    // read a content from a line where is the current cursor
    var line_content = cm.doc.getLine(current_cursor.line);

    // go to the end the current line
    CodeMirror.commands.goLineEnd(cm);

    // make a break for a new line
    CodeMirror.commands.newlineAndIndent(cm);

    // filled a content of the new line content from line above it
    cm.doc.replaceSelection(line_content);

    // restore position cursor on the new line
    cm.doc.setCursor(current_cursor.line + 1, current_cursor.ch);
};
Posted by: Guest on March-06-2021

Code answers related to "repeat current line shortcut jupyter notebook linux"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language