From 796701caa2a4ac27eea10c658cedf0688b8e471d Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Mon, 17 Oct 2022 22:52:58 -0700 Subject: [PATCH] Add temporary markdown Vim configuration --- vim.nix | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/vim.nix b/vim.nix index bff6262..3f2bad3 100644 --- a/vim.nix +++ b/vim.nix @@ -3,13 +3,41 @@ { programs.vim = { enable = true; - # Temporary configuration for editing Nix files extraConfig = '' + " Temporary configuration for editing Nix files syntax on set autoindent set expandtab set tabstop=2 set shiftwidth=2 + + " Temporary configuration for editing markdown + " full configuration with plugins is described here + " https://blog.elnu.com/2022/06/how-to-configure-vim-for-writing + + setlocal linebreak + + set spell spelllang=en + set spelllang+=cjk " prevent CJK characters from being spellchecked + + function! Characters() + return strchars(join(getline(1, '$'), "\n")) + endfunction +function! Words() + return wordcount().words + endfunction + + function! Minutes() + let wpm = 200 + return (Words() + wpm / 2) / wpm + endfunction + + set laststatus=2 " enable status line + set statusline+=%=%{Words()}\ words, + set statusline+=\ %{Characters()}\ characters,\ about + set statusline+=\ %{Minutes()}\ minutes + " remove ugly white background + hi StatusLine ctermfg=0 ctermbg=none cterm=bold " 0 for the terminal color 0 ''; };