Skip to content

Instantly share code, notes, and snippets.

@endaaman
Last active June 13, 2017 23:08
Show Gist options
  • Save endaaman/d8cc9f70560fcde77e6d1729b3695cea to your computer and use it in GitHub Desktop.
Save endaaman/d8cc9f70560fcde77e6d1729b3695cea to your computer and use it in GitHub Desktop.
set smoothscroll
map l nextTab
map h previousTab
map J scrollPageDown
map K scrollPageUp
map <C-n> nextTab
map <C-p> previousTab
copyTitle -> {{
var title = document.title
document.addEventListener('copy', function(e) {
e.preventDefault()
e.clipboardData.setData('text', title)
document.removeEventListener('copy', arguments.callee, false)
})
document.execCommand('copy')
Status.setMessage('Copied: ' + title)
}}
copyMdLink -> {{
var title = document.title
var url = location.href
var text = '[' + title + '](' + url + ')'
document.addEventListener('copy', function(e) {
e.preventDefault()
e.clipboardData.setData('text', text)
document.removeEventListener('copy', arguments.callee, false)
})
document.execCommand('copy')
Status.setMessage('Copied: ' + text)
}}
map yt :call copyTitle<CR>
map ym :call copyMdLink<CR>
let blacklists = ["https://secure.sakura.ad.jp/*","http://localhost/*","http://enda.dev/*","http://live.nicovideo.jp/*"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment