Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/princejoogie/dir-telescope.nvim
Perform telescope functions in a selected directory
https://github.com/princejoogie/dir-telescope.nvim
fuzzy-finder lua neovim neovim-plugin nvim nvim-plugin plugin telescope-extension vim
Last synced: 11 days ago
JSON representation
Perform telescope functions in a selected directory
- Host: GitHub
- URL: https://github.com/princejoogie/dir-telescope.nvim
- Owner: princejoogie
- License: other
- Created: 2022-10-19T08:23:45.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-27T00:49:00.000Z (2 months ago)
- Last Synced: 2024-08-28T02:51:14.509Z (2 months ago)
- Topics: fuzzy-finder, lua, neovim, neovim-plugin, nvim, nvim-plugin, plugin, telescope-extension, vim
- Language: Lua
- Homepage:
- Size: 50.8 KB
- Stars: 143
- Watchers: 3
- Forks: 9
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-pinoy-made - Github
- my-awesome-github-stars - princejoogie/dir-telescope.nvim - Perform telescope functions in a selected directory (Lua)
README
# dir-telescope.nvim
Perform [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) functions in selected directories
https://user-images.githubusercontent.com/47204120/196644189-ceb442bd-9528-4069-89dc-511ab1c98788.mp4
## Installation
- [packer.nvim](https://github.com/wbthomason/packer.nvim)
```lua
use({
"princejoogie/dir-telescope.nvim",
-- telescope.nvim is a required dependency
requires = {"nvim-telescope/telescope.nvim"},
config = function()
require("dir-telescope").setup({
-- these are the default options set
hidden = true,
no_ignore = false,
show_preview = true,
follow_symlinks = false,
})
end,
})
```## Usage
1. `dir-telescope` can be used in two ways, either as a telescope extension or as user commands.
2. the commands will open a telescope picker with the list of directories in your current working directory.
3. you can select a directory by hitting `Enter` or select multiple directories to filter with `Tab`
4. it will then perform either a `live_grep` or `find_files` on your selected directories
5. `(tip)`: `` will save your queries in a quickfix list. this is the default binding for `telescope.nvim`### With Telescope extensions
```lua
require("telescope").load_extension("dir")
```To use the extension simply run `:Telescope dir live_grep` or `:Telescope dir find_files`. These will respect the options you have set during configuration.
#### Setting keymaps for telescope extensions
```lua
vim.keymap.set("n", "fd", "Telescope dir live_grep", { noremap = true, silent = true })
vim.keymap.set("n", "pd", "Telescope dir find_files", { noremap = true, silent = true })
```#### Programatically call the extension
```lua
require("telescope").extensions.dir.live_grep()
require("telescope").extensions.dir.find_files()
```### With User commands
`dir-telescope` creates two user commands `:GrepInDirectory` and `:FileInDirectory` which you can map to any liking you want.
#### Setting keymaps for user commands
```lua
vim.keymap.set("n", "fd", "GrepInDirectory", { noremap = true, silent = true })
vim.keymap.set("n", "pd", "FileInDirectory", { noremap = true, silent = true })
```## Contributing
Intructions for contributing is documented in th [CONTRIBUTING.md](./CONTRIBUTING.md) guide
---
Made with ☕ by Prince Carlo Juguilon