Live data from Hacker News

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

news.ycombinator.com

1–10 of 69 posts

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

#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

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

#8
Some I like:

  " Keep cycled-away buffers open (preserving undo, 
  " allowing buffer switch without write)
  set hidden

  " Facilities for handling pasting into vim, preserving
  " indentation of the pasted text.
  " This will make  start paste mode and  stop paste mode.
  " Note that typing  in paste mode inserts , since in paste
  " mode everything is inserted literally, except the 'pastetoggle' key
  " sequence.
  map  :set paste
  map  :set nopaste
  imap  :set paste
  imap  
  set pastetoggle=

  " Toggle line-numbers with key sequence Ctrl-N-N:
  nmap  :set invnumber 

  " Consolidate swapfiles to keep working directories clean
  set directory=~/.vim/swap

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

#10
Map some "leader" commands for common operations, eg:

  let mapleader=','
  let g:mapleader=','

  nmap w :w!
  nmap q :q
  nmap f :find
  map d :execute 'NERDTreeToggle ' . getcwd()
  nmap m :make

  " cut & paste
  map c "+y
  map x "+d
  map v "+p
Also quicker window navigation:

  map  j
  map  k
  map  h
  map  l
Post reply on HN