블로그 이미지
훅크선장

카테고리

분류 전체보기 (360)
사진이야기 (23)
펭귄컴퓨팅 (120)
컴퓨터보안 (83)
절름발이 프로그래머 (59)
하드웨어개조 (23)
멀알려줄까 (35)
홈베이킹&홈쿠킹 (2)
잡다한것들 (15)
Total
Today
Yesterday

달력

« » 2024.3
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

공지사항

태그목록

최근에 올라온 글

Go 언어 연습을 위해서, CentOS 7 Linux 환경에서 Go 언어 환경을 설치해 본 것입니다.

 

0. GoLang 설치하기 

# cd

# wget https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz

# tar -zxvf go1.14.2.linux-amd64.tar.gz 

# mv go/ /usr/local/

 

GoLang 사용을 위한 환경변수 설정 

# cd

# vi .bashrc

다음을 추가한다.

export PATH=/usr/local/go/bin:$PATH

 

Go 언어 테스트해보기

# vi helloworld.go

예제 파일 내용을 다음과 같이 만든다.

package main

import "fmt"

func main() {
fmt.Println("Hello World")
}

 

# go build helloworld.go

# ./helloworld

Hello World

 

1. 기존 vim 패치키 제거 

# yum remove vim-common vim-enhanced vim-filesystem vim-minimal

 

2. 필요한 라이브러리 등 설치 

# yum install gcc make ncurses ncurses-devel cmake

# yum install ctags git tcl-devel  ruby ruby-devel  lua lua-devel  luajit luajit-devel  python python-devel  perl perl-devel  perl-ExtUtils-ParseXS  perl-ExtUtils-XSpp  perl-ExtUtils-CBuilder  perl-ExtUtils-Embed

 

3. vim 8 다운로드 및 빌드와 설치 

# cd

# git clone https://github.com/vim/vim.git

# cd vim

# ./configure --with-features=huge --enable-multibyte --enable-rubyinterp  --enable-python3interp --enable-perlinterp --enable-luainterp

# make

# make install

 

설치가 완료되면, 버전 확인하기

# vim --version

 

4. Pathogon은 vim 플러그인과 런타임 파일을 쉽게 관리 할 수 있도록 도와주는 vim 환경관리 툴이다. 먼저 pathogon을 설치한다.
~/.vim/autoload 디렉토리 밑에 vim-pathogon을 클론(clone)한다.

# mkdir -p ~/.vim/autoload

# cd ~/.vim/autoload
# git clone https://github.com/tpope/vim-pathogen.git
pathogen.vim을 ~/.vim/autoload 디렉토리에 복사한다.

# cp vim-pathogen/autoload/pathogen.vim ./


아래와 같이 vim-go 스크립트를 다운로드 한다.

# mkdir -p ~/.vim/bundle

# cd ~/.vim/bundle
# git clone https://github.com/fatih/vim-go.git

 

홈 디렉토리에 .vimrc 파일을 생성하고, 다음과 같이 작성한다.

# vi ~/.vimrc 
execute pathogen#infect()
syntax on
filetype plugin indent on

vim을 실행하고 :GoInstallBinaries명령을 실행하면, vim-go 관련된 플러그인들이 자동으로 설치된다.

 

4. YouCompleteMe(이하 YCM)은 VIM을 위한 자동코드완성 엔진이다. YCM은 C, C++, Object-C, Object-C++, CUDA, Python2, Pyton3, C#, Go 등 다양한 언어에 대한 자동완성기능을 제공한다.
YCM을 클론하고 컴파일 한다. Go 자동완성을 지원하고 싶다면 --go-completer 를 컴파일 옵션으로 설정해야 한다.

 

# cd ~/.vim/bundle
# git clone https://github.com/Valloric/YouCompleteMe.git
# cd ~/.vim/bundle/YouCompleteMe
# git submodule update --init --recursive
# ./install.sh --go-completer 

 

5.Tagbar
Tagbar 플러그인을 이용해서 현재 파일의 태그를 탐색해서, 코드의 대략적인 구조를 빠르게 살펴볼수 있다.

#cd ~/.vim/bundle
# git clone https://github.com/majutsushi/tagbar.git

 

6. NerdTree
NERDTree는 Vim용 파일 탐색기다. 이 플러그인은 디렉토리의 구조를 계층적으로 보여줘서, 파일을 쉽게 탐색하고 편집할 수 있도록 도와준다.

# cd ~/.vim/bundle
# git clone https://github.com/scrooloose/nerdtree.git

 

 

참조 사이트 : 

https://golang.org/dl/

 

Downloads - The Go Programming Language

Downloads After downloading a binary release suitable for your system, please follow the installation instructions. If you are building from source, follow the source installation instructions. See the release history for more information about Go releases

golang.org

https://www.joinc.co.kr/w/man/12/golang/Start

 

golang 시작하기 - 개발환경 만들기

 

www.joinc.co.kr

http://www.programmersought.com/article/6244238683/

 

Centos7 install vim8.0 + YouCompleteMe + support python 3.6 - Programmer Sought

Install python3.6:https://blog.csdn.net/wanormi/article/details/82900782 Upgrade vim and gcc Upgrade gcc sudo yum install centos-release-scl -y sudo yum install devtoolset-3-toolchain -y sudo yum install gcc-c++ sudo scl enable devtoolset-3 bash Upgrade vi

www.programmersought.com

https://phoenixnap.com/kb/how-to-install-vim-centos-7

 

How to Install Vim 8.2 on CentOS 7? (Latest Version)

You don't need to wait for the latest version of Vim to appear in official repositories. In tutorial learn how to install Vim 8.2 on CentOS 7. Get Started!

phoenixnap.com

 

Posted by 훅크선장
, |