๐ ๋ค์ด๊ฐ๋ฉฐ
ํ๋ฉด UI ๊ตฌ์ฑ์ ๋ง๋ฌด๋ฆฌํ ์๊ฐ์ด๋ค. ์์ง์ ์ฝ๋ ํ๋ฉด๊ณผ ํ์ผ ํธ๋ฆฌ๋ฐ์ ์์ด์ ๋ง์ด ๋ถํธ๊ฐ์ด ๋๊ปด์ง ํ ๋ฐ, ์ด์ ์ ๋ง CUI๊ฐ ๋ญ์ง ๋ณผ ์ ์๋ค ใ ใ
Bufferline์ ๋งจ ์์ ๋ด๊ฐ ์ด์ด๋์ ํ์ผ ๋ชฉ๋ก์ ํ์ธ ํ ์ ์๋ ๊ธฐ๋ฅ์ด๊ณ , statusline์ ๋งจ ๋ฐ์ ๊ฐ์ข ๋ฉํ๋ฐ์ดํฐ๋ฅผ ํ์ธํ ์ ์๋ ๊ธฐ๋ฅ์ด๋ค.
๐ Bufferline: barbar.nvim
Bufferline์ด ๋ณด์ด๊ฒ ํ๋ ํ๋ฌ๊ทธ์ธ์ผ๋ก๋ ํฌ๊ฒ bufferline.nvim๊ณผ barbar.nvim์ด ์๋ค. bufferline.nvim์ด ์ข ๋ ๋ณดํธ์ ์ผ๋ก ์ฌ์ฉ๋๊ณ ์ปค์คํฐ๋ง์ด์ง์ด ์์ ๋ก์ด๋ฐ, barbar.nvim์ ๋จ์ถ์ด๋ก ํธ๋ฆฌํ๊ฒ ๋ฒํผ ๊ฐ ์ด๋์ ํ ์ ์๋ค๋ ์ฅ์ ์ด ์์ด barbar.nvim์ ์ ํํ๋ค.
barbar.nvim Github(ํด๋ฆญ)์ README์ Lazy๋ฅผ ์ฌ์ฉํด ํ๋ฌ๊ทธ์ธ์ ์ค์นํ๋ ๋ฐฉ๋ฒ์ด ๋ค์๊ณผ ๊ฐ์ด ๋์ ์๋ค.
-- [[ lua/plugins/barbar.lua ]]
require('lazy').setup {
{'romgrk/barbar.nvim',
dependencies = {
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
},
init = function() vim.g.barbar_auto_setup = false end,
opts = {
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
-- animation = true,
-- insert_at_start = true,
-- โฆetc.
},
version = '^1.0.0', -- optional: only update when a new 1.x version is released
},
}๊ฐ์ธ ์ค์ ์ ์ฒด
๋์ barbar ํ๋ฌ๊ทธ์ธ ์ ์ฒด ์ค์ ์ ๋ค์๊ณผ ๊ฐ๋ค.
return {
'romgrk/barbar.nvim',
dependencies = {
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
},
init = function() vim.g.barbar_auto_setup = false end,
opts = {
icons = {
separator = { left = 'โ', right = '' },
inactive = { separator = { left = 'โ', right = '' } },
},
-- Sets the maximum padding width with which to surround each tab
maximum_padding = 1,
-- Sets the minimum padding width with which to surround each tab
minimum_padding = 1,
-- Set the filetypes which barbar will offset itself for
sidebar_filetypes = {
['neo-tree'] = { event = 'BufWipeout' },
},
},
config = function(_, opts)
-- 1. ๋จผ์ setup ์คํ
require('barbar').setup(opts)
-- 2. ์์ ๋ฎ์ด์ฐ๊ธฐ
-- ์์ ์ค์
local colors = {
bg = '#1f1f1f',
fg = '#ffffff',
blue = '#51afef',
orange = '#FF8800',
gray = '#5c6370',
}
-- ํ์ฌ ๋ฒํผ (ํ์ฑ)
vim.api.nvim_set_hl(0, 'BufferCurrent', { fg = colors.fg, bg = colors.bg, bold = true })
vim.api.nvim_set_hl(0, 'BufferCurrentMod', { fg = colors.orange, bg = colors.bg })
-- ๋นํ์ฑ ๋ฒํผ
vim.api.nvim_set_hl(0, 'BufferInactive', { fg = colors.gray, bg = '#181818' })
vim.api.nvim_set_hl(0, 'BufferInactiveMod', { fg = colors.orange, bg = '#181818' })
-- ํญ๋ผ์ธ ๋ฐฐ๊ฒฝ
vim.api.nvim_set_hl(0, 'BufferTabpageFill', { bg = '#181818' })
-- ๊ตฌ๋ถ์
vim.api.nvim_set_hl(0, 'BufferCurrentSign', { fg = colors.blue, bg = colors.bg })
vim.api.nvim_set_hl(0, 'BufferInactiveSign', { fg = '#3e4452', bg = '#181818' })
end,
version = '^1.9.0', -- optional: only update when a new 1.x version is released
}๊ตฌ๋ถ์ (Separator) ์ค์
๋ฒํผ ๊ฐ์ ๊ตฌ๋ถ์ ๋ฌธ์ ๊ธฐ๋ณธ ์ค์ ์ด '์ผ์ชฝ ์ ๋ ฌ๋ ์ธ๋ก์ '์ธ๋ฐ, ํ์ผ ํธ๋ฆฌ์ ์ฝ๋ ํ๋ฉด ๋ถ๋ฆฌ์ ๊ณผ ์์น๊ฐ ์ด๊ธ๋ ๋ณด๊ธฐ ์ข์ง ์์๋ค ๐
'์ค์ ์ ๋ ฌ๋, ๋ ์์ ์ธ๋ก์ '์ผ๋ก ๊ตฌ๋ถ์ ์ ๋ณ๊ฒฝํด ์ฃผ์๋ค.
icons = {
separator = { left = 'โ', right = '' },
inactive = { separator = { left = 'โ', right = '' } },
}๋ฒํผ๊ฐ ์ ํ๋์ด ์์ ๋(separator)์ ์ ํ๋์ง ์์์ ๋(inactive-separator)๋ฅผ ๊ฐ๊ฐ ์ค์ ํด์ผ ๋์ผํ๊ฒ ์ ์ฉ๋๋ค.
ํจ๋ฉ(Padding) ์ค์
๊ณต๊ฐ์ด ์ถฉ๋ถํ ๊ฒฝ์ฐ ๋ฒํผ ํฌ๊ธฐ๊ฐ ๊ฝค ์ปค์ง๋๋ฐ, ์ฌ๋ฐฑ์ด ๋๋ฌด ๋ง์ผ๋ ๋ณด๊ธฐ ์ข์ง ์์์ ๊ฐ ๋ฒํผ ํญ ์์์ ์ฌ๋ฐฑ์ 1๋ก ๊ณ ์ ํ๋ค.
maximum_padding = 1,
minimum_padding = 1,์ฌ์ด๋๋ฐ ์คํ์ ์ค์
ํ์ผ ํ์๊ธฐ ๊ฐ์ ์ฌ์ด๋๋ฐ๊ฐ ์ด๋ฆด ๋ ๋ฒํผ๋ผ์ธ์ ์๋์ผ๋ก ์ด๋์ํจ๋ค.
sidebar_filetypes = {
['neo-tree'] = { event = 'BufWipeout' },
}nvim-tree ๋ฑ ๋ค๋ฅธ ํ์ผ ํธ๋ฆฌ ํ๋ฌ๊ทธ์ธ์ ๋ํ ์คํ์
์ค์ ๋ ํ๋ฌ๊ทธ์ธ ๋ฆฌ๋๋ฏธ์์ ํ์ธํ ์ ์๋ค. ์์๋ ๋ค์๊ณผ ๊ฐ๋ค.
sidebar_filetypes = {
NvimTree = true,
undotree = { text = 'undotree' },
Outline = { event = 'BufWinLeave', text = 'symbols-outline' },
}์์ ์ปค์คํฐ๋ง์ด์ง
config ํจ์์์ highlight ๊ทธ๋ฃน์ ์ง์ ์ค์ ํ์ฌ ์ํ๋ ์์ ํ
๋ง๋ฅผ ์ ์ฉํ ์ ์๋ค.
local colors = {
bg = '#1f1f1f', -- ํ์ฑ ๋ฒํผ ๋ฐฐ๊ฒฝ
fg = '#ffffff', -- ํ์ฑ ๋ฒํผ ํ
์คํธ
blue = '#51afef', -- ๊ตฌ๋ถ์ ๊ฐ์กฐ์
orange = '#FF8800', -- ์์ ์ํ ํ์
gray = '#5c6370', -- ๋นํ์ฑ ํ
์คํธ
}VSCode ํ
๋ง๊ฐ barbar ํ๋ฌ๊ทธ์ธ์ ์ต์ ํ๋์ด ์์ง ์์ ๊ฒ ๊ฐ์์ #181818 ๋ฑ์ ์์์ ์์ ์ ์ฉํ๋ค.
-- ํ์ฑ ๋ฒํผ
vim.api.nvim_set_hl(0, 'BufferCurrent', { fg = colors.fg, bg = colors.bg, bold = true })
vim.api.nvim_set_hl(0, 'BufferCurrentMod', { fg = colors.orange, bg = colors.bg })
vim.api.nvim_set_hl(0, 'BufferCurrentSign', { fg = colors.blue, bg = colors.bg })
-- ๋นํ์ฑ ๋ฒํผ
vim.api.nvim_set_hl(0, 'BufferInactive', { fg = colors.gray, bg = '#181818' })
vim.api.nvim_set_hl(0, 'BufferInactiveMod', { fg = colors.orange, bg = '#181818' })
vim.api.nvim_set_hl(0, 'BufferInactiveSign', { fg = '#3e4452', bg = '#181818' })
-- ํญ๋ผ์ธ ๋ฐฐ๊ฒฝ
vim.api.nvim_set_hl(0, 'BufferTabpageFill', { bg = '#181818' })์์ ์ ์ฉ์ฌํญ์ ๋ค์๊ณผ ๊ฐ๋ค.
- ์์ ์ฌํญ์ด ์์ง ์ ์ฅ๋์ง ์์ ๋ฒํผ๋ ์ค๋ ์ง์ ๊ธ์จ
- ํ์ฑ ๋ฒํผ๋ ์ด๋์ด ํ์ (์ฝ๋ ์ค๋ํซ๊ณผ ๊ฐ์ ์)
- ๋นํ์ฑ ๋ฒํผ๋ ๊ฒ์์ (ํ์ผ ํธ๋ฆฌ์ ๊ฐ์ ์)
๐ซ Statusline: lualine
Statusline์ ๊ฐ์ฅ ๋ง์ด ์ฌ์ฉ๋๋ lualine(ํด๋ฆญ)์ผ๋ก ๊ฒฐ์ ํ๋ค. ์ฐ๋ฆฌ๋ VSCode์ ๊ฐ์ฅ ๋น์ทํ ํ
๋ง๋ฅผ ์ ์ฉํด์ผ ํ๋๋ฐ, statusline ํ๋ฌ๊ทธ์ธ ์ค ํ
๋ง ํธํ์ด ๊ฐ์ฅ ์ ๋์ด ์๋ ํ๋ฌ๊ทธ์ธ์ด lualine์ด๋ค.
Lazy๋ก lualine ์ค์น
lualine.nvim์ README์ Lazy ๋งค๋์ ๋ก ํ๋ฌ๊ทธ์ธ์ ์ค์นํ๋ ๋ฐฉ๋ฒ์ด ๋ค์๊ณผ ๊ฐ์ด ๋์ ์๋ค.
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' }
}์ฐฝ ํฌ๊ธฐ์ ๋ฐ๋ผ ์์ ์กฐ์ ํ๊ธฐ
Statusline์ ๋ชจ๋ ์์๊ฐ ํญ์ ํ์๋๋ฉด, ์ฐฝ ํฌ๊ธฐ๋ฅผ ์ค์์ ๋ ์ค์ํ ์ ๋ณด๋ค์ด ํ์๋์ง ์์ ์ ์๋ค. ์ด๋ฅผ ๋ฐฉ์งํ๊ธฐ ์ํด ๋ฐ์ํ์ผ๋ก statusline์ ๊ตฌ์ฑํ๋ค.
์ ์ฒด ์ฝ๋๋ ๋ค์๊ณผ ๊ฐ๋ค.
-- [[ lua/plugins/lualine.lua ]]
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
-- Variable for small window settings
local hide_in_width = function()
return vim.fn.winwidth(0) > 100
end
-- Diagnostics: Not shown if small window
local diagnostics = {
'diagnostics',
sources = { 'nvim_diagnostic' },
always_visible = false,
cond = hide_in_width,
}
-- Git diff icon settings: Not shown if small window
local diff = {
'diff',
cond = hide_in_width,
}
require('lualine').setup {
options = {
disabled_filetypes = { 'alpha', 'neo-tree' },
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', diff, diagnostics},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = { 'fugitive' }
}
end,
}hide_in_width ํจ์๋ฅผ ์ ์ธํด ์๋์ฐ ํฌ๊ธฐ๊ฐ ์์์ง๋ฉด dianostics์ diff ์์๊ฐ ํ์๋์ง ์๋๋ก ํ๋ค. ์ด๋ ์ฃผ์ํ ์ ์, sections ํ๋กํผํฐ์์ ๋ฌธ์์ด์ด ์๋ ๋ณ์๋ฅผ ์ ๋ฌํด์ผ ํ๋ค.
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', diff, diagnostics},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},lualine_b์ diff์ diagonstics ๋ณ์๋ฅผ ์ ๋ฌํ ๊ฒ์ ๋ณผ ์ ์๋ค. Statusline์ ์์๋ค์ pre-configured ๊ทธ๋๋ก ์ฌ์ฉํ์ง ์์๋ ๋๊ณ , ๋ง์๋๋ก ์ปค์คํฐ๋ง์ด์งํ ์ ์๋ค.
options = {
disabled_filetypes = { 'alpha', 'neo-tree' },
},ํ์ผ ํธ๋ฆฌ์๋ statusline์ด ๋ํ๋์ง ์๊ฒ ํ๊ณ ์ถ๋ค๋ฉด disabled_filetypes ํ๋กํผํฐ์ ํ์ผ ํธ๋ฆฌ๋ฅผ ์ถ๊ฐํด์ฃผ๋ฉด ๋๋ค.
Bufferline๊ณผ statusline๊น์ง ๊ตฌ์ฑํ๊ณ ๋๋ฉด ์ด ์ ๋์ ํ๋ฉด์ด ์์ฑ๋์์ ๊ฒ! ๐ disabled_filetypes์ ํ์ผํธ๋ฆฌ๋ฅผ ์ถ๊ฐํ๋ค๋ฉด ์ผ์ชฝ ํ๋จ ํ์ ๊ธ์จ๋ ์์ด์ง๋ค.
๐ Scrollbar: nvim-scrollbar
์คํฌ๋กค ์์ฒด๋ ๋ง์ฐ์ค ํ ์ด๋ ํค๋ณด๋์ 'PGDN' ํค๋ก ํ ๋๊ฐ ๋ง์ ๊ด์ฐฎ์ง๋ง, git diff๋ฅผ ์คํฌ๋กค๋ฐ์์ ๋ฐ๋ก ํ์ธํด์ ๊ทธ ์์น๋ก ๊ฐ๊ณ ์ถ์ ๋๊ฐ ์๋ค. ๊ฒ์์ ํ ๋๋ ์ฌ๊ฐ ๋ถํธํ ๊ฒ ์๋๋ค.
์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ์คํฌ๋กค๋ฐ ํ๋ฌ๊ทธ์ธ์ ์ค์นํ๊ธฐ๋ก ๊ฒฐ์ ํ๋ค.
README์ lazy ๋งค๋์ ๋ฅผ ํ์ฉํ ์ค์น ๋งค๋ด์ผ์ ๊ณต์์ ์ผ๋ก ๋์ ์์ง ์์ง๋ง ๋ค์ Github Issue(ํด๋ฆญ)์์ ํํธ๋ฅผ ์ป์ ์ ์์๋ค.
TBD
์คํฌ๋กค๋ฐ ํ๋ฌ๊ทธ์ธ์ ๋ช ๊ฐ ๋๋ฌ๋ดค์ง๋ง,
- ์คํฌ๋กค๋ฐ ์์๊ณผ ๋๋น๋ฅผ ์กฐ์ ํ ์ ์๊ณ
- VSCode์ฒ๋ผ ํ์ผ ๊ธธ์ด์ ๋ง์ถฐ ์คํฌ๋กค๋ฐ ํฌ๊ธฐ๊ฐ ๊ณ ์ ๋๊ณ
- ๋ชจ๋ ๋ด์ฉ์ด ํ ํ๋ฉด ์์ ์์ด๋ ์คํฌ๋กค๋ฐ๊ฐ ์ฌ๋ผ์ง์ง ์๋
์ธ ๊ฐ์ง ์กฐ๊ฑด์ ์ถฉ์กฑํ๋ ์คํฌ๋กค๋ฐ๋ฅผ ์ฐพ์ ์ ์์๋ค. ๊ฐ์ธ์ ์ผ๋ก ํ๋ฌ๊ทธ์ธ์ ์์ ํด์ ๊ตฌํํ๊ธฐ ์ ๊น์ง ์ด ํํธ๋ ์ต์ข ์ค์ ์ ๊ณต์ ํ ์ ์์ ๊ฒ ๊ฐ๋ค.
โจ ๋ง์น๋ฉฐ
์ด์ ๊ทธ๋ด๋ฏํ ํ๋ฉด ๊ตฌ์ฑ์ด ์๋ฃ๋์๋ค. ์คํฌ๋กค๋ฐ๊ฐ ๋ง์ ๊ผญ ๋๋ ๊ฒ ์์ด์ ์์ฝ์ง๋ง, ์ถํ์ ์ง์ ๊ตฌํํด ๋ณด๋ ๊ฒ๋ ์ฌ๋ฏธ์์ ๊ฒ ๊ฐ๋ค.
์ด๋๋ก ๊ฐ๋ฐ์ ์งํํด๋ ๋์ง๋ง ์ฝ๋ ์๋ํฐ๋ฅผ ์ฐ๋ ์ฃผ๋ ์ด์ ๋ ๋น ๋ฅธ ์๋ฌ ํ์ธ์ด๊ธฐ๋ ํ๋ค. ๊ฐ๋จํ ๋ฌธ๋ฒ ์ค๋ฅ๋ ์๋ํฐ๊ฐ ์ก์๋ด ์ค์ผ ์์ฐ์ฑ์ด ์ฌ๋ผ๊ฐ๋ค. ์ดํ๋ถํฐ๋ ๊ธฐ๋ฅ์ ์ธ ๋ฉด์ ์ง์คํด์ IDE ๊ตฌ์ฑ์ ์งํํ ์์ ์ด๋ค.