actions: reset highlight position of main playlist when cleared
[ncmpcpp.git] / doc / bindings
blobf4b846cda17a464a246c666be2ebe27b02959b23
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 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 actions failed to execute
28 ##    due to its requirements not being met. Note that
29 ##    execution of chain of actions ALWAYS succeeds, no
30 ##    matter if one of actions from the chain failed (even
31 ##    if it was the first one in order and thus nothing
32 ##    was really executed). Because of that, if you decide
33 ##    to bind both actions and chains to a single key, make
34 ##    sure that chain is defined in the end. Otherwise, all
35 ##    actions bound to the key after chain will never be run.
37 ## 3) When ncmpcpp starts, bindings configuration file is
38 ##    parsed and then ncmpcpp provides "missing pieces"
39 ##    of default keybindings. If you want to disable some
40 ##    bindings, there is a special action called 'dummy'
41 ##    for that purpose. Eg. if you want to disable ability
42 ##    to crop playlists, you need to put the following
43 ##    into configuration file:
45 ##    def_key "C"
46 ##      dummy
48 ##    After that ncmpcpp will not bind any default action
49 ##    to this key.
51 ## 4) To let you write simple macros, the following special
52 ##    actions are provided:
54 ##    - push_character "character" - pushes given special
55 ##      character into input queue, so it will be immediately
56 ##      picked by ncmpcpp upon next call to readKey function.
57 ##      Accepted values: mouse, up, down, page_up, page_down,
58 ##      home, end, space, enter, insert, delete, left, right,
59 ##      tab, shift_tab, ctrl_a, ctrl_b, ..., ctrl_z, f1, f2,
60 ##      ..., f12, backspace, backspace_2.
62 ##    - push_characters "string" - pushes given string into
63 ##      input queue.
65 ##    - require_runnable "action" - checks whether given action
66 ##      is runnable and fails if it isn't. This is especially
67 ##      useful when mixed with previous two functions. Consider
68 ##      the following macro definition:
70 ##      def_key "key"
71 ##        push_characters "custom_filter"
72 ##        apply_filter
74 ##      If apply_filter can't be currently run, we end up with
75 ##      sequence of characters in input queue which will be
76 ##      treated just as we typed them. This may lead to unexpected
77 ##      results (in this case 'c' will most likely clear current
78 ##      playlist, 'u' will trigger database update, 's' will stop
79 ##      playback etc.). To prevent such thing from happening, we
80 ##      need to change above definition to this one:
82 ##      def_key "key"
83 ##        require_runnable "apply_filter"
84 ##        push_characters "custom_filter"
85 ##        apply_filter
87 ##      Here, first we test whether apply_filter can be actually run
88 ##      before we stuff characters into input queue, so if condition
89 ##      is not met, whole chain is aborted and we're fine.
91 ##    - require_screen "screen" - checks whether given screen is
92 ##      currently active. accepted values: browser, clock, help,
93 ##      media_library, outputs, playlist, playlist_editor,
94 ##      search_engine, tag_editor, visualizer, last_fm, lyrics,
95 ##      selected_items_adder, server_info, song_info,
96 ##      sort_playlist_dialog, tiny_tag_editor.
98 ##    - run_external_command "command" - runs given command using
99 ##      system() function.
101 ## 5) In addition to binding to a key, you can also bind actions
102 ##    or chains of actions to a command. If it comes to commands,
103 ##    syntax is very similar to defining keys. Here goes example
104 ##    definition of a command:
106 ##      def_command "quit" [deferred]
107 ##        stop
108 ##        quit
110 ##    If you execute the above command (which can be done by
111 ##    invoking action execute_command, typing 'quit' and pressing
112 ##    enter), ncmpcpp will stop the player and then quit. Note the
113 ##    presence of word 'deferred' enclosed in square brackets. It
114 ##    tells ncmpcpp to wait for confirmation (ie. pressing enter)
115 ##    after you typed quit. Instead of 'deferred', 'immediate'
116 ##    could be used. Then ncmpcpp will not wait for confirmation
117 ##    (enter) and will execute the command the moment it sees it.
119 ## Note: Both 'backspace' and 'backspace_2' are used because some
120 ##       terminals interpret backspace using keycode of 'backspace'
121 ##       and some the one of 'backspace_2'. You can get away with
122 ##       binding once if all your terminal emulators use the same
123 ##       value.
125 ## Note: There is a difference between:
127 ##         def_key "key"
128 ##           action1
130 ##         def_key "key"
131 ##           action2
133 ##       and
135 ##         def_key "key"
136 ##           action1
137 ##           action2
139 ##      First one binds two single actions to the same key whilst
140 ##      second one defines a chain of actions. The behavior of
141 ##      these two is different and is described in (1) and (2).
143 ## Note: Function def_key accepts non-ascii characters.
145 ##### List of unbound actions #####
147 ## The following actions are not bound to any key/command:
149 ##  - set_volume
150 ##  - filter_playlist_on_priorities
153 #def_key "mouse"
154 #  mouse_event
156 #def_key "up"
157 #  scroll_up
159 #def_key "down"
160 #  scroll_down
162 #def_key "["
163 #  scroll_up_album
165 #def_key "]"
166 #  scroll_down_album
168 #def_key "{"
169 #  scroll_up_artist
171 #def_key "}"
172 #  scroll_down_artist
174 #def_key "page_up"
175 #  page_up
177 #def_key "page_down"
178 #  page_down
180 #def_key "home"
181 #  move_home
183 #def_key "end"
184 #  move_end
186 #def_key "space"
187 #  press_space
189 #def_key "enter"
190 #  press_enter
192 #def_key "delete"
193 #  delete_playlist_items
195 #def_key "delete"
196 #  delete_stored_playlist
198 #def_key "right"
199 #  next_column
201 #def_key "right"
202 #  slave_screen
204 #def_key "right"
205 #  volume_up
207 #def_key "+"
208 #  volume_up
210 #def_key "left"
211 #  previous_column
213 #def_key "left"
214 #  master_screen
216 #def_key "left"
217 #  volume_down
219 #def_key "-"
220 #  volume_down
222 #def_key ":"
223 #  execute_command
225 #def_key "tab"
226 #  next_screen
228 #def_key "shift_tab"
229 #  previous_screen
231 #def_key "f1"
232 #  show_help
234 #def_key "1"
235 #  show_playlist
237 #def_key "2"
238 #  show_browser
240 #def_key "2"
241 #  change_browse_mode
243 #def_key "3"
244 #  show_search_engine
246 #def_key "3"
247 #  reset_search_engine
249 #def_key "4"
250 #  show_media_library
252 #def_key "4"
253 #  toggle_media_library_columns_mode
255 #def_key "5"
256 #  show_playlist_editor
258 #def_key "6"
259 #  show_tag_editor
261 #def_key "7"
262 #  show_outputs
264 #def_key "8"
265 #  show_visualizer
267 #def_key "="
268 #  show_clock
270 #def_key "@"
271 #  show_server_info
273 #def_key "s"
274 #  stop
276 #def_key "p"
277 #  pause
279 #def_key ">"
280 #  next
282 #def_key "<"
283 #  previous
285 #def_key "ctrl_h"
286 #  jump_to_parent_directory
288 #def_key "ctrl_h"
289 #  replay_song
291 #def_key "backspace"
292 #  jump_to_parent_directory
294 #def_key "backspace"
295 #  replay_song
297 #def_key "backspace_2"
298 #  jump_to_parent_directory
300 #def_key "backspace_2"
301 #  replay_song
303 #def_key "f"
304 #  seek_forward
306 #def_key "b"
307 #  seek_backward
309 #def_key "r"
310 #  toggle_repeat
312 #def_key "z"
313 #  toggle_random
315 #def_key "y"
316 #  save_tag_changes
318 #def_key "y"
319 #  start_searching
321 #def_key "y"
322 #  toggle_single
324 #def_key "R"
325 #  toggle_consume
327 #def_key "Y"
328 #  toggle_replay_gain_mode
330 #def_key "t"
331 #  toggle_space_mode
333 #def_key "T"
334 #  toggle_add_mode
336 #def_key "|"
337 #  toggle_mouse
339 #def_key "#"
340 #  toggle_bitrate_visibility
342 #def_key "Z"
343 #  shuffle
345 #def_key "x"
346 #  toggle_crossfade
348 #def_key "X"
349 #  set_crossfade
351 #def_key "u"
352 #  update_database
354 #def_key "ctrl_v"
355 #  sort_playlist
357 #def_key "ctrl_r"
358 #  reverse_playlist
360 #def_key "ctrl_f"
361 #  apply_filter
363 #def_key "/"
364 #  find
366 #def_key "/"
367 #  find_item_forward
369 #def_key "?"
370 #  find
372 #def_key "?"
373 #  find_item_backward
375 #def_key "."
376 #  next_found_item
378 #def_key ","
379 #  previous_found_item
381 #def_key "w"
382 #  toggle_find_mode
384 #def_key "e"
385 #  edit_song
387 #def_key "e"
388 #  edit_library_tag
390 #def_key "e"
391 #  edit_library_album
393 #def_key "e"
394 #  edit_directory_name
396 #def_key "e"
397 #  edit_playlist_name
399 #def_key "e"
400 #  edit_lyrics
402 #def_key "i"
403 #  show_song_info
405 #def_key "I"
406 #  show_artist_info
408 #def_key "g"
409 #  jump_to_position_in_song
411 #def_key "l"
412 #  show_lyrics
414 #def_key "v"
415 #  reverse_selection
417 #def_key "V"
418 #  remove_selection
420 #def_key "B"
421 #  select_album
423 #def_key "a"
424 #  add_selected_items
426 #def_key "c"
427 #  clear_playlist
429 #def_key "c"
430 #  clear_main_playlist
432 #def_key "C"
433 #  crop_playlist
435 #def_key "C"
436 #  crop_main_playlist
438 #def_key "m"
439 #  move_sort_order_up
441 #def_key "m"
442 #  move_selected_items_up
444 #def_key "m"
445 #  toggle_media_library_sort_mode
447 #def_key "n"
448 #  move_sort_order_down
450 #def_key "n"
451 #  move_selected_items_down
453 #def_key "M"
454 #  move_selected_items_to
456 #def_key "A"
457 #  add
459 #def_key "S"
460 #  save_playlist
462 #def_key "o"
463 #  jump_to_playing_song
465 #def_key "G"
466 #  jump_to_browser
468 #def_key "G"
469 #  jump_to_playlist_editor
471 #def_key "~"
472 #  jump_to_media_library
474 #def_key "E"
475 #  jump_to_tag_editor
477 #def_key "U"
478 #  toggle_playing_song_centering
480 #def_key "P"
481 #  toggle_display_mode
483 #def_key "\\"
484 #  toggle_interface
486 #def_key "!"
487 #  toggle_separators_between_albums
489 #def_key "L"
490 #  toggle_lyrics_fetcher
492 #def_key "F"
493 #  toggle_fetching_lyrics_in_background
495 #def_key "ctrl_l"
496 #  toggle_screen_lock
498 #def_key "`"
499 #  toggle_browser_sort_mode
501 #def_key "`"
502 #  toggle_library_tag_type
504 #def_key "`"
505 #  refetch_lyrics
507 #def_key "`"
508 #  add_random_items
510 #def_key "ctrl_p"
511 #  set_selected_items_priority
513 #def_key "q"
514 #  quit