Adding new 'option'

From Vifm Wiki
Jump to navigation Jump to search

Adding a global option[edit]

  1. Add it to config structure in cfg/config.h.
  2. Add it to cfg_init() function in cfg/config.c initializing with default value.
  3. Add it to store_global_options() function in cfg/info.c.
  4. Add it in opt_handlers to options array.
  5. Add it to options array in opt_handlers.c.
  6. Implement.
  7. Add it to data/vim/doc/app/vifm-app.txt (don't forget to update modification date).
  8. Add it to data/man/vifm.1 (don't forget to update modification date).
  9. Regenerate tags.c by building the application.
  10. Add to tests/test-data/syntax-highlight/syntax.vifm.
  11. Add it to data/vim/syntax/vifm.vim (don't forget to update modification date). For boolean options don't forget about highlighting no<option> and inv<option>.
  12. Running scripts/check-syntax-changes should show changes in highlight for new lines.
  13. Add unit test(s).
  14. Remove from the TODO file if the option is mentioned there.
  15. Add to the ChangeLog file.
  16. Update THANKS file if the option was proposed by someone.

Adding a local option[edit]

  1. Add it to view_t structure in ui.h: <type> <name>, <name_g>;.
  2. Add it to init_view() or reset_view() function in filelist.c.
  3. Add it to write_options() function in cfg/info.c.
  4. Add it to options array in opt_handlers.c.
  5. Add it to reset_local_options(), load_view_options() and clone_local_options() functions in opt_handlers.c.
  6. Implement.
  7. Add it to vim/doc/vifm.txt (don't forget to update modification date).
  8. Add it to vifm.1 (don't forget to update modification date).
  9. Regenerate tags.c.
  10. add it to vim/syntax/vifm.vim (don't forget to update modification date). For boolean options don't forget about highlighting no<option> and inv<option>.
  11. Remove from the TODO file.
  12. Add to the ChangeLog file.
  13. Update THANKS file if option was proposed by someone.