Skip to content

Commit 1e6eef4

Browse files
committed
Add some config in demo to README and doc
Also make examples in README and doc more unified.
1 parent 39ac3ec commit 1e6eef4

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Configuration Example
4141
```vim
4242
let g:cycle_no_mappings = 1
4343
let g:cycle_max_conflict = 14
44-
let g:cycle_select_ui = 'ui.select'
44+
let g:cycle_select_ui = 'telescope'
4545
let g:cycle_conflict_ui = 'confirm'
4646
4747
nmap <silent> <LocalLeader>a <Plug>CycleNext
@@ -53,6 +53,7 @@ vmap <silent> <LocalLeader>ga <Plug>CycleSelect
5353
5454
let g:cycle_filetype_links = {
5555
\ 'ghmarkdown': 'markdown',
56+
\ 'typescriptreact': 'jsx',
5657
\ }
5758
5859
let g:cycle_default_groups = [
@@ -110,6 +111,12 @@ let g:cycle_default_groups_for_ruby = [
110111
\ ], #{regex: ['''\1''', ':\1', '"\1"\2']}]
111112
\ ]
112113
114+
" For "jsx" only (not real filetype, but linked from typescriptreact)
115+
let g:cycle_default_groups_for_jsx = [
116+
\ [['\v\="(.+)"', '\v\=''(.+)''', '\v\=\{`\$@!(.+)`}'], #{regex: ['=''\1''', '={`\1`}', '="\1"']}],
117+
\ [['={`${\(.\+\)}`}', '={`\@!\(.\+\)}'], #{regex: ['={\1}', '={`${\1}`}']}],
118+
\ ]
119+
113120
" For fileType "markdown" only
114121
let g:cycle_default_groups_for_markdown = [
115122
\ [['^\(\s*\)- \[ \] ', '^\(\s*\)- \[x\] '],

doc/cycle.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,8 @@ Configuration examples: *cycle-config-examples*
638638
General options:
639639
>
640640
let g:cycle_no_mappings = 1
641-
let g:cycle_max_conflict = 1
642-
let g:cycle_select_ui = 'ui.select'
641+
let g:cycle_max_conflict = 14
642+
let g:cycle_select_ui = 'telescope'
643643
let g:cycle_conflict_ui = 'confirm'
644644
<
645645

@@ -664,8 +664,7 @@ Global groups:
664664
\ [['on', 'off'], 'match_word'],
665665
\ [['+', '-']],
666666
\ [['>', '<']],
667-
\ [['"', "'"]],
668-
\ [['==', '!=']],
667+
\ [['==', '!='], { 'cond': function('s:not_lua_context') }],
669668
\ [['0', '1']],
670669
\ [['and', 'or']],
671670
\ [["in", "out"]],
@@ -727,6 +726,7 @@ Filetype specified groups:
727726
>
728727
let g:cycle_filetype_links = {
729728
\ 'ghmarkdown': 'markdown',
729+
\ 'typescriptreact': 'jsx',
730730
\ }
731731
732732
" ruby only
@@ -735,6 +735,12 @@ Filetype specified groups:
735735
\ [['stylesheet_link_tag ', 'javascript_include_tag ']],
736736
\ ]
737737
738+
" jsx only
739+
let g:cycle_default_groups_for_jsx = [
740+
\ [['\v\="(.+)"', '\v\=''(.+)''', '\v\=\{`\$@!(.+)`}'], #{regex: ['=''\1''', '={`\1`}', '="\1"']}],
741+
\ [['={`${\(.\+\)}`}', '={`\@!\(.\+\)}'], #{regex: ['={\1}', '={`${\1}`}']}],
742+
\ ]
743+
738744
" " demo how to convert 'switch.vim' definition:
739745
" " This cycles "foo" / 'foo' / :foo
740746
" let switch_vim_ruby_keyword_string = {

0 commit comments

Comments
 (0)