Giter Club home page Giter Club logo

Comments (7)

romainl avatar romainl commented on June 3, 2024

Hmm… what is the output of :echo &viminfo?

from vim-cool.

craigmac avatar craigmac commented on June 3, 2024

'100,<50,s10,h

from vim-cool.

romainl avatar romainl commented on June 3, 2024

Yeah, the reasoning behind this is that set hlsearch is an explicit attempt to activate search highlighting, and thus that the expected outcome is to have the last search matches highlighted. In short: one enables "feature that highlights something" -> one gets highlighting. A bit like syntax on: you enable syntax highlighting, you get syntax highlighting.

Now, two questions:

  • is it really explicit if it's done as part of :source $MYVIMRC?
  • isn't that a special case that requires special handling?

from vim-cool.

craigmac avatar craigmac commented on June 3, 2024

Could there be a workaround to check if the OptionSet was fired as result of last command being the sourcing of a Vim filetype buffer?

from vim-cool.

romainl avatar romainl commented on June 3, 2024

OptionSet has a rich API but it doesn't have that information. We can probably parse the output of :verbose set hlsearch?, but how to discriminate between the vimrc being sourced normally, as part of the startup process, and the vimrc being sourced manually? Maybe by inspecting the history?

from vim-cool.

craigmac avatar craigmac commented on June 3, 2024

Yeah, I'm not sure there's a foolproof way to do it. For now, I'm just going to stick a call my :nohlsearch binding manually after I save my vimrc: autocmd BufWritePost $MYVIMRC nested source $MYVIMRC | call feedkeys("\<C-l>")

from vim-cool.

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.