Tips: quickly move current line

This commit is contained in:
Marco Hinz 2016-01-06 03:06:32 +01:00
parent 57d58172ef
commit c441df37f0
2 changed files with 11 additions and 0 deletions

View File

@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
- Plugins: [New section "Tmux"](README.md#tmux) - Plugins: [New section "Tmux"](README.md#tmux)
- Tips: [Saner behavior of n and N](README.md#saner-behavior-of-n-and-n) - Tips: [Saner behavior of n and N](README.md#saner-behavior-of-n-and-n)
- Tips: [Quickly move current line](README.md#quickly-move-current-line)
## [1.0] - 2016-01-06 ## [1.0] - 2016-01-06
First release! First release!

View File

@ -18,6 +18,7 @@
#### [Tips](#tips-1) #### [Tips](#tips-1)
- [Saner behavior of n and N](#saner-behavior-of-n-and-n) - [Saner behavior of n and N](#saner-behavior-of-n-and-n)
- [Quickly move current line](#quickly-move-current-line)
#### [Debugging](#debugging-1) #### [Debugging](#debugging-1)
- [General tips](#general-tips) - [General tips](#general-tips)
@ -361,6 +362,15 @@ nnoremap <expr> n 'Nn'[v:searchforward].'zvzz'
nnoremap <expr> N 'nN'[v:searchforward].'zvzz' nnoremap <expr> N 'nN'[v:searchforward].'zvzz'
``` ```
#### Quickly move current line
Sometimes I need a quick way to move the current line above or below:
```viml
nnoremap [e :<c-u>execute 'move -1-'. v:count1<cr>
nnoremap ]e :<c-u>execute 'move +'. v:count1<cr>
```
These mappings also take a count, so `2]e` moves the current line 2 lines below.
## Debugging ## Debugging
#### General tips #### General tips