Advertisement
vlig

_vimrc

Mar 29th, 2016
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.33 KB | None | 0 0
  1. " When started as "evim", evim.vim will already have done these settings.
  2. if v:progname =~? "evim"
  3. finish
  4. endif
  5.  
  6. " Use Vim settings, rather than Vi settings (much better!).
  7. " This must be first, because it changes other options as a side effect.
  8. set nocompatible
  9.  
  10. " allow backspacing over everything in insert mode
  11. set backspace=indent,eol,start
  12.  
  13. if has("vms")
  14. set nobackup " do not keep a backup file, use versions instead
  15. else
  16. set backup " keep a backup file
  17. endif
  18. set history=50 " keep 50 lines of command line history
  19. set ruler " show the cursor position all the time
  20. set showcmd " display incomplete commands
  21. set incsearch " do incremental searching
  22.  
  23. " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
  24. " let &guioptions = substitute(&guioptions, "t", "", "g")
  25.  
  26. " Don't use Ex mode, use Q for formatting
  27. map Q gq
  28.  
  29. " CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
  30. " so that you can undo CTRL-U after inserting a line break.
  31. inoremap <C-U> <C-G>u<C-U>
  32.  
  33. " In many terminal emulators the mouse works just fine, thus enable it.
  34. if has('mouse')
  35. set mouse=a
  36. endif
  37.  
  38. " Switch syntax highlighting on, when the terminal has colors
  39. " Also switch on highlighting the last used search pattern.
  40. if &t_Co > 2 || has("gui_running")
  41. syntax on
  42. set hlsearch
  43. endif
  44.  
  45. " Only do this part when compiled with support for autocommands.
  46. if has("autocmd")
  47.  
  48. " Enable file type detection.
  49. " Use the default filetype settings, so that mail gets 'tw' set to 72,
  50. " 'cindent' is on in C files, etc.
  51. " Also load indent files, to automatically do language-dependent indenting.
  52. filetype plugin indent on
  53.  
  54. " Put these in an autocmd group, so that we can delete them easily.
  55. augroup vimrcEx
  56. au!
  57.  
  58. " For all text files set 'textwidth' to 78 characters.
  59. autocmd FileType text setlocal textwidth=78
  60.  
  61. " When editing a file, always jump to the last known cursor position.
  62. " Don't do it when the position is invalid or when inside an event handler
  63. " (happens when dropping a file on gvim).
  64. " Also don't do it when the mark is in the first line, that is the default
  65. " position when opening a file.
  66. autocmd BufReadPost *
  67. \ if line("'\"") > 1 && line("'\"") <= line("$") |
  68. \ exe "normal! g`\"" |
  69. \ endif
  70.  
  71. augroup END
  72.  
  73. else
  74.  
  75. set autoindent " always set autoindenting on
  76.  
  77. endif " has("autocmd")
  78.  
  79. " Convenient command to see the difference between the current buffer and the
  80. " file it was loaded from, thus the changes you made.
  81. " Only define it when not defined already.
  82. if !exists(":DiffOrig")
  83. command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
  84. \ | wincmd p | diffthis
  85. endif
  86.  
  87. "set encoding=utf8
  88. set laststatus=2 "показывать строку статуса
  89. set statusline=%f%m%r%h%w\ %y\ enc:%{&enc}\ ff:%{&ff}\ fenc:%{&fenc}%=(ch:%3b\ hex:%2B)\ col:%2c\ line:%2l/%L\ [%2p%%]
  90.  
  91. "список кодировок для автоопределения
  92. set fileencodings=utf-8,cp1251,koi8-r,cp866
  93. "перемещение по русским словам
  94. set iskeyword=@,a-z,A-Z,48-57,_,128-175,192-255
  95.  
  96. set nu "номера строк
  97. set shiftwidth=4 "размер сдвига при нажатии на << и >>
  98. set tabstop=4 "размер табуляции
  99. set softtabstop=4
  100. set smarttab
  101. set smartindent "умная автоматическая расстановка отступов
  102. set wrap "перенос строк
  103. set linebreak "перенос строк по словам, а не по буквам
  104. set incsearch "при поиске перескакивать в процессе
  105. set nowrapscan "останавливать поиск в конце файла
  106. set ignorecase "игнорировать регистр букв при поиске
  107. set foldenable
  108. set fdm=indent
  109. set foldopen=all
  110. "set autochdir
  111.  
  112. "отключение бэкапов
  113. set nobackup
  114. set nowritebackup
  115. "set noswapfile
  116.  
  117. "автодополнение скобок
  118. imap ( ()<LEFT>
  119. imap [ []<LEFT>
  120. imap { {}<LEFT>
  121.  
  122. " Ввод команд при русской раскладке
  123. " переключение раскладок по <C-^>
  124. set keymap=russian-jcukenwin
  125. " раскладка по умолчанию - английская
  126. set iminsert=0
  127.  
  128. set guifont=DejaVu_Sans_Mono:h10:cRUSSIAN
  129. set guioptions-=T
  130. color desert
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement