我的vim的vimrc配置文件,保存用

" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below.  If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim

" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
  syntax on
endif

" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark

" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
"  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif

" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
"  filetype plugin indent on
"endif

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd		" Show (partial) command in status line.
"set showmatch		" Show matching brackets.
"set ignorecase		" Do case insensitive matching
"set smartcase		" Do smart case matching
"set incsearch		" Incremental search
"set autowrite		" Automatically save before commands like :next and :make
"set hidden		" Hide buffers when they are abandoned
"set mouse=a		" Enable mouse usage (all modes)

" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
  source /etc/vim/vimrc.local
endif



 " =============================================================================
"        << 判断操作系统是 Windows 还是 Linux 和判断是终端还是 Gvim >>
" =============================================================================
 
" -----------------------------------------------------------------------------
"  < 判断操作系统是否是 Windows 还是 Linux >
" -----------------------------------------------------------------------------
let g:iswindows = 0
let g:islinux = 0
if(has("win32") || has("win64") || has("win95") || has("win16"))
    let g:iswindows = 1
else
    let g:islinux = 1
endif
 
" -----------------------------------------------------------------------------
"  < 判断是终端还是 Gvim >
" -----------------------------------------------------------------------------
if has("gui_running")
    let g:isGUI = 1
else
    let g:isGUI = 0
endif
 
 
" =============================================================================
"                          << 以下为软件默认配置 >>
" =============================================================================
 
" -----------------------------------------------------------------------------
"  < Windows Gvim 默认配置> 做了一点修改
" -----------------------------------------------------------------------------
if (g:iswindows && g:isGUI)
    source $VIMRUNTIME/vimrc_example.vim
    source $VIMRUNTIME/mswin.vim
    behave mswin
    set diffexpr=MyDiff()
 
    function MyDiff()
        let opt = '-a --binary '
        if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
        if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
        let arg1 = v:fname_in
        if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
        let arg2 = v:fname_new
        if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
        let arg3 = v:fname_out
        if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
        let eq = ''
        if $VIMRUNTIME =~ ' '
            if &sh =~ '\<cmd'
                let cmd = '""' . $VIMRUNTIME . '\diff"'
                let eq = '"'
            else
                let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
            endif
        else
            let cmd = $VIMRUNTIME . '\diff'
        endif
        silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
    endfunction
endif
 
" -----------------------------------------------------------------------------
"  < Linux Gvim/Vim 默认配置> 做了一点修改
" -----------------------------------------------------------------------------
if g:islinux
    set hlsearch        "高亮搜索
    set incsearch       "在输入要搜索的文字时,实时匹配
 
    " Uncomment the following to have Vim jump to the last position when
    " reopening a file
    if has("autocmd")
        au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
    endif
 
    if g:isGUI
        " Source a global configuration file if available
        if filereadable("/etc/vim/gvimrc.local")
            source /etc/vim/gvimrc.local
        endif
    else
        " This line should not be removed as it ensures that various options are
        " properly set to work with the Vim-related packages available in Debian.
        runtime! debian.vim
 
        " Vim5 and later versions support syntax highlighting. Uncommenting the next
        " line enables syntax highlighting by default.
        if has("syntax")
            syntax on
        endif
 
        set mouse=a                    " 在任何模式下启用鼠标
        "set t_Co=256                   " 在终端启用256色
        set backspace=2                " 设置退格键可用
 
        " Source a global configuration file if available
        if filereadable("/etc/vim/vimrc.local")
            source /etc/vim/vimrc.local
        endif
    endif
endif
 
 
" =============================================================================
"                          << 以下为用户自定义配置 >>
" =============================================================================
 
" -----------------------------------------------------------------------------
"  < Vundle 插件管理工具配置 >
" -----------------------------------------------------------------------------
" 用于更方便的管理vim插件,具体用法参考 :h vundle 帮助
" Vundle工具安装方法为在终端输入如下命令
" git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
" 如果想在 windows 安装就必需先安装 "git for window",可查阅网上资料
 
set nocompatible                                      "禁用 Vi 兼容模式
filetype off                                          "
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 要下载.vimrc文件,可以按照以下步骤操作: 1. 打开任意网页浏览器,进入搜索引擎网站,如Google或百度。 2. 在搜索框中输入“vim配置文件.vimrc下载”并点击搜索按钮。 3. 在搜索结果中,可以看到一些网站提供.vimrc文件的下载链接。点击其中一个可靠的链接。 4. 进入下载页面后,查看文件下载方式。通常,会提供一个“下载”按钮或者直接显示文件内容。 5. 如果有“下载”按钮,点击该按钮进行下载。如果文件内容直接显示在页面上,复制整个内容。 6. 找到想要保存.vimrc文件的位置,例如桌面或者指定文件夹。 7. 在浏览器上右击鼠标,并选择“保存链接为”或“保存页面为”。然后,选择保存到指定位置。 8. 在保存对话框中,指定保存文件的名称为“.vimrc”,确保文件名前面有一个点来确保其为隐藏文件。 9. 点击保存按钮,等待文件下载完成。 10. 成功保存文件后,即可在指定位置找到下载的.vimrc文件。 注意事项:在下载文件时,始终选择可信任的来源,以确保文件的安全性。另外,.vimrc文件通常是用于Vim编辑器的配置文件,如果使用其他编辑器,可能会需要相应的配置文件。 ### 回答2: 要下载vim配置文件.vimrc,你可以按照以下步骤进行操作: 1. 打开你的终端或命令行界面。 2. 使用curl命令下载.vimrc文件。在终端中输入以下命令并按下回车键: curl -o ~/.vimrc https://raw.githubusercontent.com/username/repo/master/.vimrc 这个命令会从GitHub的仓库中下载.vimrc文件并保存到你的主目录下。 替换"username/repo"部分为你所使用的GitHub用户名和仓库名称。 3. 下载完成后,你可以使用vim编辑器打开.vimrc文件来查看和修改配置。 在终端中输入以下命令打开.vimrc文件: vim ~/.vimrc 这将使用vim编辑器打开你的.vimrc文件,现在你可以根据自己的需求进行编辑和配置。 如果你对vim的配置不熟悉,你可以搜索一些vim的配置示例或教程,以帮助你进行必要的修改。 希望这个回答对你有所帮助! ### 回答3: vim配置文件.vimrc是用来定制Vim编辑器的设置和插件的配置文件。想要下载.vimrc文件,请按照以下步骤进行操作。 1. 打开你的命令行终端。 2. 在终端中输入以下命令,下载.vimrc文件: `wget https://raw.githubusercontent.com/username/repo/master/.vimrc` 这里的`https://raw.githubusercontent.com/username/repo/master/.vimrc`是.vimrc文件所在的URL。你需要将其替换为你想要下载的.vimrc文件的真实URL。 3. 下载完成后,.vimrc文件会保存在当前目录下。 4. 如果需要将.vimrc文件移动到其他目录,请使用以下命令: `mv .vimrc /desired/path` 这里的`/desired/path`是你想要移动到的目标路径。你需要将其替换为你想要保存.vimrc文件的目标路径。 通过上述步骤,你可以下载到你想要的.vimrc配置文件,并可以根据自己的需要进行自定义及编辑。记得根据实际情况修改命令中的URL和目标路径以适应你的需求。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值