Guest User

Untitled

a guest
Feb 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. # ~/.vimrc
  2.  
  3. set nocompatible " be iMproved, required
  4. " filetype off " required
  5.  
  6. " highlighting
  7. " set relativenumber
  8. set number
  9. set ruler
  10. syntax on
  11. set background=dark
  12. set cursorline
  13. set incsearch
  14. set hlsearch
  15. set ignorecase
  16. set smartcase
  17. set showmatch
  18. :highlight search guifg=yellow guibg=darkred
  19.  
  20. " tabbing
  21. set expandtab
  22. set smarttab
  23. set smartindent
  24. set shiftwidth=2
  25. set tabstop=2
  26. set softtabstop=2
  27.  
  28. " have command-line completion <Tab> (for filenames, help topics, option
  29. " names) first list the available options and complete the longest common part,
  30. " then have further <Tab>s cycle through the possibilities:
  31. set wildmode=list:longest,full
  32.  
  33. " folding settings
  34. set foldmethod=indent
  35. set foldnestmax=10
  36. set nofoldenable
  37. set foldlevel=1
  38.  
  39. " All of your Plugins must be added before the following line
  40. filetype plugin indent on " required
  41.  
  42. let g:solarized_termcolors=256
  43.  
  44. " Strip trailing whitespace
  45. function! <SID>StripTrailingWhitespaces()
  46. " Preparation: save last search, and cursor position.
  47. let _s=@/
  48. let l = line(".")
  49. let c = col(".")
  50. " Do the business:
  51. %s/\s\+$//e
  52. " Clean up: restore previous search history, and cursor position
  53. let @/=_s
  54. call cursor(l, c)
  55. endfunction
  56. autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
Add Comment
Please, Sign In to add comment