view .vimrc @ 100:a4cd935561d4 dml-dockerised tip

small updates and version pin for cliopatria
author wolffd <wolffd.mail@googlemail.com>
date Fri, 29 Jun 2018 17:48:41 +0100
parents 19d1235ce229
children
line wrap: on
line source
" An example for a vimrc file.
"
" Maintainer:	Bram Moolenaar <Bram@vim.org>
" Last change:	2001 Jul 18
"
" 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

" samer: 
set showmatch				" show matching brackets
set ignorecase				" case insensitive search...
set smartcase				" ...except if string includes upper-case

" 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

set autoindent		" always set autoindenting on
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

" Make p in Visual mode replace the selected text with the "" register.
vnoremap p <Esc>:let current_reg = @"<CR>gvs<C-R>=current_reg<CR><Esc>

" 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

  " For all text files set 'textwidth' to 78 characters.
  autocmd FileType text setlocal textwidth=78
  autocmd FileType python setlocal tabstop=4|set shiftwidth=4|set expandtab
  autocmd FileType cs setlocal tabstop=4|set shiftwidth=4|set expandtab
  autocmd FileType scheme setlocal expandtab|set tabstop=2
  autocmd FileType ocaml setlocal tabstop=2|set shiftwidth=2|set expandtab
  autocmd FileType haskell setlocal tabstop=2|set shiftwidth=2|set expandtab
  autocmd FileType prolog setlocal tabstop=3|set shiftwidth=3|set expandtab
  autocmd Syntax ocaml set commentstring=(*%s*)
  autocmd Syntax scheme set commentstring=;%s
  autocmd FileType matlab setlocal tabstop=2|set shiftwidth=2

  " 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

endif " has("autocmd")

" Original vimrc from Mac OS X bundle
" System vimrc file for Mac OS X
" Author:  Benji Fisher <benji@member.AMS.org>
" Last modified:  5 April 2003

" Get a good value for $PATH.  For example, if teTeX is installed, this
" should add the path to tex, pdflatex, etc.
" This should only make a difference when vim is started from the Finder or
" with open.
let $PATH = system("printenv PATH")
let $PATH = substitute($PATH, "\<C-J>$", "", "")

" If running in a Terminal window, set the terminal type to allow syntax
" highlighting.
" Otherwise, change directory on startup.
if !has("gui_running")
	set term=xterm-color
else
	autocmd VimEnter * if getcwd()=="/" | if strlen(@%) | cd %:p:h | else | cd | endif | endif
endif

set title
set mouse=a
set mousefocus=on
set tabstop=3
set softtabstop=3
set shiftwidth=3
set smarttab
" set ignorecase

set nobackup          " do not keep a backup file, use versions instead
" set backup            " keep a backup file

" Fix search highlighting colors and customise status bar and vertical split
hi clear Search
hi clear StatusLine
hi clear StatusLineNC
hi clear VertSplit

hi Search term=underline cterm=underline gui=NONE
hi StatusLine term=bold,underline cterm=underline,bold gui=bold guifg=blue guibg=white
hi StatusLineNC  term=underline cterm=underline guifg=white guibg=blue
hi VertSplit term=bold cterm=bold
hi MatchParen term=underline cterm=bold ctermbg=none  gui=underline

au BufWinEnter,BufNewFile,BufRead *.lytex set filetype=tex
au BufWinEnter,BufNewFile,BufRead *.icl set filetype=prolog
au BufWinEnter,BufNewFile,BufRead *.pha set filetype=prolog
au BufWinEnter,BufNewFile,BufRead *.psm set filetype=prolog
au BufWinEnter,BufNewFile,BufRead *.chr set filetype=prolog
au BufWinEnter,BufNewFile,BufRead *.yap set filetype=prolog
au BufWinEnter,BufNewFile,BufRead *.chrism set filetype=prolog
au BufWinEnter,BufNewFile,BufRead *.curry set filetype=haskell
au BufWinEnter,BufNewFile,BufRead *.kern set filetype=humdrum
au BufWinEnter,BufNewFile,BufRead *.krn set filetype=humdrum
au BufWinEnter,BufNewFile,BufRead *.church set filetype=scheme
au BufWinEnter,BufNewFile,BufRead .ocamlinit set filetype=ocaml

" for vim-latex
set grepprg=grep\ -nH\ $*
set wildmenu
let g:Tex_AutoFolding=0
let g:tex_flavor='latex'
let mapleader="\\"

" for pasting code
set pastetoggle=<F2>

cmap w!! w !sudo tee % >/dev/null<CR>:e!<CR><CR>
" activate visual mode in normal mode
nmap <S-Up> V
nmap <S-Down> V
" " these are mapped in visual mode
vmap <S-Up> k
vmap <S-Down> j