telescope.nvim icon indicating copy to clipboard operation
telescope.nvim copied to clipboard

Windows: Use / instead of \ in paths

Open Yohnny777 opened this issue 2 years ago • 3 comments

Typing \ when searching on Windows is really annoying, I would rather use forward slashes.

Describe the solution you'd like A clear and concise description of what you want to happen.

There should be a way to make 'assets/image' search resolve 'assets\image'.

Yohnny777 avatar Jan 23 '23 16:01 Yohnny777

A workaround for this would be to specify a custom find_command.

I had the same issue on my windows machine but if you have ripgrep there's a handy --path-separator flag you can use to change the default \ on windows.

This is what I have for reference

   pickers = {
      find_files = {
         hidden = true,
         find_command = {
            'rg',
            '--files',
            '--color=never',
            '--no-heading',
            '--line-number',
            '--column',
            '--smart-case',
            '--hidden',
            '--glob',
            '!{.git/*,.svelte-kit/*,target/*,node_modules/*}',
            '--path-separator',
            '/',
         },
      }
   }

KevinSilvester avatar Apr 27 '23 00:04 KevinSilvester

A workaround for this would be to specify a custom find_command.

I had the same issue on my windows machine but if you have ripgrep there's a handy --path-separator flag you can use to change the default \ on windows.

This is what I have for reference

   pickers = {
      find_files = {
         hidden = true,
         find_command = {
            'rg',
            '--files',
            '--color=never',
            '--no-heading',
            '--line-number',
            '--column',
            '--smart-case',
            '--hidden',
            '--glob',
            '!{.git/*,.svelte-kit/*,target/*,node_modules/*}',
            '--path-separator',
            '/',
         },
      }
   }

I tried convert the rg commands to fd but I couldn't it to work, do you know if there is way in fd?

JustBarnt avatar Jan 25 '24 17:01 JustBarnt

A workaround for this would be to specify a custom find_command. I had the same issue on my windows machine but if you have ripgrep there's a handy --path-separator flag you can use to change the default \ on windows. This is what I have for reference

   pickers = {
      find_files = {
         hidden = true,
         find_command = {
            'rg',
            '--files',
            '--color=never',
            '--no-heading',
            '--line-number',
            '--column',
            '--smart-case',
            '--hidden',
            '--glob',
            '!{.git/*,.svelte-kit/*,target/*,node_modules/*}',
            '--path-separator',
            '/',
         },
      }
   }

I tried convert the rg commands to fd but I couldn't it to work, do you know if there is way in fd?

The --path-separator option should be working the same way with fd as well. I think you might have encountered a bug.

KevinSilvester avatar Jan 29 '24 10:01 KevinSilvester