[elinks-dev] Re: Doing Crazy stuff.
myself at ligesh.com
Fri Jun 23 23:12:29 PDT 2006
On Fri, Jun 23, 2006 at 08:53:42PM +0000, Miciah Dashiel Butler Masters wrote:
> function select_history_item_in_vim()
> local url
> local f
> local fn = elinks_home.."goto_url"
> os.execute("vim "..elinks_home.."globhist")
> f = io.open(fn, "r")
> if f then url = f:read() f:close() os.remove(fn) end
> if url then return "goto_url", url end
> Then add something like
> vimhist = select_history_item_in_vim,
> to console_hook_functions (and make sure that you define
> select_history_item_in_vim above that!) so that you enter 'vimhist' in
> the Lua console, or add:
> bind_key("main", "Ctrl-v", select_history_item_in_vim)
I think I have wasted my time not switching to elinks earlier. I never thought the above thing would be possible. I just asked as a mere formality. I forgot that you store the global history in a file, and all I needed was to read it using Vim. Yes, that was stupid of me not to think of it. I have integrated vim, and it is really wonderful, finally to view and manage your history the proper way. I was planning on writing my own browser in Vim, but I think this is much much more than sufficient.
Now I am wondering: can't motions be made into Lua? Is it possible to make the motion system Lua Configurable? I think that would be the real solution, rather than hacking multiple motions. As I said, Elinks is a 2 dimensional system, and it is imperative that the motion be extremely efficient. I actually like 'lynx' in a way. I mean, it is horrible in too many ways, but since it renders everything linearly, it has a certain pattern, and and moving around is sort of straightforward. But in the elinks, the complexity of its rendering makes motion a bit confusing.
> bind_key ("main", "Ctrl-g",
> function ()
> function (url)
> return "goto_url",
This is better. The currently solution is not as efficient, since all I do search in google, and nothing else. So typing a g before the search string in the url box is irritating. The above solution is ideal, and also, it means, I can create my own dialog boxes to do anything I want.
:: Ligesh :: http://ligesh.com
More information about the elinks-dev