濮阳杆衣贸易有限公司

主頁 > 知識庫 > Ubuntu上Vim安裝NERDTree插件的詳細(xì)操作步驟

Ubuntu上Vim安裝NERDTree插件的詳細(xì)操作步驟

熱門標(biāo)簽:ai電銷機器人 如何開發(fā) 蘭州語音電銷機器人軟件 宿州防封外呼系統(tǒng)廠家 智能外呼系統(tǒng)如何部署 電話機器人服務(wù)差 山東400電話如何辦理 電銷機器人對公司貢獻 高德地圖標(biāo)注在建線路 濟源電話外呼系統(tǒng)怎么樣

NERDTree是Vim的文件系統(tǒng)瀏覽器,使用此插件,用戶可以直觀地瀏覽復(fù)雜的目錄層次結(jié)構(gòu),快速打開文件以進行讀取或編輯,以及執(zhí)行基本的文件系統(tǒng)操作。NERDTree源碼在https://github.com/preservim/nerdtree 。

這里通過Vundle安裝NERDTree,Vundle是Vim軟件包的縮寫,是Vim插件管理器。Vundle源碼在https://github.com/VundleVim/Vundle.vim 。

安裝Vundle:

(1). 執(zhí)行如下命令:

mkdir -p ~/.vim/bundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

(2). 打開~/.vimrc,在此文件中添加內(nèi)容如下:

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()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
 
" Keep Plugin commands between vundle#begin/end.
" 安裝其它插件
 
" All of your Plugins must be added before the following line
call vundle#end()      " required
filetype plugin indent on  " required

安裝NERDTree:

(1). 執(zhí)行如下命令:

git clone https://github.com/preservim/nerdtree.git ~/.vim/bundle/nerdtree

(2). 打開~/.vimrc,在語句call vundle#end()語句前添加內(nèi)容如下:

Plugin 'preservim/nerdtree'

NERDTree常用快捷鍵:未說明默認(rèn)是在命令行模式,命令前有”:”是在底行模式下

1. 通過vim打開一個文件后,在底行模式下輸入”NERDTree”后回車進入NERDTree;

2. ctrl+w+h:光標(biāo)focus左側(cè)樹形結(jié)構(gòu);

3. ctrl+w+l:光標(biāo)focus右側(cè)文件顯示窗口;

4. ctrl+w+w:光標(biāo)自動在左右側(cè)窗口切換;

5. ctrl+w+r:移動當(dāng)前窗口的布局位置;

6. o/go:在已有窗口中打開文件,跳到/不跳到該窗口;

7. o:如果光標(biāo)定位在目錄上,點擊”o”則會展開或合攏該目錄;

8. t/T:在新的Tab中打開文件,跳到/不跳到新Tab;

9. :tabc/:tabo:關(guān)閉當(dāng)前的/關(guān)閉所有其它的Tab;

10. :tabp/:tabn:跳到前一個/跳到后一個Tab;

12. i/gi:split一個新窗口并打開選中文件,跳到/不跳到該窗口;

13. s/gs:vsplit一個新窗口并打開選中文件,跳到/不跳到該窗口;

14. x:合攏當(dāng)前文件或目錄的父目錄;

15. P/p:跳到根結(jié)點/父結(jié)點;

16. C:將選中目錄或選中文件的父目錄設(shè)為根結(jié)點;

17. u/U:將當(dāng)前根結(jié)點的父目錄設(shè)為根結(jié)點,并合攏原根結(jié)點/展開原根結(jié)點;

18. r/R:遞歸刷新選中目錄/根結(jié)點;

19. I:切換是否顯示隱藏文件;

20. q:關(guān)閉NERDTree窗口。

打開NERDTree后界面如下:

完整的~/.vimrc文件內(nèi)容如下:

" 安裝Vundle: 參考:https://github.com/VundleVim/Vundle.vim
" $ mkdir -p ~/.vim/bundle
" $ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
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()
 
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" Keep Plugin commands between vundle#begin/end.
 
" 安裝NERDTree
" $ git clone https://github.com/preservim/nerdtree.git ~/.vim/bundle/nerdtree
Plugin 'preservim/nerdtree'
 
" 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
" 語法高亮顯示
syntax on
" 縮進設(shè)置
set tabstop=8
set softtabstop=8
set shiftwidth=8
" C代碼縮進
set cindent
" 搜索結(jié)果高亮顯示
set hlsearch
" 解決中文字符顯示亂碼
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8

總結(jié)

到此這篇關(guān)于Ubuntu上Vim安裝NERDTree插件操作步驟的文章就介紹到這了,更多相關(guān)Vim安裝NERDTree插件內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

標(biāo)簽:晉中 安陽 佛山 云南 巴中 畢節(jié) 南寧 衡水

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Ubuntu上Vim安裝NERDTree插件的詳細(xì)操作步驟》,本文關(guān)鍵詞  Ubuntu,上,Vim,安裝,NERDTree,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Ubuntu上Vim安裝NERDTree插件的詳細(xì)操作步驟》相關(guān)的同類信息!
  • 本頁收集關(guān)于Ubuntu上Vim安裝NERDTree插件的詳細(xì)操作步驟的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    宁阳县| 深泽县| 桃园县| 桃源县| 楚雄市| 阿合奇县| 开化县| 淮滨县| 广汉市| 莱西市| 霍林郭勒市| 永城市| 洛宁县| 临湘市| 建阳市| 大兴区| 凤凰县| 达孜县| 介休市| 秦安县| 蒙阴县| 汽车| 伊通| 鄯善县| 方正县| 池州市| 平舆县| 小金县| 芒康县| 白银市| 九寨沟县| 江华| 万州区| 开远市| 德江县| 大安市| 凤山县| 呼伦贝尔市| 张家界市| 东城区| 香港 |