Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. execute pathogen#infect()
  2. filetype plugin indent on
  3. " Use the Solarized Dark theme
  4. let g:solarized_termtrans=1
  5.  
  6. syntax enable
  7. set background=dark
  8. colorscheme solarized
  9. let g:solarized_termcolors=256
  10.  
  11. " Make Vim more useful
  12. set nocompatible
  13. " Use the OS clipboard by default (on versions compiled with `+clipboard`)
  14. set clipboard=unnamed
  15. " Enhance command-line completion
  16. set wildmenu
  17. " Allow cursor keys in insert mode
  18. set esckeys
  19. " Allow backspace in insert mode
  20. set backspace=indent,eol,start
  21. " Optimize for fast terminal connections
  22. set ttyfast
  23. " Add the g flag to search/replace by default
  24. set gdefault
  25. " Use UTF-8 without BOM
  26. set encoding=utf-8 nobomb
  27. " Change mapleader
  28. let mapleader=","
  29. " Don’t add empty newlines at the end of files
  30. set binary
  31. set noeol
  32. " Centralize backups, swapfiles and undo history
  33. set backupdir=~/.vim/backups
  34. set directory=~/.vim/swaps
  35. if exists("&undodir")
  36. set undodir=~/.vim/undo
  37. endif
  38.  
  39. " Don’t create backups when editing files in certain directories
  40. set backupskip=/tmp/*,/private/tmp/*
  41.  
  42. " Respect modeline in files
  43. set modeline
  44. set modelines=4
  45. " Enable per-directory .vimrc files and disable unsafe commands in them
  46. set exrc
  47. set secure
  48. " Enable line numbers
  49. set number
  50. " Enable syntax highlighting
  51. syntax on
  52. " Highlight current line
  53. set cursorline
  54. " Make tabs as wide as two spaces
  55. set tabstop=2
  56. " Show “invisible” characters
  57. set lcs=tab:▸\ ,trail:·,eol:¬,nbsp:_
  58. set list
  59. " Highlight searches
  60. set hlsearch
  61. " Ignore case of searches
  62. set ignorecase
  63. " Highlight dynamically as pattern is typed
  64. set incsearch
  65. " Always show status line
  66. set laststatus=2
  67. " Enable mouse in all modes
  68. set mouse=a
  69. " Disable error bells
  70. set noerrorbells
  71. " Don’t reset cursor to start of line when moving around.
  72. set nostartofline
  73. " Show the cursor position
  74. set ruler
  75. " Don’t show the intro message when starting Vim
  76. set shortmess=atI
  77. " Show the current mode
  78. set showmode
  79. " Show the filename in the window titlebar
  80. set title
  81. " Show the (partial) command as it’s being typed
  82. set showcmd
  83. " Use relative line numbers
  84. if exists("&relativenumber")
  85. set relativenumber
  86. au BufReadPost * set relativenumber
  87. endif
  88. " Start scrolling three lines before the horizontal window border
  89. set scrolloff=3
  90.  
  91. set title
  92. set ruler
  93. set number
  94. set esckeys
  95. set hlsearch
  96. set showmode
  97. set showmatch
  98. set expandtab
  99. set linebreak
  100. set tabstop=2
  101. set scrolloff=2
  102. set shiftwidth=2
  103. set softtabstop=2
  104. set encoding=UTF-8
  105. set fileencodings=UTF-8
  106. set backspace=eol,start,indent
  107.  
  108. " Strip trailing whitespace (,ss)
  109. function! StripWhitespace()
  110. let save_cursor = getpos(".")
  111. let old_query = getreg('/')
  112. :%s/\s\+$//e
  113. call setpos('.', save_cursor)
  114. call setreg('/', old_query)
  115. endfunction
  116. noremap <leader>ss :call StripWhitespace()<CR>
  117. " Save a file as root (,W)
  118. noremap <leader>W :w !sudo tee % > /dev/null<CR>
  119.  
  120. " Automatic commands
  121. if has("autocmd")
  122. " Enable file type detection
  123. filetype on
  124. " Treat .json files as .js
  125. autocmd BufNewFile,BufRead *.json setfiletype json syntax=javascript
  126. " Treat .md files as Markdown
  127. autocmd BufNewFile,BufRead *.md setlocal filetype=markdown
  128. endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement