我是靠谱客的博主 正直银耳汤,最近开发中收集的这篇文章主要介绍Vim配置.vimrc文件效果图,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

Vim配置

  • .vimrc文件
  • 效果图

.vimrc文件

" 设置自己的leader
let mapleader=","
" 打开文件类型侦测
filetype on
" 根据不同的文件类型加载不同的插件
filetype plugin on
" 定义快捷键到行尾部和首部
" ctrl+a 到行首
nnoremap <C-a> ^
" ctrl+e 到行尾
nnoremap <C-E> $
" 快速跳转 大写J等于往下调3行
nmap J 3j
nmap K 3k
" 关于保存退出文件相关
nmap <Leader>w :w<CR>
nmap <Leader>e :wq<CR>
" 打开行号显示
set number
" 处理复制粘贴 按y 在visual 模式下复制 按p在normal模式下粘贴
vnoremap <Leader>y "+y
nmap <Leader>p "+p
" 跳转Window
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" 处理esc
inoremap jj <ESC>
" 快速加括号 引号
nnoremap <leader>" viw<esc>a"<esc>hbi"<esc>lel
nnoremap <leader>' viw<esc>a'<esc>hbi'<esc>lel
nnoremap <leader>( viw<esc>a)<esc>hbi(<esc>lel
"快速加横条
nnoremap <leader>* O/<esc>30a*<esc>a/<esc>16hi
nnoremap <leader># O#<esc>30a=<esc>a#<esc>16hi
" 让vim配置保存后立马生效
autocmd BufWritePost $MYVIMRC source $MYVIMRC
" 开启实时搜索并且对大小写不敏感
set incsearch
set ignorecase
set smartcase
" 关闭兼容模式
set nocompatible
" 开启vim自身命令行模式智能补全
set wildmenu
" 消除颜色
noremap <Leader><space> :nohlsearch<CR>
" 自动识别文件格式
set fileformats=unix,dos
set fileformat=unix
"不生成swp文件
set noswapfile
" 统一缩紧
set softtabstop=2
set shiftwidth=2
" 将tab自动转为空格
set expandtab
" 不能自动换行
set nowrap
" 格式化
set formatoptions=tcrqn " 根据要求格式化
set autoindent     " 继承缩紧
set smartindent    " 为C语言提供自动缩紧
set cindent        " 使用C样式缩紧
set smarttab       " 在行和段开始处使用制表符
set tabstop=4
set shiftwidth=4
" { }直接换行
imap{ {}<ESC>i<CR><ESC>O
set backspace=2
" 设置文件编码
set fileencoding=utf-8
" 搜索设置
set showmatch      " 匹配成队符号
set matchtime=5    " 匹配括号高亮的时间
" 行数控制
set scrolloff=20  " 光标始终保持在距离上下顶点20行的位置
" 自定义状态行
set laststatus=2
set statusline=%F Ascii:%b 0x:%B %=[%{&ff}]:%l 列:%v 最大行:%L %y
" 设置缓冲区
set hidden
" 如果超过这个时间没有输入,将内容写入到磁盘
set updatetime=3
" c 不给出 |ins-completion-menu| 信息。例如,
set shortmess+=c
" 自定义函数
function! ShowPos()
    let &statusline = ""
    let now_line = line(".")
    let max_line =  line("$")
    let pos = now_line * 1.0 / max_line * 1.0 * 100
    let pos = float2nr(pos) / 10
    let statusline="%F Ascii:%-5b 0x:%-4B "
    let statusline2="%=[%{&ff}] 行:%l 列:%v 最大行:%L %y"
    let statusline3 = "["
    let g:count = 0
    while g:count < 10
        if pos > -1
            let statusline3 = statusline3 . "➡"
            let pos = pos - 1
        else
            let statusline3 = statusline3 . " "
        endif
        let g:count = g:count + 1
    endwhile
    let statusline3 = statusline3 . "]"
    let statusline = statusline . statusline3 . statusline2
    let &statusline = statusline
endfunction()
autocmd CursorMoved * call ShowPos()
autocmd CursorMovedI * call ShowPos()


" 安装插件
call plug#begin('~/.vim/plugged')

" vim欢迎界面
Plug 'mhinz/vim-startify'
" 文件树
Plug 'scrooloose/nerdtree'
" 自动代码格式化
Plug 'Chiel92/vim-autoformat'
" 错误检查插件
Plug 'w0rp/ale'
" 各种括号自动补全
Plug 'Raimondi/delimitMate'
" 状态栏
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" 骚气的配色
Plug 'atelierbram/vim-colors_atelier-schemes'
Plug 'flazz/vim-colorschemes'
Plug 'liuchengxu/space-vim-dark'
Plug 'NLKNguyen/papercolor-theme'
Plug 'yuttie/hydrangea-vim'
Plug 'junegunn/seoul256.vim'
Plug 'joshdick/onedark.vim'
" 文件图标 配合nerdtree
Plug 'ryanoasis/vim-devicons'
" 文件图标的进一步美化
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
" 通用代码注释
" gcc 注释所在行
" gc 注释选中部分 visual模式下
" gcu 撤销上一次注释
" gcgc 撤销注释当前行和临近的N行注释
Plug 'tpope/vim-commentary'
" 对齐插件
" 先用V选中多行,ea进入对齐模式
" 默认是左对齐
" 回车进入R模式是右对齐 right
" 再次回车进入C模式是居中对齐 Centered
" 紧接着输入对齐中间的字符,也就是分隔符
Plug 'junegunn/vim-easy-align'
" 补全插件 不要乱动
" Plug 'Valloric/YouCompleteMe'
" python的缩进插件
Plug 'vim-scripts/indentpython.vim'
" 插件管理器 配合plug使用,实现每个插件安装之后在一个单独的文件夹
Plug 'tpope/vim-pathogen'
" 符号编辑插件
Plug 'tpope/vim-surround'
" c++ stl高亮
Plug 'octol/vim-cpp-enhanced-highlight'
" tab自动补全代码片段
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
" 对称括号加颜色
Plug 'frazrepo/vim-rainbow'
" 函数、类等快速加注释
" 在光标定位到数据结构声明或函数声明的第一行,运行:Dox,将生成数据结构或函数的注释骨架
Plug 'vim-scripts/DoxygenToolkit.vim'
"快速定位
Plug 'easymotion/vim-easymotion'
Plug 'itchyny/vim-cursorword'
"
Plug 'gcmt/wildfire.vim'
Plug 'skywind3000/asyncrun.vim'
" 折腾
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'liuchengxu/vista.vim'
call plug#end()

"wildfire推荐设置
let g:wildfire_objects = ["i'", 'i"', "i)", "i]", "i}", "ip", "it"]
" asyncrun 推荐设置
let g:asyncrun_open=6
"vim-commentary
"为python和shell等添加注释
autocmd FileType python,shell,coffee set commentstring=# %s
"修改注释风格
autocmd FileType java,c,cpp set commentstring=// %s
" 对称括号加颜色 设置启动
let g:rainbow_active = 1

" 设置vim-easy-align
" 自动对齐 map visual映射
" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ea <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ea <Plug>(EasyAlign)
" 设置vim-autoformat
" 自动格式化内容
noremap <Leader>ac :Autoformat<CR>
"设置代码折叠
set foldmethod=indent
set nofoldenable
"vista.vim宽度
let g:vista_sidebar_width=60   
"==========================youcompleteme==================================="
""let g:ycm_global_ycm_extra_conf='~/.ycm_extra_conf.py'
""let g:ycm_global_ycm_extra_conf = '~/.vim/plugged/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
"let g:ycm_confirm_extra_conf = 0
"let g:ycm_semantic_triggers = {
"             'c,cpp,python,java,go,erlang,perl': ['re!w{2}'],
"             'cs,lua,javascript': ['re!w{2}'],
"             }
" 不在单独打开窗口显示函数原型
" set completeopt=menu,menuone
" let g:ycm_add_preview_to_completeopt = 0
" let g:ycm_show_diagnostics_ui = 0
" let g:ycm_key_invoke_complerion = '<c-space>'
" " ycm显示补全的白名单 1==True
" let g:ycm_filetype_whitelist = {
"              "c":1,
"              "cpp":1,
"              "objc":1,
"              "sh":1,
"              "zsh":1,
"              "zimbu":1,
"              "python":1,
"              "text":1,
"              "cmake":1,
"              "javascript":1,
"              "vim":1,
"              "html":1,
"              }
" nnoremap gd :YcmCompleter GoToDefinitionElseDeclaration<CR>
" nnoremap g/ :YcmCompleter GetDoc<CR>
" nnoremap gt :YcmCompleter GetType<CR>
" nnoremap gr :YcmCompleter GoToReferences<CR>
" let g:ycm_autoclose_preview_window_after_completion=0
" let g:ycm_autoclose_preview_window_after_insertion=1
" let g:ycm_use_clangd = 1
" let g:ycm_clangd_uses_ycmd_caching = 0
" let g:ycm_python_interpreter_path = "/usr/bin/python3"
" let g:ycm_python_binary_path = "/usr/bin/python3"
" let g:ycm_clangd_binary_path = "~/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clangd/output/bin/clangd"
"==========================youcompleteme==================================="



" 在普通模式下 按tt 显示/隐藏nerdtree
map tt :NERDTreeMirror<CR>
map tt :NERDTreeToggle<CR>
" 设置octol/vim-cpp-enhanced-highlight
" 默认不高亮类作用域
let g:cpp_class_scope_highlight = 1
" 成员变量也是默认不显示
let g:cpp_member_variable_highlight = 1
" 声明中高亮类名
let g:cpp_class_decl_highlight = 1
" 模版突出显示
let g:cpp_experimental_template_highlight = 1
" 库突出显示
let g:cpp_concepts_highlight = 1

" 设置ultisnips
let g:UltiSnipsExpandTrigger="<tab>"



"===========================ultisnips================================"
function! g:UltiSnips_Complete()
    call UltiSnips#ExpandSnippet()
    if g:ulti_expand_res == 0
        if pumvisible()
            return "<C-n>"
        else
            call UltiSnips#JumpForwards()
            if g:ulti_jump_forwards_res == 0
                return "<TAB>"
            endif
        endif
    endif
    return ""
endfunction

function! g:UltiSnips_Reverse()
    call UltiSnips#JumpBackwards()
    if g:ulti_jump_backwards_res == 0
        return "<C-P>"
    endif

    return ""
endfunction


if !exists("g:UltiSnipsJumpForwardTrigger")
    let g:UltiSnipsJumpForwardTrigger = "<tab>"
endif
if !exists("g:UltiSnipsJumpBackwardTrigger")
    let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
endif

au InsertEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger     . " <C-R>=g:UltiSnips_Complete()<cr>"
au InsertEnter * exec "inoremap <silent> " .     g:UltiSnipsJumpBackwardTrigger . " <C-R>=g:UltiSnips_Reverse()<cr>"
"===========================ultisnips================================"




" 打开文件自动跳转到上一次的光标位置
if has("autocmd")
    au BufReadPost * if line("'"") > 0|if line("'"") <= line("$")|exe("norm '"")|else|exe "norm $"|endif|endif
endif


" taglist
" 设置Tlist的宽度
let Tlist_WinWidth=30
" 如果Tlist是最后一个窗口就直接关闭
let Tlist_Exit_OnlyWindow=1

"============================ale============================="
let b:ale_fixers = ['autopep8', 'yapf']
let g:ale_set_highlights = 0
"自定义error和warning图标
let g:ale_sign_error = '•'
let g:ale_sign_warning = '•'
"在vim自带的状态栏中整合ale
let g:ale_statusline_format = ['E•%d', 'W•%d', 'OK']
"显示Linter名称,出错或警告等相关信息
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
"打开文件时不进行检查
let g:ale_lint_on_enter = 0

"普通模式下,wp前往上一个错误或警告,wn前往下一个错误或警告
nmap wp <Plug>(ale_previous_wrap)
nmap wn <Plug>(ale_next_wrap)
"<Leader>s触发/关闭语法检查
nmap <Leader>s :ALEToggle<CR>
"<Leader>d查看错误或警告的详细信息
nmap <Leader>d :ALEDetail<CR>
"使用clang对c和c++进行语法检查,对python使用pylint进行语法检查
let g:ale_linters = {
               'c++': ['clang++-10'],
               'c': ['clang-10'],
               'python': ['flake8'],
            }

"============================ale============================="


" airline_theme
let g:airline_theme="violet"
"这个是安装字体后 必须设置此项"
let g:airline_powerline_fonts = 1
"打开tabline功能,方便查看Buffer和切换,这个功能比较不错"
"我还省去了minibufexpl插件,因为我习惯在1个Tab下用多个buffer"
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_nr_show = 1
" 窗口移动与跳转映射
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l 
"设置切换Buffer快捷键"
nnoremap <C-N> :bn<CR>
nnoremap <C-P> :bp<CR>
" 关闭状态显示空白符号计数,这个对我用处不大"
let g:airline#extensions#whitespace#enabled = 0
let g:airline#extensions#whitespace#symbol = '!'

" 在Gvim中我设置了英文用Hermit, 中文使用 YaHei Mono "
if has('win32')
    set guifont=Hermit:h13
    set guifontwide=Microsoft_YaHei_Mono:h12
endif
" 设置DoxygenToolkit
let g:DoxygenToolkit_paramTag_pre="@param: "
let g:DoxygenToolkit_returnTag="@returns: "
let g:DoxygenToolkit_briefTag_funcName="no"
let g:doxygen_enhanced_color=1
let g:DoxygenToolkit_classTag = "@class "
let g:DoxygenToolkit_dateTag = "@date "
"*****************************************************
"新文件标题                                          *
"*****************************************************
"新建.c,.h,.sh,.java文件,自动插入文件头
autocmd BufNewFile *.c,*.cpp,*.sh,*.rb,*.java,*.py,*.h exec ":call SetTitle()"
""定义函数SetTitle,自动插入文件头
func SetTitle()
    "如果文件类型为.sh文件
    if &filetype == 'sh'
        call setline(1,"#!/bin/bash")
        call append(line("."), "")
    elseif &filetype == 'python'
        call setline(1,"#!/usr/bin/env python3.6")
        call append(line("."),"# coding=utf-8")
        call append(line(".")+1, "")

    elseif &filetype == 'ruby'
        call setline(1,"#!/usr/bin/env ruby")
        call append(line("."),"# encoding: utf-8")
        call append(line(".")+1, "")
    else
        call setline(1, "/*************************************************************************")
        call append(line("."),   "   > File Name   : ".expand("%"))
        call append(line(".")+1, "   > Author      : name")
        call append(line(".")+2, "   > Mail        : name@gmail.com")
        call append(line(".")+3, "   > Created Time: ".strftime("%c"))
        call append(line(".")+4, "   > Version     : 0.1")
        call append(line(".")+5, " ************************************************************************/")
        call append(line(".")+6, "")
    endif
    if expand("%:e") == 'h'
        call append(line(".")+7, "#pragma once")
        call append(line(".")+8, "#ifndef _".toupper(expand("%:r"))."_H")
        call append(line(".")+9, "#define _".toupper(expand("%:r"))."_H")
        call append(line(".")+10, "#endif")
    endif
    if &filetype == 'java'
        call append(line(".")+7,"public class ".expand("%:r"))
        call append(line(".")+8,"")
    endif
endfunc
"新建文件后,自动定位到文件末尾
autocmd BufNewFile * normal G
" F3自动调格式
noremap <F3> :Autoformat<CR>
" F2自动插入注释
nnoremap <F2> :Dox<CR>
"单词两侧快速双引号
nnoremap <leader>" mQlbi"<ESC>ea"<ESC>`Ql
"快速单引号
nnoremap <leader>' mQlbi'<ESC>ea'<ESC>`Ql
let g:autoformat_verbosemode=1

" 设置底色 与配色方案配合
set background=light
colorscheme PaperColor 
" hi Normal ctermfg=223
" 保存时自动调格式
"au BufWrite * :Autoformat
" 设置剪贴板
set clipboard=unnamedplus
" 透明度
" hi Normal     ctermbg=NONE guibg=NONE
" hi LineNr     ctermbg=NONE guibg=NONE
" hi SignColumn ctermbg=NONE guibg=NONE
"easymotion设置
let g:EasyMotion_do_mapping = 0 " Disable default mappings
nmap s <Plug>(easymotion-overwin-f)
nmap s <Plug>(easymotion-overwin-f2)
let g:EasyMotion_smartcase = 1
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
"当前行加粗显示
set cul

hi CursorLine term=bold cterm=bold ctermfg=NONE ctermbg=NONE



"=============================coc.nvim=================================="
"" TextEdit might fail if hidden is not set.
set hidden
set nobackup
set nowritebackup
" Give more space for displaying messages.
set cmdheight=2
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
set updatetime=300
" Don't pass messages to |ins-completion-menu|.
set shortmess+=c
" Always show the signcolumn, otherwise it would shift the text each time
" diagnostics appear/become resolved.
if has("patch-8.1.1564")
  " Recently vim can merge signcolumn and number column into one
  set signcolumn=number
else
  set signcolumn=yes
endif

" Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
       pumvisible() ? "<C-n>" :
       <SID>check_back_space() ? "<TAB>" :
       coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "<C-p>" : "<C-h>"

function! s:check_back_space() abort
  let col = col('.') - 1
  return !col || getline('.')[col - 1]  =~# 's'
endfunction

" Use <c-space> to trigger completion.
if has('nvim')
  inoremap <silent><expr> <c-space> coc#refresh()
else
  inoremap <silent><expr> <c-@> coc#refresh()
endif

" Make <CR> auto-select the first completion item and notify coc.nvim to
" format on enter, <cr> could be remapped by other vim plugin
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
                              : "<C-g>u<CR><c-r>=coc#on_enter()<CR>"

" Use `[g` and `]g` to navigate diagnostics
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)

" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)

" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>

function! s:show_documentation()
  if (index(['vim','help'], &filetype) >= 0)
    execute 'h '.expand('<cword>')
  elseif (coc#rpc#ready())
    call CocActionAsync('doHover')
  else
    execute '!' . &keywordprg . " " . expand('<cword>')
  endif
endfunction

" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')

" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)

" Formatting selected code.
xmap <leader>f  <Plug>(coc-format-selected)
nmap <leader>f  <Plug>(coc-format-selected)

augroup mygroup
  autocmd!
  " Setup formatexpr specified filetype(s).
  autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
  " Update signature help on jump placeholder.
  autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end

" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a  <Plug>(coc-codeaction-selected)
nmap <leader>a  <Plug>(coc-codeaction-selected)

" Remap keys for applying codeAction to the current buffer.
nmap <leader>ac  <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf  <Plug>(coc-fix-current)

" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)

" Remap <C-f> and <C-b> for scroll float windows/popups.
if has('nvim-0.4.0') || has('patch-8.2.0750')
  nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"
  nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"
  inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "<c-r>=coc#float#scroll(1)<cr>" : "<Right>"
  inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "<c-r>=coc#float#scroll(0)<cr>" : "<Left>"
  vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"
  vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"
endif

" Use CTRL-S for selections ranges.
" Requires 'textDocument/selectionRange' support of language server.
nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select)

" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocAction('format')

" Add `:Fold` command to fold current buffer.
command! -nargs=? Fold :call     CocAction('fold', <f-args>)

" Add `:OR` command for organize imports of the current buffer.
command! -nargs=0 OR   :call     CocAction('runCommand', 'editor.action.organizeImport')

" Add (Neo)Vim's native statusline support.
" NOTE: Please see `:h coc-status` for integrations with external plugins that
" provide custom statusline: lightline.vim, vim-airline.
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}

" Mappings for CoCList
" Show all diagnostics.
nnoremap <silent><nowait> <space>a  :<C-u>CocList diagnostics<cr>
" Manage extensions.
nnoremap <silent><nowait> <space>e  :<C-u>CocList extensions<cr>
" Show commands.
nnoremap <silent><nowait> <space>c  :<C-u>CocList commands<cr>
" Find symbol of current document.
nnoremap <silent><nowait> <space>o  :<C-u>CocList outline<cr>
" Search workspace symbols.
nnoremap <silent><nowait> <space>s  :<C-u>CocList -I symbols<cr>
" Do default action for next item.
nnoremap <silent><nowait> <space>j  :<C-u>CocNext<CR>
" Do default action for previous item.
nnoremap <silent><nowait> <space>k  :<C-u>CocPrev<CR>
" Resume latest coc list.
nnoremap <silent><nowait> <space>p  :<C-u>CocListResume<CR>


"*****************VISTA.VIM********************"
function! NearestMethodOrFunction() abort
  return get(b:, 'vista_nearest_method_or_function', '')
endfunction

set statusline+=%{NearestMethodOrFunction()}

" By default vista.vim never run if you don't call it explicitly.
"
" If you want to show the nearest function in your statusline automatically,
" you can add the following line to your vimrc
autocmd VimEnter * call vista#RunForNearestMethodOrFunction()

效果图

vim 效果图

最后

以上就是正直银耳汤为你收集整理的Vim配置.vimrc文件效果图的全部内容,希望文章能够帮你解决Vim配置.vimrc文件效果图所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(40)

评论列表共有 0 条评论

立即
投稿
返回
顶部