bartle
  • Login
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. FlowFX (flowfx@chaos.social)'s status on Thursday, 24-Jan-2019 11:15:56 CET FlowFX FlowFX

    @blastmaster Does that set textwidth to columncolor? 1. I want it the other way around, and 2. when loading the vimrc in a new vim session, the textwidth is not set yet.

    In conversation Thursday, 24-Jan-2019 11:15:56 CET from chaos.social permalink
    • FlowFX (flowfx@chaos.social)'s status on Thursday, 24-Jan-2019 10:45:48 CET FlowFX FlowFX

      #Vim question: how do I set `colorcolumn` to the current `textwidth`?

      Textwidth is set either in a config file or by the editorconfig-vim plugin or sth like it.

      Right now I only know how to set colorcolumn manually (or fixed value in the vimrc). There has to be a better way!

      In conversation Thursday, 24-Jan-2019 10:45:48 CET permalink
    • FlowFX (flowfx@chaos.social)'s status on Thursday, 24-Jan-2019 11:18:41 CET FlowFX FlowFX
      in reply to

      @blastmaster Or I just don't know what I'm talking about.

      In conversation Thursday, 24-Jan-2019 11:18:41 CET permalink
    • ‮nahtaiv3L (l3viathan@mastodon.social)'s status on Thursday, 24-Jan-2019 12:56:35 CET ‮nahtaiv3L ‮nahtaiv3L
      in reply to

      @flowfx @blastmaster You can create an autocommand for the event OptionSet

      In conversation Thursday, 24-Jan-2019 12:56:35 CET permalink
      FlowFX repeated this.
    • FlowFX (flowfx@chaos.social)'s status on Thursday, 24-Jan-2019 15:01:13 CET FlowFX FlowFX
      in reply to
      • ‮nahtaiv3L

      So thanks to @l3viathan and @blastmaster I learned about Vim's :autocmd today. :)

      This works for me:

      :autocmd FileType python,ruby let &colorcolumn=&textwidth

      Actually, the trigger isn't really relevatn. It would work with OptionSet and BufRead as well.

      Yay! :)

      #Vim #autocmd

      In conversation Thursday, 24-Jan-2019 15:01:13 CET permalink
    • blabber (blabber@chaos.social)'s status on Thursday, 24-Jan-2019 15:10:54 CET blabber blabber
      in reply to
      • ‮nahtaiv3L

      @flowfx FYI: colorcolumn kannst du auch relativ zu textwidth setzen. Wenn du colorcolumn auf +0 setzt, passt sich das automatisch an die textwidth an.

      Das steht bei mir pauschal in der vimrc. Wenn keine textwidth gesetzt ist, habe ich keine farbige Spalte, wenn eine gesetzt ist wird mir die entsprechende Spalte eingefärbt.

      @l3viathan @blastmaster

      In conversation Thursday, 24-Jan-2019 15:10:54 CET permalink
      FlowFX repeated this.
    • blabber (blabber@chaos.social)'s status on Thursday, 24-Jan-2019 15:18:01 CET blabber blabber
      in reply to

      @flowfx Relatiert: https://github.com/vim/vim/blob/135059724f140ceac889c9f8136bd1bf5c41d49d/runtime/doc/options.txt#L1715-L1716

      In conversation Thursday, 24-Jan-2019 15:18:01 CET permalink
      FlowFX repeated this.
    • FlowFX (flowfx@chaos.social)'s status on Thursday, 24-Jan-2019 15:18:28 CET FlowFX FlowFX
      in reply to
      • blabber

      And that's why I ask stupid questions.

      The simple answer comes from @blabber, and it's:

      set colorcolumn=+0

      In conversation Thursday, 24-Jan-2019 15:18:28 CET permalink
    • FlowFX (flowfx@chaos.social)'s status on Thursday, 24-Jan-2019 15:18:54 CET FlowFX FlowFX
      in reply to
      • blabber

      @blabber DANKE!!!

      In conversation Thursday, 24-Jan-2019 15:18:54 CET permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • Privacy
  • Source
  • Version
  • Contact

bartle is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All bartle content and data are available under the Creative Commons Attribution 3.0 license.