{"id":16406817,"url":"https://github.com/terror/vim-tricks","last_synced_at":"2025-07-28T23:06:21.412Z","repository":{"id":107012172,"uuid":"363168487","full_name":"terror/vim-tricks","owner":"terror","description":"Notes on various vim tricks encountered over time. Mostly as a way to remember cool stuff.","archived":false,"fork":false,"pushed_at":"2021-04-30T16:40:22.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-25T08:57:00.611Z","etag":null,"topics":["vim"],"latest_commit_sha":null,"homepage":"","language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terror.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"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":"2021-04-30T14:37:34.000Z","updated_at":"2023-03-07T18:37:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"89ea0fca-1919-4de4-b1f3-dd4e2b3fcf8c","html_url":"https://github.com/terror/vim-tricks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/terror/vim-tricks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terror%2Fvim-tricks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terror%2Fvim-tricks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terror%2Fvim-tricks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terror%2Fvim-tricks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terror","download_url":"https://codeload.github.com/terror/vim-tricks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terror%2Fvim-tricks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267600091,"owners_count":24113713,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["vim"],"created_at":"2024-10-11T06:11:04.521Z","updated_at":"2025-07-28T23:06:21.395Z","avatar_url":"https://github.com/terror.png","language":"Vim script","funding_links":[],"categories":[],"sub_categories":[],"readme":"## \u003cp align='center'\u003evim tricks ✨\u003c/p\u003e\n\n\u003cp align='center'\u003e\n  Notes on various vim tricks encountered over time. Mostly as a way to remember cool stuff.\n\u003c/p\u003e\n\n## Sorting\n\n- `:sort` to sort lines\n- `:sort!` to sort lines in reverse order\n- `:sort n` to sort lines numerically\n- `:%!sort -u` to sort lines alphabetically, removing duplicate lines\n\n### Example\n\n[![asciicast](https://asciinema.org/a/kZrHhTCOgNHBgGs5IQ9HEJmp5.svg)](https://asciinema.org/a/kZrHhTCOgNHBgGs5IQ9HEJmp5)\n\n## Digraphs\n\nDigraphs are `special` characters such as the copyright symbol or accent grave.\n\n- `ctrl-K + \u003ctwo letter combo\u003e` to output a digraph (in insert mode)\n- A list of defined digraphs can be found by issuing the `:digraphs` command\n\n### Example\n\n[![asciicast](https://asciinema.org/a/Ei8v9b4WWBF7vVyboZBoNUsHV.svg)](https://asciinema.org/a/Ei8v9b4WWBF7vVyboZBoNUsHV)\n\n## Batch inserting\n\n- `ctrl-v` to enter V-BLOCK mode\n- `I` to edit\n- `Esc` to persist changes\n\n### Example\n\n[![asciicast](https://asciinema.org/a/eKOAyrdaKtxd0sZqcLchLNsBp.svg)](https://asciinema.org/a/eKOAyrdaKtxd0sZqcLchLNsBp)\n\n## Moving fast on lines\n\n- `^` to move to the beginning of the line\n- `$` to move to the end of the line\n- `w` to move to the beginning of the next word\n- `e` to move the the end of the next word\n- `b` to move to the beginning of the previous word\n- `gE` to move to the end of the previous word\n\n### Example\n\n[![asciicast](https://asciinema.org/a/khI5inqQovOn1b2tyujFYwX9U.svg)](https://asciinema.org/a/khI5inqQovOn1b2tyujFYwX9U)\n\n## Aligning text\n\nThere are a few commands for aligning text horizontally in vim\n\n- `:center` centers text\n- `:left` aligns text to the left\n- `:right` aligns text to the right\n\n### Example\n\n[![asciicast](https://asciinema.org/a/0xIOVtCTxidyWEUp73UY3lbF1.svg)](https://asciinema.org/a/0xIOVtCTxidyWEUp73UY3lbF1)\n\n## Retracing movements\n\nSometimes it's useful to jump to previously\nmodified positions in a file.\n\n- `'.` jump to last modified line\n- `` `.`` jump to exact spot in last modified line\n- `ctrl-O` retrace movements in file backwards (in\n  normal mode)\n- `ctrl-I` retrace movements in file forwards\n\n### Example\n\n[![asciicast](https://asciinema.org/a/ln86i0BzOUYSxctuAVVwIoQvs.svg)](https://asciinema.org/a/ln86i0BzOUYSxctuAVVwIoQvs)\n\n## Deleting/Changing inside X\n\nProgrammers often work with parentheses (), brackets []\nand curly braces {}. It's often useful to wipe or\nmodify contents in between them.\n\n- `di{insert key here}` to delete inside\n- `ci{insert key here}` to change inside\n\n### Nifty mappings\n\nRemapping the operators can save some time here:\n\n```vim\nonoremap b i[\nonoremap p i(\nonoremap cb i{\n```\n\n### Example\n\n[![asciicast](https://asciinema.org/a/zWHu591jlDFCvXEtso3cq9Fh3.svg)](https://asciinema.org/a/zWHu591jlDFCvXEtso3cq9Fh3)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterror%2Fvim-tricks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterror%2Fvim-tricks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterror%2Fvim-tricks/lists"}