반응형
NerdTree-트리에 파일 표시
NerdTree 디렉토리 패널에 현재 파일을 표시하는 바로 가기가 있습니까?
TextMate '드로어에 파일 표시'처럼-Ctrl + Command + R
in : h NERDTree :
:NERDTreeFind :NERDTreeFind
Find the current file in the tree. If no tree exists for the current tab,
or the file is not under the current root, then initialize a new tree where
the root is the directory of the current file.
나는 그것이 기본적으로 어떤 것에 묶여 있다고 생각하지 않으므로 직접 키 바인딩을해야합니다.
nmap ,n :NERDTreeFind<CR>
내 .vimrc에 나타나는 것과 함께
nmap ,m :NERDTreeToggle<CR>
이것을 확인하면 동기화 작업이 자동화됩니다. 버퍼를 변경할 때마다 nerdtree가 자동으로 새로 고쳐집니다 ( 여기 에서 약간의 수정으로 복사했습니다 ).
" Check if NERDTree is open or active
function! IsNERDTreeOpen()
return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1)
endfunction
" Call NERDTreeFind iff NERDTree is active, current window contains a modifiable
" file, and we're not in vimdiff
function! SyncTree()
if &modifiable && IsNERDTreeOpen() && strlen(expand('%')) > 0 && !&diff
NERDTreeFind
wincmd p
endif
endfunction
" Highlight currently open buffer in NERDTree
autocmd BufEnter * call SyncTree()
참고 URL : https://stackoverflow.com/questions/7692233/nerdtree-reveal-file-in-tree
반응형
'developer tip' 카테고리의 다른 글
UICollectionView의 cellForItemAtIndexPath가 호출되지 않습니다. (0) | 2020.08.31 |
---|---|
Swift의 iOS 경고에서 TextField에서 입력 값 가져 오기 (0) | 2020.08.31 |
Sublime Text 2 : 요청시 후행 공백 제거 (0) | 2020.08.30 |
Dart에서 명명 된 매개 변수와 위치 매개 변수의 차이점은 무엇입니까? (0) | 2020.08.30 |
기본 패키지에서 Java 클래스에 액세스하는 방법은 무엇입니까? (0) | 2020.08.30 |