diff --git a/cspell.json b/cspell.json new file mode 100644 index 0000000..8642716 --- /dev/null +++ b/cspell.json @@ -0,0 +1 @@ +{"words":["nvim","builtins","stylua","rustfmt"],"flagWords":[],"version":"0.2","language":"en"} diff --git a/en.utf-8.add b/en.utf-8.add deleted file mode 100644 index 8335709..0000000 --- a/en.utf-8.add +++ /dev/null @@ -1,10 +0,0 @@ -config -nvim -lua -utf -autocmd -set -spellfile -lodash -metadataSemver -util diff --git a/en.utf-8.add.spl b/en.utf-8.add.spl deleted file mode 100644 index 61793d9..0000000 Binary files a/en.utf-8.add.spl and /dev/null differ diff --git a/init.lua b/init.lua index a64006e..a20a2dd 100644 --- a/init.lua +++ b/init.lua @@ -4,12 +4,14 @@ vim.cmd [[ au BufNewFile,BufRead *.http setfiletype http augroup END - autocmd BufRead,BufNewFile *.ts,*.tsx,*.py,*.js,*.jsx,*.css,*.scss,*.rs,*.lua,*.html setlocal spell spelllang=en_us wrap + " autocmd BufRead,BufNewFile *.ts,*.tsx,*.py,*.js,*.jsx,*.css,*.scss,*.rs,*.lua,*.html setlocal spell spelllang=en_us wrap " autocmd BufRead,BufNewFile * setlocal spell spelllang=en_us wrap set spellfile=~/.config/nvim/lua/user/en.utf-8.add + set autoread + au FocusGained,BufEnter * :checktime ]] return { diff --git a/plugins/null-ls.lua b/plugins/null-ls.lua index 84fbe9a..bedcad2 100644 --- a/plugins/null-ls.lua +++ b/plugins/null-ls.lua @@ -1,7 +1,28 @@ +-- npm install -g cspell@latest + + + +local output = vim.fn.system({ + "command", + "-v", + "cspell" +}) +if output == nil or output == "" then +-- if v:shell_error != 0 then + vim.fn.system({ + "npm", + "install", + "-g", + "cspell@latest" + }) + +end + + return { "jose-elias-alvarez/null-ls.nvim", opts = function(_, config) - -- config variable is the default configuration table for the setup function call + -- config variable is the default definitions table for the setup function call local null_ls = require "null-ls" -- Check supported formatters and linters @@ -12,7 +33,11 @@ return { null_ls.builtins.formatting.stylua, null_ls.builtins.formatting.prettier, null_ls.builtins.formatting.rustfmt, + null_ls.builtins.diagnostics.cspell, + null_ls.builtins.code_actions.cspell, } + + config.update_in_insert = true; return config -- return final config table end, }