Truncating message line to avoid enter key

This commit is contained in:
Reed Esau
2014-08-21 02:44:21 -06:00
parent 7db7399705
commit d13caf6137
2 changed files with 20 additions and 11 deletions

View File

@@ -33,14 +33,14 @@ the usage is sound, you can elect to keep it —_wordy_ be damned.
Off-the-shelf proofreading software can scan your text for potential problems Off-the-shelf proofreading software can scan your text for potential problems
and provide comprehensive feedback. However, it may require a complex and provide comprehensive feedback. However, it may require a complex
software installation or transmission of your work to a remote server for software installation or transmission of your work to a remote server for
checking. checking.
_wordy_ stands ready as a simple alternative to these comprehensive tools, _wordy_ stands ready as a simple alternative to these comprehensive tools,
focusing narrowly on identifying potential problems that might otherwise focusing narrowly on identifying potential problems that might otherwise
be missed. To compensate for _wordy_s bare-bones approach, its best used be missed. To compensate for _wordy_s bare-bones approach, its best used
in concert with the [literature on usage][lit] (Strunk and White, e.g.) in concert with the [literature on usage][lit] (Strunk and White, e.g.)
and websites like the [English Language & Usage Stack Exchange][ese]. and websites like the [English Language & Usage Stack Exchange][ese].
[lit]: http://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Dstripbooks&field-keywords=English+Usage [lit]: http://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Dstripbooks&field-keywords=English+Usage
[ese]: http://english.stackexchange.com [ese]: http://english.stackexchange.com
@@ -58,7 +58,7 @@ package manager.
### On demand ### On demand
Using this plugin's commands does not require any special configuration. Using this plugins commands does not require any special configuration.
Important note: on the first use of each of the plugins dictionaries, Important note: on the first use of each of the plugins dictionaries,
a spell file will be built. This produces a message that resembles: a spell file will be built. This produces a message that resembles:
@@ -205,14 +205,14 @@ Instead of puffery, demonstrate through details.
``` ```
Words can be used to hide or obscure a weak position, or to cast doubt on Words can be used to hide or obscure a weak position, or to cast doubt on
a strong one. They can be used to mislead, to evade blame, or to claim credit a strong one. They can be used to mislead, to evade blame, or to claim credit
where none has been earned. where none has been earned.
* “mistakes were made” * “mistakes were made”
* “discounted up to 50% off” * “discounted up to 50% off”
* “most voters feel that my opponent cant be trusted” * “most voters feel that my opponent cant be trusted”
Assuming that youre not intentionally trying to manipulate others, you Assuming that youre not intentionally trying to manipulate others, you
will seek to purge such loaded language from your writing. will seek to purge such loaded language from your writing.
### To be and the passive voice ### To be and the passive voice
@@ -269,7 +269,7 @@ If you find this plugin useful, you may want to check out these others by
* [vim-colors-pencil][cp] - color scheme for Vim inspired by IA Writer * [vim-colors-pencil][cp] - color scheme for Vim inspired by IA Writer
* [vim-lexical][lx] - building on Vims spell-check and thesaurus/dictionary completion * [vim-lexical][lx] - building on Vims spell-check and thesaurus/dictionary completion
* [vim-litecorrect][lc] - lightweight auto-correction for Vim * [vim-litecorrect][lc] - lightweight auto-correction for Vim
* [vim-one][vo] - make use of Vims _+clientserver_ capabilities * [vim-one][vo] - make use of Vims _+clientserver_ capabilities
* [vim-pencil][pn] - rethinking Vim as a tool for writers * [vim-pencil][pn] - rethinking Vim as a tool for writers
* [vim-textobj-quote][qu] - extends Vim to support typographic (curly) quotes * [vim-textobj-quote][qu] - extends Vim to support typographic (curly) quotes
* [vim-textobj-sentence][ts] - improving on Vim's native sentence motion command * [vim-textobj-sentence][ts] - improving on Vim's native sentence motion command

View File

@@ -53,15 +53,24 @@ function! wordy#init(...) abort
let l:msg = 'Unable to read source: ' . l:src_path let l:msg = 'Unable to read source: ' . l:src_path
endif endif
endfor endfor
let l:prefix = 'wordy: '
if len(l:dst_paths) > 0 if len(l:dst_paths) > 0
let b:original_spl = &spelllang let b:original_spl = &spelllang
exe 'setlocal spelllang=' . l:lang . ',' . join(l:dst_paths, ',') exe 'setlocal spelllang=' . l:lang . ',' . join(l:dst_paths, ',')
setlocal spell setlocal spell
let l:msg = join(l:dicts, ', ')
" the magic numbers derived empirically with MacVim
" docs for rulerformat say 'The default ruler width is 17 characters'
let l:msg = l:prefix . join(l:dicts, ', ')
let l:max_len = &columns - strlen(l:prefix) - 5 - (&ruler ? 18 : 0)
if strlen(l:msg) > l:max_len
let l:msg = strpart(l:msg, 0, l:max_len-3) . '...'
endif
else else
let l:msg = 'off' let l:msg = l:prefix . 'off'
endif endif
echohl ModeMsg | echo 'wordy: ' . l:msg | echohl NONE echohl ModeMsg | echo l:msg | echohl NONE
endfunction endfunction
function! wordy#jump(mode) function! wordy#jump(mode)