goyo.txt 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. *goyo.txt* goyo Last change: April 2 2017
  2. GOYO - TABLE OF CONTENTS *goyo* *goyo-toc*
  3. ==============================================================================
  4. goyo.vim (고요)
  5. Installation
  6. Usage
  7. Dimension expression
  8. Configuration
  9. Callbacks
  10. Inspiration
  11. Pros.
  12. License
  13. GOYO.VIM (고요) *goyo-vim*
  14. ==============================================================================
  15. Distraction-free writing in Vim.
  16. https://raw.github.com/junegunn/i/master/goyo.png
  17. (Color scheme: {seoul256}{1})
  18. Best served with {limelight.vim}{2}.
  19. {1} https://github.com/junegunn/seoul256.vim
  20. {2} https://github.com/junegunn/limelight.vim
  21. INSTALLATION *goyo-installation*
  22. ==============================================================================
  23. Use your favorite plugin manager.
  24. - {vim-plug}{3}
  25. 1. Add `Plug 'junegunn/goyo.vim'` to .vimrc
  26. 2. Run `:PlugInstall`
  27. {3} https://github.com/junegunn/vim-plug
  28. USAGE *goyo-usage*
  29. ==============================================================================
  30. *:Goyo*
  31. - `:Goyo`
  32. - Toggle Goyo
  33. - `:Goyo [dimension]`
  34. - Turn on or resize Goyo
  35. - `:Goyo!`
  36. - Turn Goyo off
  37. The window can be resized with the usual [count]`CTRL-W` + `>`, `<`, `+`, `-` keys,
  38. and `CTRL-W` + `=` will resize it back to the initial size.
  39. < Dimension expression >______________________________________________________~
  40. *goyo-dimension-expression*
  41. The expected format of a dimension expression is
  42. `[WIDTH][XOFFSET][x[HEIGHT][YOFFSET]]`. `XOFFSET` and `YOFFSET` should be
  43. prefixed by `+` or `-`. Each component can be given in percentage.
  44. >
  45. " Width
  46. Goyo 120
  47. " Height
  48. Goyo x30
  49. " Both
  50. Goyo 120x30
  51. " In percentage
  52. Goyo 120x50%
  53. " With offsets
  54. Goyo 50%+25%x50%-25%
  55. <
  56. CONFIGURATION *goyo-configuration*
  57. ==============================================================================
  58. *g:goyo_width* *g:goyo_height* *g:goyo_linenr*
  59. - `g:goyo_width` (default: 80)
  60. - `g:goyo_height` (default: 85%)
  61. - `g:goyo_linenr` (default: 0)
  62. < Callbacks >_________________________________________________________________~
  63. *goyo-callbacks*
  64. By default, {vim-airline}{4}, {vim-powerline}{5}, {powerline}{6},
  65. {lightline.vim}{7}, {vim-signify}{8}, and {vim-gitgutter}{9} are temporarily
  66. disabled while in Goyo mode.
  67. If you have other plugins that you want to disable/enable, or if you want to
  68. change the default settings of Goyo window, you can set up custom routines to
  69. be triggered on `GoyoEnter` and `GoyoLeave` events.
  70. >
  71. function! s:goyo_enter()
  72. silent !tmux set status off
  73. silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z
  74. set noshowmode
  75. set noshowcmd
  76. set scrolloff=999
  77. Limelight
  78. " ...
  79. endfunction
  80. function! s:goyo_leave()
  81. silent !tmux set status on
  82. silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z
  83. set showmode
  84. set showcmd
  85. set scrolloff=5
  86. Limelight!
  87. " ...
  88. endfunction
  89. autocmd! User GoyoEnter nested call <SID>goyo_enter()
  90. autocmd! User GoyoLeave nested call <SID>goyo_leave()
  91. <
  92. More examples can be found here: {Customization}{10}
  93. {4} https://github.com/bling/vim-airline
  94. {5} https://github.com/Lokaltog/vim-powerline
  95. {6} https://github.com/Lokaltog/powerline
  96. {7} https://github.com/itchyny/lightline.vim
  97. {8} https://github.com/mhinz/vim-signify
  98. {9} https://github.com/airblade/vim-gitgutter
  99. {10} https://github.com/junegunn/goyo.vim/wiki/Customization
  100. INSPIRATION *goyo-inspiration*
  101. ==============================================================================
  102. - {LiteDFM}{11}
  103. - {VimRoom}{12}
  104. {11} https://github.com/bilalq/lite-dfm
  105. {12} http://projects.mikewest.org/vimroom/
  106. PROS. *goyo-pros*
  107. ==============================================================================
  108. 1. Works well with splits. Doesn't mess up with the current window arrangement
  109. 2. Works well with popular statusline plugins
  110. 3. Prevents accessing the empty windows around the central buffer
  111. 4. Can be closed with any of `:q[uit]`, `:clo[se]`, `:tabc[lose]`, or `:Goyo`
  112. 5. Can dynamically change the width of the window
  113. 6. Adjusts its colors when color scheme is changed
  114. 7. Realigns the window when the terminal (or window) is resized or when the size
  115. of the font is changed
  116. 8. Correctly hides colorcolumns and Emojis in statusline
  117. 9. Highly customizable with callbacks
  118. LICENSE *goyo-license*
  119. ==============================================================================
  120. MIT
  121. ==============================================================================
  122. vim:tw=78:sw=2:ts=2:ft=help:norl:nowrap: