当前位置:K88软件开发文章中心编程工具Vim → 文章内容

vim配置.vimrc方案2

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-24 10:53:10

由 路飞 创建, 最后一次修改 2016-08-24 " Modeline and Notes {" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell:"" __ _ _____ _" ___ _ __ / _/ |___ / __ __(_)_ __ ___" / __| '_ \| |_| | |_ \ _____\ \ / /| | '_ ` _ \" \__ \ |_) | _| |___) |_____|\ V / | | | | | | |" |___/ .__/|_| |_|____/ \_/ |_|_| |_| |_|" |_|"" This is the personal .vimrc file of Steve Francia." While much of it is beneficial for general use, I would" recommend picking out the parts you want and understand."" You can find me at http://spf13.com"" Copyright 2014 Steve Francia"" Licensed under the Apache License, Version 2.0 (the "License");" you may not use this file except in compliance with the License." You may obtain a copy of the License at"" http://www.apache.org/licenses/LICENSE-2.0"" Unless required by applicable law or agreed to in writing, software" distributed under the License is distributed on an "AS IS" BASIS," WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied." See the License for the specific language governing permissions and" limitations under the License." }" Environment { " Identify platform { silent function! OSX() return has('macunix') endfunction silent function! LINUX() return has('unix') && !has('macunix') && !has('win32unix') endfunction silent function! WINDOWS() return (has('win32') || has('win64')) endfunction " } " Basics { set nocompatible " Must be first line if !WINDOWS() set shell=/bin/sh endif " } " Windows Compatible { " On Windows, also use '.vim' instead of 'vimfiles'; this makes synchronization " across (heterogeneous) systems easier. if WINDOWS() set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after endif " } " Arrow Key Fix { " https://github.com/spf13/spf13-vim/issues/780 if &term[:4] == "xterm" || &term[:5] == 'screen' || &term[:3] == 'rxvt' inoremap <silent> <C-[>OC <RIGHT> endif " }" }" Use before config if available { if filereadable(expand("~/.vimrc.before")) source ~/.vimrc.before endif" }" Use bundles config { if filereadable(expand("~/.vimrc.bundles")) source ~/.vimrc.bundles endif" }" General { set background=dark " Assume a dark background " Allow to trigger background function! ToggleBG() let s:tbg = &background " Inversion if s:tbg == "dark" set background=light else set background=dark endif endfunction noremap <leader>bg :call ToggleBG()<CR> " if !has('gui') "set term=$TERM " Make arrow and other keys work " endif filetype plugin indent on " Automatically detect file types. syntax on " Syntax highlighting set mouse=a " Automatically enable mouse usage set mousehide " Hide the mouse cursor while typing scriptencoding utf-8 if has('clipboard') if has('unnamedplus') " When possible use + register for copy-paste set clipboard=unnamed,unnamedplus else " On mac and Windows, use * register for copy-paste set clipboard=unnamed endif endif " Most prefer to automatically switch to the current file directory when " a new buffer is opened; to prevent this behavior, add the following to " your .vimrc.before.local file: " let g:spf13_no_autochdir = 1 if !exists('g:spf13_no_autochdir') autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif " Always switch to the current file directory endif "set autowrite " Automatically write a file when leaving a modified buffer set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter') set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility set virtualedit=onemore " Allow for cursor beyond last character set history=1000 " Store a ton of history (default is 20) set spell " Spell checking on set hidden " Allow buffer switching without saving set iskeyword-=. " '.' is an end of word designator set iskeyword-=# " '#' is an end of word designator set iskeyword-=- " '-' is an end of word designator " Instead of reverting the cursor to the last position in the buffer, we " set it to the first line when editing a git commit message au FileType gitcommit au! BufEnter COMMIT_EDITMSG call setpos('.', [0, 1, 1, 0]) " http://vim.wikia.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session " Restore cursor to file position in previous editing session " To disable this, add the following to your .vimrc.before.local

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  下一页


vim配置.vimrc方案2