-
Notifications
You must be signed in to change notification settings - Fork 53
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
Noob question: How to create new project? #108
Comments
I had the same question and this is what I've found. Hope it helps you: Apparently, it all comes down to how the extension finds the root directory of the current project. There are two ways:
You can also have both, such that the if one is not detected, the other is used as a fallback. Unfortunately, I only found some explicit configuration files in the alternate version: https://github.com/ahmedkhalf/project.nvim. I don't know how you are configuring your nvim, but here's how mine is configured - I have a project.nvim file on the 'user' folder and I just call it on the init.lua by using (require("user.project)):
You can try pattern and LSP to see which one you like more, or just leave both and delete projects that you eventually don't use repeatedly. All the best, |
Hello @ckilb to add default projects your config of telescope should be like this
Also you can add new projects by Ctrl + a (within your project root dir) in popup and choose it by Ctrl + l |
i have a project with git initialized however when I open telescope project and then tap Ctrl + a, nothing happens. |
@finalclass did you bind another action to these keys? Try open telescope usually with Ctrl p then Ctrl a, quit vim then reopen project in vim, then Ctrl p, normally you should see your project there Also after tap Ctrl a, check logs with :messages |
@finalclass can you send your telescope config? I will try to reproduce, and you are right it looks like it's something with telescope at least according to the logs you sent. There written /home/sel is not a git directory I wonder if you put that path somewhere |
I load telescope with Packer: vim.cmd [[packadd packer.nvim]]
return require('packer').startup(function(use)
use("nvim-telescope/telescope.nvim")
use("nvim-telescope/telescope-project.nvim")
-- ... other modules ...
end)
local nnoremap = require("finalclass/keymap").nnoremap
require("telescope").load_extension("project")
nnoremap("<leader>ff", "<cmd>Telescope find_files<cr>")
nnoremap("<leader>fs", "<cmd>Telescope git_files<cr>")
nnoremap("<leader>fg", "<cmd>Telescope live_grep<cr>")
nnoremap("<leader>fb", "<cmd>Telescope buffers<cr>")
nnoremap("<leader>dh", "<cmd>Telescope help_tags<cr>")
nnoremap("<leader>fp", function()
require("telescope").extensions.project.project{}
end) Where keymap.lua is: local M = {}
local function bind(op, outer_opts)
outer_opts = outer_opts or {noremap = true}
return function(lhs, rhs, opts)
opts = vim.tbl_extend("force",
outer_opts,
opts or {}
)
vim.keymap.set(op, lhs, rhs, opts)
end
end
M.nmap = bind("n", {noremap = true})
-- M.imap = bind("i", {noremap = true})
M.nnoremap = bind("n")
M.vnoremap = bind("v")
M.xnoremap = bind("x")
M.inoremap = bind("i")
return M Should I have autochdir on? |
The problem most probably is because of my wrong assumption, that is: I assume that project is added based on a file I'm currently editing and not based on my working dir. When I open vim in a specific project (in a specific directory of the project) then it works fine. When I move out from this directory to some file from a different project then it stops working. I'm sorry I come from an emacs background (it's my second week in vim) and I think I treat vim too much like emacs:) |
Just came across this issue thread, and your response helped me solve the issue I was currently having. Cheers 🍻 @AntoscencoVladimir |
I successfully installed Telescope & this extension. If i launch neovim i can see this:
How am I able to create a project now?
If I simply press
c
(or ESC first for normal mode and thenc
) which is listed as the keyboard shortcut for creating a project nothing really happens.It would be nice to have some documentation how it works for Neovim beginners like me.
The text was updated successfully, but these errors were encountered: