{"id":15038317,"url":"https://github.com/esm7/obsidian-vimrc-support","last_synced_at":"2025-04-13T08:55:54.223Z","repository":{"id":38849429,"uuid":"309078472","full_name":"esm7/obsidian-vimrc-support","owner":"esm7","description":"A plugin for the Obsidian.md note-taking software","archived":false,"fork":false,"pushed_at":"2025-02-27T14:59:31.000Z","size":142,"stargazers_count":1221,"open_issues_count":90,"forks_count":55,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-06T05:06:38.468Z","etag":null,"topics":["obsidian-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/esm7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-01T11:13:56.000Z","updated_at":"2025-04-03T04:41:41.000Z","dependencies_parsed_at":"2024-07-23T19:57:08.801Z","dependency_job_id":"e8915819-22e4-4e82-9a0c-f3beb6c56c23","html_url":"https://github.com/esm7/obsidian-vimrc-support","commit_stats":{"total_commits":110,"total_committers":23,"mean_commits":4.782608695652174,"dds":0.6454545454545455,"last_synced_commit":"ba94e13835d079b4d83eaa178dd264cf74d6a23f"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esm7%2Fobsidian-vimrc-support","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esm7%2Fobsidian-vimrc-support/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esm7%2Fobsidian-vimrc-support/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esm7%2Fobsidian-vimrc-support/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esm7","download_url":"https://codeload.github.com/esm7/obsidian-vimrc-support/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688545,"owners_count":21145764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["obsidian-plugin"],"created_at":"2024-09-24T20:37:59.787Z","updated_at":"2025-04-13T08:55:54.186Z","avatar_url":"https://github.com/esm7.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/esm7"],"categories":["TypeScript"],"sub_categories":[],"readme":"# Obsidian Vimrc Support Plugin\r\n\r\n\u003e [!IMPORTANT]\r\n\u003e In Obsidian 1.7.2 and beyond, `\u003cCR\u003e` needs to be added for normal mode Ex command mappings, e.g. `nmap \u003cF9\u003e :nohl\u003cCR\u003e` instead of `nmap \u003cF9\u003e :nohl` (similarly to \"real\" Vim).\r\n\u003e This is due to a breaking change in the underlying `codemirror-vim` library.\r\n\u003e Normal mode movements, e.g. `map j gj`, remain as-is.\r\n\r\n\u003e [!NOTE]\r\n\u003e **Maintainer Needed!**\r\n\u003e \r\n\u003e While I am still around for some urgent fixes, especially when the plugin stops working due to Obsidian API changes, I am no longer able to give it the attention it deserves.\r\n\u003e \r\n\u003e Anyone who wishes to take over, please message me.\r\n\r\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/esm7)\r\n\r\nThis plugin loads a file of Vim commands from `path/to/VaultName/.obsidian.vimrc`.\r\nFor users of the Obsidian.md Vim mode, this is very useful for making various settings (most notably keymaps) persist.\r\n\r\nNote that this plugin is **not** the Vim support of Obsidian -- that support is built-in and you can perfectly use Obsidian in Vim mode without this plugin.\r\nThis plugin merely implements the ability to load a persistent configuration and adds a few extras.\r\n\r\n## Usage\r\n\r\nFirst and foremost, make sure you have the Obsidian Vim key bindings turned on -- see Editor -\u003e Vim key bindings.\r\n\r\nNow to keep some of your Vim settings permanent, install this plugin and put a file named `.obsidian.vimrc` in your vault root (*not* inside the `.obsidian` directory).\r\nIf you're using multiple vaults, you'll need this file on each one.\r\n\r\n**For iOS/iPadOS users**, it's highly recommended to set \"Paste from Other Apps\" of Obsidian to Allow, so there won't be annoying popups.\r\n\r\nHere's a simple \u0026 useful `.obsidian.vimrc` that I'm using:\r\n\r\n```vim\r\n\" Have j and k navigate visual lines rather than logical ones\r\nnmap j gj\r\nnmap k gk\r\n\" I like using H and L for beginning/end of line\r\nnmap H ^\r\nnmap L $\r\n\" Quickly remove search highlights\r\nnmap \u003cF9\u003e :nohl\u003cCR\u003e\r\n\r\n\" Yank to system clipboard\r\nset clipboard=unnamed\r\n\r\n\" Go back and forward with Ctrl+O and Ctrl+I\r\n\" (make sure to remove default Obsidian shortcuts for these to work)\r\nexmap back obcommand app:go-back\r\nnmap \u003cC-o\u003e :back\u003cCR\u003e\r\nexmap forward obcommand app:go-forward\r\nnmap \u003cC-i\u003e :forward\u003cCR\u003e\r\n```\r\n\r\n## Supported Commands\r\n\r\nThe commands that can be used are whatever CodeMirror supports.\r\nI couldn't find a formal list anywhere but you can look for `defaultExCommandMap` in [the source code](https://github.com/replit/codemirror-vim/blob/master/src/vim.js), or play around with trying commands in Obsidian's Vim mode.\r\n\r\nIn addition to that:\r\n- The plugin skips blank lines and lines starting with Vimscript comments (`\" ...`).\r\n- Special support for yanking to system clipboard can be activated by `set clipboard=unnamed` (`unnamedplus` will do the same thing).\r\n- Support for the `tabstop` Vim option (e.g. `set tabstop=4`).\r\n- Custom mapping/unmapping commands in addition to the defaults:\r\n  - `noremap`\r\n  - `iunmap`\r\n  - `nunmap`\r\n  - `vunmap`\r\n  - PRs are welcome to implement more :)\r\n- `exmap [commandName] [command...]`: a command to map Ex commands. This should basically be supported in regular `:map`, but doesn't work with multi-argument commands due to a CodeMirror bug, so this is a workaround.\r\n- `obcommand` - execute Obsidian commands, see more details below.\r\n- `cmcommand` - execute arbitrary CodeMirror commands, see details below.\r\n- `surround` - surround your selected text in visual mode or word in normal mode with text.\r\n- `pasteinto` - paste your current clipboard into your selected text in visual mode or word in normal mode. Useful for creating hyperlinks.\r\n- `jscommand` and `jsfile` - extend Vim mode using JavaScript snippets.\r\n- `source` - loads Vim commands from a file (relative to the vault root).\r\n\r\nCommands that fail don't generate any visible error for now.\r\n\r\n**Important tip!** Before adding commands to your Vimrc file, you should try them in Obsidian's normal mode (type '`:`' in the editor) to make sure they work as expected.\r\nCodeMirror's Vim mode has some limitations and bugs and not all commands will work like you'd expect.\r\nIn some cases you can find workarounds by experimenting, and the easiest way to do that is by trying interactively rather than via the Vimrc file.\r\n\r\nFinally, this plugin also provides the following motions/mappings by default:\r\n\r\n- `[[` and `]]` to jump to the previous and next Markdown heading.\r\n- `zk` and `zj` to move up and down while skipping folds.\r\n- `gl` and `gL` to jump to the next and previous link.\r\n- `gf` to open the link or file under the cursor (temporarily moving the cursor if necessary—e.g. if it's on the first square bracket of a [[Wikilink]]).\r\n\r\n## Installation\r\n\r\nIn the Obsidian.md settings under \"Community plugins\", click on \"Turn on community plugins\", then browse to this plugin.\r\n\r\nAlternatively (and less recommended), you can install it manually: just copy `main.js` and `manifest.json` to your vault `VaultFolder/.obsidian/plugins/obsidian-vimrc-support/`.\r\n\r\n## Support the Development\r\n\r\nIf you want to support the development of this plugin, please consider to [buy me a coffee](https://www.buymeacoffee.com/esm7).\r\n\r\n## \"Please implement \\[some Vim feature here\\]...\"\r\n\r\nI'd like to emphasize again that this plugin is a tweak to Obsidian's built-in Vim mode, which is in turn mostly the [`codemirror-vim` extension for CodeMirror](https://raw.githack.com/replit/codemirror-vim/master/dev/web-demo.html). And while I am personally very fond of helping everybody make use of Vim modes everywhere, this plugin is often not the best place to implement some types of features.\r\n\r\n1. Vim editor features (e.g. new motions) would best be implemented in `codemirror-vim`, so other editors using this component would enjoy them too! Please consider submitting issues or pull requests [there](https://github.com/replit/codemirror-vim) first.\r\n2. Features that are already implemented by other Obsidian plugins are best to stay in these plugins. Please consider asking these plugin authors to add Vim support for their features (using the CodeMirror API), or even better -- help them out :)\r\n\r\nHaving said that, adding features here in this plugin is often very easy thanks to the CodeMirror [API for extending its Vim mode](https://codemirror.net/doc/manual.html#vimapi_extending), so as the path of least resistance I will occassionally implement some requested Vim features and be happy to accept PRs.\r\n\r\nThings I'd love to add:\r\n- Implement some standard `vim-markdown` motions for Obsidian, e.g. `[[`, or implement for CodeMirror the 1-2 missing Ex commands required to define these keymaps in the Vimrc.\r\n\r\n## Change Vimrc File Location/Name\r\n\r\nIf you want the Vimrc file name or path to be different than the default, there is a plugin setting (under Settings | Plugin Options | Vimrc Support) to change that.\r\n\r\n## Executing Obsidian Commands with `obcommand`\r\n\r\nThe plugin defines a custom Ex command named `obcommand` to execute various Obsidian commands as an Ex command.\r\nThis is useful to map external functionality of Obsidian or other plugins to Vim shortcuts, but it's not as easy to use as one would hope.\r\n\r\nIf you just type `:obcommand` you'll get in the Developer Console (Ctrl+Shift+I) the list of commands that are currently defined by the app.\r\nThe simple syntax `:obcommand [commandName]` will execute the named command.\r\n\r\nSome useful examples:\r\n- `obcommand editor:insert-link`\r\n- `obcommand editor:toggle-comment`\r\n- `obcommand app:go-back`\r\n- `obcommand workspace:split-vertical`\r\n\r\nAnd many more.\r\n\r\n**WARNING:** this is not a formal API that Obsidian provides and is done in a rather hacky manner.\r\nIt's definitely possible that some future version of Obsidian will break this functionality.\r\n\r\n### Mapping Obsidian Commands Within Vim\r\n\r\nNext thing you probably wanna ask is \"how do I map the great Obsidian commands to Vim commands?\"\r\n\r\nThe trivial answer should have been something along the line of `:nmap \u003cC-o\u003e :obcommand app:go-back`, but this **does not work** because of an annoying CodeMirror bug.\r\nTurns out that the various mapping commands of CodeMirror pass only the first argument, so when you execute your mapping if defined as above, `:obcommand` would execute with no arguments.\r\n\r\nHere comes a custom command to the rescue, `exmap`, which you can use to \"alias\" Ex commands for longer Ex commands: `:exmap back obcommand app:go-back`.\r\nYou now have a simple (0 argument) Ex command named `back` that goes back in Obsidian, and *that* is something you can map.\r\n\r\nTo summarize, here's how you map `C-o` to Back:\r\n```\r\nexmap back obcommand app:go-back\r\nnmap \u003cC-o\u003e :back\u003cCR\u003e\r\n```\r\n\r\nNote how `exmap` lists command names without colons and in `nmap` the colon is required.\r\n\r\n## Surround Text with `surround`\r\n\r\nThe plugin defines a custom Ex command named `surround` to surround either your currently selected text in visual mode or the word your cursor is over in normal mode with text.\r\nThis is useful for Vim users who are used to the `vim-surround` plugin.\r\n\r\nThe syntax follows `:surround [prefixText] [postfixText]`.\r\n\r\nSome examples:\r\n\r\n- `surround ( )`\r\n- `surround \" \"`\r\n- `surround [[ ]]`\r\n\r\nHere's an example config that implements many of the features from vim-surround:\r\n\r\n```\r\nexmap surround_wiki surround [[ ]]\r\nexmap surround_double_quotes surround \" \"\r\nexmap surround_single_quotes surround ' '\r\nexmap surround_backticks surround ` `\r\nexmap surround_brackets surround ( )\r\nexmap surround_square_brackets surround [ ]\r\nexmap surround_curly_brackets surround { }\r\n\r\n\" NOTE: must use 'map' and not 'nmap'\r\nmap [[ :surround_wiki\u003cCR\u003e\r\nnunmap s\r\nvunmap s\r\nmap s\" :surround_double_quotes\u003cCR\u003e\r\nmap s' :surround_single_quotes\u003cCR\u003e\r\nmap s` :surround_backticks\u003cCR\u003e\r\nmap sb :surround_brackets\u003cCR\u003e\r\nmap s( :surround_brackets\u003cCR\u003e\r\nmap s) :surround_brackets\u003cCR\u003e\r\nmap s[ :surround_square_brackets\u003cCR\u003e\r\nmap s] :surround_square_brackets\u003cCR\u003e\r\nmap s{ :surround_curly_brackets\u003cCR\u003e\r\nmap s} :surround_curly_brackets\u003cCR\u003e\r\n```\r\n\r\nUsage:\r\n\r\n1. Select some text in visual mode, then press `s` and then the desired surround character. e.g. `s\"` to surround the selected text with double quotes.\r\n2. Place your cursor over a word in normal mode, then press `s` and then the desired surround character. e.g. `s\"` to surround the word with double quotes.\r\n\r\n## Inserting Links/Hyperlinks with `pasteinto`\r\n\r\nThe plugin defines a custom Ex command named `pasteinto` to paste text into your currently selected text in visual mode, or the word your cursor is over in normal mode.\r\nThis is particularly useful for creating links/hyperlinks `[selected-text](paste)`.\r\n\r\nHere's my hyperlink config as an example:\r\n```\r\n\" Maps pasteinto to Alt-p\r\nmap \u003cA-p\u003e :pasteinto\r\n```\r\n\r\n## Some Help with Binding Space Chords (Doom and Spacemacs fans)\r\n\r\n`\u003cSpace\u003e` can be bound to make chords, such as `\u003cSpace\u003efs` in conjunction with obcommand to save your current file and more.\r\nBut first `\u003cSpace\u003e` must be unbound with `unmap \u003cSpace\u003e`.\r\nAfterwards `\u003cSpace\u003e` can be mapped normally as any other key.\r\n\r\n\r\n## Emulate Common Vim Commands via Obsidian commands\r\n\r\nUsing `obcommand`, it is possible to emulate some additional Vim commands that aren't included in Obsidian's Vim mode, like for example `gt` and `zo`. \r\n\r\n```vim\r\n\" Emulate Folding https://vimhelp.org/fold.txt.html#fold-commands\r\nexmap togglefold obcommand editor:toggle-fold\r\nnmap zo :togglefold\u003cCR\u003e\r\nnmap zc :togglefold\u003cCR\u003e\r\nnmap za :togglefold\u003cCR\u003e\r\n\r\nexmap unfoldall obcommand editor:unfold-all\r\nnmap zR :unfoldall\u003cCR\u003e\r\n\r\nexmap foldall obcommand editor:fold-all\r\nnmap zM :foldall\u003cCR\u003e\r\n\r\nexmap tabnext obcommand workspace:next-tab\r\nnmap gt :tabnext\u003cCR\u003e\r\nexmap tabprev obcommand workspace:previous-tab\r\nnmap gT :tabprev\u003cCR\u003e\r\n\r\n```\r\n\r\n## Fixed Keyboard Layout in Normal Mode\r\n\r\nIn many languages and keyboard layouts it becomes problematic or plain impossible to use Vim keys.\r\nThe Vim keys are located in different positions on some keyboard layouts, which could be confusing when switching\r\nlayouts, and on some layouts (e.g. non-Western languages) the keys for Vim movements just don't exist.\r\nTo be able to use Vim mode with those layouts \u0026 languages, you can turn on the \"fixed keyboard layout\" feature in the\r\nplugin settings.\r\n\r\nWhen turned on for the first time, or when you click \"capture current layout\", your current keyboard layout is saved,\r\nand that will be the layout that is used when you are in Vim normal or visual mode.\r\nWhen you enter insert mode, you will type in your actual current system layout/language.\r\n\r\n**This feature is experimental and may have unintended side-effects relating to Obsidian or editor shortcuts.**\r\n\r\n## Relative Line Numbers\r\n\r\nRelative line numbers work very nicely with [this](https://github.com/nadavspi/obsidian-relative-line-numbers) Obsidian plugin (thank you @piotryordanov for bringing it to my attention!)\r\n\r\n## Extending Vim Commands with JavaScript Snippets\r\n\r\nThe plugin allows to define Vim commands that map to JavaScript snippets, which adds exciting new possibilities to what you can achieve with Vim key bindings. **But -- this comes with a price of a security risk, and is therefore disabled by default.**\r\n\r\n\u003e :warning: **Security Warning**\r\n\u003e \r\n\u003e Before using this feature, you **must be sure** that you understand its potential security implications.\r\n\u003e\r\n\u003e Running JavaScript snippets with Vim commands stored in your vault means that anyone who gains access to\r\n\u003e your notes can run arbitrary code inside your Obsidian app.\r\n\r\nIf you understand the risks and choose to use this feature, turn on \"Support JS Commands\" in the plugin settings and continue reading.\r\n\r\n### JavaScript Command Usage\r\n\r\nThere are two ways to define JS-based commands.\r\n\r\n#### JSCommand - JSFunction\r\n**The `jscommand` Ex command** defines a JS function that has an `editor: Editor`, a `view: MarkdownView` and a `selection: EditorSelection` arguments (see the [Obsidian API](https://github.com/obsidianmd/obsidian-api/blob/master/obsidian.d.ts) if you're not sure what these are).\r\nYou define only the body of the function, in a single line wrapped by curly braces, e.g.:\r\n\r\n```\r\njscommand { console.log(editor.getCursor()); }\r\n```\r\n\r\nThis will immediately log your current cursor position to the developer console.\r\nIf you want, you can make this an Ex command using `exmap`:\r\n\r\n```\r\nexmap logCursor jscommand { console.log(editor.getCursor()); }\r\nnmap \u003cC-q\u003e :logCursor\u003cCR\u003e\r\n```\r\n\r\n#### JSCommand - JSFile\r\nAnother version of the same functionality is **the `jsfile` Ex command**, which executes code from a file you give as a parameter, then appends another optional piece of code to it (e.g. in case you want to store several helper methods in a file and launch different ones as part of different commands).\r\n\r\nThe `jsfile` should be placed in your vault (alongside, e.g., your markdown files).\r\n\r\nAs above, the code running as part of `jsfile` has the arguments `editor: Editor`, `view: MarkdownView` and `selection: EditorSelection`.\r\n\r\nHere's an example `.obsidian.vimrc` entry that maps `]]` and `[[` to jump to the next/previous Markdown heading. Note that `]]` and `[[` are already provided by default in this plugin, but this is a good example of how to use `jsfile`:\r\n\r\n```\r\nexmap nextHeading jsfile mdHelpers.js {jumpHeading(true)}\r\nexmap prevHeading jsfile mdHelpers.js {jumpHeading(false)}\r\nnmap ]] :nextHeading\u003cCR\u003e\r\nnmap [[ :prevHeading\u003cCR\u003e\r\n```\r\n\r\nSee [here](JsSnippets.md) for the full example, and please contribute your own!\r\n\r\n### Custom Styles for Status Bar\r\n\r\nYou may utilize the vim mode display prompt class and the `data-vim-mode` attribute to \r\nadd styles to the status bar prompt (e.g. assign colors for different status). You can \r\nalso toggle the setting in settings page to also apply the display prompt class to the \r\nentire status bar container if you want some customizations on it.\r\n\r\nThe display prompt class: `vimrc-support-vim-mode`\r\n\r\nThe `data-vim-mode` values:\r\n\r\n| Mode    | Data Value (`data-vim-mode`) |\r\n| ------- | ---------------------------- |\r\n| normal  | `normal`                     |\r\n| insert  | `insert`                     |\r\n| visual  | `visual`                     |\r\n| replace | `replace`                    |\r\n\r\n#### Powerline Styling Snippet\r\n\r\n**Screenshots**\r\n\r\n\u003cimg width=\"1470\" alt=\"Screen Shot 2023-04-09 at 19 19 53\" src=\"https://user-images.githubusercontent.com/11176415/230812728-731e24d3-d667-478c-831c-14e0010e7973.png\"\u003e\r\n\u003cimg width=\"1470\" alt=\"Screen Shot 2023-04-09 at 19 20 09\" src=\"https://user-images.githubusercontent.com/11176415/230812731-26ba0c02-1948-4a26-89d2-3e73a11076d1.png\"\u003e\r\n\u003cimg width=\"1470\" alt=\"Screen Shot 2023-04-09 at 19 20 22\" src=\"https://user-images.githubusercontent.com/11176415/230812734-f51a01c9-5f80-4da7-b051-04018cc805cc.png\"\u003e\r\n\u003cimg width=\"1470\" alt=\"Screen Shot 2023-04-09 at 19 20 37\" src=\"https://user-images.githubusercontent.com/11176415/230812736-6fa688db-37b9-4b70-bacb-a6553b0762cb.png\"\u003e\r\n\r\n```css\r\ndiv.status-bar-item.plugin-obsidian-vimrc-support {\r\n  /* Papercolor theme */\r\n  --text-color-normal: #585858;\r\n  --text-color-insert: #005f87;\r\n  --text-color-visual: white;\r\n  --text-color-replace: white;\r\n\r\n  --background-color-normal: #eeeeee;\r\n  --background-color-insert: #eeeeee;\r\n  --background-color-visual: #d75f00;\r\n  --background-color-replace: #d70087;\r\n}\r\n\r\ndiv.status-bar-item.plugin-obsidian-vimrc-support {\r\n  /* \r\n    Move to bottom left corner and discard top/left/bottom space\r\n    from container paddings.\r\n   */\r\n  order: -9999;\r\n  margin: -4px auto -5px -5px;\r\n\r\n  /* \r\n    We have the :after pseudo-element next, so padding-right\r\n    is not needed\r\n    */\r\n  padding-right: 0px;\r\n  padding-left: 1em;\r\n\r\n  /* Use Monospace font */\r\n  font-family: 'MesloLGM Nerd Font Mono'; /* !!! Needs to be a powerline font */\r\n  font-weight: bold;\r\n  font-size: 1.2em;\r\n\r\n  /* Clear spaces made from radius borders */\r\n  border-top-right-radius: 0px;\r\n  border-bottom-right-radius: 0px;\r\n}\r\n\r\ndiv.status-bar-item.plugin-obsidian-vimrc-support:after {\r\n  /* Powerline separator character */\r\n  content: '';\r\n  position: relative;\r\n  font-size: 1.5rem;\r\n  left: 0.9rem;\r\n\r\n  /* Fine adjust the position */\r\n  margin-top: 0.1rem;\r\n}\r\n\r\n/* Normal */\r\ndiv.status-bar-item.vimrc-support-vim-mode[data-vim-mode=\"normal\"]:after {\r\n  color: var(--background-color-normal);\r\n}\r\ndiv.status-bar-item.vimrc-support-vim-mode[data-vim-mode=\"normal\"] {\r\n  color: var(--text-color-normal);\r\n  background-color: var(--background-color-normal);\r\n}\r\n\r\n/* Insert */\r\ndiv.status-bar-item.vimrc-support-vim-mode[data-vim-mode=\"insert\"]:after {\r\n  color: var(--background-color-insert);\r\n}\r\ndiv.status-bar-item.vimrc-support-vim-mode[data-vim-mode=\"insert\"] {\r\n  color: var(--text-color-insert);\r\n  background-color: var(--background-color-insert);\r\n}\r\n\r\n/* Visual */\r\ndiv.status-bar-item.vimrc-support-vim-mode[data-vim-mode=\"visual\"]:after {\r\n  color: var(--background-color-visual);\r\n}\r\ndiv.status-bar-item.vimrc-support-vim-mode[data-vim-mode=\"visual\"] {\r\n  color: var(--text-color-visual);\r\n  background-color: var(--background-color-visual);\r\n}\r\n\r\n/* Replace */\r\ndiv.status-bar-item.vimrc-support-vim-mode[data-vim-mode=\"replace\"]:after {\r\n  color: var(--background-color-replace);\r\n}\r\ndiv.status-bar-item.vimrc-support-vim-mode[data-vim-mode=\"replace\"] {\r\n  color: var(--text-color-replace);\r\n  background-color: var(--background-color-replace);\r\n}\r\n```\r\n\r\nNote that the above snippet uses powerline glygh for the triangular shape, so you need to install a [powerline font](https://github.com/powerline/fonts) to display correctly. And of course, feel free to change the CSS variables to whatever color palette you want!\r\n\r\n## Changelog\r\n\r\n### 0.10.2\r\n\r\n- Fixed https://github.com/esm7/obsidian-vimrc-support/pull/246 (thanks @baodrate!)\r\n\r\n### 0.10.1\r\n\r\n- Fixed https://github.com/esm7/obsidian-vimrc-support/issues/231 (thanks @alythobani!)\r\n- Fixed https://github.com/esm7/obsidian-vimrc-support/issues/232.\r\n\r\n### 0.10.0\r\n\r\n- Most notably, support for *many* new default mappings, see [here](https://github.com/esm7/obsidian-vimrc-support/pull/222) -- thanks @alythobani for this great contribution!\r\n- Fixed https://github.com/esm7/obsidian-vimrc-support/issues/228.\r\n- Added a license file, at last!\r\n\r\n\r\n### 0.9.0\r\n\r\nMultiple fixes and improvements, all contributed by @jiyee - thank you!\r\n\r\n- Fixed chord and Vim mode display issues (https://github.com/esm7/obsidian-vimrc-support/issues/149).\r\n- Added `source` command (https://github.com/esm7/obsidian-vimrc-support/issues/157)\r\n- Fixed Normal Mode Layout is back!\r\n\r\n### 0.8.0\r\n\r\n- The plugin is now marked as supporting mobile; thanks @Geniucker for taking this step, testing and documenting it!\r\n- Implemented `nunmap` and `vunmap`, which allow really nice `surround` implementation (see README). Thanks @dohsimpson!\r\n\r\n### 0.7.3\r\n\r\nFixed an issue in updating the last selection variable, leading to `jsFile` receiving an incorrect argument and (thanks @zjhcn!)\r\n\r\n### 0.7.2\r\n\r\nFixed the plugin breaking for some users after Obsidian's recent updates, plus some optimizations.\r\n\r\n### 0.7.1\r\n\r\nFixed `jscommand` and `jsfile` broken in the latest Obsidian update.\r\n\r\n### 0.7.0\r\n\r\n**IMPORTANT: this version drops support for the legacy (CM5) Obsidian editor.**\r\nIf you are sticking to the legacy editor until Obsidian removes it, you cannot upgrade to this version of the plugin.\r\n\r\n- Fixed multiple issues (like [this one](https://github.com/esm7/obsidian-vimrc-support/issues/118)) related to bad detection of the editor type.\r\n  - They were fixed by no longer trying to detect the editor type ;) Support for the legacy editor has become clumsy and it was time to drop it.\r\n- Support for Obsidian 0.15 multi windows (https://github.com/esm7/obsidian-vimrc-support/pull/110).\r\n\r\n### 0.6.3\r\n\r\nAdded `selection` also to `jsfile` (thanks @twio142!)\r\n\r\n### 0.6.2\r\n\r\n- Fixed the default Vimrc file name not used if the setting is overriden \u0026 empty.\r\n- Added a `selection` argument to `jscommand` (https://github.com/esm7/obsidian-vimrc-support/issues/99).\r\n\r\n### 0.6.1\r\n\r\n- Fixed backward selection error in `surround` (https://github.com/esm7/obsidian-vimrc-support/issues/91)\r\n\r\n### 0.6.0\r\n\r\n- The `surround` and `pasteinto` commands now work with the new (CM6-based) editor.\r\n- Made the existence of the Vimrc file not required for other plugin features to work (https://github.com/esm7/obsidian-vimrc-support/issues/89)\r\n- New exciting, but dangerous, `jscommand` and `jsfile` commands, that allow extending the plugin with JavaScript snippets.\r\n\r\n### 0.5.2\r\n\r\n- Fixed wrong detection of the editor (legacy vs new) on some occasions, leading to the plugin not really working in these situations.\r\n- Fixed issues related to Vim mode display with the new editor.\r\n\r\n### 0.5.1\r\n\r\n- Fixed a possible exception.\r\n\r\n### 0.5.0\r\n\r\nAdded partial support to the new (CM6-based) editor.\r\n\r\nPersonal note: the CM6 update landed while I'm going through extremely busy weeks.\r\nI was therefore not yet able to give it the full attention it deserves, but since many users need this plugin updated, I'm releasing it in a slightly immature state.\r\nThe core functionality works, but some plugin features are not yet supported in CM6, most notably `surround` (and its derivatives) and `cmcommand`.\r\n\r\nI'll do my best to find the time to complete the missing pieces in the next few days and handle reported issues quickly.\r\n\r\n### 0.4.6\r\n- Added the `cmcommand` command for executing arbitrary CodeMirror commands.\r\n\r\n### 0.4.5\r\nApparently the fix in version 0.4.4 was not good enough. Hopefully we're done with this issue now.\r\n\r\n### 0.4.4\r\n- Fix to an error constantly displayed in the console.\r\n\r\n### 0.4.3\r\n- Another fix to \"fixed keyboard layout in Normal mode\".\r\n- Added escape character backslash to surround command.\r\n\r\n### 0.4.2\r\n- Attempted fix to https://github.com/esm7/obsidian-vimrc-support/issues/42 (thanks @Andr3wD!)\r\n- Fix to \"fixed keyboard layout in Normal mode\" which was often not really working.\r\n\r\n### 0.4.1\r\n- Small fix in `surround`.\r\n\r\n### 0.4.0\r\n- `surround` and `pasteinto` commands (thanks @Andr3wD!)\r\n- Vim chord display (thanks @Andr3wD!)\r\n- Vim mode display (thanks @Andr3wD!)\r\n- Fixed [fold and unfold bug](https://github.com/esm7/obsidian-vimrc-support/issues/35).\r\n- The plugin now supports maintaining a fixed keyboard layout when in normal mode, if configured to do so.\r\n\r\n### 0.3.1\r\n\r\n- Fixed some commands not working via `obcommand` (https://github.com/esm7/obsidian-vimrc-support/issues/32)\r\n\r\n### 0.3.0\r\n\r\n- Added a settings file for the Vimrc file name (thank you @SalmanAlSaigal!)\r\n- Added the `exmap` Ex command.\r\n- Added the `obcommand` Ex command.\r\n\r\n### 0.2.4\r\n\r\nFixed a race condition with yank \u0026 paste: https://github.com/esm7/obsidian-vimrc-support/issues/11\r\n\r\n### 0.2.3\r\n\r\nAdded the `noremap` command, thanks @nadavspi!\r\n\r\n### 0.2.2\r\n\r\nAdded the `iunmap` command, thanks @hnsol!\r\n\r\n### 0.2.1\r\n\r\n- Fixed [this issue](https://github.com/esm7/obsidian-vimrc-support/issues/7): setting `clipboard=unnamed` also works for pasting now (it monitors the system clipboard and updates the yank buffer if a change is detected).\r\n- Support for the `tabstop` Vim option as asked [here](https://github.com/esm7/obsidian-vimrc-support/issues/3).\r\n\r\n### 0.2.0\r\n\r\nAdded support for yanking to system clipboard (see above), comments and blank lines.\r\n\r\n### 0.1.1\r\n\r\nFixed [an issue](https://github.com/esm7/obsidian-vimrc-support/issues/2) caused by the plugin injecting the Vimrc on every file load.\r\nThe plugin now injects the Vimrc just once for the CodeMirror class (for the class -- not object instance, because that's where CodeMirror keeps the Vim settings.)\r\n\r\nThis seems to work well, but in theory there could be Vimrc settings that are CodeMirror-object bound and not class-bound, and in that case we'll be in trouble (these settings will be lost when Obsidian replaces CodeMirror objects).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesm7%2Fobsidian-vimrc-support","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesm7%2Fobsidian-vimrc-support","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesm7%2Fobsidian-vimrc-support/lists"}