小知识: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 Vim

ing,

” 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 ” dont 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:h10: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系统中常常可以看到文本中夹杂着^M这样的控制字符,用此命令删除之

noremap <leader>m :%s/
声明: 猿站网有关资源均来自网络搜集与网友提供,任何涉及商业盈利目的的均不得使用,否则产生的一切后果将由您自己承担! 本平台资源仅供个人学习交流、测试使用 所有内容请在下载后24小时内删除,制止非法恶意传播,不对任何下载或转载者造成的危害负任何法律责任!也请大家支持、购置正版! 。本站一律禁止以任何方式发布或转载任何违法的相关信息访客发现请向站长举报,会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。本网站的资源部分来源于网络,如有侵权烦请发送邮件至:2697268773@qq.com进行处理。
建站知识

小知识:恢复linux下被删除的syslog—/var/log/messages文件方法

2023-6-3 5:56:09

建站知识

小知识:linux wc命令应用举例

2023-6-3 6:12:42

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索