Advertisement
Guest User

vimrc

a guest
Oct 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 4.62 KB | None | 0 0
  1. set nocompatible              " be iMproved, required                                                      
  2. filetype off                  " required
  3.  
  4. "set the runtime path to include Vundle and initialize
  5. set rtp+=~/.vim/bundle/Vundle.vim
  6. call vundle#begin()
  7. "alternatively, pass a path where Vundle should install plugins
  8. "call vundle#begin('~/some/path/here')
  9.  
  10. "let Vundle manage Vundle, required
  11. Plugin 'VundleVim/Vundle.vim'
  12.  
  13. "The following are examples of different formats supported.
  14. "Keep Plugin commands between vundle#begin/end.
  15. "plugin on GitHub repo
  16. Plugin 'tpope/vim-fugitive'
  17. "plugin from http://vim-scripts.org/vim/scripts.html
  18. "Plugin 'L9'
  19. "Git plugin not hosted on GitHub
  20. Plugin 'git://git.wincent.com/command-t.git'
  21. "git repos on your local machine (i.e. when working on your own plugin)
  22. Plugin 'file:///home/gmarik/path/to/plugin'
  23. "The sparkup vim script is in a subdirectory of this repo called vim.
  24. "Pass the path to set the runtimepath properly.
  25. Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
  26. "Install L9 and avoid a Naming conflict if you've already installed a
  27. "different version somewhere else.
  28. "Plugin 'ascenator/L9', {'name': 'newL9'}
  29.  
  30. "All of your Plugins must be added before the following line"
  31. Plugin 'fatih/vim-go'
  32. Bundle "myusuf3/numbers.vim"
  33.  
  34. call vundle#end()            " required
  35. filetype plugin indent on    " required
  36. "To ignore plugin indent changes, instead use:
  37. "filetype plugin on
  38. "
  39. " Brief help
  40. ":PluginList       - lists configured plugins
  41. ":PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
  42. ":PluginSearch foo - searches for foo; append `!` to refresh local cache
  43. ":PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
  44. "
  45. " see :h vundle for more details or wiki for FAQ
  46. " Put your non-Plugin stuff after this line
  47.  
  48.  
  49.  
  50. set ruler
  51. set clipboard+=unnamed
  52.  
  53.  
  54. set showmatch
  55.  
  56. highlight Normal ctermbg=Blue
  57. highlight Comment ctermbg=DarkGray
  58. highlight Constant ctermbg=Blue
  59. highlight Normal ctermbg=Black
  60. highlight NonText ctermbg=Black
  61. highlight Special ctermbg=DarkMagenta
  62. highlight Cursor ctermbg=Green
  63.  
  64. " this next line is needed to enable your custom colors:
  65. syntax enable
  66.  
  67.  
  68. " Update file when changed from the outside
  69. set autoread
  70.  
  71. " Highlight current line
  72. set cursorline
  73.  
  74. " Hide buffers instead of closing
  75. set hidden
  76.  
  77. " Line settings
  78. set nowrap
  79. set number
  80. set numberwidth=3
  81.  
  82. " Indentation settings
  83. " I want spaces
  84. set expandtab
  85.  
  86. " with a smart tab
  87. set smarttab
  88.  
  89. " and 1 tab == 4 spaces
  90. set shiftwidth=4
  91. set softtabstop=4
  92. set shiftround
  93. set copyindent
  94.  
  95. " Linebreak when obsessive
  96. set lbr
  97. set tw=500
  98.  
  99. " Auto indent
  100. set ai
  101.  
  102. " Smart indent
  103. set si
  104.  
  105. " Wrapping
  106. set nowrap
  107.  
  108. " Status bar
  109. set laststatus=2
  110.  
  111. " Folding
  112.  
  113.  
  114. " Searching
  115. set ignorecase
  116. set hlsearch
  117. set incsearch
  118. set smartcase
  119.  
  120. " Show matching brackets
  121. set showmatch
  122. set mat=2
  123.  
  124. " Dont redraw while executing macros
  125. set lazyredraw
  126.  
  127. " Set 80-char column (off by default)
  128. " set colorcolumn=80
  129. highlight ColorColumn ctermbg=233
  130.  
  131. " Encoding
  132. set encoding=utf-8
  133. set fileencoding=utf-8
  134. set fileencodings=utf-8
  135.  
  136. " netrw configs
  137. let g:netrw_banner = 0
  138.  
  139. " Backspace tweaks
  140. set backspace=indent,eol,start
  141. set whichwrap+=<,>,h,l
  142.  
  143. " Fat finger fixes
  144. cnoreabbrev W! w!
  145. cnoreabbrev Q! q!
  146. cnoreabbrev Qall! qall!
  147. cnoreabbrev Wq wq
  148. cnoreabbrev Wa wa
  149. cnoreabbrev wQ wq
  150. cnoreabbrev WQ wq
  151. cnoreabbrev W w
  152. cnoreabbrev Q q
  153. cnoreabbrev Qall qall
  154.  
  155. " Custom commands
  156. command Todo vimgrep /TODO\C/ **/*.* | copen
  157. command Note vimgrep /NOTE\C/ **/*.* | copen
  158. command Fix vimgrep /FIXME\C/ **/*.* | copen
  159. command CDC cd %:p:h
  160.  
  161. " Retain visual mode after > and <
  162. vmap < <gv
  163. vmap > >gv
  164.  
  165. " Move visual block
  166. vnoremap J :m '>+1<cr>gv=gv
  167. vnoremap K :m '<-2<cr>gv=gv
  168.  
  169.  
  170. " For encoding/formats
  171. set encoding=utf-8 nobomb
  172. set fileformats=unix,dos,mac
  173.  
  174. " For editing binaries
  175. set binary
  176.  
  177. " Send more characters at a given time
  178. set ttyfast
  179.  
  180. " Show partial command on last line
  181. set showcmd
  182.  
  183. " How to split new windows
  184. set splitbelow splitright
  185.  
  186. " ======= Colors and Fonts ======== "
  187.  
  188. " Syntax highlighting
  189. syntax on
  190.  
  191. " Enable dark background
  192. set background=dark
  193.  
  194. " Enable 256 colormode
  195. set t_Co=256
  196.  
  197. " Mouse tweak
  198. set mousemodel=popup
  199.  
  200. " ====== COMMANDS/MAPPINGS ======= "
  201.  
  202. let mapleader=","   " Set the mapleader to be ,
  203.  
  204. "
  205. nnoremap ; :
  206. map q: <Nop>
  207. cmap w!! w !sudo tee > /dev/null %
  208.  
  209. " ===== GO ===== "
  210. " Clear filetype flags before changing runtimepath to force Vim to reload them.
  211. filetype off
  212. filetype plugin indent off
  213. set runtimepath+=$GOROOT/misc/vim
  214. filetype plugin indent on
  215. syntax on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement