Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " Set vim to be nocompatible, so as not to be compatible with vi
- " Highly recommended: Has to be the first line.
- set nocompatible
- "" #### ### For Windows Configuration ### ###
- ""
- " source $VIMRUNTIME/vimrc_example.vim
- ""
- "" To use the standard MS-Windows way of CTRL-X, CTRL-C and CTRL-V
- "" source $VIMRUNTIME/mswin.vim
- ""
- "" For Cygwin:
- "" -----------
- "" In order to have bash as the shell for win32 vim.exe and gvim.exe, you have
- "" to do the following:
- "
- "" Download vim-7.0-extra.tar.gz; Extract the file and change directory to
- "" src. Build vimrun.exe in the cygwin environment so that the system() call
- "" is executed via bash, not cmd.exe. The command to build vimrun.exe for
- "" cygwin is
- "
- " make -f Make_cyg.mak vimrun.exe
- "
- "" Rename the old vimrun.exe in $VIMRUNTIME to vimrun_cmd.exe,
- "" where $VIMRUNTIME is usually C:\Program Files\path-to-vim-exe
- "" Copy the newly created vimrun.exe to $VIMRUNTIME\
- "
- "" Also set these options in vimrc,
- " set shell=bash.exe
- " set shellcmdflag=-c
- " set shellslash
- "
- " " ### ### ### ###
- " For user-defined files
- " let $VIM = "$HOME/.vim"
- " To automatically insert a closing parenthesis when typing an opening
- " parenthesis
- " :inoremap ( ()<ESC>i
- " :inoremap { {}<ESC>i
- " :inoremap [ []<ESC>i
- " :inoremap < <><ESC>i
- " MATHEMATICA *mma.vim* *ft-mma-syntax* *ft-mathematica-syntax*
- " Empty *.m files will automatically be presumed to be Matlab files unless
- " the following line is in .vimrc:
- " let filetype_m = "mma"
- " To set status line
- set laststatus=2
- " let g:ScreenShellExternal=1
- " When editing a file, always jump to the last known cursor position.
- autocmd BufReadPost *
- \ if line("'\"") > 0 && line("'\"") <= line("$") |
- \ exe "normal g`\"" |
- \ endif
- " For recognizing specific file types
- let file_ext = bufname("%")
- " Wraps line at the 5th column from the right margin and an <EOL> is inserted
- if file_ext =~ '\.txt$' || file_ext =~ '\.tex$' " || file_ext =~ '\.bib$' || file_ext =~ '\.sty$'
- set wrapmargin=5
- endif
- " To wrap long lines
- set wrap
- " if file_ext =~ '\.for$' || file_ext =~ '\.f90$' || file_ext =~ '\.f$'
- " highlight WhitespaceEOL ctermbg=white guibg=white
- " match WhitespaceEOL /^\ \+/
- " highlight RedundantSpaces ctermbg=white guibg=white
- " match RedundantSpaces /\s\+$\| \+\ze\t/
- " endif
- " To handle common typos
- command! Q quit
- command! W write
- command! Wq wq
- command! WQ wq
- " Allow backspacing over everything in insert mode
- set backspace=indent,eol,start
- " To getrid of annoying ~ files
- set nobackup
- " To show current mode
- set showmode
- " Show current uncompleted command
- " set showcmd
- " Show line number,column number always
- set ruler
- " Show report when N lines were changed
- " report=0 means "show all changes"!
- set report=0
- " Show title of file
- set title
- " let &titlestring = hostname()
- " :auto BufEnter * let &titlestring = hostname() . ":" . expand("%:p")
- " set titlestring=%<%F
- " let &titlestring = hostname() . ": " . expand("%P")
- " let &titlestring = hostname() . ": " . expand("%F")
- " :set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%)
- " Ignore filename with the following suffixes when using :edit or :sp
- set suffixes=.aux,.log,.pdf,.ps,.tar,.gz,.tgz,.dvi,.bbl,.blg,.eps,.out,
- \.png,.los,.lof,.lot,.dat,.sty,.xml,.toc,.latexmain,.bm,.idx,.ilg,.ind,
- \.fdb_latexmk
- " call scriptmanager#Activate(["vim-addon-mw-utils"])
- " Allow usage of cursor keys withing insert mode
- " set esckeys
- " Use fast terminal
- " set ttyfast
- " Don't use fast terminal
- " set nottyfast
- " Auto indent
- set autoindent
- " Smart indent
- set smartindent
- " To toggle between set number and set nonumber
- nmap <C-N> :set number! <CR>
- " To actually put line numbers in a file
- " :%!cat -n
- " :nmap <A-N> :%!cat -n<CR>
- " OR,
- " :%! nl -ba
- " Use mouse in xterm to scroll
- " set mouse=n
- " 5 lines before and after the current line when scrolling
- set scrolloff=5
- " To ignore case in search pattern
- set ignorecase
- set smartcase
- " To incrementally search pattern
- set incsearch
- " No tabs in the source file
- " All tab characters are of 4 space characters
- set softtabstop=4
- set tabstop=4
- set shiftwidth=4
- set expandtab
- " Fortran tabs won't be colored red (Have to loaded before "syntax" command)
- let fortran_have_tabs=1
- " Switch on syntax highlighting if it wasn't on yet.
- if !exists("syntax_on")
- syntax on
- endif
- " Allow switching buffers, which have unsaved changes
- set hidden
- " Switch on search pattern highlighting.
- set hlsearch
- " To showmatch of '(), {}, []' parenthesis
- " inoremap ) )<left><c-o>%<c-o>:sleep 500m<CR><c-o>%<c-o>a
- " inoremap } }<left><c-o>%<c-o>:sleep 500m<CR><c-o>%<c-o>a
- " inoremap ] ]<left><c-o>%<c-o>:sleep 500m<CR><c-o>%<c-o>a
- " Show the matching bracket for the last ')'?
- " set showmatch
- " For filetype plugins
- filetype plugin on
- " Spelling auto correction: Auto correcting typos
- iabbr adn and
- iabbr nad and
- iabbr teh the
- iabbr hte the
- iabbr alos also
- iabbr aslo also
- iabbr qed QED
- iabbr qcd QCD
- " " Vim latex suite
- " " IMPORTANT: grep will sometimes skip displaying the file name if you
- " " search in a singe file. This will confuse Latex-Suite. Set your grep
- " " program to always generate a file-name.
- " set grepprg=grep\ -nH\ $*
- "
- " " OPTIONAL: This enables automatic indentation as you type.
- " " filetype indent on
- "
- " " OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
- " " 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
- " " The following changes the default filetype back to 'tex':
- " let g:tex_flavor='latex'
- "
- " let g:Tex_Folding=0
- " let g:Tex_DefaultTargetFormat='pdf'
- " let g:Tex_UseEditorSettingInDVIViewer = 1
- " let g:Tex_ViewRule_pdf = 'okular'
- " let g:Tex_ViewRule_dvi = 'okular'
- " let g:Tex_ViewRule_ps = 'okular'
- " let g:Tex_CompileRule_pdf = 'pdflatex -synctex=1 -interaction=nonstopmode $*'
- " let g:Tex_FormatDependency_ps = 'dvi,ps'
- " let g:Tex_FormatDependency_pspdf = 'dvi,ps,pspdf'
- " let g:Tex_FormatDependency_dvipdf = 'dvi,dvipdf'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement