mirror of
https://github.com/amix/vimrc
synced 2025-02-28 14:12:51 +08:00
Merge aba37f1391
into 351979d3e0
This commit is contained in:
commit
46b1825d7c
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,3 @@
|
||||
temp_dirs/undodir*
|
||||
sources_non_forked/ack.vim/.netrwhist
|
||||
temp_dirs/yankring_history_v2.txt
|
||||
sources_forked/yankring/doc/tags
|
||||
sources_non_forked/tlib/doc/tags
|
||||
my_configs.vim
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Over the last 8 years I have used and tweaked Vim. This is my Ultimate vimrc.
|
||||
|
||||
There are two versions:
|
||||
There are two(2 versions:
|
||||
|
||||
* **Basic**: If you want something small just copy [basic.vim](https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim) into your ~/.vimrc and you will have a great basic setup
|
||||
* **Awesome**: This includes a ton of useful plugins, color schemes and configurations
|
||||
@ -15,14 +15,14 @@ The basic version is basically just one file and no plugins. You can check out [
|
||||
|
||||
This is useful to install on remote servers where you don't need many plugins and you don't do many edits.
|
||||
|
||||
git clone git://github.com/amix/vimrc.git ~/.vim_runtime
|
||||
git clone git://github.com/pypsde/vimrc.git ~/.vim_runtime
|
||||
sh ~/.vim_runtime/install_basic_vimrc.sh
|
||||
|
||||
|
||||
## How to install the Awesome version?
|
||||
The awesome version includes a lot of great plugins, configurations and color schemes that make Vim a lot better. To install it simply do following:
|
||||
|
||||
git clone git://github.com/amix/vimrc.git ~/.vim_runtime
|
||||
git clone git://github.com/pypsde/vimrc.git ~/.vim_runtime
|
||||
sh ~/.vim_runtime/install_awesome_vimrc.sh
|
||||
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
sudo apt-get install pip ctags
|
||||
cd ~/.vim_runtime
|
||||
|
||||
echo 'set runtimepath+=~/.vim_runtime
|
||||
|
@ -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 :-)"
|
||||
|
@ -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
|
@ -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
|
@ -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/).
|
||||
|
@ -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
@ -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
|
@ -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 " }}}
|
||||
" }}}
|
@ -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 " }}}
|
@ -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 " }}}
|
@ -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 " }}}
|
@ -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 " }}}
|
@ -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 " }}}
|
@ -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 " }}}
|
@ -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 " }}}
|
@ -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'],
|
||||
\ }),
|
||||
\ ])
|
@ -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'],
|
||||
\ }),
|
||||
\ ])
|
@ -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 " }}}
|
@ -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 " }}}
|
@ -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 " }}}
|
@ -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 " }}}
|
@ -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 " }}}
|
@ -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'),
|
||||
\ }
|
@ -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')),
|
||||
\ ])
|
@ -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"}')
|
||||
\ ])
|
@ -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()}')
|
||||
\ ])
|
@ -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")}')
|
||||
\ ])
|
@ -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")}')
|
||||
\ ])
|
@ -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()}')
|
||||
\ ])
|
@ -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'))
|
||||
\ ])
|
@ -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'))
|
||||
\ ])
|
@ -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()}')
|
||||
\ ])
|
@ -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()
|
||||
\ )
|
||||
\ )
|
@ -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()
|
||||
\ )
|
||||
\ )
|
@ -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:
|
@ -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*
|
@ -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
|
@ -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!
|
@ -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))
|
||||
|
@ -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
1
sources_non_forked/ack.vim/.gitignore
vendored
1
sources_non_forked/ack.vim/.gitignore
vendored
@ -1 +0,0 @@
|
||||
tags
|
@ -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/).
|
@ -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
|
@ -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.
|
@ -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>)
|
@ -1,24 +0,0 @@
|
||||
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*
|
@ -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
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
au BufRead,BufNewFile /etc/nginx/* set ft=nginx
|
||||
au BufRead,BufNewFile /usr/local/nginx/conf/* set ft=nginx
|
@ -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#
|
@ -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"
|
18
sources_non_forked/pyflakes/README
Normal file
18
sources_non_forked/pyflakes/README
Normal 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>
|
||||
|
73
sources_non_forked/pyflakes/ftplugin/python_pyflakes.vim
Normal file
73
sources_non_forked/pyflakes/ftplugin/python_pyflakes.vim
Normal 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
|
4
sources_non_forked/syntastic/.gitignore
vendored
Normal file
4
sources_non_forked/syntastic/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
*~
|
||||
*.swp
|
||||
tags
|
||||
.DS_Store
|
49
sources_non_forked/syntastic/CONTRIBUTING.md
Normal file
49
sources_non_forked/syntastic/CONTRIBUTING.md
Normal file
@ -0,0 +1,49 @@
|
||||
# Bug reports / Github issues
|
||||
|
||||
When reporting a bug make sure you search the existing github issues for the
|
||||
same/similar issues. If you find one, feel free to add a `+1` comment with any
|
||||
additional information that may help us solve the issue.
|
||||
|
||||
When creating a new issue be sure to state the following:
|
||||
|
||||
* Steps to reproduce the bug.
|
||||
* The version of vim you are using.
|
||||
* The version of syntastic you are using.
|
||||
|
||||
For syntax checker bugs also state the version of the checker executable that you are using.
|
||||
|
||||
# Submitting a patch
|
||||
|
||||
* Fork the repo on github
|
||||
* Make a [topic branch](https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches) and start hacking
|
||||
* Submit a pull request based off your topic branch
|
||||
|
||||
Small focused patches are preferred.
|
||||
|
||||
Large changes to the code should be discussed with the core team first. Create an issue and explain your plan and see what we say.
|
||||
|
||||
# General style notes
|
||||
|
||||
Following the coding conventions/styles used in the syntastic core:
|
||||
|
||||
* Use 4 space indents.
|
||||
* Don't use abbreviated keywords - e.g. use `endfunction`, not `endfun` (there's always room for more fun!).
|
||||
* Don't use `l:` prefixes for variables unless actually required (i.e. almost never).
|
||||
* Code for maintainability. We would rather a function be a couple of lines longer and have (for example) some [explaining variables](http://www.refactoring.com/catalog/introduceExplainingVariable.html) to aid readability.
|
||||
|
||||
# Syntax checker style notes
|
||||
|
||||
The preferred style for error format strings is one "clause" per line. E.g.
|
||||
(from the coffeelint checker):
|
||||
|
||||
```viml
|
||||
let errorformat = '%E%f:%l:%c: %trror: %m,' .
|
||||
\ 'Syntax%trror: In %f\, %m on line %l,' .
|
||||
\ '%EError: In %f\, Parse error on line %l: %m,' .
|
||||
\ '%EError: In %f\, %m on line %l,' .
|
||||
\ '%W%f(%l): lint warning: %m,' .
|
||||
\ '%W%f(%l): warning: %m,' .
|
||||
\ '%E%f(%l): SyntaxError: %m,' .
|
||||
\ '%-Z%p^,' .
|
||||
\ '%-G%.%#'
|
||||
```
|
13
sources_non_forked/syntastic/LICENCE
Normal file
13
sources_non_forked/syntastic/LICENCE
Normal file
@ -0,0 +1,13 @@
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
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.
|
174
sources_non_forked/syntastic/README.markdown
Normal file
174
sources_non_forked/syntastic/README.markdown
Normal file
@ -0,0 +1,174 @@
|
||||
,
|
||||
/ \,,_ .'|
|
||||
,{{| /}}}}/_.' _____________________________________________
|
||||
}}}}` '{{' '. / \
|
||||
{{{{{ _ ;, \ / Ladies and Gentlemen, \
|
||||
,}}}}}} /o`\ ` ;) | |
|
||||
{{{{{{ / ( | this is ... |
|
||||
}}}}}} | \ | |
|
||||
{{{{{{{{ \ \ | |
|
||||
}}}}}}}}} '.__ _ | | _____ __ __ _ |
|
||||
{{{{{{{{ /`._ (_\ / | / ___/__ ______ / /_____ ______/ /_(_)____ |
|
||||
}}}}}}' | //___/ --=: \__ \/ / / / __ \/ __/ __ `/ ___/ __/ / ___/ |
|
||||
jgs `{{{{` | '--' | ___/ / /_/ / / / / /_/ /_/ (__ ) /_/ / /__ |
|
||||
}}}` | /____/\__, /_/ /_/\__/\__,_/____/\__/_/\___/ |
|
||||
| /____/ |
|
||||
| /
|
||||
\_____________________________________________/
|
||||
|
||||
|
||||
|
||||
|
||||
Syntastic is a syntax checking plugin that runs files through external syntax
|
||||
checkers and displays any resulting errors to the user. This can be done on
|
||||
demand, or automatically as files are saved. If syntax errors are detected, the
|
||||
user is notified and is happy because they didn't have to compile their code or
|
||||
execute their script to find them.
|
||||
|
||||
At the time of this writing, syntax checking plugins exist for Ada,
|
||||
AppleScript, AsciiDoc, Bourne shell, C, C++, C#, CoffeeScript, Coco, Coq,
|
||||
CSS, Cucumber, CUDA, D, Dart, DocBook, Elixir, Erlang, eRuby, Fortran,
|
||||
Gentoo metadata, Go, Haml, Haskell, Haxe, HSS, HTML, Java, JavaScript, JSON,
|
||||
LESS, LISP, LLVM intermediate language, Lua, MATLAB, NASM, Objective-C,
|
||||
Objective-C++, OCaml, Perl, Perl POD, PHP, Puppet, Python, reStructuredText,
|
||||
Ruby, Rust, SASS/SCSS, Scala, Slim, Tcl, TeX, Twig, TypeScript, Vala, VHDL,
|
||||
xHtml, XML, XSLT, YAML, z80, Zope page templates, zsh.
|
||||
|
||||
## Screenshot
|
||||
|
||||
Below is a screenshot showing the methods that Syntastic uses to display syntax
|
||||
errors. Note that, in practise, you will only have a subset of these methods
|
||||
enabled.
|
||||
|
||||

|
||||
|
||||
1. Errors are loaded into the location list for the corresponding window.
|
||||
2. When the cursor is on a line containing an error, the error message is echoed in the command window.
|
||||
3. Signs are placed beside lines with errors - note that warnings are displayed in a different color.
|
||||
4. There is a configurable statusline flag you can include in your statusline config.
|
||||
5. Hover the mouse over a line containing an error and the error message is displayed as a balloon.
|
||||
6. (not shown) Highlighting errors with syntax highlighting. Erroneous parts of lines can be highlighted.
|
||||
|
||||
## Installation
|
||||
|
||||
Installing syntastic is easy but first you need to have the pathogen plugin installed. If you already
|
||||
have pathogen working then skip Step 1 and go to Step 2.
|
||||
|
||||
### Step 1: Install pathogen.vim
|
||||
|
||||
First I'll show you how to install tpope's [pathogen.vim](https://github.com/tpope/vim-pathogen) so that
|
||||
it's easy to install syntastic. Do this in your Terminal so that you get the pathogen.vim file
|
||||
and the directories it needs:
|
||||
|
||||
mkdir -p ~/.vim/autoload ~/.vim/bundle; \
|
||||
curl -so ~/.vim/autoload/pathogen.vim \
|
||||
https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
|
||||
|
||||
Next you *need to add this* to your ~/.vimrc:
|
||||
|
||||
execute pathogen#infect()
|
||||
|
||||
### Step 2: Install syntastic as a pathogen bundle
|
||||
|
||||
You now have pathogen installed and can put syntastic into ~/.vim/bundle like this:
|
||||
|
||||
|
||||
cd ~/.vim/bundle
|
||||
git clone https://github.com/scrooloose/syntastic.git
|
||||
|
||||
Quit vim and start it back up to reload it, then type:
|
||||
|
||||
:Helptags
|
||||
|
||||
If you get an error when you do this, then you probably didn't install pathogen right. Go back to
|
||||
step 1 and make sure you did the following:
|
||||
|
||||
1. Created both the ~/.vim/autoload and ~/.vim/bundle directories.
|
||||
2. Added the "call pathogen#infect()" line to your ~/.vimrc file
|
||||
3. Did the git clone of syntastic inside ~/.vim/bundle
|
||||
4. Have permissions to access all of these directories.
|
||||
|
||||
|
||||
## Google group
|
||||
|
||||
To get information or make suggestions check out the [google group](https://groups.google.com/group/vim-syntastic).
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
__Q. I installed syntastic but it isn't reporting any errors...__
|
||||
|
||||
A. The most likely reason is that none of the syntax checkers that it requires is installed. For example: python requires either `flake8`, `pyflakes` or `pylint` to be installed and in `$PATH`. To see which executables are supported, just look in `syntax_checkers/<filetype>/*.vim`. Note that aliases do not work; the actual executable must be available in your `$PATH`. Symbolic links are okay. You can see syntastic's idea of available checkers by running `:SyntasticInfo`.
|
||||
|
||||
Another reason it could fail is that either the command line options or the error output for a syntax checker may have changed. In this case, make sure you have the latest version of the syntax checker installed. If it still fails then create an issue - or better yet, create a pull request.
|
||||
|
||||
__Q. Recently some of my syntax checker options have stopped working...__
|
||||
|
||||
A. The options are still there, they have just been renamed. Recently, almost all syntax checkers were refactored to use the new `syntastic#makeprg#build()` function. This made a lot of the old explicit options redundant - as they are now implied. The new implied options usually have slightly different names to the old options.
|
||||
|
||||
e.g. Previously there was `g:syntastic_phpcs_conf`, now you must use `g:syntastic_php_phpcs_args`.
|
||||
|
||||
See `:help syntastic-checker-options` for more information.
|
||||
|
||||
__Q. I run a checker and the location list is not updated...__
|
||||
|
||||
A. By default, the location list is changed only when you run the `:Errors` command, in order to minimise conflicts with other plugins. If you want the location list to always be updated when you run the checkers, add this line to your vimrc:
|
||||
```vim
|
||||
let g:syntastic_always_populate_loc_list=1
|
||||
```
|
||||
|
||||
__Q. How can I pass additional arguments to a checker?__
|
||||
|
||||
A. Almost all syntax checkers use the `syntastic#makeprg#build()` function. Those checkers that do can be configured using global variables. The general form of the global args variables are:
|
||||
```vim
|
||||
syntastic_<filetype>_<subchecker>_args
|
||||
```
|
||||
|
||||
So, If you wanted to pass "--my --args --here" to the ruby mri checker you would add this line to your vimrc:
|
||||
```vim
|
||||
let g:syntastic_ruby_mri_args="--my --args --here"
|
||||
```
|
||||
|
||||
See `:help syntastic-checker-options` for more information.
|
||||
|
||||
__Q. Syntastic supports several checkers for my filetype - how do I tell it which one(s) to use?__
|
||||
|
||||
A. Stick a line like this in your vimrc:
|
||||
```vim
|
||||
let g:syntastic_<filetype>_checkers=['<checker-name>']
|
||||
```
|
||||
|
||||
To see the list of checkers for your filetype, look in `syntax_checkers/<filetype>/`.
|
||||
|
||||
e.g. Python has the following checkers: `flake8`, `pyflakes`, `pylint` and a native `python` checker.
|
||||
|
||||
To tell syntastic to use `pylint`, you would use this setting:
|
||||
```vim
|
||||
let g:syntastic_python_checkers=['pylint']
|
||||
```
|
||||
|
||||
Some filetypes, like PHP, have style checkers as well as syntax checkers. These can be chained together like this:
|
||||
```vim
|
||||
let g:syntastic_php_checkers=['php', 'phpcs', 'phpmd']
|
||||
```
|
||||
|
||||
This is telling syntastic to run the `php` checker first, and if no errors are found, run `phpcs`, and then `phpmd`.
|
||||
|
||||
__Q. How can I jump between the different errors without using the location list at the bottom of the window?__
|
||||
|
||||
A. Vim provides several built in commands for this. See `:help :lnext` and `:help :lprev`.
|
||||
|
||||
If you use these commands a lot then you may want to add shortcut mappings to your vimrc, or install something like [unimpaired](https://github.com/tpope/vim-unimpaired), which provides such mappings (among other things).
|
||||
|
||||
__Q. A syntax checker is giving me unwanted/strange style tips?__
|
||||
|
||||
A. Some filetypes (e.g. php) have style checkers as well as syntax checkers. You can usually configure the options that are passed to the style checkers, or just disable them. Take a look at the [wiki](https://github.com/scrooloose/syntastic/wiki/Syntaxcheckers) to see what options are available.
|
||||
|
||||
__Q. The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?__
|
||||
|
||||
A. There is no safe way to handle that situation automatically, but you can work around it:
|
||||
|
||||
```vim
|
||||
nnoremap <silent> <C-d> :lclose<CR>:bdelete<CR>
|
||||
cabbrev <silent> bd lclose\|bdelete
|
||||
```
|
BIN
sources_non_forked/syntastic/_assets/screenshot_1.png
Normal file
BIN
sources_non_forked/syntastic/_assets/screenshot_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 90 KiB |
239
sources_non_forked/syntastic/autoload/syntastic/c.vim
Normal file
239
sources_non_forked/syntastic/autoload/syntastic/c.vim
Normal file
@ -0,0 +1,239 @@
|
||||
if exists("g:loaded_syntastic_c_autoload")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_autoload = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" initialize c/cpp syntax checker handlers
|
||||
function! s:Init()
|
||||
let s:handlers = []
|
||||
let s:cflags = {}
|
||||
|
||||
call s:RegHandler('gtk', 'syntastic#c#CheckPKG',
|
||||
\ ['gtk', 'gtk+-2.0', 'gtk+', 'glib-2.0', 'glib'])
|
||||
call s:RegHandler('glib', 'syntastic#c#CheckPKG',
|
||||
\ ['glib', 'glib-2.0', 'glib'])
|
||||
call s:RegHandler('glade', 'syntastic#c#CheckPKG',
|
||||
\ ['glade', 'libglade-2.0', 'libglade'])
|
||||
call s:RegHandler('libsoup', 'syntastic#c#CheckPKG',
|
||||
\ ['libsoup', 'libsoup-2.4', 'libsoup-2.2'])
|
||||
call s:RegHandler('webkit', 'syntastic#c#CheckPKG',
|
||||
\ ['webkit', 'webkit-1.0'])
|
||||
call s:RegHandler('cairo', 'syntastic#c#CheckPKG',
|
||||
\ ['cairo', 'cairo'])
|
||||
call s:RegHandler('pango', 'syntastic#c#CheckPKG',
|
||||
\ ['pango', 'pango'])
|
||||
call s:RegHandler('libxml', 'syntastic#c#CheckPKG',
|
||||
\ ['libxml', 'libxml-2.0', 'libxml'])
|
||||
call s:RegHandler('freetype', 'syntastic#c#CheckPKG',
|
||||
\ ['freetype', 'freetype2', 'freetype'])
|
||||
call s:RegHandler('SDL', 'syntastic#c#CheckPKG',
|
||||
\ ['sdl', 'sdl'])
|
||||
call s:RegHandler('opengl', 'syntastic#c#CheckPKG',
|
||||
\ ['opengl', 'gl'])
|
||||
call s:RegHandler('ruby', 'syntastic#c#CheckRuby', [])
|
||||
call s:RegHandler('Python\.h', 'syntastic#c#CheckPython', [])
|
||||
call s:RegHandler('php\.h', 'syntastic#c#CheckPhp', [])
|
||||
endfunction
|
||||
|
||||
" default include directories
|
||||
let s:default_includes = [ '.', '..', 'include', 'includes',
|
||||
\ '../include', '../includes' ]
|
||||
|
||||
" convenience function to determine the 'null device' parameter
|
||||
" based on the current operating system
|
||||
function! syntastic#c#GetNullDevice()
|
||||
if has('win32')
|
||||
return '-o nul'
|
||||
elseif has('unix') || has('mac')
|
||||
return '-o /dev/null'
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" get the gcc include directory argument depending on the default
|
||||
" includes and the optional user-defined 'g:syntastic_c_include_dirs'
|
||||
function! syntastic#c#GetIncludeDirs(filetype)
|
||||
let include_dirs = []
|
||||
|
||||
if !exists('g:syntastic_'.a:filetype.'_no_default_include_dirs') ||
|
||||
\ !g:syntastic_{a:filetype}_no_default_include_dirs
|
||||
let include_dirs = copy(s:default_includes)
|
||||
endif
|
||||
|
||||
if exists('g:syntastic_'.a:filetype.'_include_dirs')
|
||||
call extend(include_dirs, g:syntastic_{a:filetype}_include_dirs)
|
||||
endif
|
||||
|
||||
return join(map(syntastic#util#unique(include_dirs), '"-I" . v:val'), ' ')
|
||||
endfunction
|
||||
|
||||
" read additional compiler flags from the given configuration file
|
||||
" the file format and its parsing mechanism is inspired by clang_complete
|
||||
function! syntastic#c#ReadConfig(file)
|
||||
" search in the current file's directory upwards
|
||||
let config = findfile(a:file, '.;')
|
||||
if config == '' || !filereadable(config) | return '' | endif
|
||||
|
||||
" convert filename into absolute path
|
||||
let filepath = substitute(fnamemodify(config, ':p:h'), '\', '/', 'g')
|
||||
|
||||
" try to read config file
|
||||
try
|
||||
let lines = map(readfile(config),
|
||||
\ 'substitute(v:val, ''\'', ''/'', ''g'')')
|
||||
catch /E484/
|
||||
return ''
|
||||
endtry
|
||||
|
||||
let parameters = []
|
||||
for line in lines
|
||||
let matches = matchlist(line, '\C^\s*-I\s*\(\S\+\)')
|
||||
if matches != [] && matches[1] != ''
|
||||
" this one looks like an absolute path
|
||||
if match(matches[1], '^\%(/\|\a:\)') != -1
|
||||
call add(parameters, '-I' . matches[1])
|
||||
else
|
||||
call add(parameters, '-I' . filepath . '/' . matches[1])
|
||||
endif
|
||||
else
|
||||
call add(parameters, line)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return join(parameters, ' ')
|
||||
endfunction
|
||||
|
||||
" search the first 100 lines for include statements that are
|
||||
" given in the handlers dictionary
|
||||
function! syntastic#c#SearchHeaders()
|
||||
let includes = ''
|
||||
let files = []
|
||||
let found = []
|
||||
let lines = filter(getline(1, 100), 'v:val =~# "#\s*include"')
|
||||
|
||||
" search current buffer
|
||||
for line in lines
|
||||
let file = matchstr(line, '"\zs\S\+\ze"')
|
||||
if file != ''
|
||||
call add(files, file)
|
||||
continue
|
||||
endif
|
||||
for handler in s:handlers
|
||||
if line =~# handler["regex"]
|
||||
let includes .= call(handler["func"], handler["args"])
|
||||
call add(found, handler["regex"])
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
||||
" search included headers
|
||||
for hfile in files
|
||||
if hfile != ''
|
||||
let filename = expand('%:p:h') . (has('win32') ?
|
||||
\ '\' : '/') . hfile
|
||||
try
|
||||
let lines = readfile(filename, '', 100)
|
||||
catch /E484/
|
||||
continue
|
||||
endtry
|
||||
let lines = filter(lines, 'v:val =~# "#\s*include"')
|
||||
for handler in s:handlers
|
||||
if index(found, handler["regex"]) != -1
|
||||
continue
|
||||
endif
|
||||
for line in lines
|
||||
if line =~# handler["regex"]
|
||||
let includes .= call(handler["func"], handler["args"])
|
||||
call add(found, handler["regex"])
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
endif
|
||||
endfor
|
||||
|
||||
return includes
|
||||
endfunction
|
||||
|
||||
" try to find library with 'pkg-config'
|
||||
" search possible libraries from first to last given
|
||||
" argument until one is found
|
||||
function! syntastic#c#CheckPKG(name, ...)
|
||||
if executable('pkg-config')
|
||||
if !has_key(s:cflags, a:name)
|
||||
for i in range(a:0)
|
||||
let l:cflags = system('pkg-config --cflags '.a:000[i])
|
||||
" since we cannot necessarily trust the pkg-config exit code
|
||||
" we have to check for an error output as well
|
||||
if v:shell_error == 0 && l:cflags !~? 'not found'
|
||||
let l:cflags = ' '.substitute(l:cflags, "\n", '', '')
|
||||
let s:cflags[a:name] = l:cflags
|
||||
return l:cflags
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
return s:cflags[a:name]
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" try to find PHP includes with 'php-config'
|
||||
function! syntastic#c#CheckPhp()
|
||||
if executable('php-config')
|
||||
if !exists('s:php_flags')
|
||||
let s:php_flags = system('php-config --includes')
|
||||
let s:php_flags = ' ' . substitute(s:php_flags, "\n", '', '')
|
||||
endif
|
||||
return s:php_flags
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" try to find the ruby headers with 'rbconfig'
|
||||
function! syntastic#c#CheckRuby()
|
||||
if executable('ruby')
|
||||
if !exists('s:ruby_flags')
|
||||
let s:ruby_flags = system('ruby -r rbconfig -e '
|
||||
\ . '''puts RbConfig::CONFIG["rubyhdrdir"] || RbConfig::CONFIG["archdir"]''')
|
||||
let s:ruby_flags = substitute(s:ruby_flags, "\n", '', '')
|
||||
let s:ruby_flags = ' -I' . s:ruby_flags
|
||||
endif
|
||||
return s:ruby_flags
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" try to find the python headers with distutils
|
||||
function! syntastic#c#CheckPython()
|
||||
if executable('python')
|
||||
if !exists('s:python_flags')
|
||||
let s:python_flags = system('python -c ''from distutils import '
|
||||
\ . 'sysconfig; import sys; sys.stdout.write(sysconfig.get_python_inc())''')
|
||||
let s:python_flags = substitute(s:python_flags, "\n", '', '')
|
||||
let s:python_flags = ' -I' . s:python_flags
|
||||
endif
|
||||
return s:python_flags
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" return a handler dictionary object
|
||||
function! s:RegHandler(regex, function, args)
|
||||
let handler = {}
|
||||
let handler["regex"] = a:regex
|
||||
let handler["func"] = function(a:function)
|
||||
let handler["args"] = a:args
|
||||
call add(s:handlers, handler)
|
||||
endfunction
|
||||
|
||||
call s:Init()
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
50
sources_non_forked/syntastic/autoload/syntastic/makeprg.vim
Normal file
50
sources_non_forked/syntastic/autoload/syntastic/makeprg.vim
Normal file
@ -0,0 +1,50 @@
|
||||
if exists("g:loaded_syntastic_makeprg_autoload")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_makeprg_autoload = 1
|
||||
|
||||
"Returns a makeprg of the form
|
||||
"
|
||||
"[exe] [args] [filename] [post_args] [tail]
|
||||
"
|
||||
"A (made up) example:
|
||||
" ruby -a -b -c test_file.rb --more --args > /tmp/output
|
||||
"
|
||||
"To generate this you would call:
|
||||
"
|
||||
" let makeprg = syntastic#makeprg#build({
|
||||
" \ 'exe': 'ruby',
|
||||
" \ 'args': '-a -b -c',
|
||||
" \ 'post_args': '--more --args',
|
||||
" \ 'tail': '> /tmp/output',
|
||||
" \ 'filetype': 'ruby',
|
||||
" \ 'subchecker': 'mri' })
|
||||
"
|
||||
"Note that the current filename is added by default - but can be overridden by
|
||||
"passing in an 'fname' arg.
|
||||
"
|
||||
"Arguments 'filetype' and 'subchecker' are mandatory, handling of composite
|
||||
"types and user-defined variables breaks if you omit them.
|
||||
"
|
||||
"All other options can be overriden by the user with global variables - even
|
||||
"when not specified by the checker in syntastic#makeprg#build().
|
||||
"
|
||||
"E.g. They could override the checker exe with
|
||||
"
|
||||
" let g:syntastic_ruby_mri_exe="another_ruby_checker_exe.rb"
|
||||
"
|
||||
"The general form of the override option is:
|
||||
" syntastic_[filetype]_[subchecker]_[option-name]
|
||||
"
|
||||
function! syntastic#makeprg#build(opts)
|
||||
let builder = g:SyntasticMakeprgBuilder.New(
|
||||
\ get(a:opts, 'exe', ''),
|
||||
\ get(a:opts, 'args', ''),
|
||||
\ get(a:opts, 'fname', ''),
|
||||
\ get(a:opts, 'post_args', ''),
|
||||
\ get(a:opts, 'tail', ''),
|
||||
\ get(a:opts, 'filetype', ''),
|
||||
\ get(a:opts, 'subchecker', '') )
|
||||
|
||||
return builder.makeprg()
|
||||
endfunction
|
@ -0,0 +1,71 @@
|
||||
if exists("g:loaded_syntastic_postprocess_autoload")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_postprocess_autoload = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! s:compareErrorItems(a, b)
|
||||
if a:a['bufnr'] != a:b['bufnr']
|
||||
" group by files
|
||||
return a:a['bufnr'] - a:b['bufnr']
|
||||
elseif a:a['lnum'] != a:b['lnum']
|
||||
return a:a['lnum'] - a:b['lnum']
|
||||
elseif a:a['type'] !=? a:b['type']
|
||||
" errors take precedence over warnings
|
||||
return a:a['type'] ==? 'e' ? -1 : 1
|
||||
else
|
||||
return get(a:a, 'col') - get(a:b, 'col')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" natural sort
|
||||
function! syntastic#postprocess#sort(errors)
|
||||
return sort(a:errors, 's:compareErrorItems')
|
||||
endfunction
|
||||
|
||||
function syntastic#postprocess#compressWhitespace(errors)
|
||||
let llist = []
|
||||
|
||||
for e in a:errors
|
||||
let e['text'] = substitute(e['text'], "\001", '', 'g')
|
||||
let e['text'] = substitute(e['text'], '\n', ' ', 'g')
|
||||
let e['text'] = substitute(e['text'], '\s\{2,}', ' ', 'g')
|
||||
call add(llist, e)
|
||||
endfor
|
||||
|
||||
return llist
|
||||
endfunction
|
||||
|
||||
" remove spurious CR under Cygwin
|
||||
function! syntastic#postprocess#cygwinRemoveCR(errors)
|
||||
if has('win32unix')
|
||||
let llist = []
|
||||
|
||||
for e in a:errors
|
||||
let e['text'] = substitute(e['text'], '\r', '', 'g')
|
||||
call add(llist, e)
|
||||
endfor
|
||||
else
|
||||
let llist = a:errors
|
||||
endif
|
||||
|
||||
return llist
|
||||
endfunction
|
||||
|
||||
" decode XML entities
|
||||
function! syntastic#postprocess#decodeXMLEntities(errors)
|
||||
let llist = []
|
||||
|
||||
for e in a:errors
|
||||
let e['text'] = syntastic#util#decodeXMLEntities(e['text'])
|
||||
call add(llist, e)
|
||||
endfor
|
||||
|
||||
return llist
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim: set et sts=4 sw=4:
|
212
sources_non_forked/syntastic/autoload/syntastic/util.vim
Normal file
212
sources_non_forked/syntastic/autoload/syntastic/util.vim
Normal file
@ -0,0 +1,212 @@
|
||||
if exists("g:loaded_syntastic_util_autoload")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_util_autoload = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists("g:syntastic_debug")
|
||||
let g:syntastic_debug = 0
|
||||
endif
|
||||
|
||||
let s:deprecationNoticesIssued = []
|
||||
|
||||
function! syntastic#util#DevNull()
|
||||
if has('win32')
|
||||
return 'NUL'
|
||||
endif
|
||||
return '/dev/null'
|
||||
endfunction
|
||||
|
||||
"search the first 5 lines of the file for a magic number and return a map
|
||||
"containing the args and the executable
|
||||
"
|
||||
"e.g.
|
||||
"
|
||||
"#!/usr/bin/perl -f -bar
|
||||
"
|
||||
"returns
|
||||
"
|
||||
"{'exe': '/usr/bin/perl', 'args': ['-f', '-bar']}
|
||||
function! syntastic#util#parseShebang()
|
||||
for lnum in range(1,5)
|
||||
let line = getline(lnum)
|
||||
|
||||
if line =~ '^#!'
|
||||
let exe = matchstr(line, '^#!\s*\zs[^ \t]*')
|
||||
let args = split(matchstr(line, '^#!\s*[^ \t]*\zs.*'))
|
||||
return {'exe': exe, 'args': args}
|
||||
endif
|
||||
endfor
|
||||
|
||||
return {'exe': '', 'args': []}
|
||||
endfunction
|
||||
|
||||
" Run 'command' in a shell and parse output as a version string.
|
||||
" Returns an array of version components.
|
||||
function! syntastic#util#parseVersion(command)
|
||||
return split(matchstr( system(a:command), '\v^\D*\zs\d+(\.\d+)+\ze' ), '\.')
|
||||
endfunction
|
||||
|
||||
" Verify that the 'installed' version is at least the 'required' version.
|
||||
"
|
||||
" 'installed' and 'required' must be arrays. If they have different lengths,
|
||||
" the "missing" elements will be assumed to be 0 for the purposes of checking.
|
||||
"
|
||||
" See http://semver.org for info about version numbers.
|
||||
function! syntastic#util#versionIsAtLeast(installed, required)
|
||||
for index in range(max([len(a:installed), len(a:required)]))
|
||||
if len(a:installed) <= index
|
||||
let installed_element = 0
|
||||
else
|
||||
let installed_element = a:installed[index]
|
||||
endif
|
||||
if len(a:required) <= index
|
||||
let required_element = 0
|
||||
else
|
||||
let required_element = a:required[index]
|
||||
endif
|
||||
if installed_element != required_element
|
||||
return installed_element > required_element
|
||||
endif
|
||||
endfor
|
||||
" Everything matched, so it is at least the required version.
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"print as much of a:msg as possible without "Press Enter" prompt appearing
|
||||
function! syntastic#util#wideMsg(msg)
|
||||
let old_ruler = &ruler
|
||||
let old_showcmd = &showcmd
|
||||
|
||||
"convert tabs to spaces so that the tabs count towards the window width
|
||||
"as the proper amount of characters
|
||||
let msg = substitute(a:msg, "\t", repeat(" ", &tabstop), "g")
|
||||
let msg = strpart(msg, 0, winwidth(0)-1)
|
||||
|
||||
"This is here because it is possible for some error messages to begin with
|
||||
"\n which will cause a "press enter" prompt. I have noticed this in the
|
||||
"javascript:jshint checker and have been unable to figure out why it
|
||||
"happens
|
||||
let msg = substitute(msg, "\n", "", "g")
|
||||
|
||||
set noruler noshowcmd
|
||||
redraw
|
||||
|
||||
echo msg
|
||||
|
||||
let &ruler=old_ruler
|
||||
let &showcmd=old_showcmd
|
||||
endfunction
|
||||
|
||||
" Check whether a buffer is loaded, listed, and not hidden
|
||||
function! syntastic#util#bufIsActive(buffer)
|
||||
" convert to number, or hell breaks loose
|
||||
let buf = str2nr(a:buffer)
|
||||
|
||||
if !bufloaded(buf) || !buflisted(buf)
|
||||
return 0
|
||||
endif
|
||||
|
||||
" get rid of hidden buffers
|
||||
for tab in range(1, tabpagenr('$'))
|
||||
if index(tabpagebuflist(tab), buf) >= 0
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" start in directory a:where and walk up the parent folders until it
|
||||
" finds a file matching a:what; return path to that file
|
||||
function! syntastic#util#findInParent(what, where)
|
||||
let here = fnamemodify(a:where, ':p')
|
||||
|
||||
while !empty(here)
|
||||
let p = split(globpath(here, a:what), '\n')
|
||||
|
||||
if !empty(p)
|
||||
return fnamemodify(p[0], ':p')
|
||||
elseif here == '/'
|
||||
break
|
||||
endif
|
||||
|
||||
" we use ':h:h' rather than ':h' since ':p' adds a trailing '/'
|
||||
" if 'here' is a directory
|
||||
let here = fnamemodify(here, ':p:h:h')
|
||||
endwhile
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" Returns unique elements in a list
|
||||
function! syntastic#util#unique(list)
|
||||
let seen = {}
|
||||
let uniques = []
|
||||
for e in a:list
|
||||
if !has_key(seen, e)
|
||||
let seen[e] = 1
|
||||
call add(uniques, e)
|
||||
endif
|
||||
endfor
|
||||
return uniques
|
||||
endfunction
|
||||
|
||||
" A less noisy shellescape()
|
||||
function! syntastic#util#shescape(string)
|
||||
return a:string =~ '\m^[A-Za-z0-9_/.-]\+$' ? a:string : shellescape(a:string)
|
||||
endfunction
|
||||
|
||||
" A less noisy shellescape(expand())
|
||||
function! syntastic#util#shexpand(string)
|
||||
return syntastic#util#shescape(expand(a:string))
|
||||
endfunction
|
||||
|
||||
" decode XML entities
|
||||
function! syntastic#util#decodeXMLEntities(string)
|
||||
let str = a:string
|
||||
let str = substitute(str, '<', '<', 'g')
|
||||
let str = substitute(str, '>', '>', 'g')
|
||||
let str = substitute(str, '"', '"', 'g')
|
||||
let str = substitute(str, ''', "'", 'g')
|
||||
let str = substitute(str, '&', '\&', 'g')
|
||||
return str
|
||||
endfunction
|
||||
|
||||
function! syntastic#util#debug(msg)
|
||||
if g:syntastic_debug
|
||||
echomsg "syntastic: debug: " . a:msg
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! syntastic#util#info(msg)
|
||||
echomsg "syntastic: info: " . a:msg
|
||||
endfunction
|
||||
|
||||
function! syntastic#util#warn(msg)
|
||||
echohl WarningMsg
|
||||
echomsg "syntastic: warning: " . a:msg
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
function! syntastic#util#error(msg)
|
||||
execute "normal \<Esc>"
|
||||
echohl ErrorMsg
|
||||
echomsg "syntastic: error: " . a:msg
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
function! syntastic#util#deprecationWarn(msg)
|
||||
if index(s:deprecationNoticesIssued, a:msg) >= 0
|
||||
return
|
||||
endif
|
||||
|
||||
call add(s:deprecationNoticesIssued, a:msg)
|
||||
call syntastic#util#warn(a:msg)
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim: set et sts=4 sw=4:
|
468
sources_non_forked/syntastic/doc/syntastic.txt
Normal file
468
sources_non_forked/syntastic/doc/syntastic.txt
Normal file
@ -0,0 +1,468 @@
|
||||
*syntastic.txt* Syntax checking on the fly has never been so pimp.
|
||||
*syntastic*
|
||||
|
||||
|
||||
It's a bird! It's a plane! ZOMG It's ... ~
|
||||
|
||||
_____ __ __ _ ~
|
||||
/ ___/__ ______ / /_____ ______/ /_(_)____ ~
|
||||
\__ \/ / / / __ \/ __/ __ `/ ___/ __/ / ___/ ~
|
||||
___/ / /_/ / / / / /_/ /_/ (__ ) /_/ / /__ ~
|
||||
/____/\__, /_/ /_/\__/\__,_/____/\__/_/\___/ ~
|
||||
/____/ ~
|
||||
|
||||
|
||||
|
||||
Reference Manual~
|
||||
|
||||
|
||||
==============================================================================
|
||||
CONTENTS *syntastic-contents*
|
||||
|
||||
1.Intro...................................|syntastic-intro|
|
||||
2.Functionality provided..................|syntastic-functionality|
|
||||
2.1.The statusline flag...............|syntastic-statusline-flag|
|
||||
2.2.Error signs.......................|syntastic-error-signs|
|
||||
2.3.Error window......................|syntastic-error-window|
|
||||
3.Commands................................|syntastic-commands|
|
||||
4.Global Options..........................|syntastic-global-options|
|
||||
5.Checker Options.........................|syntastic-checker-options|
|
||||
6.About...................................|syntastic-about|
|
||||
7.License.................................|syntastic-license|
|
||||
|
||||
|
||||
==============================================================================
|
||||
1. Intro *syntastic-intro*
|
||||
|
||||
Note: This doc only deals with using syntastic. To learn how to write syntax
|
||||
checker integrations, see the guide on the github wiki:
|
||||
|
||||
https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
|
||||
|
||||
Syntastic is a syntax checking plugin that runs files through external syntax
|
||||
checkers. This can be done on demand, or automatically as files are saved and
|
||||
opened. If syntax errors are detected, the user is notified and is happy
|
||||
because they didn't have to compile their code or execute their script to find
|
||||
them.
|
||||
|
||||
Syntastic comes in two parts: the syntax checker plugins, and the core. The
|
||||
syntax checker plugins are defined on a per-filetype basis where each one wraps
|
||||
up an external syntax checking program. The core script delegates off to these
|
||||
plugins and uses their output to provide the syntastic functionality.
|
||||
|
||||
Take a look in the syntax_checkers directory for a list of supported filetypes
|
||||
and checkers.
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. Functionality provided *syntastic-functionality*
|
||||
|
||||
Syntax checking can be done automatically or on demand (see
|
||||
|'syntastic_mode_map'| for configuring this).
|
||||
|
||||
When syntax checking is done, the features below can be used to notify the
|
||||
user of errors. See |syntastic-options| for how to configure and
|
||||
activate/deactivate these features.
|
||||
|
||||
* A statusline flag
|
||||
* Signs beside lines with errors
|
||||
* The |location-list| can be populated with the errors for the associated
|
||||
buffer.
|
||||
* Erroneous parts of lines can be highlighted (this functionality is only
|
||||
provided by some syntax checkers).
|
||||
* Balloons (if compiled in) can be used to display error messages for
|
||||
erroneous lines when hovering the mouse over them.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
2.1. The statusline flag *syntastic-statusline-flag*
|
||||
|
||||
To use the statusline flag, this must appear in your |'statusline'| setting >
|
||||
%{SyntasticStatuslineFlag()}
|
||||
<
|
||||
Something like this could be more useful: >
|
||||
set statusline+=%#warningmsg#
|
||||
set statusline+=%{SyntasticStatuslineFlag()}
|
||||
set statusline+=%*
|
||||
<
|
||||
When syntax errors are detected a flag will be shown. The content of the flag
|
||||
is derived from the |syntastic_stl_format| option
|
||||
------------------------------------------------------------------------------
|
||||
2.2. Error signs *syntastic-error-signs*
|
||||
|
||||
Syntastic uses the |:sign| commands to mark lines with errors and warnings in
|
||||
the sign column. To enable this feature, use the |'syntastic_enable_signs'|
|
||||
option.
|
||||
|
||||
Signs are colored using the Error and Todo syntax highlight groups by default.
|
||||
If you wish to customize the colors for the signs, you can use the following
|
||||
groups:
|
||||
SyntasticErrorSign - For syntax errors, links to 'error' by default
|
||||
SyntasticWarningSign - For syntax warnings, links to 'todo' by default
|
||||
SyntasticStyleErrorSign - For style errors, links to 'SyntasticErrorSign'
|
||||
by default
|
||||
SyntasticStyleWarningSign - For style warnings, links to
|
||||
'SyntasticWarningSign' by default
|
||||
|
||||
Example: >
|
||||
highlight SyntasticErrorSign guifg=white guibg=red
|
||||
<
|
||||
To set up highlighting for the line where a sign resides, you can use the
|
||||
following highlight groups:
|
||||
SyntasticErrorLine
|
||||
SyntasticWarningLine
|
||||
SyntasticStyleErrorLine - Links to 'SyntasticErrorLine' by default
|
||||
SyntasticStyleWarningLine - Links to 'SyntasticWarningLine' by default
|
||||
|
||||
Example: >
|
||||
highlight SyntasticErrorLine guibg=#2f0000
|
||||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
2.3. The error window *:Errors* *syntastic-error-window*
|
||||
|
||||
You can use the :Errors command to display the errors for the current buffer
|
||||
in the |location-list|.
|
||||
|
||||
Note that when you use :Errors, the current location list is overwritten with
|
||||
Syntastic's own location list.
|
||||
|
||||
|
||||
==============================================================================
|
||||
3. Commands *syntastic-commands*
|
||||
|
||||
:Errors *:SyntasticErrors*
|
||||
|
||||
When errors have been detected, use this command to pop up the |location-list|
|
||||
and display the error messages.
|
||||
|
||||
|
||||
:SyntasticToggleMode *:SyntasticToggleMode*
|
||||
|
||||
Toggles syntastic between active and passive mode. See |'syntastic_mode_map'|
|
||||
for more info.
|
||||
|
||||
|
||||
:SyntasticCheck *:SyntasticCheck*
|
||||
|
||||
Manually cause a syntax check to be done. Useful in passive mode, or if the
|
||||
current filetype is set to passive. See |'syntastic_mode_map'| for more info.
|
||||
|
||||
:SyntasticInfo *:SyntasticInfo*
|
||||
|
||||
Output info about what checkers are available and in use for the current
|
||||
filetype.
|
||||
|
||||
:SyntasticReset *:SyntasticReset*
|
||||
|
||||
Resets the list of errors and turns off all error notifiers.
|
||||
|
||||
|
||||
==============================================================================
|
||||
4. Global Options *syntastic-global-options*
|
||||
|
||||
|
||||
*'syntastic_check_on_open'*
|
||||
Default: 0
|
||||
If enabled, syntastic will do syntax checks when buffers are first loaded as
|
||||
well as on saving >
|
||||
let g:syntastic_check_on_open=1
|
||||
<
|
||||
|
||||
*'syntastic_check_on_wq'*
|
||||
Default: 1
|
||||
Normally syntastic runs syntax checks whenever buffers are written to disk.
|
||||
If you want to skip these checks when you issue |:wq|, |:x|, and |:ZZ|, set this
|
||||
variable to 0. >
|
||||
let g:syntastic_check_on_wq=0
|
||||
<
|
||||
|
||||
*'syntastic_aggregate_errors'*
|
||||
Default: 0
|
||||
When enabled, |:SyntasticCheck| runs all checkers that apply, then aggregates
|
||||
errors found by all checkers and displays them. When disabled,
|
||||
|:SyntasticCheck| runs each checker in turn, and stops to display the results
|
||||
the first time a checker finds any errors. >
|
||||
let g:syntastic_aggregate_errors=1
|
||||
<
|
||||
|
||||
*'syntastic_echo_current_error'*
|
||||
Default: 1
|
||||
If enabled, syntastic will echo the error associated with the current line to
|
||||
the command window. If multiple errors are found, the first will be used. >
|
||||
let g:syntastic_echo_current_error=1
|
||||
<
|
||||
|
||||
*'syntastic_enable_signs'*
|
||||
Default: 1
|
||||
Use this option to tell syntastic whether to use the |:sign| interface to mark
|
||||
syntax errors: >
|
||||
let g:syntastic_enable_signs=1
|
||||
<
|
||||
|
||||
*'syntastic_error_symbol'* *'syntastic_style_error_symbol'*
|
||||
*'syntastic_warning_symbol'* *'syntastic_style_warning_symbol'*
|
||||
Use this option to control what the syntastic |:sign| text contains. Several
|
||||
error symobls can be customized:
|
||||
syntastic_error_symbol - For syntax errors, defaults to '>>'
|
||||
syntastic_style_error_symbol - For style errors, defaults to 'S>'
|
||||
syntastic_warning_symbol - For syntax warnings, defaults to '>>'
|
||||
syntastic_style_warning_symbol - For style warnings, defaults to 'S>'
|
||||
|
||||
Example: >
|
||||
let g:syntastic_error_symbol='✗'
|
||||
let g:syntastic_warning_symbol='⚠'
|
||||
<
|
||||
|
||||
*'syntastic_enable_balloons'*
|
||||
Default: 1
|
||||
Use this option to tell syntastic whether to display error messages in balloons
|
||||
when the mouse is hovered over erroneous lines: >
|
||||
let g:syntastic_enable_balloons = 1
|
||||
<
|
||||
Note that vim must be compiled with |+balloon_eval|.
|
||||
|
||||
*'syntastic_enable_highlighting'*
|
||||
Default: 1
|
||||
Use this option to tell syntastic whether to use syntax highlighting to mark
|
||||
errors (where possible). Highlighting can be turned off with the following >
|
||||
let g:syntastic_enable_highlighting = 0
|
||||
<
|
||||
|
||||
*'syntastic_always_populate_loc_list'*
|
||||
Default: 0
|
||||
Enable this option to tell syntastic to always stick any detected errors into
|
||||
the loclist: >
|
||||
let g:syntastic_always_populate_loc_list=1
|
||||
<
|
||||
*'syntastic_auto_jump'*
|
||||
Default: 0
|
||||
Enable this option if you want the cursor to jump to the first detected error
|
||||
when saving or opening a file: >
|
||||
let g:syntastic_auto_jump=1
|
||||
<
|
||||
|
||||
*'syntastic_auto_loc_list'*
|
||||
Default: 2
|
||||
Use this option to tell syntastic to automatically open and/or close the
|
||||
|location-list| (see |syntastic-error-window|).
|
||||
|
||||
When set to 0 the error window will not be opened or closed automatically. >
|
||||
let g:syntastic_auto_loc_list=0
|
||||
<
|
||||
|
||||
When set to 1 the error window will be automatically opened when errors are
|
||||
detected, and closed when none are detected. >
|
||||
let g:syntastic_auto_loc_list=1
|
||||
<
|
||||
When set to 2 the error window will be automatically closed when no errors are
|
||||
detected, but not opened automatically. >
|
||||
let g:syntastic_auto_loc_list=2
|
||||
<
|
||||
|
||||
*'syntastic_loc_list_height'*
|
||||
Default: 10
|
||||
Use this option to specify the height of the location lists that syntastic
|
||||
opens. >
|
||||
let g:syntastic_loc_list_height=5
|
||||
<
|
||||
|
||||
*'syntastic_ignore_files'*
|
||||
Default: []
|
||||
Use this option to specify files that syntastic should neither check, nor
|
||||
include in error lists. It has to be a list of |regular-expression| patterns.
|
||||
The full paths of files (see |::p|) are matched against these patterns, and
|
||||
the matches are case sensitive. Use |\c| if you need case insensitive
|
||||
patterns. >
|
||||
let g:syntastic_ignore_files=['^/usr/include/', '\c\.h$']
|
||||
<
|
||||
|
||||
*'syntastic_filetype_map'*
|
||||
Default: {}
|
||||
Use this option to map non-standard filetypes to standard ones. Corresponding
|
||||
checkers are mapped accordingly, which allows syntastic to check files with
|
||||
non-standard filetypes: >
|
||||
let g:syntastic_filetype_map = { 'latex': 'tex',
|
||||
\ 'gentoo-metadata': 'xml' }
|
||||
<
|
||||
|
||||
*'syntastic_mode_map'*
|
||||
Default: { "mode": "active",
|
||||
"active_filetypes": [],
|
||||
"passive_filetypes": [] }
|
||||
|
||||
Use this option to fine tune when automatic syntax checking is done (or not
|
||||
done).
|
||||
|
||||
The option should be set to something like: >
|
||||
|
||||
let g:syntastic_mode_map = { 'mode': 'active',
|
||||
\ 'active_filetypes': ['ruby', 'php'],
|
||||
\ 'passive_filetypes': ['puppet'] }
|
||||
<
|
||||
|
||||
"mode" can be mapped to one of two values - "active" or "passive". When set to
|
||||
active, syntastic does automatic checking whenever a buffer is saved or
|
||||
initially opened. When set to "passive" syntastic only checks when the user
|
||||
calls |:SyntasticCheck|.
|
||||
|
||||
The exceptions to these rules are defined with "active_filetypes" and
|
||||
"passive_filetypes". In passive mode, automatic checks are still done
|
||||
for all filetypes in the "active_filetypes" array. In active mode,
|
||||
automatic checks are not done for any filetypes in the
|
||||
"passive_filetypes" array.
|
||||
|
||||
At runtime, the |:SyntasticToggleMode| command can be used to switch between
|
||||
active and passive mode.
|
||||
|
||||
If any of "mode", "active_filetypes", or "passive_filetypes" are not specified
|
||||
then they will default to their default value as above.
|
||||
|
||||
*'syntastic_quiet_warnings'*
|
||||
|
||||
Use this option if you only care about syntax errors, not warnings. When set,
|
||||
this option has the following effects:
|
||||
* no |signs| appear unless there is at least one error, whereupon both
|
||||
errors and warnings are displayed
|
||||
* the |'syntastic_auto_loc_list'| option only pops up the error window if
|
||||
there's at least one error, whereupon both errors and warnings are
|
||||
displayed
|
||||
>
|
||||
let g:syntastic_quiet_warnings=1
|
||||
<
|
||||
|
||||
*'syntastic_stl_format'*
|
||||
|
||||
Default: [Syntax: line:%F (%t)]
|
||||
Use this option to control what the syntastic statusline text contains. Several
|
||||
magic flags are available to insert information:
|
||||
%e - number of errors
|
||||
%w - number of warnings
|
||||
%t - total number of warnings and errors
|
||||
%fe - line number of first error
|
||||
%fw - line number of first warning
|
||||
%F - line number of first warning or error
|
||||
|
||||
Several additional flags are available to hide text under certain conditions:
|
||||
%E{...} - hide the text in the brackets unless there are errors
|
||||
%W{...} - hide the text in the brackets unless there are warnings
|
||||
%B{...} - hide the text in the brackets unless there are both warnings AND
|
||||
errors
|
||||
These flags cant be nested.
|
||||
|
||||
Example: >
|
||||
let g:syntastic_stl_format = '[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]'
|
||||
<
|
||||
If this format is used and the current buffer has 5 errors and 1 warning
|
||||
starting on lines 20 and 10 respectively then this would appear on the
|
||||
statusline: >
|
||||
[Err: 20 #5, Warn: 10 #1]
|
||||
<
|
||||
If the buffer had 2 warnings, starting on line 5 then this would appear: >
|
||||
[Warn: 5 #2]
|
||||
<
|
||||
*'syntastic_full_redraws'*
|
||||
Default: 0 in GUI Vim and MacVim, 1 otherwise
|
||||
Controls whether syntastic calls |:redraw| or |:redraw!| for screen redraws.
|
||||
Changing it can in principle make screen redraws smoother, but it can also
|
||||
cause screen flicker, or ghost characters. Leaving it to the default should
|
||||
be safe.
|
||||
|
||||
*'syntastic_debug'*
|
||||
Default: 0
|
||||
Set this to 1 to enable debugging: >
|
||||
let g:syntastic_debug = 1
|
||||
<
|
||||
Checkers will then add debugging messages to Vim's |message-history|. You can
|
||||
examine these messages with |:mes|.
|
||||
|
||||
|
||||
==============================================================================
|
||||
5. Checker Options *syntastic-checker-options*
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5.1 Telling syntastic which checker to use.
|
||||
|
||||
Stick a line like this in your vimrc: >
|
||||
let g:syntastic_<filetype>_checkers = ['<checker-name>']
|
||||
<
|
||||
e.g. >
|
||||
let g:syntastic_python_checkers = ['flake8']
|
||||
<
|
||||
|
||||
There's also a per-buffer version of this setting, b:syntastic_checkers. Use
|
||||
this in an autocmd to configure specific checkers for particular paths: >
|
||||
autocmd FileType python if stridx(expand('%:p'), '/some/path/') == 0 |
|
||||
\ let b:syntastic_checkers = ['pylint'] | endif
|
||||
<
|
||||
|
||||
To see the list of available checkers for your filetype, look in
|
||||
`syntax_checkers/<filetype>/`. The names of the files here correspond to
|
||||
'<checker-name>' above.
|
||||
|
||||
e.g. Python has the following checkers: flake8, pyflakes, pylint and a
|
||||
native python checker.
|
||||
|
||||
Some filetypes, like PHP, have style checkers as well as syntax checkers. These
|
||||
can be chained together like this: >
|
||||
let g:syntastic_php_checkers=['php', 'phpcs', 'phpmd']`
|
||||
<
|
||||
This is telling syntastic to run the 'php' checker first, and if no errors are
|
||||
found, run 'phpcs', and then 'phpmd'.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5.2 Configuring specific checkers *syntastic-config-makeprg*
|
||||
|
||||
Most checkers use the 'syntastic#makeprg#build()' function and provide many
|
||||
options by default - in fact you can customise every part of the command
|
||||
that gets called.
|
||||
|
||||
Checkers that use 'syntastic#makeprg#build()' look like this: >
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'ruby',
|
||||
\ 'args': '-a -b -c',
|
||||
\ 'post_args': '--more --args',
|
||||
\ 'tail': '> /tmp/output',
|
||||
\ 'filetype': 'ruby',
|
||||
\ 'subchecker': 'mri' })
|
||||
<
|
||||
|
||||
The 'filetype' and 'subchecker' parameters are mandatory. All of the other
|
||||
parameters above are optional (well, you probably need at least 'exe'), and
|
||||
can be overriden by setting global variables - even parameters not specified
|
||||
in the call to syntastic#makeprg#build().
|
||||
|
||||
E.g. To override the checker exe above, you could do this: >
|
||||
let g:syntastic_ruby_mri_exe="another_ruby_checker_exe.rb"
|
||||
<
|
||||
To override the args and the tail: >
|
||||
let g:syntastic_ruby_mri_args="--my --args --here"
|
||||
let g:syntastic_ruby_mri_tail="> /tmp/my-output-file-biatch"
|
||||
<
|
||||
|
||||
The general form of the override options is: >
|
||||
syntastic_[filetype]_[subchecker]_[option-name]
|
||||
<
|
||||
|
||||
For checkers that do not use the 'syntastic#makeprg#build()' function you
|
||||
will have to look at the source code of the checker in question. If there are
|
||||
specific options that can be set, these are usually documented at the top of
|
||||
the script.
|
||||
|
||||
==============================================================================
|
||||
6. About *syntastic-about*
|
||||
|
||||
The core maintainers of syntastic are:
|
||||
Martin Grenfell (github: scrooloose)
|
||||
Gregor Uhlenheuer (github: kongo2002)
|
||||
|
||||
Find the latest version of syntastic here:
|
||||
http://github.com/scrooloose/syntastic
|
||||
|
||||
==============================================================================
|
||||
7. License *syntastic-license*
|
||||
|
||||
Syntastic is released under the wtfpl.
|
||||
See http://sam.zoy.org/wtfpl/COPYING.
|
||||
|
||||
vim:tw=78:sw=4:ft=help:norl:
|
456
sources_non_forked/syntastic/plugin/syntastic.vim
Normal file
456
sources_non_forked/syntastic/plugin/syntastic.vim
Normal file
@ -0,0 +1,456 @@
|
||||
"============================================================================
|
||||
"File: syntastic.vim
|
||||
"Description: Vim plugin for on the fly syntax checking.
|
||||
"Version: 3.0.0
|
||||
"Released On: 13 April, 2013
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_plugin")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_plugin = 1
|
||||
|
||||
runtime! plugin/syntastic/*.vim
|
||||
|
||||
let s:running_windows = has("win16") || has("win32")
|
||||
|
||||
if !exists("g:syntastic_always_populate_loc_list")
|
||||
let g:syntastic_always_populate_loc_list = 0
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_auto_jump")
|
||||
let g:syntastic_auto_jump = 0
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_quiet_warnings")
|
||||
let g:syntastic_quiet_warnings = 0
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_stl_format")
|
||||
let g:syntastic_stl_format = '[Syntax: line:%F (%t)]'
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_check_on_open")
|
||||
let g:syntastic_check_on_open = 0
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_check_on_wq")
|
||||
let g:syntastic_check_on_wq = 1
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_aggregate_errors")
|
||||
let g:syntastic_aggregate_errors = 0
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_loc_list_height")
|
||||
let g:syntastic_loc_list_height = 10
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_ignore_files")
|
||||
let g:syntastic_ignore_files = []
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_filetype_map")
|
||||
let g:syntastic_filetype_map = {}
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_full_redraws")
|
||||
let g:syntastic_full_redraws = !( has('gui_running') || has('gui_macvim'))
|
||||
endif
|
||||
|
||||
" TODO: not documented
|
||||
if !exists("g:syntastic_reuse_loc_lists")
|
||||
" a relevant bug has been fixed in one of the pre-releases of Vim 7.4
|
||||
let g:syntastic_reuse_loc_lists = (v:version >= 704)
|
||||
endif
|
||||
|
||||
let s:registry = g:SyntasticRegistry.Instance()
|
||||
let s:notifiers = g:SyntasticNotifiers.Instance()
|
||||
let s:modemap = g:SyntasticModeMap.Instance()
|
||||
|
||||
function! s:CompleteCheckerName(argLead, cmdLine, cursorPos)
|
||||
let checker_names = []
|
||||
for ft in s:CurrentFiletypes()
|
||||
for checker in s:registry.availableCheckersFor(ft)
|
||||
call add(checker_names, checker.getName())
|
||||
endfor
|
||||
endfor
|
||||
return join(checker_names, "\n")
|
||||
endfunction
|
||||
|
||||
command! SyntasticToggleMode call s:ToggleMode()
|
||||
command! -nargs=? -complete=custom,s:CompleteCheckerName SyntasticCheck call s:UpdateErrors(0, <f-args>) <bar> call s:Redraw()
|
||||
command! Errors call s:ShowLocList()
|
||||
command! SyntasticInfo call s:registry.echoInfoFor(s:CurrentFiletypes())
|
||||
command! SyntasticReset call s:ClearCache() | call s:notifiers.refresh(g:SyntasticLoclist.New([]))
|
||||
|
||||
highlight link SyntasticError SpellBad
|
||||
highlight link SyntasticWarning SpellCap
|
||||
|
||||
augroup syntastic
|
||||
autocmd BufReadPost * if g:syntastic_check_on_open | call s:UpdateErrors(1) | endif
|
||||
autocmd BufWritePost * call s:UpdateErrors(1)
|
||||
|
||||
autocmd BufWinEnter * call s:BufWinEnterHook()
|
||||
|
||||
" TODO: the next autocmd should be "autocmd BufWinLeave * if empty(&bt) | lclose | endif"
|
||||
" but in recent versions of Vim lclose can no longer be called from BufWinLeave
|
||||
autocmd BufEnter * call s:BufEnterHook()
|
||||
augroup END
|
||||
|
||||
if v:version > 703 || (v:version == 703 && has('patch544'))
|
||||
" QuitPre was added in Vim 7.3.544
|
||||
augroup syntastic
|
||||
autocmd QuitPre * call s:QuitPreHook()
|
||||
augroup END
|
||||
endif
|
||||
|
||||
|
||||
function! s:BufWinEnterHook()
|
||||
if empty(&bt)
|
||||
let loclist = g:SyntasticLoclist.current()
|
||||
call s:notifiers.refresh(loclist)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:BufEnterHook()
|
||||
" TODO: at this point there is no b:syntastic_loclist
|
||||
let loclist = filter(getloclist(0), 'v:val["valid"] == 1')
|
||||
let buffers = syntastic#util#unique(map( loclist, 'v:val["bufnr"]' ))
|
||||
if &bt=='quickfix' && !empty(loclist) && empty(filter( buffers, 'syntastic#util#bufIsActive(v:val)' ))
|
||||
call g:SyntasticLoclistHide()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:QuitPreHook()
|
||||
let b:syntastic_skip_checks = !g:syntastic_check_on_wq
|
||||
call g:SyntasticLoclistHide()
|
||||
endfunction
|
||||
|
||||
"refresh and redraw all the error info for this buf when saving or reading
|
||||
function! s:UpdateErrors(auto_invoked, ...)
|
||||
if s:SkipFile()
|
||||
return
|
||||
endif
|
||||
|
||||
let run_checks = !a:auto_invoked || s:modemap.allowsAutoChecking(&filetype)
|
||||
if run_checks
|
||||
if a:0 >= 1
|
||||
call s:CacheErrors(a:1)
|
||||
else
|
||||
call s:CacheErrors()
|
||||
endif
|
||||
end
|
||||
|
||||
let loclist = g:SyntasticLoclist.current()
|
||||
|
||||
let w:syntastic_loclist_set = 0
|
||||
if g:syntastic_always_populate_loc_list || g:syntastic_auto_jump
|
||||
call setloclist(0, loclist.filteredRaw())
|
||||
let w:syntastic_loclist_set = 1
|
||||
if run_checks && g:syntastic_auto_jump && loclist.hasErrorsOrWarningsToDisplay()
|
||||
silent! lrewind
|
||||
endif
|
||||
endif
|
||||
|
||||
call s:notifiers.refresh(loclist)
|
||||
endfunction
|
||||
|
||||
"clear the loc list for the buffer
|
||||
function! s:ClearCache()
|
||||
call s:notifiers.reset(g:SyntasticLoclist.current())
|
||||
unlet! b:syntastic_loclist
|
||||
endfunction
|
||||
|
||||
function! s:CurrentFiletypes()
|
||||
return split(&filetype, '\.')
|
||||
endfunction
|
||||
|
||||
"detect and cache all syntax errors in this buffer
|
||||
function! s:CacheErrors(...)
|
||||
call s:ClearCache()
|
||||
let newLoclist = g:SyntasticLoclist.New([])
|
||||
|
||||
if !s:SkipFile()
|
||||
let active_checkers = 0
|
||||
let names = []
|
||||
|
||||
call syntastic#util#debug("CacheErrors: g:syntastic_aggregate_errors = " . g:syntastic_aggregate_errors)
|
||||
if exists('b:syntastic_aggregate_errors')
|
||||
call syntastic#util#debug("CacheErrors: b:syntastic_aggregate_errors = " . b:syntastic_aggregate_errors)
|
||||
endif
|
||||
|
||||
for ft in s:CurrentFiletypes()
|
||||
if a:0
|
||||
let checker = s:registry.getChecker(ft, a:1)
|
||||
let checkers = !empty(checker) ? [checker] : []
|
||||
else
|
||||
let checkers = s:registry.getActiveCheckers(ft)
|
||||
endif
|
||||
|
||||
for checker in checkers
|
||||
let active_checkers += 1
|
||||
call syntastic#util#debug("CacheErrors: Invoking checker: " . checker.getName())
|
||||
|
||||
let loclist = checker.getLocList()
|
||||
|
||||
if !loclist.isEmpty()
|
||||
let newLoclist = newLoclist.extend(loclist)
|
||||
call add(names, [checker.getName(), checker.getFiletype()])
|
||||
|
||||
if !(exists('b:syntastic_aggregate_errors') ? b:syntastic_aggregate_errors : g:syntastic_aggregate_errors)
|
||||
break
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
||||
if !empty(names)
|
||||
if len(syntastic#util#unique(map(copy(names), 'v:val[1]'))) == 1
|
||||
let type = names[0][1]
|
||||
let name = join(map(names, 'v:val[0]'), ', ')
|
||||
call newLoclist.setName( name . ' ('. type . ')' )
|
||||
else
|
||||
" checkers from mixed types
|
||||
call newLoclist.setName(join(map(names, 'v:val[1] . "/" . v:val[0]'), ', '))
|
||||
endif
|
||||
endif
|
||||
|
||||
if !active_checkers
|
||||
if a:0
|
||||
call syntastic#util#warn('checker ' . a:1 . ' is not active for filetype ' . &filetype)
|
||||
else
|
||||
call syntastic#util#debug('no active checkers for filetype ' . &filetype)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
let b:syntastic_loclist = newLoclist
|
||||
endfunction
|
||||
|
||||
function! s:ToggleMode()
|
||||
call s:modemap.toggleMode()
|
||||
call s:ClearCache()
|
||||
call s:UpdateErrors(1)
|
||||
call s:modemap.echoMode()
|
||||
endfunction
|
||||
|
||||
"display the cached errors for this buf in the location list
|
||||
function! s:ShowLocList()
|
||||
let loclist = g:SyntasticLoclist.current()
|
||||
call loclist.show()
|
||||
endfunction
|
||||
|
||||
"the script changes &shellredir and &shell to stop the screen flicking when
|
||||
"shelling out to syntax checkers. Not all OSs support the hacks though
|
||||
function! s:OSSupportsShellredirHack()
|
||||
return !s:running_windows && executable('/bin/bash') && (s:uname() !~ "FreeBSD") && (s:uname() !~ "OpenBSD")
|
||||
endfunction
|
||||
|
||||
function! s:IsRedrawRequiredAfterMake()
|
||||
return !s:running_windows && (s:uname() =~ "FreeBSD" || s:uname() =~ "OpenBSD")
|
||||
endfunction
|
||||
|
||||
"Redraw in a way that doesnt make the screen flicker or leave anomalies behind.
|
||||
"
|
||||
"Some terminal versions of vim require `redraw!` - otherwise there can be
|
||||
"random anomalies left behind.
|
||||
"
|
||||
"However, on some versions of gvim using `redraw!` causes the screen to
|
||||
"flicker - so use redraw.
|
||||
function! s:Redraw()
|
||||
if g:syntastic_full_redraws
|
||||
redraw!
|
||||
else
|
||||
redraw
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:IgnoreFile(filename)
|
||||
let fname = fnamemodify(a:filename, ':p')
|
||||
for p in g:syntastic_ignore_files
|
||||
if fname =~# p
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" Skip running in special buffers
|
||||
function! s:SkipFile()
|
||||
let force_skip = exists('b:syntastic_skip_checks') ? b:syntastic_skip_checks : 0
|
||||
let fname = expand('%')
|
||||
return force_skip || !empty(&buftype) || !filereadable(fname) || getwinvar(0, '&diff') || s:IgnoreFile(fname)
|
||||
endfunction
|
||||
|
||||
function! s:uname()
|
||||
if !exists('s:uname')
|
||||
let s:uname = system('uname')
|
||||
endif
|
||||
return s:uname
|
||||
endfunction
|
||||
|
||||
"return a string representing the state of buffer according to
|
||||
"g:syntastic_stl_format
|
||||
"
|
||||
"return '' if no errors are cached for the buffer
|
||||
function! SyntasticStatuslineFlag()
|
||||
let loclist = g:SyntasticLoclist.current()
|
||||
let issues = loclist.filteredRaw()
|
||||
let num_issues = loclist.getLength()
|
||||
if loclist.hasErrorsOrWarningsToDisplay()
|
||||
let errors = loclist.errors()
|
||||
let warnings = loclist.warnings()
|
||||
|
||||
let num_errors = len(errors)
|
||||
let num_warnings = len(warnings)
|
||||
|
||||
let output = g:syntastic_stl_format
|
||||
|
||||
"hide stuff wrapped in %E(...) unless there are errors
|
||||
let output = substitute(output, '\C%E{\([^}]*\)}', num_errors ? '\1' : '' , 'g')
|
||||
|
||||
"hide stuff wrapped in %W(...) unless there are warnings
|
||||
let output = substitute(output, '\C%W{\([^}]*\)}', num_warnings ? '\1' : '' , 'g')
|
||||
|
||||
"hide stuff wrapped in %B(...) unless there are both errors and warnings
|
||||
let output = substitute(output, '\C%B{\([^}]*\)}', (num_warnings && num_errors) ? '\1' : '' , 'g')
|
||||
|
||||
|
||||
"sub in the total errors/warnings/both
|
||||
let output = substitute(output, '\C%w', num_warnings, 'g')
|
||||
let output = substitute(output, '\C%e', num_errors, 'g')
|
||||
let output = substitute(output, '\C%t', num_issues, 'g')
|
||||
|
||||
"first error/warning line num
|
||||
let output = substitute(output, '\C%F', num_issues ? issues[0]['lnum'] : '', 'g')
|
||||
|
||||
"first error line num
|
||||
let output = substitute(output, '\C%fe', num_errors ? errors[0]['lnum'] : '', 'g')
|
||||
|
||||
"first warning line num
|
||||
let output = substitute(output, '\C%fw', num_warnings ? warnings[0]['lnum'] : '', 'g')
|
||||
|
||||
return output
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"Emulates the :lmake command. Sets up the make environment according to the
|
||||
"options given, runs make, resets the environment, returns the location list
|
||||
"
|
||||
"a:options can contain the following keys:
|
||||
" 'makeprg'
|
||||
" 'errorformat'
|
||||
"
|
||||
"The corresponding options are set for the duration of the function call. They
|
||||
"are set with :let, so dont escape spaces.
|
||||
"
|
||||
"a:options may also contain:
|
||||
" 'defaults' - a dict containing default values for the returned errors
|
||||
" 'subtype' - all errors will be assigned the given subtype
|
||||
" 'preprocess' - a function to be applied to the error file before parsing errors
|
||||
" 'postprocess' - a list of functions to be applied to the error list
|
||||
" 'cwd' - change directory to the given path before running the checker
|
||||
" 'returns' - a list of valid exit codes for the checker
|
||||
function! SyntasticMake(options)
|
||||
call syntastic#util#debug('SyntasticMake: called with options: '. string(a:options))
|
||||
|
||||
let old_shell = &shell
|
||||
let old_shellredir = &shellredir
|
||||
let old_errorformat = &errorformat
|
||||
let old_cwd = getcwd()
|
||||
let old_lc_messages = $LC_MESSAGES
|
||||
let old_lc_all = $LC_ALL
|
||||
|
||||
if s:OSSupportsShellredirHack()
|
||||
"this is a hack to stop the screen needing to be ':redraw'n when
|
||||
"when :lmake is run. Otherwise the screen flickers annoyingly
|
||||
let &shellredir = '&>'
|
||||
let &shell = '/bin/bash'
|
||||
endif
|
||||
|
||||
if has_key(a:options, 'errorformat')
|
||||
let &errorformat = a:options['errorformat']
|
||||
endif
|
||||
|
||||
if has_key(a:options, 'cwd')
|
||||
exec 'lcd ' . fnameescape(a:options['cwd'])
|
||||
endif
|
||||
|
||||
let $LC_MESSAGES = 'C'
|
||||
let $LC_ALL = ''
|
||||
let err_lines = split(system(a:options['makeprg']), "\n", 1)
|
||||
let $LC_ALL = old_lc_all
|
||||
let $LC_MESSAGES = old_lc_messages
|
||||
|
||||
if has_key(a:options, 'preprocess')
|
||||
let err_lines = call(a:options['preprocess'], [err_lines])
|
||||
endif
|
||||
lgetexpr err_lines
|
||||
|
||||
let errors = copy(getloclist(0))
|
||||
|
||||
if has_key(a:options, 'cwd')
|
||||
exec 'lcd ' . fnameescape(old_cwd)
|
||||
endif
|
||||
|
||||
silent! lolder
|
||||
let &errorformat = old_errorformat
|
||||
let &shellredir = old_shellredir
|
||||
let &shell=old_shell
|
||||
|
||||
if s:IsRedrawRequiredAfterMake()
|
||||
call s:Redraw()
|
||||
endif
|
||||
|
||||
if has_key(a:options, 'returns') && index(a:options['returns'], v:shell_error) == -1
|
||||
throw 'Syntastic: checker error'
|
||||
endif
|
||||
|
||||
if has_key(a:options, 'defaults')
|
||||
call SyntasticAddToErrors(errors, a:options['defaults'])
|
||||
endif
|
||||
|
||||
" Apply ignore patterns
|
||||
let ignore = {}
|
||||
for buf in syntastic#util#unique(map(copy(errors), 'v:val["bufnr"]'))
|
||||
let ignore[buf] = s:IgnoreFile(bufname(str2nr(buf)))
|
||||
endfor
|
||||
call filter(errors, '!ignore[v:val["bufnr"]]')
|
||||
|
||||
" Add subtype info if present.
|
||||
if has_key(a:options, 'subtype')
|
||||
call SyntasticAddToErrors(errors, {'subtype': a:options['subtype']})
|
||||
endif
|
||||
|
||||
if has_key(a:options, 'postprocess') && !empty(a:options['postprocess'])
|
||||
for rule in a:options['postprocess']
|
||||
let errors = call('syntastic#postprocess#' . rule, [errors])
|
||||
endfor
|
||||
endif
|
||||
|
||||
return errors
|
||||
endfunction
|
||||
|
||||
"take a list of errors and add default values to them from a:options
|
||||
function! SyntasticAddToErrors(errors, options)
|
||||
for i in range(0, len(a:errors)-1)
|
||||
for key in keys(a:options)
|
||||
if !has_key(a:errors[i], key) || empty(a:errors[i][key])
|
||||
let a:errors[i][key] = a:options[key]
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
return a:errors
|
||||
endfunction
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -0,0 +1,38 @@
|
||||
if exists("g:loaded_syntastic_notifier_autoloclist")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_notifier_autoloclist = 1
|
||||
|
||||
if !exists("g:syntastic_auto_loc_list")
|
||||
let g:syntastic_auto_loc_list = 2
|
||||
endif
|
||||
|
||||
let g:SyntasticAutoloclistNotifier = {}
|
||||
|
||||
" Public methods {{{1
|
||||
"
|
||||
function! g:SyntasticAutoloclistNotifier.New()
|
||||
let newObj = copy(self)
|
||||
return newObj
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticAutoloclistNotifier.refresh(loclist)
|
||||
call g:SyntasticAutoloclistNotifier.AutoToggle(a:loclist)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist)
|
||||
if a:loclist.hasErrorsOrWarningsToDisplay()
|
||||
if g:syntastic_auto_loc_list == 1
|
||||
call a:loclist.show()
|
||||
endif
|
||||
else
|
||||
if g:syntastic_auto_loc_list > 0
|
||||
|
||||
"TODO: this will close the loc list window if one was opened by
|
||||
"something other than syntastic
|
||||
lclose
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
64
sources_non_forked/syntastic/plugin/syntastic/balloons.vim
Normal file
64
sources_non_forked/syntastic/plugin/syntastic/balloons.vim
Normal file
@ -0,0 +1,64 @@
|
||||
if exists("g:loaded_syntastic_notifier_balloons")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_notifier_balloons = 1
|
||||
|
||||
if !exists("g:syntastic_enable_balloons")
|
||||
let g:syntastic_enable_balloons = 1
|
||||
endif
|
||||
|
||||
if !has('balloon_eval')
|
||||
let g:syntastic_enable_balloons = 0
|
||||
endif
|
||||
|
||||
let g:SyntasticBalloonsNotifier = {}
|
||||
|
||||
" Public methods {{{1
|
||||
|
||||
function! g:SyntasticBalloonsNotifier.New()
|
||||
let newObj = copy(self)
|
||||
return newObj
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticBalloonsNotifier.enabled()
|
||||
return
|
||||
\ has('balloon_eval') &&
|
||||
\ (exists('b:syntastic_enable_balloons') ? b:syntastic_enable_balloons : g:syntastic_enable_balloons)
|
||||
endfunction
|
||||
|
||||
" Update the error balloons
|
||||
function! g:SyntasticBalloonsNotifier.refresh(loclist)
|
||||
let b:syntastic_balloons = {}
|
||||
if self.enabled() && a:loclist.hasErrorsOrWarningsToDisplay()
|
||||
let buf = bufnr('')
|
||||
let issues = filter(a:loclist.filteredRaw(), 'v:val["bufnr"] == buf')
|
||||
if !empty(issues)
|
||||
for i in issues
|
||||
if has_key(b:syntastic_balloons, i['lnum'])
|
||||
let b:syntastic_balloons[i['lnum']] .= "\n" . i['text']
|
||||
else
|
||||
let b:syntastic_balloons[i['lnum']] = i['text']
|
||||
endif
|
||||
endfor
|
||||
set beval bexpr=SyntasticBalloonsExprNotifier()
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Reset the error balloons
|
||||
function! g:SyntasticBalloonsNotifier.reset(loclist)
|
||||
if has('balloon_eval')
|
||||
set nobeval
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Private functions {{{1
|
||||
|
||||
function! SyntasticBalloonsExprNotifier()
|
||||
if !exists('b:syntastic_balloons')
|
||||
return ''
|
||||
endif
|
||||
return get(b:syntastic_balloons, v:beval_lnum, '')
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
79
sources_non_forked/syntastic/plugin/syntastic/checker.vim
Normal file
79
sources_non_forked/syntastic/plugin/syntastic/checker.vim
Normal file
@ -0,0 +1,79 @@
|
||||
if exists("g:loaded_syntastic_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_checker = 1
|
||||
|
||||
let g:SyntasticChecker = {}
|
||||
|
||||
" Public methods {{{1
|
||||
|
||||
function! g:SyntasticChecker.New(args)
|
||||
let newObj = copy(self)
|
||||
|
||||
let newObj._filetype = a:args['filetype']
|
||||
let newObj._name = a:args['name']
|
||||
|
||||
|
||||
let prefix = 'SyntaxCheckers_' . newObj._filetype . '_' . newObj._name . '_'
|
||||
let newObj._locListFunc = function(prefix . 'GetLocList')
|
||||
let newObj._isAvailableFunc = function(prefix . 'IsAvailable')
|
||||
|
||||
if exists('*' . prefix . 'GetHighlightRegex')
|
||||
let newObj._highlightRegexFunc = function(prefix. 'GetHighlightRegex')
|
||||
else
|
||||
let newObj._highlightRegexFunc = ''
|
||||
endif
|
||||
|
||||
return newObj
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticChecker.getFiletype()
|
||||
return self._filetype
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticChecker.getName()
|
||||
return self._name
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticChecker.getLocList()
|
||||
try
|
||||
let list = self._locListFunc()
|
||||
call syntastic#util#debug('getLocList: checker ' . self._filetype . '/' . self._name . ' returned ' . v:shell_error)
|
||||
catch /\m\C^Syntastic: checker error$/
|
||||
let list = []
|
||||
call syntastic#util#error('checker ' . self._filetype . '/' . self._name . ' returned abnormal status ' . v:shell_error)
|
||||
endtry
|
||||
call self._populateHighlightRegexes(list)
|
||||
return g:SyntasticLoclist.New(list)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticChecker.getHighlightRegexFor(error)
|
||||
if empty(self._highlightRegexFunc)
|
||||
return []
|
||||
endif
|
||||
|
||||
return self._highlightRegexFunc(error)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticChecker.isAvailable()
|
||||
return self._isAvailableFunc()
|
||||
endfunction
|
||||
|
||||
" Private methods {{{1
|
||||
|
||||
function! g:SyntasticChecker._populateHighlightRegexes(list)
|
||||
let list = a:list
|
||||
if !empty(self._highlightRegexFunc)
|
||||
for i in range(0, len(list)-1)
|
||||
if list[i]['valid']
|
||||
let term = self._highlightRegexFunc(list[i])
|
||||
if len(term) > 0
|
||||
let list[i]['hl'] = term
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
return list
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
63
sources_non_forked/syntastic/plugin/syntastic/cursor.vim
Normal file
63
sources_non_forked/syntastic/plugin/syntastic/cursor.vim
Normal file
@ -0,0 +1,63 @@
|
||||
if exists("g:loaded_syntastic_notifier_cursor")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_notifier_cursor = 1
|
||||
|
||||
if !exists('g:syntastic_echo_current_error')
|
||||
let g:syntastic_echo_current_error = 1
|
||||
endif
|
||||
|
||||
let g:SyntasticCursorNotifier = {}
|
||||
|
||||
" Public methods {{{1
|
||||
|
||||
function! g:SyntasticCursorNotifier.New()
|
||||
let newObj = copy(self)
|
||||
return newObj
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticCursorNotifier.enabled()
|
||||
return exists('b:syntastic_echo_current_error') ? b:syntastic_echo_current_error : g:syntastic_echo_current_error
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticCursorNotifier.refresh(loclist)
|
||||
if self.enabled() && a:loclist.hasErrorsOrWarningsToDisplay()
|
||||
let b:syntastic_messages = copy(a:loclist.messages(bufnr('')))
|
||||
let b:oldLine = -1
|
||||
autocmd! syntastic CursorMoved
|
||||
autocmd syntastic CursorMoved * call g:SyntasticRefreshCursor()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticCursorNotifier.reset(loclist)
|
||||
autocmd! syntastic CursorMoved
|
||||
unlet! b:syntastic_messages
|
||||
let b:oldLine = -1
|
||||
endfunction
|
||||
|
||||
" Private methods {{{1
|
||||
|
||||
" The following defensive nonsense is needed because of the nature of autocmd
|
||||
function! g:SyntasticRefreshCursor()
|
||||
if !exists('b:syntastic_messages') || empty(b:syntastic_messages)
|
||||
" file not checked
|
||||
return
|
||||
endif
|
||||
|
||||
if !exists('b:oldLine')
|
||||
let b:oldLine = -1
|
||||
endif
|
||||
let l = line('.')
|
||||
if l == b:oldLine
|
||||
return
|
||||
endif
|
||||
let b:oldLine = l
|
||||
|
||||
if has_key(b:syntastic_messages, l)
|
||||
call syntastic#util#wideMsg(b:syntastic_messages[l])
|
||||
else
|
||||
echo
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -0,0 +1,66 @@
|
||||
if exists("g:loaded_syntastic_notifier_highlighting")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_notifier_highlighting = 1
|
||||
|
||||
" Highlighting requires getmatches introduced in 7.1.040
|
||||
let s:has_highlighting = v:version > 701 || (v:version == 701 && has('patch040'))
|
||||
|
||||
if !exists("g:syntastic_enable_highlighting")
|
||||
let g:syntastic_enable_highlighting = 1
|
||||
endif
|
||||
|
||||
let g:SyntasticHighlightingNotifier = {}
|
||||
|
||||
" Public methods {{{1
|
||||
|
||||
function! g:SyntasticHighlightingNotifier.New()
|
||||
let newObj = copy(self)
|
||||
return newObj
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticHighlightingNotifier.enabled()
|
||||
return
|
||||
\ s:has_highlighting &&
|
||||
\ (exists('b:syntastic_enable_highlighting') ? b:syntastic_enable_highlighting : g:syntastic_enable_highlighting)
|
||||
endfunction
|
||||
|
||||
" Sets error highlights in the cuirrent window
|
||||
function! g:SyntasticHighlightingNotifier.refresh(loclist)
|
||||
if self.enabled()
|
||||
call self.reset(a:loclist)
|
||||
let buf = bufnr('')
|
||||
let issues = filter(a:loclist.filteredRaw(), 'v:val["bufnr"] == buf')
|
||||
for item in issues
|
||||
let group = item['type'] == 'E' ? 'SyntasticError' : 'SyntasticWarning'
|
||||
|
||||
" The function `Syntastic_{filetype}_{checker}_GetHighlightRegex` is
|
||||
" used to override default highlighting.
|
||||
if has_key(item, 'hl')
|
||||
call matchadd(group, '\%' . item['lnum'] . 'l' . item['hl'])
|
||||
elseif get(item, 'col')
|
||||
let lastcol = col([item['lnum'], '$'])
|
||||
let lcol = min([lastcol, item['col']])
|
||||
|
||||
" a bug in vim can sometimes cause there to be no 'vcol' key,
|
||||
" so check for its existence
|
||||
let coltype = has_key(item, 'vcol') && item['vcol'] ? 'v' : 'c'
|
||||
|
||||
call matchadd(group, '\%' . item['lnum'] . 'l\%' . lcol . coltype)
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Remove all error highlights from the window
|
||||
function! g:SyntasticHighlightingNotifier.reset(loclist)
|
||||
if s:has_highlighting
|
||||
for match in getmatches()
|
||||
if stridx(match['group'], 'Syntastic') == 0
|
||||
call matchdelete(match['id'])
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
184
sources_non_forked/syntastic/plugin/syntastic/loclist.vim
Normal file
184
sources_non_forked/syntastic/plugin/syntastic/loclist.vim
Normal file
@ -0,0 +1,184 @@
|
||||
if exists("g:loaded_syntastic_loclist")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_loclist = 1
|
||||
|
||||
let g:SyntasticLoclist = {}
|
||||
|
||||
" Public methods {{{1
|
||||
|
||||
function! g:SyntasticLoclist.New(rawLoclist)
|
||||
let newObj = copy(self)
|
||||
let newObj._quietWarnings = g:syntastic_quiet_warnings
|
||||
|
||||
let llist = copy(a:rawLoclist)
|
||||
let llist = filter(llist, 'v:val["valid"] == 1')
|
||||
|
||||
for e in llist
|
||||
if empty(e['type'])
|
||||
let e['type'] = 'E'
|
||||
endif
|
||||
endfor
|
||||
|
||||
let newObj._rawLoclist = llist
|
||||
let newObj._hasErrorsOrWarningsToDisplay = -1
|
||||
|
||||
let newObj._name = ''
|
||||
|
||||
return newObj
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticLoclist.current()
|
||||
if !exists("b:syntastic_loclist")
|
||||
let b:syntastic_loclist = g:SyntasticLoclist.New([])
|
||||
endif
|
||||
return b:syntastic_loclist
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticLoclist.extend(other)
|
||||
let list = self.toRaw()
|
||||
call extend(list, a:other.toRaw())
|
||||
return g:SyntasticLoclist.New(list)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticLoclist.toRaw()
|
||||
return copy(self._rawLoclist)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticLoclist.filteredRaw()
|
||||
return copy(self._quietWarnings ? self.errors() : self._rawLoclist)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticLoclist.quietWarnings()
|
||||
return self._quietWarnings
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticLoclist.isEmpty()
|
||||
return empty(self._rawLoclist)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticLoclist.getLength()
|
||||
return len(self._rawLoclist)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticLoclist.getName()
|
||||
return len(self._name)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticLoclist.setName(name)
|
||||
let self._name = a:name
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticLoclist.hasErrorsOrWarningsToDisplay()
|
||||
if self._hasErrorsOrWarningsToDisplay >= 0
|
||||
return self._hasErrorsOrWarningsToDisplay
|
||||
endif
|
||||
let self._hasErrorsOrWarningsToDisplay = empty(self._rawLoclist) ? 0 : (!self._quietWarnings || len(self.errors()))
|
||||
return self._hasErrorsOrWarningsToDisplay
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticLoclist.errors()
|
||||
if !exists("self._cachedErrors")
|
||||
let self._cachedErrors = self.filter({'type': "E"})
|
||||
endif
|
||||
return self._cachedErrors
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticLoclist.warnings()
|
||||
if !exists("self._cachedWarnings")
|
||||
let self._cachedWarnings = self.filter({'type': "W"})
|
||||
endif
|
||||
return self._cachedWarnings
|
||||
endfunction
|
||||
|
||||
" cache used by EchoCurrentError()
|
||||
function! g:SyntasticLoclist.messages(buf)
|
||||
if !exists("self._cachedMessages")
|
||||
let self._cachedMessages = {}
|
||||
let errors = self.errors() + (self._quietWarnings ? [] : self.warnings())
|
||||
|
||||
for e in errors
|
||||
let b = e['bufnr']
|
||||
let l = e['lnum']
|
||||
|
||||
if !has_key(self._cachedMessages, b)
|
||||
let self._cachedMessages[b] = {}
|
||||
endif
|
||||
|
||||
if !has_key(self._cachedMessages[b], l)
|
||||
let self._cachedMessages[b][l] = e['text']
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
return get(self._cachedMessages, a:buf, {})
|
||||
endfunction
|
||||
|
||||
"Filter the list and return new native loclist
|
||||
"e.g.
|
||||
" .filter({'bufnr': 10, 'type': 'e'})
|
||||
"
|
||||
"would return all errors for buffer 10.
|
||||
"
|
||||
"Note that all comparisons are done with ==?
|
||||
function! g:SyntasticLoclist.filter(filters)
|
||||
let rv = []
|
||||
|
||||
for error in self._rawLoclist
|
||||
|
||||
let passes_filters = 1
|
||||
for key in keys(a:filters)
|
||||
if error[key] !=? a:filters[key]
|
||||
let passes_filters = 0
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
|
||||
if passes_filters
|
||||
call add(rv, error)
|
||||
endif
|
||||
endfor
|
||||
return rv
|
||||
endfunction
|
||||
|
||||
"display the cached errors for this buf in the location list
|
||||
function! g:SyntasticLoclist.show()
|
||||
if !exists('w:syntastic_loclist_set')
|
||||
let w:syntastic_loclist_set = 0
|
||||
endif
|
||||
call setloclist(0, self.filteredRaw(), g:syntastic_reuse_loc_lists && w:syntastic_loclist_set ? 'r' : ' ')
|
||||
let w:syntastic_loclist_set = 1
|
||||
|
||||
if self.hasErrorsOrWarningsToDisplay()
|
||||
let num = winnr()
|
||||
exec "lopen " . g:syntastic_loc_list_height
|
||||
if num != winnr()
|
||||
wincmd p
|
||||
endif
|
||||
|
||||
" try to find the loclist window and set w:quickfix_title
|
||||
let errors = getloclist(0)
|
||||
for buf in tabpagebuflist()
|
||||
if buflisted(buf) && bufloaded(buf) && getbufvar(buf, '&buftype') ==# 'quickfix'
|
||||
let win = bufwinnr(buf)
|
||||
let title = getwinvar(win, 'quickfix_title')
|
||||
|
||||
" TODO: try to make sure we actually own this window; sadly,
|
||||
" errors == getloclist(0) is the only somewhat safe way to
|
||||
" achieve that
|
||||
if strpart(title, 0, 16) ==# ':SyntasticCheck ' ||
|
||||
\ ( (title == '' || title ==# ':setloclist()') && errors == getloclist(0) )
|
||||
call setwinvar(win, 'quickfix_title', ':SyntasticCheck ' . self._name)
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Non-method functions {{{1
|
||||
|
||||
function! g:SyntasticLoclistHide()
|
||||
silent! lclose
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -0,0 +1,72 @@
|
||||
if exists("g:loaded_syntastic_makeprg_builder")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_makeprg_builder = 1
|
||||
|
||||
let g:SyntasticMakeprgBuilder = {}
|
||||
|
||||
" Public methods {{{1
|
||||
|
||||
function! g:SyntasticMakeprgBuilder.New(exe, args, fname, post_args, tail, filetype, subchecker)
|
||||
let newObj = copy(self)
|
||||
let newObj._exe = a:exe
|
||||
let newObj._args = a:args
|
||||
let newObj._fname = a:fname
|
||||
let newObj._post_args = a:post_args
|
||||
let newObj._tail = a:tail
|
||||
let newObj._filetype = empty(a:filetype) ? &filetype : a:filetype
|
||||
let newObj._subchecker = a:subchecker
|
||||
return newObj
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticMakeprgBuilder.makeprg()
|
||||
return join([self.exe(), self.args(), self.fname(), self.post_args(), self.tail()])
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticMakeprgBuilder.exe()
|
||||
return self._getOpt('exe')
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticMakeprgBuilder.args()
|
||||
return self._getOpt('args')
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticMakeprgBuilder.fname()
|
||||
if empty(self._fname)
|
||||
return syntastic#util#shexpand('%')
|
||||
else
|
||||
return self._fname
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticMakeprgBuilder.post_args()
|
||||
return self._getOpt('post_args')
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticMakeprgBuilder.tail()
|
||||
return self._getOpt('tail')
|
||||
endfunction
|
||||
|
||||
" Private methods {{{1
|
||||
|
||||
function g:SyntasticMakeprgBuilder._getOpt(name)
|
||||
if self._optExists(a:name)
|
||||
return {self._optName(a:name)}
|
||||
endif
|
||||
|
||||
return self['_' . a:name]
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticMakeprgBuilder._optExists(name)
|
||||
return exists(self._optName(a:name))
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticMakeprgBuilder._optName(name)
|
||||
let setting = "g:syntastic_" . self._filetype
|
||||
if !empty(self._subchecker)
|
||||
let setting .= '_' . self._subchecker
|
||||
endif
|
||||
return setting . '_' . a:name
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
67
sources_non_forked/syntastic/plugin/syntastic/modemap.vim
Normal file
67
sources_non_forked/syntastic/plugin/syntastic/modemap.vim
Normal file
@ -0,0 +1,67 @@
|
||||
if exists("g:loaded_syntastic_modemap")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_modemap = 1
|
||||
|
||||
let g:SyntasticModeMap = {}
|
||||
|
||||
" Public methods {{{1
|
||||
|
||||
function! g:SyntasticModeMap.Instance()
|
||||
if !exists('s:SyntasticModeMapInstance')
|
||||
let s:SyntasticModeMapInstance = copy(self)
|
||||
call s:SyntasticModeMapInstance._initModeMapFromGlobalOpts()
|
||||
endif
|
||||
|
||||
return s:SyntasticModeMapInstance
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticModeMap.allowsAutoChecking(filetype)
|
||||
let fts = split(a:filetype, '\.')
|
||||
|
||||
if self.isPassive()
|
||||
return self._isOneFiletypeActive(fts)
|
||||
else
|
||||
return self._noFiletypesArePassive(fts)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticModeMap.isPassive()
|
||||
return self._mode == "passive"
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticModeMap.toggleMode()
|
||||
if self._mode == "active"
|
||||
let self._mode = "passive"
|
||||
else
|
||||
let self._mode = "active"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticModeMap.echoMode()
|
||||
echo "Syntastic: " . self._mode . " mode enabled"
|
||||
endfunction
|
||||
|
||||
" Private methods {{{1
|
||||
|
||||
function! g:SyntasticModeMap._initModeMapFromGlobalOpts()
|
||||
let self._mode = "active"
|
||||
let self._activeFiletypes = []
|
||||
let self._passiveFiletypes = []
|
||||
|
||||
if exists("g:syntastic_mode_map")
|
||||
let self._mode = get(g:syntastic_mode_map, 'mode', self._mode)
|
||||
let self._activeFiletypes = get(g:syntastic_mode_map, 'active_filetypes', self._activeFiletypes)
|
||||
let self._passiveFiletypes = get(g:syntastic_mode_map, 'passive_filetypes', self._passiveFiletypes)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticModeMap._isOneFiletypeActive(filetypes)
|
||||
return !empty(filter(a:filetypes, 'index(self._activeFiletypes, v:val) != -1'))
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticModeMap._noFiletypesArePassive(filetypes)
|
||||
return empty(filter(a:filetypes, 'index(self._passiveFiletypes, v:val) != -1'))
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
55
sources_non_forked/syntastic/plugin/syntastic/notifiers.vim
Normal file
55
sources_non_forked/syntastic/plugin/syntastic/notifiers.vim
Normal file
@ -0,0 +1,55 @@
|
||||
if exists("g:loaded_syntastic_notifiers")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_notifiers = 1
|
||||
|
||||
let g:SyntasticNotifiers = {}
|
||||
|
||||
let s:notifier_types = ['signs', 'balloons', 'highlighting', 'cursor', 'autoloclist']
|
||||
|
||||
" Public methods {{{1
|
||||
|
||||
function! g:SyntasticNotifiers.Instance()
|
||||
if !exists('s:SyntasticNotifiersInstance')
|
||||
let s:SyntasticNotifiersInstance = copy(self)
|
||||
call s:SyntasticNotifiersInstance._initNotifiers()
|
||||
endif
|
||||
|
||||
return s:SyntasticNotifiersInstance
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticNotifiers.refresh(loclist)
|
||||
for type in self._enabled_types
|
||||
let class = substitute(type, '.*', 'Syntastic\u&Notifier', '')
|
||||
if !has_key(g:{class}, 'enabled') || self._notifier[type].enabled()
|
||||
call self._notifier[type].refresh(a:loclist)
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticNotifiers.reset(loclist)
|
||||
for type in self._enabled_types
|
||||
let class = substitute(type, '.*', 'Syntastic\u&Notifier', '')
|
||||
|
||||
" reset notifiers regardless if they are enabled or not, since
|
||||
" the user might have disabled them since the last refresh();
|
||||
" notifiers MUST be prepared to deal with reset() when disabled
|
||||
if has_key(g:{class}, 'reset')
|
||||
call self._notifier[type].reset(a:loclist)
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" Private methods {{{1
|
||||
|
||||
function! g:SyntasticNotifiers._initNotifiers()
|
||||
let self._notifier = {}
|
||||
for type in s:notifier_types
|
||||
let class = substitute(type, '.*', 'Syntastic\u&Notifier', '')
|
||||
let self._notifier[type] = g:{class}.New()
|
||||
endfor
|
||||
|
||||
let self._enabled_types = copy(s:notifier_types)
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
213
sources_non_forked/syntastic/plugin/syntastic/registry.vim
Normal file
213
sources_non_forked/syntastic/plugin/syntastic/registry.vim
Normal file
@ -0,0 +1,213 @@
|
||||
if exists("g:loaded_syntastic_registry")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_registry = 1
|
||||
|
||||
let s:defaultCheckers = {
|
||||
\ 'c': ['gcc'],
|
||||
\ 'coffee': ['coffee', 'coffeelint'],
|
||||
\ 'cpp': ['gcc'],
|
||||
\ 'css': ['csslint', 'phpcs'],
|
||||
\ 'go': ['go'],
|
||||
\ 'html': ['tidy'],
|
||||
\ 'java': ['javac'],
|
||||
\ 'javascript': ['jshint', 'jslint'],
|
||||
\ 'json': ['jsonlint', 'jsonval'],
|
||||
\ 'objc': ['gcc'],
|
||||
\ 'objcpp': ['gcc'],
|
||||
\ 'perl': ['perl', 'perlcritic'],
|
||||
\ 'php': ['php', 'phpcs', 'phpmd'],
|
||||
\ 'puppet': ['puppet', 'puppetlint'],
|
||||
\ 'python': ['python', 'flake8', 'pylint'],
|
||||
\ 'ruby': ['mri'],
|
||||
\ 'sh': ['sh'],
|
||||
\ 'tex': ['lacheck']
|
||||
\ }
|
||||
|
||||
let s:defaultFiletypeMap = {
|
||||
\ 'gentoo-metadata': 'xml',
|
||||
\ 'lhaskell': 'haskell'
|
||||
\ }
|
||||
|
||||
let g:SyntasticRegistry = {}
|
||||
|
||||
" TODO: Handling of filetype aliases: all public methods take aliases as
|
||||
" parameters, all private methods take normalized filetypes. Public methods
|
||||
" are thus supposed to normalize filetypes before calling private methods.
|
||||
|
||||
" Public methods {{{1
|
||||
|
||||
function! g:SyntasticRegistry.Instance()
|
||||
if !exists('s:SyntasticRegistryInstance')
|
||||
let s:SyntasticRegistryInstance = copy(self)
|
||||
let s:SyntasticRegistryInstance._checkerMap = {}
|
||||
endif
|
||||
|
||||
return s:SyntasticRegistryInstance
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry.CreateAndRegisterChecker(args)
|
||||
let checker = g:SyntasticChecker.New(a:args)
|
||||
let registry = g:SyntasticRegistry.Instance()
|
||||
call registry.registerChecker(checker)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry.registerChecker(checker) abort
|
||||
let ft = a:checker.getFiletype()
|
||||
|
||||
if !has_key(self._checkerMap, ft)
|
||||
let self._checkerMap[ft] = []
|
||||
endif
|
||||
|
||||
call self._validateUniqueName(a:checker)
|
||||
|
||||
call add(self._checkerMap[ft], a:checker)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry.checkable(ftalias)
|
||||
return !empty(self.getActiveCheckers(a:ftalias))
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry.getActiveCheckers(ftalias)
|
||||
let filetype = s:SyntasticRegistryNormaliseFiletype(a:ftalias)
|
||||
let checkers = self.availableCheckersFor(a:ftalias)
|
||||
|
||||
if self._userHasFiletypeSettings(filetype)
|
||||
return self._filterCheckersByUserSettings(checkers, filetype)
|
||||
endif
|
||||
|
||||
if has_key(s:defaultCheckers, filetype)
|
||||
return self._filterCheckersByDefaultSettings(checkers, filetype)
|
||||
endif
|
||||
|
||||
let checkers = self.availableCheckersFor(filetype)
|
||||
|
||||
if !empty(checkers)
|
||||
return [checkers[0]]
|
||||
endif
|
||||
|
||||
return []
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry.getChecker(ftalias, name)
|
||||
for checker in self.availableCheckersFor(a:ftalias)
|
||||
if checker.getName() == a:name
|
||||
return checker
|
||||
endif
|
||||
endfor
|
||||
|
||||
return {}
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry.availableCheckersFor(ftalias)
|
||||
let filetype = s:SyntasticRegistryNormaliseFiletype(a:ftalias)
|
||||
let checkers = copy(self._allCheckersFor(filetype))
|
||||
return self._filterCheckersByAvailability(checkers)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry.echoInfoFor(ftalias_list)
|
||||
echomsg "Syntastic info for filetype: " . join(a:ftalias_list, '.')
|
||||
|
||||
let available = []
|
||||
let active = []
|
||||
for ftalias in a:ftalias_list
|
||||
call extend(available, self.availableCheckersFor(ftalias))
|
||||
call extend(active, self.getActiveCheckers(ftalias))
|
||||
endfor
|
||||
|
||||
echomsg "Available checkers: " . join(syntastic#util#unique(map(available, "v:val.getName()")))
|
||||
echomsg "Currently active checker(s): " . join(syntastic#util#unique(map(active, "v:val.getName()")))
|
||||
endfunction
|
||||
|
||||
" Private methods {{{1
|
||||
|
||||
function! g:SyntasticRegistry._allCheckersFor(filetype)
|
||||
call self._loadCheckers(a:filetype)
|
||||
if empty(self._checkerMap[a:filetype])
|
||||
return []
|
||||
endif
|
||||
|
||||
return self._checkerMap[a:filetype]
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry._filterCheckersByDefaultSettings(checkers, filetype)
|
||||
if has_key(s:defaultCheckers, a:filetype)
|
||||
return self._filterCheckersByName(a:checkers, s:defaultCheckers[a:filetype])
|
||||
endif
|
||||
|
||||
return a:checkers
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry._filterCheckersByUserSettings(checkers, filetype)
|
||||
if exists("b:syntastic_checkers")
|
||||
let whitelist = b:syntastic_checkers
|
||||
else
|
||||
let whitelist = g:syntastic_{a:filetype}_checkers
|
||||
endif
|
||||
return self._filterCheckersByName(a:checkers, whitelist)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry._filterCheckersByName(checkers, list)
|
||||
let checkers_by_name = {}
|
||||
for c in a:checkers
|
||||
let checkers_by_name[c.getName()] = c
|
||||
endfor
|
||||
|
||||
let filtered = []
|
||||
for name in a:list
|
||||
if has_key(checkers_by_name, name)
|
||||
call add(filtered, checkers_by_name[name])
|
||||
endif
|
||||
endfor
|
||||
|
||||
return filtered
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry._filterCheckersByAvailability(checkers)
|
||||
return filter(copy(a:checkers), "v:val.isAvailable()")
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry._loadCheckers(filetype)
|
||||
if self._haveLoadedCheckers(a:filetype)
|
||||
return
|
||||
endif
|
||||
|
||||
exec "runtime! syntax_checkers/" . a:filetype . "/*.vim"
|
||||
|
||||
if !has_key(self._checkerMap, a:filetype)
|
||||
let self._checkerMap[a:filetype] = []
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry._haveLoadedCheckers(filetype)
|
||||
return has_key(self._checkerMap, a:filetype)
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry._userHasFiletypeSettings(filetype)
|
||||
if exists("g:syntastic_" . a:filetype . "_checker") && !exists("g:syntastic_" . a:filetype . "_checkers")
|
||||
let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker]
|
||||
call syntastic#util#deprecationWarn("variable g:syntastic_" . a:filetype . "_checker is deprecated")
|
||||
endif
|
||||
return exists("b:syntastic_checkers") || exists("g:syntastic_" . a:filetype . "_checkers")
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticRegistry._validateUniqueName(checker) abort
|
||||
for checker in self._allCheckersFor(a:checker.getFiletype())
|
||||
if checker.getName() == a:checker.getName()
|
||||
throw "Syntastic: Duplicate syntax checker name for: " . a:checker.getName()
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" Private functions {{{1
|
||||
|
||||
"resolve filetype aliases, and replace - with _ otherwise we cant name
|
||||
"syntax checker functions legally for filetypes like "gentoo-metadata"
|
||||
function! s:SyntasticRegistryNormaliseFiletype(ftalias)
|
||||
let ft = get(s:defaultFiletypeMap, a:ftalias, a:ftalias)
|
||||
let ft = get(g:syntastic_filetype_map, ft, ft)
|
||||
let ft = substitute(ft, '-', '_', 'g')
|
||||
return ft
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
149
sources_non_forked/syntastic/plugin/syntastic/signs.vim
Normal file
149
sources_non_forked/syntastic/plugin/syntastic/signs.vim
Normal file
@ -0,0 +1,149 @@
|
||||
if exists("g:loaded_syntastic_notifier_signs")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_notifier_signs = 1
|
||||
|
||||
if !exists("g:syntastic_enable_signs")
|
||||
let g:syntastic_enable_signs = 1
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_error_symbol")
|
||||
let g:syntastic_error_symbol = '>>'
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_warning_symbol")
|
||||
let g:syntastic_warning_symbol = '>>'
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_style_error_symbol")
|
||||
let g:syntastic_style_error_symbol = 'S>'
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_style_warning_symbol")
|
||||
let g:syntastic_style_warning_symbol = 'S>'
|
||||
endif
|
||||
|
||||
|
||||
" start counting sign ids at 5000, start here to hopefully avoid conflicting
|
||||
" with any other code that places signs (not sure if this precaution is
|
||||
" actually needed)
|
||||
let s:first_sign_id = 5000
|
||||
let s:next_sign_id = s:first_sign_id
|
||||
|
||||
let g:SyntasticSignsNotifier = {}
|
||||
|
||||
let s:setup_done = 0
|
||||
|
||||
" Public methods {{{1
|
||||
|
||||
function! g:SyntasticSignsNotifier.New()
|
||||
let newObj = copy(self)
|
||||
|
||||
if !s:setup_done
|
||||
call self._setup()
|
||||
let s:setup_done = 1
|
||||
endif
|
||||
|
||||
return newObj
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticSignsNotifier.enabled()
|
||||
return
|
||||
\ has('signs') &&
|
||||
\ exists('b:syntastic_enable_signs') ? b:syntastic_enable_signs : g:syntastic_enable_signs
|
||||
endfunction
|
||||
|
||||
function! g:SyntasticSignsNotifier.refresh(loclist)
|
||||
let old_signs = copy(self._bufSignIds())
|
||||
if self.enabled()
|
||||
call self._signErrors(a:loclist)
|
||||
endif
|
||||
call self._removeSigns(old_signs)
|
||||
let s:first_sign_id = s:next_sign_id
|
||||
endfunction
|
||||
|
||||
" Private methods {{{1
|
||||
|
||||
" One time setup: define our own sign types and highlighting
|
||||
function! g:SyntasticSignsNotifier._setup()
|
||||
if has('signs')
|
||||
if !hlexists('SyntasticErrorSign')
|
||||
highlight link SyntasticErrorSign error
|
||||
endif
|
||||
if !hlexists('SyntasticWarningSign')
|
||||
highlight link SyntasticWarningSign todo
|
||||
endif
|
||||
if !hlexists('SyntasticStyleErrorSign')
|
||||
highlight link SyntasticStyleErrorSign SyntasticErrorSign
|
||||
endif
|
||||
if !hlexists('SyntasticStyleWarningSign')
|
||||
highlight link SyntasticStyleWarningSign SyntasticWarningSign
|
||||
endif
|
||||
if !hlexists('SyntasticStyleErrorLine')
|
||||
highlight link SyntasticStyleErrorLine SyntasticErrorLine
|
||||
endif
|
||||
if !hlexists('SyntasticStyleWarningLine')
|
||||
highlight link SyntasticStyleWarningLine SyntasticWarningLine
|
||||
endif
|
||||
|
||||
" define the signs used to display syntax and style errors/warns
|
||||
exe 'sign define SyntasticError text=' . g:syntastic_error_symbol .
|
||||
\ ' texthl=SyntasticErrorSign linehl=SyntasticErrorLine'
|
||||
exe 'sign define SyntasticWarning text=' . g:syntastic_warning_symbol .
|
||||
\ ' texthl=SyntasticWarningSign linehl=SyntasticWarningLine'
|
||||
exe 'sign define SyntasticStyleError text=' . g:syntastic_style_error_symbol .
|
||||
\ ' texthl=SyntasticStyleErrorSign linehl=SyntasticStyleErrorLine'
|
||||
exe 'sign define SyntasticStyleWarning text=' . g:syntastic_style_warning_symbol .
|
||||
\ ' texthl=SyntasticStyleWarningSign linehl=SyntasticStyleWarningLine'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Place signs by all syntax errors in the buffer
|
||||
function! g:SyntasticSignsNotifier._signErrors(loclist)
|
||||
let loclist = a:loclist
|
||||
if loclist.hasErrorsOrWarningsToDisplay()
|
||||
|
||||
" errors some first, so that they are not masked by warnings
|
||||
let buf = bufnr('')
|
||||
let issues = copy(loclist.errors())
|
||||
if !loclist.quietWarnings()
|
||||
call extend(issues, loclist.warnings())
|
||||
endif
|
||||
call filter(issues, 'v:val["bufnr"] == buf')
|
||||
let seen = {}
|
||||
|
||||
for i in issues
|
||||
if !has_key(seen, i['lnum'])
|
||||
let seen[i['lnum']] = 1
|
||||
|
||||
let sign_severity = i['type'] ==? 'W' ? 'Warning' : 'Error'
|
||||
let sign_subtype = get(i, 'subtype', '')
|
||||
let sign_type = 'Syntastic' . sign_subtype . sign_severity
|
||||
|
||||
exec "sign place " . s:next_sign_id . " line=" . i['lnum'] . " name=" . sign_type . " buffer=" . i['bufnr']
|
||||
call add(self._bufSignIds(), s:next_sign_id)
|
||||
let s:next_sign_id += 1
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Remove the signs with the given ids from this buffer
|
||||
function! g:SyntasticSignsNotifier._removeSigns(ids)
|
||||
if has('signs')
|
||||
for i in a:ids
|
||||
exec "sign unplace " . i
|
||||
call remove(self._bufSignIds(), index(self._bufSignIds(), i))
|
||||
endfor
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Get all the ids of the SyntaxError signs in the buffer
|
||||
function! g:SyntasticSignsNotifier._bufSignIds()
|
||||
if !exists("b:syntastic_sign_ids")
|
||||
let b:syntastic_sign_ids = []
|
||||
endif
|
||||
return b:syntastic_sign_ids
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
168
sources_non_forked/syntastic/syntax_checkers/ada/gcc.vim
Normal file
168
sources_non_forked/syntastic/syntax_checkers/ada/gcc.vim
Normal file
@ -0,0 +1,168 @@
|
||||
"============================================================================
|
||||
"File: ada.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Alfredo Di Napoli <alfredo.dinapoli@gmail.com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
" In order to also check header files add this to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_ada_check_header = 1
|
||||
"
|
||||
" To disable the search of included header files after special
|
||||
" libraries like gtk and glib add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_ada_no_include_search = 1
|
||||
"
|
||||
" To disable the include of the default include dirs (such as /usr/include)
|
||||
" add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_ada_no_default_include_dirs = 1
|
||||
"
|
||||
" To enable header files being re-checked on every file write add the
|
||||
" following line to your .vimrc. Otherwise the header files are checked only
|
||||
" one time on initially loading the file.
|
||||
" In order to force syntastic to refresh the header includes simply
|
||||
" unlet b:syntastic_ada_includes. Then the header files are being re-checked
|
||||
" on the next file write.
|
||||
"
|
||||
" let g:syntastic_ada_auto_refresh_includes = 1
|
||||
"
|
||||
" Alternatively you can set the buffer local variable b:syntastic_ada_cflags.
|
||||
" If this variable is set for the current buffer no search for additional
|
||||
" libraries is done. I.e. set the variable like this:
|
||||
"
|
||||
" let b:syntastic_ada_cflags = ' -I/usr/include/libsoup-2.4'
|
||||
"
|
||||
" In order to add some custom include directories that should be added to the
|
||||
" gcc command line you can add those to the global variable
|
||||
" g:syntastic_ada_include_dirs. This list can be used like this:
|
||||
"
|
||||
" let g:syntastic_ada_include_dirs = [ 'includes', 'headers' ]
|
||||
"
|
||||
" Moreover it is possible to add additional compiler options to the syntax
|
||||
" checking execution via the variable 'g:syntastic_ada_compiler_options':
|
||||
"
|
||||
" let g:syntastic_ada_compiler_options = ' -std=c++0x'
|
||||
"
|
||||
" Additionally the setting 'g:syntastic_ada_config_file' allows you to define
|
||||
" a file that contains additional compiler arguments like include directories
|
||||
" or CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_ada_config':
|
||||
"
|
||||
" let g:syntastic_ada_config_file = '.config'
|
||||
"
|
||||
" Using the global variable 'g:syntastic_ada_remove_include_errors' you can
|
||||
" specify whether errors of files included via the
|
||||
" g:syntastic_ada_include_dirs' setting are removed from the result set:
|
||||
"
|
||||
" let g:syntastic_ada_remove_include_errors = 1
|
||||
"
|
||||
" Use the variable 'g:syntastic_ada_errorformat' to override the default error
|
||||
" format:
|
||||
"
|
||||
" let g:syntastic_ada_errorformat = '%f:%l:%c: %trror: %m'
|
||||
"
|
||||
" Set your compiler executable with e.g. (defaults to gcc)
|
||||
"
|
||||
" let g:syntastic_ada_compiler = 'gcc'
|
||||
|
||||
if exists('g:loaded_syntastic_ada_gcc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_ada_gcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_ada_compiler')
|
||||
let g:syntastic_ada_compiler = 'gcc'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_ada_gcc_IsAvailable()
|
||||
return executable(g:syntastic_ada_compiler)
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:syntastic_ada_compiler_options')
|
||||
let g:syntastic_ada_compiler_options = ''
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_ada_config_file')
|
||||
let g:syntastic_ada_config_file = '.syntastic_ada_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_ada_gcc_GetLocList()
|
||||
let makeprg = g:syntastic_ada_compiler . ' -c -x ada -fsyntax-only '
|
||||
let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
|
||||
|
||||
if exists('g:syntastic_c_errorformat')
|
||||
let errorformat = g:syntastic_c_errorformat
|
||||
endif
|
||||
|
||||
" add optional user-defined compiler options
|
||||
let makeprg .= g:syntastic_ada_compiler_options
|
||||
|
||||
let makeprg .= ' ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('ada')
|
||||
|
||||
" determine whether to parse header files as well
|
||||
if expand('%') =~? '\.ads$'
|
||||
if exists('g:syntastic_ada_check_header')
|
||||
let makeprg = g:syntastic_ada_compiler .
|
||||
\ ' -c ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . g:syntastic_ada_compiler_options .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('ada')
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
" check if the user manually set some cflags
|
||||
if !exists('b:syntastic_ada_cflags')
|
||||
" check whether to search for include files at all
|
||||
if !exists('g:syntastic_ada_no_include_search') ||
|
||||
\ g:syntastic_ada_no_include_search != 1
|
||||
" refresh the include file search if desired
|
||||
if exists('g:syntastic_ada_auto_refresh_includes') &&
|
||||
\ g:syntastic_ada_auto_refresh_includes != 0
|
||||
let makeprg .= syntastic#c#SearchHeaders()
|
||||
else
|
||||
" search for header includes if not cached already
|
||||
if !exists('b:syntastic_ada_includes')
|
||||
let b:syntastic_ada_includes = syntastic#c#SearchHeaders()
|
||||
endif
|
||||
let makeprg .= b:syntastic_ada_includes
|
||||
endif
|
||||
endif
|
||||
else
|
||||
" use the user-defined cflags
|
||||
let makeprg .= b:syntastic_ada_cflags
|
||||
endif
|
||||
|
||||
" add optional config file parameters
|
||||
let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_ada_config_file)
|
||||
|
||||
" process makeprg
|
||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
" filter the processed errors if desired
|
||||
if exists('g:syntastic_ada_remove_include_errors') &&
|
||||
\ g:syntastic_ada_remove_include_errors != 0
|
||||
return filter(errors,
|
||||
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
|
||||
else
|
||||
return errors
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'ada',
|
||||
\ 'name': 'gcc'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -0,0 +1,50 @@
|
||||
"==============================================================================
|
||||
" FileName: applescript.vim
|
||||
" Desc: Syntax checking plugin for syntastic.vim
|
||||
" Author: Zhao Cai
|
||||
" Email: caizhaoff@gmail.com
|
||||
" Version: 0.2.1
|
||||
" Date Created: Thu 09 Sep 2011 10:30:09 AM EST
|
||||
" Last Modified: Fri 09 Dec 2011 01:10:24 PM EST
|
||||
"
|
||||
" History: 0.1.0 - working, but it will run the script everytime to check
|
||||
" syntax. Should use osacompile but strangely it does not give
|
||||
" errors.
|
||||
"
|
||||
" 0.2.0 - switch to osacompile, it gives less errors compared
|
||||
" with osascript.
|
||||
"
|
||||
" 0.2.1 - remove g:syntastic_applescript_tempfile. use
|
||||
" tempname() instead.
|
||||
"
|
||||
" License: This program is free software. It comes without any
|
||||
" warranty, to the extent permitted by applicable law. You can
|
||||
" redistribute it and/or modify it under the terms of the Do What The
|
||||
" Fuck You Want To Public License, Version 2, as published by Sam
|
||||
" Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_applescript_osacompile_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_applescript_osacompile_checker=1
|
||||
|
||||
function! SyntaxCheckers_applescript_osacompile_IsAvailable()
|
||||
return executable('osacompile')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_applescript_osacompile_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'osacompile',
|
||||
\ 'args': '-o ' . tempname() . '.scpt ',
|
||||
\ 'filetype': 'applescript',
|
||||
\ 'subchecker': 'osacompile' })
|
||||
let errorformat = '%f:%l:%m'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'applescript',
|
||||
\ 'name': 'osacompile'})
|
@ -0,0 +1,47 @@
|
||||
"============================================================================
|
||||
"File: asciidoc.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_asciidoc_asciidoc_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_asciidoc_asciidoc_checker = 1
|
||||
|
||||
function! SyntaxCheckers_asciidoc_asciidoc_IsAvailable()
|
||||
return executable("asciidoc")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_asciidoc_asciidoc_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'asciidoc',
|
||||
\ 'args': syntastic#c#GetNullDevice(),
|
||||
\ 'filetype': 'asciidoc',
|
||||
\ 'subchecker': 'asciidoc' })
|
||||
|
||||
let errorformat =
|
||||
\ '%Easciidoc: %tRROR: %f: line %l: %m,' .
|
||||
\ '%Easciidoc: %tRROR: %f: %m,' .
|
||||
\ '%Easciidoc: FAILED: %f: line %l: %m,' .
|
||||
\ '%Easciidoc: FAILED: %f: %m,' .
|
||||
\ '%Wasciidoc: %tARNING: %f: line %l: %m,' .
|
||||
\ '%Wasciidoc: %tARNING: %f: %m,' .
|
||||
\ '%Wasciidoc: DEPRECATED: %f: line %l: %m,' .
|
||||
\ '%Wasciidoc: DEPRECATED: %f: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0, 1] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'asciidoc',
|
||||
\ 'name': 'asciidoc'})
|
@ -0,0 +1,48 @@
|
||||
"============================================================================
|
||||
"File: checkpatch.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim using checkpatch.pl
|
||||
"Maintainer: Daniel Walker <dwalker at fifo99 dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
if exists("g:loaded_syntastic_c_checkpatch_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_checkpatch_checker = 1
|
||||
|
||||
" Bail if the user doesn't have `checkpatch.pl` or ./scripts/checkpatch.pl installed.
|
||||
if executable("checkpatch.pl")
|
||||
let g:syntastic_c_checker_checkpatch_location = 'checkpatch.pl'
|
||||
elseif executable("./scripts/checkpatch.pl")
|
||||
let g:syntastic_c_checker_checkpatch_location = './scripts/checkpatch.pl'
|
||||
endif
|
||||
|
||||
function SyntaxCheckers_c_checkpatch_IsAvailable()
|
||||
return exists("g:syntastic_c_checker_checkpatch_location")
|
||||
endfunction
|
||||
|
||||
|
||||
function! SyntaxCheckers_c_checkpatch_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': g:syntastic_c_checker_checkpatch_location,
|
||||
\ 'args': '--no-summary --no-tree --terse --file',
|
||||
\ 'filetype': 'c',
|
||||
\ 'subchecker': 'checkpatch' })
|
||||
|
||||
let errorformat =
|
||||
\ '%f:%l: %tARNING: %m,' .
|
||||
\ '%f:%l: %tRROR: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0],
|
||||
\ 'subtype': 'Style' })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'checkpatch'})
|
183
sources_non_forked/syntastic/syntax_checkers/c/gcc.vim
Normal file
183
sources_non_forked/syntastic/syntax_checkers/c/gcc.vim
Normal file
@ -0,0 +1,183 @@
|
||||
"============================================================================
|
||||
"File: c.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
" In order to also check header files add this to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_c_check_header = 1
|
||||
"
|
||||
" To disable the search of included header files after special
|
||||
" libraries like gtk and glib add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_c_no_include_search = 1
|
||||
"
|
||||
" To disable the include of the default include dirs (such as /usr/include)
|
||||
" add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_c_no_default_include_dirs = 1
|
||||
"
|
||||
" To enable header files being re-checked on every file write add the
|
||||
" following line to your .vimrc. Otherwise the header files are checked only
|
||||
" one time on initially loading the file.
|
||||
" In order to force syntastic to refresh the header includes simply
|
||||
" unlet b:syntastic_c_includes. Then the header files are being re-checked on
|
||||
" the next file write.
|
||||
"
|
||||
" let g:syntastic_c_auto_refresh_includes = 1
|
||||
"
|
||||
" Alternatively you can set the buffer local variable b:syntastic_c_cflags.
|
||||
" If this variable is set for the current buffer no search for additional
|
||||
" libraries is done. I.e. set the variable like this:
|
||||
"
|
||||
" let b:syntastic_c_cflags = ' -I/usr/include/libsoup-2.4'
|
||||
"
|
||||
" In order to add some custom include directories that should be added to the
|
||||
" gcc command line you can add those to the global variable
|
||||
" g:syntastic_c_include_dirs. This list can be used like this:
|
||||
"
|
||||
" let g:syntastic_c_include_dirs = [ 'includes', 'headers' ]
|
||||
"
|
||||
" Moreover it is possible to add additional compiler options to the syntax
|
||||
" checking execution via the variable 'g:syntastic_c_compiler_options':
|
||||
"
|
||||
" let g:syntastic_c_compiler_options = ' -ansi'
|
||||
"
|
||||
" Additionally the setting 'g:syntastic_c_config_file' allows you to define a
|
||||
" file that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_c_config':
|
||||
"
|
||||
" let g:syntastic_c_config_file = '.config'
|
||||
"
|
||||
" Using the global variable 'g:syntastic_c_remove_include_errors' you can
|
||||
" specify whether errors of files included via the g:syntastic_c_include_dirs'
|
||||
" setting are removed from the result set:
|
||||
"
|
||||
" let g:syntastic_c_remove_include_errors = 1
|
||||
"
|
||||
" Use the variable 'g:syntastic_c_errorformat' to override the default error
|
||||
" format:
|
||||
"
|
||||
" let g:syntastic_c_errorformat = '%f:%l:%c: %trror: %m'
|
||||
"
|
||||
" Set your compiler executable with e.g. (defaults to gcc)
|
||||
"
|
||||
" let g:syntastic_c_compiler = 'clang'
|
||||
|
||||
if exists('g:loaded_syntastic_c_gcc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_gcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_c_compiler')
|
||||
let g:syntastic_c_compiler = 'gcc'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_gcc_IsAvailable()
|
||||
return executable(g:syntastic_c_compiler)
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:syntastic_c_compiler_options')
|
||||
let g:syntastic_c_compiler_options = '-std=gnu99'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_c_config_file')
|
||||
let g:syntastic_c_config_file = '.syntastic_c_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_gcc_GetLocList()
|
||||
let makeprg = g:syntastic_c_compiler . ' -x c -fsyntax-only '
|
||||
let errorformat =
|
||||
\ '%-G%f:%s:,' .
|
||||
\ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' .
|
||||
\ '%-G%f:%l: %#error: %#for each function it appears%.%#,' .
|
||||
\ '%-GIn file included%.%#,' .
|
||||
\ '%-G %#from %f:%l\,,' .
|
||||
\ '%f:%l:%c: %trror: %m,' .
|
||||
\ '%f:%l:%c: %tarning: %m,' .
|
||||
\ '%f:%l:%c: %m,' .
|
||||
\ '%f:%l: %trror: %m,' .
|
||||
\ '%f:%l: %tarning: %m,'.
|
||||
\ '%f:%l: %m'
|
||||
|
||||
if exists('g:syntastic_c_errorformat')
|
||||
let errorformat = g:syntastic_c_errorformat
|
||||
endif
|
||||
|
||||
" add optional user-defined compiler options
|
||||
let makeprg .= g:syntastic_c_compiler_options
|
||||
|
||||
let makeprg .= ' ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('c')
|
||||
|
||||
" determine whether to parse header files as well
|
||||
if expand('%') =~? '\.h$'
|
||||
if exists('g:syntastic_c_check_header')
|
||||
let makeprg = g:syntastic_c_compiler .
|
||||
\ ' -c ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . g:syntastic_c_compiler_options .
|
||||
\ ' ' . syntastic#c#GetNullDevice() .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('c')
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
" check if the user manually set some cflags
|
||||
if !exists('b:syntastic_c_cflags')
|
||||
" check whether to search for include files at all
|
||||
if !exists('g:syntastic_c_no_include_search') ||
|
||||
\ g:syntastic_c_no_include_search != 1
|
||||
" refresh the include file search if desired
|
||||
if exists('g:syntastic_c_auto_refresh_includes') &&
|
||||
\ g:syntastic_c_auto_refresh_includes != 0
|
||||
let makeprg .= syntastic#c#SearchHeaders()
|
||||
else
|
||||
" search for header includes if not cached already
|
||||
if !exists('b:syntastic_c_includes')
|
||||
let b:syntastic_c_includes = syntastic#c#SearchHeaders()
|
||||
endif
|
||||
let makeprg .= b:syntastic_c_includes
|
||||
endif
|
||||
endif
|
||||
else
|
||||
" use the user-defined cflags
|
||||
let makeprg .= b:syntastic_c_cflags
|
||||
endif
|
||||
|
||||
" add optional config file parameters
|
||||
let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_c_config_file)
|
||||
|
||||
" process makeprg
|
||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
" filter the processed errors if desired
|
||||
if exists('g:syntastic_c_remove_include_errors') &&
|
||||
\ g:syntastic_c_remove_include_errors != 0
|
||||
return filter(errors,
|
||||
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
|
||||
else
|
||||
return errors
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'gcc'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
65
sources_non_forked/syntastic/syntax_checkers/c/make.vim
Normal file
65
sources_non_forked/syntastic/syntax_checkers/c/make.vim
Normal file
@ -0,0 +1,65 @@
|
||||
"============================================================================
|
||||
"File: make.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_c_make_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_make_checker = 1
|
||||
|
||||
function SyntaxCheckers_c_make_IsAvailable()
|
||||
return executable('make')
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_make_GetLocList()
|
||||
|
||||
let makeprg = 'make -sk'
|
||||
|
||||
let errorformat =
|
||||
\ '%-G%f:%s:,' .
|
||||
\ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' .
|
||||
\ '%-G%f:%l: %#error: %#for each function it appears%.%#,' .
|
||||
\ '%-GIn file included%.%#,' .
|
||||
\ '%-G %#from %f:%l\,,' .
|
||||
\ '%f:%l:%c: %trror: %m,' .
|
||||
\ '%f:%l:%c: %tarning: %m,' .
|
||||
\ '%f:%l:%c: %m,' .
|
||||
\ '%f:%l: %trror: %m,' .
|
||||
\ '%f:%l: %tarning: %m,'.
|
||||
\ '%f:%l: %m'
|
||||
|
||||
if exists('g:syntastic_c_errorformat')
|
||||
let errorformat = g:syntastic_c_errorformat
|
||||
endif
|
||||
|
||||
" process makeprg
|
||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
" filter the processed errors if desired
|
||||
if exists('g:syntastic_c_remove_include_errors') &&
|
||||
\ g:syntastic_c_remove_include_errors != 0
|
||||
return filter(errors,
|
||||
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
|
||||
else
|
||||
return errors
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'make'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
58
sources_non_forked/syntastic/syntax_checkers/c/oclint.vim
Normal file
58
sources_non_forked/syntastic/syntax_checkers/c/oclint.vim
Normal file
@ -0,0 +1,58 @@
|
||||
"============================================================================
|
||||
"File: oclint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: "UnCO" Lin <undercooled aT lavabit com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
"
|
||||
" The setting 'g:syntastic_oclint_config_file' allows you to define a file
|
||||
" that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_oclint_config':
|
||||
"
|
||||
" let g:syntastic_oclint_config_file = '.config'
|
||||
|
||||
if exists("g:loaded_syntastic_c_oclint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_oclint_checker = 1
|
||||
|
||||
function! SyntaxCheckers_c_oclint_IsAvailable()
|
||||
return executable("oclint")
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_oclint_config_file')
|
||||
let g:syntastic_oclint_config_file = '.syntastic_oclint_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_oclint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'oclint',
|
||||
\ 'args': '-text',
|
||||
\ 'post_args': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file),
|
||||
\ 'filetype': 'c',
|
||||
\ 'subchecker': 'oclint' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: %m P1 ,' .
|
||||
\ '%E%f:%l:%c: %m P2 ,' .
|
||||
\ '%W%f:%l:%c: %m P3 ,' .
|
||||
\ '%E%f:%l:%c: fatal error: %m,' .
|
||||
\ '%E%f:%l:%c: error: %m,' .
|
||||
\ '%W%f:%l:%c: warning: %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'postprocess': ['compressWhitespace', 'sort'] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'oclint'})
|
51
sources_non_forked/syntastic/syntax_checkers/c/sparse.vim
Normal file
51
sources_non_forked/syntastic/syntax_checkers/c/sparse.vim
Normal file
@ -0,0 +1,51 @@
|
||||
"============================================================================
|
||||
"File: sparse.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim using sparse.pl
|
||||
"Maintainer: Daniel Walker <dwalker at fifo99 dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
"
|
||||
" The setting 'g:syntastic_sparse_config_file' allows you to define a file
|
||||
" that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_sparse_config':
|
||||
"
|
||||
" let g:syntastic_sparse_config_file = '.config'
|
||||
|
||||
if exists("g:loaded_syntastic_c_sparse_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_sparse_checker = 1
|
||||
|
||||
function! SyntaxCheckers_c_sparse_IsAvailable()
|
||||
return executable("sparse")
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_sparse_config_file')
|
||||
let g:syntastic_sparse_config_file = '.syntastic_sparse_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_sparse_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'sparse',
|
||||
\ 'args': '-ftabstop=' . &ts . ' ' . syntastic#c#ReadConfig(g:syntastic_sparse_config_file),
|
||||
\ 'filetype': 'c',
|
||||
\ 'subchecker': 'sparse' })
|
||||
|
||||
let errorformat = '%f:%l:%v: %trror: %m,%f:%l:%v: %tarning: %m,'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")},
|
||||
\ 'returns': [0] })
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'sparse'})
|
57
sources_non_forked/syntastic/syntax_checkers/c/splint.vim
Normal file
57
sources_non_forked/syntastic/syntax_checkers/c/splint.vim
Normal file
@ -0,0 +1,57 @@
|
||||
"============================================================================
|
||||
"File: splint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
"
|
||||
" The setting 'g:syntastic_splint_config_file' allows you to define a file
|
||||
" that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_splint_config':
|
||||
"
|
||||
" let g:syntastic_splint_config_file = '.config'
|
||||
|
||||
if exists("g:loaded_syntastic_c_splint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_splint_checker = 1
|
||||
|
||||
function! SyntaxCheckers_c_splint_IsAvailable()
|
||||
return executable("splint")
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_splint_config_file')
|
||||
let g:syntastic_splint_config_file = '.syntastic_splint_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_splint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'splint',
|
||||
\ 'post_args': '-showfunc -hints +quiet ' . syntastic#c#ReadConfig(g:syntastic_splint_config_file),
|
||||
\ 'filetype': 'c',
|
||||
\ 'subchecker': 'splint' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-G%f:%l:%v: %[%#]%[%#]%[%#] Internal Bug %.%#,' .
|
||||
\ '%W%f:%l:%v: %m,' .
|
||||
\ '%W%f:%l: %m,' .
|
||||
\ '%-C %\+In file included from %.%#,' .
|
||||
\ '%-C %\+from %.%#,' .
|
||||
\ '%+C %.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'postprocess': ['compressWhitespace'],
|
||||
\ 'defaults': {'type': 'W'} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'splint'})
|
32
sources_non_forked/syntastic/syntax_checkers/c/ycm.vim
Normal file
32
sources_non_forked/syntastic/syntax_checkers/c/ycm.vim
Normal file
@ -0,0 +1,32 @@
|
||||
"============================================================================
|
||||
"File: ycm.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Val Markovic <val at markovic dot io>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_c_ycm_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_ycm_checker = 1
|
||||
|
||||
function! SyntaxCheckers_c_ycm_IsAvailable()
|
||||
return exists('g:loaded_youcompleteme')
|
||||
endfunction
|
||||
|
||||
if !exists('g:loaded_youcompleteme')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_ycm_GetLocList()
|
||||
return youcompleteme#CurrentFileDiagnostics()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'ycm'})
|
44
sources_non_forked/syntastic/syntax_checkers/co/coco.vim
Normal file
44
sources_non_forked/syntastic/syntax_checkers/co/coco.vim
Normal file
@ -0,0 +1,44 @@
|
||||
"============================================================================
|
||||
"File: co.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Andrew Kelley <superjoe30@gmail.com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
if exists("g:loaded_syntastic_co_coco_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_co_coco_checker=1
|
||||
|
||||
"bail if the user doesnt have coco installed
|
||||
if !executable("coco")
|
||||
finish
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_co_coco_GetLocList()
|
||||
return executable('coco')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_co_coco_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'coco',
|
||||
\ 'args': '-c -o /tmp',
|
||||
\ 'filetype': 'co',
|
||||
\ 'subchecker': 'coco' })
|
||||
|
||||
let errorformat =
|
||||
\ '%EFailed at: %f,' .
|
||||
\ '%ZSyntax%trror: %m on line %l,'.
|
||||
\ '%EFailed at: %f,'.
|
||||
\ '%Z%trror: Parse error on line %l: %m'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'co',
|
||||
\ 'name': 'coco'})
|
@ -0,0 +1,48 @@
|
||||
"============================================================================
|
||||
"File: coffee.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Lincoln Stoll <l@lds.li>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" Note: this script requires CoffeeScript version 1.6.2 or newer.
|
||||
"
|
||||
if exists("g:loaded_syntastic_coffee_coffee_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_coffee_coffee_checker=1
|
||||
|
||||
function! SyntaxCheckers_coffee_coffee_IsAvailable()
|
||||
return executable("coffee") &&
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('coffee --version 2>' . syntastic#util#DevNull()), [1,6,2])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_coffee_coffee_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'coffee',
|
||||
\ 'args': '-cp',
|
||||
\ 'filetype': 'coffee',
|
||||
\ 'subchecker': 'coffee' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: %trror: %m,' .
|
||||
\ 'Syntax%trror: In %f\, %m on line %l,' .
|
||||
\ '%EError: In %f\, Parse error on line %l: %m,' .
|
||||
\ '%EError: In %f\, %m on line %l,' .
|
||||
\ '%W%f(%l): lint warning: %m,' .
|
||||
\ '%W%f(%l): warning: %m,' .
|
||||
\ '%E%f(%l): SyntaxError: %m,' .
|
||||
\ '%-Z%p^,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'coffee',
|
||||
\ 'name': 'coffee'})
|
@ -0,0 +1,43 @@
|
||||
"============================================================================
|
||||
"File: coffeelint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Lincoln Stoll <l@lds.li>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
if exists("g:loaded_syntastic_coffee_coffeelint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_coffee_coffeelint_checker=1
|
||||
|
||||
function! SyntaxCheckers_coffee_coffeelint_IsAvailable()
|
||||
return executable('coffeelint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_coffee_coffeelint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'coffeelint',
|
||||
\ 'args': '--csv',
|
||||
\ 'filetype': 'coffee',
|
||||
\ 'subchecker': 'coffeelint' })
|
||||
|
||||
let errorformat =
|
||||
\ '%f\,%l\,%\d%#\,%trror\,%m,' .
|
||||
\ '%f\,%l\,%trror\,%m,' .
|
||||
\ '%f\,%l\,%\d%#\,%tarn\,%m,' .
|
||||
\ '%f\,%l\,%tarn\,%m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'returns': [0, 1] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'coffee',
|
||||
\ 'name': 'coffeelint'})
|
40
sources_non_forked/syntastic/syntax_checkers/coq/coqtop.vim
Normal file
40
sources_non_forked/syntastic/syntax_checkers/coq/coqtop.vim
Normal file
@ -0,0 +1,40 @@
|
||||
"============================================================================
|
||||
"File: coqtop.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Matvey Aksenov <matvey.aksenov at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_coq_coqtop_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_coq_coqtop_checker=1
|
||||
|
||||
function! SyntaxCheckers_coq_coqtop_IsAvailable()
|
||||
return executable('coqtop')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_coq_coqtop_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'coqtop',
|
||||
\ 'args': '-noglob -batch -load-vernac-source',
|
||||
\ 'filetype': 'coq',
|
||||
\ 'subchecker': 'coqtop' })
|
||||
|
||||
let errorformat =
|
||||
\ '%AFile \"%f\"\, line %l\, characters %c\-%.%#\:,'.
|
||||
\ '%C%m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'coq',
|
||||
\ 'name': 'coqtop'})
|
65
sources_non_forked/syntastic/syntax_checkers/cpp/cpplint.vim
Normal file
65
sources_non_forked/syntastic/syntax_checkers/cpp/cpplint.vim
Normal file
@ -0,0 +1,65 @@
|
||||
"============================================================================
|
||||
"File: cpplint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" For details about cpplint see:
|
||||
" https://code.google.com/p/google-styleguide/
|
||||
"
|
||||
" Checker options:
|
||||
"
|
||||
" - g:syntastic_cpp_cpplint_thres (integer; default: 5)
|
||||
" error threshold: policy violations with a severity above this
|
||||
" value are highlighted as errors, the others are warnings
|
||||
"
|
||||
" - g:syntastic_cpp_cpplint_args (string; default: '--verbose=3')
|
||||
" command line options to pass to cpplint
|
||||
|
||||
if exists("g:loaded_syntastic_cpp_cpplint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_cpplint_checker = 1
|
||||
|
||||
if !exists('g:syntastic_cpp_cpplint_thres')
|
||||
let g:syntastic_cpp_cpplint_thres = 5
|
||||
endif
|
||||
|
||||
if ! exists('g:syntastic_cpp_cpplint_args')
|
||||
let g:syntastic_cpp_cpplint_args = '--verbose=3'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cpp_cpplint_IsAvailable()
|
||||
return executable('cpplint.py')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cpp_cpplint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'cpplint.py',
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'subchecker': 'cpplint' })
|
||||
|
||||
let errorformat = '%A%f:%l: %m [%t],%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style' })
|
||||
|
||||
" change error types according to the prescribed threshold
|
||||
for n in range(len(loclist))
|
||||
let loclist[n]['type'] = loclist[n]['type'] < g:syntastic_cpp_cpplint_thres ? 'W' : 'E'
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'cpplint'})
|
179
sources_non_forked/syntastic/syntax_checkers/cpp/gcc.vim
Normal file
179
sources_non_forked/syntastic/syntax_checkers/cpp/gcc.vim
Normal file
@ -0,0 +1,179 @@
|
||||
"============================================================================
|
||||
"File: cpp.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
" In order to also check header files add this to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_cpp_check_header = 1
|
||||
"
|
||||
" To disable the search of included header files after special
|
||||
" libraries like gtk and glib add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_cpp_no_include_search = 1
|
||||
"
|
||||
" To disable the include of the default include dirs (such as /usr/include)
|
||||
" add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_cpp_no_default_include_dirs = 1
|
||||
"
|
||||
" To enable header files being re-checked on every file write add the
|
||||
" following line to your .vimrc. Otherwise the header files are checked only
|
||||
" one time on initially loading the file.
|
||||
" In order to force syntastic to refresh the header includes simply
|
||||
" unlet b:syntastic_cpp_includes. Then the header files are being re-checked
|
||||
" on the next file write.
|
||||
"
|
||||
" let g:syntastic_cpp_auto_refresh_includes = 1
|
||||
"
|
||||
" Alternatively you can set the buffer local variable b:syntastic_cpp_cflags.
|
||||
" If this variable is set for the current buffer no search for additional
|
||||
" libraries is done. I.e. set the variable like this:
|
||||
"
|
||||
" let b:syntastic_cpp_cflags = ' -I/usr/include/libsoup-2.4'
|
||||
"
|
||||
" In order to add some custom include directories that should be added to the
|
||||
" gcc command line you can add those to the global variable
|
||||
" g:syntastic_cpp_include_dirs. This list can be used like this:
|
||||
"
|
||||
" let g:syntastic_cpp_include_dirs = [ 'includes', 'headers' ]
|
||||
"
|
||||
" Moreover it is possible to add additional compiler options to the syntax
|
||||
" checking execution via the variable 'g:syntastic_cpp_compiler_options':
|
||||
"
|
||||
" let g:syntastic_cpp_compiler_options = ' -std=c++0x'
|
||||
"
|
||||
" Additionally the setting 'g:syntastic_cpp_config_file' allows you to define
|
||||
" a file that contains additional compiler arguments like include directories
|
||||
" or CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_cpp_config':
|
||||
"
|
||||
" let g:syntastic_cpp_config_file = '.config'
|
||||
"
|
||||
" Using the global variable 'g:syntastic_cpp_remove_include_errors' you can
|
||||
" specify whether errors of files included via the
|
||||
" g:syntastic_cpp_include_dirs' setting are removed from the result set:
|
||||
"
|
||||
" let g:syntastic_cpp_remove_include_errors = 1
|
||||
"
|
||||
" Use the variable 'g:syntastic_cpp_errorformat' to override the default error
|
||||
" format:
|
||||
"
|
||||
" let g:syntastic_cpp_errorformat = '%f:%l:%c: %trror: %m'
|
||||
"
|
||||
" Set your compiler executable with e.g. (defaults to g++)
|
||||
"
|
||||
" let g:syntastic_cpp_compiler = 'clang++'
|
||||
|
||||
if exists('g:loaded_syntastic_cpp_gcc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_gcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_cpp_compiler')
|
||||
let g:syntastic_cpp_compiler = 'g++'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cpp_gcc_IsAvailable()
|
||||
return executable(g:syntastic_cpp_compiler)
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:syntastic_cpp_compiler_options')
|
||||
let g:syntastic_cpp_compiler_options = ''
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_cpp_config_file')
|
||||
let g:syntastic_cpp_config_file = '.syntastic_cpp_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cpp_gcc_GetLocList()
|
||||
let makeprg = g:syntastic_cpp_compiler . ' -x c++ -fsyntax-only '
|
||||
let errorformat =
|
||||
\ '%-G%f:%s:,' .
|
||||
\ '%f:%l:%c: %trror: %m,' .
|
||||
\ '%f:%l:%c: %tarning: %m,' .
|
||||
\ '%f:%l:%c: %m,'.
|
||||
\ '%f:%l: %trror: %m,'.
|
||||
\ '%f:%l: %tarning: %m,'.
|
||||
\ '%f:%l: %m'
|
||||
|
||||
if exists('g:syntastic_cpp_errorformat')
|
||||
let errorformat = g:syntastic_cpp_errorformat
|
||||
endif
|
||||
|
||||
" add optional user-defined compiler options
|
||||
let makeprg .= g:syntastic_cpp_compiler_options
|
||||
|
||||
let makeprg .= ' ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('cpp')
|
||||
|
||||
" determine whether to parse header files as well
|
||||
if expand('%') =~? '\.\(h\|hpp\|hh\)$'
|
||||
if exists('g:syntastic_cpp_check_header')
|
||||
let makeprg = g:syntastic_cpp_compiler .
|
||||
\ ' -c ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . g:syntastic_cpp_compiler_options .
|
||||
\ ' ' . syntastic#c#GetNullDevice() .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('cpp')
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
" check if the user manually set some cflags
|
||||
if !exists('b:syntastic_cpp_cflags')
|
||||
" check whether to search for include files at all
|
||||
if !exists('g:syntastic_cpp_no_include_search') ||
|
||||
\ g:syntastic_cpp_no_include_search != 1
|
||||
" refresh the include file search if desired
|
||||
if exists('g:syntastic_cpp_auto_refresh_includes') &&
|
||||
\ g:syntastic_cpp_auto_refresh_includes != 0
|
||||
let makeprg .= syntastic#c#SearchHeaders()
|
||||
else
|
||||
" search for header includes if not cached already
|
||||
if !exists('b:syntastic_cpp_includes')
|
||||
let b:syntastic_cpp_includes = syntastic#c#SearchHeaders()
|
||||
endif
|
||||
let makeprg .= b:syntastic_cpp_includes
|
||||
endif
|
||||
endif
|
||||
else
|
||||
" use the user-defined cflags
|
||||
let makeprg .= b:syntastic_cpp_cflags
|
||||
endif
|
||||
|
||||
" add optional config file parameters
|
||||
let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_cpp_config_file)
|
||||
|
||||
" process makeprg
|
||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
" filter the processed errors if desired
|
||||
if exists('g:syntastic_cpp_remove_include_errors') &&
|
||||
\ g:syntastic_cpp_remove_include_errors != 0
|
||||
return filter(errors,
|
||||
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
|
||||
else
|
||||
return errors
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'gcc'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
36
sources_non_forked/syntastic/syntax_checkers/cpp/oclint.vim
Normal file
36
sources_non_forked/syntastic/syntax_checkers/cpp/oclint.vim
Normal file
@ -0,0 +1,36 @@
|
||||
"============================================================================
|
||||
"File: oclint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: "UnCO" Lin <undercooled aT lavabit com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
"
|
||||
" The setting 'g:syntastic_oclint_config_file' allows you to define a file
|
||||
" that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_oclint_config':
|
||||
"
|
||||
" let g:syntastic_oclint_config_file = '.config'
|
||||
|
||||
if exists("g:loaded_syntastic_cpp_oclint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_oclint_checker = 1
|
||||
|
||||
function! SyntaxCheckers_cpp_oclint_IsAvailable()
|
||||
return SyntaxCheckers_c_oclint_IsAvailable()
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cpp_oclint_GetLocList()
|
||||
return SyntaxCheckers_c_oclint_GetLocList()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'oclint'})
|
||||
|
||||
runtime! syntax_checkers/c/*.vim
|
34
sources_non_forked/syntastic/syntax_checkers/cpp/ycm.vim
Normal file
34
sources_non_forked/syntastic/syntax_checkers/cpp/ycm.vim
Normal file
@ -0,0 +1,34 @@
|
||||
"============================================================================
|
||||
"File: ycm.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Val Markovic <val at markovic dot io>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_cpp_ycm_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_ycm_checker = 1
|
||||
|
||||
function! SyntaxCheckers_cpp_ycm_IsAvailable()
|
||||
return SyntaxCheckers_c_ycm_IsAvailable()
|
||||
endfunction
|
||||
|
||||
if !exists('g:loaded_youcompleteme')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cpp_ycm_GetLocList()
|
||||
return SyntaxCheckers_c_ycm_GetLocList()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'ycm'})
|
||||
|
||||
runtime! syntax_checkers/c/*.vim
|
39
sources_non_forked/syntastic/syntax_checkers/cs/mcs.vim
Normal file
39
sources_non_forked/syntastic/syntax_checkers/cs/mcs.vim
Normal file
@ -0,0 +1,39 @@
|
||||
"============================================================================
|
||||
"File: cs.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Daniel Walker <dwalker@fifo99.com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_cs_mcs_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cs_mcs_checker=1
|
||||
|
||||
function! SyntaxCheckers_cs_mcs_IsAvailable()
|
||||
return executable('mcs')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cs_mcs_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'mcs',
|
||||
\ 'args': '--parse',
|
||||
\ 'filetype': 'cs',
|
||||
\ 'subchecker': 'mcs' })
|
||||
|
||||
let errorformat = '%f(%l\,%c): %trror %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cs',
|
||||
\ 'name': 'mcs'})
|
58
sources_non_forked/syntastic/syntax_checkers/css/csslint.vim
Normal file
58
sources_non_forked/syntastic/syntax_checkers/css/csslint.vim
Normal file
@ -0,0 +1,58 @@
|
||||
"============================================================================
|
||||
"File: css.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim using `csslint` CLI tool (http://csslint.net).
|
||||
"Maintainer: Ory Band <oryband at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
"
|
||||
" Specify additional options to csslint with this option. e.g. to disable
|
||||
" warnings:
|
||||
"
|
||||
" let g:syntastic_csslint_options = '--warnings=none'
|
||||
|
||||
if exists('g:loaded_syntastic_css_csslint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_css_csslint_checker=1
|
||||
|
||||
if !exists('g:syntastic_csslint_exec')
|
||||
let g:syntastic_csslint_exec = 'csslint'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_csslint_options')
|
||||
let g:syntastic_csslint_options = ''
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_css_csslint_IsAvailable()
|
||||
return executable(expand(g:syntastic_csslint_exec))
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_css_csslint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': expand(g:syntastic_csslint_exec),
|
||||
\ 'args': '--format=compact ' . g:syntastic_csslint_options,
|
||||
\ 'filetype': 'css',
|
||||
\ 'subchecker': 'csslint' })
|
||||
|
||||
" Print CSS Lint's error/warning messages from compact format. Ignores blank lines.
|
||||
let errorformat =
|
||||
\ '%-G,' .
|
||||
\ '%-G%f: lint free!,' .
|
||||
\ '%f: line %l\, col %c\, %trror - %m,' .
|
||||
\ '%f: line %l\, col %c\, %tarning - %m,'.
|
||||
\ '%f: line %l\, col %c\, %m,'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'css',
|
||||
\ 'name': 'csslint'})
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user