vim配置文件(本人喜欢的风格)

简介:

在/etc/vimrc这个文件


if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"

   set fileencodings=utf-8,latin1

endif

set nu

set tabstop=4

set nocompatible " Use Vim defaults (much better!)

set bs=indent,eol,start " allow backspacing over everything in insert mode

"set ai " always set autoindenting on

"set backup " keep a backup file

set viminfo='20,\"50 " read/write a .viminfo file, don't store more

" than 50 lines of registers

set history=50 " keep 50 lines of command line history

set ruler " show the cursor position all the time

" Only do this part when compiled with support for autocommands

if has("autocmd")

  augroup redhat

    " In text files, always limit the width of text to 78 characters

    autocmd BufRead *.txt set tw=78

    " When editing a file, always jump to the last cursor position

    autocmd BufReadPost *

    \ if line("'\"") > 0 && line ("'\"") <= line("$") |

    \   exe "normal! g'\"" |

    \ endif

  augroup END

endif

if has("cscope") && filereadable("/usr/bin/cscope")

   set csprg=/usr/bin/cscope

   set csto=0

   set cst

   set nocsverb

   " add any database in current directory

   if filereadable("cscope.out")

      cs add cscope.out

   " else add database pointed to by environment

   elseif $CSCOPE_DB != ""

      cs add $CSCOPE_DB

   endif

   set csverb

endif

" Switch syntax highlighting on, when the terminal has colors

" Also switch on highlighting the last used search pattern.

if &t_Co > 2 || has("gui_running")

  syntax on

  set hlsearch

endif

if &term=="xterm"

     set t_Co=8

     set t_Sb=[4%dm

     set t_Sf=[3%dm

endif

highlight Comment ctermfg=green guifg=green

目录
相关文章
|
人工智能 Linux 开发工具
linux 对文件内容的查看、归档 及 vim基本操作
linux 对文件内容的查看、归档 及 vim基本操作
|
Linux 开发工具
xshell5 vim后文件内容仍停留在屏幕的问题
xshell5 vim后文件内容仍停留在屏幕的问题
118 0
|
12月前
|
存储 Linux Shell
常用vim命令和vim基本使用及Linux用户的管理,用户和组相关文件
这篇文章介绍了Vim编辑器的基本使用、常用命令和模式,以及Linux系统中用户和组的管理方法,包括用户和组相关文件如/etc/passwd、/etc/shadow和/etc/group的说明。
常用vim命令和vim基本使用及Linux用户的管理,用户和组相关文件
|
弹性计算 开发工具 云计算
云服务器 ECS产品使用问题之vim 路径提示找不到文件,该如何解决
云服务器ECS(Elastic Compute Service)是各大云服务商阿里云提供的一种基础云计算服务,它允许用户租用云端计算资源来部署和运行各种应用程序。以下是一个关于如何使用ECS产品的综合指南。
|
缓存 Shell 开发工具
[oeasy]python024_vim读取文件_从头复制到尾_撤销_重做_reg_寄存器
[oeasy]python024_vim读取文件_从头复制到尾_撤销_重做_reg_寄存器
109 5
|
Shell Linux 开发工具
【异常解决】vim编辑文件时提示 Found a swap file by the name “.start.sh.swp“的解决方案
【异常解决】vim编辑文件时提示 Found a swap file by the name “.start.sh.swp“的解决方案
985 0
|
开发工具
Vim如何清空文件
这样,你就清空了你的文件。
677 1
|
Linux 开发工具
Linux 多个vi、vim进程编辑同一文件时的临时文件问题
Linux 多个vi、vim进程编辑同一文件时的临时文件问题
385 0
|
Linux 开发工具
【专栏】Linux 必备技能:Vim文本编辑器中快速跳转到文件开头和结尾的方法
【4月更文挑战第28天】本文介绍了Vim文本编辑器中快速跳转到文件开头和结尾的方法。使用`gg`或`1G`可跳转到文件开头,`G`或`$`则用于跳转到结尾。此外,还提到了跳转到指定行(如`10G`)和查找特定字符(如`f`+字符)的技巧,以提升编辑效率。
2233 0
|
Linux 开发工具
6.vim(vi)多文件编辑
6.vim(vi)多文件编辑
185 1