Assume that GVIM is installed in the d directory GVIM.
First, find the Directory D: \ GVIM \ GVimPortable \ App \ DefaultData \ settings, which contains a file vimrc, which is basically the same as vimrc In ubuntu, but some places are not the same. Because the program in vimrc in GVIM makes the gvim interface have menus and other things, I can only add vimrc in linux at the end,
Then paste all my own configuration, configuration file details please see the previous blog http://www.cnblogs.com/yejinru/archive/2012/11/19/2777970.html
However, an error is reported in line 84-85:
So we need to comment it out.
" command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis" \ | wincmd p | diffthis
Then we found that the menu bar of vimrc disappears. We looked down with a line of code and found that the menu was commented out by lines 366 to lines 377 (the following code) on my configuration, then we can just comment them out.
"""""""""""""""""""""""""""""""""""""""" "Menu bar, toolbar display and hide switch """""""""""""""""""" "set guioptions-= Tset guioptions-= mmap <silent> <F4>: if & guioptions = ~ # 'T' <Bar> \ set guioptions-= T <Bar> \ set guioptions-= m <bar> \ else <Bar> \ set guioptions + = T <Bar> \ set guioptions + = m <Bar> \ endif <CR>
At this time, although the menu bar came out, it was found that the text of the menu changed from the original Chinese characters to garbled characters --
In desperation, we continue to change.
Find the first line (my configuration file)
set encoding=utf-8set termencoding=utf-8set fileencodings=utf-8,chinese,latin-1
It is found that he uses UTF-8 code, but not this encoding in gvim, so just comment them out.
At this time, basically synchronize the configuration file under my ubuntu to the wim under the cmd_^
However, the F9 can be directly compiled and run on ubuntu. Under wim, I found that even if the environment variable is added, it still cannot be compiled and run directly. If anyone knows, add ^.
The font size is set as follows:
"Set guifont = Courier \ New: h16 font size
Attach my GVIM vimrc File
"An example for a vimrc file. "" Maintainer: Bram Moolenaar <Bram@vim.org> "Last change: 2006 Nov 16" "To use it, copy it to" for Unix and OS/2 :~ /. Vimrc "for Amiga: s :. vimrc "for MS-DOS and Win32: $ VIM \ _ vimrc" for OpenVMS: sys $ login :. vimrc "When started as" evim ", evim. vim will already have done these settings. if v: progname = ~? "Evim" finishendif "Use Vim settings, rather then Vi settings (much better !). "This must be first, because it changes other options as a side effect. set nocompatible "allow backspacing over everything in insert modeset backspace = indent, eol, startif has (" vms ") set nobackup" do not keep a backup file, use versions insteadelse set backup "keep a backup fileendifset history = 50" keep 50 lines of command line historyset Rory "show the cursor position all the timeset showcmd" disp Lay incomplete commandsset incsearch "do incremental searching" For Win32 GUI: remove 't'flag from 'guioptions': no tearoff menu entries "let & guioptions = substitute (& guioptions, "t", "", "g") "Don't use Ex mode, use Q for formattingmap Q gq" In using terminal emulators the mouse works just fine, thus enable it. set mouse = a "Switch syntax highlighting on, when the terminal has colors" Also switch On highlighting the last used search pattern. if & t_Co> 2 | has ("gui_running") syntax on set hlsearchendif "Only do this part when compiled with support for autocommands. if has ("autocmd") "Enable file type detection. "Use the default filetype settings, so that mail gets 'tw 'set to 72," 'cindent' is on in C files, etc. "Also load indent files, to automatically do language-dependent indenting. Filetype plugin indent on "Put these in an autocmd group, so that we can delete them easily. augroup vimrcEx au! "For all text files set 'textidth' to 78 characters. autocmd FileType text setlocal textwidth = 78 "When editing a file, always jump to the last known cursor position. "Don't do it when the position is invalid or when inside an event handler" (happens when dropping a file on gvim ). autocmd BufReadPost * \ if line ("'\" ")> 0 & line ("' \ "") <= line ("$") | \ exe "normal! G' \ "" | \ endif augroup ENDelse set autoindent "always set autoindenting onendif" has ("autocmd ") "Convenient command to see the difference between the current buffer and the" file it was loaded from, thus the changes you made. "command DiffOrig vert new | set bt = nofile | r # | 0d _ | diffthis" \ | wincmd p | diffthis "here" sets the font size set guifont = Courier \ New: h16 "set encoding = UTF-8" set termencoding = UTF-8 "set fileencodings = UTF-8, chinese, latin-1if has (" win32 ") set fileencoding = chineseelse set fileencoding = utf-8endiflanguage messages zh_CN.utf-8 "set not with previous versions and set nocompatible" set color scheme colorscheme ir_black "show row set nu" detect file type filetype on "set when File when changed, the system automatically loads set autoread "records the number of historical rows set history = 100" display syntax highlighting syntax enablesyntax on "when processing unsaved or read-only files, pop-up confirmation set confirm "share clipboard with windows set clipboard + = unnamed" Load file type plug-in fil Etype plugin on "load the relevant indent file filetype indent on for a specific file type" Save the global variable set viminfo + =! "Do not use line breaks to separate words with the following symbols: set iskeyword + =_, $, @, % ,#, -"set mouse always available set mouse = a" highlight current row set cursorline "command line height set height Height = 1" the prompt set shortmess = atI for children in Somalia is not displayed at startup "set noerrorbells" is blank between Split windows, easy to read: set fillchars = vert: \, stl: \, stlnc: """""""" "Do Not Back Up Files (do not back up files when overwriting files) set nobackup "do not generate swap files. When the buffer is discarded, hide the pixels inserted between setlocal noswapfileset bufhidden = hide" characters. Number of lines set linespace = 0 "command line in enhanced mode automatically complete operation set wildmenu" set paste mode, so that the paste is not misplaced "set paste" save the file, ctrl + S: "nmap <C-s> <esc>: w <CR>" imap <C-s> <esc>: w <CR> noremap <C-S>: update <CR> vnoremap <C-S> <C-C>: update <CR> inoremap <C-S> <C-O>: update <CR> """""""""""""""""""""""""""""""""""" "Search and match """ """""""""""""""""""""""""""""""""""""""" "highlight matching parentheses set showmatch" high Highlight the found sentence (phrases) "set hlsearch". When searching, the entered words are highlighted by character (similar to firefox search ), that is, when you enter the search content, the search result set incsearch is displayed. The case-insensitive set ignorecase is ignored during search. Do not flash set novisualbell """"""""""""""""" """""""""""""""""""""""""""""""""""""""" "text format and layout """"""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" "automatic formatting set formatoptions = tcrqn" inherits the indent of the previous line, it is especially suitable for multi-line annotation set autoindent "providing automatic indentation for C programs set smartindent" using C-style indent set cindent "Tab: 4 set tabstop = 4" unified indent: 4 "enables you to delete four spaces at a time when you press the backspace key set softtabstop = 4" set <and> width when the command is moved for 4 set shiftwidth = 4 "do not use spaces instead of the tab set noexpandtab" set 80 characters in each line to automatically wrap set textwidth = 80 "automatically switch the current directory to the directory where the current file is located set autochdir" fold code set foldmethod = syntax "when a file is opened, set foldlevel = 100 """""""""""""""""""""""""" "automatic instance brackets """"""""""""""""""" "inoremap (() <ESC> iinoremap) <c-r> = ClosePair (') <CR> Inoremap {{}< ESC> iinoremap} <c-r> = ClosePair ('}') <CR> inoremap [[] <ESC> iinoremap] <c-r> = ClosePair (']') <CR> inoremap ''' <ESC> iinoremap "<ESC> ifunction ClosePair (char) if getline ('. ') [col ('. ')-1] = a: char return "\ <Right>" else return: char endifendf """""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" "set mapleader """""""""""""""""""""""""""""" """""""""""" """""""""""""""""""""""""""""""""""""""" "Let mapleader = ", "" platformfunction! MySys () if has ("win32") return "windows" else return "linux" endifendfunction "if file not opened, create a new tab, or switch to the opened filefunction! SwitchToBuf (filename) "find in current tab let bufwinnr = bufwinnr (a: filename) if bufwinnr! =-1 exec bufwinnr. "wincmd w" return else "search each tab tabfirst let tb = 1 while tb <= tabpagenr (" $ ") let bufwinnr = bufwinnr (a: filename) if bufwinnr! =-1 exec "normal ". tb. "gt" exec bufwinnr. "wincmd w" return endif tabnext let tb = tb + 1 endwhile "not exist, new tab exec" tabnew ". a: filename endifendfunction "fast edit. vimrcif MySys () = 'linux '"fast reloading of. vimrc map <silent> <leader> ss: source ~ /. Vimrc <cr> "fast editing of the. vimrc map <silent> <leader> ee: call SwitchToBuf ("~ /. Vimrc ") <cr>" when. vimrc is edited, reload it autocmd! Bufwritepost. vimrc source ~ /. Vimrcelseif MySys () = 'windows' "Set helplang set helplang = cn" Fast reloading of the _ vimrc map <silent> <leader> ss: source ~ /_ Vimrc <cr> "Fast editing of _ vimrc map <silent> <leader> ee: call SwitchToBuf ("~ /_ Vimrc ") <cr>" When _ vimrc is edited, reload it autocmd! Bufwritepost _ vimrc source ~ /_ Vimrcendifif MySys () = 'windows' source $ VIMRUNTIME/mswin. vim behave mswinendif """"""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" """"""""""" """""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" "Add project to allow access to ctags """"""""""""""""""""""""""""" the project after "" project1 "set tags = tagsset autochdir" is added to the tags variable """"""""""""""""""""""" "set Taglist """""""""""""""""""""""""""""" "sort by name let Tlist_Sort_Type =" name "" display the window on the right. let Tlist_Use_left_Window = 1 "if there is only one buffer, the kill window also kill bufferlet Tlist_Exist_OnlyWindow = 1 "so that the taglist displays only the tags of the current file, and the tags of other files are collapsed (when the tags of multiple files are displayed at the same time) let Tlist_File_Fold_Auto_Close = 1 "Do Not Display The folding tree let Tlist_Enable_Fold_Column = 1 "does not display the tags of multiple files at the same time, only show the current file's let Tlist_Show_One_File = 1" keyboard ing nmap tl: tlistToggle <cr> """""""""""""""""""""""""""""""""""" "sets winManager to manage netrw and Taglist. """""""""""""""""""""""""""""""""""""""" "Let g: winManagerWindowLayout = "FileExplorer | TagList" let g: persistentBehaviour = 0let g: winManagerWidth = 30let g: defaultExplorer = 0 nmap <C-W> <C-F>: firstExplorerWindow <cr> nmap <C-W> <C-B>: BottomExplorerWindow <cr> "nmap <silent> <F8>: WMToggle <cr> nmap wm: WMToggle <cr> "set netrw" let g: netrw_winsize = 30 "nmap <silent> <leader> f E: Sexplore! <Cr> "let Tlist_File_Fold_Auto_Close = 1" quickly switch header files/source files "nnoremap <silent> <F12>: A <cr>" "nmap <silent> <F12>: A <CR> "Quickly search for" nnoremap <silent> <F3>: grep <cr> "set MiniBufExploer """ "quickfix mode autocmd FileType c, cpp map <buffer> <leader> <space>: w <cr>: make <cr> """""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" """""""""""""""""""""" "F5 "compile and run C ++ program "F6 compile and run C program """""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" "C: Compile and run map <F6>: call CompileRunGcc () <CR> func! CompileRunGcc () exec "w" exec "! Gcc %-o % <"exec "! ./% <"Endfunc" C ++ compilation and running map <F5>: call CompileRunGpp () <CR> func! CompileRunGpp () exec "w" exec "! G ++ %-o % <"exec "!. /% <"Endfunc source $ VIMRUNTIME/vimrc_example.vimsource $ VIMRUNTIME/mswin. vimbehave mswinset diffexpr = MyDiff () function MyDiff () let opt = '-a -- binary' if & diffopt = ~ 'Icase' | let opt = opt. '-I' | endif if & diffopt = ~ 'Iwhite' | let opt = opt. '-B' | endif let arg1 = v: fname_in if arg1 = ~ ''| Let arg1 = '"'. arg1. '"' | endif let arg2 = v: fname_new if arg2 = ~ ''| Let arg2 = '"'. arg2. '"' | endif let arg3 = v: fname_out if arg3 = ~ ''| Let arg3 = '"'. arg3. '"' | endif let eq ='' if $ VIMRUNTIME = ~ ''If & sh = ~ '\ <Cmd' let cmd = '""'. $ VIMRUNTIME. '\ diff "'Let eq ='" 'else let cmd = substitute ($ VIMRUNTIME ,'','"',''). '\ diff "' endif else let cmd = $ VIMRUNTIME. '\ diff 'endif silent execute '! '. Cmd. ''. opt. arg1. ''. arg2. '> '. arg3. some options when eqendfunction is automatically completed (ctrl-p): when there are more than one option, the menu is displayed, the longest selection; show the additional information currently selected if v: version >=700 set completeopt = menu, longest, preview endif """""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" "status row related actions """""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" """""""""""""""" """""""""""""""""""""""""""""""""""""""" "" Display status bar (default value: 1, unable to display status bar) set laststatus = 2 "status line color highlight StatusLine guifg = SlateBlue guibg = Yellowhighlight StatusLineNC guifg = Gray guibg = Whitefunction! CurDir () let curdir = substitute (getcwd (), '/Users/amir /',"~ /"," G ") return curdirendfunction "status row display content "" "% F current file name" % m current File Modification status "% r current file read-only" % Y current file type "% {& fileformat} current file encoding" % B ASCII value of characters at the current cursor "% B current cursor hexadecimal value of the character "% l current cursor row number" % c current cursor column number "% V current cursor virtual column number (calculated based on the number of bytes occupied by the character) "% p percentage of current row to total number of rows" % Percent "% L total number of current file rows set statusline = \ % F % m % r % h \ % w \ CWD: \ % r % {CurDir ()} % h \ Line: \ % l/% L: % c "sets the information displayed in the status Line as follows:" set nowr Apscan "Highlight currentif has (" gui_running ") set cursorline hi cursorline guibg = #333333 hi CursorColumn guibg = #333333 endif """"""""""""""""""""""""" "=> VIM userinterface """"""""""""""""""""""""""""""""""""" "Set 7 lines to the curors-when moving vertical .. set so = 7 "Do not redraw, when running macros .. lazyredrawset lz "Change buffer- Without savingset hid "Set magic onset magic" How many tenths of a second to blinkset mat = 2 set lines = 40 set columns = 100 """""""""""" """""""""""""""""""""""""""""""""""""""" "calendar plugin Settings """""""""""""""""""""""""""""""""""" "let g: calendar_diary =/calendar "map ca: Calendar <cr>" enables gvim to support Alt + n to switch the tab function! BufPos_ActivateBuffer (num) let l: count = 1 for I in range (1, bufnr ("$") if buflisted (I) & getbufvar (I, "& modifiable ") if l: count = a: num exe "buffer ". I return endif let l: count = l: count + 1 endif endforendfunction
In addition, the background color is ir_black.
In row 106
"Set the color scheme colorscheme ir_black
You can set your favorite background color.
The type of the background color is in the Directory D: \ GVIM \ GVimPortable \ App \ vim \ vim71 \ colors.
In addition, the background color is from the vim Resource Network. You can copy the same file and change its name to ir_black (this name is random, but keep up with the above ...), The Code is as follows:
"% SiSU Vim color file" Slate Maintainer: Ralph amisrated <ralph@amissah.com> "(originally looked at desert Hans Fugal
Links to the above two files:
Http://pan.baidu.com/share/link? Consumer id = 416806 & uk = 3239296356
Of course, you can also change the color you like. If you are interested in it, you can try it yourself.
Finally, attach my running interface
On January 5, I found that the article "hands-on teach you how to convert Vim into an IDE programming environment (image and text)" was written in great detail, and I gave up the above ugly =.
Attach his link http://blog.csdn.net/wooin/article/details/1858917