actions: add support for range selection and make a few actions work on ranges
[ncmpcpp.git] / doc / bindings
blob2c75e4bcbc100c23e6b0e6100729af88980e2f4f
1 ##########################################################
2 ## this is example bindings configuration file, copy it ##
3 ## to ~/.ncmpcpp/bindings and set up your preferences   ##
4 ##########################################################
5 ##
6 ##### General rules #####
7 ##
8 ## 1) Because each action has runtime checks whether it's
9 ##    ok to run it, a few actions can be bound to one key.
10 ##    Actions will be bound in order given in configuration
11 ##    file. When a key is pressed, first action in order
12 ##    will test itself whether it's possible to run it. If
13 ##    test succeeds, action is executed and other actions
14 ##    bound to this key are ignored. If it doesn't, next
15 ##    action in order tests itself etc.
17 ## 2) It's possible to bind more that one action at once
18 ##    to a key. It can be done using the following syntax:
20 ##    def_key "key"
21 ##      action1
22 ##      action2
23 ##      ...
25 ##    This creates a chain of actions. When such chain is
26 ##    executed, each action in chain is run until the end of
27 ##    chain is reached or one of its actions fails to execute
28 ##    due to its requirements not being met. If multiple actions
29 ##    and/or chains are bound to the same key, they will be
30 ##    consecutively run until one of them gets fully executed.
32 ## 3) When ncmpcpp starts, bindings configuration file is
33 ##    parsed and then ncmpcpp provides "missing pieces"
34 ##    of default keybindings. If you want to disable some
35 ##    bindings, there is a special action called 'dummy'
36 ##    for that purpose. Eg. if you want to disable ability
37 ##    to crop playlists, you need to put the following
38 ##    into configuration file:
40 ##    def_key "C"
41 ##      dummy
43 ##    After that ncmpcpp will not bind any default action
44 ##    to this key.
46 ## 4) To let you write simple macros, the following special
47 ##    actions are provided:
49 ##    - push_character "character" - pushes given special
50 ##      character into input queue, so it will be immediately
51 ##      picked by ncmpcpp upon next call to readKey function.
52 ##      Accepted values: mouse, up, down, page_up, page_down,
53 ##      home, end, space, enter, insert, delete, left, right,
54 ##      tab, ctrl_a, ctrl_b, ..., ctrl_z, ctrl_[, ctrl_\\,
55 ##      ctrl_], ctrl_^, ctrl__, f1, f2, ..., f12, backspace.
56 ##      In addition, most of these names can be prefixed with
57 ##      alt_/ctrl_/shift_ to be recognized with the appropriate
58 ##      modifier key(s).
60 ##    - push_characters "string" - pushes given string into
61 ##      input queue.
63 ##    - require_runnable "action" - checks whether given action
64 ##      is runnable and fails if it isn't. This is especially
65 ##      useful when mixed with previous two functions. Consider
66 ##      the following macro definition:
68 ##      def_key "key"
69 ##        push_characters "custom_filter"
70 ##        apply_filter
72 ##      If apply_filter can't be currently run, we end up with
73 ##      sequence of characters in input queue which will be
74 ##      treated just as we typed them. This may lead to unexpected
75 ##      results (in this case 'c' will most likely clear current
76 ##      playlist, 'u' will trigger database update, 's' will stop
77 ##      playback etc.). To prevent such thing from happening, we
78 ##      need to change above definition to this one:
80 ##      def_key "key"
81 ##        require_runnable "apply_filter"
82 ##        push_characters "custom_filter"
83 ##        apply_filter
85 ##      Here, first we test whether apply_filter can be actually run
86 ##      before we stuff characters into input queue, so if condition
87 ##      is not met, whole chain is aborted and we're fine.
89 ##    - require_screen "screen" - checks whether given screen is
90 ##      currently active. accepted values: browser, clock, help,
91 ##      media_library, outputs, playlist, playlist_editor,
92 ##      search_engine, tag_editor, visualizer, last_fm, lyrics,
93 ##      selected_items_adder, server_info, song_info,
94 ##      sort_playlist_dialog, tiny_tag_editor.
96 ##    - run_external_command "command" - runs given command using
97 ##      system() function.
99 ## 5) In addition to binding to a key, you can also bind actions
100 ##    or chains of actions to a command. If it comes to commands,
101 ##    syntax is very similar to defining keys. Here goes example
102 ##    definition of a command:
104 ##      def_command "quit" [deferred]
105 ##        stop
106 ##        quit
108 ##    If you execute the above command (which can be done by
109 ##    invoking action execute_command, typing 'quit' and pressing
110 ##    enter), ncmpcpp will stop the player and then quit. Note the
111 ##    presence of word 'deferred' enclosed in square brackets. It
112 ##    tells ncmpcpp to wait for confirmation (ie. pressing enter)
113 ##    after you typed quit. Instead of 'deferred', 'immediate'
114 ##    could be used. Then ncmpcpp will not wait for confirmation
115 ##    (enter) and will execute the command the moment it sees it.
117 ##    Note: while command chains are executed, internal environment
118 ##    update (which includes current window refresh and mpd status
119 ##    update) is not performed for performance reasons. However, it
120 ##    may be desirable to do so in some situration. Therefore it's
121 ##    possible to invoke by hand by performing 'update enviroment'
122 ##    action.
124 ## Note: There is a difference between:
126 ##         def_key "key"
127 ##           action1
129 ##         def_key "key"
130 ##           action2
132 ##       and
134 ##         def_key "key"
135 ##           action1
136 ##           action2
138 ##      First one binds two single actions to the same key whilst
139 ##      second one defines a chain of actions. The behavior of
140 ##      these two is different and is described in (1) and (2).
142 ## Note: Function def_key accepts non-ascii characters.
144 ##### List of unbound actions #####
146 ## The following actions are not bound to any key/command:
148 ##  - set_volume
151 #def_key "mouse"
152 #  mouse_event
154 #def_key "up"
155 #  scroll_up
157 #def_key "down"
158 #  scroll_down
160 #def_key "["
161 #  scroll_up_album
163 #def_key "]"
164 #  scroll_down_album
166 #def_key "{"
167 #  scroll_up_artist
169 #def_key "}"
170 #  scroll_down_artist
172 #def_key "page_up"
173 #  page_up
175 #def_key "page_down"
176 #  page_down
178 #def_key "home"
179 #  move_home
181 #def_key "end"
182 #  move_end
184 #def_key "insert"
185 #  select_item
187 #def_key "enter"
188 #  press_enter
190 #def_key "space"
191 #  add_item_to_playlist
193 #def_key "space"
194 #  toggle_lyrics_update_on_song_change
196 #def_key "space"
197 #  toggle_visualization_type
199 #def_key "delete"
200 #  delete_playlist_items
202 #def_key "delete"
203 #  delete_browser_items
205 #def_key "delete"
206 #  delete_stored_playlist
208 #def_key "right"
209 #  next_column
211 #def_key "right"
212 #  slave_screen
214 #def_key "right"
215 #  volume_up
217 #def_key "+"
218 #  volume_up
220 #def_key "left"
221 #  previous_column
223 #def_key "left"
224 #  master_screen
226 #def_key "left"
227 #  volume_down
229 #def_key "-"
230 #  volume_down
232 #def_key ":"
233 #  execute_command
235 #def_key "tab"
236 #  next_screen
238 #def_key "shift_tab"
239 #  previous_screen
241 #def_key "f1"
242 #  show_help
244 #def_key "1"
245 #  show_playlist
247 #def_key "2"
248 #  show_browser
250 #def_key "2"
251 #  change_browse_mode
253 #def_key "3"
254 #  show_search_engine
256 #def_key "3"
257 #  reset_search_engine
259 #def_key "4"
260 #  show_media_library
262 #def_key "4"
263 #  toggle_media_library_columns_mode
265 #def_key "5"
266 #  show_playlist_editor
268 #def_key "6"
269 #  show_tag_editor
271 #def_key "7"
272 #  show_outputs
274 #def_key "8"
275 #  show_visualizer
277 #def_key "="
278 #  show_clock
280 #def_key "@"
281 #  show_server_info
283 #def_key "s"
284 #  stop
286 #def_key "p"
287 #  pause
289 #def_key ">"
290 #  next
292 #def_key "<"
293 #  previous
295 #def_key "ctrl_h"
296 #  jump_to_parent_directory
298 #def_key "ctrl_h"
299 #  replay_song
301 #def_key "backspace"
302 #  jump_to_parent_directory
304 #def_key "backspace"
305 #  replay_song
307 #def_key "f"
308 #  seek_forward
310 #def_key "b"
311 #  seek_backward
313 #def_key "r"
314 #  toggle_repeat
316 #def_key "z"
317 #  toggle_random
319 #def_key "y"
320 #  save_tag_changes
322 #def_key "y"
323 #  start_searching
325 #def_key "y"
326 #  toggle_single
328 #def_key "R"
329 #  toggle_consume
331 #def_key "Y"
332 #  toggle_replay_gain_mode
334 #def_key "T"
335 #  toggle_add_mode
337 #def_key "|"
338 #  toggle_mouse
340 #def_key "#"
341 #  toggle_bitrate_visibility
343 #def_key "Z"
344 #  shuffle
346 #def_key "x"
347 #  toggle_crossfade
349 #def_key "X"
350 #  set_crossfade
352 #def_key "u"
353 #  update_database
355 #def_key "ctrl_s"
356 #  sort_playlist
358 #def_key "ctrl_s"
359 #  toggle_browser_sort_mode
361 #def_key "ctrl_s"
362 #  toggle_media_library_sort_mode
364 #def_key "ctrl_r"
365 #  reverse_playlist
367 #def_key "/"
368 #  find
370 #def_key "/"
371 #  find_item_forward
373 #def_key "?"
374 #  find
376 #def_key "?"
377 #  find_item_backward
379 #def_key "."
380 #  next_found_item
382 #def_key ","
383 #  previous_found_item
385 #def_key "w"
386 #  toggle_find_mode
388 #def_key "e"
389 #  edit_song
391 #def_key "e"
392 #  edit_library_tag
394 #def_key "e"
395 #  edit_library_album
397 #def_key "e"
398 #  edit_directory_name
400 #def_key "e"
401 #  edit_playlist_name
403 #def_key "e"
404 #  edit_lyrics
406 #def_key "i"
407 #  show_song_info
409 #def_key "I"
410 #  show_artist_info
412 #def_key "g"
413 #  jump_to_position_in_song
415 #def_key "l"
416 #  show_lyrics
418 #def_key "ctrl_v"
419 #  select_range
421 #def_key "v"
422 #  reverse_selection
424 #def_key "V"
425 #  remove_selection
427 #def_key "B"
428 #  select_album
430 #def_key "a"
431 #  add_selected_items
433 #def_key "c"
434 #  clear_playlist
436 #def_key "c"
437 #  clear_main_playlist
439 #def_key "C"
440 #  crop_playlist
442 #def_key "C"
443 #  crop_main_playlist
445 #def_key "m"
446 #  move_sort_order_up
448 #def_key "m"
449 #  move_selected_items_up
451 #def_key "m"
452 #  set_visualizer_sample_multiplier
454 #def_key "n"
455 #  move_sort_order_down
457 #def_key "n"
458 #  move_selected_items_down
460 #def_key "M"
461 #  move_selected_items_to
463 #def_key "A"
464 #  add
466 #def_key "S"
467 #  save_playlist
469 #def_key "o"
470 #  jump_to_playing_song
472 #def_key "G"
473 #  jump_to_browser
475 #def_key "G"
476 #  jump_to_playlist_editor
478 #def_key "~"
479 #  jump_to_media_library
481 #def_key "E"
482 #  jump_to_tag_editor
484 #def_key "U"
485 #  toggle_playing_song_centering
487 #def_key "P"
488 #  toggle_display_mode
490 #def_key "\\"
491 #  toggle_interface
493 #def_key "!"
494 #  toggle_separators_between_albums
496 #def_key "L"
497 #  toggle_lyrics_fetcher
499 #def_key "F"
500 #  toggle_fetching_lyrics_in_background
502 #def_key "ctrl_l"
503 #  toggle_screen_lock
505 #def_key "`"
506 #  toggle_library_tag_type
508 #def_key "`"
509 #  refetch_lyrics
511 #def_key "`"
512 #  add_random_items
514 #def_key "ctrl_p"
515 #  set_selected_items_priority
517 #def_key "q"
518 #  quit