File tree Expand file tree Collapse file tree 3 files changed +122
-0
lines changed
plugins/by-name/substitute
tests/test-sources/plugins/by-name/substitute Expand file tree Collapse file tree 3 files changed +122
-0
lines changed Original file line number Diff line number Diff line change 120120 githubId = 50964650 ;
121121 name = "gwen" ;
122122 } ;
123+ fwastring = {
124+ email = "fredrik@wastring.com" ;
125+ github = "fwastring" ;
126+ githubId = 25203388 ;
127+ name = "Fredrik Wastring" ;
128+ } ;
123129 jalil-salame = {
124130 email = "jalil.salame@gmail.com" ;
125131 github = "jalil-salame" ;
Original file line number Diff line number Diff line change 1+ {
2+ lib ,
3+ ...
4+ } :
5+ lib . nixvim . plugins . mkNeovimPlugin {
6+ name = "substitute" ;
7+ package = "substitute-nvim" ;
8+ description = "Operator to substitute and exchange text objects quickly." ;
9+
10+ maintainers = [ lib . maintainers . fwastring ] ;
11+
12+ settingsExample = {
13+ on_substitute = lib . nixvim . nestedLiteralLua ''
14+ function(params)
15+ vim.notify("substituted using register " .. params.register)
16+ end
17+ '' ;
18+
19+ yank_substituted_text = true ;
20+ modifiers = [
21+ "join"
22+ "trim"
23+ ] ;
24+ highlight_substituted_text . timer = 750 ;
25+ range = {
26+ prefix = "S" ;
27+ complete_word = true ;
28+ confirm = true ;
29+ subject . motion = "iw" ;
30+ range . motion = "ap" ;
31+ suffix = "| call histdel(':', -1)" ;
32+ auto_apply = true ;
33+ cursor_position = "start" ;
34+ } ;
35+ exchange = {
36+ motion = "ap" ;
37+ use_esc_to_cancel = false ;
38+ preserve_cursor_position = true ;
39+ } ;
40+ } ;
41+ }
Original file line number Diff line number Diff line change 1+ { lib } :
2+ {
3+ empty = {
4+ plugins . substitute . enable = true ;
5+ } ;
6+
7+ defaults = {
8+ plugins . substitute = {
9+ enable = true ;
10+ settings = {
11+ on_substitute = lib . nixvim . mkRaw "nil" ;
12+ yank_substituted_text = false ;
13+ preserve_cursor_position = false ;
14+ modifiers = lib . nixvim . mkRaw "nil" ;
15+
16+ highlight_substituted_text = {
17+ enabled = true ;
18+ timer = 500 ;
19+ } ;
20+ range = {
21+ prefix = "s" ;
22+ prompt_current_text = false ;
23+ confirm = false ;
24+ complete_word = false ;
25+ group_substituted_text = false ;
26+ subject = lib . nixvim . mkRaw "nil" ;
27+ range = lib . nixvim . mkRaw "nil" ;
28+ register = lib . nixvim . mkRaw "nil" ;
29+ suffix = "" ;
30+ auto_apply = false ;
31+ cursor_position = "end" ;
32+ } ;
33+ exchange = {
34+ motion = lib . nixvim . mkRaw "nil" ;
35+ use_esc_to_cancel = true ;
36+ preserve_cursor_position = false ;
37+ } ;
38+ } ;
39+ } ;
40+ } ;
41+
42+ example = {
43+ plugins . substitute = {
44+ enable = true ;
45+ settings = {
46+ on_substitute = lib . nixvim . mkRaw ''
47+ function(params)
48+ vim.notify("substituted using register " .. params.register)
49+ end
50+ '' ;
51+ yank_substituted_text = true ;
52+ modifiers = [
53+ "join"
54+ "trim"
55+ ] ;
56+ highlight_substituted_text . timer = 750 ;
57+ range = {
58+ prefix = "S" ;
59+ complete_word = true ;
60+ confirm = true ;
61+ subject . motion = "iw" ;
62+ range . motion = "ap" ;
63+ suffix = "| call histdel(':', -1)" ;
64+ auto_apply = true ;
65+ cursor_position = "start" ;
66+ } ;
67+ exchange = {
68+ motion = "ap" ;
69+ use_esc_to_cancel = false ;
70+ preserve_cursor_position = true ;
71+ } ;
72+ } ;
73+ } ;
74+ } ;
75+ }
You can’t perform that action at this time.
0 commit comments