Coder Social home page Coder Social logo

Comments (12)

bhcleek avatar bhcleek commented on June 8, 2024

Vim-go does not have an option to build on save. It's not too difficult to set such a thing up if you want it, though, by leveraging autocommands.

But I want to be clear on what you're asking for. Are you asking for a new feature, asking for help to know how to build on save with vim-go, asking how to keep other things from running when saving, or something else entirely?

from vim-go.

bhcleek avatar bhcleek commented on June 8, 2024

I see the title changed from what it was originally. Are you saying that you're not seeing the metalinter run when saving or are you concerned that saving does not build when g:go_metalinter_autosave is enabled?

from vim-go.

bhcleek avatar bhcleek commented on June 8, 2024

Closing for lack of feedback.

from vim-go.

jinleileiking avatar jinleileiking commented on June 8, 2024

I see the title changed from what it was originally. Are you saying that you're not seeing the metalinter run when saving or are you concerned that saving does not build when g:go_metalinter_autosave is enabled?

I just enable autosave of errcheck.

the steps of vim is:

  1. :w
  2. call metalinter_autosave cmd errcheck
  3. call :GoBuild

What I want is do not call any checker like errcheck.

I you give it an "". I will enable the default linters.

from vim-go.

jinleileiking avatar jinleileiking commented on June 8, 2024

@bhcleek

from vim-go.

bhcleek avatar bhcleek commented on June 8, 2024

I think what you want is to not call the metalinter when you run :GoBuild. Is that right?

If so, then you'll need to disable the metalinter by using g:go_metalinter_autosave. :GoBuild has to before building so that the files will be persisted to disk so they're available to go build.

from vim-go.

jinleileiking avatar jinleileiking commented on June 8, 2024

I think what you want is to not call the metalinter when you run :GoBuild. Is that right?

I want not call the metalinter when I run :w (save file to disk)

my linters are controlled by ale

from vim-go.

bhcleek avatar bhcleek commented on June 8, 2024

If you don't want to call the metalinter when saving a file, then disable by leveraging g:go_metalinter_autosave. You can either remove let g:go_metalinter_autosave = 1 from your vimrc or change it to let g:go_metalinter_autosave = 0

from vim-go.

jinleileiking avatar jinleileiking commented on June 8, 2024

Afaik, if let g:go_metalinter_autosave = 1, when :w vim-go will call metalinter and then call :GoBuild.

I just want: when :w vim-go only call :GoBuild

from vim-go.

bhcleek avatar bhcleek commented on June 8, 2024

g:go_metalinter_autosave does not cause a build. Builds do not happen on save automatically. But if that's something you want, you can create your own autocmd to do it.

from vim-go.

jinleileiking avatar jinleileiking commented on June 8, 2024

I seem to understand what's going on. The metalinter I use is golangci-lint. If the codes cannot go build , golangci-lint will fail. So if linters is set to empty, a build will be executed indirectly. So, Can the enabled linter be set to none? Currently empty means that default linters are enabled.

from vim-go.

bhcleek avatar bhcleek commented on June 8, 2024

To prevent the metalinter from executing when writing the file, use let g:go_metalinter_autosave = 0.

from vim-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.