2021. 3. 8. 23:48ㆍUbuntu
설치하기
sudo apt-get install neovim |
nvim에서 configuration 설정 파일 위치 확인하기
:help vimrc |
configuration 설정 파일 만들기
cd ~/.config/nvim touch init.vim |
vim-plug 설치하기
junegunn/vim-plug
:hibiscus: Minimalist Vim Plugin Manager. Contribute to junegunn/vim-plug development by creating an account on GitHub.
github.com
1
2
|
mkdir autoload
curl https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -o plug.vim
|
cs |
▶ colorscheme Plugin
morhetz/gruvbox
Retro groove color scheme for Vim. Contribute to morhetz/gruvbox development by creating an account on GitHub.
github.com
▶ Git 관련 Plugin
tpope/vim-fugitive
fugitive.vim: A Git wrapper so awesome, it should be illegal - tpope/vim-fugitive
github.com
▶ coc (nodejs 설치 필요)
neoclide/coc.nvim
Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers. - neoclide/coc.nvim
github.com
phoenixnap.com/kb/update-node-js-version
How to Update Node.js to Latest Version {Linux, Windows, and MacOS}
New Node.js versions come out often! This guide shows you how to install the latest Node.js version on any Linux, Windows, or MacOS system. Follow our step-by-step tutorial and upgrade now.
phoenixnap.com
github.com/neoclide/coc.nvim/wiki/Language-servers
neoclide/coc.nvim
Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers. - neoclide/coc.nvim
github.com
https://github.com/autozimu/LanguageClient-neovim/wiki/Clangd
GitHub - autozimu/LanguageClient-neovim: Language Server Protocol (LSP) support for vim and neovim.
Language Server Protocol (LSP) support for vim and neovim. - GitHub - autozimu/LanguageClient-neovim: Language Server Protocol (LSP) support for vim and neovim.
github.com
↑ coc-clangd 설치
https://github.com/KabbAmine/vCoolor.vim
GitHub - KabbAmine/vCoolor.vim: Simple color selector/picker plugin for Vim.
Simple color selector/picker plugin for Vim. Contribute to KabbAmine/vCoolor.vim development by creating an account on GitHub.
github.com
https://github.com/MattesGroeger/vim-bookmarks
GitHub - MattesGroeger/vim-bookmarks: Vim bookmark plugin
Vim bookmark plugin. Contribute to MattesGroeger/vim-bookmarks development by creating an account on GitHub.
github.com
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
" curl -fLO $HOME/.config/nvim/autoload/plug.vim --create-dirs \
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
set nocompatible " 오리지날 VI와 호환하지 않음
filetype off " Vundle 설정을 위한 시작 부분
" :PlugInstall 로 설치
call plug#begin('~/.config/nvim/plugged')
Plug 'morhetz/gruvbox'
Plug 'tomasr/molokai'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-unimpaired'
Plug 'preservim/nerdtree'
Plug 'ctrlpvim/ctrlp.vim' " ctrl+p 키로 파일을 탐색할 수 있다. (ctrl+c to quit)
Plug 'neoclide/coc.nvim', {'branch': 'release'} "~/.config/coc/extensions/node_modules
Plug 'KabbAmine/vCoolor.vim'
Plug 'udalov/kotlin-vim'
Plug 'MattesGroeger/vim-bookmarks'
call plug#end()
" -------------------------------------------------------------------
colorscheme gruvbox
"colorscheme molokai
" ctrl+n 키를 NERDTreeFocus 단축키로 설정
map <silent> <C-n> :NERDTreeFocus<CR>
" vCoolor 관련 내용
" <Alt-H> you can insert a HEX color anywhere
" (NORMAL mode map)
map <silent> <A-h> :VCoolor<CR>
" (INSERT mode map)
inoremap <silent> <A-h> <ESC>:VCoolor<CR>
"<Alt-R> you can insert a rgb color anywhere (NORMAL and INSERT modes).
"<Alt-V> you can insert a hsl color anywhere (NORMAL and INSERT modes).
"<Alt-W> you can insert a rgba color anywhere (NORMAL and INSERT modes).
" Prettier 관련 내용
" use ':Prettier' to format current buffer.
command! -nargs=0 Prettier :CocCommand prettier.formatFile
" 특정 영역을 선택한 후 '\'키와 'f'키를 같이 누르면 작동한다.
vmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
" -------------------------------------------------------------------
set hlsearch " 검색어 하이라이팅
set nu " 줄번호
set autoindent " 자동 들여쓰기
set scrolloff=2 " 2줄 범위에서부터 scroll
set wildmode=longest,list
set sw=1 " 스크롤바 너비
set autowrite " 다른 파일로 넘어갈 때 자동 저장
set autoread " 작업 중인 파일 외부에서 변경됬을 경우 자동으로 불러옴
set cindent " C언어 자동 들여쓰기
set bs=eol,start,indent " 줄의 끝, 시작, 들여쓰기에서 백스페이스를 사용하면 이전 줄과 연결됨
set history=256 " 편집한 256줄 까지 기억
set laststatus=2 " 상태바 표시 항상
"set paste " 붙여넣기 계단현상 없애기
set shiftwidth=4 " 자동 들여쓰기 너비 설정
set showmatch " 일치하는 괄호 하이라이팅
set smartcase " 검색시 대소문자 구별
set smarttab
set smartindent
set softtabstop=4 " Tab키를 눌렀을 때 4개 space로
set tabstop=4 " Tab을 4개 space로
set expandtab " 모든 Tab을 space로 설정
set incsearch " 단어 검색시 글자 입력할 때마다 검색
" 마지막으로 수정된 곳에 커서를 위치함
au BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "norm g`\"" |
\ endif
" 구문 강조 사용
if has("syntax")
syntax on
endif
" -------------------------------------------------------------------
" swap file 저장 위치 지정
set directory=$HOME/.config/nvim/swap
" Set up persistent undo across all files.
set undofile
if !isdirectory(expand("$HOME/.config/nvim/undodir"))
call mkdir(expand("$HOME/.config/nvim/undodir"), "p")
endif
set undodir=$HOME/.config/nvim/undodir
" Fast split navigation with <Ctrl> + hjkl
" Normal mode map.
nmap <c-h> <c-w><c-h>
nmap <c-j> <c-w><c-j>
nmap <c-k> <c-w><c-k>
nmap <c-l> <c-w><c-l>
|
cs |
'Ubuntu' 카테고리의 다른 글
참고 (0) | 2021.08.04 |
---|---|
gcc / make (0) | 2021.07.04 |
파이썬 설치 (0) | 2021.03.03 |
GCC compiler (0) | 2021.02.22 |
vim 키 (0) | 2021.02.21 |