main.js
/**
     * Initialize Vimderbar plugin; setup menu, load vim.js from CodeMirror,
     * setup css and html, hook Document change, init StatusBar
     */
Initialize Vimderbar plugin; setup menu, load vim.js from CodeMirror,
setup css and html, hook Document change, init StatusBar
Initialize Vimderbar plugin ; setup menu load vim . js from CodeMirror setup css and html hook Document change init StatusBar
function init() {
        CommandManager.register("Enable Vimderbar", TOGGLE_VIMDERBAR_ID, toggleActive);
        CommandManager.register("Switch Pane", TOGGLE_ACTIVE_PANE, function () {
            var activePaneId = MainViewManager.getActivePaneId();
            var paneIdList = MainViewManager.getPaneIdList();
            var found = paneIdList.indexOf(activePaneId);
            MainViewManager.setActivePaneId(paneIdList[paneIdList.length - 1 - found]);
        });
        var view_menu = Menus.getMenu(Menus.AppMenuBar.VIEW_MENU);
        if (view_menu) {
            view_menu.addMenuItem(TOGGLE_VIMDERBAR_ID);
        }
        vimderbarPreferences.on("change", preferencesChange);
        CommandManager.get(TOGGLE_VIMDERBAR_ID).setChecked(vimderbarPreferences.get("enabled"));
        ExtensionUtils.loadStyleSheet(module, "styles/vimderbar.css");
        StatusBar.init();
        EditorManager.on("activeEditorChange", handleEditorChange);
        brackets.libRequire(["thirdparty/CodeMirror2/keymap/vim"], function () {
            var mappings = vimderbarPreferences.get("mappings") || [];
            if (mappings) {
                for (var i = 0; i < mappings.length; i++) {
                    CodeMirror.Vim.map(mappings[i].keys, mappings[i].toKeys, mappings[i].mode);
                }
            }
            setExCommands();
        });
    }
function init ( ) { CommandManager . register ( "Enable Vimderbar" , TOGGLE_VIMDERBAR_ID , toggleActive ) ; CommandManager . register ( "Switch Pane" , TOGGLE_ACTIVE_PANE , function ( ) { var activePaneId = MainViewManager . getActivePaneId ( ) ; var paneIdList = MainViewManager . getPaneIdList ( ) ; var found = paneIdList . indexOf ( activePaneId ) ; MainViewManager . setActivePaneId ( paneIdList [ paneIdList . length - 1 - found ] ) ; } ) ; var view_menu = Menus . getMenu ( Menus . AppMenuBar . VIEW_MENU ) ; if ( view_menu ) { view_menu . addMenuItem ( TOGGLE_VIMDERBAR_ID ) ; } vimderbarPreferences . on ( "change" , preferencesChange ) ; CommandManager . get ( TOGGLE_VIMDERBAR_ID ) . setChecked ( vimderbarPreferences . get ( "enabled" ) ) ; ExtensionUtils . loadStyleSheet ( module , "styles/vimderbar.css" ) ; StatusBar . init ( ) ; EditorManager . on ( "activeEditorChange" , handleEditorChange ) ; brackets . libRequire ( [ "thirdparty/CodeMirror2/keymap/vim" ] , function ( ) { var mappings = vimderbarPreferences . get ( "mappings" ) || [ ] ; if ( mappings ) { for ( var i = 0 ; i < mappings . length ; i ++ ) { CodeMirror . Vim . map ( mappings [ i ] . keys , mappings [ i ] . toKeys , mappings [ i ] . mode ) ; } } setExCommands ( ) ; } ) ; }
Initialize Vimderbar plugin; setup menu, load vim.js from CodeMirror,
 setup css and html, hook Document change, init StatusBar
Initialize Vimderbar plugin ; setup menu load vim . js from CodeMirror setup css and html hook Document change init StatusBar
// Register function as command // Switch active pane // Add command to View menu, if it exists // Import vim keymap mode from brackets source