p00f / cphelper.nvim

Neovim helper for competitive programming. Use https://sr.ht/~p00f/cphelper.nvim instead
MIT License
130 stars 9 forks source link

Unable to Test the code #11

Closed proro485 closed 3 years ago

proro485 commented 3 years ago

:CphTest command is not working and giving the following error.

Issue1

p00f commented 3 years ago

Do :lcd %:p:h and then test (this changes neovim's working directory to match the current file)

proro485 commented 3 years ago

Thanks, it is working now. Do I have to do this everytime or was it just a one off?

p00f commented 3 years ago

It should not happen normally. If it happens again I'll reopen the issue

anurag3301 commented 2 years ago

Hey @proro485, there is an alternative automatic way which I use, you can also try. make the following change in packer config and install 'ygm2/rooter.nvim' along with cphelper

    use {
      'p00f/cphelper.nvim',
      requires = {
        'nvim-lua/plenary.nvim',
        'ygm2/rooter.nvim',
        opt = true
      }
    }

Now just add the following in the init.lua or anywhere else

-- Rooter config
vim.g.rooter_pattern = { 'input1', 'output1' }

If it detected the file input1 or output1, it will automatically cd into it. Hope it helps :)