Running :source {file} currently errors with Command :so[urce] is not yet implemented (PRs are welcome!) because the entry at src/vimscript/exCommandParser.ts uses the undefined stub that falls through to UnimplementedCommand.
Proposal
Implement :source by reading the file and, for each non-blank / non-comment line:
- Try the three
vimrcKeyRemappingBuilder paths (remap, unmap, mapclear) and apply to configuration via the existing public VimrcImpl.{add,remove,clear}RemapFromConfig helpers. This mirrors what src/configuration/vimrc.ts already does at startup so :nnoremap / :unmap / :mapclear work as users expect.
- Otherwise feed the line through
ExCommandLine.parser.tryParse(...) and execute the resulting command. This is the same pattern :foldclose / :folddoopen already use to re-enter the ex-command parser. It naturally supports :set, :edit, :nohl, nested :source, and anything else already implemented.
Path resolution: expand ~ / $HOME, then resolve relatives against the first workspace folder (or the active document's directory when there is no workspace). Cycle detection via a static Set<string> of currently-being-sourced absolute paths, rejecting re-entry with E1092. Missing files report E484.
I have this implemented locally with tests covering basic mapping load, comments/blanks, nested source, cycle detection, missing file, and regular ex-command execution. Full test suite stays green. Will open a PR referencing this issue shortly.
Running
:source {file}currently errors withCommand :so[urce] is not yet implemented (PRs are welcome!)because the entry atsrc/vimscript/exCommandParser.tsuses theundefinedstub that falls through toUnimplementedCommand.Proposal
Implement
:sourceby reading the file and, for each non-blank / non-comment line:vimrcKeyRemappingBuilderpaths (remap, unmap, mapclear) and apply toconfigurationvia the existing publicVimrcImpl.{add,remove,clear}RemapFromConfighelpers. This mirrors whatsrc/configuration/vimrc.tsalready does at startup so:nnoremap/:unmap/:mapclearwork as users expect.ExCommandLine.parser.tryParse(...)and execute the resulting command. This is the same pattern:foldclose/:folddoopenalready use to re-enter the ex-command parser. It naturally supports:set,:edit,:nohl, nested:source, and anything else already implemented.Path resolution: expand
~/$HOME, then resolve relatives against the first workspace folder (or the active document's directory when there is no workspace). Cycle detection via a staticSet<string>of currently-being-sourced absolute paths, rejecting re-entry withE1092. Missing files reportE484.I have this implemented locally with tests covering basic mapping load, comments/blanks, nested source, cycle detection, missing file, and regular ex-command execution. Full test suite stays green. Will open a PR referencing this issue shortly.