diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-09 15:55:41 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-09 15:55:41 +1200 |
commit | 6a03a3885c0483d5cf6ef05613e509986822a209 (patch) | |
tree | f1760ef0e6e6fae2ec1e14b4cb841027c0ea918b | |
parent | Merge branch 'hotfix/v0.1.2' (diff) | |
parent | Bump VERSION (diff) | |
download | vim-digraph-search-0.2.0.tar.gz (sig) vim-digraph-search-0.2.0.zip |
Merge branch 'release/v0.2.0'v0.2.0
* release/v0.2.0:
Remove unneeded variable scoping
Switch to two-spacing
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | autoload/digraph_search.vim | 44 | ||||
-rw-r--r-- | doc/digraph_search.txt | 10 | ||||
-rw-r--r-- | plugin/digraph_search.vim | 4 |
5 files changed, 32 insertions, 32 deletions
@@ -3,14 +3,14 @@ digraph\_search.vim This plugin provides an insert mode mapping target to search for digraphs by searching for a substring of the character's official name, per `:help -digraph-table` and `:help digraph-table-multibyte`. This is for situations +digraph-table` and `:help digraph-table-multibyte`. This is for situations where you might be able to remember part of the official name for a character, but you can't remember the digraph pieces. License ------- -Copyright (c) [Tom Ryder][1]. Distributed under the same terms as Vim itself. +Copyright (c) [Tom Ryder][1]. Distributed under the same terms as Vim itself. See `:help license`. [1]: https://sanctum.geek.nz/ @@ -1 +1 @@ -0.1.2 +0.2.0 diff --git a/autoload/digraph_search.vim b/autoload/digraph_search.vim index 172b17c..46b10a3 100644 --- a/autoload/digraph_search.vim +++ b/autoload/digraph_search.vim @@ -2,27 +2,27 @@ function! digraph_search#Search() abort " Get the search string - let l:search = input('Digraph search: ') - if !strlen(l:search) + let search = input('Digraph search: ') + if !strlen(search) return endif " Look for the uppercased search in the table - let l:results = [] - for l:digraph in digraph_search#Digraphs() - if stridx(l:digraph['name'], toupper(l:search)) != -1 - call add(l:results, l:digraph) + let results = [] + for digraph in digraph_search#Digraphs() + if stridx(digraph['name'], toupper(search)) != -1 + call add(results, digraph) endif endfor " Print results, or if there weren't any, say so redraw - echo 'Digraphs matching '.toupper(l:search).':' - if len(l:results) - for l:result in l:results - echo l:result['char'] - \.' '.l:result['keys'] - \.' '.l:result['name'] + echo 'Digraphs matching '.toupper(search).':' + if len(results) + for result in results + echo result['char'] + \.' '.result['keys'] + \.' '.result['name'] endfor else echo 'None!' @@ -36,19 +36,19 @@ function! digraph_search#Digraphs() abort " We haven't been called yet; get the digraph list if !exists('s:digraphs') let s:digraphs = [] - let l:table = 0 - for l:line in readfile($VIMRUNTIME.'/doc/digraph.txt') + let table = 0 + for line in readfile($VIMRUNTIME.'/doc/digraph.txt') " Flag whether we're in one of the digraph tables; look for the heading - let l:table = l:table && strlen(l:line) - \ || l:line =~# '\C\*digraph-table\%(-mbyte\)\=\*$' + let table = table && strlen(line) + \ || line =~# '\C\*digraph-table\%(-mbyte\)\=\*$' " Skip to next line if not in a table - if !l:table + if !table continue endif " Check whether this row matches a parseable digraph row - let l:match = matchlist(l:line, + let match = matchlist(line, \ '^\(\S\)\+\s\+' \ . '\(\S\S\)\s\+' \ . '\%(0x\)\=\x\+\s\+' @@ -56,15 +56,15 @@ function! digraph_search#Digraphs() abort \ . '\(.\+\)' \ ) " Skip to next line if not a table row match - if !len(l:match) + if !len(match) continue endif " Add to the digraphs list; key is digraph, value is full name call add(s:digraphs, { - \ 'char': l:match[1], - \ 'keys': l:match[2], - \ 'name': l:match[3], + \ 'char': match[1], + \ 'keys': match[2], + \ 'name': match[3], \ }) endfor endif diff --git a/doc/digraph_search.txt b/doc/digraph_search.txt index da25b2c..c94eb05 100644 --- a/doc/digraph_search.txt +++ b/doc/digraph_search.txt @@ -4,20 +4,20 @@ DESCRIPTION *digraph_search* This plugin provides an insert mode mapping target to search for |digraphs| by searching for a substring of the character's official name, per -|digraph-table| and |digraph-table-multibyte|. This is for situations where +|digraph-table| and |digraph-table-multibyte|. This is for situations where you might be able to remember part of the official name for a character, but you can't remember the digraph pieces. REQUIREMENTS *digraph_search-requirements* -This plugin only loads if 'compatible' is not set. It requires the |+digraphs| -feature, of course. +This plugin only loads if 'compatible' is not set. It requires the +|+digraphs| feature, of course. MAPPINGS *digraph_search-mappings* *<Plug>(DigraphSearch)* -The single insert mode mapping target is |<Plug>(DigraphSearch)|. There is no -default key mapping; you should define one yourself in your |vimrc|. For +The single insert mode mapping target is |<Plug>(DigraphSearch)|. There is no +default key mapping; you should define one yourself in your |vimrc|. For example: > imap <C-K><C-K> <Plug>(DigraphSearch) diff --git a/plugin/digraph_search.vim b/plugin/digraph_search.vim index 1d58d42..1923eb2 100644 --- a/plugin/digraph_search.vim +++ b/plugin/digraph_search.vim @@ -5,13 +5,13 @@ " Author: Tom Ryder <tom@sanctum.geek.nz> " License: Same as Vim itself " -if exists('g:loaded_digraph_search') || &compatible +if exists('loaded_digraph_search') || &compatible finish endif if !has('digraphs') || v:version < 700 finish endif -let g:loaded_digraph_search = 1 +let loaded_digraph_search = 1 " Set up mapping inoremap <silent> <unique> |