No description
Find a file
2025-03-20 22:02:45 -05:00
.github/workflows Initial commit 2025-03-11 15:03:19 -05:00
src Remove unnecessary sleep function (#9) 2025-03-20 22:02:45 -05:00
tests Initial commit 2025-03-11 15:03:19 -05:00
.editorconfig Initial commit 2025-03-11 15:03:19 -05:00
.gitignore Initial commit 2025-03-11 15:03:19 -05:00
.npmrc Initial commit 2025-03-11 15:03:19 -05:00
.prettierignore Remove unnecessary sleep function (#9) 2025-03-20 22:02:45 -05:00
CHANGELOG.md Remove unnecessary sleep function (#9) 2025-03-20 22:02:45 -05:00
CONTRIBUTING.md Initial commit 2025-03-11 15:03:19 -05:00
esbuild.config.mjs Initial commit 2025-03-11 15:03:19 -05:00
eslint.config.mjs Initial commit 2025-03-11 15:03:19 -05:00
LICENSE Initial commit 2025-03-11 15:03:19 -05:00
manifest.json Release 1.1.0 (#7) 2025-03-19 22:31:34 -05:00
package-lock.json Release 1.1.0 (#7) 2025-03-19 22:31:34 -05:00
package.json Release 1.1.0 (#7) 2025-03-19 22:31:34 -05:00
prettier.config.mjs Initial commit 2025-03-11 15:03:19 -05:00
README.md Rename windows-command to batch-command (#6) 2025-03-19 22:29:24 -05:00
simple-git-hooks.json Initial commit 2025-03-11 15:03:19 -05:00
tsconfig.json Initial commit 2025-03-11 15:03:19 -05:00
version.config.mjs Initial commit 2025-03-11 15:03:19 -05:00
versions.json Release 1.1.0 (#7) 2025-03-19 22:31:34 -05:00
vitest.config.mjs Initial commit 2025-03-11 15:03:19 -05:00

Obsidian Command Line

This plugin adds enhanced support for command line code blocks in Obsidian.

Features

  • Copy command lines from your notes without selecting text.
  • Prompts and output are removed from clipboard contents to support pasting into terminal sessions.
  • Default prompts are provided for command lines that do not specify one.
  • Optional syntax highlighting and styling using Prism Command Line.
  • Optional support for removing unnecessary white space from clipboard contents.
  • Supports mobile and desktop.

Getting Started

Command line code blocks are identified using one of the following languages:

Name Highlight Prompt Pattern Default Prompt Continuation
batch-command batch /\S*?>/ C:\> ^
powershell-command powershell /\S*?>/ PS> `
shell-command shell /\S*?[#$%]/ $ \

For example, copying the following code block to the clipboard will remove the prompt and output while preserving line continuations and white space:

```shell-command
$ command with \
    line continuation
and output, which will be removed
from the clipboard.
```

Note

If clipboard normalization is enabled in Settings, unnecessary white space (including line continuations) will be removed in addition to the prompt and output.

Contributing

Pull requests are welcome! See CONTRIBUTING.md for details.

License

Source code in this repository is licensed under a Simplified BSD License. See LICENSE for details.