Re: [go-nuts] vim setup for auto go fmt on save.

2016-10-12 Thread Fatih Arslan
As others said you can just add a command to BufWritePost. However
don't forget that it's just runs it and is not able to capture any
parse errors and show you. It also might replace your current buffer
with the output of the error so you don't want it. Vim-go takes care
of it and has many other small improvements.

I understand you want something simple. Vim-go by default doesn't load
anything into your vim runtime. It's all lazily loaded and only is
executed if you run it (if you save it in our case).

On Mon, Oct 10, 2016 at 2:04 PM, 김용빈  wrote:
> Tank you Sander.
>
> I successfully installed and it works well.
>
> Still I want to know simple way though.
> If anyone knows about it, please let me know. :)
>
> --
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Fatih Arslan

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] vim setup for auto go fmt on save.

2016-10-10 Thread Tarsis Azevedo
Fatih, vim-go author, wrote awesome tutorial about that.
https://github.com/fatih/vim-go-tutorial/blob/master/README.md

Tarsis Figueredo Azevedo.
---
Celular: (21) 998524668
@tarsisazevedo 
---


On Mon, Oct 10, 2016 at 10:24 AM, Grzegorz Żur 
wrote:

> This will run go fmt on save.
>
> :autocmd BufWritePost *.go silent ! go fmt >/dev/null
>
> On Monday, 10 October 2016 14:04:21 UTC+2, 김용빈 wrote:
>>
>> Tank you Sander.
>>
>> I successfully installed and it works well.
>>
>> Still I want to know simple way though.
>> If anyone knows about it, please let me know. :)
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] vim setup for auto go fmt on save.

2016-10-10 Thread 김용빈
Tank you Sander.

I successfully installed and it works well.

Still I want to know simple way though.
If anyone knows about it, please let me know. :)

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] vim setup for auto go fmt on save.

2016-10-10 Thread Sander van Harmelen
If you want to develop Go in vim, I would strongly suggest to just install and 
use the vim-go package/plugin. It will help you with a lot of stuff, but most 
can be turned of if you don’t want of need it.

Sander


On 10 Oct 2016, at 08:15: 49, 김용빈  wrote:

Hello,

How could I achieve auto go fmt on save in vim? (with 2~3 lines of code)

I don't want install entire plug-in like vim-go. Or is it better to do?

Thank you.
 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com 
.
For more options, visit https://groups.google.com/d/optout 
.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] vim setup for auto go fmt on save.

2016-10-10 Thread 김용빈
Hello,

How could I achieve auto go fmt on save in vim? (with 2~3 lines of code)

I don't want install entire plug-in like vim-go. Or is it better to do?

Thank you.
 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.