Make Vim an IDE

Source: Internet
Author: User
Tags set background egrep

Making vim an IDE was an exiting thing. Conside following configuration files:

    • . VIMRC: ~/.VIMRC
    • Winmanager.vim: ~/.vim/bundle/winmanager/plugin/winmanager.vim
. VIMRC

My. VIMRC is as follows:

Set nocompatible ' be improved, requiredfiletype off ' required ' set the runtime Path to Inc Lude Vundle and Initializeset rtp+=~/.vim/bundle/vundle.vimcall vundle#begin () "Let Vundle manage Vundle, RequiredPlugin ' Vundlevim/vundle.vim ' "My Bundles Here" "Original repos on Githubbundle ' tpope/vim-fugitive ' Bundle ' lokaltog/ Vim-easymotion ' bundle ' rstacruz/sparkup ', {' RTP ': ' vim/'}bundle ' tpope/vim-rails.git ' bundle ' the-nerd-tree ' bundle ' The-nerd-commenter ' bundle ' taglist.vim ' bundle ' Winmanager ' vim-scripts reposbundle ' L9 ' bundle ' fuzzyfinder ' "Non GitHub reposbundle ' git://git.wincent.com/command-t.git ' Bundle ' bufexplorer.zip ' "Color schemesbundle ' tomasr/ Molokai ' bundle ' flazz/vim-colorschemes ' bundle ' evening_2 ' bundle ' solarized ' "All of your Plugins must is added before the       Following Linecall vundle#end () "Requiredfiletype plugin indent on" required "Brief Help" ":P luginlist -Lists configured plugins "":P lugininstall-installs PLugins; Append '! ' to update or just:P luginupdate "":P luginsearch foo-searches for foo; Append '! ' to refresh local cache "":P luginclean-confirms removal of unused plugins; Append '! ' to Auto-approve removal "" Put your Non-plugin stuff after the "Set <leader> to ', ' let Mapleader = ' , ' Set color Schemesyntax on ' colorscheme molokaicolorscheme evening_2 ' syntax enable ' Set Background=dark ' ColorScheme s Olarized "to" the number of space characters inserted for Indentationset shiftwidth=4 "to control the number of SPAC E characters that would be inserted when the TAB key was pressed "insert 4 spaces for a tabset tabstop=4" to insert space ch  Aracters Whenever the TAB key is pressed "if you want to enter a real tab character, use Ctrl-v<tab> key Sequenceset Expandtab "To display line Numbersset nu" by pressing ctrl-n twice in normal mode, "Vim toggles between showing and Hidi Ng Line Numbers.nmap <C-N><C-N>: Set invnumber<cr> "Make BackspacAppsset backspace=2 "To display the status line alwaysset laststatus=2" does not create a Swapfilese T noswapfile "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""  E-cscope ' option ' when it was compiled.    If It wasn ' t, time to recompile vim...if have ("Cscope") "Use both Cscope and Ctag for ' ctrl] ', ': Ta ', and ' vim-t ' Set Cscopetag "Check cscope for definition of a symbol before checking ctags:set to 1" If you want the reverse SE    Arch order.    Set csto=0 "Add any Cscope database in current directory if filereadable (" Cscope.out ") CS Add cscope.out    "Else add the database pointed to by environment variable ElseIf $CSCOPE _db! =" "cs Add $CSCOPE _db endif "Show msg when no other Cscope DB added set Cscopeverbose" "" "" "" "" My cscope/vim KEY mappings "" The following maps all invoke one of the following cscope search types: "' s ' symbol:fi   nd all references to the token under cursor "' g ' global:find global definition (s) of the token under cursor"  ' C ' calls:find all calls to the function name under cursor "' t ' Text:find all instances of the text under    Cursor "' E ' egrep:egrep search for the word under cursor" ' F ' file:open the filename under cursor "' I ' includes:find files that include the filename under cursor" ' d ' called:find functions that function u  NDEr cursor Calls "" Below is three sets of the maps:one set that just jumps to your "search result, one that Splits the existing Vim window horizontally and "diplays your search result in the new window, and one that does the    Same "thing, but does a vertical split instead (vim 6 only).   "To does the first type of search, hit ' ctrl-\ ', followed by one of the "Cscope Search types above (s,g,c,t,e,f,i,d).  The result of your cscope "search would be a displayed in the current window.    You can use Ctrl-t to ' go back to where you were before the search. Nmap <c-\>s:cs Find S <c-r>=expand ("<cword>") <CR><CR> nmap <c-\>g:cs Find G <c -r>=expand ("<cword>") <CR><CR> nmap <c-\>c:cs find C <c-r>=expand ("<cword>") & Lt cr><cr> nmap <c-\>t:cs Find T <c-r>=expand ("<cword>") <CR><CR> nmap <c -\>e:cs Find e <c-r>=expand ("<cword>") <CR><CR> nmap <c-\>f:cs find F <c-r>=e Xpand ("<cfile>") <CR><CR> nmap <c-\>i:cs Find I ^<c-r>=expand ("<cfile>") &LT;CR&G T;$<cr> nmap <c-\>d:cs Find D <c-r>=expand ("<cword>") <CR><CR> "Using" Ctrl-spa Cebar ' (intepreted as [email protected] by VIM) then a seaRCH type "makes the vim window split horizontally, with search result displayed in" the new window. Nmap <[email protected]>s:cs Find S <c-r>=expand ("<cword>") <CR><CR> nmap <[ Email protected]>g:cs Find G <c-r>=expand ("<cword>") <CR><CR> nmap <[email  Protected]>c:cs Find C <c-r>=expand ("<cword>") <CR><CR> Nmap <[email protected]  >t:cs Find T <c-r>=expand ("<cword>") <CR><CR> nmap <[email protected]>e:cs Find E <c-r>=expand ("<cword>") <CR><CR> nmap <[email protected]>f:cs find F <C-R> =expand ("<cfile>") <CR><CR> nmap <[email protected]>i:cs Find I <c-r>=expand (" <cfile> ") <CR><CR> nmap <[email protected]>d:cs find D <c-r>=expand (" <cword > ") <CR><CR>" hitting Ctrl-space *twice* befoRe the search type does a vertical "split instead of a horizontal one (vim 6 and up only)" (Note:you may WIS H to put a ' set Splitright ' in your. VIMRC "If you prefer the new window on the right instead of the left Nmap < [Email protected]><[email protected]>s:vert SCS find S <c-r>=expand ("<cword>") < cr><cr> Nmap <[email protected]><[email protected]>g:vert SCS find G <C-R>= Expand ("<cword>") <CR><CR> nmap <[email protected]><[email protected]>c: Vert SCS Find C <c-r>=expand ("<cword>") <CR><CR> nmap <[email protected]><[ Email protected]>t:vert SCS find T <c-r>=expand ("<cword>") <CR><CR> nmap <[email& Nbsp;protected]><[email protected]>e:vert SCS find e <c-r>=expand ("<cword>") <CR> <CR> Nmap <[email protected]><[email p Rotected]>f:vert SCS find F <c-r>=expand ("<cfile>") <CR><CR> nmap <[email prote     Cted]><[email protected]>i:vert SCS Find I ^<c-r>=expand ("<cfile>") <CR>$<CR> Nmap <[email protected]><[email protected]>d:vert SCS Find D <c-r>=expand ("<cword >) <cr><cr>endif "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" _ctags_cmd = '/usr/bin/ctags ' "Increase the Vim window width to accommodate the taglist windowlet tlist_inc_winwidth = 0" Jump to taglist windows on Openlet tlist_gainfocus_on_toggleopen = 1 "Open the TagList window when Vim startslet Tlist_auto _open = 1 "Automatically update the TagList to include" newly edited fileslet tlist_auto_update = 1 "Close Vim if the TAGL IST is the only windowlet Tlist_exit_onlywindow = 1 "Show tags for the current buffer onlylet tlist_show_one_file = 1" Process files even when the TagList window is closed Let Tlist_process_file_always = 1 "Display of the tags menulet tlist_show_menu = 1" Place the TagList window in the right SID Elet Tlist_use_right_window = 1 "Automatically highlight the current tag in the Taglistlet Tlist_auto_highlight_tag = 0nma P <silent> <leader>tg:TlistToggle<CR> "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " Gt <leader>wm:wmtoggle<cr>let g:nerdtree_title= "[Nerdtree]" Let g:winmanagerwindowlayout= ' NERDTree| Bufexplorer,taglist ' function! Nerdtree_start () exec ' Nerdtree ' endfunctionfunction! Nerdtree_isvalid () return 1endfunction "Auto open Winmanagerlet g:autoopenwinmanager=1""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 

Main Points of my VIMRC

    • Use Vundle to manage plugins;
    • Key Pulgins:winmanager, TagList, Nerdtree.

To use my VIMRC

    1. Copy my vimrc to your. VIMRC
    2. Open vim and Execute command ": Plugininstall"
    3. Modify Winmanager.vim
Modify Winmanager.vim

Modify function Togglewindowsmanager

"Toggle showing the Explorer plugins.
function! <sid>togglewindowsmanager ()
If Iswinmanagervisible ()
Call S:closewindowsmanager ()
Else
Call S:startwindowsmanager ()
"Solve the bug that
"An extra blank window would open
"When Winmanager opens
exec ' Q '
End
Endfunction

ADD codes to set auto open Winmanager

"Set auto Open Winmanager
If G:autoopenwinmanager
Autocmd vimenter * Nested call S:togglewindowsmanager () |1wincmd W
End

Make Vim an IDE

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.