The configuration of Collin Doering
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

211 lines
4.7KB

  1. " {{{ anrxc's vimperator configuration with Emacs bindings
  2. "
  3. " Bindings
  4. " * http://sysphere.org/~anrxc/j/articles/vimperator/index.html
  5. " Todo
  6. " * C-n and C-p in "INSERT (menu)" mode
  7. " * http://code.google.com/p/vimperator-labs/issues/detail?id=36
  8. " License
  9. " * http://creativecommons.org/publicdomain/zero/1.0
  10. " }}}
  11. " {{{ Options
  12. "
  13. " User styles as colorschemes in Vimperator 2 *BROKEN*
  14. " colorscheme zenburn
  15. " Window title
  16. set titlestring=Firefox
  17. " No toolbar and scrollbars by default
  18. "set go=rb
  19. " Editor, C-i invokes it in text fields
  20. set editor=emacsclient
  21. " Command line and search patterns history
  22. set history=10000
  23. " Show pattern matches as you type
  24. "set incsearch
  25. " Hilight previous search pattern matches
  26. "set hlsearch
  27. " Override ignorecase if pattern has uppercase chars
  28. "set smartcase
  29. " Show the tab bar only if more then one tab is open
  30. set showtabline=never
  31. " Focus content after a page has loaded *DISALED* - does not work with pentadactyl
  32. "set focuscontent
  33. " Show destination links in 1=status line, 2=command line
  34. set showstatuslinks=command
  35. " Show completions and use AwesomeBar (+search plugins)
  36. set complete=sl
  37. " *DISABLED* - does not work with pentadactyl
  38. "set wildoptions=auto
  39. " Ex commands output in a new tab by default (prefs, addons...)
  40. set newtab=all
  41. " Internal default search engine is ignored, plugins are used
  42. "set ds=yubnub
  43. " }}}
  44. " {{{ Key bindings
  45. " - Emacs GTK key-theme and FF already provide bindings for input fields
  46. "
  47. " M-x enters command mode
  48. noremap <A-x> :
  49. noremap <A-!> :!
  50. " Emacs navigation in command line and insert mode
  51. cmap <C-n> <Tab>
  52. cmap <C-p> <S-Tab>
  53. cmap <C-f> <Right>
  54. cmap <C-b> <Left>
  55. cmap <C-j> <CR>
  56. noremap <C-j> <CR>
  57. inoremap <C-j> <CR>
  58. inoremap <C-n> <Down>
  59. inoremap <C-p> <Up>
  60. inoremap <C-f> <Right>
  61. inoremap <C-b> <Left>
  62. " Use C-f and C-b for tab browsing
  63. noremap <C-f> <C-n>
  64. noremap <C-b> <C-p>
  65. " Use C-a and C-e to jump to first/last tab
  66. "noremap <C-a> g0
  67. "noremap <C-e> g$
  68. "
  69. " Or use them to go to the absolute left/right of the document
  70. noremap <C-a> 0
  71. noremap <C-e> $
  72. " Use C-p and C-n for up/down
  73. noremap <C-p> 2k
  74. noremap <C-n> 2j
  75. " Use C-v and M-v for jump scrolling
  76. noremap <C-v> <C-d>
  77. noremap <A-v> <C-u>
  78. " Goto the top of the document with M-<
  79. noremap <A-<> gg
  80. " Goto the end of the document with M->
  81. noremap <A->> G
  82. " Use C-s and C-r for searching (n/N for next/prev as in less)
  83. noremap <C-s> /
  84. noremap <C-r> ?
  85. " Copy the current URL to the clipboard with M-w
  86. noremap <A-w> y
  87. "
  88. " Copy selected text to the clipboard with C-w
  89. noremap <C-w> Y
  90. " Paste the current clipboard selection to a new buffer with C-y
  91. noremap <C-y> P
  92. " Use current URL as a start for a new location with C-x C-v
  93. noremap <C-x><C-v> O
  94. " C-g as cancel (C-q is stop)
  95. cmap <C-g> <Esc>
  96. imap <C-g> <Esc>
  97. noremap <C-g> <Esc>
  98. " Avoid Find dialog when canceling a started command, C-x C-g
  99. noremap <C-x><C-g> <Esc>
  100. "
  101. " Avoid quit on C-q, and it's more suitable for Stop here
  102. noremap <C-q> :stop<CR>
  103. " Kill the buffer with C-x k
  104. noremap <C-x>k d
  105. " Undo close tab with C-_ (also with C-Shift-t, as C-t is new tab)
  106. noremap <C-_> u
  107. " Exit and save the session with C-x C-c
  108. noremap <C-x><C-c> ZZ
  109. " Buffer lists with C-x b and C-x C-b
  110. noremap <C-x>b b
  111. noremap <C-x><C-b> B
  112. " Open a link in a new tab with C-x t
  113. " Open a link in the current tab with C-x l
  114. noremap <C-x>t :t<SPACE>
  115. noremap <C-x>l :o<SPACE>
  116. " Open hints in new tab by default (switch roles of f and F)
  117. "noremap f F
  118. "noremap F f
  119. " Switch hints to letter "j", for right hand usage
  120. noremap j f
  121. noremap J F
  122. "
  123. " Extended hint mode with M-j
  124. " ; - focus link, a - save, y - copy link, O - :open query, T - for :tabopen ...
  125. noremap <A-j> ;
  126. " We can now also use F for Shift+b/f as back/forward
  127. noremap F L
  128. noremap B H
  129. " Back with Backspace as well
  130. map <BS> H
  131. " Use C-h i to start help
  132. noremap <C-h>i :help<CR>
  133. " Record a key sequence into a macro with C-x (
  134. noremap <C-x>( q
  135. " Play a macro with C-x e
  136. noremap <C-x>e @
  137. " Set a mark at the cursor with C-x r m
  138. noremap <C-x>rm m
  139. " Jump to the mark in the current buffer with C-x r b
  140. noremap <C-x>rb '
  141. " C-v was pass-next, remap to bind with default keys
  142. noremap <C-d> <C-v>
  143. "
  144. " C-x C-f starts the "Open File" dialog (C-x C-s is Save)
  145. map <C-x><C-f> <C-d><C-o>
  146. " {{{ Javascript functions
  147. "
  148. " Show the Feed and Bookmark buttons on the statusbar
  149. javascript <<EOF
  150. (function(){
  151. var statusPanel = document.createElement("statusbarpanel");
  152. statusPanel.setAttribute("id", "buttons-panel-clone");
  153. statusPanel.appendChild(document.getElementById("feed-button"));
  154. statusPanel.appendChild(document.getElementById("star-button"));
  155. statusPanel.firstChild.setAttribute("style", "padding: 0; max-height: 16px;");
  156. document.getElementById("status-bar")
  157. .insertBefore(statusPanel, document.getElementById("security-button"));
  158. })();
  159. EOF
  160. " }}}