VIM
vim encoding
tnx 2 aaron-mueller.de
set encoding
vimdoc
set encoding=utf-8
tnx 2 unix.stackexchange.com
Or instead, set the LANG environment variable to indicate that UTF-8 is your
preferred character encoding. This will affect not just Vim but any software
which relies on LANG to determine how it should represent text. For example,
to indicate that text should appear in English (en),
as spoken in the United States (US), encoded as UTF-8 (utf-8), set LANG=en_US.utf-8.
fileencoding
vimdoc
fileencoding=utf-8
search multiple consecutive spaces
tnx 2 stackoverflow.com
/[^ ]\zs \+
Void Match
tnx 2 aaron-mueller.de
" hint :help pattern-overview
" switch on
:highlight needLineBreak ctermbg=gray
:match needLineBreak /.\%>80v/
" switch off
:match none
tnx 2 spektom
set nomagic
clear last search highlighting
tnx 2 Shaun Bouckaert
:let @/ = ''
vim syntax highlighting of OBO Flat File
The OBO Flat File Format is a text file format to store ontologies.
/opt/oc/share/vim/syntax/obo.vim
" Vim syntax file
" Language: OBO Flat File Format
" URL: http://www.geneontology.org/GO.format.obo-1_4.shtml
" Maintainer: Ulf Laube
" Last Change: 2014-06-06
" Version: 1.4
if exists("b:current_syntax")
finish
endif
setlocal iskeyword+=:
syn match oboTrailMod " \[.*\]$"
syn match oboTrailMod " {.*}$"
syn match oboStanzaTerm "^\[.*\]"
syn match oboStanzaTag "^.\{-}:"
syn match oboStanzaSynValue "\".*\""
syn match oboHeader "^format-version:"
syn match oboHeader "^data-version:"
syn match oboHeader "^ontology:"
syn match oboHeader "^date:"
syn match oboHeader "^saved-by:"
syn match oboHeader "^auto-generated-by:"
syn match oboHeader "^subsetdef:"
syn match oboHeader "^import:"
syn match oboHeader "^synonymtypedef:"
syn match oboHeader "^idspace:"
syn match oboHeader "^default-relationship-id-prefix:"
syn match oboHeader "^id-mapping:"
syn match oboHeader "^remark:"
syn match oboRem "!.*$"
highlight link oboStanzaTerm Identifier
highlight link oboStanzaTag Type
highlight link oboStanzaSynValue Special
highlight link oboTrailMod Statement
highlight link oboRem Comment
highlight link oboHeader Constant
let b:current_syntax = "obo"
/etc/vimrc
...
au BufRead,BufNewFile *.obo set filetype=obo
...
/etc/vimrc.local
"#///////////////////////////////////////////////#
"# #
"# name: vimrc.local #
"# #
"VERSION=0.24 #
"# #
"# author: ulf dab laube at ulaube dab de #
"# #
"# descr.: vim configuration #
"# #
"# SYNTAX: use file with this lines in vimrc: #
"# #
"# if filereadable(expand("/etc/vimrc.local")) #
"# source /etc/vimrc.local #
"# endif #
"# #
"#////////////+//////////////////////////////////#
"# changelog: #
"# #
"# 20140606 new key mappings #
"# 20120912 change hex to F6 #
"# 20120912 change F9 to line wrap switch #
"# 20120223 encoding added #
"# 20120703 f7 autoindent #
"# #
"#////////////+//////////////////////////////////#
" ### set default encoding
set encoding=utf-8
"set bomb
" ### set bell modes
set noerrorbells
set vb t_vb="|f"
" ### enable syntax highlighting
syntax on
" ### enable modline detection like # vim: ft=sh
set modeline
" ### automatically indent lines (default)
set noautoindent
" ### number of whitspaces in tabs
set tabstop=4
" ### expand tab2whitspaces
"set expandtab
set shiftwidth=4
" ### autospace for brackets
"set cindent
set autoindent
"set smartindent
" ### select case-insenitiv search (not default)
set ignorecase
set smartcase
" ### highlighting all search matches
set hlsearch
"set incsearch
" ### set default line highlighting
set cursorline
"set cursorcolumn
" ### enable linenumbering
set number
" ### set list characters
" -k : vr hh , FB , ?S
"set lcs=tab:├─,eol:█,trail:▓
" -k : vr hh , PI , ?S
set lcs=tab:├─,eol:¶,trail:▓
" ### syntax highlighting ###
" /opt/oc/share/vim/syntax/obo.vim
au BufRead,BufNewFile *.obo set filetype=obo
" ### mappings ###
" map : split window
noremap :split!
" map : vsplit window
noremap :vsplit!
" map : highlighting from column 80 to end of line
highlight needLineBreak ctermbg=gray
let g:highlightLineBreak = 0
function HighlightingNeedLineBreak()
if g:highlightLineBreak == 1
:match none
let g:highlightLineBreak = 0
return
endif
:match needLineBreak /.\%>80v/
let g:highlightLineBreak = 1
endfunction
noremap :call HighlightingNeedLineBreak()
" map : show cursorcolumn on/off
noremap :set cursorcolumn!
" map : nomagic search on/off
noremap :set nomagic!
" map : autoindent on/off
noremap :set autoindent!
" map : readonly on/off
noremap :set ro!
" map : line wrap on/off
noremap :set invwrap!
" map : syntax highlighting on/off
map :if has("syntax_items")syntax offelsesyntax onendif
" map : list characters on/off
noremap :set list!
" map : linenumbers on/off
noremap :set number!
" map : show key mappings
noremap :echo system("echo '### key mappings ###';grep '^\" map' /etc/vimrc.local")
" map : clear last search highlighting
noremap :let @/ = ''
" map : hex on/off
function Fxxd()
let c=getline(".")
if c =~ '^[0-9a-f]\{7}:'
:%!xxd -r
else
:%!xxd
endif
endfunction
map :call Fxxd()
save highlighted syntax in a HTML file
tnx 2 Maciej Bliziński
:runtime! syntax/2html.vim
or
:TOhtml