aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-30 17:41:33 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-30 17:41:33 +1300
commit13ada038d3e8cd6a066a123312db4c711549c713 (patch)
tree0d3792488d0a9e0dfbe281e43098e7788a5dd88a /vim
parentUse single-quoted string in gvimrc (diff)
downloaddotfiles-13ada038d3e8cd6a066a123312db4c711549c713.tar.gz
dotfiles-13ada038d3e8cd6a066a123312db4c711549c713.zip
Use `normal!` not `normal` in Vim config macro
vim-vint says: >Avoid commands that rely on user settings (see Google VimScript Style >Guide (Fragile)) The style guide explains: >Always use normal! instead of normal. The latter depends upon the >user's key mappings and could do anything. Can't argue with that...
Diffstat (limited to 'vim')
-rw-r--r--vim/indent/html.vim8
1 files changed, 4 insertions, 4 deletions
diff --git a/vim/indent/html.vim b/vim/indent/html.vim
index 7b16fb3a..a6f84726 100644
--- a/vim/indent/html.vim
+++ b/vim/indent/html.vim
@@ -6,9 +6,9 @@ nnoremap <leader>v :exe "!tidy -eq -utf8 " . shellescape(expand("%"))<CR>
" Make a bare URL into a link to itself
function! UrlLink()
- normal yiW
- execute "normal i<a href=\"\<C-R>0\">\<Esc>"
- normal E
- execute "normal a</a>\<Esc>"
+ normal! yiW
+ execute "normal! i<a href=\"\<C-R>0\">\<Esc>"
+ normal! E
+ execute "normal! a</a>\<Esc>"
endfunction
nnoremap <silent> <leader>r :<C-U>call UrlLink()<CR>