defm03

vimrc

Jul 9th, 2013
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 2.48 KB | None | 0 0
  1. " ~/.vimrc
  2.  
  3. " Basic Settings
  4. set nocompatible
  5. syntax on
  6. filetype on
  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 number of lines selected in visual
  16. set wrap                          " wrap lines automatically (create new line)
  17. "set number                        " show line numbers
  18.  
  19. " swap file directory to avoid clutter
  20. set backupdir=~/.vim/backup
  21.  
  22. " break comment lines but not at middle of words
  23. :set formatoptions=l
  24. :set lbr
  25.  
  26. " Appearance
  27. "colorscheme lettuce
  28.  
  29. " use 256 color palette if available
  30. if &term=="xterm"
  31.   set t_Co=256
  32. endif
  33.  
  34. " highlight searches, searches begin immediately
  35. set hlsearch
  36. set incsearch
  37. " non-case-sensitive searches
  38. set ignorecase
  39. set smartcase
  40.  
  41. " tab settings
  42. set tabstop=2                     " tab character amount
  43. set expandtab                     " tabs as space
  44. set smartindent                   " smart autoindenting on a new line
  45. set shiftwidth=2                  " set spaces for autoindent
  46. set softtabstop=2
  47.  
  48. " Folding
  49. set foldcolumn=0
  50. set foldmethod=syntax
  51. set foldlevelstart=1
  52.  
  53. " Navigation
  54. set nostartofline                 " navigate closest column character(up/down)
  55. set showtabline=2                 " tab bar always on
  56. "set showmatch                     " bouncy parenthesis
  57.  
  58. " visual bells give me seizures
  59. set t_vb=''
  60.  
  61. " mouse support (cursor position, tab selection - hold shift to select text)
  62. " n = normal mode, i = insert, c = command, a = all
  63. set mouse=ni
  64.  
  65. " setting menu tab completion
  66. set wildmenu
  67. set wildignore+=*.o,*~,.lo
  68. set suffixes+=.in,.a
  69.  
  70. " Key mappings
  71.  
  72. set pastetoggle=<F3>                    " disable autoindent when pasting
  73. imap <F4> <Esc>                         " easier to reach Esc
  74. nn <F5> :setlocal spell! spell?<CR>     " spelling toggle
  75. map <F7> <Esc>:set mouse=<CR>           " mouse support off
  76. map <F8> <Esc>:set mouse=ni<CR>         " mouse support on
  77. vmap <F9> :!xclip -f -sel clip<CR>      " copy text to xorg server clipboard
  78. map <F10> :-1r !xclip -o -sel clip<CR>  " paste text from xserv clip to vim
  79. map <CR> o<Esc>                         " newline with Enter (command-mode)
  80. noremap <C-J> gj                        " wrapped line navigation
  81. noremap <C-K> gk
  82.  
  83. " space bar un-highligts search
  84. :noremap <silent> <Space> :silent noh<Bar>echo<CR>
Advertisement
Add Comment
Please, Sign In to add comment