k2nr/ViChrome — Issue #28: have to put in http:// to go to url
Author: rever0f
Created: 2011-12-21 19:56:06+00:00
State: open

first thanks vichrome is the best vim thing i have found for chromium.

when going to a new tab I have to type in the http. rather not. here is the patch file data for mode.coffee to add an option to tabopennew and open with -u flag to open http auto by typing or by mapping.

am a nub at coffeescript/submitting patches and probably a number of other things. i apologize if i offend.

manifest.json mode.js modejs.old model.js
modecoffee.patch modejs.new modejs.patch
[inkling@atreyu k2nr-ViChrome-f984147]$ cat modecoffee.patch
*** coffee/mode.coffee 2011-12-21 14:29:28.839894850 -0500
--- coffee/modecoffee.old 2011-12-21 13:59:28.092983666 -0500
***************
*** 24,34 ****
sources = [
{ class : "CandSourceGoogleSuggest" }
]
- else if opt.eurl
- baseCom += " u"
- dscr += " URL"
- sources = [
- ]
else
sources = [
{ class: "CandSourceGoogleSuggest", num: 3, reqPrefix: true }
--- 24,29 ----
***************
*** 48,54 ****
when "-w" then web = true
when "-h" then history = true
when "-g","g" then search = true
- when "-u","u" then eurl = true
else urls.push arg

if interactive or bookmark or history or web
--- 43,48 ----
***************
*** 57,63 ****
history : history
web : web
search : search
- eurl : eurl
com = "Open" + urls.join(' ')
@enterInteractiveOpen( com, opt )
else if search
--- 51,56 ----
***************
*** 67,80 ****

url = "http://" + g.model.getSetting("searchEngine") + "/search?gcx=c&sourceid=chrome&ie=UTF-8&q=" + word + "&qscrl=1"
g.view.open( url, "_self" )
- else if eurl
- word = ""
- word += "+" + encodeURIComponent(i) for i in urls
- word = word.substr(1)
-
- url = "http://" + word
- g.view.open( url, "_self" )
-

else
g.view.open( urls[0], "_self" )
--- 60,65 ----
***************
*** 88,94 ****
when "-w" then web = true
when "-h" then history = true
when "-g","g" then search = true
- when "-u","u" then eurl = true
else words.push arg

if interactive or bookmark or history or web
--- 73,78 ----
***************
*** 97,103 ****
history : history
web : web
search : search
- eurl : eurl
com = "OpenNewTab " + words.join(' ')
@enterInteractiveOpen( com, opt )
else if search
--- 81,86 ----
***************
*** 109,123 ****
urls = []
urls.push url
chrome.extension.sendRequest {command : "TabOpenNew", args : urls, times : times}, g.handler.onCommandResponse
- else if eurl
- word = ""
- word += "+" + encodeURIComponent(i) for i in words
- word = word.substr(1)
-
- url = "http://" + word
- urls = []
- urls.push url
- chrome.extension.sendRequest {command : "TabOpenNew", args : urls, times : times}, g.handler.onCommandResponse
else
chrome.extension.sendRequest {command : "TabOpenNew", args : words, times : times}, g.handler.onCommandResponse

--- 92,97 ----