Skip to content

Commit

Permalink
Download portuguese spellfile if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
fortes committed Oct 25, 2024
1 parent c77dc81 commit 447a77e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions stowed-files/nvim/.vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,20 @@ endif

if has('spell')
set spelllang=en_us,pt_pt

let s:spell_file = fnamemodify($MYVIMRC, ':h').'/spell/pt.utf-8.spl'
let s:spell_url = 'http://ftp.vim.org/vim/runtime/spell/pt.utf-8.spl'

" Download Portuguese dictionary if not present
if !filereadable(s:spell_file)
echo "Portuguese spell file not found. Downloading..."
if executable('curl')
execute '!curl -fLo ' . s:spell_file . ' ' . s:spell_url
elseif executable('wget')
execute '!wget -O ' . s:spell_file . ' ' . s:spell_url
endif
endif

" Re-generate spelling files if modified
for d in glob(fnamemodify($MYVIMRC, ':h').'/spell/*.add', 1, 1)
if getftime(d) > getftime(d.'.spl')
Expand Down

0 comments on commit 447a77e

Please sign in to comment.