ํ”Œ๋Ÿฌ๊ทธ์ธ ์—†์ด 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

vimium-c - Vim like Using firefox

์„ค์น˜ ํŒŒ์ด์–ดํญ์Šค์˜ ํ™•์žฅ๊ธฐ๋Šฅ ๊ฒ€์ƒ‰ : vimium-c ํ”Œ๋Ÿฌ๊ทธ์ธ ์„ค์น˜ ์‚ฌ์šฉ๋ฒ• ? : ๋„์›€๋ง ๋ณด์ด๊ธฐ/์ˆจ๊ธฐ๊ธฐ Navigating the current Page: ? show the help dialog for a list of all available keys h scroll left j scroll down k scroll up l scroll right gg scroll to top of the page G scroll to bottom of the page d scroll down half a page u scroll up half a page f open a link in the current tab F open a link in a new tab r reload gs view source i enter insert mode -- all commands will be ignored until you hit Esc to exit yy copy the current url to the clipboard yf copy a link url to the clipboard gf cycle forward to the next frame gF focus the main/top frame Navigating to new pages: o Open URL, bookmark, or history entry, on an English letter "o" O Open URL, bookmark, history entry in a new tab, on an English letter "O" b Open bookmark B Open bookmark in a new tab Nvigating your history: H go back in history L go forward in history Manipulating tabs: J, gT go one tab left K, gt go one tab right g0 go to the first tab. Use `ng0` to go to n-th tab, on `g` and a number character of `0` g$ go to the last tab ^ visit the previously-visited tab t create tab yt duplicate current tab x close current tab X restore closed tab (i.e. unwind the `x` command) T search through your open tabs W move current tab to new window <a-p> pin/unpin current tab Using marks: ma, mA set local mark "a" (global mark "A") `a, `A jump to local mark "a" (global mark "A") `` jump back to the position before the previous jump -- that is, before the previous gg, G, n, N, / or `a Additional advanced browsing commands: ]], [[ Follow the link labeled "next or ">" ("previous" or "<">) - helpful for browsing paginated sites <a-f> open multiple links in a new tab gi focus the first (or n-th) text input box on the page. Use <tab> to cycle through options. gu go up one level in the URL hierarchy gU go up to root of the URL hierarchy ge edit the current URL gE edit the current URL and open in a new tab zH scroll all the way left zL scroll all the way right v enter visual mode; use p/P to paste-and-go, use y to yank V enter visual line mode REFERENCE vimium - https://github.com/gdh1995/vimium

2023-08-26 ยท 428 words

SpaceVim - A community-driven vim distribution

์„ค์น˜ vim ๋˜๋Š” neovim์„ ๋จผ์ € ์„ค์น˜ํ•œ๋‹ค. ๋‘˜ ๋‹ค ์„ค์น˜๋˜์–ด ์žˆ๋Š” ๊ฒฝ์šฐ ํ•˜๋‚˜๋งŒ ๋™์ž‘ํ•˜๋„๋ก ์•„๋ž˜ ๋ช…๋ น์–ด๋กœ ์„ค์น˜ํ•œ๋‹ค. $ curl -sLf https://spacevim.org/install.sh | bash -s -- --install vim $ curl -sLf https://spacevim.org/install.sh | bash -s -- --install neovim $ vim ~/.config/nvim ์•„๋ž˜ ๋ ˆํผ๋Ÿฐ์Šค๋ฅผ ์ฐธ๊ณ ํ•œ๋‹ค. ์‚ฌ์šฉํ•˜๋Š” ์ฝ”๋”ฉ ์–ธ์–ด๋ฅผ layer๋กœ ๋“ฑ๋กํ•ด์ฃผ๋ฉด ๊ฑฐ์˜ ๋ชจ๋“  ๊ฒƒ์ด ํ•ด๊ฒฐ๋œ๋‹ค. ์•„์šธ๋Ÿฌ ๊ฐ ์–ธ์–ด์— ๋Œ€ํ•œ ์„ค์ •๋ฒ•๋„ ์ฐธ๊ณ  (๋‹จ์ถ•ํ‚ค๋„ ์ •๋ฆฌ) vimproc Error neovim์œผ๋กœ spacevim์„ ์„ค์น˜ํ•˜๊ณ  ์‹คํ–‰ํ–ˆ๋Š”๋ฐ ์œ„ ์—๋Ÿฌ๊ฐ€ ๋‚˜๋Š” ๊ฒฝ์šฐ $ cd ~/.SpaceVim/bundle/vimproc.vim $ make $ nvim Links Quick Start Guide https://spacevim.org/quick-start-guide/ Python Set https://spacevim.org/use-vim-as-a-python-ide/ Rust Set https://spacevim.org/use-vim-as-a-rust-ide/

2022-09-09 ยท 87 words

vim-devicons

์†Œ๊ฐœ vim์ด ํ„ฐ๋ฏธ๋„์—์„œ ๋™์ž‘ํ•˜๋ฏ€๋กœ ์•„์ด์ฝ˜์„ ํ‘œ์‹œํ•˜๊ธฐ๊ฐ€ ์ข‹์ง€ ์•Š๋‹ค. ์ƒ‰๊น”๊ณผ ๋ชจ์–‘์„ ๋ฏธ๋ คํ•˜๊ฒŒ ๋ฐ”๊พธ์–ด ์ค€๋‹ค. ๊ฐœ์ธ์ ์ธ ๊ด€์ ์—์„œ ๋ณด๋ฉด ์ƒ๋‹นํžˆ ๋งค๋ ฅ์ ์ด๋‹ค. ์‚ญ๋ง‰ํ•œ ๊ฒ€์€ ๋ฐฐ๊ฒฝ์— ๊ธ€์”จ๋งŒ ๋ณด์ด๋‹ค๊ฐ€ ๊ฝƒ์ด ํ”ผ๊ณ  ๊ทธ๋ฆผ์ด ์—ฌ๊ธฐ ์ €๊ธฐ ์žˆ๋Š” ๋А๋‚Œ์ด๋‹ค. ๊ฑฐ๊ธฐ์—๋‹ค ์•„๋ฆ„๋‹ค์šฐ๋ฉด์„œ๋„ ์ ˆ์ œ๋œ ๊ฒƒ์ด ์ž‘์—… ์ง‘์ค‘๋ ฅ์„ ๊ฒฐ์ฝ” ๋–จ์–ด ๋œจ๋ฆฌ๋Š” ๊ฒƒ๋„ ์•„๋‹ˆ๋‹ค. ์ ๊ทน ์ถ”์ฒœํ•œ๋‹ค. https://github.com/ryanoasis/vim-devicons ์ด ๊ณณ์— ๊ฐ€๋ฉด ์ƒ˜ํ”Œ ์‚ฌ์ง„๊ณผ ์„ค์น˜๋ฒ•์ด ์ž์„ธํžˆ ๋‚˜์™€์žˆ๋‹ค. ์ ์šฉ๋˜๋Š” ํ”Œ๋Ÿฌ๊ทธ์ธ: NERDTree,vim airline, CtrlP, powerline, denite, unite, lightline.vim, vim startify, vimfiler, vim-buffet and flagship. ๋ฌผ๋ก  ํฐํŠธ๋ฅผ ์„ค์น˜ํ•˜๋ฉด zsh, bash ๋“ฑ์—์„œ๋„ ํ”„๋กฌํ”„ํŠธ ํ‘œ์‹œ๋ฅผ ์ง€์›ํ•œ๋‹ค. ํฐํŠธ ์„ค์น˜ vim-devicons๋ฅผ ์„ค์น˜ํ•˜๊ธฐ ์ „์— ๋จผ์ € Nerd Patched ํฐํŠธ๋ฅผ ์„ค์น˜ํ•ด์•ผ ํ•œ๋‹ค. ํฐํŠธ๋Š” ๋‹ค์–‘ํ•œ๋ฐ ๋ชจ๋‘ ์„ค์น˜ํ•œ๋‹ค๋ฉด ๋งŽ์€ ์šฉ๋Ÿ‰์„ ์ฐจ์ง€ํ•˜๋ฏ€๋กœ ์—ฌ๊ธฐ์—์„œ๋Š” Noto Nerd Font ํฐํŠธ๋งŒ ์„ค์น˜ํ–ˆ๋‹ค. ์ฐธ๊ณ ๋กœ ํฐํŠธ๋ฅผ ๋ฐ›์„ ์ˆ˜ ์žˆ๋Š” ์‚ฌ์ดํŠธ์ด๋‹ค. nerd-fonts ๊นƒํ—ˆ๋ธŒ ์‚ฌ์ดํŠธ์™€ ์„ค์น˜ ์•ˆ๋‚ด๋„ ์žˆ๋‹ค. https://github.com/ryanoasis/nerd-fonts ๋ชจ๋‘ ์„ค์น˜ํ•˜๋ฉด ์šฉ๋Ÿ‰์ด ์•ฝ 1.2GB๋กœ ๋งค์šฐ ํฌ๋ฏ€๋กœ ๋‹ค์Œ ์Šคํฌ๋ฆฝํŠธ์—์„œ Noto์™€ Hack๋งŒ ์„ค์น˜ํ•œ๋‹ค. ์‹คํ–‰ํ•˜๋ฉด ~/.local/share/fonts์— ์„ค์น˜๋œ๋‹ค. ์„ค์น˜ ํ›„ ์ž์‹ ์ด ์‚ฌ์šฉํ•˜๋Š” ํ„ฐ๋ฏธ๋„์„ค์ •์—์„œ ํฐํŠธ๋ฅผ Noto Nerd font๋กœ ์„ค์ •ํ•ด์ฃผ๋ฉด ์ค€๋น„๊ฐ€ ์™„๋ฃŒ๋œ๋‹ค. #!/bin/bash declare -a fonts=( BitstreamVeraSansMono CodeNewRoman DroidSansMono FiraCode FiraMono Go-Mono Hack Hermit JetBrainsMono Meslo Noto Overpass ProggyClean RobotoMono SourceCodePro SpaceMono Ubuntu UbuntuMono ) version='2.1.0' fonts_dir="${HOME}/.local/share/fonts" if [[ ! -d "$fonts_dir" ]]; then mkdir -p "$fonts_dir" fi for font in "${fonts[@]}"; do zip_file="${font}.zip" download_url="https://github.com/ryanoasis/nerd-fonts/releases/download/v${version}/${zip_file}" echo "Downloading $download_url" wget "$download_url" unzip "$zip_file" -d "$fonts_dir" rm "$zip_file" done find "$fonts_dir" -name '*Windows Compatible*' -delete fc-cache -fv ์„ค์น˜ ๋ฐ ์„ค์ • ~/.vimrc ๋˜๋Š” ~/.config/nvim/init.vim ์„ค์ • Plug 'ryanoasis/vim-devicons' ... set encoding=UTF-8 ์„ค์น˜ nvim +plugInstall +qall ํ„ฐ๋ฏธ๋„ ์„ค์ •์—์„œ ํฐํŠธ๋ฅผ Noto Nerd Font๋ฅผ ์„ค์ •ํ•ด ์ฃผ๊ณ  vim ๋˜๋Š” nvim ์„ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค. Links https://github.com/ryanoasis/vim-devicons https://www.nerdfonts.com/font-downloads https://github.com/ryanoasis/nerd-fonts

2022-08-26 ยท 237 words

NerdTree

2022.09.09 - tips ์ถ”๊ฐ€ ์†Œ๊ฐœ The NERDTree is a file system explorer for the Vim editor. vim ํ™˜๊ฒฝ์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ํŒŒ์ผ ์‹œ์Šคํ…œ ํƒ์ƒ‰๊ธฐ์ด๋‹ค. ์„ค์น˜ ~/.vimrc ๋˜๋Š” ~/.config/nvim/init.vim ์„ค์ • Plug 'scrooloose/nerdtree' vim vim +PlugInstall +qall nvim nvim +PlugInstall +qall ์„ค์ • ๋ฐ ๊ธฐ๋Šฅ F8ํ‚ค๋กœ ์—ด๊ธฐ/๋‹ซ๊ธฐ " nerdtree nnoremap <F8> :NERDTreeToggle<CR> "ํ™”๋ฉด์— ๋„์šฐ๊ธฐ: F8ํ‚ค let g:NERDTreeWinPos = "right" "ํ™”๋ฉด ์˜ค๋ฅธ์ชฝ์— ๋„์šฐ๊ธฐ autocmd BufEnter * lcd %:p:h autocmd VimEnter * if !argc() | NERDTree | endif "vim ๋‹จ๋… ์‹คํ–‰์‹œ ์‹คํ–‰์‹œํ‚ค๊ธฐ h``j``k``l - ์ด๋™ enter - ํด๋”์—ด๊ธฐ, ํŒŒ์ผ์—ด๊ธฐ q - ๋‚˜๊ฐ€๊ธฐ h - ๋„์›€๋ง c - ์„ ํƒ๋œ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ root๋กœ ๋งŒ๋“ค๊ธฐ m - ๋ฉ”๋‰ด I - ์ˆจ์€ํŒŒ์ผ(hidden file/dir) ๋ณด์ด๊ธฐ Tips shift + i - show hidden dir and files / - Search directories and files form cusor s - open file to split vertically ...

2022-08-26 ยท (updated 2022-09-09) ยท 131 words