// vim:ft=javascript require("session.js"); session_auto_save_auto_load = true; require("favicon.js"); require("new-tabs.js"); tab_bar_show_icon = true; tab_bar_show_index = true; url_completion_use_history = true; define_opensearch_webjump("ddg", "ddg.xml"); ///////////////////////////////////////////////////////////////////////////////// // reopening closed buffers var my_closed_buffers = new Array(); //save the URL of the current buffer before closing it interactive("my-close-and-save-current-buffer", "close and save the current buffer for later restore", function(I) { if(my_closed_buffers.length==10){ my_closed_buffers.shift(); // remove older item to save // memory, just save maximum 10 buffers } my_closed_buffers.push(I.buffer.document.URL); kill_buffer(I.buffer); //kill the current buffer }); undefine_key(default_global_keymap, "q"); define_key(default_global_keymap, "q", "my-close-and-save-current-buffer"); interactive("my-open-closed-buffer", "open the last closed buffer", function(I){ // check if the array length > 0 if(my_closed_buffers.length>0){ // load the URL in new windows load_url_in_new_buffer( my_closed_buffers[my_closed_buffers.length - 1], I.window); // remove the first item in the array my_closed_buffers.pop(); } }); define_key(default_global_keymap, "A-W", "my-open-closed-buffer") /////////////////////////////////////////////////////////////////////////////////