Skip to content

Commit

Permalink
refactor: remove useless
Browse files Browse the repository at this point in the history
  • Loading branch information
phanen committed Jul 14, 2024
1 parent df56f7f commit 85cb3f9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions lua/fzf-lua-overlay/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ local M = {}

M.opts = {
dot_dir = '~',
dot_dirs = { '~' },
note_dir = '~/notes',
todo_dir = '~/notes/todo/',
snip_dir = '~/notes/snip/',
cache_dir = vim.fs.joinpath(vim.g.cache_dir or vim.fn.stdpath 'cache', 'fzf-lua-overlay'),
cache_dir = vim.fs.joinpath(vim.g.state_path or vim.fn.stdpath 'state', 'fzf-lua-overlay'),
}

M.setup = function(opts) M.opts = vim.tbl_deep_extend('force', M.opts, opts or {}) end
Expand Down
2 changes: 1 addition & 1 deletion lua/fzf-lua-overlay/providers/find_dots.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ M.opts = {
formatter = 'path.filename_first',
cwd = cfg.dot_dir,
cmd = ([[rg --color=never --files --hidden %s --follow --no-messages -g "!.git"]]):format(
table.concat(cfg.dot_dirs, ' ')
table.concat({ cfg.dot_dir }, ' ')
),
}

Expand Down
2 changes: 1 addition & 1 deletion lua/fzf-lua-overlay/providers/grep_dots.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ M.opts = {
prompt = 'grep_dots> ',
cwd = cfg.dot_dir,
cmd = ([[rg %s --column --line-number --no-heading --color=always --smart-case --max-columns=4096 -e]]):format(
table.concat(cfg.dot_dirs, ' ')
table.concat({ cfg.dot_dir }, ' ')
),
}

Expand Down
5 changes: 1 addition & 4 deletions lua/fzf-lua-overlay/providers/grep_notes.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
local cfg = require('fzf-lua-overlay.config').opts

local notes_history = vim.fs.joinpath(cfg.cache_dir, 'notes_history')

local M = {}

M.name = 'live_grep_native'
Expand All @@ -11,10 +9,9 @@ M.opts = {
actions = {
['ctrl-g'] = function()
local last_query = require('fzf-lua').get_last_query()
return require('fzf-lua-overlay').find_notes({ query = last_query })
return require('fzf-lua-overlay').find_notes { query = last_query }
end,
},
fzf_opts = { ['--history'] = notes_history },
}

return M

0 comments on commit 85cb3f9

Please sign in to comment.