-
-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugins/telescope: add project extension
- Loading branch information
1 parent
e07a482
commit 974b1d2
Showing
4 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
./live-greps-args.nix | ||
./manix.nix | ||
./media-files.nix | ||
./project.nix | ||
./ui-select.nix | ||
./undo.nix | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
let | ||
mkExtension = import ./_mk-extension.nix; | ||
in | ||
mkExtension { | ||
name = "project"; | ||
package = "telescope-project-nvim"; | ||
|
||
settingsExample = { | ||
base_dirs = [ | ||
"~/dev/src" | ||
"~/dev/src2" | ||
{ | ||
__unkeyed-1 = "~/dev/src3"; | ||
max_depth = 4; | ||
} | ||
{ path = "~/dev/src4"; } | ||
{ | ||
path = "~/dev/src5"; | ||
max_depth = 2; | ||
} | ||
]; | ||
hidden_files = true; | ||
theme = "dropdown"; | ||
order_by = "asc"; | ||
search_by = "title"; | ||
sync_with_nvim_tree = true; | ||
on_project_selected.__raw = '' | ||
function(prompt_bufnr) | ||
require("telescope._extensions.project.actions").change_working_directory(prompt_bufnr, false) | ||
require("harpoon.ui").nav_file(1) | ||
end | ||
''; | ||
}; | ||
} |
104 changes: 104 additions & 0 deletions
104
tests/test-sources/plugins/by-name/telescope/project.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{ | ||
empty = { | ||
# Tries to create a file on loading | ||
test.runNvim = false; | ||
plugins.telescope = { | ||
enable = true; | ||
extensions.project.enable = true; | ||
}; | ||
plugins.web-devicons.enable = true; | ||
}; | ||
|
||
default = { | ||
# Tries to create a file on loading | ||
test.runNvim = false; | ||
plugins.telescope = { | ||
enable = true; | ||
|
||
extensions.project = { | ||
enable = true; | ||
|
||
settings = { | ||
base_dirs = null; | ||
cd_scope = [ | ||
"tab" | ||
"window" | ||
]; | ||
hidden_files = false; | ||
order_by = "recent"; | ||
search_by = "title"; | ||
sync_with_nvim_tree = false; | ||
on_project_selected.__raw = "require('telescope._extensions.project.actions').find_project_files"; | ||
mappings = { | ||
n = { | ||
"d".__raw = "require('telescope._extensions.project.actions').delete_project"; | ||
"r".__raw = "require('telescope._extensions.project.actions').rename_project"; | ||
"c".__raw = "require('telescope._extensions.project.actions').add_project"; | ||
"C".__raw = "require('telescope._extensions.project.actions').add_project_cwd"; | ||
"f".__raw = "require('telescope._extensions.project.actions').find_project_files"; | ||
"b".__raw = "require('telescope._extensions.project.actions').browse_project_files"; | ||
"s".__raw = "require('telescope._extensions.project.actions').search_in_project_files"; | ||
"R".__raw = "require('telescope._extensions.project.actions').recent_project_files"; | ||
"w".__raw = "require('telescope._extensions.project.actions').change_working_directory"; | ||
"o".__raw = "require('telescope._extensions.project.actions').next_cd_scope"; | ||
}; | ||
i = { | ||
"<c-d>".__raw = "require('telescope._extensions.project.actions').delete_project"; | ||
"<c-v>".__raw = "require('telescope._extensions.project.actions').rename_project"; | ||
"<c-a>".__raw = "require('telescope._extensions.project.actions').add_project"; | ||
"<c-A>".__raw = "require('telescope._extensions.project.actions').add_project_cwd"; | ||
"<c-f>".__raw = "require('telescope._extensions.project.actions').find_project_files"; | ||
"<c-b>".__raw = "require('telescope._extensions.project.actions').browse_project_files"; | ||
"<c-s>".__raw = "require('telescope._extensions.project.actions').search_in_project_files"; | ||
"<c-r>".__raw = "require('telescope._extensions.project.actions').recent_project_files"; | ||
"<c-l>".__raw = "require('telescope._extensions.project.actions').change_working_directory"; | ||
"<c-o>".__raw = "require('telescope._extensions.project.actions').next_cd_scope"; | ||
"<c-w>".__raw = "require('telescope._extensions.project.actions').change_workspace"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
plugins.web-devicons.enable = true; | ||
}; | ||
|
||
example = { | ||
# Tries to create a file on loading | ||
test.runNvim = false; | ||
plugins.telescope = { | ||
enable = true; | ||
|
||
extensions.project = { | ||
enable = true; | ||
|
||
settings = { | ||
base_dirs = [ | ||
"~/dev/src" | ||
"~/dev/src2" | ||
{ | ||
__unkeyed-1 = "~/dev/src3"; | ||
max_depth = 4; | ||
} | ||
{ path = "~/dev/src4"; } | ||
{ | ||
path = "~/dev/src5"; | ||
max_depth = 2; | ||
} | ||
]; | ||
hidden_files = true; | ||
theme = "dropdown"; | ||
order_by = "asc"; | ||
search_by = "title"; | ||
sync_with_nvim_tree = true; | ||
on_project_selected.__raw = '' | ||
function(prompt_bufnr) | ||
require('telescope._extensions.project.actions').change_working_directory(prompt_bufnr, false) | ||
require("harpoon.ui").nav_file(1) | ||
end | ||
''; | ||
}; | ||
}; | ||
}; | ||
plugins.web-devicons.enable = true; | ||
}; | ||
} |