Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Basic installation and configuration steps of gVim in Ubuntu system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "the basic installation and configuration steps of gVim in the Ubuntu system". In the daily operation, I believe that many people have doubts about the basic installation and configuration steps of gVim in the Ubuntu system. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "the basic installation and configuration steps of gVim in the Ubuntu system". Next, please follow the editor to study!

Installation:

1. Download the source code package vim-7.4.tar.bz2 on www.vim.org

two。 Libncurses5-dev installation of the development library:

The code is as follows:

Sudo apt-get install libncurses5-dev

3. Decompress tar jxvf vim-7.4.tar.bz2 and enter vim74/src:

The code is as follows:

/ configure-- with-features=huge-- enable-pythoninterp=yes-- enable-gui=gnome2-- enable-cscope-- enable-fontset-- enable-perlinterp-- enable-rubyinterp-- with-python-config-dir=/usr/lib/python2.6/config

4.

The code is as follows:

Make & & sudo make install

5. So the installation of vim is complete, so install gvim below:

The code is as follows:

Sudo apt-get install vim-gnome

Some basic configuration instructions in the gvim configuration file .vimrc:

"Don't use vi's keyboard mode, but vim's own

Set nocompatible

"Grammar highlighting

Set syntax=on

"Color scheme

Colorscheme torte

"remove the sound of input errors.

Set noeb

"pop-up confirmation when working with unsaved or read-only files

Set confirm

"automatic indent

Set autoindent

Set cindent

"automatic line wrapping

Set wrap

"the whole word breaks.

Set linebreak

"width of the Tab key

Set tabstop=4

"uniformly indent to 4

Set softtabstop=4

Set shiftwidth=4

"do not replace tabs with spaces

Set noexpandtab

"use tabs at the beginning of lines and paragraphs

Set smarttab

"Show line number

Set number

"number of historical records

Set history=1000

"prohibit the generation of temporary files

Set nobackup

Set noswapfile

"search ignores case

Set ignorecase

"search for verbatim highlighting

Set hlsearch

Set incsearch

"inline replacement

Set gdefault

"Encoding Settin

Set enc=utf-8

Set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936

"language Settings

Set helplang=cn

Set encoding=utf8

Set langmenu=zh_CN.UTF-8

Set imcmdline

Source $VIMRUNTIME/delmenu.vim

Source $VIMRUNTIME/menu.vim

"sets the font.

Set guifont=Liberation\ Mono\ 12

"set guifont=Fixedsys\ Excelsior\ 3.01\ 14

"what is displayed on my status line (including file type and decoding)

Set statusline=%F%m%r%h%w\ [FORMAT=% {& ff}]\ [TYPE=%Y]\ [POS=%l,%v] [% p%%]\% {strftime (\ "% d/%m/%y\ -\% HGV% M\")}

"set statusline= [% F]% y% r% m% ratio% = [Line:%l/%L,Column:%c] [% p%%]

"always show the status line

Set laststatus=2

"during editing, the status line of the cursor position is displayed in the lower right corner

Set ruler

"the height of the command line (under the status line), which defaults to 1, here it is 2

Set cmdheight=2

"detect file types

Filetype on

"load the file type plug-in

Filetype plugin on

"load relevant indentation files for specific file types

Filetype indent on

"Save global variables

Set viminfofoots!

"words with the following symbols should not be separated by line breaks

Set iskeyword+=_,$,@,%,#,-

"number of pixel lines inserted between characters

Set linespace=0

"automatic completion of command line operations in enhanced mode

Set wildmenu

"enable the return key (backspace) to handle indent, eol, start, etc.

Set backspace=2

"allow backspace and cursor keys to cross line boundaries

Set whichwrap+=,h,l

"you can use the mouse anywhere in buffer (similar to double-clicking the mouse in the workspace in office)

Set mouse=a

Set selection=exclusive

Set selectmode=mouse,key

"tell us which line of the file has been changed by using the: commands command

Set report=0

"when started, the prompt for assistance to Somali children was not displayed.

Set shortmess=atI

"display white space between segmented windows for ease of reading

Set fillchars=vert:\, stl:\, stlnc:\

"highlight matching parentheses

Set showmatch

"match the time when the parentheses are highlighted (in 1/10 seconds)

Set matchtime=5

"keep 3 lines apart as the cursor moves over the top and bottom of the buffer

Set scrolloff=3

"provide automatic indentation for C programs

Set smartindent

"Line numbers are displayed only when the following file types are detected, not for plain text files

If has ("autocmd")

Autocmd FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby set number

Autocmd FileType xml,html vmap'oclinic /

Autocmd FileType html,text,php,vim,c,java,xml,bash,shell,perl,python setlocal textwidth=100

Autocmd Filetype html,xml,xsl source $VIMRUNTIME/plugin/closetag.vim

Autocmd BufReadPost *

\ if line ("'\") > 0 & & line ("'\")

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report