Giter VIP home page Giter VIP logo

vim-longlines's Introduction

vim-longlines

A Vim plugin to help navigate through long soft-wrapped lines.

Installation

Use your favorite plugin manager or install as a Vim package (see :help packages).

Usage

After installing the plugin, use :LongLines to toggle the longline mode and :LongLines! to turn it off. It's also possible to automatically enable the longline mode for certain filetypes by using an autocommand:

" Enable the longlines plugin for TeX and MediaWiki files.
autocmd FileType mediawiki,tex LongLines

When the longline mode is on, motion commands such as j, k, gg, G, etc., work on display lines rather than actual lines. Although the longline mode replicates most commands reasonably well, some mappings (e.g., dd, V, etc.) don't work very well, and scrolling moves the cursor.

Options

When the longline mode is on, text is not hardwrapped by default and options that enable automatic hardwrapping of text (e.g., Vim's default fo=tcq) are altered to prevent this. If you wish to keep these options unaltered, set the global variable g:longlines_keep_opts or the buffer variable b:longlines_keep_opts to a nonzero value:

let g:longlines_keep_opts = 1

Similarly, when the longline mode is on, all motions commands are remapped to work on display lines, even when user-defined maps exist. If you wish to preserve already existing mappings, set the global variable g:longlines_keep_maps or the buffer variable b:longlines_keep_maps to a nonzero value:

let g:longlines_keep_maps = 1

To always enable the longline mode, set the global variable g:longlines_always_enable to a nonzero value:

let g:longlines_always_enable = 1

License

Public domain. See the file UNLICENSE for more details.

vim-longlines's People

Contributors

manu-mannattil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vim-longlines's Issues

Problem with Cyrillic layout

I have two layout and to make all hotkeys work in both, I added this lines in the config:

set langmap+=ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯ;ABCDEFGHIJKLMNOPQRSTUVWXYZ " Cyrillic layout in normal mode
set langmap+=фисвуапршолдьтщзйкыегмцчня;abcdefghijklmnopqrstuvwxyz " Cyrillic layout in normal mode
set langmap+=ЖжЭэХхЪъ;\:\;\"\'{[}]                                 " Cyrillic layout in normal mode

With the Long-lines plugin on, however, there's a problem: J and K work fine with the Latin layour but they work weird with the Cyrillic one. The cursor is placed either somewhere in the middle of lines or at their ends.

H and L seem to work fine in both layouts.

All other hotkeys in Neovim seem to work fine in both layouts.

Jumps with scroloff

When there's set scrolloff=6 in config, the "viewport" jumps up and down when skipping long soft-wrapped lines, although the cursor doesn't do these jumps.

Cannot autostart the plugin

I use the lines below to get the plugin autostart. But with these settings it works in a funny way: skipping some displayed soft-wrapped lines, the cursor still jumps to others. Whereas when I simply type :LongLines, everything works just fine.

So my question is: what is the optimal way to get the plugin autostart? I need it for all my buffers because I only work with markdown and plain-texts.

Plug 'manu-mannattil/vim-longlines'
au VimEnter * LongLines
autocmd FileType * LongLines

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.