Live data from Hacker News

Ask HN: What's in your .vimrc file?

news.ycombinator.com

61–69 of 69 posts

Re: Ask HN: What's in your .vimrc file?

#62
Been through some changes lately - this is the trimmed down of my .gvimrc (MacVim). " window settings set lines=70 set columns=200 set fileencoding=utf8

    set incsearch
    set ignorecase
    set hlsearch
    
    " make the status line more useful
    set statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v]
    set nocompatible
    
    " backspace mode
    set bs=2
    
    " highlitt current line and add line numbers
    set cursorline
    set number
    
    " yummy
    set guifont=Monaco:h11.00
    
    " turn off the scrollbars and the rest of the crap
    set guioptions=eg
    
    
    ""set foldenable
    ""set foldmethod=indent
    filetype plugin on
    filetype on
    
    " autoindenting
    set cindent
    set smartindent
    set autoindent
    
    " display improvements
    set list
    " show indents
    set listchars=tab:\.\ ,trail:-
    set ruler
    set showcmd
    " i use tabs instead of spaces, wanna make something of it?
    set noexpandtab
    set tabstop=4
    set shiftwidth=4
    set softtabstop=4
    
    " temp files
    set backupdir=~/.vim/bak
    set directory=~/.vim/tmp
    " colorz
    syntax on
    colorscheme herald " molokai, zenburn, darkburn, vibrantink
    
    " PLUGINZ
     " allml settings
    let g:allml_global_maps = 1
    let g:HiMtchBrkt=1
    let g:SCMDiffCommand="/opt/subversion/bin/svn"
    
    inoremap  :call PhpDocSingle()
    nnoremap  :call PhpDocSingle()
    vnoremap  :call PhpDocRange() 
    
    " PHP specific fixes
    " highlights interpolated variables in sql strings and does sql-syntax highlighting. yay
    autocmd FileType php let php_sql_query=1
    " does exactly that. highlights html inside of php strings
    autocmd FileType php let php_htmlInStrings=1
    " discourages use oh short tags. c'mon its deprecated remember
    autocmd FileType php let php_noShortTags=1
    " settings for cake
    au BufNewFile  *.ctp set filetype=php
    au BufRead *.ctp set filetype=php

Re: Ask HN: What's in your .vimrc file?

#63
The interesting stuff only:

    set showbreak=>\ 
    set wildignore=*.bak,*.pyc,*.swp
    set wildmenu
    set wildmode=list:longest
    
This is actually quicker than reaching for ESC most of the time:

    inoremap  
    vnoremap  
Tab switching:

    noremap  gt
    noremap  gT
Something useful for syntax file writing:

    noremap  :echo synIDattr(synID(line("."), col("."), 1), "name")

Re: Ask HN: What's in your .vimrc file?

#66
post #43
post #41

Earlier quoted context omitted.

Indeed! I can't do it any more, just filled me with so much hate... It's like people use the spacebar just to think. /rant ;)

And to answer the poster, I tend to just use the default vim. I'm bouncing around machines so much that I don't bother setting anything up on my main one that I'll miss on the others...

My cure for that is putting my .vimrc on my site; then, from a foreign machine, I just do:

wget -O ~/.vimrc http://lucasoman.com/vimrc

And just like that, I'm in my comfort zone. Of course, this doesn't cover plugins and such, but I don't use those very often.

Re: Ask HN: What's in your .vimrc file?

#67
Here are just a couple things I find really useful day to day. I used to have a timeout that would revert to normal mode from insert mode after about 30 seconds if idle, but I got tired of that after about six months and just got in the habit of hitting Escape when I finished with an insert action. I did it just now, even though this is a textarea.

  " For (ab)use with :sp
  map  j_
  map  k_
  set wmh=0 so=999 winheight=999

  nnoremap i :nohi

  " \s is global-replace-this-word
  :nnoremap s :%s/\\>//g

Re: Ask HN: What's in your .vimrc file?

#69
post #2

perhaps of interest: " for vertical split, with the pipe dividers hidden :hi clear vertsplit :hi vertsplit ctermbg=Black ctermfg=Black " quit quits all :nmap :q :qa :nmap :wq :wqa " H/L go to beginning/end of line without moving fingers :nmap H 0 :nmap L $ " turn off matching paren highlighting let loaded_matchparen = 1

Why don't you use paren matching?
Post reply on HN