toddrpartridge

vimrc

Feb 16th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.34 KB | None | 0 0
  1. " ~/.vimrc
  2.  
  3. " Basic Settings
  4. set nocompatible                  " vim defaults (not vi)
  5. syntax on                         " enable syntax highlighting
  6. filetype on                       " detect filetype
  7. filetype plugin on
  8. filetype plugin indent on
  9.  
  10. set encoding=utf-8
  11. set fileencoding=utf-8
  12.  
  13. set backspace=indent,eol,start    " backspace erases in insert mode
  14. set ruler                         " show line/character in statusbar
  15. set showcmd                       " show partial command in status line
  16. set wrap                          " wrap lines automatically (create new line)
  17. "set number                        " show line numbers
  18.  
  19. set t_vb=''                       " turn off visual bells
  20.  
  21. set backupdir=$HOME/.vim/backup,/tmp " swap file directory to avoid clutter
  22.  
  23. " Tab Settings
  24. set tabstop=2                     " tab character amount
  25. set expandtab                     " tabs as space
  26. set smartindent                   " smart autoindenting on a new line
  27. set shiftwidth=2                  " number of spaces for autoindent
  28. set softtabstop=2
  29.  
  30. " Folding
  31. set foldcolumn=0
  32. set foldmethod=syntax
  33. set foldlevelstart=1
  34.  
  35. " Navigation
  36. set nostartofline                 " navigate closest column character(up/down)
  37. set showtabline=2                 " tab bar always on
  38. "set showmatch                     " bouncy parenthesis
  39.  
  40. " Appearance
  41. if &term=="xterm"                 " use 256 color palette if available
  42.   set t_Co=256
  43.   colorscheme wombat256
  44. endif
  45.  
  46. "if &t_Co == 256 || &t_Co == 88
  47. "  colorscheme wombat256
  48. "endif
  49.  
  50. set cursorline                    " highlight current line (disable underline)
  51. hi CursorLine term=none cterm=none
  52.  
  53. " Search
  54. set hlsearch                      " highlight searches
  55. set incsearch                     " highlight immediately
  56. set ignorecase                    " non-case-sensitive searches
  57. set smartcase                     " additional parameters for above
  58.  
  59. " Others
  60. set wildmenu                      " setting menu tab completion
  61. set wildignore+=*.o,*~,.lo
  62. set suffixes+=.in,.a
  63.  
  64. :set formatoptions=l              " break comment lines...
  65. :set lbr                          " but not at middle of words
  66.  
  67. "autocmd bufwritepre * :%s/\s\+$//e  " remove trailing whitespaces when saving
  68.  
  69. set mouse=                        " mouse navigation (tabs, cursor...)
  70.                                   " (n)ormal, (c)ommand, (i)nsert, (a)ll
  71.                                  " interferes w/ pasting from x clipboard
  72.  
  73. " Key mappings
  74.  
  75. map <F1> <nop>                          " disable F1 help, use :help instead
  76. set pastetoggle=<F3>                    " disable autoindent when pasting
  77. imap <F4> <Esc>                         " easier to reach Esc
  78. nn <F5> :setlocal spell! spell?<CR>     " spelling toggle
  79. vmap <F7> :!xclip -f -sel clip<CR>      " copy text to xorg server clipboard
  80. map <F8> :-1r !xclip -o -sel p<CR>      " paste from xserv clip (middle)
  81. map <F9> <Esc>:set mouse=<CR>           " mouse support off
  82. map <F10> <Esc>:set mouse=ni<CR>        " mouse support on
  83. map <CR> o<Esc>                         " newline with Enter (command-mode)
  84. noremap <C-J> gj                        " wrapped line navigation
  85. noremap <C-K> gk
  86.  
  87. " space bar un-highlights search
  88. :noremap <silent> <Space> :silent noh<Bar>echo<CR>
  89.  
  90. " Unused
  91. " set listchars=tab:.\ ,trail:•     " make trail space and tabs with bullet
  92. " set list
Advertisement
Add Comment
Please, Sign In to add comment