Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Telescope mappings in normal and insert mode #231

Merged
merged 1 commit into from Feb 10, 2023
Merged

Improved Telescope mappings in normal and insert mode #231

merged 1 commit into from Feb 10, 2023

Conversation

sourproton
Copy link
Contributor

I saw @Cretezy 's pull request and realized I made the same modifications in my own config, but with move_selection_next and move_selection_previous instead of cycle_history. So, this PR

  • In insert mode
    • Adds <C-j>/<C-k> to scroll in results list
    • Adds <C-n>/<C-p> to scroll in preview
  • In normal mode
    • Adds q to quit

@folke folke merged commit fd0a0e8 into LazyVim:main Feb 10, 2023
@folke folke mentioned this pull request Feb 10, 2023
@ditsuke
Copy link
Contributor

ditsuke commented Feb 10, 2023

Made the same mod in my config, thanks for adding here!

@sourproton
Copy link
Contributor Author

Thank you @folke for accepting the PR. On the Telescope subject, in my config I also have nvim-telescope/telescope-file-browser.nvim setup in the following way

{
    "nvim-telescope/telescope-file-browser.nvim",
    dependencies = { "nvim-telescope/telescope.nvim" },
    config = function()
        require("telescope").load_extension "file_browser"
    end,
    keys = {
        { "<leader>fd", "<cmd>Telescope file_browser<cr>", desc = "File Browser (cwd)" },
    },
}

Would you be interested in having this merged too ?

@folke
Copy link
Collaborator

folke commented Feb 10, 2023

I don't think it's all that useful, given that we already have neo-tree and Telescope find_files.

@sourproton
Copy link
Contributor Author

sourproton commented Feb 10, 2023

I agree. I just thought it would be worth it asking.

Finally, I also have jpalardy/vim-slime setup to work with the Julia and Python REPLs with tmux. I think this is even less worth it merging, but I think others would like having this template to build their configs upon (there aren't that many examples on how to nicely work with REPLs and NeoVim).

Where do you think would be the ideal place to showcase it?

-- slime (REPL integration)
{
    "jpalardy/vim-slime",
    keys = {
        { "<leader>rc", "<cmd>SlimeConfig<cr>",               desc = "Slime Config" },
        { "<leader>rr", "<Plug>SlimeSendCell<BAR>/^# %%<CR>", desc = "Slime Send Cell" },
    },
    config = function()
        vim.g.slime_target = "tmux"
        vim.g.slime_cell_delimiter = "# %%"
        vim.g.slime_bracketed_paste = 1
    end,
},

@folke
Copy link
Collaborator

folke commented Feb 10, 2023

You can use https://github.com/LazyVim/LazyVim/discussions/categories/show-and-tell for that.

@sourproton sourproton deleted the improve-telescope-navigation branch February 10, 2023 21:06
@folke
Copy link
Collaborator

folke commented Feb 11, 2023

Hi! I just wanted to let you know that I changed the Telescope keybindings to make them more consistent with cmp / signature help and hover.

<c-f> and <c-b> should now be used for scrolling the preview. This is the same as used for the cmp doc window, signature help and for scrolling the hover window.

I've also removed the new <c-i> and <c-j> mappings since in other places we also use the default way of navigating a list with <c-n> and <c-p>. Again this is to make all mappings more consistent.

You can of course still override this in your own mappings if that's what you prefer.

ofrades pushed a commit to ofrades/LazyVim that referenced this pull request May 30, 2023
joshmedeski pushed a commit to joshmedeski/LazyVim that referenced this pull request Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants