feat(nvim): automatically find files

Run "nvim +GoToFile" to open Neovim and automatically open Telescope to
find the file that I need.

The idea was taken from @joshmedeski when he mentioned it in a podcast
with @nicknisi.

https://youtu.be/17o9QrCcF_o
https://github.com/joshmedeski/dotfiles/search?q=GoToFile
This commit is contained in:
Oliver Davies 2023-02-24 09:40:43 +00:00
parent 223412970a
commit f603d40156

View file

@ -41,4 +41,12 @@ local nmap = require("opdavies.keymap").nmap
nmap { "<leader>gm", telescope.extensions.git_worktree.create_git_worktree }
nmap { "<leader>gw", telescope.extensions.git_worktree.git_worktrees }
-- Create a command to open Telescope, can be used when starting nvim -
-- "e.g. nvim +GoToFile".
vim.api.nvim_create_user_command(
"GoToFile",
telescope.fd,
{}
)
return telescope_mapper