{"id":13475014,"url":"https://github.com/unblevable/quick-scope","last_synced_at":"2025-05-14T14:08:11.542Z","repository":{"id":33266152,"uuid":"36910694","full_name":"unblevable/quick-scope","owner":"unblevable","description":"Lightning fast left-right movement in Vim","archived":false,"fork":false,"pushed_at":"2025-01-27T21:15:03.000Z","size":213,"stargazers_count":1459,"open_issues_count":11,"forks_count":52,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-12T14:15:21.561Z","etag":null,"topics":["vim","vim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","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/unblevable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2015-06-05T03:53:23.000Z","updated_at":"2025-04-12T09:17:30.000Z","dependencies_parsed_at":"2022-07-11T09:17:26.592Z","dependency_job_id":"cf3952e4-7a64-414f-8501-238162e2bd7e","html_url":"https://github.com/unblevable/quick-scope","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unblevable%2Fquick-scope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unblevable%2Fquick-scope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unblevable%2Fquick-scope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unblevable%2Fquick-scope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unblevable","download_url":"https://codeload.github.com/unblevable/quick-scope/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254159688,"owners_count":22024564,"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":["vim","vim-plugin"],"created_at":"2024-07-31T16:01:16.691Z","updated_at":"2025-05-14T14:08:11.519Z","avatar_url":"https://github.com/unblevable.png","language":"Vim Script","readme":"# quick-scope\nAn always-on highlight for a unique character in every word on a line to help\nyou use \u003ckbd\u003ef\u003c/kbd\u003e, \u003ckbd\u003eF\u003c/kbd\u003e and family.\n\n![screencast3](https://cloud.githubusercontent.com/assets/723755/8230149/6ecbed28-158b-11e5-9474-89e846e7682c.gif)\n\nThis plugin should help you get to any word on a line in two or three\nkeystrokes with Vim's built-in \u003ckbd\u003ef\u0026lt;char\u0026gt;\u003c/kbd\u003e (which moves your cursor to\n\u003ckbd\u003e\u0026lt;char\u0026gt;\u003c/kbd\u003e).\n\n+ [Overview](#overview)\n  + [Features](#features)\n  + [Benefits](#benefits)\n+ [Installation](#installation)\n+ [Options](#options)\n  + [Highlight on key press](#highlight-on-key-press)\n  + [Customize colors](#customize-colors)\n  + [Toggle highlighting](#toggle-highlighting)\n  + [Disable on long lines](#disable-plugin-on-long-lines)\n  + [Blacklist buftypes](#blacklist-buftypes)\n  + [Blacklist filetypes](#blacklist-filetypes)\n  + [Customize Accepted Characters](#accepted-characters)\n  + [Lazy Highlight](#lazy-highlight)\n+ [Moving Across a Line](#moving-across-a-line)\n  + [Character motions](#character-motions)\n  + [Other motions](#other-motions)\n\n## Overview\nWhen moving across a line, the \u003ckbd\u003ef\u003c/kbd\u003e, \u003ckbd\u003eF\u003c/kbd\u003e, \u003ckbd\u003et\u003c/kbd\u003e and\n\u003ckbd\u003eT\u003c/kbd\u003e motions combined with \u003ckbd\u003e;\u003c/kbd\u003e and \u003ckbd\u003e,\u003c/kbd\u003e should be your\ngo-to options for [many reasons](#advantages). Quick-scope fixes their only\ndrawback: it is difficult to consistently choose the right characters to\ntarget.\n\n### Features\n+ Quick-scope highlights the first occurrences of characters to the left and\n  right of your cursor (**green** in the screencast), once per word, every time\n  your cursor moves.\n\n  ![screencast0](https://cloud.githubusercontent.com/assets/723755/8228892/5cf6798e-1580-11e5-8ed4-379d676e7dba.gif)\n\n+ If a word does not contain a first occurrence of a character but contains a\n  second occurrence of a character, that character is highlighted in another\n  color (**blue** in the screencast).\n\n  ![screencast1](https://cloud.githubusercontent.com/assets/723755/8228897/6603ab28-1580-11e5-82cc-b048e3801edb.gif)\n\n+ Quick-scope takes extra measures to avoid bombarding you with superfluous\n  colors:\n  + It ignores special characters since they are easy to eye and tend to only\n    appear once or twice on a line.\n\n    ![screencast2](https://cloud.githubusercontent.com/assets/723755/8229126/1abf997c-1582-11e5-872c-eff92386abca.gif)\n\n  + By default, it samples colors from your active color scheme for its\n    highlighting.\n\n    ![screencast3](https://cloud.githubusercontent.com/assets/723755/8230149/6ecbed28-158b-11e5-9474-89e846e7682c.gif)\n\n### Benefits\n+ Highlighting is done automatically.\n  + You already know what character to target before pressing any keys.\n  + No more guesswork or slowing down to reason about the character motions.\n+ This plugin neither introduces new motions nor overrides built-in ones.\n  + You don't have to learn any new commands or mappings.\n  + This helps you to become a better user of vanilla Vim.\n\n## Installation\n\n[![LuaRocks](https://img.shields.io/luarocks/v/unblevable/quick-scope?logo=lua\u0026color=purple)](https://luarocks.org/modules/unblevable/quick-scope)\n\nUse your favorite plugin manager.\n```vim\n\" Your .vimrc\n\nPlug 'unblevable/quick-scope'       \" Plug\nNeoBundle 'unblevable/quick-scope'  \" xor NeoBundle\nPlugin 'unblevable/quick-scope'     \" xor Vundle\n```\n```sh\n$ git clone https://github.com/unblevable/quick-scope ~/.vim/bundle/quick-scope # xor Pathogen\n```\n\n## Options\n### Highlight on key press\n```vim\n\" Your .vimrc\n\n\" Trigger a highlight in the appropriate direction when pressing these keys:\nlet g:qs_highlight_on_keys = ['f', 'F', 't', 'T']\n\n\" Trigger a highlight only when pressing f and F.\nlet g:qs_highlight_on_keys = ['f', 'F']\n```\n\nQuick-scope determines the highlighting mode (always on, vs highlight on key\npress) when the plugin is initialized. This means that if you want highlight on\nkeys functionality this value must be set before the `plugin/quick_scope.vim`\nfile is sourced. For more details about it or details about symptoms you may\nencounter see discussion in issues\n[#72](https://github.com/unblevable/quick-scope/issues/72) and\n[#98](https://github.com/unblevable/quick-scope/issues/98).\n\n### Customize colors\nQuick-scope directly makes use of highlight groups called `QuickScopePrimary`\nand `QuickScopeSecondary`. By default `QuickScopePrimary` is linked to the\n`Function` group and `QuickScopeSecondary` is linked to the `Define` group. You\ncan customize them by adding your own `:highlight` commands.\n```vim\n\" Your .vimrc\nhighlight QuickScopePrimary guifg='#afff5f' gui=underline ctermfg=155 cterm=underline\nhighlight QuickScopeSecondary guifg='#5fffff' gui=underline ctermfg=81 cterm=underline\n```\n\nHowever, it is recommended to put them in an `autocmd` so that they are updated\nif and when the colorscheme changes. To achieve this you should put the\nfollowing block before you set `colorscheme \u003ccolorsname\u003e` (**Note:** if you do\nit after you will not see your colors).\n```vim\n\" Your .vimrc\n\naugroup qs_colors\n  autocmd!\n  autocmd ColorScheme * highlight QuickScopePrimary guifg='#afff5f' gui=underline ctermfg=155 cterm=underline\n  autocmd ColorScheme * highlight QuickScopeSecondary guifg='#5fffff' gui=underline ctermfg=81 cterm=underline\naugroup END\n```\n\nThe highlight groups are applied using a priority (see: `:help :syn-priority`\nand `:help matchadd()` for more detail). The default priority used is `1` but\nyou can override this if needed by setting it yourself using:\n```vim\nlet g:qs_hi_priority = 2\n```\n\n### Toggle highlighting\nTurn the highlighting on and off with a user command:\n```\n:QuickScopeToggle\n```\nOr create a custom mapping for the toggle.\n```vim\n\" Your .vimrc\n\n\" Map the leader key + q to toggle quick-scope's highlighting in normal/visual mode.\n\" Note that you must use nmap/xmap instead of their non-recursive versions (nnoremap/xnoremap).\nnmap \u003cleader\u003eq \u003cplug\u003e(QuickScopeToggle)\nxmap \u003cleader\u003eq \u003cplug\u003e(QuickScopeToggle)\n```\n\nSetting `g:qs_enable` equal to zero will start the plugin disabled. (default: 1)\n```vim\n\" Your .vimrc\n\nlet g:qs_enable=0\n```\n\nAdditionally, setting the buffer local variable `b:qs_local_disable` will have\nthe same effect on a specific buffer.\n```vim\nlet b:qs_local_disable=1\n```\n\n### Disable plugin on long lines\nTurn off this plugin when the length of line is longer than `g:qs_max_chars`.\n(default: 1000)\n```vim\n\" Your .vimrc\n\nlet g:qs_max_chars=80\n```\n\n### Blacklist buftypes\n\nSetting `g:qs_buftype_blacklist` to a list of buffer types disables the plugin when\nentering certain `buftype`'s. For example, to disable this plugin when for terminals and\nfloating windows without filetypes set, put the following in your `vimrc`:\n\n```vim\nlet g:qs_buftype_blacklist = ['terminal', 'nofile']\n```\n\n### Blacklist filetypes\n\nSetting `g:qs_filetype_blacklist` to a list of file types disables the plugin when\nentering certain `filetypes`'s. For example, to disable this plugin for\n[dashboard-nvim](https://github.com/glepnir/dashboard-nvim) and\n[vim-startify](https://github.com/mhinz/vim-startify), put the following in your `vimrc`:\n\n```vim\nlet g:qs_filetype_blacklist = ['dashboard', 'startify']\n```\n\n### Accepted Characters\nThe option `g:qs_accepted_chars` is a list of characters that quick-scope will\nhighlight. (default: a list of `a-z, A-Z, 0-9`)\n```vim\n\" Your .vimrc\n\nlet g:qs_accepted_chars = [ 'a', 'b', ... etc ]\n```\n\n### Lazy Highlight\nThe option `g:qs_lazy_highlight` can be used to change the vanilla highlight\nmode autocmd event from `CursorMoved` to `CursorHold`. This option is provided\nto reduce the slowdown caused by vanilla highlight mode in large terminals.\n(default: `0`)\n```vim\n\" Your .vimrc\n\nlet g:qs_lazy_highlight = 1\n```\n\n### Highlighting delay\nThe option `g:qs_delay` can be used to set the delay duration after which the\nhighlighting starts if the cursor is not moved. This option increases\nperformance. Taken into account only if `g:qs_lazy_highlight` and\n`g:qs_highlight_on_keys` are not enabled. If you set this to 0, the\nhighlighting will be synchronous. It requires `has('timers')`. (default: `50`)\n```vim\nlet g:qs_delay = 0\n```\n\n## Moving Across a Line\nThis section provides a detailed look at the most common and useful options for\nmoving your cursor across a line in Vim. When you are aware of the existing\ntools available to you and their trade-offs, you can better understand the\nbenefits of this plugin.\n\n### Character motions\n\nI unofficially refer to \u003ckbd\u003ef\u003c/kbd\u003e, \u003ckbd\u003eF\u003c/kbd\u003e, \u003ckbd\u003et\u003c/kbd\u003e, \u003ckbd\u003eT\u003c/kbd\u003e,\n\u003ckbd\u003e;\u003c/kbd\u003e and \u003ckbd\u003e,\u003c/kbd\u003e as the **character motions**. They form your\nswiss army knife for moving across a line:\n\n#### Advantages\n+ The motions are easy to reason about. Simply choose a character and then move\n  your cursor to it. (And with quick-scope, the best characters to choose are\n  always identified for you.)\n+ They are versatile. You can usually move your cursor to any word on a line in\n  a single motion.\n+ Yet they are also precise. You specify an exact location to move your cursor.\n+ The key combinations are quick to execute and efficient in terms of number of\n  key presses. It should only take 2 or 3 key presses to move your cursor to\n  where you want it to be.\n+ The \u003ckbd\u003ef\u003c/kbd\u003e key in particular sits comfortably on home row of the\n  keyboard.\n+ Vim includes a set of two dedicated keys, \u003ckbd\u003e;\u003c/kbd\u003e and \u003ckbd\u003e,\u003c/kbd\u003e, just\n  to make it easier to repeat the character motions and offset bad character\n  targets.\n\n#### Reference\n*You can also consult Vim's excellent help docs for information about any\ncommand using `:h \u003ccommand\u003e`.*\n```\nf\u003cchar\u003e moves your cursor to the first occurrence of \u003cchar\u003e to the right.\n\nfg\nIt's just like the story of the grasshopper and the octopus.\n^ \u003e \u003e \u003e \u003e \u003e \u003e \u003e \u003e \u003e \u003e \u003e \u003e \u003e \u003e \u003e ^\n\n```\n```\nF\u003cchar\u003e moves your cursor to the first occurrence of \u003cchar\u003e to the left.\n\nFl\nAll year long, the grasshopper kept burying acorns for winter,\n         ^ \u003c \u003c \u003c \u003c \u003c \u003c \u003c \u003c \u003c \u003c ^\n```\n\u003ckbd\u003et\u003c/kbd\u003e and \u003ckbd\u003eT\u003c/kbd\u003e can be just as useful. Notice how \u003ckbd\u003etf\u003c/kbd\u003e\nis the most optimal way to reach the word `off` in the example below.\n```\nt\u003cchar\u003e moves your cursor right before the first occurrence of \u003cchar\u003e to the right.\n\ntf\nwhile the octopus mooched off his girlfriend and watched TV.\n      ^ \u003e \u003e \u003e \u003e \u003e \u003e \u003e \u003e \u003e ^\n```\n```\nT\u003cchar\u003e moves your cursor right before the first occurrence of \u003cchar\u003e to the left.\n\nTs\nBut then the winter came, and the grasshopper died, and the octopus ate all his acorns.\n                                       ^ \u003c \u003c \u003c \u003c ^\n```\nThe character motions can take a preceding `count`, but in practice, Vim users\ntend to use the \u003ckbd\u003e;\u003c/kbd\u003e and \u003ckbd\u003e,\u003c/kbd\u003e to repeat a character motion any\nnumber of times.\n```\n; repeats the last character motion in the original direction.\n\nfa;;\nAnd also he got a racecar.\n^ \u003e ^\nAnd also he got a racecar.\n    ^ \u003e \u003e \u003e \u003e \u003e ^\n```\n```\n, repeats the last character motion in the opposite direction.\n\nfs,\nIs any of this getting through to you?\n   ^ \u003e \u003e \u003e \u003e ^\nIs any of this getting through to you?\n ^ \u003c \u003c \u003c \u003c \u003c ^\n```\n\n### Other motions\n+ Note that many of Vim's motions can take a preceding `count`, e.g.\n  \u003ckbd\u003e2w\u003c/kbd\u003e moves your cursor two words to the right. However, in most\n  cases I would advise you **not** to use a `count`:\n  + The number keys tend to be awkward to reach.\n  + It is silly to waste time counting things before using a motion.\n  + There are probably more effective ways to get to where you want in one or\n    two keystrokes anyway (usually with \u003ckbd\u003ef\u003c/kbd\u003e and co. or simply by\n    repeating the motion).\n\n+ \u003ckbd\u003eb\u003c/kbd\u003e, \u003ckbd\u003eB\u003c/kbd\u003e, \u003ckbd\u003ew\u003c/kbd\u003e, \u003ckbd\u003eW\u003c/kbd\u003e, \u003ckbd\u003ege\u003c/kbd\u003e,\n  \u003ckbd\u003egE\u003c/kbd\u003e, \u003ckbd\u003ee\u003c/kbd\u003e, \u003ckbd\u003eE\u003c/kbd\u003e\n\n  The word motions. They are usually the optimal choices for moving your cursor\n  a distance of one or two words. (See `:h word` for Vim's definition of a\n  word.) Take advantage of the fact that some of these keys ignore special\n  characters or target the beginning or end of words.\n\n+ \u003ckbd\u003e0\u003c/kbd\u003e, \u003ckbd\u003e^\u003c/kbd\u003e, \u003ckbd\u003e$\u003c/kbd\u003e\n\n  These keys let you skip to the beginning or end of a line. They are\n  especially useful for repositioning your cursor for another motion on long\n  lines.\n\n  You might want to map \u003ckbd\u003e0\u003c/kbd\u003e to \u003ckbd\u003e^\u003c/kbd\u003e because \u003ckbd\u003e^\u003c/kbd\u003e tends\n  to be the preferred functionality but \u003ckbd\u003e0\u003c/kbd\u003e is easier to reach.\n  ```vim\n  \" Your .vimrc\n\n  \" Move across wrapped lines like regular lines\n  noremap 0 ^ \" Go to the first non-blank character of a line\n  noremap ^ 0 \" Just in case you need to go to the very beginning of a line\n  ```\n\n+ \u003ckbd\u003eh\u003c/kbd\u003e, \u003ckbd\u003el\u003c/kbd\u003e\n\n  Try to avoid spamming these keys at all costs, but bear in mind that they\n  *are* the most optimal ways to move your cursor one or two spaces.\n\n+ \u003ckbd\u003e?\u003c/kbd\u003e, \u003ckbd\u003e/\u003c/kbd\u003e\n\n  The search keys. They are overkill for moving across a line.\n  + Much of their behavior overlaps with that of the superior character\n    motions.\n  + \u003ckbd\u003e/\u003c/kbd\u003e + `pattern` + \u003ckbd\u003eReturn\u003c/kbd\u003e amounts to a wildly\n    inefficient number of keystrokes.\n  + Searches pollute your buffer with lingering highlights.\n\n+ \u003ckbd\u003e(\u003c/kbd\u003e, \u003ckbd\u003e)\u003c/kbd\u003e\n\n  These keys let you move across sentences. (See `:h sentence` for Vim's\n  definition of a sentence.) They can also be convenient when working with\n  programming languages that occasionally have `!` or `?` at the end of words,\n  e.g. Ruby and Elixir.\n","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funblevable%2Fquick-scope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funblevable%2Fquick-scope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funblevable%2Fquick-scope/lists"}