Zig + Nvim ์„ค์ •

last updated: {{ โ€œ1710903265โ€ | date: โ€œ%Y-%m-%d %H:%Mโ€ }} Intro neovim์—์„œ zig ์„ค์ • ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•œ๋‹ค. Install on Alpine ์„ค์น˜ํ•˜๊ธฐ $ doas apk add zig zls neovim $ nvim ~/.local/nvim/init.lua require 'lspconfig'.zls.setup{} ๋‹ค๋ฅธ ์–ด๋–ค ์–ธ์–ด๋ณด๋‹ค๋„ ์„ค์ •์ด ๊ฐ„๋‹จํ•˜๋‹ค. zls๋Š” zig language server lspconfig๋Š” neovim์— ๋‚ด์žฅ๋œ LSP ์„ค์ •์„ ๋งํ•œ๋‹ค. nvim ์„ค์ • ํ›„ zigํŒŒ์ผ์„ ์—ด๊ณ  ์ฝ”๋”ฉํ•˜๋ฉด ๋„์›€๋ง์ด ๋‚˜ํƒ€๋‚œ๋‹ค. tab์œผ๋กœ ์ด๋™ํ•˜๊ณ  Enter๋กœ ์„ ํƒํ•œ๋‹ค. Install zls from Source ์†Œ์Šค๋ฅผ ์ปดํŒŒ์ผํ•˜๋Š” ๋ฐฉ๋ฒ•. ์ตœ์‹  ๋ฒ„์ „์˜ zig(ํ˜„์žฌ 0.12)์ด์–ด์•ผ git ์†Œ์Šค๋กœ ์ปดํŒŒ์ผ ๋œ๋‹ค. zig ์ตœ์‹  ๋ฒ„์ „์€ zig ํ™ˆ์—์„œ ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์žˆ๋‹ค. ๋‹ค์Œ ์ ˆ์ฐจ์— ๋”ฐ๋ผ ๋นŒ๋“œํ•œ๋‹ค. $ git clone https://github.com/zigtools/zls $ cd zls $ zig build -Doptimize=ReleaseSafe $ mkdir ~/bin && cp zig-out/bin/zls ~/bin $ echo 'export PATH=$HOME/bin:$PATH' >> ~/.bash_profile $ source ~/.bash_profile $ zls --version Links Neovim setup for Zig https://terminalprogrammer.com/neovim-setup-for-zig

2024-03-12 ยท 121 words

Comment.nvim - nvim ์ฃผ์„์ฒ˜๋ฆฌ ํ”„๋กœ๊ทธ๋žจ

Intro ํ”„๋กœ๊ทธ๋ž˜๋ฐ ํ™˜๊ฒฝ์—์„œ ๊ฐ ์–ธ์–ด๋ณ„ ์ฃผ์„์ฒ˜๋ฆฌ๋ฅผ ์‰ฝ๊ฒŒ ์ถ”๊ฐ€ ์ œ๊ฑฐ ํ•  ์ˆ˜ ์žˆ๋Š” ํ”Œ๋Ÿฌ๊ทธ์ธ ๊ด€๋ จ ํ”Œ๋Ÿฌ๊ทธ์ธ ์ค‘์— ๊ฐ€์žฅ ์ธ๊ธฐ๊ฐ€ ๋งŽ๊ณ  ์‚ฌ์šฉ์ด ํŽธ๋ฆฌํ•˜๋‹ค. Features Supports treesitter. Supports commentstring. Read :h comment.commentstring Supports line (//) and block (/* */) comments Dot (.) repeat support for gcc, gbc and friends Count support for [count]gcc and [count]gbc Left-right (gcw gc$) and Up-Down (gc2j gc4k) motions Use with text-objects (gci{ gbat) Supports pre and post hooks Ignore certain lines, powered by Lua regex Install With packer.nvim use { 'numToStr/Comment.nvim', config = function() require('Comment').setup() end } Manual Install $ cd ~/.local/share/nvim/site $ git clone https://github.com/numToStr/Comment.nvim $ cp Comment.nvim/plugin/Comment.lua plugin/ $ cp -r Comment.nvim/lua/Comment lua/ $ vi ~/.config/nvim/init.lua ... lua require('Comment').setup() :so % REFERNCE Comment.nvim Github: https://github.com/numToStr/Comment.nvim

2023-08-10 ยท 119 words