# 查看vim安装目录
pi@raspberrypi:/usr/local $ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 30 2017 18:21:38)
Included patches: 1-197, 322, 377-378, 550, 703, 706-707
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm +termguicolors
-browse -footer +multi_byte +terminfo
++builtin_terms +fork() +multi_lang +termresponse
+byte_offset +gettext -mzscheme +textobjects
+channel -hangul_input +netbeans_intg +timers
+cindent +iconv +num64 +title
-clientserver +insert_expand +packages -toolbar
-clipboard +job +path_extra +user_commands
+cmdline_compl +jumplist -perl +vertsplit
+cmdline_hist +keymap +persistent_undo +virtualedit
+cmdline_info +lambda +postscript +visual
+comments +langmap +printer +visualextra
+conceal +libcall +profile +viminfo
+cryptv +linebreak -python +vreplace
+cscope +lispindent -python3 +wildignore
+cursorbind +listcmds +quickfix +wildmenu
+cursorshape +localmap +reltime +windows
+dialog_con -lua +rightleft +writebackup
+diff +menu -ruby -X11
+digraphs +mksession +scrollbind -xfontset
-dnd +modify_fname +signs -xim
-ebcdic +mouse +smartindent -xpm
+emacs_tags -mouseshape +startuptime -xsmp
+eval +mouse_dec +statusline -xterm_clipboard
+ex_extra +mouse_gpm -sun_workshop -xterm_save
+extra_search -mouse_jsbterm +syntax
+farsi +mouse_netterm +tag_binary
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -fdebug-prefix-map=/build/vim-UkjqTY/vim-8.0.0197=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl
# 到vim安装目录下
cd cd /usr/share/vim
pi@raspberrypi:/usr/share/vim $ ls
addons registry vim80 vimfiles vimrc
pi@raspberrypi:/usr/share/vim $ cd vim80
pi@raspberrypi:/usr/share/vim/vim80 $ ls
autoload debian.vim evim.vim ftplugin.vim indent.vim macros pack scripts.vim tutor
bugreport.vim defaults.vim filetype.vim ftplugof.vim indoff.vim menu.vim plugin spell vimrc_example.vim
colors delmenu.vim ftoff.vim gvimrc_example.vim keymap mswin.vim print synmenu.vim
compiler doc ftplugin indent lang optwin.vim rgb.txt syntax
# 安装插件管理工具
pi@raspberrypi:/usr/share/vim/vim80/autoload $ sudo curl -LSso /usr/share/vim/vim80/autoload/pathogen.vim https://tpo.pe/pathogen.vim
# 安装插件
pi@raspberrypi:/usr/share/vim/vim80 $ sudo mkdir bundle
pi@raspberrypi:/usr/share/vim/vim80 $ cd bundle
pi@raspberrypi:/usr/share/vim/vim80/bundle $ sudo git clone https://github.com/tpope/vim-sensible.git
Cloning into 'vim-sensible'...
remote: Counting objects: 305, done.
remote: Total 305 (delta 0), reused 0 (delta 0), pack-reused 305
Receiving objects: 100% (305/305), 44.24 KiB | 0 bytes/s, done.
Resolving deltas: 100% (77/77), done.
pi@raspberrypi:/usr/share/vim/vim80/bundle $ sudo git clone https://github.com/scrooloose/nerdtree
Cloning into 'nerdtree'...
remote: Counting objects: 4572, done.
remote: Compressing objects: 100% (17/17), done.
Receiving objects: 100% (4572/4572), 1.30 MiB | 27.00 KiB/s, done.
remote: Total 4572 (delta 8), reused 25 (delta 8), pack-reused 4541
Resolving deltas: 100% (1964/1964), done.
pi@raspberrypi:/usr/share/vim/vim80/bundle $ sudo git clone https://github.com/jistr/vim-nerdtree-tabs
Cloning into 'vim-nerdtree-tabs'...
remote: Counting objects: 504, done.
remote: Total 504 (delta 0), reused 0 (delta 0), pack-reused 504
Receiving objects: 100% (504/504), 88.51 KiB | 0 bytes/s, done.
Resolving deltas: 100% (205/205), done.
# 添加配置
sudo vim /etc/vim/vimrc
# 在下方添加
execute pathogen#infect()
syntax on
filetype plugin indent on
let g:nerdtree_tabs_open_on_console_startup=1
效果
屏幕快照 2018-04-03 下午11.20.46.png
参考:
vim-pathogen
Vim插件之NERDTree安装配置
一步步在 Centos 7 上搭建 vim C++ IDE
网友评论