Skip to content

Instantly share code, notes, and snippets.

@9999years
Created November 2, 2016 01:44
Show Gist options
  • Save 9999years/c4d5ea8102df6df1a4e66edcc7ea6620 to your computer and use it in GitHub Desktop.
Save 9999years/c4d5ea8102df6df1a4e66edcc7ea6620 to your computer and use it in GitHub Desktop.
"a quick vim script for distraction free writing
"use :NoDistractions
"turns off line numbers etc, shows word count in the ruler,
"no status line
"only in the current buffer
function! NoDistractions()
setlocal nolist
setlocal laststatus=0
setlocal rulerformat=%{wordcount().words}
setlocal nonumber
setlocal cmdheight=1
"see :h i_CTRL-\_CTRL-O
inoremap <buffer> <C-s> <C-\><C-o>:w<CR>
endfunction
command! -nargs=0 NoDistractions call NoDistractions()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment