.vimrc的配置---转

termux平台下,通过pkg update && pkg upgrade && pkg install vim来获得vim。可是,当我配置.vimrc时发现如果我每在一个平台使用vim都要敲键盘的话,太浪费时间了。毕竟,人生苦短。于是,我将win10、centos平台下编写的配置写下来;以后就复制粘贴就行了。
在Windows平台下,Full安装默认出现:

source $VIMRUNTIME/vimrc_example.vim

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 arg1 = substitute(arg1, ‘!’, ‘!’, ‘g’)
let arg2 = v:fname_new
if arg2 =~ ’ ’ | let arg2 = ‘"’ . arg2 . ‘"’ | endif
let arg2 = substitute(arg2, ‘!’, ‘!’, ‘g’)
let arg3 = v:fname_out
if arg3 =~ ’ ’ | let arg3 = ‘"’ . arg3 . ‘"’ | endif
let arg3 = substitute(arg3, ‘!’, ‘!’, ‘g’)
if KaTeX parse error: Double superscript at position 50: …hljs-string">' '̲</span> <sp…VIMRUNTIME . ‘\diff"’
else
let cmd = substitute(KaTeX parse error: Double superscript at position 48: …hljs-string">' '̲</span>, <span …VIMRUNTIME . ‘\diff’
endif
let cmd = substitute(cmd, ‘!’, ‘!’, ‘g’)
silent execute ‘!’ . cmd . ’ ’ . opt . arg1 . ’ ’ . arg2 . ’ > ’ . arg3
if exists(‘l:shxq_sav’)
let &shellxquote=l:shxq_sav
endif
endfunction

在linux平台下:
touch ~/.vimrc
----------------------------------------------------------------------------------


”设置文件编码
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936
set fileencoding=gb2312
set termencoding=utf-8

syntax on
"设置颜色
color darkblue
set cursorline cursorcolumn
set incsearch
set ignorecase
set smartcase
"
设置保持历史记录10000
set history=10000
set nofoldenable
set confirm
set backspace=indent,eol,start
set t_Co=256
set report=0
set nowrap
set scrolloff=5
set number
set ruler
set showmatch
set showcmd
set title
set laststatus=2
set matchtime=2
set matchpairs+=<:>

" 设置文件不备份,这里被注释掉;
"
set nobackup
" set noundofile
"
set noswapfile

set autoindent
set smartindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set smarttab
set textwidth=80

"Vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin ‘VundleVim/Vundle.vim’
Plugin ‘scrooloose/nerdtree’
Plugin ‘mattn/calendar-vim’
Plugin ‘godlygeek/tabular’
Plugin ‘plasticboy/vim-markdown’
Plugin ‘suan/vim-instant-markdown’
Plugin ‘lervag/vimtex’
Plugin ‘sirver/ultisnips’
Plugin ‘pboettch/vim-cmake-syntax’
Plugin ‘Valloric/YoucompleteMe’
Plugin ‘kien/ctrlp.vim’
Plugin ‘jiangmiao/auto-pairs’
Plugin ‘EasyGrep’
Plugin ‘scrooloose/syntastic’
Plugin ‘Valloric/ListToggle’
Plugin ‘bling/vim-airline’
Plugin ‘maralla/completor.vim’
Plugin ‘vim-scripts/indentpython.vim’
Plugin ‘vim-syntastic/syntastic’
Plugin ‘nvie/vim-flake8’
Plugin ‘Lokaltog/vim-powerline’
Plugin ‘Yggdroot/indentLine’
Plugin ‘godlygeek/tabular’
Plugin ‘plasticboy/vim-markdown’
Plugin ‘lervag/vimtex’
Plugin ‘tpope/vim-fugitive’
Plugin ‘EditPlus’
Plugin ‘cst’
Plugin ‘Xdebug’
Plugin ‘PyChimp’
Plugin ‘taglist.vim’
Plugin ‘snipMate’
call vundle#end()
filetype plugin indent on

“设置日历方面
let g:calendar_diary=”/mnt/c/Users/mydai/diary/"
let g:calendar_focus_today=1

let g:tex_flavor=‘latex’
let g:vimtex_view_method=‘zathura’
let g:vimtex_quickfix_mod=0
set conceallevel=1

" YouCompleteme config:fedora 27 and later:
"
sudo dnf install cmake gcc g++ make python3-devel
" Compiling YCM with semantic support for C-family languages through libclang;
"
cd ~/.vim/bundle/youcompleteme
" python3 install.py --clang-completer
"
YCM Configuration notes:
let g:ycm_min_num_of_chars_for_completion=3
let g:ycm_python_binary_path=‘python’
let g:ycm_seed_identifiers_with_syntax=1
let g:ycm_autoclose_preview_window_after_completion=1
let g:ycm_auto_trigger=1

写完配置文件后,就要git了:

mkdir ~/.vim/
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

随后进入 vim:
执行:
PluginInstall
----------------------------------
git相关知识,再次写一下:
Powershell平台下posh-git:

Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy RemoteSigned -Force

Install-Module posh-git -Scope CurrentUser -Force
Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force # Newer beta version with PowerShell Core support(这个没下载,不使用)

Git in Bash(哎,人生苦短,直接截图):

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值