diff options
| author | Ariel D'Alessandro <ariel.dalessandro@auto1.com> | 2023-01-23 10:38:06 +0100 |
|---|---|---|
| committer | Ariel D'Alessandro <ariel.dalessandro@auto1.com> | 2023-01-23 10:38:06 +0100 |
| commit | a29ebc56106bab0d865e17e7e1e63dbb5e0e456a (patch) | |
| tree | b093530df2edb4c4ccc68e61819447097ad2e049 /lua | |
| parent | 093e305968b6e913bdeee5aea4cf0d5fe5ee756c (diff) | |
| download | nvim-conf-a29ebc56106bab0d865e17e7e1e63dbb5e0e456a.tar.gz nvim-conf-a29ebc56106bab0d865e17e7e1e63dbb5e0e456a.zip | |
feat: error handle for telescope mappings
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/alpha/telescope/init.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lua/alpha/telescope/init.lua b/lua/alpha/telescope/init.lua index c717cb6..bfddbc3 100644 --- a/lua/alpha/telescope/init.lua +++ b/lua/alpha/telescope/init.lua @@ -85,8 +85,12 @@ function M.find_symbol() end function M.my_plugins() + if vim.fn.isdirectory("~/code/plugins/") == 0 then + vim.notify("Directory ~/code/plugins does not exists", vim.log.levels.WARN, { title = "Telescope Mappings" }) + return + end require("telescope.builtin").find_files({ - cwd = "~/plugins/", + cwd = "~/code/plugins/", }) end @@ -99,6 +103,10 @@ function M.laravel_commands() end function M.api_specs() + if vim.fn.isdirectory("./api-specification") == 0 then + vim.notify("Directory api-specification does not exists", vim.log.levels.WARN, { title = "Telescope Mappings" }) + return + end require("telescope.builtin").git_files({ cwd = "./api-specification", show_untracked = true, |