├── .gitignore ├── .gitmodules ├── README.md ├── assets └── source-code-pro │ ├── SIL Open Font License.txt │ ├── SourceCodePro-Black.otf │ ├── SourceCodePro-BlackIt.otf │ ├── SourceCodePro-Bold.otf │ ├── SourceCodePro-BoldIt.otf │ ├── SourceCodePro-ExtraLight.otf │ ├── SourceCodePro-ExtraLightIt.otf │ ├── SourceCodePro-It.otf │ ├── SourceCodePro-Light.otf │ ├── SourceCodePro-LightIt.otf │ ├── SourceCodePro-Medium.otf │ ├── SourceCodePro-MediumIt.otf │ ├── SourceCodePro-Regular.otf │ ├── SourceCodePro-Semibold.otf │ └── SourceCodePro-SemiboldIt.otf ├── ctags └── .ctags ├── gvimrcs └── shortcuts.vim ├── install.sh ├── screenshots └── screenshot_01.png └── vimrcs ├── extended.vim └── plugins.vim /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | .DS_STORE 3 | 4 | # Vim 5 | plugged/ 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "submodules/amix-vimrc"] 2 | path = submodules/amix-vimrc 3 | url = https://github.com/amix/vimrc.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vim-go-runtime 2 | Fast and extendable vim-based go development environment. Inspired by farazdagi's vim-go-ide and powering fatih's vim-go plugin. 3 | 4 | vim-go-runtime 5 | 6 | ## Install 7 | 8 | 0. Get a high enough version of Vim (7.4+) and MacVim: 9 | 10 | ``` 11 | $ brew install vim --with-lua 12 | $ brew install macvim --with-lua 13 | ``` 14 | You probably need to add this to your `.bash_profile` to pick the right vim: 15 | ``` 16 | alias vim="/usr/local/bin/vim" 17 | ``` 18 | Don't forget to source afterwards: 19 | ``` 20 | $ source ~/.bash_profile 21 | ``` 22 | 23 | 1. Backup your old **.vimrc**, **.gvimrc** or **.ctags** if you have any: 24 | 25 | ```$ cp ~/.vimrc ~/.vimrc_backup``` 26 | 27 | 2. Clone this repository to your home folder and run the install script (this takes some time): 28 | 29 | ``` 30 | $ git clone --recursive git@github.com:codepushr/vim-go-runtime.git ~/.vim-go-runtime 31 | $ sh ~/.vim-go-runtime/install.sh 32 | ``` 33 | 34 | 4. Install Go binaries (inside Vim): 35 | 36 | ``` 37 | :GoInstallBinaries 38 | ``` 39 | 40 | ## Troubleshooting 41 | 42 | ##### After cloning the repository I'm getting the following git error 43 | 44 | ``` 45 | No submodule mapping found in .gitmodules for path 'sources_non_forked/gruvbox' 46 | Failed to recurse into submodule path 'submodules/amix-vimrc' 47 | ``` 48 | Simply ignore this. This is a gruvbox submodule error in amix' repository (from which we use the base vimrc config). This setup even includes gruvbox with the vim-colorschemes plugin. 49 | 50 | ##### I'm getting a YouCompleteMe error after running the install script 51 | 52 | ``` 53 | ycm_client_support.[so|pyd|dll] and ycm_core.[so|pyd|dll] not detected; 54 | you need to compile YCM before using it. Read the docs! 55 | ``` 56 | This is just a warning, don't be scared. Just let the install script finish and it will compile it afterwards. Everything should run just fine after the script ends. 57 | 58 | ## Vimrcs 59 | 60 | There are several vimrcs that play together in this configuration. 61 | 62 | 1. The base vimrc by amix located in `submodules/amix-vimrc/vimrcs/basic.vim` 63 | 2. The extended vimrc for custom configs located in `vimrc/extended.vim` 64 | 3. The plugins vimrc with the list of plugins an their configs located in `vimrcs/plugins.vim` 65 | 4. The shortcut config for mvim (gui_running) located in `gvimrcs/shortcuts.vim` 66 | 67 | ## Plugins 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 |
PluginDescription
Valloric/YouCompleteMeYou need this for proper auto completion when coding in go.
kien/ctrlpSwitch between files, buffers or tags in no time. Yeah!
xolox/vim-miscDependency for vim-session, see below.
xolox/vim-sessionDon't abuse tmux, use vim-session to reopen all your buffers!
fatih/vim-goThis is THE golang plugin for vim! The reason I switched to vim.
garyburd/go-explorerNice to have plugin to show documentation for a specific package.
sirver/ultisnipsReally useful plugin if you want to generate boilerplate code.
tpope/vim-fugitiveGit integration to check commits, status and more directly in vim.
tomtom/tcomment_vimPlugin for super fast and convenient commenting (inline, block).
scrooloose/nerdtreeShows a file tree on the left and lets you modify files directly in vim.
Raimondi/delimitMateVery useful plugin for auto-completing quotes, parens, brackets etc.
rking/agThis plugin lets you browse for code throughout your whole project.
majutsushi/tagbarShows a sexy tag-bar on the right and lets you jump directly to tags.
ap/vim-buftablineDisplays a bar on the top showing all your open buffers.
itchyny/lightlineThis plugin shows a nice status bar and is very configurable.
flazz/vim-colorschemesGives you tons of color schemes for vim.
mhinz/vim-sayonaraThis plugin helps you to close buffers or whole windows.
143 | 144 | ## Leader 145 | 146 | The leader is configured as `,` 147 | 148 | ## Shortcuts 149 | 150 | Here's a quick list of shortcuts that I configured. You can change them to your needs in `vimrcs/extended.vim` or `vimrcs/plugins.vim` or `gvimrcs/shortcuts.vim`. 151 | 152 | #### Navigation 153 | 154 |
Basic
155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 |
ShortcutDescription
[ctrl]+TabSwitch to next buffer
[ctrl]+[shift]+TabSwitch to previous buffer
[cmd]+[alt]+LeftSwitch to left pane (mvim)
[cmd]+[alt]+RightSwitch to right pane (mvim)
[cmd]+[alt]+UpSwitch to upper pane (mvim)
[cmd]+[alt]+DownSwitch to lower pane (mvim)
[cmd]+wClose buffer (mvim)
[cmd]+[shift]+wClose window & buffer (mvim)
[leader]+nToggle nerdtree navigator
[leader]+mToggle tagbar
201 | 202 |
Ctrlp
203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |
ShortcutDescription
[leader]+jList of last opened buffers
[crtl]+fList of all files in the project
[crtl]+dList of all tags in current buffer
221 |
Quickfix
222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 |
ShortcutDescription
[ctrl]+nGo to next occurance
[ctrl]+pGo to previous occurance
[leader]+aClose quickfix window
240 | 241 | #### Golang 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 |
ShortcutDescription
[leader]+iRun go info on the current selection
[leader]+rRun current file
[leader]+bBuild current project
[leader]+dRun go doc on the current selection
[leader]+fJump to the definition of selection
269 | 270 | #### Comments 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 |
ShortcutDescription
[leader]+__Toggle comment selection
282 | 283 | #### Project wide search 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 |
ShortcutDescription
[leader]+gSearch for term
[ctrl]+nGo to next occurance
[ctrl]+pGo to previous occurance
[leader]+aClose quickfix window
307 | 308 | ## Licence Information 309 | 310 | MIT LICENCE 311 | 312 | Copyright 2015 - by Aleksandar Palic - http://www.twitter.com/codepushr 313 | 314 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 315 | 316 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 317 | 318 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 319 | -------------------------------------------------------------------------------- /assets/source-code-pro/SIL Open Font License.txt: -------------------------------------------------------------------------------- 1 | Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. 2 | 3 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 4 | This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL 5 | 6 | ----------------------------------------------------------- 7 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 8 | ----------------------------------------------------------- 9 | 10 | PREAMBLE 11 | The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. 12 | 13 | The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. 14 | 15 | DEFINITIONS 16 | "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. 17 | 18 | "Reserved Font Name" refers to any names specified as such after the copyright statement(s). 19 | 20 | "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). 21 | 22 | "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. 23 | 24 | "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. 25 | 26 | PERMISSION & CONDITIONS 27 | Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 28 | 29 | 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 30 | 31 | 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 32 | 33 | 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 34 | 35 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 36 | 37 | 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. 38 | 39 | TERMINATION 40 | This license becomes null and void if any of the above conditions are not met. 41 | 42 | DISCLAIMER 43 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-Black.otf -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-BlackIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-BlackIt.otf -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-Bold.otf -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-BoldIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-BoldIt.otf -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-ExtraLight.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-ExtraLight.otf -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-ExtraLightIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-ExtraLightIt.otf -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-It.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-It.otf -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-Light.otf -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-LightIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-LightIt.otf -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-Medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-Medium.otf -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-MediumIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-MediumIt.otf -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-Regular.otf -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-Semibold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-Semibold.otf -------------------------------------------------------------------------------- /assets/source-code-pro/SourceCodePro-SemiboldIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/assets/source-code-pro/SourceCodePro-SemiboldIt.otf -------------------------------------------------------------------------------- /ctags/.ctags: -------------------------------------------------------------------------------- 1 | --langdef=Go 2 | --langmap=Go:.go 3 | --regex-Go=/func([ \t ]+\([^)]+\))?[ \t ]+([a-zA-Z0-9_]+)/\2/f,func/ 4 | --regex-Go=/var[ \t ]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/v,var/ 5 | --regex-Go=/type[ \t ]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/t,type/ 6 | -------------------------------------------------------------------------------- /gvimrcs/shortcuts.vim: -------------------------------------------------------------------------------- 1 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2 | " => Shortcuts 3 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 4 | 5 | " Replace CMD+w with closing buffer but preserving window 6 | macmenu &File.Close key= 7 | nmap :Sayonara! 8 | imap :Sayonara! 9 | 10 | " Replace CMD+shift-w with closing buffer and window 11 | macmenu &File.Close\ Window key= 12 | nmap :Sayonara 13 | imap :Sayonara 14 | 15 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | ############################################################### 2 | # => Install Script 3 | ############################################################### 4 | 5 | cd ~/.vim-go-runtime 6 | 7 | curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ 8 | https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 9 | 10 | echo "Setting up base config ..." 11 | echo "set runtimepath+=~/.vim_go_runtime" > ~/.vimrc 12 | # Load base config and plugins 13 | echo "source ~/.vim-go-runtime/submodules/amix-vimrc/vimrcs/basic.vim" >> ~/.vimrc 14 | echo "source ~/.vim-go-runtime/vimrcs/plugins.vim" >> ~/.vimrc 15 | 16 | echo "Installing plugins ..." 17 | 18 | vim +PlugInstall +qall 19 | 20 | echo "Setting up extended config ..." 21 | # Load extended configs 22 | echo "source ~/.vim-go-runtime/vimrcs/extended.vim" >> ~/.vimrc 23 | echo "source ~/.vim-go-runtime/gvimrcs/shortcuts.vim" > ~/.gvimrc 24 | 25 | echo "Setting up ctags for go ..." 26 | echo "set tags=~/.vim-go-runtime/ctags/.ctags" >> ~/.vimrc 27 | 28 | echo "Finished setting up! :)" 29 | 30 | -------------------------------------------------------------------------------- /screenshots/screenshot_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x7061/vim-go-runtime/8d28e09d031d5b67a41933bda4e7cb9bcbe5b3cb/screenshots/screenshot_01.png -------------------------------------------------------------------------------- /vimrcs/extended.vim: -------------------------------------------------------------------------------- 1 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2 | " => GUI related 3 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 4 | " Set font according to system 5 | if has("mac") || has("macunix") 6 | set gfn=Source\ Code\ Pro:h12,Menlo:h11 7 | elseif has("win16") || has("win32") 8 | set gfn=Source\ Code\ Pro:h12,Bitstream\ Vera\ Sans\ Mono:h11 9 | elseif has("linux") 10 | set gfn=Source\ Code\ Pro:h12,Bitstream\ Vera\ Sans\ Mono:h11 11 | elseif has("unix") 12 | set gfn=Monospace\ 11 13 | endif 14 | 15 | " Disable scrollbars (real hackers don't use scrollbars for navigation!) 16 | set guioptions-=r 17 | set guioptions-=R 18 | set guioptions-=l 19 | set guioptions-=L 20 | set guioptions-=T 21 | 22 | set foldcolumn=0 23 | 24 | " Colorscheme 25 | if has("gui_running") 26 | set linespace=2 27 | set background=dark 28 | 29 | let g:rehash256 = 1 30 | let g:molokai_original = 1 31 | colorscheme molokai 32 | else 33 | colorscheme iceberg 34 | endif 35 | 36 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 37 | " => Coding related 38 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 39 | 40 | set number 41 | "set cursorline 42 | set nocursorcolumn 43 | set colorcolumn=80 44 | set pumheight=10 45 | set cmdheight=1 46 | set completeopt=menu,menuone 47 | set lazyredraw 48 | "set list 49 | "set listchars=tab:▸\ ,trail:·,eol:¬,extends:❯,precedes:❮ 50 | 51 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 52 | " => Clipboard 53 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 54 | 55 | set clipboard^=unnamed 56 | set clipboard^=unnamedplus 57 | 58 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 59 | " => Buffer Handling 60 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 61 | 62 | noremap :bnext 63 | noremap :bprevious 64 | 65 | set switchbuf=useopen,usetab 66 | 67 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 68 | " => Split Pane Handling 69 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 70 | 71 | " Attempt to make window switching even more elegant 72 | " by binding CMD+ALT+LEFT or RIGHT 73 | if has("gui_running") 74 | map h 75 | map l 76 | map k 77 | map j 78 | endif 79 | 80 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 81 | " => Quickfix 82 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 83 | 84 | autocmd FileType qf wincmd J 85 | nnoremap a :cclose 86 | map :cn 87 | map :cp 88 | 89 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 90 | " => GoDebug 91 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 92 | 93 | nmap :normal o_ = "breakpoint" 94 | 95 | -------------------------------------------------------------------------------- /vimrcs/plugins.vim: -------------------------------------------------------------------------------- 1 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2 | " => Plugins 3 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 4 | 5 | call plug#begin('~/.vim-go-runtime/plugged') 6 | 7 | " Mandatory 8 | Plug 'Valloric/YouCompleteMe', {'do': './install.py --all'} 9 | Plug 'ctrlpvim/ctrlp.vim' 10 | 11 | " Golang 12 | Plug 'fatih/vim-go', {'for': 'go'} " THE go plugin 13 | Plug 'SirVer/ultisnips' " For awesome go snippets 14 | 15 | " Important 16 | Plug 'tpope/vim-fugitive' " Git integration 17 | Plug 'tomtom/tcomment_vim' " Commenting made easy 18 | Plug 'scrooloose/nerdtree' " File tree 19 | Plug 'Raimondi/delimitMate' " Auto-close brackets 20 | Plug 'rking/ag.vim' " For silver surfing 21 | Plug 'majutsushi/tagbar' " Tagbar 22 | Plug 'ap/vim-buftabline' " Buffer bar 23 | 24 | " Nice to have 25 | Plug 'itchyny/lightline.vim' " Statusline 26 | Plug 'flazz/vim-colorschemes', { 'do': 'ln -s ~/.vim-go-runtime/plugged/vim-colorschemes/colors ~/.vim/colors' } 27 | Plug 'fatih/molokai' " Fatih's molokai theme 28 | Plug 'mhinz/vim-sayonara' " Kill buffer without closing window 29 | 30 | call plug#end() 31 | 32 | set nocompatible " iMproved, required 33 | filetype off " Required 34 | filetype plugin indent on " Required 35 | 36 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 37 | " => Plugin Configuration 38 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 39 | 40 | " 41 | " UltiSnips 42 | " 43 | function! g:UltiSnips_Complete() 44 | call UltiSnips#ExpandSnippet() 45 | if g:ulti_expand_res == 0 46 | if pumvisible() 47 | return "\" 48 | else 49 | call UltiSnips#JumpForwards() 50 | if g:ulti_jump_forwards_res == 0 51 | return "\" 52 | endif 53 | endif 54 | endif 55 | return "" 56 | endfunction 57 | 58 | function! g:UltiSnips_Reverse() 59 | call UltiSnips#JumpBackwards() 60 | if g:ulti_jump_backwards_res == 0 61 | return "\" 62 | endif 63 | 64 | return "" 65 | endfunction 66 | 67 | 68 | if !exists("g:UltiSnipsJumpForwardTrigger") 69 | let g:UltiSnipsJumpForwardTrigger = "" 70 | endif 71 | 72 | if !exists("g:UltiSnipsJumpBackwardTrigger") 73 | let g:UltiSnipsJumpBackwardTrigger="" 74 | endif 75 | 76 | au InsertEnter * exec "inoremap " . g:UltiSnipsExpandTrigger . " =g:UltiSnips_Complete()" 77 | au InsertEnter * exec "inoremap " . g:UltiSnipsJumpBackwardTrigger . " =g:UltiSnips_Reverse()" 78 | 79 | " 80 | " Ctrlp 81 | " 82 | map j :CtrlPBuffer 83 | let g:ctrlp_working_path_mode = 1 84 | let g:ctrlp_map = '' 85 | let g:ctrlp_max_height = 10 86 | let g:ctrlp_custom_ignore = 'node_modules\|^\.DS_Store\|^\.git\|^\.coffee' 87 | let g:ctrlp_use_caching = 1 88 | let g:ctrlp_clear_cache_on_exit = 0 89 | let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp' 90 | let g:ctrlp_extensions = ['tag', 'buffertag'] 91 | let g:ctrlp_buftag_types = { 92 | \ 'go' : '--language-force=go --golang-types=ftv', 93 | \ 'markdown' : '--language-force=markdown --markdown-types=hik', 94 | \ } 95 | 96 | nmap :CtrlPBufTag 97 | 98 | " 99 | " Vim-Go 100 | " 101 | let g:go_fmt_fail_silently = 0 102 | let g:go_fmt_command = "goimports" 103 | let g:go_autodetect_gopath = 1 104 | let g:go_snippet_case_type = "camelcase" 105 | 106 | let g:go_highlight_space_tab_error = 0 107 | let g:go_highlight_array_whitespace_error = 0 108 | let g:go_highlight_trailing_whitespace_error = 0 109 | let g:go_highlight_extra_types = 1 110 | let g:go_highlight_functions = 1 111 | let g:go_highlight_types = 1 112 | let g:go_highlight_fields = 1 113 | let g:go_highlight_methods = 1 114 | let g:go_highlight_structs = 1 115 | let g:go_highlight_operators = 1 116 | let g:go_highlight_build_constraints = 1 117 | 118 | au FileType go nmap i (go-info) 119 | au FileType go nmap r (go-run) 120 | au FileType go nmap b (go-build) 121 | au FileType go nmap d (go-doc) 122 | au FileType go nmap f (go-def) 123 | au FileType go nmap t (go-test) 124 | au FileType go nmap l :GoLint 125 | au FileType go nmap e (go-rename) 126 | au FileType go map p :GoPlay 127 | 128 | " 129 | " Nerdtree 130 | " 131 | map n :NERDTreeToggle 132 | let g:NERDTreeWinSize=34 133 | 134 | " 135 | " DelimitMate 136 | " 137 | let g:delimitMate_expand_cr = 1 138 | let g:delimitMate_expand_space = 1 139 | let g:delimitMate_smart_quotes = 1 140 | let g:delimitMate_expand_inside_quotes = 0 141 | let g:delimitMate_smart_matchpairs = '^\%(\w\|\$\)' 142 | 143 | " 144 | " Tagbar 145 | " 146 | nmap m :TagbarToggle 147 | let g:tagbar_width = 34 148 | let g:tagbar_type_go = { 149 | \ 'ctagstype' : 'go', 150 | \ 'kinds' : [ 151 | \ 'p:package', 152 | \ 'i:imports:1', 153 | \ 'c:constants', 154 | \ 'v:variables', 155 | \ 't:types', 156 | \ 'n:interfaces', 157 | \ 'w:fields', 158 | \ 'e:embedded', 159 | \ 'm:methods', 160 | \ 'r:constructor', 161 | \ 'f:functions' 162 | \ ], 163 | \ 'sro' : '.', 164 | \ 'kind2scope' : { 165 | \ 't' : 'ctype', 166 | \ 'n' : 'ntype' 167 | \ }, 168 | \ 'scope2kind' : { 169 | \ 'ctype' : 't', 170 | \ 'ntype' : 'n' 171 | \ }, 172 | \ 'ctagsbin' : 'gotags', 173 | \ 'ctagsargs' : '-sort -silent' 174 | \ } 175 | 176 | --------------------------------------------------------------------------------