diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-04-20 12:57:07 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-05-02 16:15:17 +0530 |
| commit | b4b6a646b3a7a7f6c7e990c67f208b76f4b5f748 (patch) | |
| tree | 7f18775a63594acf0187668af63766dd72b9f66f /config.lua | |
| parent | 75157006bf6f1176f64e87695343980b16908bb6 (diff) | |
| download | null-browser-b4b6a646b3a7a7f6c7e990c67f208b76f4b5f748.tar.gz null-browser-b4b6a646b3a7a7f6c7e990c67f208b76f4b5f748.zip | |
Refactor + expose managing mode to inside lua
Diffstat (limited to '')
| -rw-r--r-- | config.lua | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -22,6 +22,11 @@ web.set('close_window_when_no_views', true) web.set('user_agent', 'MacOS | Safari - $500 edition') web.set('downloads_dir', os.getenv('HOME') .. '/Downloads/firefox') +-- Switch modes +web.keymap.set_mode('n') -- Start in normal mode +web.keymap.set('n', 'i', function() web.keymap.set_mode('i') end) +web.keymap.set('i', '<esc>', function() web.keymap.set_mode('n') end) + web.event.add_listener('UrlChanged', { callback = function(opts) print('url change', web.inspect(opts)); @@ -35,10 +40,11 @@ local function trim(s) end local function to_url(url) + url = trim(url) if string.match(url, "^https?://") then - return trim(url) + return url end - return "https://" .. trim(url) + return "https://" .. url end -- Search |
