diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 17:41:33 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 17:41:33 +1300 |
commit | 13ada038d3e8cd6a066a123312db4c711549c713 (patch) | |
tree | 0d3792488d0a9e0dfbe281e43098e7788a5dd88a /vim | |
parent | Use single-quoted string in gvimrc (diff) | |
download | dotfiles-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.vim | 8 |
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> |