Help, I need a lightweight Go syntax-aware editor

polaris · · 740 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>This is not another post asking for best IDE/editor for Golang, so please bear with me.</p> <p>I need to remotely access a Linux server to edit and build my Go project. When I am working locally, I use Emacs and Atom with all the fancy plugins. But when I am remote ( using VPN or SSH tunnel) I have to do X-forwarding and that too on a poor link. Emacs gets a little slow but Atom is unusable over this link. Is there something light-weight I can use? I am ready to compromise some functionality but syntax highlighting, automatic formatting and auto-completion are absolute minimum requirement.</p> <p>Please recommend me something for my use-case. Thanks in advance.</p> <hr/>**评论:**<br/><br/>intermernet: <pre><p>If you can customize the remote box, and want to stick with emacs, you should be able to install go-mode for emacs. <a href="https://github.com/dominikh/go-mode.el" rel="nofollow">https://github.com/dominikh/go-mode.el</a> has instructions for installation and further configuration.</p></pre>aldto: <pre><p>I don&#39;t have an answer, but I&#39;m interested in why you need to use x-forwarding. I don&#39;t have experience with x-forwarding, but I imagine that running emacs in an SSH terminal session, transfering a few ANSI characters at a time, would be a whole lot faster than transfering x-window data. Just a guess, but I can&#39;t really think of how the vim suggestions would really make a difference in your case for the same reason. Maybe someone can expand on their answer?</p></pre>Have_No_Name: <pre><p>I was trying to use the same environment as when I am on-site. I used Emacs with go-mode. And you are correct, it is much faster when I just do &#34;emacs -nw&#34; on the SSH terminal itself. But I lose all the fancy fonts and stuff.</p></pre>peterhellberg: <pre><p>A small price to pay in order to get a more responsive editor IMHO. If you have a really bad connection then you might also want to check out MOSH (The mobile shell)</p></pre>kavehmz: <pre><p>How much access you have? Can you mount your project dir remotely (sshfs)? Many others here are also suggesting almost similar solutions and we all are tying to suggest you to avoid x-froward. No matter emacs or vim, x-forwarding will be slow for most developers.</p></pre>EdiX: <pre><p>sshfs.</p></pre>izuriel: <pre><p>I&#39;ve never used emacs, but do you think vim would be more lightweight over the connection? I know vim-go covers most of your needs. Not sure about auto completion. I personally prefer <code>go doc</code> now that it&#39;s a thing. </p></pre>bradleyfalzon: <pre><p>This. Syntax highlighting comes via vim-go, automatic formatting too. Auto-completion, I&#39;d like to know others&#39; solutions, as I&#39;ve never used it, but check out YouCompleteMe vim plugin.</p> <p>.vim example (but check out the help for information on each of these, sorry for the lack of comments):</p> <pre><code>let g:go_fmt_autosave = 1 let g:go_fmt_command = &#34;goimports&#34; let g:go_highlight_functions = 1 let g:go_highlight_methods = 1 let g:go_highlight_structs = 1 let g:go_highlight_operators = 1 let g:go_highlight_build_constraints = 1 </code></pre> <p>Essentially, you should consider a dotfiles repo to keep you vim config in sync between machines (if relevant for your use case).</p></pre>izuriel: <pre><p>I primarily use Atom for projects but I keep vim tricked out and fancy for every other need. One day I&#39;ll probably switch. I&#39;ll just bored some of these for my own .vimrc!</p></pre>TheMiamiWhale: <pre><p>Sounds like OP&#39;s issue isn&#39;t using emacs - it&#39;s that he doesn&#39;t want to us emacs via SSH terminal and is wanting to stick with x-forwarding.</p></pre>sybrandy: <pre><p>I&#39;m a big vim fan. From what I&#39;ve been told, slow terminals is why VI was designed the way it is. You&#39;re welcome to use my vim configuration at <a href="https://github.com/sybrandy/local_config" rel="nofollow">https://github.com/sybrandy/local_config</a> look in the .vim directory to see everything. However, I suggest you start from scratch, use a few tutorials, and add in only what you like/need vs. just using what someone else says you have too.</p> <p>Good luck and if you do go down this road, check out <a href="/r/vim" rel="nofollow">r/vim</a> for tips, help, etc.</p></pre>momonga2345: <pre><p>With emacs you can use <a href="https://www.gnu.org/software/tramp/" rel="nofollow">tramp-mode</a> to edit remote files through ssh</p></pre>tiberiousr: <pre><p>Go to <a href="http://vim-bootstrap.com" rel="nofollow">http://vim-bootstrap.com</a> and select Go and any other languages you need, then use Vim. It&#39;s excellent.</p></pre>binaryblade: <pre><p>Vim</p></pre>SSoreil: <pre><p>Vim with Vim-go should go over fine.</p></pre>qcoh: <pre><p>You can use emacs with <a href="http://wikemacs.org/wiki/TRAMP" rel="nofollow">tramp-mode</a>.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

740 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传