경박한 VIM

3042 단어 vim

vim 자동 들여쓰기 및 tap 스페이스 바 설정 4


우선 설정 정보를 수정해야 한다. 우선 어디서 수정했는지 알고 한 번만 말해야 한다. 파일 경로는 /etc/vim/vimrc 아래에 있다.
sudo vim /etc/vim/vimrc
안에 다음과 같은 코드를 추가하면 우리가 말한 기능을 실현할 수 있다
set smartindent  
set tabstop=4  
set shiftwidth=4  
set expandtab  
set softtabstop=4  

vim 재장착

sudo apt-get install --reinstall vim-gnome vim-gui-common vim-common vim-runtime

vim 플러그인 관리 및 설치

  • 현재 사용자 디렉터리에 생성됩니다.vim 디렉터리, 이미 있으면 제멋대로 생략하세요.명령은 다음과 같습니다.
  • mkdir .vim
  • 입장.vim 디렉터리를 만들고 디렉터리 bundle를 만들고 bundle 디렉터리에 들어가서 Vundle을 복제합니다. 플러그인을 관리하기 때문입니다.설치할 플러그인을 Plugin'XXX'사이에 추가합니다.
  • cd ~/.vim && mkdir bundle && cd bundle
    클론 명령 코드는 다음과 같습니다.
    git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
  • vim를 편집하고 실행합니다.vimrc .다음 설정은.vimrc 머리.
  • set nocompatible              " be iMproved, required
    filetype off                  " required
    
    " 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'}
    
    " 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
  • 실행: PluginInstall 설치 플러그인.명령줄에vim을 입력하고:PluginInstall을 입력하십시오. 조금만 기다리면 설치될 것입니다.
  • 좋은 웹페이지 즐겨찾기