mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated all the plugins. Removed powerline. Added vim-airline (replacement for powerline). Added vim-fugitive.
This commit is contained in:
@ -10,6 +10,8 @@ additional contributions from:
|
||||
|
||||
* [alderz](https://github.com/alderz)
|
||||
* [asymmetric](https://github.com/asymmetric)
|
||||
* [bpugh](https://github.com/bpugh)
|
||||
* [bruno-](https://github.com/bruno-)
|
||||
* [darkwise](https://github.com/darkwise)
|
||||
* [henrik](https://github.com/henrik)
|
||||
* [holizz](https://github.com/holizz)
|
||||
@ -36,3 +38,4 @@ additional contributions from:
|
||||
* [steveno](https://github.com/steveno)
|
||||
* [taq](https://github.com/taq)
|
||||
* [thisgeek](https://github.com/thisgeek)
|
||||
* [Xandaros](https://github.com/Xandaros)
|
||||
|
@ -17,8 +17,10 @@ Garbas][garbas], [Marc Weber][marcweber], and [Adnan Zafar][ajzafar].
|
||||
|
||||
## Installing SnipMate ##
|
||||
|
||||
SnipMate depends on [vim-addon-mw-utils][mw-utils] and [tlib][tlib]. We
|
||||
recommend one of the following ways of installing all three.
|
||||
We recommend one of the following methods for installing SnipMate and its
|
||||
dependencies. SnipMate depends on [vim-addon-mw-utils][mw-utils] and
|
||||
[tlib][tlib]. Since SnipMate does not ship with any snippets, we suggest
|
||||
looking at the [vim-snippets][vim-snippets] repository.
|
||||
|
||||
* Using [Pathogen][pathogen], run the following commands:
|
||||
|
||||
@ -27,6 +29,9 @@ recommend one of the following ways of installing all three.
|
||||
% git clone https://github.com/MarcWeber/vim-addon-mw-utils.git
|
||||
% git clone https://github.com/garbas/vim-snipmate.git
|
||||
|
||||
# Optional:
|
||||
% git clone https://github.com/honza/vim-snippets.git
|
||||
|
||||
* Using [VAM][vam], add `vim-snippets` to the list of packages to be installed.
|
||||
|
||||
* Using [Vundle][vundle], add the following to your `vimrc` then run
|
||||
@ -36,8 +41,8 @@ recommend one of the following ways of installing all three.
|
||||
Bundle "tomtom/tlib_vim"
|
||||
Bundle "garbas/vim-snipmate"
|
||||
|
||||
Lastly, since SnipMate does not ship with any snippets, we suggest looking at
|
||||
the [vim-snippets][vim-snippets] repository.
|
||||
" Optional:
|
||||
Bundle "honza/vim-snippets"
|
||||
|
||||
|
||||
[ultisnips]: https://github.com/sirver/ultisnips
|
||||
|
@ -22,17 +22,18 @@ let s:c.read_snippets_cached = get(s:c, 'read_snippets_cached', {'func' : functi
|
||||
|
||||
" if filetype is objc, cpp, cs or cu also append snippets from scope 'c'
|
||||
" you can add multiple by separating scopes by ',', see s:AddScopeAliases
|
||||
" TODO add documentation to doc/*
|
||||
let s:c.scope_aliases = get(s:c, 'scope_aliases', {})
|
||||
let s:c.scope_aliases.objc = get(s:c.scope_aliases, 'objc', 'c')
|
||||
let s:c.scope_aliases.cpp = get(s:c.scope_aliases, 'cpp', 'c')
|
||||
let s:c.scope_aliases.cu = get(s:c.scope_aliases, 'cu', 'c')
|
||||
let s:c.scope_aliases.xhtml = get(s:c.scope_aliases, 'xhtml', 'html')
|
||||
let s:c.scope_aliases.html = get(s:c.scope_aliases, 'html', 'javascript')
|
||||
let s:c.scope_aliases.php = get(s:c.scope_aliases, 'php', 'php,html,javascript')
|
||||
let s:c.scope_aliases.ur = get(s:c.scope_aliases, 'ur', 'html,javascript')
|
||||
let s:c.scope_aliases.mxml = get(s:c.scope_aliases, 'mxml', 'actionscript')
|
||||
let s:c.scope_aliases.eruby = get(s:c.scope_aliases, 'eruby', 'eruby-rails,html')
|
||||
if !exists('g:snipMate_no_default_aliases') || !g:snipMate_no_default_aliases
|
||||
let s:c.scope_aliases.objc = get(s:c.scope_aliases, 'objc', 'c')
|
||||
let s:c.scope_aliases.cpp = get(s:c.scope_aliases, 'cpp', 'c')
|
||||
let s:c.scope_aliases.cu = get(s:c.scope_aliases, 'cu', 'c')
|
||||
let s:c.scope_aliases.xhtml = get(s:c.scope_aliases, 'xhtml', 'html')
|
||||
let s:c.scope_aliases.html = get(s:c.scope_aliases, 'html', 'javascript')
|
||||
let s:c.scope_aliases.php = get(s:c.scope_aliases, 'php', 'php,html,javascript')
|
||||
let s:c.scope_aliases.ur = get(s:c.scope_aliases, 'ur', 'html,javascript')
|
||||
let s:c.scope_aliases.mxml = get(s:c.scope_aliases, 'mxml', 'actionscript')
|
||||
let s:c.scope_aliases.eruby = get(s:c.scope_aliases, 'eruby', 'eruby-rails,html')
|
||||
endif
|
||||
|
||||
" set this to "\<tab>" to make snipmate not swallow tab (make sure to not have
|
||||
" expandtab set). Remember that you can always enter tabs by <c-v> <tab> then
|
||||
@ -181,7 +182,7 @@ fun! s:ProcessSnippet(snip)
|
||||
endif
|
||||
|
||||
if &et " Expand tabs to spaces if 'expandtab' is set.
|
||||
return substitute(snippet, '\t', repeat(' ', &sts ? &sts : &sw), 'g')
|
||||
return substitute(snippet, '\t', repeat(' ', (&sts > 0) ? &sts : &sw), 'g')
|
||||
endif
|
||||
return snippet
|
||||
endf
|
||||
@ -722,10 +723,8 @@ fun! snipMate#ShowAvailableSnips()
|
||||
return ''
|
||||
endf
|
||||
|
||||
|
||||
" user interface implementation {{{1
|
||||
|
||||
fun! snipMate#TriggerSnippet()
|
||||
" Pass an argument to force snippet expansion instead of triggering or jumping
|
||||
function! snipMate#TriggerSnippet(...)
|
||||
if exists('g:SuperTabMappingForward')
|
||||
if g:SuperTabMappingForward == "<tab>"
|
||||
let SuperTabPlug = maparg('<Plug>SuperTabForward', 'i')
|
||||
@ -752,7 +751,7 @@ fun! snipMate#TriggerSnippet()
|
||||
call feedkeys("\<tab>") | return ''
|
||||
endif
|
||||
|
||||
if exists('b:snip_state')
|
||||
if exists('b:snip_state') && a:0 == 0 " Jump only if no arguments
|
||||
let jump = b:snip_state.jump_stop(0)
|
||||
if type(jump) == 1 " returned a string
|
||||
return jump
|
||||
@ -788,8 +787,7 @@ fun! snipMate#TriggerSnippet()
|
||||
return word == ''
|
||||
\ ? "\<tab>"
|
||||
\ : "\<c-r>=snipMate#ShowAvailableSnips()\<cr>"
|
||||
endf
|
||||
|
||||
endfunction
|
||||
|
||||
fun! snipMate#BackwardsSnippet()
|
||||
if exists('b:snip_state') | return b:snip_state.jump_stop(1) | endif
|
||||
@ -819,5 +817,4 @@ fun! snipMate#BackwardsSnippet()
|
||||
return "\<s-tab>"
|
||||
endf
|
||||
|
||||
|
||||
" vim:noet:sw=4:ts=4:ft=vim
|
||||
|
@ -105,6 +105,25 @@ g:snipMate.scope_aliases A |Dictionary| associating certain filetypes
|
||||
"ruby" or contains "ruby" as an entry in the
|
||||
case of dotted filetypes.
|
||||
|
||||
g:snipMate_no_default_aliases
|
||||
When set to 1, prevents SnipMate from loading
|
||||
default scope aliases. The defaults are:
|
||||
Filetype Alias ~
|
||||
cpp c
|
||||
cu c
|
||||
eruby eruby-rails,html
|
||||
html javascript
|
||||
mxml actionscript
|
||||
objc c
|
||||
php php,html,javascript
|
||||
ur html,javascript
|
||||
xhtml html
|
||||
Note: Setting this option does not disable
|
||||
scope aliases entirely, only those made by
|
||||
SnipMate itself. Any scope aliases created by
|
||||
the user or someone else will still be in
|
||||
effect.
|
||||
|
||||
g:snipMate['no_match_completion_feedkeys_chars']
|
||||
A string inserted when no match for a trigger
|
||||
is found. By default a tab is inserted
|
||||
@ -119,26 +138,32 @@ The mappings SnipMate uses can be customized with the |:map| commands. For
|
||||
example, to change the key that triggers snippets and moves to the next
|
||||
tabstop, >
|
||||
|
||||
:imap <C-J> <Plug>SnipMateNextOrTrigger
|
||||
:smap <C-J> <Plug>SnipMateNextOrTrigger
|
||||
:imap <C-J> <Plug>snipMateNextOrTrigger
|
||||
:smap <C-J> <Plug>snipMateNextOrTrigger
|
||||
|
||||
The list of possible <Plug> mappings is as follows:
|
||||
|
||||
<Plug>SnipMateNextOrTrigger Default: <Tab> Mode: Insert, Select
|
||||
<Plug>snipMateNextOrTrigger Default: <Tab> Mode: Insert, Select
|
||||
Jumps to the next tab stop or, if none exists,
|
||||
try to expand a snippet. Use in both insert
|
||||
and select modes.
|
||||
|
||||
<Plug>SnipMateBack Default: <S-Tab> Mode: Insert, Select
|
||||
<Plug>snipMateTrigger Default: unmapped Mode: Insert
|
||||
Try to expand a snippet regardless of any
|
||||
existing snippet expansion. If done within an
|
||||
expanded snippet, the outer snippet's tab
|
||||
stops are lost, unless expansion failed.
|
||||
|
||||
<Plug>snipMateBack Default: <S-Tab> Mode: Insert, Select
|
||||
Jump to the previous tab stop, if it exists.
|
||||
Use in both insert and select modes.
|
||||
|
||||
<Plug>SnipMateShow Default: <C-R><Tab> Mode: Insert
|
||||
<Plug>snipMateShow Default: <C-R><Tab> Mode: Insert
|
||||
Show all available snippets (that start with
|
||||
the previous text, if it exists). Use in
|
||||
insert mode.
|
||||
|
||||
<Plug>SnipMateVisual Default: <Tab> Mode: Visual
|
||||
<Plug>snipMateVisual Default: <Tab> Mode: Visual
|
||||
See |SnipMate-visual|.
|
||||
|
||||
Additionally, <CR> is mapped in visual mode in .snippets files for retabbing
|
||||
|
@ -1,7 +1,7 @@
|
||||
command! -buffer -range=% RetabSnip <line1>,<line2>call snipMate#RetabSnip()
|
||||
vnoremap <buffer> <cr> :RetabSnip<cr>
|
||||
|
||||
if !exists('g:nsippet_no_indentation_settings')
|
||||
if !exists('g:snippet_no_indentation_settings')
|
||||
setlocal sw=4
|
||||
setlocal tabstop=4
|
||||
setlocal noexpandtab
|
||||
|
@ -38,6 +38,7 @@ au FileType snippets setl noet nospell fdm=expr fde=getline(v:lnum)!~'^\\t\\\\|^
|
||||
|
||||
inoremap <silent> <Plug>snipMateNextOrTrigger <C-R>=snipMate#TriggerSnippet()<CR>
|
||||
snoremap <silent> <Plug>snipMateNextOrTrigger <Esc>a<C-R>=snipMate#TriggerSnippet()<CR>
|
||||
inoremap <silent> <Plug>snipMateTrigger <C-R>=snipMate#TriggerSnippet(1)<CR>
|
||||
inoremap <silent> <Plug>snipMateBack <C-R>=snipMate#BackwardsSnippet()<CR>
|
||||
snoremap <silent> <Plug>snipMateBack <Esc>a<C-R>=snipMate#BackwardsSnippet()<CR>
|
||||
inoremap <silent> <Plug>snipMateShow <C-R>=snipMate#ShowAvailableSnips()<CR>
|
||||
|
@ -17,7 +17,6 @@ hi link snipComment Comment
|
||||
hi link multiSnipText String
|
||||
hi link snipKeyword Keyword
|
||||
hi link snipEscape SpecialChar
|
||||
hi link snipComment Comment
|
||||
hi link placeHolder Special
|
||||
hi link tabStop Special
|
||||
hi link snipCommand String
|
||||
|
Reference in New Issue
Block a user