Code Monkey home page Code Monkey logo

Comments (5)

krobelus avatar krobelus commented on June 2, 2024 1

I'm working on finding a solution here. I think a sensible approach is to use filetype=git for diff buffers.
We already use it for git show buffers which are not much different.

from kakoune.

krobelus avatar krobelus commented on June 2, 2024 1

proposed fix is at https://lists.sr.ht/~mawww/kakoune/%[email protected]%3E (it serves a larger series but can be extracted)

from kakoune.

krobelus avatar krobelus commented on June 2, 2024

I think it makes sense to map <ret> depending on filetype, not based on which commands where executed to create the buffer.
Note that for git diff we set filetype diff but override the generic diff <ret> mapping with one that always uses the Git toplevel dir (not terribly important though).
In future, git commands might set buffer-local variables for the $PWD (so things work better when there are multiple Git worktrees). So hand crafting a buffer might have some minor downsides.

I like to save my search results in a file with :w grep-controllers. Then to reuse those results, I just open the file and assign it the grep filetype with set buffer filetype grep

you can use :rename-buffer on the *grep* buffer instead

from kakoune.

lobre avatar lobre commented on June 2, 2024

you can use :rename-buffer on the grep buffer instead

That is a nice tip (as long as you don't want to persist it to disk.

I think it makes sense to map depending on filetype, not based on which commands where executed to create the buffer.

I feel like it would be good practice too.

from kakoune.

lobre avatar lobre commented on June 2, 2024

I think that could be effectively a good idea and could lead to a cleaner approach.

from kakoune.

Related Issues (20)

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.