From ac041cd8a2b1b8fc170c246f49cf1756512c7fe0 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sat, 25 Apr 2015 13:26:19 -0500 Subject: [PATCH] Add Joining Lines Together as a vim til. --- README.md | 1 + vim/joining-lines-together.md | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 vim/joining-lines-together.md diff --git a/README.md b/README.md index 76674d8..36bab36 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [Help For Non-Normal Mode Features](vim/help-for-non-normal-mode-features.md) - [Horizontal to Vertical and Back Again](vim/horizontal-to-vertical-and-back-again.md) - [Interactive Buffer List](vim/interactive-buffer-list.md) +- [Joining Lines Together](vim/joining-lines-together.md) - [List All Buffers](vim/list-all-buffers.md) - [Marks Across Vim Sessions](vim/marks-across-vim-sessions.md) - [Moving To A Specific Line](vim/moving-to-a-specific-line.md) diff --git a/vim/joining-lines-together.md b/vim/joining-lines-together.md new file mode 100644 index 0000000..5e21ad9 --- /dev/null +++ b/vim/joining-lines-together.md @@ -0,0 +1,23 @@ +# Joining Lines Together + +You can quickly join a series of lines onto a single line using the `J` +command. Simply hitting 'J' in normal mode will join the current line with +the line below it leaving a space in between the two. If you want to join +the next 5 lines, you can hit `5J`. Hitting '5J' on this: + +``` +first, +second, +third, +fourth, +fifth +``` + +will transform it into this: + +``` +first, second, third, fourth, fifth +``` + +Similarly, you can perform a line by line join on a visual selection by +hitting `J` after making the desired visual selection.