flippidippi / sVim

Safari extension with shortcuts similar to Vim
Other
732 stars 52 forks source link

sVim

sVim is a Safari extension with shortcuts similar to Vim. The functionality of sVim will mostly follow the Chrome extension cVim.

Get it

Help

Shortcuts

Keyboard Command Description Mapping Name
Movement
"j" scroll down scrollDown
"k" scroll up scrollUp
"h" scroll left scrollLeft
"l" scroll right scrollRight
"d" scroll half-page down scrollPageDown
"e", "u" scroll half-page up scrollPageUp
"shift+d" scroll full-page down scrollFullPageDown
"shift+e" scroll full-page up scrollFullPageUp
"shift+g" scroll to bottom of the page scrollToBottom
"g g" scroll to top of the page scrollToTop
"0" scroll to the left of the page scrollToLeft
"$" scroll to the right of the page scrollToRight
"g i" go to the first input box goToInput
"g n" find a "next page" link and navigate to it gotoNextPage
"g p" find a "previous page" link and navigate to it gotoPrevPage
Miscellaneous
"r" reload the current tab reloadTab
"z i" zoom page in zoomPageIn
"z o" zoom page out zoomPageOut
"z 0" zoom page to original size zoomOrig
"g r" toggle Safari reader if possible toggleReader
"g v" show sVimrc page showsVimrc
"g ?" open help page in new tab help
Tab Navigation
"g t", "shift+k" navigate to the next tab nextTab
"g shift+t", "shift+j" navigate to the previous tab previousTab
"g 0" go to the first tab firstTab
"g $" go to the last tab lastTab
"g l" go to the last active tab that's still open lastActiveTab
"x" close the current tab quit
"g x shift+t" close the tab to the left of the current tab closeTabLeft
"g x t" close the tab to the right of the current tab closeTabRight
"g x 0" close all tabs to the left of the current tab closeTabsToLeft
"g x $" close all tabs to the right of the current tab closeTabsToRight
"shift+x" open the last closed tab lastClosedTab
"ctrl+shift+x" open the last closed tab in background lastClosedTabBackground
"t" open new tab newTab
"shift+h" go back in history goBack
"shift+l" go forward in history goForward
"shift+," move current tab left moveTabLeft
"shift+." move current tab right moveTabRight
"g u" navigate to parent directory parentDirectory
"g shift+u" navigate to top directory topDirectory
"g d" navigate to parent domain parentDomain
"g h" navigate to home page homePage
Window Navigation
"w" open new window newWindow
"g w" navigate to the next window nextWindow
"g shift+w" navigate to the previous window previousWindow
Modes
"escape", "ctrl+[" enter normal mode normalMode
"i" enter insert mode insertMode
Link Hints
"f" open link in current tab createHint
"shift+f" open link in new background tab createTabbedHint
"ctrl+shift+f" open link in new foreground tab createForegroundHint
Clipboard
"y y" copy current URL to clipboard yankDocumentUrl

sVimrc

sVimrc Commands

sVimrc Settings

Setting Name Description Type Default
preventdefaultesc prevent escape from exiting full screen, if unset then only prevent when not in normal mode boolean true
smoothscroll use smooth scrolling boolean true
fullpagescrollpercent percent of the page to scroll by when using scrollFullPageUp and scrollFullPageDown integer 85
lastactivetablimit number of last active tabs to remember integer 25
lastclosedtablimit number of closed tabs to remember integer 25
scrollduration duration of smooth scrolling integer 30
scrollstep amount of pixels scrolled when using scrollUp and scrollDown integer 60
zoomstep percent to zoom when using zoomPageIn and zoomPageOut integer 10
hintcharacters characters to be used in link hint mode string "asdfgqwertzxcvb"
homeurl url to use as home page string "topsites://"
mapleader key string "\"
newtaburl url to use as the default new tab url string "topsites://"
blacklists disable sVim on the sites matching one of the patterns array []
nextpagetextpatterns a list of regex patterns used to find the "next page" link on the page array ["Next"]
prevpagetextpatterns a list of regex patterns used to find the "prev page" link on the page array ["Previous"]

sVimrc Example

" Settings
set nosmoothscroll
let fullpagescrollpercent = 100
let lastactivetablimit = 50;
let lastclosedtablimit = 50;
let scrollduration = 25
let scrollstep = 65
let zoomstep = 15
let hintcharacters = "1234567890";
let homeurl = "http://google.com";
let mapleader = ","
let newtaburl = "http://google.com"
let blacklists = ["*://example.com/stuff/*", "*://mail.google.com/*"]
let nextpagetextpatterns = ["Next"]
let prevpagetextpatterns = ["Prev(ious)?"]

" Shortcuts
map "q" nextTab
map "shift+q" previousTab
map "<Leader> h" closeTabLeft
map "<Leader> l" closeTabRight
map "down" scrollDown
map "up" scrollUp
map "left" scrollLeft
map "right" scrollRight
map "space" scrollFullPageDown