前言:
此刻大家对“darkgraycss编号”大致比较关心,兄弟们都需要了解一些“darkgraycss编号”的相关资讯。那么小编同时在网上收集了一些关于“darkgraycss编号””的相关资讯,希望姐妹们能喜欢,同学们快快来了解一下吧!Vim的使用
vim基本操作
移动光标
下面操作均需处在一般模式(默认的模式)下:
h j k l 分别为“左”“下”“上”“右”翻半页:Ctrl + d(d for down),Ctrl + u(u for up)。翻一页:Ctrl + f(f for front),Ctrl + b(b for back)。gg表示移到到首行。G表示移动到尾行。nG(n指的是数字)表示移动到第n行;一般用于根据程序错误提示信息进行 bug fix。0表示移到光标所在行的行首; $表示移动到光标所在行的行尾。
复制剪切粘贴
按yy复制光标所在行。按dd剪切光标所在行,如果光剪切不粘贴,那就相当于删除。按p将复制/剪切的内容粘贴至光标后,因为光标是在具体字符的位置上,所以实际是在该字符的后面;整行的复制粘贴在游标的下一行。
v模式相关
按v切换到“高亮选择模式”,移动光标进行选择。在v模式下,按y(y for yank)复制高亮选择的内容。在v模式下,按d剪切高亮选择的内容,如果光剪切不粘贴,那就相当于删除。
撤销、重做
以下仅讨论vim下的操作(vi的操作稍有不同):
按u进行撤销,可多次撤销。按Ctrl + r(r for redo)进行重做,可多次重做。
进入编辑模式
下面所有操作均需在一般模式下执行:
i,在当前光标所在字符前插入。o,在当前光标所在行的下一行插入新的一行。O,在当前光标所在行的上一行插入新的一行。
查找和替换字符串
下面所有操作均需在一般模式下执行:
/word,向下查找一个字符串word,查找后按n看下一匹配结果,按N看上一匹配结果。?word,向上查找一个字符串word,查找后按n看下一匹配结果,按N看上一匹配结果。:s/word1/word2/g,查找word1并替换为word2,/g表示全文替换,不加则只替换每行的第一个匹配项。:n1,n2s/word1/word2/g,在n1和n2行之间查找word1并替换为word2,其中n1、n2皆可取数字,另外n2可取$表示最后一行。
行号相关
:set nu表示显示行号。:set nonu表示不显示行号。
保存及退出
:w,保存文本。:q,退出vim。:w!,强制保存,在root用户下,即使文本只读也可以完成保存。:q!,强制退出,所有改动不生效。:wq,保存并退出。
vim插件
下载Vundle
$ git clone ~/.vim/bundle/Vundle.vim
配置插件
$ vim ~/.vimrcset nocompatible " be iMproved, requiredfiletype off " requiredset rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()Plugin 'VundleVim/Vundle.vim'Plugin 'tpope/vim-fugitive'Plugin 'git://git.wincent.com/command-t.git'Plugin ''Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}call vundle#end() " requiredfiletype plugin indent on " required
安装插件
复制
$ vim:PluginInstall
或者
复制
$ vim +PluginInstall +qall
然后会出现如下图一样的界面
然后慢慢等!慢慢等!慢慢等!这里敲黑板,画圈圈记起来,笔者当年就是进入这个界面一脸懵逼发现不会动就Ctrl+C了,然后就以为自己配置失败了 o_O。
仔细看,最左边正在安装的有个>符号,新增的插件有个+符号,左下角的英文也是已经相当明白了!
一键安装?
没错,我知道你懒,所以这里提供了一键安装,移步这里一键安装
将我的仓库拉到你的本地
$ git clone ~/.oh-my-zsh安装
$ cd ~/.oh-my-zsh$ ./install.sh -----------------------------warning-------------------------| The installation is successful, please execute || source ~/.zshrc | -------------------------------end---------------------------
该脚本会安装vim,配置zshrc/vimrc
这里贴出我的配置
$ vim ~/.vimrcset nocompatible " be iMproved, requiredfiletype off " required" set the runtime path to include Vundle and initializeset rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()" alternatively, pass a path where Vundle should install plugins"call vundle#begin('~/some/path/here')" let Vundle manage Vundle, requiredPlugin 'VundleVim/Vundle.vim'" NERD-treePlugin 'scrooloose/nerdtree'Plugin 'majutsushi/tagbar'Plugin 'fholgado/minibufexpl.vim'Plugin 'godlygeek/tabular'Plugin 'plasticboy/vim-markdown'Plugin 'jeroenbourgois/vim-actionscript'Plugin 'cespare/mxml.vim'Plugin 'vim-scripts/xmledit'Plugin 'msanders/cocoa.vim'Plugin 'Yggdroot/indentLine'Plugin 'tfnico/vim-gradle'Plugin 'adragomir/javacomplete'Plugin 'scrooloose/syntastic'Plugin 'flazz/vim-colorschemes'Plugin 'molok/vim-smartusline'Plugin 'bpdp/vim-java'Plugin 'mattn/emmet-vim'Plugin 'vim-airline/vim-airline'Plugin 'vim-airline/vim-airline-themes'" All of your Plugins must be added before the following linecall vundle#end() " requiredfiletype plugin indent on " required" To ignore plugin indent changes, instead use:"filetype plugin on"" Brief help" :PluginList - lists configured plugins" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate" :PluginSearch foo - searches for foo; append `!` to refresh local cache" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal"" see :h vundle for more details or wiki for FAQ" Put your non-Plugin stuff after this line"=============================================================================" General settings"=============================================================================highlight OverLength ctermbg=blue ctermfg=whiteset colorcolumn=120set nocp" Tab relatedset ts=4set sw=4set smarttabset etset ambiwidth=double" Format relatedset tw=0set lbrset fo+=mB" Indent relatedset cinset aiset cino=:0g0t0(susj1" Editing relatedset backspace=indent,eol,startset whichwrap=b,s,<,>,[,]set mouse=set selectmode=set mousemodel=popupset keymodel=set selection=inclusive" Miscset wildmenuset nospell" Encoding relatedset encoding=utf-8"set langmenu=zh_CN.UTF-8"language message zh_CN.UTF-8set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1" File type relatedfiletype plugin indent onau BufRead *.as set filetype=actionscript etau BufRead *.mxml set filetype=mxml etau BufRead *.mml set filetype=mathml et" Display relatedset ruset nuset smset hlsset nowrapsyntax on" Refer to: ofu=syntaxcomplete#Complete"if (has("gui_running"))" colo bluegreen"else" colo bluegreen"endif" Default Colors for CursorLinehighlight CursorLine ctermbg=Blue ctermfg=Yellow" Change Color when entering Insert Modeautocmd InsertEnter * highlight CursorLine ctermbg=Darkgray ctermfg=Red"Revert Color to default when leaving Insert Modeautocmd InsertLeave * highlight CursorLine ctermbg=Blue ctermfg=Yellow" autocmd vimenter * NERDTreeautocmd vimenter * if !argc() | NERDTree | endifautocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endiflet g:NERDTreeDirArrows=0let g:NERDTreeWinSize=30au BufRead,BufNewFile *.gradle set filetype=groovy" set foldmethod=indent" set foldnestmax=2let g:indentLine_leadingSpaceEnabled=1let g:indentLine_leadingSpaceChar='.'let g:indentLine_color_term=7let g:indentLine_color_gui='#FFB3B3'" let g:indentLine_char = '|'hi Modified guifg=black guibg=#FFA500set statusline=%2.2n\ %t\ %h%#Modified#%m%r%*%=%l%L\ %2c\ %Plet g:smartusline_string_to_highlight='%2.2n %t %h'au BufNewFile,BufRead *.groovy setf groovyau BufNewFile,BufRead *.gradle setf groovyif (has("autocmd")) autocmd Filetype java setlocal omnifunc=javacomplete#Completeendif" ============================================================================" Shortcuts" ============================================================================" Escape arrow in puttymap <Esc>[A <C-Up>map <Esc>[B <C-Down>map <Esc>[C <C-Right>map <Esc>[D <C-Left>map! <Esc>[A <C-Up>map! <Esc>[B <C-Down>map! <Esc>[D <C-Left>map! <Esc>[C <C-Right>" Move linesnmap <C-Down> :move .+1<CR>nmap <C-Up> :move .-2<CR>" Toggle line numbernmap <F12> :set nu!<CR>imap <F12> :set nu!<CR>" Toggle NERDTree windownmap <silent> <F9> :NERDTreeToggle<CR>nmap <silent> <C-O> :NERDTreeToggle<CR><ESC>" miniBufExploer configlet g:miniBufExplMapWindowNavVim=1let g:miniBufExplMapWindowNavArrows=1let g:miniBufExplMapCTabSwitchBufs=1let g:miniBufExplModSelTarget=1" buffer changenmap <S-Tab> :bn<CR>nmap <S-Left> :bp<CR>nmap <S-Right> :bn<CR>" Toggle Tagbarnmap <C-t> :TagbarToggle<CR>"=============================================================================" Modes"=============================================================================function EnglishMode() "set imactivatekey= "set noimcmdline "set iminsert=0 "set imsearch=0 setlocal nospellendfunctioncommand -nargs=0 EnglishMode call EnglishMode()function ChineseMode() "set imactivatekey=C-space "set noimcmdline "set iminsert=2 "set imsearch=2 setlocal nospellendfunctioncommand -nargs=0 ChineseMode call ChineseMode()function TextMode() setlocal nocin setlocal nosm setlocal noai setlocal tw=0endfunctioncommand -nargs=0 TextMode call TextMode()function CodeMode() setlocal cin setlocal sm setlocal ai setlocal tw=0endfunctioncommand -nargs=0 CodeMode call CodeMode()function MailMode() call TextMode() setlocal ft=mail setlocal tw=0endfunctioncommand -nargs=0 MailMode call MailMode()function BBSMode() call MailMode() call ChineseMode() setlocal ft=bbs setlocal fenc=cp936 setlocal tw=0endfunctioncommand -nargs=0 BBSMode call BBSMode()function VikiMode() call ChineseMode() setlocal ft=vikiendfunctioncommand -nargs=0 VikiMode call VikiMode()"=============================================================================" Functions"=============================================================================function TimeStamp() let curposn= SaveWinPosn() %s/\$Date: .*\$/\=strftime("$Date: %Y-%m-%d %H:%M:%S$")/ge %s/Last Change: .*$/\=strftime("Last Change: %Y-%m-%d %H:%M:%S")/ge %s/Last Modified: .*$/\=strftime("Last Modified: %Y-%m-%d %H:%M:%S")/ge " Replace once and never update. %s/Created: *$/\=strftime("Created: %Y-%m-%d %H:%M:%S")/ge call RestoreWinPosn(curposn)endfunctioncommand -nargs=0 TimeStamp call TimeStamp()function AutoTimeStamp() augr tagdate au! au BufWritePre,FileWritePre * call TimeStamp() augr ENDendfunctioncommand -nargs=0 AutoTimeStamp call AutoTimeStamp()function NoAutoTimeStamp() augr tagdate au! augr ENDendfunctioncommand -nargs=0 NoAutoTimeStamp call NoAutoTimeStamp()command -nargs=1 Margin exec "match Error /.\\%>" . (<args> + 1) . "v/"command -nargs=0 NoMargin match nonefunction CodeLayout() call CodeMode() WManager Tlistendfunctioncommand -nargs=0 CodeLayout call CodeLayout()function CodeLayoutSmall() call CodeLayout() set columns=141 exec "norm \<c-w>l" set nu set lines=100endfunctioncommand -nargs=0 CodeLayoutSmall call CodeLayoutSmall()function CodeLayoutLarge() call CodeLayout() set columns=226 exec "norm \<c-w>l" set nu vsplit set lines=100endfunctioncommand -nargs=0 CodeLayoutLarge call CodeLayoutLarge()" ============================================================================" Plugins settings" ============================================================================" Tlistlet Tlist_Use_Right_Window=1let Tlist_File_Fold_Auto_Close=1" Alet g:alternateNoDefaultAlternate=1let g:alternateRelativeFiles=1" Vikilet g:vikiNameSuffix=".viki"autocmd! BufRead,BufNewFile *.viki call VikiMode()" BBSautocmd! BufRead,BufNewFile *.bbs call BBSMode()" Mailautocmd! FileType mail call MailMode()" XMLautocmd! FileType html,xml,yaml setlocal sw=2 ts=2" FencViewlet g:fencview_autodetect=0"=============================================================================" Platform dependent settings"=============================================================================if (has("win32")) "------------------------------------------------------------------------- " Win32 "------------------------------------------------------------------------- if (has("gui_running")) set guifont=Bitstream_Vera_Sans_Mono:h9:cANSI set guifontwide=NSimSun:h9:cGB2312 endif " For Viki let g:netrw_browsex_viewer="start" " For tee set shellpipe=2>&1\|\ tee " VimTweak if (has("gui_running")) command -nargs=1 SetAlpha call libcallnr("vimtweak.dll", \"SetAlpha", <args>) command -nargs=0 TopMost call libcallnr("vimtweak.dll", \"EnableTopMost", 1) command -nargs=0 NoTopMost call libcallnr("vimtweak.dll", \"EnableTopMost", 0) endifelse "------------------------------------------------------------------------- " Linux "------------------------------------------------------------------------- if (has("gui_running")) set guifont=Bitstream\ Vera\ Sans\ Mono\ 9 endif " For Viki let g:vikiHomePage="~/document/Viki/index.viki" let g:netrw_browsex_viewer="kfmclient exec" set makeprg=buildendif
标签: #darkgraycss编号