-;; Time-stamp: <2016-02-18 13:10:11 kmodi>
+;; Time-stamp: <2016-03-02 12:04:39 kmodi>
 
 ;; Eww - Emacs browser (needs emacs 24.4 or higher)
 

(provide 'setup-eww)

;; Default eww key bindings
;; |--------+---------------------------------------------------------------------------------|
;; | Key    | Function                                                                        |
;; |--------+---------------------------------------------------------------------------------|
;; | TAB    | Skip to the next link.                                                          |
;; | SPC    | Scroll text of selected window upward ARG lines; or near full screen if no ARG. |
;; | &      | Browse the current URL with an external browser.                                |
;; | -      | Begin a negative numeric argument for the next command.                         |
;; | 0 .. 9 | Part of the numeric argument for the next command.                              |
;; | B      | Display the bookmarks.                                                          |
;; | C      | Display a buffer listing the current URL cookies, if there are any.             |
;; | H      | List the eww-histories.                                                         |
;; | F      | Toggle font between variable-width and fixed-width.                             |
;; | R      | Readable mode                                                                   |
;; | S      | List eww buffers                                                                |
;; | b      | Add the current page to the bookmarks.                                          |
;; | d      | Download URL under point to `eww-download-directory'.                           |
;; | g      | Reload the current page.                                                        |
;; | l      | Go to the previously displayed page.                                            |
;; | n      | Go to the page marked `next'.                                                   |
;; | p      | Go to the page marked `previous'.                                               |
;; | q      | Quit WINDOW and bury its buffer.                                                |
;; | r      | Go to the next displayed page.                                                  |
;; | t      | Go to the page marked `top'.                                                    |
;; | u      | Go to the page marked `up'.                                                     |
;; | v      | `eww-view-source' (not documented)                                              |
;; | w      | `eww-copy-page-url' (not documented)                                            |
;; | DEL    | Scroll text of selected window down ARG lines; or near full screen if no ARG.   |
;; | S-SPC  | Scroll text of selected window down ARG lines; or near full screen if no ARG.   |
;; | C-M-i  | Skip to the previous link.                                                      |
;; |--------+---------------------------------------------------------------------------------|


    (bind-keys
     :map eww-mode-map
      (":" . eww) ; Go to URL
      ("h" . eww-list-histories) ; View history
      ("w" . modi/eww-copy-url-dwim)
      ("/" . highlight-regexp)
      ("k" . modi/eww-keep-lines))
    ;; Make the binding for `revert-buffer' do `eww-reload' in eww-mode
    (define-key eww-mode-map [remap revert-buffer] #'eww-reload)
    (bind-keys
     :map eww-text-map ; For single line text fields
      ("<backtab>"  . shr-previous-link) ; S-TAB Jump to previous link on the page
