ํ”Œ๋Ÿฌ๊ทธ์ธ ์—†์ด vim์„ ์ตœ์†Œ ์„ค์ •์œผ๋กœ ์‚ฌ์šฉํ•˜๊ธฐ

์›๊ฒฉ์ง€์—์„œ vi(m)์„ ์‚ฌ์šฉํ•  ๋•Œ ๊ฐ„๋‹จํ•œ ํŽธ์ง‘์€ ๊ดœ์ฐฎ์œผ๋‚˜ ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•˜๊ฑฐ๋‚˜ ํ•  ๋•Œ์—๋Š” ๋ถˆํŽธํ•˜๋‹ค. ํ•˜์ง€๋งŒ ํ”Œ๋Ÿฌ๊ทธ์ธ๊ณผ ๋งŽ์€ ์„ค์ •์„ ํ•  ๊ฒฝ์šฐ ๋ฒˆ๊ฑฐ๋กญ๊ธฐ๋„ ํ•˜๊ณ  ๋ฌด๊ฑฐ์›Œ์ง€๊ธฐ๋„ ํ•œ๋‹ค. ํ•œ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์€ ๋กœ์ปฌ์˜ ํ™˜๊ฒฝ์—์„œ scp๋ฅผ ์ด์šฉํ•ด ํŽธ์ง‘ํ•˜๋Š” ๋ฐฉ๋ฒ•์ด๋‹ค. nvim scp ์ฐธ์กฐ. ๋˜ ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•์€ ์•„์ฃผ ๋ถˆํŽธํ•˜์ง€ ์•Š๋Š” ์„ ์—์„œ ํ™˜๊ฒฝ์„ ์„ค์ •ํ•˜๊ณ  ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ด๋‹ค. ์ด ๊ฒฝ์šฐ ํ”Œ๋Ÿฌ๊ทธ์ธ ์‚ฌ์šฉ์„ ํ•˜์ง€ ์•Š๊ณ , ์ตœ์†Œํ•œ์˜ ์„ค์ •๋งŒ ํ•˜๋Š” ๊ฒƒ์ด๋‹ค. ์žฅ์ ์€ ๊ฐ€๋ณ๊ณ  ๋น ๋ฅด๋ฉด์„œ ํ™˜๊ฒฝ์„ค์ •๋„ ์ตœ์†Œํ•œ์œผ๋กœ ํ•  ์ˆ˜ ์žˆ์–ด ํŽธ๋ฆฌํ•˜๋‹ค. ํŠนํžˆ ์›๊ฒฉ์ง€๊ฐ€ ์ €์‚ฌ์–‘ ์ปดํ“จํ„ฐ์ด๊ฑฐ๋‚˜ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด ๋“ฑ์ผ ๋•Œ ์ ๋‹นํ•˜๋‹ค. Setup how to setup # Install vim or nvim sudo apt install vim # Setup for (v)vim vi ~/.vimrc # Use vi ~/myproject/myfile.c .vimrc " " minimal vimrc with no (extra) plugins " "load system defaults if filereadable(expand('$VIMRUNTIME/defaults.vim')) unlet! g:skip_defaults_vim source $VIMRUNTIME/defaults.vim endif "regular settings "---------------- " ui set number set ruler set wildmenu set showcmd set showmatch " encoding/format set encoding=utf-8 set fileformats=unix,dos,mac " searching set hlsearch set incsearch set ignorecase set smartcase " indent set shiftwidth=4 set tabstop=4 set softtabstop=4 set autoindent " key timeout values set esckeys set ttimeoutlen=20 set timeoutlen=1000 " allow syntax and filetype plugins syntax enable filetype plugin indent on runtime macros/matchit.vim " autocmds "--------- augroup general autocmd! "keep equal proportions when windows resized autocmd VimResized * wincmd = "save cursor position in a file autocmd BufReadPost * if line("'\"") > 1 && line("'\"") \ <= line("$") | exe "normal! g'\"" | endif augroup END augroup languages autocmd! autocmd BufNewFile,BufRead *.bash set syntax=sh autocmd FileType python xnoremap <leader>r <esc>:'<,'>:w !python3<CR> autocmd FileType go set noexpandtab autocmd FileType html :syntax sync fromstart autocmd FileType html,javascript,css,json,yaml,sh \ setlocal ts=2 sts=2 sw=2 expandtab augroup END REFERENCE A minimal Vimrc - https://madjam.dev/posts/a-minimal-vimrc/

2023-09-16 ยท 265 words