vim-shellcheck icon indicating copy to clipboard operation
vim-shellcheck copied to clipboard

Plugin doesn't do anything when writing on openSUSE, but on MacOS it does

Open thomasmerz opened this issue 4 years ago β€’ 4 comments

I found your fancy ❀️ vim-plugin and use it on MacOS and on openSUSE (both are my main workstation(s) and servers):

On MacOS it behaves like this:

  • 🟩 shellcheck on write (:w) grafik
  • πŸ›‘ shellcheck on demand (:Shellcheck!) grafik

And on openSUSE it only works on demand:

  • πŸ›‘ shellcheck on write (:w) (nothing happens at all!?)
  • 🟩 shellcheck on demand (:Shellcheck!) grafik

My vim on MacOS:

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 24 2021 06:02:32)
macOS version - x86_64
Included patches: 1-3455
Compiled by Homebrew

My vim on OpenSUSE:

VIM - Vi IMproved 8.0 (2016 Sep 12)
Included patches: 1-1568
Compiled by 'http://www.opensuse.org/'

I tried it also with a more current vim on openSUSE (8.2.4375-lp153.721.1), but this didn't make it better in any way…

shellcheck on write would be what I prefer. Can you @itspriddle please help what's wrong here? πŸ€·πŸ»β€β™‚οΈ Thanks a lot!

thomasmerz avatar Feb 22 '22 14:02 thomasmerz

Hey @thomasmerz

Are you using any other listing plugins, such as syntastic? This plugin doesn't do anything on :w on its own (although you could add it with an autocmd BufWrite *.sh :ShellCheck!)

The other thing that stands out is the error from your macOS screenshot using :ShellCheck!. Behind the scenes, this plugin creates a temp file here, which has the contents of the current buffer (or highlighted text) written to it. This temp file is the one that actually has spellcheck -f gcc ... performed on it. The point this plugin is trying to run spellcheck the file is missing. I can't duplicate that on Vim 8.2p4400 from Homebrew on my M1 Macs running macOS 12.2.1 .

It feels like vim-spellcheck is indeed working as designed on your OpenSUSE box, but the temp file issue on macOS is definitely a weird issue I haven't seen myself.

Are you doing anything out of the ordinary with temp files/dirs on your Mac?

itspriddle avatar Feb 22 '22 20:02 itspriddle

Regarding the tempfile: I've set set directory=~/temp,. on both MacOS and openSUSE. But also with set directory=. or set directory= nothing changes with :ShellCheck! on πŸ›‘ MacOS or on 🟩 openSUSE. On MacOS there's TMPDIR=/var/folders/89/t8gb_dhj0bl_fmcj76pxy4g80000gp/T/ set in my bash:

$ ll -d $TMPDIR
drwx------ Thomas.Merz staff 6.0 KB now ο„• /var/folders/89/t8gb_dhj0bl_fmcj76pxy4g80000gp/T/

Nothing like this on my openSUSE…

That's really weird: "/var/folders/89/t8gb_dhj0bl_fmcj76pxy4g80000gp/T/vsvCjOn/3-abc.sh: /var/folders/89/t8gb_dhj0bl_fmcj76pxy4g80000gp/T/vsvCjOn/3-abc.sh: openBinaryFile: does not exist (No such file or directory)" πŸ€₯ grafik

thomasmerz avatar Feb 22 '22 21:02 thomasmerz

Here are my vim-plugins on:

  • MacOS ο„• ack.vim/ ο„• aws-vim/ ο„• sudo.vim/ ο„• syntastic/ ο„• tabular/ ο„• vim-airline/ ο„• vim-airline-themes/ ο„• vim-better-whitespace/ ο„• vim-fugitive/ ο„• vim-gitgutter/ ο„• vim-gnupg/ ο„• vim-json/ ο„• vim-puppet/ ο„• vim-shellcheck/

  • openSUSE 22:08 $ ls -1d */ ο„• vim-airline/ ο„• vim-better-whitespace/ ο„• vim-fugitive/ ο„• vim-gitgutter/ ο„• vim-gnupg/ ο„• vim-shellcheck/

🟩 After adding syntastic also on openSUSE it works for me with :w to shellcheck also on openSUSE. Thank you for this "hint" πŸ˜„ That's the way I like it πŸ‘πŸ»

thomasmerz avatar Feb 22 '22 21:02 thomasmerz

@itspriddle , have you any idea after my update?

thomasmerz avatar Mar 17 '22 22:03 thomasmerz