diff options
| author | anott03 <amitav_nott@ryecountryday.org> | 2021-01-25 13:20:01 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-25 19:20:01 +0100 |
| commit | ccbb7f56384921a81813f0f9ebc85cdba0b7c255 (patch) | |
| tree | 107739be676bda2e004e191e6a7c114aa172e399 /README.md | |
| parent | 5bf9e14f10023d5ab8182b33a80fca68cd174f79 (diff) | |
fix: move to actions.select as default action (#465)
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -278,11 +278,11 @@ require('telescope').setup{ -- So, to not map "<C-n>", just put ["<c-x>"] = false, -- Otherwise, just set the mapping to the function that you want it to be. - ["<C-i>"] = actions.goto_file_selection_split, + ["<C-i>"] = actions.hselect, -- Add up multiple actions - ["<CR>"] = actions.goto_file_selection_edit + actions.center, + ["<CR>"] = actions.select + actions.center, -- You can perform as many actions in a row as you like - ["<CR>"] = actions.goto_file_selection_edit + actions.center + my_cool_custom_action, + ["<CR>"] = actions.select + actions.center + my_cool_custom_action, }, n = { ["<esc>"] = actions.close @@ -302,8 +302,8 @@ local actions = require('telescope.actions') ------------------------------ require('telescope.builtin').fd({ -- or new custom picker's attach_mappings field: attach_mappings = function(prompt_bufnr) - -- This will replace goto_file_selection_edit no mather on which key it is mapped by default - actions.goto_file_selection_edit:replace(function() + -- This will replace select no mather on which key it is mapped by default + actions.select:replace(function() local entry = actions.get_selected_entry() actions.close(prompt_bufnr) print(vim.inspect(entry)) @@ -311,17 +311,17 @@ require('telescope.builtin').fd({ -- or new custom picker's attach_mappings fiel end) -- You can also enhance an action with pre and post action which will run before of after an action - actions.goto_file_selection_split:enhance ({ + actions.hselect:enhance ({ pre = function() - -- Will run before actions.goto_file_selection_split + -- Will run before actions.hselect end, post = function() - -- Will run after actions.goto_file_selection_split + -- Will run after actions.hselect end, }) -- Or replace for all commands: edit, new, vnew and tab - actions._goto_file_selection:replace(function(_, cmd) + actions._select:replace(function(_, cmd) print(cmd) -- Will print edit, new, vnew or tab depending on your keystroke end) @@ -339,21 +339,21 @@ require('telescope.builtin').fd({ -- or new custom picker's attach_mappings fiel <!-- finder = finders.new_table(results), --> <!-- sorter = sorters.fuzzy_with_index_bias(), --> <!-- attach_mappings = function(prompt_bufnr) --> -<!-- -- This will replace goto_file_selection_edit no mather on which key it is mapped by default --> -<!-- actions.goto_file_selection_edit:replace(function() --> +<!-- -- This will replace select no mather on which key it is mapped by default --> +<!-- actions.select:replace(function() --> <!-- -- Code here --> <!-- end) --> <!-- -- You can also enhance an action with post and post action which will run before of after an action --> -<!-- actions.goto_file_selection_split:enhance { --> +<!-- actions.hselect:enhance { --> <!-- pre = function() --> -<!-- -- Will run before actions.goto_file_selection_split --> +<!-- -- Will run before actions.hselect --> <!-- end, --> <!-- post = function() --> -<!-- -- Will run after actions.goto_file_selection_split --> +<!-- -- Will run after actions.hselect --> <!-- end, --> <!-- } --> <!-- -- Or replace for all commands: edit, new, vnew and tab --> -<!-- actions._goto_file_selection:replace(function(_, cmd) --> +<!-- actions._select:replace(function(_, cmd) --> <!-- print(cmd) -- Will print edit, new, vnew or tab depending on your keystroke --> <!-- end) --> <!-- return true --> |
