public:computer:vim_cheat_sheet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
public:computer:vim_cheat_sheet [2022/03/21 18:27] – [References] alexpublic:computer:vim_cheat_sheet [2022/09/13 17:24] alex
Line 439: Line 439:
 |:args |현재 열린 모든 파일중 현재 편집중인 파일 표시 | |:args |현재 열린 모든 파일중 현재 편집중인 파일 표시 |
  
-==== _gvimrc ====+==== _vimrc ==== 
 +  * Install Vundle<sxh bash> 
 +$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim 
 +or 
 +> cd %USERPROFILE% 
 +> git clone https://github.com/VundleVim/Vundle.vim.git %USERPROFILE%/.vim/bundle/Vundle.vim 
 +> gvim .vimrc 
 +</sxh> 
 + 
 +  * Plugin 
 +<sxh shell title:_vimrc> 
 +set nocompatible              " be iMproved, required 
 +filetype off                  " required 
 +set shellslash 
 + 
 +"-------------------------------------------------------------- 
 +" Specify a directory for plugins 
 +" - For Neovim: stdpath('data') . '/plugged' 
 +" - Avoid using standard Vim directory names like 'plugin' 
 +"call plug#begin('~/.vim/plugged'
 + 
 +" Make sure you use single quotes 
 + 
 +" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align 
 +"Plug 'junegunn/vim-easy-align' 
 + 
 +" Any valid git URL is allowed 
 +"Plug 'https://github.com/junegunn/vim-github-dashboard.git' 
 + 
 +" Multiple Plug commands can be written in a single line using | separators 
 +"Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' 
 + 
 +" On-demand loading 
 +"Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle'
 +"Plug 'tpope/vim-fireplace', { 'for': 'clojure'
 + 
 +" Using a non-default branch 
 +"Plug 'rdnetto/YCM-Generator', { 'branch': 'stable'
 + 
 +" Using a tagged release; wildcard allowed (requires git 1.9.2 or above) 
 +"Plug 'fatih/vim-go', { 'tag': '*'
 + 
 +" Plugin options 
 +"Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim'
 + 
 +" Plugin outside ~/.vim/plugged with post-update hook 
 +"Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } 
 + 
 +" Unmanaged plugin (manually installed and updated) 
 +"Plug '~/my-prototype-plugin' 
 + 
 +" Plugin airline 
 +"Plug 'vim-airline/vim-airline' 
 +"Plug 'vim-airline/vim-airline-themes' 
 + 
 +"Plug 'scrooloose/syntastic' 
 +"Plug 'posva/vim-vue' 
 +"Plug 'altercation/vim-colors-solarized' 
 + 
 +" Initialize plugin system 
 +"call plug#end() 
 +"-------------------------------------------------------------- 
 +" set the runtime path to include Vundle and initialize 
 +set rtp+=~/.vim/bundle/Vundle.vim 
 +call vundle#begin() 
 +" alternatively, pass a path where Vundle should install plugins 
 +"call vundle#begin('~/some/path/here'
 + 
 +" let Vundle manage Vundle, required 
 +Plugin 'VundleVim/Vundle.vim' 
 + 
 +" The following are examples of different formats supported. 
 +" Keep Plugin commands between vundle#begin/end. 
 +" plugin on GitHub repo 
 +Plugin 'tpope/vim-fugitive' 
 +" plugin from http://vim-scripts.org/vim/scripts.html 
 +" Plugin 'L9' 
 +" Git plugin not hosted on GitHub 
 +Plugin 'git://git.wincent.com/command-t.git' 
 +" git repos on your local machine (i.e. when working on your own plugin) 
 +"Plugin 'file:///home/gmarik/path/to/plugin' 
 +" The sparkup vim script is in a subdirectory of this repo called vim. 
 +" Pass the path to set the runtimepath properly. 
 +Plugin 'rstacruz/sparkup', {'rtp': 'vim/'
 +" Install L9 and avoid a Naming conflict if you've already installed a 
 +" different version somewhere else. 
 +" Plugin 'ascenator/L9', {'name': 'newL9'
 + 
 +Plugin 'vim-airline/vim-airline' 
 +Plugin 'vim-airline/vim-airline-themes' 
 +Plugin 'scrooloose/syntastic' 
 +Plugin 'posva/vim-vue' 
 +Plugin 'altercation/vim-colors-solarized' 
 + 
 + 
 +" All of your Plugins must be added before the following line 
 +call vundle#end()            " required 
 +filetype plugin indent on    " required 
 +" To ignore plugin indent changes, instead use: 
 +"filetype plugin on 
 +
 +" Brief help 
 +" :PluginList       - lists configured plugins 
 +" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate 
 +" :PluginSearch foo - searches for foo; append `!` to refresh local cache 
 +" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal 
 +
 +" see :h vundle for more details or wiki for FAQ 
 +" Put your non-Plugin stuff after this line 
 +"-------------------------------------------------------------- 
 +" An example for a gvimrc file. 
 +" The commands in this are executed when the GUI is started, after the vimrc 
 +" has been executed. 
 +
 +" Maintainer: Bram Moolenaar <Bram@vim.org> 
 +" Last change: 2016 Apr 05 
 +
 +" To use it, copy it to 
 +        for Unix:  ~/.gvimrc 
 +       for Amiga:  s:.gvimrc 
 +  for MS-Windows:  $VIM\_gvimrc 
 +       for Haiku:  ~/config/settings/vim/gvimrc 
 +     for OpenVMS:  sys$login:.gvimrc 
 + 
 +" Make external commands work through a pipe instead of a pseudo-tty 
 +"set noguipty 
 + 
 +" set the X11 font to use 
 +" set guifont=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1 
 + 
 +set ch=2 " Make command line two lines high 
 + 
 +set mousehide " Hide the mouse when typing text 
 + 
 +" Make shift-insert work like in Xterm 
 +map <S-Insert> <MiddleMouse> 
 +map! <S-Insert> <MiddleMouse> 
 + 
 +" Only do this for Vim version 5.0 and later. 
 +if version >= 500 
 + 
 +  " Switch on syntax highlighting if it wasn't on yet. 
 +  if !exists("syntax_on"
 +    syntax on 
 +  endif 
 + 
 +  " For Win32 version, have "K" lookup the keyword in a help file 
 +  "if has("win32"
 +  "  let winhelpfile='windows.hlp' 
 +  "  map K :execute "!start winhlp32 -k <cword> " . winhelpfile <CR> 
 +  "endif 
 + 
 +  " Set nice colors 
 +  " background for normal text is light grey 
 +  " Text below the last line is darker grey 
 +  " Cursor is green, Cyan when ":lmap" mappings are active 
 +  " Constants are not underlined but have a slightly lighter background 
 +  highlight Normal guibg=grey90 
 +  highlight Cursor guibg=Green guifg=NONE 
 +  highlight lCursor guibg=Cyan guifg=NONE 
 +  highlight NonText guibg=grey80 
 +  highlight Constant gui=NONE guibg=grey95 
 +  highlight Special gui=NONE guibg=grey95 
 + 
 +endif 
 + 
 + 
 +set guifont=D2Coding:h12:cHANGEUL:qDEFAULT 
 +" set guifont=Source_Code_Pro:h12:cANSI:qDEFAULT 
 + 
 +if has("gui_running"
 +  set encoding=utf-8   
 + 
 +  source $VIMRUNTIME/mswin.vim 
 +  behave mswin 
 +   
 +  if has('win32'
 +    set keymodel=startsel 
 +        
 +    " set guifont=Source\ Code\ Pro:h16:cANSI:qDEFAULT 
 +    " set guifont=JetBrains\ Mono\ Regular:h18:cANSI:qDEFAULT 
 +    " set guifont=D2Coding\ ligature:h16:cHANGEUL:qDEFAULT      
 +   set renderoptions=type:directx, 
 +       \gamma:1.0, 
 +       \contrast:0.5, 
 +       \level:1, 
 +       \geom:1, 
 +       \renmode:5, 
 +       \taamode:
 + 
 +      " restore Ctrl-F to Page down 
 +    unmap <C-F> 
 +  elseif has('gui_macvim'  
 +    set guifont=JetBrains\ Mono\ 16 
 +    set antialias 
 +  else 
 +    set guifont=JetBrains\ Mono\ 16 
 +  endif 
 + 
 +  " Turn off toolbar 
 +  "set guioptions-=T 
 +  " Turn on menu 
 +  "set guioptions+=m 
 +end 
 + 
 +set smartindent 
 +set tabstop=2 
 +set expandtab 
 +set shiftwidth=2 
 + 
 +" colorscheme darkblue 
 + 
 +"set statusline+=%#warningmsg# 
 +"set statusline+=%{SyntasticStatuslineFlag()} 
 +"set statusline+=%* 
 + 
 +"let g:syntastic_always_populate_loc_list = 1 
 +"let g:syntastic_auto_loc_list = 1 
 +"let g:syntastic_check_on_open = 1 
 +"let g:syntastic_check_on_wq = 0 
 + 
 +let g:airline#extensions#tabline#enabled = 1 
 +let g:airline_powerline_fonts = 1 
 + 
 +syntax enable 
 +set background=dark 
 +colorscheme solarized 
 + 
 +set encoding=utf-8    
 +"set rop=type:directx,gamma:1.0,contrast:0.5,level:1,geom:1,renmode:4,taamode:
 + 
 +"let g:airline_section_z airline#section#create(['windowswap', '%3p%% ', 'linenr', ':%3v']) 
 + 
 +set nu 
 +set clipboard=unnamed 
 +set laststatus=
 +set lines=50 
 +</sxh> 
 + 
 +  * Plug
 <sxh> <sxh>
 set nocompatible              " be iMproved, required set nocompatible              " be iMproved, required
Line 670: Line 909:
  
 </sxh> </sxh>
 +
 +  * Apply <sxh>
 +:source %
 +:PluginInstall
 +</sxh>
 +
 +
 +
 +===== Examples =====
 +  * '':%s/^(\d+.)/\n\1/g'': 라인 첫번째에 ''숫자(1자이상).''으로 된 항목 앞에 개행문자 추가 (문서전체적용)
  
  
Line 684: Line 933:
   * [[https://pastime0.tistory.com/entry/vim|GVIM 환경설정 ]]   * [[https://pastime0.tistory.com/entry/vim|GVIM 환경설정 ]]
   * [[https://woonizzooni.tistory.com/entry/Windows10-%ED%99%98%EA%B2%BD%EC%97%90%EC%84%9C-vim-%ED%99%98%EA%B2%BD-%EC%84%A4%EC%A0%95|Windows10 환경에서 vim 환경 설정]]   * [[https://woonizzooni.tistory.com/entry/Windows10-%ED%99%98%EA%B2%BD%EC%97%90%EC%84%9C-vim-%ED%99%98%EA%B2%BD-%EC%84%A4%EC%A0%95|Windows10 환경에서 vim 환경 설정]]
 +  * [[http://gypark.pe.kr/wiki/Vi%EB%A1%9C%EB%AC%B8%EC%9E%90%EC%97%B4%EC%B9%98%ED%99%98%ED%95%98%EA%B8%B0|Vi로문자열치환하기]]
  
  
  • public/computer/vim_cheat_sheet.txt
  • Last modified: 2023/01/01 01:06
  • by alex