Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim基本配置备忘 or .vimrc #107

Open
lanlin opened this issue Nov 3, 2021 · 1 comment
Open

vim基本配置备忘 or .vimrc #107

lanlin opened this issue Nov 3, 2021 · 1 comment

Comments

@lanlin
Copy link
Owner

lanlin commented Nov 3, 2021

~/.vimrc

"设置主题+透明
autocmd vimenter * hi Normal guibg=NONE ctermbg=NONE " transparent bg
colorscheme molokai

"显示行号
set nu

"启动时隐去援助提示
set shortmess=atI

"语法高亮
syntax on

"使用vim的键盘模式
"set nocompatible

"不需要备份
set nobackup

"没有保存或文件只读时弹出确认
set confirm

"鼠标可用
set mouse=a

"tab缩进
set tabstop=4
set shiftwidth=4
set expandtab
set smarttab

"文件自动检测外部更改
set autoread

"c文件自动缩进
set cindent

"自动对齐
set autoindent

"智能缩进
set smartindent

"高亮查找匹配
set hlsearch

"背景色
set background=dark

"显示匹配
set showmatch

"显示标尺,就是在右下角显示光标位置
set ruler

"去除vi的一致性
set nocompatible

"允许折叠
set foldenable
"""""""""""""""""设置折叠"""""""""""""""""""""
"
"根据语法折叠
set fdm=syntax

"手动折叠
"set fdm=manual

"设置键盘映射,通过空格设置折叠
nnoremap <space> @=((foldclosed(line('.')<0)?'zc':'zo'))<CR>
""""""""""""""""""""""""""""""""""""""""""""""
"不要闪烁
set novisualbell

"启动显示状态行
set laststatus=2

"浅色显示当前行
autocmd InsertLeave * se nocul

"用浅色高亮当前行
autocmd InsertEnter * se cul

"显示输入的命令
set showcmd

"被分割窗口之间显示空白
set fillchars=stl:/
set fillchars=vert:/
set fillchars=stlnc:/
@lanlin
Copy link
Owner Author

lanlin commented Nov 3, 2021

下载 vim themes

  1. 找一个主题包下载,比如 https://github.com/rafi/awesome-vim-colorschemes

  2. 将 colors 目录下的 xxx.vim 文件全部拷贝到 ~/.vim/colors 中即可

  3. 打开 .vimrc 修改 colorscheme 主题名,然后保存退出即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant