Home

Cmus complete guide

cmus — C* Music Player: Complete Guide


Starting cmus

cmus [options]
Option Description
--listen ADDR Listen on a UNIX socket instead of the default
--plugins List available plugins and exit
--show-cursor Always display the cursor (useful for screen readers)
--help Display usage information
--version Display version information

Do not use --listen to run multiple instances as the same user — it corrupts the metadata cache.


Step 1: Adding Music

Press 5 to open the file browser. Navigate with arrow keys, Enter to go into a folder, Backspace to go up. Press a on a file or folder to add it to your library.

cmus never moves, duplicates, or modifies your files. It only caches metadata like duration and artist. Adding a large folder can take a moment — watch the total duration counter in the bottom right climb as tracks are indexed.

To save manually: :save. cmus also saves everything automatically on quit.

You can also add directly from the command line:

:add ~/Music
:add -l ~/Music    # add to library explicitly
:add -p ~/Music    # add to playlist
:add -q ~/Music    # append to queue
:add -Q ~/Music    # prepend to queue

Supported formats depend on loaded input plugins. Supported playlist types: plain, .m3u, .pls. Supported URLs: Shoutcast (http://...), CDDA (cdda://...).


Step 2: Views

Press 17 to switch views.

Key View Description
1 Library (tree) Tracks grouped by artist and album, albums sorted by year
2 Library (sorted) Same content as view 1, as a flat auto-sorted list
3 Playlist Editable playlists with optional sorting
4 Queue Upcoming tracks — played before library or playlist
5 Browser Directory browser for adding files
6 Filters User-defined filters
7 Settings Keybindings, unbound commands, and options

Step 3: Playing Tracks

Press 2 to switch to the sorted library view. Use arrow keys to select a track and press Enter to play it.

Playback keys

Key Action
x Play / restart track
c Pause / resume
v Stop
b Next track
z Previous track
B Next album
Z Previous album
l / Seek forward 5s
h / Seek backward 5s
. Seek forward 1 min
, Seek backward 1 min

Pressing z (previous) jumps to the beginning of the current track if the playback position is greater than rewind_offset (default 5 seconds). Set rewind_offset=-1 to always jump to the previous track.

Playback mode toggles

The status bar bottom-right shows active toggles — only “on” toggles are displayed. The full format is:

aaa_mode & play_sorted & play_library | volume | continue follow repeat shuffle
Key Toggle Status bar Description
C continue C Auto-play next track when current ends. If off, cmus stops after every track.
r repeat R Repeat after all tracks in the current group are played.
Ctrl+r repeat_current Repeat current track forever.
s shuffle / S / & off = in order; S = random tracks; & = random albums
m aaa_mode Cycle play scope: all / artist / album
M play_library Toggle between library and playlist as playback source
o play_sorted Play in sorted view (2) order instead of tree view (1) order
t show_remaining_time Show remaining instead of elapsed time
f follow f Keep cursor on currently playing track as it changes

For sequential playback: C on, r off, s off.


r vs Ctrl + r

In cmus (C Musical Player), both r and Ctrl + r deal with repeating your music, but they operate on completely different scopes.

Here is the breakdown of how they work:

r (Toggle Repeat Row)

Pressing the lowercase r key toggles the overall Repeat mode for your current playback.

Pressing **Ctrl and r** at the same time toggles the Repeat Current Track mode.

Summary Reference

Key Command Action Best Used For… Status Bar Text
r Toggles Repeat List/Album Looping an entire playlist or album so the music never stops. repeat
Ctrl + r Toggles Repeat Single Track Putting a single song on an endless loop because you can’t get it out of your head. aaa

Volume

Key Action
+ / = Volume +10% (both channels)
- Volume −10%
] Right channel +1%
[ Left channel +1%
} Right channel −1%
{ Left channel −1%

Volume can also be set via command: :vol 80%, :vol +5%, :vol -10%. Two arguments set left and right channels separately: :vol 80% 80%.


Step 4: The Queue

The queue lets you decide what plays next without interrupting the current track. It is temporary — once a track plays it is removed, and cmus returns to normal library order. The queue is not affected by shuffle.

Key Action
e Append selected track to queue
E Prepend selected track to queue
4 Open queue view
p / P Move selected track down / up in queue
D / Del Remove selected track from queue
:clear -q Clear the entire queue
:lqueue [N] Add N random albums to queue (default 1)
:tqueue [N] Add N random tracks to queue (default 1)

When cmus is ready to play the next track and the queue is not empty, it removes the top entry from the queue and plays it. Once the queue is empty, playback resumes from the library or playlist.


Step 5: Playlists

Playlists are like a second library where you control the order manually. They persist across sessions and are useful for mixes, audio books, or any fixed sequence. For a temporary one-off sequence, use the queue instead.

Creating a playlist and adding tracks

  1. Press 2 to go to the sorted library view
  2. Navigate to a track and press y to add it to the active playlist
  3. Press 3 to open the playlist view

Playlist keys (in view 3)

Key Action
y Add selected track to active playlist (from any view)
p / P Move track down / up
D / Del Remove selected track
Space Select / activate a playlist
:clear -p Remove all tracks from active playlist

Playlist commands

Command Action
:pl-create name Create and activate a new playlist
:pl-rename name Rename the selected playlist
:pl-delete name Delete a playlist (no undo)
:pl-delete -a Delete all playlists
:pl-switch name Switch to a different playlist
:pl-import [file] Import a .m3u or .pls file
:pl-export file Export active playlist to file (overwrites if exists)

Saving and loading

Command Action
:save Save current view
:save -p file Save playlist view to file
:save -l file Save library view to file
:save -L file Save filtered library to file
:save -q file Save queue to file
:save -e file Extended save — includes track metadata
:load playlist Load a playlist into current view
:load -l playlist Load playlist into library views

cmus auto-saves playlists to ~/.config/cmus/playlists/ on exit.

Playing from a playlist vs library

Changing to view 3 does not automatically make cmus play from the playlist. To switch playback source, press Enter on a playlist track. To switch without interrupting the current track, press M. The status bar shows playlist instead of library when playlist mode is active.


Step 6: Navigation

Key Action
j / Down
k / Up
g / Home Top
G / End Bottom
Ctrl+F / PgDn Page down
Ctrl+B / PgUp Page up
Ctrl+D Half page down
Ctrl+U Half page up
Ctrl+E Scroll down one row
Ctrl+Y Scroll up one row
Tab Switch between artist/album and track panes (view 1)
i Jump to currently playing track
Space Expand/collapse artist in tree view; mark track in views 2–4

Step 7: Searching

Press / to search forward, ? to search backward. Type your query and press Enter. Press n for next result, N for previous.

In views 1–4 the query matches artist, album, and title tags. Use //WORDS to search only artists/albums in view 1, or only titles in views 2–4. Use ??WORDS for the same backwards. Files without tags are matched against the filename.

Searching also works in views 5–7.

Key Action
/query Search forward
?query Search backward
n Next result
N Previous result
F Open filter command line
L Open live-filter command line

Step 8: Marking and Editing Tracks

Editing commands affect marked tracks. If no tracks are marked, the selected track is used. You can only mark tracks in list views (2–4).

Key Action
Space Mark / unmark selected track
:mark expression Mark all tracks matching a filter expression
:unmark Unmark all tracks
:invert Invert current marking
a Copy marked/selected to library
y Copy marked/selected to active playlist
e Append marked/selected to queue
E Prepend marked/selected to queue
p Move marked tracks after selected track
P Move marked tracks before selected track
D / Del Remove marked/selected tracks from current view

Examples:

:mark duration<120        # mark all tracks under 2 minutes
:mark play_count>=1       # mark all tracks played at least once
:mark genre="Jazz"        # mark all jazz tracks

Step 9: Filters

Filters temporarily hide tracks in library views (1 and 2) without removing them from the library. The :save command still saves all tracks regardless of active filters.

Filter types

Type Example Available in
Simple beatles live-filter only
Short ~a beatles (!~y1960-1965 | ~d>600) all filter commands
Long artist="*beatles*"&album="R*" all filter commands

Long expressions use & (and), | (or), ! (not), and parentheses for grouping.

Long filter string keys

Key Type Comparators
filename, artist, albumartist, album, title, genre, comment string = !=
discnumber, tracknumber, date, originaldate, duration, bitrate integer < <= = >= > !=
tag boolean true if track has tags
stream boolean true if track is a stream

Short filter keys

Key Matches Notes
~f filename
~a artist
~A albumartist
~l album
~t title
~g genre
~c comment
~y date supports ranges: 1980-1990, -1990, 1980-
~d duration
~n tracknumber
~D discnumber
~T tag (boolean)
~s stream (boolean)

Filter commands

Command Action
:filter expression Apply temporary filter (clears saved filters)
:filter Clear the active filter
:live-filter expression Apply on top of active filters; shows preview as you type; persists after leaving command mode
:fset name=expression Save a named filter to filters view (6)
:factivate name Activate a saved filter
:factivate !name Activate a saved filter negated
:factivate Deactivate all filters

Filter examples

:filter genre="*rock*"&date>=1980
:filter ~y1980-~grock
:live-filter sleepwalking
:fset ogg=filename="*.ogg"
:fset 90s-ogg-mp3=date>=1990&date<2000&(ogg|filename="*.mp3")
:factivate ogg missing-tags
:factivate !ogg missing-tags

Step 10: Customisation

Press 7 to open the settings and keybindings view. Select any item with arrow keys and press Enter to edit it in the command line. Press Space to toggle boolean values directly.

Key binding commands

Command Action
:bind context key command Add a key binding
:bind -f context key command Add or overwrite a key binding
:unbind context key Remove a key binding
:unbind -f context key Remove without error if not found
:showbind context key Show what a key is bound to

Valid contexts: common (all views), library (1–2), playlist (3), queue (4), browser (5), filters (6).

Always use -f when setting bindings in rc to avoid conflicts with autosave.

Examples:

:bind -f common q quit
:bind common w push filter artist=

Color scheme

:colorscheme solarized

Color schemes (*.theme) live in /usr/share/cmus/ or ~/.config/cmus/. Colors are saved to autosave — changing a theme file does not update colors automatically; reload with :colorscheme name.


Configuration Options

Set with :set option=value, toggle booleans with :toggle option, view current value with :set option.

Playback

Option Default Description
continue true Auto-play next track when current ends
continue_album true Continue to next album when current album ends
repeat false Repeat after all tracks in group are played
repeat_current false Repeat current track forever
shuffle off off / tracks / albums
aaa_mode all Play scope in library: all / artist / album
play_library true Play from library instead of playlist
play_sorted false Play in sorted view (2) order instead of tree (1) order
follow false Select currently playing track on track change
resume false Resume playback on startup
rewind_offset 5 Seconds: below this, prev jumps to previous track; above, jumps to start of current. -1 = always go to previous track
stop_after_queue false Stop when play queue is exhausted
auto_reshuffle true Reshuffle when end of shuffled list is reached
replaygain disabled track / album / track-preferred / album-preferred / smart
replaygain_limit true Apply clipping limit with replay gain
replaygain_preamp 0.0 Replay gain preamplification in dB

Display

Option Default Description
show_remaining_time false Show remaining instead of elapsed time
show_current_bitrate false Show current bitrate in status line
show_playback_position true Show elapsed/remaining time in status line
show_hidden false Show hidden files in browser
show_all_tracks true Show all tracks when artist selected in tree view
display_artist_sort_name false Show sort name in tree (e.g. “Artist, The”)
time_show_leading_zero true Pad sub-10-minute durations with leading zero
progress_bar line disabled / line / shuttle / color / color_shuttle
scroll_offset 2 Minimum lines to keep above/below cursor
tree_width_percent 33 Width of left pane as percentage of window
tree_width_max 0 Maximum left pane width in columns (0 = unlimited)
smart_artist_sort true Ignore “The” when sorting artist names
sort_albums_by_name false Sort albums by name instead of date in tree view
auto_hide_playlists_panel false Hide left panel in playlist view (shows on demand via Tab)

Library

Option Default Description
lib_sort artist album discnumber tracknumber title filename Sort keys for sorted library view (2)
pl_sort (empty) Sort keys for playlist view (3); empty enables manual ordering
ignore_duplicates false Skip tracks with matching artist, album, disc, track, and title
lib_add_filter Filter applied automatically when adding files to library
skip_track_info false Skip metadata loading when adding tracks (useful on slow network filesystems; use update-cache later)

Other

Option Default Description
start_view tree View shown on startup (use this in rc, not :view)
mouse false Enable mouse support
mpris true Enable MPRIS D-Bus interface
softvol false Use software volume control
buffer_seconds 10 Player buffer size in seconds (1–300)
confirm_run true Ask for confirmation before running :run
wrap_search true Wrap search around end of list
search_resets_position true Start searches from beginning of view
block_key_paste true Prevent accidental input from paste events
status_display_program External command run on every status change
output_plugin Output plugin: alsa / pulse / oss / coreaudio / etc.
id3_default_charset ISO-8859-1 Fallback charset for ID3v1 and broken ID3v2 tags
pause_on_output_change false Pause when audio output changes (pulse, aaudio only)

Library View Sorting

The tree view (1) sorts automatically using three levels:

  1. Artist — alphanumerically by artist tag (or artistsort tag if present; smart_artist_sort ignores leading “The”)
  2. Album — grouped by album name, sorted by date of first track, then alphabetically. Albums without a date appear at the top.
  3. Track — by discnumber, then tracknumber, then filename

Compilations are handled specially. If albumartist or the ID3v2 TPE2 tag is set, it is used instead of the track artist. Otherwise cmus checks for compilation markers (Various Artists, VA, V/A, compilation=true, ID3v2 TCMP) and names the artist <Various Artists>. URLs show as <Stream>. Files with no artist/album tags show as <No Name>.


Format Strings

Used with format_current, format_playlist, format_trackwin, format_title, and their altformat_* equivalents (used when tags are absent).

Code Tag
%a artist
%A albumartist
%l album
%t title
%n tracknumber
%D discnumber
%T totaldiscs
%y date
%d duration
%g genre
%c comment
%f full path
%F filename only
%X play count
%{bitrate} bitrate (append unit manually, e.g. %{bitrate}Kbps)
%{codec} codec
%{composer} composer
%= align right from here (use once)
%! prior text is lower priority, may be shortened (use once)
%% literal %

Conditional syntax: %{?CONDITION?A?B} — renders A if condition true, B otherwise (B optional).

Printf-style width/alignment/padding is supported. Width can have a %-suffix for percentage of terminal width.

Examples:

:set format_trackwin= %02n. %t %{?y?(%y)}%= %d
:set format_current= %a - %l%! - %02n. %t%= %{bitrate}Kbps %g %y
:set format_playlist= %-25%a %-15%l %3n. %t%= %y %d

Sort Keys

Used with lib_sort and pl_sort. Space-separated list. Prefix with - to reverse order.

artist, album, title, tracknumber, discnumber, date, originaldate,
genre, comment, albumartist, filename, filemtime, play_count,
bitrate, bpm, codec, media, codec_profile,
rg_track_gain, rg_track_peak, rg_album_gain, rg_album_peak

Examples:

:set lib_sort=artist date album discnumber tracknumber
:set pl_sort=-date artist

Colors and Attributes

Colors are integers −1..255 or named values:

Range Names
−1 default (terminal default)
0–7 black red green yellow blue magenta cyan gray
8–15 darkgray lightred lightgreen lightyellow lightblue lightmagenta lightcyan white

Attributes (combinable with |): default, standout, bold, reverse, underline, italic, blink.

Example:

:set color_win_cur=lightyellow
:set color_statusline_bg=gray
:set color_win_title_attr=bold

Command Reference

All cmus functionality is implemented as commands. Type : to enter command mode, Tab to autocomplete, / for history, Esc to cancel.

Playback

Command Key Description
player-play [file] x Play or restart current track; optionally play a specific file
player-pause c Toggle pause
player-pause-playback Pause only if currently playing
player-stop v Stop playback
player-next b Next track
player-prev z Previous track
player-next-album B Next album
player-prev-album Z Previous album
mute Toggle mute

Seeking

Command Description
:seek 1:30 Seek to absolute 1m 30s
:seek 1h Seek to absolute 1 hour
:seek +30 Seek forward 30 seconds
:seek -1m Seek backward 1 minute
:seek +1:30 Seek forward 90 seconds

Library and Queue

Command Description
:add ~/path Add file, directory, or URL
:clear Clear current view
:clear -l / -p / -q Clear library / playlist / queue
:update-cache Update changed files in metadata cache
:update-cache -f Force update all files in cache
:rand Randomise track order in current view
:reshuffle Reshuffle shuffle lists for library and playlist
:lqueue [N] Queue N random albums (default 1)
:tqueue [N] Queue N random tracks (default 1)

Filters and Marking

Command Description
:filter expression Apply temporary filter
:filter Clear filter
:live-filter expression Live filter with preview
:fset name=expression Save named filter
:factivate [name...] Activate saved filters (no args = deactivate all)
:mark expression Mark tracks matching expression
:unmark Unmark all tracks
:invert Invert marking

Utility

Command Description
:run command Run external command on marked/selected files ({} = filenames)
:shell command Execute a shell command
:echo args Display text on command line ({} = current file)
:cd [dir] Change working directory and browser location
:pwd Print current working directory
:source file Read and execute commands from a file
:colorscheme name Switch color scheme
:refresh Redraw terminal window (Ctrl+L)
:version Print version information
:help Show help file information
:quit or :q Save and quit

Playing Audio CDs

Requires the cdio input plugin.

:set device=/dev/cdrom
:add cdda://          # entire disc
:add cdda://2         # track 2 only
:add cdda://1-3       # tracks 1 to 3
:add cdda:///path/to/cd.cue/2-5    # from image file

Metadata is read from CD-Text first, then from CDDB (configure with :set input.cdio.cddb_url=...).


Files

Path Description
~/.config/cmus/autosave Auto-written on exit — do not edit while cmus is running
~/.config/cmus/rc Your static config — loaded after autosave, never overwritten by cmus
/usr/share/cmus/rc Default config — read only if autosave does not exist
~/.config/cmus/playlists/ Saved playlists
~/.config/cmus/cache Track metadata cache
~/.config/cmus/*.theme Color schemes

The rc file is read on every startup and is the right place for bindings, format strings, and settings you always want applied. The autosave file stores runtime state (volume, position, library paths, shuffle/repeat state) and is overwritten on every quit — edit it only when cmus is closed.


Environment Variables

Variable Description
CMUS_SOCKET Override socket path (default: $XDG_RUNTIME_DIR/cmus-socket)
CMUS_HOME Override config directory (default: ~/.config/cmus)
CMUS_CHARSET Override character set (default: locale charmap)
HOME User home directory
http_proxy Proxy URI for HTTP requests

Relocating the library with pl_env_vars

pl_env_vars lets you store library paths using environment variables, making the library portable across machines or users:

:set pl_env_vars=HOME

Paths are then stored relative to $HOME. Multiple variables can be comma-separated. Takes effect on next restart.


D-Bus / MPRIS

cmus exposes /org/mpris/MediaPlayer2 on the bus name org.mpris.MediaPlayer2.cmus, implementing the MPRIS v2 spec. This allows desktop widgets, status bars, and media key handlers to control cmus.

Enable or disable: :set mpris=true / :set mpris=false


Step 11: Quit

Type :q and press Enter. cmus automatically saves your library, settings, playlists, and queue.


Further Reading

man cmus-remote
https://github.com/cmus/cmus/blob/master/Doc/cmus.txt
https://github.com/cmus/cmus/issues
Tags: LinuxMusicCmus