반응형

Updates: November 6, 2024
Contents: Steps to install GitHub Copilot in NVim or Vim (Linux, Ubuntu)

Prerequisites

To use GitHub Copilot in Neovim / Vim, you must have:

  • Neovim version 0.6 or above or Vim version 9.0.0185 or above
  • Node.js version 18 or above

For more information, see the Vim/Neovim documentation and the Node.js website.

Download GitHub Copilot Plugin

  • For NVim:
    git clone https://github.com/github/copilot.vim \
    ~/.config/nvim/pack/github/start/copilot.vim
  • For Vim:
    git clone https://github.com/github/copilot.vim \
    ~/.vim/pack/github/start/copilot.vim
 

Install GitHub Copilot

  1. Open NVim or Vim.
  2. Run the command:
    :Copilot setup
    :Copilot enable

    This command will download and install all the plugins listed in your configuration file.

GitHub Authentication

If GitHub authentication is required, follow these steps:

  1. Update package lists and install GitHub CLI:
    sudo apt update
    sudo apt install gh
  2. For Windows users using WSL, install wslu:
    sudo apt install wslu
  3. Authenticate with GitHub:
    BROWSER=/mnt/c/Windows/explorer.exe gh auth login
     This command sets the browser to Windows Explorer and initiates the GitHub authentication process.

References

 

사용자 환경에 GitHub Copilot 확장 설치 - GitHub Docs

선호하는 코딩 환경에서 Copilot을(를) 사용하려면 GitHub Copilot 확장을 설치해야 합니다.

docs.github.com

 

반응형
반응형

Updates: November 6, 2024
Contents: Steps to install vim-plug on Linux including Ubuntu

Set Up Environment for NVim Installation

Before installing plugins, ensure that NVim or Vim is installed on your system.

Install vim-plug

vim-plug is a minimalist Vim plugin manager that supports parallel installation of plugins.

  • For NVim:
    sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
           https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  • For Vim:
    curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
        https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Download Result

 

Configure Plugins

After installing vim-plug, configure your plugins by editing the appropriate configuration file.

  • For NVim:
    nvim ~/.config/nvim/init.vim
  • For Vim:
    vim ~/.vimrc

In the configuration file, add the following lines to initialize vim-plug and specify your desired plugins:

" in init.nvim or .vimrc
call plug#begin('~/.vim/plugged')

" List your plugins here
Plug 'tpope/vim-sensible'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }

call plug#end()
 

Install Plugins

After saving the configuration file, install the specified plugins:

  1. Open NVim or Vim.
  2. Run the command:
    :PlugInstall

    This command will download and install all the plugins listed in your configuration file.

Managing Plugins with vim-plug

After installing vim-plug, you can manage your plugins using the following commands:

  • :PlugInstall to install the plugins
  • :PlugUpdate to install or update the plugins
  • :PlugDiff to review the changes from the last update
  • :PlugClean to remove plugins no longer in the list

In WSL or WSL2 on Windows, the plugged folder is located at ~/.local/share/nvim/plugged

 

References

 

GitHub - junegunn/vim-plug: :hibiscus: Minimalist Vim Plugin Manager

:hibiscus: Minimalist Vim Plugin Manager. Contribute to junegunn/vim-plug development by creating an account on GitHub.

github.com

 

반응형
반응형

Updates: November 5, 2024
Contents: Steps to install the latest version of Vim from source (version 9.1)

This guide includes additional configurations considering future plugin setups. 

It assumes that Vim is already installed on your system.

 

Remove Existing Vim Installation
Before installing the latest version, remove any existing Vim installations:

sudo apt-get remove --purge vim vim-runtime vim-tiny vim-gtk vim-gtk3 vim-gnome vim-nox vim-common

 

Set Up Environment for Vim Installation

Update your package list and install necessary packages:

sudo apt update
sudo apt install git make clang libtool-bin libxt-dev libpython3-dev valgrind -y

 

Configure Vim Dependencies

Enable source repositories and install build dependencies:

(from https://mebadong.tistory.com/92)

sudo cp /etc/apt/sources.list /etc/apt/sources.list~
sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
sudo apt-get update
sudo apt-get build-dep vim

 

Clone Vim Source Code

Download the Vim source code from the official repository:

git clone https://github.com/vim/vim.git
cd vim/src

 

Clean Previous Build Configurations

If you've previously built Vim, clean the build environment:

sudo make distclean

 

Configure Vim Build Options

Set up the build configuration with Python3 support:

./configure --with-features=huge \
            --enable-multibyte \
            --enable-python3interp=yes \
            --with-python3-config-dir=$(python3-config --configdir) \
            --prefix=/usr/local

 

Compile and Install Vim

Build and install Vim:

sudo make
sudo make install

 

Create Symbolic Link for 'vi' Command

To allow the 'vi' command to invoke Vim:

sudo ln -s /usr/local/bin/vim /usr/local/bin/vi

 

References

반응형
반응형

Updates: 2024. 11. 05

Contents: 최신 버전 Vim 설치 방법 && source에서 설치 (version 9.1)

 

본 글에서는 추후 설정할 Plugin 등을 고려한 몇 가지를 추가한 설정을 포함하고 있습니다.

또한, 일전에 vim이 설치되었을 것을 가정하고 작성하였습니다.

 

기존의 vim 설치 제거

sudo apt-get remove --purge vim vim-runtime vim-tiny vim-gtk vim-gtk3 vim-gnome vim-nox vim-common

 

vim 설치 환경 세팅

sudo apt update
sudo apt install git make clang libtool-bin libxt-dev libpython3-dev valgrind -y

 

vim 의존성 환경 설정 (from https://mebadong.tistory.com/92)

sudo cp /etc/apt/sources.list /etc/apt/sources.list~
sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
sudo apt-get update
sudo apt-get build-dep vim

 

vim source 복사

git clone https://github.com/vim/vim.git
cd vim/src


vim 이전 설치 대비 설치 환경 초기화

sudo make distclean

 

vim 설치 config 설정 (python 환경 포함)

./configure --with-features=huge \
            --enable-multibyte \
            --enable-python3interp=yes \
            --with-python3-config-dir=$(python3-config --configdir) \
            --prefix=/usr/local


vim 설치

sudo make
sudo make install

 

필요한 경우, (vim 과 vi 모두 동작하게, 두 개의 명령어 연동)

sudo ln -s /usr/local/bin/vim /usr/local/bin/vi

 

References

반응형

+ Recent posts