Arch Linux에서 입력이 제공되지 않는 경우 시작 시 Vim이 NERDTree를 시작하도록 하는 방법

Arch Linux에서 입력이 제공되지 않는 경우 시작 시 Vim이 NERDTree를 시작하도록 하는 방법

gvim-gtk2내 Open Build Service 저장소에서 설치했습니다 (여기그렇습니다) 대부분의 경우 잘 작동합니다. 유일한 예외는 입력이 제공되지 않은 경우(즉, 열도록 지정된 파일이나 폴더 없이 시작 되거나 시작되지 않은 경우) ~/.vimrc시작 시 NERDTree를 로드하도록 되어 있지만 그렇지 않다는 것입니다.vimgvim

오히려 Vim이 시작할 때 보여주는 화면은 다음과 같습니다: 여기에 이미지 설명을 입력하세요

여기~/.vimrc파일이야. ~/.vimrcVim 시작 시 NERDTree를 시작하기 위한 내 줄은 다음과 같습니다 .

autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif

이 라인은 다음에서 빌린 것입니다.NERDTre 읽어보기파일. 다른 배포판에서는 ~/.vimrc시작 시 로드 NERDTree에서 이 줄을 내가 원하는 방식으로 정확하게 찾았 지만 Arch Linux에서는 그렇지 않습니다. /etc/vimrc내 패키지가 설치하는 파일은 다음 vim-runtime과 같습니다.

" All system-wide defaults are set in $VIMRUNTIME/archlinux.vim (usually just
" /usr/share/vim/vimfiles/archlinux.vim) and sourced by the call to :runtime
" you can find below.  If you wish to change any of those settings, you should
" do it in this file (/etc/vimrc), since archlinux.vim will be overwritten
" everytime an upgrade of the vim packages is performed.  It is recommended to
" make changes after sourcing archlinux.vim since it alters the value of the
" 'compatible' option.

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages.
runtime! archlinux.vim

" If you prefer the old-style vim functionalty, add 'runtime! vimrc_example.vim'
" Or better yet, read /usr/share/vim/vim80/vimrc_example.vim or the vim manual
" and configure vim to your own liking!

" do not load defaults if ~/.vimrc is missing
"let skip_defaults_vim=1

여기 내 archlinux.vim파일이 있습니다:

" The ArchLinux global vimrc - setting only a few sane defaults
"
" Maintainer:      Thomas Dziedzic [[email protected]]
"
" NEVER EDIT THIS FILE, IT'S OVERWRITTEN UPON UPGRADES, GLOBAL CONFIGURATION
" SHALL BE DONE IN /etc/vimrc, USER SPECIFIC CONFIGURATION IN ~/.vimrc

" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible                " Use Vim defaults instead of 100% vi compatibility
set backspace=indent,eol,start  " more powerful backspacing

" Now we set some defaults for the editor
set history=50                  " keep 50 lines of command line history
set ruler                       " show the cursor position all the time

" Suffixes that get lower priority when doing tab completion for filenames.
" These are files we are not likely to want to edit or read.
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc,.png,.jpg

if has('gui_running')
  " Make shift-insert work like in Xterm
  map <S-Insert> <MiddleMouse>
  map! <S-Insert> <MiddleMouse>
endif

관련 정보