Revision history for VimModelines
Revision [23476]
Last edited on 2016-05-20 07:38:48 by BrianKoontz [Replaces old-style internal links with new pipe-split links.]Additions:
//This article is for Developers who use [[http://www.vim.org | Vim]] to edit wikka sources.//
Deletions:
Additions:
==CategoryDevelopment==
Deletions:
Additions:
==CategoryDevelopment== [[http://essayshelp.org/ essay help]]
Deletions:
No Differences
Additions:
====Another Example====
as it is unlikely that vim modelines will make it into the code repository, one could simply put in .vimrc:
set ts=8
set sts=4
set sw=4
set tw=0
" highlight with red unneeded whitespace at end of line
highlight WhitespaceEOL ctermbg=red guibg=red
match WhitespaceEOL /\s\+$/
" go to the last known position in the opened file
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
" smart tab function from vim.org
inoremap <tab> <c-r>=InsertTabWrapper ("forward")<cr>
inoremap <s-tab> <c-r>=InsertTabWrapper ("backward")<cr>
function! InsertTabWrapper(direction)
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
elseif "backward" == a:direction
return "\<c-p>"
else
return "\<c-n>"
endif
endfunction
----
as it is unlikely that vim modelines will make it into the code repository, one could simply put in .vimrc:
set ts=8
set sts=4
set sw=4
set tw=0
" highlight with red unneeded whitespace at end of line
highlight WhitespaceEOL ctermbg=red guibg=red
match WhitespaceEOL /\s\+$/
" go to the last known position in the opened file
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
" smart tab function from vim.org
inoremap <tab> <c-r>=InsertTabWrapper ("forward")<cr>
inoremap <s-tab> <c-r>=InsertTabWrapper ("backward")<cr>
function! InsertTabWrapper(direction)
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
elseif "backward" == a:direction
return "\<c-p>"
else
return "\<c-n>"
endif
endfunction
----
Revision [13671]
Edited on 2006-03-30 08:04:46 by DotMG [Vim modelines without editing wikka sources!]Additions:
{{color c="red" text="The inconvenient of this is that all php source will be modified! Another solution is to modify vim settings locally for all contributors"}}:
- Edit the file ''filetype.vim''.
- For example, I use Vim on Windows, and **all** my wikka files are stored at d:\SVN\wikka, I just added this line to ''filetype.vim'' : %%(vim)au BufNewFile,BufRead d:/SVN/wikka/*.php setf wikka%%
- Edit the file ''filetype.vim''.
- For example, I use Vim on Windows, and **all** my wikka files are stored at d:\SVN\wikka, I just added this line to ''filetype.vim'' : %%(vim)au BufNewFile,BufRead d:/SVN/wikka/*.php setf wikka%%