Advertisement
rharder

vimrc

Feb 6th, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 9.43 KB | None | 0 0
  1. " http://pastebin.com/raw/yYwjR8qa
  2. set number
  3. syntax on
  4. set tabstop=2
  5. set shiftwidth=2
  6. set expandtab
  7. set autoindent
  8. set nobk
  9. if has("mouse")
  10.       set mouse=a
  11. endif
  12.  
  13. nnoremap <C-J> <C-W><C-J>
  14. nnoremap <C-K> <C-W><C-K>
  15. nnoremap <C-L> <C-W><C-L>
  16. nnoremap <C-H> <C-W><C-H>
  17. set splitbelow
  18. set splitright
  19.  
  20.  
  21. " An example for a vimrc file.
  22. "
  23. " Maintainer:   Bram Moolenaar <Bram@vim.org>
  24. " Last change:  2002 Sep 19
  25. "
  26. " To use it, copy it to
  27. "     for Unix and OS/2:  ~/.vimrc
  28. "         for Amiga:  s:.vimrc
  29. "  for MS-DOS and Win32:  $VIM\_vimrc
  30. "       for OpenVMS:  sys$login:.vimrc
  31.  
  32. " When started as "evim", evim.vim will already have done these settings.
  33. if v:progname =~? "evim"
  34.   finish
  35. endif
  36.  
  37. " Use Vim settings, rather then Vi settings (much better!).
  38. " This must be first, because it changes other options as a side effect.
  39. set nocompatible
  40.  
  41. " allow backspacing over everything in insert mode
  42. set backspace=indent,eol,start
  43.  
  44. if has("vms")
  45.   set nobackup      " do not keep a backup file, use versions instead
  46. else
  47.   set backup        " keep a backup file
  48. endif
  49. set history=50      " keep 50 lines of command line history
  50. set ruler       " show the cursor position all the time
  51. set showcmd     " display incomplete commands
  52. set incsearch       " do incremental searching
  53.  
  54. " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
  55. " let &guioptions = substitute(&guioptions, "t", "", "g")
  56.  
  57. " Don't use Ex mode, use Q for formatting
  58. map Q gq
  59.  
  60. " This is an alternative that also works in block mode, but the deleted
  61. " text is lost and it only works for putting the current register.
  62. "vnoremap p "_dp
  63.  
  64. " Switch syntax highlighting on, when the terminal has colors
  65. " Also switch on highlighting the last used search pattern.
  66. if &t_Co > 2 || has("gui_running")
  67.   syntax on
  68.   set hlsearch
  69. endif
  70.  
  71. " Only do this part when compiled with support for autocommands.
  72. if has("autocmd")
  73.  
  74.   " Enable file type detection.
  75.   " Use the default filetype settings, so that mail gets 'tw' set to 72,
  76.   " 'cindent' is on in C files, etc.
  77.   " Also load indent files, to automatically do language-dependent indenting.
  78.   filetype plugin indent on
  79.  
  80.   " Put these in an autocmd group, so that we can delete them easily.
  81.   augroup vimrcEx
  82.   au!
  83.  
  84.   " For all text files set 'textwidth' to 78 characters.
  85.   autocmd FileType text setlocal textwidth=78
  86.  
  87.   " When editing a file, always jump to the last known cursor position.
  88.   " Don't do it when the position is invalid or when inside an event handler
  89.   " (happens when dropping a file on gvim).
  90.   autocmd BufReadPost *
  91.     \ if line("'\"") > 0 && line("'\"") <= line("$") |
  92.     \   exe "normal g`\"" |
  93.     \ endif
  94.  
  95.   augroup END
  96.  
  97. else
  98.  
  99.   set autoindent        " always set autoindenting on
  100.  
  101. endif " has("autocmd")
  102. " ViM autocommands for binary plist files
  103. " Copyright (C) 2005 Moritz Heckscher
  104. "
  105. " Note: When a file changes externally and you answer no to vim's question if
  106. " you want to write anyway, the autocommands (e.g. for BufWritePost) are still
  107. " executed, it seems, which could have some unwanted side effects.
  108. "
  109. " This program is free software; you can redistribute it and/or modify
  110. " it under the terms of the GNU General Public License as published by
  111. " the Free Software Foundation; either version 2 of the License, or
  112. " (at your option) any later version.
  113. "
  114. " This program is distributed in the hope that it will be useful,
  115. " but WITHOUT ANY WARRANTY; without even the implied warranty of
  116. " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  117. " GNU General Public License for more details.
  118. augroup plist
  119.   " Delete existing commands (avoid problems if this file is sourced twice)
  120.   autocmd!
  121.  
  122.   " Set binary mode (needs to be set _before_ reading binary files to avoid
  123.   " breaking lines etc; since setting this for normal plist files doesn't
  124.   " hurt and it's not yet known whether or not the file to be read is stored
  125.   " in binary format, set the option in any case to be sure).
  126.   " Do it before editing a file in a new buffer and before reading a file
  127.   " into in an existing buffer (using ':read foo.plist').
  128.   autocmd BufReadPre,FileReadPre *.plist set binary
  129.  
  130.   " Define a little function to convert binary files if necessary...
  131.   fun MyBinaryPlistReadPost()
  132.           " Check if the first line just read in indicates a binary plist
  133.           if getline("'[") =~ "^bplist"
  134.                   " Filter lines read into buffer (convert to XML with plutil)
  135.                   '[,']!plutil -convert xml1 /dev/stdin -o /dev/stdout
  136.                   " Many people seem to want to save files originally stored
  137.                   " in binary format as such after editing, so memorize format.
  138.                   let b:saveAsBinaryPlist = 1
  139.           endif
  140.           " Yeah, plain text (finally or all the way through, either way...)!
  141.           set nobinary
  142.           " Trigger file type detection to get syntax coloring etc. according
  143.           " to file contents (alternative: 'setfiletype xml' to force xml).
  144.           filetype detect
  145.   endfun
  146.   " ... and call it just after editing a file in a new buffer...
  147.   autocmd BufReadPost *.plist call MyBinaryPlistReadPost()
  148.   " ... or when reading a file into an existing buffer (in that case, don't
  149.   " save as binary later on).
  150.   autocmd FileReadPost *.plist call MyBinaryPlistReadPost() | let b:saveAsBinaryPlist = 0
  151.  
  152.   " Define and use functions for conversion back to binary format
  153.   fun MyBinaryPlistWritePre()
  154.           if exists("b:saveAsBinaryPlist") && b:saveAsBinaryPlist
  155.                   " Must set binary mode before conversion (for EOL settings)
  156.                   set binary
  157.                   " Convert buffer lines to be written to binary
  158.                   silent '[,']!plutil -convert binary1 /dev/stdin -o /dev/stdout
  159.                   " If there was a problem, e.g. when the file contains syntax
  160.                   " errors, undo the conversion and go back to nobinary so the
  161.                   " file will be saved in text format.
  162.                   if v:shell_error | undo | set nobinary | endif
  163.           endif
  164.   endfun
  165.   autocmd BufWritePre,FileWritePre *.plist call MyBinaryPlistWritePre()
  166.   fun MyBinaryPlistWritePost()
  167.           " If file was to be written in binary format and there was no error
  168.           " doing the conversion, ...
  169.           if exists("b:saveAsBinaryPlist") && b:saveAsBinaryPlist && !v:shell_error
  170.                   " ... undo the conversion and go back to nobinary so the
  171.                   " lines are shown as text again in vim.
  172.                   undo
  173.                   set nobinary
  174.           endif
  175.   endfun
  176.   autocmd BufWritePost,FileWritePost *.plist call MyBinaryPlistWritePost()
  177. augroup END
  178.  
  179.  
  180. " Vim syntax file
  181. " Language: Rich Text Format
  182. "       "*.rtf" files
  183. "
  184. " The Rich Text Format (RTF) Specification is a method of encoding formatted
  185. " text and graphics for easy transfer between applications.
  186. " .hlp (windows help files) use compiled rtf files
  187. " rtf documentation at http://night.primate.wisc.edu/software/RTF/
  188. "
  189. " Maintainer:   Dominique StÈphan (dominique@mggen.com)
  190. " URL: http://www.mggen.com/vim/syntax/rtf.zip
  191. " Last Change:  2001 Mai 02
  192.  
  193. " TODO: render underline, italic, bold
  194.  
  195. " For version 5.x: Clear all syntax items
  196. " For version 6.x: Quit when a syntax file was already loaded
  197. if version < 600
  198.   syntax clear
  199. elseif exists("b:current_syntax")
  200.   finish
  201. endif
  202.  
  203. " case on (all controls must be lower case)
  204. syn case match
  205.  
  206. " Control Words
  207. syn match rtfControlWord    "\\[a-z]\+[\-]\=[0-9]*"
  208.  
  209. " New Control Words (not in the 1987 specifications)
  210. syn match rtfNewControlWord "\\\*\\[a-z]\+[\-]\=[0-9]*"
  211.  
  212. " Control Symbol : any \ plus a non alpha symbol, *, \, { and } and '
  213. syn match rtfControlSymbol  "\\[^a-zA-Z\*\{\}\\']"
  214.  
  215. " { } and \ are special characters, to use them
  216. " we add a backslash \
  217. syn match rtfCharacter      "\\\\"
  218. syn match rtfCharacter      "\\{"
  219. syn match rtfCharacter      "\\}"
  220. " Escaped characters (for 8 bytes characters upper than 127)
  221. syn match rtfCharacter      "\\'[A-Za-z0-9][A-Za-z0-9]"
  222. " Unicode
  223. syn match rtfUnicodeCharacter   "\\u[0-9][0-9]*"
  224.  
  225. " Color values, we will put this value in Red, Green or Blue
  226. syn match rtfRed        "\\red[0-9][0-9]*"
  227. syn match rtfGreen      "\\green[0-9][0-9]*"
  228. syn match rtfBlue       "\\blue[0-9][0-9]*"
  229.  
  230. " Some stuff for help files
  231. syn match rtfFootNote "[#$K+]{\\footnote.*}" contains=rtfControlWord,rtfNewControlWord
  232.  
  233. " Define the default highlighting.
  234. " For version 5.7 and earlier: only when not done already
  235. " For version 5.8 and later: only when an item doesn't have highlighting yet
  236. if version >= 508 || !exists("did_rtf_syntax_inits")
  237.   if version < 508
  238.     let did_rtf_syntax_inits = 1
  239.     command -nargs=+ HiLink hi link <args>
  240.   else
  241.     command -nargs=+ HiLink hi def link <args>
  242.   endif
  243.  
  244.  
  245.    HiLink rtfControlWord        Statement
  246.    HiLink rtfNewControlWord     Special
  247.    HiLink rtfControlSymbol      Constant
  248.    HiLink rtfCharacter          Character
  249.    HiLink rtfUnicodeCharacter   SpecialChar
  250.    HiLink rtfFootNote           Comment
  251.  
  252.    " Define colors for the syntax file
  253.    hi rtfRed          term=underline cterm=underline ctermfg=DarkRed gui=underline guifg=DarkRed
  254.    hi rtfGreen        term=underline cterm=underline ctermfg=DarkGreen gui=underline guifg=DarkGreen
  255.    hi rtfBlue         term=underline cterm=underline ctermfg=DarkBlue gui=underline guifg=DarkBlue
  256.  
  257.    HiLink rtfRed    rtfRed
  258.    HiLink rtfGreen  rtfGreen
  259.    HiLink rtfBlue   rtfBlue
  260.  
  261.   delcommand HiLink
  262. endif
  263.  
  264.  
  265. let b:current_syntax = "rtf"
  266.  
  267. " vim:ts=8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement