温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

linux Vim的配置是怎样的

发布时间:2021-09-27 14:40:00 来源:亿速云 阅读:115 作者:柒染 栏目:系统运维

这篇文章给大家介绍linux Vim的配置是怎样的,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

有需要的朋友可以参考下。

代码如下:


" 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 " hightlight cursor line 高亮光标所在行

" set the back space
set backspace=indent,eol,start "这行比较重要,刚接触vim的朋友会发现有时候backspace键删不了文字
 
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 <leader>x :xa!<cr>
nmap <leader>w :w!<cr>
 
"switch to current directory
map <leader>cd :cd %:p:h<cr>
 
" just for fun
map <F9> ggVGg?
 
" folding code
if exists("&foldenable")
  set fen
endif
 
if exists("&foldlevel")
  set fdl=0
endif
 
" tag list --
map <F3> :Tlist<cr>
 
"remove the windows ^M windows系统中常常可以看到文本中夹杂着^M这样的控制字符,用此命令删除之
noremap <leader>m :%s/

关于linux Vim的配置是怎样的就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI