diff --git a/README.md b/README.md index 792584bf..71b36a48 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # The Ultimate vimrc +## Important -- set iterm profile -> terminal -> report terminal type: xterm-256 + Over the last 8 years I have used and tweaked Vim. This is my Ultimate vimrc. There are two versions: @@ -109,13 +111,13 @@ After you have installed the setup you can create **~/.vim_runtime/my_configs.vi ~/.vim_runtime (master)> cat my_configs.vim map ct :cd ~/Desktop/Todoist/todoist - map cw :cd ~/Desktop/Wedoist/wedoist + map cw :cd ~/Desktop/Wedoist/wedoist You can also install your own plugins, for instance, via pathogen we can install [vim-rails](https://github.com/tpope/vim-rails): cd ~/.vim_runtime git clone git://github.com/tpope/vim-rails.git sources_non_forked/vim-rails - + Now you have vim-rails installed ;-) @@ -124,7 +126,7 @@ Now you have vim-rails installed ;-) ### Plugin related mappings Open [bufexplorer](https://github.com/vim-scripts/bufexplorer.zip) and see and manage the current buffers: - + map o :BufExplorer Open [MRU.vim](https://github.com/vim-scripts/mru.vim) and see the recently open files: @@ -132,7 +134,7 @@ Open [MRU.vim](https://github.com/vim-scripts/mru.vim) and see the recently open map f :MRU Open [ctrlp.vim](https://github.com/kien/ctrlp.vim) plugin: - + let g:ctrlp_map = '' Open [PeepOpen](https://peepcode.com/products/peepopen) plugin: @@ -142,7 +144,7 @@ Open [PeepOpen](https://peepcode.com/products/peepopen) plugin: Managing the [NERD Tree](https://github.com/scrooloose/nerdtree) plugin: map nn :NERDTreeToggle - map nb :NERDTreeFromBookmark + map nb :NERDTreeFromBookmark map nf :NERDTreeFind [goyo.vim](https://github.com/junegunn/goyo.vim) and [vim-zenroom2](https://github.com/amix/vim-zenroom2) lets you only focus on one thing at a time. It removes all the distractions and centers the content. It has a special look when editing Markdown, reStructuredText and textfiles. It only has one mapping. @@ -159,65 +161,65 @@ Treat long lines as break lines (useful when moving around in them): map j gj map k gk - + Map `` to `/` (search) and `+` to `?` (backwards search): - + map / map ? map :noh Disable highlight when `` is pressed: - + map :noh Smart way to move between windows: - + map j map k map h map l Closing of current buffer(s): - + " Close current buffer map bd :Bclose - + " Close all buffers map ba :1,1000 bd! - + Useful mappings for managing tabs: - + map tn :tabnew map to :tabonly map tc :tabclose - map tm :tabmove - + map tm :tabmove + " Opens a new tab with the current buffer's path " Super useful when editing files in the same directory map te :tabedit =expand("%:p:h")/ - + Switch CWD to the directory of the open buffer: - + map cd :cd %:p:h:pwd - + Open vimgrep and put the cursor in the right position: - + map g :vimgrep // **/*. Vimgreps in the current file: - + map :vimgrep // % Remove the Windows ^M - when the encodings gets messed up: - + noremap m mmHmt:%s///ge'tzt'm - + Quickly open a buffer for scripbble: - + map q :e ~/buffer Toggle paste mode on and off: - + map pp :setlocal paste! @@ -261,7 +263,7 @@ Surround the visual selection in parenthesis/brackets/etc.: vnoremap $$ `>a"` vnoremap $q `>a'` vnoremap $e `>a"` - + ### Command line mappings @@ -280,7 +282,7 @@ Bash like keys for the command line: Write the file as sudo (only on Unix). Super useful when you open a file and you don't have permissions to save your changes. [Vim tip](http://vim.wikia.com/wiki/Su-write): - :W + :W ### Spell checking @@ -295,7 +297,7 @@ Shortcuts using `` instead of special chars map sa zg map s? z= -### Cope +### Cope Do :help cope if you are unsure what cope is. It's super useful! When you search with vimgrep, display your results in cope by doing: diff --git a/deprecated_maximum_awesome_vimrc b/deprecated_maximum_awesome_vimrc new file mode 100644 index 00000000..f040e9bd --- /dev/null +++ b/deprecated_maximum_awesome_vimrc @@ -0,0 +1,114 @@ +" set up pathogen, https://github.com/tpope/vim-pathogen +filetype on " without this vim emits a zero exit status, later, because of :ft off +filetype off +call pathogen#infect() +filetype plugin indent on + +" don't bother with vi compatibility +set nocompatible + +" enable syntax highlighting +syntax enable + +set autoindent +set autoread " reload files when changed on disk, i.e. via `git checkout` +set backspace=2 " Fix broken backspace in some setups +set backupcopy=yes " see :help crontab +set clipboard=unnamed " yank and paste with the system clipboard +set directory-=. " don't store swapfiles in the current directory +set encoding=utf-8 +set expandtab " expand tabs to spaces +set ignorecase " case-insensitive search +set incsearch " search as you type +set laststatus=2 " always show statusline +set list " show trailing whitespace +set listchars=tab:▸\ ,trail:▫ +set number " show line numbers +set ruler " show where you are +set scrolloff=3 " show context above/below cursorline +set shiftwidth=2 " normal mode indentation commands use 2 spaces +set showcmd +set smartcase " case-sensitive search if any caps +set softtabstop=2 " insert mode tab and backspace use 2 spaces +set tabstop=8 " actual tabs occupy 8 characters +set wildignore=log/**,node_modules/**,target/**,tmp/**,*.rbc +set wildmenu " show a navigable menu for tab completion +set wildmode=longest,list,full + +" Enable basic mouse behavior such as resizing buffers. +set mouse=a +if exists('$TMUX') " Support resizing in tmux + set ttymouse=xterm2 +endif + +" keyboard shortcuts +let mapleader = ',' +map h +map j +map k +map l +map l :Align +nmap a :Ack +nmap b :CtrlPBuffer +nmap d :NERDTreeToggle +nmap f :NERDTreeFind +nmap t :CtrlP +nmap T :CtrlPClearCache:CtrlP +nmap ] :TagbarToggle +nmap :call whitespace#strip_trailing() +nmap g :GitGutterToggle +nmap c Kwbd +map V :source ~/.vimrc:filetype detect:exe ":echo 'vimrc reloaded'" + +" plugin settings +let g:ctrlp_match_window = 'order:ttb,max:20' +let g:NERDSpaceDelims=1 +let g:gitgutter_enabled = 0 + +" Use The Silver Searcher https://github.com/ggreer/the_silver_searcher +if executable('ag') + let g:ackprg = 'ag --nogroup --column' + + " Use Ag over Grep + set grepprg=ag\ --nogroup\ --nocolor + + " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore + let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' +endif + +" fdoc is yaml +autocmd BufRead,BufNewFile *.fdoc set filetype=yaml +" md is markdown +autocmd BufRead,BufNewFile *.md set filetype=markdown +" extra rails.vim help +autocmd User Rails silent! Rnavcommand decorator app/decorators -glob=**/* -suffix=_decorator.rb +autocmd User Rails silent! Rnavcommand observer app/observers -glob=**/* -suffix=_observer.rb +autocmd User Rails silent! Rnavcommand feature features -glob=**/* -suffix=.feature +autocmd User Rails silent! Rnavcommand job app/jobs -glob=**/* -suffix=_job.rb +autocmd User Rails silent! Rnavcommand mediator app/mediators -glob=**/* -suffix=_mediator.rb +autocmd User Rails silent! Rnavcommand stepdefinition features/step_definitions -glob=**/* -suffix=_steps.rb +" automatically rebalance windows on vim resize +autocmd VimResized * :wincmd = + +" Fix Cursor in TMUX +if exists('$TMUX') + let &t_SI = "\Ptmux;\\]50;CursorShape=1\x7\\\" + let &t_EI = "\Ptmux;\\]50;CursorShape=0\x7\\\" +else + let &t_SI = "\]50;CursorShape=1\x7" + let &t_EI = "\]50;CursorShape=0\x7" +endif + +" Go crazy! +if filereadable(expand("~/.vimrc.local")) + " In your .vimrc.local, you might like: + " + " set autowrite + " set nocursorline + " set nowritebackup + " set whichwrap+=<,>,h,l,[,] " Wrap arrow keys between lines + " + " autocmd! bufwritepost .vimrc source ~/.vimrc + " noremap! jj + source ~/.vimrc.local +endif diff --git a/my_configs.vim b/my_configs.vim new file mode 100644 index 00000000..f0abc51f --- /dev/null +++ b/my_configs.vim @@ -0,0 +1,134 @@ +"Switch color schemes" +function! ColorSet(colorName) + if a:colorName == "default" + colorscheme molokai + set background=dark + let g:molokai_original=1 + let g:airline_theme = 'molokai' + elseif a:colorName == "outside" + colorscheme solarized + set background=light + let g:airline_theme = 'molokai' + elseif a:colorName == "bluey" + colorscheme solarized + set background=dark + let g:airline_theme = 'molokai' + elseif a:colorName == "smyck" + colorscheme smyck + set background=dark + let g:airline_theme = 'molokai' + elseif a:colorName == "dracula" + colorscheme dracula + set background=dark + let g:airline_theme = 'molokai' + else + colorscheme molokai + set background=dark + let g:molokai_original=1 + let g:airline_theme = 'molokai' + endif +endfunction + +:command -nargs=1 ColorSet :call ColorSet() + +if !empty($VIM_COLOR) + :call ColorSet($VIM_COLOR) +else + :call ColorSet("default") +endif + + +"set mouse=a +"set background=dark +"let g:molokai_original = 1 +"colorscheme solarized +"syntax enable +"set background=dark +"set smartindent +"autocmd BufWritePre * :FixWhitespace +set timeoutlen=2000 +set pastetoggle= +"inoremap jk +"nnoremap ; : +#set colorcolumn=80 +" Open Vim, be able to undo +"set undodir=$HOME/.vim/undo +"set undolevels=1000 +"set undoreload=10000 + +" System wide copy paste +"set clipboard=unnamedplus + +" Make Y behave like other capitals +"map Y y$ +" +" " Start scrolling 3 lines before the border +set scrolloff=3 +" +" " Automatically reread files that have been changed externally +"set autoread +" +" " Make ^e and ^y scroll 3 lines instead of 1 +"nnoremap 3 +"nnoremap 3 +" +" " don't move the cursor after pasting +" " (by jumping to back start of previously changed text) +"noremap p p`[ +"noremap P P`[ +" +" " Reselect visual block after indent/outdent +"vnoremap < >gv + +" Turn off the christmas lights +"nnoremap :nohlsearch +" Allow saving as root by w!! +"cmap w!! %!sudo tee > /dev/null % + +" Finde merge conflict markers +"nmap cf /\v^[<=>]{7}( .*\|$) + +" Use Marked.app to preview Markdown files... +"function! s:setupMarkup() +" nnoremap p :silent !open -a Marked.app '%:p' +"endfunction + +" Navigate splits more easily +"map h +"map j +"map k +"map l + +" " These makes j/k move up/down a screen line instead of a physical file line (for wrapped lines) +"nmap k gk +"nmap j gj + +" autocmd BufEnter * if &modifiable | NERDTreeFind | wincmd p | endif + +" Easymotion {{{ +"let g:EasyMotion_do_mapping = 0 + +"nnoremap f :call EasyMotion#F(0, 0) +"onoremap f :call EasyMotion#F(0, 0) +"vnoremap f :call EasyMotion#F(1, 0) + +"nnoremap F :call EasyMotion#F(0, 1) +"onoremap F :call EasyMotion#F(0, 1) +"vnoremap F :call EasyMotion#F(1, 1) + +"onoremap t :call EasyMotion#T(0, 0) +"onoremap T :call EasyMotion#T(0, 1) +" }}} + + +"source ~/.vim_runtime/maximum_awesome_vimrc + + +"set tabstop=2 +"set shiftwidth=2 +"set expandtab +"set smartindentl:s +" +" + diff --git a/sources_forked/dracula/colors/dracula.vim b/sources_forked/dracula/colors/dracula.vim new file mode 100644 index 00000000..d4fe4a0e --- /dev/null +++ b/sources_forked/dracula/colors/dracula.vim @@ -0,0 +1,116 @@ +" Dracula Theme v0.7.0 +" +" https://github.com/zenorocha/dracula-theme +" +" Copyright 2013, All rights reserved +" +" Code licensed under the MIT license +" http://zenorocha.mit-license.org +" +" @author Éverton Ribeiro +" @author Zeno Rocha + +set background=dark +highlight clear + +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "Dracula" + +hi Cursor ctermfg=17 ctermbg=231 cterm=NONE guifg=#282a36 guibg=#f8f8f0 gui=NONE +hi Visual ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=#44475a gui=NONE +hi CursorLine ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=#3d3f49 gui=NONE +hi CursorColumn ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=#3d3f49 gui=NONE +hi ColorColumn ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=#3d3f49 gui=NONE +hi LineNr ctermfg=246 ctermbg=236 cterm=NONE guifg=#909194 guibg=#3d3f49 gui=NONE +hi VertSplit ctermfg=59 ctermbg=236 cterm=NONE guifg=#64666d guibg=#64666d gui=NONE +hi MatchParen ctermfg=212 ctermbg=NONE cterm=underline guifg=#ff79c6 guibg=NONE gui=underline +hi StatusLine ctermfg=231 ctermbg=236 cterm=bold guifg=#f8f8f2 guibg=#64666d gui=bold +hi StatusLineNC ctermfg=231 ctermbg=236 cterm=NONE guifg=#f8f8f2 guibg=#64666d gui=NONE +hi Pmenu ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi PmenuSel ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=#44475a gui=NONE +hi IncSearch ctermfg=17 ctermbg=228 cterm=NONE guifg=#282a36 guibg=#f1fa8c gui=NONE +hi Search ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline +hi Directory ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE +hi Folded ctermfg=61 ctermbg=235 cterm=NONE guifg=#6272a4 guibg=#282a36 gui=NONE + +hi Normal ctermfg=231 ctermbg=235 cterm=NONE guifg=#f8f8f2 guibg=#282a36 gui=NONE +hi Boolean ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE +hi Character ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE +hi Comment ctermfg=61 ctermbg=NONE cterm=NONE guifg=#6272a4 guibg=NONE gui=NONE +hi Conditional ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE +hi Constant ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi Define ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE +hi DiffAdd ctermfg=231 ctermbg=64 cterm=bold guifg=#f8f8f2 guibg=#468410 gui=bold +hi DiffDelete ctermfg=88 ctermbg=NONE cterm=NONE guifg=#8b080b guibg=NONE gui=NONE +hi DiffChange ctermfg=231 ctermbg=23 cterm=NONE guifg=#f8f8f2 guibg=#243a5f gui=NONE +hi DiffText ctermfg=231 ctermbg=24 cterm=bold guifg=#f8f8f2 guibg=#204a87 gui=bold +hi ErrorMsg ctermfg=231 ctermbg=212 cterm=NONE guifg=#f8f8f0 guibg=#ff79c6 gui=NONE +hi WarningMsg ctermfg=231 ctermbg=212 cterm=NONE guifg=#f8f8f0 guibg=#ff79c6 gui=NONE +hi Float ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE +hi Function ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE +hi Identifier ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=italic +hi Keyword ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE +hi Label ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE +hi NonText ctermfg=59 ctermbg=236 cterm=NONE guifg=#3b3a32 guibg=#32343f gui=NONE +hi Number ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE +hi Operator ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE +hi PreProc ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE +hi Special ctermfg=231 ctermbg=NONE cterm=NONE guifg=#f8f8f2 guibg=NONE gui=NONE +hi SpecialKey ctermfg=59 ctermbg=236 cterm=NONE guifg=#3b3a32 guibg=#3d3f49 gui=NONE +hi Statement ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE +hi StorageClass ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=italic +hi String ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE +hi Tag ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE +hi Title ctermfg=231 ctermbg=NONE cterm=bold guifg=#f8f8f2 guibg=NONE gui=bold +hi Todo ctermfg=61 ctermbg=NONE cterm=inverse,bold guifg=#6272a4 guibg=NONE gui=inverse,bold +hi Type ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline +hi rubyClass ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE +hi rubyFunction ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE +hi rubyInterpolationDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi rubySymbol ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE +hi rubyConstant ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic +hi rubyStringDelimiter ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE +hi rubyBlockParameter ctermfg=215 ctermbg=NONE cterm=NONE guifg=#ffb86c guibg=NONE gui=italic +hi rubyInstanceVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi rubyInclude ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE +hi rubyGlobalVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi rubyRegexp ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE +hi rubyRegexpDelimiter ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE +hi rubyEscape ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE +hi rubyControl ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE +hi rubyClassVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi rubyOperator ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE +hi rubyException ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE +hi rubyPseudoVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi rubyRailsUserClass ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic +hi rubyRailsARAssociationMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE +hi rubyRailsARMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE +hi rubyRailsRenderMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE +hi rubyRailsMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE +hi erubyDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi erubyComment ctermfg=61 ctermbg=NONE cterm=NONE guifg=#6272a4 guibg=NONE gui=NONE +hi erubyRailsMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE +hi htmlTag ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi htmlEndTag ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi htmlTagName ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi htmlArg ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi htmlSpecialChar ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE +hi javaScriptFunction ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=italic +hi javaScriptRailsFunction ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE +hi javaScriptBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi yamlKey ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE +hi yamlAnchor ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi yamlAlias ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi yamlDocumentHeader ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE +hi cssURL ctermfg=215 ctermbg=NONE cterm=NONE guifg=#ffb86c guibg=NONE gui=italic +hi cssFunctionName ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE +hi cssColor ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE +hi cssPseudoClassId ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE +hi cssClassName ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE +hi cssValueLength ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE +hi cssCommonAttr ctermfg=81 ctermbg=NONE cterm=NONE guifg=#6be5fd guibg=NONE gui=NONE +hi cssBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE diff --git a/sources_forked/molokai/README.md b/sources_forked/molokai/README.md new file mode 100644 index 00000000..320508df --- /dev/null +++ b/sources_forked/molokai/README.md @@ -0,0 +1,24 @@ +# Molokai Color Scheme for Vim + +Molokai is a Vim port of the monokai theme for TextMate originally created by Wimer Hazenberg. + +By default, it has a dark gray background based on the version created by Hamish Stuart Macpherson for the E editor. + +![Gray Background](http://www.winterdom.com/weblog/content/binary/WindowsLiveWriter/MolokaiforVim_8602/molokai_normal_small_3.png) + +![Molokai Original](http://www.winterdom.com/weblog/content/binary/WindowsLiveWriter/MolokaiforVim_8602/molokai_original_small_3.png) + +256-Color terminals are also supported, though there are some differences with the Gui version. Only the dark gray background style is supported on terminal vim at this time. + +## Installation + +Copy the file on your .vim/colors folder. + +If you prefer the scheme to match the original monokai background color, put this in your .vimrc file: + let g:molokai_original = 1 + +There is also an alternative sheme under development for color terminals which attempts to bring the 256 color version as close as possible to the the default (dark) GUI version. To access, add this to your .vimrc: + let g:rehash256 = 1 + +Note: when using the console version, add this command after enabling the colorscheme in your .vimrc: + set background=dark diff --git a/sources_forked/molokai/colors/molokai.vim b/sources_forked/molokai/colors/molokai.vim new file mode 100644 index 00000000..2e4ba739 --- /dev/null +++ b/sources_forked/molokai/colors/molokai.vim @@ -0,0 +1,270 @@ + +" Vim color file +" +" Author: Tomas Restrepo +" +" Note: Based on the monokai theme for textmate +" by Wimer Hazenberg and its darker variant +" by Hamish Stuart Macpherson +" + +hi clear + +set background=dark +if version > 580 + " no guarantees for version 5.8 and below, but this makes it stop + " complaining + hi clear + if exists("syntax_on") + syntax reset + endif +endif +let g:colors_name="molokai" + +if exists("g:molokai_original") + let s:molokai_original = g:molokai_original +else + let s:molokai_original = 0 +endif + + +hi Boolean guifg=#AE81FF +hi Character guifg=#E6DB74 +hi Number guifg=#AE81FF +hi String guifg=#E6DB74 +hi Conditional guifg=#F92672 gui=bold +hi Constant guifg=#AE81FF gui=bold +hi Cursor guifg=#000000 guibg=#F8F8F0 +hi iCursor guifg=#000000 guibg=#F8F8F0 +hi Debug guifg=#BCA3A3 gui=bold +hi Define guifg=#66D9EF +hi Delimiter guifg=#8F8F8F +hi DiffAdd guibg=#13354A +hi DiffChange guifg=#89807D guibg=#4C4745 +hi DiffDelete guifg=#960050 guibg=#1E0010 +hi DiffText guibg=#4C4745 gui=italic,bold + +hi Directory guifg=#A6E22E gui=bold +hi Error guifg=#960050 guibg=#1E0010 +hi ErrorMsg guifg=#F92672 guibg=#232526 gui=bold +hi Exception guifg=#A6E22E gui=bold +hi Float guifg=#AE81FF +hi FoldColumn guifg=#465457 guibg=#000000 +hi Folded guifg=#465457 guibg=#000000 +hi Function guifg=#A6E22E +hi Identifier guifg=#FD971F +hi Ignore guifg=#808080 guibg=bg +hi IncSearch guifg=#C4BE89 guibg=#000000 + +hi Keyword guifg=#F92672 gui=bold +hi Label guifg=#E6DB74 gui=none +hi Macro guifg=#C4BE89 gui=italic +hi SpecialKey guifg=#66D9EF gui=italic + +hi MatchParen guifg=#000000 guibg=#FD971F gui=bold +hi ModeMsg guifg=#E6DB74 +hi MoreMsg guifg=#E6DB74 +hi Operator guifg=#F92672 + +" complete menu +hi Pmenu guifg=#66D9EF guibg=#000000 +hi PmenuSel guibg=#808080 +hi PmenuSbar guibg=#080808 +hi PmenuThumb guifg=#66D9EF + +hi PreCondit guifg=#A6E22E gui=bold +hi PreProc guifg=#A6E22E +hi Question guifg=#66D9EF +hi Repeat guifg=#F92672 gui=bold +hi Search guifg=#FFFFFF guibg=#455354 +" marks +hi SignColumn guifg=#A6E22E guibg=#232526 +hi SpecialChar guifg=#F92672 gui=bold +hi SpecialComment guifg=#7E8E91 gui=bold +hi Special guifg=#66D9EF guibg=bg gui=italic +if has("spell") + hi SpellBad guisp=#FF0000 gui=undercurl + hi SpellCap guisp=#7070F0 gui=undercurl + hi SpellLocal guisp=#70F0F0 gui=undercurl + hi SpellRare guisp=#FFFFFF gui=undercurl +endif +hi Statement guifg=#F92672 gui=bold +hi StatusLine guifg=#455354 guibg=fg +hi StatusLineNC guifg=#808080 guibg=#080808 +hi StorageClass guifg=#FD971F gui=italic +hi Structure guifg=#66D9EF +hi Tag guifg=#F92672 gui=italic +hi Title guifg=#ef5939 +hi Todo guifg=#FFFFFF guibg=bg gui=bold + +hi Typedef guifg=#66D9EF +hi Type guifg=#66D9EF gui=none +hi Underlined guifg=#808080 gui=underline + +hi VertSplit guifg=#808080 guibg=#080808 gui=bold +hi VisualNOS guibg=#403D3D +hi Visual guibg=#403D3D +hi WarningMsg guifg=#FFFFFF guibg=#333333 gui=bold +hi WildMenu guifg=#66D9EF guibg=#000000 + +if s:molokai_original == 1 + hi Normal guifg=#F8F8F2 guibg=#272822 + hi Comment guifg=#75715E + hi CursorLine guibg=#3E3D32 + hi CursorLineNr guifg=#FD971F gui=none + hi CursorColumn guibg=#3E3D32 + hi ColorColumn guibg=#3B3A32 + hi LineNr guifg=#BCBCBC guibg=#3B3A32 + hi NonText guifg=#75715E + hi SpecialKey guifg=#75715E +else + hi Normal guifg=#F8F8F2 guibg=#1B1D1E + hi Comment guifg=#7E8E91 + hi CursorLine guibg=#293739 + hi CursorLineNr guifg=#FD971F gui=none + hi CursorColumn guibg=#293739 + hi ColorColumn guibg=#232526 + hi LineNr guifg=#465457 guibg=#232526 + hi NonText guifg=#465457 + hi SpecialKey guifg=#465457 +end + +" +" Support for 256-color terminal +" +if &t_Co > 255 + if s:molokai_original == 1 + hi Normal ctermbg=234 + hi CursorLine ctermbg=235 cterm=none + hi CursorLineNr ctermfg=208 cterm=none + else + hi Normal ctermfg=252 ctermbg=233 + hi CursorLine ctermbg=234 cterm=none + hi CursorLineNr ctermfg=208 cterm=none + endif + hi Boolean ctermfg=135 + hi Character ctermfg=144 + hi Number ctermfg=135 + hi String ctermfg=144 + hi Conditional ctermfg=161 cterm=bold + hi Constant ctermfg=135 cterm=bold + hi Cursor ctermfg=16 ctermbg=253 + hi Debug ctermfg=225 cterm=bold + hi Define ctermfg=81 + hi Delimiter ctermfg=241 + + hi DiffAdd ctermbg=24 + hi DiffChange ctermfg=181 ctermbg=239 + hi DiffDelete ctermfg=162 ctermbg=53 + hi DiffText ctermbg=102 cterm=bold + + hi Directory ctermfg=118 cterm=bold + hi Error ctermfg=219 ctermbg=89 + hi ErrorMsg ctermfg=199 ctermbg=16 cterm=bold + hi Exception ctermfg=118 cterm=bold + hi Float ctermfg=135 + hi FoldColumn ctermfg=67 ctermbg=16 + hi Folded ctermfg=67 ctermbg=16 + hi Function ctermfg=118 + hi Identifier ctermfg=208 cterm=none + hi Ignore ctermfg=244 ctermbg=232 + hi IncSearch ctermfg=193 ctermbg=16 + + hi keyword ctermfg=161 cterm=bold + hi Label ctermfg=229 cterm=none + hi Macro ctermfg=193 + hi SpecialKey ctermfg=81 + + hi MatchParen ctermfg=16 ctermbg=208 cterm=bold + hi ModeMsg ctermfg=229 + hi MoreMsg ctermfg=229 + hi Operator ctermfg=161 + + " complete menu + hi Pmenu ctermfg=81 ctermbg=16 + hi PmenuSel ctermfg=253 ctermbg=244 + hi PmenuSbar ctermbg=232 + hi PmenuThumb ctermfg=81 + + hi PreCondit ctermfg=118 cterm=bold + hi PreProc ctermfg=118 + hi Question ctermfg=81 + hi Repeat ctermfg=161 cterm=bold + hi Search ctermfg=253 ctermbg=66 + + " marks column + hi SignColumn ctermfg=118 ctermbg=235 + hi SpecialChar ctermfg=161 cterm=bold + hi SpecialComment ctermfg=245 cterm=bold + hi Special ctermfg=81 + if has("spell") + hi SpellBad ctermbg=52 + hi SpellCap ctermbg=17 + hi SpellLocal ctermbg=17 + hi SpellRare ctermfg=none ctermbg=none cterm=reverse + endif + hi Statement ctermfg=161 cterm=bold + hi StatusLine ctermfg=238 ctermbg=253 + hi StatusLineNC ctermfg=244 ctermbg=232 + hi StorageClass ctermfg=208 + hi Structure ctermfg=81 + hi Tag ctermfg=161 + hi Title ctermfg=166 + hi Todo ctermfg=231 ctermbg=232 cterm=bold + + hi Typedef ctermfg=81 + hi Type ctermfg=81 cterm=none + hi Underlined ctermfg=244 cterm=underline + + hi VertSplit ctermfg=244 ctermbg=232 cterm=bold + hi VisualNOS ctermbg=238 + hi Visual ctermbg=235 + hi WarningMsg ctermfg=231 ctermbg=238 cterm=bold + hi WildMenu ctermfg=81 ctermbg=16 + + hi Comment ctermfg=59 + hi CursorColumn ctermbg=234 + hi ColorColumn ctermbg=234 + hi LineNr ctermfg=250 ctermbg=234 + hi NonText ctermfg=59 + + hi SpecialKey ctermfg=59 + + if exists("g:rehash256") && g:rehash256 == 1 + hi Normal ctermfg=252 ctermbg=234 + hi CursorLine ctermbg=236 cterm=none + hi CursorLineNr ctermfg=208 cterm=none + + hi Boolean ctermfg=141 + hi Character ctermfg=222 + hi Number ctermfg=141 + hi String ctermfg=222 + hi Conditional ctermfg=197 cterm=bold + hi Constant ctermfg=141 cterm=bold + + hi DiffDelete ctermfg=125 ctermbg=233 + + hi Directory ctermfg=154 cterm=bold + hi Error ctermfg=125 ctermbg=233 + hi Exception ctermfg=154 cterm=bold + hi Float ctermfg=141 + hi Function ctermfg=154 + hi Identifier ctermfg=208 + + hi Keyword ctermfg=197 cterm=bold + hi Operator ctermfg=197 + hi PreCondit ctermfg=154 cterm=bold + hi PreProc ctermfg=154 + hi Repeat ctermfg=197 cterm=bold + + hi Statement ctermfg=197 cterm=bold + hi Tag ctermfg=197 + hi Title ctermfg=203 + hi Visual ctermbg=238 + + hi Comment ctermfg=244 + hi LineNr ctermfg=239 ctermbg=235 + hi NonText ctermfg=239 + hi SpecialKey ctermfg=239 + endif +end diff --git a/sources_forked/smyck/colors/smyck.vim b/sources_forked/smyck/colors/smyck.vim new file mode 100644 index 00000000..b6fe8427 --- /dev/null +++ b/sources_forked/smyck/colors/smyck.vim @@ -0,0 +1,95 @@ +" ---------------------------------------------------------------------------- +" Vim color file +" Maintainer: John-Paul Bader +" Last Change: 2012 April +" License: Beer Ware +" ---------------------------------------------------------------------------- + +" Reset Highlighting +hi clear +if exists("syntax_on") + syntax reset +endif + +set background=dark +set linespace=3 + +let g:colors_name = "smyck" + +hi Normal cterm=none ctermbg=none ctermfg=15 gui=none guibg=#282828 guifg=#F7F7F7 +hi LineNr cterm=none ctermbg=none ctermfg=8 gui=none guibg=#282828 guifg=#8F8F8F +hi StatusLine cterm=none ctermbg=8 ctermfg=15 gui=none guibg=#5D5D5D guifg=#FBFBFB +hi StatusLineNC cterm=none ctermbg=15 ctermfg=8 gui=none guibg=#5D5D5D guifg=#FBFBFB +hi Search cterm=none ctermbg=6 ctermfg=15 gui=none guibg=#2EB5C1 guifg=#F7F7F7 +hi IncSearch cterm=none ctermbg=3 ctermfg=8 gui=none guibg=#F6DC69 guifg=#8F8F8F +hi ColumnMargin cterm=none ctermbg=0 gui=none guibg=#000000 +hi Error cterm=none ctermbg=1 ctermfg=15 gui=none guifg=#F7F7F7 +hi ErrorMsg cterm=none ctermbg=1 ctermfg=15 gui=none guifg=#F7F7F7 +hi Folded cterm=none ctermbg=none ctermfg=2 gui=none guibg=#3B3B3B guifg=#90AB41 +hi FoldColumn cterm=none ctermbg=8 ctermfg=2 gui=none guibg=#3B3B3B guifg=#90AB41 +hi NonText cterm=bold ctermbg=none ctermfg=8 gui=bold guifg=#8F8F8F +hi ModeMsg cterm=bold ctermbg=none ctermfg=10 gui=none +hi Pmenu cterm=none ctermbg=8 ctermfg=15 gui=none guibg=#8F8F8F guifg=#F7F7F7 +hi PmenuSel cterm=none ctermbg=15 ctermfg=8 gui=none guibg=#F7F7F7 guifg=#8F8F8F +hi PmenuSbar cterm=none ctermbg=15 ctermfg=8 gui=none guibg=#F7F7F7 guifg=#8F8F8F +hi SpellBad cterm=none ctermbg=1 ctermfg=15 gui=none guifg=#F7F7F7 +hi SpellCap cterm=none ctermbg=4 ctermfg=15 gui=none guifg=#F7F7F7 +hi SpellRare cterm=none ctermbg=4 ctermfg=15 gui=none guifg=#F7F7F7 +hi SpellLocal cterm=none ctermbg=4 ctermfg=15 gui=none guifg=#F7F7F7 +hi Visual cterm=none ctermbg=15 ctermfg=8 gui=none guibg=#F7F7F7 guifg=#8F8F8F +hi Directory cterm=none ctermbg=none ctermfg=4 gui=none guibg=#242424 guifg=#88CCE7 +hi SpecialKey cterm=none ctermbg=none ctermfg=8 gui=none guifg=#8F8F8F +hi DiffAdd cterm=bold ctermbg=2 ctermfg=15 +hi DiffChange cterm=bold ctermbg=4 ctermfg=15 +hi DiffDelete cterm=bold ctermbg=1 ctermfg=15 +hi DiffText cterm=bold ctermbg=3 ctermfg=8 +hi MatchParen cterm=none ctermbg=6 ctermfg=15 gui=none guibg=#2EB5C1 guifg=#F7F7F7 +hi CursorLine cterm=none ctermbg=238 ctermfg=none gui=none guibg=#424242 +hi CursorColumn cterm=none ctermbg=238 ctermfg=none gui=none guibg=#424242 +hi Title cterm=none ctermbg=none ctermfg=4 gui=none guifg=#88CCE7 + +" ---------------------------------------------------------------------------- +" Syntax Highlighting +" ---------------------------------------------------------------------------- +hi Keyword cterm=none ctermbg=none ctermfg=10 gui=none guifg=#D1FA71 +hi Comment cterm=none ctermbg=none ctermfg=8 gui=none guifg=#8F8F8F +hi Delimiter cterm=none ctermbg=none ctermfg=15 gui=none guifg=#F7F7F7 +hi Identifier cterm=none ctermbg=none ctermfg=12 gui=none guifg=#96D9F1 +hi Structure cterm=none ctermbg=none ctermfg=12 gui=none guifg=#9DEEF2 +hi Ignore cterm=none ctermbg=none ctermfg=8 gui=none guifg=bg +hi Constant cterm=none ctermbg=none ctermfg=12 gui=none guifg=#96D9F1 +hi PreProc cterm=none ctermbg=none ctermfg=10 gui=none guifg=#D1FA71 +hi Type cterm=none ctermbg=none ctermfg=12 gui=none guifg=#96D9F1 +hi Statement cterm=none ctermbg=none ctermfg=10 gui=none guifg=#D1FA71 +hi Special cterm=none ctermbg=none ctermfg=6 gui=none guifg=#d7d7d7 +hi String cterm=none ctermbg=none ctermfg=3 gui=none guifg=#F6DC69 +hi Number cterm=none ctermbg=none ctermfg=3 gui=none guifg=#F6DC69 +hi Underlined cterm=none ctermbg=none ctermfg=magenta gui=underline guibg=#272727 +hi Symbol cterm=none ctermbg=none ctermfg=9 gui=none guifg=#FAB1AB +hi Method cterm=none ctermbg=none ctermfg=15 gui=none guifg=#F7F7F7 +hi Interpolation cterm=none ctermbg=none ctermfg=6 gui=none guifg=#2EB5C1 + +" Erlang +hi link erlangAtom Keyword +hi link erlangBitType Keyword + +hi link rubyBeginend Keyword +hi link rubyClass Keyword +hi link rubyModule Keyword +hi link rubyKeyword Keyword +hi link rubyOperator Method +hi link rubyIdentifier Keyword +hi link rubyClassVariable Symbol +hi link rubyInstanceVariable Constant +hi link rubyGlobalVariable Constant +hi link rubyClassVariable Method +hi link rubyConstant Constant +hi link rubySymbol Symbol +hi link rubyFunction Constant +hi link rubyControl Keyword +hi link rubyConditional Keyword +hi link rubyInterpolation Interpolation +hi link rubyInterpolationDelimiter Interpolation +hi link rubyRailsMethod Method + + diff --git a/sources_non_forked/bufexplorer/README.md b/sources_non_forked/bufexplorer/README.md deleted file mode 100644 index f34dab5e..00000000 --- a/sources_non_forked/bufexplorer/README.md +++ /dev/null @@ -1,39 +0,0 @@ -created by ---------- -[jeff lanzarotta](http://www.vim.org/account/profile.php?user_id=97) - -script type ----------- -utility - -description ------------ -With bufexplorer, you can quickly and easily switch between buffers by using the one of the default public interfaces: - - '\be' (normal open) or - '\bs' (force horizontal split open) or - '\bv' (force vertical split open) - -Once the bufexplorer window is open you can use the normal movement keys (hjkl) to move around and then use or to select the buffer you would like to open. If you would like to have the selected buffer opened in a new tab, simply press either or 't'. Please note that when opening a buffer in a tab, that if the buffer is already in another tab, bufexplorer can switch to that tab automatically for you if you would like. More about that in the supplied VIM help. - -Bufexplorer also offers various options including: - -* Display the list of buffers in various sort orders including: - * Most Recently Used (MRU) which is the default - * Buffer number - * File name - * File extension - * Full file path name -* Delete buffer from list - -For more about options, sort orders, configuration options, etc. please see the supplied VIM help. - -install details ---------------- -Simply unzip bufexplorer.zip into a directory in your 'runtimepath', usually ~/.vim or c:\vimfiles, and restart Vim. This zip file contains plugin\bufexplorer.vim, and doc\bufexplorer.txt. See ':help add-local-help' on how to add bufexplorer.txt to vim's help system. - -NOTE ----- -Version 7.0.12 and above will ONLY work with 7.0 and above of Vim. - -**IMPORTANT**: If you have a version prior to 7.1.2 that contains an autoload\bufexplorer.vim file, please REMOVE the autoload\bufexlorer.vim AND the plugin\bufexplorer.vim files before installing a new version. diff --git a/sources_non_forked/bufexplorer/doc/bufexplorer.txt b/sources_non_forked/bufexplorer/doc/bufexplorer.txt deleted file mode 100644 index 06e92237..00000000 --- a/sources_non_forked/bufexplorer/doc/bufexplorer.txt +++ /dev/null @@ -1,513 +0,0 @@ -*bufexplorer.txt* Buffer Explorer Last Change: 22 Oct 2010 - -Buffer Explorer *buffer-explorer* *bufexplorer* - Version 7.2.8 - -Plugin for easily exploring (or browsing) Vim |:buffers|. - -|bufexplorer-installation| Installation -|bufexplorer-usage| Usage -|bufexplorer-windowlayout| Window Layout -|bufexplorer-customization| Customization -|bufexplorer-changelog| Change Log -|bufexplorer-todo| Todo -|bufexplorer-credits| Credits - -For Vim version 7.0 and above. -This plugin is only available if 'compatible' is not set. - -{Vi does not have any of this} - -============================================================================== -INSTALLATION *bufexplorer-installation* - -To install: - - Download the bufexplorer.zip. - - Extract the zip archive into your runtime directory. - The archive contains plugin/bufexplorer.vim, and doc/bufexplorer.txt. - - Start Vim or goto an existing instance of Vim. - - Execute the following command: -> - :helptag /doc -< - This will generate all the help tags for any file located in the doc - directory. - -============================================================================== -USAGE *bufexplorer-usage* - -To start exploring in the current window, use: > - \be or :BufExplorer -To start exploring in a newly split horizontal window, use: > - \bs or :BufExplorerHorizontalSplit -To start exploring in a newly split vertical window, use: > - \bv or :BufExplorerVerticalSplit - -If you would like to use something other than '\', you may simply change the -leader (see |mapleader|). - -Note: If the current buffer is modified when bufexplorer started, the current - window is always split and the new bufexplorer is displayed in that new - window. - -Commands to use once exploring: - - Toggle help information. - Opens the buffer that is under the cursor into the current - window. - Opens the buffer that is under the cursor into the current - window. - Opens the buffer that is under the cursor in another tab. - d |:delete|the buffer under the cursor from the list. The - buffer's 'buflisted' is cleared. This allows for the buffer to - be displayed again using the 'show unlisted' command. - R Toggles relative path/absolute path. - T Toggles to show only buffers for this tab or not. - D |:wipeout|the buffer under the cursor from the list. When a - buffers is wiped, it will not be shown when unlisted buffer are - displayed. - f Toggles whether you are taken to the active window when - selecting a buffer or not. - o Opens the buffer that is under the cursor into the current - window. - p Toggles the showing of a split filename/pathname. - q Quit exploring. - r Reverses the order the buffers are listed in. - s Selects the order the buffers are listed in. Either by buffer - number, file name, file extension, most recently used (MRU), or - full path. - t Opens the buffer that is under the cursor in another tab. - u Toggles the showing of "unlisted" buffers. - -Once invoked, Buffer Explorer displays a sorted list (MRU is the default -sort method) of all the buffers that are currently opened. You are then -able to move the cursor to the line containing the buffer's name you are -wanting to act upon. Once you have selected the buffer you would like, -you can then either open it, close it(delete), resort the list, reverse -the sort, quit exploring and so on... - -=============================================================================== -WINDOW LAYOUT *bufexplorer-windowlayout* - -------------------------------------------------------------------------------- -" Press for Help -" Sorted by mru | Locate buffer | Absolute Split path -"= - 01 %a bufexplorer.txt C:\Vim\vimfiles\doc line 87 - 02 # bufexplorer.vim c:\Vim\vimfiles\plugin line 1 -------------------------------------------------------------------------------- - | | | | | - | | | | +-- Current Line #. - | | | +-- Relative/Full Path - | | +-- Buffer Name. - | +-- Buffer Attributes. See|:buffers|for more information. - +-- Buffer Number. See|:buffers|for more information. - -=============================================================================== -CUSTOMIZATION *bufexplorer-customization* - - *g:bufExplorerChgWin* -If set, bufexplorer will bring up the selected buffer in the window specified -by g:bufExplorerChgWin. - - *g:bufExplorerDefaultHelp* -To control whether the default help is displayed or not, use: > - let g:bufExplorerDefaultHelp=0 " Do not show default help. - let g:bufExplorerDefaultHelp=1 " Show default help. -The default is to show the default help. - - *g:bufExplorerDetailedHelp* -To control whether detailed help is display by, use: > - let g:bufExplorerDetailedHelp=0 " Do not show detailed help. - let g:bufExplorerDetailedHelp=1 " Show detailed help. -The default is NOT to show detailed help. - - *g:bufExplorerFindActive* -To control whether you are taken to the active window when selecting a buffer, -use: > - let g:bufExplorerFindActive=0 " Do not go to active window. - let g:bufExplorerFindActive=1 " Go to active window. -The default is to be taken to the active window. - - *g:bufExplorerFuncRef* -When a buffer is selected, the functions specified either singly or as a list -will be called. - - *g:bufExplorerReverseSort* -To control whether to sort the buffer in reverse order or not, use: > - let g:bufExplorerReverseSort=0 " Do not sort in reverse order. - let g:bufExplorerReverseSort=1 " Sort in reverse order. -The default is NOT to sort in reverse order. - - *g:bufExplorerShowDirectories* -Directories usually show up in the list from using a command like ":e .". -To control whether to show directories in the buffer list or not, use: > - let g:bufExplorerShowDirectories=1 " Show directories. - let g:bufExplorerShowDirectories=0 " Don't show directories. -The default is to show directories. - - *g:bufExplorerShowRelativePath* -To control whether to show absolute paths or relative to the current -directory, use: > - let g:bufExplorerShowRelativePath=0 " Show absolute paths. - let g:bufExplorerShowRelativePath=1 " Show relative paths. -The default is to show absolute paths. - - *g:bufExplorerShowTabBuffer* -To control weither or not to show buffers on for the specific tab or not, use: > - let g:bufExplorerShowTabBuffer=0 " No. - let g:bufExplorerShowTabBuffer=1 " Yes. -The default is not to show. - - *g:bufExplorerShowUnlisted* -To control whether to show unlisted buffer or not, use: > - let g:bufExplorerShowUnlisted=0 " Do not show unlisted buffers. - let g:bufExplorerShowUnlisted=1 " Show unlisted buffers. -The default is to NOT show unlisted buffers. - - *g:bufExplorerSortBy* -To control what field the buffers are sorted by, use: > - let g:bufExplorerSortBy='extension' " Sort by file extension. - let g:bufExplorerSortBy='fullpath' " Sort by full file path name. - let g:bufExplorerSortBy='mru' " Sort by most recently used. - let g:bufExplorerSortBy='name' " Sort by the buffer's name. - let g:bufExplorerSortBy='number' " Sort by the buffer's number. -The default is to sort by mru. - - *g:bufExplorerSplitBelow* -To control where the new split window will be placed above or below the -current window, use: > - let g:bufExplorerSplitBelow=1 " Split new window below current. - let g:bufExplorerSplitBelow=0 " Split new window above current. -The default is to use what ever is set by the global &splitbelow -variable. - - *g:bufExplorerSplitOutPathName* -To control whether to split out the path and file name or not, use: > - let g:bufExplorerSplitOutPathName=1 " Split the path and file name. - let g:bufExplorerSplitOutPathName=0 " Don't split the path and file - " name. -The default is to split the path and file name. - - *g:bufExplorerSplitRight* -To control where the new vsplit window will be placed to the left or right of -current window, use: > - let g:bufExplorerSplitRight=0 " Split left. - let g:bufExplorerSplitRight=1 " Split right. -The default is to use the global &splitright. - -=============================================================================== -CHANGE LOG *bufexplorer-changelog* - -7.2.8 - Enhancements: - * Thanks to Charles Campbell for integrating bufexplorer with GDBMGR. - http://mysite.verizon.net/astronaut/vim/index.html#GDBMGR -7.2.7 - Fix: - * My 1st attempt to fix the "cache" issue where buffers information - has changed but the cache/display does not reflect those changes. - More work still needs to be done. -7.2.6 - Fix: - * Thanks to Michael Henry for pointing out that I totally forgot to - update the inline help to reflect the previous change to the 'd' - and 'D' keys. Opps! -7.2.5 - Fix: - * Philip Morant suggested switching the command (bwipe) associated - with the 'd' key with the command (bdelete) associated with the 'D' - key. This made sense since the 'd' key is more likely to be used - compared to the 'D' key. -7.2.4 - Fix: - * I did not implement the patch provided by Godefroid Chapelle - correctly. I missed one line which happened to be the most - important one :) -7.2.3 - Enhancements: - * Thanks to David Fishburn for helping me out with a much needed - code overhaul as well as some awesome performance enhancements. - He also reworked the handling of tabs. - * Thanks to Vladimir Dobriakov for making the suggestions on - enhancing the documentation to include a better explaination of - what is contained in the main bufexplorer window. - * Thanks to Yuriy Ershov for added code that when the bufexplorer - window is opened, the cursor is now positioned at the line with the - active buffer (useful in non-MRU sort modes). - * Yuriy also added the abiltiy to cycle through the sort fields in - reverse order. - Fixes: - * Thanks to Michael Henry for supplying a patch that allows - bufexplorer to be opened even when there is one buffer or less. - * Thanks to Godefroid Chapelle for supplying a patch that fixed - MRU sort order after loading a session. -7.2.2 - Fixes: - * Thanks to David L. Dight for spotting and fixing an issue when - using ctrl^. bufexplorer would incorrectly handle the previous - buffer so that when ctrl^ was pressed the incorrect file was opened. -7.2.1 - Fixes: - * Thanks to Dimitar for spotting and fixing a feature that was - inadvertently left out of the previous version. The feature was - when bufexplorer was used together with WinManager, you could use - the tab key to open a buffer in a split window. -7.2.0 - Enhancements: - * For all those missing the \bs and \bv commands, these have now - returned. Thanks to Phil O'Connell for asking for the return of - these missing features and helping test out this version. - Fixes: - * Fixed problem with the bufExplorerFindActive code not working - correctly. - * Fixed an incompatibility between bufexplorer and netrw that caused - buffers to be incorrectly removed from the MRU list. -7.1.7 - Fixes: - * TaCahiroy fixed several issues related to opening a buffer in a - tab. -7.1.6 - Fixes: - * Removed ff=unix from modeline in bufexplorer.txt. Found by Bill - McCarthy. -7.1.5 - Fixes: - * Could not open unnamed buffers. Fixed by TaCahiroy. -7.1.4 - Fixes: - * Sometimes when a file's path has 'white space' in it, extra buffers - would be created containing each piece of the path. i.e: - opening c:\document and settings\test.txt would create a buffer - named "and" and a buffer named "Documents". This was reported and - fixed by TaCa Yoss. -7.1.3 - Fixes: - * Added code to allow only one instance of the plugin to run at a - time. Thanks Dennis Hostetler. -7.1.2 - Fixes: - * Fixed a jumplist issue spotted by JiangJun. I overlooked the - 'jumplist' and with a couple calls to 'keepjumps', everything is - fine again. - * Went back to just having a plugin file, no autoload file. By having - the autoload, WinManager was no longer working and without really - digging into the cause, it was easier to go back to using just a - plugin file. -7.1.1 - Fixes: - * A problem spotted by Thomas Arendsen Hein. - When running Vim (7.1.94), error E493 was being thrown. - Enhancements: - * Added 'D' for 'delete' buffer as the 'd' command was a 'wipe' - buffer. -7.1.0 - Another 'major' update, some by Dave Larson, some by me. - * Making use of 'autoload' now to make the plugin load quicker. - * Removed '\bs' and '\bv'. These are now controlled by the user. The - user can issue a ':sp' or ':vs' to create a horizontal or vertical - split window and then issue a '\be' - * Added handling of tabs. -7.0.17 - Fixed issue with 'drop' command. - Various enhancements and improvements. -7.0.16 - Fixed issue reported by Liu Jiaping on non Windows systems, which was - ... - Open file1, open file2, modify file1, open bufexplorer, you get the - following error: - - --------8<-------- - Error detected while processing function - 14_StartBufExplorer..14_SplitOpen: - line 4: - E37: No write since last change (add ! to override) - - But the worse thing is, when I want to save the current buffer and - type ':w', I get another error message: - E382: Cannot write, 'buftype' option is set - --------8<-------- - -7.0.15 - Thanks to Mark Smithfield for suggesting bufexplorer needed to handle - the ':args' command. -7.0.14 - Thanks to Randall Hansen for removing the requirement of terminal - versions to be recompiled with 'gui' support so the 'drop' command - would work. The 'drop' command is really not needed in terminal - versions. -7.0.13 - Fixed integration with WinManager. - Thanks to Dave Eggum for another update. - - Fix: The detailed help didn't display the mapping for toggling - the split type, even though the split type is displayed. - - Fixed incorrect description in the detailed help for toggling - relative or full paths. - - Deprecated s:ExtractBufferNbr(). Vim's str2nr() does the same - thing. - - Created a s:Set() function that sets a variable only if it hasn't - already been defined. It's useful for initializing all those - default settings. - - Removed checks for repetitive command definitions. They were - unnecessary. - - Made the help highlighting a little more fancy. - - Minor reverse compatibility issue: Changed ambiguous setting - names to be more descriptive of what they do (also makes the code - easier to follow): - Changed bufExplorerSortDirection to bufExplorerReverseSort - Changed bufExplorerSplitType to bufExplorerSplitVertical - Changed bufExplorerOpenMode to bufExplorerUseCurrentWindow - - When the BufExplorer window closes, all the file-local marks are - now deleted. This may have the benefit of cleaning up some of the - jumplist. - - Changed the name of the parameter for StartBufExplorer from - "split" to "open". The parameter is a string which specifies how - the buffer will be open, not if it is split or not. - - Deprecated DoAnyMoreBuffersExist() - it is a one line function - only used in one spot. - - Created four functions (SplitOpen(), RebuildBufferList(), - UpdateHelpStatus() and ReSortListing()) all with one purpose - to - reduce repeated code. - - Changed the name of AddHeader() to CreateHelp() to be more - descriptive of what it does. It now returns an array instead of - updating the window directly. This has the benefit of making the - code more efficient since the text the function returns is used a - little differently in the two places the function is called. - - Other minor simplifications. -7.0.12 - MAJOR Update. - This version will ONLY run with Vim version 7.0 or greater. - Dave Eggum has made some 'significant' updates to this latest - version: - - Added BufExplorerGetAltBuf() global function to be used in the - users rulerformat. - - Added g:bufExplorerSplitRight option. - - Added g:bufExplorerShowRelativePath option with mapping. - - Added current line highlighting. - - The split type can now be changed whether bufexplorer is opened - in split mode or not. - - Various major and minor bug fixes and speed improvements. - - Sort by extension. - Other improvements/changes: - - Changed the help key from '?' to to be more 'standard'. - - Fixed splitting of vertical bufexplorer window. - Hopefully I have not forgot something :) -7.0.11 - Fixed a couple of highlighting bugs, reported by David Eggum. He also - changed passive voice to active on a couple of warning messages. -7.0.10 - Fixed bug report by Xiangjiang Ma. If the 'ssl' option is set, - the slash character used when displaying the path was incorrect. -7.0.9 - Martin Grenfell found and eliminated an annoying bug in the - bufexplorer/winmanager integration. The bug was were an - annoying message would be displayed when a window was split or - a new file was opened in a new window. Thanks Martin! -7.0.8 - Thanks to Mike Li for catching a bug in the WinManager integration. - The bug was related to the incorrect displaying of the buffer - explorer's window title. -7.0.7 - Thanks to Jeremy Cowgar for adding a new enhancement. This - enhancement allows the user to press 'S', that is capital S, which - will open the buffer under the cursor in a newly created split - window. -7.0.6 - Thanks to Larry Zhang for finding a bug in the "split" buffer code. - If you force set g:bufExplorerSplitType='v' in your vimrc, and if you - tried to do a \bs to split the bufexplorer window, it would always - split horizontal, not vertical. He also found that I had a typeo in - that the variable g:bufExplorerSplitVertSize was all lower case in - the documentation which was incorrect. -7.0.5 - Thanks to Mun Johl for pointing out a bug that if a buffer was - modified, the '+' was not showing up correctly. -7.0.4 - Fixed a problem discovered first by Xiangjiang Ma. Well since I've - been using vim 7.0 and not 6.3, I started using a function (getftype) - that is not in 6.3. So for backward compatibility, I conditionaly use - this function now. Thus, the g:bufExplorerShowDirectories feature is - only available when using vim 7.0 and above. -7.0.3 - Thanks to Erwin Waterlander for finding a problem when the last - buffer was deleted. This issue got me to rewrite the buffer display - logic (which I've wanted to do for sometime now). - Also great thanks to Dave Eggum for coming up with idea for - g:bufExplorerShowDirectories. Read the above information about this - feature. -7.0.2 - Thanks to Thomas Arendsen Hein for finding a problem when a user - has the default help turned off and then brought up the explorer. An - E493 would be displayed. -7.0.1 - Thanks to Erwin Waterlander for finding a couple problems. - The first problem allowed a modified buffer to be deleted. Opps! The - second problem occurred when several files were opened, BufExplorer - was started, the current buffer was deleted using the 'd' option, and - then BufExplorer was exited. The deleted buffer was still visible - while it is not in the buffers list. Opps again! -7.0.0 - Thanks to Shankar R. for suggesting to add the ability to set - the fixed width (g:bufExplorerSplitVertSize) of a new window - when opening bufexplorer vertically and fixed height - (g:bufExplorerSplitHorzSize) of a new window when opening - bufexplorer horizontally. By default, the windows are normally - split to use half the existing width or height. -6.3.0 - Added keepjumps so that the jumps list would not get cluttered with - bufexplorer related stuff. -6.2.3 - Thanks to Jay Logan for finding a bug in the vertical split position - of the code. When selecting that the window was to be split - vertically by doing a '\bv', from then on, all splits, i.e. '\bs', - were split vertically, even though g:bufExplorerSplitType was not set - to 'v'. -6.2.2 - Thanks to Patrik Modesto for adding a small improvement. For some - reason his bufexplorer window was always showing up folded. He added - 'setlocal nofoldenable' and it was fixed. -6.2.1 - Thanks goes out to Takashi Matsuo for added the 'fullPath' sorting - logic and option. -6.2.0 - Thanks goes out to Simon Johann-Ganter for spotting and fixing a - problem in that the last search pattern is overridden by the search - pattern for blank lines. -6.1.6 - Thanks to Artem Chuprina for finding a pesky bug that has been around - for sometime now. The key mapping was causing the buffer - explored to close prematurely when vim was run in an xterm. The - key mapping is now removed. -6.1.5 - Thanks to Khorev Sergey. Added option to show default help or not. -6.1.4 - Thanks goes out to Valery Kondakoff for suggesting the addition of - setlocal nonumber and foldcolumn=0. This allows for line numbering - and folding to be turned off temporarily while in the explorer. -6.1.3 - Added folding. Did some code cleanup. Added the ability to force the - newly split window to be temporarily vertical, which was suggested by - Thomas Glanzmann. -6.1.2 - Now pressing the key will quit, just like 'q'. - Added folds to hide winmanager configuration. - If anyone had the 'C' option in their cpoptions they would receive - a E10 error on startup of BufExplorer. cpo is now saved, updated and - restored. Thanks to Charles E Campbell, Jr. - Attempted to make sure there can only be one BufExplorer window open - at a time. -6.1.1 - Thanks to Brian D. Goodwin for adding toupper to FileNameCmp. This - way buffers sorted by name will be in the correct order regardless of - case. -6.0.16 - Thanks to Andre Pang for the original patch/idea to get bufexplorer - to work in insertmode/modeless mode (evim). Added Initialize - and Cleanup autocommands to handle commands that need to be - performed when starting or leaving bufexplorer. -6.0.15 - Srinath Avadhanulax added a patch for winmanager.vim. -6.0.14 - Fix a few more bug that I thought I already had fixed. Thanks - to Eric Bloodworth for adding 'Open Mode/Edit in Place'. Added - vertical splitting. -6.0.13 - Thanks to Charles E Campbell, Jr. for pointing out some embarrassing - typos that I had in the documentation. I guess I need to run - the spell checker more :o) -6.0.12 - Thanks to Madoka Machitani, for the tip on adding the augroup command - around the MRUList autocommands. -6.0.11 - Fixed bug report by Xiangjiang Ma. '"=' was being added to the - search history which messed up hlsearch. -6.0.10 - Added the necessary hooks so that the Srinath Avadhanula's - winmanager.vim script could more easily integrate with this script. - Tried to improve performance. -6.0.9 - Added MRU (Most Recently Used) sort ordering. -6.0.8 - Was not resetting the showcmd command correctly. - Added nifty help file. -6.0.7 - Thanks to Brett Carlane for some great enhancements. Some are added, - some are not, yet. Added highlighting of current and alternate - filenames. Added splitting of path/filename toggle. Reworked - ShowBuffers(). - Changed my email address. -6.0.6 - Copyright notice added. Needed this so that it could be distributed - with Debian Linux. Fixed problem with the SortListing() function - failing when there was only one buffer to display. -6.0.5 - Fixed problems reported by David Pascoe, in that you where unable to - hit 'd' on a buffer that belonged to a files that no longer existed - and that the 'yank' buffer was being overridden by the help text when - the bufexplorer was opened. -6.0.4 - Thanks to Charles Campbell, Jr. for making this plugin more plugin - *compliant*, adding default keymappings of be and bs - as well as fixing the 'w:sortDirLabel not being defined' bug. -6.0.3 - Added sorting capabilities. Sort taken from explorer.vim. -6.0.2 - Can't remember. (2001-07-25) -6.0.1 - Initial release. - -=============================================================================== -TODO *bufexplorer-todo* - -- Nothing as of now, buf if you have any suggestions, drop me an email. - -=============================================================================== -CREDITS *bufexplorer-credits* - -Author: Jeff Lanzarotta - -Credit must go out to Bram Moolenaar and all the Vim developers for -making the world's best editor (IMHO). I also want to thank everyone who -helped and gave me suggestions. I wouldn't want to leave anyone out so I -won't list names. - -=============================================================================== -vim:tw=78:noet:wrap:ts=8:ft=help:norl: diff --git a/sources_non_forked/bufexplorer/plugin/bufexplorer.vim b/sources_non_forked/bufexplorer/plugin/bufexplorer.vim deleted file mode 100644 index 87913639..00000000 --- a/sources_non_forked/bufexplorer/plugin/bufexplorer.vim +++ /dev/null @@ -1,1162 +0,0 @@ -"============================================================================== -" Copyright: Copyright (C) 2001-2010 Jeff Lanzarotta -" Permission is hereby granted to use and distribute this code, -" with or without modifications, provided that this copyright -" notice is copied with it. Like anything else that's free, -" bufexplorer.vim is provided *as is* and comes with no -" warranty of any kind, either expressed or implied. In no -" event will the copyright holder be liable for any damages -" resulting from the use of this software. -" Name Of File: bufexplorer.vim -" Description: Buffer Explorer Vim Plugin -" Maintainer: Jeff Lanzarotta (delux256-vim at yahoo dot com) -" Last Changed: Friday, 22 October 2010 -" Version: See g:bufexplorer_version for version number. -" Usage: This file should reside in the plugin directory and be -" automatically sourced. -" -" You may use the default keymappings of -" -" be - Opens BE. -" bs - Opens horizontally window BE. -" bv - Opens vertically window BE. -" -" Or you can use -" -" ":BufExplorer" - Opens BE. -" ":BufExplorerHorizontalSplit" - Opens horizontally window BE. -" ":BufExplorerVerticalSplit" - Opens vertically window BE. -" -" For more help see supplied documentation. -" History: See supplied documentation. -"============================================================================== - -" Exit quickly if already running or when 'compatible' is set. {{{1 -if exists("g:bufexplorer_version") || &cp - finish -endif -"1}}} - -" Version number -let g:bufexplorer_version = "7.2.8" - -" Check for Vim version 700 or greater {{{1 -if v:version < 700 - echo "Sorry, bufexplorer ".g:bufexplorer_version."\nONLY runs with Vim 7.0 and greater." - finish -endif - -" Public Interface {{{1 -if maparg("be") =~ 'BufExplorer' - nunmap be -endif - -if maparg("bs") =~ 'BufExplorerHorizontalSplit' - nunmap bs -endif - -if maparg("bv") =~ 'BufExplorerVerticalSplit' - nunmap bv -endif - -nmap + + + + + + +
+ {{ content }} +
+ + + diff --git a/sources_non_forked/vim-notes/plugin/notes.vim b/sources_non_forked/vim-notes/plugin/notes.vim new file mode 100644 index 00000000..89d06fcb --- /dev/null +++ b/sources_non_forked/vim-notes/plugin/notes.vim @@ -0,0 +1,79 @@ +" Vim plug-in +" Author: Peter Odding +" Last Change: August 19, 2013 +" URL: http://peterodding.com/code/vim/notes/ + +" Support for automatic update using the GLVS plug-in. +" GetLatestVimScripts: 3375 1 :AutoInstall: notes.zip + +" Don't source the plug-in when it's already been loaded or &compatible is set. +if &cp || exists('g:loaded_notes') + finish +endif + +" Make sure vim-misc is installed. +try + " The point of this code is to do something completely innocent while making + " sure the vim-misc plug-in is installed. We specifically don't use Vim's + " exists() function because it doesn't load auto-load scripts that haven't + " already been loaded yet (last tested on Vim 7.3). + call type(g:xolox#misc#version) +catch + echomsg "Warning: The vim-notes plug-in requires the vim-misc plug-in which seems not to be installed! For more information please review the installation instructions in the readme (also available on the homepage and on GitHub). The vim-notes plug-in will now be disabled." + let g:loaded_notes = 1 + finish +endtry + +" Initialize the configuration defaults. +call xolox#notes#init() + +" User commands to create, delete and search notes. +command! -bar -bang -nargs=? -complete=customlist,xolox#notes#cmd_complete Note call xolox#notes#edit(, ) +command! -bar -bang -nargs=? -complete=customlist,xolox#notes#cmd_complete DeleteNote call xolox#notes#delete(, ) +command! -bang -nargs=? -complete=customlist,xolox#notes#keyword_complete SearchNotes call xolox#notes#search(, ) +command! -bar -bang RelatedNotes call xolox#notes#related() +command! -bar -bang -nargs=? RecentNotes call xolox#notes#recent#show(, ) +command! -bar -bang MostRecentNote call xolox#notes#recent#edit() +command! -bar -count=1 ShowTaggedNotes call xolox#notes#tags#show_tags() +command! -bar IndexTaggedNotes call xolox#notes#tags#create_index() +command! -bar NoteToMarkdown call xolox#notes#markdown#view() +command! -bar NoteToHtml call xolox#notes#html#view() + +" TODO Generalize this so we have one command + modifiers (like :tab)? +command! -bar -bang -range NoteFromSelectedText call xolox#notes#from_selection(, 'edit') +command! -bar -bang -range SplitNoteFromSelectedText call xolox#notes#from_selection(, 'vsplit') +command! -bar -bang -range TabNoteFromSelectedText call xolox#notes#from_selection(, 'tabnew') + +" Automatic commands to enable the :edit note:… shortcut and load the notes file type. + +augroup PluginNotes + autocmd! + au SwapExists * call xolox#notes#swaphack() + au BufUnload * call xolox#notes#unload_from_cache() + au BufReadPost,BufWritePost * call xolox#notes#refresh_syntax() + au InsertEnter,InsertLeave * call xolox#notes#refresh_syntax() + au CursorHold,CursorHoldI * call xolox#notes#refresh_syntax() + " NB: "nested" is used here so that SwapExists automatic commands apply + " to notes (which is IMHO better than always showing the E325 prompt). + au BufReadCmd note:* nested call xolox#notes#shortcut() + " Automatic commands to read/write notes (used for automatic renaming). + exe 'au BufReadCmd' xolox#notes#autocmd_pattern(g:notes_shadowdir, 0) 'call xolox#notes#edit_shadow()' + for s:directory in xolox#notes#find_directories(0) + exe 'au BufWriteCmd' xolox#notes#autocmd_pattern(s:directory, 1) 'call xolox#notes#save()' + endfor + unlet s:directory +augroup END + +augroup filetypedetect + let s:template = 'au BufNewFile,BufRead %s if &bt == "" | setl ft=notes | end' + for s:directory in xolox#notes#find_directories(0) + execute printf(s:template, xolox#notes#autocmd_pattern(s:directory, 1)) + endfor + unlet s:directory + execute printf(s:template, xolox#notes#autocmd_pattern(g:notes_shadowdir, 0)) +augroup END + +" Make sure the plug-in is only loaded once. +let g:loaded_notes = 1 + +" vim: ts=2 sw=2 et diff --git a/sources_non_forked/vim-notes/syntax/notes.vim b/sources_non_forked/vim-notes/syntax/notes.vim new file mode 100644 index 00000000..5d3fd485 --- /dev/null +++ b/sources_non_forked/vim-notes/syntax/notes.vim @@ -0,0 +1,162 @@ +" Vim syntax script +" Author: Peter Odding +" Last Change: July 16, 2013 +" URL: http://peterodding.com/code/vim/notes/ + +" Note: This file is encoded in UTF-8 including a byte order mark so +" that Vim loads the script using the right encoding transparently. + +" Quit when a syntax file was already loaded. +if exists('b:current_syntax') + finish +endif + +" Check for spelling errors in all text. +syntax spell toplevel + +" Inline elements. {{{1 + +" Cluster of elements which never contain a newline character. +syntax cluster notesInline contains=notesName + +" Default highlighting style for notes syntax markers. +highlight def link notesHiddenMarker Ignore + +" Highlight note names as hyperlinks. {{{2 +call xolox#notes#highlight_names(1) +syntax cluster notesInline add=notesName +highlight def link notesName Underlined + +" Highlight @tags as hyperlinks. {{{2 +syntax match notesTagName /\(^\|\s\)\@<=@\k\+/ +highlight def link notesTagName Underlined + +" Highlight list bullets and numbers. {{{2 +execute 'syntax match notesListBullet /' . escape(xolox#notes#leading_bullet_pattern(), '/') . '/' +highlight def link notesListBullet Comment +syntax match notesListNumber /^\s*\zs\d\+[[:punct:]]\?\ze\s/ +highlight def link notesListNumber Comment + +" Highlight quoted fragments. {{{2 +if xolox#notes#unicode_enabled() + syntax match notesDoubleQuoted /“.\{-}”/ + syntax match notesSingleQuoted /‘.\{-}’/ +else + syntax match notesDoubleQuoted /".\{-}"/ + syntax match notesSingleQuoted /`.\{-}'/ +endif +highlight def link notesSingleQuoted Special +highlight def link notesDoubleQuoted String + +" Highlight text emphasized in italic font. {{{2 +if has('conceal') + syntax region notesItalic matchgroup=notesItalicMarker start=/\<_\k\@=/ end=/_\>\|\n/ contains=@Spell concealends + highlight link notesItalicMarker notesHiddenMarker +else + syntax match notesItalic /\<_\k[^_]*\k_\>/ +endif +syntax cluster notesInline add=notesItalic +highlight notesItalic gui=italic cterm=italic + +" Highlight text emphasized in bold font. {{{2 +if has('conceal') + syntax region notesBold matchgroup=notesBoldMarker start=/\*\k\@=/ end=/\S\@<=\*/ contains=@Spell concealends + highlight link notesBoldMarker notesHiddenMarker +else + syntax match notesBold /\*\k[^*]*\k\*/ +endif +syntax cluster notesInline add=notesBold +highlight notesBold gui=bold cterm=bold + +" Highlight domain names, URLs, e-mail addresses and filenames. {{{2 + +" FIXME This setting is lost once the user switches color scheme! +highlight notesSubtleURL gui=underline guifg=fg + +syntax match notesTextURL @\/ +syntax cluster notesInline add=notesEmailAddr +highlight def link notesEmailAddr notesSubtleURL +syntax match notesUnixPath /\k\@/ +syntax match notesXXX /\/ +syntax match notesFixMe /\/ +syntax match notesInProgress /\<\(CURRENT\|INPROGRESS\|STARTED\|WIP\)\>/ +syntax match notesDoneItem /^\(\s\+\).*\.*\(\n\1\s.*\)*/ contains=@notesInline +syntax match notesDoneMarker /\/ containedin=notesDoneItem +highlight def link notesTodo WarningMsg +highlight def link notesXXX WarningMsg +highlight def link notesFixMe WarningMsg +highlight def link notesDoneItem Comment +highlight def link notesDoneMarker Question +highlight def link notesInProgress Directory + +" Highlight Vim command names in :this notation. {{{2 +syntax match notesVimCmd /:\w\+\(!\|\>\)/ contains=ALLBUT,@Spell +syntax cluster notesInline add=notesVimCmd +highlight def link notesVimCmd Special + +" Block level elements. {{{1 + +" The first line of each note contains the title. {{{2 +syntax match notesTitle /^.*\%1l.*$/ contains=@notesInline +highlight def link notesTitle ModeMsg + +" Short sentences ending in a colon are considered headings. {{{2 +syntax match notesShortHeading /^\s*\zs\u.\{1,50}\k:\ze\(\s\|$\)/ contains=@notesInline +highlight def link notesShortHeading Title + +" Atx style headings are also supported. {{{2 +syntax match notesAtxHeading /^#\+.*/ contains=notesAtxMarker,@notesInline +highlight def link notesAtxHeading Title +syntax match notesAtxMarker /^#\+/ contained +highlight def link notesAtxMarker Comment + +" E-mail style block quotes are highlighted as comments. {{{2 +syntax match notesBlockQuote /\(^\s*>.*\n\)\+/ contains=@notesInline +highlight def link notesBlockQuote Comment + +" Horizontal rulers. {{{2 +syntax match notesRule /\(^\s\+\)\zs\*\s\*\s\*$/ +highlight def link notesRule Comment + +" Highlight embedded blocks of source code, log file messages, basically anything Vim can highlight. {{{2 +" NB: I've escaped these markers so that Vim doesn't interpret them when editing this file… +syntax match notesCodeStart /{{[{]\w*/ +syntax match notesCodeEnd /}}[}]/ +highlight def link notesCodeStart Ignore +highlight def link notesCodeEnd Ignore +call xolox#notes#highlight_sources(1) + +" Hide mode line at end of file. {{{2 +syntax match notesModeLine /\_^vim:.*\_s*\%$/ +highlight def link notesModeLine LineNr + +" Last edited dates in :ShowTaggedNotes buffers. +syntax match notesLastEdited /(last edited \(today\|yesterday\|\w\+, \w\+ \d\+, \d\+\))/ +highlight def link notesLastEdited LineNr + +" }}}1 + +" Set the currently loaded syntax mode. +let b:current_syntax = 'notes' + +" vim: ts=2 sw=2 et bomb fdl=1 diff --git a/sources_non_forked/vim-ruby/.gitignore b/sources_non_forked/vim-ruby/.gitignore new file mode 100644 index 00000000..926ccaaf --- /dev/null +++ b/sources_non_forked/vim-ruby/.gitignore @@ -0,0 +1 @@ +doc/tags diff --git a/sources_non_forked/vim-ruby/.rspec b/sources_non_forked/vim-ruby/.rspec new file mode 100644 index 00000000..4e1e0d2f --- /dev/null +++ b/sources_non_forked/vim-ruby/.rspec @@ -0,0 +1 @@ +--color diff --git a/sources_non_forked/vim-ruby/CONTRIBUTORS b/sources_non_forked/vim-ruby/CONTRIBUTORS new file mode 100644 index 00000000..20888fc1 --- /dev/null +++ b/sources_non_forked/vim-ruby/CONTRIBUTORS @@ -0,0 +1,18 @@ +Maintainers: + Mark Guzman + Doug Kearns + Tim Pope + Andrew Radev + Nikolai Weibull + +Other contributors: + Michael Brailsford + Sean Flanagan + Tim Hammerquist + Ken Miller + Hugh Sasse + Tilman Sauerbeck + Bertram Scharpf + Gavin Sinclair + Aaron Son + Ned Konz diff --git a/sources_non_forked/vim-ruby/ChangeLog b/sources_non_forked/vim-ruby/ChangeLog new file mode 100644 index 00000000..65b659f2 --- /dev/null +++ b/sources_non_forked/vim-ruby/ChangeLog @@ -0,0 +1,1579 @@ +This file is no longer maintained. Consult the Git log for newer changes. + +2009-09-27 Mark Guzman + + * autoload/rubycomplete.vim: pplying a patch from Yoshimasa Niwa resolving + a possible runaway CPU issue when matching context regexes + +2008-08-11 Doug Kearns + + * ftdetect/ruby.vim: match irbrc as a Ruby filetype + +2008-07-15 Doug Kearns + + * FAQ, README, etc/website/index.html: update the references to + RubyGarden's VimRubySupport page + +2008-07-08 Doug Kearns + + * NEWS: begin updating for the pending release + +2008-06-29 Mark Guzman + + * autoload/rubycomplete.vim: resolve a typo in the configuration initialization + section + +2008-06-29 Tim Pope + + * syntax/ruby.vim: revert highlighting of - as number + +2008-06-29 Tim Pope + + * indent/eruby.vim: fix quirk in optional argument handling + +2008-06-29 Tim Pope + + * syntax/ruby.vim: don't match $_foo as an invalid variable + +2008-04-25 Tim Pope + + * ftplugin/eruby.vim, syntax/eruby.vim: guard against recursion + +2008-04-21 Tim Pope + + * indent/eruby.vim: don't let ruby indent %> lines + * indent/ruby.vim: hack around <%= and <%- from eruby + +2008-04-20 Tim Pope + + * syntax/ruby.vim: don't highlight x /= y as regexp + +2008-02-17 Tim Pope + + * indent/ruby.vim: Copy previous string indent inside strings + +2008-02-13 Tim Pope + + * syntax/ruby.vim: keepend on // regexps and add \/ escape + +2008-02-01 Mark Guzman + + * autoload/rubycomplete.vim: switch vim variable checking to a more + rubyish method + +2008-01-31 Tim Pope + + * indent/eruby.vim: setlocal, not set indentexpr + +2008-01-28 Tim Pope + + * syntax/ruby.vim: better heuristic for regexps as method arguments + +2008-01-25 Tim Pope + + * syntax/ruby.vim: highlight several regexp constructs + +2008-01-21 Tim Pope + + * indent/eruby.vim: per Bram's advice, use 'W' searchpair flag + +2008-01-21 Tim Pope + + * indent/eruby.vim: indent { and } like do and end + +2007-12-17 Tim Pope + + * indent/eruby.vim: treat <%- like <% + +2007-10-01 Tim Pope + + * syntax/ruby.vim: removed some false positives (e.g., include?, nil?) + +2007-09-14 Tim Pope + + * compiler/rspec.vim: new compiler plugin for rspec + +2007-09-06 Tim Pope + + * syntax/eruby.vim: remove Vim 5.x specific sections + * syntax/ruby.vim: highlight negative sign in numbers + +2007-08-07 Tim Pope + + * indent/ruby.vim: fix while/until/for match in skip regexp + +2007-07-30 Tim Pope + + * syntax/ruby.vim: highlight undef like def + +2007-07-16 Tim Pope + + * indent/ruby.vim: prevent symbols like :for from indenting + +2007-07-14 Tim Pope + + * syntax/eruby.vim: fixed ALLBUT clauses to refer to right group + +2007-06-22 Tim Pope + + * syntax/ruby.vim: include operator highlighting in class/module + declarations (for ::) + +2007-06-04 Tim Pope + + * syntax/ruby.vim: fixed %s() highlighting + +2007-05-26 Tim Pope + + * syntax/ruby.vim: added rubyBlockParameter to @rubyNoTop + +2007-05-25 Tim Pope + + * indent/ruby.vim: removed string delimiters from string matches + +2007-05-25 Tim Pope + + * syntax/ruby.vim: cleaned up string highlighting + * indent/ruby.vim: lines starting with strings are no longer ignored + +2007-05-22 Tim Pope + + * syntax/ruby.vim: made module declaration match mirror class + declaration match + * ftdetect/ruby.vim: added .irbrc + +2007-05-16 Tim Pope + + * syntax/ruby.vim: revert from using TOP to ALLBUT + +2007-05-15 Tim Pope + + * syntax/eruby.vim: handle %%> properly + +2007-05-14 Tim Pope + + * syntax/ruby.vim: fixed problem highlighting [foo[:bar]] + * syntax/ruby.vim: don't highlight = in {:foo=>"bar"} + +2007-05-11 Tim Pope + + * indent/eruby.vim: GetRubyIndent() takes an argument for debugging + * doc/ft-ruby-syntax.txt: clean up some cruft + +2007-05-09 Tim Pope + + * syntax/ruby.vim: added module_function keyword + +2007-05-06 Tim Pope + + * doc/ft-ruby-syntax.txt: bring into sync with upstream + * ftdetect/ruby.vim: Rails extensions + +2007-05-06 Tim Pope + + * NEWS: update documentation for next release + * syntax/eruby.vim: allow for nesting (foo.erb.erb) + * syntax/ruby.vim: removed : from rubyOptionalDoLine (falsely matches + on symbols, and the syntax is deprecated anyways) + +2007-05-06 Tim Pope + + * ftplugin/ruby.vim: maps for [[, ]], [], ][, [m, ]m, [M, ]M + +2007-05-06 Tim Pope + + * ftplugin/eruby.vim, syntax/eruby.vim: added a default subtype option + +2007-05-06 Tim Pope + + * syntax/ruby.vim: Highlight punctuation variables in string + interpolation, and flag invalid ones as errors + +2007-05-05 Tim Pope + + * syntax/ruby.vim: eliminated some false positves for here docs, + symbols, ASCII codes, and conditionals as statement modifiers + * syntax/ruby.vim: added "neus" to regexp flags + +2007-04-24 Tim Pope + + * ftplugin/eruby.vim, syntax/eruby.vim: fixed typo in subtype + detection + +2007-04-20 Tim Pope + + * ftplugin/eruby.vim, syntax/eruby.vim: refined subtype detection + +2007-04-17 Tim Pope + + * syntax/ruby.vim: highlight %s() as a symbol, not a string + * ftplugin/eruby.vim: determine and use eruby subtype + +2007-04-16 Tim Pope + + * ftplugin/ruby.vim: add *.erb to the browse filter + * indent/eruby.vim: use 'indentexpr' from subtype + +2007-04-16 Tim Pope + + * ftdetect/ruby.vim: detect *.erb as eruby + * syntax/eruby.vim: determine subtype by inspecting filename + +2007-04-03 Doug Kearns + + * syntax/ruby.vim: allow text to appear after, and on the same line, + as '=begin' in rubyDocumentation regions + +2007-03-31 Doug Kearns + + * ftplugin/ruby.vim: add break, redo, next, and retry to b:match_words + +2007-03-28 Doug Kearns + + * syntax/ruby.vim: add matchgroup to rubyArrayLiteral so that + contained square brackets do not match in the start/end patterns + +2007-03-28 Doug Kearns + + * syntax/ruby.vim: don't match [!=?] as part of a sigil prefixed + symbol name + +2007-03-28 Doug Kearns + + * syntax/ruby.vim: rename the rubyNoDoBlock, rubyCaseBlock, + rubyConditionalBlock, and rubyOptionalDoBlock syntax groups to + rubyBlockExpression, rubyCaseExpression, rubyConditionalExpression, + and rubyRepeatExpression respectively + +2007-03-28 Doug Kearns + + * syntax/ruby.vim: remove accidentally included matchgroup from + rubyArrayLiteral + +2007-03-20 Doug Kearns + + * indent/ruby.vim: ignore instance, class, and global variables named + "end" when looking to deindent the closing end token + +2007-03-20 Doug Kearns + + * syntax/ruby.vim, syntax/eruby.vim: remove the Vim version 5 + compatibility code + +2007-03-20 Doug Kearns + + * syntax/ruby.vim: add rubyArrayLiteral syntax group for folding + multiline array literals + +2007-03-19 Doug Kearns + + * syntax/ruby.vim: highlight the scope and range operators when + ruby_operators is set; simplify block parameter highlighting by adding + the rubyBlockParameterList syntax group + +2007-03-17 Doug Kearns + + * syntax/ruby.vim: when ruby_operators is set don't match '>' in '=>'; + fix some minor bugs in the highlighting of pseudo operators and + contain TOP in rubyBracketOperator + +2007-03-17 Doug Kearns + + * syntax/ruby.vim: allow regexp literals to be highlighted after the + 'else' keyword + +2007-03-09 Tim Pope + + * syntax/ruby.vim: Added OPTIMIZE alongside FIXME and TODO. Mirrors + Edge Rails' new annotations extractor tasks. + +2007-03-09 Tim Pope + + * ftplugin/ruby.vim: Skip class= and for= with matchit (really belongs + in ftplugin/eruby.vim). + +2007-03-05 Doug Kearns + + * ftplugin/ruby.vim: add sigil prefixed identifiers to b:match_skip + +2007-03-03 Doug Kearns + + * ftplugin/ruby.vim: simplify the b:match_words pattern by making + better use of b:match_skip in concert with the previous syntax group + additions + +2007-03-03 Doug Kearns + + * syntax/ruby.vim: add rubyConditionalModifier and rubyRepeatModifier + syntax groups for conditional and loop modifiers and match the + optional 'do' or ':' in looping statements with a new rubyOptionalDo + syntax group + +2007-03-02 Doug Kearns + + * NEWS: fix typo + +2007-03-02 Doug Kearns + + * NEWS: update documentation for next release + +2007-03-02 Tim Pope + + * syntax/ruby.vim: Cope with (nonsensical) inclusion of : in + iskeyword. + +2007-03-02 Tim Pope + + * NEWS: Documented changes to omnicompletion. + +2007-03-02 Doug Kearns + + * ftplugin/ruby.vim: refine the conditional/loop expression vs + modifier matchit heuristic + +2007-03-01 Doug Kearns + + * syntax/ruby.vim: refine the conditional/loop expression vs modifier + highlighting heuristic + +2007-02-28 Doug Kearns + + * syntax/ruby.vim: highlight conditional and loop expressions properly + when used with the ternary operator and in blocks + +2007-02-28 Doug Kearns + + * NEWS, CONTRIBUTORS: update documentation for next release + +2007-02-27 Tim Pope + + * ftplugin/ruby.vim: Provide 'balloonexpr'. + +2007-02-27 Doug Kearns + + * syntax/ruby.vim: add rubyPredefinedVariable to short-form + rubyInterpolation's contains list + +2007-02-27 Doug Kearns + + * syntax/ruby.vim: :retab! the file to save a few bytes + +2007-02-26 Tim Pope + + * syntax/ruby.vim: Limit then, else, elsif, and when to inside + conditional statements. + +2007-02-26 Doug Kearns + + * syntax/ruby.vim: make sure 'class << self' is always highlighted + +2007-02-26 Doug Kearns + + * syntax/ruby.vim: reorganise string interpolation syntax groups + +2007-02-26 Doug Kearns + + * syntax/ruby.vim: highlight interpolation regions preceded by + multiple backslashes properly + +2007-02-26 Doug Kearns + + * syntax/ruby.vim: highlight methods named "end" when the definition + is distributed over multiple lines (i.e. allow more "def end" madness) + +2007-02-25 Tim Pope + + * syntax/ruby.vim: Highlight predefined global variables in aliases. + +2007-02-25 Tim Pope + + * syntax/ruby.vim: Highlight symbols and global variables in aliases. + Highlight capitalized method names. + +2007-02-24 Tim Pope + + * ftplugin/ruby.vim: set keywordprg=ri + + * syntax/ruby.vim: Allow for "def end" madness + +2007-02-24 Doug Kearns + + * syntax/ruby.vim: allow escape sequences and interpolation inside + symbol 'names' specified with a string + +2007-02-24 Doug Kearns + + * syntax/ruby.vim: highlight == and & 'operator' redefinitions + properly + +2007-02-23 Tim Pope + + * doc/ft-ruby-syntax.txt: Recommend hi link rubyIdentifier NONE over + ruby_no_identifiers. + +2007-02-23 Tim Pope + + * syntax/ruby.vim: Fixed method highlighting when not at the end of + the line. Highlight aliases. Account for \ before #{} interpolation. + +2007-02-23 Doug Kearns + + * syntax/ruby.vim: make sure multi-line backslash escaped + interpolation regions are highlighted as rubyString + +2007-02-23 Doug Kearns + + * syntax/ruby.vim: link the rubyLoop syntax group to the Repeat + highlight group + +2007-02-22 Tim Pope + + * indent/eruby.vim: Fixed an edge case. + + * syntax/ruby.vim: Simpler method and class declaration highlighting. + Changed some contains=ALLBUT,... to contains=TOP. Altered some + highlight links: rubyConstant is now Type; rubySymbol is now Constant. + New groups like rubyLoop and rubyCondition. + +2007-02-22 Doug Kearns + + * syntax/ruby.vim: highlight short format interpolated variables + +2007-02-20 Tim Pope + + * syntax/ruby.vim: Place class/module declarations in a separate + group. Allow self to be highlighted in a method declaration. + +2007-02-18 Tim Pope + + * syntax/ruby.vim: Separate Regexp group. Nest Ruby code inside + string interpolation. Restored highlighting of method, class, and + module declarations. + +2007-02-10 Doug Kearns + + * ftplugin/ruby.vim: only reset 'ofu' if it exists and was set by the + ftplugin (for Vim 6 compatibility) + +2007-01-22 Tim Pope + + * ftplugin/ruby.vim: Limited path detection code to Windows, again. + +2006-12-13 Mark Guzman + + * autoload/rubycomplete.vim: added support for lambda and '&' defined + procs. + +2006-12-07 Mark Guzman + + * ftplugin/ruby.vim: modified the path detection code use + the built-in interpreter if it's available in all cases. + +2006-12-04 Tim Pope + + * indent/eruby.vim: Special case for "end" on first line of multi-line + eRuby block. + +2006-12-03 Doug Kearns + + * CONTRIBUTORS: add tpope + +2006-12-01 Mark Guzman + + * ftplugin/ruby.vim: changed the path detection code to use the + built-in interpreter if it's available under windows + +2006-11-30 Mark Guzman + + * autoload/rubycomplete.vim: Display constants as defines. Added a + rails preloading option. Fixed a bug detecting ranges defined with + %r{. Added support for completion in rails migrations. Will now + fail-over to syntax completion automatically, if the vim isn't built + with ruby support. Added support for class detection using + ObjectSpace. Tweeked buffer searching code to find modules/classes + reliably in more cases. + +2006-11-09 Tim Pope + + * indent/ruby.vim: Only increase one 'shiftwidth' after a line ending + with an open parenthesis. + +2006-11-08 Tim Pope + + * indent/eruby.vim: Rearranged keywords; new 'indentkeys' + +2006-11-08 Tim Pope + + * indent/eruby.vim: new indenting algorithm + +2006-11-08 Doug Kearns + + * syntax/ruby.vim: don't include trailing whitespace in matches for + 'def', 'class', and 'module' keywords + +2006-10-28 Doug Kearns + + * syntax/ruby.vim: remove accidently included nextgroup arg in + 'heredoc' syntax group definitions + +2006-10-24 Doug Kearns + + * syntax/eruby.vim: recognise '-' trim mode block delimiters (Nikolai + Weibull) + +2006-09-19 Mark Guzman + + * autoload/rubycomplete.vim: improved rails view support. included + rails helpers in rails completions. kernel elements are also included + in default completions. improved the handling of "broken" code. + +2006-09-07 Mark Guzman + + * autoload/rubycomplete.vim: autoload rubygems if possible. added + debugging print. clean up the buffer loading code a bit + +2006-08-21 Mark Guzman + + * autoload/rubycomplete.vim: modified the buffer loading code to prevent + syntax errors from stopping completion + +2006-07-12 Mark Guzman + + * autoload/rubycomplete.vim: added in-buffer method def handling. also + added an inital attempt at handling completion in a rails view + +2006-07-11 Doug Kearns + + * FAQ, INSTALL, NEWS, README, doc/ft-ruby-syntax.txt: update + documentation for next release + + * ftplugin/ruby.vim: only set 'omnifunc' if Vim has been compiled with + the Ruby interface + +2006-07-10 Doug Kearns + + * syntax/ruby.vim: fold all multiline strings + +2006-06-19 Mark Guzman + + * autoload/rubycomplete.vim: modified to change the default + buffer loading behavior. buffers are no longer loaded/parsed + automatically. enabling this feature requires setting the + variable g:rubycomplete_buffer_loading. this was done as + a security measure, the default vim7 install should not + execute any code. + + * autoload/rubycomplete.vim: symbol completion now works. i + tested with global symbols as well as rails symbols. + +2006-05-26 Doug Kearns + + * ftplugin/ruby.vim: fix typo + +2006-05-25 Mark Guzman + + * autoload/rubycomplete.vim: added rails column support. + switched to dictionary with type specifiers for methods, + classes, and variables. started/added rails 1.0 support. + added rails database connection support. + +2006-05-25 Doug Kearns + + * syntax/ruby.vim: use a region for the rubyMultiLineComment syntax + group instead of a multiline match pattern as it is faster; rename + rubyMultiLineComment to rubyMultilineComment + +2006-05-13 Doug Kearns + + * ftplugin/ruby.vim: test for '&omnifunc', rather than the Vim + version, before setting it; add omnifunc to b:undo_ftplugin + +2006-05-12 Doug Kearns + + * syntax/ruby.vim: match the pseudo operators such as '+=' when + ruby_operators is defined + +2006-05-11 Mark Guzman + + * autoload/rubycomplete.vim: added checks for the existance of + global config variables per dkearns' patch. refined error messages + to use vim error style + +2006-05-11 Doug Kearns + + * syntax/ruby.vim: make sure rubyDocumentation is highlighted even if + ruby_no_comment_fold is defined; improve rubyDocumentation match + patterns + +2006-05-09 Doug Kearns + + * syntax/ruby.vim: make folding of comments configurable via the + ruby_no_comment_fold variable + + * syntax/ruby.vim: add rubyMultiLineComment syntax group to allow + folding of comment blocks + +2006-05-08 Doug Kearns + + * syntax/ruby.vim: simplify rubyNoDoBlock, rubyOptDoLine match + patterns + + * syntax/ruby.vim: add initial support for highlighting 'operators'. + This is off by default and enabled by defining the ruby_operators + variable + + * syntax/ruby.vim: if/unless immediately following a method name + should always be highlighted as modifiers and not the beginning of an + expression + +2006-05-07 Mark Guzman + + * autoload/rubycomplete.vim: Switched to script local vars, + per patch from dkearns. removed secondary array clause. applied + patch provided by dkearns, fixes input handling. + +2006-05-07 Doug Kearns + + * autoload/rubycomplete.vim: set 'foldmethod' to marker in the + modeline + +2006-05-03 Doug Kearns + + * ftplugin/ruby.vim: add patterns for braces, brackets and parentheses + to b:match_words + +2006-05-01 Mark Guzman + + * autoload/rubycomplete.vim: Added error trapping and messages + for class import errors + +2006-04-28 Mark Guzman + + * autoload/rubycomplete.vim: started adding raw range support + 1..2.. fixed the symbol completion bug, where you + would end up with a double colon. + +2006-04-27 Mark Guzman + + * autoload/rubycomplete.vim: added variable type detection for + Ranges. added handlers for string completion: "test". + +2006-04-26 Mark Guzman + + * autoload/rubycomplete.vim: removed cWORD expansion in favor of + grabbing the whole line. added support for completing variables + inside operations and parameter lists. removed excess cruft code. + removed commented code. + + * autoload/rubycomplete.vim: fixed the truncation code. this fixes + f.chomp! returning chomp! again, where it should provide + the global list. It also fixes f.foo( a.B, b. returning a's + list when it should return b's. + +2006-04-26 Doug Kearns + + * autoload/rubycomplete.vim: set 'expandtab' properly + +2006-04-25 Mark Guzman + + * autoload/rubycomplete.vim: started stripping out preceding + assigment operation stuff. "x = A", would attempt to complete + A using the global list. I've started removing old/commented + code in an effort to slim down the file. + +2006-04-25 Doug Kearns + + * autoload/rubycomplete.vim: remove excess whitespace + + * indent/ruby.vim: make sure 'smartindent' is disabled + +2006-04-24 Mark Guzman + + * autoload/rubycomplete.vim: fixed a completion bug where the entered + text was not taken to account. it will now be used to limit the entries + returned + +2006-04-24 Doug Kearns + + * Rakefile: add vim help files, the new FAQ and rubycomplete.vim to + the gemspec file list + +2006-04-22 Mark Guzman + + * autoload/rubycomplete.vim: changed the rails load code to match the + console load, we're now pulling everything in. completion of class + members from within the class definition now works properly. + +2006-04-21 Mark Guzman + + * autoload/rubycomplete.vim: renamed the vim global variable + controlling the addition of classes defined in the current buffer to + the global completion list + + * autoload/rubycomplete.vim: the global variable list is now sorted + and dups are removed + + * autoload/rubycomplete.vim: fixed a bug with rails support, where + rails standard methods would be added to a completion list when not + in a rails project + + * doc/ft-ruby-omni.txt: added information about the classes in global + completion option + +2006-04-21 Doug Kearns + + * doc/ft-ruby-omni.txt: add highlighting to example setting of + g:rubycomplete_rails variable + +2006-04-21 Mark Guzman + + * autoload/rubycomplete.vim: added support for adding classes defined + in the current buffer to the global completion list - when completing + with no text outside of a class definition + +2006-04-20 Doug Kearns + + * doc/ft-ruby-omni.txt: add new omni completion documentation + + * doc/ft-ruby-syntax.txt, syntax/doc/ruby.txt: move syntax + documentation to ft-ruby-syntax.txt + +2006-04-20 Mark Guzman + + * autoload/rubycomplete.vim: fixed a completion hang/crash when + completing symbols globally switched to smaller chunks being added to + the dictionary + + * autoload/rubycomplete.vim: it will now complete rails classes + + * autoload/rubycomplete.vim: removed left over debug prints + +2006-04-19 Mark Guzman + + * autoload/rubycomplete.vim: in-buffer class completion seems to work + properly in my test cases added range variable detection - contributed + +2006-04-19 Doug Kearns + + * ftdetect/ruby.vim: add RJS and RXML template file detection + +2006-04-19 Gavin Sinclair + + * CONTRIBUTORS, ftplugin/ruby.vim: update Gavin's email address + +2006-04-18 Mark Guzman + + * autoload/rubycomplete.vim: revised the in-buffer class loading, + needs a little more work but its testable + +2006-04-17 Doug Kearns + + * CONTRIBUTORS, indent/ruby.vim: update Nikolai's email address + +2006-04-16 Mark Guzman + + * autoload/rubycomplete.vim: added a work-around for the cWORD bug + found by dkearns; added support for completion of in-buffer classes; + switched return-type over to a dictionary + +2006-04-15 Doug Kearns + + * autoload/rubycomplete.vim: rename rbcomplete#Complete to match + script file name + + * autoload/rubycomplete.vim, compiler/rubyunit.vim, ftdetect/ruby.vim, + ftplugin/ruby.vim, indent/ruby.vim, syntax/ruby.vim, + compiler/eruby.vim, compiler/ruby.vim, ftplugin/eruby.vim, + indent/eruby.vim, syntax/eruby.vim: add Release-Coordinator header + line and remove GPL license + + * CONTRIBUTORS, bin/vim-ruby-install.rb: add Mark to the list of + maintainers; add rubycomplete.vim to the installer script's list of + files + +2006-04-14 Mark Guzman + + * autoload/rubycomplete.vim, ftplugin/ruby.vim: added ruby + omni-completion files; modified the ftplugin to set the omnifunc + +2005-10-14 Gavin Sinclair + + * indent/ruby.vim: Changed maintainer to Nikolai. + +2005-10-13 Doug Kearns + + * compiler/eruby.vim, compiler/rubyunit.vim, ftplugin/eruby.vim, + ftplugin/ruby.vim, indent/eruby.vim, indent/ruby.vim, + syntax/eruby.vim, syntax/ruby.vim: fix typo in URL header + + * ftdetect/ruby.vim: add filetype detection for Rantfiles + +2005-10-07 Doug Kearns + + * NEWS: updated for new release + + * syntax/doc/ruby.txt: update formatting for Vim 6.4 release + +2005-10-06 Doug Kearns + + * ftplugin/ruby.vim: prevent symbols from matching as matchit + match_words + +2005-10-05 Doug Kearns + + * NEWS: updated for new release + + * bin/vim-ruby-install.rb: raise an exception if there are unknown + args passed to the script + + * ftplugin/ruby.vim: add '.' to the head of 'path' so that files + relative to the directory of the current file are found first + +2005-10-04 Doug Kearns + + * syntax/ruby.vim: make the use of 'ruby_no_expensive' local to the + buffer for eruby files + + * compiler/eruby.vim, compiler/rubyunit.vim, compiler/ruby.vim, + ftdetect/ruby.vim, ftplugin/eruby.vim, ftplugin/ruby.vim, + indent/eruby.vim, indent/ruby.vim, syntax/eruby.vim, syntax/ruby.vim: + replace spaces with tabs, where possible, to reduce file sizes as + requested by BM + +2005-09-30 Doug Kearns + + * ftplugin/ruby.vim: place Gems after the standard $LOAD_PATH in + 'path' + +2005-09-27 Doug Kearns + + * ftplugin/ruby.vim: replace a single '.' with ',,' in all locations + in 'path' + +2005-09-26 Doug Kearns + + * ftplugin/ruby.vim: use print instead of puts to generate s:rubypath + +2005-09-25 Doug Kearns + + * syntax/ruby.vim: allow comments to be highlighted directly after + module/class/method definitions without intervening whitespace + +2005-09-24 Doug Kearns + + * syntax/ruby.vim: allow regexp's as hash values and after a ';' + + * NEWS: updated for new release + + * syntax/ruby.vim: fix typo in rubyControl highlight group name + + * bin/vim-ruby-install.rb: add --backup option and include short + options for it and --windows; make sure the backup directory is + written to CWD + +2005-09-22 Doug Kearns + + * compiler/rubyunit.vim: improve compiler message output and behaviour + to match that of the GUI test runners + + * syntax/ruby: allow while/until modifiers after methods with names + ending in [!=?]; assume (for now) that while/until expressions used as + args will be specified with parentheses + +2005-09-21 Doug Kearns + + * bin/vim-ruby-install.rb, indent/eruby.vim: add a new indent file for + eRuby; just use the html indent file for now + + * compiler/eruby.vim: use the ruby compiler plugin 'efm' and add a + eruby_compiler config variable to allow for using eruby as the + 'makeprg' rather than the default erb + +2005-09-20 Doug Kearns + + * syntax/ruby.vim: match and highlight exit! as a 'special' method + +2005-09-18 Nikolai Weibull + + * indent/ruby.vim: Fix bug #2481 + +2005-09-18 Nikolai Weibull + + * indent/ruby.vim: Fix for #2473 + +2005-09-18 Doug Kearns + + * bin/vim-ruby-install.rb: make sure that the latest vim-ruby, rather + than vim-ruby-devel, gem is being used + +2005-09-16 Doug Kearns + + * ftdetect/ruby.vim: use 'set filetype' rather than 'setfiletype' to + override any previously set filetype + +2005-09-15 Doug Kearns + + * syntax/ruby.vim: add $LOADED_FEATURES and $PROGRAM_NAME to + rubyPredefinedVariable + + * NEWS: correct release number + + * INSTALL: add a precautionary note about backing up files prior to + using the installer + +2005-09-14 Doug Kearns + + * Rakefile: add INSTALL and NEWS files to FileList + + * INSTALL, NEWS: add INSTALL and NEWS files + +2005-09-13 Doug Kearns + + * syntax/eruby.vim: make sure escaped eRuby tags aren't highlighted as + block delimiters with a trailing '%' + +2005-09-11 Doug Kearns + + * CONTRIBUTORS: update pcp's email address + + * indent/ruby.vim: reinsert license in header + + * ftplugin/ruby.vim: include gems load path in 'path' option + + * indent/ruby.vim: ignore the rescue 'modifier' when indenting (#2296) + + * indent/ruby.vim: fix comment typo + +2005-09-10 Nikolai Weibull + + * indent/ruby.vim: Fixes bugs introduced in earlier commits. Been + running without fault for two-three weeks now. It's about as good as + it gets without a major reworking. Enjoy! + +2005-09-10 Doug Kearns + + * Rakefile: use GMT time in the version string + + * compiler/rubyunit.vim: save each message from error backtraces + + * README, etc/website/index.html: update the package naming + description + + * Rakefile: set the package task's need_zip attribute so that zip + package archives are also created + + * ftplugin/ruby.vim: remove 'multiline' patterns from b:match_words + +2005-09-09 Doug Kearns + + * syntax/ruby: allow if/unless/while/until expressions to be + highlighted when used as method args following a ',' + +2005-09-08 Doug Kearns + + * syntax/ruby.vim: allow while/until expressions to be highlighted + + * bin/vim-ruby-install.rb: rescue Win32::Registry::Error when + accessing the Windows registry + + * ChangeLog, Rakefile, compiler/eruby.vim, compiler/rubyunit.vim, + compiler/ruby.vim, ftplugin/eruby.vim, indent/ruby.vim, + syntax/eruby.vim, syntax/ruby.vim: normalise vim modelines + + * etc/release/release.sh: add -z to cvsrelease call to create a zip + release file as well as a tar.gz + + * Rakefile: add CONTRIBUTORS file to FileList + + * ftplugin/ruby.vim: escape \'s in b:match_skip pattern + + * Rakefile: update filetype/ to ftdetect/ in FileList + +2005-09-07 Doug Kearns + + * ftplugin/ruby.vim: improve b:match_words pattern + +2005-09-06 Doug Kearns + + * syntax/ruby.vim: move hyphen to end of collection in rubyNoDoBlock + pattern + +2005-09-03 Doug Kearns + + * syntax/ruby.vim: allow if/unless expressions after the %, ^, | and & + operators + +2005-09-02 Doug Kearns + + * bin/vim-ruby-install.rb: add ftplugin/eruby.vim to list of source + files + + * ftplugin/eruby.vim: add new eRuby ftplugin + + * ftplugin/ruby.vim: merge most features from Ned Konz's ftplugin + + * compiler/eruby.vim: match eruby specific error messages and parse + the error's column number when provided + +2005-09-01 Doug Kearns + + * bin/vim-ruby-install.rb, compiler/eruby.vim: add new eruby compiler + plugin + + * syntax/eruby.vim, syntax/ruby.vim: split erubyBlock into erubyBlock + and erubyExpression; allow expressions inside blocks; set + ruby_no_expensive if highlighting eRuby; add spell checking and + rubyTodo to erubyComment + + * syntax/eruby.vim: make sure that eRubyOneLiner starts at the + very beginning of a line + + * syntax/eruby.vim: make sure that eRubyOneLiner cannot be extended + over multiple lines + +2005-08-30 Doug Kearns + + * syntax/ruby.vim: remove rubyIterator HiLink command line + +2005-08-27 Doug Kearns + + * bin/vim-ruby-install.rb: add Env.determine_home_dir using + %HOMEDRIVE%%HOMEPATH% as HOME on Windows if HOME is not explicitly set + + * syntax/ruby.vim: fix regression in rubyOptDoBlock + + * syntax/ruby.vim: fix typo in rubyBlockParameter pattern + +2005-08-26 Nikolai Weibull + + * indent/ruby.vim: Updated to indent correctly. There's more to be + done, as a statement may be contained in other stuff than a '... = ', + so that '=' should be [=+-...]. Soon to be fixed. + +2005-08-26 Doug Kearns + + * syntax/ruby.vim: only match rubyBlockParameter after 'do' that is a + 'keyword' + +2005-08-25 Doug Kearns + + * syntax/ruby.vim: rename rubyIterator to rubyBlockParameter; ensure + it only highlights these after a 'do' or '{'; match parameters in + parentheses + + * syntax/doc/ruby.txt: minor reorganisation of options + + * bin/vim-ruby-install.rb: don't use $0 == __FILE__ idiom to start + installer file as this will fail when running as a gem as + vim-ruby-install.rb is loaded by the gem driver; make _same_contents + a private method; fix a bug in BackupDir.backup where it was writing + the backup to an incorrect location + +2005-08-24 Nikolai Weibull + + * indent/ruby.vim: + 1. resetting of cpoptions (wouldn't always be done, depending on if + GetRubyIndent was defined. + + 2. Bugs #166, #1914, #2296 should be fixed + + 3. Somewhat simpler processing of the contents of the file. + + Most of the work was removing complexity that was trying to be clever + about understanding the syntax/semantics of the file, while actually + making things slow and actually not matching correctly. + +2005-08-24 Doug Kearns + + * syntax/ruby.vim: remove 'contains=rubyString' from the + rubyInterpolation group until that is more comprehensively improved + +2005-08-18 Doug Kearns + + * syntax/ruby.vim: explicitly match block arguments so that &keyword + isn't highlighted as a 'keyword' prefixed with & + + * syntax/ruby.vim: improve highlighting of heredocs used as method + arguments + +2005-08-17 Doug Kearns + + * syntax/ruby.vim: improve highlighting of the optional 'do' in + looping constructs + + * syntax/ruby.vim: remove accidentally added 'keepend' from + rubyOptDoBlock + + * syntax/ruby.vim: merge 'while|until' start patterns of + rubyOptDoBlock syntax group + +2005-08-16 Doug Kearns + + * bin/vim-ruby-install.rb: wrap 'main' in a begin/end block + + * bin/vim-ruby-install.rb: add FIXME comment (Hugh Sasse) + + * README, bin/vim-ruby-install.rb, etc/website/index.html: offer + $VIM/vimfiles and $HOME/{.vim,vimfiles} rather than $VIMRUNTIME as the + two default installation directories + +2005-08-15 Doug Kearns + + * syntax/ruby.vim: remove character offset 'hs' from the + rubyOptDoBlock start match + + * syntax/ruby.vim: exclude leading whitespace from the rubyOptDoBlock + syntax group start patterns with \zs + +2005-08-11 Doug Kearns + + * CONTRIBUTORS, bin/vim-ruby-install.rb, syntax/eruby.vim: add syntax + highlighting for eRuby files + + * ftdetect/ruby.vim: reorder autocommands for eRuby setf line + +2005-08-08 Doug Kearns + + * bin/vim-ruby-install.rb: add ftdetect/ruby.vim to list of source + files + +2005-08-07 Doug Kearns + + * filetype/ruby.vim, ftdetect/ruby.vim: move ruby.vim from filetype/ + to ftdetect/ + + * filetype/filetype.vim, filetype/ruby.vim: move filetype.vim to + ruby.vim; add eRuby filetype detection + +2005-08-06 Doug Kearns + + * syntax/ruby.vim: match rubyConstant and rubyLocalVariableOrMethod + with a leading word boundary + + * syntax/ruby.vim: move ruby_no_identifiers test to the default + highlighting block so that all identifiers are still matched when this + is config variable set + + * syntax/ruby.vim: remove display argument from rubyConstant now that + the match is multiline + +2005-08-03 Doug Kearns + + * CONTRIBUTORS: add new file listing project contributors + +2005-08-02 Doug Kearns + + * syntax/ruby.vim: differentiate between constants and capitalized + class methods invoked with the scope operator '::' + +2005-08-01 Doug Kearns + + * syntax/ruby.vim: undo reordering of identifier matching and make $_ + a special case to prevent it matching against global variables with a + leading underscore + +2005-07-30 Doug Kearns + + * syntax/ruby.vim: reorder identifier matching so that identifiers + 'containing' predefined identifiers, such as $_, match properly + +2005-07-28 Doug Kearns + + * syntax/ruby.vim: improve matching of conditional expressions + +2005-07-27 Doug Kearns + + * Rakefile: add 'package' as the default target + +2005-07-26 Doug Kearns + + * syntax/ruby.vim: replace leading context 'lc' offsets with the + '\@<=' pattern construct when matching 'normal regular expressions' + (Aaron Son) + +2005-07-22 Doug Kearns + + * syntax/ruby.vim: allow strings inside interpolation regions + +2005-07-04 Doug Kearns + + * bin/vim-ruby-install.rb: improve source directory detection (Hugh + Sasse) + +2005-04-05 Doug Kearns + + * syntax/ruby.vim: match rubyNested*, and rubyDelimEscape as + transparent items; add closing escaped delimiters to rubyDelimEscape + syntax group + +2005-04-04 Doug Kearns + + * syntax/ruby.vim: highlight nested delimiters in generalized quotes + (Aaron Son, Bertram Scharpf and Ken Miller) + +2005-04-04 Doug Kearns + + * syntax/ruby.vim: minor improvement to block parameter highlighting + +2005-04-04 Doug Kearns + + * syntax/doc/ruby.txt: add documentation for the ruby_space_errors, + ruby_no_trail_space_error and ruby_no_tab_space_error configuration + variables + +2005-03-30 Doug Kearns + + * syntax/ruby.vim: add configurable highlighting of trailing space and + 'space before tab' errors (Tilman Sauerbeck) + +2005-03-24 Gavin Sinclair + + * syntax/ruby.vim: Improved hilighting of %{...} strings with + nested brackets (Ken Miller). + * indent/ruby.vim: Improved indenting of %{...} strings with + nested brackets (Ken Miller). + * syntax/ruby.vim: Corrected hilighting of |(x,y)| iterator + parameters (Tilman Sauerbeck). + +2004-11-27 Doug Kearns + + * compiler/ruby.vim, compiler/rubyunit.vim, syntax/ruby.vim: update + DJK's email address + +2004-09-30 Doug Kearns + + * syntax/ruby.vim: match regexp values in hash literals + +2004-09-20 Gavin Sinclair + + * bin/vim-ruby-install.rb: added + * Rakefile: 'rake package' generates TGZ and GEM + * install.rb: removed + * build.rb: removed + +2004-09-04 Doug Kearns + + * compiler/rubyunit.vim, compiler/ruby.vim: update to use new + CompilerSet command + +2004-05-19 Doug Kearns + + * compiler/rubyunit.vim: match assert messages + +2004-05-12 Doug Kearns + + * syntax/ruby.vim: check for the folding feature rather than just the + vim version when testing if the foldmethod should be set to syntax + +2004-05-11 Doug Kearns + + * compiler/rubyunit.vim: add initial support for parsing Test::Unit + errors + +2004-05-11 Doug Kearns + + * syntax/doc/ruby.txt: add documentation for the + ruby_no_special_methods and ruby_fold configuration variables + +2004-04-29 Doug Kearns + + * filetype/filetype.vim: move matching of [Rr]akefile* to a separate + section which is located later in the file to avoid incorrectly + matching other filetypes prefixed with [Rr]akefile + +2005-04-27 Doug Kearns + + * filetype/filetype.vim: match 'rakefile' as a Rakefile + +2004-04-23 Ward Wouts + + * syntax/ruby.vim: add ruby_fold variable to control the setting of + the foldmethod option + +2004-04-06 Doug Kearns + + * filetype/filetype.vim: add RubyGems specification and installation + files and Rakefiles + +2004-04-01 Doug Kearns + + * compiler/rubyunit.vim: add a new compiler plugin for Test::Unit + +2004-03-23 Doug Kearns + + * etc/website/index.html, etc/website/djk-theme.css: add simple CSS + style sheet + +2004-02-08 Doug Kearns + + * etc/website/index.html: convert to valid HTML 4.01 Strict. + +2004-01-11 Gavin Sinclair + + * ftplugin/ruby.vim: Added matchit instructions. + +2003-11-06 Doug Kearns + + * README: update DJK's current location. + +2003-11-06 Doug Kearns + + * syntax/ruby.vim: add support for the new decimal and octal base + indicators and capitalization of all base indicators. + +2003-10-20 Nikolai Weibull + + * indent/ruby.vim: Added support for ?: multilining, such as + a ? + b : + c. + +2003-10-18 Nikolai Weibull + + * indent/ruby.vim: Fixed a silly bug with the [] matching. + +2003-10-17 Gavin Sinclair + + * README: Minor addition. + * etc/website/index.html: Synced with README. + +2003-10-15 Nikolai Weibull + + * indent/ruby.vim: Fixed bug #114. Also fixed a related problem with + documentation blocks. They would indent relative to the other code. + Now it simply indents with zero width (to match =begin) by default. + Otherwise acts like 'autoindent'. Also fixed a problem with | and & + not being recognized as continuation lines. This may cause problems + with do blocks, we'll see. + * indent/ruby.vim: In response to previous note. It proved fatal. + Fixed now. + +2003-10-14 Nikolai Weibull + + * syntax/ruby.vim: Readded matching of $' and $" when + ruby_no_identifiers was off. Got accidentaly removed with previous + fix. + +2003-10-13 Nikolai Weibull + + * indent/ruby.vim: General cleanup, speedup, fixup. Fixes bug #62. + Indentiation of tk.rb (5200+ lines) takes under 13 seconds now. + * ftplugin/ruby.vim: Cleanup. Nested if's unnecessary. Also modified + modeline. + +2003-10-12 Nikolai Weibull + + * indent/ruby.vim: Fixed bugs #89 and #102. + * syntax/ruby.vim: The $' and $" variables weren't being matched if + ruby_no_identifiers was on. This messed up string matching. + * indent/ruby.vim: Basically did a total rewrite in the process. + Everything is well documented now, and should be rather simple to + understand. There is probably room for optimization still, but it + works rather fast, indenting tk.rb (5200+ lines) in under 15 seconds. + I'm betting searchpair() may be executing a bit too often still, but a + lot of special cases have now been taken care of. This version also + fixes bug #59 and #71. + +2003-10-03 Doug Kearns + + * syntax/ruby.vim: simplify the rubyData pattern by using the new EOF + atom. + +2003-10-03 Doug Kearns + + * syntax/ruby.vim: link rubyBoolean to rubyPseudoVariable; link + rubyPseudoVariable to the Constant highlight group. + +2003-09-30 Doug Kearns + + * syntax/ruby.vim: create rubyPseudoVariable syntax group; move self, + nil, __LINE__ and __FILE_ to rubyPseudoVariable. + +2003-09-30 Doug Kearns + + * etc/website/index.html: update DJK's current location. + +2003-09-26 Doug Kearns + + * etc/website/index.html: close the open PRE element and add a DOCTYPE + declaration. + +2003-09-26 Doug Kearns + + * indent/ruby.vim: update references to rubyExprSubst - this syntax + group has been split into rubyInterpolation, rubyNoInterpolation and + rubyEscape. + +2003-09-26 Gavin Sinclair + + * etc/release/*: added to aid in the production of releases. + * etc/website/*: now anyone can have a crack at the + vim.ruby.rubyforge.org website! + +2003-09-25 Doug Kearns + + * syntax/ruby.vim: link the rubyNoInterpolation syntax group to + rubyString; merge rubyHexadecimal, rubyDecimal, rubyOctal, rubyBinary + into rubyInteger. + +2003-09-22 Doug Kearns + + * syntax/ruby.vim: link the rubyOperator syntax group to the Operator + highlight group. + +2003-09-21 Doug Kearns + + * syntax/ruby.vim: match regexps after split, scan, sub and gsub. + +2003-09-21 Doug Kearns + + * syntax/ruby.vim: highlight escaped string interpolation correctly; + allow hexadecimal and octal escape sequences to match with less than 3 + and 2 digits respectively; split rubyExprSubst into multiple syntax + groups - rubyInterpolation, rubyNoInterpolation, rubyEscape. + +2003-09-19 Doug Kearns + + * syntax/ruby.vim: match singleton class definitions with no + whitespace between 'class' and '<<'. + +2003-09-19 Doug Kearns + + * install.rb, syntax/doc/ruby.txt: fix minor typos. + +2003-09-18 Doug Kearns + + * syntax/ruby.vim: improve float and decimal matching; split + rubyInteger into multiple syntax groups - rubyASCIICode, + rubyHexadecimal, rubyDecimal, rubyOctal, rubyBinary. + +2003-09-18 Doug Kearns + + * syntax/ruby.vim: replace all patterns surrounded by \(\) with \%(\) + when the sub-expression is not used. + +2003-09-18 Gavin Sinclair + + * install.rb: Included comments and USAGE string from revisino 1.1. + +2003-09-18 Doug Kearns + + * syntax/ruby.vim: match regexp after 'not' and 'then'; match if and + unless expressions following '=' and '('. + +2003-09-17 Gavin Sinclair + + * ftplugin/ruby.vim: implemented matchit support (thanks to Ned Konz + and Hugh Sasse). + +2003-09-17 Gavin Sinclair + + * install.rb: replaced with Hugh Sasse's contribution. Alpha state + until tested, and with several issues and todos listed. + +2003-09-11 Doug Kearns + + * syntax/ruby.vim: fix my accidental redefinition of the + ruby_no_expensive matchgroups. + +2003-09-11 Doug Kearns + + * syntax/ruby.vim: improve support for symbols, integers and floating + point numbers; add the display argument to :syntax where appropriate. + +2003-09-09 Doug Kearns + + * syntax/ruby.vim: remove Vim 5.x specific sections and simplify the + generalized string, regular expression, symbol, and word list literal + syntax groups. + +2003-09-09 Doug Kearns + + * indent/ruby.vim, syntax/ruby.vim: rename the rubyStringDelimit + syntax group rubyStringDelimiter. + +2003-09-09 Doug Kearns + + * syntax/ruby.vim: highlight one line module, class, and method + definitions, using the ';' terminator, correctly; split + rubyClassOrModule into two new syntax groups - rubyClass and + rubyModule. + +2003-09-08 Doug Kearns + + * syntax/ruby.vim: add the @Spell cluster to support spell checking + of comment text. + +2003-09-08 Doug Kearns + + * syntax/ruby.vim: add support for the new %s() symbol literal. + +2003-09-03 Doug Kearns + + * compiler/ruby.vim: update the maintainer's email address. + +2003-09-02 Doug Kearns + + * syntax/ruby.vim: make sure that the optional do after for, until or + while is not matched as the beginning of a do/end code block; also + highlight the optional ':' for these loop constructs. + +2003-08-28 Doug Kearns + + * syntax/ruby.vim: add folding support to embedded data sections after + an __END__ directive. + +2003-08-27 Doug Kearns + + * syntax/ruby.vim: don't allow '<<' after '.' or '::' to match as the + beginning of a heredoc. + +2003-08-26 Doug Kearns + + * syntax/ruby.vim: fix shebang highlighting which was being ignored + all together. + +2003-08-25 Doug Kearns + + * syntax/ruby.vim: add the new %W() word list literal with + interpolation; add folding to %q() single quoted strings and %w() word + list literals. + +2003-08-24 Doug Kearns + + * syntax/ruby.vim: add $deferr to rubyPredefinedVariable; add several + new methods (abort, at_exit, attr, attr_accessor, attr_reader, + attr_writer, autoload, callcc, caller, exit, extend, fork, eval, + class_eval, instance_eval, module_eval, private, protected, public, + trap) to the Special Methods section. + +2003-08-21 Doug Kearns + + * syntax/ruby.vim: add access control methods (public, protected and + private) to a new rubyAccess syntax group. + +2003-08-21 Doug Kearns + + * syntax/ruby.vim: no longer match NotImplementError as a predefined + global constant; move rubyTodo to the Comments and Documentation + section; create a Special Methods section and add the + ruby_no_special_methods variable to allow the highlighting of these + 'special' methods to be disabled. + +2003-08-18 Doug Kearns + + * compiler/ruby.vim, ftplugin/ruby.vim, indent/ruby.vim, + syntax/ruby.vim: retab the header section - Bram prefers as many TAB + characters as possible. + +2003-08-18 Doug Kearns + + * syntax/ruby.vim: allow for, while and until loop bodies to contain + do...end and {...} blocks - rubyOptDoBlock should contain rubyDoBlock + and rubyCurlyBlock. + +2003-08-16 Doug Kearns + + * syntax/ruby.vim: string expression substitution of class variables + does not require braces. + diff --git a/sources_non_forked/vim-ruby/FAQ b/sources_non_forked/vim-ruby/FAQ new file mode 100644 index 00000000..2776d614 --- /dev/null +++ b/sources_non_forked/vim-ruby/FAQ @@ -0,0 +1,251 @@ +*vim-ruby.txt* *vim-ruby* *vim-ruby-faq* + + VIM/RUBY CONFIGURATION FILES + + The vim-ruby Project FAQ + + https://github.com/vim-ruby/vim-ruby + +The vim-ruby project maintains Ruby-related configuration files for Vim. This +FAQ contains all you need to know about it. + +*** TOC *** + +============================================================================== + +*vim-ruby-faq-X* What is the vim-ruby project? + +It maintains all the configuration files that help Vim edit Ruby code. By +installing these files, Vim will properly highlight and indent Ruby files, and +will be able to run them and go directly to the location of any errors. +Rakefiles, ERB files, and unit tests are also identified and supported. + +If you make use of this project, make sure you read the installation and +configuration instructions in this FAQ. + + +*vim-ruby-faq-X* Doesn't Vim include these files? + +Yes it does. You should only want to download and install this project if it +has changed since you last installed your version of Vim. Read the "News" +section of the |vim-ruby-homepage| to see when the most recent release was +made. + + +*vim-ruby-faq-X* How do you get it? + +The easiest way is to run: > + + gem install vim-ruby + +(This really only downloads it. See installation instructions +|vim-ruby-install| below.) + +If you don't have RubyGems, download a tarball from: > + + https://github.com/vim-ruby/vim-ruby/downloads + +Again, see installation instructions below. + + +*vim-ruby-faq-X* How do you install it? *vim-ruby-install* + +If you obtained the vim-ruby files via RubyGems, run: > + + vim-ruby-install.rb + +If you downloaded a tarball, unpack it, change to the created directory, and +run: > + + ruby bin/vim-ruby-install.rb + +Whichever way you run it, the effect is the same. The installer will: + - Search for a Vim config directory to put its files and ask you to confirm. + - Copy the configuration files to the appropriate places underneath the + directory you selected. + +Here is an example installation transcript: + + Possible Vim installation directories: ~ + 1) D:/Gavin/vimfiles ~ + 2) E:/Vim/vimfiles ~ + ~ + Please select one (or anything else to specify another directory): 2 ~ + autoload/rubycomplete.vim -> E:/Vim/vimfiles/autoload/rubycomplete.vim ~ + compiler/eruby.vim -> E:/Vim/vimfiles/compiler/eruby.vim ~ + compiler/ruby.vim -> E:/Vim/vimfiles/compiler/ruby.vim ~ + compiler/rubyunit.vim -> E:/Vim/vimfiles/compiler/rubyunit.vim ~ + ftdetect/ruby.vim -> E:/Vim/vimfiles/ftdetect/ruby.vim ~ + ftplugin/eruby.vim -> E:/Vim/vimfiles/ftplugin/eruby.vim ~ + ftplugin/ruby.vim -> E:/Vim/vimfiles/ftplugin/ruby.vim ~ + indent/eruby.vim -> E:/Vim/vimfiles/indent/eruby.vim ~ + indent/ruby.vim -> E:/Vim/vimfiles/indent/ruby.vim ~ + syntax/eruby.vim -> E:/Vim/vimfiles/syntax/eruby.vim ~ + syntax/ruby.vim -> E:/Vim/vimfiles/syntax/ruby.vim ~ + +Existing files are overwritten. This is safe, because it's a slow-maturing +project, so new files are better than old ones. However, if you had edited the +files, you will have lost your changes. Better make your changes in, for +instance: + + ~/.vim/after/ftplugin/ruby.vim ~ + +This file will be loaded _after_ the regular config files are loaded, so your +customisations will definitely take effect. + + +*vim-ruby-faq-X* What Vim config do I need? *vim-ruby-config* + +Without the following lines in your .vimrc, _vimrc, or other startup file, the +files in the vim-ruby project will be largely useless. > + + set nocompatible " We're running Vim, not Vi! + syntax on " Enable syntax highlighting + filetype on " Enable filetype detection + filetype indent on " Enable filetype-specific indenting + filetype plugin on " Enable filetype-specific plugins + compiler ruby " Enable compiler support for ruby + +See |.vimrc| for more information about this important Vim configuration file. + +See |matchit-install| for instructions on installing "matchit", which will +allow you to use |%| to bounce between Ruby keywords (class, def, while, ...) +and their respective "end" keywords. + + +*vim-ruby-faq-X* How do I know that everything's working? + +If you've run the installer and added the configuration |vim-ruby-config| +above, everything should be fine when you restart Vim. To test this: + - Edit a Ruby file with Vim (make sure it has a .rb extension). + - The code should be syntax highlighted. + - Type in some code. When you start a new line, it should be automatically + indented to the correct spot. + - Add or remove some space from the beginning of a line of code and hit ==. + That line should be reindented. + - Put the cursor on a "class" or "def" keyword and hit %. The cursor should + now be on the matching "end" keyword. + - TODO: what else? + + +*vim-ruby-faq-X* How do I use it? + +TODO: write. + + +*vim-ruby-faq-X* How do I customise it? *vim-ruby-customize* + +The most important customisation for editing Ruby code is the amount of space to +indent. The following is a typical setup. Look up the various options to read +about them. > + + set expandtab + set tabstop=2 shiftwidth=2 softtabstop=2 + set autoindent + +TODO: is autoindent necessary? What other options should go here? What about +Ruby comments? +FIXME: Autoindent is good. maybe mention |i_CTRL_D| and |i_CTRL_T| for +moving lines about in this context? +COMMENT: I never use ^D and ^T in insert mode, though I always knew what they +do. Might try them! + + +*vim-ruby-faq-X* I want feature X. Will you include it? + +The idea of the vim-ruby project is to maintain configuration files that are +actually distributed with Vim. Therefore all functionality should be helpful to +all Vim/Ruby users. So the project does not deal with people's individual +tastes. + +That said, we are considering creating a separate configuration file for less +universal features, whose features users can pick and choose. So don't hesitate +to send us your suggestions. + + +*vim-ruby-faq-X* What are some other cool Ruby-related Vim tricks I can use? + +An example is the following (put it in ~/.vimrc/ftplugin/ruby_extra.vim or +similar): [similar? |$VIMRUNTIME| or what?] > + + if !exists( "*EndToken" ) + function EndToken() + let current_line = getline( '.' ) + let braces_at_end = '{\s*\(|\(,\|\s\|\w\)*|\s*\)\?$' + if match( current_line, braces_at_end ) >= 0 + return '}' + else + return 'end' + endif + endfunction + endif + + imap :execute 'normal o' . EndToken()O + +This will help you create ruby blocks of code, by inserting "}" or "end" as +appropriate. Try creating these lines of code and hitting SHIFT-ENTER: + + array.map { |elem| ~ + + def fibonacci(n) ~ + +For other suggestions, search the web or look at: > + + https://github.com/vim-ruby/vim-ruby/wiki/VimRubySupport + + +*vim-ruby-faq-X* How can I report a bug? *vim-ruby-bug-reporting* + +Bug reports are most welcome. In order of preference: + - submit a bug at https://github.com/vim-ruby/vim-ruby/issues + - send an email to the mailing list (see below) + - email the maintainer (email address appears in each configuration file) + + + *vim-ruby-list* +*vim-ruby-faq-X* Does the project have a mailing list? + +Yes: vim-ruby-devel@rubyforge.org. Only subscribers can post. To join, visit: +> + http://rubyforge.org/mailman/listinfo/vim-ruby-devel + +The list is mirrored at: > + + http://news.gmane.org/gmane.comp.editors.vim.vim%2druby.devel + + +*vim-ruby-faq-X* Why is this project separate from Vim? + +We can't use Vim's CVS to keep track of these files, so we organise it ourselves +and give Bram the latest files in time for each release of Vim. By keeping the +Ruby stuff together, we can release it all at once and people can update it +independently of Vim. + + +*vim-ruby-faq-X* I have another question... + +The mailing list or the file maintainer is a good place to ask. Or perhaps +comp.lang.ruby, but please make sure you've read the FAQ thoroughly before +asking there. + + +*vim-ruby-faq-X* Can you repeat all the web pages listed in this FAQ? + +Homepage *vim-ruby-homepage* : > + https://github.com/vim-ruby/vim-ruby/ + +Bug tracker: > + https://github.com/vim-ruby/vim-ruby/issues + +Relevant Wiki page: > + https://github.com/vim-ruby/vim-ruby/wiki + +Mailing list archives: > + http://news.gmane.org/gmane.comp.editors.vim.vim%2druby.devel + http://rubyforge.org/pipermail/vim-ruby-devel/ + +Mailing list join: > + http://rubyforge.org/mailman/listinfo/vim-ruby-devel + + +vim: ft=help tw=78 noet : diff --git a/sources_non_forked/vim-ruby/Gemfile b/sources_non_forked/vim-ruby/Gemfile new file mode 100644 index 00000000..c543a5dd --- /dev/null +++ b/sources_non_forked/vim-ruby/Gemfile @@ -0,0 +1,4 @@ +source 'http://rubygems.org' + +gem 'rspec' +gem 'vimrunner' diff --git a/sources_non_forked/vim-ruby/Gemfile.lock b/sources_non_forked/vim-ruby/Gemfile.lock new file mode 100644 index 00000000..66a9ec64 --- /dev/null +++ b/sources_non_forked/vim-ruby/Gemfile.lock @@ -0,0 +1,20 @@ +GEM + remote: http://rubygems.org/ + specs: + diff-lcs (1.1.3) + rspec (2.11.0) + rspec-core (~> 2.11.0) + rspec-expectations (~> 2.11.0) + rspec-mocks (~> 2.11.0) + rspec-core (2.11.1) + rspec-expectations (2.11.2) + diff-lcs (~> 1.1.3) + rspec-mocks (2.11.2) + vimrunner (0.1.1) + +PLATFORMS + ruby + +DEPENDENCIES + rspec + vimrunner diff --git a/sources_non_forked/vim-ruby/INSTALL.markdown b/sources_non_forked/vim-ruby/INSTALL.markdown new file mode 100644 index 00000000..29ba3fb1 --- /dev/null +++ b/sources_non_forked/vim-ruby/INSTALL.markdown @@ -0,0 +1,36 @@ +Installation +============ + +In general, your favorite method works. Here are some options. + +With pathogen.vim +----------------- + +Install [pathogen.vim](https://github.com/tpope/vim-pathogen), +then copy and paste: + + git clone git://github.com/vim-ruby/vim-ruby.git ~/.vim/bundle/vim-ruby + +With Vundle +----------- + +Install [Vundle](https://github.com/gmarik/vundle), then add the +following to your vimrc: + + Bundle 'vim-ruby/vim-ruby' + +With patience +------------- + +Wait for an upgrade to Vim and install it. Vim ships with the latest +version of vim-ruby at the time of its release. (Remember this when +choosing another installation method. The version you download will +supersede the version that ships with Vim, so you will now be +responsible for keeping it up-to-date.) + +Manually +-------- + +[Download](https://github.com/vim-ruby/vim-ruby/archives/master) and +extract an archive, and run `bin/vim-ruby-install.rb` to copy the +relevant files to `~/.vim`. diff --git a/sources_non_forked/vim-ruby/NEWS b/sources_non_forked/vim-ruby/NEWS new file mode 100644 index 00000000..388dffe7 --- /dev/null +++ b/sources_non_forked/vim-ruby/NEWS @@ -0,0 +1,243 @@ +This file is no longer maintained. Consult the Git log for newer changes. + += 2008.07.XX + +== Filetype Detection + +The IRB RC file (.irbrc) is now detected as being a Ruby file. + + += 2007.05.07 + +== Ruby Syntax Highlighting + +Highlight OPTIMIZE alongside FIXME and TODO. + +Multiline array literals can now be folded. + +== Ruby Filetype Support + +Added mappings for [[, ]], [], ][, [m, ]m, [M, and ]M. The first four bounce +between class and module declarations, and the last four between method +declarations. + +== eRuby Syntax Highlighting + +Tim Pope has taken over maintenance of the eRuby syntax file. The subtype of +the file is now determined dynamically from the filename, rather than being +hardwired to HTML. It can be overridden with b:eruby_subtype. + +== eRuby Filetype Support + +Tim Pope has taken over maintenance of the eRuby filetype plugin. Like with +the syntax file, the subtype is now determined dynamically. + +== eRuby Indenting + +As with the syntax file and filetype plugin, the subtype is now determined +dynamically. + +== Bug Fixes + +Ruby syntax file + - when ruby_operators is set, highlight scope and range operators, and don't + match '>' in =>' + - regexp literals are highlighted after the 'else' keyword + - don't match [!=?] as part of a sigil prefixed symbol name + - allow text to appear after, and on the same line, as '=begin' in + rubyDocumentation regions + - highlight %s() ans a symbol, not a string + - eliminated some false positves for here docs, symbols, ASCII codes, and + conditionals as statement modifiers + - added "neus" to regexp flags + - Highlight punctuation variables in string interpolation, and flag invalid + ones as errors + - removed : from rubyOptionalDoLine (falsely matches on symbols) + +Ruby filetype plugin + - eliminated some false positives with the matchit patterns + +Ruby indent plugin + - ignore instance, class, and global variables named "end" + + += 2007.03.02 + +== Omni Completion + +Fall back to syntax highlighting completion if Vim lacks the Ruby interface. + +RubyGems is now loaded by default if available. + +Classes are detected using ObjectSpace. Kernel methods are included in method +completion. + +Added completion in Rails views. Rails helpers are included. Rails migrations +now have completion. + +== Ruby Syntax Highlighting + +Ruby code is highlighted inside interpolation regions. + +Symbols are now highlighted with the Constant highlight group; Constants and +class names with the Type highlight group. + +Symbol names specified with a string recognise interpolation and escape +sequences. + +Alias statements receive special highlighting similar to other 'definitions'. + +== Ruby Filetype Support + +Matchit support has been improved to include (), {}, and [] in the list of +patterns so that these will be appropriately skipped when included in comments. + +ri has been added as the 'keywordprg' and 'balloonexpr' is set to return the +output of ri. + +== eRuby Indenting + +Tim Pope has taken over maintenance of the eRuby indent file. Ruby code is now +indented appropriately. + +== Bug Fixes + +Ruby syntax file + - trailing whitespace is no longer included with the def, class, module + keywords. + - escaped interpolation regions should now be ignored in all cases. + - conditional and loop statements are now highlighted correctly in more + locations (where they're used as expressions). + +eRuby syntax file + - '-' trim mode block delimiters are now recognised. + +Omni Completion + - more robustness; failure to parse buffer no longer errors or prevents + completion. + + += 2006.07.11 + +== Omni Completion + +A new omni completion function is now included which offers IntelliSense-like +functionality. See :help ft-ruby-omni for further information. + +Note: This will only work with Vim 7.x, compiled with the Ruby interface +(+ruby), and Ruby 1.8.x + +== Ruby Filetype Support + +Matchit support has been improved to include (), {}, and [] in the list of +patterns meaning these will be appropriately skipped when included in comments. + +== Ruby Syntax Highlighting + +Operators can now be highlighted by defining the Vim global variable +"ruby_operators". + +Multiline comments will now be folded. This can be disabled by defining the +"ruby_no_comment_fold" Vim variable. + +== Filetype Detection + +RJS and RXML templates are now detected as being 'filetype=ruby'. + +== FAQ + +There is a new FAQ document included. This is a work in progress and any +feedback would be appreciated. + +== Bug Fixes + +Ruby syntax file - if/unless modifiers after a method name ending with [?!=] +should now be highlighted correctly. + + += 2005.10.07 + +== Vim 6.4 + +This release is included in Vim 6.4. + +== Bug Fixes + +Ruby filetype plugin - symbols were incorrectly being matched as match_words +causing the matchit motion command to jump to an incorrect location in some +circumstances. + + += 2005.10.05 + +== Bug Fixes + +Ruby syntax file - allow for comments directly after module/class/def lines +without intervening whitespace (fold markers were breaking syntax highlighting). + +Ruby filetype plugin - improve ordering of 'path' elements. + +eRuby syntax file - make use of ruby_no_expensive local to the buffer. + + += 2005.09.24 + +== Filetype Detection + +The eruby filetype is now detected solely based on the file's extension. This +was being overridden by the scripts.vim detection script. + +Note: Only files ending in *.rhtml are detected as filetype eruby since these +are currently assumed to be Ruby embedded in (X)HTML only. Other filetypes +could be supported if requested. + +== eRuby Indent File + +There is a new eRuby indent file which simply sources the HTML indent file for +now. + +== eRuby Compiler Plugin + +This now supports erb as the default 'makeprg'. To use eruby set the +eruby_compiler variable to "eruby" in your .vimrc + +== Test::Unit Compiler Plugin + +This has been improved and should now display messages similar to, though more +detailed than, the GUI test runners. + +== Bug Fixes + +A few minor bugs have been fixed in the Ruby syntax and indent files. + + += 2005.09.15 + +== eRuby Support + +There are new syntax, compiler, and ftplugin files for eRuby. This support is +incomplete and we're keen to hear of any problems or suggestions you may have +to improve it. + +== Ruby Filetype Support + +The Ruby filetype plugin has been improved to include as many useful settings +as possible without intruding too much on an individual user's preferences. +Matchit support has been improved, and the following options are now set to +appropriate values: comments, commentstring, formatoptions, include, +includeexpr, path, and suffixesadd + +== Filetype Detection + +The new ftdetect mechanism of Vim 6.3 is being utilized to enable filetype +detection of eRuby files until this is officially added to the next release of +Vim. + +== Installation Directories + +The installer script now, where possible, automatically determines both the +user and system-wide preferences directory. + +== Bug Fixes + +A large number of bugs have been fixed in the Ruby syntax and indent files. diff --git a/sources_non_forked/vim-ruby/README b/sources_non_forked/vim-ruby/README new file mode 100644 index 00000000..6f1bb2e1 --- /dev/null +++ b/sources_non_forked/vim-ruby/README @@ -0,0 +1,74 @@ + +---------------------------------+ + | vim-ruby github project README | + +---------------------------------+ + +Summary: + This project contains Vim configuration files for editing and compiling Ruby + within Vim. See the project homepage for more details. + +Web links: + Homepage: https://github.com/vim-ruby + Explanation: https://github.com/vim-ruby/vim-ruby/wiki + +For regular users: + - The project page should have two tarballs for download: + - vim-ruby-YYYY.MM.DD.tar.gz (the current stable release) + - vim-ruby-devel-YYYY.MM.DD.tar.gz (cutting-edge features we'd like you + to test) + - Please give feedback through the bug tracking and feature request features + of github. + - Feel free to join discussions on the vim-ruby-devel mailing list: + http://rubyforge.org/mail/?group_id=16 + +For would-be contributors: + - Please get the latest from Git. + - Please join the mailing list and discuss changes, submit patches, etc. + - Thank you very much for taking an interest. + +Contents of the project: + - The autoload, compiler, ftdetect, ftplugin, indent and syntax directories + contain the ruby*.vim files that are to be copied to a location somewhere + in the Vim 'runtimepath'. + - vim-ruby-install.rb performs this copying. + +How you get these files into Vim: + - By downloading the project via a snapshot or Git, you can keep up with + the latest, make changes, and install the files to a Vim directory. + - By downloading one of the tarballs, you can easily install the latest + stable or development version wherever you like on your machine. No + README, no vim-ruby-install.rb, just Vim files. You would typically + install these into either $VIM/vimfiles, for system-wide use, or $HOME/.vim + ($HOME/vimfiles on Windows) for personal use. + - Remember that when you install Vim in the first place, all of these files + are present. The purpose of downloading and installing them from + github is to get the latest version of them. + +Git topics: + - Project was migrated from CVS in August, 2008. + - Files are tagged according to which version of Vim they are released in. + - The project was initiated in July 2003, when the current version of Vim + was 6.2. Thus every file began its life tagged as vim6.2. + - Modifications to the files are made in the expectation that they need to + be tested by interested users. They therefore (probably) don't have a + tag, and are available via "git pull --rebase", or a development snapshot. + - When a modification is considered stable, it is given a tag. + Everything that is stable gets released in vim-ruby-YYY.MM.DD.tar.gz files. + - When a new version of Vim is about to be released, the stable tarball is + contributed to it. After it has been released, the files are tagged + accordingly. + - MORAL OF THE STORY: modifications are committed to the head of the tree; + when they are ready for release into userland, they are tagged "stable". + +Any questions or suggestions? + - If there's something about the project or its concepts that you don't + understand, send an email to the release coordinator, Doug Kearns + (dougkearns at gmail.com). + - To ask about the contents of the configuration files, open a GitHub issue + or ask on the mailing list, as different people maintain the different + files. + +Project gossip: + - While the individual effort to maintain these files has a long history, + this actual project began in late July 2003. + + --= End of Document =-- diff --git a/sources_non_forked/vim-ruby/Rakefile b/sources_non_forked/vim-ruby/Rakefile new file mode 100644 index 00000000..37c6d573 --- /dev/null +++ b/sources_non_forked/vim-ruby/Rakefile @@ -0,0 +1,42 @@ +require 'rubygems' +require 'rake/gempackagetask' + +PACKAGE_NAME = 'vim-ruby' +RELEASE_FILES = FileList[ + 'ChangeLog', 'CONTRIBUTORS', 'FAQ', 'INSTALL', 'NEWS', 'README', 'bin/*.rb', + 'doc/*.txt','{autoload,compiler,ftdetect,ftplugin,indent,syntax}/*.vim' +] +PACKAGE_VERSION = Time.now.gmtime.strftime('%Y.%m.%d') + +desc "Build all the packages" +task :default => :package + + +def gemspec + Gem::Specification.new do |s| + s.name = PACKAGE_NAME + s.version = PACKAGE_VERSION + s.files = RELEASE_FILES.to_a + s.summary = "Ruby configuration files for Vim. Run 'vim-ruby-install.rb' to complete installation." + s.description = s.summary + "\n\nThis package doesn't contain a Ruby library." + s.requirements << 'RubyGems 0.8+' << 'Vim 6.0+' + s.required_ruby_version = '>= 1.8.0' + s.require_path = '.' + s.bindir = 'bin' + s.executables = ['vim-ruby-install.rb'] + s.author = 'Gavin Sinclair et al.' + s.email = 'gsinclair@soyabean.com.au' + s.homepage = 'https://github.com/vim-ruby/vim-ruby' + s.has_rdoc = false + end +end + +Rake::GemPackageTask.new(gemspec) do |t| + t.package_dir = 'etc/package' + t.need_tar = true + t.need_zip = true +end + +# Supporting methods + +# vim: nowrap sw=2 sts=2 ts=8 ff=unix ft=ruby: diff --git a/sources_non_forked/vim-ruby/autoload/rubycomplete.vim b/sources_non_forked/vim-ruby/autoload/rubycomplete.vim new file mode 100644 index 00000000..e1064c8a --- /dev/null +++ b/sources_non_forked/vim-ruby/autoload/rubycomplete.vim @@ -0,0 +1,805 @@ +" Vim completion script +" Language: Ruby +" Maintainer: Mark Guzman +" URL: https://github.com/vim-ruby/vim-ruby +" Release Coordinator: Doug Kearns +" Maintainer Version: 0.8.1 +" ---------------------------------------------------------------------------- +" +" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com) +" ---------------------------------------------------------------------------- + +" {{{ requirement checks + +function! s:ErrMsg(msg) + echohl ErrorMsg + echo a:msg + echohl None +endfunction + +if !has('ruby') + call s:ErrMsg( "Error: Rubycomplete requires vim compiled with +ruby" ) + call s:ErrMsg( "Error: falling back to syntax completion" ) + " lets fall back to syntax completion + setlocal omnifunc=syntaxcomplete#Complete + finish +endif + +if version < 700 + call s:ErrMsg( "Error: Required vim >= 7.0" ) + finish +endif +" }}} requirement checks + +" {{{ configuration failsafe initialization +if !exists("g:rubycomplete_rails") + let g:rubycomplete_rails = 0 +endif + +if !exists("g:rubycomplete_classes_in_global") + let g:rubycomplete_classes_in_global = 0 +endif + +if !exists("g:rubycomplete_buffer_loading") + let g:rubycomplete_buffer_loading = 0 +endif + +if !exists("g:rubycomplete_include_object") + let g:rubycomplete_include_object = 0 +endif + +if !exists("g:rubycomplete_include_objectspace") + let g:rubycomplete_include_objectspace = 0 +endif +" }}} configuration failsafe initialization + +" {{{ vim-side support functions +let s:rubycomplete_debug = 0 + +function! s:dprint(msg) + if s:rubycomplete_debug == 1 + echom a:msg + endif +endfunction + +function! s:GetBufferRubyModule(name, ...) + if a:0 == 1 + let [snum,enum] = s:GetBufferRubyEntity(a:name, "module", a:1) + else + let [snum,enum] = s:GetBufferRubyEntity(a:name, "module") + endif + return snum . '..' . enum +endfunction + +function! s:GetBufferRubyClass(name, ...) + if a:0 >= 1 + let [snum,enum] = s:GetBufferRubyEntity(a:name, "class", a:1) + else + let [snum,enum] = s:GetBufferRubyEntity(a:name, "class") + endif + return snum . '..' . enum +endfunction + +function! s:GetBufferRubySingletonMethods(name) +endfunction + +function! s:GetBufferRubyEntity( name, type, ... ) + let lastpos = getpos(".") + let lastline = lastpos + if (a:0 >= 1) + let lastline = [ 0, a:1, 0, 0 ] + call cursor( a:1, 0 ) + endif + + let stopline = 1 + + let crex = '^\s*\<' . a:type . '\>\s*\<' . a:name . '\>\s*\(<\s*.*\s*\)\?' + let [lnum,lcol] = searchpos( crex, 'w' ) + "let [lnum,lcol] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' ) + + if lnum == 0 && lcol == 0 + call cursor(lastpos[1], lastpos[2]) + return [0,0] + endif + + let curpos = getpos(".") + let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'wr' ) + call cursor(lastpos[1], lastpos[2]) + + if lnum > enum + return [0,0] + endif + " we found a the class def + return [lnum,enum] +endfunction + +function! s:IsInClassDef() + return s:IsPosInClassDef( line('.') ) +endfunction + +function! s:IsPosInClassDef(pos) + let [snum,enum] = s:GetBufferRubyEntity( '.*', "class" ) + let ret = 'nil' + + if snum < a:pos && a:pos < enum + let ret = snum . '..' . enum + endif + + return ret +endfunction + +function! s:GetRubyVarType(v) + let stopline = 1 + let vtp = '' + let pos = getpos('.') + let sstr = '^\s*#\s*@var\s*'.escape(a:v, '*').'\>\s\+[^ \t]\+\s*$' + let [lnum,lcol] = searchpos(sstr,'nb',stopline) + if lnum != 0 && lcol != 0 + call setpos('.',pos) + let str = getline(lnum) + let vtp = substitute(str,sstr,'\1','') + return vtp + endif + call setpos('.',pos) + let ctors = '\(now\|new\|open\|get_instance' + if exists('g:rubycomplete_rails') && g:rubycomplete_rails == 1 && s:rubycomplete_rails_loaded == 1 + let ctors = ctors.'\|find\|create' + else + endif + let ctors = ctors.'\)' + + let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)' + let sstr = ''.a:v.'\>\s*[+\-*/]*'.fstr + let [lnum,lcol] = searchpos(sstr,'nb',stopline) + if lnum != 0 && lcol != 0 + let str = matchstr(getline(lnum),fstr,lcol) + let str = substitute(str,'^=\s*','','') + + call setpos('.',pos) + if str == '"' || str == '''' || stridx(tolower(str), '%q[') != -1 + return 'String' + elseif str == '[' || stridx(str, '%w[') != -1 + return 'Array' + elseif str == '{' + return 'Hash' + elseif str == '/' || str == '%r{' + return 'Regexp' + elseif strlen(str) >= 4 && stridx(str,'..') != -1 + return 'Range' + elseif stridx(str, 'lambda') != -1 || str == '&' + return 'Proc' + elseif strlen(str) > 4 + let l = stridx(str,'.') + return str[0:l-1] + end + return '' + endif + call setpos('.',pos) + return '' +endfunction + +"}}} vim-side support functions + +"{{{ vim-side completion function +function! rubycomplete#Init() + execute "ruby VimRubyCompletion.preload_rails" +endfunction + +function! rubycomplete#Complete(findstart, base) + "findstart = 1 when we need to get the text length + if a:findstart + let line = getline('.') + let idx = col('.') + while idx > 0 + let idx -= 1 + let c = line[idx-1] + if c =~ '\w' + continue + elseif ! c =~ '\.' + idx = -1 + break + else + break + endif + endwhile + + return idx + "findstart = 0 when we need to return the list of completions + else + let g:rubycomplete_completions = [] + execute "ruby VimRubyCompletion.get_completions('" . a:base . "')" + return g:rubycomplete_completions + endif +endfunction +"}}} vim-side completion function + +"{{{ ruby-side code +function! s:DefRuby() +ruby << RUBYEOF +# {{{ ruby completion + +begin + require 'rubygems' # let's assume this is safe...? +rescue Exception + #ignore? +end +class VimRubyCompletion +# {{{ constants + @@debug = false + @@ReservedWords = [ + "BEGIN", "END", + "alias", "and", + "begin", "break", + "case", "class", + "def", "defined", "do", + "else", "elsif", "end", "ensure", + "false", "for", + "if", "in", + "module", + "next", "nil", "not", + "or", + "redo", "rescue", "retry", "return", + "self", "super", + "then", "true", + "undef", "unless", "until", + "when", "while", + "yield", + ] + + @@Operators = [ "%", "&", "*", "**", "+", "-", "/", + "<", "<<", "<=", "<=>", "==", "===", "=~", ">", ">=", ">>", + "[]", "[]=", "^", ] +# }}} constants + +# {{{ buffer analysis magic + def load_requires + buf = VIM::Buffer.current + enum = buf.line_number + nums = Range.new( 1, enum ) + nums.each do |x| + ln = buf[x] + begin + eval( "require %s" % $1 ) if /.*require\s*(.*)$/.match( ln ) + rescue Exception + #ignore? + end + end + end + + def load_buffer_class(name) + dprint "load_buffer_class(%s) START" % name + classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")') + return if classdef == nil + + pare = /^\s*class\s*(.*)\s*<\s*(.*)\s*\n/.match( classdef ) + load_buffer_class( $2 ) if pare != nil && $2 != name # load parent class if needed + + mixre = /.*\n\s*(include|prepend)\s*(.*)\s*\n/.match( classdef ) + load_buffer_module( $2 ) if mixre != nil && $2 != name # load mixins if needed + + begin + eval classdef + rescue Exception + VIM::evaluate( "s:ErrMsg( 'Problem loading class \"%s\", was it already completed?' )" % name ) + end + dprint "load_buffer_class(%s) END" % name + end + + def load_buffer_module(name) + dprint "load_buffer_module(%s) START" % name + classdef = get_buffer_entity(name, 's:GetBufferRubyModule("%s")') + return if classdef == nil + + begin + eval classdef + rescue Exception + VIM::evaluate( "s:ErrMsg( 'Problem loading module \"%s\", was it already completed?' )" % name ) + end + dprint "load_buffer_module(%s) END" % name + end + + def get_buffer_entity(name, vimfun) + loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading") + return nil if loading_allowed.to_i.zero? + return nil if /(\"|\')+/.match( name ) + buf = VIM::Buffer.current + nums = eval( VIM::evaluate( vimfun % name ) ) + return nil if nums == nil + return nil if nums.min == nums.max && nums.min == 0 + + dprint "get_buffer_entity START" + visited = [] + clscnt = 0 + bufname = VIM::Buffer.current.name + classdef = "" + cur_line = VIM::Buffer.current.line_number + while (nums != nil && !(nums.min == 0 && nums.max == 0) ) + dprint "visited: %s" % visited.to_s + break if visited.index( nums ) + visited << nums + + nums.each do |x| + if x != cur_line + next if x == 0 + ln = buf[x] + if /^\s*(module|class|def|include)\s+/.match(ln) + clscnt += 1 if $1 == "class" + #dprint "\$1$1 + classdef += "%s\n" % ln + classdef += "end\n" if /def\s+/.match(ln) + dprint ln + end + end + end + + nm = "%s(::.*)*\", %s, \"" % [ name, nums.last ] + nums = eval( VIM::evaluate( vimfun % nm ) ) + dprint "nm: \"%s\"" % nm + dprint "vimfun: %s" % (vimfun % nm) + dprint "got nums: %s" % nums.to_s + end + if classdef.length > 1 + classdef += "end\n"*clscnt + # classdef = "class %s\n%s\nend\n" % [ bufname.gsub( /\/|\\/, "_" ), classdef ] + end + + dprint "get_buffer_entity END" + dprint "classdef====start" + lns = classdef.split( "\n" ) + lns.each { |x| dprint x } + dprint "classdef====end" + return classdef + end + + def get_var_type( receiver ) + if /(\"|\')+/.match( receiver ) + "String" + else + VIM::evaluate("s:GetRubyVarType('%s')" % receiver) + end + end + + def dprint( txt ) + print txt if @@debug + end + + def escape_vim_singlequote_string(str) + str.to_s.gsub(/'/,"\\'") + end + + def get_buffer_entity_list( type ) + # this will be a little expensive. + loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading") + allow_aggressive_load = VIM::evaluate("exists('g:rubycomplete_classes_in_global') && g:rubycomplete_classes_in_global") + return [] if allow_aggressive_load.to_i.zero? || loading_allowed.to_i.zero? + + buf = VIM::Buffer.current + eob = buf.length + ret = [] + rg = 1..eob + re = eval( "/^\s*%s\s*([A-Za-z0-9_:-]*)(\s*<\s*([A-Za-z0-9_:-]*))?\s*/" % type ) + + rg.each do |x| + if re.match( buf[x] ) + next if type == "def" && eval( VIM::evaluate("s:IsPosInClassDef(%s)" % x) ) != nil + ret.push $1 + end + end + + return ret + end + + def get_buffer_modules + return get_buffer_entity_list( "modules" ) + end + + def get_buffer_methods + return get_buffer_entity_list( "def" ) + end + + def get_buffer_classes + return get_buffer_entity_list( "class" ) + end + + + def load_rails + allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails") + return if allow_rails.to_i.zero? + + buf_path = VIM::evaluate('expand("%:p")') + file_name = VIM::evaluate('expand("%:t")') + vim_dir = VIM::evaluate('getcwd()') + file_dir = buf_path.gsub( file_name, '' ) + file_dir.gsub!( /\\/, "/" ) + vim_dir.gsub!( /\\/, "/" ) + vim_dir << "/" + dirs = [ vim_dir, file_dir ] + sdirs = [ "", "./", "../", "../../", "../../../", "../../../../" ] + rails_base = nil + + dirs.each do |dir| + sdirs.each do |sub| + trail = "%s%s" % [ dir, sub ] + tcfg = "%sconfig" % trail + + if File.exists?( tcfg ) + rails_base = trail + break + end + end + break if rails_base + end + + return if rails_base == nil + $:.push rails_base unless $:.index( rails_base ) + + rails_config = rails_base + "config/" + rails_lib = rails_base + "lib/" + $:.push rails_config unless $:.index( rails_config ) + $:.push rails_lib unless $:.index( rails_lib ) + + bootfile = rails_config + "boot.rb" + envfile = rails_config + "environment.rb" + if File.exists?( bootfile ) && File.exists?( envfile ) + begin + require bootfile + require envfile + begin + require 'console_app' + require 'console_with_helpers' + rescue Exception + dprint "Rails 1.1+ Error %s" % $! + # assume 1.0 + end + #eval( "Rails::Initializer.run" ) #not necessary? + VIM::command('let s:rubycomplete_rails_loaded = 1') + dprint "rails loaded" + rescue Exception + dprint "Rails Error %s" % $! + VIM::evaluate( "s:ErrMsg('Error loading rails environment')" ) + end + end + end + + def get_rails_helpers + allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails") + rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded') + return [] if allow_rails.to_i.zero? || rails_loaded.to_i.zero? + + buf_path = VIM::evaluate('expand("%:p")') + buf_path.gsub!( /\\/, "/" ) + path_elm = buf_path.split( "/" ) + dprint "buf_path: %s" % buf_path + types = [ "app", "db", "lib", "test", "components", "script" ] + + i = nil + ret = [] + type = nil + types.each do |t| + i = path_elm.index( t ) + break if i + end + type = path_elm[i] + type.downcase! + + dprint "type: %s" % type + case type + when "app" + i += 1 + subtype = path_elm[i] + subtype.downcase! + + dprint "subtype: %s" % subtype + case subtype + when "views" + ret += ActionView::Base.instance_methods + ret += ActionView::Base.methods + when "controllers" + ret += ActionController::Base.instance_methods + ret += ActionController::Base.methods + when "models" + ret += ActiveRecord::Base.instance_methods + ret += ActiveRecord::Base.methods + end + + when "db" + ret += ActiveRecord::ConnectionAdapters::SchemaStatements.instance_methods + ret += ActiveRecord::ConnectionAdapters::SchemaStatements.methods + end + + + return ret + end + + def add_rails_columns( cls ) + allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails") + rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded') + return [] if allow_rails.to_i.zero? || rails_loaded.to_i.zero? + + begin + eval( "#{cls}.establish_connection" ) + return [] unless eval( "#{cls}.ancestors.include?(ActiveRecord::Base).to_s" ) + col = eval( "#{cls}.column_names" ) + return col if col + rescue + dprint "add_rails_columns err: (cls: %s) %s" % [ cls, $! ] + return [] + end + return [] + end + + def clean_sel(sel, msg) + ret = sel.reject{|x|x.nil?}.uniq + ret = ret.grep(/^#{Regexp.quote(msg)}/) if msg != nil + ret + end + + def get_rails_view_methods + allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails") + rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded') + return [] if allow_rails.to_i.zero? || rails_loaded.to_i.zero? + + buf_path = VIM::evaluate('expand("%:p")') + buf_path.gsub!( /\\/, "/" ) + pelm = buf_path.split( "/" ) + idx = pelm.index( "views" ) + + return [] unless idx + idx += 1 + + clspl = pelm[idx].camelize.pluralize + cls = clspl.singularize + + ret = [] + begin + ret += eval( "#{cls}.instance_methods" ) + ret += eval( "#{clspl}Helper.instance_methods" ) + rescue Exception + dprint "Error: Unable to load rails view helpers for %s: %s" % [ cls, $! ] + end + + return ret + end +# }}} buffer analysis magic + +# {{{ main completion code + def self.preload_rails + a = VimRubyCompletion.new + require 'Thread' + Thread.new(a) do |b| + begin + b.load_rails + rescue + end + end + a.load_rails + rescue + end + + def self.get_completions(base) + b = VimRubyCompletion.new + b.get_completions base + end + + def get_completions(base) + loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading") + if loading_allowed.to_i == 1 + load_requires + load_rails + end + + input = VIM::Buffer.current.line + cpos = VIM::Window.current.cursor[1] - 1 + input = input[0..cpos] + input += base + input.sub!(/.*[ \t\n\"\\'`><=;|&{(]/, '') # Readline.basic_word_break_characters + input.sub!(/self\./, '') + input.sub!(/.*((\.\.[\[(]?)|([\[(]))/, '') + + dprint 'input %s' % input + message = nil + receiver = nil + methods = [] + variables = [] + classes = [] + constants = [] + + case input + when /^(\/[^\/]*\/)\.([^.]*)$/ # Regexp + receiver = $1 + message = Regexp.quote($2) + methods = Regexp.instance_methods(true) + + when /^([^\]]*\])\.([^.]*)$/ # Array + receiver = $1 + message = Regexp.quote($2) + methods = Array.instance_methods(true) + + when /^([^\}]*\})\.([^.]*)$/ # Proc or Hash + receiver = $1 + message = Regexp.quote($2) + methods = Proc.instance_methods(true) | Hash.instance_methods(true) + + when /^(:[^:.]*)$/ # Symbol + dprint "symbol" + if Symbol.respond_to?(:all_symbols) + receiver = $1 + message = $1.sub( /:/, '' ) + methods = Symbol.all_symbols.collect{|s| s.id2name} + methods.delete_if { |c| c.match( /'/ ) } + end + + when /^::([A-Z][^:\.\(]*)$/ # Absolute Constant or class methods + dprint "const or cls" + receiver = $1 + methods = Object.constants + methods.grep(/^#{receiver}/).collect{|e| "::" + e} + + when /^(((::)?[A-Z][^:.\(]*)+?)::?([^:.]*)$/ # Constant or class methods + receiver = $1 + message = Regexp.quote($4) + dprint "const or cls 2 [recv: \'%s\', msg: \'%s\']" % [ receiver, message ] + load_buffer_class( receiver ) + begin + classes = eval("#{receiver}.constants") + #methods = eval("#{receiver}.methods") + rescue Exception + dprint "exception: %s" % $! + methods = [] + end + methods.grep(/^#{message}/).collect{|e| receiver + "::" + e} + + when /^(:[^:.]+)\.([^.]*)$/ # Symbol + dprint "symbol" + receiver = $1 + message = Regexp.quote($2) + methods = Symbol.instance_methods(true) + + when /^([0-9_]+(\.[0-9_]+)?(e[0-9]+)?)\.([^.]*)$/ # Numeric + dprint "numeric" + receiver = $1 + message = Regexp.quote($4) + begin + methods = eval(receiver).methods + rescue Exception + methods = [] + end + + when /^(\$[^.]*)$/ #global + dprint "global" + methods = global_variables.grep(Regexp.new(Regexp.quote($1))) + + when /^((\.?[^.]+)+?)\.([^.]*)$/ # variable + dprint "variable" + receiver = $1 + message = Regexp.quote($3) + load_buffer_class( receiver ) + + cv = eval("self.class.constants") + vartype = get_var_type( receiver ) + dprint "vartype: %s" % vartype + if vartype != '' + load_buffer_class( vartype ) + + begin + methods = eval("#{vartype}.instance_methods") + variables = eval("#{vartype}.instance_variables") + rescue Exception + dprint "load_buffer_class err: %s" % $! + end + elsif (cv).include?(receiver) + # foo.func and foo is local var. + methods = eval("#{receiver}.methods") + vartype = receiver + elsif /^[A-Z]/ =~ receiver and /\./ !~ receiver + vartype = receiver + # Foo::Bar.func + begin + methods = eval("#{receiver}.methods") + rescue Exception + end + else + # func1.func2 + ObjectSpace.each_object(Module){|m| + next if m.name != "IRB::Context" and + /^(IRB|SLex|RubyLex|RubyToken)/ =~ m.name + methods.concat m.instance_methods(false) + } + end + variables += add_rails_columns( "#{vartype}" ) if vartype && vartype.length > 0 + + when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/ + message = $1 + methods = Range.instance_methods(true) + + when /^\.([^.]*)$/ # unknown(maybe String) + message = Regexp.quote($1) + methods = String.instance_methods(true) + + else + dprint "default/other" + inclass = eval( VIM::evaluate("s:IsInClassDef()") ) + + if inclass != nil + dprint "inclass" + classdef = "%s\n" % VIM::Buffer.current[ inclass.min ] + found = /^\s*class\s*([A-Za-z0-9_-]*)(\s*<\s*([A-Za-z0-9_:-]*))?\s*\n$/.match( classdef ) + + if found != nil + receiver = $1 + message = input + load_buffer_class( receiver ) + begin + methods = eval( "#{receiver}.instance_methods" ) + variables += add_rails_columns( "#{receiver}" ) + rescue Exception + found = nil + end + end + end + + if inclass == nil || found == nil + dprint "inclass == nil" + methods = get_buffer_methods + methods += get_rails_view_methods + + cls_const = Class.constants + constants = cls_const.select { |c| /^[A-Z_-]+$/.match( c ) } + classes = eval("self.class.constants") - constants + classes += get_buffer_classes + classes += get_buffer_modules + + include_objectspace = VIM::evaluate("exists('g:rubycomplete_include_objectspace') && g:rubycomplete_include_objectspace") + ObjectSpace.each_object(Class) { |cls| classes << cls.to_s } if include_objectspace == "1" + message = receiver = input + end + + methods += get_rails_helpers + methods += Kernel.public_methods + end + + + include_object = VIM::evaluate("exists('g:rubycomplete_include_object') && g:rubycomplete_include_object") + methods = clean_sel( methods, message ) + methods = (methods-Object.instance_methods) if include_object == "0" + rbcmeth = (VimRubyCompletion.instance_methods-Object.instance_methods) # lets remove those rubycomplete methods + methods = (methods-rbcmeth) + + variables = clean_sel( variables, message ) + classes = clean_sel( classes, message ) - ["VimRubyCompletion"] + constants = clean_sel( constants, message ) + + valid = [] + valid += methods.collect { |m| { :name => m.to_s, :type => 'm' } } + valid += variables.collect { |v| { :name => v.to_s, :type => 'v' } } + valid += classes.collect { |c| { :name => c.to_s, :type => 't' } } + valid += constants.collect { |d| { :name => d.to_s, :type => 'd' } } + valid.sort! { |x,y| x[:name] <=> y[:name] } + + outp = "" + + rg = 0..valid.length + rg.step(150) do |x| + stpos = 0+x + enpos = 150+x + valid[stpos..enpos].each { |c| outp += "{'word':'%s','item':'%s','kind':'%s'}," % [ c[:name], c[:name], c[:type] ].map{|x|escape_vim_singlequote_string(x)} } + outp.sub!(/,$/, '') + + VIM::command("call extend(g:rubycomplete_completions, [%s])" % outp) + outp = "" + end + end +# }}} main completion code + +end # VimRubyCompletion +# }}} ruby completion +RUBYEOF +endfunction + +let s:rubycomplete_rails_loaded = 0 + +call s:DefRuby() +"}}} ruby-side code + + +" vim:tw=78:sw=4:ts=8:et:fdm=marker:ft=vim:norl: diff --git a/sources_non_forked/vim-ruby/bin/vim-ruby-install.rb b/sources_non_forked/vim-ruby/bin/vim-ruby-install.rb new file mode 100755 index 00000000..10a15dd5 --- /dev/null +++ b/sources_non_forked/vim-ruby/bin/vim-ruby-install.rb @@ -0,0 +1,455 @@ +#!/usr/bin/env ruby + +# vim-ruby-install: install the Vim config files for Ruby editing +# +# * scope out the target directory and get user to confirm +# * if no directory found, ask user +# * allow user to force a search for a Windows gvim installation +# * find source files from gem or from top level directory +# * copy to target directory, taking account of +# * line endings (NL for Unix-ish; CRLF for Windows) +# * permissions (755 for directories; 644 for files) +# + +require 'rbconfig' +include RbConfig +require 'fileutils' +require 'optparse' +require 'pathname' + +SOURCE_FILES = %w{ + autoload/rubycomplete.vim + compiler/eruby.vim + compiler/rspec.vim + compiler/ruby.vim + compiler/rubyunit.vim + ftdetect/ruby.vim + ftplugin/eruby.vim + ftplugin/ruby.vim + indent/eruby.vim + indent/ruby.vim + syntax/eruby.vim + syntax/ruby.vim +} + +# +# Miscellaneous functions in the user's environment. +# +class Env + # + # Returns :UNIX or :WINDOWS, according to CONFIG['host_os'] and $options[:windows]. + # + def Env.determine_target_os + os = CONFIG['host_os'] + if os =~ /mswin/ or $options[:windows] + return :WINDOWS + else + return :UNIX + end + end + + # + # Returns the path to the directory where the vim configuration files will be copied from. + # The first preference is the directory above this script. If that fails, we look for the + # RubyGems package 'vim-ruby'. Failing that, we return +nil+. + # + def Env.determine_source_directory + # 1. Try the directory above this installation script. + vim_ruby_source_dir = File.expand_path(File.join(File.dirname($0), '..')) + return vim_ruby_source_dir if _valid_vim_ruby_dir(vim_ruby_source_dir) + # 2. Try the gem 'vim-ruby'. + begin + require 'rubygems' + raise "Need RubyGems 0.8+" if Gem::RubyGemsPackageVersion < '0.8' + rescue LoadError + return nil + end + #vim_ruby_gem_dir = Gem.latest_load_paths.grep(%r{gems/vim-ruby-\d{4}\.\d{2}\.\d{2}}).last + vim_ruby_gem_dir = Gem.all_load_paths.grep(%r{gems/vim-ruby-\d{4}\.\d{2}\.\d{2}}).sort.last + if vim_ruby_gem_dir and _valid_vim_ruby_dir(vim_ruby_gem_dir) + return vim_ruby_gem_dir + end + return nil + end + + # Returns the Vim installation directory ($VIM). + # TODO: print warning if vim command not in PATH or appropriate key not in registry? + def Env.determine_vim_dir + installation_dir = ENV['VIM'] || + case Env.determine_target_os + when :UNIX + IO.popen('vim --version 2>/dev/null') do |version| + dir = version.read[/fall-back for \$VIM: "(.*)"/, 1] + end + when :WINDOWS + begin + require 'win32/registry' + Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Vim\Gvim') do |reg| + path = reg['path', Win32::Registry::REG_SZ] + dir = path.sub(/\\vim\d\d\\gvim.exe/i, '') + end + rescue Win32::Registry::Error + nil + end + end + return installation_dir + end + + def Env.determine_home_dir + home_dir = ENV['HOME'] || + case Env.determine_target_os + when :WINDOWS + ENV['HOMEDRIVE'] + ENV['HOMEPATH'] if ENV['HOMEDRIVE'] and ENV['HOMEPATH'] + end + return home_dir + end + + def Env.ask_user(message) + print message + gets.strip + end + + private_class_method + + def Env._valid_vim_ruby_dir(dir) + Dir.chdir(dir) do + return SOURCE_FILES.all? { |path| FileTest.file?(path) } + end + end + +end # class Env + + +# +# A FileWriter writes files with pre-selected line endings and permissions. +# +# writer = FileWriter.new(:UNIX, 0664) +# writer.copy(source, target) +# +class FileWriter + LINE_ENDINGS = { :UNIX => "\n", :WINDOWS => "\r\n" } + + def initialize(ending, file_permissions=0644, directory_permissions=0755) + @ending = LINE_ENDINGS[ending] or raise "No/invalid line ending given: #{ending}" + @permissions = { + :file => file_permissions, + :dir => directory_permissions + } + end + + # Source and target paths assumed to be Pathname objects. Copy the source to the target, + # ensuring the right line endings. + def copy(source_path, target_path) + _ensure_directory_exists(target_path) + target_path.open('wb', @permissions[:file]) do |io| + lines = source_path.read.split("\n") + lines.each do |line| + io.write(line.chomp + @ending) + end + end + puts "#{source_path.to_s.ljust(25)} -> #{target_path}" + end + + # Create the given directory with the correct directory permissions. + def mkpath(directory) + FileUtils.mkdir_p(directory.to_s, :mode => @permissions[:dir], :verbose => true) + end + + def _ensure_directory_exists(path) + dir = path.dirname + unless dir.directory? + # FileUtils.mkdir_p already checks if it exists and is a + # directory. What if it exists as a file? (HGS) + mkpath(dir) + end + end +end # class FileWriter + +# +# Represents the target base directory for installs. Handles writing the files through a +# given FileWriter. +# +class TargetDirectory + def self.finder + TargetDirectory::Finder.new + end + + def initialize(directory, writer) + @directory = Pathname.new(directory) + @writer = writer # FileWriter + end + + # Copies the given relative path from the current directory to the target. + def copy(path) + source_path = Pathname.new(path) + target_path = @directory + path + @writer.copy(source_path, target_path) + end + + def [](path) + @directory + path + end + + def path + @directory + end +end # class TargetDirectory + +# +# Represents the target directory. Can find candidates, based on the operating system and +# user options; but is ultimately created with one in mind. +# +class TargetDirectory::Finder + # Guides the user through a selection process, ending in a chosen directory. + def find_target_directory + # 1. Was a directory specified using the --directory option? + if option_dir = $options[:target_dir] + return option_dir + end + # 2. Try the potentials (if there are any). + if dirs = _potential_directories and not dirs.empty? + puts + puts "Possible Vim installation directories:" + dirs.each_with_index do |dir, idx| + puts " #{idx+1}) #{dir}" + end + puts + r = Env.ask_user "Please select one (or anything else to specify another directory): " + if (1..dirs.size).include? r.to_i + chosen_directory = dirs[r.to_i - 1] + return chosen_directory + end + end + # 3. We didn't find any, or the user wants to enter another. + if dirs.empty? + puts + puts "Couldn't find any Vim installation directories." + end + entered_directory = Env.ask_user "Please enter the full path to your Vim installation directory: " + entered_directory = File.expand_path(entered_directory) + return entered_directory + end + + private + + # Return an array of _potential_ directories (i.e. they exist). Take the options into + # account. + def _potential_directories + dirs = [] + dirs << _vim_user_dir + dirs << _vim_system_dir + return dirs.compact.map { |dir| File.expand_path(dir) } + end + + # Return the Vim system preferences directory + def _vim_system_dir + vim_dir = Env.determine_vim_dir + system_dir = vim_dir + "/vimfiles" if vim_dir + return system_dir + end + + # Return the Vim user preferences directory + def _vim_user_dir + platform_dir = { :UNIX => "/.vim", :WINDOWS => "/vimfiles" } + home_dir = Env.determine_home_dir + user_dir = home_dir + platform_dir[Env.determine_target_os] if home_dir + return user_dir + end +end # class TargetDirectory::Finder + +# +# VimRubyInstaller is the class that copies the files from the source directory to the target +# directory, both of which are provided. +# +class VimRubyInstaller + # +source+ and +target+ are the base directories from and to which the configuration files + # will be copied. Both are strings. + def initialize(source, target) + unless FileTest.directory?(source) + raise "Automatically determined source directory ('#{source}') doesn't exist" + end + unless FileTest.directory?(target) + raise "Chosen target directory ('#{target}') doesn't exist" + end + @source_dir = source + file_writer = FileWriter.new(Env.determine_target_os) + @target_dir = TargetDirectory.new(target, file_writer) + end + + # Since we know the source and target directories, all we have to do is copy the files + # across. If the --backup option was specified or the target file is + # _newer_ than the source file, we make a backup of it and report that to + # the user. + def install + backupdir = BackupDir.new("./vim-ruby-backup.#{Process.pid}") + Dir.chdir(@source_dir) do + SOURCE_FILES.each do |path| + source_path = Pathname.new(path) + target_path = @target_dir[path] + # FIXME: Backup everything for now + if $options[:backup] and target_path.file? + backupdir.backup(@target_dir, path) + elsif target_path.file? and target_path.mtime > source_path.mtime + # We're going to overwrite a newer file; back it up, unless they're the same. + unless _same_contents?(target_path, source_path) + backupdir.backup(@target_dir, path) + end + end + @target_dir.copy(path) + end + end + backups = backupdir.contents + unless backups.empty? + puts + puts "The following backups were made:" + backups.each do |path| + puts " * #{path}" + end + puts + puts "These backups are located in this directory: #{backupdir.path}" + end + end + + private + + # Test two files for equality of contents, ignoring line endings. + def _same_contents?(p1, p2) + contents1 = p1.read.split("\n").map { |line| line.chomp } + contents2 = p2.read.split("\n").map { |line| line.chomp } + contents1 == contents2 + end + + # A directory for holding backups of configuration files. + class BackupDir + def initialize(path) + @base = Pathname.new(path).expand_path + end + + # Copy basedir/path to @path/path. + def backup(basedir, path) + @base.mkpath unless @base.directory? + source = basedir.path + path + target = @base + path + target.dirname.mkpath + FileUtils.cp(source.to_s, target.dirname.to_s, :verbose => true) + end + + def [](path) + @base + path + end + + def contents + return [] unless @base.directory? + results = [] + Dir.chdir(@base) do + Pathname.new('.').find do |path| + results << path if path.file? + end + end + results + end + + def path + @base + end + end # class VimRubyInstaller::BackupDir +end # class VimRubyInstaller + +# +# * * * M A I N * * * +# + +begin + $options = { + :backup => false, + :target_dir => nil, + :windows => false + } + + op = OptionParser.new do |p| + p.banner = %{ + vim-ruby-install.rb: Install the vim-ruby configuration files + + About: + * Detects the Vim user and system-wide preferences directories + * User to confirm before proceeding + * User may specify other directory + * Takes config files from current directory or from vim-ruby gem + * Writes files with correct permissions and line endings + + Usage: + direct: ruby bin/vim-ruby-install.rb [options] + gem: vim-ruby-install.rb [options] + + Options: + }.gsub(/^ /, '') + p.on('-b', '--backup', 'Backup existing runtime files') do |value| + $options[:backup] = value + end + p.on('-d DIR', '--directory', 'Install into given directory') do |dir| + $options[:target_dir] = dir + end + p.on('-w', '--windows', 'Install into Windows directories') do |value| + $options[:windows] = value + end + p.on('-h', '--help', 'Show this message') do + puts p + exit + end + p.on_tail %{ + Notes: + + * "Direct" usage means unpacking a vim-ruby tarball and running this + program from the vim-ruby directory. + + * The convenient alternative is to use RubyGems: + gem install vim-ruby + vim-ruby-install.rb + + * The --windows option is designed for forcing an install into the + Windows (gvim) configuration directory; useful when running from + Cygwin or MinGW. + + * This installer is quite new (2004-09-20). Please report bugs to + gsinclair@soyabean.com.au. + }.gsub(/^ /, '') + end + op.parse!(ARGV) + + if not ARGV.empty? + raise "invalid argument: #{ARGV[0]}" + end + + source_dir = Env.determine_source_directory + if source_dir.nil? + raise "Can't find source directory." + end + + target_dir = TargetDirectory.finder.find_target_directory + if not File.directory?(target_dir) + puts + puts "Target directory '#{target_dir}' does not exist." + response = Env.ask_user "Do you want to create it? [Yn] " + response = "y" if response.empty? + if response.strip =~ /^y(es)?$/i + FileUtils.mkdir_p(target_dir, :verbose => true) + else + puts + puts "Installation aborted." + exit + end + end + + VimRubyInstaller.new(source_dir, target_dir).install + +rescue + + raise if $DEBUG + $stderr.puts + $stderr.puts $!.message + $stderr.puts "Try 'ruby #{$0} --help' for detailed usage." + exit 1 + +end + +# vim: nowrap sw=2 sts=2 ts=8 ff=unix ft=ruby: diff --git a/sources_non_forked/vim-ruby/compiler/eruby.vim b/sources_non_forked/vim-ruby/compiler/eruby.vim new file mode 100644 index 00000000..45ad5eea --- /dev/null +++ b/sources_non_forked/vim-ruby/compiler/eruby.vim @@ -0,0 +1,39 @@ +" Vim compiler file +" Language: eRuby +" Maintainer: Doug Kearns +" URL: https://github.com/vim-ruby/vim-ruby +" Release Coordinator: Doug Kearns + +if exists("current_compiler") + finish +endif +let current_compiler = "eruby" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo-=C + +if exists("eruby_compiler") && eruby_compiler == "eruby" + CompilerSet makeprg=eruby +else + CompilerSet makeprg=erb +endif + +CompilerSet errorformat= + \eruby:\ %f:%l:%m, + \%+E%f:%l:\ parse\ error, + \%W%f:%l:\ warning:\ %m, + \%E%f:%l:in\ %*[^:]:\ %m, + \%E%f:%l:\ %m, + \%-C%\tfrom\ %f:%l:in\ %.%#, + \%-Z%\tfrom\ %f:%l, + \%-Z%p^, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8: diff --git a/sources_non_forked/vim-ruby/compiler/rake.vim b/sources_non_forked/vim-ruby/compiler/rake.vim new file mode 100644 index 00000000..3bd9da0d --- /dev/null +++ b/sources_non_forked/vim-ruby/compiler/rake.vim @@ -0,0 +1,35 @@ +" Vim compiler file +" Language: Rake +" Maintainer: Tim Pope +" URL: https://github.com/vim-ruby/vim-ruby +" Release Coordinator: Doug Kearns + +if exists("current_compiler") + finish +endif +let current_compiler = "rake" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo-=C + +CompilerSet makeprg=rake + +CompilerSet errorformat= + \%D(in\ %f), + \%\\s%#from\ %f:%l:%m, + \%\\s%#from\ %f:%l:, + \%\\s%##\ %f:%l:%m, + \%\\s%##\ %f:%l, + \%\\s%#[%f:%l:\ %#%m, + \%\\s%#%f:%l:\ %#%m, + \%\\s%#%f:%l:, + \%m\ [%f:%l]: + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8: diff --git a/sources_non_forked/vim-ruby/compiler/rspec.vim b/sources_non_forked/vim-ruby/compiler/rspec.vim new file mode 100644 index 00000000..7c340bab --- /dev/null +++ b/sources_non_forked/vim-ruby/compiler/rspec.vim @@ -0,0 +1,33 @@ +" Vim compiler file +" Language: RSpec +" Maintainer: Tim Pope +" URL: https://github.com/vim-ruby/vim-ruby +" Release Coordinator: Doug Kearns + +if exists("current_compiler") + finish +endif +let current_compiler = "rspec" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo-=C + +CompilerSet makeprg=rspec + +CompilerSet errorformat= + \%f:%l:\ %tarning:\ %m, + \%E%.%#:in\ `load':\ %f:%l:%m, + \%E%f:%l:in\ `%*[^']':\ %m, + \%-Z\ \ \ \ \ \#\ %f:%l:%.%#, + \%E\ \ %\\d%\\+)%.%#, + \%C\ \ \ \ \ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8: diff --git a/sources_non_forked/vim-ruby/compiler/ruby.vim b/sources_non_forked/vim-ruby/compiler/ruby.vim new file mode 100644 index 00000000..dcf7a401 --- /dev/null +++ b/sources_non_forked/vim-ruby/compiler/ruby.vim @@ -0,0 +1,45 @@ +" Vim compiler file +" Language: Ruby +" Function: Syntax check and/or error reporting +" Maintainer: Tim Pope +" URL: https://github.com/vim-ruby/vim-ruby +" Release Coordinator: Doug Kearns +" ---------------------------------------------------------------------------- + +if exists("current_compiler") + finish +endif +let current_compiler = "ruby" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo-=C + +" default settings runs script normally +" add '-c' switch to run syntax check only: +" +" CompilerSet makeprg=ruby\ -wc\ $* +" +" or add '-c' at :make command line: +" +" :make -c % +" +CompilerSet makeprg=ruby\ -w\ $* + +CompilerSet errorformat= + \%+E%f:%l:\ parse\ error, + \%W%f:%l:\ warning:\ %m, + \%E%f:%l:in\ %*[^:]:\ %m, + \%E%f:%l:\ %m, + \%-C%\tfrom\ %f:%l:in\ %.%#, + \%-Z%\tfrom\ %f:%l, + \%-Z%p^, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8: diff --git a/sources_non_forked/vim-ruby/compiler/rubyunit.vim b/sources_non_forked/vim-ruby/compiler/rubyunit.vim new file mode 100644 index 00000000..93a0c8e6 --- /dev/null +++ b/sources_non_forked/vim-ruby/compiler/rubyunit.vim @@ -0,0 +1,33 @@ +" Vim compiler file +" Language: Test::Unit - Ruby Unit Testing Framework +" Maintainer: Doug Kearns +" URL: https://github.com/vim-ruby/vim-ruby +" Release Coordinator: Doug Kearns + +if exists("current_compiler") + finish +endif +let current_compiler = "rubyunit" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo-=C + +CompilerSet makeprg=testrb + +CompilerSet errorformat=\%W\ %\\+%\\d%\\+)\ Failure:, + \%C%m\ [%f:%l]:, + \%E\ %\\+%\\d%\\+)\ Error:, + \%C%m:, + \%C\ \ \ \ %f:%l:%.%#, + \%C%m, + \%Z\ %#, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8: diff --git a/sources_non_forked/vim-ruby/doc/ft-ruby-omni.txt b/sources_non_forked/vim-ruby/doc/ft-ruby-omni.txt new file mode 100644 index 00000000..79fa3da1 --- /dev/null +++ b/sources_non_forked/vim-ruby/doc/ft-ruby-omni.txt @@ -0,0 +1,40 @@ +RUBY *ft-ruby-omni* + +Completion of Ruby code requires that Vim be built with |+ruby|. + +Ruby completion will parse your buffer on demand in order to provide a list of +completions. These completions will be drawn from modules loaded by "require" +and modules defined in the current buffer. + +The completions provided by CTRL-X CTRL-O are sensitive to the context: + + CONTEXT COMPLETIONS PROVIDED ~ + + 1. Not inside a class definition Classes, constants and globals + + 2. Inside a class definition Methods or constants defined in the class + + 3. After '.', '::' or ':' Methods applicable to the object being + dereferenced + + 4. After ':' or ':foo' Symbol name (beginning with "foo") + +Notes: + - Vim will load/evaluate code in order to provide completions. This may + cause some code execution, which may be a concern. This is no longer + enabled by default, to enable this feature add > + let g:rubycomplete_buffer_loading = 1 +<- In context 1 above, Vim can parse the entire buffer to add a list of + classes to the completion results. This feature is turned off by default, + to enable it add > + let g:rubycomplete_classes_in_global = 1 +< to your vimrc + - In context 2 above, anonymous classes are not supported. + - In context 3 above, Vim will attempt to determine the methods supported by + the object. + - Vim can detect and load the Rails environment for files within a rails + project. The feature is disabled by default, to enable it add > + let g:rubycomplete_rails = 1 +< to your vimrc + + vim:tw=78:sw=4:ts=8:ft=help:norl: diff --git a/sources_non_forked/vim-ruby/doc/ft-ruby-syntax.txt b/sources_non_forked/vim-ruby/doc/ft-ruby-syntax.txt new file mode 100644 index 00000000..482ebefc --- /dev/null +++ b/sources_non_forked/vim-ruby/doc/ft-ruby-syntax.txt @@ -0,0 +1,64 @@ +RUBY *ruby.vim* *ft-ruby-syntax* + +There are a number of options to the Ruby syntax highlighting. + +1. Ruby operators |ruby_operators| +2. Whitespace errors |ruby_space_errors| +3. Folds |ruby_fold| +4. Reducing expensive operations |ruby_no_expensive| |ruby_minlines| + + +1. Ruby operators *ruby_operators* + +Ruby operators can be highlighted. + +This is enabled by defining "ruby_operators": > + + :let ruby_operators = 1 +< + +2. Whitespace errors *ruby_space_errors* + +Whitespace errors can be highlighted by defining "ruby_space_errors": > + + :let ruby_space_errors = 1 +< + +This will highlight trailing whitespace and tabs preceded by a space character +as errors. This can be refined by defining "ruby_no_trail_space_error" and +"ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after +spaces respectively. + +3. Folds *ruby_fold* + +Folds can be enabled by defining "ruby_fold": > + + :let ruby_fold = 1 +< + +This will set the value |foldmethod| to "syntax" locally to the current buffer +or window, which will enable syntax-based folding when editing Ruby filetypes. + +4. Reducing expensive operations *ruby_no_expensive* + +By default, the "end" keyword is colorized according to the opening statement +of the block it closes. While useful, this feature can be expensive; if you +experience slow redrawing (or you are on a terminal with poor color support) +you may want to turn it off by defining the "ruby_no_expensive" variable: > + + :let ruby_no_expensive = 1 +< +In this case the same color will be used for all control keywords. + + *ruby_minlines* + +If you do want this feature enabled, but notice highlighting errors while +scrolling backwards, which are fixed when redrawing with CTRL-L, try setting +the "ruby_minlines" variable to a value larger than 50: > + + :let ruby_minlines = 100 +< +Ideally, this value should be a number of lines large enough to embrace your +largest class or module. + + vim:tw=78:sw=4:ts=8:ft=help:norl: diff --git a/sources_non_forked/vim-ruby/doc/vim-ruby.txt b/sources_non_forked/vim-ruby/doc/vim-ruby.txt new file mode 100644 index 00000000..dba015e1 --- /dev/null +++ b/sources_non_forked/vim-ruby/doc/vim-ruby.txt @@ -0,0 +1,61 @@ +*vim-ruby.txt* + +1. Ruby motions |ruby-motion| +2. Ruby text objects |ruby-text-objects| + +============================================================================== +1. Ruby motions *ruby-motion* + +Vim provides motions such as |[m| and |]m| for jumping to the start or end of +a method definition. Out of the box, these work for curly-bracket languages, +but not for ruby. The |vim-ruby| plugin enhances these motions, by making them +also work on ruby files. + + *ruby-]m* +]m Go to start of next method definition. + + *ruby-]M* +]M Go to end of next method definition. + + *ruby-[m* +[m Go to start of previous method definition. + + *ruby-[M* +[M Go to end of previous method definition. + + *ruby-]]* +]] Go to start of next module or class definition. + + *ruby-][* +][ Go to end of next module or class definition. + + *ruby-[[* +[[ Go to start of previous module or class definition. + + *ruby-[]* +[] Go to end of previous module or class definition. + +============================================================================== +2. Ruby text objects *ruby-text-objects* + +Vim's |text-objects| can be used to select or operate upon regions of text +that are defined by structure. The |vim-ruby| plugin adds text objects for +operating on methods and classes. + + *ruby-v_am* *ruby-am* +am "a method", select from "def" until matching "end" + keyword. + + *ruby-v_im* *ruby-im* +im "inner method", select contents of "def"/"end" block, + excluding the "def" and "end" themselves. + + *ruby-v_aM* *ruby-aM* +aM "a class", select from "class" until matching "end" + keyword. + + *ruby-v_iM* *ruby-iM* +iM "inner class", select contents of "class"/"end" + block, excluding the "class" and "end" themselves. + + vim:tw=78:sw=4:ts=8:ft=help:norl: diff --git a/sources_non_forked/vim-ruby/etc/examples/indent/closing_brackets.rb b/sources_non_forked/vim-ruby/etc/examples/indent/closing_brackets.rb new file mode 100644 index 00000000..46c4afd6 --- /dev/null +++ b/sources_non_forked/vim-ruby/etc/examples/indent/closing_brackets.rb @@ -0,0 +1,16 @@ +[1, [2, + [3], + 3], + 4] + +[1, [2, + 3], + 4] + +[1, {2 => + 3}, + 4] + +[1, f(2, + 3), + 4] diff --git a/sources_non_forked/vim-ruby/ftdetect/ruby.vim b/sources_non_forked/vim-ruby/ftdetect/ruby.vim new file mode 100644 index 00000000..a4e9a6d9 --- /dev/null +++ b/sources_non_forked/vim-ruby/ftdetect/ruby.vim @@ -0,0 +1,62 @@ +" Ruby +au BufNewFile,BufRead *.rb,*.rbw,*.gemspec set filetype=ruby + +" Ruby on Rails +au BufNewFile,BufRead *.builder,*.rxml,*.rjs set filetype=ruby + +" Rakefile +au BufNewFile,BufRead [rR]akefile,*.rake set filetype=ruby + +" Rantfile +au BufNewFile,BufRead [rR]antfile,*.rant set filetype=ruby + +" IRB config +au BufNewFile,BufRead .irbrc,irbrc set filetype=ruby + +" Pry config +au BufNewFile,BufRead .pryrc set filetype=ruby + +" Rackup +au BufNewFile,BufRead *.ru set filetype=ruby + +" Capistrano +au BufNewFile,BufRead Capfile set filetype=ruby + +" Bundler +au BufNewFile,BufRead Gemfile set filetype=ruby + +" Guard +au BufNewFile,BufRead Guardfile,.Guardfile set filetype=ruby + +" Chef +au BufNewFile,BufRead Cheffile set filetype=ruby +au BufNewFile,BufRead Berksfile set filetype=ruby + +" Vagrant +au BufNewFile,BufRead [vV]agrantfile set filetype=ruby + +" Autotest +au BufNewFile,BufRead .autotest set filetype=ruby + +" eRuby +au BufNewFile,BufRead *.erb,*.rhtml set filetype=eruby + +" Thor +au BufNewFile,BufRead [tT]horfile,*.thor set filetype=ruby + +" Rabl +au BufNewFile,BufRead *.rabl set filetype=ruby + +" Jbuilder +au BufNewFile,BufRead *.jbuilder set filetype=ruby + +" Puppet librarian +au BufNewFile,BufRead Puppetfile set filetype=ruby +" +" Buildr Buildfile +au BufNewFile,BufRead [Bb]uildfile set filetype=ruby + +" Appraisal +au BufNewFile,BufRead Appraisals set filetype=ruby + +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/sources_non_forked/vim-ruby/ftplugin/eruby.vim b/sources_non_forked/vim-ruby/ftplugin/eruby.vim new file mode 100644 index 00000000..9bb8e86f --- /dev/null +++ b/sources_non_forked/vim-ruby/ftplugin/eruby.vim @@ -0,0 +1,102 @@ +" Vim filetype plugin +" Language: eRuby +" Maintainer: Tim Pope +" URL: https://github.com/vim-ruby/vim-ruby +" Release Coordinator: Doug Kearns + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif + +let s:save_cpo = &cpo +set cpo-=C + +" Define some defaults in case the included ftplugins don't set them. +let s:undo_ftplugin = "" +let s:browsefilter = "All Files (*.*)\t*.*\n" +let s:match_words = "" + +if !exists("g:eruby_default_subtype") + let g:eruby_default_subtype = "html" +endif + +if &filetype =~ '^eruby\.' + let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+') +elseif !exists("b:eruby_subtype") + let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") + let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') + if b:eruby_subtype == '' + let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$') + endif + if b:eruby_subtype == 'rhtml' + let b:eruby_subtype = 'html' + elseif b:eruby_subtype == 'rb' + let b:eruby_subtype = 'ruby' + elseif b:eruby_subtype == 'yml' + let b:eruby_subtype = 'yaml' + elseif b:eruby_subtype == 'js' + let b:eruby_subtype = 'javascript' + elseif b:eruby_subtype == 'txt' + " Conventional; not a real file type + let b:eruby_subtype = 'text' + elseif b:eruby_subtype == '' + let b:eruby_subtype = g:eruby_default_subtype + endif +endif + +if exists("b:eruby_subtype") && b:eruby_subtype != '' + exe "runtime! ftplugin/".b:eruby_subtype.".vim ftplugin/".b:eruby_subtype."_*.vim ftplugin/".b:eruby_subtype."/*.vim" +else + runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim +endif +unlet! b:did_ftplugin + +" Override our defaults if these were set by an included ftplugin. +if exists("b:undo_ftplugin") + let s:undo_ftplugin = b:undo_ftplugin + unlet b:undo_ftplugin +endif +if exists("b:browsefilter") + let s:browsefilter = b:browsefilter + unlet b:browsefilter +endif +if exists("b:match_words") + let s:match_words = b:match_words + unlet b:match_words +endif + +runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim +let b:did_ftplugin = 1 + +" Combine the new set of values with those previously included. +if exists("b:undo_ftplugin") + let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin +endif +if exists ("b:browsefilter") + let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter +endif +if exists("b:match_words") + let s:match_words = b:match_words . ',' . s:match_words +endif + +" Change the browse dialog on Win32 to show mainly eRuby-related files +if has("gui_win32") + let b:browsefilter="eRuby Files (*.erb, *.rhtml)\t*.erb;*.rhtml\n" . s:browsefilter +endif + +" Load the combined list of match_words for matchit.vim +if exists("loaded_matchit") + let b:match_words = s:match_words +endif + +" TODO: comments= +setlocal commentstring=<%#%s%> + +let b:undo_ftplugin = "setl cms< " + \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: nowrap sw=2 sts=2 ts=8: diff --git a/sources_non_forked/vim-ruby/ftplugin/ruby.vim b/sources_non_forked/vim-ruby/ftplugin/ruby.vim new file mode 100644 index 00000000..9630a940 --- /dev/null +++ b/sources_non_forked/vim-ruby/ftplugin/ruby.vim @@ -0,0 +1,395 @@ +" Vim filetype plugin +" Language: Ruby +" Maintainer: Tim Pope +" URL: https://github.com/vim-ruby/vim-ruby +" Release Coordinator: Doug Kearns +" ---------------------------------------------------------------------------- + +if (exists("b:did_ftplugin")) + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +if has("gui_running") && !has("gui_win32") + setlocal keywordprg=ri\ -T\ -f\ bs +else + setlocal keywordprg=ri +endif + +" Matchit support +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_ignorecase = 0 + + let b:match_words = + \ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|def\|begin\)\>=\@!' . + \ ':' . + \ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' . + \ ':' . + \ '\' . + \ ',{:},\[:\],(:)' + + let b:match_skip = + \ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" . + \ "\\'" +endif + +setlocal formatoptions-=t formatoptions+=croql + +setlocal include=^\\s*\\<\\(load\\>\\\|require\\>\\\|autoload\\s*:\\=[\"']\\=\\h\\w*[\"']\\=,\\) +setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.rb','') +setlocal suffixesadd=.rb + +if exists("&ofu") && has("ruby") + setlocal omnifunc=rubycomplete#Complete +endif + +" To activate, :set ballooneval +if has('balloon_eval') && exists('+balloonexpr') + setlocal balloonexpr=RubyBalloonexpr() +endif + + +" TODO: +"setlocal define=^\\s*def + +setlocal comments=:# +setlocal commentstring=#\ %s + +if !exists('g:ruby_version_paths') + let g:ruby_version_paths = {} +endif + +function! s:query_path(root) + let code = "print $:.join %q{,}" + if &shell =~# 'sh' && $PATH !~# '\s' + let prefix = 'env PATH='.$PATH.' ' + else + let prefix = '' + endif + if &shellxquote == "'" + let path_check = prefix.'ruby -e "' . code . '"' + else + let path_check = prefix."ruby -e '" . code . "'" + endif + + let cd = haslocaldir() ? 'lcd' : 'cd' + let cwd = getcwd() + try + exe cd fnameescape(a:root) + let path = split(system(path_check),',') + exe cd fnameescape(cwd) + return path + finally + exe cd fnameescape(cwd) + endtry +endfunction + +function! s:build_path(path) + let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',') + if &g:path !~# '\v^\.%(,/%(usr|emx)/include)=,,$' + let path = substitute(&g:path,',,$',',','') . ',' . path + endif + return path +endfunction + +if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h')) + let s:version_file = findfile('.ruby-version', '.;') + if !empty(s:version_file) + let b:ruby_version = get(readfile(s:version_file, '', 1), '') + if !has_key(g:ruby_version_paths, b:ruby_version) + let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h')) + endif + endif +endif + +if exists("g:ruby_path") + let s:ruby_path = type(g:ruby_path) == type([]) ? join(g:ruby_path, ',') : g:ruby_path +elseif has_key(g:ruby_version_paths, get(b:, 'ruby_version', '')) + let s:ruby_paths = g:ruby_version_paths[b:ruby_version] + let s:ruby_path = s:build_path(s:ruby_paths) +else + if !exists('g:ruby_default_path') + if has("ruby") && has("win32") + ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) ) + elseif executable('ruby') + let g:ruby_default_path = s:query_path($HOME) + else + let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val') + endif + endif + let s:ruby_paths = g:ruby_default_path + let s:ruby_path = s:build_path(s:ruby_paths) +endif + +if stridx(&l:path, s:ruby_path) == -1 + let &l:path = s:ruby_path +endif +if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val."/tags"'),',')) == -1 + let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',') +endif + +if has("gui_win32") && !exists("b:browsefilter") + let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n" . + \ "All Files (*.*)\t*.*\n" +endif + +let b:undo_ftplugin = "setl fo< inc< inex< sua< def< com< cms< path< tags< kp<" + \."| unlet! b:browsefilter b:match_ignorecase b:match_words b:match_skip" + \."| if exists('&ofu') && has('ruby') | setl ofu< | endif" + \."| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif" + +if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps") + nnoremap [m :call searchsyn('\','rubyDefine','b','n') + nnoremap ]m :call searchsyn('\','rubyDefine','','n') + nnoremap [M :call searchsyn('\','rubyDefine','b','n') + nnoremap ]M :call searchsyn('\','rubyDefine','','n') + xnoremap [m :call searchsyn('\','rubyDefine','b','v') + xnoremap ]m :call searchsyn('\','rubyDefine','','v') + xnoremap [M :call searchsyn('\','rubyDefine','b','v') + xnoremap ]M :call searchsyn('\','rubyDefine','','v') + + nnoremap [[ :call searchsyn('\<\%(class\module\)\>','rubyModule\rubyClass','b','n') + nnoremap ]] :call searchsyn('\<\%(class\module\)\>','rubyModule\rubyClass','','n') + nnoremap [] :call searchsyn('\','rubyModule\rubyClass','b','n') + nnoremap ][ :call searchsyn('\','rubyModule\rubyClass','','n') + xnoremap [[ :call searchsyn('\<\%(class\module\)\>','rubyModule\rubyClass','b','v') + xnoremap ]] :call searchsyn('\<\%(class\module\)\>','rubyModule\rubyClass','','v') + xnoremap [] :call searchsyn('\','rubyModule\rubyClass','b','v') + xnoremap ][ :call searchsyn('\','rubyModule\rubyClass','','v') + + let b:undo_ftplugin = b:undo_ftplugin + \."| sil! exe 'unmap [[' | sil! exe 'unmap ]]' | sil! exe 'unmap []' | sil! exe 'unmap ]['" + \."| sil! exe 'unmap [m' | sil! exe 'unmap ]m' | sil! exe 'unmap [M' | sil! exe 'unmap ]M'" + + if maparg('im','n') == '' + onoremap im :call wrap_i('[m',']M') + onoremap am :call wrap_a('[m',']M') + xnoremap im :call wrap_i('[m',']M') + xnoremap am :call wrap_a('[m',']M') + let b:undo_ftplugin = b:undo_ftplugin + \."| sil! exe 'ounmap im' | sil! exe 'ounmap am'" + \."| sil! exe 'xunmap im' | sil! exe 'xunmap am'" + endif + + if maparg('iM','n') == '' + onoremap iM :call wrap_i('[[','][') + onoremap aM :call wrap_a('[[','][') + xnoremap iM :call wrap_i('[[','][') + xnoremap aM :call wrap_a('[[','][') + let b:undo_ftplugin = b:undo_ftplugin + \."| sil! exe 'ounmap iM' | sil! exe 'ounmap aM'" + \."| sil! exe 'xunmap iM' | sil! exe 'xunmap aM'" + endif + + if maparg("\",'n') == '' + nnoremap :exe v:count1."tag =RubyCursorIdentifier()" + nnoremap g :exe "tjump =RubyCursorIdentifier()" + nnoremap g] :exe "tselect =RubyCursorIdentifier()" + nnoremap ] :exe v:count1."stag =RubyCursorIdentifier()" + nnoremap :exe v:count1."stag =RubyCursorIdentifier()" + nnoremap g :exe "stjump =RubyCursorIdentifier()" + nnoremap g] :exe "stselect =RubyCursorIdentifier()" + nnoremap } :exe "ptag =RubyCursorIdentifier()" + nnoremap g} :exe "ptjump =RubyCursorIdentifier()" + let b:undo_ftplugin = b:undo_ftplugin + \."| sil! exe 'nunmap '| sil! exe 'nunmap g'| sil! exe 'nunmap g]'" + \."| sil! exe 'nunmap ]'| sil! exe 'nunmap '" + \."| sil! exe 'nunmap g'| sil! exe 'nunmap g]'" + \."| sil! exe 'nunmap }'| sil! exe 'nunmap g}'" + endif + + if maparg("gf",'n') == '' + " By using findfile() rather than gf's normal behavior, we prevent + " erroneously editing a directory. + nnoremap gf :exe gf(v:count1,"gf",'edit') + nnoremap f :exe gf(v:count1,"\C-W>f",'split') + nnoremap :exe gf(v:count1,"\C-W>\C-F>",'split') + nnoremap gf :exe gf(v:count1,"\C-W>gf",'tabedit') + let b:undo_ftplugin = b:undo_ftplugin + \."| sil! exe 'nunmap gf' | sil! exe 'nunmap f' | sil! exe 'nunmap ' | sil! exe 'nunmap gf'" + endif +endif + +let &cpo = s:cpo_save +unlet s:cpo_save + +if exists("g:did_ruby_ftplugin_functions") + finish +endif +let g:did_ruby_ftplugin_functions = 1 + +function! RubyBalloonexpr() + if !exists('s:ri_found') + let s:ri_found = executable('ri') + endif + if s:ri_found + let line = getline(v:beval_lnum) + let b = matchstr(strpart(line,0,v:beval_col),'\%(\w\|[:.]\)*$') + let a = substitute(matchstr(strpart(line,v:beval_col),'^\w*\%([?!]\|\s*=\)\?'),'\s\+','','g') + let str = b.a + let before = strpart(line,0,v:beval_col-strlen(b)) + let after = strpart(line,v:beval_col+strlen(a)) + if str =~ '^\.' + let str = substitute(str,'^\.','#','g') + if before =~ '\]\s*$' + let str = 'Array'.str + elseif before =~ '}\s*$' + " False positives from blocks here + let str = 'Hash'.str + elseif before =~ "[\"'`]\\s*$" || before =~ '\$\d\+\s*$' + let str = 'String'.str + elseif before =~ '\$\d\+\.\d\+\s*$' + let str = 'Float'.str + elseif before =~ '\$\d\+\s*$' + let str = 'Integer'.str + elseif before =~ '/\s*$' + let str = 'Regexp'.str + else + let str = substitute(str,'^#','.','') + endif + endif + let str = substitute(str,'.*\.\s*to_f\s*\.\s*','Float#','') + let str = substitute(str,'.*\.\s*to_i\%(nt\)\=\s*\.\s*','Integer#','') + let str = substitute(str,'.*\.\s*to_s\%(tr\)\=\s*\.\s*','String#','') + let str = substitute(str,'.*\.\s*to_sym\s*\.\s*','Symbol#','') + let str = substitute(str,'.*\.\s*to_a\%(ry\)\=\s*\.\s*','Array#','') + let str = substitute(str,'.*\.\s*to_proc\s*\.\s*','Proc#','') + if str !~ '^\w' + return '' + endif + silent! let res = substitute(system("ri -f rdoc -T \"".str.'"'),'\n$','','') + if res =~ '^Nothing known about' || res =~ '^Bad argument:' || res =~ '^More than one method' + return '' + endif + return res + else + return "" + endif +endfunction + +function! s:searchsyn(pattern,syn,flags,mode) + norm! m' + if a:mode ==# 'v' + norm! gv + endif + let i = 0 + let cnt = v:count ? v:count : 1 + while i < cnt + let i = i + 1 + let line = line('.') + let col = col('.') + let pos = search(a:pattern,'W'.a:flags) + while pos != 0 && s:synname() !~# a:syn + let pos = search(a:pattern,'W'.a:flags) + endwhile + if pos == 0 + call cursor(line,col) + return + endif + endwhile +endfunction + +function! s:synname() + return synIDattr(synID(line('.'),col('.'),0),'name') +endfunction + +function! s:wrap_i(back,forward) + execute 'norm k'.a:forward + let line = line('.') + execute 'norm '.a:back + if line('.') == line - 1 + return s:wrap_a(a:back,a:forward) + endif + execute 'norm jV'.a:forward.'k' +endfunction + +function! s:wrap_a(back,forward) + execute 'norm '.a:forward + if line('.') < line('$') && getline(line('.')+1) ==# '' + let after = 1 + endif + execute 'norm '.a:back + while getline(line('.')-1) =~# '^\s*#' && line('.') + - + endwhile + if exists('after') + execute 'norm V'.a:forward.'j' + elseif line('.') > 1 && getline(line('.')-1) =~# '^\s*$' + execute 'norm kV'.a:forward + else + execute 'norm V'.a:forward + endif +endfunction + +function! RubyCursorIdentifier() + let asciicode = '\%(\w\|[]})\"'."'".']\)\@\|\<0[xXbBoOdD][[:xdigit:]_]\+\>\)\|'.asciicode + let operator = '\%(\[\]\|<<\|<=>\|[!<>]=\=\|===\=\|[!=]\~\|>>\|\*\*\|\.\.\.\=\|=>\|[~^&|*/%+-]\)' + let method = '\%(\<[_a-zA-Z]\w*\>\%([?!]\|\s*=>\@!\)\=\)' + let global = '$\%([!$&"'."'".'*+,./:;<=>?@\`~]\|-\=\w\+\>\)' + let symbolizable = '\%(\%(@@\=\)\w\+\>\|'.global.'\|'.method.'\|'.operator.'\)' + let pattern = '\C\s*\%('.number.'\|\%(:\@") : stripped +endfunction + +function! s:gf(count,map,edit) abort + if getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$' + let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') + return a:edit.' %:h/'.target.'.rb' + elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$' + let target = matchstr(getline('.'),'\(["'']\)\.\./\zs.\{-\}\ze\1') + return a:edit.' %:h/'.target.'.rb' + elseif getline('.') =~# '^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'']\).*\1\s*$' + let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') + else + let target = expand('') + endif + let found = findfile(target, &path, a:count) + if found ==# '' + return 'norm! '.a:count.a:map + else + return a:edit.' '.fnameescape(found) + endif +endfunction + +" +" Instructions for enabling "matchit" support: +" +" 1. Look for the latest "matchit" plugin at +" +" http://www.vim.org/scripts/script.php?script_id=39 +" +" It is also packaged with Vim, in the $VIMRUNTIME/macros directory. +" +" 2. Copy "matchit.txt" into a "doc" directory (e.g. $HOME/.vim/doc). +" +" 3. Copy "matchit.vim" into a "plugin" directory (e.g. $HOME/.vim/plugin). +" +" 4. Ensure this file (ftplugin/ruby.vim) is installed. +" +" 5. Ensure you have this line in your $HOME/.vimrc: +" filetype plugin on +" +" 6. Restart Vim and create the matchit documentation: +" +" :helptags ~/.vim/doc +" +" Now you can do ":help matchit", and you should be able to use "%" on Ruby +" keywords. Try ":echo b:match_words" to be sure. +" +" Thanks to Mark J. Reed for the instructions. See ":help vimrc" for the +" locations of plugin directories, etc., as there are several options, and it +" differs on Windows. Email gsinclair@soyabean.com.au if you need help. +" + +" vim: nowrap sw=2 sts=2 ts=8: diff --git a/sources_non_forked/vim-ruby/indent/eruby.vim b/sources_non_forked/vim-ruby/indent/eruby.vim new file mode 100644 index 00000000..80cab700 --- /dev/null +++ b/sources_non_forked/vim-ruby/indent/eruby.vim @@ -0,0 +1,82 @@ +" Vim indent file +" Language: eRuby +" Maintainer: Tim Pope +" URL: https://github.com/vim-ruby/vim-ruby +" Release Coordinator: Doug Kearns + +if exists("b:did_indent") + finish +endif + +runtime! indent/ruby.vim +unlet! b:did_indent +setlocal indentexpr= + +if exists("b:eruby_subtype") + exe "runtime! indent/".b:eruby_subtype.".vim" +else + runtime! indent/html.vim +endif +unlet! b:did_indent + +if &l:indentexpr == '' + if &l:cindent + let &l:indentexpr = 'cindent(v:lnum)' + else + let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))' + endif +endif +let b:eruby_subtype_indentexpr = &l:indentexpr + +let b:did_indent = 1 + +setlocal indentexpr=GetErubyIndent() +setlocal indentkeys=o,O,*,<>>,{,},0),0],o,O,!^F,=end,=else,=elsif,=rescue,=ensure,=when + +" Only define the function once. +if exists("*GetErubyIndent") + finish +endif + +function! GetErubyIndent(...) + if a:0 && a:1 == '.' + let v:lnum = line('.') + elseif a:0 && a:1 =~ '^\d' + let v:lnum = a:1 + endif + let vcol = col('.') + call cursor(v:lnum,1) + let inruby = searchpair('<%','','%>','W') + call cursor(v:lnum,vcol) + if inruby && getline(v:lnum) !~ '^<%\|^\s*[-=]\=%>' + let ind = GetRubyIndent(v:lnum) + else + exe "let ind = ".b:eruby_subtype_indentexpr + endif + let lnum = prevnonblank(v:lnum-1) + let line = getline(lnum) + let cline = getline(v:lnum) + if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)' + let ind = ind - &sw + endif + if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)' + let ind = ind - &sw + endif + if line =~# '\%({\|\' + let ind = ind + &sw + elseif line =~# '<%[-=]\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>' + let ind = ind + &sw + endif + if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>' + let ind = ind + &sw + endif + if line !~# '^\s*<%' && line =~# '%>\s*$' + let ind = ind - &sw + endif + if cline =~# '^\s*[-=]\=%>\s*$' + let ind = ind - &sw + endif + return ind +endfunction + +" vim:set sw=2 sts=2 ts=8 noet: diff --git a/sources_non_forked/vim-ruby/indent/ruby.vim b/sources_non_forked/vim-ruby/indent/ruby.vim new file mode 100644 index 00000000..095b3a43 --- /dev/null +++ b/sources_non_forked/vim-ruby/indent/ruby.vim @@ -0,0 +1,537 @@ +" Vim indent file +" Language: Ruby +" Maintainer: Nikolai Weibull +" URL: https://github.com/vim-ruby/vim-ruby +" Release Coordinator: Doug Kearns + +" 0. Initialization {{{1 +" ================= + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal nosmartindent + +" Now, set up our indentation expression and keys that trigger it. +setlocal indentexpr=GetRubyIndent(v:lnum) +setlocal indentkeys=0{,0},0),0],!^F,o,O,e +setlocal indentkeys+==end,=else,=elsif,=when,=ensure,=rescue,==begin,==end + +" Only define the function once. +if exists("*GetRubyIndent") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +" 1. Variables {{{1 +" ============ + +" Regex of syntax group names that are or delimit strings/symbols or are comments. +let s:syng_strcom = '\' + +" Regex of syntax group names that are strings. +let s:syng_string = + \ '\' + +" Regex of syntax group names that are strings or documentation. +let s:syng_stringdoc = + \'\' + +" Expression used to check whether we should skip a match with searchpair(). +let s:skip_expr = + \ "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'" + +" Regex used for words that, at the start of a line, add a level of indent. +let s:ruby_indent_keywords = '^\s*\zs\<\%(module\|class\|def\|if\|for' . + \ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure' . + \ '\|rescue\):\@!\>' . + \ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' . + \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' + +" Regex used for words that, at the start of a line, remove a level of indent. +let s:ruby_deindent_keywords = + \ '^\s*\zs\<\%(ensure\|else\|rescue\|elsif\|when\|end\):\@!\>' + +" Regex that defines the start-match for the 'end' keyword. +"let s:end_start_regex = '\%(^\|[^.]\)\<\%(module\|class\|def\|if\|for\|while\|until\|case\|unless\|begin\|do\)\>' +" TODO: the do here should be restricted somewhat (only at end of line)? +let s:end_start_regex = + \ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' . + \ '\<\%(module\|class\|def\|if\|for\|while\|until\|case\|unless\|begin\):\@!\>' . + \ '\|\%(^\|[^.:@$]\)\@<=\' + +" Regex that defines the middle-match for the 'end' keyword. +let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\\|when\|elsif\):\@!\>' + +" Regex that defines the end-match for the 'end' keyword. +let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\' + +" Expression used for searchpair() call for finding match for 'end' keyword. +let s:end_skip_expr = s:skip_expr . + \ ' || (expand("") == "do"' . + \ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\):\\@!\\>")' + +" Regex that defines continuation lines, not including (, {, or [. +let s:non_bracket_continuation_regex = '\%([\\.,:*/%+]\|\\|%\@ 0 + " Go in and out of blocks comments as necessary. + " If the line isn't empty (with opt. comment) or in a string, end search. + let line = getline(lnum) + if line =~ '^=begin' + if in_block + let in_block = 0 + else + break + endif + elseif !in_block && line =~ '^=end' + let in_block = 1 + elseif !in_block && line !~ '^\s*#.*$' && !(s:IsInStringOrComment(lnum, 1) + \ && s:IsInStringOrComment(lnum, strlen(line))) + break + endif + let lnum = prevnonblank(lnum - 1) + endwhile + return lnum +endfunction + +" Find line above 'lnum' that started the continuation 'lnum' may be part of. +function s:GetMSL(lnum) + " Start on the line we're at and use its indent. + let msl = a:lnum + let msl_body = getline(msl) + let lnum = s:PrevNonBlankNonString(a:lnum - 1) + while lnum > 0 + " If we have a continuation line, or we're in a string, use line as MSL. + " Otherwise, terminate search as we have found our MSL already. + let line = getline(lnum) + + if s:Match(lnum, s:splat_regex) + " If the above line looks like the "*" of a splat, use the current one's + " indentation. + " + " Example: + " Hash[* + " method_call do + " something + " + return msl + elseif s:Match(line, s:non_bracket_continuation_regex) && + \ s:Match(msl, s:non_bracket_continuation_regex) + " If the current line is a non-bracket continuation and so is the + " previous one, keep its indent and continue looking for an MSL. + " + " Example: + " method_call one, + " two, + " three + " + let msl = lnum + elseif s:Match(lnum, s:non_bracket_continuation_regex) && + \ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex)) + " If the current line is a bracket continuation or a block-starter, but + " the previous is a non-bracket one, respect the previous' indentation, + " and stop here. + " + " Example: + " method_call one, + " two { + " three + " + return lnum + elseif s:Match(lnum, s:bracket_continuation_regex) && + \ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex)) + " If both lines are bracket continuations (the current may also be a + " block-starter), use the current one's and stop here + " + " Example: + " method_call( + " other_method_call( + " foo + return msl + elseif s:Match(lnum, s:block_regex) && + \ !s:Match(msl, s:continuation_regex) && + \ !s:Match(msl, s:block_continuation_regex) + " If the previous line is a block-starter and the current one is + " mostly ordinary, use the current one as the MSL. + " + " Example: + " method_call do + " something + " something_else + return msl + else + let col = match(line, s:continuation_regex) + 1 + if (col > 0 && !s:IsInStringOrComment(lnum, col)) + \ || s:IsInString(lnum, strlen(line)) + let msl = lnum + else + break + endif + endif + + let msl_body = getline(msl) + let lnum = s:PrevNonBlankNonString(lnum - 1) + endwhile + return msl +endfunction + +" Check if line 'lnum' has more opening brackets than closing ones. +function s:ExtraBrackets(lnum) + let opening = {'parentheses': [], 'braces': [], 'brackets': []} + let closing = {'parentheses': [], 'braces': [], 'brackets': []} + + let line = getline(a:lnum) + let pos = match(line, '[][(){}]', 0) + + " Save any encountered opening brackets, and remove them once a matching + " closing one has been found. If a closing bracket shows up that doesn't + " close anything, save it for later. + while pos != -1 + if !s:IsInStringOrComment(a:lnum, pos + 1) + if line[pos] == '(' + call add(opening.parentheses, {'type': '(', 'pos': pos}) + elseif line[pos] == ')' + if empty(opening.parentheses) + call add(closing.parentheses, {'type': ')', 'pos': pos}) + else + let opening.parentheses = opening.parentheses[0:-2] + endif + elseif line[pos] == '{' + call add(opening.braces, {'type': '{', 'pos': pos}) + elseif line[pos] == '}' + if empty(opening.braces) + call add(closing.braces, {'type': '}', 'pos': pos}) + else + let opening.braces = opening.braces[0:-2] + endif + elseif line[pos] == '[' + call add(opening.brackets, {'type': '[', 'pos': pos}) + elseif line[pos] == ']' + if empty(opening.brackets) + call add(closing.brackets, {'type': ']', 'pos': pos}) + else + let opening.brackets = opening.brackets[0:-2] + endif + endif + endif + + let pos = match(line, '[][(){}]', pos + 1) + endwhile + + " Find the rightmost brackets, since they're the ones that are important in + " both opening and closing cases + let rightmost_opening = {'type': '(', 'pos': -1} + let rightmost_closing = {'type': ')', 'pos': -1} + + for opening in opening.parentheses + opening.braces + opening.brackets + if opening.pos > rightmost_opening.pos + let rightmost_opening = opening + endif + endfor + + for closing in closing.parentheses + closing.braces + closing.brackets + if closing.pos > rightmost_closing.pos + let rightmost_closing = closing + endif + endfor + + return [rightmost_opening, rightmost_closing] +endfunction + +function s:Match(lnum, regex) + let col = match(getline(a:lnum), '\C'.a:regex) + 1 + return col > 0 && !s:IsInStringOrComment(a:lnum, col) ? col : 0 +endfunction + +function s:MatchLast(lnum, regex) + let line = getline(a:lnum) + let col = match(line, '.*\zs' . a:regex) + while col != -1 && s:IsInStringOrComment(a:lnum, col) + let line = strpart(line, 0, col) + let col = match(line, '.*' . a:regex) + endwhile + return col + 1 +endfunction + +" 3. GetRubyIndent Function {{{1 +" ========================= + +function GetRubyIndent(...) + " 3.1. Setup {{{2 + " ---------- + + " For the current line, use the first argument if given, else v:lnum + let clnum = a:0 ? a:1 : v:lnum + + " Set up variables for restoring position in file. Could use clnum here. + let vcol = col('.') + + " 3.2. Work on the current line {{{2 + " ----------------------------- + + " Get the current line. + let line = getline(clnum) + let ind = -1 + + " If we got a closing bracket on an empty line, find its match and indent + " according to it. For parentheses we indent to its column - 1, for the + " others we indent to the containing line's MSL's level. Return -1 if fail. + let col = matchend(line, '^\s*[]})]') + if col > 0 && !s:IsInStringOrComment(clnum, col) + call cursor(clnum, col) + let bs = strpart('(){}[]', stridx(')}]', line[col - 1]) * 2, 2) + if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0 + if line[col-1]==')' && col('.') != col('$') - 1 + let ind = virtcol('.') - 1 + else + let ind = indent(s:GetMSL(line('.'))) + endif + endif + return ind + endif + + " If we have a =begin or =end set indent to first column. + if match(line, '^\s*\%(=begin\|=end\)$') != -1 + return 0 + endif + + " If we have a deindenting keyword, find its match and indent to its level. + " TODO: this is messy + if s:Match(clnum, s:ruby_deindent_keywords) + call cursor(clnum, 1) + if searchpair(s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'bW', + \ s:end_skip_expr) > 0 + let msl = s:GetMSL(line('.')) + let line = getline(line('.')) + + if strpart(line, 0, col('.') - 1) =~ '=\s*$' && + \ strpart(line, col('.') - 1, 2) !~ 'do' + let ind = virtcol('.') - 1 + elseif getline(msl) =~ '=\s*\(#.*\)\=$' + let ind = indent(line('.')) + else + let ind = indent(msl) + endif + endif + return ind + endif + + " If we are in a multi-line string or line-comment, don't do anything to it. + if s:IsInStringOrDocumentation(clnum, matchend(line, '^\s*') + 1) + return indent('.') + endif + + " If we are at the closing delimiter of a "<<" heredoc-style string, set the + " indent to 0. + if line =~ '^\k\+\s*$' + \ && s:IsInStringDelimiter(clnum, 1) + \ && search('\V<<'.line, 'nbW') > 0 + return 0 + endif + + " 3.3. Work on the previous line. {{{2 + " ------------------------------- + + " Find a non-blank, non-multi-line string line above the current line. + let lnum = s:PrevNonBlankNonString(clnum - 1) + + " If the line is empty and inside a string, use the previous line. + if line =~ '^\s*$' && lnum != prevnonblank(clnum - 1) + return indent(prevnonblank(clnum)) + endif + + " At the start of the file use zero indent. + if lnum == 0 + return 0 + endif + + " Set up variables for the previous line. + let line = getline(lnum) + let ind = indent(lnum) + + " If the previous line ended with a block opening, add a level of indent. + if s:Match(lnum, s:block_regex) + return indent(s:GetMSL(lnum)) + &sw + endif + + " If the previous line ended with the "*" of a splat, add a level of indent + if line =~ s:splat_regex + return indent(lnum) + &sw + endif + + " If the previous line contained unclosed opening brackets and we are still + " in them, find the rightmost one and add indent depending on the bracket + " type. + " + " If it contained hanging closing brackets, find the rightmost one, find its + " match and indent according to that. + if line =~ '[[({]' || line =~ '[])}]\s*\%(#.*\)\=$' + let [opening, closing] = s:ExtraBrackets(lnum) + + if opening.pos != -1 + if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0 + if col('.') + 1 == col('$') + return ind + &sw + else + return virtcol('.') + endif + else + let nonspace = matchend(line, '\S', opening.pos + 1) - 1 + return nonspace > 0 ? nonspace : ind + &sw + endif + elseif closing.pos != -1 + call cursor(lnum, closing.pos + 1) + normal! % + + if s:Match(line('.'), s:ruby_indent_keywords) + return indent('.') + &sw + else + return indent('.') + endif + else + call cursor(clnum, vcol) + end + endif + + " If the previous line ended with an "end", match that "end"s beginning's + " indent. + let col = s:Match(lnum, '\%(^\|[^.:@$]\)\\s*\%(#.*\)\=$') + if col > 0 + call cursor(lnum, col) + if searchpair(s:end_start_regex, '', s:end_end_regex, 'bW', + \ s:end_skip_expr) > 0 + let n = line('.') + let ind = indent('.') + let msl = s:GetMSL(n) + if msl != n + let ind = indent(msl) + end + return ind + endif + end + + let col = s:Match(lnum, s:ruby_indent_keywords) + if col > 0 + call cursor(lnum, col) + let ind = virtcol('.') - 1 + &sw + " TODO: make this better (we need to count them) (or, if a searchpair + " fails, we know that something is lacking an end and thus we indent a + " level + if s:Match(lnum, s:end_end_regex) + let ind = indent('.') + endif + return ind + endif + + " 3.4. Work on the MSL line. {{{2 + " -------------------------- + + " Set up variables to use and search for MSL to the previous line. + let p_lnum = lnum + let lnum = s:GetMSL(lnum) + + " If the previous line wasn't a MSL and is continuation return its indent. + " TODO: the || s:IsInString() thing worries me a bit. + if p_lnum != lnum + if s:Match(p_lnum, s:non_bracket_continuation_regex) || s:IsInString(p_lnum,strlen(line)) + return ind + endif + endif + + " Set up more variables, now that we know we wasn't continuation bound. + let line = getline(lnum) + let msl_ind = indent(lnum) + + " If the MSL line had an indenting keyword in it, add a level of indent. + " TODO: this does not take into account contrived things such as + " module Foo; class Bar; end + if s:Match(lnum, s:ruby_indent_keywords) + let ind = msl_ind + &sw + if s:Match(lnum, s:end_end_regex) + let ind = ind - &sw + endif + return ind + endif + + " If the previous line ended with [*+/.,-=], but wasn't a block ending or a + " closing bracket, indent one extra level. + if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)') + if lnum == p_lnum + let ind = msl_ind + &sw + else + let ind = msl_ind + endif + return ind + endif + + " }}}2 + + return ind +endfunction + +" }}}1 + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim:set sw=2 sts=2 ts=8 et: diff --git a/sources_non_forked/vim-ruby/spec/indent/arguments_spec.rb b/sources_non_forked/vim-ruby/spec/indent/arguments_spec.rb new file mode 100644 index 00000000..39837409 --- /dev/null +++ b/sources_non_forked/vim-ruby/spec/indent/arguments_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +describe "Indenting" do + specify "multi-line arguments" do + assert_correct_indenting <<-EOF + User.new( + :first_name => 'Some', + :second_name => 'Guy' + ) + EOF + + assert_correct_indenting <<-EOF + User.new(:first_name => 'Some', + :second_name => 'Guy') + EOF + + assert_correct_indenting <<-EOF + User.new( + :first_name => 'Some', + :second_name => 'Guy' + ) + EOF + end +end diff --git a/sources_non_forked/vim-ruby/spec/indent/basic_spec.rb b/sources_non_forked/vim-ruby/spec/indent/basic_spec.rb new file mode 100644 index 00000000..8ef872ff --- /dev/null +++ b/sources_non_forked/vim-ruby/spec/indent/basic_spec.rb @@ -0,0 +1,42 @@ +require 'spec_helper' + +describe "Indenting" do + specify "if-clauses" do + assert_correct_indenting <<-EOF + if foo + bar + end + EOF + + assert_correct_indenting <<-EOF + if foo + bar + else + baz + end + EOF + + assert_correct_indenting <<-EOF + bar if foo + something_else + EOF + end + + specify "heredocs" do + assert_correct_indenting <<-EOF + def one + two = <<-THREE + four + THREE + end + EOF + + assert_correct_indenting <<-EOF + def one + two = < 'bar'} + end + EOF + + assert_correct_indenting <<-EOF + def foo(job) + job.do! + end + EOF + end + + specify "blocks with multiline parameters" do + assert_correct_indenting <<-EOF + def foo + opts.on('--coordinator host=HOST[,port=PORT]', + 'Specify the HOST and the PORT of the coordinator') do |str| + h = sub_opts_to_hash(str) + puts h + end + end + EOF + end + + specify "case-insensitive matching" do + @vim.set 'ignorecase' + assert_correct_indenting <<-EOF + module X + Class.new do + end + end + EOF + @vim.set 'ignorecase&' + end + + specify "blocks with tuple arguments" do + assert_correct_indenting <<-EOF + proc do |(a, b)| + puts a + puts b + end + EOF + + assert_correct_indenting <<-EOF + proc do |foo, (a, b), bar| + puts a + puts b + end + EOF + + assert_correct_indenting <<-EOF + proc do |(a, (b, c)), d| + puts a, b + puts c, d + end + EOF + end +end diff --git a/sources_non_forked/vim-ruby/spec/indent/continuations_spec.rb b/sources_non_forked/vim-ruby/spec/indent/continuations_spec.rb new file mode 100644 index 00000000..b24d0f89 --- /dev/null +++ b/sources_non_forked/vim-ruby/spec/indent/continuations_spec.rb @@ -0,0 +1,142 @@ +require 'spec_helper' + +describe "Indenting" do + specify "arrays" do + assert_correct_indenting <<-EOF + foo = [one, + two, + three] + EOF + end + + specify "tricky string interpolation" do + # See https://github.com/vim-ruby/vim-ruby/issues/75 for details + assert_correct_indenting <<-EOF + puts %{\#{}} + puts "OK" + EOF + + assert_correct_indenting <<-EOF + while true + begin + puts %{\#{x}} + rescue ArgumentError + end + end + EOF + end + + specify "continuations after round braces" do + assert_correct_indenting <<-EOF + opts.on('--coordinator host=HOST[,port=PORT]', + 'Specify the HOST and the PORT of the coordinator') do |str| + h = sub_opts_to_hash(str) + puts h + end + EOF + end + + specify "continuations after assignment" do + assert_correct_indenting <<-EOF + variable = + if condition? + 1 + else + 2 + end + EOF + + assert_correct_indenting <<-EOF + variable = # evil comment + case something + when 'something' + something_else + else + other + end + EOF + end + + specify "continuations after hanging comma" do + assert_correct_indenting <<-EOF + array = [ + :one, + ].each do |x| + puts x.to_s + end + EOF + end + + specify "string interpolation" do + # See https://github.com/vim-ruby/vim-ruby/issues/93 for details + assert_correct_indenting <<-EOF + command = %|\#{file}| + settings.log.info("Returning: \#{command}") + EOF + end + + specify "closing bracket not on its own line" do + # See https://github.com/vim-ruby/vim-ruby/issues/81 for details + assert_correct_indenting <<-EOF + one { two >> + three } + four + EOF + end + + specify "lonesome single parenthesis in a method definition" do + # See https://github.com/vim-ruby/vim-ruby/issues/130 for details + assert_correct_indenting <<-EOF + def bar( + baz + ) + return baz+1 + end + EOF + end + + specify "brackets on their own line, followed by a comma" do + # See https://github.com/vim-ruby/vim-ruby/issues/124 for details + assert_correct_indenting <<-EOF + bla = { + :one => [ + {:bla => :blub} + ], + :two => ( + {:blub => :abc} + ), + :three => { + :blub => :abc + }, + :four => 'five' + } + EOF + end + + specify "string with an and#" do + # See https://github.com/vim-ruby/vim-ruby/issues/108 for details + assert_correct_indenting <<-EOF + outside_block "and#" do + inside_block do + end + end + EOF + end + + specify "continuation with a symbol at the end" do + # See https://github.com/vim-ruby/vim-ruby/issues/132 for details + assert_correct_indenting <<-EOF + foo = :+ + # Next indents correctly + EOF + end + + specify "continuation with a hanging comma" do + # See https://github.com/vim-ruby/vim-ruby/issues/139 for details + assert_correct_indenting <<-EOF + thing :foo + thing 'a', + 'b' + EOF + end +end diff --git a/sources_non_forked/vim-ruby/spec/indent/end_constructs_spec.rb b/sources_non_forked/vim-ruby/spec/indent/end_constructs_spec.rb new file mode 100644 index 00000000..e9ae7dad --- /dev/null +++ b/sources_non_forked/vim-ruby/spec/indent/end_constructs_spec.rb @@ -0,0 +1,31 @@ +require 'spec_helper' + +describe "Indenting" do + specify "end constructs" do + assert_correct_indenting <<-EOF + f do + g { def h; end } + end + EOF + + assert_correct_indenting <<-EOF + if foo + bar ; end + something_else + EOF + + assert_correct_indenting <<-EOF + if bar ; end + something_else + EOF + + assert_correct_indenting <<-EOF + foo do + foo = 3 . class + foo = lambda { class One; end } + foo = lambda { |args| class One; end } + foo = bar; class One; end + end + EOF + end +end diff --git a/sources_non_forked/vim-ruby/spec/indent/nesting_spec.rb b/sources_non_forked/vim-ruby/spec/indent/nesting_spec.rb new file mode 100644 index 00000000..7a09d855 --- /dev/null +++ b/sources_non_forked/vim-ruby/spec/indent/nesting_spec.rb @@ -0,0 +1,66 @@ +require 'spec_helper' + +describe "Indenting" do + specify "nested blocks" do + assert_correct_indenting <<-EOF + var.func1(:param => 'value') do + var.func2(:param => 'value') do + puts "test" + end + end + EOF + + assert_correct_indenting <<-EOF + var.func1(:param => 'value') { + var.func2(:param => 'value') { + foo({ bar => baz }) + puts "test one" + puts "test two" + } + } + EOF + + assert_correct_indenting <<-EOF + var. + func1(:param => 'value') { + var.func2(:param => 'value') { + puts "test" + } + } + EOF + end + + specify "nested hashes" do + assert_correct_indenting <<-EOF + foo, bar = { + :bar => { + :one => 'two', + :five => 'six' + } + } + EOF + + assert_correct_indenting <<-EOF + foo, + bar = { + :bar => { + :foo => { 'bar' => 'baz' }, + :one => 'two', + :three => 'four' + } + } + EOF + end + + specify "nested blocks with a continuation and function call inbetween" do + assert_correct_indenting <<-EOF + var. + func1(:param => 'value') { + func1_5(:param => 'value') + var.func2(:param => 'value') { + puts "test" + } + } + EOF + end +end diff --git a/sources_non_forked/vim-ruby/spec/indent/splat_spec.rb b/sources_non_forked/vim-ruby/spec/indent/splat_spec.rb new file mode 100644 index 00000000..235f2528 --- /dev/null +++ b/sources_non_forked/vim-ruby/spec/indent/splat_spec.rb @@ -0,0 +1,46 @@ +require 'spec_helper' + +describe "Indenting" do + specify "splats with blocks in square brackets" do + assert_correct_indenting <<-EOF + x = Foo[* + y do + z + end + ] + EOF + + assert_correct_indenting <<-EOF + x = Foo[* # with a comment + y do + z + end + ] + EOF + end + + specify "splats with blocks in assignment" do + assert_correct_indenting <<-EOF + x = * + array.map do + 3 + end + EOF + end + + specify "splats with blocks in round brackets" do + assert_correct_indenting <<-EOF + x = Foo(*y do + z + end) + EOF + + assert_correct_indenting <<-EOF + x = Foo( + *y do + z + end + ) + EOF + end +end diff --git a/sources_non_forked/vim-ruby/spec/spec_helper.rb b/sources_non_forked/vim-ruby/spec/spec_helper.rb new file mode 100644 index 00000000..a11bb6f1 --- /dev/null +++ b/sources_non_forked/vim-ruby/spec/spec_helper.rb @@ -0,0 +1,44 @@ +require 'tmpdir' +require 'vimrunner' + +module Support + def assert_correct_indenting(string) + whitespace = string.scan(/^\s*/).first + string = string.split("\n").map { |line| line.gsub /^#{whitespace}/, '' }.join("\n").strip + + File.open 'test.rb', 'w' do |f| + f.write string + end + + @vim.edit 'test.rb' + @vim.normal 'gg=G' + @vim.write + + IO.read('test.rb').strip.should eq string + end +end + +RSpec.configure do |config| + include Support + + config.before(:suite) do + VIM = Vimrunner.start_gvim + VIM.prepend_runtimepath(File.expand_path('../..', __FILE__)) + end + + config.after(:suite) do + VIM.kill + end + + config.around(:each) do |example| + @vim = VIM + + # cd into a temporary directory for every example. + Dir.mktmpdir do |dir| + Dir.chdir(dir) do + @vim.command("cd #{dir}") + example.call + end + end + end +end diff --git a/sources_non_forked/vim-ruby/syntax/eruby.vim b/sources_non_forked/vim-ruby/syntax/eruby.vim new file mode 100644 index 00000000..c20b086b --- /dev/null +++ b/sources_non_forked/vim-ruby/syntax/eruby.vim @@ -0,0 +1,74 @@ +" Vim syntax file +" Language: eRuby +" Maintainer: Tim Pope +" URL: https://github.com/vim-ruby/vim-ruby +" Release Coordinator: Doug Kearns + +if exists("b:current_syntax") + finish +endif + +if !exists("main_syntax") + let main_syntax = 'eruby' +endif + +if !exists("g:eruby_default_subtype") + let g:eruby_default_subtype = "html" +endif + +if &filetype =~ '^eruby\.' + let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+') +elseif !exists("b:eruby_subtype") && main_syntax == 'eruby' + let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") + let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') + if b:eruby_subtype == '' + let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$') + endif + if b:eruby_subtype == 'rhtml' + let b:eruby_subtype = 'html' + elseif b:eruby_subtype == 'rb' + let b:eruby_subtype = 'ruby' + elseif b:eruby_subtype == 'yml' + let b:eruby_subtype = 'yaml' + elseif b:eruby_subtype == 'js' + let b:eruby_subtype = 'javascript' + elseif b:eruby_subtype == 'txt' + " Conventional; not a real file type + let b:eruby_subtype = 'text' + elseif b:eruby_subtype == '' + let b:eruby_subtype = g:eruby_default_subtype + endif +endif + +if !exists("b:eruby_nest_level") + let b:eruby_nest_level = strlen(substitute(substitute(substitute(expand("%:t"),'@','','g'),'\c\.\%(erb\|rhtml\)\>','@','g'),'[^@]','','g')) +endif +if !b:eruby_nest_level + let b:eruby_nest_level = 1 +endif + +if exists("b:eruby_subtype") && b:eruby_subtype != '' + exe "runtime! syntax/".b:eruby_subtype.".vim" + unlet! b:current_syntax +endif +syn include @rubyTop syntax/ruby.vim + +syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,erubyComment + +exe 'syn region erubyOneLiner matchgroup=erubyDelimiter start="^%\{1,'.b:eruby_nest_level.'\}%\@!" end="$" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend oneline' +exe 'syn region erubyBlock matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}%\@!-\=" end="[=-]\=%\@" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend' +exe 'syn region erubyExpression matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}=\{1,4}" end="[=-]\=%\@" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend' +exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}-\=#" end="[=-]\=%\@" contains=rubyTodo,@Spell containedin=ALLBUT,@erubyRegions keepend' + +" Define the default highlighting. + +hi def link erubyDelimiter PreProc +hi def link erubyComment Comment + +let b:current_syntax = 'eruby' + +if main_syntax == 'eruby' + unlet main_syntax +endif + +" vim: nowrap sw=2 sts=2 ts=8: diff --git a/sources_non_forked/vim-ruby/syntax/ruby.vim b/sources_non_forked/vim-ruby/syntax/ruby.vim new file mode 100644 index 00000000..3b262677 --- /dev/null +++ b/sources_non_forked/vim-ruby/syntax/ruby.vim @@ -0,0 +1,369 @@ +" Vim syntax file +" Language: Ruby +" Maintainer: Doug Kearns +" URL: https://github.com/vim-ruby/vim-ruby +" Release Coordinator: Doug Kearns +" ---------------------------------------------------------------------------- +" +" Previous Maintainer: Mirko Nasato +" Thanks to perl.vim authors, and to Reimer Behrends. :-) (MN) +" ---------------------------------------------------------------------------- + +if exists("b:current_syntax") + finish +endif + +if has("folding") && exists("ruby_fold") + setlocal foldmethod=syntax +endif + +syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo + +if exists("ruby_space_errors") + if !exists("ruby_no_trail_space_error") + syn match rubySpaceError display excludenl "\s\+$" + endif + if !exists("ruby_no_tab_space_error") + syn match rubySpaceError display " \+\t"me=e-1 + endif +endif + +" Operators +if exists("ruby_operators") + syn match rubyOperator "[~!^&|*/%+-]\|\%(class\s*\)\@\|<=\|\%(<\|\>\|>=\|=\@\|\*\*\|\.\.\.\|\.\.\|::" + syn match rubyOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=" + syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop +endif + +" Expression Substitution and Backslash Notation +syn match rubyStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display +syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display +syn match rubyQuoteEscape "\\[\\']" contained display + +syn region rubyInterpolation matchgroup=rubyInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,@rubyNotTop +syn match rubyInterpolation "#\%(\$\|@@\=\)\w\+" display contained contains=rubyInterpolationDelimiter,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable,rubyPredefinedVariable +syn match rubyInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained +syn match rubyInterpolation "#\$\%(-\w\|\W\)" display contained contains=rubyInterpolationDelimiter,rubyPredefinedVariable,rubyInvalidVariable +syn match rubyInterpolationDelimiter "#\ze\$\%(-\w\|\W\)" display contained +syn region rubyNoInterpolation start="\\#{" end="}" contained +syn match rubyNoInterpolation "\\#{" display contained +syn match rubyNoInterpolation "\\#\%(\$\|@@\=\)\w\+" display contained +syn match rubyNoInterpolation "\\#\$\W" display contained + +syn match rubyDelimEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE + +syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained +syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained +syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained +syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained + +" These are mostly Oniguruma ready +syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\)" end=")" contained +syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\)" end=")" contained transparent contains=@rubyRegexpSpecial +syn region rubyRegexpBrackets matchgroup=rubyRegexpCharClass start="\[\^\=" skip="\\\]" end="\]" contained transparent contains=rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass oneline +syn match rubyRegexpCharClass "\\[DdHhSsWw]" contained display +syn match rubyRegexpCharClass "\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\):\]" contained +syn match rubyRegexpEscape "\\[].*?+^$|\\/(){}[]" contained +syn match rubyRegexpQuantifier "[*?+][?+]\=" contained display +syn match rubyRegexpQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display +syn match rubyRegexpAnchor "[$^]\|\\[ABbGZz]" contained display +syn match rubyRegexpDot "\." contained display +syn match rubyRegexpSpecial "|" contained display +syn match rubyRegexpSpecial "\\[1-9]\d\=\d\@!" contained display +syn match rubyRegexpSpecial "\\k<\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\=>" contained display +syn match rubyRegexpSpecial "\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" contained display +syn match rubyRegexpSpecial "\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display +syn match rubyRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display + +syn cluster rubyStringSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape +syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets +syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment + +" Numbers and ASCII Codes +syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@" display +syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@" display +syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@" display +syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@" display +syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@" display +syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@" display + +" Identifiers +syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent +syn match rubyBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent + +syn match rubyConstant "\%(\%(^\|[^.]\)\.\_s*\)\@\%(\s*(\)\@!" +syn match rubyClassVariable "@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display +syn match rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display +syn match rubyGlobalVariable "$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)" +syn match rubySymbol "[]})\"':]\@\|<=\|<\|===\|[=!]=\|[=!]\~\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" +syn match rubySymbol "[]})\"':]\@_,;:!?/.'"@$*\&+0]\)" +syn match rubySymbol "[]})\"':]\@\@!\)\=" +syn match rubySymbol "\%([{(,]\_s*\)\@<=\l\w*[!?]\=::\@!"he=e-1 +syn match rubySymbol "[]})\"':]\@\|{\)\s*\)\@<=|" end="|" oneline display contains=rubyBlockParameter + +syn match rubyInvalidVariable "$[^ A-Za-z_-]" +syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~]# +syn match rubyPredefinedVariable "$\d\+" display +syn match rubyPredefinedVariable "$_\>" display +syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display +syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display +syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display +syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\_s*\)\@\%(\s*(\)\@!" +syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\_s*\)\@\%(\s*(\)\@!" + +" Normal Regular Expression +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold + +" Generalized Regular Expression +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold + +" Normal String and Shell Command Output +syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold +syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,@Spell fold +syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold + +" Generalized Single Quoted String, Symbol and Array of Strings +syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape +syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape +syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape +syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape +syn region rubyString matchgroup=rubyStringDelimiter start="%q " end=" " skip="\\\\\|\\)" fold +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1" skip="\\\\\|\\\z1" fold +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape + +" Generalized Double Quoted String and Array of Strings and Shell Command Output +" Note: %= is not matched here as the beginning of a double quoted string +syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold +syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx] " end=" " skip="\\\\\|\\)" contains=@rubyStringSpecial fold + +" Here Document +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration + +syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter + +" Keywords +" Note: the following keywords have already been defined: +" begin case class def do end for if module unless until while +syn match rubyControl "\<\%(and\|break\|in\|next\|not\|or\|redo\|rescue\|retry\|return\)\>[?!]\@!" +syn match rubyOperator "\[?!]\@!" +syn match rubyBoolean "\<\%(true\|false\)\>[?!]\@!" +syn match rubyPseudoVariable "\<\%(nil\|self\|__ENCODING__\|__FILE__\|__LINE__\|__callee__\|__method__\)\>[?!]\@!" " TODO: reorganise +syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>[?!]\@!" + +" Expensive Mode - match 'end' with the appropriate opening keyword for syntax +" based folding and special highlighting of module/class/method definitions +if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") + syn match rubyDefine "\" nextgroup=rubyAliasDeclaration skipwhite skipnl + syn match rubyDefine "\" nextgroup=rubyMethodDeclaration skipwhite skipnl + syn match rubyDefine "\" nextgroup=rubyFunction skipwhite skipnl + syn match rubyClass "\" nextgroup=rubyClassDeclaration skipwhite skipnl + syn match rubyModule "\" nextgroup=rubyModuleDeclaration skipwhite skipnl + + syn region rubyMethodBlock start="\" matchgroup=rubyDefine end="\%(\" contains=ALLBUT,@rubyNotTop fold + syn region rubyBlock start="\" matchgroup=rubyClass end="\" contains=ALLBUT,@rubyNotTop fold + syn region rubyBlock start="\" matchgroup=rubyModule end="\" contains=ALLBUT,@rubyNotTop fold + + " modifiers + syn match rubyConditionalModifier "\<\%(if\|unless\)\>" display + syn match rubyRepeatModifier "\<\%(while\|until\)\>" display + + syn region rubyDoBlock matchgroup=rubyControl start="\" end="\" contains=ALLBUT,@rubyNotTop fold + " curly bracket block or hash literal + syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop fold + syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@" end="\" contains=ALLBUT,@rubyNotTop fold + syn region rubyCaseExpression matchgroup=rubyConditional start="\" end="\" contains=ALLBUT,@rubyNotTop fold + syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" end="\%(\%(\%(\.\@" contains=ALLBUT,@rubyNotTop fold + + syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression + syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression + + syn match rubyExceptional "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyBlockExpression + syn match rubyMethodExceptional "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyMethodBlock + + " statements with optional 'do' + syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" matchgroup=rubyOptionalDo end="\%(\\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop + syn region rubyRepeatExpression start="\[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" matchgroup=rubyRepeat end="\" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine fold + + if !exists("ruby_minlines") + let ruby_minlines = 500 + endif + exec "syn sync minlines=" . ruby_minlines + +else + syn match rubyControl "\[?!]\@!" nextgroup=rubyMethodDeclaration skipwhite skipnl + syn match rubyControl "\[?!]\@!" nextgroup=rubyClassDeclaration skipwhite skipnl + syn match rubyControl "\[?!]\@!" nextgroup=rubyModuleDeclaration skipwhite skipnl + syn match rubyControl "\<\%(case\|begin\|do\|for\|if\|unless\|while\|until\|else\|elsif\|ensure\|then\|when\|end\)\>[?!]\@!" + syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!" +endif + +" Special Methods +if !exists("ruby_no_special_methods") + syn keyword rubyAccess public protected private public_class_method private_class_method public_constant private_constant module_function + " attr is a common variable name + syn match rubyAttribute "\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!" + syn keyword rubyAttribute attr_accessor attr_reader attr_writer + syn match rubyControl "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>[?!]\@!\)" + syn keyword rubyEval eval class_eval instance_eval module_eval + syn keyword rubyException raise fail catch throw + " false positive with 'include?' + syn match rubyInclude "\[?!]\@!" + syn keyword rubyInclude autoload extend load prepend require require_relative + syn keyword rubyKeyword callcc caller lambda proc +endif + +" Comments and Documentation +syn match rubySharpBang "\%^#!.*" display +syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE XXX todo contained +syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell +if !exists("ruby_no_comment_fold") + syn region rubyMultilineComment start="\%(\%(^\s*#.*\n\)\@" transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE + +syn match rubyKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)[?!]" transparent contains=NONE +syn match rubyKeywordAsMethod "\<\%(if\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE + +syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE + +" __END__ Directive +syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold + +hi def link rubyClass rubyDefine +hi def link rubyModule rubyDefine +hi def link rubyMethodExceptional rubyDefine +hi def link rubyDefine Define +hi def link rubyFunction Function +hi def link rubyConditional Conditional +hi def link rubyConditionalModifier rubyConditional +hi def link rubyExceptional rubyConditional +hi def link rubyRepeat Repeat +hi def link rubyRepeatModifier rubyRepeat +hi def link rubyOptionalDo rubyRepeat +hi def link rubyControl Statement +hi def link rubyInclude Include +hi def link rubyInteger Number +hi def link rubyASCIICode Character +hi def link rubyFloat Float +hi def link rubyBoolean Boolean +hi def link rubyException Exception +if !exists("ruby_no_identifiers") + hi def link rubyIdentifier Identifier +else + hi def link rubyIdentifier NONE +endif +hi def link rubyClassVariable rubyIdentifier +hi def link rubyConstant Type +hi def link rubyGlobalVariable rubyIdentifier +hi def link rubyBlockParameter rubyIdentifier +hi def link rubyInstanceVariable rubyIdentifier +hi def link rubyPredefinedIdentifier rubyIdentifier +hi def link rubyPredefinedConstant rubyPredefinedIdentifier +hi def link rubyPredefinedVariable rubyPredefinedIdentifier +hi def link rubySymbol Constant +hi def link rubyKeyword Keyword +hi def link rubyOperator Operator +hi def link rubyBeginEnd Statement +hi def link rubyAccess Statement +hi def link rubyAttribute Statement +hi def link rubyEval Statement +hi def link rubyPseudoVariable Constant + +hi def link rubyComment Comment +hi def link rubyData Comment +hi def link rubyDataDirective Delimiter +hi def link rubyDocumentation Comment +hi def link rubyTodo Todo + +hi def link rubyQuoteEscape rubyStringEscape +hi def link rubyStringEscape Special +hi def link rubyInterpolationDelimiter Delimiter +hi def link rubyNoInterpolation rubyString +hi def link rubySharpBang PreProc +hi def link rubyRegexpDelimiter rubyStringDelimiter +hi def link rubySymbolDelimiter rubyStringDelimiter +hi def link rubyStringDelimiter Delimiter +hi def link rubyHeredoc rubyString +hi def link rubyString String +hi def link rubyRegexpEscape rubyRegexpSpecial +hi def link rubyRegexpQuantifier rubyRegexpSpecial +hi def link rubyRegexpAnchor rubyRegexpSpecial +hi def link rubyRegexpDot rubyRegexpCharClass +hi def link rubyRegexpCharClass rubyRegexpSpecial +hi def link rubyRegexpSpecial Special +hi def link rubyRegexpComment Comment +hi def link rubyRegexp rubyString + +hi def link rubyInvalidVariable Error +hi def link rubyError Error +hi def link rubySpaceError rubyError + +let b:current_syntax = "ruby" + +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/sources_non_forked/vim-trailing-whitespace/.gitignore b/sources_non_forked/vim-trailing-whitespace/.gitignore new file mode 100644 index 00000000..926ccaaf --- /dev/null +++ b/sources_non_forked/vim-trailing-whitespace/.gitignore @@ -0,0 +1 @@ +doc/tags diff --git a/sources_non_forked/vim-trailing-whitespace/README b/sources_non_forked/vim-trailing-whitespace/README new file mode 100644 index 00000000..9fd024b6 --- /dev/null +++ b/sources_non_forked/vim-trailing-whitespace/README @@ -0,0 +1,9 @@ +This plugin causes all trailing whitespace to be highlighted in red. + +To fix the whitespace errors, just call :FixWhitespace. By default it +operates on the entire file. Pass a range (or use V to select some lines) +to restrict the portion of the file that gets fixed. + +The repo is at http://github.com/bronson/vim-trailing-whitespace + +Originally based on http://vim.wikia.com/wiki/Highlight_unwanted_spaces diff --git a/sources_non_forked/vim-trailing-whitespace/doc/trailing-whitespace.txt b/sources_non_forked/vim-trailing-whitespace/doc/trailing-whitespace.txt new file mode 100644 index 00000000..8974e980 --- /dev/null +++ b/sources_non_forked/vim-trailing-whitespace/doc/trailing-whitespace.txt @@ -0,0 +1,16 @@ +*trailing-whitespace.txt* trailing-whitespace + + +This plugin causes all trailing whitespace to be highlighted in red. + + + *FixWhitespace* + +To fix the whitespace errors, just call :FixWhitespace. By default it +operates on the entire file. Pass a range (or use V to select some lines) +to restrict the portion of the file that gets fixed. + +The repo is at http://github.com/bronson/vim-trailing-whitespace + +Originally based on http://vim.wikia.com/wiki/Highlight_unwanted_spaces + diff --git a/sources_non_forked/vim-trailing-whitespace/plugin/trailing-whitespace.vim b/sources_non_forked/vim-trailing-whitespace/plugin/trailing-whitespace.vim new file mode 100644 index 00000000..5edc29b9 --- /dev/null +++ b/sources_non_forked/vim-trailing-whitespace/plugin/trailing-whitespace.vim @@ -0,0 +1,20 @@ +if exists('loaded_trailing_whitespace_plugin') | finish | endif +let loaded_trailing_whitespace_plugin = 1 + +" Highlight EOL whitespace, http://vim.wikia.com/wiki/Highlight_unwanted_spaces +highlight ExtraWhitespace ctermbg=darkred guibg=#382424 +autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red +autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ + +" The above flashes annoyingly while typing, be calmer in insert mode +autocmd InsertLeave * match ExtraWhitespace /\s\+$/ +autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@FixWhitespace(,) diff --git a/vimrcs/basic.vim b/vimrcs/basic.vim index 66c75335..f3fb5740 100644 --- a/vimrcs/basic.vim +++ b/vimrcs/basic.vim @@ -1,12 +1,12 @@ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Maintainer: +" Maintainer: " Amir Salihefendic " http://amix.dk - amix@amix.dk " -" Version: +" Version: " 5.0 - 29/05/12 15:43:36 " -" Blog_post: +" Blog_post: " http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github " " Awesome_version: @@ -19,7 +19,7 @@ " Syntax_highlighted: " http://amix.dk/vim/vimrc.html " -" Raw_version: +" Raw_version: " http://amix.dk/vim/vimrc.txt " " Sections: @@ -61,9 +61,9 @@ let g:mapleader = "," " Fast saving nmap w :w! -" :W sudo saves the file +" :W sudo saves the file " (useful for handling the permission-denied error) -command W w !sudo tee % > /dev/null +command! W w !sudo tee % > /dev/null """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -73,7 +73,7 @@ command W w !sudo tee % > /dev/null set so=7 " Avoid garbled characters in Chinese language windows OS -let $LANG='en' +let $LANG='en' set langmenu=en source $VIMRUNTIME/delmenu.vim source $VIMRUNTIME/menu.vim @@ -110,23 +110,23 @@ endif " Ignore case when searching set ignorecase -" When searching try to be smart about cases +" When searching try to be smart about cases set smartcase " Highlight search results set hlsearch " Makes search act like search in modern browsers -set incsearch +set incsearch " Don't redraw while executing macros (good performance config) -set lazyredraw +set lazyredraw " For regular expressions turn magic on set magic " Show matching brackets when text indicator is over them -set showmatch +set showmatch " How many tenths of a second to blink when matching brackets set mat=2 @@ -144,7 +144,7 @@ set foldcolumn=1 " => Colors and Fonts """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Enable syntax highlighting -syntax enable +syntax enable try colorscheme desert @@ -176,7 +176,6 @@ set nobackup set nowb set noswapfile - """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Text, tab and indent related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -187,8 +186,8 @@ set expandtab set smarttab " 1 tab == 4 spaces -set shiftwidth=4 -set tabstop=4 +set shiftwidth=2 +set tabstop=2 " Linebreak on 500 characters set lbr @@ -238,8 +237,8 @@ map ba :1,1000 bd! map tn :tabnew map to :tabonly map tc :tabclose -map tm :tabmove -map t :tabnext +map tm :tabmove +map t :tabnext " Let 'tl' toggle between this and the last accessed tab let g:lasttab = 1 @@ -254,7 +253,7 @@ map te :tabedit =expand("%:p:h")/ " Switch CWD to the directory of the open buffer map cd :cd %:p:h:pwd -" Specify the behavior when switching between buffers +" Specify the behavior when switching between buffers try set switchbuf=useopen,usetab,newtab set stal=2 @@ -283,6 +282,9 @@ set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Editing mappings """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Remap ; to : +nnoremap ; : + " Remap VIM 0 to first non-blank character map 0 ^ @@ -300,13 +302,14 @@ if has("mac") || has("macunix") endif " Delete trailing white space on save, useful for Python and CoffeeScript ;) -func! DeleteTrailingWS() - exe "normal mz" - %s/\s\+$//ge - exe "normal `z" -endfunc -autocmd BufWrite *.py :call DeleteTrailingWS() -autocmd BufWrite *.coffee :call DeleteTrailingWS() +"func! DeleteTrailingWS() + "exe "normal mz" + "%s/\s\+$//ge + "exe "normal `z" +"endfunc +"autocmd BufWrite *.py :call DeleteTrailingWS() +"autocmd BufWrite *.coffee :call DeleteTrailingWS() +autocmd BufWritePre * :FixWhitespace """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -317,7 +320,7 @@ autocmd BufWrite *.coffee :call DeleteTrailingWS() vnoremap gv :call VisualSelection('gv', '') " Open Ack and put the cursor in the right position -map g :Ack +map g :Ack " When you press r you can search and replace the selected text vnoremap r :call VisualSelection('replace', '') @@ -377,7 +380,7 @@ function! CmdLine(str) exe "menu Foo.Bar :" . a:str emenu Foo.Bar unmenu Foo -endfunction +endfunction function! VisualSelection(direction, extra_filter) range let l:saved_reg = @" diff --git a/vimrcs/extended.vim b/vimrcs/extended.vim index 255a31cf..a162f000 100644 --- a/vimrcs/extended.vim +++ b/vimrcs/extended.vim @@ -1,5 +1,5 @@ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Important: +" Important: " This requries that you install https://github.com/amix/vimrc ! " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -49,7 +49,7 @@ autocmd! bufwritepost vimrc source ~/.vim_runtime/my_configs.vim """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Turn persistent undo on +" => Turn persistent undo on " means that you can undo even when you close a buffer/VIM """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" try @@ -69,7 +69,7 @@ cno $j e ./ cno $c e eCurrentFileDir("e") " $q is super useful when browsing on the command line -" it deletes everything until the last slash +" it deletes everything until the last slash cno $q eDeleteTillSlash() " Bash like keys for the command line @@ -97,13 +97,13 @@ vnoremap $q `>a'` vnoremap $e `>a"` " Map auto complete of (, ", ', [ -inoremap $1 ()i -inoremap $2 []i -inoremap $3 {}i -inoremap $4 {o}O -inoremap $q ''i -inoremap $e ""i -inoremap $t <>i +"inoremap $1 ()i +"inoremap $2 []i +"inoremap $3 {}i +"inoremap $4 {o}O +"inoremap $q ''i +"inoremap $e ""i +"inoremap $t <>i """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -137,7 +137,7 @@ func! DeleteTillSlash() else let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "") endif - endif + endif return g:cmd_edited endfunc diff --git a/vimrcs/filetypes.vim b/vimrcs/filetypes.vim index f6a58f6b..c589a407 100644 --- a/vimrcs/filetypes.vim +++ b/vimrcs/filetypes.vim @@ -9,14 +9,14 @@ au BufNewFile,BufRead *.mako set ft=mako au FileType python map F :set foldmethod=indent -au FileType python inoremap $r return -au FileType python inoremap $i import -au FileType python inoremap $p print +au FileType python inoremap $r return +au FileType python inoremap $i import +au FileType python inoremap $p print au FileType python inoremap $f #--- PH ----------------------------------------------FP2xi -au FileType python map 1 /class -au FileType python map 2 /def -au FileType python map C ?class -au FileType python map D ?def +au FileType python map 1 /class +au FileType python map 2 /def +au FileType python map C ?class +au FileType python map D ?def """""""""""""""""""""""""""""" @@ -29,10 +29,10 @@ au FileType javascript setl nocindent au FileType javascript imap $log();hi au FileType javascript imap alert();hi -au FileType javascript inoremap $r return +au FileType javascript inoremap $r return au FileType javascript inoremap $f //--- PH ----------------------------------------------FP2xi -function! JavaScriptFold() +function! JavaScriptFold() setl foldmethod=syntax setl foldlevelstart=1 syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend @@ -54,3 +54,29 @@ endfunction au FileType coffee call CoffeeScriptFold() au FileType gitcommit call setpos('.', [0, 1, 1, 0]) + + +"""""""""""""""""""""""""""""" +" => Markdown / Prose section +""""""""""""""""""""""""""""""" +function! WordProcessor() + "setl textwidth=80 + "setl foldcolumn=10 + "setl columns=100 +" :Goyo +endfunction + +" md is markdown +"autocmd FileType markdown,mkd call WordProcessor() +"autocmd BufRead,BufNewFile *.md set filetype=markdown +" +"let g:pencil#wrapModeDefault = 'soft' " or 'hard' +"let g:pencil#textwidth = 80 +"let g:pencil#mode_indicators = {'hard': '␍', 'soft': '⤸', 'off': '',} +"let g:airline_section_x = '%{PencilMode()}' + +"augroup pencil +" autocmd! +" autocmd FileType markdown,mkd,md call pencil#init() +" autocmd FileType text call pencil#init({'wrap': 'hard'}) +"augroup END diff --git a/vimrcs/plugins_config.vim b/vimrcs/plugins_config.vim index fc0072bd..14e58f90 100644 --- a/vimrcs/plugins_config.vim +++ b/vimrcs/plugins_config.vim @@ -1,5 +1,5 @@ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Important: +" Important: " This requries that you install https://github.com/amix/vimrc ! " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -77,7 +77,7 @@ set grepprg=/bin/grep\ -nH " => Nerd Tree """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" map nn :NERDTreeToggle -map nb :NERDTreeFromBookmark +map nb :NERDTreeFromBookmark map nf :NERDTreeFind @@ -98,7 +98,8 @@ au FileType mako vmap Si S"i${ _(2f"a) } """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => vim-airline config (force color) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -let g:airline_theme="luna" +"let g:airline_theme="luna" +let g:airline_theme="molokai" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Vimroom @@ -113,3 +114,8 @@ nnoremap z :Goyo " => Syntastic (syntax checker) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:syntastic_python_checkers=['pyflakes'] + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Vim-Pencil +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +