如何在Ubuntu上安装Vim?

Vim是vi文本编辑器的克隆。Vim比vi提供了很多改进。Vim创建于1991年,并作为一个开源Vim许可证获得了许可。即使vi也安装了大多数流行的Linux发行版以及Ubuntu,默认情况下Vim也没有安装。因此,您将按照以下步骤安装Vim Ubuntu。

null

搜索Vim包

即使不需要安装Vim,我们也会搜索Vim包。大多数发行版都提供了大量Vim和相关的包,甚至是不同版本的Vim。首先,我们将使用以下命令更新包存储库。

$ sudo apt update

然后我们将使用以下命令来搜索Vim包。

$ apt search vim
图片[1]-如何在Ubuntu上安装Vim?-yiteyi-C++库
搜索Vim包

我们可以从输出中看到与Vim相关的包非常不同。

显示Vim包信息

关于Vim的包信息包含Vim的版本、包名、安装大小、下载大小等。

$ apt show vim

输出如下。

Package: vimVersion: 2:8.1.2269-1ubuntu5Priority: optionalSection: editorsOrigin: UbuntuMaintainer: Ubuntu Developers [email protected]Original-Maintainer: Debian Vim Maintainers [email protected]orgBugs: https://bugs.launchpad.net/ubuntu/+filebugInstalled-Size: 3,111 kBProvides: editorDepends: vim-common (= 2:8.1.2269-1ubuntu5), vim-runtime (= 2:8.1.2269-1ubuntu5), libacl1 (>= 2.2.23), libc6 (>= 2.29), libcanberra0 (>= 0.2), libgpm2 (>= 1.20.7), libpython3.8 (>= 3.8.2), libselinux1 (>= 1.32), libtinfo6 (>= 6)Suggests: ctags, vim-doc, vim-scriptsHomepage: https://www.vim.org/Task: server, cloud-image, lubuntu-desktopDownload-Size: 1,238 kBAPT-Manual-Installed: yesAPT-Sources: http://us.archive.ubuntu.com/ubuntu focal/main amd64 PackagesDescription: Vi IMproved - enhanced vi editorVim is an almost compatible version of the UNIX editor Vi..Many new features have been added: multi level undo, syntaxhighlighting, command line history, on-line help, filenamecompletion, block operations, folding, Unicode support, etc..This package contains a version of vim compiled with a ratherstandard set of features. This package does not provide a GUIversion of Vim. See the other vim-* packages if you need more(or less).
图片[2]-如何在Ubuntu上安装Vim?-yiteyi-C++库
显示Vim包信息

安装Vim

我们将使用以下apt命令安装Vim。我们还将提供vim的包名。我们还将使用sudo命令来提供root权限。

$ sudo apt install vim

或者,您可以使用apt get命令,该命令提供与apt命令相同的功能和参数。

$ sudo apt-get install vim

检查Vim版本

安装Vim后,我们可以检查安装的Vim版本。我们将使用 –版本 参数。通常,vim命令打开vim文本编辑器,但使用 –版本 参数Vim编辑器将不会打开。

$ vim --version

输出如下所示,其中包含版本、开发人员、特性、编译选项等信息。

VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 15 2020 06:40:31)Included patches: 1-2269Modified by [email protected]Compiled by [email protected]Huge version without GUI. Features included (+) or not (-):+acl -farsi -mouse_sysmouse -tag_any_white+arabic +file_in_path +mouse_urxvt -tcl+autocmd +find_in_path +mouse_xterm +termguicolors+autochdir +float +multi_byte +terminal-autoservername +folding +multi_lang +terminfo-balloon_eval -footer -mzscheme +termresponse+balloon_eval_term +fork() +netbeans_intg +textobjects-browse +gettext +num64 +textprop++builtin_terms -hangul_input +packages +timers+byte_offset +iconv +path_extra +title+channel +insert_expand -perl -toolbar+cindent +job +persistent_undo +user_commands-clientserver +jumplist +postscript +vartabs-clipboard +keymap +printer +vertsplit+cmdline_compl +lambda +profile +virtualedit+cmdline_hist +langmap -python +visual+cmdline_info +libcall +python3 +visualextra+comments +linebreak +quickfix +viminfo+conceal +lispindent +reltime +vreplace+cryptv +listcmds +rightleft +wildignore+cscope +localmap -ruby +wildmenu+cursorbind -lua +scrollbind +windows+cursorshape +menu +signs +writebackup+dialog_con +mksession +smartindent -X11+diff +modify_fname +sound -xfontset+digraphs +mouse +spell -xim-dnd -mouseshape +startuptime -xpm-ebcdic +mouse_dec +statusline -xsmp+emacs_tags +mouse_gpm -sun_workshop -xterm_clipboard+eval -mouse_jsbterm +syntax -xterm_save+ex_extra +mouse_netterm +tag_binary+extra_search +mouse_sgr -tag_old_staticsystem 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-iU6mZD/vim-8.1.2269=. -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1Linking: gcc -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lnsl -lselinux -lcanberra -lacl -lattr -lgpm -ldl -L/usr/lib/python3.8/config-3.8-x86_64-linux-gnu -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm -lm

相关文章: 如何在Linux中删除符号链接?

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享