Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Here is my current vimrc. Some highlights of what all these settings do:

  • Turn on some nifty colors, for syntax highlighting and on the status bar
  • Don't use real tabs, instead, use 4 spaces whenever you hit the tab key
  • Handles indentation of curlies
  • Uses upper ascii characters to represent real tabs, as well as showing you when there are spaces at the end of your lines
  • If you're typing out comments, and the text gets to the end of the line, make it wrap, and make sure it adds a comment for you at the beginning of the next line
  • Turn off all the noisy beeping, so the terminal won't beep every time you press the cursor in the wrong direction, or make some other simple mistake
    And my all-time favorite:

  • Tab completion of variable names! If you hit tab with no characters before your curser, you get a normal 4 space tab. If there are characters before you cursor, it performs completion on them, allowing you to scroll forward through the options with tab, or backwards through the options with shift-tab.

    " Eric Andreychek's .vimrc set nocompatible " turn these ON: set digraph esckeys hidden ruler showcmd wildmenu smartindent expandta +b set visualbell showmatch title " turn these OFF: set noerrorbells nostartofline nohlsearch " non-toggles: set backspace=2 formatoptions=cqrt laststatus=2 shortmess=at textwidth +=79 set whichwrap=<,>,h,l shiftwidth=4 softtabstop=4 set comments=b:#,:%,fb:-,n:>,n:) set list listchars=tab:ùð,trail:Ü set viminfo=%,'50,\"100,:100,n~/.viminfo " mappings: map Q gq map K <NUL> map <C-Z> :shell<CR> map ,v :e ~/.vimrc<CR> map ,F :view $VIMRUNTIME/filetype.vim map ,SO :source $VIMRUNTIME/syntax/ map ,V :view $VIMRUNTIME/syntax/ map <C-A> <Home> map <C-E> <End> " syntax coloring!! :-) syntax on " some colors: "white on black" hi comment ctermfg=darkgreen ctermbg=black guifg=darkgreen guibg=bla +ck " Make the status bar blue set t_mr=^[[0;1;37;44m " The bottom line is bold-white set t_me=^[[m " Shhhhh! set t_vb= " Mmmmm... tab completetion function! InsertTabWrapper(direction) let col = col('.') - 1 if !col || getline('.')[col - 1] !~ '\k' return "\<tab>" elseif "backward" == a:direction return "\<c-p>" else return "\<c-n>" endif endfunction inoremap <S-tab> <c-r>=InsertTabWrapper ("backward")<cr> inoremap <tab> <c-r>=InsertTabWrapper ("forward")<cr>

    There are some control/escape characters in this vimrc file. If you really want to use the whole thing, don't try to copy and paste this, just snag it from my website: Eric's vimrc.

    Have fun,
    -Eric

    Update: Oh yeah, and vim rules :-)


    --
    Lucy: "What happens if you practice the piano for 20 years and then end up not being rich and famous?"
    Schroeder: "The joy is in the playing."

    In reply to Re: Vim configs (slightly OT) by andreychek
    in thread Vim configs (slightly OT) by djw

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post; it's "PerlMonks-approved HTML":



    • Are you posting in the right place? Check out Where do I post X? to know for sure.
    • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
      <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
    • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
    • Want more info? How to link or How to display code and escape characters are good places to start.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Domain Nodelet?
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others romping around the Monastery: (2)
    As of 2024-04-19 21:15 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found