Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " http://pastebin.com/raw/yYwjR8qa
- set number
- syntax on
- set tabstop=2
- set shiftwidth=2
- set expandtab
- set autoindent
- set nobk
- if has("mouse")
- set mouse=a
- endif
- nnoremap <C-J> <C-W><C-J>
- nnoremap <C-K> <C-W><C-K>
- nnoremap <C-L> <C-W><C-L>
- nnoremap <C-H> <C-W><C-H>
- set splitbelow
- set splitright
- " An example for a vimrc file.
- "
- " Maintainer: Bram Moolenaar <Bram@vim.org>
- " Last change: 2002 Sep 19
- "
- " To use it, copy it to
- " for Unix and OS/2: ~/.vimrc
- " for Amiga: s:.vimrc
- " for MS-DOS and Win32: $VIM\_vimrc
- " for OpenVMS: sys$login:.vimrc
- " When started as "evim", evim.vim will already have done these settings.
- if v:progname =~? "evim"
- finish
- endif
- " Use Vim settings, rather then Vi settings (much better!).
- " This must be first, because it changes other options as a side effect.
- set nocompatible
- " allow backspacing over everything in insert mode
- set backspace=indent,eol,start
- if has("vms")
- set nobackup " do not keep a backup file, use versions instead
- else
- set backup " keep a backup file
- endif
- set history=50 " keep 50 lines of command line history
- set ruler " show the cursor position all the time
- set showcmd " display incomplete commands
- set incsearch " do incremental searching
- " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
- " let &guioptions = substitute(&guioptions, "t", "", "g")
- " Don't use Ex mode, use Q for formatting
- map Q gq
- " This is an alternative that also works in block mode, but the deleted
- " text is lost and it only works for putting the current register.
- "vnoremap p "_dp
- " Switch syntax highlighting on, when the terminal has colors
- " Also switch on highlighting the last used search pattern.
- if &t_Co > 2 || has("gui_running")
- syntax on
- set hlsearch
- endif
- " Only do this part when compiled with support for autocommands.
- if has("autocmd")
- " Enable file type detection.
- " Use the default filetype settings, so that mail gets 'tw' set to 72,
- " 'cindent' is on in C files, etc.
- " Also load indent files, to automatically do language-dependent indenting.
- filetype plugin indent on
- " Put these in an autocmd group, so that we can delete them easily.
- augroup vimrcEx
- au!
- " For all text files set 'textwidth' to 78 characters.
- autocmd FileType text setlocal textwidth=78
- " When editing a file, always jump to the last known cursor position.
- " Don't do it when the position is invalid or when inside an event handler
- " (happens when dropping a file on gvim).
- autocmd BufReadPost *
- \ if line("'\"") > 0 && line("'\"") <= line("$") |
- \ exe "normal g`\"" |
- \ endif
- augroup END
- else
- set autoindent " always set autoindenting on
- endif " has("autocmd")
- " ViM autocommands for binary plist files
- " Copyright (C) 2005 Moritz Heckscher
- "
- " Note: When a file changes externally and you answer no to vim's question if
- " you want to write anyway, the autocommands (e.g. for BufWritePost) are still
- " executed, it seems, which could have some unwanted side effects.
- "
- " This program is free software; you can redistribute it and/or modify
- " it under the terms of the GNU General Public License as published by
- " the Free Software Foundation; either version 2 of the License, or
- " (at your option) any later version.
- "
- " This program is distributed in the hope that it will be useful,
- " but WITHOUT ANY WARRANTY; without even the implied warranty of
- " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- " GNU General Public License for more details.
- augroup plist
- " Delete existing commands (avoid problems if this file is sourced twice)
- autocmd!
- " Set binary mode (needs to be set _before_ reading binary files to avoid
- " breaking lines etc; since setting this for normal plist files doesn't
- " hurt and it's not yet known whether or not the file to be read is stored
- " in binary format, set the option in any case to be sure).
- " Do it before editing a file in a new buffer and before reading a file
- " into in an existing buffer (using ':read foo.plist').
- autocmd BufReadPre,FileReadPre *.plist set binary
- " Define a little function to convert binary files if necessary...
- fun MyBinaryPlistReadPost()
- " Check if the first line just read in indicates a binary plist
- if getline("'[") =~ "^bplist"
- " Filter lines read into buffer (convert to XML with plutil)
- '[,']!plutil -convert xml1 /dev/stdin -o /dev/stdout
- " Many people seem to want to save files originally stored
- " in binary format as such after editing, so memorize format.
- let b:saveAsBinaryPlist = 1
- endif
- " Yeah, plain text (finally or all the way through, either way...)!
- set nobinary
- " Trigger file type detection to get syntax coloring etc. according
- " to file contents (alternative: 'setfiletype xml' to force xml).
- filetype detect
- endfun
- " ... and call it just after editing a file in a new buffer...
- autocmd BufReadPost *.plist call MyBinaryPlistReadPost()
- " ... or when reading a file into an existing buffer (in that case, don't
- " save as binary later on).
- autocmd FileReadPost *.plist call MyBinaryPlistReadPost() | let b:saveAsBinaryPlist = 0
- " Define and use functions for conversion back to binary format
- fun MyBinaryPlistWritePre()
- if exists("b:saveAsBinaryPlist") && b:saveAsBinaryPlist
- " Must set binary mode before conversion (for EOL settings)
- set binary
- " Convert buffer lines to be written to binary
- silent '[,']!plutil -convert binary1 /dev/stdin -o /dev/stdout
- " If there was a problem, e.g. when the file contains syntax
- " errors, undo the conversion and go back to nobinary so the
- " file will be saved in text format.
- if v:shell_error | undo | set nobinary | endif
- endif
- endfun
- autocmd BufWritePre,FileWritePre *.plist call MyBinaryPlistWritePre()
- fun MyBinaryPlistWritePost()
- " If file was to be written in binary format and there was no error
- " doing the conversion, ...
- if exists("b:saveAsBinaryPlist") && b:saveAsBinaryPlist && !v:shell_error
- " ... undo the conversion and go back to nobinary so the
- " lines are shown as text again in vim.
- undo
- set nobinary
- endif
- endfun
- autocmd BufWritePost,FileWritePost *.plist call MyBinaryPlistWritePost()
- augroup END
- " Vim syntax file
- " Language: Rich Text Format
- " "*.rtf" files
- "
- " The Rich Text Format (RTF) Specification is a method of encoding formatted
- " text and graphics for easy transfer between applications.
- " .hlp (windows help files) use compiled rtf files
- " rtf documentation at http://night.primate.wisc.edu/software/RTF/
- "
- " Maintainer: Dominique StÈphan (dominique@mggen.com)
- " URL: http://www.mggen.com/vim/syntax/rtf.zip
- " Last Change: 2001 Mai 02
- " TODO: render underline, italic, bold
- " For version 5.x: Clear all syntax items
- " For version 6.x: Quit when a syntax file was already loaded
- if version < 600
- syntax clear
- elseif exists("b:current_syntax")
- finish
- endif
- " case on (all controls must be lower case)
- syn case match
- " Control Words
- syn match rtfControlWord "\\[a-z]\+[\-]\=[0-9]*"
- " New Control Words (not in the 1987 specifications)
- syn match rtfNewControlWord "\\\*\\[a-z]\+[\-]\=[0-9]*"
- " Control Symbol : any \ plus a non alpha symbol, *, \, { and } and '
- syn match rtfControlSymbol "\\[^a-zA-Z\*\{\}\\']"
- " { } and \ are special characters, to use them
- " we add a backslash \
- syn match rtfCharacter "\\\\"
- syn match rtfCharacter "\\{"
- syn match rtfCharacter "\\}"
- " Escaped characters (for 8 bytes characters upper than 127)
- syn match rtfCharacter "\\'[A-Za-z0-9][A-Za-z0-9]"
- " Unicode
- syn match rtfUnicodeCharacter "\\u[0-9][0-9]*"
- " Color values, we will put this value in Red, Green or Blue
- syn match rtfRed "\\red[0-9][0-9]*"
- syn match rtfGreen "\\green[0-9][0-9]*"
- syn match rtfBlue "\\blue[0-9][0-9]*"
- " Some stuff for help files
- syn match rtfFootNote "[#$K+]{\\footnote.*}" contains=rtfControlWord,rtfNewControlWord
- " Define the default highlighting.
- " For version 5.7 and earlier: only when not done already
- " For version 5.8 and later: only when an item doesn't have highlighting yet
- if version >= 508 || !exists("did_rtf_syntax_inits")
- if version < 508
- let did_rtf_syntax_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
- HiLink rtfControlWord Statement
- HiLink rtfNewControlWord Special
- HiLink rtfControlSymbol Constant
- HiLink rtfCharacter Character
- HiLink rtfUnicodeCharacter SpecialChar
- HiLink rtfFootNote Comment
- " Define colors for the syntax file
- hi rtfRed term=underline cterm=underline ctermfg=DarkRed gui=underline guifg=DarkRed
- hi rtfGreen term=underline cterm=underline ctermfg=DarkGreen gui=underline guifg=DarkGreen
- hi rtfBlue term=underline cterm=underline ctermfg=DarkBlue gui=underline guifg=DarkBlue
- HiLink rtfRed rtfRed
- HiLink rtfGreen rtfGreen
- HiLink rtfBlue rtfBlue
- delcommand HiLink
- endif
- let b:current_syntax = "rtf"
- " vim:ts=8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement