X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=blobdiff_plain;f=.vimrc;h=63217bca0f8d6fff3ef2306fb64035f89b9b8d3c;hp=750786dd4e59e2ce9a13cda0b78c96940cdd9a94;hb=1751a6dde6882ca2ec77adb6ae6181d05701147c;hpb=7ba9017ba0901c03c5337f8df1c6f30d291e2f81 diff --git a/.vimrc b/.vimrc index 750786d..63217bc 100644 --- a/.vimrc +++ b/.vimrc @@ -99,6 +99,10 @@ endif set ruler " Show cursor position below each window set showcmd " Show (partial) command keys in the status line +set visualbell " Use visual bell instead of beeping +if v:version >= 800 + set belloff=error,insertmode " Do not ring the bell for these reasons +endif " Short message for [Modified]; " overwrite message for writing a file with subsequent message; @@ -386,13 +390,13 @@ autocmd BufReadPost * call RestorePosition() function! SetupEncoding(encoding) - if !has("iconv") || exists('b:encoding_set') || strlen(a:encoding) == 0 + if !has("iconv") || exists('b:encoding_set') || empty(a:encoding) return endif call RestorePosition() let b:encoding_set = 1 - if len(expand('%')) + if !empty(expand('%')) execute "edit ++enc=" . a:encoding endif endfunction @@ -458,7 +462,7 @@ function! ExtractURL() let line = getline('.') let parts = split(line, s:URL_re . '\zs') - if len(parts) == 0 + if empty(parts) throw 'ExtractURLCannotFindURL' " No URL found endif @@ -713,8 +717,6 @@ command! Text call Text() function! AutoEncoding() if &modified && &fileencoding != "" call SetupEncoding(&fileencoding) - else - redraw endif autocmd! auto-encoding augroup! auto-encoding