diff options
author | Karel Kočí <karel.koci@nic.cz> | 2016-07-29 13:27:53 +0200 |
---|---|---|
committer | Karel Kočí <karel.koci@nic.cz> | 2016-07-29 13:27:53 +0200 |
commit | c82fdf5eeb808e4c6d110bcf59d5eb6519a0524e (patch) | |
tree | 7260876cb00df983b45eb66ae300e926acd90f89 /conkerorrc | |
parent | 0dc880d20f29a604012a3991d5fd64efccc7344a (diff) | |
download | myconfigs-c82fdf5eeb808e4c6d110bcf59d5eb6519a0524e.tar.gz myconfigs-c82fdf5eeb808e4c6d110bcf59d5eb6519a0524e.tar.bz2 myconfigs-c82fdf5eeb808e4c6d110bcf59d5eb6519a0524e.zip |
Add conkeror rc file
Diffstat (limited to 'conkerorrc')
-rw-r--r-- | conkerorrc | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/conkerorrc b/conkerorrc new file mode 100644 index 0000000..fe16952 --- /dev/null +++ b/conkerorrc @@ -0,0 +1,48 @@ +// 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") +///////////////////////////////////////////////////////////////////////////////// |