1
0
Fork 0
mirror of synced 2024-11-23 01:05:34 -05:00

pre final status

This commit is contained in:
bood 2013-08-17 19:58:31 +02:00
parent 20c3ee5fa0
commit c47bdd32d6
99 changed files with 1441 additions and 10865 deletions

View file

@ -1,3 +1,4 @@
cd ~/.vim_runtime
cat ~/.vim_runtime/vimrcs/basic.vim > ~/.vimrc
mv ~/.vimrc ~/.vimrc_old
ln -s ~/.vim_runtime/vimrcs/basic.vim ~/.vimrc
echo "Installed the Basic Vim configuration successfully! Enjoy :-)"

View file

@ -1,11 +0,0 @@
This is a version of Infinite Red's vim theme (http://blog.infinitered.com/entries/show/8) packaged to work with Tim Pope's pathogen plugin (http://www.vim.org/scripts/script.php?script_id=2332).
To use it (assuming you're using pathogen):
- go to your bundle directory (.vim/bundle or .vimbundles) and clone the repo:
git clone git@github.com:wgibbs/vim-irblack.git
- edit your .vimrc and add:
:colorscheme ir_black

View file

@ -1,220 +0,0 @@
" ir_black color scheme
" More at: http://blog.infinitered.com/entries/show/8
" ********************************************************************************
" Standard colors used in all ir_black themes:
" Note, x:x:x are RGB values
"
" normal: #f6f3e8
"
" string: #A8FF60 168:255:96
" string inner (punc, code, etc): #00A0A0 0:160:160
" number: #FF73FD 255:115:253
" comments: #7C7C7C 124:124:124
" keywords: #96CBFE 150:203:254
" operators: white
" class: #FFFFB6 255:255:182
" method declaration name: #FFD2A7 255:210:167
" regular expression: #E9C062 233:192:98
" regexp alternate: #FF8000 255:128:0
" regexp alternate 2: #B18A3D 177:138:61
" variable: #C6C5FE 198:197:254
"
" Misc colors:
" red color (used for whatever): #FF6C60 255:108:96
" light red: #FFB6B0 255:182:176
"
" brown: #E18964 good for special
"
" lightpurpleish: #FFCCFF
"
" Interface colors:
" background color: black
" cursor (where underscore is used): #FFA560 255:165:96
" cursor (where block is used): white
" visual selection: #1D1E2C
" current line: #151515 21:21:21
" search selection: #07281C 7:40:28
" line number: #3D3D3D 61:61:61
" ********************************************************************************
" The following are the preferred 16 colors for your terminal
" Colors Bright Colors
" Black #4E4E4E #7C7C7C
" Red #FF6C60 #FFB6B0
" Green #A8FF60 #CEFFAB
" Yellow #FFFFB6 #FFFFCB
" Blue #96CBFE #FFFFCB
" Magenta #FF73FD #FF9CFE
" Cyan #C6C5FE #DFDFFE
" White #EEEEEE #FFFFFF
" ********************************************************************************
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "ir_black"
"hi Example guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
" General colors
hi Normal guifg=#f6f3e8 guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
hi NonText guifg=#070707 guibg=black gui=NONE ctermfg=black ctermbg=NONE cterm=NONE
hi Cursor guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=reverse
hi LineNr guifg=#3D3D3D guibg=black gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE
hi VertSplit guifg=#202020 guibg=#202020 gui=NONE ctermfg=darkgray ctermbg=darkgray cterm=NONE
hi StatusLine guifg=#CCCCCC guibg=#202020 gui=None ctermfg=white ctermbg=darkgray cterm=NONE
hi StatusLineNC guifg=black guibg=#202020 gui=NONE ctermfg=blue ctermbg=darkgray cterm=NONE
hi Folded guifg=#a0a8b0 guibg=#384048 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
hi Title guifg=#f6f3e8 guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=NONE
hi Visual guifg=NONE guibg=DarkBlue gui=NONE ctermfg=NONE ctermbg=darkgray cterm=NONE
hi SpecialKey guifg=#808080 guibg=#343434 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
hi WildMenu guifg=white guibg=DarkRed gui=NONE ctermfg=white ctermbg=DarkRed cterm=NONE
hi PmenuSbar guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=NONE
"hi Ignore guifg=gray guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
hi Error guifg=NONE guibg=red gui=undercurl ctermfg=white ctermbg=red cterm=NONE guisp=#FF6C60 " undercurl color
hi ErrorMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE
hi WarningMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE
" Message displayed in lower left, such as --INSERT--
hi ModeMsg guifg=black guibg=#C6C5FE gui=BOLD ctermfg=black ctermbg=cyan cterm=BOLD
if version >= 700 " Vim 7.x specific colors
hi CursorLine guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD
hi CursorColumn guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD
hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=BOLD ctermfg=white ctermbg=darkgray cterm=NONE
hi Pmenu guifg=#f6f3e8 guibg=#444444 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
hi PmenuSel guifg=#000000 guibg=#cae682 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
hi Search guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
endif
" Syntax highlighting
hi Comment guifg=#7C7C7C guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE
hi String guifg=#A8FF60 guibg=NONE gui=NONE ctermfg=green ctermbg=NONE cterm=NONE
hi Number guifg=#FF73FD guibg=NONE gui=NONE ctermfg=magenta ctermbg=NONE cterm=NONE
hi Keyword guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE
hi PreProc guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE
hi Conditional guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE " if else end
hi Todo guifg=#8f8f8f guibg=NONE gui=NONE ctermfg=red ctermbg=NONE cterm=NONE
hi Constant guifg=#99CC99 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE
hi Identifier guifg=#C6C5FE guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE
hi Function guifg=#FFD2A7 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE
hi Type guifg=#FFFFB6 guibg=NONE gui=NONE ctermfg=yellow ctermbg=NONE cterm=NONE
hi Statement guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE
hi Special guifg=#E18964 guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE
hi Delimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE
hi Operator guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE
hi link Character Constant
hi link Boolean Constant
hi link Float Number
hi link Repeat Statement
hi link Label Statement
hi link Exception Statement
hi link Include PreProc
hi link Define PreProc
hi link Macro PreProc
hi link PreCondit PreProc
hi link StorageClass Type
hi link Structure Type
hi link Typedef Type
hi link Tag Special
hi link SpecialChar Special
hi link SpecialComment Special
hi link Debug Special
" Special for Ruby
hi rubyRegexp guifg=#B18A3D guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE
hi rubyRegexpDelimiter guifg=#FF8000 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE
hi rubyEscape guifg=white guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE
hi rubyInterpolationDelimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE
hi rubyControl guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE "and break, etc
"hi rubyGlobalVariable guifg=#FFCCFF guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE "yield
hi rubyStringDelimiter guifg=#336633 guibg=NONE gui=NONE ctermfg=lightgreen ctermbg=NONE cterm=NONE
"rubyInclude
"rubySharpBang
"rubyAccess
"rubyPredefinedVariable
"rubyBoolean
"rubyClassVariable
"rubyBeginEnd
"rubyRepeatModifier
"hi link rubyArrayDelimiter Special " [ , , ]
"rubyCurlyBlock { , , }
hi link rubyClass Keyword
hi link rubyModule Keyword
hi link rubyKeyword Keyword
hi link rubyOperator Operator
hi link rubyIdentifier Identifier
hi link rubyInstanceVariable Identifier
hi link rubyGlobalVariable Identifier
hi link rubyClassVariable Identifier
hi link rubyConstant Type
" Special for Java
" hi link javaClassDecl Type
hi link javaScopeDecl Identifier
hi link javaCommentTitle javaDocSeeTag
hi link javaDocTags javaDocSeeTag
hi link javaDocParam javaDocSeeTag
hi link javaDocSeeTagParam javaDocSeeTag
hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE
hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE
"hi javaClassDecl guifg=#CCFFCC guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE
" Special for XML
hi link xmlTag Keyword
hi link xmlTagName Conditional
hi link xmlEndTag Identifier
" Special for HTML
hi link htmlTag Keyword
hi link htmlTagName Conditional
hi link htmlEndTag Identifier
" Special for Javascript
hi link javaScriptNumber Number
" Special for Python
"hi link pythonEscape Keyword
" Special for CSharp
hi link csXmlTag Keyword
" Amix customizations
" Tab line
hi TabLineFill guifg=#000000 guibg=#000000 gui=NONE
hi TabLine guifg=black guibg=#888888 gui=NONE
hi TabLineSel guifg=white guibg=#000000 gui=bold
" Search higlights
hi Search guifg=White guibg=DarkRed gui=NONE

View file

@ -1,38 +0,0 @@
vim-peepopen
=============
A plugin for the Vim text editor. PeepOpen provides fuzzy search of filenames and paths in a programming project.
Installation
------------
Get the PeepOpen.app and open it at least once to approve the Mac OS X security dialog.
Standard:
Copy `peepopen.vim` to your `~/.vim/plugin` directory.
With Tim Pope's [Pathogen](http://github.com/tpope/vim-pathogen):
Copy the entire `vim-peepopen` plugin directory to your `~/.vim/bundle` directory.
Usage
-----
`<Leader>p` opens the current project directory with the PeepOpen application.
Use the [vim-rooter](https://github.com/airblade/vim-rooter) plugin for automatic assignment of the current working directory for projects stored in Git.
(Leader is mapped to '\' by default)
### Options
Automatically quit PeepOpen when Vim exits.
`let p:peepopen_quit = 1`
Credits
-------
- Initial Vim Plugin by [Andrew Stewart](http://www.airbladesoftware.com/).
- Some plugin boilerplate from [Rein Henrichs](http://reinh.com/).

View file

@ -1,57 +0,0 @@
" plugin/peepopen.vim
" Author: Geoffrey Grosenbach <boss@topfunky.com>
" License: MIT License
" Install this file as plugin/peepopen.vim.
" If you prefer Command-T, use this snippet in your .gvimrc:
" if has("gui_macvim")
" macmenu &File.New\ Tab key=<nop>
" map <D-t> <Plug>PeepOpen
" end
" ============================================================================
" Exit quickly when:
" - this plugin was already loaded (or disabled)
" - when 'compatible' is set
if &cp || exists("g:peepopen_loaded") && g:peepopen_loaded
finish
endif
let g:peepopen_loaded = 1
let s:save_cpo = &cpo
set cpo&vim
if !exists('g:peepopen_quit')
let g:peepopen_quit = 0
endif
function s:LaunchPeepOpenViaVim()
silent exe "!open -a PeepOpen " . shellescape(getcwd())
redraw!
endfunction
function s:QuitPeepOpenViaVim()
silent exe '!ps ax | grep PeepOpen | grep -v grep | awk "{ print $1 }" | xargs kill -QUIT'
endfunction
command! PeepOpen :call <SID>LaunchPeepOpenViaVim()
command! PeepQuit :call <SID>QuitPeepOpenViaVim()
if has('autocmd') && exists('g:peepopen_quit') && g:peepopen_quit
au VimLeave * :call <SID>QuitPeepOpenViaVim()
endif
noremap <unique> <script> <Plug>PeepOpen <SID>Launch
noremap <SID>Launch :call <SID>LaunchPeepOpenViaVim()<CR>
if !hasmapto('<Plug>PeepOpen')
map! <unique> <silent> <Leader>p <Plug>PeepOpen
endif
let &cpo = s:save_cpo
unlet s:save_cpo
" vim:set sw=2 sts=2:

File diff suppressed because one or more lines are too long

View file

@ -1,107 +0,0 @@
=================
Powerline for vim
=================
:Author: Kim Silkebækken (kim.silkebaekken+vim@gmail.com)
:Source: https://github.com/Lokaltog/vim-powerline
:Version: β
Introduction
------------
Powerline is a utility plugin which allows you to create better-looking,
more functional vim statuslines. See the screenshots below for
a demonstration of the plugin's capabilities.
It's recommended that you install the plugin using Pathogen_ or Vundle_.
After the plugin is installed update your help tags and see ``:help
Powerline`` for instructions on how to enable and configure the plugin.
See the `Troubleshooting`_ section below if you're having any issues with
the plugin or the font patcher.
**Note:** You need a patched font to be able to use the symbols in the
statusline. An experimental Python/fontforge-based font patcher is included
in the ``fontpatcher`` directory. See ``fontpatcher/README.rst`` for usage
instructions.
.. _Pathogen: https://github.com/tpope/vim-pathogen
.. _Vundle: https://github.com/gmarik/vundle
Screenshots
-----------
.. image:: http://i.imgur.com/MsuIB.png
Troubleshooting
---------------
I can't see the fancy symbols, what's wrong?
Make sure that you have ``let g:Powerline_symbols = 'fancy'`` in your
``vimrc`` file. The settings may be loaded too late if you have this in
``gvimrc``, so always put this in your ``vimrc``.
Clear the cache using ``:PowerlineClearCache`` and restart vim.
Make sure that you've configured gvim or your terminal emulator to use
a patched font.
Make sure that vim is compiled with the ``--with-features=big`` flag.
The fancy symbols look a bit blurry or "off"!
Make sure that you have patched all variants of your font (i.e. both the
regular and the bold font files).
I'm unable to patch my font, what should I do?
Font patching is only known to work on most Linux and OS X machines. If
you have followed the instructions in the fontpatcher README and still
have problems, please submit an issue on GitHub.
You can download some community-contributed patched fonts from the
`Powerline wiki`_ if you don't want to mess around with the font
patcher.
The Syntastic/Fugitive statusline flags don't work!
These flags should work without any configuration. If you installed
either plugin after Powerline, you'll have to clear the cache using
``:PowerlineClearCache`` and restart vim.
The colors are weird in the default OS X Terminal app!
The default OS X Terminal app is known to have some issues with the
Powerline colors. Please use another terminal emulator. iTerm2 should
work fine.
The arrows may have the wrong colors if you have changed the "minimum
contrast" slider in the color tab of your OS X settings.
The statusline has strange characters like ``^B`` in it!
Please add ``set encoding=utf-8`` to your ``vimrc``.
You may also need to set your ``LANG`` and ``LC_*`` environment
variables to a UTF-8 locale (e.g. ``LANG=en_US.utf8``). Consult your
Linux distro's documentation for information about setting these
variables correctly.
The statusline has a lot of ``^`` or underline characters in it!
You need to configure the ``fillchars`` setting to disable statusline
fillchars (see ``:h fillchars`` for details). Add this to your
``vimrc`` to solve this issue::
set fillchars+=stl:\ ,stlnc:\
The statusline is hidden/only appears in split windows!
Make sure that you have ``set laststatus=2`` in your ``vimrc``.
I'm using tmux and Powerline looks like crap, what's wrong?
You need to tell tmux that it has 256-color capabilities. Add this to
your ``.tmux.conf`` to solve this issue::
set -g default-terminal "screen-256color"
If you use iTerm2, make sure that you have enabled the setting 'Set
locale variables automatically' in Profiles > Terminal > Environment.
If you have any other issues and you can't find the answer in the docs,
please submit an issue on GitHub.
.. _`Powerline wiki`: https://github.com/Lokaltog/vim-powerline/wiki/Patched-fonts

View file

@ -1,183 +0,0 @@
" Powerline - The ultimate statusline utility
"
" Author: Kim Silkebækken <kim.silkebaekken+vim@gmail.com>
" Source repository: https://github.com/Lokaltog/vim-powerline
" Script variables {{{
let g:Pl#OLD_STL = ''
let g:Pl#THEME = []
let g:Pl#THEME_CALLBACKS = []
let g:Pl#HL = []
" Cache revision, this must be incremented whenever the cache format is changed
let s:CACHE_REVISION = 7
" }}}
" Script initialization {{{
function! Pl#LoadCache() " {{{
if filereadable(g:Powerline_cache_file) && g:Powerline_cache_enabled
exec 'source' escape(g:Powerline_cache_file, ' \')
if ! exists('g:Powerline_cache_revision') || g:Powerline_cache_revision != s:CACHE_REVISION
" Cache revision differs, cache is invalid
unlet! g:Powerline_cache_revision
return 0
endif
" Create highlighting groups
for hi_cmd in g:Pl#HL
exec hi_cmd
endfor
" Run theme callbacks
for callback in g:Pl#THEME_CALLBACKS
" Substitute {{NEWLINE}} with newlines (strings must be
" stored without newlines characters to avoid vim errors)
exec substitute(callback[0], "{{NEWLINE}}", "\n", 'g')
exec substitute(callback[1], "{{NEWLINE}}", "\n", 'g')
endfor
return 1
endif
return 0
endfunction " }}}
function! Pl#ClearCache() " {{{
if filereadable(g:Powerline_cache_file)
" Delete the cache file
call delete(g:Powerline_cache_file)
endif
echo 'Powerline cache cleared. Please restart vim for the changes to take effect.'
endfunction " }}}
function! Pl#ReloadColorscheme() " {{{
call Pl#ClearCache()
" The colorscheme and theme files must be manually sourced because
" vim won't reload previously autoloaded files
"
" This is a bit hackish, but it works
unlet! g:Powerline#Colorschemes#{g:Powerline_colorscheme}#colorscheme
exec "source" split(globpath(&rtp, 'autoload/Powerline/Colorschemes/'. g:Powerline_colorscheme .'.vim', 1), '\n')[0]
unlet! g:Powerline#Themes#{g:Powerline_theme}#theme
exec "source" split(globpath(&rtp, 'autoload/Powerline/Themes/'. g:Powerline_theme .'.vim', 1), '\n')[0]
let g:Pl#THEME = []
call Pl#Load()
endfunction " }}}
function! Pl#Load() " {{{
if empty(g:Pl#OLD_STL)
" Store old statusline
let g:Pl#OLD_STL = &statusline
endif
if ! Pl#LoadCache()
try
" Autoload the theme dict first
let raw_theme = g:Powerline#Themes#{g:Powerline_theme}#theme
catch
echom 'Invalid Powerline theme! Please check your theme and colorscheme settings.'
return
endtry
" Create list with parsed statuslines
for buffer_statusline in raw_theme
unlet! mode_statuslines
let mode_statuslines = Pl#Parser#GetStatusline(buffer_statusline.segments)
if ! empty(buffer_statusline.callback)
" The callback function passes its arguments on to
" Pl#StatuslineCallback along with the normal/current mode
" statusline.
let s:cb_func = "function! PowerlineStatuslineCallback_". buffer_statusline.callback[1] ."(...)\n"
let s:cb_func .= "return Pl#StatuslineCallback(". string(mode_statuslines['n']) .", a:000)\n"
let s:cb_func .= "endfunction"
" The callback expression should be used to initialize any
" variables that will use the callback function. The
" expression requires a %s which will be replaced by the
" callback function name.
let s:cb_expr = printf(buffer_statusline.callback[2], 'PowerlineStatuslineCallback_'. buffer_statusline.callback[1])
exec s:cb_func
exec s:cb_expr
" Newlines must be substituted with another character
" because vim doesn't like newlines in strings
call add(g:Pl#THEME_CALLBACKS, [substitute(s:cb_func, "\n", "{{NEWLINE}}", 'g'), substitute(s:cb_expr, "\n", "{{NEWLINE}}", 'g')])
unlet! s:cb_func s:cb_expr
continue
endif
" Store the statuslines for matching specific buffers
call add(g:Pl#THEME, {
\ 'matches': buffer_statusline.matches,
\ 'mode_statuslines': mode_statuslines
\ })
endfor
if ! g:Powerline_cache_enabled
" Don't cache anything if caching is disabled or cache file isn't writeable
return
endif
" Prepare commands and statuslines for caching
let cache = [
\ 'let g:Powerline_cache_revision = '. string(s:CACHE_REVISION),
\ 'let g:Pl#HL = '. string(g:Pl#HL),
\ 'let g:Pl#THEME = '. string(g:Pl#THEME),
\ 'let g:Pl#THEME_CALLBACKS = '. string(g:Pl#THEME_CALLBACKS),
\ ]
call writefile(cache, g:Powerline_cache_file)
endif
endfunction " }}}
" }}}
" Statusline updater {{{
function! Pl#Statusline(statusline, current) " {{{
let mode = mode()
if ! a:current
let mode = 'N' " Normal (non-current)
elseif mode =~# '\v(v|V|)'
let mode = 'v' " Visual mode
elseif mode =~# '\v(s|S|)'
let mode = 's' " Select mode
elseif mode =~# '\vi'
let mode = 'i' " Insert mode
elseif mode =~# '\v(R|Rv)'
let mode = 'r' " Replace mode
else
" Fallback to normal mode
let mode = 'n' " Normal (current)
endif
return g:Pl#THEME[a:statusline].mode_statuslines[mode]
endfunction " }}}
function! Pl#StatuslineCallback(statusline, args) " {{{
" Replace %1, %2, etc. in the statusline with the callback args
return substitute(
\ a:statusline,
\ '\v\%(\d+)',
\ '\=a:args[submatch(1)]',
\ 'g')
endfunction " }}}
function! Pl#UpdateStatusline(current) " {{{
if empty(g:Pl#THEME)
" Load statuslines if they aren't loaded yet
call Pl#Load()
endif
for i in range(0, len(g:Pl#THEME) - 1)
if Pl#Match#Validate(g:Pl#THEME[i])
" Update window-local statusline
let &l:statusline = '%!Pl#Statusline('. i .','. a:current .')'
endif
endfor
endfunction " }}}
" }}}

View file

@ -1,145 +0,0 @@
function! Pl#Colorscheme#Init(hi) " {{{
let colorscheme = {}
for hi in a:hi
" Ensure that the segments are a list
let segments = type(hi[0]) == type('') ? [ hi[0] ] : hi[0]
let mode_hi_dict = hi[1]
for segment in segments
let colorscheme[segment] = mode_hi_dict
endfor
endfor
return colorscheme
endfunction " }}}
function! Pl#Colorscheme#Apply(colorscheme, buffer_segments) " {{{
" Set color parameters for all segments in a:buffer_segments
" TODO This function should be recursive and work on both segments and groups
" TODO We could probably handle the NS stuff here...
try
let colorscheme = g:Powerline#Colorschemes#{a:colorscheme}#colorscheme
catch
echom 'Color scheme "'. a:colorscheme .'" doesn''t exist!'
return
endtry
let buffer_segments = a:buffer_segments
" This is a bit complex, I'll walk you through exactly what happens here...
"
" First of all we loop through the buffer_segments, which are the segments that
" this specific buffer will have.
for buffer_segment in buffer_segments
" The buffer_segment consists of a 'matches' list and a 'segments' list.
" The 'matches' list has conditions to limit this statusline to specific buffers/windows.
" The 'segments' list has each segment and segment group for this buffer
for segment in buffer_segment.segments
let type = get(segment, 'type', '')
if type == 'segment_group'
" We're going to handle segment groups different from single segments. Segment groups
" have child segments which may have their own highlighting (e.g. fileinfo.flags),
" and these child segments may be grouped (e.g. fileinfo.flags.ro) to provide very
" specific highlighting. So here we'll handle all that:
" Set the default/fallback colors for this group
for i in range(len(segment.variants), 0, -1)
" Check for available highlighting for the main group segment
"
" This works like the segment highlighting below
" TODO Create a function for this
let seg_variants = join(segment.variants[0:i], '.')
let seg_name = i > 0 ? segment.name .'.'. seg_variants : segment.name
let seg_ns_name = len(segment.ns) > 0 ? segment.ns .':'. seg_name : seg_name
if has_key(colorscheme, seg_ns_name)
" We have a namespaced highlight group
let segment.colors = colorscheme[seg_ns_name]
break
elseif has_key(colorscheme, seg_name)
" We have a non-namespaced group
let segment.colors = colorscheme[seg_name]
break
endif
endfor
" The reason why we need to deepcopy the group's segments is that the child segments
" all point to the same base segments and that screws up highlighting if we highlight
" some child segments with different namespaced colors
let segment.segments = deepcopy(segment.segments)
" Apply colors to each child segment
for child_segment in segment.segments
" Check if this child segment is grouped (e.g. fileinfo.flags.group.subgroup)
" We're going to prioritize the most specific grouping and then work back to the
" most common group (e.g. fileinfo.flags)
" FIXME We don't have the variants from before because group children aren't run through Pl#Segment#Get
let child_segment.variants = [seg_name] + split(child_segment.name, '\.')
" Use the parent group's namespace
let child_segment.ns = segment.ns
for i in range(len(child_segment.variants), 0, -1)
" Check for available highlighting for the main group segment
let child_seg_name = join(child_segment.variants[0:i], '.')
let child_seg_ns_name = len(child_segment.ns) > 0 ? child_segment.ns .':'. child_seg_name : child_seg_name
if has_key(colorscheme, child_seg_ns_name)
" We have a namespaced highlight group
let child_segment.colors = colorscheme[child_seg_ns_name]
break
elseif has_key(colorscheme, child_seg_name)
" We have a non-namespaced group
let child_segment.colors = colorscheme[child_seg_name]
break
endif
endfor
endfor
elseif type == 'segment'
for i in range(len(segment.variants), 0, -1)
" Check for available highlighting
"
" This is done in the following manner, using the segment gundo:static_filename.text.buffer as an example:
"
" * Look for the hl group: gundo:static_filename.text.buffer
" * Look for the hl group: static_filename.text.buffer
" * Look for the hl group: gundo:static_filename.text
" * Look for the hl group: static_filename.text
" * Look for the hl group: gundo:static_filename
" * Look for the hl group: static_filename
" * Return the segment without highlighting, causing an error in the parser
let seg_variants = join(segment.variants[0:i], '.')
let seg_name = i > 0 ? segment.name .'.'. seg_variants : segment.name
let seg_ns_name = len(segment.ns) > 0 ? segment.ns .':'. seg_name : seg_name
if has_key(colorscheme, seg_ns_name)
" We have a namespaced highlight group
let segment.colors = colorscheme[seg_ns_name]
break
elseif has_key(colorscheme, seg_name)
" We have a non-namespaced group
let segment.colors = colorscheme[seg_name]
break
endif
endfor
endif
unlet! segment
endfor
endfor
" Good luck parsing this return value
"
" It's a huge dict with all segments for all buffers with their respective syntax highlighting.
" It will be parsed by the main Powerline code, where all the data will be shortened to a simple
" array consiting of a statusline for each mode, with generated highlighting groups and dividers.
return buffer_segments
endfunction " }}}

View file

@ -1,140 +0,0 @@
" cterm -> gui color dict {{{
let s:cterm2gui_dict = {
\ 16: 0x000000, 17: 0x00005f, 18: 0x000087, 19: 0x0000af, 20: 0x0000d7, 21: 0x0000ff,
\ 22: 0x005f00, 23: 0x005f5f, 24: 0x005f87, 25: 0x005faf, 26: 0x005fd7, 27: 0x005fff,
\ 28: 0x008700, 29: 0x00875f, 30: 0x008787, 31: 0x0087af, 32: 0x0087d7, 33: 0x0087ff,
\ 34: 0x00af00, 35: 0x00af5f, 36: 0x00af87, 37: 0x00afaf, 38: 0x00afd7, 39: 0x00afff,
\ 40: 0x00d700, 41: 0x00d75f, 42: 0x00d787, 43: 0x00d7af, 44: 0x00d7d7, 45: 0x00d7ff,
\ 46: 0x00ff00, 47: 0x00ff5f, 48: 0x00ff87, 49: 0x00ffaf, 50: 0x00ffd7, 51: 0x00ffff,
\ 52: 0x5f0000, 53: 0x5f005f, 54: 0x5f0087, 55: 0x5f00af, 56: 0x5f00d7, 57: 0x5f00ff,
\ 58: 0x5f5f00, 59: 0x5f5f5f, 60: 0x5f5f87, 61: 0x5f5faf, 62: 0x5f5fd7, 63: 0x5f5fff,
\ 64: 0x5f8700, 65: 0x5f875f, 66: 0x5f8787, 67: 0x5f87af, 68: 0x5f87d7, 69: 0x5f87ff,
\ 70: 0x5faf00, 71: 0x5faf5f, 72: 0x5faf87, 73: 0x5fafaf, 74: 0x5fafd7, 75: 0x5fafff,
\ 76: 0x5fd700, 77: 0x5fd75f, 78: 0x5fd787, 79: 0x5fd7af, 80: 0x5fd7d7, 81: 0x5fd7ff,
\ 82: 0x5fff00, 83: 0x5fff5f, 84: 0x5fff87, 85: 0x5fffaf, 86: 0x5fffd7, 87: 0x5fffff,
\ 88: 0x870000, 89: 0x87005f, 90: 0x870087, 91: 0x8700af, 92: 0x8700d7, 93: 0x8700ff,
\ 94: 0x875f00, 95: 0x875f5f, 96: 0x875f87, 97: 0x875faf, 98: 0x875fd7, 99: 0x875fff,
\ 100: 0x878700, 101: 0x87875f, 102: 0x878787, 103: 0x8787af, 104: 0x8787d7, 105: 0x8787ff,
\ 106: 0x87af00, 107: 0x87af5f, 108: 0x87af87, 109: 0x87afaf, 110: 0x87afd7, 111: 0x87afff,
\ 112: 0x87d700, 113: 0x87d75f, 114: 0x87d787, 115: 0x87d7af, 116: 0x87d7d7, 117: 0x87d7ff,
\ 118: 0x87ff00, 119: 0x87ff5f, 120: 0x87ff87, 121: 0x87ffaf, 122: 0x87ffd7, 123: 0x87ffff,
\ 124: 0xaf0000, 125: 0xaf005f, 126: 0xaf0087, 127: 0xaf00af, 128: 0xaf00d7, 129: 0xaf00ff,
\ 130: 0xaf5f00, 131: 0xaf5f5f, 132: 0xaf5f87, 133: 0xaf5faf, 134: 0xaf5fd7, 135: 0xaf5fff,
\ 136: 0xaf8700, 137: 0xaf875f, 138: 0xaf8787, 139: 0xaf87af, 140: 0xaf87d7, 141: 0xaf87ff,
\ 142: 0xafaf00, 143: 0xafaf5f, 144: 0xafaf87, 145: 0xafafaf, 146: 0xafafd7, 147: 0xafafff,
\ 148: 0xafd700, 149: 0xafd75f, 150: 0xafd787, 151: 0xafd7af, 152: 0xafd7d7, 153: 0xafd7ff,
\ 154: 0xafff00, 155: 0xafff5f, 156: 0xafff87, 157: 0xafffaf, 158: 0xafffd7, 159: 0xafffff,
\ 160: 0xd70000, 161: 0xd7005f, 162: 0xd70087, 163: 0xd700af, 164: 0xd700d7, 165: 0xd700ff,
\ 166: 0xd75f00, 167: 0xd75f5f, 168: 0xd75f87, 169: 0xd75faf, 170: 0xd75fd7, 171: 0xd75fff,
\ 172: 0xd78700, 173: 0xd7875f, 174: 0xd78787, 175: 0xd787af, 176: 0xd787d7, 177: 0xd787ff,
\ 178: 0xd7af00, 179: 0xd7af5f, 180: 0xd7af87, 181: 0xd7afaf, 182: 0xd7afd7, 183: 0xd7afff,
\ 184: 0xd7d700, 185: 0xd7d75f, 186: 0xd7d787, 187: 0xd7d7af, 188: 0xd7d7d7, 189: 0xd7d7ff,
\ 190: 0xd7ff00, 191: 0xd7ff5f, 192: 0xd7ff87, 193: 0xd7ffaf, 194: 0xd7ffd7, 195: 0xd7ffff,
\ 196: 0xff0000, 197: 0xff005f, 198: 0xff0087, 199: 0xff00af, 200: 0xff00d7, 201: 0xff00ff,
\ 202: 0xff5f00, 203: 0xff5f5f, 204: 0xff5f87, 205: 0xff5faf, 206: 0xff5fd7, 207: 0xff5fff,
\ 208: 0xff8700, 209: 0xff875f, 210: 0xff8787, 211: 0xff87af, 212: 0xff87d7, 213: 0xff87ff,
\ 214: 0xffaf00, 215: 0xffaf5f, 216: 0xffaf87, 217: 0xffafaf, 218: 0xffafd7, 219: 0xffafff,
\ 220: 0xffd700, 221: 0xffd75f, 222: 0xffd787, 223: 0xffd7af, 224: 0xffd7d7, 225: 0xffd7ff,
\ 226: 0xffff00, 227: 0xffff5f, 228: 0xffff87, 229: 0xffffaf, 230: 0xffffd7, 231: 0xffffff,
\ 232: 0x080808, 233: 0x121212, 234: 0x1c1c1c, 235: 0x262626, 236: 0x303030, 237: 0x3a3a3a,
\ 238: 0x444444, 239: 0x4e4e4e, 240: 0x585858, 241: 0x626262, 242: 0x6c6c6c, 243: 0x767676,
\ 244: 0x808080, 245: 0x8a8a8a, 246: 0x949494, 247: 0x9e9e9e, 248: 0xa8a8a8, 249: 0xb2b2b2,
\ 250: 0xbcbcbc, 251: 0xc6c6c6, 252: 0xd0d0d0, 253: 0xdadada, 254: 0xe4e4e4, 255: 0xeeeeee
\ }
" }}}
" Allocated color dict {{{
let s:allocated_colors = {
\ 'NONE': 'NONE',
\ }
" }}}
function! s:Cterm2GUI(cterm) " {{{
if toupper(a:cterm) == 'NONE'
return 'NONE'
endif
if ! has_key(s:cterm2gui_dict, a:cterm)
return 0xff0000
endif
return s:cterm2gui_dict[a:cterm]
endfunction " }}}
function! Pl#Hi#Segments(segments, mode_colors) " {{{
let mode_translate = {
\ 'normal': 'n',
\ 'noncurrent': 'N',
\ 'insert': 'i',
\ 'visual': 'v',
\ 'replace': 'r',
\ 'select': 's',
\ }
let attributes = ['bold', 'italic', 'underline']
let segments = a:segments
let mode_hi_dict = {}
" Mode dict
for [mode, colors] in items(a:mode_colors)
if has_key(mode_translate, mode)
let mode = mode_translate[mode]
endif
unlet! fg
let fg = s:allocated_colors[colors[0]]
let hi = {
\ 'cterm': [fg['cterm'], ''],
\ 'gui' : [fg['gui'], ''],
\ 'attr' : []
\ }
if exists('colors[1]')
if type(colors[1]) == type([])
" We don't have a BG color, but we have attributes
let hi.attr = colors[1]
else
" The second parameter is the background color
unlet! bg
let bg = s:allocated_colors[colors[1]]
let hi.cterm[1] = bg['cterm']
let hi.gui[1] = bg['gui']
endif
endif
if exists('colors[2]') && type(colors[2]) == type([])
" The third parameter is always an attribute list
let hi.attr = colors[2]
endif
let mode_hi_dict[mode] = {
\ 'ctermfg': (empty(hi['cterm'][0]) ? '' : (string(hi['cterm'][0]) == 'NONE' ? 'NONE' : hi['cterm'][0])),
\ 'ctermbg': (empty(hi['cterm'][1]) ? '' : (string(hi['cterm'][1]) == 'NONE' ? 'NONE' : hi['cterm'][1])),
\ 'guifg' : (empty(hi['gui'][0]) ? '' : (string(hi['gui'][0]) == 'NONE' ? 'NONE' : hi['gui'][0])),
\ 'guibg' : (empty(hi['gui'][1]) ? '' : (string(hi['gui'][1]) == 'NONE' ? 'NONE' : hi['gui'][1])),
\ 'attr' : (! len(hi['attr']) ? 'NONE' : join(hi['attr'], ','))
\ }
endfor
return [segments, mode_hi_dict]
endfunction " }}}
function! Pl#Hi#Allocate(colors) " {{{
for [key, color] in items(a:colors)
if type(color) == type(0)
" Only terminal color
let cterm = color
let gui = s:Cterm2GUI(color)
elseif type(color) == type([]) && len(color) == 2
" Terminal and GUI colors
let cterm = color[0]
let gui = color[1]
endif
let s:allocated_colors[key] = {
\ 'cterm': cterm,
\ 'gui': gui,
\ }
unlet! color
endfor
endfunction " }}}

View file

@ -1,43 +0,0 @@
function! Pl#Match#Add(pat, expr) " {{{
return [a:pat, a:expr]
endfunction " }}}
function! Pl#Match#Any(...) " {{{
let matches = []
for match_name in a:000
if empty(match_name)
" Skip empty match parameters
continue
endif
if has_key(g:Powerline#Matches#matches, match_name)
call add(matches, g:Powerline#Matches#matches[match_name])
endif
unlet! match_name
endfor
return ['match', 'any', matches]
endfunction " }}}
function! Pl#Match#Validate(theme) " {{{
let match = a:theme.matches[1]
if match == 'none'
return 0
elseif match == 'any'
let matches = a:theme.matches[2]
if ! len(matches)
" Empty match array matches everything
return 1
endif
for [eval, re] in matches
if match(eval(eval), '\v'. re) != -1
return 1
endif
endfor
return 0
endif
endfunction " }}}

View file

@ -1,40 +0,0 @@
let s:segment_mods = []
function! Pl#Mod#AddSegmentMod(action, properties) " {{{
call add(s:segment_mods, [a:action, a:properties])
endfunction " }}}
function! Pl#Mod#ApplySegmentMods(theme) " {{{
let theme = deepcopy(a:theme)
for mod in s:segment_mods
let [action, properties] = mod
" We have to loop through the segments instead of using index() because some
" segments are lists!
let target_seg_idx = -1
for i in range(0, len(theme) - 1)
unlet! segment
let segment = theme[i]
if type(segment) == type(properties.target_segment) && segment == properties.target_segment
let target_seg_idx = i
break
endif
endfor
if action == 'insert_segment'
" Insert segment
if target_seg_idx != -1
call insert(theme, properties.new_segment, (properties.where == 'before' ? target_seg_idx : target_seg_idx + 1))
endif
elseif action == 'remove_segment'
" Remove segment
if target_seg_idx != -1
call remove(theme, target_seg_idx)
endif
endif
endfor
return theme
endfunction " }}}

View file

@ -1,371 +0,0 @@
let g:Pl#Parser#Symbols = {
\ 'compatible': {
\ 'dividers': [ '', [0x2502], '', [0x2502] ]
\ , 'symbols' : {
\ 'BRANCH': 'BR:'
\ , 'RO' : 'RO'
\ , 'FT' : 'FT'
\ , 'LINE' : 'LN'
\ }
\ },
\ 'unicode': {
\ 'dividers': [ [0x25b6], [0x276f], [0x25c0], [0x276e] ]
\ , 'symbols' : {
\ 'BRANCH': [0x26a1]
\ , 'RO' : [0x2613]
\ , 'FT' : [0x2691]
\ , 'LINE' : [0x204b]
\ },
\ },
\ 'fancy': {
\ 'dividers': [ [0x2b80], [0x2b81], [0x2b82], [0x2b83] ]
\ , 'symbols' : {
\ 'BRANCH': [0x2b60]
\ , 'RO' : [0x2b64]
\ , 'FT' : [0x2b62, 0x2b63]
\ , 'LINE' : [0x2b61]
\ }
\ }
\ }
" Handle symbol overrides
for [s:key, s:value] in items(g:Powerline_symbols_override)
let g:Pl#Parser#Symbols[g:Powerline_symbols].symbols[s:key] = s:value
unlet! s:key s:value
endfor
" Handle divider overrides
if len(g:Powerline_dividers_override) == 4
let g:Pl#Parser#Symbols[g:Powerline_symbols].dividers = g:Powerline_dividers_override
endif
let s:LEFT_SIDE = 0
let s:RIGHT_SIDE = 2
let s:PADDING = 1
let s:EMPTY_SEGMENT = { 'type': 'empty' }
let s:HARD_DIVIDER = 0
let s:SOFT_DIVIDER = 1
function! Pl#Parser#GetStatusline(segments) " {{{
let statusline = {
\ 'n': ''
\ , 'N': ''
\ , 'v': ''
\ , 'i': ''
\ , 'r': ''
\ , 's': ''
\ }
" Run through the different modes and create the statuslines
for mode in keys(statusline)
" Create an empty statusline list
let stl = []
call extend(stl, s:ParseSegments(mode, s:LEFT_SIDE, a:segments))
let statusline[mode] .= join(stl, '')
endfor
return statusline
endfunction " }}}
function! Pl#Parser#ParseChars(arg) " {{{
" Handles symbol arrays which can be either an array of hex values,
" or a string. Will convert the hex array to a string, or return the
" string as-is.
let arg = a:arg
if type(arg) == type([])
" Hex array
call map(arg, 'nr2char(v:val)')
return join(arg, '')
endif
" Anything else, just return it as it is
return arg
endfunction " }}}
function! s:ParseSegments(mode, side, segments, ...) " {{{
let mode = a:mode
let side = a:side
let segments = a:segments
let level = exists('a:1') ? a:1 : 0
let base_color = exists('a:2') ? a:2 : {}
let ret = []
for i in range(0, len(segments) - 1)
unlet! seg_prev seg_curr seg_next
" Prepare some resources (fetch previous, current and next segment)
let seg_curr = deepcopy(get(segments, i))
" Find previous segment
let seg_prev = s:EMPTY_SEGMENT
" If we're currently at i = 0 we have to start on 0 or else we will start on the last segment (list[-1])
let range_start = (i == 0 ? i : i - 1)
for j in range(range_start, 0, -1)
let seg = deepcopy(get(segments, j))
if get(seg, 'name') ==# 'TRUNCATE'
" Skip truncate segments
continue
endif
" Look ahead for another segment that's visible in this mode
if index(get(seg, 'modes'), mode) != -1
" Use this segment
let seg_prev = seg
break
endif
endfor
"" Find next segment
let seg_next = s:EMPTY_SEGMENT
" If we're currently at i = len(segments) - 1 we have to start on i or else we will get an error because the index doesn't exist
let range_start = (i == len(segments) - 1 ? i : i + 1)
for j in range(range_start, len(segments) - 1, 1)
let seg = deepcopy(get(segments, j))
if get(seg, 'name') ==# 'TRUNCATE'
" Skip truncate segments
continue
endif
" Look ahead for another segment that's visible in this mode
if index(get(seg, 'modes'), mode) != -1
" Use this segment
let seg_next = seg
break
endif
endfor
if index(get(seg_curr, 'modes', []), mode) == -1
" The segment is invisible in this mode, skip it
" FIXME When two segments after each other are hidden, a gap appears where the segments would be, this is probably due to segment padding
continue
endif
" Handle the different segment types
if seg_curr.type == 'segment'
if seg_curr.name ==# 'TRUNCATE'
" Truncate statusline
call add(ret, '%<')
elseif seg_curr.name ==# 'SPLIT'
" Split statusline
" Switch sides
let side = s:RIGHT_SIDE
" Handle highlighting
let mode_colors = get(seg_curr.colors, mode, seg_curr.colors['n'])
let hl_group = s:HlCreate(mode_colors)
" Add segment text
call add(ret, '%#'. hl_group .'#%=')
else
" Add segment text
let text = seg_curr.text
" Decide on whether to use the group's colors or the segment's colors
let colors = get(seg_curr, 'colors', base_color)
" Fallback to normal (current) highlighting if we don't have mode-specific highlighting
let mode_colors = get(colors, mode, get(colors, 'n', {}))
if empty(mode_colors)
echom 'Segment doesn''t have any colors! NS: "'. seg_curr.ns .'" SEG: "'. seg_curr.name .'"'
continue
endif
" Check if we're in a group (level > 0)
if level > 0
" If we're in a group we don't have dividers between
" segments, so we should only pad one side, but only pad
" if the segment doesn't have Pl#Segment#NoPadding() set
let padding_right = (seg_curr.padding && side == s:LEFT_SIDE ? repeat(' ', s:PADDING) : '')
let padding_left = (seg_curr.padding && side == s:RIGHT_SIDE ? repeat(' ', s:PADDING) : '')
" Check if we lack a bg/fg color for this segment
" If we do, use the bg/fg color from base_color
let base_color_mode = ! has_key(base_color, mode) ? base_color['n'] : base_color[mode]
for col in ['ctermbg', 'ctermfg', 'guibg', 'guifg']
if empty(mode_colors[col])
let mode_colors[col] = base_color_mode[col]
endif
endfor
else
"" If we're outside a group we have dividers and must pad both sides
let padding_left = repeat(' ', s:PADDING)
let padding_right = repeat(' ', s:PADDING)
endif
" Get main hl group for segment
let hl_group = s:HlCreate(mode_colors)
" Prepare segment text
let text = '%(%#'. hl_group .'#'. padding_left . text . padding_right . '%)'
if level == 0
" Add divider to single segments
let text = s:AddDivider(text, side, mode, colors, seg_prev, seg_curr, seg_next)
endif
call add(ret, text)
endif
elseif seg_curr.type == 'segment_group'
" Recursively parse segment group
let func_params = [mode, side, seg_curr.segments, level + 1]
if has_key(seg_curr, 'colors')
" Pass the base colors on to the child segments
call add(func_params, seg_curr.colors)
endif
" Get segment group string
let text = join(call('s:ParseSegments', func_params), '')
" Pad on the opposite side of the divider
let padding_right = (side == s:RIGHT_SIDE ? repeat(' ', s:PADDING) : '')
let padding_left = (side == s:LEFT_SIDE ? repeat(' ', s:PADDING) : '')
let text = s:AddDivider(padding_left . text . padding_right, side, mode, seg_curr.colors, seg_prev, seg_curr, seg_next)
call add(ret, text)
endif
endfor
return ret
endfunction " }}}
function! s:HlCreate(hl) " {{{
" Create a short and unique highlighting group name
" It uses the hex values of all the color properties and an attribute flag at the end
" NONE colors are translated to NN for cterm and NNNNNN for gui colors
let hi_group = printf('Pl%s%s%s%s%s'
\ , (a:hl['ctermfg'] == 'NONE' ? 'NN' : printf('%02x', a:hl['ctermfg']))
\ , (a:hl['guifg'] == 'NONE' ? 'NNNNNN' : printf('%06x', a:hl['guifg'] ))
\ , (a:hl['ctermbg'] == 'NONE' ? 'NN' : printf('%02x', a:hl['ctermbg']))
\ , (a:hl['guibg'] == 'NONE' ? 'NNNNNN' : printf('%06x', a:hl['guibg'] ))
\ , substitute(a:hl['attr'], '\v([a-zA-Z])[a-zA-Z]*,?', '\1', 'g')
\ )
if ! s:HlExists(hi_group)
let ctermbg = a:hl['ctermbg'] == 'NONE' ? 'NONE' : printf('%d', a:hl['ctermbg'])
if (has('win32') || has('win64')) && !has('gui_running') && ctermbg != 'NONE' && ctermbg > 128
let ctermbg -= 128
endif
let hi_cmd = printf('hi %s ctermfg=%s ctermbg=%s cterm=%s guifg=%s guibg=%s gui=%s'
\ , hi_group
\ , a:hl['ctermfg'] == 'NONE' ? 'NONE' : printf('%d', a:hl['ctermfg'])
\ , ctermbg
\ , a:hl['attr']
\ , (a:hl['guifg'] == 'NONE' ? 'NONE' : printf('#%06x', a:hl['guifg']))
\ , (a:hl['guibg'] == 'NONE' ? 'NONE' : printf('#%06x', a:hl['guibg']))
\ , a:hl['attr']
\ )
exec hi_cmd
" Add command to Pl#HL list for caching
call add(g:Pl#HL, hi_cmd)
endif
" Return only the highlighting group name
return hi_group
endfunction " }}}
function! s:HlExists(hl) " {{{
if ! hlexists(a:hl)
return 0
endif
redir => hlstatus
silent exec 'hi' a:hl
redir END
return (hlstatus !~ 'cleared')
endfunction " }}}
function! s:AddDivider(text, side, mode, colors, prev, curr, next) " {{{
let seg_prev = a:prev
let seg_curr = a:curr
let seg_next = a:next
" Set default color/type for the divider
let div_colors = get(a:colors, a:mode, a:colors['n'])
let div_type = s:SOFT_DIVIDER
" Define segment to compare
let cmp_seg = a:side == s:LEFT_SIDE ? seg_next : seg_prev
let cmp_all_colors = get(cmp_seg, 'colors', {})
let cmp_colors = get(cmp_all_colors, a:mode, get(cmp_all_colors, 'n', {}))
if ! empty(cmp_colors)
" Compare the highlighting groups
"
" If the background color for cterm is equal, use soft divider with the current segment's highlighting
" If not, use hard divider with a new highlighting group
"
" Note that if the previous/next segment is the split, a hard divider is always used
if get(div_colors, 'ctermbg') != get(cmp_colors, 'ctermbg') || get(seg_next, 'name') ==# 'SPLIT' || get(seg_prev, 'name') ==# 'SPLIT'
let div_type = s:HARD_DIVIDER
" Create new highlighting group
if div_colors['attr'] =~ 'reverse' && cmp_colors['attr'] =~ 'reverse'
" Use FG = CURRENT FG, BG = CMP FG
let div_colors['ctermbg'] = get(cmp_colors, 'ctermfg')
let div_colors['guibg'] = get(cmp_colors, 'guifg')
let div_colors['attr'] = div_colors['attr'] =~ 'bold' ? 'bold' : 'NONE'
elseif div_colors['attr'] =~ 'reverse'
" Use FG = CURRENT FG, BG = CMP BG
let div_colors['ctermbg'] = get(cmp_colors, 'ctermbg')
let div_colors['guibg'] = get(cmp_colors, 'guibg')
let div_colors['attr'] = div_colors['attr'] =~ 'bold' ? 'bold' : 'NONE'
elseif cmp_colors['attr'] =~ 'reverse'
" Use FG = CMP FG, BG = CURRENT BG : reversed
let div_colors['ctermfg'] = get(cmp_colors, 'ctermfg')
let div_colors['guifg'] = get(cmp_colors, 'guifg')
let div_colors['attr'] = 'reverse'
else
" Use FG = CURRENT BG, BG = CMP BG
let div_colors['ctermfg'] = get(div_colors, 'ctermbg')
let div_colors['guifg'] = get(div_colors, 'guibg')
let div_colors['ctermbg'] = get(cmp_colors, 'ctermbg')
let div_colors['guibg'] = get(cmp_colors, 'guibg')
let div_colors['attr'] = 'NONE'
endif
endif
endif
" Prepare divider
let divider_raw = deepcopy(g:Pl#Parser#Symbols[g:Powerline_symbols].dividers[a:side + div_type])
let divider = Pl#Parser#ParseChars(divider_raw)
" Don't add dividers for segments adjacent to split (unless it's a hard divider)
if ((get(seg_next, 'name') ==# 'SPLIT' || get(seg_prev, 'name') ==# 'SPLIT') && div_type != s:HARD_DIVIDER)
return ''
endif
if a:side == s:LEFT_SIDE
" Left side
" Divider to the right
return printf('%%(%s%%#%s#%s%%)', a:text, s:HlCreate(div_colors), divider)
else
" Right side
" Divider to the left
return printf('%%(%%#%s#%s%s%%)', s:HlCreate(div_colors), divider, a:text)
endif
endfunction " }}}

View file

@ -1,188 +0,0 @@
let s:default_modes = ['n', 'N', 'v', 'i', 'r', 's']
function! s:CheckConditions(params) " {{{
" Check conditions for a segment/group
" Integer parameters are always conditions
for param in a:params
if type(param) == type(0) && param == 0
" Break here if it's an integer parameter and it's false (0)
return 0
endif
unlet! param
endfor
return 1
endfunction " }}}
function! Pl#Segment#Create(name, ...) " {{{
" Check condition parameters
if ! s:CheckConditions(a:000)
return {}
endif
let name = a:name
let modes = s:default_modes
let padding = 1
let segments = []
for param in a:000
" Lookup modes for this segment/group
if type(param) == type([]) && param[0] == 'modes'
let modes = param[1]
elseif type(param) == type([]) && param[0] == 'nopadding'
let padding = 0
elseif type(a:1) == type([]) && a:1[0] == 'segment'
call add(segments, param[1])
endif
unlet! param
endfor
if type(a:1) == type([]) && a:1[0] == 'segment'
" This is a segment group
return ['segment_group', {
\ 'type': 'segment_group'
\ , 'name': name
\ , 'segments': segments
\ , 'modes': modes
\ , 'padding': padding
\ }]
else
" This is a single segment
let text = a:1
" Search/replace symbols
for [key, symbol] in items(g:Pl#Parser#Symbols[g:Powerline_symbols].symbols)
let text = substitute(
\ text,
\ '\v\$('. key .')',
\ '\=Pl#Parser#ParseChars(g:Pl#Parser#Symbols[g:Powerline_symbols].symbols[submatch(1)])',
\ 'g')
unlet! key symbol
endfor
return ['segment', {
\ 'type': 'segment'
\ , 'name': name
\ , 'text': text
\ , 'modes': modes
\ , 'padding': padding
\ }]
endif
endfunction " }}}
function! Pl#Segment#Init(params) " {{{
" Check condition parameters
if ! s:CheckConditions(a:params)
return {}
endif
let segments = {}
let ns = ''
for param in a:params
if type(param) == type('')
" String parameters is the namespace
let ns = param
elseif type(param) == type([])
" The data dict is in param[1]
" By default we don't have a namespace for the segment
let segment = param[1]
if ! empty(ns)
" Update segment so that it includes the namespace
" Add the namespace to the segment dict key
let segment.ns = ns
let segment.name = join([segment.ns, segment.name], ':')
endif
let key = segment.name
let segments[key] = segment
endif
unlet! param
endfor
return segments
endfunction " }}}
function! Pl#Segment#Modes(modes) " {{{
" Handle modes for both segments and groups
let modes = split(a:modes, '\zs')
if modes[0] == '!'
" Filter modes (e.g. "!nr" will ignore the segment in normal and replace modes)
let modes = filter(deepcopy(s:default_modes), 'v:val !~# "['. join(modes[1:]) .']"')
endif
return ['modes', modes]
endfunction " }}}
function! Pl#Segment#NoPadding() " {{{
return ['nopadding']
endfunction " }}}
function! Pl#Segment#Split(...) " {{{
return a:0 ? a:1 .':SPLIT' : 'SPLIT'
endfunction " }}}
function! Pl#Segment#Truncate() " {{{
return 'TRUNCATE'
endfunction " }}}
function! Pl#Segment#Get(name) " {{{
" Return a segment data dict
let args = []
" Check for printf segments (lists)
if type(a:name) == type([])
" We're dealing with a segment with printf arguments
let seg_orig_name = a:name[0]
let args = a:name[1:]
else
let seg_orig_name = a:name
endif
" Fetch namespace and variants for storing in the segment dict
let seg_ns = ''
let seg_variants = []
" Retrieve color scheme variants
let seg_name_split = split(seg_orig_name, '\v\.')
if len(seg_name_split) > 1
let seg_variants = seg_name_split[1:]
endif
" Retrieve segment name and namespace
" Use the first piece of the split string, we can't have variants in the final segment name
let seg_name_split = split(seg_name_split[0], '\v:')
let seg_name = seg_name_split[0]
if len(seg_name_split) > 1
let seg_ns = seg_name_split[0]
let seg_name = seg_name_split[-1]
endif
try
" If we have a namespace, try to use the namespaced segment first (i.e. search for the segment in the namespaced file first)
let return_segment = deepcopy(g:Powerline#Segments#{seg_ns}#segments[seg_ns .':'. seg_name])
catch
try
" We didn't find a namespaced segment, fall back to common segments
let return_segment = deepcopy(g:Powerline#Segments#segments[seg_name])
catch
" Didn't find the segment among the common segments either, just skip it
return {}
endtry
endtry
if len(args) && has_key(return_segment, 'text')
" Handle segment printf arguments
" printf doesn't accept lists as its second argument, so we have to work around that
let return_segment.text = call('printf', [ return_segment.text ] + args)
endif
" Assign namespace, name and variants
let return_segment.ns = seg_ns
let return_segment.name = seg_name
let return_segment.orig_name = seg_orig_name
let return_segment.variants = seg_variants
return return_segment
endfunction " }}}

View file

@ -1,100 +0,0 @@
function! Pl#Theme#Create(...) " {{{
let buffer_segments = []
for buffer_segment in a:000
" Remove empty segments (e.g. 'Pl#Theme#Function's)
if empty(buffer_segment)
continue
endif
call add(buffer_segments, buffer_segment)
endfor
let buffer_segments = Pl#Colorscheme#Apply(g:Powerline_colorscheme, buffer_segments)
return buffer_segments
endfunction " }}}
function! Pl#Theme#Callback(name, expr) " {{{
return ['callback', a:name, a:expr]
endfunction " }}}
function! Pl#Theme#Buffer(ns, ...) " {{{
let segments = []
let ns = ! empty(a:ns) ? a:ns .':' : ''
" Match namespace parameter by default
let matches = Pl#Match#Any(a:ns)
let callback = []
let args = a:000
let args = Pl#Mod#ApplySegmentMods(args)
" Fetch segment data dicts
for item in args
if type(item) == type([])
if item[0] == 'match'
" Match item, overrides default namespace match
let matches = item
unlet! item
continue
elseif item[0] == 'callback'
" Store the item as a callback expression
let matches = ['match', 'none']
let callback = [a:ns, item[1], item[2]]
unlet! item
continue
endif
" printf segment, append ns to first item in list
let item[0] = ns . item[0]
else
let item = ns . item
endif
let segment = Pl#Segment#Get(item)
if ! empty(segment)
" Skip empty (possible disabled) segments
call add(segments, segment)
endif
unlet! item
endfor
return {
\ 'matches': matches
\ , 'callback': callback
\ , 'segments': segments
\ }
endfunction " }}}
function! Pl#Theme#InsertSegment(new_segment, where, target_segment) " {{{
" It's very important to NOT refer to the theme dict until everything's loaded!
"
" Because these functions are called from the vimrc, we need to put the
" actions in a list which will be parsed later.
"
" These functions don't accept a name parameter, because they work on the
" currently selected theme (will change any selected theme)
call Pl#Mod#AddSegmentMod('insert_segment', {
\ 'new_segment': a:new_segment,
\ 'where': a:where,
\ 'target_segment': a:target_segment
\ })
endfunction " }}}
function! Pl#Theme#RemoveSegment(target_segment) " {{{
" It's very important to NOT refer to the theme dict until everything's loaded!
"
" Because these functions are called from the vimrc, we need to put the
" actions in a list which will be parsed later.
"
" These functions don't accept a name parameter, because they work on the
" currently selected theme (will change any selected theme)
call Pl#Mod#AddSegmentMod('remove_segment', {
\ 'target_segment': a:target_segment
\ })
endfunction " }}}
function! Pl#Theme#ReplaceSegment(old_segment, new_segment) " {{{
call Pl#Theme#InsertSegment(a:new_segment, 'after', a:old_segment)
call Pl#Theme#RemoveSegment(a:old_segment)
endfunction " }}}

View file

@ -1,166 +0,0 @@
call Pl#Hi#Allocate({
\ 'black' : 16,
\ 'white' : 231,
\
\ 'darkestgreen' : 22,
\ 'darkgreen' : 28,
\ 'mediumgreen' : 70,
\ 'brightgreen' : 148,
\
\ 'darkestcyan' : 23,
\ 'mediumcyan' : 117,
\
\ 'darkestblue' : 24,
\ 'darkblue' : 31,
\
\ 'darkestred' : 52,
\ 'darkred' : 88,
\ 'mediumred' : 124,
\ 'brightred' : 160,
\ 'brightestred' : 196,
\
\ 'darkestpurple' : 55,
\ 'mediumpurple' : 98,
\ 'brightpurple' : 189,
\
\ 'brightorange' : 208,
\ 'brightestorange': 214,
\
\ 'gray0' : 233,
\ 'gray1' : 235,
\ 'gray2' : 236,
\ 'gray3' : 239,
\ 'gray4' : 240,
\ 'gray5' : 241,
\ 'gray6' : 244,
\ 'gray7' : 245,
\ 'gray8' : 247,
\ 'gray9' : 250,
\ 'gray10' : 252,
\ })
let g:Powerline#Colorschemes#default#colorscheme = Pl#Colorscheme#Init([
\ Pl#Hi#Segments(['SPLIT'], {
\ 'n': ['white', 'gray2'],
\ 'N': ['white', 'gray0'],
\ 'i': ['white', 'darkestblue'],
\ }),
\
\ Pl#Hi#Segments(['mode_indicator'], {
\ 'n': ['gray10', 'gray0', ['bold']],
\ 'i': ['darkestcyan', 'white', ['bold']],
\ 'v': ['white', 'darkestblue', ['bold']],
\ 'r': ['white', 'brightred', ['bold']],
\ 's': ['white', 'gray5', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['branch', 'scrollpercent', 'raw', 'filesize'], {
\ 'n': ['gray9', 'gray4'],
\ 'N': ['gray4', 'gray1'],
\ 'i': ['mediumcyan', 'darkblue'],
\ }),
\
\ Pl#Hi#Segments(['fileinfo', 'filename'], {
\ 'n': ['white', 'gray4', ['bold']],
\ 'N': ['gray7', 'gray0', ['bold']],
\ 'i': ['white', 'darkblue', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['fileinfo.filepath'], {
\ 'n': ['gray10'],
\ 'N': ['gray5'],
\ 'i': ['mediumcyan'],
\ }),
\
\ Pl#Hi#Segments(['static_str'], {
\ 'n': ['white', 'gray4'],
\ 'N': ['gray7', 'gray1'],
\ 'i': ['white', 'darkblue'],
\ }),
\
\ Pl#Hi#Segments(['fileinfo.flags'], {
\ 'n': ['brightestred', ['bold']],
\ 'N': ['darkred'],
\ 'i': ['brightestred', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['currenttag', 'fullcurrenttag', 'fileformat', 'fileencoding', 'pwd', 'filetype', 'rvm:string', 'rvm:statusline', 'virtualenv:statusline', 'charcode', 'currhigroup'], {
\ 'n': ['gray8', 'gray2'],
\ 'i': ['mediumcyan', 'darkestblue'],
\ }),
\
\ Pl#Hi#Segments(['lineinfo'], {
\ 'n': ['gray2', 'gray10', ['bold']],
\ 'N': ['gray7', 'gray1', ['bold']],
\ 'i': ['darkestcyan', 'mediumcyan', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['errors'], {
\ 'n': ['brightestorange', 'gray2', ['bold']],
\ 'i': ['brightestorange', 'darkestblue', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['lineinfo.line.tot'], {
\ 'n': ['gray6'],
\ 'N': ['gray5'],
\ 'i': ['darkestcyan'],
\ }),
\
\ Pl#Hi#Segments(['paste_indicator', 'ws_marker'], {
\ 'n': ['white', 'brightred', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['gundo:static_str.name', 'command_t:static_str.name'], {
\ 'n': ['white', 'mediumred', ['bold']],
\ 'N': ['brightred', 'darkestred', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['gundo:static_str.buffer', 'command_t:raw.line'], {
\ 'n': ['white', 'darkred'],
\ 'N': ['brightred', 'darkestred'],
\ }),
\
\ Pl#Hi#Segments(['gundo:SPLIT', 'command_t:SPLIT'], {
\ 'n': ['white', 'darkred'],
\ 'N': ['white', 'darkestred'],
\ }),
\
\ Pl#Hi#Segments(['lustyexplorer:static_str.name', 'minibufexplorer:static_str.name', 'nerdtree:raw.name', 'tagbar:static_str.name'], {
\ 'n': ['white', 'mediumgreen', ['bold']],
\ 'N': ['mediumgreen', 'darkestgreen', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['lustyexplorer:static_str.buffer', 'tagbar:static_str.buffer'], {
\ 'n': ['brightgreen', 'darkgreen'],
\ 'N': ['mediumgreen', 'darkestgreen'],
\ }),
\
\ Pl#Hi#Segments(['lustyexplorer:SPLIT', 'minibufexplorer:SPLIT', 'nerdtree:SPLIT', 'tagbar:SPLIT'], {
\ 'n': ['white', 'darkgreen'],
\ 'N': ['white', 'darkestgreen'],
\ }),
\
\ Pl#Hi#Segments(['ctrlp:focus', 'ctrlp:byfname'], {
\ 'n': ['brightpurple', 'darkestpurple'],
\ }),
\
\ Pl#Hi#Segments(['ctrlp:prev', 'ctrlp:next', 'ctrlp:pwd'], {
\ 'n': ['white', 'mediumpurple'],
\ }),
\
\ Pl#Hi#Segments(['ctrlp:item'], {
\ 'n': ['darkestpurple', 'white', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['ctrlp:marked'], {
\ 'n': ['brightestred', 'darkestpurple', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['ctrlp:count'], {
\ 'n': ['darkestpurple', 'white'],
\ }),
\
\ Pl#Hi#Segments(['ctrlp:SPLIT'], {
\ 'n': ['white', 'darkestpurple'],
\ }),
\ ])

View file

@ -1,192 +0,0 @@
" This theme is based on Solarized-dark colors, combined
" with Powerline native colors
call Pl#Hi#Allocate({
\ 'black' : 16,
\ 'white' : 231,
\
\ 'darkestgreen' : 22,
\ 'darkgreen' : 28,
\ 'mediumgreen' : 70,
\ 'brightgreen' : 148,
\
\ 'darkestcyan' : 23,
\ 'mediumcyan' : 117,
\
\ 'darkestblue' : 24,
\ 'darkblue' : 31,
\
\ 'darkestred' : 52,
\ 'darkred' : 88,
\ 'mediumred' : 124,
\ 'brightred' : 160,
\ 'brightestred' : 196,
\
\ 'darkestpurple' : 55,
\ 'mediumpurple' : 98,
\ 'brightpurple' : 189,
\
\ 'brightorange' : 208,
\ 'brightestorange': 214,
\
\ 'gray0' : 233,
\ 'gray1' : 235,
\ 'gray2' : 236,
\ 'gray3' : 239,
\ 'gray4' : 240,
\ 'gray5' : 241,
\ 'gray6' : 244,
\ 'gray7' : 245,
\ 'gray8' : 247,
\ 'gray9' : 250,
\ 'gray10' : 252,
\
\ 'base00' : [241, 0x657b83],
\ 'base01' : [240, 0x586e75],
\ 'base02' : [0, 0x073642],
\ 'base03' : [234, 0x002b36],
\ 'base0' : [244, 0x839496],
\ 'base1' : [245, 0x93a1a1],
\ 'base2' : [254, 0xeee8d5],
\ 'base3' : [230, 0xfdf6e3],
\ 'yellow' : [136, 0xb58900],
\ 'orange' : [166, 0xcb4b16],
\ 'red' : [160, 0xdc322f],
\ 'magenta' : [125, 0xd33682],
\ 'violet' : [61, 0x6c71c4],
\ 'blue' : [33, 0x268bd2],
\ 'cyan' : [37, 0x2aa198],
\ 'green' : [64, 0x859900],
\ })
let g:Powerline#Colorschemes#skwp#colorscheme = Pl#Colorscheme#Init([
\ Pl#Hi#Segments(['SPLIT'], {
\ 'n': ['white', 'base02'],
\ 'N': ['white', 'base02'],
\ }),
\
\ Pl#Hi#Segments(['mode_indicator'], {
\ 'n': ['darkestgreen', 'brightgreen', ['bold']],
\ 'i': ['darkestcyan', 'white', ['bold']],
\ 'v': ['red', 'brightorange', ['bold']],
\ 'r': ['white', 'violet', ['bold']],
\ 's': ['white', 'gray5', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['branch', 'raw', 'filesize'], {
\ 'n': ['base03', 'blue'],
\ 'N': ['gray5', 'base03'],
\ }),
\
\ Pl#Hi#Segments(['scrollpercent'], {
\ 'n': ['gray7', 'gray2'],
\ 'N': ['base2', 'base02'],
\ }),
\
\ Pl#Hi#Segments(['fileinfo', 'filename', 'filepath'], {
\ 'n': ['base2', 'darkestblue', ['bold']],
\ 'N': ['base1', 'base02', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['fileinfo.filepath'], {
\ 'n': ['gray10'],
\ 'N': ['gray5'],
\ 'i': ['mediumcyan'],
\ }),
\
\ Pl#Hi#Segments(['static_str'], {
\ 'n': ['base3', 'violet'],
\ 'N': ['base1', 'base02'],
\ 'i': ['white', 'base02'],
\ }),
\
\ Pl#Hi#Segments(['fileinfo.flags'], {
\ 'n': ['base03', ['bold']],
\ 'N': ['gray5'],
\ 'i': ['base03', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['currenttag', 'fullcurrenttag', 'fileformat', 'fileencoding', 'pwd', 'filetype', 'rvm:string', 'rvm:statusline', 'virtualenv:statusline', 'charcode', 'currhigroup'], {
\ 'n': ['gray5', 'gray2'],
\ 'i': ['mediumcyan', 'base02'],
\ }),
\
\ Pl#Hi#Segments(['lineinfo'], {
\ 'n': ['gray2', 'gray10', ['bold']],
\ 'N': ['gray7', 'gray1', ['bold']],
\ 'i': ['darkestcyan', 'mediumcyan', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['errors'], {
\ 'n': ['orange', 'base02', ['bold']],
\ 'N': ['gray5', 'base03', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['lineinfo.line.tot'], {
\ 'n': ['gray6'],
\ 'N': ['gray5'],
\ 'i': ['darkestcyan'],
\ }),
\
\ Pl#Hi#Segments(['paste_indicator', 'ws_marker'], {
\ 'n': ['base3', 'red', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['gundo:static_str.name', 'command_t:static_str.name'], {
\ 'n': ['base3', 'darkblue', ['bold']],
\ 'N': ['base1', 'base03', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['gundo:static_str.buffer', 'command_t:raw.line'], {
\ 'n': ['white', 'base02'],
\ 'N': ['gray5', 'base02'],
\ }),
\
\ Pl#Hi#Segments(['gundo:SPLIT', 'command_t:SPLIT'], {
\ 'n': ['white', 'base02'],
\ 'N': ['white', 'base02'],
\ }),
\
\ Pl#Hi#Segments(['lustyexplorer:static_str.name', 'minibufexplorer:static_str.name', 'nerdtree:raw.name', 'tagbar:static_str.name'], {
\ 'n': ['gray10', 'darkestblue', ['bold']],
\ 'N': ['gray3', 'base02', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['lustyexplorer:static_str.buffer', 'tagbar:static_str.buffer'], {
\ 'n': ['base3', 'blue'],
\ 'N': ['gray5', 'base02'],
\ }),
\
\ Pl#Hi#Segments(['lustyexplorer:SPLIT', 'minibufexplorer:SPLIT', 'nerdtree:SPLIT', 'tagbar:SPLIT'], {
\ 'n': ['gray3', 'base02'],
\ 'N': ['gray3', 'base02'],
\ }),
\
\ Pl#Hi#Segments(['ctrlp:focus', 'ctrlp:byfname'], {
\ 'n': ['green', 'base03'],
\ }),
\
\ Pl#Hi#Segments(['ctrlp:prev', 'ctrlp:next', 'ctrlp:pwd'], {
\ 'n': ['green', 'base02'],
\ }),
\
\ Pl#Hi#Segments(['ctrlp:item'], {
\ 'n': ['base2', 'darkestblue', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['ctrlp:marked'], {
\ 'n': ['brightgreen', 'base03', ['bold']],
\ }),
\
\ Pl#Hi#Segments(['ctrlp:count'], {
\ 'n': ['base0', 'base03'],
\ }),
\
\ Pl#Hi#Segments(['ctrlp:SPLIT'], {
\ 'n': ['white', 'base03'],
\ }),
\
\ Pl#Hi#Segments(['status'], {
\ 'n': ['green', 'base02'],
\ 'N': ['gray5', 'base02'],
\ }),
\ ])

View file

@ -1,141 +0,0 @@
" Recalculate the trailing whitespace warning when idle, and after saving
autocmd CursorHold,BufWritePost,InsertLeave * unlet! b:statusline_trailing_space_warning
function! Powerline#Functions#GetFilepath() " {{{
" Recalculate the filepath when cwd changes.
let cwd = getcwd()
if exists("b:Powerline_cwd") && cwd != b:Powerline_cwd
unlet! b:Powerline_filepath
endif
let b:Powerline_cwd = cwd
if exists('b:Powerline_filepath')
return b:Powerline_filepath
endif
let dirsep = has('win32') && ! &shellslash ? '\' : '/'
let filepath = expand('%:p')
if empty(filepath)
return ''
endif
let ret = ''
if g:Powerline_stl_path_style == 'short'
" Display a short path where the first directory is displayed with its
" full name, and the subsequent directories are shortened to their
" first letter, i.e. "/home/user/foo/foo/bar/baz.vim" becomes
" "~/foo/f/b/baz.vim"
"
" This displays the shortest possible path, relative to ~ or the
" current directory.
let mod = (exists('+acd') && &acd) ? ':~:h' : ':~:.:h'
let fpath = split(fnamemodify(filepath, mod), dirsep)
let fpath_shortparts = map(fpath[1:], 'v:val[0]')
let ret = join(extend([fpath[0]], fpath_shortparts), dirsep) . dirsep
elseif g:Powerline_stl_path_style == 'relative'
" Display a relative path, similar to the %f statusline item
let ret = fnamemodify(filepath, ':~:.:h') . dirsep
elseif g:Powerline_stl_path_style == 'full'
" Display the full path, similar to the %F statusline item
let ret = fnamemodify(filepath, ':h') . dirsep
endif
if ret == ('.' . dirsep)
let ret = ''
endif
let b:Powerline_filepath = ret
return ret
endfunction " }}}
function! Powerline#Functions#GetShortPath(threshold) " {{{
let fullpath = split(substitute(expand('%:p:h'), $HOME, '~', 'g'), '/')
if len(fullpath) > a:threshold
let fullpath = [fullpath[0], '…'] + fullpath[-a:threshold + 1 :]
endif
return join(fullpath, '/')
endfunction " }}}
function! Powerline#Functions#GetMode() " {{{
let mode = mode()
if mode ==# 'v'
let mode = get(g:, "Powerline_mode_v", "VISUAL")
elseif mode ==# 'V'
let mode = get(g:, "Powerline_mode_V", "V⋅LINE")
elseif mode ==# ''
let mode = get(g:, "Powerline_mode_cv", "V⋅BLOCK")
elseif mode ==# 's'
let mode = get(g:, "Powerline_mode_s", "SELECT")
elseif mode ==# 'S'
let mode = get(g:, "Powerline_mode_S", "S⋅LINE")
elseif mode ==# ''
let mode = get(g:, "Powerline_mode_cs", "S⋅BLOCK")
elseif mode =~# '\vi'
let mode = get(g:, "Powerline_mode_i", "INSERT")
elseif mode =~# '\v(R|Rv)'
let mode = get(g:, "Powerline_mode_R", "REPLACE")
else
" Fallback to normal mode
let mode = get(g:, "Powerline_mode_n", "NORMAL")
endif
return mode
endfunction " }}}
function! Powerline#Functions#GetFilesize() " {{{
let bytes = getfsize(expand("%:p"))
if bytes <= 0
return ''
endif
if bytes < 1024
return bytes . 'B'
else
return (bytes / 1024) . 'kB'
endif
endfunction "}}}
function! Powerline#Functions#GetCharCode() " {{{
" Get the output of :ascii
redir => ascii
silent! ascii
redir END
if match(ascii, 'NUL') != -1
return 'NUL'
endif
" Zero pad hex values
let nrformat = '0x%02x'
let encoding = (&fenc == '' ? &enc : &fenc)
if encoding == 'utf-8'
" Zero pad with 4 zeroes in unicode files
let nrformat = '0x%04x'
endif
" Get the character and the numeric value from the return value of :ascii
" This matches the two first pieces of the return value, e.g.
" "<F> 70" => char: 'F', nr: '70'
let [str, char, nr; rest] = matchlist(ascii, '\v\<(.{-1,})\>\s*([0-9]+)')
" Format the numeric value
let nr = printf(nrformat, nr)
return "'". char ."' ". nr
endfunction "}}}
function! Powerline#Functions#GetWSMarker() " {{{
" Return '...' if trailing white space is detected
" Return '' otherwise
if ! exists("b:statusline_trailing_space_warning")
if search('\s$', 'nw') != 0
let b:statusline_trailing_space_warning = ' … '
else
let b:statusline_trailing_space_warning = ''
endif
endif
return b:statusline_trailing_space_warning
endfunction " }}}

View file

@ -1,12 +0,0 @@
function! Powerline#Functions#ft_man#GetName() " {{{
let matches = matchlist(getline(1), '\v^([a-zA-Z_\.\-]+)\((\d+)\)')
if ! len(matches)
return 'n/a'
endif
let file = tolower(matches[1])
let num = matches[2]
return file
endfunction " }}}

View file

@ -1,7 +0,0 @@
function! Powerline#Functions#fugitive#GetBranch(symbol) " {{{
let ret = fugitive#statusline()
let ret = substitute(ret, '\c\v\[?GIT\(([a-z0-9\-_\./:]+)\)\]?', a:symbol .' \1', 'g')
return ret
endfunction " }}}

View file

@ -1,17 +0,0 @@
function! Powerline#Functions#hgrev#Status(symbol) " {{{
if ! exists('*HGRev')
" HGRev hasn't been loaded yet
return ''
endif
if !exists("b:statusline_hg_status")
silent execute "RefreshMercurialRev"
endif
let b:statusline_hg_status=HGRev()
if b:statusline_hg_status != '-'
let ret = "\u26A1". '' . substitute(b:statusline_hg_status, '^[^ ]*', '\1', 'g')
let ret=substitute(ret,' M$','+','g')
else
let ret=''
endif
return ret
endfunction " }}}

View file

@ -1,16 +0,0 @@
function! Powerline#Functions#syntastic#GetErrors(line_symbol) " {{{
if ! exists('g:syntastic_stl_format')
" Syntastic hasn't been loaded yet
return ''
endif
" Temporarily change syntastic output format
let old_stl_format = g:syntastic_stl_format
let g:syntastic_stl_format = '%E{ ERRORS (%e) '. a:line_symbol .' %fe }%W{ WARNINGS (%w) '. a:line_symbol .' %fw }'
let ret = SyntasticStatuslineFlag()
let g:syntastic_stl_format = old_stl_format
return ret
endfunction " }}}

View file

@ -1,13 +0,0 @@
let g:Powerline#Matches#matches = {
\ 'command_t' : Pl#Match#Add('bufname("%")', 'GoToFile'),
\ 'bt_help' : Pl#Match#Add('&bt' , 'help'),
\ 'ft_man' : Pl#Match#Add('&ft' , 'man'),
\ 'ft_qf' : Pl#Match#Add('&ft' , 'qf'),
\ 'ft_vimpager' : Pl#Match#Add('&ft' , 'vimpager'),
\ 'gundo_preview' : Pl#Match#Add('bufname("%")', '__Gundo_Preview__'),
\ 'gundo_tree' : Pl#Match#Add('bufname("%")', '__Gundo__'),
\ 'lustyexplorer' : Pl#Match#Add('bufname("%")', '\[LustyExplorer-Buffers\]'),
\ 'minibufexplorer' : Pl#Match#Add('bufname("%")', '\-MiniBufExplorer\-'),
\ 'tagbar' : Pl#Match#Add('&ft' , 'tagbar'),
\ 'nerdtree' : Pl#Match#Add('&ft' , 'nerdtree'),
\ }

View file

@ -1,30 +0,0 @@
let g:Powerline#Segments#segments = Pl#Segment#Init([
\ Pl#Segment#Create('SPLIT' , '__split__'),
\ Pl#Segment#Create('TRUNCATE', '__truncate__'),
\
\ Pl#Segment#Create('paste_indicator' , '%{&paste ? "PASTE" : ""}', Pl#Segment#Modes('!N')),
\ Pl#Segment#Create('mode_indicator' , '%{Powerline#Functions#GetMode()}', Pl#Segment#Modes('!N')),
\ Pl#Segment#Create('fileinfo',
\ Pl#Segment#Create('flags.ro' , '%{&readonly ? "$RO" : ""}'),
\ Pl#Segment#Create('filepath' , '%{Powerline#Functions#GetFilepath()}', Pl#Segment#NoPadding()),
\ Pl#Segment#Create('filename' , '%t'),
\ Pl#Segment#Create('flags.mod' , '%M'),
\ Pl#Segment#Create('flags.type' , '%H%W'),
\ ),
\ Pl#Segment#Create('filename' , '%t'),
\ Pl#Segment#Create('filesize' , '%{Powerline#Functions#GetFilesize()}', Pl#Segment#Modes('!N')),
\ Pl#Segment#Create('pwd' , '%{substitute(getcwd(), expand("$HOME"), "~", "g")}'),
\ Pl#Segment#Create('static_str' , '%%{"%s"}'),
\ Pl#Segment#Create('raw' , '%s'),
\ Pl#Segment#Create('fileformat' , '%{&fileformat}', Pl#Segment#Modes('!N')),
\ Pl#Segment#Create('fileencoding' , '%{(&fenc == "" ? &enc : &fenc)}', Pl#Segment#Modes('!N')),
\ Pl#Segment#Create('filetype' , '%{strlen(&ft) ? &ft : "no ft"}', Pl#Segment#Modes('!N')),
\ Pl#Segment#Create('scrollpercent' , '%3p%%'),
\ Pl#Segment#Create('lineinfo',
\ Pl#Segment#Create('line.cur' , '$LINE %3l'),
\ Pl#Segment#Create('line.tot' , ':%-2v', Pl#Segment#NoPadding()),
\ ),
\ Pl#Segment#Create('charcode' , '%{Powerline#Functions#GetCharCode()}', Pl#Segment#Modes('!N')),
\ Pl#Segment#Create('currhigroup' , '%{synIDattr(synID(line("."), col("."), 1), "name")}', Pl#Segment#Modes('!N')),
\ Pl#Segment#Create('ws_marker' , '%{Powerline#Functions#GetWSMarker()}', Pl#Segment#Modes('!N')),
\ ])

View file

@ -1,20 +0,0 @@
if !exists("g:Powerline#Segments#ctrlp#segments#focus ")
let g:Powerline#Segments#ctrlp#segments#focus = '%{"%0"}'
endif
if !exists("g:Powerline#Segments#ctrlp#segments#prev ")
let g:Powerline#Segments#ctrlp#segments#prev = '%-3{"%3"}'
endif
if !exists("g:Powerline#Segments#ctrlp#segments#next ")
let g:Powerline#Segments#ctrlp#segments#next = '%-3{"%5"}'
endif
let g:Powerline#Segments#ctrlp#segments = Pl#Segment#Init(['ctrlp'
\ , Pl#Segment#Create('focus', g:Powerline#Segments#ctrlp#segments#focus)
\ , Pl#Segment#Create('byfname', '%{"%1"}')
\ , Pl#Segment#Create('prev', g:Powerline#Segments#ctrlp#segments#prev)
\ , Pl#Segment#Create('item', '%-9{"%4"}')
\ , Pl#Segment#Create('next', g:Powerline#Segments#ctrlp#segments#next)
\ , Pl#Segment#Create('marked', '%{"%6" == " <+>" ? "" : strpart("%6", 2, len("%6") - 3)}')
\
\ , Pl#Segment#Create('count', '%-6{"%0"}')
\ ])

View file

@ -1,3 +0,0 @@
let g:Powerline#Segments#ft_man#segments = Pl#Segment#Init(['ft_man',
\ Pl#Segment#Create('filename', '%{Powerline#Functions#ft_man#GetName()}')
\ ])

View file

@ -1,5 +0,0 @@
let g:Powerline#Segments#fugitive#segments = Pl#Segment#Init(['fugitive',
\ (exists('g:loaded_fugitive') && g:loaded_fugitive == 1),
\
\ Pl#Segment#Create('branch', '%{Powerline#Functions#fugitive#GetBranch("$BRANCH")}')
\ ])

View file

@ -1,4 +0,0 @@
let g:Powerline#Segments#hgrev#segments = Pl#Segment#Init(['hgrev',
\ (exists('hgrev_loaded')),
\ Pl#Segment#Create('branch', '%{Powerline#Functions#hgrev#Status("$BRANCH")}')
\ ])

View file

@ -1,6 +0,0 @@
let g:Powerline#Segments#rvm#segments = Pl#Segment#Init(['rvm',
\ (exists('g:loaded_rvm') && g:loaded_rvm == 1),
\
\ Pl#Segment#Create('string', '%{rvm#string()}'),
\ Pl#Segment#Create('statusline', '%{rvm#statusline()}')
\ ])

View file

@ -1,5 +0,0 @@
let g:Powerline#Segments#syntastic#segments = Pl#Segment#Init(['syntastic',
\ (exists('g:loaded_syntastic_plugin') && g:loaded_syntastic_plugin == 1),
\
\ Pl#Segment#Create('errors', '%{Powerline#Functions#syntastic#GetErrors("$LINE")}', Pl#Segment#Modes('!N'))
\ ])

View file

@ -1,6 +0,0 @@
let g:Powerline#Segments#tagbar#segments = Pl#Segment#Init(['tagbar',
\ (exists(':Tagbar') > 0),
\
\ Pl#Segment#Create('currenttag', '%{tagbar#currenttag("%s", "")}', Pl#Segment#Modes('!N')),
\ Pl#Segment#Create('fullcurrenttag', '%{tagbar#currenttag("%s", "", "f")}', Pl#Segment#Modes('!N'))
\ ])

View file

@ -1,5 +0,0 @@
let g:Powerline#Segments#virtualenv#segments = Pl#Segment#Init(['virtualenv',
\ has('python') && (exists('g:virtualenv_loaded') && g:virtualenv_loaded == 1),
\
\ Pl#Segment#Create('statusline', '%{virtualenv#statusline()}')
\ ])

View file

@ -1,116 +0,0 @@
let g:Powerline#Themes#default#theme = Pl#Theme#Create(
\ Pl#Theme#Buffer(''
\ , 'paste_indicator'
\ , 'mode_indicator'
\ , 'fugitive:branch'
\ , 'hgrev:branch'
\ , 'fileinfo'
\ , 'syntastic:errors'
\ , Pl#Segment#Truncate()
\ , 'tagbar:currenttag'
\ , Pl#Segment#Split()
\ , 'rvm:string'
\ , 'virtualenv:statusline'
\ , 'fileformat'
\ , 'fileencoding'
\ , 'filetype'
\ , 'scrollpercent'
\ , 'lineinfo'
\ ),
\
\ Pl#Theme#Buffer('command_t'
\ , ['static_str.name', 'Command-T']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ , ['raw.line', '%10(Match #%l%)']
\ ),
\
\ Pl#Theme#Buffer('gundo', Pl#Match#Any('gundo_tree')
\ , ['static_str.name', 'Gundo']
\ , ['static_str.buffer', 'Undo tree']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ ),
\
\ Pl#Theme#Buffer('gundo', Pl#Match#Any('gundo_preview')
\ , ['static_str.name', 'Gundo']
\ , ['static_str.buffer', 'Diff preview']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ ),
\
\ Pl#Theme#Buffer('bt_help'
\ , ['static_str.name', 'Help']
\ , 'filename'
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ , 'scrollpercent'
\ ),
\
\ Pl#Theme#Buffer('ft_vimpager'
\ , ['static_str.name', 'Pager']
\ , 'filename'
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ , 'scrollpercent'
\ ),
\
\ Pl#Theme#Buffer('lustyexplorer'
\ , ['static_str.name', 'LustyExplorer']
\ , ['static_str.buffer', 'Buffer list']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ ),
\
\ Pl#Theme#Buffer('ft_man'
\ , ['static_str.name', 'Man page']
\ , 'filename'
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ , 'scrollpercent'
\ ),
\
\ Pl#Theme#Buffer('minibufexplorer'
\ , ['static_str.name', 'MiniBufExplorer']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ ),
\
\ Pl#Theme#Buffer('ft_qf'
\ , ['static_str.name', 'Quickfix']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ ),
\
\ Pl#Theme#Buffer('tagbar'
\ , ['static_str.name', 'Tagbar']
\ , ['static_str.buffer', 'Tree']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ ),
\
\ Pl#Theme#Buffer('ctrlp', Pl#Theme#Callback('ctrlp_main', 'if ! exists("g:ctrlp_status_func") | let g:ctrlp_status_func = {} | endif | let g:ctrlp_status_func.main = "%s"')
\ , 'ctrlp:prev'
\ , 'ctrlp:item'
\ , 'ctrlp:next'
\ , 'ctrlp:marked'
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ , 'ctrlp:focus'
\ , 'ctrlp:byfname'
\ , 'pwd'
\ ),
\
\ Pl#Theme#Buffer('ctrlp', Pl#Theme#Callback('ctrlp_prog', 'if ! exists("g:ctrlp_status_func") | let g:ctrlp_status_func = {} | endif | let g:ctrlp_status_func.prog = "%s"')
\ , 'ctrlp:count'
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ , 'pwd'
\ ),
\
\ Pl#Theme#Buffer('nerdtree'
\ , ['raw.name', '%{Powerline#Functions#GetShortPath(4)}']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ )
\ )

View file

@ -1,116 +0,0 @@
" Disabled:
" Add the following line into the first theme group to see the highlight
" group
" \ , 'currhigroup'
"
" Line info taken out - I know which line number I'm on from the gutter
"\ , 'lineinfo'
let g:Powerline#Themes#skwp#theme = Pl#Theme#Create(
\ Pl#Theme#Buffer(''
\ , 'fugitive:branch'
\ , 'fileinfo'
\ , 'flags.mod'
\ , 'syntastic:errors'
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ , 'sass:status'
\ , 'rvm:string'
\ , 'paste_indicator'
\ ),
\
\ Pl#Theme#Buffer('command_t'
\ , ['static_str.name', 'Command-T']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ , ['raw.line', '%10(Match #%l%)']
\ ),
\
\ Pl#Theme#Buffer('gundo', Pl#Match#Any('gundo_tree')
\ , ['static_str.name', 'Gundo']
\ , ['static_str.buffer', 'Undo tree']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ ),
\
\ Pl#Theme#Buffer('gundo', Pl#Match#Any('gundo_preview')
\ , ['static_str.name', 'Gundo']
\ , ['static_str.buffer', 'Diff preview']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ ),
\
\ Pl#Theme#Buffer('bt_help'
\ , ['static_str.name', 'Help']
\ , 'filename'
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ , 'scrollpercent'
\ ),
\
\ Pl#Theme#Buffer('ft_vimpager'
\ , ['static_str.name', 'Pager']
\ , 'filename'
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ , 'scrollpercent'
\ ),
\
\ Pl#Theme#Buffer('lustyexplorer'
\ , ['static_str.name', 'LustyExplorer']
\ , ['static_str.buffer', 'Buffer list']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ ),
\
\ Pl#Theme#Buffer('ft_man'
\ , ['static_str.name', 'Man page']
\ , 'filename'
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ , 'scrollpercent'
\ ),
\
\ Pl#Theme#Buffer('minibufexplorer'
\ , ['static_str.name', 'MiniBufExplorer']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ ),
\
\ Pl#Theme#Buffer('ft_qf'
\ , ['static_str.name', 'Quickfix']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ ),
\
\ Pl#Theme#Buffer('tagbar'
\ , ['static_str.name', 'Tagbar']
\ , ['static_str.buffer', 'Tree']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ ),
\
\ Pl#Theme#Buffer('ctrlp', Pl#Theme#Callback('ctrlp_main', 'if ! exists("g:ctrlp_status_func") | let g:ctrlp_status_func = {} | endif | let g:ctrlp_status_func.main = "%s"')
\ , 'ctrlp:prev'
\ , 'ctrlp:item'
\ , 'ctrlp:next'
\ , 'ctrlp:marked'
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ , 'ctrlp:focus'
\ , 'ctrlp:byfname'
\ , 'pwd'
\ ),
\
\ Pl#Theme#Buffer('ctrlp', Pl#Theme#Callback('ctrlp_prog', 'if ! exists("g:ctrlp_status_func") | let g:ctrlp_status_func = {} | endif | let g:ctrlp_status_func.prog = "%s"')
\ , 'ctrlp:count'
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ , 'pwd'
\ ),
\
\ Pl#Theme#Buffer('nerdtree'
\ , ['raw.name', '%{Powerline#Functions#GetShortPath(4)}']
\ , Pl#Segment#Truncate()
\ , Pl#Segment#Split()
\ )
\ )

View file

@ -1,429 +0,0 @@
*Powerline.txt* For Vim version 7.3. Last change: 2011 Nov 23
______
_________ \ /__
\_____ \______ _ _____________ / /'__' ___ ____
| ___/ _ \ \/ \/ / __ \_ ___\ / | |/ \_/ __ \
| | | (_) \ _ / ___/| | / /__| | | \ ___/
'___' \____/ \/ \/ \___ |__' /___ /'__'__| /\___ \
\/ / / \/ \/
| /
|/
'
==============================================================================
CONTENTS *Powerline-contents*
1. Introduction ....................... |Powerline-introduction|
2. Usage .............................. |Powerline-usage|
3. Requirements ....................... |Powerline-requirements|
3.1 Recommended settings ........... |Powerline-recommended-settings|
4. Configuration ...................... |Powerline-configuration|
4.1 Powerline_cache_file ........... |Powerline_cache_file|
4.1.1 Clearing the cache ....... |:PowerlineClearCache|
4.2 Powerline_cache_enabled ........ |Powerline_cache_enabled|
4.3 Powerline_symbols .............. |Powerline_symbols|
4.3.1 Compatible symbols ....... |Powerline-symbols-compatible|
4.3.2 Fancy symbols ............ |Powerline-symbols-fancy|
4.3.3 Overriding symbols ....... |Powerline_symbols_override|
4.3.4 Overriding dividers ...... |Powerline_dividers_override|
4.4 Powerline_theme ................ |Powerline_theme|
4.5 Powerline_colorscheme .......... |Powerline_colorscheme|
4.6 Powerline_stl_path_style ....... |Powerline_stl_path_style|
5. Fonts .............................. |Powerline-fonts|
6. Customization ...................... |Powerline-customization|
6.1 Basic customization ............ |Powerline-basic-customization|
6.2 Advanced customization ......... |Powerline-advanced-customization|
6.2.1 Colorschemes ............. |Powerline-cust-colorschemes|
6.2.2 Functions ................ |Powerline-cust-functions|
6.2.3 Segments ................. |Powerline-cust-segments|
6.2.4 Themes ................... |Powerline-cust-themes|
7. License ............................ |Powerline-license|
8. Known issues ....................... |Powerline-known-issues|
9. Contributing ....................... |Powerline-contributing|
==============================================================================
1. Introduction *Powerline* *Powerline-introduction*
Powerline is a utility plugin which allows you to create better-looking, more
functional Vim statuslines.
==============================================================================
2. Usage *Powerline-usage*
Powerline is automatically enabled when it's installed, either by unzipping
the provided archive or by adding it as a Pathogen/Vundle bundle.
Powerline replaces the standard Vim 'statusline' with a custom statusline made
up of Powerline segments.
Powerline ignores any 'statusline' customizations you have defined in your
|vimrc|. If you remove Powerline, your 'statusline' customizations are
restored.
==============================================================================
3. Requirements *Powerline-requirements*
Powerline has been developed and tested in Vim 7.3, but it should run without
any problems in Vim 7.2. The default configuration requires a Unix-like system
to work properly.
The plugin only works with Vim running in an 88/256-color terminal or Gvim.
Vi-compatible mode must be disabled.
------------------------------------------------------------------------------
3.1 Recommended settings *Powerline-recommended-settings*
The following configuration options should be set in your |vimrc|: >
set nocompatible " Disable vi-compatibility
set laststatus=2 " Always show the statusline
set encoding=utf-8 " Necessary to show Unicode glyphs
Note: If you're using an 88/256-color terminal but still don't see the colored
statusline, you may have to set the following option as well: >
set t_Co=256 " Explicitly tell Vim that the terminal supports 256 colors
==============================================================================
4. Configuration *Powerline-configuration*
Powerline will work fine without any user configuration, but default behavior
can be overridden by setting configuration variables globally in your |vimrc|
file.
------------------------------------------------------------------------------
4.1 Powerline_cache_file *Powerline_cache_file*
By default Powerline caches all the statuslines and colors in a cache file in
the plugin's directory (or the Vim directory, depending on the installation
method used).
It's recommended that you enable the cache, as this dramatically improves Vim
startup time after the cache file has been generated (the plugin usually loads
within ~100ms without the cache and ~1ms with the cache).
Note: The default cache filename includes the current theme, colorscheme and
symbol settings in order to tie the cache file to your current configuration,
so the cache file will be regenerated when you change any settings. This may
leave several old cache files in your Vim folder, and these may safely be
deleted.
Defaults: "<plugin_directory>/Powerline_<theme>_<colorscheme>_<symbols>.cache"
------------------------------------------------------------------------------
4.1.1 Clearing the cache *:PowerlineClearCache*
Powerline provides a command to easily clear the cache after changing your
settings or updating your theme. Simply run the following command to clear
your cache, and restart Vim afterwards: >
:PowerlineClearCache
<
------------------------------------------------------------------------------
4.2 Powerline_cache_enabled *Powerline_cache_enabled*
It's possible to disable statusline caching by setting this option to 0. This
is mostly useful when developing statuslines.
Example: >
let g:Powerline_cache_enabled = 0
<
Default: 1
------------------------------------------------------------------------------
4.3 Powerline_symbols *Powerline_symbols*
This option defines which set of symbols and dividers you want to use. There
are currently three available options: "compatible", "unicode" and "fancy".
TYPE DESCRIPTION ~
compatible Doesn't use any special characters.
unicode Simulates icons and arrows using similar Unicode glyphs.
fancy Custom icons and arrows. Requires a patched font.
Example: >
let g:Powerline_symbols = 'fancy'
<
Default: "compatible"
Symbols can be inserted into statuslines by using the following variables
(just insert the variables as text in your segments):
VARIABLE DESCRIPTION ~
$BRANCH Inserts a branch symbol
$RO Inserts a read-only symbol
$FT Inserts a filetype symbol
$LINE Inserts a line number symbol
------------------------------------------------------------------------------
4.3.1 Compatible symbols *Powerline-symbols-compatible*
These symbols will work in any configuration, and do not require a special
font to work. This option will replace the fancy icons with plain text, and
the pointy dividers with straight lines.
------------------------------------------------------------------------------
4.3.2 Fancy symbols *Powerline-symbols-fancy*
These symbols require a custom font to work. A font patcher is provided for
adding the required symbols to any outline font and some bitmap fonts, see
|Powerline-fonts| and the provided README file for usage details.
------------------------------------------------------------------------------
4.3.3 Overriding symbols *Powerline_symbols_override*
You can override symbols by adding your symbols to the
g:Powerline_symbols_override dictionary. Example: If you want the branch
symbol to be "∓" (hex code 0x2213) and the line symbol to be "L" you can add
the following to your |vimrc|: >
let g:Powerline_symbols_override = {
\ 'BRANCH': [0x2213],
\ 'LINE': 'L',
\ }
<
------------------------------------------------------------------------------
4.3.4 Overriding dividers *Powerline_dividers_override*
If you for some reason want to override the dividers then you can set
g:Powerline_dividers_override to a list with exactly four elements:
1: Hard right-pointing arrow
2: Soft right-pointing arrow
3: Hard left-pointing arrow
4: Soft left-pointing arrow
Example: >
let g:Powerline_dividers_override = ['>>', '>', '<<', '<']
<
------------------------------------------------------------------------------
4.3.5 Overriding mode names *Powerline_mode*
You can change the names used for modes at the far left by setting some
variables in your |vimrc|. For example you can change "N" to "NORMAL" with: >
let g:Powerline_mode_n = 'NORMAL'
<
The variables are all named beginning with 'g:Powerline_mode_', as follows:
mode name default note ~
Normal n ' N ' (surrounded by spaces)
Insert i INSERT
Replace R REPLACE |Replace-mode|
Visual v VISUAL |Visual-mode|
Visual linewise V V⋅LINE
Visual blockwise cv V⋅BLOCK
Select s SELECT |Select-mode|
Select linewise S S⋅LINE
Select blockwise cs S⋅BLOCK
-----------------------------------------------------------------------------
4.4 Powerline_theme *Powerline_theme*
This option defines the theme Powerline uses. The available themes are located
in autoload/Powerline/Themes/. A theme is a pre-defined set of Powerline
segments which make up the statusline.
Example: >
let g:Powerline_theme = 'skwp'
<
Default: "default"
------------------------------------------------------------------------------
4.5 Powerline_colorscheme *Powerline_colorscheme*
This option defines the colorscheme Powerline uses. The available colorschemes
are located in autoload/Powerline/Colorschemes/.
Example: >
let g:Powerline_colorscheme = 'skwp'
<
Default: "default"
------------------------------------------------------------------------------
4.6 Powerline_stl_path_style *Powerline_stl_path_style*
There are currently four ways to display the current path and file name. The
default is to only display the file name like the %t statusline item. By
setting this configuration value you can choose from the following ways
display the current path and file name:
VALUE DESCRIPTION ~
filename Display only the file name using the %t statusline item.
short Display a short path. The home directory is substituted with
"~", the first directory is displayed with its full name, and
subsequent directories are shortened to their first letter.
I.e. "/home/user/foo/bar/baz.vim" becomes "~/f/b/baz.vim" and
"long/relative/path/foo/bar/baz.vim becomes
"long/r/p/f/b/baz.vim".
relative Display a relative path, similar to the %f statusline item.
full Display the full path, similar to the %F statusline item.
Example: >
let g:Powerline_stl_path_style = 'full'
<
Default: "relative"
==============================================================================
5. Fonts *Powerline-fonts*
TODO
==============================================================================
6. Customization *Powerline-customization*
There are currently two ways of customizing Powerline: Basic customization
using a couple of functions to insert and remove existing segments from the
statusline, and advanced customization using your own autoload files. The
customization features of Powerline allow you to create your own statuslines
without ever touching the original source code.
------------------------------------------------------------------------------
6.1 Basic customization *Powerline-basic-customization*
Powerline provides the following functions to alter the default statusline
look. These functions should be called from your |vimrc| file or another file
which is sourced at Vim startup.
Note: These functions are currently applied to all statuslines, so if you
insert a segment after a segment which is present in many statuslines (e.g.
the "filename" segment), all the statuslines will have the inserted segment.
This behavior may be changed in a future version of Powerline.
Note: Remember to clear your cache with |:PowerlineClearCache| after changing
your statusline!
Example: >
" Insert the charcode segment after the filetype segment
call Pl#Theme#InsertSegment('charcode', 'after', 'filetype')
" Replace the scrollpercent segment with the charcode segment
call Pl#Theme#ReplaceSegment('scrollpercent', 'fileinfo')
<
*Pl#Theme#InsertSegment*
Pl#Theme#InsertSegment({newsegment}, {location}, {targetsegment})
This function inserts {newsegment} before or after {targetsegment}. The
{location} parameter specifies the location of the new segment, valid values
are "before" and "after". You can see all the available segments in
autoload/Powerline/Segments.vim and the files specified in
|Powerline-cust-segments|.
Pl#Theme#RemoveSegment({targetsegment}) *Pl#Theme#RemoveSegment*
This function removes the {targetsegment} segment entirely.
Pl#Theme#ReplaceSegment({oldsegment}, {newsegment}) *Pl#Theme#ReplaceSegment*
This function replaces {oldsegment} with {newsegment}.
------------------------------------------------------------------------------
6.2 Advanced customization *Powerline-advanced-customization*
Because Powerline utilizes Vim's autoload functionality, you can easily create
your own segments, themes, functions and colorschemes without touching the
original source code. This is a bit more complex than using the utility
functions, but it allows you to do a lot more with your statusline.
Your custom autoload files should be stored in your |runtimepath| (usually in
"~/.vim/autoload/Powerline/*").
Note: Remember to clear your cache with |:PowerlineClearCache| after changing
your statusline!
6.2.1 Colorschemes *Powerline-cust-colorschemes*
------------------------------------------------------------------------------
Colorschemes should be stored as separate files in
{runtimepath}/autoload/Powerline/Colorschemes/.
SYNTAX ~
TODO
EXAMPLE ~
TODO
6.2.2 Functions *Powerline-cust-functions*
------------------------------------------------------------------------------
Functions should be stored as separate files in
{runtimepath}/autoload/Powerline/Functions/.
SYNTAX ~
TODO
EXAMPLE ~
TODO
6.2.3 Segments *Powerline-cust-segments*
------------------------------------------------------------------------------
Segments should be stored as separate files in
{runtimepath}/autoload/Powerline/Segments/.
SYNTAX ~
TODO
EXAMPLE ~
TODO
6.2.4 Themes *Powerline-cust-themes*
------------------------------------------------------------------------------
Themes should be stored as separate files in
{runtimepath}/autoload/Powerline/Themes/.
SYNTAX ~
TODO
EXAMPLE ~
TODO
==============================================================================
7. License *Powerline-license*
Creative Commons Attribution-ShareAlike 3.0 Unported
http://creativecommons.org/licenses/by-sa/3.0/
==============================================================================
8. Known issues *Powerline-known-issues*
See the issue tracker at
https://github.com/Lokaltog/vim-powerline/issues
==============================================================================
9. Contributing *Powerline-contributing*
If you experience any bugs or have feature requests, please open an issue on
GitHub. Fork the source repository on GitHub and send a pull request if you
have any code improvements.
Author: Kim Silkebækken <kim.silkebaekken+vim@gmail.com>
Source repository: https://github.com/Lokaltog/vim-powerline
==============================================================================
vim:tw=78:sw=4:ts=8:ft=help:norl:

View file

@ -1,34 +0,0 @@
:PowerlineClearCache Powerline.txt /*:PowerlineClearCache*
Pl#Theme#InsertSegment Powerline.txt /*Pl#Theme#InsertSegment*
Pl#Theme#RemoveSegment Powerline.txt /*Pl#Theme#RemoveSegment*
Pl#Theme#ReplaceSegment Powerline.txt /*Pl#Theme#ReplaceSegment*
Powerline Powerline.txt /*Powerline*
Powerline-advanced-customization Powerline.txt /*Powerline-advanced-customization*
Powerline-basic-customization Powerline.txt /*Powerline-basic-customization*
Powerline-configuration Powerline.txt /*Powerline-configuration*
Powerline-contents Powerline.txt /*Powerline-contents*
Powerline-contributing Powerline.txt /*Powerline-contributing*
Powerline-cust-colorschemes Powerline.txt /*Powerline-cust-colorschemes*
Powerline-cust-functions Powerline.txt /*Powerline-cust-functions*
Powerline-cust-segments Powerline.txt /*Powerline-cust-segments*
Powerline-cust-themes Powerline.txt /*Powerline-cust-themes*
Powerline-customization Powerline.txt /*Powerline-customization*
Powerline-fonts Powerline.txt /*Powerline-fonts*
Powerline-introduction Powerline.txt /*Powerline-introduction*
Powerline-known-issues Powerline.txt /*Powerline-known-issues*
Powerline-license Powerline.txt /*Powerline-license*
Powerline-recommended-settings Powerline.txt /*Powerline-recommended-settings*
Powerline-requirements Powerline.txt /*Powerline-requirements*
Powerline-symbols-compatible Powerline.txt /*Powerline-symbols-compatible*
Powerline-symbols-fancy Powerline.txt /*Powerline-symbols-fancy*
Powerline-usage Powerline.txt /*Powerline-usage*
Powerline.txt Powerline.txt /*Powerline.txt*
Powerline_cache_enabled Powerline.txt /*Powerline_cache_enabled*
Powerline_cache_file Powerline.txt /*Powerline_cache_file*
Powerline_colorscheme Powerline.txt /*Powerline_colorscheme*
Powerline_dividers_override Powerline.txt /*Powerline_dividers_override*
Powerline_mode Powerline.txt /*Powerline_mode*
Powerline_stl_path_style Powerline.txt /*Powerline_stl_path_style*
Powerline_symbols Powerline.txt /*Powerline_symbols*
Powerline_symbols_override Powerline.txt /*Powerline_symbols_override*
Powerline_theme Powerline.txt /*Powerline_theme*

View file

@ -1,319 +0,0 @@
SplineFontDB: 3.0
FontName: PowerlineSymbols
FullName: PowerlineSymbols
FamilyName: PowerlineSymbols
Weight: Medium
Copyright:
UComments: "2011-11-21: Created."
Version: 001.000
ItalicAngle: 0
UnderlinePosition: -98.6328
UnderlineWidth: 48.8281
Ascent: 800
Descent: 200
LayerCount: 2
Layer: 0 0 "Back" 1
Layer: 1 0 "Fore" 0
XUID: [1021 211 26716215 11021609]
FSType: 0
OS2Version: 0
OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 1
CreationTime: 1321867751
ModificationTime: 1326665029
OS2TypoAscent: 0
OS2TypoAOffset: 1
OS2TypoDescent: 0
OS2TypoDOffset: 1
OS2TypoLinegap: 90
OS2WinAscent: 0
OS2WinAOffset: 1
OS2WinDescent: 0
OS2WinDOffset: 1
HheadAscent: 0
HheadAOffset: 1
HheadDescent: 0
HheadDOffset: 1
OS2Vendor: 'PfEd'
MarkAttachClasses: 1
DEI: 91125
Encoding: UnicodeFull
Compacted: 1
UnicodeInterp: none
NameList: Adobe Glyph List
DisplaySize: -24
AntiAlias: 1
FitToEm: 1
WinInfo: 0 31 18
BeginPrivate: 0
EndPrivate
BeginChars: 1114112 9
StartChar: uni2B80
Encoding: 11136 11136 0
Width: 621
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 1000 m 1
621 379 l 1
0 -243 l 1
0 1000 l 1
EndSplineSet
EndChar
StartChar: uni2B81
Encoding: 11137 11137 1
Width: 621
Flags: HMW
LayerCount: 2
Fore
SplineSet
10 991 m 0
16 997 23 1000 32 1000 c 0
41 1000 48 996 54 990 c 2
613 400 l 2
619 394 621 386 621 378 c 0
621 370 618 362 613 357 c 2
54 -233 l 2
48 -239 41 -242 32 -242 c 0
23 -242 16 -240 10 -234 c 0
4 -228 0 -221 0 -212 c 0
0 -203 3 -196 8 -190 c 2
547 379 l 1
8 948 l 2
3 954 0 961 0 970 c 0
0 979 4 985 10 991 c 0
EndSplineSet
EndChar
StartChar: uni2B82
Encoding: 11138 11138 2
Width: 621
Flags: HMW
LayerCount: 2
Fore
SplineSet
621 1000 m 5
621 -243 l 5
0 379 l 5
621 1000 l 5
EndSplineSet
EndChar
StartChar: uni2B83
Encoding: 11139 11139 3
Width: 621
Flags: HMW
LayerCount: 2
Fore
SplineSet
612 991 m 0
618 985 621 979 621 970 c 0
621 961 619 954 613 948 c 2
74 379 l 1
613 -190 l 2
619 -196 621 -203 621 -212 c 0
621 -221 618 -228 612 -234 c 0
606 -240 598 -242 589 -242 c 0
580 -242 574 -239 568 -233 c 2
8 357 l 2
3 362 0 370 0 378 c 0
0 386 3 394 8 400 c 2
568 990 l 2
574 996 580 1000 589 1000 c 0
598 1000 606 997 612 991 c 0
EndSplineSet
EndChar
StartChar: uni2B61
Encoding: 11105 11105 4
Width: 555
VWidth: 0
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 800 m 5
92 800 l 5
92 513 l 5
253 513 l 5
253 444 l 5
0 444 l 5
0 800 l 5
236 312 m 5
339 312 l 5
468 67 l 5
468 312 l 5
555 312 l 5
555 -44 l 5
453 -44 l 5
323 200 l 5
323 -44 l 5
236 -44 l 5
236 312 l 5
EndSplineSet
EndChar
StartChar: uni2B60
Encoding: 11104 11104 5
Width: 676
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 197 m 1
94 207 419 279 419 384 c 2
419 537 l 1
278 501 l 1
478 794 l 1
677 501 l 1
536 537 l 1
536 384 l 2
536 196 208 126 208 21 c 2
208 -244 l 1
0 -244 l 1
0 197 l 1
0 288 m 1
0 405 0 944 0 944 c 1
208 944 l 1
208 944 208 451 208 334 c 1
185 311 12 288 0 288 c 1
EndSplineSet
EndChar
StartChar: uni2B62
Encoding: 11106 11106 6
Width: 428
VWidth: 0
Flags: HMW
LayerCount: 2
Fore
SplineSet
88 677 m 2
429 677 l 1
429 589 l 1
88 589 l 1
88 162 l 1
198 162 l 1
198 343 l 1
374 343 l 1
374 427 l 1
198 427 l 1
198 506 l 1
429 506 l 1
429 274 l 1
416 263 391 255 374 255 c 2
286 255 l 1
286 162 l 2
286 114 246 74 198 74 c 2
88 74 l 2
40 74 0 114 0 162 c 2
0 589 l 2
0 637 40 677 88 677 c 2
EndSplineSet
EndChar
StartChar: uni2B63
Encoding: 11107 11107 7
Width: 428
VWidth: 0
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 677 m 5
341 677 l 6
389 677 429 637 429 589 c 6
429 506 l 6
429 458 389 418 341 418 c 6
287 418 l 5
287 162 l 6
287 114 247 74 199 74 c 6
89 74 l 6
41 74 1 114 1 162 c 6
1 274 l 6
0 274 l 6
0 506 l 5
89 506 l 5
89 162 l 5
199 162 l 5
199 506 l 5
341 506 l 5
341 589 l 5
0 589 l 5
0 677 l 5
EndSplineSet
EndChar
StartChar: uni2B64
Encoding: 11108 11108 8
Width: 546
VWidth: 0
Flags: HMW
LayerCount: 2
Fore
SplineSet
273 733 m 4
429 733 430 538 430 538 c 5
430 420 l 5
547 420 l 5
547 303 l 5
547 303 546 -9 273 -9 c 4
0 -9 0 303 0 303 c 5
0 420 l 5
117 420 l 5
117 538 l 5
117 538 117 733 273 733 c 4
273 655 m 4
195 655 195 576 195 420 c 5
352 420 l 5
352 576 351 655 273 655 c 4
273 342 m 4
195 342 195 147 273 147 c 4
351 147 351 342 273 342 c 4
EndSplineSet
EndChar
EndChars
BitmapFont: 10 10 8 2 1
BDFChar: 0 11136 6 0 4 -2 7
JAC+4q"X@:^jlCb
BDFChar: 1 11137 6 0 4 -2 7
J3Y4g#RCta5_&h7
BDFChar: 2 11138 6 1 5 -2 7
#T,OGq"T(n(^L*A
BDFChar: 3 11139 6 1 5 -2 7
#S8+DJ:Km-&-r79
BDFChar: 4 11105 6 1 4 -1 7
J:N1>!0GR3O8o7\
BDFChar: 5 11104 7 0 5 -2 7
^rY<PaN2`d^q]pM
BDFChar: 6 11106 4 1 5 -1 6
G^u0KJ=)F+
BDFChar: 7 11107 4 0 5 -1 6
p]QtGOH>Q3
BDFChar: 8 11108 5 0 5 0 6
0M"b4bku\c
EndBitmapFont
BitmapFont: 12 10 10 2 1
BDFChar: 0 11136 7 0 6 -2 11
!!%Pbi:-O>r:od>^jlCb
BDFChar: 1 11137 7 0 6 -3 11
!!%O7+:ne]":,P]5_&h7
BDFChar: 2 11138 7 0 6 -2 11
!!!-1*'AWHr-UUH$j6P1
BDFChar: 3 11139 7 0 6 -2 11
!!!--&0O5gJ3Y4g#Qt,-
BDFChar: 4 11105 7 0 5 0 8
J:N1>!$jBP,QIfE
BDFChar: 5 11104 8 0 8 -3 11
z^];.Ma8juqa8j9]a8jQehuLOm^];.Mz
BDFChar: 6 11106 5 1 6 0 8
!-j$]R"1Qc?iU0,
BDFChar: 7 11107 5 0 5 0 7
p]QtGOH>Q3
BDFChar: 8 11108 7 0 5 0 8
0M"`*r63C_GQ7^D
EndBitmapFont
EndSplineFont

View file

@ -1,164 +0,0 @@
======================
Powerline font patcher
======================
:Author: Kim Silkebækken (kim.silkebaekken+vim@gmail.com)
Description
-----------
This font patcher creates dividers and symbols for use with Powerline. The
script requires Python 2 and FontForge compiled with Python bindings.
Patched fonts are renamed by default (" for Powerline" is added to the font
name) so they don't conflict with existing fonts. Use the ``--no-rename``
option to disable font renaming.
Glyph table
-----------
All the glyphs are stored in the ``U+2B60``-``U+2BFF`` range ("Misc symbols
and arrows").
+------------+-------------------+
| Code point | Description |
+============+===================+
| ``U+2B60`` | Branch symbol |
+------------+-------------------+
| ``U+2B61`` | LN (line) symbol |
+------------+-------------------+
| ``U+2B62`` | FT symbol, part 1 |
+------------+-------------------+
| ``U+2B63`` | FT symbol, part 2 |
+------------+-------------------+
| ``U+2B64`` | Padlock (closed) |
+------------+-------------------+
| ``U+2B80`` | Hard right arrow |
+------------+-------------------+
| ``U+2B81`` | Soft right arrow |
+------------+-------------------+
| ``U+2B82`` | Hard left arrow |
+------------+-------------------+
| ``U+2B83`` | Soft left arrow |
+------------+-------------------+
===================
Font patching guide
===================
There's a `GitHub wiki page`_ dedicated to community-contributed patched
fonts. You may download one of the fonts on that page if you don't want to
patch the fonts yourself.
If you do patch a font that's not included in the wiki (and you have
permission to distribute it), please include it on the wiki page.
**Note:** The fonts in the wiki may be outdated, and may have different
glyphs than the ones provided in the latest version of Powerline. It's
recommended that you always patch your fonts yourself if you have the
required software.
.. _`GitHub wiki page`: https://github.com/Lokaltog/vim-powerline/wiki/Patched-fonts
Linux
-----
1. Install fontforge with Python bindings. For Ubuntu users the required
package is ``python-fontforge``, for Arch Linux users the required
package is ``fontforge``. It should be something similar for other
distros.
2. Run the font patcher::
$ /path/to/fontpatcher MyFontFile.ttf
3. Copy the font file into ``~/.fonts`` (or another X font directory)::
$ cp MyFontFile-Powerline.otf ~/.fonts
**Note:** If the font is a pure bitmap font (e.g. a PCF font) it will be
stored in the BDF format. This is usually not a problem, and you may
convert the font back to the PCF format using ``bdftopcf`` if you want
to. All other fonts will be stored in the OTF format regardless of the
original format.
4. Update your font cache::
$ sudo fc-cache -vf
**Note:** If you use vim in rxvt-unicode in the client/daemon mode, you
may need to close all running terminals as well for the font to be
updated.
5. **For gvim users:** Update the GUI font in your ``vimrc`` file::
set guifont=MyFont\ for\ Powerline
**For terminal users:** Update your terminal configuration to use the
patched font.
6. Update your ``vimrc`` configuration to use the new symbols::
let g:Powerline_symbols = 'fancy'
7. Make sure that the cache file is deleted::
$ rm /tmp/Powerline.cache
8. Start vim and enjoy your new statusline!
OS X
----
1. Check if you have a FontForge version with Python support by running
``fontforge -version``. You should see something like this::
$ fontforge -version
Copyright (c) 2000-2011 by George Williams.
Executable based on sources from 13:48 GMT 22-Feb-2011-D.
Library based on sources from 13:48 GMT 22-Feb-2011.
fontforge 20110222
libfontforge 20110222
Make sure that the executable version number doesn't have ``NoPython`` in
it. If everything looks OK, skip ahead to step 4.
2. If you have FontForge but with ``NoPython`` in the version number, please
try to update to a later version::
$ brew uninstall fontforge
$ brew update
$ brew install --use-gcc fontforge
**Note:** You may have to use ``--use-clang`` instead of ``--use-gcc``
when compiling FontForge.
3. If you don't have FontForge, install it with Homebrew::
$ brew update
$ brew install --use-gcc fontforge
4. Patch your fonts by passing the ``fontpatcher`` script as a parameter to
FontForge::
$ fontforge -script /path/to/fontpatcher MyFontFile.ttf
5. Install the font by double-clicking the font file in Finder and click
"Install this font" from the preview window.
6. **For gvim users:** Update the GUI font in your ``vimrc`` file::
set guifont=MyFont\ for\ Powerline
**For terminal users:** Update your terminal configuration to use the
patched font.
7. Update your ``vimrc`` configuration to use the new symbols::
let g:Powerline_symbols = 'fancy'
8. Make sure that the cache file is deleted::
$ rm /tmp/Powerline.cache
9. Start vim and enjoy your new statusline!

View file

@ -1,240 +0,0 @@
#!/usr/bin/env python
"""Font patcher for Powerline.
Creates dividers and symbols for use with Powerline. Requires FontForge with Python bindings.
Stores glyphs in the 2b60-2bff Unicode range ("Misc symbols and arrows").
[2b60] Branch symbol
[2b61] LN (line) symbol
[2b62] FT symbol 1
[2b63] FT symbol 2
[2b64] Padlock (closed) symbol
[2b80] Hard right arrow
[2b81] Soft right arrow
[2b82] Hard left arrow
[2b83] Soft left arrow
"""
from __future__ import division
import argparse
import os
import sys
import re
try:
import fontforge
import psMat
except ImportError:
sys.stderr.write('The required FontForge modules could not be loaded.\n\n')
if sys.version_info.major > 2:
sys.stderr.write('FontForge only supports Python 2. Please run this script with the Python 2 executable - e.g. "python2 {0}"\n'.format(sys.argv[0]))
else:
sys.stderr.write('You need FontForge with Python bindings for this script to work.\n')
sys.exit(1)
# Handle command-line arguments
parser = argparse.ArgumentParser(description='Font patcher for Powerline. Creates dividers and symbols in FontForge-compatible font files. Requires FontForge with Python bindings. Stores glyphs in the U+2B80-U+2BFF range ("Miscellaneous symbols and arrows"). Stores the patched font as a new, renamed font file by default.')
parser.add_argument('fonts', help='font file to patch', metavar='font', nargs='+')
parser.add_argument('--no-rename', help='don\'t add " for Powerline" to the font name', default=True, action='store_false', dest='rename')
parser.add_argument('--symbol-font', help='font file with symbols', metavar='font', dest='symbol_font', default='{0}/PowerlineSymbols.sfd'.format(sys.path[0]))
parser.add_argument('--fix-mono', help='fixes some mono-fonts which have glyphs of 0 widths', default=False, action='store_true', dest='fixmono')
parser.add_argument('--fix-win', help='modifies font names such that Windows correctly recognizes font families', default=False, action='store_true', dest='fixwin')
args = parser.parse_args()
SYM_ATTR = {
# Right/left-aligned glyphs will have their advance width reduced in order to overlap the next glyph slightly
0x2b60: { 'align': 'c', 'stretch': 'y' , 'overlap': False },
0x2b61: { 'align': 'c', 'stretch': '' , 'overlap': False },
0x2b62: { 'align': 'r', 'stretch': '' , 'overlap': False },
0x2b63: { 'align': 'l', 'stretch': '' , 'overlap': False },
0x2b64: { 'align': 'c', 'stretch': '' , 'overlap': False },
0x2b80: { 'align': 'l', 'stretch': 'xy', 'overlap': True },
0x2b81: { 'align': 'l', 'stretch': 'xy', 'overlap': True },
0x2b82: { 'align': 'r', 'stretch': 'xy', 'overlap': True },
0x2b83: { 'align': 'r', 'stretch': 'xy', 'overlap': True },
}
# Open symbol font
try:
symbols = fontforge.open(args.symbol_font)
except EnvironmentError:
sys.exit(1)
# Patch provided fonts
for font_path in args.fonts:
try:
font = fontforge.open(font_path)
except EnvironmentError:
sys.exit(1)
# Rename font
if args.rename:
font.familyname += ' for Powerline'
font.fullname += ' for Powerline'
font.fontname += 'ForPowerline'
font.appendSFNTName('English (US)', 'Preferred Family', font.familyname)
font.appendSFNTName('English (US)', 'Compatible Full', font.fullname)
if args.fixwin:
font.fontname = re.sub(r'\W', '', font.familyname)
# Force the em size to be equal
symbols.em = font.em
# Initial font dimensions
font_dim = {
'xmin' : 0,
'ymin' : -font.descent,
'xmax' : 0,
'ymax' : font.ascent,
'width' : 0,
'height': 0,
}
# Find the biggest char width and height
#
# 0x00-0x17f is the Latin Extended-A range
# 0x2500-0x2600 is the box drawing range
for glyph in range(0x00, 0x17f) + range(0x2500, 0x2600):
try:
(xmin, ymin, xmax, ymax) = font[glyph].boundingBox()
except TypeError:
continue
if font_dim['width'] == 0:
font_dim['width'] = font[glyph].width
if ymin < font_dim['ymin']: font_dim['ymin'] = ymin
if ymax > font_dim['ymax']: font_dim['ymax'] = ymax
if xmax > font_dim['xmax']: font_dim['xmax'] = xmax
# Calculate font height
font_dim['height'] = abs(font_dim['ymin']) + font_dim['ymax']
# Update the font encoding to ensure that the Unicode glyphs are available
font.encoding = 'ISO10646'
# Fetch this property before adding outlines
onlybitmaps = font.onlybitmaps
def get_dim(glyph):
bbox = glyph.boundingBox()
return {
'xmin' : bbox[0],
'ymin' : bbox[1],
'xmax' : bbox[2],
'ymax' : bbox[3],
'width' : bbox[2] + (-bbox[0]),
'height': bbox[3] + (-bbox[1]),
}
# Create glyphs from symbol font
for sym_glyph in symbols.glyphs():
sym_attr = SYM_ATTR[sym_glyph.unicode]
# Prepare symbol glyph dimensions
sym_dim = get_dim(sym_glyph)
# Select and copy symbol from its encoding point
symbols.selection.select(sym_glyph.encoding)
symbols.copy()
# Select and paste symbol to its unicode code point
font.selection.select(sym_glyph.unicode)
font.paste()
# Now that we have copy/pasted the glyph, it's time to scale and move it
# Handle glyph stretching
if 'x' in sym_attr['stretch']:
# Stretch the glyph horizontally
scale_ratio = font_dim['width'] / sym_dim['width']
font.transform(psMat.scale(scale_ratio, 1))
if 'y' in sym_attr['stretch']:
# Stretch the glyph vertically
scale_ratio = font_dim['height'] / sym_dim['height']
font.transform(psMat.scale(1, scale_ratio))
# Use the dimensions from the pasted and stretched glyph
sym_dim = get_dim(font[sym_glyph.unicode])
# Center-align the glyph vertically
font_ycenter = font_dim['height'] / 2
sym_ycenter = sym_dim['height'] / 2
# First move it to the ymax (top)
font.transform(psMat.translate(0, font_dim['ymax'] - sym_dim['ymax']))
# Then move it the y center difference
font.transform(psMat.translate(0, sym_ycenter - font_ycenter))
# Ensure that the glyph doesn't extend outside the font's bounding box
if sym_dim['width'] > font_dim['width']:
# The glyph is too wide, scale it down to fit
scale_matrix = psMat.scale(font_dim['width'] / sym_dim['width'], 1)
font.transform(scale_matrix)
# Use the dimensions from the stretched glyph
sym_dim = get_dim(font[sym_glyph.unicode])
# Handle glyph alignment
if sym_attr['align'] == 'c':
# Center align
align_matrix = psMat.translate(font_dim['width'] / 2 - sym_dim['width'] / 2 , 0)
elif sym_attr['align'] == 'r':
# Right align
align_matrix = psMat.translate(font_dim['width'] - sym_dim['width'], 0)
else:
# No alignment (left alignment)
align_matrix = psMat.translate(0, 0)
font.transform(align_matrix)
if sym_attr['overlap'] is True:
overlap_width = font.em / 48
# Stretch the glyph slightly horizontally if it should overlap
font.transform(psMat.scale((sym_dim['width'] + overlap_width) / sym_dim['width'], 1))
if sym_attr['align'] == 'l':
# The glyph should be left-aligned, so it must be moved overlap_width to the left
# This only applies to left-aligned glyphs because the glyph is scaled to the right
font.transform(psMat.translate(-overlap_width, 0))
# Ensure the font is considered monospaced on Windows
font[sym_glyph.unicode].width = font_dim['width']
if font.bitmapSizes and not onlybitmaps:
# If this is an outline font with bitmaps, regenerate bitmaps for the changed glyphs
font.selection.changed()
for size in font.bitmapSizes:
font.regenBitmaps((size, ))
output_name, extension = os.path.split(font_path)[1].rsplit('.', 1)
if extension.lower() not in ['ttf', 'otf']:
# Default to OpenType if input is not TrueType/OpenType
extension = 'otf'
if args.fixmono:
for glyph in font.glyphs():
if glyph.width == 0: glyph.width = font_dim['width']
if onlybitmaps:
# Generate BDF font
font.generate('{0}-Powerline.bdf'.format(output_name, bitmap_type='bdf'))
else:
# Generate OTF/TTF font
font.generate('{0}-Powerline.{1}'.format(output_name, extension))

View file

@ -1,69 +0,0 @@
" Powerline - The ultimate statusline utility
"
" Author: Kim Silkebækken <kim.silkebaekken+vim@gmail.com>
" Source repository: https://github.com/Lokaltog/vim-powerline
" Script initialization {{{
if exists('g:Powerline_loaded') || &compatible || version < 702
finish
endif
let g:Powerline_loaded = 1
" }}}
" Commands {{{
command! PowerlineClearCache call Pl#ClearCache()
command! PowerlineReloadColorscheme call Pl#ReloadColorscheme()
" }}}
" Set default options {{{
for [s:key, s:value] in items({
\ 'theme' : 'default'
\ , 'colorscheme' : 'default'
\ , 'symbols' : 'compatible'
\ , 'symbols_override' : {}
\ , 'dividers_override': []
\ , 'stl_path_style' : 'relative'
\ , 'cache_enabled' : 1
\ })
if ! exists('g:Powerline_' . s:key)
exec printf('let g:Powerline_%s = %s', s:key, string(s:value))
endif
unlet! s:key s:value
endfor
if ! exists('g:Powerline_cache_file')
exec 'let g:Powerline_cache_file = '. string(printf('%s/Powerline_%s_%s_%s.cache'
\ , simplify(expand('<sfile>:p:h') .'/..')
\ , g:Powerline_theme
\ , g:Powerline_colorscheme
\ , g:Powerline_symbols
\ ))
endif
" }}}
" Autocommands {{{
function! s:CreateAutocmds()
augroup PowerlineMain
autocmd!
" Reload statuslines when changing color scheme
autocmd ColorScheme *
\ call Pl#Load()
autocmd BufEnter,WinEnter,FileType,BufUnload *
\ call Pl#UpdateStatusline(1)
autocmd BufLeave,WinLeave *
\ call Pl#UpdateStatusline(0)
autocmd BufWritePost */autoload/Powerline/Colorschemes/*.vim
\ :PowerlineReloadColorscheme
augroup END
endfunction
augroup PowerlineStartup
autocmd!
autocmd VimEnter * call s:CreateAutocmds() | call Pl#UpdateStatusline(1)
augroup END
" }}}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
tags

View file

@ -1,114 +0,0 @@
# ack.vim #
This plugin is a front for the Perl module
[App::Ack](http://search.cpan.org/~petdance/ack/ack). Ack can be used as a
replacement for 99% of the uses of _grep_. This plugin will allow you to run
ack from vim, and shows the results in a split window.
The *Official Version* of this plugin is available at [vim.org](http://www.vim.org/scripts/script.php?script_id=2572).
## Installation ##
### Ack
You have to install [ack](http://betterthangrep.com/), of course.
Install on Debian / Ubuntu with:
sudo apt-get install ack-grep
Install on Fedora with:
su -l -c 'yum install ack'
Install on openSUSE with:
sudo zypper install ack
Install on Gentoo with:
sudo emerge ack
Install with Homebrew:
brew install ack
Install with MacPorts:
sudo port install p5-app-ack
Install with Gentoo Prefix:
emerge ack
Install on FreeBSD with:
cd /usr/ports/textproc/p5-ack/ && make install clean
You can specify a custom ack name and path in your .vimrc like so:
let g:ackprg="<custom-ack-path-goes-here> -H --nocolor --nogroup --column"
Otherwise, you are on your own.
### The Plugin
If you have [Rake](http://rake.rubyforge.org/) installed, you can just run: `rake install`.
Otherwise, the file ack.vim goes in ~/.vim/plugin, and the ack.txt file belongs in ~/.vim/doc. Be sure to run
:helptags ~/.vim/doc
afterwards.
## Usage ##
:Ack [options] {pattern} [{directory}]
Search recursively in {directory} (which defaults to the current directory) for the {pattern}.
Files containing the search term will be listed in the split window, along with
the line number of the occurrence, once for each occurrence. [Enter] on a line
in this window will open the file, and place the cursor on the matching line.
Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use `:Ack`, `:AckAdd`, `:LAck`, and `:LAckAdd` respectively. (See `doc/ack.txt`, or install and `:h Ack` for more information.)
**From the [ack docs](http://betterthangrep.com/)** (my favorite feature):
--type=TYPE, --type=noTYPE
Specify the types of files to include or exclude from a search. TYPE is a filetype, like perl or xml. --type=perl can also be specified as --perl, and --type=noperl can be done as --noperl.
If a file is of both type "foo" and "bar", specifying --foo and --nobar will exclude the file, because an exclusion takes precedence over an inclusion.
Type specifications can be repeated and are ORed together.
See ack --help=types for a list of valid types.
### Gotchas ###
Some characters have special meaning, and need to be escaped your search pattern. For instance, '#'. You have to escape it like this `:Ack '\\\#define foo'` to search for `#define foo`. (From [blueyed in issue #5](https://github.com/mileszs/ack.vim/issues/5).)
### Keyboard Shortcuts ###
In the quickfix window, you can use:
o to open (same as enter)
go to preview file (open but maintain focus on ack.vim results)
t to open in new tab
T to open in new tab silently
h to open in horizontal split
H to open in horizontal split silently
v to open in vertical split
gv to open in vertical split silently
q to close the quickfix window
This Vim plugin is derived (and by derived, I mean copied, essentially) from
Antoine Imbert's blog post [Ack and Vim
Integration](http://blog.ant0ine.com/typepad/2007/03/ack-and-vim-integration.html) (in
particular, the function at the bottom of the post). I added a help file that
provides just enough reference to get you going. I also highly recommend you
check out the docs for the Perl script 'ack', for obvious reasons: [ack -
grep-like text finder](http://betterthangrep.com/).

View file

@ -1,23 +0,0 @@
# Added by Josh Nichols, a.k.a. technicalpickles
require 'rake'
files = ['doc/ack.txt', 'plugin/ack.vim']
desc 'Install plugin and documentation'
task :install do
vimfiles = if ENV['VIMFILES']
ENV['VIMFILES']
elsif RUBY_PLATFORM =~ /(win|w)32$/
File.expand_path("~/vimfiles")
else
File.expand_path("~/.vim")
end
files.each do |file|
target_file = File.join(vimfiles, file)
FileUtils.mkdir_p File.dirname(target_file)
FileUtils.cp file, target_file
puts " Copied #{file} to #{target_file}"
end
end

View file

@ -1,84 +0,0 @@
*ack.txt* Plugin that integrates ack with Vim
==============================================================================
Author: Antoine Imbert <antoine.imbert+ackvim@gmail.com> *ack-author*
License: Same terms as Vim itself (see |license|)
==============================================================================
INTRODUCTION *ack*
This plugin is a front for the Perl module App::Ack. Ack can be used as a
replacement for grep. This plugin will allow you to run ack from vim, and
shows the results in a split window.
:Ack[!] [options] {pattern} [{directory}] *:Ack*
Search recursively in {directory} (which defaults to the current
directory) for the {pattern}. Behaves just like the |:grep| command, but
will open the |Quickfix| window for you. If [!] is not given the first
error is jumped to.
:AckAdd [options] {pattern} [{directory}] *:AckAdd*
Just like |:Ack|, but instead of making a new list, the matches are
appended to the current |quickfix| list.
:AckFromSearch [{directory}] *:AckFromSearch*
Just like |:Ack| but the pattern is from previous search.
:LAck [options] {pattern} [{directory}] *:LAck*
Just like |:Ack| but instead of the |quickfix| list, matches are placed in
the current |location-list|.
:LAckAdd [options] {pattern} [{directory}] *:LAckAdd*
Just like |:AckAdd| but instead of the |quickfix| list, matches are added
to the current |location-list|
:AckFile [options] {pattern} [{directory}] *:AckFile*
Search recursively in {directory} (which defaults to the current
directory) for filenames matching the {pattern}. Behaves just like the
|:grep| command, but will open the |Quickfix| window for you.
:AckHelp[!] [options] {pattern} *:AckHelp*
Search vim documentation files for the {pattern}. Behaves just like the
|:Ack| command, but searches only vim documentation .txt files
:LAckHelp [options] {pattern} *:LAckHelp*
Just like |:AckHelp| but instead of the |quickfix| list, matches are placed
in the current |location-list|.
Files containing the search term will be listed in the split window, along
with the line number of the occurrence, once for each occurrence. <Enter> on
a line in this window will open the file, and place the cursor on the matching
line.
See http://betterthangrep.com/ for more information.
==============================================================================
MAPPINGS *ack-mappings*
The following keyboard shortcuts are available in the quickfix window:
o open file (same as enter).
go preview file (open but maintain focus on ack.vim results).
t open in a new tab.
T open in new tab silently.
h open in horizontal split.
H open in horizontal split silently.
v open in vertical split.
gv open in vertical split silently.
q close the quickfix window.

View file

@ -1,120 +0,0 @@
" NOTE: You must, of course, install the ack script
" in your path.
" On Debian / Ubuntu:
" sudo apt-get install ack-grep
" With MacPorts:
" sudo port install p5-app-ack
" With Homebrew:
" brew install ack
" Location of the ack utility
if !exists("g:ackprg")
let s:ackcommand = executable('ack-grep') ? 'ack-grep' : 'ack'
let g:ackprg=s:ackcommand." -H --nocolor --nogroup --column"
endif
if !exists("g:ack_apply_qmappings")
let g:ack_apply_qmappings = !exists("g:ack_qhandler")
endif
if !exists("g:ack_apply_lmappings")
let g:ack_apply_lmappings = !exists("g:ack_lhandler")
endif
if !exists("g:ack_qhandler")
let g:ack_qhandler="botright copen"
endif
if !exists("g:ack_lhandler")
let g:ack_lhandler="botright lopen"
endif
function! s:Ack(cmd, args)
redraw
echo "Searching ..."
" If no pattern is provided, search for the word under the cursor
if empty(a:args)
let l:grepargs = expand("<cword>")
else
let l:grepargs = a:args . join(a:000, ' ')
end
" Format, used to manage column jump
if a:cmd =~# '-g$'
let g:ackformat="%f"
else
let g:ackformat="%f:%l:%c:%m"
end
let grepprg_bak=&grepprg
let grepformat_bak=&grepformat
try
let &grepprg=g:ackprg
let &grepformat=g:ackformat
silent execute a:cmd . " " . escape(l:grepargs, '|')
finally
let &grepprg=grepprg_bak
let &grepformat=grepformat_bak
endtry
if a:cmd =~# '^l'
exe g:ack_lhandler
let l:apply_mappings = g:ack_apply_lmappings
else
exe g:ack_qhandler
let l:apply_mappings = g:ack_apply_qmappings
endif
if l:apply_mappings
exec "nnoremap <silent> <buffer> q :ccl<CR>"
exec "nnoremap <silent> <buffer> t <C-W><CR><C-W>T"
exec "nnoremap <silent> <buffer> T <C-W><CR><C-W>TgT<C-W><C-W>"
exec "nnoremap <silent> <buffer> o <CR>"
exec "nnoremap <silent> <buffer> go <CR><C-W><C-W>"
exec "nnoremap <silent> <buffer> h <C-W><CR><C-W>K"
exec "nnoremap <silent> <buffer> H <C-W><CR><C-W>K<C-W>b"
exec "nnoremap <silent> <buffer> v <C-W><CR><C-W>H<C-W>b<C-W>J<C-W>t"
exec "nnoremap <silent> <buffer> gv <C-W><CR><C-W>H<C-W>b<C-W>J"
endif
" If highlighting is on, highlight the search keyword.
if exists("g:ackhighlight")
let @/=a:args
set hlsearch
end
redraw!
endfunction
function! s:AckFromSearch(cmd, args)
let search = getreg('/')
" translate vim regular expression to perl regular expression.
let search = substitute(search,'\(\\<\|\\>\)','\\b','g')
call s:Ack(a:cmd, '"' . search .'" '. a:args)
endfunction
function! s:GetDocLocations()
let dp = ''
for p in split(&rtp,',')
let p = p.'/doc/'
if isdirectory(p)
let dp = p.'*.txt '.dp
endif
endfor
return dp
endfunction
function! s:AckHelp(cmd,args)
let args = a:args.' '.s:GetDocLocations()
call s:Ack(a:cmd,args)
endfunction
command! -bang -nargs=* -complete=file Ack call s:Ack('grep<bang>',<q-args>)
command! -bang -nargs=* -complete=file AckAdd call s:Ack('grepadd<bang>', <q-args>)
command! -bang -nargs=* -complete=file AckFromSearch call s:AckFromSearch('grep<bang>', <q-args>)
command! -bang -nargs=* -complete=file LAck call s:Ack('lgrep<bang>', <q-args>)
command! -bang -nargs=* -complete=file LAckAdd call s:Ack('lgrepadd<bang>', <q-args>)
command! -bang -nargs=* -complete=file AckFile call s:Ack('grep<bang> -g', <q-args>)
command! -bang -nargs=* -complete=help AckHelp call s:AckHelp('grep<bang>',<q-args>)
command! -bang -nargs=* -complete=help LAckHelp call s:AckHelp('lgrep<bang>',<q-args>)

View file

@ -0,0 +1,24 @@
bufexplorer bufexplorer.txt /*bufexplorer*
bufexplorer-changelog bufexplorer.txt /*bufexplorer-changelog*
bufexplorer-credits bufexplorer.txt /*bufexplorer-credits*
bufexplorer-customization bufexplorer.txt /*bufexplorer-customization*
bufexplorer-installation bufexplorer.txt /*bufexplorer-installation*
bufexplorer-todo bufexplorer.txt /*bufexplorer-todo*
bufexplorer-usage bufexplorer.txt /*bufexplorer-usage*
bufexplorer-windowlayout bufexplorer.txt /*bufexplorer-windowlayout*
bufexplorer.txt bufexplorer.txt /*bufexplorer.txt*
buffer-explorer bufexplorer.txt /*buffer-explorer*
g:bufExplorerChgWin bufexplorer.txt /*g:bufExplorerChgWin*
g:bufExplorerDefaultHelp bufexplorer.txt /*g:bufExplorerDefaultHelp*
g:bufExplorerDetailedHelp bufexplorer.txt /*g:bufExplorerDetailedHelp*
g:bufExplorerFindActive bufexplorer.txt /*g:bufExplorerFindActive*
g:bufExplorerFuncRef bufexplorer.txt /*g:bufExplorerFuncRef*
g:bufExplorerReverseSort bufexplorer.txt /*g:bufExplorerReverseSort*
g:bufExplorerShowDirectories bufexplorer.txt /*g:bufExplorerShowDirectories*
g:bufExplorerShowRelativePath bufexplorer.txt /*g:bufExplorerShowRelativePath*
g:bufExplorerShowTabBuffer bufexplorer.txt /*g:bufExplorerShowTabBuffer*
g:bufExplorerShowUnlisted bufexplorer.txt /*g:bufExplorerShowUnlisted*
g:bufExplorerSortBy bufexplorer.txt /*g:bufExplorerSortBy*
g:bufExplorerSplitBelow bufexplorer.txt /*g:bufExplorerSplitBelow*
g:bufExplorerSplitOutPathName bufexplorer.txt /*g:bufExplorerSplitOutPathName*
g:bufExplorerSplitRight bufexplorer.txt /*g:bufExplorerSplitRight*

View file

@ -1,7 +0,0 @@
# nginx syntax files for Vim.
Copied into a directory to play well with pathogen.
* Original: http://www.vim.org/scripts/script.php?script_id=1886

View file

@ -1,2 +0,0 @@
au BufRead,BufNewFile /etc/nginx/* set ft=nginx
au BufRead,BufNewFile /usr/local/nginx/conf/* set ft=nginx

View file

@ -1,9 +0,0 @@
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
" cindent actually works for nginx' simple file structure
setlocal cindent
" Just make sure that the comments are not reset as defs would be.
setlocal cinkeys-=0#

View file

@ -1,664 +0,0 @@
" Vim syntax file
" Language: nginx.conf
if exists("b:current_syntax")
finish
end
setlocal iskeyword+=.
setlocal iskeyword+=/
setlocal iskeyword+=:
syn match ngxVariable '\$\w\w*'
syn match ngxVariableBlock '\$\w\w*' contained
syn match ngxVariableString '\$\w\w*' contained
syn region ngxBlock start=+^+ end=+{+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline
syn region ngxString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=ngxVariableString oneline
syn region ngxString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=ngxVariableString oneline
syn match ngxComment ' *#.*$'
syn keyword ngxBoolean on
syn keyword ngxBoolean off
syn keyword ngxDirectiveBlock http contained
syn keyword ngxDirectiveBlock mail contained
syn keyword ngxDirectiveBlock events contained
syn keyword ngxDirectiveBlock server contained
syn keyword ngxDirectiveBlock types contained
syn keyword ngxDirectiveBlock location contained
syn keyword ngxDirectiveBlock upstream contained
syn keyword ngxDirectiveBlock charset_map contained
syn keyword ngxDirectiveBlock limit_except contained
syn keyword ngxDirectiveBlock if contained
syn keyword ngxDirectiveBlock geo contained
syn keyword ngxDirectiveBlock map contained
syn keyword ngxDirectiveImportant include
syn keyword ngxDirectiveImportant root
syn keyword ngxDirectiveImportant server
syn keyword ngxDirectiveImportant server_name
syn keyword ngxDirectiveImportant listen
syn keyword ngxDirectiveImportant internal
syn keyword ngxDirectiveImportant proxy_pass
syn keyword ngxDirectiveImportant memcached_pass
syn keyword ngxDirectiveImportant fastcgi_pass
syn keyword ngxDirectiveImportant try_files
syn keyword ngxDirectiveControl break
syn keyword ngxDirectiveControl return
syn keyword ngxDirectiveControl rewrite
syn keyword ngxDirectiveControl set
syn keyword ngxDirectiveError error_page
syn keyword ngxDirectiveError post_action
syn keyword ngxDirectiveDeprecated connections
syn keyword ngxDirectiveDeprecated imap
syn keyword ngxDirectiveDeprecated open_file_cache_retest
syn keyword ngxDirectiveDeprecated optimize_server_names
syn keyword ngxDirectiveDeprecated satisfy_any
syn keyword ngxDirective accept_mutex
syn keyword ngxDirective accept_mutex_delay
syn keyword ngxDirective access_log
syn keyword ngxDirective add_after_body
syn keyword ngxDirective add_before_body
syn keyword ngxDirective add_header
syn keyword ngxDirective addition_types
syn keyword ngxDirective aio
syn keyword ngxDirective alias
syn keyword ngxDirective allow
syn keyword ngxDirective ancient_browser
syn keyword ngxDirective ancient_browser_value
syn keyword ngxDirective auth_basic
syn keyword ngxDirective auth_basic_user_file
syn keyword ngxDirective auth_http
syn keyword ngxDirective auth_http_header
syn keyword ngxDirective auth_http_timeout
syn keyword ngxDirective autoindex
syn keyword ngxDirective autoindex_exact_size
syn keyword ngxDirective autoindex_localtime
syn keyword ngxDirective charset
syn keyword ngxDirective charset_types
syn keyword ngxDirective client_body_buffer_size
syn keyword ngxDirective client_body_in_file_only
syn keyword ngxDirective client_body_in_single_buffer
syn keyword ngxDirective client_body_temp_path
syn keyword ngxDirective client_body_timeout
syn keyword ngxDirective client_header_buffer_size
syn keyword ngxDirective client_header_timeout
syn keyword ngxDirective client_max_body_size
syn keyword ngxDirective connection_pool_size
syn keyword ngxDirective create_full_put_path
syn keyword ngxDirective daemon
syn keyword ngxDirective dav_access
syn keyword ngxDirective dav_methods
syn keyword ngxDirective debug_connection
syn keyword ngxDirective debug_points
syn keyword ngxDirective default_type
syn keyword ngxDirective degradation
syn keyword ngxDirective degrade
syn keyword ngxDirective deny
syn keyword ngxDirective devpoll_changes
syn keyword ngxDirective devpoll_events
syn keyword ngxDirective directio
syn keyword ngxDirective directio_alignment
syn keyword ngxDirective empty_gif
syn keyword ngxDirective env
syn keyword ngxDirective epoll_events
syn keyword ngxDirective error_log
syn keyword ngxDirective eventport_events
syn keyword ngxDirective expires
syn keyword ngxDirective fastcgi_bind
syn keyword ngxDirective fastcgi_buffer_size
syn keyword ngxDirective fastcgi_buffers
syn keyword ngxDirective fastcgi_busy_buffers_size
syn keyword ngxDirective fastcgi_cache
syn keyword ngxDirective fastcgi_cache_key
syn keyword ngxDirective fastcgi_cache_methods
syn keyword ngxDirective fastcgi_cache_min_uses
syn keyword ngxDirective fastcgi_cache_path
syn keyword ngxDirective fastcgi_cache_use_stale
syn keyword ngxDirective fastcgi_cache_valid
syn keyword ngxDirective fastcgi_catch_stderr
syn keyword ngxDirective fastcgi_connect_timeout
syn keyword ngxDirective fastcgi_hide_header
syn keyword ngxDirective fastcgi_ignore_client_abort
syn keyword ngxDirective fastcgi_ignore_headers
syn keyword ngxDirective fastcgi_index
syn keyword ngxDirective fastcgi_intercept_errors
syn keyword ngxDirective fastcgi_max_temp_file_size
syn keyword ngxDirective fastcgi_next_upstream
syn keyword ngxDirective fastcgi_param
syn keyword ngxDirective fastcgi_pass_header
syn keyword ngxDirective fastcgi_pass_request_body
syn keyword ngxDirective fastcgi_pass_request_headers
syn keyword ngxDirective fastcgi_read_timeout
syn keyword ngxDirective fastcgi_send_lowat
syn keyword ngxDirective fastcgi_send_timeout
syn keyword ngxDirective fastcgi_split_path_info
syn keyword ngxDirective fastcgi_store
syn keyword ngxDirective fastcgi_store_access
syn keyword ngxDirective fastcgi_temp_file_write_size
syn keyword ngxDirective fastcgi_temp_path
syn keyword ngxDirective fastcgi_upstream_fail_timeout
syn keyword ngxDirective fastcgi_upstream_max_fails
syn keyword ngxDirective flv
syn keyword ngxDirective geoip_city
syn keyword ngxDirective geoip_country
syn keyword ngxDirective google_perftools_profiles
syn keyword ngxDirective gzip
syn keyword ngxDirective gzip_buffers
syn keyword ngxDirective gzip_comp_level
syn keyword ngxDirective gzip_disable
syn keyword ngxDirective gzip_hash
syn keyword ngxDirective gzip_http_version
syn keyword ngxDirective gzip_min_length
syn keyword ngxDirective gzip_no_buffer
syn keyword ngxDirective gzip_proxied
syn keyword ngxDirective gzip_static
syn keyword ngxDirective gzip_types
syn keyword ngxDirective gzip_vary
syn keyword ngxDirective gzip_window
syn keyword ngxDirective if_modified_since
syn keyword ngxDirective ignore_invalid_headers
syn keyword ngxDirective image_filter
syn keyword ngxDirective image_filter_buffer
syn keyword ngxDirective image_filter_jpeg_quality
syn keyword ngxDirective image_filter_transparency
syn keyword ngxDirective imap_auth
syn keyword ngxDirective imap_capabilities
syn keyword ngxDirective imap_client_buffer
syn keyword ngxDirective index
syn keyword ngxDirective ip_hash
syn keyword ngxDirective keepalive_requests
syn keyword ngxDirective keepalive_timeout
syn keyword ngxDirective kqueue_changes
syn keyword ngxDirective kqueue_events
syn keyword ngxDirective large_client_header_buffers
syn keyword ngxDirective limit_conn
syn keyword ngxDirective limit_conn_log_level
syn keyword ngxDirective limit_rate
syn keyword ngxDirective limit_rate_after
syn keyword ngxDirective limit_req
syn keyword ngxDirective limit_req_log_level
syn keyword ngxDirective limit_req_zone
syn keyword ngxDirective limit_zone
syn keyword ngxDirective lingering_time
syn keyword ngxDirective lingering_timeout
syn keyword ngxDirective lock_file
syn keyword ngxDirective log_format
syn keyword ngxDirective log_not_found
syn keyword ngxDirective log_subrequest
syn keyword ngxDirective map_hash_bucket_size
syn keyword ngxDirective map_hash_max_size
syn keyword ngxDirective master_process
syn keyword ngxDirective memcached_bind
syn keyword ngxDirective memcached_buffer_size
syn keyword ngxDirective memcached_connect_timeout
syn keyword ngxDirective memcached_next_upstream
syn keyword ngxDirective memcached_read_timeout
syn keyword ngxDirective memcached_send_timeout
syn keyword ngxDirective memcached_upstream_fail_timeout
syn keyword ngxDirective memcached_upstream_max_fails
syn keyword ngxDirective merge_slashes
syn keyword ngxDirective min_delete_depth
syn keyword ngxDirective modern_browser
syn keyword ngxDirective modern_browser_value
syn keyword ngxDirective msie_padding
syn keyword ngxDirective msie_refresh
syn keyword ngxDirective multi_accept
syn keyword ngxDirective open_file_cache
syn keyword ngxDirective open_file_cache_errors
syn keyword ngxDirective open_file_cache_events
syn keyword ngxDirective open_file_cache_min_uses
syn keyword ngxDirective open_file_cache_valid
syn keyword ngxDirective open_log_file_cache
syn keyword ngxDirective output_buffers
syn keyword ngxDirective override_charset
syn keyword ngxDirective perl
syn keyword ngxDirective perl_modules
syn keyword ngxDirective perl_require
syn keyword ngxDirective perl_set
syn keyword ngxDirective pid
syn keyword ngxDirective pop3_auth
syn keyword ngxDirective pop3_capabilities
syn keyword ngxDirective port_in_redirect
syn keyword ngxDirective postpone_gzipping
syn keyword ngxDirective postpone_output
syn keyword ngxDirective protocol
syn keyword ngxDirective proxy
syn keyword ngxDirective proxy_bind
syn keyword ngxDirective proxy_buffer
syn keyword ngxDirective proxy_buffer_size
syn keyword ngxDirective proxy_buffering
syn keyword ngxDirective proxy_buffers
syn keyword ngxDirective proxy_busy_buffers_size
syn keyword ngxDirective proxy_cache
syn keyword ngxDirective proxy_cache_key
syn keyword ngxDirective proxy_cache_methods
syn keyword ngxDirective proxy_cache_min_uses
syn keyword ngxDirective proxy_cache_path
syn keyword ngxDirective proxy_cache_use_stale
syn keyword ngxDirective proxy_cache_valid
syn keyword ngxDirective proxy_connect_timeout
syn keyword ngxDirective proxy_headers_hash_bucket_size
syn keyword ngxDirective proxy_headers_hash_max_size
syn keyword ngxDirective proxy_hide_header
syn keyword ngxDirective proxy_ignore_client_abort
syn keyword ngxDirective proxy_ignore_headers
syn keyword ngxDirective proxy_intercept_errors
syn keyword ngxDirective proxy_max_temp_file_size
syn keyword ngxDirective proxy_method
syn keyword ngxDirective proxy_next_upstream
syn keyword ngxDirective proxy_pass_error_message
syn keyword ngxDirective proxy_pass_header
syn keyword ngxDirective proxy_pass_request_body
syn keyword ngxDirective proxy_pass_request_headers
syn keyword ngxDirective proxy_read_timeout
syn keyword ngxDirective proxy_redirect
syn keyword ngxDirective proxy_send_lowat
syn keyword ngxDirective proxy_send_timeout
syn keyword ngxDirective proxy_set_body
syn keyword ngxDirective proxy_set_header
syn keyword ngxDirective proxy_ssl_session_reuse
syn keyword ngxDirective proxy_store
syn keyword ngxDirective proxy_store_access
syn keyword ngxDirective proxy_temp_file_write_size
syn keyword ngxDirective proxy_temp_path
syn keyword ngxDirective proxy_timeout
syn keyword ngxDirective proxy_upstream_fail_timeout
syn keyword ngxDirective proxy_upstream_max_fails
syn keyword ngxDirective random_index
syn keyword ngxDirective read_ahead
syn keyword ngxDirective real_ip_header
syn keyword ngxDirective recursive_error_pages
syn keyword ngxDirective request_pool_size
syn keyword ngxDirective reset_timedout_connection
syn keyword ngxDirective resolver
syn keyword ngxDirective resolver_timeout
syn keyword ngxDirective rewrite_log
syn keyword ngxDirective rtsig_overflow_events
syn keyword ngxDirective rtsig_overflow_test
syn keyword ngxDirective rtsig_overflow_threshold
syn keyword ngxDirective rtsig_signo
syn keyword ngxDirective satisfy
syn keyword ngxDirective secure_link_secret
syn keyword ngxDirective send_lowat
syn keyword ngxDirective send_timeout
syn keyword ngxDirective sendfile
syn keyword ngxDirective sendfile_max_chunk
syn keyword ngxDirective server_name_in_redirect
syn keyword ngxDirective server_names_hash_bucket_size
syn keyword ngxDirective server_names_hash_max_size
syn keyword ngxDirective server_tokens
syn keyword ngxDirective set_real_ip_from
syn keyword ngxDirective smtp_auth
syn keyword ngxDirective smtp_capabilities
syn keyword ngxDirective smtp_client_buffer
syn keyword ngxDirective smtp_greeting_delay
syn keyword ngxDirective so_keepalive
syn keyword ngxDirective source_charset
syn keyword ngxDirective ssi
syn keyword ngxDirective ssi_ignore_recycled_buffers
syn keyword ngxDirective ssi_min_file_chunk
syn keyword ngxDirective ssi_silent_errors
syn keyword ngxDirective ssi_types
syn keyword ngxDirective ssi_value_length
syn keyword ngxDirective ssl
syn keyword ngxDirective ssl_certificate
syn keyword ngxDirective ssl_certificate_key
syn keyword ngxDirective ssl_ciphers
syn keyword ngxDirective ssl_client_certificate
syn keyword ngxDirective ssl_crl
syn keyword ngxDirective ssl_dhparam
syn keyword ngxDirective ssl_engine
syn keyword ngxDirective ssl_prefer_server_ciphers
syn keyword ngxDirective ssl_protocols
syn keyword ngxDirective ssl_session_cache
syn keyword ngxDirective ssl_session_timeout
syn keyword ngxDirective ssl_verify_client
syn keyword ngxDirective ssl_verify_depth
syn keyword ngxDirective starttls
syn keyword ngxDirective stub_status
syn keyword ngxDirective sub_filter
syn keyword ngxDirective sub_filter_once
syn keyword ngxDirective sub_filter_types
syn keyword ngxDirective tcp_nodelay
syn keyword ngxDirective tcp_nopush
syn keyword ngxDirective thread_stack_size
syn keyword ngxDirective timeout
syn keyword ngxDirective timer_resolution
syn keyword ngxDirective types_hash_bucket_size
syn keyword ngxDirective types_hash_max_size
syn keyword ngxDirective underscores_in_headers
syn keyword ngxDirective uninitialized_variable_warn
syn keyword ngxDirective use
syn keyword ngxDirective user
syn keyword ngxDirective userid
syn keyword ngxDirective userid_domain
syn keyword ngxDirective userid_expires
syn keyword ngxDirective userid_mark
syn keyword ngxDirective userid_name
syn keyword ngxDirective userid_p3p
syn keyword ngxDirective userid_path
syn keyword ngxDirective userid_service
syn keyword ngxDirective valid_referers
syn keyword ngxDirective variables_hash_bucket_size
syn keyword ngxDirective variables_hash_max_size
syn keyword ngxDirective worker_connections
syn keyword ngxDirective worker_cpu_affinity
syn keyword ngxDirective worker_priority
syn keyword ngxDirective worker_processes
syn keyword ngxDirective worker_rlimit_core
syn keyword ngxDirective worker_rlimit_nofile
syn keyword ngxDirective worker_rlimit_sigpending
syn keyword ngxDirective worker_threads
syn keyword ngxDirective working_directory
syn keyword ngxDirective xclient
syn keyword ngxDirective xml_entities
syn keyword ngxDirective xslt_stylesheet
syn keyword ngxDirective xslt_types
" 3rd party module list:
" http://wiki.nginx.org/Nginx3rdPartyModules
" Accept Language Module <http://wiki.nginx.org/NginxAcceptLanguageModule>
" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.
syn keyword ngxDirectiveThirdParty set_from_accept_language
" Access Key Module <http://wiki.nginx.org/NginxHttpAccessKeyModule>
" Denies access unless the request URL contains an access key.
syn keyword ngxDirectiveThirdParty accesskey
syn keyword ngxDirectiveThirdParty accesskey_arg
syn keyword ngxDirectiveThirdParty accesskey_hashmethod
syn keyword ngxDirectiveThirdParty accesskey_signature
" Auth PAM Module <http://web.iti.upv.es/~sto/nginx/>
" HTTP Basic Authentication using PAM.
syn keyword ngxDirectiveThirdParty auth_pam
syn keyword ngxDirectiveThirdParty auth_pam_service_name
" Cache Purge Module <http://labs.frickle.com/nginx_ngx_cache_purge/>
" Module adding ability to purge content from FastCGI and proxy caches.
syn keyword ngxDirectiveThirdParty fastcgi_cache_purge
syn keyword ngxDirectiveThirdParty proxy_cache_purge
" Chunkin Module <http://wiki.nginx.org/NginxHttpChunkinModule>
" HTTP 1.1 chunked-encoding request body support for Nginx.
syn keyword ngxDirectiveThirdParty chunkin
syn keyword ngxDirectiveThirdParty chunkin_keepalive
syn keyword ngxDirectiveThirdParty chunkin_max_chunks_per_buf
syn keyword ngxDirectiveThirdParty chunkin_resume
" Circle GIF Module <http://wiki.nginx.org/NginxHttpCircleGifModule>
" Generates simple circle images with the colors and size specified in the URL.
syn keyword ngxDirectiveThirdParty circle_gif
syn keyword ngxDirectiveThirdParty circle_gif_max_radius
syn keyword ngxDirectiveThirdParty circle_gif_min_radius
syn keyword ngxDirectiveThirdParty circle_gif_step_radius
" Drizzle Module <http://github.com/chaoslawful/drizzle-nginx-module>
" Make nginx talk directly to mysql, drizzle, and sqlite3 by libdrizzle.
syn keyword ngxDirectiveThirdParty drizzle_connect_timeout
syn keyword ngxDirectiveThirdParty drizzle_dbname
syn keyword ngxDirectiveThirdParty drizzle_keepalive
syn keyword ngxDirectiveThirdParty drizzle_module_header
syn keyword ngxDirectiveThirdParty drizzle_pass
syn keyword ngxDirectiveThirdParty drizzle_query
syn keyword ngxDirectiveThirdParty drizzle_recv_cols_timeout
syn keyword ngxDirectiveThirdParty drizzle_recv_rows_timeout
syn keyword ngxDirectiveThirdParty drizzle_send_query_timeout
syn keyword ngxDirectiveThirdParty drizzle_server
" Echo Module <http://wiki.nginx.org/NginxHttpEchoModule>
" Brings 'echo', 'sleep', 'time', 'exec' and more shell-style goodies to Nginx config file.
syn keyword ngxDirectiveThirdParty echo
syn keyword ngxDirectiveThirdParty echo_after_body
syn keyword ngxDirectiveThirdParty echo_before_body
syn keyword ngxDirectiveThirdParty echo_blocking_sleep
syn keyword ngxDirectiveThirdParty echo_duplicate
syn keyword ngxDirectiveThirdParty echo_end
syn keyword ngxDirectiveThirdParty echo_exec
syn keyword ngxDirectiveThirdParty echo_flush
syn keyword ngxDirectiveThirdParty echo_foreach_split
syn keyword ngxDirectiveThirdParty echo_location
syn keyword ngxDirectiveThirdParty echo_location_async
syn keyword ngxDirectiveThirdParty echo_read_request_body
syn keyword ngxDirectiveThirdParty echo_request_body
syn keyword ngxDirectiveThirdParty echo_reset_timer
syn keyword ngxDirectiveThirdParty echo_sleep
syn keyword ngxDirectiveThirdParty echo_subrequest
syn keyword ngxDirectiveThirdParty echo_subrequest_async
" Events Module <http://docs.dutov.org/nginx_modules_events_en.html>
" Privides options for start/stop events.
syn keyword ngxDirectiveThirdParty on_start
syn keyword ngxDirectiveThirdParty on_stop
" EY Balancer Module <http://github.com/ry/nginx-ey-balancer>
" Adds a request queue to Nginx that allows the limiting of concurrent requests passed to the upstream.
syn keyword ngxDirectiveThirdParty max_connections
syn keyword ngxDirectiveThirdParty max_connections_max_queue_length
syn keyword ngxDirectiveThirdParty max_connections_queue_timeout
" Fancy Indexes Module <https://connectical.com/projects/ngx-fancyindex/wiki>
" Like the built-in autoindex module, but fancier.
syn keyword ngxDirectiveThirdParty fancyindex
syn keyword ngxDirectiveThirdParty fancyindex_exact_size
syn keyword ngxDirectiveThirdParty fancyindex_footer
syn keyword ngxDirectiveThirdParty fancyindex_header
syn keyword ngxDirectiveThirdParty fancyindex_localtime
syn keyword ngxDirectiveThirdParty fancyindex_readme
syn keyword ngxDirectiveThirdParty fancyindex_readme_mode
" GeoIP Module (DEPRECATED) <http://wiki.nginx.org/NginxHttp3rdPartyGeoIPModule>
" Country code lookups via the MaxMind GeoIP API.
syn keyword ngxDirectiveThirdParty geoip_country_file
" Headers More Module <http://wiki.nginx.org/NginxHttpHeadersMoreModule>
" Set and clear input and output headers...more than "add"!
syn keyword ngxDirectiveThirdParty more_clear_headers
syn keyword ngxDirectiveThirdParty more_clear_input_headers
syn keyword ngxDirectiveThirdParty more_set_headers
syn keyword ngxDirectiveThirdParty more_set_input_headers
" HTTP Push Module <http://pushmodule.slact.net/>
" Turn Nginx into an adept long-polling HTTP Push (Comet) server.
syn keyword ngxDirectiveThirdParty push_buffer_size
syn keyword ngxDirectiveThirdParty push_listener
syn keyword ngxDirectiveThirdParty push_message_timeout
syn keyword ngxDirectiveThirdParty push_queue_messages
syn keyword ngxDirectiveThirdParty push_sender
" HTTP Redis Module <http://people.FreeBSD.ORG/~osa/ngx_http_redis-0.3.1.tar.gz>>
" Redis <http://code.google.com/p/redis/> support.>
syn keyword ngxDirectiveThirdParty redis_bind
syn keyword ngxDirectiveThirdParty redis_buffer_size
syn keyword ngxDirectiveThirdParty redis_connect_timeout
syn keyword ngxDirectiveThirdParty redis_next_upstream
syn keyword ngxDirectiveThirdParty redis_pass
syn keyword ngxDirectiveThirdParty redis_read_timeout
syn keyword ngxDirectiveThirdParty redis_send_timeout
" HTTP JavaScript Module <http://wiki.github.com/kung-fu-tzu/ngx_http_js_module>
" Embedding SpiderMonkey. Nearly full port on Perl module.
syn keyword ngxDirectiveThirdParty js
syn keyword ngxDirectiveThirdParty js_filter
syn keyword ngxDirectiveThirdParty js_filter_types
syn keyword ngxDirectiveThirdParty js_load
syn keyword ngxDirectiveThirdParty js_maxmem
syn keyword ngxDirectiveThirdParty js_require
syn keyword ngxDirectiveThirdParty js_set
syn keyword ngxDirectiveThirdParty js_utf8
" Log Request Speed <http://wiki.nginx.org/NginxHttpLogRequestSpeed>
" Log the time it took to process each request.
syn keyword ngxDirectiveThirdParty log_request_speed_filter
syn keyword ngxDirectiveThirdParty log_request_speed_filter_timeout
" Memc Module <http://wiki.nginx.org/NginxHttpMemcModule>
" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.
syn keyword ngxDirectiveThirdParty memc_buffer_size
syn keyword ngxDirectiveThirdParty memc_cmds_allowed
syn keyword ngxDirectiveThirdParty memc_connect_timeout
syn keyword ngxDirectiveThirdParty memc_flags_to_last_modified
syn keyword ngxDirectiveThirdParty memc_next_upstream
syn keyword ngxDirectiveThirdParty memc_pass
syn keyword ngxDirectiveThirdParty memc_read_timeout
syn keyword ngxDirectiveThirdParty memc_send_timeout
syn keyword ngxDirectiveThirdParty memc_upstream_fail_timeout
syn keyword ngxDirectiveThirdParty memc_upstream_max_fails
" Mogilefs Module <http://www.grid.net.ru/nginx/mogilefs.en.html>
" Implements a MogileFS client, provides a replace to the Perlbal reverse proxy of the original MogileFS.
syn keyword ngxDirectiveThirdParty mogilefs_connect_timeout
syn keyword ngxDirectiveThirdParty mogilefs_domain
syn keyword ngxDirectiveThirdParty mogilefs_methods
syn keyword ngxDirectiveThirdParty mogilefs_noverify
syn keyword ngxDirectiveThirdParty mogilefs_pass
syn keyword ngxDirectiveThirdParty mogilefs_read_timeout
syn keyword ngxDirectiveThirdParty mogilefs_send_timeout
syn keyword ngxDirectiveThirdParty mogilefs_tracker
" MP4 Streaming Lite Module <http://wiki.nginx.org/NginxMP4StreamingLite>
" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL.
syn keyword ngxDirectiveThirdParty mp4
" Nginx Notice Module <http://xph.us/software/nginx-notice/>
" Serve static file to POST requests.
syn keyword ngxDirectiveThirdParty notice
syn keyword ngxDirectiveThirdParty notice_type
" Phusion Passenger <http://www.modrails.com/documentation.html>
" Easy and robust deployment of Ruby on Rails application on Apache and Nginx webservers.
syn keyword ngxDirectiveThirdParty passenger_base_uri
syn keyword ngxDirectiveThirdParty passenger_default_user
syn keyword ngxDirectiveThirdParty passenger_enabled
syn keyword ngxDirectiveThirdParty passenger_log_level
syn keyword ngxDirectiveThirdParty passenger_max_instances_per_app
syn keyword ngxDirectiveThirdParty passenger_max_pool_size
syn keyword ngxDirectiveThirdParty passenger_pool_idle_time
syn keyword ngxDirectiveThirdParty passenger_root
syn keyword ngxDirectiveThirdParty passenger_ruby
syn keyword ngxDirectiveThirdParty passenger_use_global_queue
syn keyword ngxDirectiveThirdParty passenger_user_switching
syn keyword ngxDirectiveThirdParty rack_env
syn keyword ngxDirectiveThirdParty rails_app_spawner_idle_time
syn keyword ngxDirectiveThirdParty rails_env
syn keyword ngxDirectiveThirdParty rails_framework_spawner_idle_time
syn keyword ngxDirectiveThirdParty rails_spawn_method
" RDS JSON Module <http://github.com/agentzh/rds-json-nginx-module>
" Help ngx_drizzle and other DBD modules emit JSON data.
syn keyword ngxDirectiveThirdParty rds_json
syn keyword ngxDirectiveThirdParty rds_json_content_type
syn keyword ngxDirectiveThirdParty rds_json_format
syn keyword ngxDirectiveThirdParty rds_json_ret
" RRD Graph Module <http://wiki.nginx.org/NginxNgx_rrd_graph>
" This module provides an HTTP interface to RRDtool's graphing facilities.
syn keyword ngxDirectiveThirdParty rrd_graph
syn keyword ngxDirectiveThirdParty rrd_graph_root
" Secure Download <http://wiki.nginx.org/NginxHttpSecureDownload>
" Create expiring links.
syn keyword ngxDirectiveThirdParty secure_download
syn keyword ngxDirectiveThirdParty secure_download_fail_location
syn keyword ngxDirectiveThirdParty secure_download_path_mode
syn keyword ngxDirectiveThirdParty secure_download_secret
" SlowFS Cache Module <http://labs.frickle.com/nginx_ngx_slowfs_cache/>
" Module adding ability to cache static files.
syn keyword ngxDirectiveThirdParty slowfs_big_file_size
syn keyword ngxDirectiveThirdParty slowfs_cache
syn keyword ngxDirectiveThirdParty slowfs_cache_key
syn keyword ngxDirectiveThirdParty slowfs_cache_min_uses
syn keyword ngxDirectiveThirdParty slowfs_cache_path
syn keyword ngxDirectiveThirdParty slowfs_cache_purge
syn keyword ngxDirectiveThirdParty slowfs_cache_valid
syn keyword ngxDirectiveThirdParty slowfs_temp_path
" Strip Module <http://wiki.nginx.org/NginxHttpStripModule>
" Whitespace remover.
syn keyword ngxDirectiveThirdParty strip
" Substitutions Module <http://wiki.nginx.org/NginxHttpSubsModule>
" A filter module which can do both regular expression and fixed string substitutions on response bodies.
syn keyword ngxDirectiveThirdParty subs_filter
syn keyword ngxDirectiveThirdParty subs_filter_types
" Supervisord Module <http://labs.frickle.com/nginx_ngx_supervisord/>
" Module providing nginx with API to communicate with supervisord and manage (start/stop) backends on-demand.
syn keyword ngxDirectiveThirdParty supervisord
syn keyword ngxDirectiveThirdParty supervisord_inherit_backend_status
syn keyword ngxDirectiveThirdParty supervisord_name
syn keyword ngxDirectiveThirdParty supervisord_start
syn keyword ngxDirectiveThirdParty supervisord_stop
" Upload Module <http://www.grid.net.ru/nginx/upload.en.html>
" Parses multipart/form-data allowing arbitrary handling of uploaded files.
syn keyword ngxDirectiveThirdParty upload_aggregate_form_field
syn keyword ngxDirectiveThirdParty upload_buffer_size
syn keyword ngxDirectiveThirdParty upload_cleanup
syn keyword ngxDirectiveThirdParty upload_limit_rate
syn keyword ngxDirectiveThirdParty upload_max_file_size
syn keyword ngxDirectiveThirdParty upload_max_output_body_len
syn keyword ngxDirectiveThirdParty upload_max_part_header_len
syn keyword ngxDirectiveThirdParty upload_pass
syn keyword ngxDirectiveThirdParty upload_pass_args
syn keyword ngxDirectiveThirdParty upload_pass_form_field
syn keyword ngxDirectiveThirdParty upload_set_form_field
syn keyword ngxDirectiveThirdParty upload_store
syn keyword ngxDirectiveThirdParty upload_store_access
" Upload Progress Module <http://wiki.nginx.org/NginxHttpUploadProgressModule>
" Tracks and reports upload progress.
syn keyword ngxDirectiveThirdParty report_uploads
syn keyword ngxDirectiveThirdParty track_uploads
syn keyword ngxDirectiveThirdParty upload_progress
syn keyword ngxDirectiveThirdParty upload_progress_content_type
syn keyword ngxDirectiveThirdParty upload_progress_header
syn keyword ngxDirectiveThirdParty upload_progress_json_output
syn keyword ngxDirectiveThirdParty upload_progress_template
" Upstream Fair Balancer <http://wiki.nginx.org/NginxHttpUpstreamFairModule>
" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin.
syn keyword ngxDirectiveThirdParty fair
syn keyword ngxDirectiveThirdParty upstream_fair_shm_size
" Upstream Consistent Hash <http://wiki.nginx.org/NginxHttpUpstreamConsistentHash>
" Select backend based on Consistent hash ring.
syn keyword ngxDirectiveThirdParty consistent_hash
" Upstream Hash Module <http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule>
" Provides simple upstream load distribution by hashing a configurable variable.
syn keyword ngxDirectiveThirdParty hash
syn keyword ngxDirectiveThirdParty hash_again
" XSS Module <http://github.com/agentzh/xss-nginx-module>
" Native support for cross-site scripting (XSS) in an nginx.
syn keyword ngxDirectiveThirdParty xss_callback_arg
syn keyword ngxDirectiveThirdParty xss_get
syn keyword ngxDirectiveThirdParty xss_input_types
syn keyword ngxDirectiveThirdParty xss_output_type
" highlight
hi link ngxComment Comment
hi link ngxVariable Identifier
hi link ngxVariableBlock Identifier
hi link ngxVariableString PreProc
hi link ngxBlock Normal
hi link ngxString String
hi link ngxBoolean Boolean
hi link ngxDirectiveBlock Statement
hi link ngxDirectiveImportant Type
hi link ngxDirectiveControl Keyword
hi link ngxDirectiveError Constant
hi link ngxDirectiveDeprecated Error
hi link ngxDirective Identifier
hi link ngxDirectiveThirdParty Special
let b:current_syntax = "nginx"

@ -0,0 +1 @@
Subproject commit 9922e13d308d2b5be4c9b3deff50aaa0c2580584

View file

@ -0,0 +1,18 @@
This is a mirror of http://www.vim.org/scripts/script.php?script_id=3161
Usage
-----
1. Open a Python file
2. Press `<F7>` to run `pyflakes` on it
It shows the errors inside a quickfix window, which will allow your to quickly
jump to the error locations by simply pressing [Enter].
Customization
-------------
If you don't want to use the `<F7>` key for pyflakes-checking, simply remap it to
another key. It autodetects whether it has been remapped and won't register
the `<F7>` key if so. For example, to remap it to `<F3>` instead, use:
autocmd FileType python map <buffer> <F3> :call Pyflakes()<CR>

View file

@ -0,0 +1,73 @@
"
" Python filetype plugin for running pyflakes
" Language: Python (ft=python)
" Maintainer: Vincent Driessen <vincent@datafox.nl>
" Version: Vim 7 (may work with lower Vim versions, but not tested)
" URL: http://github.com/nvie/vim-pyflakes
"
" Only do this when not done yet for this buffer
if exists("b:loaded_pyflakes_ftplugin")
finish
endif
let b:loaded_pyflakes_ftplugin=1
let s:pyflakes_cmd="pyflakes"
if !exists("*Pyflakes()")
function Pyflakes()
if !executable(s:pyflakes_cmd)
echoerr "File " . s:pyflakes_cmd . " not found. Please install it first."
return
endif
set lazyredraw " delay redrawing
cclose " close any existing cwindows
" store old grep settings (to restore later)
let l:old_gfm=&grepformat
let l:old_gp=&grepprg
" write any changes before continuing
if &readonly == 0
update
endif
" perform the grep itself
let &grepformat="%f:%l: %m"
let &grepprg=s:pyflakes_cmd
silent! grep! %
" restore grep settings
let &grepformat=l:old_gfm
let &grepprg=l:old_gp
" open cwindow
let has_results=getqflist() != []
if has_results
execute 'belowright copen'
nnoremap <buffer> <silent> c :cclose<CR>
nnoremap <buffer> <silent> q :cclose<CR>
endif
set nolazyredraw
redraw!
if has_results == 0
" Show OK status
hi Green ctermfg=green
echohl Green
echon "Static analysis OK"
echohl
endif
endfunction
endif
" Add mappings, unless the user didn't want this.
" The default mapping is registered under to <F7> by default, unless the user
" remapped it already (or a mapping exists already for <F7>)
if !exists("no_plugin_maps") && !exists("no_pyflakes_maps")
if !hasmapto('Pyflakes()')
noremap <buffer> <F7> :call Pyflakes()<CR>
noremap! <buffer> <F7> :call Pyflakes()<CR>
endif
endif

View file

@ -0,0 +1,62 @@
'Tlist_Auto_Highlight_Tag' taglist.txt /*'Tlist_Auto_Highlight_Tag'*
'Tlist_Auto_Open' taglist.txt /*'Tlist_Auto_Open'*
'Tlist_Auto_Update' taglist.txt /*'Tlist_Auto_Update'*
'Tlist_Close_On_Select' taglist.txt /*'Tlist_Close_On_Select'*
'Tlist_Compact_Format' taglist.txt /*'Tlist_Compact_Format'*
'Tlist_Ctags_Cmd' taglist.txt /*'Tlist_Ctags_Cmd'*
'Tlist_Display_Prototype' taglist.txt /*'Tlist_Display_Prototype'*
'Tlist_Display_Tag_Scope' taglist.txt /*'Tlist_Display_Tag_Scope'*
'Tlist_Enable_Fold_Column' taglist.txt /*'Tlist_Enable_Fold_Column'*
'Tlist_Exit_OnlyWindow' taglist.txt /*'Tlist_Exit_OnlyWindow'*
'Tlist_File_Fold_Auto_Close' taglist.txt /*'Tlist_File_Fold_Auto_Close'*
'Tlist_GainFocus_On_ToggleOpen' taglist.txt /*'Tlist_GainFocus_On_ToggleOpen'*
'Tlist_Highlight_Tag_On_BufEnter' taglist.txt /*'Tlist_Highlight_Tag_On_BufEnter'*
'Tlist_Inc_Winwidth' taglist.txt /*'Tlist_Inc_Winwidth'*
'Tlist_Max_Submenu_Items' taglist.txt /*'Tlist_Max_Submenu_Items'*
'Tlist_Max_Tag_Length' taglist.txt /*'Tlist_Max_Tag_Length'*
'Tlist_Process_File_Always' taglist.txt /*'Tlist_Process_File_Always'*
'Tlist_Show_Menu' taglist.txt /*'Tlist_Show_Menu'*
'Tlist_Show_One_File' taglist.txt /*'Tlist_Show_One_File'*
'Tlist_Sort_Type' taglist.txt /*'Tlist_Sort_Type'*
'Tlist_Use_Horiz_Window' taglist.txt /*'Tlist_Use_Horiz_Window'*
'Tlist_Use_Right_Window' taglist.txt /*'Tlist_Use_Right_Window'*
'Tlist_Use_SingleClick' taglist.txt /*'Tlist_Use_SingleClick'*
'Tlist_WinHeight' taglist.txt /*'Tlist_WinHeight'*
'Tlist_WinWidth' taglist.txt /*'Tlist_WinWidth'*
:TlistAddFiles taglist.txt /*:TlistAddFiles*
:TlistAddFilesRecursive taglist.txt /*:TlistAddFilesRecursive*
:TlistClose taglist.txt /*:TlistClose*
:TlistDebug taglist.txt /*:TlistDebug*
:TlistHighlightTag taglist.txt /*:TlistHighlightTag*
:TlistLock taglist.txt /*:TlistLock*
:TlistMessages taglist.txt /*:TlistMessages*
:TlistOpen taglist.txt /*:TlistOpen*
:TlistSessionLoad taglist.txt /*:TlistSessionLoad*
:TlistSessionSave taglist.txt /*:TlistSessionSave*
:TlistShowPrototype taglist.txt /*:TlistShowPrototype*
:TlistShowTag taglist.txt /*:TlistShowTag*
:TlistToggle taglist.txt /*:TlistToggle*
:TlistUndebug taglist.txt /*:TlistUndebug*
:TlistUnlock taglist.txt /*:TlistUnlock*
:TlistUpdate taglist.txt /*:TlistUpdate*
Tlist_Get_Tag_Prototype_By_Line() taglist.txt /*Tlist_Get_Tag_Prototype_By_Line()*
Tlist_Get_Tagname_By_Line() taglist.txt /*Tlist_Get_Tagname_By_Line()*
Tlist_Set_App() taglist.txt /*Tlist_Set_App()*
Tlist_Update_File_Tags() taglist.txt /*Tlist_Update_File_Tags()*
taglist-commands taglist.txt /*taglist-commands*
taglist-debug taglist.txt /*taglist-debug*
taglist-extend taglist.txt /*taglist-extend*
taglist-faq taglist.txt /*taglist-faq*
taglist-functions taglist.txt /*taglist-functions*
taglist-install taglist.txt /*taglist-install*
taglist-internet taglist.txt /*taglist-internet*
taglist-intro taglist.txt /*taglist-intro*
taglist-keys taglist.txt /*taglist-keys*
taglist-license taglist.txt /*taglist-license*
taglist-menu taglist.txt /*taglist-menu*
taglist-options taglist.txt /*taglist-options*
taglist-requirements taglist.txt /*taglist-requirements*
taglist-session taglist.txt /*taglist-session*
taglist-todo taglist.txt /*taglist-todo*
taglist-using taglist.txt /*taglist-using*
taglist.txt taglist.txt /*taglist.txt*

View file

@ -1,4 +0,0 @@
.*.sw[a-z]
.*.un~
doc/tags

View file

@ -1,15 +0,0 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2010 to 2012 Mick Koch <kchmck@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

View file

@ -1,25 +0,0 @@
REF = HEAD
VERSION = $(shell git describe --always $(REF))
ARCHIVE = vim-coffee-script-$(VERSION).zip
ARCHIVE_DIRS = after compiler doc ftdetect ftplugin indent syntax
# Don't do anything by default.
all:
# Make vim.org zipball.
archive:
git archive $(REF) -o $(ARCHIVE) -- $(ARCHIVE_DIRS)
# Remove zipball.
clean:
-rm -f $(ARCHIVE)
# Build the list of syntaxes for @coffeeAll.
coffeeAll:
@grep -E 'syn (match|region)' syntax/coffee.vim |\
grep -v 'contained' |\
awk '{print $$3}' |\
uniq
.PHONY: all archive clean hash coffeeAll

View file

@ -1,18 +0,0 @@
### Version 002 (December 5, 2011)
Added binary numbers (0b0101) and fixed some bugs (#9, #62, #63, #65).
### Version 001 (October 18, 2011)
Removed deprecated `coffee_folding` option, added `coffee_compile_vert` option,
split out compiler, fixed indentation and syntax bugs, and added Haml support
and omnicompletion.
- The coffee compiler is now a proper vim compiler that can be loaded with
`:compiler coffee`.
- The `coffee_compile_vert` option can now be set to split the CoffeeCompile
buffer vertically by default.
- CoffeeScript is now highlighted inside the `:coffeescript` filter in Haml.
- Omnicompletion (`:help compl-omni`) now uses JavaScript's dictionary to
complete words.
- We now have a fancy version number.

View file

@ -1,270 +0,0 @@
This project adds [CoffeeScript] support to the vim editor. It handles syntax,
indenting, compiling, and more. Also included is support for CoffeeScript in
Haml and HTML.
![Screenshot](http://i.imgur.com/eUBvm.png)
[CoffeeScript]: http://jashkenas.github.com/coffee-script/
### Install from a Zipball
This is the quickest way to get things running.
1. Download the latest zipball from [vim.org][zipball-vim] or
[github][zipball-github]. The latest version on github is under Download
Packages (don't use the Download buttons.)
2. Extract the archive into `~/.vim/`:
unzip -od ~/.vim vim-coffee-script-HASH.zip
These steps are also used to update the plugin.
[zipball-vim]: http://www.vim.org/scripts/script.php?script_id=3590
[zipball-github]: https://github.com/kchmck/vim-coffee-script/downloads
### Install with Pathogen
Since this plugin has rolling versions based on git commits, using pathogen and
git is the preferred way to install. The plugin ends up contained in its own
directory and updates are just a `git pull` away.
1. Install tpope's [pathogen] into `~/.vim/autoload/` and add this line to your
`vimrc`:
call pathogen#infect()
To get the all the features of this plugin, make sure you also have a
`filetype plugin indent on` line in there.
[pathogen]: http://www.vim.org/scripts/script.php?script_id=2332
2. Create and change into `~/.vim/bundle/`:
$ mkdir ~/.vim/bundle
$ cd ~/.vim/bundle
3. Make a clone of the `vim-coffee-script` repository:
$ git clone https://github.com/kchmck/vim-coffee-script.git
#### Updating
1. Change into `~/.vim/bundle/vim-coffee-script/`:
$ cd ~/.vim/bundle/vim-coffee-script
2. Pull in the latest changes:
$ git pull
### CoffeeMake: Compile the Current File
The `CoffeeMake` command compiles the current file and parses any errors:
![CoffeeMake](http://i.imgur.com/cr9xI.png)
The full signature of the command is:
:[silent] CoffeeMake[!] [COFFEE-OPTIONS]...
By default, `CoffeeMake` shows all compiler output and jumps to the first line
reported as an error by `coffee`:
:CoffeeMake
Compiler output can be hidden with `silent`:
:silent CoffeeMake
Line-jumping can be turned off by adding a bang:
:CoffeeMake!
Options given to `CoffeeMake` are passed along to `coffee`:
:CoffeeMake --bare
`CoffeeMake` can be manually loaded for a file with:
:compiler coffee
#### Recompile on write
To recompile a file when it's written, add an `autocmd` like this to your
`vimrc`:
au BufWritePost *.coffee silent CoffeeMake!
All of the customizations above can be used, too. This one compiles silently
and with the `-b` option, but shows any errors:
au BufWritePost *.coffee silent CoffeeMake! -b | cwindow | redraw!
The `redraw!` command is needed to fix a redrawing quirk in terminal vim, but
can removed for gVim.
#### Default compiler options
The `CoffeeMake` command passes any options in the `coffee_make_options`
variable along to the compiler. You can use this to set default options:
let coffee_make_options = '--bare'
#### Path to compiler
To change the compiler used by `CoffeeMake` and `CoffeeCompile`, set
`coffee_compiler` to the full path of an executable or the filename of one
in your `$PATH`:
let coffee_compiler = '/usr/bin/coffee'
This option is set to `coffee` by default.
### CoffeeCompile: Compile Snippets of CoffeeScript
The `CoffeeCompile` command shows how the current file or a snippet of
CoffeeScript is compiled to JavaScript. The full signature of the command is:
:[RANGE] CoffeeCompile [watch|unwatch] [vert[ical]] [WINDOW-SIZE]
Calling `CoffeeCompile` without a range compiles the whole file:
![CoffeeCompile](http://i.imgur.com/KJfSZ.png)
Calling `CoffeeCompile` with a range, like in visual mode, compiles the selected
snippet of CoffeeScript:
![CoffeeCompile Snippet](http://i.imgur.com/mbaUA.png)
![Compiled Snippet](http://i.imgur.com/Ocjuc.png)
This scratch buffer can be quickly closed by hitting the `q` key.
Using `vert` splits the CoffeeCompile buffer vertically instead of horizontally:
:CoffeeCompile vert
Set the `coffee_compile_vert` variable to split the buffer vertically by
default:
let coffee_compile_vert = 1
The initial size of the CoffeeCompile buffer can be given as a number:
:CoffeeCompile 4
#### Watch (live preview) mode
Watch mode is like the Try CoffeeScript preview box on the CoffeeScript
homepage:
![Watch Mode](http://i.imgur.com/M6l1j.png)
![Watch Mode](http://i.imgur.com/qtNmU.png)
Writing some code and then exiting insert mode automatically updates the
compiled JavaScript buffer.
Use `watch` to start watching a buffer (`vert` is also recommended):
:CoffeeCompile watch vert
After making some changes in insert mode, hit escape and the CoffeeScript will
be recompiled. Changes made outside of insert mode don't trigger this recompile,
but calling `CoffeeCompile` will compile these changes without any bad effects.
To get synchronized scrolling of a CoffeeScript and CoffeeCompile buffer, set
`scrollbind` on each:
:setl scrollbind
Use `unwatch` to stop watching a buffer:
:CoffeeCompile unwatch
### CoffeeLint: Lint your CoffeeScript
The `CoffeeLint` command runs [coffeelint](http://www.coffeelint.org/) (version
0.4.0 or later required) on the current file and parses any errors:
:[RANGE] CoffeeLint[!] [COFFEELINT-OPTIONS]
Use it like `CoffeeMake`.
![CoffeeLint](http://i.imgur.com/dlxF7.png)
#### Default coffeelint options
Options in `coffee_lint_options` are passed along to `coffeelint`:
let coffee_lint_options = '-f lint.json'
#### Path to `coffeelint`
Use the `coffee_linter` option to set a different path to the `coffeelint`
executable:
let coffee_linter = '/usr/bin/coffeelint'
This option is set to `coffeelint` by default.
### CoffeeRun: Run some CoffeeScript
The `CoffeeRun` command compiles the current file or selected snippet and runs
the resulting JavaScript. Output is shown at the bottom of the screen:
![CoffeeRun](http://i.imgur.com/7hwSy.png)
![CoffeeRun Output](http://i.imgur.com/WNWvC.png)
### Configure Syntax Highlighting
Add these lines to your `vimrc` to disable the relevant syntax group.
#### Disable trailing whitespace error
Trailing whitespace is highlighted as an error by default. This can be disabled
with:
hi link coffeeSpaceError NONE
#### Disable trailing semicolon error
Trailing semicolons are also considered an error (for help transitioning from
JavaScript.) This can be disabled with:
hi link coffeeSemicolonError NONE
#### Disable reserved words error
Reserved words like `function` and `var` are highlighted as an error where
they're not allowed in CoffeeScript. This can be disabled with:
hi link coffeeReservedError NONE
### Tune Vim for CoffeeScript
Changing these core settings can make vim more CoffeeScript friendly.
#### Fold by indentation
Folding by indentation works well for CoffeeScript functions and classes:
![Folding](http://i.imgur.com/Y0rDC.png)
To fold by indentation in CoffeeScript files, add this line to your `vimrc`:
au BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenable
With this, folding is disabled by default but can be quickly toggled per-file
by hitting `zi`. To enable folding by default, remove `nofoldenable`:
au BufNewFile,BufReadPost *.coffee setl foldmethod=indent
#### Two-space indentation
To get standard two-space indentation in CoffeeScript files, add this line to
your `vimrc`:
au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab

View file

@ -1,44 +0,0 @@
Thanks to all bug reporters, and special thanks to those who have contributed
code:
Brian Egan (brianegan):
Initial compiling support
Ches Martin (ches):
Initial vim docs
Chris Hoffman (cehoffman):
Add new keywoards from, to, and do
Highlight the - in negative integers
Add here regex highlighting, increase fold level for here docs
David Wilhelm (bigfish):
CoffeeRun command
Jay Adkisson (jayferd):
Support for eco templates
Karl Guertin (grayrest)
Cakefiles are coffeescript
Maciej Konieczny (narfdotpl):
Fix funny typo
Matt Sacks (mattsa):
Javascript omni-completion
coffee_compile_vert option
Nick Stenning (nickstenning):
Fold by indentation for coffeescript
Simon Lipp (sloonz):
Trailing spaces are not error on lines containing only spaces
Stéphan Kochen (stephank):
Initial HTML CoffeeScript highlighting
Sven Felix Oberquelle (Svelix):
Haml CoffeeScript highlighting
Wei Dai (clvv):
Fix the use of Vim built-in make command.

View file

@ -1 +0,0 @@
- Don't highlight bad operator combinations

View file

@ -1,9 +0,0 @@
" Language: CoffeeScript
" Maintainer: Sven Felix Oberquelle <Svelix.Github@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
" Inherit coffee from html so coffeeComment isn't redefined and given higher
" priority than hamlInterpolation.
syn cluster hamlCoffeescript contains=@htmlCoffeeScript
syn region hamlCoffeescriptFilter matchgroup=hamlFilter start="^\z(\s*\):coffee\z(script\)*\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlCoffeeScript,hamlInterpolation keepend

View file

@ -1,11 +0,0 @@
" Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
" Syntax highlighting for text/coffeescript script tags
syn include @htmlCoffeeScript syntax/coffee.vim
syn region coffeeScript start=+<script [^>]*type *=[^>]*text/coffeescript[^>]*>+
\ end=+</script>+me=s-1 keepend
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
\ containedin=htmlHead

View file

@ -1,82 +0,0 @@
" Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
" All this is needed to support compiling filenames with spaces, quotes, and
" such. The filename is escaped and embedded into the `makeprg` setting.
"
" Because of this, `makeprg` must be updated on every file rename. And because
" of that, `CompilerSet` can't be used because it doesn't exist when the
" rename autocmd is ran. So, we have to do some checks to see whether `compiler`
" was called locally or globally, and respect that in the rest of the script.
if exists('current_compiler')
finish
else
let current_compiler = 'coffee'
endif
" Pattern to check if coffee is the compiler
let s:pat = '^' . current_compiler
" Path to CoffeeScript compiler
if !exists('coffee_compiler')
let coffee_compiler = 'coffee'
endif
" Extra options passed to CoffeeMake
if !exists('coffee_make_options')
let coffee_make_options = ''
endif
" Get a `makeprg` for the current filename.
function! s:GetMakePrg()
return g:coffee_compiler . ' -c ' . g:coffee_make_options . ' $* '
\ . fnameescape(expand('%'))
endfunction
" Set `makeprg` and return 1 if coffee is still the compiler, else return 0.
function! s:SetMakePrg()
if &l:makeprg =~ s:pat
let &l:makeprg = s:GetMakePrg()
elseif &g:makeprg =~ s:pat
let &g:makeprg = s:GetMakePrg()
else
return 0
endif
return 1
endfunction
" Set a dummy compiler so we can check whether to set locally or globally.
CompilerSet makeprg=coffee
call s:SetMakePrg()
CompilerSet errorformat=Error:\ In\ %f\\,\ %m\ on\ line\ %l,
\Error:\ In\ %f\\,\ Parse\ error\ on\ line\ %l:\ %m,
\SyntaxError:\ In\ %f\\,\ %m,
\%-G%.%#
" Compile the current file.
command! -bang -bar -nargs=* CoffeeMake make<bang> <args>
" Set `makeprg` on rename since we embed the filename in the setting.
augroup CoffeeUpdateMakePrg
autocmd!
" Update `makeprg` if coffee is still the compiler, else stop running this
" function.
function! s:UpdateMakePrg()
if !s:SetMakePrg()
autocmd! CoffeeUpdateMakePrg
endif
endfunction
" Set autocmd locally if compiler was set locally.
if &l:makeprg =~ s:pat
autocmd BufFilePost,BufWritePost <buffer> call s:UpdateMakePrg()
else
autocmd BufFilePost,BufWritePost call s:UpdateMakePrg()
endif
augroup END

View file

@ -1,143 +0,0 @@
*coffee-script.txt* For Vim version 7.3
=============================================================================
Author: Mick Koch <kchmck@gmail.com> *coffee-script-author*
License: WTFPL (see |coffee-script-license|)
=============================================================================
CONTENTS *coffee-script-contents*
|coffee-script-introduction| Introduction and Feature Summary
|coffee-script-commands| Commands
|coffee-script-settings| Settings
|compiler-coffee-script| Compiler
{Vi does not have any of this}
=============================================================================
INTRODUCTION *coffee-script*
*coffee-script-introduction*
This plugin adds support for CoffeeScript syntax, indenting, and compiling.
Also included is an eco syntax and support for CoffeeScript in Haml and HTML.
COMMANDS *coffee-script-commands*
*:CoffeeMake*
:CoffeeMake[!] {opts} Wrapper around |:make| that also passes options in
|g:coffee_make_options| to the compiler. Use |:silent|
to hide compiler output. See |:make| for more
information about [!] and other helpful commands.
*:CoffeeCompile*
:[range]CoffeeCompile [vertical] [{win-size}]
Shows how the current file or [range] is compiled
to JavaScript. [vertical] (or vert) splits the
compile buffer vertically instead of horizontally, and
{win-size} sets the initial size of the buffer. It can
be closed quickly with the "q" key.
:CoffeeCompile {watch} [vertical] [{win-size}]
The watch mode of :CoffeeCompile emulates the "Try
CoffeeScript" live preview on the CoffeeScript web
site. After making changes to the source file,
exiting insert mode will cause the preview buffer to
update automatically. {watch} should be given as
"watch" or "unwatch," where the latter will stop the
automatic updating. [vertical] is recommended, and
'scrollbind' is useful.
*:CoffeeLint*
:[range]CoffeeLint[!] {opts}
Run {coffeelint} on the current file and add any
errors to the quickfix list. The first error is jumped
to if [!] isn't given. Options in
|g:coffee_lint_options| and {opts} are passed along to
{coffeelint}. Although the whole file is linted, if a
[range] is given, only errors within those lines will
be considered.
*:CoffeeRun*
:[range]CoffeeRun Compiles the file or [range] and runs the resulting
JavaScript, displaying the output.
SETTINGS *coffee-script-settings*
You can configure plugin behavior using global variables and syntax commands
in your |vimrc|.
Global Settings~
*g:coffee_compiler*
Set the path to the compiler used by |CoffeeMake| and |CoffeeCompile| (it's
{coffee} by default.)
>
let coffee_compiler = '/usr/bin/coffee'
<
*g:coffee_make_options*
Set default options |CoffeeMake| should pass to the compiler.
>
let coffee_make_options = '--bare'
<
*g:coffee_compile_vert*
Split the CoffeeCompile buffer vertically by default.
>
let coffee_compile_vert = 1
<
*g:coffee_linter*
Set the path to the {coffeelint} executable (it's {coffeelint} by default.)
>
let coffee_linter = '/usr/bin/coffeelint'
<
*g:coffee_lint_options*
Set default options |CoffeeLint| should pass to {coffeelint}.
>
let coffee_lint_options = '-f lint.json'
<
Syntax Highlighting~
*ft-coffee-script-syntax*
Trailing whitespace is highlighted as an error by default. This can be
disabled with:
>
hi link coffeeSpaceError NONE
Trailing semicolons are also considered an error (for help transitioning from
JavaScript.) This can be disabled with:
>
hi link coffeeSemicolonError NONE
Reserved words like {function} and {var} are highlighted where they're not
allowed in CoffeeScript. This can be disabled with:
>
hi link coffeeReservedError NONE
COMPILER *compiler-coffee-script*
A CoffeeScript compiler is provided as a wrapper around {coffee} and can be
loaded with;
>
compiler coffee
This is done automatically when a CoffeeScript file is opened if no other
compiler is loaded.
=============================================================================
LICENSE *coffee-script-license*
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2010 to 2012 Mick Koch <kchmck@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
vim:tw=78:ts=8:ft=help:norl:

View file

@ -1,17 +0,0 @@
" Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee
autocmd BufNewFile,BufRead *._coffee set filetype=coffee
function! s:DetectCoffee()
if getline(1) =~ '^#!.*\<coffee\>'
set filetype=coffee
endif
endfunction
autocmd BufNewFile,BufRead * call s:DetectCoffee()

View file

@ -1 +0,0 @@
autocmd BufNewFile,BufRead *.eco set filetype=eco

View file

@ -1,263 +0,0 @@
" Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal formatoptions-=t formatoptions+=croql
setlocal comments=:#
setlocal commentstring=#\ %s
setlocal omnifunc=javascriptcomplete#CompleteJS
" Enable CoffeeMake if it won't overwrite any settings.
if !len(&l:makeprg)
compiler coffee
endif
" Check here too in case the compiler above isn't loaded.
if !exists('coffee_compiler')
let coffee_compiler = 'coffee'
endif
" Path to coffeelint executable
if !exists('coffee_linter')
let coffee_linter = 'coffeelint'
endif
" Options passed to CoffeeLint
if !exists('coffee_lint_options')
let coffee_lint_options = ''
endif
" Reset the CoffeeCompile variables for the current buffer.
function! s:CoffeeCompileResetVars()
" Compiled output buffer
let b:coffee_compile_buf = -1
let b:coffee_compile_pos = []
" If CoffeeCompile is watching a buffer
let b:coffee_compile_watch = 0
endfunction
" Clean things up in the source buffer.
function! s:CoffeeCompileClose()
exec bufwinnr(b:coffee_compile_src_buf) 'wincmd w'
silent! autocmd! CoffeeCompileAuWatch * <buffer>
call s:CoffeeCompileResetVars()
endfunction
" Update the CoffeeCompile buffer given some input lines.
function! s:CoffeeCompileUpdate(startline, endline)
let input = join(getline(a:startline, a:endline), "\n")
" Move to the CoffeeCompile buffer.
exec bufwinnr(b:coffee_compile_buf) 'wincmd w'
" Coffee doesn't like empty input.
if !len(input)
return
endif
" Compile input.
let output = system(g:coffee_compiler . ' -scb 2>&1', input)
" Be sure we're in the CoffeeCompile buffer before overwriting.
if exists('b:coffee_compile_buf')
echoerr 'CoffeeCompile buffers are messed up'
return
endif
" Replace buffer contents with new output and delete the last empty line.
setlocal modifiable
exec '% delete _'
put! =output
exec '$ delete _'
setlocal nomodifiable
" Highlight as JavaScript if there is no compile error.
if v:shell_error
setlocal filetype=
else
setlocal filetype=javascript
endif
call setpos('.', b:coffee_compile_pos)
endfunction
" Update the CoffeeCompile buffer with the whole source buffer.
function! s:CoffeeCompileWatchUpdate()
call s:CoffeeCompileUpdate(1, '$')
exec bufwinnr(b:coffee_compile_src_buf) 'wincmd w'
endfunction
" Peek at compiled CoffeeScript in a scratch buffer. We handle ranges like this
" to prevent the cursor from being moved (and its position saved) before the
" function is called.
function! s:CoffeeCompile(startline, endline, args)
if !executable(g:coffee_compiler)
echoerr "Can't find CoffeeScript compiler `" . g:coffee_compiler . "`"
return
endif
" If in the CoffeeCompile buffer, switch back to the source buffer and
" continue.
if !exists('b:coffee_compile_buf')
exec bufwinnr(b:coffee_compile_src_buf) 'wincmd w'
endif
" Parse arguments.
let watch = a:args =~ '\<watch\>'
let unwatch = a:args =~ '\<unwatch\>'
let size = str2nr(matchstr(a:args, '\<\d\+\>'))
" Determine default split direction.
if exists('g:coffee_compile_vert')
let vert = 1
else
let vert = a:args =~ '\<vert\%[ical]\>'
endif
" Remove any watch listeners.
silent! autocmd! CoffeeCompileAuWatch * <buffer>
" If just unwatching, don't compile.
if unwatch
let b:coffee_compile_watch = 0
return
endif
if watch
let b:coffee_compile_watch = 1
endif
" Build the CoffeeCompile buffer if it doesn't exist.
if bufwinnr(b:coffee_compile_buf) == -1
let src_buf = bufnr('%')
let src_win = bufwinnr(src_buf)
" Create the new window and resize it.
if vert
let width = size ? size : winwidth(src_win) / 2
belowright vertical new
exec 'vertical resize' width
else
" Try to guess the compiled output's height.
let height = size ? size : min([winheight(src_win) / 2,
\ a:endline - a:startline + 2])
belowright new
exec 'resize' height
endif
" We're now in the scratch buffer, so set it up.
setlocal bufhidden=wipe buftype=nofile
setlocal nobuflisted nomodifiable noswapfile nowrap
autocmd BufWipeout <buffer> call s:CoffeeCompileClose()
" Save the cursor when leaving the CoffeeCompile buffer.
autocmd BufLeave <buffer> let b:coffee_compile_pos = getpos('.')
nnoremap <buffer> <silent> q :hide<CR>
let b:coffee_compile_src_buf = src_buf
let buf = bufnr('%')
" Go back to the source buffer and set it up.
exec bufwinnr(b:coffee_compile_src_buf) 'wincmd w'
let b:coffee_compile_buf = buf
endif
if b:coffee_compile_watch
call s:CoffeeCompileWatchUpdate()
augroup CoffeeCompileAuWatch
autocmd InsertLeave <buffer> call s:CoffeeCompileWatchUpdate()
augroup END
else
call s:CoffeeCompileUpdate(a:startline, a:endline)
endif
endfunction
" Complete arguments for the CoffeeCompile command.
function! s:CoffeeCompileComplete(arg, cmdline, cursor)
let args = ['unwatch', 'vertical', 'watch']
if !len(a:arg)
return args
endif
let match = '^' . a:arg
for arg in args
if arg =~ match
return [arg]
endif
endfor
endfunction
" Run coffeelint on a file, and add any errors between @startline and @endline
" to the quickfix list.
function! s:CoffeeLint(startline, endline, bang, args)
if !executable(g:coffee_linter)
echoerr "Can't find CoffeeScript linter `" . g:coffee_linter . "`"
return
endif
let filename = expand('%')
if !len(filename)
echoerr 'CoffeeLint must be ran on a saved file'
return
endif
let lines = split(system(g:coffee_linter . ' --csv ' . g:coffee_lint_options .
\ ' ' . a:args . ' ' . filename . ' 2>&1'), '\n')
let qflist = []
for line in lines
let match = matchlist(line, '\f\+,\(\d\+\),error,\(.\+\)')
" Ignore invalid lines.
if !len(match)
continue
endif
let lnum = str2nr(match[1])
" Don't add the error if it's not in the range.
if lnum < a:startline || lnum > a:endline
continue
endif
let text = match[2]
call add(qflist, {'bufnr': bufnr('%'), 'lnum': lnum, 'text': text})
endfor
call setqflist(qflist, 'r')
" Don't jump if there's a bang.
if !len(a:bang)
silent! cc 1
endif
endfunction
" Don't overwrite the CoffeeCompile variables.
if !exists('b:coffee_compile_buf')
call s:CoffeeCompileResetVars()
endif
" Peek at compiled CoffeeScript.
command! -range=% -bar -nargs=* -complete=customlist,s:CoffeeCompileComplete
\ CoffeeCompile call s:CoffeeCompile(<line1>, <line2>, <q-args>)
" Run some CoffeeScript.
command! -range=% -bar CoffeeRun <line1>,<line2>:w !coffee -s
" Run coffeelint on the file.
command! -range=% -bang -bar -nargs=* CoffeeLint
\ call s:CoffeeLint(<line1>, <line2>, '<bang>', <q-args>)

View file

@ -1,351 +0,0 @@
" Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal autoindent
setlocal indentexpr=GetCoffeeIndent(v:lnum)
" Make sure GetCoffeeIndent is run when these are typed so they can be
" indented or outdented.
setlocal indentkeys+=0],0),0.,=else,=when,=catch,=finally
" Only define the function once.
if exists("*GetCoffeeIndent")
finish
endif
" Keywords to indent after
let s:INDENT_AFTER_KEYWORD = '^\%(if\|unless\|else\|for\|while\|until\|'
\ . 'loop\|switch\|when\|try\|catch\|finally\|'
\ . 'class\)\>'
" Operators to indent after
let s:INDENT_AFTER_OPERATOR = '\%([([{:=]\|[-=]>\)$'
" Keywords and operators that continue a line
let s:CONTINUATION = '\<\%(is\|isnt\|and\|or\)\>$'
\ . '\|'
\ . '\%(-\@<!-\|+\@<!+\|<\|[-=]\@<!>\|\*\|/\@<!/\|%\||\|'
\ . '&\|,\|\.\@<!\.\)$'
" Operators that block continuation indenting
let s:CONTINUATION_BLOCK = '[([{:=]$'
" A continuation dot access
let s:DOT_ACCESS = '^\.'
" Keywords to outdent after
let s:OUTDENT_AFTER = '^\%(return\|break\|continue\|throw\)\>'
" A compound assignment like `... = if ...`
let s:COMPOUND_ASSIGNMENT = '[:=]\s*\%(if\|unless\|for\|while\|until\|'
\ . 'switch\|try\|class\)\>'
" A postfix condition like `return ... if ...`.
let s:POSTFIX_CONDITION = '\S\s\+\zs\<\%(if\|unless\)\>'
" A single line else statement like `else ...` but not `else if ...`
let s:SINGLE_LINE_ELSE = '^else\s\+\%(\<\%(if\|unless\)\>\)\@!'
" Max lines to look back for a match
let s:MAX_LOOKBACK = 50
" Syntax names for strings
let s:SYNTAX_STRING = 'coffee\%(String\|AssignString\|Embed\|Regex\|Heregex\|'
\ . 'Heredoc\)'
" Syntax names for comments
let s:SYNTAX_COMMENT = 'coffee\%(Comment\|BlockComment\|HeregexComment\)'
" Syntax names for strings and comments
let s:SYNTAX_STRING_COMMENT = s:SYNTAX_STRING . '\|' . s:SYNTAX_COMMENT
" Get the linked syntax name of a character.
function! s:SyntaxName(linenum, col)
return synIDattr(synID(a:linenum, a:col, 1), 'name')
endfunction
" Check if a character is in a comment.
function! s:IsComment(linenum, col)
return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_COMMENT
endfunction
" Check if a character is in a string.
function! s:IsString(linenum, col)
return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_STRING
endfunction
" Check if a character is in a comment or string.
function! s:IsCommentOrString(linenum, col)
return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_STRING_COMMENT
endfunction
" Check if a whole line is a comment.
function! s:IsCommentLine(linenum)
" Check the first non-whitespace character.
return s:IsComment(a:linenum, indent(a:linenum) + 1)
endfunction
" Search a line for a regex until one is found outside a string or comment.
function! s:SmartSearch(linenum, regex)
" Start at the first column.
let col = 0
" Search until there are no more matches, unless a good match is found.
while 1
call cursor(a:linenum, col + 1)
let [_, col] = searchpos(a:regex, 'cn', a:linenum)
" No more matches.
if !col
break
endif
if !s:IsCommentOrString(a:linenum, col)
return 1
endif
endwhile
" No good match found.
return 0
endfunction
" Check if a match should be skipped.
function! s:ShouldSkip(startlinenum, linenum, col)
" Skip if in a comment or string.
if s:IsCommentOrString(a:linenum, a:col)
return 1
endif
" Skip if a single line statement that isn't adjacent.
if s:SmartSearch(a:linenum, '\<then\>') && a:startlinenum - a:linenum > 1
return 1
endif
" Skip if a postfix condition.
if s:SmartSearch(a:linenum, s:POSTFIX_CONDITION) &&
\ !s:SmartSearch(a:linenum, s:COMPOUND_ASSIGNMENT)
return 1
endif
return 0
endfunction
" Find the farthest line to look back to, capped to line 1 (zero and negative
" numbers cause bad things).
function! s:MaxLookback(startlinenum)
return max([1, a:startlinenum - s:MAX_LOOKBACK])
endfunction
" Get the skip expression for searchpair().
function! s:SkipExpr(startlinenum)
return "s:ShouldSkip(" . a:startlinenum . ", line('.'), col('.'))"
endfunction
" Search for pairs of text.
function! s:SearchPair(start, end)
" The cursor must be in the first column for regexes to match.
call cursor(0, 1)
let startlinenum = line('.')
" Don't need the W flag since MaxLookback caps the search to line 1.
return searchpair(a:start, '', a:end, 'bcn',
\ s:SkipExpr(startlinenum),
\ s:MaxLookback(startlinenum))
endfunction
" Try to find a previous matching line.
function! s:GetMatch(curline)
let firstchar = a:curline[0]
if firstchar == '}'
return s:SearchPair('{', '}')
elseif firstchar == ')'
return s:SearchPair('(', ')')
elseif firstchar == ']'
return s:SearchPair('\[', '\]')
elseif a:curline =~ '^else\>'
return s:SearchPair('\<\%(if\|unless\|when\)\>', '\<else\>')
elseif a:curline =~ '^catch\>'
return s:SearchPair('\<try\>', '\<catch\>')
elseif a:curline =~ '^finally\>'
return s:SearchPair('\<try\>', '\<finally\>')
endif
return 0
endfunction
" Get the nearest previous line that isn't a comment.
function! s:GetPrevNormalLine(startlinenum)
let curlinenum = a:startlinenum
while curlinenum
let curlinenum = prevnonblank(curlinenum - 1)
if !s:IsCommentLine(curlinenum)
return curlinenum
endif
endwhile
return 0
endfunction
" Try to find a comment in a line.
function! s:FindComment(linenum)
call cursor(a:linenum, 0)
" Current column
let cur = 0
" Last column in the line
let end = col('$') - 1
while cur != end
call cursor(0, cur + 1)
let [_, cur] = searchpos('#', 'cn', a:linenum)
if !cur
break
endif
if s:IsComment(a:linenum, cur)
return cur
endif
endwhile
return 0
endfunction
" Get a line without comments or surrounding whitespace.
function! s:GetTrimmedLine(linenum)
let comment = s:FindComment(a:linenum)
let line = getline(a:linenum)
if comment
" Subtract 1 to get to the column before the comment and another 1 for
" zero-based indexing.
let line = line[:comment - 2]
endif
return substitute(substitute(line, '^\s\+', '', ''),
\ '\s\+$', '', '')
endfunction
function! GetCoffeeIndent(curlinenum)
" Don't do anything if on the first line.
if a:curlinenum == 1
return -1
endif
let prevlinenum = a:curlinenum - 1
" If continuing a comment, keep the indent level.
if s:IsCommentLine(prevlinenum)
return indent(prevlinenum)
endif
let prevlinenum = s:GetPrevNormalLine(a:curlinenum)
" Don't do anything if there's no code before.
if !prevlinenum
return -1
endif
" Indent based on the current line.
let curline = s:GetTrimmedLine(a:curlinenum)
" Try to find a matching statement. This handles outdenting.
let matchlinenum = s:GetMatch(curline)
if matchlinenum
return indent(matchlinenum)
endif
" Try to find a matching when.
if curline =~ '^when\>' && !s:SmartSearch(prevlinenum, '\<switch\>')
let linenum = a:curlinenum
while linenum
let linenum = s:GetPrevNormalLine(linenum)
if getline(linenum) =~ '^\s*when\>'
return indent(linenum)
endif
endwhile
return -1
endif
" Indent based on the previous line.
let prevline = s:GetTrimmedLine(prevlinenum)
let previndent = indent(prevlinenum)
" Always indent after these operators.
if prevline =~ s:INDENT_AFTER_OPERATOR
return previndent + &shiftwidth
endif
" Indent after a continuation if it's the first.
if prevline =~ s:CONTINUATION
" If the line ends in a slash, make sure it isn't a regex.
if prevline =~ '/$'
" Move to the line so we can get the last column.
call cursor(prevlinenum)
if s:IsString(prevlinenum, col('$') - 1)
return -1
endif
endif
let prevprevlinenum = s:GetPrevNormalLine(prevlinenum)
" If the continuation is the first in the file, there can't be others before
" it.
if !prevprevlinenum
return previndent + &shiftwidth
endif
let prevprevline = s:GetTrimmedLine(prevprevlinenum)
" Only indent after the first continuation.
if prevprevline !~ s:CONTINUATION && prevprevline !~ s:CONTINUATION_BLOCK
return previndent + &shiftwidth
endif
return -1
endif
" Indent after these keywords and compound assignments if they aren't a
" single line statement.
if prevline =~ s:INDENT_AFTER_KEYWORD || prevline =~ s:COMPOUND_ASSIGNMENT
if !s:SmartSearch(prevlinenum, '\<then\>') && prevline !~ s:SINGLE_LINE_ELSE
return previndent + &shiftwidth
endif
return -1
endif
" Indent a dot access if it's the first.
if curline =~ s:DOT_ACCESS && prevline !~ s:DOT_ACCESS
return previndent + &shiftwidth
endif
" Outdent after these keywords if they don't have a postfix condition or are
" a single-line statement.
if prevline =~ s:OUTDENT_AFTER
if !s:SmartSearch(prevlinenum, s:POSTFIX_CONDITION) ||
\ s:SmartSearch(prevlinenum, '\<then\>')
return previndent - &shiftwidth
endif
endif
" If no indent or outdent is needed, keep the indent level of the previous
" line.
return previndent
endfunction

View file

@ -1,221 +0,0 @@
" Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
" Bail if our syntax is already loaded.
if exists('b:current_syntax') && b:current_syntax == 'coffee'
finish
endif
" Include JavaScript for coffeeEmbed.
syn include @coffeeJS syntax/javascript.vim
" Highlight long strings.
syn sync minlines=100
" CoffeeScript identifiers can have dollar signs.
setlocal isident+=$
" These are `matches` instead of `keywords` because vim's highlighting
" priority for keywords is higher than matches. This causes keywords to be
" highlighted inside matches, even if a match says it shouldn't contain them --
" like with coffeeAssign and coffeeDot.
syn match coffeeStatement /\<\%(return\|break\|continue\|throw\)\>/ display
hi def link coffeeStatement Statement
syn match coffeeRepeat /\<\%(for\|while\|until\|loop\)\>/ display
hi def link coffeeRepeat Repeat
syn match coffeeConditional /\<\%(if\|else\|unless\|switch\|when\|then\)\>/
\ display
hi def link coffeeConditional Conditional
syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display
hi def link coffeeException Exception
syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\)\>/
\ display
" The `own` keyword is only a keyword after `for`.
syn match coffeeKeyword /\<for\s\+own\>/ contained containedin=coffeeRepeat
\ display
hi def link coffeeKeyword Keyword
syn match coffeeOperator /\<\%(instanceof\|typeof\|delete\)\>/ display
hi def link coffeeOperator Operator
" The first case matches symbol operators only if they have an operand before.
syn match coffeeExtendedOp /\%(\S\s*\)\@<=[+\-*/%&|\^=!<>?.]\{-1,}\|[-=]>\|--\|++\|:/
\ display
syn match coffeeExtendedOp /\<\%(and\|or\)=/ display
hi def link coffeeExtendedOp coffeeOperator
" This is separate from `coffeeExtendedOp` to help differentiate commas from
" dots.
syn match coffeeSpecialOp /[,;]/ display
hi def link coffeeSpecialOp SpecialChar
syn match coffeeBoolean /\<\%(true\|on\|yes\|false\|off\|no\)\>/ display
hi def link coffeeBoolean Boolean
syn match coffeeGlobal /\<\%(null\|undefined\)\>/ display
hi def link coffeeGlobal Type
" A special variable
syn match coffeeSpecialVar /\<\%(this\|prototype\|arguments\)\>/ display
hi def link coffeeSpecialVar Special
" An @-variable
syn match coffeeSpecialIdent /@\%(\I\i*\)\?/ display
hi def link coffeeSpecialIdent Identifier
" A class-like name that starts with a capital letter
syn match coffeeObject /\<\u\w*\>/ display
hi def link coffeeObject Structure
" A constant-like name in SCREAMING_CAPS
syn match coffeeConstant /\<\u[A-Z0-9_]\+\>/ display
hi def link coffeeConstant Constant
" A variable name
syn cluster coffeeIdentifier contains=coffeeSpecialVar,coffeeSpecialIdent,
\ coffeeObject,coffeeConstant
" A non-interpolated string
syn cluster coffeeBasicString contains=@Spell,coffeeEscape
" An interpolated string
syn cluster coffeeInterpString contains=@coffeeBasicString,coffeeInterp
" Regular strings
syn region coffeeString start=/"/ skip=/\\\\\|\\"/ end=/"/
\ contains=@coffeeInterpString
syn region coffeeString start=/'/ skip=/\\\\\|\\'/ end=/'/
\ contains=@coffeeBasicString
hi def link coffeeString String
" A integer, including a leading plus or minus
syn match coffeeNumber /\i\@<![-+]\?\d\+\%([eE][+-]\?\d\+\)\?/ display
" A hex, binary, or octal number
syn match coffeeNumber /\<0[xX]\x\+\>/ display
syn match coffeeNumber /\<0[bB][01]\+\>/ display
syn match coffeeNumber /\<0[oO][0-7]\+\>/ display
hi def link coffeeNumber Number
" A floating-point number, including a leading plus or minus
syn match coffeeFloat /\i\@<![-+]\?\d*\.\@<!\.\d\+\%([eE][+-]\?\d\+\)\?/
\ display
hi def link coffeeFloat Float
" An error for reserved keywords
if !exists("coffee_no_reserved_words_error")
syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\|implements\|interface\|let\|package\|private\|protected\|public\|static\|yield\)\>/
\ display
hi def link coffeeReservedError Error
endif
" A normal object assignment
syn match coffeeObjAssign /@\?\I\i*\s*\ze::\@!/ contains=@coffeeIdentifier display
hi def link coffeeObjAssign Identifier
syn keyword coffeeTodo TODO FIXME XXX contained
hi def link coffeeTodo Todo
syn match coffeeComment /#.*/ contains=@Spell,coffeeTodo
hi def link coffeeComment Comment
syn region coffeeBlockComment start=/####\@!/ end=/###/
\ contains=@Spell,coffeeTodo
hi def link coffeeBlockComment coffeeComment
" A comment in a heregex
syn region coffeeHeregexComment start=/#/ end=/\ze\/\/\/\|$/ contained
\ contains=@Spell,coffeeTodo
hi def link coffeeHeregexComment coffeeComment
" Embedded JavaScript
syn region coffeeEmbed matchgroup=coffeeEmbedDelim
\ start=/`/ skip=/\\\\\|\\`/ end=/`/
\ contains=@coffeeJS
hi def link coffeeEmbedDelim Delimiter
syn region coffeeInterp matchgroup=coffeeInterpDelim start=/#{/ end=/}/ contained
\ contains=@coffeeAll
hi def link coffeeInterpDelim PreProc
" A string escape sequence
syn match coffeeEscape /\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\./ contained display
hi def link coffeeEscape SpecialChar
" A regex -- must not follow a parenthesis, number, or identifier, and must not
" be followed by a number
syn region coffeeRegex start=/\%(\%()\|\i\@<!\d\)\s*\|\i\)\@<!\/=\@!\s\@!/
\ skip=/\[[^\]]\{-}\/[^\]]\{-}\]/
\ end=/\/[gimy]\{,4}\d\@!/
\ oneline contains=@coffeeBasicString
hi def link coffeeRegex String
" A heregex
syn region coffeeHeregex start=/\/\/\// end=/\/\/\/[gimy]\{,4}/
\ contains=@coffeeInterpString,coffeeHeregexComment
\ fold
hi def link coffeeHeregex coffeeRegex
" Heredoc strings
syn region coffeeHeredoc start=/"""/ end=/"""/ contains=@coffeeInterpString
\ fold
syn region coffeeHeredoc start=/'''/ end=/'''/ contains=@coffeeBasicString
\ fold
hi def link coffeeHeredoc String
" An error for trailing whitespace, as long as the line isn't just whitespace
if !exists("coffee_no_trailing_space_error")
syn match coffeeSpaceError /\S\@<=\s\+$/ display
hi def link coffeeSpaceError Error
endif
" An error for trailing semicolons, for help transitioning from JavaScript
if !exists("coffee_no_trailing_semicolon_error")
syn match coffeeSemicolonError /;$/ display
hi def link coffeeSemicolonError Error
endif
" Ignore reserved words in dot accesses.
syn match coffeeDotAccess /\.\@<!\.\s*\I\i*/he=s+1 contains=@coffeeIdentifier
hi def link coffeeDotAccess coffeeExtendedOp
" Ignore reserved words in prototype accesses.
syn match coffeeProtoAccess /::\s*\I\i*/he=s+2 contains=@coffeeIdentifier
hi def link coffeeProtoAccess coffeeExtendedOp
" This is required for interpolations to work.
syn region coffeeCurlies matchgroup=coffeeCurly start=/{/ end=/}/
\ contains=@coffeeAll
syn region coffeeBrackets matchgroup=coffeeBracket start=/\[/ end=/\]/
\ contains=@coffeeAll
syn region coffeeParens matchgroup=coffeeParen start=/(/ end=/)/
\ contains=@coffeeAll
" These are highlighted the same as commas since they tend to go together.
hi def link coffeeBlock coffeeSpecialOp
hi def link coffeeBracket coffeeBlock
hi def link coffeeCurly coffeeBlock
hi def link coffeeParen coffeeBlock
" This is used instead of TOP to keep things coffee-specific for good
" embedding. `contained` groups aren't included.
syn cluster coffeeAll contains=coffeeStatement,coffeeRepeat,coffeeConditional,
\ coffeeException,coffeeKeyword,coffeeOperator,
\ coffeeExtendedOp,coffeeSpecialOp,coffeeBoolean,
\ coffeeGlobal,coffeeSpecialVar,coffeeSpecialIdent,
\ coffeeObject,coffeeConstant,coffeeString,
\ coffeeNumber,coffeeFloat,coffeeReservedError,
\ coffeeObjAssign,coffeeComment,coffeeBlockComment,
\ coffeeEmbed,coffeeRegex,coffeeHeregex,
\ coffeeHeredoc,coffeeSpaceError,
\ coffeeSemicolonError,coffeeDotAccess,
\ coffeeProtoAccess,coffeeCurlies,coffeeBrackets,
\ coffeeParens
if !exists('b:current_syntax')
let b:current_syntax = 'coffee'
endif

View file

@ -1,62 +0,0 @@
" Vim syntax file
" Language: eco
" Maintainer: Jay Adkisson
" Mostly stolen from eruby.vim
if !exists("g:eco_default_subtype")
let g:eco_default_subtype = "html"
endif
if !exists("b:eco_subtype")
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
let b:eco_subtype = matchstr(s:lines,'eco_subtype=\zs\w\+')
if b:eco_subtype == ''
let b:eco_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eco\)\+$','',''),'\.\zs\w\+$')
endif
if b:eco_subtype == 'rhtml'
let b:eco_subtype = 'html'
elseif b:eco_subtype == 'jst'
let b:eco_subtype = 'html'
elseif b:eco_subtype == 'rb'
let b:eco_subtype = 'ruby'
elseif b:eco_subtype == 'yml'
let b:eco_subtype = 'yaml'
elseif b:eco_subtype == 'js' || b:eco_subtype == 'json'
let b:eco_subtype = 'javascript'
elseif b:eco_subtype == 'txt'
" Conventional; not a real file type
let b:eco_subtype = 'text'
elseif b:eco_subtype == ''
if exists('b:current_syntax') && b:current_syntax != ''
let b:eco_subtype = b:current_syntax
else
let b:eco_subtype = g:eco_default_subtype
endif
endif
endif
if exists("b:eco_subtype") && b:eco_subtype != '' && b:eco_subtype != 'eco'
exec "runtime! syntax/".b:eco_subtype.".vim"
syn include @coffeeTop syntax/coffee.vim
endif
syn cluster ecoRegions contains=ecoBlock,ecoExpression,ecoComment
syn region ecoBlock matchgroup=ecoDelimiter start=/<%/ end=/%>/ contains=@coffeeTop containedin=ALLBUT,@ecoRegions keepend
syn region ecoExpression matchgroup=ecoDelimiter start=/<%[=\-]/ end=/%>/ contains=@coffeeTop containedin=ALLBUT,@ecoRegions keepend
syn region ecoComment matchgroup=ecoComment start=/<%#/ end=/%>/ contains=@coffeeTodo,@Spell containedin=ALLBUT,@ecoRegions keepend
" eco features not in coffeescript proper
syn keyword ecoEnd end containedin=@ecoRegions
syn match ecoIndentColon /\s+\w+:/ containedin=@ecoRegions
" Define the default highlighting.
hi def link ecoDelimiter Delimiter
hi def link ecoComment Comment
hi def link ecoEnd coffeeConditional
hi def link ecoIndentColon None
let b:current_syntax = 'eco'
" vim: nowrap sw=2 sts=2 ts=8:

View file

@ -1,12 +0,0 @@
<html>
<%# comment %>
<%# basic %>
<%- foo = "1" %>
<%# interpolation %>
<%= " == #{ ( -> "LOL" )() } == " %>
<%# interpolation with nested curlies %>
<%= " == #{ { a: 1, b: { c: 3, d: 4 } } } == " %>
</html>

View file

@ -1,3 +0,0 @@
# Nested curlies
" >> #{ == { { { } } } == } << "
" >> #{ == { abc: { def: 42 } } == } << "

View file

@ -1,90 +0,0 @@
# Various operators
abc instanceof def
typeof abc
delete abc
abc::def
abc + def
abc - def
abc * def
abc / def
abc % def
abc & def
abc | def
abc ^ def
abc >> def
abc << def
abc >>> def
abc ? def
abc && def
abc and def
abc || def
abc or def
abc += def
abc -= def
abc *= def
abc /= def
abc %= def
abc &= def
abc |= def
abc ^= def
abc >>= def
abc <<= def
abc >>>= def
abc ?= def
abc &&= def
abc ||= def
abc and= def
abc or= def
abc.def.ghi
abc?.def?.ghi
abc < def
abc > def
abc = def
abc == def
abc != def
abc <= def
abc >= def
abc++
abc--
++abc
--abc
# Nested operators
abc[def] = ghi
abc[def[ghi: jkl]] = 42
@abc[def] = ghi
abc["#{def = 42}"] = 42
abc["#{def.ghi = 42}"] = 42
abc["#{def[ghi] = 42}"] = 42
abc["#{def['ghi']}"] = 42
# Object assignments
abc =
def: 123
DEF: 123
@def: 123
Def: 123
'def': 123
42: 123
# Operators shouldn't be highlighted
vector=
wand=
abc+++
abc---
abc ** def
abc &&& def
abc ^^ def
abc ===== def
abc <==== def
abc >==== def
abc +== def
abc =^= def

View file

@ -1,27 +0,0 @@
# Should be an error
function = 42
var = 42
# Shouldn't be an error
abc.with = 42
function: 42
var: 42
# Keywords shouldn't be highlighted
abc.function
abc.do
abc.break
abc.true
abc::function
abc::do
abc::break
abc::true
abc:: function
abc. function
# Numbers should be highlighted
def.42
def .42
def::42

View file

@ -1,7 +0,0 @@
<head>
<script type="text/coffeescript">
abc = {
def: 42
}
</script>
</head>

View file

@ -0,0 +1,10 @@
expand-region-about expand_region.txt /*expand-region-about*
expand-region-contents expand_region.txt /*expand-region-contents*
expand-region-global-options expand_region.txt /*expand-region-global-options*
expand-region-intro expand_region.txt /*expand-region-intro*
expand-region-mappings expand_region.txt /*expand-region-mappings*
expand-region-usage expand_region.txt /*expand-region-usage*
expand_region_text_objects expand_region.txt /*expand_region_text_objects*
expand_region_use_select_mode expand_region.txt /*expand_region_use_select_mode*
vim-expand-region.txt expand_region.txt /*vim-expand-region.txt*
vim-expand-regions expand_region.txt /*vim-expand-regions*

View file

@ -1,2 +0,0 @@
tags

View file

@ -1,120 +0,0 @@
*indent-object.txt* Text objects based on indent levels.
Copyright (c) 2010 Michael Smith
Indent Text Objects
INTRODUCTION |idntobj-introduction|
TEXT OBJECTS |idntobj-objects|
BLANK LINES |idntobj-blanklines|
ABOUT |idntobj-about|
==============================================================================
INTRODUCTION *idntobj-introduction*
Vim text objects provide a convenient way to select and operate on various
types of objects. These objects include regions surrounded by various types of
brackets and various parts of language (ie sentences, paragraphs, etc).
This plugin defines a new text object, based on indentation levels. This is
very useful in languages such as Python, in which the syntax defines scope in
terms of indentation. Using the objects defined in this plugin, an entire if
structure can be quickly selected, for example.
==============================================================================
TEXT OBJECTS *ai* *ii* *aI* *iI* *idntobj-objects*
This plugin defines two new text objects. These are very similar - they differ
only in whether they include the line below the block or not.
Key Mapping Description ~
>
<count>ai (A)n (I)ndentation level and line above.
<count>ii (I)nner (I)ndentation level (no line above).
<count>aI (A)n (I)ndentation level and lines above/below.
<count>iI (I)nner (I)ndentation level (no lines above/below).
<
Note that the iI mapping is mostly included simply for completeness, it is
effectively a synonym for ii.
Just like regular text objects, these mappings can be used either with
operators expecting a motion, such as 'd' or 'c', as well as in visual mode.
In visual mode the mapping can be repeated, which has the effect of
iteratively increasing the scope of indentation block selected. Specifying a
count can be used to achieve the same effect.
The difference between |ai| and |aI| is that |ai| includes the line
immediately above the indentation block, whereas aI includes not only that,
but also the line below. Which of these is most useful largely depends on the
structure of the language being edited.
For example, when editing the Python code, |ai| is generally more useful, as
the line above the indentation block is usually related to it. For example, in
the following code (* is used to indicate the cursor position):
>
if foo > 3:
log("foo is big") *
foo = 3
do_something_else()
<
the if clause is logically related to the code block, whereas the function
call below is not. It is unlikely we would want to select the line below when
we are interested in the if block.
However, in other languages, such as Vim scripts, control structures are
usually terminated with something like 'endif'. Therefore, in this example:
>
if foo > 3
echo "foo is big" *
let foo = 3
endif
call do_something_else()
<
we would more likely want to include the endif when we select the if
structure.
==============================================================================
BLANK LINES *idntobj-blanklines*
When scanning code blocks, the plugin usually ignores blank lines. There is an
exception to this, however, when the block being selected is not indented. In
this case if blank lines are ignored, then the entire file would be selected.
Instead when code at the top level is being indented blank lines are
considered to delimit the block.
==============================================================================
ABOUT *idntobj-about*
vim-indent-object was written by Michael Smith <msmith@msmith.id.au>. The
project repository is kept at:
http://github.com/michaeljsmith/vim-indent-object
Any feedback or criticism is welcome, and can be mailed to the author at the
above email address. Alternatively issues can be raised on the project
website.
Licence:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

View file

@ -1,224 +0,0 @@
"--------------------------------------------------------------------------------
"
" Copyright (c) 2010 Michael Smith <msmith@msmith.id.au>
"
" http://github.com/michaeljsmith/vim-indent-object
"
" Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to
" deal in the Software without restriction, including without limitation the
" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
" sell copies of the Software, and to permit persons to whom the Software is
" furnished to do so, subject to the following conditions:
"
" The above copyright notice and this permission notice shall be included in
" all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
" IN THE SOFTWARE.
"
"--------------------------------------------------------------------------------
" Mappings excluding line below.
onoremap <silent>ai :<C-u>cal <Sid>HandleTextObjectMapping(0, 0, 0, [line("."), line("."), col("."), col(".")])<CR>
onoremap <silent>ii :<C-u>cal <Sid>HandleTextObjectMapping(1, 0, 0, [line("."), line("."), col("."), col(".")])<CR>
vnoremap <silent>ai :<C-u>cal <Sid>HandleTextObjectMapping(0, 0, 1, [line("'<"), line("'>"), col("'<"), col("'>")])<CR><Esc>gv
vnoremap <silent>ii :<C-u>cal <Sid>HandleTextObjectMapping(1, 0, 1, [line("'<"), line("'>"), col("'<"), col("'>")])<CR><Esc>gv
" Mappings including line below.
onoremap <silent>aI :<C-u>cal <Sid>HandleTextObjectMapping(0, 1, 0, [line("."), line("."), col("."), col(".")])<CR>
onoremap <silent>iI :<C-u>cal <Sid>HandleTextObjectMapping(1, 1, 0, [line("."), line("."), col("."), col(".")])<CR>
vnoremap <silent>aI :<C-u>cal <Sid>HandleTextObjectMapping(0, 1, 1, [line("'<"), line("'>"), col("'<"), col("'>")])<CR><Esc>gv
vnoremap <silent>iI :<C-u>cal <Sid>HandleTextObjectMapping(1, 1, 1, [line("'<"), line("'>"), col("'<"), col("'>")])<CR><Esc>gv
let s:l0 = -1
let s:l1 = -1
let s:c0 = -1
let s:c1 = -1
function! <Sid>TextObject(inner, incbelow, vis, range, count)
" Record the current state of the visual region.
let vismode = "V"
" Detect if this is a completely new visual selction session.
let new_vis = 0
let new_vis = new_vis || s:l0 != a:range[0]
let new_vis = new_vis || s:l1 != a:range[1]
let new_vis = new_vis || s:c0 != a:range[2]
let new_vis = new_vis || s:c1 != a:range[3]
let s:l0 = a:range[0]
let s:l1 = a:range[1]
let s:c0 = a:range[2]
let s:c1 = a:range[3]
" Repeatedly increase the scope of the selection.
let itr_cnt = 0
let cnt = a:count
while cnt > 0
" Look for the minimum indentation in the current visual region.
let l = s:l0
let idnt_invalid = 1000
let idnt = idnt_invalid
while l <= s:l1
if !(getline(l) =~ "^\\s*$")
let idnt = min([idnt, indent(l)])
endif
let l += 1
endwhile
" Keep track of where the range should be expanded to.
let l_1 = s:l0
let l_1o = l_1
let l2 = s:l1
let l2o = l2
" If we are highlighting only blank lines, we may not have found a
" valid indent. In this case we need to look for the next and previous
" non blank lines and check which of those has the largest indent.
if idnt == idnt_invalid
let idnt = 0
let pnb = prevnonblank(s:l0)
if pnb
let idnt = max([idnt, indent(pnb)])
let l_1 = pnb
endif
let nnb = nextnonblank(s:l0)
if nnb
let idnt = max([idnt, indent(nnb)])
endif
" If we are in whitespace at the beginning of a block, skip over
" it when we are selecting the range. Similarly, if we are in
" whitespace at the end, ignore it.
if idnt > indent(pnb)
let l_1 = nnb
endif
if idnt > indent(nnb)
let l2 = pnb
endif
endif
" Search backward for the first line with less indent than the target
" indent (skipping blank lines).
let blnk = getline(l_1) =~ "^\\s*$"
while l_1 > 0 && ((idnt == 0 && !blnk) || (idnt != 0 && (blnk || indent(l_1) >= idnt)))
if !blnk || !a:inner
let l_1o = l_1
endif
let l_1 -= 1
let blnk = getline(l_1) =~ "^\\s*$"
endwhile
" Search forward for the first line with more indent than the target
" indent (skipping blank lines).
let line_cnt = line("$")
let blnk = getline(l2) =~ "^\\s*$"
while l2 <= line_cnt && ((idnt == 0 && !blnk) || (idnt != 0 && (blnk || indent(l2) >= idnt)))
if !blnk || !a:inner
let l2o = l2
endif
let l2 += 1
let blnk = getline(l2) =~ "^\\s*$"
endwhile
" Determine which of these extensions to include. Include neither if
" we are selecting an 'inner' object. Exclude the bottom unless are
" told to include it.
let idnt2 = max([indent(l_1), indent(l2)])
if indent(l_1) < idnt2 || a:inner
let l_1 = l_1o
endif
if indent(l2) < idnt2 || a:inner || !a:incbelow
let l2 = l2o
endif
let l_1 = max([l_1, 1])
let l2 = min([l2, line("$")])
" Extend the columns to the start and end.
" If inner is selected, set the final cursor pos to the start
" of the text in the line.
let c_1 = 1
if a:inner
let c_1 = match(getline(l_1), "\\c\\S") + 1
endif
let c2 = len(getline(l2))
if !a:inner
let c2 += 1
endif
" Make sure there's no change if we haven't really made a
" significant change in linewise mode - this makes sure that
" we can iteratively increase selection in linewise mode.
if itr_cnt == 0 && vismode ==# 'V' && s:l0 == l_1 && s:l1 == l2
let c_1 = s:c0
let c2 = s:c1
endif
" Check whether the visual region has changed.
let chg = 0
let chg = chg || s:l0 != l_1
let chg = chg || s:l1 != l2
let chg = chg || s:c0 != c_1
let chg = chg || s:c1 != c2
if vismode ==# 'V' && new_vis
let chg = 1
endif
" Update the vars.
let s:l0 = l_1
let s:l1 = l2
let s:c0 = c_1
let s:c1 = c2
" If there was no change, then don't decrement the count (it didn't
" count because it didn't do anything).
if chg
let cnt = cnt - 1
else
" Since this didn't work, push the selection back one char. This
" will have the effect of getting the enclosing block. Do it at
" the beginning rather than the end - the beginning is very likely
" to be only one indentation level different.
if s:l0 == 0
return
endif
let s:l0 -= 1
let s:c0 = len(getline(s:l0))
endif
let itr_cnt += 1
endwhile
" Apply the range we have found. Make sure to use the current visual mode.
call cursor(s:l0, s:c0)
exe "normal! " . vismode
call cursor(s:l1, s:c1)
normal! o
" Update these static variables - we need to keep these up-to-date between
" invocations because it's the only way we can detect whether it's a new
" visual mode. We need to know if it's a new visual mode because otherwise
" if there's a single line block in visual line mode and we select it with
" "V", we can't tell whether it's already been selected using Vii.
exe "normal! \<Esc>"
let s:l0 = line("'<")
let s:l1 = line("'>")
let s:c0 = col("'<")
let s:c1 = col("'>")
normal gv
endfunction
function! <Sid>HandleTextObjectMapping(inner, incbelow, vis, range)
call <Sid>TextObject(a:inner, a:incbelow, a:vis, a:range, v:count1)
endfunction

View file

@ -0,0 +1,21 @@
MultipleCursorsFind multiple_cursors.txt /*MultipleCursorsFind*
g:multi_cursor_exit_from_insert_mode multiple_cursors.txt /*g:multi_cursor_exit_from_insert_mode*
g:multi_cursor_exit_from_visual_mode multiple_cursors.txt /*g:multi_cursor_exit_from_visual_mode*
g:multi_cursor_next_key multiple_cursors.txt /*g:multi_cursor_next_key*
g:multi_cursor_prev_key multiple_cursors.txt /*g:multi_cursor_prev_key*
g:multi_cursor_quit_key multiple_cursors.txt /*g:multi_cursor_quit_key*
g:multi_cursor_skip_key multiple_cursors.txt /*g:multi_cursor_skip_key*
g:multi_cursor_start_key multiple_cursors.txt /*g:multi_cursor_start_key*
g:multi_cursor_use_default_mapping multiple_cursors.txt /*g:multi_cursor_use_default_mapping*
multiple-cursors-contents multiple_cursors.txt /*multiple-cursors-contents*
multiple-cursors-contributing multiple_cursors.txt /*multiple-cursors-contributing*
multiple-cursors-credit multiple_cursors.txt /*multiple-cursors-credit*
multiple-cursors-global-options multiple_cursors.txt /*multiple-cursors-global-options*
multiple-cursors-intro multiple_cursors.txt /*multiple-cursors-intro*
multiple-cursors-issues multiple_cursors.txt /*multiple-cursors-issues*
multiple-cursors-license multiple_cursors.txt /*multiple-cursors-license*
multiple-cursors-mappings multiple_cursors.txt /*multiple-cursors-mappings*
multiple-cursors-references multiple_cursors.txt /*multiple-cursors-references*
multiple-cursors-usage multiple_cursors.txt /*multiple-cursors-usage*
vim-multiple-cursors multiple_cursors.txt /*vim-multiple-cursors*
vim-multiple-cursors.txt multiple_cursors.txt /*vim-multiple-cursors.txt*

View file

@ -0,0 +1,35 @@
vim-pep8 ![Project status](http://stillmaintained.com/nvie/vim-pep8.png)
========
Installation
------------
1. Install [pep8](http://pypi.python.org/pypi/pep8/)
2. Copy the file `ftplugin/python_pep8.vim` to your `~/.vim/ftplugin` directory
Usage
-----
1. Open a Python file
2. Press `<F6>` to run `pep8` on it
It shows the errors inside a quickfix window, which will allow your to quickly
jump to the error locations by simply pressing [Enter].
Customization
-------------
If you don't want to use the `<F6>` key for PEP8-checking, simply remap it to
another key. It autodetects whether it has been remapped and won't register
the `<F6>` key if so. For example, to remap it to `<F3>` instead, use:
autocmd FileType python map <buffer> <F3> :call Pep8()<CR>
Tips
----
This plugin goes well together with the following plugins:
- [PyFlakes](http://github.com/nvie/vim-pyflakes) (Python static syntax checker
under `<F7>`)
- [PyUnit](http://github.com/nvie/vim-pyunit) (unit test helper under `<F8>`
and `<F9>`)

View file

@ -0,0 +1,78 @@
"
" Python filetype plugin for running pep8
" Language: Python (ft=python)
" Maintainer: Vincent Driessen <vincent@datafox.nl>
" Version: Vim 7 (may work with lower Vim versions, but not tested)
" URL: http://github.com/nvie/vim-pep8
"
" Only do this when not done yet for this buffer
if exists("b:loaded_pep8_ftplugin")
finish
endif
let b:loaded_pep8_ftplugin = 1
if !exists("g:pep8_args")
let g:pep8_args = ""
endif
let s:pep8_cmd="pep8"
if !exists("*Pep8()")
function Pep8()
if !executable(s:pep8_cmd)
echoerr "File " . s:pep8_cmd . " not found. Please install it first."
return
endif
set lazyredraw " delay redrawing
cclose " close any existing cwindows
" store old grep settings (to restore later)
let l:old_gfm=&grepformat
let l:old_gp=&grepprg
" write any changes before continuing
if &readonly == 0
update
endif
" perform the grep itself
let &grepformat="%f:%l:%c: %m"
let &grepprg=s:pep8_cmd . " --repeat " . g:pep8_args
silent! grep! %
" restore grep settings
let &grepformat=l:old_gfm
let &grepprg=l:old_gp
" open cwindow
let has_results=getqflist() != []
if has_results
execute 'belowright copen'
setlocal wrap
nnoremap <buffer> <silent> c :cclose<CR>
nnoremap <buffer> <silent> q :cclose<CR>
endif
set nolazyredraw
redraw!
if has_results == 0
" Show OK status
hi Green ctermfg=green
echohl Green
echon "PEP8 safe"
echohl
endif
endfunction
endif
" Add mappings, unless the user didn't want this.
" The default mapping is registered under to <F6> by default, unless the user
" remapped it already (or a mapping exists already for <F6>)
if !exists("no_plugin_maps") && !exists("no_pep8_maps")
if !hasmapto('Pep8(')
noremap <buffer> <F6> :call Pep8()<CR>
noremap! <buffer> <F6> <Esc>:call Pep8()<CR>
endif
endif

View file

@ -0,0 +1,455 @@
*SnipMate.txt* Plugin for using TextMate-style snippets in Vim.
SnipMate *snippet* *snippets* *SnipMate*
Last Change: December 27, 2009
1. Description |SnipMate-description|
2. Usage |SnipMate-usage|
3. Interface and Settings |SnipMate-interface| |SnipMate-settings|
4. Snippet syntax |SnipMate-syntax|
5. Snippet sources |SnipMate-snippet-sources|
6. Disadvantages to TextMate |SnipMate-disadvantages|
7. Contact |SnipMate-contact|
8. License |SnipMate-license|
For Vim version 7.0 or later.
This plugin only works if 'compatible' is not set.
{Vi does not have any of these features.}
SnipMate depends on vim-addon-mw-utils and tlib.
==============================================================================
DESCRIPTION *SnipMate-description*
SnipMate implements snippet features in Vim. A snippet is like a template,
reducing repetitive insertion of pieces of text. Snippets can contain
placeholders for modifying the text if necessary or interpolated code for
evaluation. For example, in C, typing "for" then pushing <Tab> could expand
to: >
for (i = 0; i < count; i++) {
/* code */
}
SnipMate is inspired by TextMate's snippet features.
==============================================================================
USAGE *SnipMate-usage*
Every snippet consists of an expansion and a trigger. Typing a trigger into
your buffer and then hitting your trigger key (<Tab> by default, see
|SnipMate-mappings|) will replace the trigger with the expansion text.
The expansion text can optionally include tab stops. When it does, upon
expansion of the snippet, the cursor is placed at the first one, and the user
can jump between each tab stop. Each of these tab stops can be represented by
default placeholder text. If such a placeholder is provided, then the text of
the placeholder can be repeated in the snippet at specified mirrors. Any edits
to the placeholder are instantly updated at every mirror.
SnipMate allows multiple snippets to use the same trigger. When triggered,
a list of all snippets with that trigger is provided and prompts for which
snippet to use.
*SnipMate-scopes*
SnipMate searches for snippets inside a directory named "snippets" inside each
entry in 'runtimepath'. Which files are loaded depends on 'filetype' and
'syntax'; see |SnipMate-syntax| for more information. Snippets are loaded and
refreshed automatically on demand.
Note: SnipMate does not ship with any snippets. In order to use it, the user
must either write their own snippets or obtain some from a repository like
https://github.com/honza/vim-snippets
==============================================================================
INTERFACE AND SETTINGS *SnipMate-interface* *SnipMate-settings*
*SnipMate-commands*
Commands~
*:SnipMateOpenSnippetFiles*
:SnipMateOpenSnippetFiles Opens a list of all valid snippet locations
based on the current scope |SnipMate-scopes|.
Only existing files and non-existing .snippets
files will be shown, with the existing files
shown first.
*SnipMate-options*
Options~
g:snips_author A variable used in some snippets in place of
the author's (your) name. Similar to
$TM_FULLNAME in TextMate. For example, >
snippet name
`g:snips_author`
< creates a snippet "name" that expands to your
name.
g:snipMate This |Dictionary| contains other SnipMate
options. In short add >
let g:snipMate = {}
< to your .vimrc before setting other SnipMate
options.
g:snipMate.scope_aliases A |Dictionary| associating certain filetypes
with other scopes |SnipMate-scopes|. The
entries consist of a filetype as the key and
a comma-separated list of aliases as the
value. For example, >
let g:snipMate.scope_aliases = {}
let g:snipMate.scope_aliases['ruby']
\ = 'ruby,ruby-rails'
< tells SnipMate that "ruby-rails" snippets in
addition to "ruby" snippets should be loaded
when editing files with 'filetype' set to
"ruby" or contains "ruby" as an entry in the
case of dotted filetypes.
g:snipMate['no_match_completion_feedkeys_chars']
A string inserted when no match for a trigger
is found. By default a tab is inserted
according to 'expandtab', 'tabstop', and
'softtabstop'. Set it to the empty string to
prevent anything from being inserted.
*SnipMate-mappings*
Mappings~
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
The list of possible <Plug> mappings is as follows:
<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
Jump to the previous tab stop, if it exists.
Use in both insert and select modes.
<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
See |SnipMate-visual|.
Additionally, <CR> is mapped in visual mode in .snippets files for retabbing
snippets.
==============================================================================
SYNTAX *snippet-syntax* *SnipMate-syntax*
SnipMate looks inside of each entry of 'rtp' (or |SnipMate-snippet-sources|)
for a directory named /snippets/. Based on the 'filetype' and 'syntax'
settings (taking into account the dotted syntax), the following files are read
for snippets: >
.../snippets/<scope>.snippets
.../snippets/<scope>/<name>.snippets
.../snippets/<scope>/<trigger>.snippet
.../snippets/<scope>/<trigger>/<description>.snippet
where <scope> is an entry in 'filetype' or 'syntax', <name> is an arbitrary
name, <trigger> is the trigger for a snippet, and <description> is
a description used for |SnipMate-multisnip|.
A .snippet file defines a single snippet with the trigger (and description)
determined by the filename. The entire contents of the file are used as the
snippet expansion text.
Multiple snippets can be defined in *.snippets files. Each snippet definition
looks something like: >
snippet trigger optional description
guard left_from_cursor='^\s*'
expanded text
more expanded text
< *SnipMate-multisnip*
The description is optional. If it is left out and a second snippet inside the
same .snippets file uses the same trigger, the second one will overwrite the
first. Otherwise multisnip is used.
The guard condition line is also optional. It can be used to make a snippet
available only in some cases. The value should be a VimL expression.
Note: Hard tabs in the expansion text are required. When the snippet is
expanded in the text and 'expandtab' is set, each tab will be replaced with
spaces based on 'softtabstop' if nonzero or 'shiftwidth' otherwise.
Comments can be made in .snippets files by starting a line with a # character.
However these can't be used inside of snippet definitions: >
# this is a correct comment
snippet trigger
expanded text
snippet another_trigger
# this isn't a comment!
expanded text
This should hopefully be clear with the included syntax highlighting.
*snipMate-extends*
Borrowing from UltiSnips, .snippets files can also contain an extends
directive, for example: >
extends html, javascript, css
will tell SnipMate to also read html, javascript, and css snippets.
*SnipMate-tabstops*
Tab stops~
A tab stop, specified by ${#} where # is a number, tells SnipMate where to
position the cursor next. The special tab stop ${0} denotes the last cursor
position; in its absence, the cursor is placed at the end of the snippet.
For example, to place the cursor first on the id of a <div> tag, allow
the user to press <tab> to go to the middle of it, and finally end after
</div>: >
snippet div
<div id="${1}">
${2}
</div>
< *SnipMate-placeholders* *SnipMate-mirrors*
Placeholders and Mirrors~
Placeholder text can be supplied using "${#:text}", where # is the number of
the tab stop. This text then can be copied throughout the snippet using "$#",
given # is the same number as used before. So, to make a C for loop: >
snippet for
for (${2:i}; $2 < ${1:count}; $1++) {
${4}
}
This will cause "count" to first be selected and change if the user starts
typing. When <tab> is pressed, the "i" in ${2}'s position will be selected;
all $2 variables will default to "i" and automatically be updated if the user
starts typing.
NOTE: "$#" syntax is used only for mirrors, not for tab stops as in TextMate.
Mirrors can also be used inside of placeholders. For instance: >
snippet opt
<option value="${1:option}">${2:$1}</option>
Will, as usual, cause "option" to first be selected and update all the $1
variables if the user starts typing. Since one of these variables is inside of
${2}, this text will then be used as a placeholder for the next tab stop,
allowing the user to change it if he wishes.
To copy a value throughout a snippet without supplying default text, simply
use the "${#:}" construct without the text, e.g.: >
snippet foo
${1:}bar$1
< *SnipMate-visual*
There is a special placeholder called {VISUAL}. If you visually select text,
then press <Tab> Vim switches to insert mode. The next snippet you'll expand
will replace {VISUAL} by the text which was selected previously.
*SnipMate-eval*
Interpolated Vim Script~
Snippets can also contain Vim script commands that are executed (via |eval()|)
when the snippet is inserted. Commands are given inside backticks (`...`); for
TextMates's functionality, use the |system()| function. E.g.: >
snippet date
`system("date +%Y-%m-%d")`
will insert the current date, assuming you are on a Unix system. Note that you
can also (and should) use |strftime()| for this example.
Filename([{expr}] [, {defaultText}]) *SnipMate-Filename()*
Since the current filename is used often in snippets, a default function
has been defined for it in SnipMate.vim, appropriately called Filename().
With no arguments, the default filename without an extension is returned;
the first argument specifies what to place before or after the filename,
and the second argument supplies the default text to be used if the file
has not been named. "$1" in the first argument is replaced with the filename;
if you only want the filename to be returned, the first argument can be left
blank. Examples: >
snippet filename
`Filename()`
snippet filename_with_default
`Filename('', 'name')`
snippet filename_foo
`Filename('$1_foo')`
The first example returns the filename if it the file has been named, and an
empty string if it hasn't. The second returns the filename if it's been named,
and "name" if it hasn't. The third returns the filename followed by "_foo" if
it has been named, and an empty string if it hasn't.
==============================================================================
SNIPPET SOURCES *SnipMate-snippet-sources*
SnipMate is configurable.
plugin/SnipMate.vim assigns three important keys: >
" default implementation collecting snippets by handlers
let g:SnipMate['get_snippets'] = SnipMate#GetSnippets
" default handler:
let g:SnipMateSources['default'] = SnipMate#DefaultPool
" default directories containing snippets:
let g:SnipMate['snippet_dirs']
\ = funcref#Function('return split(&runtimepath,",")')
You can override all of those settings.
You can see that the default set of snippets is determined by Vim's 'rtp'.
Example 1:~
autoload/SnipMate_python_demo.vim shows how you can register additional
sources such as creating snippets on the fly representing python function
definitions found in the current file.
Example 2:~
Add to your ~/.vimrc: For each know snippet add a second version ending in _
adding folding markers >
let g:commentChar = {
\ 'vim': '"',
\ 'c': '//',
\ 'cpp': '//',
\ 'sh': '#',
\ 'python': '#'
\ }
" url https://github.com/garbas/vim-snipmate/issues/49
fun! AddFolding(text)
return substitute(a:text,'\n'," ".g:commentChar[&ft]." {{{\n",1)."\n".g:commentChar[&ft]." }}}"
endf
fun! SnippetsWithFolding(scopes, trigger, result)
" hacky: temporarely remove this function to prevent infinite recursion:
call remove(g:SnipMateSources, 'with_folding')
" get list of snippets:
let result = SnipMate#GetSnippets(a:scopes, substitute(a:trigger,'_\(\*\)\?$','\1',''))
let g:SnipMateSources['with_folding'] = funcref#Function('SnippetsWithFolding')
" add folding:
for k in keys(result)
let a:result[k.'_'] = map(result[k],'AddFolding(v:val)')
endfor
endf
" force setting default:
runtime plugin/SnipMate.vim
" add our own source
let g:SnipMateSources['with_folding'] = funcref#Function('SnippetsWithFolding')
See |SnipMate-syntax| for more details about all possible relative locations
to 'rtp' can be found in.
==============================================================================
DISADVANTAGES *SnipMate-disadvantages*
SnipMate.vim currently has the following disadvantages to TextMate's snippets:
- Nested placeholders are not currently possible. E.g.: >
'<div${1: id="${2:some_id}}">${3}</div>'
< In TextMate this would first highlight ' id="some_id"', and if
you hit delete it would automatically skip ${2} and go to ${3}
on the next <tab>, but if you didn't delete it it would highlight
"some_id" first. You cannot do this in SnipMate.vim.
- Regex cannot be performed on variables, such as "${1/.*/\U&}"
- Placeholders cannot span multiple lines.
- Activating snippets in different scopes of the same file is
not possible.
Perhaps some of these features will be added in a later release.
==============================================================================
CHANGELOG *SnipMate-changelog*
0.85 - 2013-04-03
-----------------
* Allow trigger key customization
* Enable undoing of snippet expansion
* Support backslash escaping in snippets
* Add support for {VISUAL}
* Expand filetype extension with scope_aliases
* Add expansion guards
* Enable per-buffer expansion of snippets
* Fix 'cpo' compatibility
* Update supertab compatibility
* Enable customization of various things through g:SnipMate
* Disable spelling in snippet files
* Highlight trigger names in .snippets files
* Update many snippets
* Separate sample snippets into separate repository
0.84
----
* Unreleased version by Michael Sanders, available on his GitHub,
<https://github.com/msanders/snipmate.vim>
0.83 - 2009-07-13
-----------------
* Last release done by Michael Sanders, available at
<http://www.vim.org/scripts/script.php?script_id=2540>
==============================================================================
CONTACT *SnipMate-contact* *SnipMate-author*
SnipMate is currently maintained by:
- Rok Garbas
- Marc Weber (marco-oweber@gmx.de)
- Adnan Zafar
For bug reports, issues, or questions, check out the Issues page on GitHub:
https://github.com/garbas/vim-snipmate/issues
The original author, Michael Sanders, can be reached at:
msanders42+snipmate <at> gmail <dot> com
==============================================================================
LICENSE *SnipMate-license*
SnipMate is released under the MIT license:
Copyright 2009-2010 Michael Sanders. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The software is provided "as is", without warranty of any kind, express or
implied, including but not limited to the warranties of merchantability,
fitness for a particular purpose and noninfringement. In no event shall the
authors or copyright holders be liable for any claim, damages or other
liability, whether in an action of contract, tort or otherwise, arising from,
out of or in connection with the software or the use or other dealings in the
software.
==============================================================================
vim:tw=78:ts=8:ft=help:norl:

View file

@ -0,0 +1,168 @@
# Credit: @iurifg
snippet do
do
${1}
end
endsnippet
snippet if "if .. do .. end"
if ${1:condition} do
${2:expression}
end
endsnippet
snippet if "if .. do: .."
if ${1:condition}, do: ${2:expression}
endsnippet
snippet ife "if .. do .. else .. end"
if ${1:condition} do
${2:expression}
else
${3:expression}
end
endsnippet
snippet ife "if .. do: .. else:"
if ${1:condition}, do: ${2}, else: ${3}
endsnippet
snippet unless "unless .. do .. end"
unless ${1} do
${2}
end
endsnippet
snippet unless "unless .. do: .."
unless ${1:condition}, do: ${2}
endsnippet
snippet unlesse "unless .. do .. else .. end"
unless ${1:condition} do
${2}
else
${3}
end
endsnippet
snippet unlesse "unless .. do: .. else:"
unless ${1:condition}, do: ${2}, else: ${3}
endsnippet
snippet cond
"cond do"
${1} ->
${2}
end
endsnippet
snippet case
case ${1} do
${2} ->
${3}
end
endsnippet
snippet def
def ${1:name} do
${2}
end
endsnippet
snippet defin "def function(n), do: n"
def ${1:name}, do: ${2}
endsnippet
snippet defg
def ${1:name} when ${2:guard-condition} do
${3}
end
endsnippet
snippet defim
defimpl ${1:protocol_name}, for: ${2:data_type} do
${3}
end
endsnippet
snippet defma
defmacro ${1:name} do
${2}
end
endsnippet
snippet defmo
defmodule ${1:module_name} do
${2}
end
endsnippet
snippet defp
defp ${1:name} do
${2}
end
endsnippet
snippet defpr
defprotocol ${1:name}, [${2:function}]
endsnippet
snippet defr
defrecord ${1:record_name}, ${2:fields}
endsnippet
snippet doc
@doc """
${1}
"""
endsnippet
snippet fn
fn(${1:args}) -> ${2} end
endsnippet
snippet fun
function do
${1}
end
endsnippet
snippet mdoc
@moduledoc """
${1}
"""
endsnippet
snippet rec
receive do
${1} ->
${2}
end
endsnippet
snippet req
require ${1:module_name}
endsnippet
snippet imp
import ${1:module_name}
endsnippet
snippet ali "alias old-module to shorthand"
alias ${1:module_name}
endsnippet
snippet test
test "${1:test_name}" do
${2}
end
endsnippet
snippet try "try .. rescue .. end"
try do
${1}
rescue
${2} -> ${3}
end
endsnippet

View file

@ -0,0 +1,88 @@
###################################################################
# Ember snippets #
###################################################################
# Application
snippet eapp "App.Name = Ember.Application.create({});"
${1:App.Name} = Ember.Application.create({});
endsnippet
# Models
snippet emod "App.ModelName = Ember.Model.extend({...});"
${1:model_name} = Ember.Model.extend({
${0://Properties here...}
});
endsnippet
# View
snippet eview "App.ViewName = Ember.Model.extend({...});"
${1:view_name} = Ember.View.extend({
${0://Properties here...}
});
endsnippet
# Controller
snippet econtroller "App.ControllerName = Ember.Model.extend({...});"
${1:controller_name} = Ember.ObjectController.extend({
${0://Properties here...}
});
endsnippet
# Route
snippet eroute "App.RouteName = Ember.Route.extend({...});"
${1:route_name} = Ember.Route.extend({
${0://Properties here...}
});
endsnippet
snippet eview "App.ViewName = Ember.Model.create({...});"
${1:view_name} = Ember.View.create({
${0://Properties here...}
});
endsnippet
# Object
snippet eobj "App.ObjectName = Ember.Object.extend({...});"
${1:object_name} = Ember.Object.create({
${0://Properties here...}
});
endsnippet
# Mixin
snippet emix "App.MixinName = Ember.Model.extend({...});"
${1:view_name} = Ember.Mixin.create({
${0://Properties here...}
});
endsnippet
# Ember getter and setter
snippet eget "this.get('property');"
${1:this}.get('${2:property}');
endsnippet
snippet eset "this.set('property', value);"
${1:this}.set('${2:property}', ${3:value});
endsnippet
# Computer properties
snippet cpro "property_name: function() {...}.property(),"
${1:property_name}: function() {
${0://body...}
}.property('${3:argumenet}'),
endsnippet
snippet cpro ": function() {...}.property('property'),"
${1:property_name}: function() {
${0://body...}
}.property(),
endsnippet
# Observes
snippet proo "property_name: function() {...}.property()"
${1:property_name}: function() {
${0://body...}
}.observes('${3:property}'),
endsnippet
# vim:ft=snippets:

View file

@ -0,0 +1,108 @@
# Closure loop
snippet forinlet
for ${1:name} in ${2:array}
let $1
${3}
# Array comprehension
snippet fora
for ${1:name} in ${2:array}
${3}
# Object comprehension
snippet foro
for ${1:key}, ${2:value} of ${3:object}
${4}
# Range comprehension (inclusive)
snippet forr
for ${1:name} from ${2:start} to ${3:finish}
${4}
snippet forrb
for ${1:name} from ${2:start} to ${3:finish} by ${4:step}
${5}
# Range comprehension (exclusive)
snippet forrex
for ${1:name} from ${2:start} til ${3:finish}
${4}
snippet forrexb
for ${1:name} from ${2:start} til ${3:finish} by ${4:step}
${5}
# Function
snippet fun
(${1:args}) ->
${2}
# Function (bound)
snippet bfun
(${1:args}) ~>
${2}
# Class
snippet cla class ..
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
${2}
snippet cla class .. constructor: ..
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
(${2:args}) ->
${3}
${4}
snippet cla class .. extends ..
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
${3}
snippet cla class .. extends .. constructor: ..
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
(${3:args}) ->
${4}
${5}
# If
snippet if
if ${1:condition}
${2}
# If __ Else
snippet ife
if ${1:condition}
${2}
else
${3}
# Else if
snippet elif
else if ${1:condition}
${2}
# Ternary If
snippet ifte
if ${1:condition} then ${2:value} else ${3:other}
# Unless
snippet unl
${1:action} unless ${2:condition}
# Switch
snippet swi
switch ${1:object}
case ${2:value}
${3}
default void
snippet mat
match ${1:object}
| ${2:value} => ${3}
| otherwise => void
# Log
snippet log
console.log ${1}
# stringify
snippet str
JSON.stringify ${1}, void, 2
# Try __ Catch
snippet try
try
${1}
catch ${2:error}
${3}
# Require
snippet req
${2:$1} = require '${1}'${3}
# Require!
snippet req!
require! ${1}
# Export
snippet exp
${1:root} = exports ? this

@ -0,0 +1 @@
Subproject commit 45d369eff6e2c5441ba21918825a8c215a44a951

View file

@ -8,21 +8,19 @@ from os import path
#--- Globals ----------------------------------------------
PLUGINS = """
ack.vim https://github.com/mileszs/ack.vim
bufexplorer https://github.com/corntrace/bufexplorer
ctrlp.vim https://github.com/kien/ctrlp.vim
mayansmoke https://github.com/vim-scripts/mayansmoke
nerdtree https://github.com/scrooloose/nerdtree
nginx.vim https://github.com/vim-scripts/nginx.vim
open_file_under_cursor.vim https://github.com/amix/open_file_under_cursor.vim
pyflakes https://github.com/vim-scripts/pyflakes
snipmate-snippets https://github.com/scrooloose/snipmate-snippets
taglist.vim https://github.com/vim-scripts/taglist.vim
tlib https://github.com/vim-scripts/tlib
vim-addon-mw-utils https://github.com/MarcWeber/vim-addon-mw-utils
vim-bundle-mako https://github.com/sophacles/vim-bundle-mako
vim-coffee-script https://github.com/kchmck/vim-coffee-script
vim-colors-solarized https://github.com/altercation/vim-colors-solarized
vim-indent-object https://github.com/michaeljsmith/vim-indent-object
vim-less https://github.com/groenewege/vim-less
vim-markdown https://github.com/tpope/vim-markdown
vim-pyte https://github.com/therubymug/vim-pyte
@ -31,6 +29,7 @@ vim-snippets https://github.com/honza/vim-snippets
vim-surround https://github.com/tpope/vim-surround
vim-expand-region https://github.com/terryma/vim-expand-region
vim-multiple-cursors https://github.com/terryma/vim-multiple-cursors
vim-pep8 https://github.com/xiaocao/vim-pep8
""".strip()
GITHUB_ZIP = '%s/archive/master.zip'

1
vimrcs/TODO Normal file
View file

@ -0,0 +1 @@
https://github.com/millermedeiros/vim-statline

View file

@ -44,7 +44,7 @@
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sets how many lines of history VIM has to remember
set history=700
set history=2048
" Enable filetype plugins
filetype plugin on
@ -70,7 +70,7 @@ command W w !sudo tee % > /dev/null
" => VIM user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set 7 lines to the cursor - when moving vertically using j/k
set so=7
set so=10
" Turn on the WiLd menu
set wildmenu
@ -87,7 +87,7 @@ endif
set ruler
" Height of the command bar
set cmdheight=2
set cmdheight=1
" A buffer becomes hidden when it is abandoned
set hid
@ -117,7 +117,7 @@ set magic
" Show matching brackets when text indicator is over them
set showmatch
" How many tenths of a second to blink when matching brackets
set mat=2
set mat=3
" No annoying sound on errors
set noerrorbells
@ -126,7 +126,7 @@ set t_vb=
set tm=500
" Add a bit extra margin to the left
set foldcolumn=1
set foldcolumn=0
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@ -137,6 +137,9 @@ syntax enable
try
colorscheme desert
"colorscheme peaksea
"colorscheme solarized
"colorscheme mayansmoke
catch
endtry
@ -204,6 +207,10 @@ vnoremap <silent> # :call VisualSelection('b', '')<CR>
map j gj
map k gk
" Turn off vim'S horroble REgex
nnoremap / /\v
vnoremap / /\v
" Map <Space> to / (search) and Ctrl-<Space> to ? (backwards search)
map <space> /
map <c-space> ?
@ -211,38 +218,43 @@ map <c-space> ?
" Disable highlight when <leader><cr> is pressed
map <silent> <leader><cr> :noh<cr>
" Smart way to move between windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" Close the current buffer
map <leader>bd :Bclose<cr>
"" ###Taps
"" ###
"" Smart way to move between windows
"map <C-j> <C-W>j
"map <C-k> <C-W>k
"map <C-h> <C-W>h
"map <C-l> <C-W>l
" Close all the buffers
map <leader>ba :1,1000 bd!<cr>
"" Close the current buffer
"map <leader>bd :Bclose<cr>
" Useful mappings for managing tabs
map <leader>tn :tabnew<cr>
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove
map <leader>t<leader> :tabnext
"" Close all the buffers
"map <leader>ba :1,1000 bd!<cr>
" Opens a new tab with the current buffer's path
" Super useful when editing files in the same directory
map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
"" Useful mappings for managing tabs
"map <leader>tn :tabnew<cr>
"map <leader>to :tabonly<cr>
"map <leader>tc :tabclose<cr>
"map <leader>tm :tabmove
"map <leader>t<leader> :tabnext
" Switch CWD to the directory of the open buffer
map <leader>cd :cd %:p:h<cr>:pwd<cr>
"" Opens a new tab with the current buffer's path
"" Super useful when editing files in the same directory
"map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
" Specify the behavior when switching between buffers
try
set switchbuf=useopen,usetab,newtab
set stal=2
catch
endtry
"" Switch CWD to the directory of the open buffer
"map <leader>cd :cd %:p:h<cr>:pwd<cr>
"" Specify the behavior when switching between buffers
"try
" set switchbuf=useopen,usetab,newtab
" set stal=2
"catch
"endtry
""### Taps ENd
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
@ -259,9 +271,18 @@ set viminfo^=%
" Always show the status line
set laststatus=2
" Format the status line
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
set statusline= " clear the statusline for when vimrc is reloaded
set statusline+=%-3.3n\ " buffer number
set statusline+=%F\ " file name
set statusline+=%h%m%r%w " flags
""set statusline+=[%{strlen(&ft)?&ft:'none'}, " filetype
""set statusline+=%{strlen(&fenc)?&fenc:&enc}, " encoding
""set statusline+=%{&fileformat}] " file format
set statusline+=%= " right align
set statusline+=%{synIDattr(synID(line('.'),col('.'),1),'name')}\ " highlight
set statusline+=%b,0x%-8B\ " current char
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Editing mappings
@ -269,18 +290,6 @@ set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\
" Remap VIM 0 to first non-blank character
map 0 ^
" Move a line of text using ALT+[jk] or Comamnd+[jk] on mac
nmap <M-j> mz:m+<cr>`z
nmap <M-k> mz:m-2<cr>`z
vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z
if has("mac") || has("macunix")
nmap <D-j> <M-j>
nmap <D-k> <M-k>
vmap <D-j> <M-j>
vmap <D-k> <M-k>
endif
" Delete trailing white space on save, useful for Python and CoffeeScript ;)
func! DeleteTrailingWS()
@ -288,40 +297,11 @@ func! DeleteTrailingWS()
%s/\s\+$//ge
exe "normal `z"
endfunc
autocmd BufWrite *.py :call DeleteTrailingWS()
autocmd BufWrite *.coffee :call DeleteTrailingWS()
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => vimgrep searching and cope displaying
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" When you press gv you vimgrep after the selected text
vnoremap <silent> gv :call VisualSelection('gv', '')<CR>
" Open vimgrep and put the cursor in the right position
map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left>
" Vimgreps in the current file
map <leader><space> :vimgrep // <C-R>%<C-A><right><right><right><right><right><right><right><right><right>
" When you press <leader>r you can search and replace the selected text
vnoremap <silent> <leader>r :call VisualSelection('replace', '')<CR>
" Do :help cope if you are unsure what cope is. It's super useful!
"
" When you search with vimgrep, display your results in cope by doing:
" <leader>cc
"
" To go to the next search result do:
" <leader>n
"
" To go to the previous search results do:
" <leader>p
"
map <leader>cc :botright cope<cr>
map <leader>co ggVGy:tabnew<cr>:set syntax=qf<cr>pgg
map <leader>n :cn<cr>
map <leader>p :cp<cr>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@ -343,12 +323,15 @@ map <leader>s? z=
" Remove the Windows ^M - when the encodings gets messed up
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
" Quickly open a buffer for scripbble
map <leader>q :e ~/buffer<cr>
" Toggle paste mode on and off
map <leader>pp :setlocal paste!<cr>
"folding settings (with <z-a> <z-M> <z-R>
set foldmethod=indent "fold based on indent
set foldnestmax=10 "deepest fold is 10 levels
set nofoldenable "dont fold by default
set foldlevel=1 "this is just what i use
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@ -390,23 +373,4 @@ function! HasPaste()
return ''
endfunction
" Don't close window, when deleting a buffer
command! Bclose call <SID>BufcloseCloseIt()
function! <SID>BufcloseCloseIt()
let l:currentBufNum = bufnr("%")
let l:alternateBufNum = bufnr("#")
if buflisted(l:alternateBufNum)
buffer #
else
bnext
endif
if bufnr("%") == l:currentBufNum
new
endif
if buflisted(l:currentBufNum)
execute("bdelete! ".l:currentBufNum)
endif
endfunction

View file

@ -52,33 +52,6 @@ catch
endtry
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Command mode related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Smart mappings on the command line
cno $h e ~/
cno $d e ~/Desktop/
cno $j e ./
cno $c e <C-\>eCurrentFileDir("e")<cr>
" $q is super useful when browsing on the command line
" it deletes everything until the last slash
cno $q <C-\>eDeleteTillSlash()<cr>
" Bash like keys for the command line
cnoremap <C-A> <Home>
cnoremap <C-E> <End>
cnoremap <C-K> <C-U>
cnoremap <C-P> <Up>
cnoremap <C-N> <Down>
" Map ½ to something useful
map ½ $
cmap ½ $
imap ½ $
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Parenthesis/bracket
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@ -115,25 +88,6 @@ autocmd FileType css set omnifunc=csscomplete#CompleteCSS
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Helper functions
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
func! DeleteTillSlash()
let g:cmd = getcmdline()
if has("win16") || has("win32")
let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\]\\).*", "\\1", "")
else
let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*", "\\1", "")
endif
if g:cmd == g:cmd_edited
if has("win16") || has("win32")
let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\\]\\).*\[\\\\\]", "\\1", "")
else
let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "")
endif
endif
return g:cmd_edited
endfunc
func! CurrentFileDir(cmd)
return a:cmd . " " . expand("%:p:h") . "/"

View file

@ -4,8 +4,6 @@
let python_highlight_all = 1
au FileType python syn keyword pythonDecorator True None False self
au BufNewFile,BufRead *.jinja set syntax=htmljinja
au BufNewFile,BufRead *.mako set ft=mako
au FileType python map <buffer> F :set foldmethod=indent<cr>
@ -18,6 +16,9 @@ au FileType python map <buffer> <leader>2 /def
au FileType python map <buffer> <leader>C ?class
au FileType python map <buffer> <leader>D ?def
autocmd BufWrite *.py :call DeleteTrailingWS()
""""""""""""""""""""""""""""""
" => JavaScript section

View file

@ -29,16 +29,6 @@ let MRU_Max_Entries = 400
map <leader>f :MRU<CR>
""""""""""""""""""""""""""""""
" => YankRing
""""""""""""""""""""""""""""""
if has("win16") || has("win32")
" Don't do anything
else
let g:yankring_history_dir = '~/.vim_runtime/temp_dirs/'
endif
""""""""""""""""""""""""""""""
" => CTRL-P
""""""""""""""""""""""""""""""
@ -51,12 +41,6 @@ let g:ctrlp_max_height = 20
let g:ctrlp_custom_ignore = 'node_modules\|^\.DS_Store\|^\.git\|^\.coffee'
""""""""""""""""""""""""""""""
" => Peepopen
""""""""""""""""""""""""""""""
map <leader>j :PeepOpen<cr>
""""""""""""""""""""""""""""""
" => ZenCoding

231
vimrcs/vimrc_bood.vim Normal file
View file

@ -0,0 +1,231 @@
" Bood vim Config
""""""""""""""""""""""
"""" General
""""""""""""""""""""""
" Sets how many lines of history VIM has to remember
set history=700
" Enable filetype plugins
filetype plugin on
filetype indent on
" Set to auto read when a file is changed from the outside
set autoread
" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible
" With a map leader it's possible to do extra key combinations
" " like <leader>w saves the current file
let mapleader = ","
let g:mapleader = ","
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set 7 lines to the cursor - when moving vertically using j/k
set so=7
" Turn on the WiLd menu
set wildmenu
" " Ignore compiled files
set wildignore=*.o,*~,*.pyc
"if has("win16") || has("win32")
" set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
"else
" set wildignore+=.git\*,.hg\*,.svn\*
"endif
"Always show current position
set ruler
" Highlight search results
set hlsearch
"
" " Makes search act like search in modern browsers
set incsearch
"For regular expressions turn magic on
set magic
"Show matching brackets when text indicator is over them
set showmatch
" How many tenths of a second to blink when matching brackets
set mat=2
" Turn off vim'S horroble REgex
nnoremap / /\v
vnoremap / /\v
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors and Fonts
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" " Enable syntax highlighting
syntax enable
"
try
colorscheme desert
catch
endtry
set background=dark
"Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" " Use spaces instead of tabs
set expandtab
"
" " Be smart when using tabs ;)
set smarttab
"
" " 1 tab == 4 spaces
set shiftwidth=4
set tabstop=4
"
" " Linebreak on 500 characters
set lbr
set tw=500
"
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
"""""""""""""""""""""""""""""
" => Visual mode related
"""""""""""""""""""""""""""""""
" " Visual mode pressing * or # searches for the current selection
" " Super useful! From an idea by Michael Naumann
vnoremap <silent> * :call VisualSelection('f', '')<CR>
vnoremap <silent> # :call VisualSelection('b', '')<CR>
" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
set viminfo^=%
" Delete trailing white space on save, useful for Python and CoffeeScript ;)
autocmd BufWrite *.py :call DeleteTrailingWS()
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Turn persistent undo on
" " means that you can undo even when you close a buffer/VIM
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"try
" set undodir=~/.vim_runtime/temp_dirs/undodir
" set undofile
" catch
"endtry
" Uncommenting the next line enables syntax highlighting by default.
if has("syntax")
syntax on
endif
"################
"Python
"################
let python_highlight_all = 1
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
" filetype plugin indent on
"endif
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd " Show (partial) command in status line.
"set showmatch " Show matching brackets.
set ignorecase " Do case insensitive matching
set smartcase " Do smart case matching
"set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make
"set hidden " Hide buffers when they are abandoned
"set mouse=a " Enable mouse usage (all modes)
"Forget to open File with sudo
cmap w!! w !sudo tee % >/dev/null
cmap x!! x !sudo tee % >/dev/null
function! VisualSelection(direction, extra_filter) range
let l:saved_reg = @"
execute "normal! vgvy"
let l:pattern = escape(@", '\\/.*$^~[]')
let l:pattern = substitute(l:pattern, "\n$", "", "")
if a:direction == 'b'
execute "normal ?" . l:pattern . "^M"
elseif a:direction == 'gv'
call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.' . a:extra_filter)
elseif a:direction == 'replace'
call CmdLine("%s" . '/'. l:pattern . '/')
elseif a:direction == 'f'
execute "normal /" . l:pattern . "^M"
endif
let @/ = l:pattern
let @" = l:saved_reg
endfunction
" Returns true if paste mode is enabled
function! HasPaste()
if &paste
return 'PASTE MODE '
en
return ''
endfunction
func! DeleteTrailingWS()
exe "normal mz"
%s/\s\+$//ge
exe "normal `z"
endfunc