Guest User

Untitled

a guest
Oct 21st, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.19 KB | None | 0 0
  1. " The "m" at the end of Vi
  2. set nocompatible
  3.  
  4. " Enable plugins
  5. filetype plugin indent on
  6.  
  7. " Set the leader, useful for mappings: "<space>" is a good one
  8. let mapleader = "\<space>"
  9.  
  10. " Sets how many lines of history Vim has to remember
  11. set history=1000
  12.  
  13. " Reload buffer when its file is changed from the outside
  14. set autoread
  15.  
  16. " Set UTF8 as standard encoding
  17. set encoding=utf8
  18.  
  19. " Use Unix as the standard file type
  20. set fileformats=unix,dos,mac
  21.  
  22. " Disable backup/swap
  23. set nobackup
  24. set nowritebackup
  25. set noswapfile
  26.  
  27. " Add "$" at end of "change" nouns
  28. set cpoptions+=$
  29.  
  30. " Remove startup message
  31. set shortmess+=I
  32.  
  33. " Don't redraw while executing macros (good performance config)
  34. set lazyredraw
  35.  
  36. " Title is name of current file
  37. set title
  38.  
  39. " Set amount of lines above the cursor
  40. set scrolloff=3
  41.  
  42. " Show line numbers (relative if we can)
  43. set number
  44. if has('relativenumber')
  45. set relativenumber
  46. endif
  47.  
  48. " Always show current position
  49. set ruler
  50.  
  51. " Height of the command bar
  52. set cmdheight=2
  53.  
  54. " Status line
  55. set statusline=%t " tail of the filename
  56. set statusline+=\ %m " modified flag
  57. set statusline+=%h " help file flag
  58. set statusline+=%r " read only flag
  59. set statusline+=%y " filetype
  60. set statusline+=[%{strlen(&fenc)?&fenc:'none'}] " file encoding
  61. set statusline+=[%{&ff}] " file format
  62. set statusline+=%= " left/right separator
  63. set statusline+=%c, " cursor column
  64. set statusline+=%l " cursor line
  65. set statusline+=\ %P " percent through file
  66.  
  67. " Always put a status line in, even if there is only one window
  68. set laststatus=2
  69.  
  70. " Turn on the Wild menu
  71. set wildmenu
  72.  
  73. " Behave shell-like when completing shell
  74. set wildmode=longest,list
  75.  
  76. " Ignore compiled files and backups
  77. set wildignore=
  78. set wildignore+=*~
  79. set wildignore+=*.o
  80. set wildignore+=*.a
  81. set wildignore+=*.so
  82. set wildignore+=*.class
  83. set wildignore+=*.pyc
  84. set wildignore+=*.gch
  85. set wildignore+=*.obj
  86.  
  87. " Virtual edit
  88. set virtualedit=
  89. set whichwrap+=<,>,h,l " disabled when virtualedit
  90.  
  91. " Backspace unindents and joins lines
  92. set backspace=start,indent,eol
  93.  
  94. " Don't notify any errors
  95. set noerrorbells
  96. set visualbell
  97. set t_vb=
  98. set timeoutlen=500
  99.  
  100. " Hide the mouse pointer while typing
  101. set mousehide
  102.  
  103. " Mouse activated
  104. set mouse=a
  105.  
  106. " Enable syntax highlighting
  107. syntax enable
  108.  
  109. " Enable modeline
  110. set modeline
  111.  
  112. " Show matching brackets when text indicator is over them
  113. set showmatch
  114.  
  115. " How many tenths of a second to blink when matching brackets
  116. set matchtime=2
  117.  
  118. " Default fold method
  119. set foldmethod=indent
  120.  
  121. " Max number of fold levels
  122. set foldnestmax=10
  123.  
  124. " Folding everything (disable at start)
  125. set nofoldenable
  126.  
  127. " Again, folding parent levels
  128. set foldlevel=1
  129.  
  130. " Complete menu
  131. set completeopt=menuone,preview
  132.  
  133. " Use spaces instead of tabs
  134. set expandtab
  135.  
  136. " Be smart when using tabs
  137. set smarttab
  138.  
  139. " Indent by 3 spaces/tabs
  140. set shiftwidth=3
  141. set softtabstop=3
  142. set tabstop=3
  143.  
  144. " Round indent to multiple of tabstop/shiftwidth
  145. set shiftround
  146.  
  147. " Invisible characters
  148. set list listchars=tab:>-,trail:.,extends:>
  149. set showbreak=>\
  150.  
  151. " Explicit FTW
  152. set autoindent
  153. set smartindent
  154. set wrap
  155.  
  156. " Regex magic
  157. set magic
  158.  
  159. " Ignore case
  160. set ignorecase
  161.  
  162. " Try to be smart about cases
  163. set smartcase
  164.  
  165. " Highlight results
  166. set hlsearch
  167.  
  168. " Makes search act like in modern browsers
  169. set incsearch
  170. set wrapscan
  171.  
  172. " Colorscheme setup
  173. colorscheme desert
  174.  
  175. " A buffer becomes hidden when it is abandoned
  176. set hidden
  177.  
  178. " Specify the behavior when switching between buffers
  179. set switchbuf=useopen,usetab
  180.  
  181. " Tab display
  182. set showtabline=0
  183.  
  184. " Split towards the right
  185. set splitright
  186.  
  187. " Treat long lines as break lines (useful when moving around in them)
  188. nnoremap j gj
  189. nnoremap k gk
  190.  
  191. " Remap Vim 0 to first non-blank character
  192. nmap 0 ^
  193.  
  194. " Exchange "`" and "'"
  195. nnoremap ' `
  196. nnoremap ` '
  197.  
  198. " Resolve inconsistency between "Y" (line), and "D" (eol)
  199. "nmap D dd
  200. nmap Y y$
  201.  
  202. " Visual block indenting: keep selection after indenting
  203. vmap > >gv
  204. vmap < <gv
  205.  
  206. " Select pasted text with gV
  207. nmap gV `[v`]
  208.  
  209. " Fast saving
  210. nmap <silent> <leader>w :write<cr>
  211.  
  212. " Close current window
  213. nmap <silent> <leader>q :quit<cr>
  214.  
  215. " vim: ft=vim et
Add Comment
Please, Sign In to add comment