Skip to content

Instantly share code, notes, and snippets.

@kgcrom
Last active December 21, 2015 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kgcrom/6266395 to your computer and use it in GitHub Desktop.
Save kgcrom/6266395 to your computer and use it in GitHub Desktop.
vim으로 Go 개발하기
#mac은 아래 두개 주석 해제
#--langdef=Go
#--langmap=Go:.go
--regex-Go=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/d,func/
--regex-Go=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,var/
--regex-Go=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,type/
" This file needs to be copied to your home dir, instead of staying here. It should live at ~/.vimrc
set number
set nocompatible " be iMproved
filetype off " required!
set expandtab
set ts=2
set sw=2
set rtp+=~/.vim/bundle/Vundle.vim/
set rtp+=$GOROOT/misc/vim
"set rtp+=$GOPATH/src/github.com/golang/lint/misc/vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'fatih/vim-go'
Plugin 'Valloric/YouCompleteMe'
Plugin 'majutsushi/tagbar'
Plugin 'scrooloose/nerdtree'
Plugin 'jstemmer/gotags'
Plugin 'nsf/gocode'
call vundle#end()
filetype plugin indent on " required!
syntax on
au BufWritePost *.go silent! !ctags --recurse=yes
au FileType go nmap <Leader>ds <Plug>(go-def-split)
au FileType go nmap <Leader>dv <Plug>(go-def-vertical)
au FileType go nmap <Leader>dt <Plug>(go-def-tab)
"au BufWritePost *.go silent! %!goimports
"let NERDTreeDirArrows=0
let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
nmap <F3> :NERDTreeToggle<CR>1
nmap <F5> :make<CR>:copen<CR>
" Map Ctrl-c Ctrl-c to open tagbar
map <silent> <C-c><C-c> :TagbarOpen fj<Cr>
" Map Ctrl-c Ctrl-c to open tagbar
map <silent> <C-c><C-x> :TagbarClose<Cr>
"vim 번들 매니저 설치
mkdir ~/.vim/bundle
git clone https://github.com/gmarik/Vundle.vim
"Ubuntu vim버전 올려야함
refhttp://linuxg.net/how-to-install-vim-7-4-on-debian-based-systems-from-source/
"Mac은 MacVim설치해야함
brew install macvim
.profile
alias vi='mvim -v'
@kgcrom
Copy link
Author

kgcrom commented Jul 6, 2014

@kgcrom
Copy link
Author

kgcrom commented Aug 21, 2014

http://superuser.com/questions/401413/cant-open-folders-in-linux-nerdtree-vim
NERDTree에서 폴더가 안열리는 문제가 있었는데 위 url로 해결!!!

let NERDTreeDirArrows=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment