Skip to content

Commit

Permalink
Add zf-native to telescope as default file sorter
Browse files Browse the repository at this point in the history
  • Loading branch information
tapayne88 committed Jan 21, 2024
1 parent e4396f8 commit 4c3a53d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion dot_config/nvim/lua/tap/plugins/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ return {
dependencies = { 'kkharji/sqlite.lua' },
},
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
'natecraddock/telescope-zf-native.nvim',
},
cmd = 'Telescope',
init = function()
Expand All @@ -27,6 +28,7 @@ return {
end, { desc = 'Give me Telescope!' })
nnoremap('<leader>l', function()
require('telescope.builtin').buffers {
sorter = require('telescope').extensions['zf-native'].native_zf_scorer(),
sort_lastused = true,
sort_mru = true,
show_all_buffers = true,
Expand Down Expand Up @@ -289,9 +291,21 @@ return {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
override_file_sorter = false,
case_mode = 'smart_case',
},
['zf-native'] = {
file = {
enable = true,
highlight_results = true,
match_filename = true,
},
generic = {
enable = false,
highlight_results = true,
match_filename = false,
},
},
live_grep_args = {
auto_quoting = true,
mappings = {
Expand All @@ -309,6 +323,7 @@ return {
require('telescope').load_extension 'smart_history'
require('telescope').load_extension 'fzf'
require('telescope').load_extension 'notify'
require('telescope').load_extension 'zf-native'

vim.opt.grepprg =
table.concat(require('telescope.config').values.vimgrep_arguments, ' ')
Expand Down

0 comments on commit 4c3a53d

Please # to comment.