Skip to content

Commit

Permalink
adding Goyo for distraction free editing
Browse files Browse the repository at this point in the history
  • Loading branch information
matthutchinson committed Apr 6, 2017
1 parent 801dfbb commit 8bf5a16
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ $ ./bin/benchpress

### Tmux

The `tmux/` directory contains various segments for my tmux status bar, and a custom theme. It all comes together to look something like this;
The `tmux/` directory contains various segments for my tmux status bar, and a
custom theme. It all comes together to look something like this;

![tmux theme status bar screenshot](https://raw.githubusercontent.com/matthutchinson/workbench/master/tmux/themeshot.png)

### Disclaimer

I change and commit to this toolbox regularly. In some rare occasions it might be in a broken state.
If you intend to use this repository yourself, its probably better if you fork it.
I change and commit to this toolbox regularly. In some rare occasions it might
be in a broken state. If you intend to use this repository yourself, its
probably better if you fork it.

### Related Links

Expand Down
16 changes: 14 additions & 2 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ call plug#begin('~/.vim/plugged')
Plug 'rking/ag.vim'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'junegunn/goyo.vim'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-bundler'
Expand Down Expand Up @@ -427,10 +428,16 @@ function! CleverTab()
endfunction
inoremap <Tab> <C-R>=CleverTab()<CR>
" #### Autocommands

" Goyo (distraction free editing in text files (txt, markdown etc.)
function! s:auto_goyo()
Goyo 84
endfunction

" #### Autocommands
if !exists("autocommands_loaded")
let autocommands_loaded = 1
let g:markdown_fenced_languages = ['javascript', 'go', 'php', 'ruby']

au WinEnter,FocusGained * setlocal cursorline
au WinLeave,FocusLost * setlocal nocursorline
Expand All @@ -443,8 +450,13 @@ if !exists("autocommands_loaded")
au BufNewFile,BufRead /private/etc/apache2/*.conf* set ft=apache
au BufRead,BufNewFile {Capfile,Gemfile,Appraisals,Rakefile,Thorfile,bluepill.pill,config.ru,.caprc,.irbrc,irb_tempfile*} set ft=ruby

autocmd BufNewFile,BufRead {*.md,*.txt,*.markdown} call s:auto_goyo()

" always spellcheck on text like files
au BufRead,BufNewFile {*.md,*.txt,*.textile,*.markdown,*.rdoc} setlocal spell
au BufRead,BufNewFile {*.md,*.txt,*.markdown,*.rdoc} setlocal spell
highlight clear SpellBad
highlight SpellBad term=standout ctermfg=5 term=underline cterm=underline

" auto strip whitespace when saving
au BufWritePre * :%s/\s\+$//e
" auto spell check & limit width of git commit messages
Expand Down

0 comments on commit 8bf5a16

Please sign in to comment.