From 2af3cf197cf1d832531aede96d36915d14a25e48 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Wed, 22 Apr 2015 21:44:29 -0500 Subject: [PATCH] Add Whole Line Auto Completion as a vim til. --- README.md | 1 + vim/whole-line-auto-completion.md | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 vim/whole-line-auto-completion.md diff --git a/README.md b/README.md index 2f4edb2..b0bcfdd 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [Tabs To Spaces](vim/tabs-to-spaces.md) - [The Vim Info File](vim/the-vim-info-file.md) - [View Commit History of a File](vim/view-commit-history-of-a-file.md) +- [Whole Line Auto-Completion](vim/whole-line-auto-completion.md) - [Wrap With Some Room](vim/wrap-with-some-room.md) ### zsh diff --git a/vim/whole-line-auto-completion.md b/vim/whole-line-auto-completion.md new file mode 100644 index 0000000..bc45dbf --- /dev/null +++ b/vim/whole-line-auto-completion.md @@ -0,0 +1,16 @@ +# Whole Line Auto-Completion + +To get whole line auto-completion in Vim, you don't need a fancy plugin. It +is built right in. There is a sub-mode of insert mode called *X mode* that +allows you to do various kinds of special insertions. The `ctrl-x ctrl-l` +binding corresponds to whole line completion. So, if you start typing a few +characters and then (while still in insert mode) hit `ctrl-x ctrl-l` you +will see a completed line that matches the initial characters you typed as +well as a list of subsequent matches. You can cycle through the matches +using `ctrl-n` and `ctrl-p` (going forward and backward, respectively). + +The completion is done based on the configured completion sources. +Generally, the completion sources will include the current buffer, other +loaded and unloaded buffers, plus others. You can see which sources are +configured with `:set complete?` and read more about the completion +configuration at `:h 'complete'`.