Skip to content

Vim plugin that nudges visually selected lines up or down

License

Notifications You must be signed in to change notification settings

vim-utilities/nudge-lines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nudge Lines

Vim plugin that nudges visually selected lines up or down

Byte size of Nudge Lines Open Issues Open Pull Requests Latest commits



Requirements

This repository requires the [Vim][vim_home] text editor to be installed the source code is available on GitHub -- vim/vim, and most GNU Linux package managers are able to install Vim directly, eg...

  • Arch based Operating Systems
sudo packman -Syy

sudo packman -S vim
  • Debian derived Distributions
sudo apt-get update

sudo apt-get install vim

Quick Start

Clone this project...

Linux/MacOS

mkdir -vp ~/git/hub/vim-utilities

cd ~/git/hub/vim-utilities

git clone git@github.com:vim-utilities/nudge-lines.git

Install via linked-install.sh script...

./linked-install.sh

Usage

After visually selecting a line, or range of lines, use the following keyboard shortcuts:

  • Ctrl^k Nudge visual selection up

  • Shift^K Nudge visual selection up and reformat tabs

  • Ctrl^j Nudge visual selection down

  • Shift^J Nudge visual selection down and reformat tabs


Notes

This repository may not be feature complete and/or fully functional, Pull Requests that add features or fix bugs are certainly welcomed.

Currently to move selected lines more than one line at a time with a single motion requires calling the Nudge_Selection__Laterally() function, eg...

:'<,'> call Nudge_Selection__Laterally(3, 'reformat')

Contributing

Options for contributing to nudge-lines and vim-utilities


Forking

Start making a Fork of this repository to an account that you have write permissions for.

  • Add remote for fork URL. The URL syntax is git@github.com:<NAME>/<REPO>.git...
cd ~/git/hub/vim-utilities/nudge-lines

git remote add fork git@github.com:<NAME>/nudge-lines.git
  • Commit your changes and push to your fork, eg. to fix an issue...
cd ~/git/hub/vim-utilities/nudge-lines


git commit -F- <<'EOF'
:bug: Fixes #42 Issue


**Edits**


- `<SCRIPT-NAME>` script, fixes some bug reported in issue
EOF


git push fork main

Note, the -u option may be used to set fork as the default remote, eg. git push fork main however, this will also default the fork remote for pulling from too! Meaning that pulling updates from origin must be done explicitly, eg. git pull origin main

  • Then on GitHub submit a Pull Request through the Web-UI, the URL syntax is https://github.com/<NAME>/<REPO>/pull/new/<BRANCH>

Note; to decrease the chances of your Pull Request needing modifications before being accepted, please check the dot-github repository for detailed contributing guidelines.


Sponsor

Thanks for even considering it!

With sponsor__shields_io__liberapay you may sponsor vim-utilities on a repeating basis.

Regardless of if you're able to financially support projects such as nudge-lines that vim-utilities maintains, please consider sharing projects that are useful with others, because one of the goals of maintaining Open Source repositories is to provide value to the community.


Attribution


License

Vim plugin that nudges visually selected lines up or down
Copyright (C) 2020 S0AndS0

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, version 3 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

For further details review full length version of AGPL-3.0 License.

About

Vim plugin that nudges visually selected lines up or down

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project