From 91220b6858bfcdd360b78cb1c4a36ab59cf82421 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 9 May 2019 00:34:44 +1200 Subject: Remove unnecessary l: prefixes to Vim variables --- vim/autoload/diff.vim | 18 +++++++++--------- vim/autoload/filetype.vim | 34 +++++++++++++++++----------------- vim/autoload/gitcommit.vim | 10 +++++----- vim/autoload/html.vim | 20 ++++++++++---------- vim/autoload/mail.vim | 38 +++++++++++++++++++------------------- vim/autoload/perl.vim | 30 +++++++++++++++--------------- vim/autoload/quote.vim | 16 ++++++++-------- vim/autoload/vimrc.vim | 4 ++-- vim/plugin/wildignore.vim | 44 ++++++++++++++++++++++---------------------- 9 files changed, 107 insertions(+), 107 deletions(-) diff --git a/vim/autoload/diff.vim b/vim/autoload/diff.vim index 32e9333a..29389b95 100644 --- a/vim/autoload/diff.vim +++ b/vim/autoload/diff.vim @@ -7,23 +7,23 @@ function! diff#MoveBlock(count, up, visual) abort endif " Flag for the number of blocks passed - let l:blocks = 0 + let blocks = 0 " Iterate through buffer lines - let l:num = line('.') - while a:up ? l:num > 1 : l:num < line('$') - let l:num += a:up ? -1 : 1 - if getline(l:num) =~# '^@@' - let l:blocks += 1 - if l:blocks == a:count + let num = line('.') + while a:up ? num > 1 : num < line('$') + let num += a:up ? -1 : 1 + if getline(num) =~# '^@@' + let blocks += 1 + if blocks == a:count break endif endif endwhile " Move to line if nonzero and not equal to the current line - if l:num != line('.') - execute 'normal '.l:num.'G' + if num != line('.') + execute 'normal '.num.'G' endif endfunction diff --git a/vim/autoload/filetype.vim b/vim/autoload/filetype.vim index e33dfcbc..fb70d690 100644 --- a/vim/autoload/filetype.vim +++ b/vim/autoload/filetype.vim @@ -8,24 +8,24 @@ function! filetype#StripRepeat() abort endif " Expand the match result - let l:fn = expand('') + let fn = expand('') " Strip leading and trailing #hashes# - if l:fn =~# '^#\+.*#\+$' - let l:fn = substitute(l:fn, '^#\+\(.\+\)#\+$', '\1', '') + if fn =~# '^#\+.*#\+$' + let fn = substitute(fn, '^#\+\(.\+\)#\+$', '\1', '') " Strip trailing tilde~ - elseif l:fn =~# '\~$' - let l:fn = substitute(l:fn, '\~$', '', '') + elseif fn =~# '\~$' + let fn = substitute(fn, '\~$', '', '') " Strip generic .extension else - let l:fn = expand(':r') + let fn = expand(':r') endif " Re-run the group if there's anything left - if strlen(l:fn) - execute 'doautocmd filetypedetect BufRead ' . fnameescape(l:fn) + if strlen(fn) + execute 'doautocmd filetypedetect BufRead ' . fnameescape(fn) endif endfunction @@ -41,17 +41,17 @@ function! filetype#SudoRepeat() abort endif " Expand the match result - let l:fn = expand('') + let fn = expand('') " myfileXXQGS16A.conf: strip eight chars before final period - if l:fn =~# '/[^./]\+\w\{8}\.[^./]\+$' - let l:fr = expand(':r') - let l:fe = expand(':e') - let l:fn = strpart(l:fr, -8, strlen(l:fr)) . '.' . l:fe + if fn =~# '/[^./]\+\w\{8}\.[^./]\+$' + let fr = expand(':r') + let fe = expand(':e') + let fn = strpart(fr, -8, strlen(fr)) . '.' . fe " myfile.XXQGS16A: strip extension - elseif l:fn =~# '/[^./]\+\.\w\{8}$' - let l:fn = expand(':r') + elseif fn =~# '/[^./]\+\.\w\{8}$' + let fn = expand(':r') " Unrecognised pattern; return, don't repeat else @@ -59,8 +59,8 @@ function! filetype#SudoRepeat() abort endif " Re-run the group if there's anything left - if strlen(l:fn) - execute 'doautocmd filetypedetect BufRead ' . fnameescape(l:fn) + if strlen(fn) + execute 'doautocmd filetypedetect BufRead ' . fnameescape(fn) endif endfunction diff --git a/vim/autoload/gitcommit.vim b/vim/autoload/gitcommit.vim index 170cc2d0..7aba1c5b 100644 --- a/vim/autoload/gitcommit.vim +++ b/vim/autoload/gitcommit.vim @@ -3,14 +3,14 @@ function! gitcommit#CursorColumn() abort " If we can find a line after the first that isn't a comment, we're " composing the message - for l:num in range(1, line('$')) - if l:num == 1 + for num in range(1, line('$')) + if num == 1 continue endif - let l:line = getline(l:num) - if strpart(l:line, 0, 1) !=# '#' + let line = getline(num) + if strpart(line, 0, 1) !=# '#' return '+1' - elseif l:line =~# '^# -\{24} >8 -\{24}$' + elseif line =~# '^# -\{24} >8 -\{24}$' break endif endfor diff --git a/vim/autoload/html.vim b/vim/autoload/html.vim index e0d47e47..9466be33 100644 --- a/vim/autoload/html.vim +++ b/vim/autoload/html.vim @@ -16,9 +16,9 @@ endfunction " Tidy the whole buffer function! html#TidyBuffer() abort - let l:view = winsaveview() + let view = winsaveview() %!tidy -quiet - call winrestview(l:view) + call winrestview(view) endfunction " Update a timestamp @@ -26,14 +26,14 @@ function! html#TimestampUpdate() abort if !&modified return endif - let l:cv = winsaveview() + let cv = winsaveview() call cursor(1,1) - let l:li = search('\C^\s*Last updated: .\+$', 'n') - if l:li - let l:date = substitute(system('date -u'), '\C\n$', '', '') - let l:line = getline(l:li) - call setline(l:li, substitute(l:line, '\C\S.*', - \ 'Last updated: '.l:date.'', '')) + let li = search('\C^\s*Last updated: .\+$', 'n') + if li + let date = substitute(system('date -u'), '\C\n$', '', '') + let line = getline(li) + call setline(li, substitute(line, '\C\S.*', + \ 'Last updated: '.date.'', '')) endif - call winrestview(l:cv) + call winrestview(cv) endfunction diff --git a/vim/autoload/mail.vim b/vim/autoload/mail.vim index f37a7865..40b7fb7f 100644 --- a/vim/autoload/mail.vim +++ b/vim/autoload/mail.vim @@ -1,16 +1,16 @@ " Add a header to a mail message function! mail#AddHeaderField(name, body) abort - let l:num = 0 - while l:num < line('$') && getline(l:num + 1) !=# '' - let l:num += 1 + let num = 0 + while num < line('$') && getline(num + 1) !=# '' + let num += 1 endwhile - call append(l:num, a:name.': '.a:body) + call append(num, a:name.': '.a:body) endfunction " Add a set of headers to a mail message function! mail#AddHeaderFields(fields) abort - for l:name in sort(keys(a:fields)) - call mail#AddHeaderField(l:name, a:fields[l:name]) + for name in sort(keys(a:fields)) + call mail#AddHeaderField(name, a:fields[name]) endfor endfunction @@ -39,43 +39,43 @@ function! mail#NewBlank(count, up, visual) abort endif " Flag for whether we've started a block - let l:block = 0 + let block = 0 " Flag for the number of blocks passed - let l:blocks = 0 + let blocks = 0 " Iterate through buffer lines - let l:num = line('.') - while a:up ? l:num > 1 : l:num < line('$') + let num = line('.') + while a:up ? num > 1 : num < line('$') " If the line is blank - if getline(l:num) =~# '^[ >]*$' + if getline(num) =~# '^[ >]*$' " If we'd moved through a non-blank block already, reset that flag and " bump up the block count - if l:block - let l:block = 0 - let l:blocks += 1 + if block + let block = 0 + let blocks += 1 endif " If we've hit the number of blocks, end the loop - if l:blocks == a:count + if blocks == a:count break endif " If the line is not blank, flag that we're going through a block else - let l:block = 1 + let block = 1 endif " Move the line number or up or down depending on direction - let l:num += a:up ? -1 : 1 + let num += a:up ? -1 : 1 endwhile " Move to line if nonzero and not equal to the current line - if l:num != line('.') - execute 'normal '.l:num.'G' + if num != line('.') + execute 'normal '.num.'G' endif endfunction diff --git a/vim/autoload/perl.vim b/vim/autoload/perl.vim index 3b87bb36..7d825604 100644 --- a/vim/autoload/perl.vim +++ b/vim/autoload/perl.vim @@ -2,26 +2,26 @@ function! perl#Boilerplate() abort " Flag whether the buffer started blank - let l:blank = line2byte(line('$') + 1) <= 2 + let blank = line2byte(line('$') + 1) <= 2 " This is a .pm file, guess its package name from path if expand('%:e') ==# 'pm' - let l:match = matchlist(expand('%:p'), '.*/lib/\(.\+\).pm$') - if len(l:match) - let l:package = substitute(l:match[1], '/', '::', 'g') + let match = matchlist(expand('%:p'), '.*/lib/\(.\+\).pm$') + if len(match) + let package = substitute(match[1], '/', '::', 'g') else - let l:package = expand('%:t:r') + let package = expand('%:t:r') endif " Otherwise, just use 'main' else - let l:package = 'main' + let package = 'main' endif " Lines always to add - let l:lines = [ - \ 'package '.l:package.';', + let lines = [ + \ 'package '.package.';', \ '', \ 'use strict;', \ 'use warnings;', @@ -34,24 +34,24 @@ function! perl#Boilerplate() abort \ ] " Conditional lines depending on package - if l:package ==# 'main' - let l:lines = ['#!perl'] + l:lines + if package ==# 'main' + let lines = ['#!perl'] + lines else - let l:lines = l:lines + ['', '1;'] + let lines = lines + ['', '1;'] endif " Add all the lines in the array - for l:line in l:lines - call append(line('.') - 1, l:line) + for line in lines + call append(line('.') - 1, line) endfor " If we started in a completely empty buffer, delete the current blank line - if l:blank + if blank delete endif " If we added a trailing '1' for a package, move the cursor up two lines - if l:package !=# 'main' + if package !=# 'main' -2 endif diff --git a/vim/autoload/quote.vim b/vim/autoload/quote.vim index 2343b12a..b84a87e8 100644 --- a/vim/autoload/quote.vim +++ b/vim/autoload/quote.vim @@ -10,27 +10,27 @@ endfunction function! quote#QuoteOpfunc(type) abort " May as well make this configurable - let l:char = exists('b:quote_char') + let char = exists('b:quote_char') \ ? b:quote_char \ : '>' " Iterate over each matched line - for l:li in range(line('''['), line(''']')) + for li in range(line('''['), line(''']')) " Get current line text - let l:cur = getline(l:li) + let cur = getline(li) " Don't quote the first or last lines if they're blank - if !strlen(l:cur) && (l:li == line('''[') || l:li == line(''']')) + if !strlen(cur) && (li == line('''[') || li == line(''']')) continue endif " Only add a space after the quote character if this line isn't already " quoted with the same character - let l:new = l:cur[0] == l:char - \ ? l:char.l:cur - \ : l:char.' '.l:cur - call setline(l:li, l:new) + let new = cur[0] == char + \ ? char.cur + \ : char.' '.cur + call setline(li, new) endfor diff --git a/vim/autoload/vimrc.vim b/vim/autoload/vimrc.vim index 0dff8ffd..1af59c07 100644 --- a/vim/autoload/vimrc.vim +++ b/vim/autoload/vimrc.vim @@ -1,6 +1,6 @@ " Run some normal-mode keystrokes without jumping around function! vimrc#Anchor(keys) abort - let l:view = winsaveview() + let view = winsaveview() execute 'normal! '.a:keys - call winrestview(l:view) + call winrestview(view) endfunction diff --git a/vim/plugin/wildignore.vim b/vim/plugin/wildignore.vim index a99a2eb0..36a8f492 100644 --- a/vim/plugin/wildignore.vim +++ b/vim/plugin/wildignore.vim @@ -13,10 +13,10 @@ let loaded_wildmenu = 1 function! s:Wildignore() abort " New empty array - let l:ignores = [] + let ignores = [] " Archives - let l:ignores += [ + let ignores += [ \ '*.7z' \,'*.bz2' \,'*.gz' @@ -28,13 +28,13 @@ function! s:Wildignore() abort \ ] " Bytecode - let l:ignores += [ + let ignores += [ \ '*.class' \,'*.pyc' \ ] " Databases - let l:ignores += [ + let ignores += [ \ '*.db' \,'*.dbm' \,'*.sdbm' @@ -42,7 +42,7 @@ function! s:Wildignore() abort \ ] " Disk - let l:ignores += [ + let ignores += [ \ '*.adf' \,'*.bin' \,'*.hdf' @@ -50,7 +50,7 @@ function! s:Wildignore() abort \ ] " Documents - let l:ignores += [ + let ignores += [ \ '*.docx' \,'*.djvu' \,'*.odp' @@ -63,23 +63,23 @@ function! s:Wildignore() abort \ ] " Encrypted - let l:ignores += [ + let ignores += [ \ '*.asc' \,'*.gpg' \ ] " Executables - let l:ignores += [ + let ignores += [ \ '*.exe' \ ] " Fonts - let l:ignores += [ + let ignores += [ \ '*.ttf' \ ] " Images - let l:ignores += [ + let ignores += [ \ '*.bmp' \,'*.gd2' \,'*.gif' @@ -96,18 +96,18 @@ function! s:Wildignore() abort \ ] " Incomplete - let l:ignores += [ + let ignores += [ \ '*.filepart' \ ] " Objects - let l:ignores += [ + let ignores += [ \ '*.a' \,'*.o' \ ] " Sound - let l:ignores += [ + let ignores += [ \ '*.au' \,'*.aup' \,'*.flac' @@ -121,24 +121,24 @@ function! s:Wildignore() abort \ ] " System-specific - let l:ignores += [ + let ignores += [ \ '.DS_Store' \ ] " Translation - let l:ignores += [ + let ignores += [ \ '*.gmo' \ ] " Version control - let l:ignores += [ + let ignores += [ \ '.git' \,'.hg' \,'.svn' \ ] " Video - let l:ignores += [ + let ignores += [ \ '*.avi' \,'*.gifv' \,'*.mp4' @@ -149,7 +149,7 @@ function! s:Wildignore() abort \ ] " Vim - let l:ignores += [ + let ignores += [ \ '*~' \,'*.swp' \ ] @@ -157,15 +157,15 @@ function! s:Wildignore() abort " If on a system where case matters for filenames, for any that had " lowercase letters, add their uppercase analogues if has('fname_case') - for l:ignore in l:ignores - if l:ignore =~# '\l' - call add(l:ignores, toupper(l:ignore)) + for ignore in ignores + if ignore =~# '\l' + call add(ignores, toupper(ignore)) endif endfor endif " Return the completed setting - return join(l:ignores, ',') + return join(ignores, ',') endfunction -- cgit v1.2.3