Guest User

Untitled

a guest
Jul 19th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. " An example for a vimrc file.
  2. "
  3. " Maintainer: Bram Moolenaar <Bram@vim.org>
  4. " Last change: 2002 Sep 19
  5. "
  6. " To use it, copy it to
  7. " for Unix and OS/2: ~/.vimrc
  8. " for Amiga: s:.vimrc
  9. " for MS-DOS and Win32: $VIM\_vimrc
  10. " for OpenVMS: sys$login:.vimrc
  11.  
  12. " When started as "evim", evim.vim will already have done these settings.
  13. if v:progname =~? "evim"
  14. finish
  15. endif
  16.  
  17. " Use Vim settings, rather then Vi settings (much better!).
  18. " This must be first, because it changes other options as a side effect.
  19. set nocompatible
  20.  
  21. " set backup and swap options
  22. set nobackup " back up current file, delete afterwards
  23. set writebackup " back up current file, delete afterwards
  24. set backupdir=~/.vim/tmp,/tmp,. " backups directory
  25. set dir=~/.vim/tmp,/tmp,. " swap directory
  26.  
  27. " allow backspacing over everything in insert mode
  28. set backspace=indent,eol,start
  29.  
  30. set history=100 " keep 100 lines of command line history
  31. set matchpairs+=<:> " match to be used witrh %
  32.  
  33. " ruler bar options
  34. set ruler " show the cursor position all the time
  35. set showcmd " display incomplete commands
  36. set laststatus=2
  37.  
  38. " search options
  39. set incsearch " do incremental searching
  40. set ignorecase
  41.  
  42. " tab space configuration
  43. set tabstop=4
  44. set softtabstop=4
  45. set shiftwidth=4
  46. set expandtab
  47.  
  48. set nowrap
  49.  
  50. " Tell Vim the terminal supports 256 colors
  51. "set t_Co=256
  52.  
  53. " Accerelate things up when working on a gnome-terminal
  54. set scrolljump=5
  55.  
  56. " Mouse support even on terminals (in all modes)
  57. set mouse=a
  58.  
  59. " Hack for desabling bells and flashes.
  60. autocmd VimEnter * set vb t_vb=
  61.  
  62. " search column 80 characters and highlight them
  63. autocmd BufWinEnter *.py let w:m2=matchadd('ErrorMsg', '\%<82v.\%>81v', -1)
  64.  
  65. " Tell Vim our compiler will be pylint
  66. " autocmd FileType python compiler pylint
  67.  
  68. " let g:color_scheme = 0
  69. " function! ToggleColorScheme()
  70. " if g:color_scheme
  71. " colorscheme default
  72. " else
  73. " " User Borland classic-IDE color scheme
  74. " colorscheme borland
  75. " endif
  76. " let g:color_scheme = !g:color_scheme
  77. " endfunction
  78.  
  79. map <silent> <C-m> :call ToggleColorScheme()<CR>
  80.  
  81.  
  82. " Don't use Ex mode, use Q for formatting
  83. map Q gq
  84.  
  85. " This is an alternative that also works in block mode, but the deleted
  86. " text is lost and it only works for putting the current register.
  87. "vnoremap p "_dp
  88.  
  89. " GUI options
  90. if has("gui_running")
  91. set guifont=Monospace\ 12
  92. let g:winManagerWindowLayout = "FileExplorer,TagsExplorer"
  93. let g:TagBase_CleanUp = '2'
  94.  
  95. " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
  96. " let &guioptions = substitute(&guioptions, "t", "", "g")
  97.  
  98. " Remove menus and guioptions
  99. aunmenu *
  100. set guioptions-=m
  101. endif
  102.  
  103. " Switch syntax highlighting on, when the terminal has colors
  104. " Also switch on highlighting the last used search pattern.
  105. if &t_Co > 2 || has("gui_running")
  106. syntax on
  107. set hlsearch
  108. endif
  109.  
  110. " Only do this part when compiled with support for autocommands.
  111. if has("autocmd")
  112.  
  113. " Enable file type detection.
  114. " Use the default filetype settings, so that mail gets 'tw' set to 72,
  115. " 'cindent' is on in C files, etc.
  116. " Also load indent files, to automatically do language-dependent indenting.
  117. filetype plugin indent on
  118.  
  119. " Put these in an autocmd group, so that we can delete them easily.
  120. augroup vimrcEx
  121. au!
  122.  
  123. " For all text files set 'textwidth' to 78 characters.
  124. autocmd FileType text setlocal textwidth=78
  125.  
  126. " When editing a file, always jump to the last known cursor position.
  127. " Don't do it when the position is invalid or when inside an event handler
  128. " (happens when dropping a file on gvim).
  129. autocmd BufReadPost *
  130. \ if line("'\"") > 0 && line("'\"") <= line("$") |
  131. \ exe "normal g`\"" |
  132. \ endif
  133.  
  134. augroup END
  135.  
  136. else
  137.  
  138. set autoindent " always set autoindenting on
  139.  
  140. endif " has("autocmd")
Add Comment
Please, Sign In to add comment