본문 바로가기
리눅스

Neovide (text editor)

by 다움위키 2024. 9. 11.

원문 보기: https://dawoum.duckdns.org/wiki/Neovide_(text_editor)

 

Neovim (text editor)의 GUI 프런트-엔드로서 데비안 저장소에서 제공하는 neovim-qt 패키지와 Neovim gtk (text editor)가 있습니다.

여기서 소개하려는 neovide는 Rust (programming language)로 작성된 또 다른 neovim의 GUI 프런트엔드입니다.

Installation

데비안 저장소에 패키지가 존재하지 않기 때문에, 개발자가 제공하는 바이너리를 이용할 수 있습니다:

만약 데비안 패키지를 만들어서 설치하고 싶으면 다음 과정을 진행하십시오:

  • git clone --recurse-submodules --depth 1 https://github.com/neovide/neovide
  • cd neovide
  • sed -r -i -e '/^incremental/a opt-level = 3' Cargo.toml
  • cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"

컴파일 전에 필요한 패키지를 먼저 설치하고, 이어서 컴파일을 시도합니다:

  • sudo apt install generate-ninja
  • export CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
  • export CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
  • CFLAGS+=' -ffat-lto-objects'
  • export SKIA_USE_SYSTEM_LIBRARIES=true
  • export FORCE_SKIA_BUILD=true
  • export SKIA_GN_COMMAND=gn
  • export SKIA_NINJA_COMMAND=ninja
  • cargo build --frozen --release --features embed-fonts

이제 cargo-deb를 이용해서 패키지를 만들 수 있습니다. 그러나, 보통 패키지에 필요한 파일들을 전부 포함하는 것은 아니기 때문에, Cargo.toml 파일을 수정할 필요가 있습니다.

대신, Building binary deb packages를 이용해서 패키지를 만들 수 있습니다. 이 방법을 이용하는 이유는 아치 리눅스에서 쉽게 설치 스크립트를 만들 수 있기 때문입니다!

위 파일에서, 마지막 package() 함수의 내용을 사용하며, 약간의 필요한 부분을 추가할 것입니다.

  • gedit neovide.install
#!/bin/bash

pkgname=neovide
pkgdir=neovide_0.13.3-1_amd64

install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
install -Dm0644 -t "$pkgdir/usr/share/applications/" "assets/$pkgname.desktop"
for px in 16 32 48 256; do
	install -Dm0644 "assets/$pkgname-${px}x${px}.png" \
	"$pkgdir/usr/share/icons/hicolor/${px}x${px}/apps/$pkgname.png"
done
install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE

실행합니다:

  • bash neovide.install

이제 설치에 필요한 파일은 구조에 맞게 만들어졌으며, 데비안 패키지 관련 control 파일을 만듭니다:

  • mkdir -p neovide_0.13.3-1_amd64/DEBIAN
  • touch neovide_0.13.3-1_amd64/DEBIAN/control

내용을 적당히 채우고, 패키지를 만듭니다:

  • dpkg-deb --build --root-owner-group neovide_0.13.3-1_amd64
  • sudo dpkg -i neovide_0.13.3-1_amd64.deb

먼저 터미널에서 실행해서, 오류가 발생하는지 확인합니다:

  • neovide

Configurations

이전의 Neovim (text editor)의 설정을 먼저 하십시오. 그런-다음 설정을 일부 추가할 수 있습니다:

  • cd ~/.config/neovide
  • neovide config.toml
fork = false
frame = "full"
idle = true
maximized = false
neovim-bin = "/usr/bin/nvim" # in reality found dynamically on $PATH if unset
no-multigrid = false
srgb = false
tabs = true
theme = "auto"
title-hidden = true
vsync = true
wsl = false

[font]
size = 17
hinting = "full"
edging = "antialias"

[[font.normal]]
family = "D2CodingLigature Nerd Font Propo"
style = "W400"

# You can set a different font for fallback
[[font.normal]]
family = "Noto Sans CJK SC" 
style = "Normal"

[[font.bold]]
family = "D2CodingLigature Nerd Font Propo"
style = "W600"

Features

이것은 표준, 전체 기능을 갖춘 Neovim GUI여야 하고, 그 외에도 몇 가지 시각적인 멋진 점이 아래에 나열되어 있습니다:

  • Ligatures: Supports ligatures and font shaping.
  • Animated Cursor: Cursor animates into position with a smear effect to improve tracking of cursor position.
  • Smooth Scrolling: Scroll operations on buffers in neovim will be animated smoothly pixel wise rather than line by line at a time.
  • Animated Windows: Windows animate into position when they are moved making it easier to see how layout changes happen.
  • Blurred Floating Windows: The backgrounds of floating windows are blurred improving the visual separation between foreground and background from built in window transparency.
  • Emoji Support: Font fallback supports rendering of emoji not contained in the configured font.
  • WSL Support: Neovide supports displaying a full gui window from inside wsl via the --wsl command argument. Communication is passed via standard io into the wsl copy of neovim providing identical experience similar to Visual Studio Code's Remote Editing.
  • Connecting to an existing Neovim instance: Neovide supports connecting to an already running instance of Neovim through the following communication channels:
    • TCP
    • Unix domain sockets (Unix-like platforms only)
    • Named pipes (Windows only)

Screenshots