Configuring VisiData¶
VisiData’s behavior can be configured several ways:
vd
command-line arguments- The global options sheet
- Sheet-specific options sheets
- The
~/.visidatarc
file
vd
command-line arguments¶
When you launch vd
, you can specify certain behaviors via arguments on the command-line.
For instance, to tell VisiData to ignore the first three lines of your input file, you’d run the following:
vd my-spreadsheet.csv --skip 3
To see the full list of configurable options, run vd -h | less
:
vd(1) Quick Reference Guide vd(1) NAME VisiData — a terminal utility for exploring and arranging tabular data SYNOPSIS vd [options] [input ...] vd [options] --play cmdlog [-w waitsecs] [--batch] [-i] [-o output] [field=value] vd [options] [input ...] +toplevel:subsheet:col:row DESCRIPTION VisiData is an easy-to-use multipurpose tool to explore, clean, edit, and restructure data. Rows can be selected, filtered, and grouped; columns can be rearranged, transformed, and derived via regex or Python expres‐ sions; and workflows can be saved, documented, and replayed. REPLAY MODE -p, --play=cmdlog replay a saved cmdlog within the interface -w, --replay-wait=seconds wait seconds between commands -b, --batch replay in batch mode (with no interface) -i, --interactive launch VisiData in interactive mode after batch :
(Press Space to scroll down the list.)
The global options sheet¶
You can also set most of the same options, plus additional color/display options, through the “global options sheet”. To launch that sheet, press Shift-O. You should see something like this:
File Edit View Column Row Data Plot System Help | VisiData 3.0.2 | Alt+H for help men option ║ global_value │ default │ description visidata_dir ║ ~/.visidata/ │ ~/.visidata/ │ directory to load and store additi… debug ║ │ False │ exit on error and display stacktra… disp_menu ║ │ True │ show menu on top line when not act… disp_menu_keys ║ │ True │ show keystrokes inline in submenus color_menu ║ │ black on 68 blue │ color of menu items in general color_menu_active ║ │ 223 yellow on black│ color of active menu items color_menu_spec ║ │ black on 34 green │ color of sheet-specific menu items color_menu_help ║ │ black italic on 68…│ color of helpbox disp_menu_boxchars ║ │ ││──┌┐└┘├┤ │ box characters to use for menus disp_menu_more ║ │ » │ command submenu indicator disp_menu_push ║ │ ⎘ │ indicator if command pushes sheet … disp_menu_input ║ │ … │ indicator if input required for co… disp_menu_fmt ║ │ | VisiData {vd.ver…│ right-side menu format string undo ║ │ True │ enable undo/redo disp_float_fmt ║ │ {:.02f} │ default fmtstr to format float val… disp_int_fmt ║ │ {:d} │ default fmtstr to format int values col_cache_size ║ │ 0 #│ max number of cache entries in eac… disp_formatter ║ │ generic │ formatter to create the text in ea… disp_displayer ║ │ generic │ displayer to render the text in ea… disp_splitwin_pct ║ │ 0 #│ height of second sheet on screen disp_note_none ║ │ ⌀ │ visible contents of a cell whose v… Shift+O› global_options| Shift+O quit-sheet 242 options
To customize an option navigate to the global_value
cell in the option’s row, and press e to edit it, like you would with any other cell in VisiData.
For example, to change VisiData’s default column width from 20 to 10, navigate down to the default_width
row, over to the global_value
cell, press e, type 10
, and then press Enter. Once you do, the global options sheet should look like this:
File Edit View Column Row Data Plot System Help | VisiData 3.0.2 | Alt+H for help men option ║ global_value │ default │ description disp_selected_note ║ │ • │ disp_sort_asc ║ │ ↑↟⇞⇡⇧⇑ │ characters for ascending sort disp_sort_desc ║ │ ↓↡⇟⇣⇩⇓ │ characters for descending sort color_default ║ │ white on black │ the default fg and bg colors color_default_hdr ║ │ bold │ color of the column headers color_bottom_hdr ║ │ underline │ color of the bottom header row color_current_row ║ │ reverse │ color of the cursor row color_current_col ║ │ bold │ color of the cursor column color_current_cell ║ │ │ color of current cell, if differen… color_current_hdr ║ │ bold reverse │ color of the header for the cursor… color_column_sep ║ │ 246 blue │ color of column separators color_key_col ║ │ 81 cyan │ color of key columns color_hidden_col ║ │ 8 │ color of hidden columns on metashe… color_selected_row ║ │ 215 yellow │ color of selected rows color_clickable ║ │ underline │ color of internally clickable item color_code ║ │ bold white on 237 │ color of code sample color_heading ║ │ bold 200 │ color of header color_guide_unwrit…║ │ 243 on black │ color of unwritten guides in Guide… force_256_colors ║ │ False │ use 256 colors even if curses repo… quitguard ║ │ False │ confirm before quitting modified s… default_width ║ 10 #│ 20 #│ default column width Shift+O› global_options| e edit-option 242 options
As with any other sheet, you can leave the global options sheet, and return to your previous sheet, by pressing q.
Sheet-specific options sheets¶
As the name suggests, the changes you make on the global options sheet affect your entire VisiData session. To change VisiData’s behavior for just one sheet, type zO to edit the “sheet options sheet”:
File Edit View Column Row Data Plot System Help | VisiData 3.0.2 | Alt+H for help men option ║ sheet_value │ default │ description visidata_dir ║ │ ~/.visidata/ │ directory to load and store additi… debug ║ │ False │ exit on error and display stacktra… disp_menu ║ │ True │ show menu on top line when not act… disp_menu_keys ║ │ True │ show keystrokes inline in submenus color_menu ║ │ black on 68 blue │ color of menu items in general color_menu_active ║ │ 223 yellow on black│ color of active menu items color_menu_spec ║ │ black on 34 green │ color of sheet-specific menu items color_menu_help ║ │ black italic on 68…│ color of helpbox disp_menu_boxchars ║ │ ││──┌┐└┘├┤ │ box characters to use for menus disp_menu_more ║ │ » │ command submenu indicator disp_menu_push ║ │ ⎘ │ indicator if command pushes sheet … disp_menu_input ║ │ … │ indicator if input required for co… disp_menu_fmt ║ │ | VisiData {vd.ver…│ right-side menu format string undo ║ │ True │ enable undo/redo disp_float_fmt ║ │ {:.02f} │ default fmtstr to format float val… disp_int_fmt ║ │ {:d} │ default fmtstr to format int values col_cache_size ║ │ 0 #│ max number of cache entries in eac… disp_formatter ║ │ generic │ formatter to create the text in ea… disp_displayer ║ │ generic │ displayer to render the text in ea… disp_splitwin_pct ║ │ 0 #│ height of second sheet on screen disp_note_none ║ │ ⌀ │ visible contents of a cell whose v… zShift+O› faa-wildlife-strikes_options| zShift+O quit-sheet 242 options
It the sheet options sheet operates just like the global options sheet, but applies only to the sheet you were on when you typed zO.
The ~/.visidatarc
file¶
The approaches above all affect only your current VisiData session. When you quit VisiData, those customizations evaporate.
To persist your customizations from session to session, you can specify them in your computer’s ~/.visidatarc
file.
Open that file in the editor of your choosing and, for each option you wish to modify, write options.my_example_option = my_custom_value
.
For instance:
options.default_width = 10
options.encoding = "latin-1"
options.bulk_select_clear = True
… and then save the file. Next time you run VisiData, these options will take effect.
Note
The ~/.visidatarc
file expects its commands to be written in Python. For basic options-setting, it doesn’t matter too much whether you know Python, as long as you follow the pattern in the example above. Numbers can be written plainly, strings of characters should be wrapped in quotation marks, and True
/False
values need to be written exactly as such.
Tip
If you know Python and are willing to acquaint yourself with VisiData’s architecture, you can use your ~/.visidatarc
file to customize VisiData in ways far more powerful than simple option-setting — including creating your own commands.