From 5fe67e55ae268274df1b1010f6207130d8bbbc73 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 10 Nov 2017 21:36:30 +1300 Subject: Rename complete.vim to completion.vim Clearer filename and more consistent to use the noun. --- vim/config/completion.vim | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 vim/config/completion.vim (limited to 'vim/config/completion.vim') diff --git a/vim/config/completion.vim b/vim/config/completion.vim new file mode 100644 index 00000000..5fcc0e62 --- /dev/null +++ b/vim/config/completion.vim @@ -0,0 +1,3 @@ +" Don't try to complete strings from included files, just use the strings in +" the open buffers; I'll open the file if I want to complete from it +set complete-=i -- cgit v1.2.3 From 3592b950fc75003077cd4d208553f344bf6d892e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 10 Nov 2017 21:37:27 +1300 Subject: Move wildmenu config into completion.vim --- vim/config/completion.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'vim/config/completion.vim') diff --git a/vim/config/completion.vim b/vim/config/completion.vim index 5fcc0e62..d9db2113 100644 --- a/vim/config/completion.vim +++ b/vim/config/completion.vim @@ -1,3 +1,27 @@ " Don't try to complete strings from included files, just use the strings in " the open buffers; I'll open the file if I want to complete from it set complete-=i + +" Configuration for the command completion feature; rather than merely cycling +" through possible completions with Tab, show them above the command line +if has('wildmenu') + + " Use the wild menu, both completing and showing all possible completions + " with a single Tab press, just as I've configured Bash to do + set wildmenu + set wildmode=longest:list + + " Don't complete certain files that I'm not likely to want to manipulate + " from within Vim: + if has('wildignore') + set wildignore+=*.a,*.o + set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png + set wildignore+=.DS_Store,.git,.hg,.svn + set wildignore+=*~,*.swp,*.tmp + endif + + " Complete files without case sensitivity, if the option is available + if exists('&wildignorecase') + set wildignorecase + endif +endif -- cgit v1.2.3 From 3e29d5a95693a5ffd5e78622f560f415743b0736 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 10 Nov 2017 21:48:23 +1300 Subject: Adjust some whitespace and comment layout --- vim/config/completion.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'vim/config/completion.vim') diff --git a/vim/config/completion.vim b/vim/config/completion.vim index d9db2113..854ffea7 100644 --- a/vim/config/completion.vim +++ b/vim/config/completion.vim @@ -24,4 +24,5 @@ if has('wildmenu') if exists('&wildignorecase') set wildignorecase endif + endif -- cgit v1.2.3 From 8b79ec9365491f8fb2bd48452b6aca68d2b673d2 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 10 Nov 2017 21:54:42 +1300 Subject: Use exists+ test rather than exists& From :help hidden-options: >Not all options are supported in all versions. This depends on the >supported features and sometimes on the system. A remark about this is >in curly braces below. When an option is not supported it may still be >set without getting an error, this is called a hidden option. You can't >get the value of a hidden option though, it is not stored. > >To test if option "foo" can be used with ":set" use something like this: > if exists('&foo') >This also returns true for a hidden option. To test if option "foo" is >really supported use something like this: > if exists('+foo') --- vim/config/completion.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vim/config/completion.vim') diff --git a/vim/config/completion.vim b/vim/config/completion.vim index 854ffea7..a8a5c201 100644 --- a/vim/config/completion.vim +++ b/vim/config/completion.vim @@ -21,7 +21,7 @@ if has('wildmenu') endif " Complete files without case sensitivity, if the option is available - if exists('&wildignorecase') + if exists('+wildignorecase') set wildignorecase endif -- cgit v1.2.3