{"id":42730,"date":"2024-12-01T14:22:03","date_gmt":"2024-12-01T06:22:03","guid":{"rendered":"https:\/\/fwq.ai\/blog\/42730\/"},"modified":"2024-12-01T14:22:03","modified_gmt":"2024-12-01T06:22:03","slug":"%e5%9c%a8-vim-%e4%b8%ad%e7%bc%96%e8%be%91-go-%e6%ba%90%e6%96%87%e4%bb%b6%e6%97%b6%e5%a6%82%e4%bd%95%e7%a6%81%e7%94%a8%e7%a9%ba%e6%a0%bc%e7%aa%81%e5%87%ba%e6%98%be%e7%a4%ba%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/42730\/","title":{"rendered":"\u5728 Vim \u4e2d\u7f16\u8f91 Go \u6e90\u6587\u4ef6\u65f6\u5982\u4f55\u7981\u7528\u7a7a\u683c\u7a81\u51fa\u663e\u793a\uff1f"},"content":{"rendered":"<p><b><\/b> <\/p>\n<p>\u5f53\u524d\u4f4d\u7f6e\uff1a <span>&gt;<\/span>  <span>&gt;<\/span>  <span>&gt;<\/span>  <span>&gt;<\/span> <span>\u5728 Vim \u4e2d\u7f16\u8f91 Go \u6e90\u6587\u4ef6\u65f6\u5982\u4f55\u7981\u7528\u7a7a\u683c\u7a81\u51fa\u663e\u793a\uff1f<\/span><\/p>\n<h1>\u5728 Vim \u4e2d\u7f16\u8f91 Go \u6e90\u6587\u4ef6\u65f6\u5982\u4f55\u7981\u7528\u7a7a\u683c\u7a81\u51fa\u663e\u793a\uff1f<\/h1>\n<p><span>\u6765\u6e90\uff1astackoverflow<\/span><br \/>\n<span>2024-04-25 17:42:36<\/span><br \/>\n<span><i><\/i>0\u6d4f\u89c8<\/span><br \/>\n<span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u672c\u7bc7\u6587\u7ae0\u7ed9\u5927\u5bb6\u5206\u4eab\u300a\u5728 Vim \u4e2d\u7f16\u8f91 Go \u6e90\u6587\u4ef6\u65f6\u5982\u4f55\u7981\u7528\u7a7a\u683c\u7a81\u51fa\u663e\u793a\uff1f\u300b\uff0c\u8986\u76d6\u4e86Golang\u7684\u5e38\u89c1\u57fa\u7840\u77e5\u8bc6\uff0c\u5176\u5b9e\u4e00\u4e2a\u8bed\u8a00\u7684\u5168\u90e8\u77e5\u8bc6\u70b9\u4e00\u7bc7\u6587\u7ae0\u662f\u4e0d\u53ef\u80fd\u8bf4\u5b8c\u7684\uff0c\u4f46\u5e0c\u671b\u901a\u8fc7\u8fd9\u4e9b\u95ee\u9898\uff0c\u8ba9\u8bfb\u8005\u5bf9\u81ea\u5df1\u7684\u638c\u63e1\u7a0b\u5ea6\u6709\u4e00\u5b9a\u7684\u8ba4\u8bc6(B \u6570)\uff0c\u4ece\u800c\u5f25\u8865\u81ea\u5df1\u7684\u4e0d\u8db3\uff0c\u66f4\u597d\u7684\u638c\u63e1\u5b83\u3002<\/p>\n<p> \u95ee\u9898\u5185\u5bb9<br \/>\n <\/p>\n<p>\u5728 vim \u4e2d\u7f16\u8f91 go \u6e90\u6587\u4ef6\u65f6\u5982\u4f55\u7981\u7528\u7a7a\u683c\u7a81\u51fa\u663e\u793a\uff1f<\/p>\n<p>\u6b64\u5916\uff0c\u4e3a\u4ec0\u4e48 vim \u4f1a\u5728 go \u6e90\u6587\u4ef6\u4e2d\u7a81\u51fa\u663e\u793a\u7a7a\u683c\uff0c\u800c\u5728 python \u6e90\u6587\u4ef6\u4e2d\u5374\u4e0d\u4f1a\u8fd9\u6837\u505a &#8211; \u662f\u6839\u636e\u6587\u4ef6\u6269\u5c55\u540d\u542f\u7528\u7a7a\u683c\u7a81\u51fa\u663e\u793a\uff0c\u4f8b\u5982<code>.go<\/code> \u8fd8\u662f <code>.py<\/code>\uff1f<\/p>\n<p><strong>vim \u7248\u672c\uff1a<\/strong><\/p>\n<pre>nlykkei:~$ vim --version\nVIM - Vi IMproved 8.1 (2018 May 18, compiled Sep 16 2019 18:46:24)\nIncluded patches: 1-503, 505-680, 682-1312\nCompiled by [email&nbsp;protected]\nNormal version without GUI.  Features included (+) or not (-):\n+acl               +extra_search      -mouse_netterm     -tag_old_static\n-arabic            -farsi             +mouse_sgr         -tag_any_white\n+autocmd           +file_in_path      -mouse_sysmouse    -tcl\n+autochdir         +find_in_path      -mouse_urxvt       -termguicolors\n-autoservername    +float             +mouse_xterm       +terminal\n-balloon_eval      +folding           +multi_byte        +terminfo\n-balloon_eval_term -footer            +multi_lang        +termresponse\n-browse            +fork()            -mzscheme          +textobjects\n+builtin_terms     -gettext           +netbeans_intg     +textprop\n+byte_offset       -hangul_input      +num64             +timers\n+channel           +iconv             +packages          +title\n+cindent           +insert_expand     +path_extra        -toolbar\n-clientserver      +job               -perl              +user_commands\n-clipboard         +jumplist          +persistent_undo   -vartabs\n+cmdline_compl     -keymap            +postscript        +vertsplit\n+cmdline_hist      +lambda            +printer           +virtualedit\n+cmdline_info      -langmap           -profile           +visual\n+comments          +libcall           +python\/dyn        +visualextra\n-conceal           +linebreak         -python3           +viminfo\n+cryptv            +lispindent        +quickfix          +vreplace\n+cscope            +listcmds          +reltime           +wildignore\n+cursorbind        +localmap          -rightleft         +wildmenu\n+cursorshape       -lua               +ruby\/dyn          +windows\n+dialog_con        +menu              +scrollbind        +writebackup\n+diff              +mksession         +signs             -X11\n+digraphs          +modify_fname      +smartindent       -xfontset\n-dnd               +mouse             +startuptime       -xim\n-ebcdic            -mouseshape        +statusline        -xpm\n-emacs_tags        -mouse_dec         -sun_workshop      -xsmp\n+eval              -mouse_gpm         +syntax            -xterm_clipboard\n+ex_extra          -mouse_jsbterm     +tag_binary        -xterm_save\n   system vimrc file: \"$VIM\/vimrc\"\n     user vimrc file: \"$HOME\/.vimrc\"\n 2nd user vimrc file: \"~\/.vim\/vimrc\"\n      user exrc file: \"$HOME\/.exrc\"\n       defaults file: \"$VIMRUNTIME\/defaults.vim\"\n  fall-back for $VIM: \"\/usr\/share\/vim\"\nCompilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1\nLinking: gcc   -L\/usr\/local\/lib -o vim        -lm -lncurses  -liconv -framework Cocoa<\/pre>\n<p> <\/p>\n<h2>\u89e3\u51b3\u65b9\u6848<\/h2>\n<p> <\/p>\n<p>\u5b83\u4e0d\u662f\u7a81\u51fa\u663e\u793a\uff0c\u4e5f\u4e0d\u662f\u4efb\u4f55\u63d2\u4ef6\u3002\u8fd9\u662f\u6240\u8c13\u7684\u201c\u7a7a\u767d\u9519\u8bef\u201d\u7684\u8bed\u6cd5\u7740\u8272\u2014\u2014\u4e0d\u5e94\u8be5\u51fa\u73b0\u7684\u5c3e\u968f\u7a7a\u767d\u3002\u5b83\u6765\u81ea\u5185\u7f6e\u7684 <code>syntax\/go.vim<\/code>\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u5404\u79cd\u5168\u5c40 <code>go_*<\/code> \u53d8\u91cf\u6765\u81ea\u5b9a\u4e49\u7a81\u51fa\u663e\u793a\u3002 <code>go.vim<\/code> \u9876\u90e8\u7684\u5757\u6ce8\u91ca\u89e3\u91ca\u4e86\u5b83\u4eec\uff1a<\/p>\n<pre>\" Options:\n\"   There are some options for customizing the highlighting; the recommended\n\"   settings are the default values, but you can write:\n\"     let OPTION_NAME = 0\n\"   in your ~\/.vimrc file to disable particular options. You can also write:\n\"     let OPTION_NAME = 1\n\"   to enable particular options. At present, all options default to on.\n\"\n\"   - g:go_highlight_array_whitespace_error\n\"     Highlights white space after \"[]\".\n\"   - g:go_highlight_chan_whitespace_error\n\"     Highlights white space around the communications operator that don't\n\"     follow the standard style.\n\"   - g:go_highlight_extra_types\n\"     Highlights commonly used library types (io.Reader, etc.).\n\"   - g:go_highlight_space_tab_error\n\"     Highlights instances of tabs following spaces.\n\"   - g:go_highlight_trailing_whitespace_error\n\"     Highlights trailing white space.\n<\/pre>\n<p>\u6ce8\u91ca\uff1a<\/p>\n<ul>\n<li><code>g\uff1a<\/code> \u5168\u5c40\u8bbe\u7f6e\u9009\u9879\u3002<\/li>\n<li>\u4f7f\u7528 <code>:set syntax<\/code> \u68c0\u67e5\u5f53\u524d\u8bed\u8a00\u3002<\/li>\n<li>\u8bf7\u53c2\u9605 <code>filetype.vim<\/code> \u4e86\u89e3\u6587\u4ef6\u540d\u5230\u8bed\u8a00\u7684\u6620\u5c04\u3002<\/li>\n<\/ul>\n<p>\u6587\u4e2d\u5173\u4e8e\u7684\u77e5\u8bc6\u4ecb\u7ecd\uff0c\u5e0c\u671b\u5bf9\u4f60\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\uff01\u82e5\u662f\u53d7\u76ca\u532a\u6d45\uff0c\u90a3\u5c31\u52a8\u52a8\u9f20\u6807\u6536\u85cf\u8fd9\u7bc7\u300a\u5728 Vim \u4e2d\u7f16\u8f91 Go \u6e90\u6587\u4ef6\u65f6\u5982\u4f55\u7981\u7528\u7a7a\u683c\u7a81\u51fa\u663e\u793a\uff1f\u300b\u6587\u7ae0\u5427\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u4e86\u89e3\u76f8\u5173\u6280\u672f\u6587\u7ae0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u524d\u4f4d\u7f6e\uff1a &gt; &gt; &gt; &gt; \u5728 Vim \u4e2d\u7f16\u8f91 Go \u6e90\u6587\u4ef6\u65f6\u5982\u4f55\u7981\u7528\u7a7a\u683c\u7a81\u51fa\u663e\u793a\uff1f \u5728 Vim \u4e2d\u7f16\u8f91 Go \u6e90\u6587\u4ef6\u65f6\u5982\u4f55\u7981\u7528\u7a7a\u683c\u7a81\u51fa\u663e\u793a\uff1f \u6765\u6e90\uff1astackoverflow 2024-04-25 17:42:36 0\u6d4f\u89c8 \u6536\u85cf \u672c\u7bc7\u6587\u7ae0\u7ed9\u5927\u5bb6\u5206\u4eab\u300a\u5728 Vim \u4e2d\u7f16\u8f91 Go \u6e90\u6587\u4ef6\u65f6\u5982\u4f55\u7981\u7528\u7a7a\u683c\u7a81\u51fa\u663e\u793a\uff1f\u300b\uff0c\u8986\u76d6\u4e86Golang\u7684\u5e38\u89c1\u57fa\u7840\u77e5\u8bc6\uff0c\u5176\u5b9e\u4e00\u4e2a\u8bed\u8a00\u7684\u5168\u90e8\u77e5\u8bc6\u70b9\u4e00\u7bc7\u6587\u7ae0\u662f\u4e0d\u53ef\u80fd\u8bf4\u5b8c\u7684\uff0c\u4f46\u5e0c\u671b\u901a\u8fc7\u8fd9\u4e9b\u95ee\u9898\uff0c\u8ba9\u8bfb\u8005\u5bf9\u81ea\u5df1\u7684\u638c\u63e1\u7a0b\u5ea6\u6709\u4e00\u5b9a\u7684\u8ba4\u8bc6(B \u6570)\uff0c\u4ece\u800c\u5f25\u8865\u81ea\u5df1\u7684\u4e0d\u8db3\uff0c\u66f4\u597d\u7684\u638c\u63e1\u5b83\u3002 \u95ee\u9898\u5185\u5bb9 \u5728 vim \u4e2d\u7f16\u8f91 go \u6e90\u6587\u4ef6\u65f6\u5982\u4f55\u7981\u7528\u7a7a\u683c\u7a81\u51fa\u663e\u793a\uff1f \u6b64\u5916\uff0c\u4e3a\u4ec0\u4e48 vim \u4f1a\u5728 go \u6e90\u6587\u4ef6\u4e2d\u7a81\u51fa\u663e\u793a\u7a7a\u683c\uff0c\u800c\u5728 python \u6e90\u6587\u4ef6\u4e2d\u5374\u4e0d\u4f1a\u8fd9\u6837\u505a &#8211; \u662f\u6839\u636e\u6587\u4ef6\u6269\u5c55\u540d\u542f\u7528\u7a7a\u683c\u7a81\u51fa\u663e\u793a\uff0c\u4f8b\u5982.go \u8fd8\u662f .py\uff1f vim \u7248\u672c\uff1a nlykkei:~$ vim &#8211;version VIM &#8211; Vi IMproved 8.1 (2018 May [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-42730","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/42730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=42730"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/42730\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=42730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=42730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=42730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}