I'd like to add commands in my .vimrc programmatically in a function. For example, instead of hardcoding commands like thiscommand! MyCommand echom My commandI'd prefer to add them in a simple function like thisfunction! AddCommands()  for commandName in [One, Two, Three]     TODO: Add a command with the given name that prints something  endforendfunctionHow can I add the commands One, Two, and Three using the for loop above?Once I got that working, I want to read a file containing file paths and automatically create commands that open those files. I call that file bookmarks file.A line in the bookmarks file looks like this:BookmarkName: /path/to/bookmarked/file.txtHere's what I got so far: Read file paths from our bookmark file  and create a command for each bookmark that, when executed, opens the file in a new tab.function! ReadBookmarks()  let bookmarks = readfile(fnameescape($BOOKMARKS_FILE))  let bookmarkSeparator = :   for bookmark in bookmarks    let nameAndPath = split(bookmark, bookmarkSeparator)    let name = nameAndPath[0]    let path = nameAndPath[1]     TODO: Add a command that opens the file in a new tab  endforendfunction
Define commands programmatically
vimscript