10
10
:Telescope advanced_git_search {function_name}
11
11
```
12
12
13
- or in lua
13
+ #### or in lua
14
14
15
15
``` lua
16
16
require (' telescope' ).extensions .advanced_git_search .{function_name }()
17
17
```
18
18
19
+ #### or through another Telescope picker
20
+
21
+ execute ` :AdvancedGitSearch ` , choose your picker and press ` <CR> `
22
+
19
23
### 🔎 Enter a query
20
24
21
25
Your usual telescope experience. See the individual commands for the grep behaviour.
@@ -27,26 +31,66 @@ the author name.
27
31
28
32
## ⚡️Commands
29
33
30
- ### 1. diff_branch_file
34
+ ### 1. search_log_content -- Search in repo log content
31
35
32
- Opens a Telescope window with a list of local branches
36
+ Opens a Telescope window with a list of all previous commit.
33
37
34
- _ Grep behaviour_ : filter on branch name .
38
+ _ Grep behaviour_ : filter on added, updated or removed code (log content: ` -G ` option in git) .
35
39
36
40
#### _ Keymaps_
37
41
38
- - ` <CR> ` opens a diff for the current file with the selected branch
42
+ - ` <CR> ` Opens a diff of the current file with the selected commit
43
+ - ` <C-e> ` show the entire commit for all files in neovim with diff plugin
44
+ - ` <C-o> ` Open the selected commit in the browser
45
+ - ` <C-y> ` copy the commit hash to clipboard
46
+
47
+ ### 2. search_log_content_file -- Search in file log content
48
+
49
+ Opens a Telescope window with a list of git commits that changed the
50
+ current file (renames included).
51
+
52
+ _ Grep behaviour_ : filter on added, updated or removed code (log content: ` -G ` option in git).
53
+
54
+ #### _ Keymaps_
55
+
56
+ - ` <CR> ` Opens a diff of the current file with the selected commit
57
+ - ` <C-e> ` show the entire commit for all files in neovim with diff plugin
58
+ - ` <C-o> ` Open the selected commit in the browser
59
+ - ` <C-y> ` copy the commit hash to clipboard
60
+
61
+ ### 3. diff_commit_file -- Diff current file with commit
62
+
63
+ Opens a Telescope window with a list of git commits that changed the
64
+ current file (renames included).
65
+
66
+ _ Grep behaviour_ : filter on commit message.
39
67
40
- ### 2. diff_commit_line
68
+ #### _ Keymaps_
69
+
70
+ - ` <CR> ` Opens a diff of the current file with the selected commit
71
+ - ` <C-e> ` show the entire commit for all files in neovim with diff plugin
72
+ - ` <C-o> ` Open the selected commit in the browser
73
+ - ` <C-y> ` copy the commit hash to clipboard
74
+
75
+ ### 4. diff_commit_line -- Diff current file with selected line history
41
76
42
77
Opens a Telescope window with a list of previous commit logs with respect to
43
78
selected lines
44
79
45
80
_ Grep behaviour_ : filter on commit message.
46
81
47
- Note: First you have to select the lines in visual mode, then go back to normal
82
+ #### How to use
83
+
84
+ _ The following only applies when you use one of the commands below._
85
+
86
+ ``` vim
87
+ :Telescope advanced_git_search diff_commit_line
88
+ :lua require('telescope').extensions.advanced_git_search.diff_commit_line()
89
+ ```
90
+
91
+ First you have to select the lines in visual mode, then go back to normal
48
92
mode and execute this command.
49
- To make this a bit easier, you can wrap it in a user command and define a keybind:
93
+ To make a bit easier, you can wrap it in a user command and define a keybind:
50
94
51
95
``` lua
52
96
vim .api .nvim_create_user_command (
@@ -63,55 +107,26 @@ vim.api.nvim_set_keymap(
63
107
)
64
108
```
65
109
110
+ No extra setup is needed when you use ` :AdvancedGitSearch ` .
111
+
66
112
#### _ Keymaps_
67
113
68
114
- ` <CR> ` opens a diff for the current file with the corresponding file on the selected commit
69
115
- ` <C-e> ` show the entire commit for all files in neovim with diff plugin
70
116
- ` <C-o> ` opens a the selected commit in the browser
71
117
- ` <C-y> ` copy the commit hash to clipboard
72
118
73
- ### 3. diff_commit_file
74
-
75
- Opens a Telescope window with a list of git commits that changed the
76
- current file (renames included).
77
-
78
- _ Grep behaviour_ : filter on commit message.
79
-
80
- #### _ Keymaps_
81
-
82
- - ` <CR> ` Opens a diff of the current file with the selected commit
83
- - ` <C-e> ` show the entire commit for all files in neovim with diff plugin
84
- - ` <C-o> ` Open the selected commit in the browser
85
- - ` <C-y> ` copy the commit hash to clipboard
86
-
87
- ### 4. search_log_content
88
-
89
- Opens a Telescope window with a list of all previous commit.
90
-
91
- _ Grep behaviour_ : filter on added, updated or removed code (log content: ` -G ` option in git).
119
+ ### 5. diff_branch_file -- Diff file with branch
92
120
93
- #### _ Keymaps_
94
-
95
- - ` <CR> ` Opens a diff of the current file with the selected commit
96
- - ` <C-e> ` show the entire commit for all files in neovim with diff plugin
97
- - ` <C-o> ` Open the selected commit in the browser
98
- - ` <C-y> ` copy the commit hash to clipboard
99
-
100
- ### 5. search_log_content_file
101
-
102
- Opens a Telescope window with a list of git commits that changed the
103
- current file (renames included).
121
+ Opens a Telescope window with a list of local branches
104
122
105
- _ Grep behaviour_ : filter on added, updated or removed code (log content: ` -G ` option in git) .
123
+ _ Grep behaviour_ : filter on branch name .
106
124
107
125
#### _ Keymaps_
108
126
109
- - ` <CR> ` Opens a diff of the current file with the selected commit
110
- - ` <C-e> ` show the entire commit for all files in neovim with diff plugin
111
- - ` <C-o> ` Open the selected commit in the browser
112
- - ` <C-y> ` copy the commit hash to clipboard
127
+ - ` <CR> ` opens a diff for the current file with the selected branch
113
128
114
- ### 6. changed_on_branch
129
+ ### 6. changed_on_branch -- Changed on current branch (experimental)
115
130
116
131
Opens a Telescope window with a list of changed files on the current branch (including staged files).
117
132
The fork point of the current branch is determined with the following command:
@@ -133,7 +148,7 @@ _Grep behaviour_: filter on filename.
133
148
134
149
- ` <CR> ` opens the selected file.
135
150
136
- ### 7. checkout_reflog
151
+ ### 7. checkout_reflog -- Checkout from reflog
137
152
138
153
Opens a Telescope window with all reflog entries
139
154
@@ -144,6 +159,7 @@ Opens a Telescope window with all reflog entries
144
159
### 8. show_custom_functions
145
160
146
161
A telescope picker for all functions above.
162
+ Enable ` show_builtin_git_pickers ` to additionally show Telescopes builtin git pickers.
147
163
148
164
## ⚙️ Installation
149
165
@@ -160,12 +176,14 @@ With Lazy
160
176
advanced_git_search = {
161
177
-- fugitive or diffview
162
178
diff_plugin = " fugitive" ,
163
- -- customize git in previewer
179
+ -- customize git in previewer
164
180
-- e.g. flags such as { "--no-pager" }, or { "-c", "delta.side-by-side=false" }
165
181
git_flags = {},
166
- -- customize git diff in previewer
182
+ -- customize git diff in previewer
167
183
-- e.g. flags such as { "--raw" }
168
184
git_diff_flags = {},
185
+ -- Show builtin git pickers when executing "show_custom_functions" or :AdvancedGitSearch
186
+ show_builtin_git_pickers = false ,
169
187
}
170
188
}
171
189
}
@@ -196,14 +214,16 @@ With Packer
196
214
-- move this to the place where you call the telescope setup function
197
215
extensions = {
198
216
advanced_git_search = {
199
- -- fugitive or diffview
217
+ -- Fugitive or diffview
200
218
diff_plugin = " fugitive" ,
201
- -- customize git in previewer
219
+ -- Customize git in previewer
202
220
-- e.g. flags such as { "--no-pager" }, or { "-c", "delta.side-by-side=false" }
203
221
git_flags = {},
204
- -- customize git diff in previewer
222
+ -- Customize git diff in previewer
205
223
-- e.g. flags such as { "--raw" }
206
224
git_diff_flags = {},
225
+ -- Show builtin git pickers when executing "show_custom_functions" or :AdvancedGitSearch
226
+ show_builtin_git_pickers = false ,
207
227
}
208
228
}
209
229
}
0 commit comments