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

What is the configuration of linux Vim?

2025-04-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article introduces you to linux Vim configuration is how, the content is very detailed, interested friends can refer to, hope to help you.

Friends in need can refer to it.

The code is as follows:

" This is my _vimrc under windows platform

" and it can be used on *nix too

" all the difference of them is the font setting session

" happy Viming,

" copyLeft (#) Abruzzi John

set linebreak " line break

set nocompatible " no compatible

set history=400 " history

set ruler

set number " line number

set hlsearch " highlight search

set noincsearch " no in C search

set expandtab " expand table

set t_vb= "close bell

set foldmethod=marker

set tabstop=4 " table step

set shiftwidth=4

set nobackup " don't backup

set smarttab " smart table

set smartindent " smart indent

set autoindent " auto indent

set cindent "cindent

set cursorline "highlight cursor line

" set the back space

set backspace=indent,eol,start "This line is more important. Friends who have just come into contact with vim will find that sometimes the backspace key cannot delete text.

colorscheme desert " color scheme

let Tlist_Use_Right_Window=0 " for tag_list plugin only

let Tlist_File_Fold_Auto_Close=1 " for tag_list plugin only

let g:winManagerWindowLayout="FileExplorer|TagList" " for winmanager

filetype plugin indent on " filetype setting

set completeopt=longest,menu " for code complete

" the following function is used for show the status bar on the buttom

function! CurrectDir()

let curdir = substitute(getcwd(), "", "", "g")

return curdir

endfunction

set statusline=\ [File]\ %F%m%r%h\ %w\ \ [PWD]\ %r%{CurrectDir()}%h\ \ %=[Line]\ %l,%c\ %=\ %P

" this is a setting of font

if has("win32")

set guifont=Courier_New:h20:cANSI

endif

" make sure that syntax always on

if exists("syntax_on")

syntax reset

else

syntax on

endif

" java complete

if has("autocmd")

autocmd Filetype java setlocal omnifunc=javacomplete#Complete

endif

""""""""""""""""""""""""""""""""""""""""""""""""""""""

let performance_mode=1

function MySys()

if has("win32")

return "win32"

elseif has("unix")

return "unix"

else

return "mac"

endif

endfunction

if MySys() == "unix" || MySys() == "mac"

set shell=bash

else

" set win32 shell

endif

" set auto read when file is changed from outside

if exists("&autoread")

set autoread

endif

" enable the mouse

if exists("&mouse")

set mouse=a

endif

" set mapleader

let mapleader=","

let g:mapleader=","

"fast saving

nmap x :xa!

nmap w :w!

"switch to current directory

map cd :cd %:p:h

" just for fun

map ggVGg?

" folding code

if exists("&foldenable")

set fen

endif

if exists("&foldlevel")

set fdl=0

endif

" tag list --

map :Tlist

"remove the windows ^M Windows systems often see text mixed with control characters such as ^M, with this command to remove it

noremap m :%s/

About linux Vim configuration is how to share here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

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