This is a creation in Article, where the information may have evolved or changed.
Golang Walk (ix) Linux under Go language vim settings
To install Vundle.vim under Linux, refer to Https://github.com/VundleVim/Vundle.vim Get and configure
Open. VIMRC, if no. VIMRC can be created, copy the following to. vimrc
"An example for a VIMRC file.""Maintainer:bram moolenaar <Bram@vim.org>"Last change: theNov to""To useit,Copy it to"for Unix and OS/2: ~/.VIMRC" forAmiga:s:.vimrc"For MS-dos and Win32: $VIM \_VIMRC" forOpenvms:sys$login:.vimrcSetNocompatible"be improved, requiredfiletype off"Required"Set the runtime path to include Vundle and Initializeset Rtp+=~/.vim/bundle/vundle.vimcall vundle#begin ()"Let Vundle manage Vundle, Requiredplugin ' Gmarik/vundle.vim '"All of your Plugins must is added before the following Lineplugin ' Fatih/vim-go ' Call Vundle#end ()"Requiredfiletype Plugin Indent on "Required"When started as "Evim", Evim.vim would already has done these settings.ifV:progname =~?"Evim"Finishendif"Use Vim settings, rather than Vi settings (much better!)."This must is First, becauseitChanges other options asA side effect.SetNocompatible"Allow backspacing to everything in insert Modeset backspace=indent,eol,startif have ("Vms") Set Nobackup"Do notKeep a backupfile, use versions insteadElse SetBackup"Keep a backup file (restore to previous version) set Undofile"Keep an undofile(Undo Changes AfterClosing) endifSethistory= - "Keep lines of command line Historyset ruler"Show theCursor position All the TimeSetShowCmd"Display incomplete commandsset incsearch"Do incremental searching"for Win32 gui:remove ' flag from ' guioptions ': No tearoff menu Entries"Let &guioptions = Substitute (&guioptions,"T","","G")"Don ' t use Ex mode, use Q for Formattingmap q GQ"Ctrl-uinchInsert mode deletes a lot. Use Ctrl-g u to FirstBreak Undo,"So, can undo ctrl-u after inserting a line break.inoremap <C-U> <C-G>u<C-U>"In many terminal emulators theMouse works just fine, thus enableit.ifHas (' mouse ')SetMouse=aendif"Switch syntax highlighting on while the terminal has colors"Also switch onHighlighting the LastUsed search pattern.if&t_co >2|| Has ("Gui_running") syntax on SetHlsearchendif"Only do the" when the compiled with the Autocommands.if has ("Autocmd") "EnablefileType detection."Use of the default filetype settings, so-mail gets ' tw ' set to"' Cindent ' is on inchC files, etc."Also load indent files, to automatically do language-dependent indenting. FileType plugin indent on "Put theseinchAn autocmd group, so thatWe can delete them easily. Augroup Vimrcex au!"For all text files set ' TextWidth ' to characters. Autocmd FileType text setlocal textwidth=78 "When editing afile, always jump to the LastKnown cursor position."Don ' t does it when the position are invalid or when inside an event handler"(happens when dropping afile onGVIM)."Also does it when the mark was in the first line, which is the default"Position when opening afile. Autocmd Bufreadpost * \ifLine"'\"") >1&& Line ("'\"") <= Line ("$") | \ EXE"normal! G ' \ ""| \ endif Augroup ENDElse SetAutoindent"Always set autoindenting onendif"Has ("Autocmd")"Convenient command to see the difference between the current buffer and the" file itwas loaded from, thus theChanges you made."Only define it is not defined Already.if!exists (":D Ifforig") command Difforig vert New | Set Bt=nofile | R ++edit # | 0d_ | Diffthis \ | Wincmd p | Diffthisendifif has (' Langmap ') && exists (' +langnoremap ') "Prevent that theLangmap option applies to characters that result fromA"Mapping. If unset (default), this could break plugins (but it ' s backward "Compatible).SetLangnoremapendifSetNuSettabstop=4Setsofttabstop=4SetShiftwidth=4SetNobackup"Here is Ctagsset tags=/home/.../go/go/tagsset tags+=/home/.../go/dev/danmu/tags
- Use Vim to open the. VIMRC, using the command: Plugininstall, you can download the corresponding plugin package.
This is where you can edit the. go file using Vim.
If required, you can use the latest ctags, be sure to be up-to-date, otherwise not supported. Go tags