Giter VIP home page Giter VIP logo

Comments (8)

jesseleite avatar jesseleite commented on August 26, 2024

Hmm, works for me with the $! I use this all the time. I wonder why it's not working for you 🤔

from vim-agriculture.

jesseleite avatar jesseleite commented on August 26, 2024

I believe this was to preserve manual backslash escaping. It's called ANSI-C quoting when you $'some string' (see bash manual here).

Again, I wonder why this doesn't work in your environment. What's your OS, Vim version, bash/zsh version, etc?

from vim-agriculture.

allhailwesttexas avatar allhailwesttexas commented on August 26, 2024

Thanks for the quick response! My env is:

  • Ubuntu 18.04 LTS
  • kitty terminal
  • fish shell (but I have tried in bash as well with same issue)
  • neovim 0.4.4

It seems most likely that the issue is fish shell, let me try again with bash and the built-in terminal client.

from vim-agriculture.

allhailwesttexas avatar allhailwesttexas commented on August 26, 2024

OK, I changed my shell with chsh and restarted my computer and now it does work with the $$$s. I will close the PR but I don't really know what a cross-shell solution would be. Will investigate when I have time.

from vim-agriculture.

jesseleite avatar jesseleite commented on August 26, 2024

@allhailwesttexas ah good find! If that's all that doesn't work, I'd like to find a solution for fish shell. Will keep this open and look into it. Thanks!

from vim-agriculture.

ipwnponies avatar ipwnponies commented on August 26, 2024

@jesseleite what is the reason behind using bash ansi-c quotes, is it to escape and forward the user query to fzf (akin to raw strings in python/js).

let command = 'rg --column --line-number --no-heading --color=always ' . s:trim(userOptions . ' ' . a:command_suffix)

I gleaned this from fzf-vim docs regarding ripgrep and it feels like this might be the same use case, trying to take multi-word command line arguments and present them as the query . Does vim's shellescape work here? That could keep it shell agnostic 👍

function! RipgrepFzf(query, fullscreen)
  let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case -- %s || true'
  let initial_command = printf(command_fmt, shellescape(a:query))
  let reload_command = printf(command_fmt, '{q}')
  let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]}
  call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), a:fullscreen)
endfunction

from vim-agriculture.

jesseleite avatar jesseleite commented on August 26, 2024

@ipwnponies Oh interesting! Will look into shellescape(), thanks for that info!

from vim-agriculture.

allhailwesttexas avatar allhailwesttexas commented on August 26, 2024

Nice!

from vim-agriculture.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.