mirror of
https://github.com/mhinz/vim-galore.git
synced 2025-02-24 01:59:28 +08:00
Tips: quickly move current line
This commit is contained in:
parent
57d58172ef
commit
c441df37f0
@ -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!
|
||||||
|
10
README.md
10
README.md
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user