Neovim
설치
sudo pacman -S neovim
sudo ln -s /usr/bin/nvim /usr/local/bin/vim
NvChad
git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 && nvim
.config/nvim
├── init.lua
├── lazy-lock.json
├── LICENSE
└── lua/
├── core/
│ ├── bootstrap.lua
│ ├── default_config.lua
│ ├── init.lua
│ ├── mappings.lua
│ └── utils.lua
├── custom/
│ ├── chadrc.lua
│ ├── configs/
│ │ ├── lspconfig.lua
│ │ ├── null-ls.lua
│ │ └── overrides.lua
│ ├── highlights.lua
│ ├── init.lua
│ ├── mappings.lua
│ ├── plugins.lua
│ └── README.md
└── plugins/
├── configs/
│ ├── cmp.lua
│ ├── lazy_nvim.lua
│ ├── lspconfig.lua
│ ├── mason.lua
│ ├── nvimtree.lua
│ ├── others.lua
│ ├── telescope.lua
│ └── treesitter.lua
└── init.lua
~/.config/nvim/lua/core/default_config.lua
에 ~/.config/nvim/lua/custom/chadrc.lua
를 병합한 설정이 사용됩니다.
키 매핑
~/.config/nvim/lua/core/mappings.lua
에 ~/.config/nvim/lua/custom/mappings.lua
를 병합한 설정이 사용됩니다.
<C>
: Ctrl<A>
: Alt<S>
: Shift<leader>
: Space:
,;
: 커맨드
LSP
- https://nvchad.com/docs/config/lsp
- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
~/.config/nvim/lua/custom/configs/lspconfig.lua
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
local root_pattern = lspconfig.util.root_pattern
lspconfig.gopls.setup {
on_attach = on_attach,
capabilities = capabilities,
root_dir = root_pattern("go.mod")
}
nvim-tree.lua
g?
: 단축키 보기
Nvterm
<A-h>
: 수평 터미널 토글<A-v>
: 수직 터미널 토글<A-i>
: 터미널 모달 토글<leader>pt
: 터미널 목록
NvCheatsheet
<leader>ch
Normal mode
:h key-notation
: key notation
u
: undo<C-R>
: redo
=
: align ex) gg=G, =3<C-K>
: clang-format (설정한 경우)
:! <command>
: shell에서 <command>를 실행합니다.:r[ead]! <command>
: stdout -> vim:w[rite]! <command>
: vim -> stdin:sh
: 쉘로 가기<C-D>
: 쉘에서 돌아오기
<C-A>
: 숫자 증가<C-X>
: 숫자 감소
Visual mode
u
: 소문자로 변환U
: 대문자로 변환