mirror of
https://github.com/preservim/vim-pencil.git
synced 2025-11-19 23:33:39 -05:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad18a74cf0 | ||
|
|
470f9ca44c | ||
|
|
f9cbfca887 | ||
|
|
01a3a95c72 | ||
|
|
08ee355694 | ||
|
|
2f62713ed9 | ||
|
|
5e6ba37a94 | ||
|
|
ebbfc350b8 | ||
|
|
b36e21556d | ||
|
|
4e82b996e4 | ||
|
|
6b6c2f08bf |
@@ -23,7 +23,7 @@ smooth the path to writing prose.
|
||||
deletion via line `<C-U>` and word `<C-W>`
|
||||
* When using hard line breaks, _pencil_ enables Vim’s autoformat while
|
||||
inserting text, except for tables and code blocks where you won’t want
|
||||
it (**NEW: blacklisting now based on filetype**)
|
||||
it
|
||||
* Buffer-scoped configuration (with a few minor exceptions, _pencil_ preserves
|
||||
your global settings)
|
||||
* Support for Vim’s Conceal feature to hide markup defined by Syntax plugins
|
||||
@@ -66,11 +66,13 @@ tool in expressing yourself. For more details on vi-style editing, see...
|
||||
* [Your problem with Vim is that you don't grok vi][gv] (December 2011)
|
||||
* [Intro to Vim's Grammar][ig] (January 2013)
|
||||
* [Why Atom Can’t Replace Vim, Learning the lesson of vi][wa] (March 2014)
|
||||
* [Language of Vim/Neovim][lovn] (January 2015)
|
||||
|
||||
[ls]: http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-nouns-and-modifiers/
|
||||
[gv]: http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118
|
||||
[ig]: http://takac.github.io/2013/01/30/vim-grammar/
|
||||
[wa]: https://medium.com/p/433852f4b4d1
|
||||
[lovn]: http://allsyed.com/language-of-vim-neovim/
|
||||
|
||||
# Installation
|
||||
|
||||
@@ -544,6 +546,16 @@ If no such lines found, _pencil_ falls back to the default wrap mode.
|
||||
* [Vim Training Class - Basic motions and commands][tc] - video tutorial by Shawn Biddle
|
||||
* [Vim for Writers][vw] - guide to the basics geared to writers
|
||||
|
||||
Bloggers and developers discuss _pencil_ and its brethern:
|
||||
|
||||
* [Reed Esau's growing list of Vim plugins for writers][regl] (2014) - by @pengwynn
|
||||
* [Distraction Free Writing in Vim][dfwiv] (2014) - by @tlattimore
|
||||
* [Safari Blog: Turning vim into an IDE through vim plugins][tviai] (2014) - by @jameydeorio
|
||||
* [Quick tops for writing prose with Vim][qtfwp] (2014) - by @benoliver999
|
||||
* [UseVim: Reed Esau's Writing Plugins][rewp] (2015) - by @alexyoung
|
||||
* [Tomasino Labs: Vim in Context][vic] (2015) - by @jamestomasino
|
||||
* [Writing with Vim][wwv] (2015) - by Pat Ambrosio
|
||||
|
||||
Other plugins of specific interest to writers:
|
||||
|
||||
* [tpope/vim-abolish][ab] - search for, substitute, and abbr. multiple variants of a word
|
||||
@@ -551,6 +563,13 @@ Other plugins of specific interest to writers:
|
||||
* [junegunn/limelight.vim][jl] - focus mode that brightens current paragraph
|
||||
* [junegunn/goyo.vim][jg] - distraction-free editing mode
|
||||
|
||||
[qtfwp]: http://benoliver999.com/technology/2014/12/06/vimforprose/
|
||||
[wwv]: https://lilii.co/aardvark/writing-with-vim
|
||||
[vic]: https://labs.tomasino.org/vim-in-context.html
|
||||
[rewp]: http://usevim.com/2015/05/27/reedes/
|
||||
[tviai]: https://www.safaribooksonline.com/blog/2014/11/23/way-vim-ide/
|
||||
[regl]: http://wynnnetherland.com/journal/reed-esau-s-growing-list-of-vim-plugins-for-writers/
|
||||
[dfwiv]: http://tlattimore.com/blog/distraction-free-writing-in-vim/
|
||||
[ab]: http://github.com/tpope/vim-abolish
|
||||
[ex]: http://github.com/tommcdo/vim-exchange
|
||||
[jl]: http://github.com/junegunn/limelight.vim
|
||||
@@ -600,8 +619,8 @@ with its own Markdown variant.
|
||||
|
||||
# Future development
|
||||
|
||||
If you’ve spotted a problem or have an idea on improving this plugin,
|
||||
please post it to the github project issue page or submit a pull request.
|
||||
If you’ve spotted a problem or have an idea on improving _pencil_,
|
||||
please report it as an issue, or better yet submit a pull request.
|
||||
|
||||
```
|
||||
<!-- vim: set tw=73 :-->
|
||||
|
||||
@@ -243,7 +243,7 @@ fun! pencil#init(...) abort
|
||||
setl breakat-=@ " avoid breaking at email addresses
|
||||
en
|
||||
|
||||
if has('syntax')
|
||||
if exists('&colorcolumn')
|
||||
setl colorcolumn=0 " doesn't align as expected
|
||||
en
|
||||
el
|
||||
@@ -255,7 +255,7 @@ fun! pencil#init(...) abort
|
||||
setl breakat<
|
||||
en
|
||||
|
||||
if has('syntax')
|
||||
if exists('&colorcolumn')
|
||||
setl colorcolumn<
|
||||
en
|
||||
en
|
||||
@@ -421,7 +421,14 @@ fun! pencil#init(...) abort
|
||||
ino <buffer> : :<c-g>u
|
||||
ino <buffer> <c-u> <c-g>u<c-u>
|
||||
ino <buffer> <c-w> <c-g>u<c-w>
|
||||
ino <buffer> <cr> <c-g>u<cr>
|
||||
|
||||
" map <cr> only if not already mapped
|
||||
if empty(maparg('<cr>', 'i'))
|
||||
ino <buffer> <cr> <c-g>u<cr>
|
||||
let b:pencil_cr_mapped = 1
|
||||
el
|
||||
let b:pencil_cr_mapped = 0
|
||||
en
|
||||
el
|
||||
sil! iu <buffer> .
|
||||
sil! iu <buffer> !
|
||||
@@ -431,7 +438,11 @@ fun! pencil#init(...) abort
|
||||
sil! iu <buffer> :
|
||||
sil! iu <buffer> <c-u>
|
||||
sil! iu <buffer> <c-w>
|
||||
sil! iu <buffer> <cr>
|
||||
|
||||
" unmap <cr> only if we mapped it ourselves
|
||||
if exists('b:pencil_cr_mapped') && b:pencil_cr_mapped
|
||||
sil! iu <buffer> <cr>
|
||||
en
|
||||
en
|
||||
endf
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ if !exists('g:pencil#autoformat_config')
|
||||
\ },
|
||||
\ 'tex': {
|
||||
\ 'black': [
|
||||
\ 'tex(BeginEndName|Delimiter|DocType|InputFile|Math|RefZone|Title)',
|
||||
\ 'tex(BeginEndName|Delimiter|DocType|InputFile|Math|RefZone|Statement|Title)',
|
||||
\ 'texSection$',
|
||||
\ ],
|
||||
\ 'enforce-previous-line': 1,
|
||||
@@ -181,9 +181,9 @@ com -nargs=0 PFormat call pencil#setAutoFormat(1)
|
||||
com -nargs=0 PFormatOff call pencil#setAutoFormat(0)
|
||||
com -nargs=0 PFormatToggle call pencil#setAutoFormat(-1)
|
||||
|
||||
" NOTE: legacy commands will be disabled by default on 31-Dec-15
|
||||
" NOTE: legacy commands have been disabled by default as of 31-Dec-15
|
||||
if !exists('g:pencil#legacyCommands')
|
||||
let g:pencil#legacyCommands = 1
|
||||
let g:pencil#legacyCommands = 0
|
||||
en
|
||||
if g:pencil#legacyCommands
|
||||
com -nargs=0 DropPencil call pencil#init({'wrap': 'off' })
|
||||
|
||||
Reference in New Issue
Block a user