Coder Social home page Coder Social logo

Comments (3)

dstein64 avatar dstein64 commented on May 26, 2024 1

@YodaEmbedding, thanks for the idea!

This is now implemented (23fdffb).

After updating the plugin, the g:scrollview_base and g:scrollview_column variables can be used to control the scrollbar placement. The base specifies where the scrollbar is anchored. This can be 'left', 'right', or 'buffer'. 'left' and 'right' anchor the scrollbar at the corresponding window edge ('right' is the default value). 'buffer' anchors the scrollbar to the buffer. g:scrollview_column specifies the position (1-indexed) relative to the base.

The following settings correspond to the example you gave ("scrollbar to always appear on a fixed column, e.g. at 80 characters").

let g:scrollview_base = 'buffer'  " or 'left' to position relative to window edge
let g:scrollview_column = 80

from nvim-scrollview.

dstein64 avatar dstein64 commented on May 26, 2024 1

@YodaEmbedding, thanks again! I hadn't considered that.

It's now possible to configure scrollview's settings specifically per-window, per-tab, and/or per-buffer, in addition to globally.

For example, let w:scrollview_base = 'buffer' would apply only for the window it's defined in. let b:scrollview_base = 'left' would apply only for the buffer.

98bd3e5

from nvim-scrollview.

YodaEmbedding avatar YodaEmbedding commented on May 26, 2024

Using g: makes it difficult to set per-buffer. For example, consider a vim help window (80 columns) and a python file (79 columns) open in two split windows.

vim_help_python_file

Perhaps better is b: so that users can set per filetype:

autocmd FileType python let b:scrollview_column=79 | let b:scrollview_base = 'buffer'
autocmd FileType rust   let b:scrollview_column=80 | let b:scrollview_base = 'buffer'

An alternative method of configuration is to depend on the buffer's colorcolumn:

let g:scrollview_column = 'colorcolumn'  "  default

...though with multi-colorcolumns, the correct choice is undefined -- and requires manual control with b:scrollview_column.

from nvim-scrollview.

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.