-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
ctrlsf.lua
33 lines (28 loc) · 925 Bytes
/
ctrlsf.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
local config = require('one.config').config
return {
'dyng/ctrlsf.vim',
desc = 'Search all contents in workspace',
on = { '<Plug>CtrlSFPrompt', '<Plug>CtrlSFVwordPath', 'CtrlSF' },
keymaps = {
{ 'n', '<leader>f', '<Plug>CtrlSFPrompt' },
{ 'v', '<leader>f', '<Plug>CtrlSFVwordPath' },
},
defaultConfig = {
{ 'search', 'ctrlsf' },
{
ignore_dir = config.ignore.fileSearch.directories,
context = '-C 3',
auto_close = 0,
follow_symlinks = 0,
},
},
config = function()
local conf = config.search.ctrlsf
local g = vim.g
for key, value in pairs(config.search.ctrlsf) do g['ctrlsf_' .. key] = value end
-- TODO: For backward compatibility. To remove them later.
if conf.ignoreDir then g.ctrlsf_ignore_dir = conf.ignoreDir end
if conf.autoClose then vim.g.ctrlsf_auto_close = conf.autoClose end
if conf.followSymlinks then vim.g.ctrlsf_follow_symlinks = conf.followSymlinks end
end,
}