Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flatcap/vim-deleteto
⚙ Vim Plugin - Trim the beginning of lines
https://github.com/flatcap/vim-deleteto
align delete plugin script vim
Last synced: about 5 hours ago
JSON representation
⚙ Vim Plugin - Trim the beginning of lines
- Host: GitHub
- URL: https://github.com/flatcap/vim-deleteto
- Owner: flatcap
- License: other
- Created: 2015-03-24T01:43:46.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2022-06-12T19:25:14.000Z (over 2 years ago)
- Last Synced: 2024-05-02T02:16:52.440Z (7 months ago)
- Topics: align, delete, plugin, script, vim
- Language: Vim script
- Homepage:
- Size: 23.4 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# deleteto.vim
## Introduction
DeleteTo reads a character from the user, then deletes from the beginning of the line up to and including that character.
If you have a tab delimited file, "dU" will delete the first column of data.
See the Workflow section, below, to see what that means.
To improve this plugin, I recommend installing Tim Pope's
[vim-repeat](https://github.com/tpope/vim-repeat) plugin.## Workflow
Imagine you're working with a list of files:
```
./deleteto/plugin/deleteto.vim
./deleteto/README.md
./keyword/plugin/keyword.vim
./keyword/README.md
```but you'd like a tidier list without the "./" at the beginning.
Type: `dU/````
deleteto/plugin/deleteto.vim
deleteto/README.md
keyword/plugin/keyword.vim
keyword/README.md
```Type `dU/` again
```
plugin/deleteto.vim
README.md
plugin/keyword.vim
README.md
```## Mappings
By default, DeleteTo creates four mappings:
| Type | To work on | Calls |
| ------------ | -------------- | --------------------- |
| dU | All lines | <Plug>DeleteToA |
| duu | This line | <Plug>DeleteToL |
| du\{motion\} | Motion-defined | <Plug>DeleteToM |
| \{visual\}du | Visual region | <Plug>DeleteToV |You can disable the default mappings with:
```viml
let g:deleteto_create_mappings = 0
```## Command
The DeleteTo command has the form
:[range]DeleteTo CHAR [COUNT]
## Examples
The delimiter will commonly be forward slash, space, comma or tab.
However, DeleteTo will work with any character.| Type this | Works on | Delete up to this character |
| ------------------- | ---------------------- | --------------------------- |
| dU/ | Whole file | First / |
| 3dU, | Whole file | Third , |
| 4duu/ | One line | Fourth / |
| vip2du<tab> | Visual - paragraph | Second <tab> |
| du9j, | Motion - 10 lines | First , |
| | |
| :DeleteTo / | Whole file | First / |
| :1,20DeleteTo / | Lines 1-20 | First / |
| :DeleteTo , 4 | Whole file | Fourth , |
| | |
| :argdo DeleteTo / 2 | All args, all lines | Second / |
| :bufdo DeleteTo \| | All buffers, all lines | First \| |## License
Copyright © Richard Russon (flatcap).
Distributed under the GPLv3## See also
- [flatcap.org](https://flatcap.org)
- [GitHub](https://github.com/flatcap/vim-deleteto)