FS#195 - emacs-like search does not work (incremental search and always_insert_mode bug?)
Attached to Project:
Uzbl
Opened by eric craven (ecraven) - 2010-01-14 01:41:58 PM
Last edited by Anonymous Submitter - 2010-01-20 02:18:13 AM
Opened by eric craven (ecraven) - 2010-01-14 01:41:58 PM
Last edited by Anonymous Submitter - 2010-01-20 02:18:13 AM
|
Details@bind <Ctrl>s<search:>* = search %s
@bind <Ctrl>r<search:>* = search_reverse %s these bindings only search for the *first* character entered, all the rest is taken as normal input. i am trying to create a configuration file for a emacs-like bindings config attached |
This task depends upon
Closed by Anonymous Submitter
2010-01-20 02:18:13 AM
Reason for closing: Fixed
Additional comments about closing: Fixed in my latest master, sending pull request to Dieter.
2010-01-20 02:18:13 AM
Reason for closing: Fixed
Additional comments about closing: Fixed in my latest master, sending pull request to Dieter.
# all settings are optional. you can use uzbl without any config at all (but it won't do much)
set prefix = /usr
# === Shortcuts / Aliases ===================================================
# request BIND <keycmd> = <command>
set bind = request BIND
# request MODE_CONFIG <mode> <key> = <value
set mode_config = request MODE_CONFIG
# request TOGGLE_MODES <mode1> <mode2> ... <moden>
set toggle_modes = event TOGGLE_MODES
# request ON_EVENT <EVENT_NAME> <command>
set on_event = request ON_EVENT
# request PROGRESS_CONFIG <key> = <value>
set progress = request PROGRESS_CONFIG
# request MODMAP From To
set modmap = request MODMAP
# request IGNORE_KEY <glob>
set ignore_key = request IGNORE_KEY
# request MODKEY_ADDITION <key1> <key2> <keyn> <result>
set modkey_addition = request MODKEY_ADDITION
set set_mode = set mode =
set set_status = set status_message =
set shell_cmd = sh -c
# Spawn path shortcuts. In spawn the first dir+path match is used in "dir1:dir2:dir3:executable"
set scripts_dir = $XDG_DATA_HOME/uzbl:@prefix/share/uzbl/examples/data/uzbl:scripts
# Javascipt helpers.
set jsh = js var run=Uzbl.run; function get(k){return run("print \\\@"+k)}; function set(k, v) {run("set "+k+" = "+v)};
# === Handlers ===============================================================
set download_handler = spawn @scripts_dir/download.sh
set cookie_handler = talk_to_socket $XDG_CACHE_HOME/uzbl/cookie_daemon_socket
set scheme_handler = sync_spawn @scripts_dir/scheme.py
# New window handler options
#set new_window = sh 'echo uri "$8" > $4' # open in same window
set new_window = sh 'uzbl-browser -u $8' # equivalent to the default behaviour
# Load start handlers
@on_event LOAD_START @set_status <span foreground="khaki">wait</span>
# Load commit handlers
@on_event LOAD_COMMIT @set_status <span foreground="green">recv</span>
@on_event LOAD_COMMIT script @scripts_dir/scroll-percentage.js
# Reset the keycmd on navigation
@on_event LOAD_COMMIT @set_mode
# Load finish handlers
@on_event LOAD_FINISH @set_status <span foreground="gold">done</span>
@on_event LOAD_FINISH spawn @scripts_dir/history.sh
# Generate a FORM_ACTIVE event if an editable
# element on the loaded site has initial focus
@on_event LOAD_FINISH js if(document.activeElement.type == 'text') {Uzbl.run("event FORM_ACTIVE");}
# Switch to insert mode if a (editable) html form is clicked
#@on_event FORM_ACTIVE @set_mode insert
# Switch to command mode if anything else is clicked
#@on_event ROOT_ACTIVE @set_mode command
# Misc on_event handlers
#@on_event CONFIG_CHANGED print Config changed: %1 = %2
# === Behaviour and appearance ===============================================
set show_status = 1
set status_top = 0
set status_background = #303030
set modcmd_style = weight="bold" foreground="red"
set keycmd_style = weight="light" foreground="red"
set prompt_style = foreground="grey"
set cursor_style = underline="single"
set completion_style = foreground="green"
set hint_style = weight="bold"
set mode_section = <span background="khaki" foreground="black">[\@[\@mode_indicator]\@]</span>
set keycmd_section = [<span \@prompt_style>\@[\@keycmd_prompt]\@</span><span \@modcmd_style>\@modcmd</span><span \@keycmd_style>\@keycmd</span><span \@completion_style>\@completion_list</span>]
set progress_section = <span foreground="#606060">\@[\@progress_format]\@</span>
set scroll_section = <span foreground="#606060">\@[\@scroll_message]\@</span>
set uri_section = <span foreground="#99FF66">\@[\@uri]\@</span>
set name_section = <span foreground="khaki">\@[\@NAME]\@</span>
set status_section = <span foreground="orange">\@status_message</span>
set selected_section = <span foreground="#606060">\@[\@SELECTED_URI]\@</span>
set status_format = <span font_family="monospace">@mode_section @keycmd_section @progress_section @uri_section @name_section @status_section @scroll_section @selected_section</span>
# Progress bar config
@progress width = 8
# %d = done, %p = pending %c = percent done, %i = int done, %s = spinner,
# %t = percent pending, %o = int pending, %r = sprite scroll
@progress format = [%d>%p]%c
@progress done = =
@progress pending =
# Or ride those spinnas'
#@progress format = [%d%s%p]
#@progress spinner = -\\|/
#@progress done = -
#@progress pending =
# === Core settings ==========================================================
set useragent = Uzbl (Webkit @WEBKIT_MAJOR.@WEBKIT_MINOR.@WEBKIT_MICRO) (@(uname -o)@ @(uname -m)@ [@ARCH_UZBL]) (Commit @COMMIT)
set fifo_dir = /tmp
set socket_dir = /tmp
# === Key modmapping and ignoring ============================================
#modmap <From> <To>
@modmap <Control> <Ctrl>
@modmap <ISO_Left_Tab> <Shift-Tab>
@modmap <space> <Space>
#modkey_addition <Key1> <Key2> <Result>
@modkey_addition <Shift> <Ctrl> <Meta>
@modkey_addition <Shift> <Tab> <Shift-Tab>
#ignore_key <glob>
@ignore_key <ISO_*>
@ignore_key <Shift>
# === Keyboard & Mouse bindings ==============================================
# With this command you can enter in any command at runtime when prefixed with
# a colon.
@bind :_ = %s
# Middle click
# if clicked on a link open the link in a new uzbl window
# otherwise open the selection in the current window
set load_from_xclip = sh 'echo "uri $(xclip -o)" > $4'
set open_new_window = sh 'uzbl-browser -u \@SELECTED_URI'
@bind <Button2> = @jsh if(get("SELECTED_URI")) { run("\@open_new_window"); } else { run("\\\@load_from_xclip"); }
# Edit HTML forms in external editor
#set external_editor = gvim
#set external_editor = xterm -e vim
#@bind E = script @scripts_dir/extedit.js
#menu_editable_add Open in @external_editor = script @scripts_dir/extedit.js
@bind <Ctrl>n = scroll vertical 50
@bind <Ctrl>v = scroll vertical 100%
@bind <Ctrl>p = scroll vertical -50
@bind <Alt>v = scroll vertical -100%
@bind <Ctrl>b = scroll horizontal -20
@bind <Ctrl>f = scroll horizontal 20
@bind <Alt>< = scroll vertical begin
@bind <Alt>> = scroll vertical end
@bind <Meta>< = scroll vertical begin
@bind <Meta>> = scroll vertical end
#@bind ^ = scroll horizontal begin
#@bind $ = scroll horizontal end
@bind <Ctrl>cp = back
@bind <Ctrl>cn = forward
#@bind <Ctrl>g = stop
@bind <Ctrl>cr = reload
@bind <Ctrl>cR = reload_ign_cache
@bind + = zoom_in
@bind - = zoom_out
@bind T = toggle_zoom_type
@bind 1 = sh "echo set zoom_level = 1.0 > $4"
@bind 2 = sh "echo set zoom_level = 2.0 > $4"
#@bind t = toggle_status
@bind <Ctrl>s<search:>* = search %s
@bind <Ctrl>r<search:>* = search_reverse %s
#jump to next
#@bind <Ctrl>s = search
#@bind <Ctrl>r = search_reverse
#@bind gh = uri http://www.uzbl.org
# shortcut to set variables
#@bind s _ = set %s
#@bind \\wiki _ = uri http://wiki.archlinux.org/index.php/Special:Search?search=%s&go=Go
#@bind gg _ = uri http://www.google.com/search?q=%s
# Enclose the executable in quotes if it has spaces. Any additional parameters you use will
# appear AFTER the default parameters
# use a script to insert bookmarks. or use the EM/keycmd technique a bit further down
#@bind B = spawn @scripts_dir/insert_bookmark.sh
#@bind U = spawn @scripts_dir/load_url_from_history.sh
#@bind u = spawn @scripts_dir/load_url_from_bookmarks.sh
@bind <Alt>w = sh 'echo -n $6 | xclip'
#@bind ytitle = sh 'echo -n $7 | xclip'
# go the page from primary selection
@bind <Ctrl>y = sh 'echo "uri `xclip -o`" > $4'
# go to the page in clipboard
#@bind P = sh 'echo "uri `xclip -selection clipboard -o`" > $4'
# start a new uzbl instance from the page in primary selection
#@bind 'p = sh 'exec uzbl-browser --uri $(xclip -o)'
#@bind ZZ = exit
@bind <Ctrl>xc = exit
#@bind Xs = js alert("hi");
# example showing how to use sh
# it sends a command to the fifo, whose path is told via a positional param
# if fifo_dir is not set, it'll echo to a file named (null) somewhere >:) remember to delete it
# The body of the shell command should be one parameter, so if it has spaces like here,
# you must enclose it in quotes. Remember to escape (and double-escape) quotes and backslashes
# in the body. Any additional parameters you use will appear AFTER the default parameters (cfg file
# path, fifo & socket dirs, etc.)
#@bind XS = sh 'echo "js alert (\\"This is sent by the shell via a fifo\\")" > "$4"'
@bind !dump = sh "echo dump_config > $4"
@bind !reload = sh "sed '/^# === Post-load misc commands/,$d' $1 > $4"
# this script allows you to configure (per domain) values to fill in form fields (eg login information) and to fill in these values automatically
set formfiller = spawn @scripts_dir/formfiller
#@bind za = @{formfiller}.sh
#@bind ze = @{formfiller}.sh edit
#@bind zn = @{formfiller}.sh new
#@bind zl = @{formfiller}.sh load
# Or the more advanced implementation using perl: (could not get this to run - Dieter)
#@bind LL = @{formfiller}.pl load
#@bind LN = @{formfiller}.pl new
#@bind LE = @{formfiller}.pl edit
# we ship some javascripts to do keyboard based link hinting/following. (webkit does not have C DOM bindings yet)
# this is similar to how it works in vimperator (and konqueror)
# TODO: did we resolve: "no click() event for hyperlinks so no referrer set" ?
#hit F to toggle the Hints (now in form of link numbering)
#@bind <Ctrl>l = script @scripts_dir/hint.js
# the most stable version:
#@bind <Ctrl>l = script @scripts_dir/follow_Numbers.js %s
# using strings, not polished yet:
#@bind <Ctrl>l<:>_ = script @scripts_dir/follow_Numbers_Strings.js %s
@bind <Ctrl>m<link:>_ = script @scripts_dir/follow_Numbers.js %s
@bind <Ctrl>l = script @scripts_dir/follow_Numbers.js
# Examples using multi-stage-bindings with text prompts.
#@bind o<uri:>_ = uri %s
@bind <Ctrl>xf<uri:>_ = uri %s
#@bind O<uri:\@uri>_ = uri %s
# multi-stage binding way to write bookmarks to file from inside uzbl.
@bind <Ctrl>b<tags:>_ = sh 'echo -e "$6 %s" >> $XDG_DATA_HOME/uzbl/bookmarks'
# Multi-stage bindings with blank prompts (similar behaviour to emacs M-c M-s bindings?)
@bind <Ctrl>a<:><Ctrl>q = exit
@bind <Ctrl>a<:><Ctrl>h = uri http://uzbl.org/
# Inject handy values into the keycmd.
@bind <Ctrl>su = event INJECT_KEYCMD \@uri
@bind <Ctrl>st = event INJECT_KEYCMD \@TITLE
# Or append.
@bind <Ctrl>du = event APPEND_KEYCMD \@uri
@bind <Ctrl>dt = event APPEND_KEYCMD \@TITLE
# === command editing configuration ==========================================
# you'll want this at the very least
@bind <Return> = event KEYCMD_EXEC_CURRENT
#@bind <Escape> = @set_mode
@bind <Ctrl>g = @set_mode
# basic searching
@bind <Home> = event SET_CURSOR_POS 0
@bind <End> = event SET_CURSOR_POS -1
@bind <Left> = event SET_CURSOR_POS -
@bind <Right> = event SET_CURSOR_POS +
@bind <BackSpace> = event KEYCMD_BACKSPACE
@bind <Delete> = event KEYCMD_DELETE
@bind <Tab> = event START_COMPLETION
# readline-ish bindings
@bind <Ctrl>w = event KEYCMD_STRIP_WORD
@bind <Ctrl>u = event SET_KEYCMD
@bind <Ctrl>a = event SET_CURSOR_POS 0
@bind <Ctrl>e = event SET_CURSOR_POS -1
# === Context menu items =====================================================
# Default context menu
menu_add Google = set uri = http://google.com
menu_add Go Home = set uri = http://uzbl.org
menu_separator separator_1
menu_add Quit uzbl = exit
# Link context menu
menu_link_add Print Link = print \@SELECTED_URI
# === Mode configuration =====================================================
# Define some mode specific uzbl configurations.
set command = @mode_config command
set insert = @mode_config insert
set stack = @mode_config stack
# Command mode config.
@command keycmd_style = foreground="red"
@command status_background = #202020
@command mode_indicator = C
# Insert mode config.
@insert status_background = #303030
@insert mode_indicator = I
# Multi-stage-binding mode config.
@stack keycmd_events = 1
@stack modcmd_updates = 1
@stack forward_keys = 0
@stack keycmd_style = foreground="red"
@stack prompt_style = foreground="#888" weight="light"
@stack status_background = #202020
@stack mode_indicator = B
set default_mode = insert
# Mode bindings:
# Changing mode method via set.
#@bind I = @set_mode insert
set always_insert_mode = 1
# Or toggle between modes by rasing the toggle event.
#set toggle_cmd_ins = @toggle_modes command insert
#@bind i = @toggle_cmd_ins
#@bind <Ctrl>i = @toggle_cmd_ins