Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rbong/vim-vertical
Vertical w and e motions for vim.
https://github.com/rbong/vim-vertical
Last synced: about 1 month ago
JSON representation
Vertical w and e motions for vim.
- Host: GitHub
- URL: https://github.com/rbong/vim-vertical
- Owner: rbong
- Created: 2016-05-14T17:40:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-05-15T13:56:50.000Z (over 8 years ago)
- Last Synced: 2024-08-01T16:44:06.735Z (4 months ago)
- Language: VimL
- Size: 2.93 KB
- Stars: 84
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- my-awesome-github-stars - rbong/vim-vertical - Vertical w and e motions for vim. (Vim Script)
README
# vim-vertical
vim-vertical is a way to get around in vim vertically the same way you do
horizontally.## usage
To go down...
```
:[range]Vertical f
```To go up...
```
:[range]Vertical b
```## example
The cursor is marked by █.
```
Lorem ipsum dolor sit amet, consectetur adipiscing elit█
Duis ullamcorper consectetur sem in congue. Quisque sagittis felis non lacus tempor, a laoreet elit pellentesque.
In rhoncus condimentum ipsum, et fringilla nunc pharetra in.
In hac habitasse platea dictumst. Mauris rutrum massa ut mauris lobortis venenatis ac et massa.
Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Donec quis ante ornare, suscipit lacus quis,
fermentum purus. Nulla viverra aliquet ornare. Donec tempus varius risus, nec vulputate lacus bibendum non.
``````
:Vertical f
``````
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Duis ullamcorper consectetur sem in congue. Quisque sagittis felis non lacus tempor, a laoreet elit pellentesque.
In rhoncus condimentum ipsum, et fringilla nunc pharetra in.
In hac habitasse platea dictumst. Mauris rutrum massa u█ mauris lobortis venenatis ac et massa.
Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Donec quis ante ornare, suscipit lacus quis,
fermentum purus. Nulla viverra aliquet ornare. Donec tempus varius risus, nec vulputate lacus bibendum non.
```The cursor has jumped to the end of the vertical block, as if it were a word
and we pressed `e`. If we enter the same command...```
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Duis ullamcorper consectetur sem in congue. Quisque sagittis felis non lacus tempor, a laoreet elit pellentesque.
In rhoncus condimentum ipsum, et fringilla nunc pharetra in.
In hac habitasse platea dictumst. Mauris rutrum massa ut mauris lobortis venenatis ac et massa.
Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Donec quis ante ornare, suscipit lacus quis,
fermentum purus. Nulla viverra aliquet ornare. Donec█tempus varius risus, nec vulputate lacus bibendum non.
```The cursor ignores white space and jumps to the next clear vertical block, as
if it were a word and we pressed `w`. The `w` and `e` like functionality will
eventually be available on their own.vim-vertical also considers whitespace at the beginning of a line empty space,
even if there is only one space.## need
Existing vim vertical movements are limited by knowing exactly what you're
looking for and everything inbetween while requiring much typing (with `/` and
`?`), or taking you to the beginning of the line (`[` `]` and `{` `}`) or even
blindly jumping and hoping to hit something (`C-d` and `C-u`).Many times, I have been at the end of a line after editing it and needed to go
to a nearby long line. Why should I not be able to just press a key and get
there if it's so well defined?Other times, I have been trying to select clearly defined blocks of text that
don't necessarily have newlines around them, and therefore can't be selected
with `ip` and `ap` or jumped over with `{` and `}`. Even when a block is
surrounded by empty lines, these commands do not always flow very well.As for jumping with `C-d` and `C-u`, simply doing `:3Vertical b` and
`:3Vertical f` is much more likely to put your cursor in a position to do
something meaningful.## known problems
vim-vertical is still experimental in its support of tab spaces and visual
selection, as well as ranges. There are many known bugs. Please still submit
any issues.