Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not running on save. Did I skip a step? #9

Open
coolaj86 opened this issue Mar 27, 2021 · 1 comment
Open

Not running on save. Did I skip a step? #9

coolaj86 opened this issue Mar 27, 2021 · 1 comment

Comments

@coolaj86
Copy link

  1. I've installed shfmt:
    curl -sS https://webinstall.dev/shfmt | bash
  2. I've installed vim-shfmt in the vim 8 plugin style:
    mkdir -p ~/.vim/pack/plugins/start/
    git clone --depth=1 https://github.com/z0mbix/vim-shfmt.git ~/.vim/pack/plugins/start/shfmt
  3. I've created a file with the options I want:
    ~/vim/plugins/shfmt.vim
    let g:shfmt_extra_args = '-i 4 -sr -s'
    let g:shfmt_fmt_on_save = 1
  4. I've sourced that file in my ~/.vimrc:
    " Shfmt: TODO add to Webi
    source ~/.vim/plugins/shfmt.vim

Now if I run :Shfmt I can see that it indents, but it's not indenting on save.

What have I misunderstood or done wrong?

@z0mbix
Copy link
Owner

z0mbix commented May 12, 2021

Are your settings actually in ~/vim/plugins/shfmt.vim or was that a typo?

also, is the file you’re editing detected as a shell script (filetype sh)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants