a亚洲精品_精品国产91乱码一区二区三区_亚洲精品在线免费观看视频_欧美日韩亚洲国产综合_久久久久久久久久久成人_在线区

首頁 > 學(xué)院 > 操作系統(tǒng) > 正文

vim配置文件

2024-06-28 16:04:37
字體:
供稿:網(wǎng)友

預(yù)覽

這里寫圖片描述

~/.vimrc

" basic {{set numberset rulerset showcmdset nobackupset noswapfileset cursorlineset autoindentset cindentset smarttabset expandtabset smartindentset wildmenuset hlsearchset nowrapset guifont=monacoset encoding=utf-8set mouse=aset tabstop=4set shiftwidth=4set softtabstop=4set history=1000" }}" leader {{let mapleader=","nmap <leader>w :w<CR>nmap <leader>q :q<CR>nmap <leader>q1 :q!<CR>nmap <leader>wq :wq<CR>nmap <leader>y "+ynmap <leader>p "+pnmap <space> :nmap <C-l> :noh<CR>"buffernmap <leader><Tab> :bn<CR>"strip all trailing whitespace in the current filennoremap <leader>w :%s//s/+$//<cr>:let @/=''<CR>" }}" hightlightsyntax enablesyntax on" color" airline can be display when set thisset t_Co=256set laststatus=2"set background=darkcolorscheme molokai"color molokaifiletype onfiletype indent onfiletype plugin onfiletype plugin indent on" for vundle {{set nocompatiblefiletype offset rtp+=~/.vim/bundle/Vundle.vimcall vundle#rc()" add plugin at therePlugin 'VundleVim/Vundle.vim'Plugin 'vim-airline/vim-airline'Plugin 'vim-airline/vim-airline-themes'Plugin 'scrooloose/nerdtree'Plugin 'nathanaelkane/vim-indent-guides'Plugin 'tpope/vim-fugitive'Plugin 'djoshea/vim-matlab'Plugin 'djoshea/vim-matlab-fold'Plugin 'dracula/vim'Plugin 'terryma/vim-multiple-cursors'Plugin 'kien/ctrlp.vim'Plugin 'majutsushi/tagbar'Plugin 'Valloric/YouCompleteMe'Plugin 'Raimondi/delimitMate'Plugin 'docunext/closetag.vim'Plugin 'scrooloose/nerdcommenter'Plugin 'SirVer/ultisnips'Plugin 'honza/vim-snippets'Plugin 'scrooloose/syntastic'" Plugin 'jeaye/color_coded'Bundle 'ShowTrailingWhitespace'Bundle 'molokai'" plugin end herecall vundle#end()filetype plugin indent on" }}" settings for airlinelet g:airline_theme='luna'let g:airline_powerline_fonts=1let g:solarized_termcolors=16let g:airline#extensions#tabline#enabled = 1let g:airline#extensions#tagbar#enabled = 1let g:airline#extensions#syntastic#enabled = 1let g:airline#extensions#tabline#buffer_idx_mode = 1" tarbarnmap <leader>tb :Tagbar<CR>" settings for nerdtreemap <C-b> :NERDTreeToggle<CR>autocmd StdinReadPRe * let s:std_in=1autocmd StdinReadPre * let s:std_in=1autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endiflet g:NERDTreeDirArrowExpandable = '?'let g:NERDTreeDirArrowCollapsible = '?'" settings for IndentGuideslet g:indent_guides_enable_on_vim_startup = 1let g:indent_guides_auto_colors = 0let g:indent_guides_guide_size = 1autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=3autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=4hi IndentGuidesOdd guibg=red ctermbg=3hi IndentGuidesEven guibg=green ctermbg=4" settings for youcompleteme" highlight Pmenu ctermfg=2 ctermbg=3 guifg=#005f87 guibg=#EEE8D5" highlight PmenuSel ctermfg=2 ctermbg=3 guifg=#AFD700 guibg=#106900let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'set completeopt=longest,menu "讓Vim的補(bǔ)全菜單行為與一般IDE一致(參考VimTip1228)autocmd InsertLeave * if pumvisible() == 0|pclose|endif "離開插入模式后自動關(guān)閉預(yù)覽窗口inoremap <expr> <CR> pumvisible() ? "/<C-y>" : "/<CR>" "回車即選中當(dāng)前項" youcompleteme 默認(rèn)tab s-tab 和自動補(bǔ)全沖突let g:ycm_key_list_select_completion=['<c-n>']" let g:ycm_key_list_select_completion = ['Down']let g:ycm_key_list_previous_completion=['<c-p>']" let g:ycm_key_list_previous_completion = ['<Up>']let g:ycm_confirm_extra_conf=0 "關(guān)閉加載.ycm_extra_conf.py提示let g:ycm_key_invoke_completion = '<C-a>' " 強(qiáng)制補(bǔ)全let g:ycm_collect_identifiers_from_tags_files=1 " 開啟 YCM 基于標(biāo)簽引擎let g:ycm_min_num_of_chars_for_completion=2 " 從第2個鍵入字符就開始羅列匹配項let g:ycm_cache_omnifunc=0 " 禁止緩存匹配項,每次都重新生成匹配項let g:ycm_seed_identifiers_with_syntax=1 " 語法關(guān)鍵字補(bǔ)全nnoremap <F5> :YcmForceCompileAndDiagnostics<CR> "force recomile with syntastic" nnoremap <leader>lo :lopen<CR> "open locationlist" nnoremap <leader>lc :lclose<CR> "close locationlistinoremap <leader><leader> <C-x><C-o>let g:ycm_complete_in_comments = 1let g:ycm_complete_in_strings = 1let g:ycm_collect_identifiers_from_comments_and_strings = 0nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR> " 跳轉(zhuǎn)到定義處" imap { {}<ESC>i<CR><ESC>V<O" settings for nerdcommenter" Add spaces after comment delimiters by defaultlet g:NERDSpaceDelims = 1" Use compact syntax for prettified multi-line commentslet g:NERDCompactSexyComs = 1" Align line-wise comment delimiters flush left instead of following code indentationlet g:NERDDefaultAlign = 'left'" Set a language to use its alternate delimiters by defaultlet g:NERDAltDelims_java = 1" Add your own custom formats or override the defaultslet g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } }" Allow commenting and inverting empty lines (useful when commenting a region)let g:NERDCommentEmptyLines = 1" Enable trimming of trailing whitespace when uncommentinglet g:NERDTrimTrailingWhitespace = 1" for ultisnipslet g:UltiSnipsExpandTrigger="<tab>"let g:UltiSnipsJumpForwardTrigger="<c-b>"let g:UltiSnipsJumpBackwardTrigger="<c-z>"" syntasticlet g:syntastic_error_symbol = '?'let g:syntastic_warning_symbol = '?'" color code" hi link StructDecl Type" hi link UnionDecl Type" hi link ClassDecl Type" hi link EnumDecl Type

youcompleteme配置文件

# Copyright (C) 2014 Google Inc.## This file is part of ycmd.## ycmd is free software: you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation, either version 3 of the License, or# (at your option) any later version.## ycmd is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with ycmd. If not, see <http://www.gnu.org/licenses/>.import osimport ycm_core# These are the compilation flags that will be used in case there's no# compilation database set (by default, one is not set).# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.flags = ['-Wall','-Wextra','-Werror','-fexceptions','-DNDEBUG',# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which# language to use when compiling headers. So it will guess. Badly. So C++# headers will be compiled as C headers. You don't want that so ALWAYS specify# a "-std=<something>".# For a C project, you would set this to something like 'c99' instead of# 'c++11'.'-std=c++11',# ...and the same thing goes for the magic -x option which specifies the# language that the files to be compiled are written in. This is mostly# relevant for c++ headers.# For a C project, you would set this to 'c' instead of 'c++'.'-x','c++','-isystem','/usr/include','-isystem','/usr/local/include','-isystem','/applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1','-isystem','/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include',# 注意下面把的庫文件根據(jù)你的系統(tǒng)修改# 格式和下面類似一個'-isystem'一個庫地址'-isystem','/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.3.1/../../../../include/c++/6.3.1','-isystem','/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.3.1/../../../../include/c++/6.3.1/x86_64-pc-linux-gnu','-isystem','/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.3.1/../../../../include/c++/6.3.1/backward','-isystem','/usr/local/include','-isystem','/usr/bin/../lib/clang/3.9.1/include','-isystem','/usr/include',]# Set this to the absolute path to the folder (NOT the file!) containing the# compile_commands.json file to use that instead of 'flags'. See here for# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html## Most projects will NOT need to set this to anything; you can just change the# 'flags' list of compilation flags.compilation_database_folder = ''if os.path.exists( compilation_database_folder ): database = ycm_core.CompilationDatabase( compilation_database_folder )else: database = NoneSOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]def DirectoryOfThisScript(): return os.path.dirname( os.path.abspath( __file__ ) )def MakeRelativePathsInFlagsAbsolute( flags, working_directory ): if not working_directory: return list( flags ) new_flags = [] make_next_absolute = False path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ] for flag in flags: new_flag = flag if make_next_absolute: make_next_absolute = False if not flag.startswith( '/' ): new_flag = os.path.join( working_directory, flag ) for path_flag in path_flags: if flag == path_flag: make_next_absolute = True break if flag.startswith( path_flag ): path = flag[ len( path_flag ): ] new_flag = path_flag + os.path.join( working_directory, path ) break if new_flag: new_flags.append( new_flag ) return new_flagsdef IsHeaderFile( filename ): extension = os.path.splitext( filename )[ 1 ] return extension in [ '.h', '.hxx', '.hpp', '.hh' ]def GetCompilationInfoForFile( filename ): # The compilation_commands.json file generated by CMake does not have entries # for header files. So we do our best by asking the db for flags for a # corresponding source file, if any. If one exists, the flags for that file # should be good enough. if IsHeaderFile( filename ): basename = os.path.splitext( filename )[ 0 ] for extension in SOURCE_EXTENSIONS: replacement_file = basename + extension if os.path.exists( replacement_file ): compilation_info = database.GetCompilationInfoForFile( replacement_file ) if compilation_info.compiler_flags_: return compilation_info return None return database.GetCompilationInfoForFile( filename )# This is the entry point; this function is called by ycmd to produce flags for# a file.def FlagsForFile( filename, **kwargs ): if database: # Bear in mind that compilation_info.compiler_flags_ does NOT return a # python list, but a "list-like" StringVec object compilation_info = GetCompilationInfoForFile( filename ) if not compilation_info: return None final_flags = MakeRelativePathsInFlagsAbsolute( compilation_info.compiler_flags_, compilation_info.compiler_working_dir_ ) else: relative_to = DirectoryOfThisScript() final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to ) return { 'flags': final_flags }

安裝命令如下

# 首先安裝cmake和clang # 把上面的vimrc復(fù)制到你的vimrc # 編輯.ycm_extra_conf.py到$HOME/ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim # 第一次進(jìn)入會因為找不到mololai而報錯,忽略即可 vim +PluginInstall +qall cp -r $HOME/.vim/bundle/molokai/colors ../../ $HOME/.vim/bundle/YouCompleteMe/install.sh --clang-completer --system-libclang
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 九九热在线免费视频 | 奇米色欧美一区二区三区 | 成人福利在线观看 | 国产精品久久久久久久久久三级 | 久久久久久亚洲精品 | 国产精品第一国产精品 | 91精品久久久久 | 久久一级 | 成人精品久久久 | 免费观看一级特黄欧美大片 | 久久精品在线免费观看 | 大陆一级毛片免费视频观看 | 国产一级特黄aaa大片评分 | 欧美一级高清在线 | 欧美一区二区三区精品免费 | 国产精品视频不卡 | 一区不卡在线 | 青青久久久 | 成全视频免费观看在线看黑人 | 黄91视频 | 国产精品乱码一区二区三区 | 日韩一区二区三区在线观看 | 成人午夜av| 日本在线视频不卡 | 中文字幕免费视频观看 | 黄频免费在线观看 | 欧美日韩视频在线观看免费 | 久久久久中文字幕 | 国产一区二区三区四区五区 | 精品一区二区在线观看 | 色网站视频 | 日本中文字幕在线看 | 欧美日韩精品综合 | 欧美一区二区在线视频 | 极品av | 国产高清一区 | www.99精品 | 精品久久久久久久久久久久久久 | 日本欧美视频 | www.黄色片视频 | 免费毛片a线观看 |