mirror of
https://github.com/amix/vimrc
synced 2025-02-28 14:12:51 +08:00
Merge eeb78f5204
into 53894de44b
This commit is contained in:
commit
c835cd1b0d
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,10 +1,5 @@
|
|||||||
temp_dirs/undodir/*
|
temp_dirs/undodir/*
|
||||||
sources_non_forked/ack.vim/.netrwhist
|
|
||||||
temp_dirs/yankring_history_v2.txt
|
temp_dirs/yankring_history_v2.txt
|
||||||
sources_forked/yankring/doc/tags
|
sources_forked/yankring/doc/tags
|
||||||
sources_non_forked/tlib/doc/tags
|
|
||||||
sources_non_forked/ctrlp.vim/doc/tags*
|
|
||||||
my_plugins/
|
|
||||||
my_configs.vim
|
|
||||||
tags
|
tags
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
323
README.md
323
README.md
@ -1,322 +1,33 @@
|
|||||||

|
# What is this?
|
||||||
|
|
||||||
# The Ultimate vimrc
|
This is the vim configurations based on [amix/vimrc](https://github.com/amix/vimrc).
|
||||||
|
|
||||||
Over the last 10 years, I have used and tweaked Vim. This configuration is the ultimate vimrc (or at least my version of it).
|
# What have I changed?
|
||||||
|
|
||||||
There are two versions:
|
* Change syntax checker from [syntastic](https://github.com/vim-syntastic/syntastic) to [ale](https://github.com/w0rp/ale) (which is **async** and needs vim 8).
|
||||||
|
|
||||||
* **The Basic**: If you want something small just copy [basic.vim](https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim) into your ~/.vimrc and you will have a good basic setup
|
* Add [indentLine](https://github.com/Yggdroot/indentLine) support. (This feature needs vim 7.3+ with `conceal` compiled)
|
||||||
* **The Awesome**: Includes a ton of useful plugins, color schemes, and configurations
|
|
||||||
|
|
||||||
I would, of course, recommend using the awesome version.
|
* Add some javascript related plugins. (mainly for vue development with jsx)
|
||||||
|
|
||||||
|
* Add [easymotion](https://github.com/easymotion/vim-easymotion) for (IMHO) better development experience.
|
||||||
|
|
||||||
## How to install the Awesome version?
|
* Change [lightline](https://github.com/itchyny/lightline.vim) to [vim-airline](https://github.com/vim-airline/vim-airline).
|
||||||
|
|
||||||
The awesome version includes a lot of great plugins, configurations and color schemes that make Vim a lot better. To install it simply do following from your terminal:
|
* Change default plugin manager (or 'runtimepath manager') from [pathogen](https://github.com/tpope/vim-pathogen) to [Vundle](https://github.com/VundleVim/Vundle.vim).
|
||||||
|
|
||||||
git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime
|
# Something to know about the change of plugin manager
|
||||||
sh ~/.vim_runtime/install_awesome_vimrc.sh
|
|
||||||
|
|
||||||
|
Since I can't figure out how to use local plugin with Vundle properly, I didn't include some plugins used by the original version in the `/sources_forked` directory.
|
||||||
|
|
||||||
## Fonts
|
If you come out with how to do this, please let me know and I would be appreciate it.
|
||||||
|
|
||||||
I recommend using [IBM Plex Mono font](https://ibm.github.io/type/) (it's an open-source and awesome font that can make your code beautiful). The Awesome vimrc is already setup to try to use it.
|
If you want to use Vundle as your plugin manager with the original configuration, you can check the following 2 files:
|
||||||
|
|
||||||
Some other fonts that Awesome will try to use:
|
1. [./vimrcs/vundle_config.vim](./vimrcs/vundle_config.vim), this file has all the vundle-related setups.
|
||||||
|
|
||||||
* [Hack](http://sourcefoundry.org/hack/)
|
2. [./install_awesome_vimrc.sh](./install_awesome_vimrc.sh), this file add one line to source the `vundle_config.vim` at top of the sources.
|
||||||
* [Source Code Pro](https://adobe-fonts.github.io/source-code-pro/)
|
|
||||||
|
|
||||||
|
# Also
|
||||||
|
|
||||||
## How to install the Basic version?
|
Some personal preferences can be found in [./my_configs.vim](./my_configs.vim).
|
||||||
|
|
||||||
The basic version is just one file and no plugins. Just copy [basic.vim](https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim) and paste it into your vimrc.
|
|
||||||
|
|
||||||
The basic version is useful to install on remote servers where you don't need many plugins, and you don't do many edits.
|
|
||||||
|
|
||||||
git clone --depth=1 git://github.com/amix/vimrc.git ~/.vim_runtime
|
|
||||||
sh ~/.vim_runtime/install_basic_vimrc.sh
|
|
||||||
|
|
||||||
|
|
||||||
## How to install on Windows?
|
|
||||||
|
|
||||||
Use [msysgit](http://msysgit.github.com/) to checkout the repository and run the installation instructions above. No special instructions needed ;-)
|
|
||||||
|
|
||||||
|
|
||||||
## How to install on Linux
|
|
||||||
|
|
||||||
If you have vim aliased as `vi` instead of `vim`, make sure to either alias it: `alias vi=vim`. Otherwise, `apt-get install vim`
|
|
||||||
|
|
||||||
|
|
||||||
## How to update to latest version?
|
|
||||||
|
|
||||||
Just do a git rebase!
|
|
||||||
|
|
||||||
cd ~/.vim_runtime
|
|
||||||
git pull --rebase
|
|
||||||
|
|
||||||
|
|
||||||
## Some screenshots
|
|
||||||
|
|
||||||
Colors when editing a Python file:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Opening recently opened files with the [mru.vim](https://github.com/vim-scripts/mru.vim) plugin:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
[NERD Tree](https://github.com/scrooloose/nerdtree) plugin in a terminal window:
|
|
||||||

|
|
||||||
|
|
||||||
Distraction free mode using [goyo.vim](https://github.com/junegunn/goyo.vim) and [vim-zenroom2](https://github.com/amix/vim-zenroom2):
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
## Included Plugins
|
|
||||||
|
|
||||||
I recommend reading the docs of these plugins to understand them better. Each plugin provides a much better Vim experience!
|
|
||||||
|
|
||||||
* [ack.vim](https://github.com/mileszs/ack.vim): Vim plugin for `the_silver_searcher` (ag) or ack -- a wicked fast grep
|
|
||||||
* [bufexplorer.zip](https://github.com/vim-scripts/bufexplorer.zip): Quickly and easily switch between buffers. This plugin can be opened with `<leader+o>`
|
|
||||||
* [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim): Fuzzy file, buffer, mru and tag finder. It's mapped to `<Ctrl+F>`
|
|
||||||
* [goyo.vim](https://github.com/junegunn/goyo.vim) and [vim-zenroom2](https://github.com/amix/vim-zenroom2):
|
|
||||||
* [lightline.vim](https://github.com/itchyny/lightline.vim): A light and configurable statusline/tabline for Vim
|
|
||||||
* [NERD Tree](https://github.com/scrooloose/nerdtree): A tree explorer plugin for vim
|
|
||||||
* [mru.vim](https://github.com/vim-scripts/mru.vim): Plugin to manage Most Recently Used (MRU) files. This plugin can be opened with `<leader+f>`
|
|
||||||
* [open_file_under_cursor.vim](https://github.com/amix/open_file_under_cursor.vim): Open file under cursor when pressing `gf`
|
|
||||||
* [pathogen.vim](https://github.com/tpope/vim-pathogen): Manage your vim runtimepath
|
|
||||||
* [snipmate.vim](https://github.com/garbas/vim-snipmate): snipmate.vim aims to be a concise vim script that implements some of TextMate's snippets features in Vim
|
|
||||||
* [syntastic](https://github.com/scrooloose/syntastic): Syntax checking hacks for vim
|
|
||||||
* [vim-commentary](https://github.com/tpope/vim-commentary): Comment stuff out. Use `gcc` to comment out a line (takes a count), `gc` to comment out the target of a motion. `gcu` uncomments a set of adjacent commented lines.
|
|
||||||
* [vim-expand-region](https://github.com/terryma/vim-expand-region): Allows you to visually select increasingly larger regions of text using the same key combination
|
|
||||||
* [vim-fugitive](https://github.com/tpope/vim-fugitive): A Git wrapper so awesome, it should be illegal
|
|
||||||
* [vim-indent-object](https://github.com/michaeljsmith/vim-indent-object): Defines a new text object representing lines of code at the same indent level. Useful for python/vim scripts
|
|
||||||
* [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors): Sublime Text style multiple selections for Vim, CTRL+N is remapped to CTRL+S (due to YankRing)
|
|
||||||
* [vim-yankstack](https://github.com/maxbrunsfeld/vim-yankstack): Maintains a history of previous yanks, changes and deletes
|
|
||||||
Remove all clutter and focus only on the essential. Similar to iA Writer or Write Room [Read more here](http://amix.dk/blog/post/19744)
|
|
||||||
|
|
||||||
|
|
||||||
## Included color schemes
|
|
||||||
|
|
||||||
* [peaksea](https://github.com/vim-scripts/peaksea): The default
|
|
||||||
* [vim-colors-solarized](https://github.com/altercation/vim-colors-solarized)
|
|
||||||
* [vim-irblack](https://github.com/wgibbs/vim-irblack)
|
|
||||||
* [mayansmoke](https://github.com/vim-scripts/mayansmoke)
|
|
||||||
* [vim-pyte](https://github.com/therubymug/vim-pyte)
|
|
||||||
|
|
||||||
|
|
||||||
## Included modes
|
|
||||||
|
|
||||||
* [vim-coffee-script](https://github.com/kchmck/vim-coffee-script)
|
|
||||||
* [vim-less](https://github.com/groenewege/vim-less)
|
|
||||||
* [vim-bundle-mako](https://github.com/sophacles/vim-bundle-mako)
|
|
||||||
* [vim-markdown](https://github.com/tpope/vim-markdown)
|
|
||||||
* [nginx.vim](https://github.com/vim-scripts/nginx.vim): Highlights configuration files for nginx
|
|
||||||
* [vim-go](https://github.com/fatih/vim-go)
|
|
||||||
|
|
||||||
|
|
||||||
## How to include your own stuff?
|
|
||||||
|
|
||||||
After you have installed the setup, you can create **~/.vim_runtime/my_configs.vim** to fill in any configurations that are important for you. For instance, my **my_configs.vim** looks like this:
|
|
||||||
|
|
||||||
~/.vim_runtime (master)> cat my_configs.vim
|
|
||||||
map <leader>ct :cd ~/Desktop/Todoist/todoist<cr>
|
|
||||||
map <leader>cw :cd ~/Desktop/Wedoist/wedoist<cr>
|
|
||||||
|
|
||||||
You can also install your plugins, for instance, via pathogen you 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
|
|
||||||
|
|
||||||
|
|
||||||
## Key Mappings
|
|
||||||
|
|
||||||
The [leader](http://learnvimscriptthehardway.stevelosh.com/chapters/06.html#leader) is `,`, so whenever you see `<leader>` it means `,`.
|
|
||||||
|
|
||||||
|
|
||||||
### Plugin related mappings
|
|
||||||
|
|
||||||
Open [bufexplorer](https://github.com/vim-scripts/bufexplorer.zip) to see and manage the current buffers (`<leader>o`):
|
|
||||||
|
|
||||||
map <leader>o :BufExplorer<cr>
|
|
||||||
|
|
||||||
Open [MRU.vim](https://github.com/vim-scripts/mru.vim) to see the recently open files (`<leader>f`):
|
|
||||||
|
|
||||||
map <leader>f :MRU<CR>
|
|
||||||
|
|
||||||
Open [ctrlp.vim](https://github.com/kien/ctrlp.vim) plugin to quickly find a file or a buffer (`<leader>j` or `<ctrl>f`):
|
|
||||||
|
|
||||||
let g:ctrlp_map = '<c-f>'
|
|
||||||
|
|
||||||
[NERD Tree](https://github.com/scrooloose/nerdtree) mappings:
|
|
||||||
|
|
||||||
map <leader>nn :NERDTreeToggle<cr>
|
|
||||||
map <leader>nb :NERDTreeFromBookmark
|
|
||||||
map <leader>nf :NERDTreeFind<cr>
|
|
||||||
|
|
||||||
[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. (`<leader>z`)
|
|
||||||
|
|
||||||
map <leader>z :Goyo<cr>
|
|
||||||
|
|
||||||
|
|
||||||
### Normal mode mappings
|
|
||||||
|
|
||||||
Fast saving of a buffer (`<leader>w`):
|
|
||||||
|
|
||||||
nmap <leader>w :w!<cr>
|
|
||||||
|
|
||||||
Map `<Space>` to `/` (search) and `<Ctrl>+<Space>` to `?` (backwards search):
|
|
||||||
|
|
||||||
map <space> /
|
|
||||||
map <c-space> ?
|
|
||||||
map <silent> <leader><cr> :noh<cr>
|
|
||||||
|
|
||||||
Disable highlights when you press `<leader><cr>`:
|
|
||||||
|
|
||||||
map <silent> <leader><cr> :noh<cr>
|
|
||||||
|
|
||||||
Smart way to move between windows (`<ctrl>j` etc.):
|
|
||||||
|
|
||||||
map <C-j> <C-W>j
|
|
||||||
map <C-k> <C-W>k
|
|
||||||
map <C-h> <C-W>h
|
|
||||||
map <C-l> <C-W>l
|
|
||||||
|
|
||||||
Closing of the current buffer(s) (`<leader>bd` and (`<leader>ba`)):
|
|
||||||
|
|
||||||
" Close current buffer
|
|
||||||
map <leader>bd :Bclose<cr>
|
|
||||||
|
|
||||||
" Close all buffers
|
|
||||||
map <leader>ba :1,1000 bd!<cr>
|
|
||||||
|
|
||||||
Useful mappings for managing tabs:
|
|
||||||
|
|
||||||
map <leader>tn :tabnew<cr>
|
|
||||||
map <leader>to :tabonly<cr>
|
|
||||||
map <leader>tc :tabclose<cr>
|
|
||||||
map <leader>tm :tabmove
|
|
||||||
|
|
||||||
" Opens a new tab with the current buffer's path
|
|
||||||
" Super useful when editing files in the same directory
|
|
||||||
map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
|
|
||||||
|
|
||||||
Switch [CWD](http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file) to the directory of the open buffer:
|
|
||||||
|
|
||||||
map <leader>cd :cd %:p:h<cr>:pwd<cr>
|
|
||||||
|
|
||||||
Open `ack.vim` for fast search:
|
|
||||||
|
|
||||||
map <leader>g :Ack
|
|
||||||
|
|
||||||
Quickly open a buffer for scripbble:
|
|
||||||
|
|
||||||
map <leader>q :e ~/buffer<cr>
|
|
||||||
|
|
||||||
Toggle paste mode on and off:
|
|
||||||
|
|
||||||
map <leader>pp :setlocal paste!<cr>
|
|
||||||
|
|
||||||
|
|
||||||
### Visual mode mappings
|
|
||||||
|
|
||||||
Visual mode pressing `*` or `#` searches for the current selection:
|
|
||||||
|
|
||||||
vnoremap <silent> * :call VisualSelection('f')<CR>
|
|
||||||
vnoremap <silent> # :call VisualSelection('b')<CR>
|
|
||||||
|
|
||||||
When you press gv you `Ack.vim` after the selected text:
|
|
||||||
|
|
||||||
vnoremap <silent> gv :call VisualSelection('gv', '')<CR>
|
|
||||||
|
|
||||||
When you press `<leader>r` you can search and replace the selected text:
|
|
||||||
|
|
||||||
vnoremap <silent> <leader>r :call VisualSelection('replace')<CR>
|
|
||||||
|
|
||||||
Surround the visual selection in parenthesis/brackets/etc.:
|
|
||||||
|
|
||||||
vnoremap $1 <esc>`>a)<esc>`<i(<esc>
|
|
||||||
vnoremap $2 <esc>`>a]<esc>`<i[<esc>
|
|
||||||
vnoremap $3 <esc>`>a}<esc>`<i{<esc>
|
|
||||||
vnoremap $$ <esc>`>a"<esc>`<i"<esc>
|
|
||||||
vnoremap $q <esc>`>a'<esc>`<i'<esc>
|
|
||||||
vnoremap $e <esc>`>a"<esc>`<i"<esc>
|
|
||||||
|
|
||||||
|
|
||||||
### Insert mode mappings
|
|
||||||
|
|
||||||
Quickly insert parenthesis/brackets/etc.:
|
|
||||||
|
|
||||||
inoremap $1 ()<esc>i
|
|
||||||
inoremap $2 []<esc>i
|
|
||||||
inoremap $3 {}<esc>i
|
|
||||||
inoremap $4 {<esc>o}<esc>O
|
|
||||||
inoremap $q ''<esc>i
|
|
||||||
inoremap $e ""<esc>i
|
|
||||||
inoremap $t <><esc>i
|
|
||||||
|
|
||||||
Insert the current date and time (useful for timestamps):
|
|
||||||
|
|
||||||
iab xdate <c-r>=strftime("%d/%m/%y %H:%M:%S")<cr>
|
|
||||||
|
|
||||||
|
|
||||||
### Command line mappings
|
|
||||||
|
|
||||||
$q is super useful when browsing on the command line. It deletes everything until the last slash:
|
|
||||||
|
|
||||||
cno $q <C-\>eDeleteTillSlash()<cr>
|
|
||||||
|
|
||||||
Bash like keys for the command line:
|
|
||||||
|
|
||||||
cnoremap <C-A> <Home>
|
|
||||||
cnoremap <C-E> <End>
|
|
||||||
cnoremap <C-K> <C-U>
|
|
||||||
|
|
||||||
cnoremap <C-P> <Up>
|
|
||||||
cnoremap <C-N> <Down>
|
|
||||||
|
|
||||||
Write the file as sudo (works 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
|
|
||||||
|
|
||||||
|
|
||||||
### Spell checking
|
|
||||||
Pressing `<leader>ss` will toggle spell checking:
|
|
||||||
|
|
||||||
map <leader>ss :setlocal spell!<cr>
|
|
||||||
|
|
||||||
Shortcuts using `<leader>` instead of special characters:
|
|
||||||
|
|
||||||
map <leader>sn ]s
|
|
||||||
map <leader>sp [s
|
|
||||||
map <leader>sa zg
|
|
||||||
map <leader>s? z=
|
|
||||||
|
|
||||||
|
|
||||||
### Cope
|
|
||||||
Query `:help cope` if you are unsure what cope is. It's super useful!
|
|
||||||
|
|
||||||
When you search with `Ack.vim`, display your results in cope by doing:
|
|
||||||
`<leader>cc`
|
|
||||||
|
|
||||||
To go to the next search result do:
|
|
||||||
`<leader>n`
|
|
||||||
|
|
||||||
To go to the previous search results do:
|
|
||||||
`<leader>p`
|
|
||||||
|
|
||||||
Cope mappings:
|
|
||||||
|
|
||||||
map <leader>cc :botright cope<cr>
|
|
||||||
map <leader>co ggVGy:tabnew<cr>:set syntax=qf<cr>pgg
|
|
||||||
map <leader>n :cn<cr>
|
|
||||||
map <leader>p :cp<cr>
|
|
||||||
|
|
||||||
|
|
||||||
## How to uninstall
|
|
||||||
Just do following:
|
|
||||||
* Remove `~/.vim_runtime`
|
|
||||||
* Remove any lines that reference `.vim_runtime` in your `~/.vimrc`
|
|
||||||
|
1
bundle/Vundle.vim
Submodule
1
bundle/Vundle.vim
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit fcc204205e3305c4f86f07e09cd756c7d06f0f00
|
@ -5,6 +5,7 @@ cd ~/.vim_runtime
|
|||||||
|
|
||||||
echo 'set runtimepath+=~/.vim_runtime
|
echo 'set runtimepath+=~/.vim_runtime
|
||||||
|
|
||||||
|
source ~/.vim_runtime/vimrcs/vundle_config.vim
|
||||||
source ~/.vim_runtime/vimrcs/basic.vim
|
source ~/.vim_runtime/vimrcs/basic.vim
|
||||||
source ~/.vim_runtime/vimrcs/filetypes.vim
|
source ~/.vim_runtime/vimrcs/filetypes.vim
|
||||||
source ~/.vim_runtime/vimrcs/plugins_config.vim
|
source ~/.vim_runtime/vimrcs/plugins_config.vim
|
||||||
|
48
my_configs.vim
Normal file
48
my_configs.vim
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
" editor configurations
|
||||||
|
set foldlevel=20 " disable folding
|
||||||
|
set number relativenumber
|
||||||
|
set cursorline
|
||||||
|
|
||||||
|
" solorized color scheme
|
||||||
|
set background=dark
|
||||||
|
colorscheme solarized
|
||||||
|
|
||||||
|
" set indent preferences based on file type
|
||||||
|
autocmd Filetype javascript setlocal ts=2 sts=2 sw=2
|
||||||
|
autocmd Filetype vue setlocal ts=2 sts=2 sw=2
|
||||||
|
autocmd Filetype vue syntax sync fromstart
|
||||||
|
|
||||||
|
" macvim font
|
||||||
|
if has("gui_macvim")
|
||||||
|
set guifont=Operator\ Mono\ Light\ Italic:h18
|
||||||
|
endif
|
||||||
|
|
||||||
|
"
|
||||||
|
" plugins
|
||||||
|
"
|
||||||
|
"
|
||||||
|
" nerdtree
|
||||||
|
let g:NERDTreeWinPos = "left"
|
||||||
|
|
||||||
|
" ctrlp
|
||||||
|
let g:ctrlp_map = '<leader>p'
|
||||||
|
let g:ctrlp_max_files = 0
|
||||||
|
let g:ctrlp_max_depth = 40
|
||||||
|
let g:ctrlp_buffer = '<leader>f'
|
||||||
|
|
||||||
|
" indent line
|
||||||
|
let g:indentLine_char = '¦'
|
||||||
|
|
||||||
|
" vim-vue
|
||||||
|
let g:vue_disable_pre_processors = 1 " otherwise input will be slow
|
||||||
|
|
||||||
|
" ale
|
||||||
|
let g:ale_sign_column_always = 1 " always display that gutter
|
||||||
|
let g:airline#extensions#ale#enabled = 1 " display errors or warnings with `vim-airline`
|
||||||
|
|
||||||
|
" airline
|
||||||
|
let g:airline_theme = 'solarized'
|
||||||
|
let g:airline_solarized_bg = 'dark'
|
||||||
|
let g:airline_powerline_fonts = 1
|
||||||
|
let g:airline#extensions#tabline#enabled = 1
|
||||||
|
let g:airline#extensions#tabline#formatter = 'unique_tail'
|
1
sources_non_forked/ack.vim/.gitignore
vendored
1
sources_non_forked/ack.vim/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
tags
|
|
@ -1,89 +0,0 @@
|
|||||||
ack.vim is distributed under the same license terms as Vim itself, which you
|
|
||||||
can find in full with `:help license` within Vim, or copied in full herein.
|
|
||||||
|
|
||||||
Copyright (c) 2007-2015 Antoine Imbert <antoine.imbert+ackvim@gmail.com>
|
|
||||||
and contributors.
|
|
||||||
|
|
||||||
Maintainers may be contacted via GitHub Issues at:
|
|
||||||
|
|
||||||
https://github.com/mileszs/ack.vim/issues
|
|
||||||
|
|
||||||
|
|
||||||
VIM LICENSE
|
|
||||||
|
|
||||||
I) There are no restrictions on distributing unmodified copies of Vim except
|
|
||||||
that they must include this license text. You can also distribute
|
|
||||||
unmodified parts of Vim, likewise unrestricted except that they must
|
|
||||||
include this license text. You are also allowed to include executables
|
|
||||||
that you made from the unmodified Vim sources, plus your own usage
|
|
||||||
examples and Vim scripts.
|
|
||||||
|
|
||||||
II) It is allowed to distribute a modified (or extended) version of Vim,
|
|
||||||
including executables and/or source code, when the following four
|
|
||||||
conditions are met:
|
|
||||||
1) This license text must be included unmodified.
|
|
||||||
2) The modified Vim must be distributed in one of the following five ways:
|
|
||||||
a) If you make changes to Vim yourself, you must clearly describe in
|
|
||||||
the distribution how to contact you. When the maintainer asks you
|
|
||||||
(in any way) for a copy of the modified Vim you distributed, you
|
|
||||||
must make your changes, including source code, available to the
|
|
||||||
maintainer without fee. The maintainer reserves the right to
|
|
||||||
include your changes in the official version of Vim. What the
|
|
||||||
maintainer will do with your changes and under what license they
|
|
||||||
will be distributed is negotiable. If there has been no negotiation
|
|
||||||
then this license, or a later version, also applies to your changes.
|
|
||||||
The current maintainer is Bram Moolenaar <Bram@vim.org>. If this
|
|
||||||
changes it will be announced in appropriate places (most likely
|
|
||||||
vim.sf.net, www.vim.org and/or comp.editors). When it is completely
|
|
||||||
impossible to contact the maintainer, the obligation to send him
|
|
||||||
your changes ceases. Once the maintainer has confirmed that he has
|
|
||||||
received your changes they will not have to be sent again.
|
|
||||||
b) If you have received a modified Vim that was distributed as
|
|
||||||
mentioned under a) you are allowed to further distribute it
|
|
||||||
unmodified, as mentioned at I). If you make additional changes the
|
|
||||||
text under a) applies to those changes.
|
|
||||||
c) Provide all the changes, including source code, with every copy of
|
|
||||||
the modified Vim you distribute. This may be done in the form of a
|
|
||||||
context diff. You can choose what license to use for new code you
|
|
||||||
add. The changes and their license must not restrict others from
|
|
||||||
making their own changes to the official version of Vim.
|
|
||||||
d) When you have a modified Vim which includes changes as mentioned
|
|
||||||
under c), you can distribute it without the source code for the
|
|
||||||
changes if the following three conditions are met:
|
|
||||||
- The license that applies to the changes permits you to distribute
|
|
||||||
the changes to the Vim maintainer without fee or restriction, and
|
|
||||||
permits the Vim maintainer to include the changes in the official
|
|
||||||
version of Vim without fee or restriction.
|
|
||||||
- You keep the changes for at least three years after last
|
|
||||||
distributing the corresponding modified Vim. When the maintainer
|
|
||||||
or someone who you distributed the modified Vim to asks you (in
|
|
||||||
any way) for the changes within this period, you must make them
|
|
||||||
available to him.
|
|
||||||
- You clearly describe in the distribution how to contact you. This
|
|
||||||
contact information must remain valid for at least three years
|
|
||||||
after last distributing the corresponding modified Vim, or as long
|
|
||||||
as possible.
|
|
||||||
e) When the GNU General Public License (GPL) applies to the changes,
|
|
||||||
you can distribute the modified Vim under the GNU GPL version 2 or
|
|
||||||
any later version.
|
|
||||||
3) A message must be added, at least in the output of the ":version"
|
|
||||||
command and in the intro screen, such that the user of the modified Vim
|
|
||||||
is able to see that it was modified. When distributing as mentioned
|
|
||||||
under 2)e) adding the message is only required for as far as this does
|
|
||||||
not conflict with the license used for the changes.
|
|
||||||
4) The contact information as required under 2)a) and 2)d) must not be
|
|
||||||
removed or changed, except that the person himself can make
|
|
||||||
corrections.
|
|
||||||
|
|
||||||
III) If you distribute a modified version of Vim, you are encouraged to use
|
|
||||||
the Vim license for your changes and make them available to the
|
|
||||||
maintainer, including the source code. The preferred way to do this is
|
|
||||||
by e-mail or by uploading the files to a server and e-mailing the URL.
|
|
||||||
If the number of changes is small (e.g., a modified Makefile) e-mailing a
|
|
||||||
context diff will do. The e-mail address to be used is
|
|
||||||
<maintainer@vim.org>
|
|
||||||
|
|
||||||
IV) It is not allowed to remove this license from the distribution of the Vim
|
|
||||||
sources, parts of it or from a modified version. You may use this
|
|
||||||
license for previous Vim releases instead of the license that they came
|
|
||||||
with, at your option.
|
|
@ -1,163 +0,0 @@
|
|||||||
# ack.vim
|
|
||||||
|
|
||||||
Run your favorite search tool from Vim, with an enhanced results list.
|
|
||||||
|
|
||||||
This plugin was designed as a Vim frontend for the programmer's search tool
|
|
||||||
[ack]. ack can be used as a replacement for 99% of the uses of `grep`. The
|
|
||||||
plugin allows you to search with ack from within Vim and shows the results in a
|
|
||||||
split window.
|
|
||||||
|
|
||||||
But here's a little secret for the Vim-seasoned: it's just a light wrapper for
|
|
||||||
Vim's [grepprg] and the [quickfix] window for match results. This makes it easy
|
|
||||||
to integrate with your own Vim configuration and use existing knowledge of core
|
|
||||||
features. It also means the plugin is flexible to use with other search tools.
|
|
||||||
|
|
||||||
[grepprg]: http://vimdoc.sourceforge.net/htmldoc/options.html#'grepprg'
|
|
||||||
[quickfix]: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#quickfix
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
### ack
|
|
||||||
|
|
||||||
You will need ack (>= 2.0), of course. To install it follow the
|
|
||||||
[manual](http://beyondgrep.com/install/).
|
|
||||||
|
|
||||||
### The Plugin
|
|
||||||
|
|
||||||
It is recommended to use one of the popular plugin managers for Vim. There are
|
|
||||||
many and you probably already have a preferred one, but a few examples for your
|
|
||||||
copy-and-paste convenience:
|
|
||||||
|
|
||||||
#### Pathogen
|
|
||||||
|
|
||||||
$ git clone https://github.com/mileszs/ack.vim.git ~/.vim/bundle/ack.vim
|
|
||||||
|
|
||||||
#### Vundle
|
|
||||||
|
|
||||||
```vim
|
|
||||||
Plugin 'mileszs/ack.vim'
|
|
||||||
```
|
|
||||||
|
|
||||||
#### NeoBundle
|
|
||||||
|
|
||||||
```vim
|
|
||||||
NeoBundle 'mileszs/ack.vim'
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Manual (not recommended)
|
|
||||||
|
|
||||||
[Download][releases] the plugin and extract it in `~/.vim/` (or
|
|
||||||
`%PROGRAMFILES%/Vim/vimfiles` on Windows).
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
:Ack [options] {pattern} [{directories}]
|
|
||||||
|
|
||||||
Search recursively in `{directories}` (which defaults to the current directory)
|
|
||||||
for the `{pattern}`.
|
|
||||||
|
|
||||||
Files containing the search term will be listed in the quickfix window, along
|
|
||||||
with the line number of the occurrence, once for each occurrence. `<Enter>` on
|
|
||||||
a line in this window will open the file and place the cursor on the matching
|
|
||||||
line.
|
|
||||||
|
|
||||||
Just like where you use `:grep`, `:grepadd`, `:lgrep`, and :`lgrepadd`, you can
|
|
||||||
use `:Ack`, `:AckAdd`, `:LAck`, and `:LAckAdd` respectively. (See `:help Ack`
|
|
||||||
after installing, or [`doc/ack.txt`][doc] in the repo, for more information.)
|
|
||||||
|
|
||||||
For more ack help see [ack documentation](http://beyondgrep.com/documentation/).
|
|
||||||
|
|
||||||
[doc]: https://github.com/mileszs/ack.vim/blob/master/doc/ack.txt
|
|
||||||
|
|
||||||
### Keyboard Shortcuts
|
|
||||||
|
|
||||||
The quickfix results window is augmented with these convenience mappings:
|
|
||||||
|
|
||||||
? a quick summary of these keys, repeat to close
|
|
||||||
o to open (same as Enter)
|
|
||||||
O to open and close the quickfix window
|
|
||||||
go to preview file, open but maintain focus on ack.vim results
|
|
||||||
t to open in new tab
|
|
||||||
T to open in new tab without moving to it
|
|
||||||
h to open in horizontal split
|
|
||||||
H to open in horizontal split, keeping focus on the results
|
|
||||||
v to open in vertical split
|
|
||||||
gv to open in vertical split, keeping focus on the results
|
|
||||||
q to close the quickfix window
|
|
||||||
|
|
||||||
### Gotchas
|
|
||||||
|
|
||||||
To search for a pattern that contains whitespace, you need to enclose the
|
|
||||||
pattern in single quotes. For example: `:Ack 'foo bar'` to search for
|
|
||||||
'foo bar'.
|
|
||||||
|
|
||||||
Some characters have special meaning, and need to be escaped in your search
|
|
||||||
pattern. For instance, `#`. You need to escape it with `:Ack '\\\#define
|
|
||||||
foo'` to search for '#define foo'. See [issue #5].
|
|
||||||
|
|
||||||
[issue #5]: https://github.com/mileszs/ack.vim/issues/5
|
|
||||||
|
|
||||||
## Possibly FAQ
|
|
||||||
|
|
||||||
#### Can I use `ag` ([The Silver Searcher]) with this?
|
|
||||||
|
|
||||||
Absolutely, and probably other tools if their output is similar or you can
|
|
||||||
write a pattern match for it--just set `g:ackprg`. If you like, you can fall
|
|
||||||
back to Ack in case you use your vimrc on a system without Ag available:
|
|
||||||
|
|
||||||
```vim
|
|
||||||
if executable('ag')
|
|
||||||
let g:ackprg = 'ag --vimgrep'
|
|
||||||
endif
|
|
||||||
```
|
|
||||||
|
|
||||||
Since Ack is quite portable you might check a copy of it into your dotfiles
|
|
||||||
repository in `~/bin` so you'll nearly always have it available.
|
|
||||||
|
|
||||||
#### What's the difference from ag.vim?
|
|
||||||
|
|
||||||
Well... not a lot really.
|
|
||||||
|
|
||||||
Present maintainer, yours truly, [kind of wishes they never forked][sadface],
|
|
||||||
contributes to both, and wouldn't mind seeing them merged again. ag.vim got a
|
|
||||||
nice code clean-up (which ack.vim is now hopefully getting), and ack.vim picked
|
|
||||||
up a few features that haven't made their way to ag.vim, like `:AckWindow`,
|
|
||||||
optional background search execution with [vim-dispatch], and auto-previewing.
|
|
||||||
|
|
||||||
#### I don't want to jump to the first result automatically. ####
|
|
||||||
|
|
||||||
Use `:Ack!`, with bang. If you want this behavior most of the time, you might
|
|
||||||
like an abbreviation or mapping in your personal config, something like these:
|
|
||||||
|
|
||||||
```vim
|
|
||||||
cnoreabbrev Ack Ack!
|
|
||||||
nnoremap <Leader>a :Ack!<Space>
|
|
||||||
```
|
|
||||||
|
|
||||||
Most of the `:[L]Ack*` commands support this. Note that this behavior follows
|
|
||||||
the convention of Vim's built-in `:grep` and `:make` commands.
|
|
||||||
|
|
||||||
[The Silver Searcher]: https://github.com/ggreer/the_silver_searcher
|
|
||||||
[sadface]: https://github.com/mileszs/ack.vim/commit/d97090fb502d40229e6976dfec0e06636ba227d5#commitcomment-5771145
|
|
||||||
|
|
||||||
## Changelog
|
|
||||||
|
|
||||||
Please see [the GitHub releases page][releases].
|
|
||||||
|
|
||||||
## Credits
|
|
||||||
|
|
||||||
This plugin is derived from Antoine Imbert's blog post [ack and Vim
|
|
||||||
Integration][] (in particular, the function in the update to the post). [Miles
|
|
||||||
Sterrett][mileszs] packaged it up as a plugin and documented it in Vim's help
|
|
||||||
format, and since then [many contributors][contributors] have submitted
|
|
||||||
enhancements and fixes.
|
|
||||||
|
|
||||||
And of course, where would we be without [ack]. And, you know, Vim.
|
|
||||||
|
|
||||||
[ack and Vim Integration]: http://blog.ant0ine.com/typepad/2007/03/ack-and-vim-integration.html
|
|
||||||
[mileszs]: https://github.com/mileszs
|
|
||||||
[contributors]: https://github.com/mileszs/ack.vim/graphs/contributors
|
|
||||||
[ack]: http://beyondgrep.com/
|
|
||||||
|
|
||||||
[vim-dispatch]: https://github.com/tpope/vim-dispatch
|
|
||||||
[releases]: https://github.com/mileszs/ack.vim/releases
|
|
@ -1,246 +0,0 @@
|
|||||||
if exists('g:autoloaded_ack') || &cp
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists('g:ack_use_dispatch')
|
|
||||||
if g:ack_use_dispatch && !exists(':Dispatch')
|
|
||||||
call s:Warn('Dispatch not loaded! Falling back to g:ack_use_dispatch = 0.')
|
|
||||||
let g:ack_use_dispatch = 0
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
let g:ack_use_dispatch = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
"-----------------------------------------------------------------------------
|
|
||||||
" Public API
|
|
||||||
"-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
function! ack#Ack(cmd, args) "{{{
|
|
||||||
call s:Init(a:cmd)
|
|
||||||
redraw
|
|
||||||
|
|
||||||
" Local values that we'll temporarily set as options when searching
|
|
||||||
let l:grepprg = g:ackprg
|
|
||||||
let l:grepformat = '%f:%l:%c:%m,%f:%l:%m' " Include column number
|
|
||||||
|
|
||||||
" Strip some options that are meaningless for path search and set match
|
|
||||||
" format accordingly.
|
|
||||||
if s:SearchingFilepaths()
|
|
||||||
let l:grepprg = substitute(l:grepprg, '-H\|--column', '', 'g')
|
|
||||||
let l:grepformat = '%f'
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Check user policy for blank searches
|
|
||||||
if empty(a:args)
|
|
||||||
if !g:ack_use_cword_for_empty_search
|
|
||||||
echo "No regular expression found."
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If no pattern is provided, search for the word under the cursor
|
|
||||||
let l:grepargs = empty(a:args) ? expand("<cword>") : a:args . join(a:000, ' ')
|
|
||||||
|
|
||||||
"Bypass search if cursor is on blank string
|
|
||||||
if l:grepargs == ""
|
|
||||||
echo "No regular expression found."
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
" NOTE: we escape special chars, but not everything using shellescape to
|
|
||||||
" allow for passing arguments etc
|
|
||||||
let l:escaped_args = escape(l:grepargs, '|#%')
|
|
||||||
|
|
||||||
echo "Searching ..."
|
|
||||||
|
|
||||||
if g:ack_use_dispatch
|
|
||||||
call s:SearchWithDispatch(l:grepprg, l:escaped_args, l:grepformat)
|
|
||||||
else
|
|
||||||
call s:SearchWithGrep(a:cmd, l:grepprg, l:escaped_args, l:grepformat)
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Dispatch has no callback mechanism currently, we just have to display the
|
|
||||||
" list window early and wait for it to populate :-/
|
|
||||||
call ack#ShowResults()
|
|
||||||
call s:Highlight(l:grepargs)
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
function! ack#AckFromSearch(cmd, args) "{{{
|
|
||||||
let search = getreg('/')
|
|
||||||
" translate vim regular expression to perl regular expression.
|
|
||||||
let search = substitute(search, '\(\\<\|\\>\)', '\\b', 'g')
|
|
||||||
call ack#Ack(a:cmd, '"' . search . '" ' . a:args)
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
function! ack#AckHelp(cmd, args) "{{{
|
|
||||||
let args = a:args . ' ' . s:GetDocLocations()
|
|
||||||
call ack#Ack(a:cmd, args)
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
function! ack#AckWindow(cmd, args) "{{{
|
|
||||||
let files = tabpagebuflist()
|
|
||||||
|
|
||||||
" remove duplicated filenames (files appearing in more than one window)
|
|
||||||
let files = filter(copy(sort(files)), 'index(files,v:val,v:key+1)==-1')
|
|
||||||
call map(files, "bufname(v:val)")
|
|
||||||
|
|
||||||
" remove unnamed buffers as quickfix (empty strings before shellescape)
|
|
||||||
call filter(files, 'v:val != ""')
|
|
||||||
|
|
||||||
" expand to full path (avoid problems with cd/lcd in au QuickFixCmdPre)
|
|
||||||
let files = map(files, "shellescape(fnamemodify(v:val, ':p'))")
|
|
||||||
let args = a:args . ' ' . join(files)
|
|
||||||
|
|
||||||
call ack#Ack(a:cmd, args)
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
function! ack#ShowResults() "{{{
|
|
||||||
let l:handler = s:UsingLocList() ? g:ack_lhandler : g:ack_qhandler
|
|
||||||
execute l:handler
|
|
||||||
call s:ApplyMappings()
|
|
||||||
redraw!
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
"-----------------------------------------------------------------------------
|
|
||||||
" Private API
|
|
||||||
"-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
function! s:ApplyMappings() "{{{
|
|
||||||
if !s:UsingListMappings() || &filetype != 'qf'
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:wintype = s:UsingLocList() ? 'l' : 'c'
|
|
||||||
let l:closemap = ':' . l:wintype . 'close<CR>'
|
|
||||||
let g:ack_mappings.q = l:closemap
|
|
||||||
|
|
||||||
nnoremap <buffer> <silent> ? :call <SID>QuickHelp()<CR>
|
|
||||||
|
|
||||||
if g:ack_autoclose
|
|
||||||
" We just map the 'go' and 'gv' mappings to close on autoclose, wtf?
|
|
||||||
for key_map in items(g:ack_mappings)
|
|
||||||
execute printf("nnoremap <buffer> <silent> %s %s", get(key_map, 0), get(key_map, 1) . l:closemap)
|
|
||||||
endfor
|
|
||||||
|
|
||||||
execute "nnoremap <buffer> <silent> <CR> <CR>" . l:closemap
|
|
||||||
else
|
|
||||||
for key_map in items(g:ack_mappings)
|
|
||||||
execute printf("nnoremap <buffer> <silent> %s %s", get(key_map, 0), get(key_map, 1))
|
|
||||||
endfor
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists("g:ackpreview") " if auto preview in on, remap j and k keys
|
|
||||||
nnoremap <buffer> <silent> j j<CR><C-W><C-W>
|
|
||||||
nnoremap <buffer> <silent> k k<CR><C-W><C-W>
|
|
||||||
nmap <buffer> <silent> <Down> j
|
|
||||||
nmap <buffer> <silent> <Up> k
|
|
||||||
endif
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
function! s:GetDocLocations() "{{{
|
|
||||||
let dp = ''
|
|
||||||
for p in split(&rtp, ',')
|
|
||||||
let p = p . '/doc/'
|
|
||||||
if isdirectory(p)
|
|
||||||
let dp = p . '*.txt ' . dp
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return dp
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
function! s:Highlight(args) "{{{
|
|
||||||
if !g:ackhighlight
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let @/ = matchstr(a:args, "\\v(-)\@<!(\<)\@<=\\w+|['\"]\\zs.{-}\\ze['\"]")
|
|
||||||
call feedkeys(":let &hlsearch=1 \| echo \<CR>", "n")
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
" Initialize state for an :Ack* or :LAck* search
|
|
||||||
function! s:Init(cmd) "{{{
|
|
||||||
let s:searching_filepaths = (a:cmd =~# '-g$') ? 1 : 0
|
|
||||||
let s:using_loclist = (a:cmd =~# '^l') ? 1 : 0
|
|
||||||
|
|
||||||
if g:ack_use_dispatch && s:using_loclist
|
|
||||||
call s:Warn('Dispatch does not support location lists! Proceeding with quickfix...')
|
|
||||||
let s:using_loclist = 0
|
|
||||||
endif
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
function! s:QuickHelp() "{{{
|
|
||||||
execute 'edit' globpath(&rtp, 'doc/ack_quick_help.txt')
|
|
||||||
|
|
||||||
silent normal gg
|
|
||||||
setlocal buftype=nofile bufhidden=hide nobuflisted
|
|
||||||
setlocal nomodifiable noswapfile
|
|
||||||
setlocal filetype=help
|
|
||||||
setlocal nonumber norelativenumber nowrap
|
|
||||||
setlocal foldmethod=diff foldlevel=20
|
|
||||||
|
|
||||||
nnoremap <buffer> <silent> ? :q!<CR>:call ack#ShowResults()<CR>
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
function! s:SearchWithDispatch(grepprg, grepargs, grepformat) "{{{
|
|
||||||
let l:makeprg_bak = &l:makeprg
|
|
||||||
let l:errorformat_bak = &l:errorformat
|
|
||||||
|
|
||||||
" We don't execute a :grep command for Dispatch, so add -g here instead
|
|
||||||
if s:SearchingFilepaths()
|
|
||||||
let l:grepprg = a:grepprg . ' -g'
|
|
||||||
else
|
|
||||||
let l:grepprg = a:grepprg
|
|
||||||
endif
|
|
||||||
|
|
||||||
try
|
|
||||||
let &l:makeprg = l:grepprg . ' ' . a:grepargs
|
|
||||||
let &l:errorformat = a:grepformat
|
|
||||||
|
|
||||||
Make
|
|
||||||
finally
|
|
||||||
let &l:makeprg = l:makeprg_bak
|
|
||||||
let &l:errorformat = l:errorformat_bak
|
|
||||||
endtry
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
function! s:SearchWithGrep(grepcmd, grepprg, grepargs, grepformat) "{{{
|
|
||||||
let l:grepprg_bak = &l:grepprg
|
|
||||||
let l:grepformat_bak = &grepformat
|
|
||||||
|
|
||||||
try
|
|
||||||
let &l:grepprg = a:grepprg
|
|
||||||
let &grepformat = a:grepformat
|
|
||||||
|
|
||||||
silent execute a:grepcmd a:grepargs
|
|
||||||
finally
|
|
||||||
let &l:grepprg = l:grepprg_bak
|
|
||||||
let &grepformat = l:grepformat_bak
|
|
||||||
endtry
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
" Are we finding matching files, not lines? (the -g option -- :AckFile)
|
|
||||||
function! s:SearchingFilepaths() "{{{
|
|
||||||
return get(s:, 'searching_filepaths', 0)
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
" Predicate for whether mappings are enabled for list type of current search.
|
|
||||||
function! s:UsingListMappings() "{{{
|
|
||||||
if s:UsingLocList()
|
|
||||||
return g:ack_apply_lmappings
|
|
||||||
else
|
|
||||||
return g:ack_apply_qmappings
|
|
||||||
endif
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
" Were we invoked with a :LAck command?
|
|
||||||
function! s:UsingLocList() "{{{
|
|
||||||
return get(s:, 'using_loclist', 0)
|
|
||||||
endfunction "}}}
|
|
||||||
|
|
||||||
function! s:Warn(msg) "{{{
|
|
||||||
echohl WarningMsg | echomsg 'Ack: ' . a:msg | echohl None
|
|
||||||
endf "}}}
|
|
||||||
|
|
||||||
let g:autoloaded_ack = 1
|
|
||||||
" vim:set et sw=2 ts=2 tw=78 fdm=marker
|
|
@ -1,315 +0,0 @@
|
|||||||
*ack.txt* Plugin that integrates ack with Vim
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
Author: Antoine Imbert <antoine.imbert+ackvim@gmail.com> *ack-author*
|
|
||||||
License: Same terms as Vim itself (see |license|)
|
|
||||||
|
|
||||||
This plugin is only available if 'compatible' is not set.
|
|
||||||
|
|
||||||
{Vi does not have any of this}
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
INTRODUCTION *ack*
|
|
||||||
|
|
||||||
This plugin is a front for the Perl module App::Ack. Ack can be used as a
|
|
||||||
replacement for grep. This plugin will allow you to run ack from vim, and
|
|
||||||
shows the results in a split window.
|
|
||||||
|
|
||||||
:Ack[!] [options] {pattern} [{directory}] *:Ack*
|
|
||||||
|
|
||||||
Search recursively in {directory} (which defaults to the current
|
|
||||||
directory) for the {pattern}. Behaves just like the |:grep| command, but
|
|
||||||
will open the |Quickfix| window for you. If [!] is not given the first
|
|
||||||
occurrence is jumped to.
|
|
||||||
|
|
||||||
:AckAdd [options] {pattern} [{directory}] *:AckAdd*
|
|
||||||
|
|
||||||
Just like |:Ack|, but instead of making a new list, the matches are
|
|
||||||
appended to the current |quickfix| list.
|
|
||||||
|
|
||||||
:AckFromSearch [{directory}] *:AckFromSearch*
|
|
||||||
|
|
||||||
Just like |:Ack| but the pattern is from previous search.
|
|
||||||
|
|
||||||
:LAck [options] {pattern} [{directory}] *:LAck*
|
|
||||||
|
|
||||||
Just like |:Ack| but instead of the |quickfix| list, matches are placed in
|
|
||||||
the current |location-list|.
|
|
||||||
|
|
||||||
:LAckAdd [options] {pattern} [{directory}] *:LAckAdd*
|
|
||||||
|
|
||||||
Just like |:AckAdd| but instead of the |quickfix| list, matches are added
|
|
||||||
to the current |location-list|
|
|
||||||
|
|
||||||
:AckFile [options] {pattern} [{directory}] *:AckFile*
|
|
||||||
|
|
||||||
Search recursively in {directory} (which defaults to the current
|
|
||||||
directory) for filenames matching the {pattern}. Behaves just like the
|
|
||||||
|:grep| command, but will open the |Quickfix| window for you.
|
|
||||||
|
|
||||||
:AckHelp[!] [options] {pattern} *:AckHelp*
|
|
||||||
|
|
||||||
Search vim documentation files for the {pattern}. Behaves just like the
|
|
||||||
|:Ack| command, but searches only vim documentation .txt files
|
|
||||||
|
|
||||||
:LAckHelp [options] {pattern} *:LAckHelp*
|
|
||||||
|
|
||||||
Just like |:AckHelp| but instead of the |quickfix| list, matches are placed
|
|
||||||
in the current |location-list|.
|
|
||||||
|
|
||||||
:AckWindow[!] [options] {pattern} *:AckWindow*
|
|
||||||
|
|
||||||
Search all buffers visible in the screen (current tab page only) files for
|
|
||||||
the {pattern}.
|
|
||||||
|
|
||||||
:LAckWindow [options] {pattern} *:LAckWindow*
|
|
||||||
|
|
||||||
Just like |:AckWindow| but instead of the |quickfix| list, matches are
|
|
||||||
placed in the current |location-list|.
|
|
||||||
|
|
||||||
Files containing the search term will be listed in the split window, along
|
|
||||||
with the line number of the occurrence, once for each occurrence. <Enter> on
|
|
||||||
a line in this window will open the file, and place the cursor on the matching
|
|
||||||
line.
|
|
||||||
|
|
||||||
Note that if you are using Dispatch.vim with |g:ack_use_dispatch|, location
|
|
||||||
lists are not supported, because Dispatch does not support them at this time.
|
|
||||||
`:LAck` versions of commands above will give a warning and proceed to use the
|
|
||||||
quickfix list instead.
|
|
||||||
|
|
||||||
See http://beyondgrep.com/ for more information on searching with ack.
|
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
CONFIGURATION *ack-configuration*
|
|
||||||
|
|
||||||
*g:ackprg*
|
|
||||||
g:ackprg
|
|
||||||
Default for ubuntu: "ack-grep"
|
|
||||||
Default for other systems: "ack"
|
|
||||||
|
|
||||||
Use this option to specify the search command and its default arguments.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
>
|
|
||||||
let g:ackprg = "ag --vimgrep"
|
|
||||||
<
|
|
||||||
*g:ack_default_options*
|
|
||||||
g:ack_default_options
|
|
||||||
Default: " -s -H --nocolor --nogroup --column"
|
|
||||||
|
|
||||||
Use this option to specify the default arguments given to `ack`. This is only
|
|
||||||
used if |g:ackprg| has not been customized from the default--if you are using
|
|
||||||
a custom search program instead of Ack, set your preferred options in
|
|
||||||
|g:ackprg|.
|
|
||||||
|
|
||||||
NOTE: This option may be deprecated in the future. ~
|
|
||||||
|
|
||||||
Example:
|
|
||||||
>
|
|
||||||
let g:ack_default_options =
|
|
||||||
\ " -s -H --nocolor --nogroup --column --smart-case --follow"
|
|
||||||
<
|
|
||||||
*g:ack_apply_qmappings*
|
|
||||||
g:ack_apply_qmappings
|
|
||||||
Default: 1
|
|
||||||
|
|
||||||
This option enables mappings on the |quickfix| window.
|
|
||||||
|
|
||||||
*g:ack_apply_lmappings*
|
|
||||||
g:ack_apply_lmappings
|
|
||||||
Default: 1
|
|
||||||
|
|
||||||
This option enables mappings on |location-list| windows.
|
|
||||||
|
|
||||||
*g:ack_mappings*
|
|
||||||
g:ack_mappings
|
|
||||||
Default: {
|
|
||||||
\ "t": "<C-W><CR><C-W>T",
|
|
||||||
\ "T": "<C-W><CR><C-W>TgT<C-W>j",
|
|
||||||
\ "o": "<CR>",
|
|
||||||
\ "O": "<CR><C-W><C-W>:ccl<CR>",
|
|
||||||
\ "go": "<CR><C-W>j",
|
|
||||||
\ "h": "<C-W><CR><C-W>K",
|
|
||||||
\ "H": "<C-W><CR><C-W>K<C-W>b",
|
|
||||||
\ "v": "<C-W><CR><C-W>H<C-W>b<C-W>J<C-W>t",
|
|
||||||
\ "gv": "<C-W><CR><C-W>H<C-W>b<C-W>J" }
|
|
||||||
|
|
||||||
This option list all maps create on quickfix/Location list window.
|
|
||||||
|
|
||||||
Example, if you want to open the result in the middle of the screen:
|
|
||||||
>
|
|
||||||
let g:ack_mappings = { "o": "<CR>zz" }
|
|
||||||
<
|
|
||||||
*g:ack_qhandler*
|
|
||||||
g:ack_qhandler
|
|
||||||
Default: "botright copen"
|
|
||||||
|
|
||||||
Command to open the quickview window.
|
|
||||||
|
|
||||||
If you want to open a quickview window with 30 lines you can do:
|
|
||||||
>
|
|
||||||
let g:ack_qhandler = "botright copen 30"
|
|
||||||
<
|
|
||||||
*g:ack_lhandler*
|
|
||||||
g:ack_lhandler
|
|
||||||
Default: "botright lopen"
|
|
||||||
|
|
||||||
Command to open the Location list window.
|
|
||||||
|
|
||||||
If you want to open a Location list window with 30 lines you can do:
|
|
||||||
>
|
|
||||||
let g:ack_lhandler = "botright lopen 30"
|
|
||||||
<
|
|
||||||
*g:ackhighlight*
|
|
||||||
g:ackhighlight
|
|
||||||
Default: 0
|
|
||||||
|
|
||||||
Use this option to highlight the searched term.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
>
|
|
||||||
let g:ackhighlight = 1
|
|
||||||
<
|
|
||||||
*g:ack_autoclose*
|
|
||||||
g:ack_autoclose
|
|
||||||
Default: 0
|
|
||||||
|
|
||||||
Use this option to specify whether to close the quickfix window after
|
|
||||||
using any of the shortcuts.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
>
|
|
||||||
let g:ack_autoclose = 1
|
|
||||||
<
|
|
||||||
*g:ack_autofold_results*
|
|
||||||
g:ack_autofold_results
|
|
||||||
Default: 0
|
|
||||||
|
|
||||||
Use this option to fold the results in quickfix by file name. Only the current
|
|
||||||
fold will be open by default and while you press 'j' and 'k' to move between the
|
|
||||||
results if you hit other fold the last one will be closed and the current will
|
|
||||||
be open.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
>
|
|
||||||
let g:ack_autofold_results = 1
|
|
||||||
<
|
|
||||||
*g:ackpreview*
|
|
||||||
g:ackpreview
|
|
||||||
Default: 0
|
|
||||||
|
|
||||||
Use this option to automagically open the file with 'j' or 'k'.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
>
|
|
||||||
let g:ackpreview = 1
|
|
||||||
<
|
|
||||||
*g:ack_use_dispatch*
|
|
||||||
g:ack_use_dispatch
|
|
||||||
Default: 0
|
|
||||||
|
|
||||||
Use this option to use vim-dispatch to run searches in the background, with a
|
|
||||||
variety of execution backends for different systems.
|
|
||||||
|
|
||||||
Due to limitations in Dispatch at this time, location lists are unsupported
|
|
||||||
and result windows will appear before results are ready. Still, these may be
|
|
||||||
acceptable tradeoffs for very large projects where searches are slow.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
>
|
|
||||||
let g:ack_use_dispatch = 1
|
|
||||||
<
|
|
||||||
*g:ack_use_cword_for_empty_search*
|
|
||||||
g:ack_use_cword_for_empty_search
|
|
||||||
Default: 1
|
|
||||||
|
|
||||||
Use this option to enable blank searches to run against the word under the
|
|
||||||
cursor. When this option is not set, blank searches will only output an error
|
|
||||||
message.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
>
|
|
||||||
let g:ack_use_cword_for_empty_search = 0
|
|
||||||
<
|
|
||||||
==============================================================================
|
|
||||||
MAPPINGS *ack-mappings*
|
|
||||||
|
|
||||||
The following keyboard shortcuts are available in the |quickfix| and
|
|
||||||
|location-list| windows:
|
|
||||||
|
|
||||||
? display a quick summary of these mappings.
|
|
||||||
|
|
||||||
o open file (same as Enter).
|
|
||||||
|
|
||||||
O open file and close the quickfix window.
|
|
||||||
|
|
||||||
go preview file (open but maintain focus on ack.vim results).
|
|
||||||
|
|
||||||
t open in a new tab.
|
|
||||||
|
|
||||||
T open in new tab without moving to it.
|
|
||||||
|
|
||||||
h open in horizontal split.
|
|
||||||
|
|
||||||
H open in horizontal split, keeping focus on the results.
|
|
||||||
|
|
||||||
v open in vertical split.
|
|
||||||
|
|
||||||
gv open in vertical split, keeping focus on the results.
|
|
||||||
|
|
||||||
q close the quickfix window.
|
|
||||||
|
|
||||||
To adjust these, see |g:ack_mappings|.
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
Ignoring files *ack-ignore*
|
|
||||||
|
|
||||||
If you're using this plugin with ag, The Silver Searcher, bear in mind that:
|
|
||||||
|
|
||||||
- It ignores file patterns from your .gitignore and .hgignore.
|
|
||||||
|
|
||||||
- If there are other files in your source repository you don't wish to
|
|
||||||
search, you can add their patterns to an .agignore file.
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
ISSUES AND FAQ *ack-issues-and-faq*
|
|
||||||
|
|
||||||
I don't want to jump to the first result automatically.~
|
|
||||||
|
|
||||||
Use `:Ack!`, with bang. If you want this behavior most of the time, you
|
|
||||||
might like an abbreviation or mapping in your personal config, something
|
|
||||||
like these:
|
|
||||||
>
|
|
||||||
cnoreabbrev Ack Ack!
|
|
||||||
nnoremap <Leader>a :Ack!<Space>
|
|
||||||
<
|
|
||||||
Most of the `:[L]Ack*` commands support this. Note that this behavior
|
|
||||||
follows the convention of Vim's built-in |:grep| and |:make| commands.
|
|
||||||
|
|
||||||
I use NERDTree and opening ack.vim results in a vertical split displacing it.~
|
|
||||||
|
|
||||||
You are probably using NERDTree with its default alignment at the left
|
|
||||||
side of the window. Set these custom mappings in your vimrc to work around
|
|
||||||
this:
|
|
||||||
>
|
|
||||||
let g:ack_mappings = {
|
|
||||||
\ 'v': '<C-W><CR><C-W>L<C-W>p<C-W>J<C-W>p',
|
|
||||||
\ 'gv': '<C-W><CR><C-W>L<C-W>p<C-W>J' }
|
|
||||||
<
|
|
||||||
This solution will be improved in the future.
|
|
||||||
|
|
||||||
Results show a mix of relative and absolute paths, making them hard to read.~
|
|
||||||
|
|
||||||
This is a quirk of Vim that can happen with plain |:vimgrep| too. You can
|
|
||||||
try this in your vimrc to work around it:
|
|
||||||
>
|
|
||||||
autocmd BufAdd * exe "cd" fnameescape(getcwd())
|
|
||||||
<
|
|
||||||
but for some users this may be disruptive to their Vim workflow. For more
|
|
||||||
details, see:
|
|
||||||
|
|
||||||
http://vi.stackexchange.com/a/4816/7174
|
|
||||||
https://github.com/mileszs/ack.vim/issues/143
|
|
||||||
|
|
||||||
vim:set et sw=4 ts=4 tw=78:
|
|
@ -1,15 +0,0 @@
|
|||||||
==== ack.vim quick help ===============
|
|
||||||
|
|
||||||
*?:* a quick summary of these keys, repeat to close
|
|
||||||
*o:* to open (same as Enter)
|
|
||||||
*O:* to open and close the quickfix window
|
|
||||||
*go:* to preview file, open but maintain focus on ack.vim results
|
|
||||||
*t:* to open in new tab
|
|
||||||
*T:* to open in new tab without moving to it
|
|
||||||
*h:* to open in horizontal split
|
|
||||||
*H:* to open in horizontal split, keeping focus on the results
|
|
||||||
*v:* to open in vertical split
|
|
||||||
*gv:* to open in vertical split, keeping focus on the results
|
|
||||||
*q:* to close the quickfix window
|
|
||||||
|
|
||||||
========================================
|
|
@ -1,9 +0,0 @@
|
|||||||
if exists("g:ack_autofold_results") && g:ack_autofold_results
|
|
||||||
setlocal foldlevel=0
|
|
||||||
setlocal foldmethod=expr
|
|
||||||
setlocal foldexpr=matchstr(getline(v:lnum),'^[^\|]\\+')==#matchstr(getline(v:lnum+1),'^[^\|]\\+')?1:'<1'
|
|
||||||
setlocal foldenable
|
|
||||||
setlocal foldclose=all
|
|
||||||
setlocal foldopen=all
|
|
||||||
nnoremap <buffer> j jzz
|
|
||||||
endif
|
|
@ -1,83 +0,0 @@
|
|||||||
if exists('g:loaded_ack') || &cp
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("g:ack_default_options")
|
|
||||||
let g:ack_default_options = " -s -H --nopager --nocolor --nogroup --column"
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Location of the ack utility
|
|
||||||
if !exists("g:ackprg")
|
|
||||||
if executable('ack-grep')
|
|
||||||
let g:ackprg = "ack-grep"
|
|
||||||
elseif executable('ack')
|
|
||||||
let g:ackprg = "ack"
|
|
||||||
else
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
let g:ackprg .= g:ack_default_options
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("g:ack_apply_qmappings")
|
|
||||||
let g:ack_apply_qmappings = !exists("g:ack_qhandler")
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("g:ack_apply_lmappings")
|
|
||||||
let g:ack_apply_lmappings = !exists("g:ack_lhandler")
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:ack_mappings = {
|
|
||||||
\ "t": "<C-W><CR><C-W>T",
|
|
||||||
\ "T": "<C-W><CR><C-W>TgT<C-W>j",
|
|
||||||
\ "o": "<CR>",
|
|
||||||
\ "O": "<CR><C-W>p<C-W>c",
|
|
||||||
\ "go": "<CR><C-W>p",
|
|
||||||
\ "h": "<C-W><CR><C-W>K",
|
|
||||||
\ "H": "<C-W><CR><C-W>K<C-W>b",
|
|
||||||
\ "v": "<C-W><CR><C-W>H<C-W>b<C-W>J<C-W>t",
|
|
||||||
\ "gv": "<C-W><CR><C-W>H<C-W>b<C-W>J" }
|
|
||||||
|
|
||||||
if exists("g:ack_mappings")
|
|
||||||
let g:ack_mappings = extend(s:ack_mappings, g:ack_mappings)
|
|
||||||
else
|
|
||||||
let g:ack_mappings = s:ack_mappings
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("g:ack_qhandler")
|
|
||||||
let g:ack_qhandler = "botright copen"
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("g:ack_lhandler")
|
|
||||||
let g:ack_lhandler = "botright lopen"
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("g:ackhighlight")
|
|
||||||
let g:ackhighlight = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("g:ack_autoclose")
|
|
||||||
let g:ack_autoclose = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("g:ack_autofold_results")
|
|
||||||
let g:ack_autofold_results = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("g:ack_use_cword_for_empty_search")
|
|
||||||
let g:ack_use_cword_for_empty_search = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
command! -bang -nargs=* -complete=file Ack call ack#Ack('grep<bang>', <q-args>)
|
|
||||||
command! -bang -nargs=* -complete=file AckAdd call ack#Ack('grepadd<bang>', <q-args>)
|
|
||||||
command! -bang -nargs=* -complete=file AckFromSearch call ack#AckFromSearch('grep<bang>', <q-args>)
|
|
||||||
command! -bang -nargs=* -complete=file LAck call ack#Ack('lgrep<bang>', <q-args>)
|
|
||||||
command! -bang -nargs=* -complete=file LAckAdd call ack#Ack('lgrepadd<bang>', <q-args>)
|
|
||||||
command! -bang -nargs=* -complete=file AckFile call ack#Ack('grep<bang> -g', <q-args>)
|
|
||||||
command! -bang -nargs=* -complete=help AckHelp call ack#AckHelp('grep<bang>', <q-args>)
|
|
||||||
command! -bang -nargs=* -complete=help LAckHelp call ack#AckHelp('lgrep<bang>', <q-args>)
|
|
||||||
command! -bang -nargs=* AckWindow call ack#AckWindow('grep<bang>', <q-args>)
|
|
||||||
command! -bang -nargs=* LAckWindow call ack#AckWindow('lgrep<bang>', <q-args>)
|
|
||||||
|
|
||||||
let g:loaded_ack = 1
|
|
||||||
|
|
||||||
" vim:set et sw=2 ts=2 tw=78 fdm=marker
|
|
@ -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 <Enter> or <Left-Mouse-Click> 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 <Shift-Enter> 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.
|
|
@ -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 <your runtime directory>/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:
|
|
||||||
|
|
||||||
<F1> Toggle help information.
|
|
||||||
<enter> Opens the buffer that is under the cursor into the current
|
|
||||||
window.
|
|
||||||
<leftmouse> Opens the buffer that is under the cursor into the current
|
|
||||||
window.
|
|
||||||
<shift-enter> 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 <F1> 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
|
|
||||||
<SNR>14_StartBufExplorer..<SNR>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
|
|
||||||
user’s 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 <F1> 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 <esc> key mapping was causing the buffer
|
|
||||||
explored to close prematurely when vim was run in an xterm. The <esc>
|
|
||||||
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 <esc> 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 <Leader>be and <Leader>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 <delux256-vim at yahoo dot com>
|
|
||||||
|
|
||||||
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:
|
|
File diff suppressed because it is too large
Load Diff
7
sources_non_forked/ctrlp.vim/.gitignore
vendored
7
sources_non_forked/ctrlp.vim/.gitignore
vendored
@ -1,7 +0,0 @@
|
|||||||
*.markdown
|
|
||||||
*.zip
|
|
||||||
note.txt
|
|
||||||
tags
|
|
||||||
tags-cn
|
|
||||||
.hg*
|
|
||||||
tmp/*
|
|
File diff suppressed because it is too large
Load Diff
@ -1,173 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: autoload/ctrlp/autoignore.vim
|
|
||||||
" Description: Auto-ignore Extension
|
|
||||||
" Author: Ludovic Chabant <github.com/ludovicchabant>
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
|
|
||||||
" Global Settings {{{
|
|
||||||
|
|
||||||
if exists('g:ctrlp_autoignore_loaded') && g:ctrlp_autoignore_loaded
|
|
||||||
\ && !g:ctrlp_autoignore_debug
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
let g:ctrlp_autoignore_loaded = 1
|
|
||||||
|
|
||||||
if !exists('g:ctrlp_autoignore_debug')
|
|
||||||
let g:ctrlp_autoignore_debug = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:ctrlp_autoignore_trace')
|
|
||||||
let g:ctrlp_autoignore_trace = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" Initialization {{{
|
|
||||||
|
|
||||||
if !exists('g:ctrlp_custom_ignore')
|
|
||||||
let g:ctrlp_custom_ignore = {}
|
|
||||||
endif
|
|
||||||
let g:ctrlp_custom_ignore['func'] = 'ctrlp#autoignore#ignore'
|
|
||||||
let g:ctrlp_custom_ignore['func-init'] = 'ctrlp#autoignore#ignore_init'
|
|
||||||
let g:ctrlp_custom_ignore['func-close'] = 'ctrlp#autoignore#ignore_close'
|
|
||||||
|
|
||||||
if !exists('g:ctrlp_root_markers')
|
|
||||||
let g:ctrlp_root_markers = []
|
|
||||||
endif
|
|
||||||
call add(g:ctrlp_root_markers, '.ctrlpignore')
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" Internals {{{
|
|
||||||
|
|
||||||
function! s:trace(message) abort
|
|
||||||
if g:ctrlp_autoignore_trace
|
|
||||||
echom "ctrlp_autoignore: " . a:message
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let s:proj_cache = {}
|
|
||||||
let s:active_cwd = ''
|
|
||||||
let s:active_cwd_len = 0
|
|
||||||
let s:active_patterns = []
|
|
||||||
let s:changed_wildignore = 0
|
|
||||||
let s:prev_wildignore = ''
|
|
||||||
|
|
||||||
function! s:load_project_patterns(root_dir) abort
|
|
||||||
let l:ign_path = a:root_dir . '/.ctrlpignore'
|
|
||||||
if !filereadable(l:ign_path)
|
|
||||||
call s:trace("No pattern file at: " . l:ign_path)
|
|
||||||
return []
|
|
||||||
endif
|
|
||||||
let l:cursyntax = 'regexp'
|
|
||||||
let l:knownsyntaxes = ['regexp', 'wildignore']
|
|
||||||
let l:patterns = []
|
|
||||||
let l:lines = readfile(l:ign_path)
|
|
||||||
for line in l:lines
|
|
||||||
" Comment line?
|
|
||||||
if match(line, '\v^\s*$') >= 0 || match(line, '\v^\s*#') >= 0
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
" Syntax change?
|
|
||||||
let l:matches = matchlist(line, '\v^syntax:\s?(\w+)\s*$')
|
|
||||||
if len(l:matches) > 0
|
|
||||||
let l:cursyntax = l:matches[1]
|
|
||||||
if index(l:knownsyntaxes, l:cursyntax) < 0
|
|
||||||
echoerr "ctrlp_autoignore: Unknown syntax '".l:cursyntax."' in: ".l:ign_path
|
|
||||||
endif
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
" Patterns!
|
|
||||||
let l:matches = matchlist(line, '\v^((dir|file|link)\:)?(.*)')
|
|
||||||
let l:mtype = l:matches[2]
|
|
||||||
let l:mpat = l:matches[3]
|
|
||||||
call add(l:patterns, {'syn': l:cursyntax, 'type': l:mtype, 'pat': l:mpat})
|
|
||||||
endfor
|
|
||||||
call s:trace("Loaded " . len(l:patterns) . " patterns from: " . l:ign_path)
|
|
||||||
return l:patterns
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:get_project_patterns(root_dir) abort
|
|
||||||
let l:ign_path = a:root_dir . '/.ctrlpignore'
|
|
||||||
let l:ign_mtime = getftime(l:ign_path)
|
|
||||||
let l:patterns = get(s:proj_cache, a:root_dir)
|
|
||||||
if type(l:patterns) == type({})
|
|
||||||
" Check that these patterns are still valid.
|
|
||||||
if l:ign_mtime < 0
|
|
||||||
" File got deleted! :(
|
|
||||||
let l:patterns['pats'] = []
|
|
||||||
return l:patterns['pats']
|
|
||||||
elseif l:ign_mtime <= l:patterns['mtime']
|
|
||||||
" File hasn't changed! :)
|
|
||||||
return l:patterns['pats']
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
call s:trace("Loading patterns for project: " . a:root_dir)
|
|
||||||
let l:loaded = s:load_project_patterns(a:root_dir)
|
|
||||||
let s:proj_cache[a:root_dir] = {
|
|
||||||
\'mtime': localtime(),
|
|
||||||
\'pats': l:loaded}
|
|
||||||
return l:loaded
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" The custom ignore function that CtrlP will be using in addition to
|
|
||||||
" normal pattern-based matching.
|
|
||||||
function! ctrlp#autoignore#ignore(item, type) abort
|
|
||||||
let l:cnv_item = tr(strpart(a:item, s:active_cwd_len), "\\", "/")
|
|
||||||
for pat in s:active_patterns
|
|
||||||
if pat['syn'] != 'regexp'
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
if pat['type'] == '' || pat['type'] == a:type
|
|
||||||
if match(l:cnv_item, pat['pat']) >= 0
|
|
||||||
call s:trace("Ignoring ".l:cnv_item." because of ".pat['pat'])
|
|
||||||
return 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
return 0
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ctrlp#autoignore#ignore_init() abort
|
|
||||||
let l:root = getcwd()
|
|
||||||
let s:active_cwd = l:root
|
|
||||||
" len+1 is for including the next separator after the root.
|
|
||||||
let s:active_cwd_len = len(l:root) + 1
|
|
||||||
let s:active_patterns = s:get_project_patterns(l:root)
|
|
||||||
call s:trace("Got ".len(s:active_patterns)." patterns for ".l:root)
|
|
||||||
|
|
||||||
let s:changed_wildignore = 0
|
|
||||||
let s:prev_wildignore = &wildignore
|
|
||||||
for pat in s:active_patterns
|
|
||||||
if pat['syn'] == 'wildignore'
|
|
||||||
execute 'set wildignore+='.pat['pat']
|
|
||||||
let s:changed_wildignore = 1
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
if s:changed_wildignore
|
|
||||||
call s:trace("Set wildignore to ".&wildignore)
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ctrlp#autoignore#ignore_close() abort
|
|
||||||
if s:changed_wildignore
|
|
||||||
execute 'set wildignore='.s:prev_wildignore
|
|
||||||
let s:prev_wildignore = ''
|
|
||||||
call s:trace("Set wildignore back to ".&wildignore)
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" List patterns for a given project's root.
|
|
||||||
function! ctrlp#autoignore#get_patterns(root_dir) abort
|
|
||||||
let l:patterns = s:get_project_patterns(a:root_dir)
|
|
||||||
for pat in l:patterns
|
|
||||||
let l:prefix = pat['type'] == '' ? '(all)' : pat['type']
|
|
||||||
echom l:prefix . ':' . pat['pat']
|
|
||||||
endfor
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
|
@ -1,147 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: autoload/ctrlp/bookmarkdir.vim
|
|
||||||
" Description: Bookmarked directories extension
|
|
||||||
" Author: Kien Nguyen <github.com/kien>
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Init {{{1
|
|
||||||
if exists('g:loaded_ctrlp_bookmarkdir') && g:loaded_ctrlp_bookmarkdir
|
|
||||||
fini
|
|
||||||
en
|
|
||||||
let g:loaded_ctrlp_bookmarkdir = 1
|
|
||||||
|
|
||||||
cal add(g:ctrlp_ext_vars, {
|
|
||||||
\ 'init': 'ctrlp#bookmarkdir#init()',
|
|
||||||
\ 'accept': 'ctrlp#bookmarkdir#accept',
|
|
||||||
\ 'lname': 'bookmarked dirs',
|
|
||||||
\ 'sname': 'bkd',
|
|
||||||
\ 'type': 'tabs',
|
|
||||||
\ 'opmul': 1,
|
|
||||||
\ 'nolim': 1,
|
|
||||||
\ 'wipe': 'ctrlp#bookmarkdir#remove',
|
|
||||||
\ })
|
|
||||||
|
|
||||||
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
|
||||||
" Utilities {{{1
|
|
||||||
fu! s:getinput(str, ...)
|
|
||||||
echoh Identifier
|
|
||||||
cal inputsave()
|
|
||||||
let input = call('input', a:0 ? [a:str] + a:000 : [a:str])
|
|
||||||
cal inputrestore()
|
|
||||||
echoh None
|
|
||||||
retu input
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:cachefile()
|
|
||||||
if !exists('s:cadir') || !exists('s:cafile')
|
|
||||||
let s:cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'bkd'
|
|
||||||
let s:cafile = s:cadir.ctrlp#utils#lash().'cache.txt'
|
|
||||||
en
|
|
||||||
retu s:cafile
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:writecache(lines)
|
|
||||||
cal ctrlp#utils#writecache(a:lines, s:cadir, s:cafile)
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:getbookmarks()
|
|
||||||
retu ctrlp#utils#readfile(s:cachefile())
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:savebookmark(name, cwd)
|
|
||||||
let cwds = exists('+ssl') ? [tr(a:cwd, '\', '/'), tr(a:cwd, '/', '\')] : [a:cwd]
|
|
||||||
let entries = filter(s:getbookmarks(), 'index(cwds, s:parts(v:val)[1]) < 0')
|
|
||||||
cal s:writecache(insert(entries, a:name.' '.a:cwd))
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:setentries()
|
|
||||||
let time = getftime(s:cachefile())
|
|
||||||
if !( exists('s:bookmarks') && time == s:bookmarks[0] )
|
|
||||||
let s:bookmarks = [time, s:getbookmarks()]
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:parts(str)
|
|
||||||
let mlist = matchlist(a:str, '\v([^\t]+)\t(.*)$')
|
|
||||||
retu mlist != [] ? mlist[1:2] : ['', '']
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:process(entries, type)
|
|
||||||
retu map(a:entries, 's:modify(v:val, a:type)')
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:modify(entry, type)
|
|
||||||
let [name, dir] = s:parts(a:entry)
|
|
||||||
let dir = fnamemodify(dir, a:type)
|
|
||||||
retu name.' '.( dir == '' ? '.' : dir )
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:msg(name, cwd)
|
|
||||||
redr
|
|
||||||
echoh Identifier | echon 'Bookmarked ' | echoh Constant
|
|
||||||
echon a:name.' ' | echoh Directory | echon a:cwd
|
|
||||||
echoh None
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:syntax()
|
|
||||||
if !ctrlp#nosy()
|
|
||||||
cal ctrlp#hicheck('CtrlPBookmark', 'Identifier')
|
|
||||||
cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
|
|
||||||
sy match CtrlPBookmark '^> [^\t]\+' contains=CtrlPLinePre
|
|
||||||
sy match CtrlPTabExtra '\zs\t.*\ze$'
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
" Public {{{1
|
|
||||||
fu! ctrlp#bookmarkdir#init()
|
|
||||||
cal s:setentries()
|
|
||||||
cal s:syntax()
|
|
||||||
retu s:process(copy(s:bookmarks[1]), ':.')
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#bookmarkdir#accept(mode, str)
|
|
||||||
let parts = s:parts(s:modify(a:str, ':p'))
|
|
||||||
cal call('s:savebookmark', parts)
|
|
||||||
if a:mode =~ 't\|v\|h'
|
|
||||||
cal ctrlp#exit()
|
|
||||||
en
|
|
||||||
cal ctrlp#setdir(parts[1], a:mode =~ 't\|h' ? 'chd!' : 'lc!')
|
|
||||||
if a:mode == 'e'
|
|
||||||
cal ctrlp#switchtype(0)
|
|
||||||
cal ctrlp#recordhist()
|
|
||||||
cal ctrlp#prtclear()
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#bookmarkdir#add(bang, dir, ...)
|
|
||||||
let ctrlp_tilde_homedir = get(g:, 'ctrlp_tilde_homedir', 0)
|
|
||||||
let cwd = fnamemodify(getcwd(), ctrlp_tilde_homedir ? ':p:~' : ':p')
|
|
||||||
let dir = fnamemodify(a:dir, ctrlp_tilde_homedir ? ':p:~' : ':p')
|
|
||||||
if a:bang == '!'
|
|
||||||
let cwd = dir != '' ? dir : cwd
|
|
||||||
let name = a:0 && a:1 != '' ? a:1 : cwd
|
|
||||||
el
|
|
||||||
let str = 'Directory to bookmark: '
|
|
||||||
let cwd = dir != '' ? dir : s:getinput(str, cwd, 'dir')
|
|
||||||
if cwd == '' | retu | en
|
|
||||||
let name = a:0 && a:1 != '' ? a:1 : s:getinput('Bookmark as: ', cwd)
|
|
||||||
if name == '' | retu | en
|
|
||||||
en
|
|
||||||
let name = tr(name, ' ', ' ')
|
|
||||||
cal s:savebookmark(name, cwd)
|
|
||||||
cal s:msg(name, cwd)
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#bookmarkdir#remove(entries)
|
|
||||||
cal s:process(a:entries, ':p')
|
|
||||||
cal s:writecache(a:entries == [] ? [] :
|
|
||||||
\ filter(s:getbookmarks(), 'index(a:entries, v:val) < 0'))
|
|
||||||
cal s:setentries()
|
|
||||||
retu s:process(copy(s:bookmarks[1]), ':.')
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#bookmarkdir#id()
|
|
||||||
retu s:id
|
|
||||||
endf
|
|
||||||
"}}}
|
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
|
@ -1,277 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: autoload/ctrlp/buffertag.vim
|
|
||||||
" Description: Buffer Tag extension
|
|
||||||
" Maintainer: Kien Nguyen <github.com/kien>
|
|
||||||
" Credits: Much of the code was taken from tagbar.vim by Jan Larres, plus
|
|
||||||
" a few lines from taglist.vim by Yegappan Lakshmanan and from
|
|
||||||
" buffertag.vim by Takeshi Nishida.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Init {{{1
|
|
||||||
if exists('g:loaded_ctrlp_buftag') && g:loaded_ctrlp_buftag
|
|
||||||
fini
|
|
||||||
en
|
|
||||||
let g:loaded_ctrlp_buftag = 1
|
|
||||||
|
|
||||||
cal add(g:ctrlp_ext_vars, {
|
|
||||||
\ 'init': 'ctrlp#buffertag#init(s:crfile)',
|
|
||||||
\ 'accept': 'ctrlp#buffertag#accept',
|
|
||||||
\ 'lname': 'buffer tags',
|
|
||||||
\ 'sname': 'bft',
|
|
||||||
\ 'exit': 'ctrlp#buffertag#exit()',
|
|
||||||
\ 'type': 'tabs',
|
|
||||||
\ 'opts': 'ctrlp#buffertag#opts()',
|
|
||||||
\ })
|
|
||||||
|
|
||||||
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
|
||||||
|
|
||||||
let [s:pref, s:opts] = ['g:ctrlp_buftag_', {
|
|
||||||
\ 'systemenc': ['s:enc', &enc],
|
|
||||||
\ 'ctags_bin': ['s:bin', ''],
|
|
||||||
\ 'types': ['s:usr_types', {}],
|
|
||||||
\ }]
|
|
||||||
|
|
||||||
let s:bins = [
|
|
||||||
\ 'ctags-exuberant',
|
|
||||||
\ 'exuberant-ctags',
|
|
||||||
\ 'exctags',
|
|
||||||
\ '/usr/local/bin/ctags',
|
|
||||||
\ '/opt/local/bin/ctags',
|
|
||||||
\ 'ctags',
|
|
||||||
\ 'ctags.exe',
|
|
||||||
\ 'tags',
|
|
||||||
\ ]
|
|
||||||
|
|
||||||
let s:types = {
|
|
||||||
\ 'ant' : '%sant%sant%spt',
|
|
||||||
\ 'asm' : '%sasm%sasm%sdlmt',
|
|
||||||
\ 'aspperl': '%sasp%sasp%sfsv',
|
|
||||||
\ 'aspvbs' : '%sasp%sasp%sfsv',
|
|
||||||
\ 'awk' : '%sawk%sawk%sf',
|
|
||||||
\ 'beta' : '%sbeta%sbeta%sfsv',
|
|
||||||
\ 'c' : '%sc%sc%sdgsutvf',
|
|
||||||
\ 'cpp' : '%sc++%sc++%snvdtcgsuf',
|
|
||||||
\ 'cs' : '%sc#%sc#%sdtncEgsipm',
|
|
||||||
\ 'cobol' : '%scobol%scobol%sdfgpPs',
|
|
||||||
\ 'delphi' : '%spascal%spascal%sfp',
|
|
||||||
\ 'dosbatch': '%sdosbatch%sdosbatch%slv',
|
|
||||||
\ 'eiffel' : '%seiffel%seiffel%scf',
|
|
||||||
\ 'erlang' : '%serlang%serlang%sdrmf',
|
|
||||||
\ 'expect' : '%stcl%stcl%scfp',
|
|
||||||
\ 'fortran': '%sfortran%sfortran%spbceiklmntvfs',
|
|
||||||
\ 'go' : '%sgo%sgo%sfctv',
|
|
||||||
\ 'html' : '%shtml%shtml%saf',
|
|
||||||
\ 'java' : '%sjava%sjava%spcifm',
|
|
||||||
\ 'javascript': '%sjavascript%sjavascript%sf',
|
|
||||||
\ 'lisp' : '%slisp%slisp%sf',
|
|
||||||
\ 'lua' : '%slua%slua%sf',
|
|
||||||
\ 'make' : '%smake%smake%sm',
|
|
||||||
\ 'matlab' : '%smatlab%smatlab%sf',
|
|
||||||
\ 'ocaml' : '%socaml%socaml%scmMvtfCre',
|
|
||||||
\ 'pascal' : '%spascal%spascal%sfp',
|
|
||||||
\ 'perl' : '%sperl%sperl%sclps',
|
|
||||||
\ 'php' : '%sphp%sphp%scdvf',
|
|
||||||
\ 'python' : '%spython%spython%scmf',
|
|
||||||
\ 'rexx' : '%srexx%srexx%ss',
|
|
||||||
\ 'ruby' : '%sruby%sruby%scfFm',
|
|
||||||
\ 'rust' : '%srust%srust%sfTgsmctid',
|
|
||||||
\ 'scheme' : '%sscheme%sscheme%ssf',
|
|
||||||
\ 'sh' : '%ssh%ssh%sf',
|
|
||||||
\ 'csh' : '%ssh%ssh%sf',
|
|
||||||
\ 'zsh' : '%ssh%ssh%sf',
|
|
||||||
\ 'scala' : '%sscala%sscala%sctTmlp',
|
|
||||||
\ 'slang' : '%sslang%sslang%snf',
|
|
||||||
\ 'sml' : '%ssml%ssml%secsrtvf',
|
|
||||||
\ 'sql' : '%ssql%ssql%scFPrstTvfp',
|
|
||||||
\ 'tex' : '%stex%stex%sipcsubPGl',
|
|
||||||
\ 'tcl' : '%stcl%stcl%scfmp',
|
|
||||||
\ 'vera' : '%svera%svera%scdefgmpPtTvx',
|
|
||||||
\ 'verilog': '%sverilog%sverilog%smcPertwpvf',
|
|
||||||
\ 'vhdl' : '%svhdl%svhdl%sPctTrefp',
|
|
||||||
\ 'vim' : '%svim%svim%savf',
|
|
||||||
\ 'yacc' : '%syacc%syacc%sl',
|
|
||||||
\ }
|
|
||||||
|
|
||||||
cal map(s:types, 'printf(v:val, "--language-force=", " --", "-types=")')
|
|
||||||
|
|
||||||
if executable('jsctags')
|
|
||||||
cal extend(s:types, { 'javascript': { 'args': '-f -', 'bin': 'jsctags' } })
|
|
||||||
en
|
|
||||||
|
|
||||||
fu! ctrlp#buffertag#opts()
|
|
||||||
for [ke, va] in items(s:opts)
|
|
||||||
let {va[0]} = exists(s:pref.ke) ? {s:pref.ke} : va[1]
|
|
||||||
endfo
|
|
||||||
" Ctags bin
|
|
||||||
if empty(s:bin)
|
|
||||||
for bin in s:bins | if executable(bin)
|
|
||||||
let s:bin = bin
|
|
||||||
brea
|
|
||||||
en | endfo
|
|
||||||
el
|
|
||||||
let s:bin = expand(s:bin, 1)
|
|
||||||
en
|
|
||||||
" Types
|
|
||||||
cal extend(s:types, s:usr_types)
|
|
||||||
endf
|
|
||||||
" Utilities {{{1
|
|
||||||
fu! s:validfile(fname, ftype)
|
|
||||||
if ( !empty(a:fname) || !empty(a:ftype) ) && filereadable(a:fname)
|
|
||||||
\ && index(keys(s:types), a:ftype) >= 0 | retu 1 | en
|
|
||||||
retu 0
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:exectags(cmd)
|
|
||||||
if exists('+ssl')
|
|
||||||
let [ssl, &ssl] = [&ssl, 0]
|
|
||||||
en
|
|
||||||
if &sh =~ 'cmd\.exe'
|
|
||||||
let [sxq, &sxq, shcf, &shcf] = [&sxq, '"', &shcf, '/s /c']
|
|
||||||
en
|
|
||||||
let output = system(a:cmd)
|
|
||||||
if &sh =~ 'cmd\.exe'
|
|
||||||
let [&sxq, &shcf] = [sxq, shcf]
|
|
||||||
en
|
|
||||||
if exists('+ssl')
|
|
||||||
let &ssl = ssl
|
|
||||||
en
|
|
||||||
retu output
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:exectagsonfile(fname, ftype)
|
|
||||||
let [ags, ft] = ['-f - --sort=no --excmd=pattern --fields=nKs --extra= --file-scope=yes ', a:ftype]
|
|
||||||
if type(s:types[ft]) == 1
|
|
||||||
let ags .= s:types[ft]
|
|
||||||
let bin = s:bin
|
|
||||||
elsei type(s:types[ft]) == 4
|
|
||||||
let ags = s:types[ft]['args']
|
|
||||||
let bin = expand(s:types[ft]['bin'], 1)
|
|
||||||
en
|
|
||||||
if empty(bin) | retu '' | en
|
|
||||||
let cmd = s:esctagscmd(bin, ags, a:fname)
|
|
||||||
if empty(cmd) | retu '' | en
|
|
||||||
let output = s:exectags(cmd)
|
|
||||||
if v:shell_error || output =~ 'Warning: cannot open' | retu '' | en
|
|
||||||
retu output
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:esctagscmd(bin, args, ...)
|
|
||||||
if exists('+ssl')
|
|
||||||
let [ssl, &ssl] = [&ssl, 0]
|
|
||||||
en
|
|
||||||
let fname = a:0 ? shellescape(a:1) : ''
|
|
||||||
if (has('win32') || has('win64'))
|
|
||||||
let cmd = a:bin.' '.a:args.' '.fname
|
|
||||||
else
|
|
||||||
let cmd = shellescape(a:bin).' '.a:args.' '.fname
|
|
||||||
endif
|
|
||||||
if &sh =~ 'cmd\.exe'
|
|
||||||
let cmd = substitute(cmd, '[&()@^<>|]', '^\0', 'g')
|
|
||||||
en
|
|
||||||
if exists('+ssl')
|
|
||||||
let &ssl = ssl
|
|
||||||
en
|
|
||||||
if has('iconv')
|
|
||||||
let last = s:enc != &enc ? s:enc : !empty( $LANG ) ? $LANG : &enc
|
|
||||||
let cmd = iconv(cmd, &enc, last)
|
|
||||||
en
|
|
||||||
retu cmd
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:process(fname, ftype)
|
|
||||||
if !s:validfile(a:fname, a:ftype) | retu [] | endif
|
|
||||||
let ftime = getftime(a:fname)
|
|
||||||
if has_key(g:ctrlp_buftags, a:fname)
|
|
||||||
\ && g:ctrlp_buftags[a:fname]['time'] >= ftime
|
|
||||||
let lines = g:ctrlp_buftags[a:fname]['lines']
|
|
||||||
el
|
|
||||||
let data = s:exectagsonfile(a:fname, a:ftype)
|
|
||||||
let [raw, lines] = [split(data, '\n\+'), []]
|
|
||||||
for line in raw
|
|
||||||
if line !~# '^!_TAG_' && len(split(line, ';"')) == 2
|
|
||||||
let parsed_line = s:parseline(line)
|
|
||||||
if parsed_line != ''
|
|
||||||
cal add(lines, parsed_line)
|
|
||||||
en
|
|
||||||
en
|
|
||||||
endfo
|
|
||||||
let cache = { a:fname : { 'time': ftime, 'lines': lines } }
|
|
||||||
cal extend(g:ctrlp_buftags, cache)
|
|
||||||
en
|
|
||||||
retu lines
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:parseline(line)
|
|
||||||
let vals = matchlist(a:line,
|
|
||||||
\ '\v^([^\t]+)\t(.+)\t[?/]\^?(.{-1,})\$?[?/]\;\"\t(.+)\tline(no)?\:(\d+)')
|
|
||||||
if vals == [] | retu '' | en
|
|
||||||
let [bufnr, bufname] = [bufnr('^'.vals[2].'$'), fnamemodify(vals[2], ':p:t')]
|
|
||||||
retu vals[1].' '.vals[4].'|'.bufnr.':'.bufname.'|'.vals[6].'| '.vals[3]
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:syntax()
|
|
||||||
if !ctrlp#nosy()
|
|
||||||
cal ctrlp#hicheck('CtrlPTagKind', 'Title')
|
|
||||||
cal ctrlp#hicheck('CtrlPBufName', 'Directory')
|
|
||||||
cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
|
|
||||||
sy match CtrlPTagKind '\zs[^\t|]\+\ze|\d\+:[^|]\+|\d\+|'
|
|
||||||
sy match CtrlPBufName '|\d\+:\zs[^|]\+\ze|\d\+|'
|
|
||||||
sy match CtrlPTabExtra '\zs\t.*\ze$' contains=CtrlPBufName,CtrlPTagKind
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:chknearby(pat)
|
|
||||||
if match(getline('.'), a:pat) < 0
|
|
||||||
let [int, forw, maxl] = [1, 1, line('$')]
|
|
||||||
wh !search(a:pat, 'W'.( forw ? '' : 'b' ))
|
|
||||||
if !forw
|
|
||||||
if int > maxl | brea | en
|
|
||||||
let int += int
|
|
||||||
en
|
|
||||||
let forw = !forw
|
|
||||||
endw
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
" Public {{{1
|
|
||||||
fu! ctrlp#buffertag#init(fname)
|
|
||||||
let bufs = exists('s:btmode') && s:btmode
|
|
||||||
\ ? filter(ctrlp#buffers(), 'filereadable(v:val)')
|
|
||||||
\ : [exists('s:bufname') ? s:bufname : a:fname]
|
|
||||||
let lines = []
|
|
||||||
for each in bufs
|
|
||||||
let bname = fnamemodify(each, ':p')
|
|
||||||
let tftype = get(split(getbufvar('^'.bname.'$', '&ft'), '\.'), 0, '')
|
|
||||||
cal extend(lines, s:process(bname, tftype))
|
|
||||||
endfo
|
|
||||||
cal s:syntax()
|
|
||||||
retu lines
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#buffertag#accept(mode, str)
|
|
||||||
let vals = matchlist(a:str,
|
|
||||||
\ '\v^[^\t]+\t+[^\t|]+\|(\d+)\:[^\t|]+\|(\d+)\|\s(.+)$')
|
|
||||||
let bufnr = str2nr(get(vals, 1))
|
|
||||||
if bufnr
|
|
||||||
cal ctrlp#acceptfile(a:mode, bufnr)
|
|
||||||
exe 'norm!' str2nr(get(vals, 2, line('.'))).'G'
|
|
||||||
cal s:chknearby('\V\C'.get(vals, 3, ''))
|
|
||||||
sil! norm! zvzz
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#buffertag#cmd(mode, ...)
|
|
||||||
let s:btmode = a:mode
|
|
||||||
if a:0 && !empty(a:1)
|
|
||||||
let s:btmode = 0
|
|
||||||
let bname = a:1 =~# '^%$\|^#\d*$' ? expand(a:1) : a:1
|
|
||||||
let s:bufname = fnamemodify(bname, ':p')
|
|
||||||
en
|
|
||||||
retu s:id
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#buffertag#exit()
|
|
||||||
unl! s:btmode s:bufname
|
|
||||||
endf
|
|
||||||
"}}}
|
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
|
@ -1,98 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: autoload/ctrlp/changes.vim
|
|
||||||
" Description: Change list extension
|
|
||||||
" Author: Kien Nguyen <github.com/kien>
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Init {{{1
|
|
||||||
if exists('g:loaded_ctrlp_changes') && g:loaded_ctrlp_changes
|
|
||||||
fini
|
|
||||||
en
|
|
||||||
let g:loaded_ctrlp_changes = 1
|
|
||||||
|
|
||||||
cal add(g:ctrlp_ext_vars, {
|
|
||||||
\ 'init': 'ctrlp#changes#init(s:bufnr, s:crbufnr)',
|
|
||||||
\ 'accept': 'ctrlp#changes#accept',
|
|
||||||
\ 'lname': 'changes',
|
|
||||||
\ 'sname': 'chs',
|
|
||||||
\ 'exit': 'ctrlp#changes#exit()',
|
|
||||||
\ 'type': 'tabe',
|
|
||||||
\ 'sort': 0,
|
|
||||||
\ 'nolim': 1,
|
|
||||||
\ })
|
|
||||||
|
|
||||||
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
|
||||||
" Utilities {{{1
|
|
||||||
fu! s:changelist(bufnr)
|
|
||||||
sil! exe 'noa hid b' a:bufnr
|
|
||||||
redi => result
|
|
||||||
sil! changes
|
|
||||||
redi END
|
|
||||||
retu map(split(result, "\n")[1:], 'tr(v:val, " ", " ")')
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:process(clines, ...)
|
|
||||||
let [clines, evas] = [[], []]
|
|
||||||
for each in a:clines
|
|
||||||
let parts = matchlist(each, '\v^.\s*\d+\s+(\d+)\s+(\d+)\s(.*)$')
|
|
||||||
if !empty(parts)
|
|
||||||
if parts[3] == '' | let parts[3] = ' ' | en
|
|
||||||
cal add(clines, parts[3].' |'.a:1.':'.a:2.'|'.parts[1].':'.parts[2].'|')
|
|
||||||
en
|
|
||||||
endfo
|
|
||||||
retu reverse(filter(clines, 'count(clines, v:val) == 1'))
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:syntax()
|
|
||||||
if !ctrlp#nosy()
|
|
||||||
cal ctrlp#hicheck('CtrlPBufName', 'Directory')
|
|
||||||
cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
|
|
||||||
sy match CtrlPBufName '\t|\d\+:\zs[^|]\+\ze|\d\+:\d\+|$'
|
|
||||||
sy match CtrlPTabExtra '\zs\t.*\ze$' contains=CtrlPBufName
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
" Public {{{1
|
|
||||||
fu! ctrlp#changes#init(original_bufnr, bufnr)
|
|
||||||
let bufnr = exists('s:bufnr') ? s:bufnr : a:bufnr
|
|
||||||
let bufs = exists('s:clmode') && s:clmode ? ctrlp#buffers('id') : [bufnr]
|
|
||||||
cal filter(bufs, 'v:val > 0')
|
|
||||||
let [swb, &swb] = [&swb, '']
|
|
||||||
let lines = []
|
|
||||||
for each in bufs
|
|
||||||
let bname = bufname(each)
|
|
||||||
let fnamet = fnamemodify(bname == '' ? '[No Name]' : bname, ':t')
|
|
||||||
cal extend(lines, s:process(s:changelist(each), each, fnamet))
|
|
||||||
endfo
|
|
||||||
sil! exe 'noa hid b' a:original_bufnr
|
|
||||||
let &swb = swb
|
|
||||||
cal ctrlp#syntax()
|
|
||||||
cal s:syntax()
|
|
||||||
retu lines
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#changes#accept(mode, str)
|
|
||||||
let info = matchlist(a:str, '\t|\(\d\+\):[^|]\+|\(\d\+\):\(\d\+\)|$')
|
|
||||||
let bufnr = str2nr(get(info, 1))
|
|
||||||
if bufnr
|
|
||||||
cal ctrlp#acceptfile(a:mode, bufnr)
|
|
||||||
cal cursor(get(info, 2), get(info, 3))
|
|
||||||
sil! norm! zvzz
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#changes#cmd(mode, ...)
|
|
||||||
let s:clmode = a:mode
|
|
||||||
if a:0 && !empty(a:1)
|
|
||||||
let s:clmode = 0
|
|
||||||
let bname = a:1 =~# '^%$\|^#\d*$' ? expand(a:1) : a:1
|
|
||||||
let s:bufnr = bufnr('^'.fnamemodify(bname, ':p').'$')
|
|
||||||
en
|
|
||||||
retu s:id
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#changes#exit()
|
|
||||||
unl! s:clmode s:bufnr
|
|
||||||
endf
|
|
||||||
"}}}
|
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
|
@ -1,95 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: autoload/ctrlp/dir.vim
|
|
||||||
" Description: Directory extension
|
|
||||||
" Author: Kien Nguyen <github.com/kien>
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Init {{{1
|
|
||||||
if exists('g:loaded_ctrlp_dir') && g:loaded_ctrlp_dir
|
|
||||||
fini
|
|
||||||
en
|
|
||||||
let [g:loaded_ctrlp_dir, g:ctrlp_newdir] = [1, 0]
|
|
||||||
|
|
||||||
let s:ars = ['s:maxdepth', 's:maxfiles', 's:compare_lim', 's:glob', 's:caching']
|
|
||||||
|
|
||||||
cal add(g:ctrlp_ext_vars, {
|
|
||||||
\ 'init': 'ctrlp#dir#init('.join(s:ars, ', ').')',
|
|
||||||
\ 'accept': 'ctrlp#dir#accept',
|
|
||||||
\ 'lname': 'dirs',
|
|
||||||
\ 'sname': 'dir',
|
|
||||||
\ 'type': 'path',
|
|
||||||
\ 'specinput': 1,
|
|
||||||
\ })
|
|
||||||
|
|
||||||
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
|
||||||
|
|
||||||
let s:dircounts = {}
|
|
||||||
" Utilities {{{1
|
|
||||||
fu! s:globdirs(dirs, depth)
|
|
||||||
let entries = split(globpath(a:dirs, s:glob), "\n")
|
|
||||||
let [dirs, depth] = [ctrlp#dirnfile(entries)[0], a:depth + 1]
|
|
||||||
cal extend(g:ctrlp_alldirs, dirs)
|
|
||||||
let nr = len(g:ctrlp_alldirs)
|
|
||||||
if !empty(dirs) && !s:max(nr, s:maxfiles) && depth <= s:maxdepth
|
|
||||||
sil! cal ctrlp#progress(nr)
|
|
||||||
cal map(dirs, 'ctrlp#utils#fnesc(v:val, "g", ",")')
|
|
||||||
cal s:globdirs(join(dirs, ','), depth)
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:max(len, max)
|
|
||||||
retu a:max && a:len > a:max
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:nocache()
|
|
||||||
retu !s:caching || ( s:caching > 1 && get(s:dircounts, s:cwd) < s:caching )
|
|
||||||
endf
|
|
||||||
" Public {{{1
|
|
||||||
fu! ctrlp#dir#init(...)
|
|
||||||
let s:cwd = getcwd()
|
|
||||||
for each in range(len(s:ars))
|
|
||||||
let {s:ars[each]} = a:{each + 1}
|
|
||||||
endfo
|
|
||||||
let cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'dir'
|
|
||||||
let cafile = cadir.ctrlp#utils#lash().ctrlp#utils#cachefile('dir')
|
|
||||||
if g:ctrlp_newdir || s:nocache() || !filereadable(cafile)
|
|
||||||
let [s:initcwd, g:ctrlp_alldirs] = [s:cwd, []]
|
|
||||||
if !ctrlp#igncwd(s:cwd)
|
|
||||||
cal s:globdirs(ctrlp#utils#fnesc(s:cwd, 'g', ','), 0)
|
|
||||||
en
|
|
||||||
cal ctrlp#rmbasedir(g:ctrlp_alldirs)
|
|
||||||
if len(g:ctrlp_alldirs) <= s:compare_lim
|
|
||||||
cal sort(g:ctrlp_alldirs, 'ctrlp#complen')
|
|
||||||
en
|
|
||||||
cal ctrlp#utils#writecache(g:ctrlp_alldirs, cadir, cafile)
|
|
||||||
let g:ctrlp_newdir = 0
|
|
||||||
el
|
|
||||||
if !( exists('s:initcwd') && s:initcwd == s:cwd )
|
|
||||||
let s:initcwd = s:cwd
|
|
||||||
let g:ctrlp_alldirs = ctrlp#utils#readfile(cafile)
|
|
||||||
en
|
|
||||||
en
|
|
||||||
cal extend(s:dircounts, { s:cwd : len(g:ctrlp_alldirs) })
|
|
||||||
retu g:ctrlp_alldirs
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#dir#accept(mode, str)
|
|
||||||
let path = a:mode == 'h' ? getcwd() : s:cwd.ctrlp#call('s:lash', s:cwd).a:str
|
|
||||||
if a:mode =~ 't\|v\|h'
|
|
||||||
cal ctrlp#exit()
|
|
||||||
en
|
|
||||||
cal ctrlp#setdir(path, a:mode =~ 't\|h' ? 'chd!' : 'lc!')
|
|
||||||
if a:mode == 'e'
|
|
||||||
sil! cal ctrlp#statusline()
|
|
||||||
cal ctrlp#setlines(s:id)
|
|
||||||
cal ctrlp#recordhist()
|
|
||||||
cal ctrlp#prtclear()
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#dir#id()
|
|
||||||
retu s:id
|
|
||||||
endf
|
|
||||||
"}}}
|
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
|
@ -1,79 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: autoload/ctrlp/line.vim
|
|
||||||
" Description: Line extension
|
|
||||||
" Author: Kien Nguyen <github.com/kien>
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Init {{{1
|
|
||||||
if exists('g:loaded_ctrlp_line') && g:loaded_ctrlp_line
|
|
||||||
fini
|
|
||||||
en
|
|
||||||
let g:loaded_ctrlp_line = 1
|
|
||||||
|
|
||||||
cal add(g:ctrlp_ext_vars, {
|
|
||||||
\ 'init': 'ctrlp#line#init(s:crbufnr)',
|
|
||||||
\ 'accept': 'ctrlp#line#accept',
|
|
||||||
\ 'act_farg' : 'dict',
|
|
||||||
\ 'lname': 'lines',
|
|
||||||
\ 'sname': 'lns',
|
|
||||||
\ 'type': 'tabe',
|
|
||||||
\ })
|
|
||||||
|
|
||||||
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
|
||||||
" Utilities {{{1
|
|
||||||
fu! s:syntax()
|
|
||||||
if !ctrlp#nosy()
|
|
||||||
cal ctrlp#hicheck('CtrlPBufName', 'Directory')
|
|
||||||
cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
|
|
||||||
sy match CtrlPBufName '\t|\zs[^|]\+\ze|\d\+:\d\+|$'
|
|
||||||
sy match CtrlPTabExtra '\zs\t.*\ze$' contains=CtrlPBufName
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
" Public {{{1
|
|
||||||
fu! ctrlp#line#init(bufnr)
|
|
||||||
let [lines, bufnr] = [[], exists('s:bufnr') ? s:bufnr : a:bufnr]
|
|
||||||
let bufs = exists('s:lnmode') && !empty(s:lnmode) ? ctrlp#buffers('id') : [bufnr]
|
|
||||||
for bufnr in bufs
|
|
||||||
let [lfb, bufn] = [getbufline(bufnr, 1, '$'), bufname(bufnr)]
|
|
||||||
if lfb == [] && bufn != ''
|
|
||||||
let lfb = ctrlp#utils#readfile(fnamemodify(bufn, ':p'))
|
|
||||||
en
|
|
||||||
cal map(lfb, 'tr(v:val, '' '', '' '')')
|
|
||||||
let [linenr, len_lfb] = [1, len(lfb)]
|
|
||||||
let buft = bufn == '' ? '[No Name]' : fnamemodify(bufn, ':t')
|
|
||||||
wh linenr <= len_lfb
|
|
||||||
let lfb[linenr - 1] .= ' |'.buft.'|'.bufnr.':'.linenr.'|'
|
|
||||||
let linenr += 1
|
|
||||||
endw
|
|
||||||
cal extend(lines, filter(lfb, 'v:val !~ ''^\s*\t|[^|]\+|\d\+:\d\+|$'''))
|
|
||||||
endfo
|
|
||||||
cal s:syntax()
|
|
||||||
retu lines
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#line#accept(dict)
|
|
||||||
let mode = a:dict['action']
|
|
||||||
let str = a:dict['line']
|
|
||||||
let input = a:dict['input']
|
|
||||||
let info = matchlist(str, '\t|[^|]\+|\(\d\+\):\(\d\+\)|$')
|
|
||||||
let bufnr = str2nr(get(info, 1))
|
|
||||||
if bufnr
|
|
||||||
cal ctrlp#acceptfile(mode, bufnr, get(info, 2))
|
|
||||||
let @/ = input
|
|
||||||
call search(input, 'c')
|
|
||||||
call histadd("search", input)
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#line#cmd(mode, ...)
|
|
||||||
let s:lnmode = a:mode
|
|
||||||
if a:0 && !empty(a:1)
|
|
||||||
let s:lnmode = 0
|
|
||||||
let bname = a:1 =~# '^%$\|^#\d*$' ? expand(a:1) : a:1
|
|
||||||
let s:bufnr = bufnr('^'.fnamemodify(bname, ':p').'$')
|
|
||||||
en
|
|
||||||
retu s:id
|
|
||||||
endf
|
|
||||||
"}}}
|
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
|
@ -1,88 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: autoload/ctrlp/mixed.vim
|
|
||||||
" Description: Mixing Files + MRU + Buffers
|
|
||||||
" Author: Kien Nguyen <github.com/kien>
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Init {{{1
|
|
||||||
if exists('g:loaded_ctrlp_mixed') && g:loaded_ctrlp_mixed
|
|
||||||
fini
|
|
||||||
en
|
|
||||||
let [g:loaded_ctrlp_mixed, g:ctrlp_newmix] = [1, 0]
|
|
||||||
|
|
||||||
cal add(g:ctrlp_ext_vars, {
|
|
||||||
\ 'init': 'ctrlp#mixed#init(s:compare_lim)',
|
|
||||||
\ 'accept': 'ctrlp#acceptfile',
|
|
||||||
\ 'lname': 'fil + mru + buf',
|
|
||||||
\ 'sname': 'mix',
|
|
||||||
\ 'type': 'path',
|
|
||||||
\ 'opmul': 1,
|
|
||||||
\ 'specinput': 1,
|
|
||||||
\ })
|
|
||||||
|
|
||||||
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
|
||||||
" Utilities {{{1
|
|
||||||
fu! s:newcache(cwd)
|
|
||||||
if g:ctrlp_newmix || !has_key(g:ctrlp_allmixes, 'data') | retu 1 | en
|
|
||||||
retu g:ctrlp_allmixes['cwd'] != a:cwd
|
|
||||||
\ || g:ctrlp_allmixes['filtime'] < getftime(ctrlp#utils#cachefile())
|
|
||||||
\ || g:ctrlp_allmixes['mrutime'] < getftime(ctrlp#mrufiles#cachefile())
|
|
||||||
\ || g:ctrlp_allmixes['bufs'] < len(ctrlp#mrufiles#bufs())
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:getnewmix(cwd, clim)
|
|
||||||
if g:ctrlp_newmix
|
|
||||||
cal ctrlp#mrufiles#refresh('raw')
|
|
||||||
let g:ctrlp_newcache = 1
|
|
||||||
en
|
|
||||||
let g:ctrlp_lines = copy(ctrlp#files())
|
|
||||||
cal ctrlp#progress('Mixing...')
|
|
||||||
let mrufs = copy(ctrlp#mrufiles#list('raw'))
|
|
||||||
if exists('+ssl') && &ssl
|
|
||||||
cal map(mrufs, 'tr(v:val, "\\", "/")')
|
|
||||||
en
|
|
||||||
let allbufs = map(ctrlp#buffers(), 'fnamemodify(v:val, ":p")')
|
|
||||||
let [bufs, ubufs] = [[], []]
|
|
||||||
for each in allbufs
|
|
||||||
cal add(filereadable(each) ? bufs : ubufs, each)
|
|
||||||
endfo
|
|
||||||
let mrufs = bufs + filter(mrufs, 'index(bufs, v:val) < 0')
|
|
||||||
if len(mrufs) > len(g:ctrlp_lines)
|
|
||||||
cal filter(mrufs, 'stridx(v:val, a:cwd)')
|
|
||||||
el
|
|
||||||
let cwd_mrufs = filter(copy(mrufs), '!stridx(v:val, a:cwd)')
|
|
||||||
let cwd_mrufs = ctrlp#rmbasedir(cwd_mrufs)
|
|
||||||
for each in cwd_mrufs
|
|
||||||
let id = index(g:ctrlp_lines, each)
|
|
||||||
if id >= 0 | cal remove(g:ctrlp_lines, id) | en
|
|
||||||
endfo
|
|
||||||
en
|
|
||||||
let mrufs += ubufs
|
|
||||||
cal map(mrufs, 'fnamemodify(v:val, ":.")')
|
|
||||||
let g:ctrlp_lines = len(mrufs) > len(g:ctrlp_lines)
|
|
||||||
\ ? g:ctrlp_lines + mrufs : mrufs + g:ctrlp_lines
|
|
||||||
if len(g:ctrlp_lines) <= a:clim
|
|
||||||
cal sort(g:ctrlp_lines, 'ctrlp#complen')
|
|
||||||
en
|
|
||||||
let g:ctrlp_allmixes = { 'filtime': getftime(ctrlp#utils#cachefile()),
|
|
||||||
\ 'mrutime': getftime(ctrlp#mrufiles#cachefile()), 'cwd': a:cwd,
|
|
||||||
\ 'bufs': len(ctrlp#mrufiles#bufs()), 'data': g:ctrlp_lines }
|
|
||||||
endf
|
|
||||||
" Public {{{1
|
|
||||||
fu! ctrlp#mixed#init(clim)
|
|
||||||
let cwd = getcwd()
|
|
||||||
if s:newcache(cwd)
|
|
||||||
cal s:getnewmix(cwd, a:clim)
|
|
||||||
el
|
|
||||||
let g:ctrlp_lines = g:ctrlp_allmixes['data']
|
|
||||||
en
|
|
||||||
let g:ctrlp_newmix = 0
|
|
||||||
retu g:ctrlp_lines
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#mixed#id()
|
|
||||||
retu s:id
|
|
||||||
endf
|
|
||||||
"}}}
|
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
|
@ -1,158 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: autoload/ctrlp/mrufiles.vim
|
|
||||||
" Description: Most Recently Used Files extension
|
|
||||||
" Author: Kien Nguyen <github.com/kien>
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Static variables {{{1
|
|
||||||
let [s:mrbs, s:mrufs] = [[], []]
|
|
||||||
let s:mruf_map_string = '!stridx(v:val, cwd) ? strpart(v:val, idx) : v:val'
|
|
||||||
|
|
||||||
fu! ctrlp#mrufiles#opts()
|
|
||||||
let [pref, opts] = ['g:ctrlp_mruf_', {
|
|
||||||
\ 'max': ['s:max', 250],
|
|
||||||
\ 'include': ['s:in', ''],
|
|
||||||
\ 'exclude': ['s:ex', ''],
|
|
||||||
\ 'case_sensitive': ['s:cseno', 1],
|
|
||||||
\ 'relative': ['s:re', 0],
|
|
||||||
\ 'save_on_update': ['s:soup', 1],
|
|
||||||
\ 'map_string': ['g:ctrlp_mruf_map_string', s:mruf_map_string],
|
|
||||||
\ }]
|
|
||||||
for [ke, va] in items(opts)
|
|
||||||
let [{va[0]}, {pref.ke}] = [pref.ke, exists(pref.ke) ? {pref.ke} : va[1]]
|
|
||||||
endfo
|
|
||||||
endf
|
|
||||||
cal ctrlp#mrufiles#opts()
|
|
||||||
" Utilities {{{1
|
|
||||||
fu! s:excl(fn)
|
|
||||||
retu !empty({s:ex}) && a:fn =~# {s:ex}
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:mergelists()
|
|
||||||
let diskmrufs = ctrlp#utils#readfile(ctrlp#mrufiles#cachefile())
|
|
||||||
cal filter(diskmrufs, 'index(s:mrufs, v:val) < 0')
|
|
||||||
let mrufs = s:mrufs + diskmrufs
|
|
||||||
retu s:chop(mrufs)
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:chop(mrufs)
|
|
||||||
if len(a:mrufs) > {s:max} | cal remove(a:mrufs, {s:max}, -1) | en
|
|
||||||
retu a:mrufs
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:reformat(mrufs, ...)
|
|
||||||
let cwd = getcwd()
|
|
||||||
let cwd .= cwd !~ '[\/]$' ? ctrlp#utils#lash() : ''
|
|
||||||
if {s:re}
|
|
||||||
let cwd = exists('+ssl') ? tr(cwd, '/', '\') : cwd
|
|
||||||
cal filter(a:mrufs, '!stridx(v:val, cwd)')
|
|
||||||
en
|
|
||||||
if a:0 && a:1 == 'raw' | retu a:mrufs | en
|
|
||||||
let idx = strlen(cwd)
|
|
||||||
if exists('+ssl') && &ssl
|
|
||||||
let cwd = tr(cwd, '\', '/')
|
|
||||||
cal map(a:mrufs, 'tr(v:val, "\\", "/")')
|
|
||||||
en
|
|
||||||
retu map(a:mrufs, g:ctrlp_mruf_map_string)
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:record(bufnr)
|
|
||||||
if s:locked | retu | en
|
|
||||||
let bufnr = a:bufnr + 0
|
|
||||||
let bufname = bufname(bufnr)
|
|
||||||
if bufnr > 0 && !empty(bufname)
|
|
||||||
cal filter(s:mrbs, 'v:val != bufnr')
|
|
||||||
cal insert(s:mrbs, bufnr)
|
|
||||||
cal s:addtomrufs(bufname)
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:addtomrufs(fname)
|
|
||||||
let fn = fnamemodify(a:fname, get(g:, 'ctrlp_tilde_homedir', 0) ? ':p:~' : ':p')
|
|
||||||
let fn = exists('+ssl') ? tr(fn, '/', '\') : fn
|
|
||||||
let abs_fn = fnamemodify(fn,':p')
|
|
||||||
if ( !empty({s:in}) && fn !~# {s:in} ) || ( !empty({s:ex}) && fn =~# {s:ex} )
|
|
||||||
\ || !empty(getbufvar('^' . abs_fn . '$', '&bt')) || !filereadable(abs_fn)
|
|
||||||
retu
|
|
||||||
en
|
|
||||||
let idx = index(s:mrufs, fn, 0, !{s:cseno})
|
|
||||||
if idx
|
|
||||||
cal filter(s:mrufs, 'v:val !='.( {s:cseno} ? '#' : '?' ).' fn')
|
|
||||||
cal insert(s:mrufs, fn)
|
|
||||||
if {s:soup} && idx < 0
|
|
||||||
cal s:savetofile(s:mergelists())
|
|
||||||
en
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:savetofile(mrufs)
|
|
||||||
cal ctrlp#utils#writecache(a:mrufs, s:cadir, s:cafile)
|
|
||||||
endf
|
|
||||||
" Public {{{1
|
|
||||||
fu! ctrlp#mrufiles#refresh(...)
|
|
||||||
let mrufs = s:mergelists()
|
|
||||||
cal filter(mrufs, '!empty(ctrlp#utils#glob(v:val, 1)) && !s:excl(v:val)')
|
|
||||||
if exists('+ssl')
|
|
||||||
cal map(mrufs, 'tr(v:val, "/", "\\")')
|
|
||||||
cal map(s:mrufs, 'tr(v:val, "/", "\\")')
|
|
||||||
let cond = 'count(mrufs, v:val, !{s:cseno}) == 1'
|
|
||||||
cal filter(mrufs, cond)
|
|
||||||
cal filter(s:mrufs, cond)
|
|
||||||
en
|
|
||||||
cal s:savetofile(mrufs)
|
|
||||||
retu a:0 && a:1 == 'raw' ? [] : s:reformat(mrufs)
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#mrufiles#remove(files)
|
|
||||||
let mrufs = []
|
|
||||||
if a:files != []
|
|
||||||
let mrufs = s:mergelists()
|
|
||||||
let cond = 'index(a:files, v:val, 0, !{s:cseno}) < 0'
|
|
||||||
cal filter(mrufs, cond)
|
|
||||||
cal filter(s:mrufs, cond)
|
|
||||||
en
|
|
||||||
cal s:savetofile(mrufs)
|
|
||||||
retu s:reformat(mrufs)
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#mrufiles#add(fn)
|
|
||||||
if !empty(a:fn)
|
|
||||||
cal s:addtomrufs(a:fn)
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#mrufiles#list(...)
|
|
||||||
retu a:0 ? a:1 == 'raw' ? s:reformat(s:mergelists(), a:1) : 0
|
|
||||||
\ : s:reformat(s:mergelists())
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#mrufiles#bufs()
|
|
||||||
retu s:mrbs
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#mrufiles#tgrel()
|
|
||||||
let {s:re} = !{s:re}
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#mrufiles#cachefile()
|
|
||||||
if !exists('s:cadir') || !exists('s:cafile')
|
|
||||||
let s:cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'mru'
|
|
||||||
let s:cafile = s:cadir.ctrlp#utils#lash().'cache.txt'
|
|
||||||
en
|
|
||||||
retu s:cafile
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#mrufiles#init()
|
|
||||||
if !has('autocmd') | retu | en
|
|
||||||
let s:locked = 0
|
|
||||||
aug CtrlPMRUF
|
|
||||||
au!
|
|
||||||
au BufWinEnter,BufWinLeave,BufWritePost * cal s:record(expand('<abuf>', 1))
|
|
||||||
au QuickFixCmdPre *vimgrep* let s:locked = 1
|
|
||||||
au QuickFixCmdPost *vimgrep* let s:locked = 0
|
|
||||||
au VimLeavePre * cal s:savetofile(s:mergelists())
|
|
||||||
aug END
|
|
||||||
endf
|
|
||||||
"}}}
|
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
|
@ -1,59 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: autoload/ctrlp/quickfix.vim
|
|
||||||
" Description: Quickfix extension
|
|
||||||
" Author: Kien Nguyen <github.com/kien>
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Init {{{1
|
|
||||||
if exists('g:loaded_ctrlp_quickfix') && g:loaded_ctrlp_quickfix
|
|
||||||
fini
|
|
||||||
en
|
|
||||||
let g:loaded_ctrlp_quickfix = 1
|
|
||||||
|
|
||||||
cal add(g:ctrlp_ext_vars, {
|
|
||||||
\ 'init': 'ctrlp#quickfix#init()',
|
|
||||||
\ 'accept': 'ctrlp#quickfix#accept',
|
|
||||||
\ 'lname': 'quickfix',
|
|
||||||
\ 'sname': 'qfx',
|
|
||||||
\ 'type': 'line',
|
|
||||||
\ 'sort': 0,
|
|
||||||
\ 'nolim': 1,
|
|
||||||
\ })
|
|
||||||
|
|
||||||
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
|
||||||
|
|
||||||
fu! s:lineout(dict)
|
|
||||||
retu printf('%s|%d:%d| %s', bufname(a:dict['bufnr']), a:dict['lnum'],
|
|
||||||
\ a:dict['col'], matchstr(a:dict['text'], '\s*\zs.*\S'))
|
|
||||||
endf
|
|
||||||
" Utilities {{{1
|
|
||||||
fu! s:syntax()
|
|
||||||
if !ctrlp#nosy()
|
|
||||||
cal ctrlp#hicheck('CtrlPqfLineCol', 'Search')
|
|
||||||
sy match CtrlPqfLineCol '|\zs\d\+:\d\+\ze|'
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
" Public {{{1
|
|
||||||
fu! ctrlp#quickfix#init()
|
|
||||||
cal s:syntax()
|
|
||||||
retu map(getqflist(), 's:lineout(v:val)')
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#quickfix#accept(mode, str)
|
|
||||||
let vals = matchlist(a:str, '^\([^|]\+\ze\)|\(\d\+\):\(\d\+\)|')
|
|
||||||
if vals == [] || vals[1] == '' | retu | en
|
|
||||||
cal ctrlp#acceptfile(a:mode, vals[1])
|
|
||||||
let cur_pos = getpos('.')[1:2]
|
|
||||||
if cur_pos != [1, 1] && cur_pos != map(vals[2:3], 'str2nr(v:val)')
|
|
||||||
mark '
|
|
||||||
en
|
|
||||||
cal cursor(vals[2], vals[3])
|
|
||||||
sil! norm! zvzz
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#quickfix#id()
|
|
||||||
retu s:id
|
|
||||||
endf
|
|
||||||
"}}}
|
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
|
@ -1,59 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: autoload/ctrlp/rtscript.vim
|
|
||||||
" Description: Runtime scripts extension
|
|
||||||
" Author: Kien Nguyen <github.com/kien>
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Init {{{1
|
|
||||||
if exists('g:loaded_ctrlp_rtscript') && g:loaded_ctrlp_rtscript
|
|
||||||
fini
|
|
||||||
en
|
|
||||||
let [g:loaded_ctrlp_rtscript, g:ctrlp_newrts] = [1, 0]
|
|
||||||
|
|
||||||
cal add(g:ctrlp_ext_vars, {
|
|
||||||
\ 'init': 'ctrlp#rtscript#init(s:caching)',
|
|
||||||
\ 'accept': 'ctrlp#acceptfile',
|
|
||||||
\ 'lname': 'runtime scripts',
|
|
||||||
\ 'sname': 'rts',
|
|
||||||
\ 'type': 'path',
|
|
||||||
\ 'opmul': 1,
|
|
||||||
\ })
|
|
||||||
|
|
||||||
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
|
||||||
|
|
||||||
let s:filecounts = {}
|
|
||||||
" Utilities {{{1
|
|
||||||
fu! s:nocache()
|
|
||||||
retu g:ctrlp_newrts ||
|
|
||||||
\ !s:caching || ( s:caching > 1 && get(s:filecounts, s:cwd) < s:caching )
|
|
||||||
endf
|
|
||||||
" Public {{{1
|
|
||||||
fu! ctrlp#rtscript#init(caching)
|
|
||||||
let [s:caching, s:cwd] = [a:caching, getcwd()]
|
|
||||||
if s:nocache() ||
|
|
||||||
\ !( exists('g:ctrlp_rtscache') && g:ctrlp_rtscache[0] == &rtp )
|
|
||||||
sil! cal ctrlp#progress('Indexing...')
|
|
||||||
let entries = split(globpath(ctrlp#utils#fnesc(&rtp, 'g'), '**/*.*'), "\n")
|
|
||||||
cal filter(entries, 'count(entries, v:val) == 1')
|
|
||||||
let [entries, echoed] = [ctrlp#dirnfile(entries)[1], 1]
|
|
||||||
el
|
|
||||||
let [entries, results] = g:ctrlp_rtscache[2:3]
|
|
||||||
en
|
|
||||||
if s:nocache() ||
|
|
||||||
\ !( exists('g:ctrlp_rtscache') && g:ctrlp_rtscache[:1] == [&rtp, s:cwd] )
|
|
||||||
if !exists('echoed')
|
|
||||||
sil! cal ctrlp#progress('Processing...')
|
|
||||||
en
|
|
||||||
let results = map(copy(entries), 'fnamemodify(v:val, '':.'')')
|
|
||||||
en
|
|
||||||
let [g:ctrlp_rtscache, g:ctrlp_newrts] = [[&rtp, s:cwd, entries, results], 0]
|
|
||||||
cal extend(s:filecounts, { s:cwd : len(results) })
|
|
||||||
retu results
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#rtscript#id()
|
|
||||||
retu s:id
|
|
||||||
endf
|
|
||||||
"}}}
|
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
|
@ -1,146 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: autoload/ctrlp/tag.vim
|
|
||||||
" Description: Tag file extension
|
|
||||||
" Author: Kien Nguyen <github.com/kien>
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Init {{{1
|
|
||||||
if exists('g:loaded_ctrlp_tag') && g:loaded_ctrlp_tag
|
|
||||||
fini
|
|
||||||
en
|
|
||||||
let g:loaded_ctrlp_tag = 1
|
|
||||||
|
|
||||||
cal add(g:ctrlp_ext_vars, {
|
|
||||||
\ 'init': 'ctrlp#tag#init()',
|
|
||||||
\ 'accept': 'ctrlp#tag#accept',
|
|
||||||
\ 'lname': 'tags',
|
|
||||||
\ 'sname': 'tag',
|
|
||||||
\ 'enter': 'ctrlp#tag#enter()',
|
|
||||||
\ 'type': 'tabs',
|
|
||||||
\ })
|
|
||||||
|
|
||||||
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
|
||||||
" Utilities {{{1
|
|
||||||
fu! s:findcount(str, tgaddr)
|
|
||||||
let [tg, ofname] = split(a:str, '\t\+\ze[^\t]\+$')
|
|
||||||
let tgs = taglist('^'.tg.'$')
|
|
||||||
if len(tgs) < 2
|
|
||||||
retu [0, 0, 0, 0]
|
|
||||||
en
|
|
||||||
let bname = fnamemodify(bufname('%'), ':p')
|
|
||||||
let fname = expand(fnamemodify(simplify(ofname), ':s?^[.\/]\+??:p:.'), 1)
|
|
||||||
let [fnd, cnt, pos, ctgs, otgs] = [0, 0, 0, [], []]
|
|
||||||
for tgi in tgs
|
|
||||||
let lst = bname == fnamemodify(tgi["filename"], ':p') ? 'ctgs' : 'otgs'
|
|
||||||
cal call('add', [{lst}, tgi])
|
|
||||||
endfo
|
|
||||||
let ntgs = ctgs + otgs
|
|
||||||
for tgi in ntgs
|
|
||||||
let cnt += 1
|
|
||||||
let fulname = fnamemodify(tgi["filename"], ':p')
|
|
||||||
if stridx(fulname, fname) >= 0
|
|
||||||
\ && strlen(fname) + stridx(fulname, fname) == strlen(fulname)
|
|
||||||
let fnd += 1
|
|
||||||
let pos = cnt
|
|
||||||
en
|
|
||||||
endfo
|
|
||||||
let cnt = 0
|
|
||||||
for tgi in ntgs
|
|
||||||
let cnt += 1
|
|
||||||
if tgi["filename"] == ofname
|
|
||||||
if a:tgaddr != ""
|
|
||||||
if a:tgaddr == tgi["cmd"]
|
|
||||||
let [fnd, pos] = [0, cnt]
|
|
||||||
en
|
|
||||||
else
|
|
||||||
let [fnd, pos] = [0, cnt]
|
|
||||||
en
|
|
||||||
en
|
|
||||||
endfo
|
|
||||||
retu [1, fnd, pos, len(ctgs)]
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:filter(tags)
|
|
||||||
let nr = 0
|
|
||||||
wh 0 < 1
|
|
||||||
if a:tags == [] | brea | en
|
|
||||||
if a:tags[nr] =~ '^!' && a:tags[nr] !~# '^!_TAG_'
|
|
||||||
let nr += 1
|
|
||||||
con
|
|
||||||
en
|
|
||||||
if a:tags[nr] =~# '^!_TAG_' && len(a:tags) > nr
|
|
||||||
cal remove(a:tags, nr)
|
|
||||||
el
|
|
||||||
brea
|
|
||||||
en
|
|
||||||
endw
|
|
||||||
retu a:tags
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:syntax()
|
|
||||||
if !ctrlp#nosy()
|
|
||||||
cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
|
|
||||||
sy match CtrlPTabExtra '\zs\t.*\ze$'
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
" Public {{{1
|
|
||||||
fu! ctrlp#tag#init()
|
|
||||||
if empty(s:tagfiles) | retu [] | en
|
|
||||||
let g:ctrlp_alltags = []
|
|
||||||
let tagfiles = sort(filter(s:tagfiles, 'count(s:tagfiles, v:val) == 1'))
|
|
||||||
for each in tagfiles
|
|
||||||
let alltags = s:filter(ctrlp#utils#readfile(each))
|
|
||||||
cal extend(g:ctrlp_alltags, alltags)
|
|
||||||
endfo
|
|
||||||
cal s:syntax()
|
|
||||||
retu g:ctrlp_alltags
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#tag#accept(mode, str)
|
|
||||||
cal ctrlp#exit()
|
|
||||||
let tgaddr = matchstr(a:str, '^[^\t]\+\t\+[^\t]\+\t\zs[^\t]\{-1,}\ze\%(;"\)\?\t')
|
|
||||||
let str = matchstr(a:str, '^[^\t]\+\t\+[^\t]\+\ze\t')
|
|
||||||
let [tg, fdcnt] = [split(str, '^[^\t]\+\zs\t')[0], s:findcount(str, tgaddr)]
|
|
||||||
let cmds = {
|
|
||||||
\ 't': ['tab sp', 'tab stj'],
|
|
||||||
\ 'h': ['sp', 'stj'],
|
|
||||||
\ 'v': ['vs', 'vert stj'],
|
|
||||||
\ 'e': ['', 'tj'],
|
|
||||||
\ }
|
|
||||||
let utg = fdcnt[3] < 2 && fdcnt[0] == 1 && fdcnt[1] == 1
|
|
||||||
let cmd = !fdcnt[0] || utg ? cmds[a:mode][0] : cmds[a:mode][1]
|
|
||||||
let cmd = a:mode == 'e' && ctrlp#modfilecond(!&aw)
|
|
||||||
\ ? ( cmd == 'tj' ? 'stj' : 'sp' ) : cmd
|
|
||||||
let cmd = a:mode == 't' ? ctrlp#tabcount().cmd : cmd
|
|
||||||
if !fdcnt[0] || utg
|
|
||||||
if cmd != ''
|
|
||||||
exe cmd
|
|
||||||
en
|
|
||||||
let save_cst = &cst
|
|
||||||
set cst&
|
|
||||||
cal feedkeys(":".( utg ? fdcnt[2] : "" )."ta ".tg."\r", 'nt')
|
|
||||||
let &cst = save_cst
|
|
||||||
el
|
|
||||||
let ext = ""
|
|
||||||
if fdcnt[1] < 2 && fdcnt[2]
|
|
||||||
let [sav_more, &more] = [&more, 0]
|
|
||||||
let ext = fdcnt[2]."\r".":let &more = ".sav_more."\r"
|
|
||||||
en
|
|
||||||
cal feedkeys(":".cmd." ".tg."\r".ext, 'nt')
|
|
||||||
en
|
|
||||||
cal feedkeys('zvzz', 'nt')
|
|
||||||
cal ctrlp#setlcdir()
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#tag#id()
|
|
||||||
retu s:id
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#tag#enter()
|
|
||||||
let tfs = get(g:, 'ctrlp_custom_tag_files', tagfiles())
|
|
||||||
let s:tagfiles = type(tfs) == 3 && tfs != [] ? filter(map(tfs, 'fnamemodify(v:val, ":p")'),
|
|
||||||
\ 'filereadable(v:val)') : []
|
|
||||||
endf
|
|
||||||
"}}}
|
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
|
@ -1,154 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: autoload/ctrlp/undo.vim
|
|
||||||
" Description: Undo extension
|
|
||||||
" Author: Kien Nguyen <github.com/kien>
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Init {{{1
|
|
||||||
if ( exists('g:loaded_ctrlp_undo') && g:loaded_ctrlp_undo )
|
|
||||||
fini
|
|
||||||
en
|
|
||||||
let g:loaded_ctrlp_undo = 1
|
|
||||||
|
|
||||||
cal add(g:ctrlp_ext_vars, {
|
|
||||||
\ 'init': 'ctrlp#undo#init()',
|
|
||||||
\ 'accept': 'ctrlp#undo#accept',
|
|
||||||
\ 'lname': 'undo',
|
|
||||||
\ 'sname': 'udo',
|
|
||||||
\ 'enter': 'ctrlp#undo#enter()',
|
|
||||||
\ 'exit': 'ctrlp#undo#exit()',
|
|
||||||
\ 'type': 'line',
|
|
||||||
\ 'sort': 0,
|
|
||||||
\ 'nolim': 1,
|
|
||||||
\ })
|
|
||||||
|
|
||||||
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
|
||||||
|
|
||||||
let s:text = map(['second', 'seconds', 'minutes', 'hours', 'days', 'weeks',
|
|
||||||
\ 'months', 'years'], '" ".v:val." ago"')
|
|
||||||
" Utilities {{{1
|
|
||||||
fu! s:getundo()
|
|
||||||
if exists('*undotree')
|
|
||||||
\ && ( v:version > 703 || ( v:version == 703 && has('patch005') ) )
|
|
||||||
retu [1, undotree()]
|
|
||||||
el
|
|
||||||
redi => result
|
|
||||||
sil! undol
|
|
||||||
redi END
|
|
||||||
retu [0, split(result, "\n")[1:]]
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:flatten(tree, cur)
|
|
||||||
let flatdict = {}
|
|
||||||
for each in a:tree
|
|
||||||
let saved = has_key(each, 'save') ? 'saved' : ''
|
|
||||||
let current = each['seq'] == a:cur ? 'current' : ''
|
|
||||||
cal extend(flatdict, { each['seq'] : [each['time'], saved, current] })
|
|
||||||
if has_key(each, 'alt')
|
|
||||||
cal extend(flatdict, s:flatten(each['alt'], a:cur))
|
|
||||||
en
|
|
||||||
endfo
|
|
||||||
retu flatdict
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:elapsed(nr)
|
|
||||||
let [text, time] = [s:text, localtime() - a:nr]
|
|
||||||
let mins = time / 60
|
|
||||||
let hrs = time / 3600
|
|
||||||
let days = time / 86400
|
|
||||||
let wks = time / 604800
|
|
||||||
let mons = time / 2592000
|
|
||||||
let yrs = time / 31536000
|
|
||||||
if yrs > 1
|
|
||||||
retu yrs.text[7]
|
|
||||||
elsei mons > 1
|
|
||||||
retu mons.text[6]
|
|
||||||
elsei wks > 1
|
|
||||||
retu wks.text[5]
|
|
||||||
elsei days > 1
|
|
||||||
retu days.text[4]
|
|
||||||
elsei hrs > 1
|
|
||||||
retu hrs.text[3]
|
|
||||||
elsei mins > 1
|
|
||||||
retu mins.text[2]
|
|
||||||
elsei time == 1
|
|
||||||
retu time.text[0]
|
|
||||||
elsei time < 120
|
|
||||||
retu time.text[1]
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:syntax()
|
|
||||||
if ctrlp#nosy() | retu | en
|
|
||||||
for [ke, va] in items({'T': 'Directory', 'Br': 'Comment', 'Nr': 'String',
|
|
||||||
\ 'Sv': 'Comment', 'Po': 'Title'})
|
|
||||||
cal ctrlp#hicheck('CtrlPUndo'.ke, va)
|
|
||||||
endfo
|
|
||||||
sy match CtrlPUndoT '\v\d+ \zs[^ ]+\ze|\d+:\d+:\d+'
|
|
||||||
sy match CtrlPUndoBr '\[\|\]'
|
|
||||||
sy match CtrlPUndoNr '\[\d\+\]' contains=CtrlPUndoBr
|
|
||||||
sy match CtrlPUndoSv 'saved'
|
|
||||||
sy match CtrlPUndoPo 'current'
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:dict2list(dict)
|
|
||||||
for ke in keys(a:dict)
|
|
||||||
let a:dict[ke][0] = s:elapsed(a:dict[ke][0])
|
|
||||||
endfo
|
|
||||||
retu map(keys(a:dict), 'eval(''[v:val, a:dict[v:val]]'')')
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:compval(...)
|
|
||||||
retu a:2[0] - a:1[0]
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:format(...)
|
|
||||||
let saved = !empty(a:1[1][1]) ? ' '.a:1[1][1] : ''
|
|
||||||
let current = !empty(a:1[1][2]) ? ' '.a:1[1][2] : ''
|
|
||||||
retu a:1[1][0].' ['.a:1[0].']'.saved.current
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:formatul(...)
|
|
||||||
let parts = matchlist(a:1,
|
|
||||||
\ '\v^\s+(\d+)\s+\d+\s+([^ ]+\s?[^ ]+|\d+\s\w+\s\w+)(\s*\d*)$')
|
|
||||||
retu parts == [] ? '----'
|
|
||||||
\ : parts[2].' ['.parts[1].']'.( parts[3] != '' ? ' saved' : '' )
|
|
||||||
endf
|
|
||||||
" Public {{{1
|
|
||||||
fu! ctrlp#undo#init()
|
|
||||||
let entries = s:undos[0] ? s:undos[1]['entries'] : s:undos[1]
|
|
||||||
if empty(entries) | retu [] | en
|
|
||||||
if !exists('s:lines')
|
|
||||||
if s:undos[0]
|
|
||||||
let entries = s:dict2list(s:flatten(entries, s:undos[1]['seq_cur']))
|
|
||||||
let s:lines = map(sort(entries, 's:compval'), 's:format(v:val)')
|
|
||||||
el
|
|
||||||
let s:lines = map(reverse(entries), 's:formatul(v:val)')
|
|
||||||
en
|
|
||||||
en
|
|
||||||
cal s:syntax()
|
|
||||||
retu s:lines
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#undo#accept(mode, str)
|
|
||||||
let undon = matchstr(a:str, '\[\zs\d\+\ze\]')
|
|
||||||
if empty(undon) | retu | en
|
|
||||||
cal ctrlp#exit()
|
|
||||||
exe 'u' undon
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#undo#id()
|
|
||||||
retu s:id
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#undo#enter()
|
|
||||||
let s:undos = s:getundo()
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#undo#exit()
|
|
||||||
unl! s:lines
|
|
||||||
endf
|
|
||||||
"}}}
|
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
|
@ -1,110 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: autoload/ctrlp/utils.vim
|
|
||||||
" Description: Utilities
|
|
||||||
" Author: Kien Nguyen <github.com/kien>
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Static variables {{{1
|
|
||||||
fu! ctrlp#utils#lash()
|
|
||||||
retu &ssl || !exists('+ssl') ? '/' : '\'
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:lash(...)
|
|
||||||
retu ( a:0 ? a:1 : getcwd() ) !~ '[\/]$' ? s:lash : ''
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#utils#opts()
|
|
||||||
let s:lash = ctrlp#utils#lash()
|
|
||||||
let usrhome = $HOME . s:lash( $HOME )
|
|
||||||
let cahome = exists('$XDG_CACHE_HOME') ? $XDG_CACHE_HOME : usrhome.'.cache'
|
|
||||||
let cadir = isdirectory(usrhome.'.ctrlp_cache')
|
|
||||||
\ ? usrhome.'.ctrlp_cache' : cahome.s:lash(cahome).'ctrlp'
|
|
||||||
if exists('g:ctrlp_cache_dir')
|
|
||||||
let cadir = expand(g:ctrlp_cache_dir, 1)
|
|
||||||
if isdirectory(cadir.s:lash(cadir).'.ctrlp_cache')
|
|
||||||
let cadir = cadir.s:lash(cadir).'.ctrlp_cache'
|
|
||||||
en
|
|
||||||
en
|
|
||||||
let s:cache_dir = cadir
|
|
||||||
endf
|
|
||||||
cal ctrlp#utils#opts()
|
|
||||||
|
|
||||||
let s:wig_cond = v:version > 702 || ( v:version == 702 && has('patch051') )
|
|
||||||
" Files and Directories {{{1
|
|
||||||
fu! ctrlp#utils#cachedir()
|
|
||||||
retu s:cache_dir
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#utils#cachefile(...)
|
|
||||||
let [tail, dir] = [a:0 == 1 ? '.'.a:1 : '', a:0 == 2 ? a:1 : getcwd()]
|
|
||||||
let cache_file = substitute(dir, '\([\/]\|^\a\zs:\)', '%', 'g').tail.'.txt'
|
|
||||||
retu a:0 == 1 ? cache_file : s:cache_dir.s:lash(s:cache_dir).cache_file
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#utils#readfile(file)
|
|
||||||
if filereadable(a:file)
|
|
||||||
let data = readfile(a:file)
|
|
||||||
if empty(data) || type(data) != 3
|
|
||||||
unl data
|
|
||||||
let data = []
|
|
||||||
en
|
|
||||||
retu data
|
|
||||||
en
|
|
||||||
retu []
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#utils#mkdir(dir)
|
|
||||||
if exists('*mkdir') && !isdirectory(a:dir)
|
|
||||||
sil! cal mkdir(a:dir, 'p')
|
|
||||||
en
|
|
||||||
retu a:dir
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#utils#writecache(lines, ...)
|
|
||||||
if isdirectory(ctrlp#utils#mkdir(a:0 ? a:1 : s:cache_dir))
|
|
||||||
sil! cal writefile(a:lines, a:0 >= 2 ? a:2 : ctrlp#utils#cachefile())
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#utils#glob(...)
|
|
||||||
let path = ctrlp#utils#fnesc(a:1, 'g')
|
|
||||||
retu s:wig_cond ? glob(path, a:2) : glob(path)
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#utils#globpath(...)
|
|
||||||
retu call('globpath', s:wig_cond ? a:000 : a:000[:1])
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#utils#fnesc(path, type, ...)
|
|
||||||
if exists('*fnameescape')
|
|
||||||
if exists('+ssl')
|
|
||||||
if a:type == 'c'
|
|
||||||
let path = escape(a:path, '%#')
|
|
||||||
elsei a:type == 'f'
|
|
||||||
let path = fnameescape(a:path)
|
|
||||||
elsei a:type == 'g'
|
|
||||||
let path = escape(a:path, '?*')
|
|
||||||
en
|
|
||||||
let path = substitute(path, '[', '[[]', 'g')
|
|
||||||
el
|
|
||||||
let path = fnameescape(a:path)
|
|
||||||
en
|
|
||||||
el
|
|
||||||
if exists('+ssl')
|
|
||||||
if a:type == 'c'
|
|
||||||
let path = escape(a:path, '%#')
|
|
||||||
elsei a:type == 'f'
|
|
||||||
let path = escape(a:path, " \t\n%#*?|<\"")
|
|
||||||
elsei a:type == 'g'
|
|
||||||
let path = escape(a:path, '?*')
|
|
||||||
en
|
|
||||||
let path = substitute(path, '[', '[[]', 'g')
|
|
||||||
el
|
|
||||||
let path = escape(a:path, " \t\n*?[{`$\\%#'\"|!<")
|
|
||||||
en
|
|
||||||
en
|
|
||||||
retu a:0 ? escape(path, a:1) : path
|
|
||||||
endf
|
|
||||||
"}}}
|
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,72 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" File: plugin/ctrlp.vim
|
|
||||||
" Description: Fuzzy file, buffer, mru, tag, etc finder.
|
|
||||||
" Author: Kien Nguyen <github.com/kien>
|
|
||||||
" =============================================================================
|
|
||||||
" GetLatestVimScripts: 3736 1 :AutoInstall: ctrlp.zip
|
|
||||||
|
|
||||||
if ( exists('g:loaded_ctrlp') && g:loaded_ctrlp ) || v:version < 700 || &cp
|
|
||||||
fini
|
|
||||||
en
|
|
||||||
let g:loaded_ctrlp = 1
|
|
||||||
|
|
||||||
let [g:ctrlp_lines, g:ctrlp_allfiles, g:ctrlp_alltags, g:ctrlp_alldirs,
|
|
||||||
\ g:ctrlp_allmixes, g:ctrlp_buftags, g:ctrlp_ext_vars, g:ctrlp_builtins]
|
|
||||||
\ = [[], [], [], [], {}, {}, [], 2]
|
|
||||||
|
|
||||||
if !exists('g:ctrlp_map') | let g:ctrlp_map = '<c-p>' | en
|
|
||||||
if !exists('g:ctrlp_cmd') | let g:ctrlp_cmd = 'CtrlP' | en
|
|
||||||
|
|
||||||
com! -n=? -com=dir CtrlP cal ctrlp#init(0, { 'dir': <q-args> })
|
|
||||||
com! -n=? -com=dir CtrlPMRUFiles cal ctrlp#init('mru', { 'dir': <q-args> })
|
|
||||||
|
|
||||||
com! -bar CtrlPBuffer cal ctrlp#init('buf')
|
|
||||||
com! -n=? CtrlPLastMode cal ctrlp#init(-1, { 'args': <q-args> })
|
|
||||||
|
|
||||||
com! -bar CtrlPClearCache cal ctrlp#clr()
|
|
||||||
com! -bar CtrlPClearAllCaches cal ctrlp#clra()
|
|
||||||
|
|
||||||
com! -bar ClearCtrlPCache cal ctrlp#clr()
|
|
||||||
com! -bar ClearAllCtrlPCaches cal ctrlp#clra()
|
|
||||||
|
|
||||||
com! -bar CtrlPCurWD cal ctrlp#init('fil', { 'mode': '' })
|
|
||||||
com! -bar CtrlPCurFile cal ctrlp#init('fil', { 'mode': 'c' })
|
|
||||||
com! -bar CtrlPRoot cal ctrlp#init('fil', { 'mode': 'r' })
|
|
||||||
|
|
||||||
exe 'nn <silent> <plug>(ctrlp) :<c-u>'.g:ctrlp_cmd.'<cr>'
|
|
||||||
|
|
||||||
if g:ctrlp_map != '' && !hasmapto('<plug>(ctrlp)')
|
|
||||||
exe 'map' g:ctrlp_map '<plug>(ctrlp)'
|
|
||||||
en
|
|
||||||
|
|
||||||
if !exists('g:ctrlp_types') || index(g:ctrlp_types, 'mru') >= 0
|
|
||||||
cal ctrlp#mrufiles#init()
|
|
||||||
en
|
|
||||||
|
|
||||||
com! -bar CtrlPTag cal ctrlp#init(ctrlp#tag#id())
|
|
||||||
com! -bar CtrlPQuickfix cal ctrlp#init(ctrlp#quickfix#id())
|
|
||||||
|
|
||||||
com! -n=? -com=dir CtrlPDir
|
|
||||||
\ cal ctrlp#init(ctrlp#dir#id(), { 'dir': <q-args> })
|
|
||||||
|
|
||||||
com! -n=? -com=buffer CtrlPBufTag
|
|
||||||
\ cal ctrlp#init(ctrlp#buffertag#cmd(0, <q-args>))
|
|
||||||
|
|
||||||
com! -bar CtrlPBufTagAll cal ctrlp#init(ctrlp#buffertag#cmd(1))
|
|
||||||
com! -bar CtrlPRTS cal ctrlp#init(ctrlp#rtscript#id())
|
|
||||||
com! -bar CtrlPUndo cal ctrlp#init(ctrlp#undo#id())
|
|
||||||
|
|
||||||
com! -n=? -com=buffer CtrlPLine
|
|
||||||
\ cal ctrlp#init(ctrlp#line#cmd('buf', <q-args>))
|
|
||||||
|
|
||||||
com! -n=? -com=buffer CtrlPChange
|
|
||||||
\ cal ctrlp#init(ctrlp#changes#cmd('fil', <q-args>))
|
|
||||||
|
|
||||||
com! -bar CtrlPChangeAll cal ctrlp#init(ctrlp#changes#cmd(1))
|
|
||||||
com! -bar CtrlPMixed cal ctrlp#init(ctrlp#mixed#id())
|
|
||||||
com! -bar CtrlPBookmarkDir cal ctrlp#init(ctrlp#bookmarkdir#id())
|
|
||||||
|
|
||||||
com! -n=? -com=dir -bang CtrlPBookmarkDirAdd
|
|
||||||
\ cal ctrlp#call('ctrlp#bookmarkdir#add', '<bang>', <q-args>)
|
|
||||||
|
|
||||||
" vim:ts=2:sw=2:sts=2
|
|
@ -1,105 +0,0 @@
|
|||||||
# ctrlp.vim
|
|
||||||
Full path fuzzy __file__, __buffer__, __mru__, __tag__, __...__ finder for Vim.
|
|
||||||
|
|
||||||
* Written in pure Vimscript for MacVim, gVim and Vim 7.0+.
|
|
||||||
* Full support for Vim's regexp as search patterns.
|
|
||||||
* Built-in Most Recently Used (MRU) files monitoring.
|
|
||||||
* Built-in project's root finder.
|
|
||||||
* Open multiple files at once.
|
|
||||||
* Create new files and directories.
|
|
||||||
* [Extensible][2].
|
|
||||||
|
|
||||||
![ctrlp][1]
|
|
||||||
|
|
||||||
## Basic Usage
|
|
||||||
* Run `:CtrlP` or `:CtrlP [starting-directory]` to invoke CtrlP in find file mode.
|
|
||||||
* Run `:CtrlPBuffer` or `:CtrlPMRU` to invoke CtrlP in find buffer or find MRU file mode.
|
|
||||||
* Run `:CtrlPMixed` to search in Files, Buffers and MRU files at the same time.
|
|
||||||
|
|
||||||
Check `:help ctrlp-commands` and `:help ctrlp-extensions` for other commands.
|
|
||||||
|
|
||||||
##### Once CtrlP is open:
|
|
||||||
* Press `<F5>` to purge the cache for the current directory to get new files, remove deleted files and apply new ignore options.
|
|
||||||
* Press `<c-f>` and `<c-b>` to cycle between modes.
|
|
||||||
* Press `<c-d>` to switch to filename only search instead of full path.
|
|
||||||
* Press `<c-r>` to switch to regexp mode.
|
|
||||||
* Use `<c-j>`, `<c-k>` or the arrow keys to navigate the result list.
|
|
||||||
* Use `<c-t>` or `<c-v>`, `<c-x>` to open the selected entry in a new tab or in a new split.
|
|
||||||
* Use `<c-n>`, `<c-p>` to select the next/previous string in the prompt's history.
|
|
||||||
* Use `<c-y>` to create a new file and its parent directories.
|
|
||||||
* Use `<c-z>` to mark/unmark multiple files and `<c-o>` to open them.
|
|
||||||
|
|
||||||
Run `:help ctrlp-mappings` or submit `?` in CtrlP for more mapping help.
|
|
||||||
|
|
||||||
* Submit two or more dots `..` to go up the directory tree by one or multiple levels.
|
|
||||||
* End the input string with a colon `:` followed by a command to execute it on the opening file(s):
|
|
||||||
Use `:25` to jump to line 25.
|
|
||||||
Use `:diffthis` when opening multiple files to run `:diffthis` on the first 4 files.
|
|
||||||
|
|
||||||
## Basic Options
|
|
||||||
* Change the default mapping and the default command to invoke CtrlP:
|
|
||||||
|
|
||||||
```vim
|
|
||||||
let g:ctrlp_map = '<c-p>'
|
|
||||||
let g:ctrlp_cmd = 'CtrlP'
|
|
||||||
```
|
|
||||||
|
|
||||||
* When invoked without an explicit starting directory, CtrlP will set its local working directory according to this variable:
|
|
||||||
|
|
||||||
```vim
|
|
||||||
let g:ctrlp_working_path_mode = 'ra'
|
|
||||||
```
|
|
||||||
|
|
||||||
`'c'` - the directory of the current file.
|
|
||||||
`'a'` - the directory of the current file, unless it is a subdirectory of the cwd
|
|
||||||
`'r'` - the nearest ancestor of the current file that contains one of these directories or files: `.git` `.hg` `.svn` `.bzr` `_darcs`
|
|
||||||
`'w'` - modifier to "r": start search from the cwd instead of the current file's directory
|
|
||||||
`0` or `''` (empty string) - disable this feature.
|
|
||||||
|
|
||||||
If none of the default markers (`.git` `.hg` `.svn` `.bzr` `_darcs`) are present in a project, you can define additional ones with `g:ctrlp_root_markers`:
|
|
||||||
|
|
||||||
```vim
|
|
||||||
let g:ctrlp_root_markers = ['pom.xml', '.p4ignore']
|
|
||||||
```
|
|
||||||
|
|
||||||
If more than one mode is specified, they will be tried in order until a directory is located.
|
|
||||||
|
|
||||||
* If a file is already open, open it again in a new pane instead of switching to the existing pane
|
|
||||||
|
|
||||||
`let g:ctrlp_switch_buffer = 'et'`
|
|
||||||
|
|
||||||
* Exclude files and directories using Vim's `wildignore` and CtrlP's own `g:ctrlp_custom_ignore`. If a custom listing command is being used, exclusions are ignored:
|
|
||||||
|
|
||||||
```vim
|
|
||||||
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
|
|
||||||
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows
|
|
||||||
|
|
||||||
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
|
|
||||||
let g:ctrlp_custom_ignore = {
|
|
||||||
\ 'dir': '\v[\/]\.(git|hg|svn)$',
|
|
||||||
\ 'file': '\v\.(exe|so|dll)$',
|
|
||||||
\ 'link': 'some_bad_symbolic_links',
|
|
||||||
\ }
|
|
||||||
```
|
|
||||||
|
|
||||||
* Use a custom file listing command:
|
|
||||||
|
|
||||||
```vim
|
|
||||||
let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux
|
|
||||||
let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows
|
|
||||||
```
|
|
||||||
|
|
||||||
* Ignore files in `.gitignore`
|
|
||||||
|
|
||||||
```vim
|
|
||||||
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
|
|
||||||
```
|
|
||||||
|
|
||||||
Check `:help ctrlp-options` for other options.
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
Use your favorite method or check the homepage for a [quick installation guide][3].
|
|
||||||
|
|
||||||
[1]: http://i.imgur.com/aOcwHwt.png
|
|
||||||
[2]: https://github.com/ctrlpvim/ctrlp.vim/tree/extensions
|
|
||||||
[3]: http://ctrlpvim.github.com/ctrlp.vim#installation
|
|
@ -1,447 +0,0 @@
|
|||||||
" Copyright (c) 2015 Junegunn Choi
|
|
||||||
"
|
|
||||||
" MIT License
|
|
||||||
"
|
|
||||||
" Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
" a copy of this software and associated documentation files (the
|
|
||||||
" "Software"), to deal in the Software without restriction, including
|
|
||||||
" without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
" distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
" permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
" the following conditions:
|
|
||||||
"
|
|
||||||
" The above copyright notice and this permission notice shall be
|
|
||||||
" included in all copies or substantial portions of the Software.
|
|
||||||
"
|
|
||||||
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
let s:cpo_save = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! s:const(val, min, max)
|
|
||||||
return min([max([a:val, a:min]), a:max])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:get_color(group, attr)
|
|
||||||
return synIDattr(synIDtrans(hlID(a:group)), a:attr)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:set_color(group, attr, color)
|
|
||||||
let gui = has('gui_running') || has('termguicolors') && &termguicolors
|
|
||||||
execute printf('hi %s %s%s=%s', a:group, gui ? 'gui' : 'cterm', a:attr, a:color)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:blank(repel)
|
|
||||||
if bufwinnr(t:goyo_pads.r) <= bufwinnr(t:goyo_pads.l) + 1
|
|
||||||
\ || bufwinnr(t:goyo_pads.b) <= bufwinnr(t:goyo_pads.t) + 3
|
|
||||||
call s:goyo_off()
|
|
||||||
endif
|
|
||||||
execute 'wincmd' a:repel
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:init_pad(command)
|
|
||||||
execute a:command
|
|
||||||
|
|
||||||
setlocal buftype=nofile bufhidden=wipe nomodifiable nobuflisted noswapfile
|
|
||||||
\ nonu nocursorline nocursorcolumn winfixwidth winfixheight statusline=\
|
|
||||||
if exists('&rnu')
|
|
||||||
setlocal nornu
|
|
||||||
endif
|
|
||||||
if exists('&colorcolumn')
|
|
||||||
setlocal colorcolumn=
|
|
||||||
endif
|
|
||||||
let bufnr = winbufnr(0)
|
|
||||||
|
|
||||||
execute winnr('#') . 'wincmd w'
|
|
||||||
return bufnr
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:setup_pad(bufnr, vert, size, repel)
|
|
||||||
let win = bufwinnr(a:bufnr)
|
|
||||||
execute win . 'wincmd w'
|
|
||||||
execute (a:vert ? 'vertical ' : '') . 'resize ' . max([0, a:size])
|
|
||||||
augroup goyop
|
|
||||||
execute 'autocmd WinEnter,CursorMoved <buffer> nested call s:blank("'.a:repel.'")'
|
|
||||||
autocmd WinLeave <buffer> call s:hide_statusline()
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
" To hide scrollbars of pad windows in GVim
|
|
||||||
let diff = winheight(0) - line('$') - (has('gui_running') ? 2 : 0)
|
|
||||||
if diff > 0
|
|
||||||
setlocal modifiable
|
|
||||||
call append(0, map(range(1, diff), '""'))
|
|
||||||
normal! gg
|
|
||||||
setlocal nomodifiable
|
|
||||||
endif
|
|
||||||
execute winnr('#') . 'wincmd w'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:resize_pads()
|
|
||||||
augroup goyop
|
|
||||||
autocmd!
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
let t:goyo_dim.width = s:const(t:goyo_dim.width, 2, &columns)
|
|
||||||
let t:goyo_dim.height = s:const(t:goyo_dim.height, 2, &lines)
|
|
||||||
|
|
||||||
let vmargin = max([0, (&lines - t:goyo_dim.height) / 2 - 1])
|
|
||||||
let yoff = s:const(t:goyo_dim.yoff, - vmargin, vmargin)
|
|
||||||
let top = vmargin + yoff
|
|
||||||
let bot = vmargin - yoff - 1
|
|
||||||
call s:setup_pad(t:goyo_pads.t, 0, top, 'j')
|
|
||||||
call s:setup_pad(t:goyo_pads.b, 0, bot, 'k')
|
|
||||||
|
|
||||||
let nwidth = max([len(string(line('$'))) + 1, &numberwidth])
|
|
||||||
let width = t:goyo_dim.width + (&number ? nwidth : 0)
|
|
||||||
let hmargin = max([0, (&columns - width) / 2 - 1])
|
|
||||||
let xoff = s:const(t:goyo_dim.xoff, - hmargin, hmargin)
|
|
||||||
call s:setup_pad(t:goyo_pads.l, 1, hmargin + xoff, 'l')
|
|
||||||
call s:setup_pad(t:goyo_pads.r, 1, hmargin - xoff, 'h')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:tranquilize()
|
|
||||||
let bg = s:get_color('Normal', 'bg#')
|
|
||||||
for grp in ['NonText', 'FoldColumn', 'ColorColumn', 'VertSplit',
|
|
||||||
\ 'StatusLine', 'StatusLineNC', 'SignColumn']
|
|
||||||
" -1 on Vim / '' on GVim
|
|
||||||
if bg == -1 || empty(bg)
|
|
||||||
call s:set_color(grp, 'fg', get(g:, 'goyo_bg', 'black'))
|
|
||||||
call s:set_color(grp, 'bg', 'NONE')
|
|
||||||
else
|
|
||||||
call s:set_color(grp, 'fg', bg)
|
|
||||||
call s:set_color(grp, 'bg', bg)
|
|
||||||
endif
|
|
||||||
call s:set_color(grp, '', 'NONE')
|
|
||||||
endfor
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:hide_statusline()
|
|
||||||
setlocal statusline=\
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:hide_linenr()
|
|
||||||
if !get(g:, 'goyo_linenr', 0)
|
|
||||||
setlocal nonu
|
|
||||||
if exists('&rnu')
|
|
||||||
setlocal nornu
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
if exists('&colorcolumn')
|
|
||||||
setlocal colorcolumn=
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:maps_nop()
|
|
||||||
let mapped = filter(['R', 'H', 'J', 'K', 'L', '|', '_'],
|
|
||||||
\ "empty(maparg(\"\<c-w>\".v:val, 'n'))")
|
|
||||||
for c in mapped
|
|
||||||
execute 'nnoremap <c-w>'.escape(c, '|').' <nop>'
|
|
||||||
endfor
|
|
||||||
return mapped
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:maps_resize()
|
|
||||||
let commands = {
|
|
||||||
\ '=': ':<c-u>let t:goyo_dim = <sid>parse_arg(t:goyo_dim_expr) <bar> call <sid>resize_pads()<cr>',
|
|
||||||
\ '>': ':<c-u>let t:goyo_dim.width = winwidth(0) + 2 * v:count1 <bar> call <sid>resize_pads()<cr>',
|
|
||||||
\ '<': ':<c-u>let t:goyo_dim.width = winwidth(0) - 2 * v:count1 <bar> call <sid>resize_pads()<cr>',
|
|
||||||
\ '+': ':<c-u>let t:goyo_dim.height += 2 * v:count1 <bar> call <sid>resize_pads()<cr>',
|
|
||||||
\ '-': ':<c-u>let t:goyo_dim.height -= 2 * v:count1 <bar> call <sid>resize_pads()<cr>'
|
|
||||||
\ }
|
|
||||||
let mapped = filter(keys(commands), "empty(maparg(\"\<c-w>\".v:val, 'n'))")
|
|
||||||
for c in mapped
|
|
||||||
execute 'nnoremap <silent> <c-w>'.c.' '.commands[c]
|
|
||||||
endfor
|
|
||||||
return mapped
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
nnoremap <silent> <plug>(goyo-resize) :<c-u>call <sid>resize_pads()<cr>
|
|
||||||
|
|
||||||
function! s:goyo_on(dim)
|
|
||||||
let dim = s:parse_arg(a:dim)
|
|
||||||
if empty(dim)
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:orig_tab = tabpagenr()
|
|
||||||
let settings =
|
|
||||||
\ { 'laststatus': &laststatus,
|
|
||||||
\ 'showtabline': &showtabline,
|
|
||||||
\ 'fillchars': &fillchars,
|
|
||||||
\ 'winminwidth': &winminwidth,
|
|
||||||
\ 'winwidth': &winwidth,
|
|
||||||
\ 'winminheight': &winminheight,
|
|
||||||
\ 'winheight': &winheight,
|
|
||||||
\ 'ruler': &ruler,
|
|
||||||
\ 'sidescroll': &sidescroll,
|
|
||||||
\ 'sidescrolloff': &sidescrolloff
|
|
||||||
\ }
|
|
||||||
|
|
||||||
" New tab
|
|
||||||
tab split
|
|
||||||
|
|
||||||
let t:goyo_master = winbufnr(0)
|
|
||||||
let t:goyo_dim = dim
|
|
||||||
let t:goyo_dim_expr = a:dim
|
|
||||||
let t:goyo_pads = {}
|
|
||||||
let t:goyo_revert = settings
|
|
||||||
let t:goyo_maps = extend(s:maps_nop(), s:maps_resize())
|
|
||||||
if has('gui_running')
|
|
||||||
let t:goyo_revert.guioptions = &guioptions
|
|
||||||
endif
|
|
||||||
|
|
||||||
" vim-gitgutter
|
|
||||||
let t:goyo_disabled_gitgutter = get(g:, 'gitgutter_enabled', 0)
|
|
||||||
if t:goyo_disabled_gitgutter
|
|
||||||
silent! GitGutterDisable
|
|
||||||
endif
|
|
||||||
|
|
||||||
" vim-signify
|
|
||||||
let t:goyo_disabled_signify = exists('b:sy') && b:sy.active
|
|
||||||
if t:goyo_disabled_signify
|
|
||||||
SignifyToggle
|
|
||||||
endif
|
|
||||||
|
|
||||||
" vim-airline
|
|
||||||
let t:goyo_disabled_airline = exists('#airline')
|
|
||||||
if t:goyo_disabled_airline
|
|
||||||
AirlineToggle
|
|
||||||
endif
|
|
||||||
|
|
||||||
" vim-powerline
|
|
||||||
let t:goyo_disabled_powerline = exists('#PowerlineMain')
|
|
||||||
if t:goyo_disabled_powerline
|
|
||||||
augroup PowerlineMain
|
|
||||||
autocmd!
|
|
||||||
augroup END
|
|
||||||
augroup! PowerlineMain
|
|
||||||
endif
|
|
||||||
|
|
||||||
" lightline.vim
|
|
||||||
let t:goyo_disabled_lightline = exists('#lightline')
|
|
||||||
if t:goyo_disabled_lightline
|
|
||||||
silent! call lightline#disable()
|
|
||||||
endif
|
|
||||||
|
|
||||||
call s:hide_linenr()
|
|
||||||
" Global options
|
|
||||||
let &winheight = max([&winminheight, 1])
|
|
||||||
set winminheight=1
|
|
||||||
set winheight=1
|
|
||||||
set winminwidth=1 winwidth=1
|
|
||||||
set laststatus=0
|
|
||||||
set showtabline=0
|
|
||||||
set noruler
|
|
||||||
set fillchars+=vert:\
|
|
||||||
set fillchars+=stl:\
|
|
||||||
set fillchars+=stlnc:\
|
|
||||||
set sidescroll=1
|
|
||||||
set sidescrolloff=0
|
|
||||||
|
|
||||||
" Hide left-hand scrollbars
|
|
||||||
if has('gui_running')
|
|
||||||
set guioptions-=l
|
|
||||||
set guioptions-=L
|
|
||||||
endif
|
|
||||||
|
|
||||||
let t:goyo_pads.l = s:init_pad('vertical topleft new')
|
|
||||||
let t:goyo_pads.r = s:init_pad('vertical botright new')
|
|
||||||
let t:goyo_pads.t = s:init_pad('topleft new')
|
|
||||||
let t:goyo_pads.b = s:init_pad('botright new')
|
|
||||||
|
|
||||||
call s:resize_pads()
|
|
||||||
call s:tranquilize()
|
|
||||||
|
|
||||||
augroup goyo
|
|
||||||
autocmd!
|
|
||||||
autocmd TabLeave * call s:goyo_off()
|
|
||||||
autocmd VimResized * call s:resize_pads()
|
|
||||||
autocmd ColorScheme * call s:tranquilize()
|
|
||||||
autocmd BufWinEnter * call s:hide_linenr() | call s:hide_statusline()
|
|
||||||
autocmd WinEnter,WinLeave * call s:hide_statusline()
|
|
||||||
if has('nvim')
|
|
||||||
autocmd TermClose * call feedkeys("\<plug>(goyo-resize)")
|
|
||||||
endif
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
call s:hide_statusline()
|
|
||||||
if exists('g:goyo_callbacks[0]')
|
|
||||||
call g:goyo_callbacks[0]()
|
|
||||||
endif
|
|
||||||
if exists('#User#GoyoEnter')
|
|
||||||
doautocmd User GoyoEnter
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:goyo_off()
|
|
||||||
if !exists('#goyo')
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Oops, not this tab
|
|
||||||
if !exists('t:goyo_revert')
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Clear auto commands
|
|
||||||
augroup goyo
|
|
||||||
autocmd!
|
|
||||||
augroup END
|
|
||||||
augroup! goyo
|
|
||||||
augroup goyop
|
|
||||||
autocmd!
|
|
||||||
augroup END
|
|
||||||
augroup! goyop
|
|
||||||
|
|
||||||
for c in t:goyo_maps
|
|
||||||
execute 'nunmap <c-w>'.escape(c, '|')
|
|
||||||
endfor
|
|
||||||
|
|
||||||
let goyo_revert = t:goyo_revert
|
|
||||||
let goyo_disabled_gitgutter = t:goyo_disabled_gitgutter
|
|
||||||
let goyo_disabled_signify = t:goyo_disabled_signify
|
|
||||||
let goyo_disabled_airline = t:goyo_disabled_airline
|
|
||||||
let goyo_disabled_powerline = t:goyo_disabled_powerline
|
|
||||||
let goyo_disabled_lightline = t:goyo_disabled_lightline
|
|
||||||
let goyo_orig_buffer = t:goyo_master
|
|
||||||
let [line, col] = [line('.'), col('.')]
|
|
||||||
|
|
||||||
if tabpagenr() == 1
|
|
||||||
tabnew
|
|
||||||
normal! gt
|
|
||||||
bd
|
|
||||||
endif
|
|
||||||
tabclose
|
|
||||||
execute 'normal! '.s:orig_tab.'gt'
|
|
||||||
if winbufnr(0) == goyo_orig_buffer
|
|
||||||
" Doesn't work if window closed with `q`
|
|
||||||
execute printf('normal! %dG%d|', line, col)
|
|
||||||
endif
|
|
||||||
|
|
||||||
let wmw = remove(goyo_revert, 'winminwidth')
|
|
||||||
let ww = remove(goyo_revert, 'winwidth')
|
|
||||||
let &winwidth = ww
|
|
||||||
let &winminwidth = wmw
|
|
||||||
let wmh = remove(goyo_revert, 'winminheight')
|
|
||||||
let wh = remove(goyo_revert, 'winheight')
|
|
||||||
let &winheight = max([wmh, 1])
|
|
||||||
let &winminheight = wmh
|
|
||||||
let &winheight = wh
|
|
||||||
|
|
||||||
for [k, v] in items(goyo_revert)
|
|
||||||
execute printf('let &%s = %s', k, string(v))
|
|
||||||
endfor
|
|
||||||
execute 'colo '. get(g:, 'colors_name', 'default')
|
|
||||||
|
|
||||||
if goyo_disabled_gitgutter
|
|
||||||
silent! GitGutterEnable
|
|
||||||
endif
|
|
||||||
|
|
||||||
if goyo_disabled_signify
|
|
||||||
silent! if !b:sy.active
|
|
||||||
SignifyToggle
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if goyo_disabled_airline && !exists('#airline')
|
|
||||||
AirlineToggle
|
|
||||||
" For some reason, Airline requires two refreshes to avoid display
|
|
||||||
" artifacts
|
|
||||||
silent! AirlineRefresh
|
|
||||||
silent! AirlineRefresh
|
|
||||||
endif
|
|
||||||
|
|
||||||
if goyo_disabled_powerline && !exists('#PowerlineMain')
|
|
||||||
doautocmd PowerlineStartup VimEnter
|
|
||||||
silent! PowerlineReloadColorscheme
|
|
||||||
endif
|
|
||||||
|
|
||||||
if goyo_disabled_lightline
|
|
||||||
silent! call lightline#enable()
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists('#Powerline')
|
|
||||||
doautocmd Powerline ColorScheme
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists('g:goyo_callbacks[1]')
|
|
||||||
call g:goyo_callbacks[1]()
|
|
||||||
endif
|
|
||||||
if exists('#User#GoyoLeave')
|
|
||||||
doautocmd User GoyoLeave
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:relsz(expr, limit)
|
|
||||||
if a:expr !~ '%$'
|
|
||||||
return str2nr(a:expr)
|
|
||||||
endif
|
|
||||||
return a:limit * str2nr(a:expr[:-2]) / 100
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:parse_arg(arg)
|
|
||||||
if exists('g:goyo_height') || !exists('g:goyo_margin_top') && !exists('g:goyo_margin_bottom')
|
|
||||||
let height = s:relsz(get(g:, 'goyo_height', '85%'), &lines)
|
|
||||||
let yoff = 0
|
|
||||||
else
|
|
||||||
let top = max([0, s:relsz(get(g:, 'goyo_margin_top', 4), &lines)])
|
|
||||||
let bot = max([0, s:relsz(get(g:, 'goyo_margin_bottom', 4), &lines)])
|
|
||||||
let height = &lines - top - bot
|
|
||||||
let yoff = top - bot
|
|
||||||
endif
|
|
||||||
|
|
||||||
let dim = { 'width': s:relsz(get(g:, 'goyo_width', 80), &columns),
|
|
||||||
\ 'height': height,
|
|
||||||
\ 'xoff': 0,
|
|
||||||
\ 'yoff': yoff }
|
|
||||||
if empty(a:arg)
|
|
||||||
return dim
|
|
||||||
endif
|
|
||||||
let parts = matchlist(a:arg, '^\s*\([0-9]\+%\?\)\?\([+-][0-9]\+%\?\)\?\%(x\([0-9]\+%\?\)\?\([+-][0-9]\+%\?\)\?\)\?\s*$')
|
|
||||||
if empty(parts)
|
|
||||||
echohl WarningMsg
|
|
||||||
echo 'Invalid dimension expression: '.a:arg
|
|
||||||
echohl None
|
|
||||||
return {}
|
|
||||||
endif
|
|
||||||
if !empty(parts[1]) | let dim.width = s:relsz(parts[1], &columns) | endif
|
|
||||||
if !empty(parts[2]) | let dim.xoff = s:relsz(parts[2], &columns) | endif
|
|
||||||
if !empty(parts[3]) | let dim.height = s:relsz(parts[3], &lines) | endif
|
|
||||||
if !empty(parts[4]) | let dim.yoff = s:relsz(parts[4], &lines) | endif
|
|
||||||
return dim
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! goyo#execute(bang, dim)
|
|
||||||
if a:bang
|
|
||||||
if exists('#goyo')
|
|
||||||
call s:goyo_off()
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
if exists('#goyo') == 0
|
|
||||||
call s:goyo_on(a:dim)
|
|
||||||
elseif !empty(a:dim)
|
|
||||||
if winnr('$') < 5
|
|
||||||
call s:goyo_off()
|
|
||||||
return goyo#execute(a:bang, a:dim)
|
|
||||||
endif
|
|
||||||
let dim = s:parse_arg(a:dim)
|
|
||||||
if !empty(dim)
|
|
||||||
let t:goyo_dim = dim
|
|
||||||
let t:goyo_dim_expr = a:dim
|
|
||||||
call s:resize_pads()
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
call s:goyo_off()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
|
||||||
unlet s:cpo_save
|
|
||||||
|
|
@ -1,170 +0,0 @@
|
|||||||
goyo.txt goyo Last change: April 2 2017
|
|
||||||
GOYO - TABLE OF CONTENTS *goyo* *goyo-toc*
|
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
goyo.vim (고요)
|
|
||||||
Installation
|
|
||||||
Usage
|
|
||||||
Dimension expression
|
|
||||||
Configuration
|
|
||||||
Callbacks
|
|
||||||
Inspiration
|
|
||||||
Pros.
|
|
||||||
License
|
|
||||||
|
|
||||||
GOYO.VIM (고요) *goyo-vim*
|
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
Distraction-free writing in Vim.
|
|
||||||
|
|
||||||
https://raw.github.com/junegunn/i/master/goyo.png
|
|
||||||
|
|
||||||
(Color scheme: {seoul256}{1})
|
|
||||||
|
|
||||||
Best served with {limelight.vim}{2}.
|
|
||||||
|
|
||||||
{1} https://github.com/junegunn/seoul256.vim
|
|
||||||
{2} https://github.com/junegunn/limelight.vim
|
|
||||||
|
|
||||||
|
|
||||||
INSTALLATION *goyo-installation*
|
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
Use your favorite plugin manager.
|
|
||||||
|
|
||||||
*:PlugInstall*
|
|
||||||
|
|
||||||
- {vim-plug}{3}
|
|
||||||
1. Add `Plug 'junegunn/goyo.vim'` to .vimrc
|
|
||||||
2. Run `:PlugInstall`
|
|
||||||
|
|
||||||
{3} https://github.com/junegunn/vim-plug
|
|
||||||
|
|
||||||
|
|
||||||
USAGE *goyo-usage*
|
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
*:Goyo*
|
|
||||||
|
|
||||||
- `:Goyo`
|
|
||||||
- Toggle Goyo
|
|
||||||
- `:Goyo [dimension]`
|
|
||||||
- Turn on or resize Goyo
|
|
||||||
- `:Goyo!`
|
|
||||||
- Turn Goyo off
|
|
||||||
|
|
||||||
The window can be resized with the usual count]<CTRL-W + `>`, `<`, `+`, `-`
|
|
||||||
keys.
|
|
||||||
|
|
||||||
|
|
||||||
< Dimension expression >______________________________________________________~
|
|
||||||
*goyo-dimension-expression*
|
|
||||||
|
|
||||||
The expected format of a dimension expression is
|
|
||||||
`[WIDTH][XOFFSET][x[HEIGHT][YOFFSET]]`. `XOFFSET` and `YOFFSET` should be
|
|
||||||
prefixed by `+` or `-`. Each component can be given in percentage.
|
|
||||||
>
|
|
||||||
" Width
|
|
||||||
Goyo 120
|
|
||||||
|
|
||||||
" Height
|
|
||||||
Goyo x30
|
|
||||||
|
|
||||||
" Both
|
|
||||||
Goyo 120x30
|
|
||||||
|
|
||||||
" In percentage
|
|
||||||
Goyo 120x50%
|
|
||||||
|
|
||||||
" With offsets
|
|
||||||
Goyo 50%+25%x50%-25%
|
|
||||||
<
|
|
||||||
|
|
||||||
CONFIGURATION *goyo-configuration*
|
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
*g:goyo_width* *g:goyo_height* *g:goyo_linenr*
|
|
||||||
|
|
||||||
- `g:goyo_width` (default: 80)
|
|
||||||
- `g:goyo_height` (default: 85%)
|
|
||||||
- `g:goyo_linenr` (default: 0)
|
|
||||||
|
|
||||||
|
|
||||||
< Callbacks >_________________________________________________________________~
|
|
||||||
*goyo-callbacks*
|
|
||||||
|
|
||||||
By default, {vim-airline}{4}, {vim-powerline}{5}, {powerline}{6},
|
|
||||||
{lightline.vim}{7}, {vim-signify}{8}, and {vim-gitgutter}{9} are temporarily
|
|
||||||
disabled while in Goyo mode.
|
|
||||||
|
|
||||||
If you have other plugins that you want to disable/enable, or if you want to
|
|
||||||
change the default settings of Goyo window, you can set up custom routines to
|
|
||||||
be triggered on `GoyoEnter` and `GoyoLeave` events.
|
|
||||||
>
|
|
||||||
function! s:goyo_enter()
|
|
||||||
silent !tmux set status off
|
|
||||||
silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z
|
|
||||||
set noshowmode
|
|
||||||
set noshowcmd
|
|
||||||
set scrolloff=999
|
|
||||||
Limelight
|
|
||||||
" ...
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:goyo_leave()
|
|
||||||
silent !tmux set status on
|
|
||||||
silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z
|
|
||||||
set showmode
|
|
||||||
set showcmd
|
|
||||||
set scrolloff=5
|
|
||||||
Limelight!
|
|
||||||
" ...
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
autocmd! User GoyoEnter nested call <SID>goyo_enter()
|
|
||||||
autocmd! User GoyoLeave nested call <SID>goyo_leave()
|
|
||||||
<
|
|
||||||
More examples can be found here: {Customization}{10}
|
|
||||||
|
|
||||||
{4} https://github.com/bling/vim-airline
|
|
||||||
{5} https://github.com/Lokaltog/vim-powerline
|
|
||||||
{6} https://github.com/Lokaltog/powerline
|
|
||||||
{7} https://github.com/itchyny/lightline.vim
|
|
||||||
{8} https://github.com/mhinz/vim-signify
|
|
||||||
{9} https://github.com/airblade/vim-gitgutter
|
|
||||||
{10} https://github.com/junegunn/goyo.vim/wiki/Customization
|
|
||||||
|
|
||||||
|
|
||||||
INSPIRATION *goyo-inspiration*
|
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
- {LiteDFM}{11}
|
|
||||||
- {VimRoom}{12}
|
|
||||||
|
|
||||||
{11} https://github.com/bilalq/lite-dfm
|
|
||||||
{12} http://projects.mikewest.org/vimroom/
|
|
||||||
|
|
||||||
|
|
||||||
PROS. *goyo-pros*
|
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
1. Works well with splits. Doesn't mess up with the current window arrangement
|
|
||||||
2. Works well with popular statusline plugins
|
|
||||||
3. Prevents accessing the empty windows around the central buffer
|
|
||||||
4. Can be closed with any of `:q[uit]`, `:clo[se]`, `:tabc[lose]`, or `:Goyo`
|
|
||||||
5. Can dynamically change the width of the window
|
|
||||||
6. Adjusts its colors when color scheme is changed
|
|
||||||
7. Realigns the window when the terminal (or window) is resized or when the size
|
|
||||||
of the font is changed
|
|
||||||
8. Correctly hides colorcolumns and Emojis in statusline
|
|
||||||
9. Highly customizable with callbacks
|
|
||||||
|
|
||||||
|
|
||||||
LICENSE *goyo-license*
|
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
MIT
|
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
vim:tw=78:sw=2:ts=2:ft=help:norl:nowrap:
|
|
@ -1,24 +0,0 @@
|
|||||||
" Copyright (c) 2015 Junegunn Choi
|
|
||||||
"
|
|
||||||
" MIT License
|
|
||||||
"
|
|
||||||
" Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
" a copy of this software and associated documentation files (the
|
|
||||||
" "Software"), to deal in the Software without restriction, including
|
|
||||||
" without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
" distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
" permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
" the following conditions:
|
|
||||||
"
|
|
||||||
" The above copyright notice and this permission notice shall be
|
|
||||||
" included in all copies or substantial portions of the Software.
|
|
||||||
"
|
|
||||||
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
command! -nargs=? -bar -bang Goyo call goyo#execute(<bang>0, <q-args>)
|
|
@ -1,117 +0,0 @@
|
|||||||
# Change Log
|
|
||||||
|
|
||||||
## [Unreleased](https://github.com/morhetz/gruvbox/tree/HEAD)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/morhetz/gruvbox/compare/v1.3.5...HEAD)
|
|
||||||
|
|
||||||
**Fixed bugs:**
|
|
||||||
|
|
||||||
- Lighter background on terminal [\#8](https://github.com/morhetz/gruvbox/issues/8)
|
|
||||||
|
|
||||||
**Closed issues:**
|
|
||||||
|
|
||||||
- Installation issue. [\#54](https://github.com/morhetz/gruvbox/issues/54)
|
|
||||||
|
|
||||||
- Italic font in terminal\(urxvt\) [\#49](https://github.com/morhetz/gruvbox/issues/49)
|
|
||||||
|
|
||||||
- Unable to log in when sourcing the palette shellscript [\#48](https://github.com/morhetz/gruvbox/issues/48)
|
|
||||||
|
|
||||||
- How can i modify multiple comment scheme [\#46](https://github.com/morhetz/gruvbox/issues/46)
|
|
||||||
|
|
||||||
- Remove comment highlight in iterm [\#44](https://github.com/morhetz/gruvbox/issues/44)
|
|
||||||
|
|
||||||
- Comments looking strange withing tmux [\#43](https://github.com/morhetz/gruvbox/issues/43)
|
|
||||||
|
|
||||||
- comments are reverse-video in xterm [\#41](https://github.com/morhetz/gruvbox/issues/41)
|
|
||||||
|
|
||||||
- What font are you using in the screenshots? [\#39](https://github.com/morhetz/gruvbox/issues/39)
|
|
||||||
|
|
||||||
- vim-signature crashes when I use gruvbox [\#38](https://github.com/morhetz/gruvbox/issues/38)
|
|
||||||
|
|
||||||
- Color of statusbar in inactive windows [\#37](https://github.com/morhetz/gruvbox/issues/37)
|
|
||||||
|
|
||||||
- Go method and struct highlighting missing [\#36](https://github.com/morhetz/gruvbox/issues/36)
|
|
||||||
|
|
||||||
- gruvbox\_256palette.sh doesn't work for Konsole [\#35](https://github.com/morhetz/gruvbox/issues/35)
|
|
||||||
|
|
||||||
- Contrast in jekyll markdown files [\#33](https://github.com/morhetz/gruvbox/issues/33)
|
|
||||||
|
|
||||||
- Pentadactyl Gruvbox Theme [\#32](https://github.com/morhetz/gruvbox/issues/32)
|
|
||||||
|
|
||||||
- make vertsplit better [\#31](https://github.com/morhetz/gruvbox/issues/31)
|
|
||||||
|
|
||||||
- Console support. [\#30](https://github.com/morhetz/gruvbox/issues/30)
|
|
||||||
|
|
||||||
- How can I change the background color? [\#29](https://github.com/morhetz/gruvbox/issues/29)
|
|
||||||
|
|
||||||
- Some words are not bold [\#28](https://github.com/morhetz/gruvbox/issues/28)
|
|
||||||
|
|
||||||
- Terminal theme on base gruvbox [\#25](https://github.com/morhetz/gruvbox/issues/25)
|
|
||||||
|
|
||||||
- Markdown has inverted colors when using \* [\#24](https://github.com/morhetz/gruvbox/issues/24)
|
|
||||||
|
|
||||||
- how install it on mac osx [\#23](https://github.com/morhetz/gruvbox/issues/23)
|
|
||||||
|
|
||||||
- Comments color for Terminal Vim [\#22](https://github.com/morhetz/gruvbox/issues/22)
|
|
||||||
|
|
||||||
- Move palette files to gruvbox-generalized [\#20](https://github.com/morhetz/gruvbox/issues/20)
|
|
||||||
|
|
||||||
- Maybe add Gruvbox Airline theme? [\#19](https://github.com/morhetz/gruvbox/issues/19)
|
|
||||||
|
|
||||||
- For Sublime text [\#18](https://github.com/morhetz/gruvbox/issues/18)
|
|
||||||
|
|
||||||
**Merged pull requests:**
|
|
||||||
|
|
||||||
- Fix the 256 palette script failed login issue [\#53](https://github.com/morhetz/gruvbox/pull/53) ([jonasmalacofilho](https://github.com/jonasmalacofilho))
|
|
||||||
|
|
||||||
- add minimal coloring for gitcommit highlighting [\#52](https://github.com/morhetz/gruvbox/pull/52) ([daniely](https://github.com/daniely))
|
|
||||||
|
|
||||||
- For terminals, turn off italics by default. [\#47](https://github.com/morhetz/gruvbox/pull/47) ([ryanmjacobs](https://github.com/ryanmjacobs))
|
|
||||||
|
|
||||||
- Change color of vertical/horizontal seperators between split windows [\#45](https://github.com/morhetz/gruvbox/pull/45) ([deshtop](https://github.com/deshtop))
|
|
||||||
|
|
||||||
- Improve gruvbox with C code [\#34](https://github.com/morhetz/gruvbox/pull/34) ([gladiac](https://github.com/gladiac))
|
|
||||||
|
|
||||||
- Fix for linux console [\#27](https://github.com/morhetz/gruvbox/pull/27) ([vyp](https://github.com/vyp))
|
|
||||||
|
|
||||||
- Colors for plugin vimshell.vim [\#21](https://github.com/morhetz/gruvbox/pull/21) ([joelmo](https://github.com/joelmo))
|
|
||||||
|
|
||||||
## [v1.3.5](https://github.com/morhetz/gruvbox/tree/v1.3.5) (2014-03-19)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/morhetz/gruvbox/compare/v0.0.8...v1.3.5)
|
|
||||||
|
|
||||||
**Implemented enhancements:**
|
|
||||||
|
|
||||||
- Better selection colors [\#15](https://github.com/morhetz/gruvbox/issues/15)
|
|
||||||
|
|
||||||
- When hlsearch is on, the cursor inverts the search color and not visible [\#2](https://github.com/morhetz/gruvbox/issues/2)
|
|
||||||
|
|
||||||
**Fixed bugs:**
|
|
||||||
|
|
||||||
- Problem with changing between dark and light on 256 color terminal [\#7](https://github.com/morhetz/gruvbox/issues/7)
|
|
||||||
|
|
||||||
- IndentGuides coloring doesn't show up [\#1](https://github.com/morhetz/gruvbox/issues/1)
|
|
||||||
|
|
||||||
**Closed issues:**
|
|
||||||
|
|
||||||
- Requesting rxvt-unicode theme [\#17](https://github.com/morhetz/gruvbox/issues/17)
|
|
||||||
|
|
||||||
- gruvbox\_256palette.sh gets reset \(gnome-terminal on Ubuntu\) [\#13](https://github.com/morhetz/gruvbox/issues/13)
|
|
||||||
|
|
||||||
- Powerline colors [\#12](https://github.com/morhetz/gruvbox/issues/12)
|
|
||||||
|
|
||||||
- Info necessary for making a port of this colorscheme [\#10](https://github.com/morhetz/gruvbox/issues/10)
|
|
||||||
|
|
||||||
**Merged pull requests:**
|
|
||||||
|
|
||||||
- Fix GNU screen detection for \*-bce [\#16](https://github.com/morhetz/gruvbox/pull/16) ([blueyed](https://github.com/blueyed))
|
|
||||||
|
|
||||||
- Added iTerm2 dark theme [\#11](https://github.com/morhetz/gruvbox/pull/11) ([Greduan](https://github.com/Greduan))
|
|
||||||
|
|
||||||
- Fix typo in Readme [\#5](https://github.com/morhetz/gruvbox/pull/5) ([ViViDboarder](https://github.com/ViViDboarder))
|
|
||||||
|
|
||||||
## [v0.0.8](https://github.com/morhetz/gruvbox/tree/v0.0.8) (2012-12-08)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
|
@ -1,113 +0,0 @@
|
|||||||
<p align="center"><img src="http://svgur.com/i/3Dp.svg"></p>
|
|
||||||
|
|
||||||
gruvbox is heavily inspired by [badwolf][], [jellybeans][] and [solarized][].
|
|
||||||
|
|
||||||
Designed as a bright theme with pastel 'retro groove' colors and light/dark mode switching in the way of [solarized][]. The main focus when developing gruvbox is to keep colors easily distinguishable, contrast enough and still pleasant for the eyes.
|
|
||||||
|
|
||||||
[badwolf]: https://github.com/sjl/badwolf
|
|
||||||
[jellybeans]: https://github.com/nanotech/jellybeans.vim
|
|
||||||
[solarized]: http://ethanschoonover.com/solarized
|
|
||||||
|
|
||||||
Attention
|
|
||||||
---------
|
|
||||||
|
|
||||||
1. [Read this first](https://github.com/morhetz/gruvbox/wiki/Terminal-specific)
|
|
||||||
2. Typeface from gallery is [Fantasque Sans Mono](https://github.com/belluzj/fantasque-sans)
|
|
||||||
3. Typeface from screenshots below is [Fira Mono](http://www.carrois.com/fira-4-1/)
|
|
||||||
|
|
||||||
Screenshots
|
|
||||||
-----------
|
|
||||||
|
|
||||||
Refer [Gallery][] for more syntax-specific screenshots.
|
|
||||||
|
|
||||||
[Gallery]: https://github.com/morhetz/gruvbox/wiki/Gallery
|
|
||||||
|
|
||||||
### Dark mode
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### Light mode
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### Airline theme
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Palette
|
|
||||||
-------
|
|
||||||
|
|
||||||
### Dark mode
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### Light mode
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Contrast options
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Refer [wiki section][] for contrast configuration and other options.
|
|
||||||
|
|
||||||
[wiki section]: https://github.com/morhetz/gruvbox/wiki/Configuration#ggruvbox_contrast_dark
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Documentation
|
|
||||||
-------------
|
|
||||||
|
|
||||||
Please check [wiki][] for installation details, terminal-specific setup, troubleshooting, configuration options and others.
|
|
||||||
|
|
||||||
[wiki]: https://github.com/morhetz/gruvbox/wiki
|
|
||||||
|
|
||||||
Features
|
|
||||||
--------
|
|
||||||
|
|
||||||
* Lots of style-customization options (contrast, color invertion, italics usage etc.)
|
|
||||||
* Extended filetype highlighting: Html, Xml, Vim, Clojure, C, Python, JavaScript, TypeScript, PureScript, CoffeeScript, Ruby, Objective-C, Go, Lua, MoonScript, Java, Markdown, Haskell, Elixir
|
|
||||||
* Supported plugins: [EasyMotion][], [vim-sneak][], [Indent Guides][], [indentLine][], [Rainbow Parentheses][], [Airline][], [Lightline][], [GitGutter][], [Signify][], [ShowMarks][], [Signature][], [Syntastic][], [Ale][], [CtrlP][], [Startify][], [NERDTree][], [Dirvish][]
|
|
||||||
|
|
||||||
[EasyMotion]: https://github.com/Lokaltog/vim-easymotion
|
|
||||||
[vim-sneak]: https://github.com/justinmk/vim-sneak
|
|
||||||
[Indent Guides]: https://github.com/nathanaelkane/vim-indent-guides
|
|
||||||
[indentLine]: https://github.com/Yggdroot/indentLine
|
|
||||||
[Rainbow Parentheses]: https://github.com/kien/rainbow_parentheses.vim
|
|
||||||
[Airline]: https://github.com/bling/vim-airline
|
|
||||||
[Lightline]: https://github.com/itchyny/lightline.vim
|
|
||||||
[GitGutter]: https://github.com/airblade/vim-gitgutter
|
|
||||||
[Signify]: https://github.com/mhinz/vim-signify
|
|
||||||
[ShowMarks]: http://www.vim.org/scripts/script.php?script_id=152
|
|
||||||
[Signature]: https://github.com/kshenoy/vim-signature
|
|
||||||
[Syntastic]: https://github.com/scrooloose/syntastic
|
|
||||||
[Ale]: https://github.com/w0rp/ale
|
|
||||||
[CtrlP]: https://github.com/kien/ctrlp.vim
|
|
||||||
[Startify]: https://github.com/mhinz/vim-startify
|
|
||||||
[NERDTree]: https://github.com/scrooloose/nerdtree
|
|
||||||
[Dirvish]: https://github.com/justinmk/vim-dirvish
|
|
||||||
|
|
||||||
Contributions
|
|
||||||
-------------
|
|
||||||
|
|
||||||
See [gruvbox-contrib][] repo for contributions, ports and extras.
|
|
||||||
|
|
||||||
[gruvbox-contrib]: https://github.com/morhetz/gruvbox-contrib
|
|
||||||
|
|
||||||
ToDo
|
|
||||||
----
|
|
||||||
|
|
||||||
* Filetype syntax highlighting (R, TeX, Swift, Erlang)
|
|
||||||
* Plugin support (Tagbar, VimPlug)
|
|
||||||
|
|
||||||
Self-Promotion
|
|
||||||
--------------
|
|
||||||
|
|
||||||
If you like gruvbox follow the repository on
|
|
||||||
[GitHub](https://github.com/morhetz/gruvbox) and vote for it on
|
|
||||||
[vim.org](http://www.vim.org/scripts/script.php?script_id=4349).
|
|
||||||
|
|
||||||
License
|
|
||||||
-------
|
|
||||||
[MIT/X11][]
|
|
||||||
|
|
||||||
[MIT/X11]: https://en.wikipedia.org/wiki/MIT_License
|
|
@ -1,79 +0,0 @@
|
|||||||
" -----------------------------------------------------------------------------
|
|
||||||
" File: gruvbox.vim
|
|
||||||
" Description: Retro groove color scheme for Airline
|
|
||||||
" Author: morhetz <morhetz@gmail.com>
|
|
||||||
" Source: https://github.com/morhetz/gruvbox
|
|
||||||
" Last Modified: 12 Aug 2017
|
|
||||||
" -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
let g:airline#themes#gruvbox#palette = {}
|
|
||||||
|
|
||||||
function! airline#themes#gruvbox#refresh()
|
|
||||||
|
|
||||||
let M0 = airline#themes#get_highlight('Identifier')
|
|
||||||
let accents_group = airline#themes#get_highlight('Special')
|
|
||||||
let modified_group = [M0[0], '', M0[2], '', '']
|
|
||||||
let warning_group = airline#themes#get_highlight2(['Normal', 'bg'], ['Question', 'fg'])
|
|
||||||
let error_group = airline#themes#get_highlight2(['Normal', 'bg'], ['WarningMsg', 'fg'])
|
|
||||||
|
|
||||||
let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['StatusLineNC', 'bg'])
|
|
||||||
let s:N2 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['Pmenu', 'bg'])
|
|
||||||
let s:N3 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['CursorLine', 'bg'])
|
|
||||||
let g:airline#themes#gruvbox#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
|
||||||
let g:airline#themes#gruvbox#palette.normal_modified = { 'airline_c': modified_group }
|
|
||||||
let g:airline#themes#gruvbox#palette.normal.airline_warning = warning_group
|
|
||||||
let g:airline#themes#gruvbox#palette.normal_modified.airline_warning = warning_group
|
|
||||||
let g:airline#themes#gruvbox#palette.normal.airline_error = error_group
|
|
||||||
let g:airline#themes#gruvbox#palette.normal_modified.airline_error = error_group
|
|
||||||
|
|
||||||
let s:I1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Identifier', 'fg'])
|
|
||||||
let s:I2 = s:N2
|
|
||||||
let s:I3 = airline#themes#get_highlight2(['Normal', 'fg'], ['Pmenu', 'bg'])
|
|
||||||
let g:airline#themes#gruvbox#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
|
||||||
let g:airline#themes#gruvbox#palette.insert_modified = g:airline#themes#gruvbox#palette.normal_modified
|
|
||||||
let g:airline#themes#gruvbox#palette.insert.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning
|
|
||||||
let g:airline#themes#gruvbox#palette.insert_modified.airline_warning = g:airline#themes#gruvbox#palette.normal_modified.airline_warning
|
|
||||||
let g:airline#themes#gruvbox#palette.insert.airline_error = g:airline#themes#gruvbox#palette.normal.airline_error
|
|
||||||
let g:airline#themes#gruvbox#palette.insert_modified.airline_error = g:airline#themes#gruvbox#palette.normal_modified.airline_error
|
|
||||||
|
|
||||||
let s:R1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Structure', 'fg'])
|
|
||||||
let s:R2 = s:I2
|
|
||||||
let s:R3 = s:I3
|
|
||||||
let g:airline#themes#gruvbox#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
|
||||||
let g:airline#themes#gruvbox#palette.replace_modified = g:airline#themes#gruvbox#palette.normal_modified
|
|
||||||
let g:airline#themes#gruvbox#palette.replace.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning
|
|
||||||
let g:airline#themes#gruvbox#palette.replace_modified.airline_warning = g:airline#themes#gruvbox#palette.normal_modified.airline_warning
|
|
||||||
let g:airline#themes#gruvbox#palette.replace.airline_error = g:airline#themes#gruvbox#palette.normal.airline_error
|
|
||||||
let g:airline#themes#gruvbox#palette.replace_modified.airline_error = g:airline#themes#gruvbox#palette.normal_modified.airline_error
|
|
||||||
|
|
||||||
let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Question', 'fg'])
|
|
||||||
let s:V2 = s:N2
|
|
||||||
let s:V3 = airline#themes#get_highlight2(['Normal', 'bg'], ['TabLine', 'fg'])
|
|
||||||
let g:airline#themes#gruvbox#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
|
||||||
let g:airline#themes#gruvbox#palette.visual_modified = { 'airline_c': [ s:V3[0], '', s:V3[2], '', '' ] }
|
|
||||||
let g:airline#themes#gruvbox#palette.visual.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning
|
|
||||||
let g:airline#themes#gruvbox#palette.visual_modified.airline_warning = g:airline#themes#gruvbox#palette.normal_modified.airline_warning
|
|
||||||
let g:airline#themes#gruvbox#palette.visual.airline_error = g:airline#themes#gruvbox#palette.normal.airline_error
|
|
||||||
let g:airline#themes#gruvbox#palette.visual_modified.airline_error = g:airline#themes#gruvbox#palette.normal_modified.airline_error
|
|
||||||
|
|
||||||
let s:IA = airline#themes#get_highlight2(['TabLine', 'fg'], ['CursorLine', 'bg'])
|
|
||||||
let g:airline#themes#gruvbox#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
|
||||||
let g:airline#themes#gruvbox#palette.inactive_modified = { 'airline_c': modified_group }
|
|
||||||
|
|
||||||
let g:airline#themes#gruvbox#palette.accents = { 'red': accents_group }
|
|
||||||
|
|
||||||
let s:TF = airline#themes#get_highlight2(['Normal', 'bg'], ['Normal', 'bg'])
|
|
||||||
let g:airline#themes#gruvbox#palette.tabline = {
|
|
||||||
\ 'airline_tab': s:N2,
|
|
||||||
\ 'airline_tabsel': s:N1,
|
|
||||||
\ 'airline_tabtype': s:V1,
|
|
||||||
\ 'airline_tabfill': s:TF,
|
|
||||||
\ 'airline_tabhid': s:IA,
|
|
||||||
\ 'airline_tabmod': s:I1
|
|
||||||
\ }
|
|
||||||
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call airline#themes#gruvbox#refresh()
|
|
||||||
|
|
||||||
" vim: set sw=2 ts=2 sts=2 et tw=80 ft=vim fdm=marker:
|
|
@ -1,41 +0,0 @@
|
|||||||
" -----------------------------------------------------------------------------
|
|
||||||
" File: gruvbox.vim
|
|
||||||
" Description: Retro groove color scheme for Vim
|
|
||||||
" Author: morhetz <morhetz@gmail.com>
|
|
||||||
" Source: https://github.com/morhetz/gruvbox
|
|
||||||
" Last Modified: 09 Apr 2014
|
|
||||||
" -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
function! gruvbox#invert_signs_toggle()
|
|
||||||
if g:gruvbox_invert_signs == 0
|
|
||||||
let g:gruvbox_invert_signs=1
|
|
||||||
else
|
|
||||||
let g:gruvbox_invert_signs=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
colorscheme gruvbox
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Search Highlighting {{{
|
|
||||||
|
|
||||||
function! gruvbox#hls_show()
|
|
||||||
set hlsearch
|
|
||||||
call GruvboxHlsShowCursor()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! gruvbox#hls_hide()
|
|
||||||
set nohlsearch
|
|
||||||
call GruvboxHlsHideCursor()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! gruvbox#hls_toggle()
|
|
||||||
if &hlsearch
|
|
||||||
call gruvbox#hls_hide()
|
|
||||||
else
|
|
||||||
call gruvbox#hls_show()
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" vim: set sw=2 ts=2 sts=2 et tw=80 ft=vim fdm=marker:
|
|
@ -1,57 +0,0 @@
|
|||||||
" -----------------------------------------------------------------------------
|
|
||||||
" File: gruvbox.vim
|
|
||||||
" Description: Gruvbox colorscheme for Lightline (itchyny/lightline.vim)
|
|
||||||
" Author: gmoe <me@griffinmoe.com>
|
|
||||||
" Source: https://github.com/morhetz/gruvbox
|
|
||||||
" Last Modified: 20 Sep 2017
|
|
||||||
" -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
function! s:getGruvColor(group)
|
|
||||||
let guiColor = synIDattr(hlID(a:group), "fg", "gui")
|
|
||||||
let termColor = synIDattr(hlID(a:group), "fg", "cterm")
|
|
||||||
return [ guiColor, termColor ]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
if exists('g:lightline')
|
|
||||||
|
|
||||||
let s:bg0 = s:getGruvColor('GruvboxBg0')
|
|
||||||
let s:bg1 = s:getGruvColor('GruvboxBg1')
|
|
||||||
let s:bg2 = s:getGruvColor('GruvboxBg2')
|
|
||||||
let s:bg4 = s:getGruvColor('GruvboxBg4')
|
|
||||||
let s:fg1 = s:getGruvColor('GruvboxFg1')
|
|
||||||
let s:fg4 = s:getGruvColor('GruvboxFg4')
|
|
||||||
|
|
||||||
let s:yellow = s:getGruvColor('GruvboxYellow')
|
|
||||||
let s:blue = s:getGruvColor('GruvboxBlue')
|
|
||||||
let s:aqua = s:getGruvColor('GruvboxAqua')
|
|
||||||
let s:orange = s:getGruvColor('GruvboxOrange')
|
|
||||||
let s:green = s:getGruvColor('GruvboxGreen')
|
|
||||||
|
|
||||||
let s:p = {'normal':{}, 'inactive':{}, 'insert':{}, 'replace':{}, 'visual':{}, 'tabline':{}, 'terminal':{}}
|
|
||||||
let s:p.normal.left = [ [ s:bg0, s:fg4, 'bold' ], [ s:fg4, s:bg2 ] ]
|
|
||||||
let s:p.normal.right = [ [ s:bg0, s:fg4 ], [ s:fg4, s:bg2 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:fg4, s:bg1 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:bg4, s:bg1 ], [ s:bg4, s:bg1 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:bg4, s:bg1 ], [ s:bg4, s:bg1 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:bg4, s:bg1 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:bg0, s:blue, 'bold' ], [ s:fg1, s:bg2 ] ]
|
|
||||||
let s:p.insert.right = [ [ s:bg0, s:blue ], [ s:fg1, s:bg2 ] ]
|
|
||||||
let s:p.insert.middle = [ [ s:fg4, s:bg2 ] ]
|
|
||||||
let s:p.terminal.left = [ [ s:bg0, s:green, 'bold' ], [ s:fg1, s:bg2 ] ]
|
|
||||||
let s:p.terminal.right = [ [ s:bg0, s:green ], [ s:fg1, s:bg2 ] ]
|
|
||||||
let s:p.terminal.middle = [ [ s:fg4, s:bg2 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:bg0, s:aqua, 'bold' ], [ s:fg1, s:bg2 ] ]
|
|
||||||
let s:p.replace.right = [ [ s:bg0, s:aqua ], [ s:fg1, s:bg2 ] ]
|
|
||||||
let s:p.replace.middle = [ [ s:fg4, s:bg2 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:bg0, s:orange, 'bold' ], [ s:bg0, s:bg4 ] ]
|
|
||||||
let s:p.visual.right = [ [ s:bg0, s:orange ], [ s:bg0, s:bg4 ] ]
|
|
||||||
let s:p.visual.middle = [ [ s:fg4, s:bg1 ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:fg4, s:bg2 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:bg0, s:fg4 ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:bg0, s:bg0 ] ]
|
|
||||||
let s:p.tabline.right = [ [ s:bg0, s:orange ] ]
|
|
||||||
let s:p.normal.error = [ [ s:bg0, s:orange ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:bg2, s:yellow ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#gruvbox#palette = lightline#colorscheme#flatten(s:p)
|
|
||||||
endif
|
|
File diff suppressed because it is too large
Load Diff
@ -1,118 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ "${TERM%%-*}" = "screen" ]; then
|
|
||||||
if [ -n "$TMUX" ]; then
|
|
||||||
printf "\033Ptmux;\033\033]4;236;rgb:32/30/2f\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;234;rgb:1d/20/21\007\033\\"
|
|
||||||
|
|
||||||
printf "\033Ptmux;\033\033]4;235;rgb:28/28/28\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;237;rgb:3c/38/36\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;239;rgb:50/49/45\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;241;rgb:66/5c/54\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;243;rgb:7c/6f/64\007\033\\"
|
|
||||||
|
|
||||||
printf "\033Ptmux;\033\033]4;244;rgb:92/83/74\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;245;rgb:92/83/74\007\033\\"
|
|
||||||
|
|
||||||
printf "\033Ptmux;\033\033]4;228;rgb:f2/e5/bc\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;230;rgb:f9/f5/d7\007\033\\"
|
|
||||||
|
|
||||||
printf "\033Ptmux;\033\033]4;229;rgb:fb/f1/c7\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;223;rgb:eb/db/b2\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;250;rgb:d5/c4/a1\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;248;rgb:bd/ae/93\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;246;rgb:a8/99/84\007\033\\"
|
|
||||||
|
|
||||||
printf "\033Ptmux;\033\033]4;167;rgb:fb/49/34\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;142;rgb:b8/bb/26\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;214;rgb:fa/bd/2f\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;109;rgb:83/a5/98\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;175;rgb:d3/86/9b\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;108;rgb:8e/c0/7c\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;208;rgb:fe/80/19\007\033\\"
|
|
||||||
|
|
||||||
printf "\033Ptmux;\033\033]4;88;rgb:9d/00/06\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;100;rgb:79/74/0e\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;136;rgb:b5/76/14\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;24;rgb:07/66/78\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;96;rgb:8f/3f/71\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;66;rgb:42/7b/58\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;130;rgb:af/3a/03\007\033\\"
|
|
||||||
else
|
|
||||||
printf "\033P\033]4;236;rgb:32/30/2f\007\033\\"
|
|
||||||
printf "\033P\033]4;234;rgb:1d/20/21\007\033\\"
|
|
||||||
|
|
||||||
printf "\033P\033]4;235;rgb:28/28/28\007\033\\"
|
|
||||||
printf "\033P\033]4;237;rgb:3c/38/36\007\033\\"
|
|
||||||
printf "\033P\033]4;239;rgb:50/49/45\007\033\\"
|
|
||||||
printf "\033P\033]4;241;rgb:66/5c/54\007\033\\"
|
|
||||||
printf "\033P\033]4;243;rgb:7c/6f/64\007\033\\"
|
|
||||||
|
|
||||||
printf "\033P\033]4;244;rgb:92/83/74\007\033\\"
|
|
||||||
printf "\033P\033]4;245;rgb:92/83/74\007\033\\"
|
|
||||||
|
|
||||||
printf "\033P\033]4;228;rgb:f2/e5/bc\007\033\\"
|
|
||||||
printf "\033P\033]4;230;rgb:f9/f5/d7\007\033\\"
|
|
||||||
|
|
||||||
printf "\033P\033]4;229;rgb:fb/f1/c7\007\033\\"
|
|
||||||
printf "\033P\033]4;223;rgb:eb/db/b2\007\033\\"
|
|
||||||
printf "\033P\033]4;250;rgb:d5/c4/a1\007\033\\"
|
|
||||||
printf "\033P\033]4;248;rgb:bd/ae/93\007\033\\"
|
|
||||||
printf "\033P\033]4;246;rgb:a8/99/84\007\033\\"
|
|
||||||
|
|
||||||
printf "\033P\033]4;167;rgb:fb/49/34\007\033\\"
|
|
||||||
printf "\033P\033]4;142;rgb:b8/bb/26\007\033\\"
|
|
||||||
printf "\033P\033]4;214;rgb:fa/bd/2f\007\033\\"
|
|
||||||
printf "\033P\033]4;109;rgb:83/a5/98\007\033\\"
|
|
||||||
printf "\033P\033]4;175;rgb:d3/86/9b\007\033\\"
|
|
||||||
printf "\033P\033]4;108;rgb:8e/c0/7c\007\033\\"
|
|
||||||
printf "\033P\033]4;208;rgb:fe/80/19\007\033\\"
|
|
||||||
|
|
||||||
printf "\033P\033]4;88;rgb:9d/00/06\007\033\\"
|
|
||||||
printf "\033P\033]4;100;rgb:79/74/0e\007\033\\"
|
|
||||||
printf "\033P\033]4;136;rgb:b5/76/14\007\033\\"
|
|
||||||
printf "\033P\033]4;24;rgb:07/66/78\007\033\\"
|
|
||||||
printf "\033P\033]4;96;rgb:8f/3f/71\007\033\\"
|
|
||||||
printf "\033P\033]4;66;rgb:42/7b/58\007\033\\"
|
|
||||||
printf "\033P\033]4;130;rgb:af/3a/03\007\033\\"
|
|
||||||
fi
|
|
||||||
|
|
||||||
elif [ "$TERM" != "linux" ] && [ "$TERM" != "vt100" ] && [ "$TERM" != "vt220" ]; then
|
|
||||||
|
|
||||||
printf "\033]4;236;rgb:32/30/2f\033\\"
|
|
||||||
printf "\033]4;234;rgb:1d/20/21\033\\"
|
|
||||||
|
|
||||||
printf "\033]4;235;rgb:28/28/28\033\\"
|
|
||||||
printf "\033]4;237;rgb:3c/38/36\033\\"
|
|
||||||
printf "\033]4;239;rgb:50/49/45\033\\"
|
|
||||||
printf "\033]4;241;rgb:66/5c/54\033\\"
|
|
||||||
printf "\033]4;243;rgb:7c/6f/64\033\\"
|
|
||||||
|
|
||||||
printf "\033]4;244;rgb:92/83/74\033\\"
|
|
||||||
printf "\033]4;245;rgb:92/83/74\033\\"
|
|
||||||
|
|
||||||
printf "\033]4;228;rgb:f2/e5/bc\033\\"
|
|
||||||
printf "\033]4;230;rgb:f9/f5/d7\033\\"
|
|
||||||
|
|
||||||
printf "\033]4;229;rgb:fb/f1/c7\033\\"
|
|
||||||
printf "\033]4;223;rgb:eb/db/b2\033\\"
|
|
||||||
printf "\033]4;250;rgb:d5/c4/a1\033\\"
|
|
||||||
printf "\033]4;248;rgb:bd/ae/93\033\\"
|
|
||||||
printf "\033]4;246;rgb:a8/99/84\033\\"
|
|
||||||
|
|
||||||
printf "\033]4;167;rgb:fb/49/34\033\\"
|
|
||||||
printf "\033]4;142;rgb:b8/bb/26\033\\"
|
|
||||||
printf "\033]4;214;rgb:fa/bd/2f\033\\"
|
|
||||||
printf "\033]4;109;rgb:83/a5/98\033\\"
|
|
||||||
printf "\033]4;175;rgb:d3/86/9b\033\\"
|
|
||||||
printf "\033]4;108;rgb:8e/c0/7c\033\\"
|
|
||||||
printf "\033]4;208;rgb:fe/80/19\033\\"
|
|
||||||
|
|
||||||
printf "\033]4;88;rgb:9d/00/06\033\\"
|
|
||||||
printf "\033]4;100;rgb:79/74/0e\033\\"
|
|
||||||
printf "\033]4;136;rgb:b5/76/14\033\\"
|
|
||||||
printf "\033]4;24;rgb:07/66/78\033\\"
|
|
||||||
printf "\033]4;96;rgb:8f/3f/71\033\\"
|
|
||||||
printf "\033]4;66;rgb:42/7b/58\033\\"
|
|
||||||
printf "\033]4;130;rgb:af/3a/03\033\\"
|
|
||||||
fi
|
|
@ -1,116 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ "${TERM%%-*}" = "screen" ]; then
|
|
||||||
if [ -n "$TMUX" ]; then
|
|
||||||
printf "\033Ptmux;\033\033]4;236;rgb:26/24/23\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;234;rgb:16/18/19\007\033\\"
|
|
||||||
|
|
||||||
printf "\033Ptmux;\033\033]4;235;rgb:1e/1e/1e\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;237;rgb:2e/2a/29\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;239;rgb:3f/39/35\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;241;rgb:53/4a/42\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;243;rgb:68/5c/51\007\033\\"
|
|
||||||
|
|
||||||
printf "\033Ptmux;\033\033]4;244;rgb:7f/70/61\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;245;rgb:7f/70/61\007\033\\"
|
|
||||||
|
|
||||||
printf "\033Ptmux;\033\033]4;228;rgb:ef/df/ae\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;230;rgb:f8/f4/cd\007\033\\"
|
|
||||||
|
|
||||||
printf "\033Ptmux;\033\033]4;229;rgb:fa/ee/bb\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;223;rgb:e6/d4/a3\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;250;rgb:cb/b8/90\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;248;rgb:af/9f/81\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;246;rgb:97/87/71\007\033\\"
|
|
||||||
|
|
||||||
printf "\033Ptmux;\033\033]4;167;rgb:f7/30/28\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;142;rgb:aa/b0/1e\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;214;rgb:f7/b1/25\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;109;rgb:71/95/86\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;175;rgb:c7/70/89\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;108;rgb:7d/b6/69\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;208;rgb:fb/6a/16\007\033\\"
|
|
||||||
|
|
||||||
printf "\033Ptmux;\033\033]4;88;rgb:89/00/09\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;100;rgb:66/62/0d\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;136;rgb:a5/63/11\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;24;rgb:0e/53/65\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;96;rgb:7b/2b/5e\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;66;rgb:35/6a/46\007\033\\"
|
|
||||||
printf "\033Ptmux;\033\033]4;130;rgb:9d/28/07\007\033\\"
|
|
||||||
else
|
|
||||||
printf "\033P\033]4;236;rgb:26/24/23\007\033\\"
|
|
||||||
printf "\033P\033]4;234;rgb:16/18/19\007\033\\"
|
|
||||||
|
|
||||||
printf "\033P\033]4;235;rgb:1e/1e/1e\007\033\\"
|
|
||||||
printf "\033P\033]4;237;rgb:2e/2a/29\007\033\\"
|
|
||||||
printf "\033P\033]4;239;rgb:3f/39/35\007\033\\"
|
|
||||||
printf "\033P\033]4;241;rgb:53/4a/42\007\033\\"
|
|
||||||
printf "\033P\033]4;243;rgb:68/5c/51\007\033\\"
|
|
||||||
|
|
||||||
printf "\033P\033]4;244;rgb:7f/70/61\007\033\\"
|
|
||||||
printf "\033P\033]4;245;rgb:7f/70/61\007\033\\"
|
|
||||||
|
|
||||||
printf "\033P\033]4;228;rgb:ef/df/ae\007\033\\"
|
|
||||||
printf "\033P\033]4;230;rgb:f8/f4/cd\007\033\\"
|
|
||||||
|
|
||||||
printf "\033P\033]4;229;rgb:fa/ee/bb\007\033\\"
|
|
||||||
printf "\033P\033]4;223;rgb:e6/d4/a3\007\033\\"
|
|
||||||
printf "\033P\033]4;250;rgb:cb/b8/90\007\033\\"
|
|
||||||
printf "\033P\033]4;248;rgb:af/9f/81\007\033\\"
|
|
||||||
printf "\033P\033]4;246;rgb:97/87/71\007\033\\"
|
|
||||||
|
|
||||||
printf "\033P\033]4;167;rgb:f7/30/28\007\033\\"
|
|
||||||
printf "\033P\033]4;142;rgb:aa/b0/1e\007\033\\"
|
|
||||||
printf "\033P\033]4;214;rgb:f7/b1/25\007\033\\"
|
|
||||||
printf "\033P\033]4;109;rgb:71/95/86\007\033\\"
|
|
||||||
printf "\033P\033]4;175;rgb:c7/70/89\007\033\\"
|
|
||||||
printf "\033P\033]4;108;rgb:7d/b6/69\007\033\\"
|
|
||||||
printf "\033P\033]4;208;rgb:fb/6a/16\007\033\\"
|
|
||||||
|
|
||||||
printf "\033P\033]4;88;rgb:89/00/09\007\033\\"
|
|
||||||
printf "\033P\033]4;100;rgb:66/62/0d\007\033\\"
|
|
||||||
printf "\033P\033]4;136;rgb:a5/63/11\007\033\\"
|
|
||||||
printf "\033P\033]4;24;rgb:0e/53/65\007\033\\"
|
|
||||||
printf "\033P\033]4;96;rgb:7b/2b/5e\007\033\\"
|
|
||||||
printf "\033P\033]4;66;rgb:35/6a/46\007\033\\"
|
|
||||||
printf "\033P\033]4;130;rgb:9d/28/07\007\033\\"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
printf "\033]4;236;rgb:26/24/23\033\\"
|
|
||||||
printf "\033]4;234;rgb:16/18/19\033\\"
|
|
||||||
|
|
||||||
printf "\033]4;235;rgb:1e/1e/1e\033\\"
|
|
||||||
printf "\033]4;237;rgb:2e/2a/29\033\\"
|
|
||||||
printf "\033]4;239;rgb:3f/39/35\033\\"
|
|
||||||
printf "\033]4;241;rgb:53/4a/42\033\\"
|
|
||||||
printf "\033]4;243;rgb:68/5c/51\033\\"
|
|
||||||
|
|
||||||
printf "\033]4;244;rgb:7f/70/61\033\\"
|
|
||||||
printf "\033]4;245;rgb:7f/70/61\033\\"
|
|
||||||
|
|
||||||
printf "\033]4;228;rgb:ef/df/ae\033\\"
|
|
||||||
printf "\033]4;230;rgb:f8/f4/cd\033\\"
|
|
||||||
|
|
||||||
printf "\033]4;229;rgb:fa/ee/bb\033\\"
|
|
||||||
printf "\033]4;223;rgb:e6/d4/a3\033\\"
|
|
||||||
printf "\033]4;250;rgb:cb/b8/90\033\\"
|
|
||||||
printf "\033]4;248;rgb:af/9f/81\033\\"
|
|
||||||
printf "\033]4;246;rgb:97/87/71\033\\"
|
|
||||||
|
|
||||||
printf "\033]4;167;rgb:f7/30/28\033\\"
|
|
||||||
printf "\033]4;142;rgb:aa/b0/1e\033\\"
|
|
||||||
printf "\033]4;214;rgb:f7/b1/25\033\\"
|
|
||||||
printf "\033]4;109;rgb:71/95/86\033\\"
|
|
||||||
printf "\033]4;175;rgb:c7/70/89\033\\"
|
|
||||||
printf "\033]4;108;rgb:7d/b6/69\033\\"
|
|
||||||
printf "\033]4;208;rgb:fb/6a/16\033\\"
|
|
||||||
|
|
||||||
printf "\033]4;88;rgb:89/00/09\033\\"
|
|
||||||
printf "\033]4;100;rgb:66/62/0d\033\\"
|
|
||||||
printf "\033]4;136;rgb:a5/63/11\033\\"
|
|
||||||
printf "\033]4;24;rgb:0e/53/65\033\\"
|
|
||||||
printf "\033]4;96;rgb:7b/2b/5e\033\\"
|
|
||||||
printf "\033]4;66;rgb:35/6a/46\033\\"
|
|
||||||
printf "\033]4;130;rgb:9d/28/07\033\\"
|
|
||||||
fi
|
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "gruvbox",
|
|
||||||
"version": "2.0.0",
|
|
||||||
"repository": "git@github.com:morhetz/gruvbox.git",
|
|
||||||
"author": "Pavel Pertsev <morhetz@gmail.com>",
|
|
||||||
"license": "MIT",
|
|
||||||
"vim": {
|
|
||||||
"opt": true
|
|
||||||
}
|
|
||||||
}
|
|
1
sources_non_forked/lightline.vim/.gitignore
vendored
1
sources_non_forked/lightline.vim/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/doc/tags
|
|
@ -1,28 +0,0 @@
|
|||||||
language: generic
|
|
||||||
|
|
||||||
sudo: false
|
|
||||||
|
|
||||||
install:
|
|
||||||
- git clone --depth=1 https://github.com/thinca/vim-themis /tmp/themis
|
|
||||||
- (if ! test -d $HOME/vim-$VIM_VERSION/bin; then
|
|
||||||
git clone https://github.com/vim/vim $HOME/vim &&
|
|
||||||
cd $HOME/vim &&
|
|
||||||
git checkout v$VIM_VERSION &&
|
|
||||||
./configure --prefix=$HOME/vim-$VIM_VERSION &&
|
|
||||||
make &&
|
|
||||||
make install;
|
|
||||||
fi)
|
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- $HOME/vim-$VIM_VERSION
|
|
||||||
|
|
||||||
env:
|
|
||||||
- VIM_VERSION=8.0.0000
|
|
||||||
- VIM_VERSION=7.4
|
|
||||||
- VIM_VERSION=7.3
|
|
||||||
|
|
||||||
script:
|
|
||||||
- export PATH=$HOME/vim-$VIM_VERSION/bin:$PATH
|
|
||||||
- vim --version
|
|
||||||
- /tmp/themis/bin/themis --reporter spec
|
|
@ -1,21 +0,0 @@
|
|||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2013-2017 itchyny
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
@ -1,393 +0,0 @@
|
|||||||
# lightline.vim
|
|
||||||
A light and configurable statusline/tabline plugin for Vim
|
|
||||||
|
|
||||||
https://github.com/itchyny/lightline.vim
|
|
||||||
|
|
||||||
### powerline (default)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### wombat
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### jellybeans
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### solarized dark
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### solarized light
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### PaperColor light
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### seoul256
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### Dracula
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### one
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### landscape
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
landscape is my colorscheme, which is a high-contrast cui-supported colorscheme, available at https://github.com/itchyny/landscape.vim
|
|
||||||
|
|
||||||
## Why yet another clone of powerline?
|
|
||||||
+ [vim-powerline](https://github.com/Lokaltog/vim-powerline) is a nice plugin, but deprecated.
|
|
||||||
+ [powerline](https://github.com/powerline/powerline) is a nice plugin, but difficult to configure.
|
|
||||||
+ [vim-airline](https://github.com/vim-airline/vim-airline) is a nice plugin, but it uses too much functions of other plugins, which should be done by users in `.vimrc`.
|
|
||||||
|
|
||||||
## Spirit of this plugin
|
|
||||||
+ Minimalism. The core script is very small to achive enough functions as a statusline plugin.
|
|
||||||
+ Configurability. You can create your own component and easily add to the statusline and the tabline.
|
|
||||||
+ Orthogonality. The plugin does not rely on the implementation of other plugins. Such plugin crossing settings should be configured by users.
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
### [Pathogen](https://github.com/tpope/vim-pathogen)
|
|
||||||
1. Install with the following command.
|
|
||||||
|
|
||||||
git clone https://github.com/itchyny/lightline.vim ~/.vim/bundle/lightline.vim
|
|
||||||
|
|
||||||
### [Vundle](https://github.com/VundleVim/Vundle.vim)
|
|
||||||
1. Add the following configuration to your `.vimrc`.
|
|
||||||
|
|
||||||
Plugin 'itchyny/lightline.vim'
|
|
||||||
|
|
||||||
2. Install with `:PluginInstall`.
|
|
||||||
|
|
||||||
### [NeoBundle](https://github.com/Shougo/neobundle.vim)
|
|
||||||
1. Add the following configuration to your `.vimrc`.
|
|
||||||
|
|
||||||
NeoBundle 'itchyny/lightline.vim'
|
|
||||||
|
|
||||||
2. Install with `:NeoBundleInstall`.
|
|
||||||
|
|
||||||
### [vim-plug](https://github.com/junegunn/vim-plug)
|
|
||||||
1. Add the following configuration to your `.vimrc`.
|
|
||||||
|
|
||||||
Plug 'itchyny/lightline.vim'
|
|
||||||
|
|
||||||
2. Install with `:PlugInstall`.
|
|
||||||
|
|
||||||
## Introduction
|
|
||||||
After installing this plugin, you restart the editor and will get a cool statusline.
|
|
||||||

|
|
||||||
|
|
||||||
The color of the statusline changes due to the mode of Vim. Try typing something, selecting in visual mode and replacing some texts.
|
|
||||||
|
|
||||||
If the statusline looks like
|
|
||||||

|
|
||||||
|
|
||||||
add the following configuration to your `.vimrc`.
|
|
||||||
```vim
|
|
||||||
set laststatus=2
|
|
||||||
```
|
|
||||||
|
|
||||||
If the statusline does not be coloured like
|
|
||||||

|
|
||||||
|
|
||||||
then modify `TERM` in your shell configuration (`.zshrc` for example)
|
|
||||||
```sh
|
|
||||||
export TERM=xterm-256color
|
|
||||||
```
|
|
||||||
and then add the following configure to your `.vimrc`.
|
|
||||||
```vim
|
|
||||||
if !has('gui_running')
|
|
||||||
set t_Co=256
|
|
||||||
endif
|
|
||||||
```
|
|
||||||
|
|
||||||
Your statusline appears to work correctly? If yes, great, thanks for choosing lightline.vim! If no, please file a issue report to the [issue tracker](https://github.com/itchyny/lightline.vim/issues).
|
|
||||||
|
|
||||||
By the way, `-- INSERT --` is unnecessary anymore because the mode information is displayed in the statusline.
|
|
||||||

|
|
||||||
If you want to get rid of it, configure as follows.
|
|
||||||
```vim
|
|
||||||
set noshowmode
|
|
||||||
```
|
|
||||||
|
|
||||||
## Colorscheme configuration
|
|
||||||
The lightline.vim plugin provides multiple colorschemes to meet your editor colorscheme.
|
|
||||||
Do not be confused, editor colorscheme rules how codes look like in buffers and lightline.vim has independent colorscheme feature, which rules how the statusline looks like.
|
|
||||||
|
|
||||||
If you are using wombat colorscheme, add the following setting to your `.vimrc`,
|
|
||||||
```vim
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'colorscheme': 'wombat',
|
|
||||||
\ }
|
|
||||||
```
|
|
||||||
restart Vim and the statusline looks like:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
If the colors of the statusline do not change, move the settings of `g:lightline` before setting the editor colorscheme.
|
|
||||||
|
|
||||||
There are many lightline colorschemes available as screenshots shown above. See `:h g:lightline.colorscheme` for the complete list.
|
|
||||||
|
|
||||||
## Advanced configuration
|
|
||||||
The default appearance of lightline.vim is carefully designed that the tutorial is enough here for most people.
|
|
||||||
So please read this section if you really want to configure and enjoy the configurability of lightline.vim.
|
|
||||||
|
|
||||||
Sometimes people want to display information of other plugins.
|
|
||||||
For example git branch information, syntax check errors and some statuses of plugins.
|
|
||||||
|
|
||||||
The lightline.vim plugin does not provide any plugin integration by default.
|
|
||||||
This plugin considers orthogonality to be one of the important ideas, which means that the plugin does not rely on implementation of other plugins.
|
|
||||||
Once a plugin starts to integrate with some famous plugins, it should be kept updated to follow the changes of the plugins, and should accept integration requests with new plugins and it will suffer from performance regression due to plugin availability checks.
|
|
||||||
|
|
||||||
Instead, lightline.vim provides a simple API that user can easily integrate with other plugins.
|
|
||||||
Once you understand how to configure and how it will be displayed in the statusline, you can also tell how to integrate with your favorite plugins.
|
|
||||||
|
|
||||||
Let's start to configure the appearance.
|
|
||||||
The statusline is composed by multiple components.
|
|
||||||
It shows the current mode, filename, modified status on the left, and file format, encoding, filetype and cursor positions on the right.
|
|
||||||
So in order to add something in the statusline, you firstly create a new component and specify the place.
|
|
||||||
|
|
||||||
This is the hello world of lightline.vim component.
|
|
||||||
```vim
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'colorscheme': 'wombat',
|
|
||||||
\ 'active': {
|
|
||||||
\ 'left': [ [ 'mode', 'paste' ],
|
|
||||||
\ [ 'readonly', 'filename', 'modified', 'helloworld' ] ]
|
|
||||||
\ },
|
|
||||||
\ 'component': {
|
|
||||||
\ 'helloworld': 'Hello, world!'
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
```
|
|
||||||
The statusline will look like:
|
|
||||||

|
|
||||||
|
|
||||||
You have succeeded in displaying `Hello, world!` in the statusline.
|
|
||||||
The `helloworld` component is added to `g:lightline.active.left` and its content is configured in `g:lightline.component`.
|
|
||||||
The component contents are simply added to `&statusline`.
|
|
||||||
Try `:echo &statusline`, it might be a little bit complicated, but you will find `Hello, world!` somewhere.
|
|
||||||
|
|
||||||
You can use `'statusline'` syntax for lightline.vim components.
|
|
||||||
Consult `:h 'statusline'` to see what's available here.
|
|
||||||
For example, if you want to print the value of character under the cursor in hexadecimal, configure as
|
|
||||||
```vim
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'colorscheme': 'wombat',
|
|
||||||
\ 'active': {
|
|
||||||
\ 'left': [ [ 'mode', 'paste' ],
|
|
||||||
\ [ 'readonly', 'filename', 'modified', 'charvaluehex' ] ]
|
|
||||||
\ },
|
|
||||||
\ 'component': {
|
|
||||||
\ 'charvaluehex': '0x%B'
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
You want the character value information on the right hand side? OK, configure as
|
|
||||||
```vim
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'colorscheme': 'wombat',
|
|
||||||
\ 'active': {
|
|
||||||
\ 'right': [ [ 'lineinfo' ],
|
|
||||||
\ [ 'percent' ],
|
|
||||||
\ [ 'fileformat', 'fileencoding', 'filetype', 'charvaluehex' ] ]
|
|
||||||
\ },
|
|
||||||
\ 'component': {
|
|
||||||
\ 'charvaluehex': '0x%B'
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
We have learned how to add a simple component.
|
|
||||||
|
|
||||||
- See `:h 'statusline'` to check the statusline flags.
|
|
||||||
- Add a new component to `g:lightline.component`.
|
|
||||||
- Add the component name to `g:lightline.active.left` or `g:lightline.active.right`.
|
|
||||||
|
|
||||||
You can also configure the statusline of inactive buffers by adding the component to `g:lightline.inactive.left` or `g:lightline.inactive.right`.
|
|
||||||
|
|
||||||
|
|
||||||
Now let's add some integrations with other plugin.
|
|
||||||
The name of the git branch is important these days.
|
|
||||||
But lightline.vim does not provide this information by default because it is also one of plugin crossing configurations, and not all people want the integration.
|
|
||||||
|
|
||||||
In order to show the branch name in the statusline, install some plugins which provides the branch information.
|
|
||||||
The [vim-fugitive](https://github.com/tpope/vim-fugitive) plugin is a famous plugin so let's integrate lightline.vim with it.
|
|
||||||
If you don't like to install full git integration but just want to display the branch name in the statusline, you can use the [vim-gitbranch](https://github.com/itchyny/vim-gitbranch) plugin which provides `gitbranch#name` function.
|
|
||||||
```vim
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'colorscheme': 'wombat',
|
|
||||||
\ 'active': {
|
|
||||||
\ 'left': [ [ 'mode', 'paste' ],
|
|
||||||
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
|
|
||||||
\ },
|
|
||||||
\ 'component_function': {
|
|
||||||
\ 'gitbranch': 'fugitive#head'
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
Okay, now the statusline shows that we are coding at the master branch.
|
|
||||||
What do we learn from this example?
|
|
||||||
|
|
||||||
- Find out the function which is suitable to use in the statusline.
|
|
||||||
- Create a function component. The previous `charvaluehex` component has `'statusline'` item configuration and registered in `g:lightline.component`. In the current example, we register the name of the function in `g:lightline.component_function`. It should return the string to be displayed in the statusline.
|
|
||||||
- Add the component name `gitbranch` to `g:lightline.active.left` or `g:lightline.active.right`.
|
|
||||||
|
|
||||||
|
|
||||||
Here we have leaned two kinds of components.
|
|
||||||
|
|
||||||
- component: it has a `%`-prefixed item which you can find the meaning at `:h 'statusline'`. All the default components of lightline.vim are components in this style. See the default components at `:h g:lightline.component`.
|
|
||||||
- function component: the name of functions are registered. The function is called again and again so be careful not to register a heavy function. See the help with `:h g:lightline.component_function`.
|
|
||||||
|
|
||||||
|
|
||||||
The function component is an important design for the configurability of lightline.vim.
|
|
||||||
By providing the configuration interface via functions, you can adjust the statusline information as you wish.
|
|
||||||
For the proof, let's look into some configuration examples in Q&A style.
|
|
||||||
|
|
||||||
### Can I hide the readonly component in the help buffer?
|
|
||||||
Yes, create a function component for `readonly`.
|
|
||||||
The configuration of function component has priority over the default component.
|
|
||||||
```vim
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'component_function': {
|
|
||||||
\ 'readonly': 'LightlineReadonly',
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
|
|
||||||
function! LightlineReadonly()
|
|
||||||
return &readonly && &filetype !=# 'help' ? 'RO' : ''
|
|
||||||
endfunction
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
### Can I hide the readonly component in other plugins buffer?
|
|
||||||
Yes, modify the `LightlineReadonly` function as you wish.
|
|
||||||
```vim
|
|
||||||
function! LightlineReadonly()
|
|
||||||
return &readonly && &filetype !~# '\v(help|vimfiler|unite)' ? 'RO' : ''
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let g:unite_force_overwrite_statusline = 0
|
|
||||||
let g:vimfiler_force_overwrite_statusline = 0
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
### Can I display the plugin information at the filename component?
|
|
||||||
Yes, overwrite the filename component.
|
|
||||||
```vim
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'component_function': {
|
|
||||||
\ 'filename': 'LightlineFilename',
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
|
|
||||||
function! LightlineFilename()
|
|
||||||
return &filetype ==# 'vimfiler' ? vimfiler#get_status_string() :
|
|
||||||
\ &filetype ==# 'unite' ? unite#get_status_string() :
|
|
||||||
\ &filetype ==# 'vimshell' ? vimshell#get_status_string() :
|
|
||||||
\ expand('%:t') !=# '' ? expand('%:t') : '[No Name]'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let g:unite_force_overwrite_statusline = 0
|
|
||||||
let g:vimfiler_force_overwrite_statusline = 0
|
|
||||||
let g:vimshell_force_overwrite_statusline = 0
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
### Can I display the plugin name at the mode component?
|
|
||||||
Yes, overwrite the mode component.
|
|
||||||
```vim
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'component_function': {
|
|
||||||
\ 'mode': 'LightlineMode',
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
|
|
||||||
function! LightlineMode()
|
|
||||||
return expand('%:t') ==# '__Tagbar__' ? 'Tagbar':
|
|
||||||
\ expand('%:t') ==# 'ControlP' ? 'CtrlP' :
|
|
||||||
\ &filetype ==# 'unite' ? 'Unite' :
|
|
||||||
\ &filetype ==# 'vimfiler' ? 'VimFiler' :
|
|
||||||
\ &filetype ==# 'vimshell' ? 'VimShell' :
|
|
||||||
\ lightline#mode()
|
|
||||||
endfunction
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
### Can I trim the file format and encoding information on narrow windows?
|
|
||||||
Yes, check `winwidth(0)` and return empty string with some threshold.
|
|
||||||
```vim
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'component_function': {
|
|
||||||
\ 'fileformat': 'LightlineFileformat',
|
|
||||||
\ 'filetype': 'LightlineFiletype',
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
|
|
||||||
function! LightlineFileformat()
|
|
||||||
return winwidth(0) > 70 ? &fileformat : ''
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! LightlineFiletype()
|
|
||||||
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
|
|
||||||
endfunction
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
### Can I trim the bar between the filename and modified sign?
|
|
||||||
Yes, by joining the two components.
|
|
||||||
```vim
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'active': {
|
|
||||||
\ 'left': [ [ 'mode', 'paste' ],
|
|
||||||
\ [ 'readonly', 'filename' ] ],
|
|
||||||
\ },
|
|
||||||
\ 'component_function': {
|
|
||||||
\ 'filename': 'LightlineFilename',
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
|
|
||||||
function! LightlineFilename()
|
|
||||||
let filename = expand('%:t') !=# '' ? expand('%:t') : '[No Name]'
|
|
||||||
let modified = &modified ? ' +' : ''
|
|
||||||
return filename . modified
|
|
||||||
endfunction
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
You can control the visibility and contents by writing simple functions.
|
|
||||||
Now you notice how much function component is important for the configurability of lightline.vim.
|
|
||||||
|
|
||||||
## Note for developers of other plugins
|
|
||||||
Appearance consistency matters.
|
|
||||||
|
|
||||||
The statusline is an important space for Vim users.
|
|
||||||
Overwriting the statusline forcibly in your plugin is not a good idea.
|
|
||||||
It is not hospitality, but just an annoying feature.
|
|
||||||
If your plugin has such a feature, add an option to be modest.
|
|
||||||
|
|
||||||
A good design is as follows.
|
|
||||||
Firstly, give the users a clue to judge which buffer is the one your plugin creates.
|
|
||||||
The filename is a manner and the filetype is another.
|
|
||||||
Then, export a function which is useful to be shown in the statusline.
|
|
||||||
Lastly, for advanced users, set important information in buffer variables so that the users can obtain the condition of the plugin easily.
|
|
||||||
|
|
||||||
## Author
|
|
||||||
itchyny (https://github.com/itchyny)
|
|
||||||
|
|
||||||
## License
|
|
||||||
This software is released under the MIT License, see LICENSE.
|
|
@ -1,489 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2017/11/11 13:29:26.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
let s:_ = 1
|
|
||||||
|
|
||||||
function! lightline#update() abort
|
|
||||||
if s:_
|
|
||||||
call lightline#init()
|
|
||||||
call lightline#colorscheme()
|
|
||||||
endif
|
|
||||||
if !s:lightline.enable.statusline
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
let w = winnr()
|
|
||||||
let s = winnr('$') == 1 ? [lightline#statusline(0)] : [lightline#statusline(0), lightline#statusline(1)]
|
|
||||||
for n in range(1, winnr('$'))
|
|
||||||
call setwinvar(n, '&statusline', s[n!=w])
|
|
||||||
call setwinvar(n, 'lightline', n!=w)
|
|
||||||
endfor
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#update_once() abort
|
|
||||||
if !exists('w:lightline') || w:lightline
|
|
||||||
call lightline#update()
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#update_disable() abort
|
|
||||||
if !s:lightline.enable.statusline
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
call setwinvar(0, '&statusline', '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#enable() abort
|
|
||||||
call lightline#colorscheme()
|
|
||||||
call lightline#update()
|
|
||||||
if s:lightline.enable.tabline
|
|
||||||
set tabline=%!lightline#tabline()
|
|
||||||
endif
|
|
||||||
augroup lightline
|
|
||||||
autocmd!
|
|
||||||
autocmd WinEnter,BufWinEnter,FileType,ColorScheme,SessionLoadPost * call lightline#update()
|
|
||||||
autocmd ColorScheme,SessionLoadPost * call lightline#highlight()
|
|
||||||
autocmd CursorMoved,BufUnload * call lightline#update_once()
|
|
||||||
augroup END
|
|
||||||
augroup lightline-disable
|
|
||||||
autocmd!
|
|
||||||
augroup END
|
|
||||||
augroup! lightline-disable
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#disable() abort
|
|
||||||
let [&statusline, &tabline] = [get(s:, '_statusline', ''), get(s:, '_tabline', '')]
|
|
||||||
for t in range(1, tabpagenr('$'))
|
|
||||||
for n in range(1, tabpagewinnr(t, '$'))
|
|
||||||
call settabwinvar(t, n, '&statusline', '')
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
augroup lightline
|
|
||||||
autocmd!
|
|
||||||
augroup END
|
|
||||||
augroup! lightline
|
|
||||||
augroup lightline-disable
|
|
||||||
autocmd!
|
|
||||||
autocmd WinEnter * call lightline#update_disable()
|
|
||||||
augroup END
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#toggle() abort
|
|
||||||
if exists('#lightline')
|
|
||||||
call lightline#disable()
|
|
||||||
else
|
|
||||||
call lightline#enable()
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let s:_lightline = {
|
|
||||||
\ 'active': {
|
|
||||||
\ 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'filename', 'modified' ] ],
|
|
||||||
\ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
|
||||||
\ },
|
|
||||||
\ 'inactive': {
|
|
||||||
\ 'left': [ [ 'filename' ] ],
|
|
||||||
\ 'right': [ [ 'lineinfo' ], [ 'percent' ] ]
|
|
||||||
\ },
|
|
||||||
\ 'tabline': {
|
|
||||||
\ 'left': [ [ 'tabs' ] ],
|
|
||||||
\ 'right': [ [ 'close' ] ]
|
|
||||||
\ },
|
|
||||||
\ 'tab': {
|
|
||||||
\ 'active': [ 'tabnum', 'filename', 'modified' ],
|
|
||||||
\ 'inactive': [ 'tabnum', 'filename', 'modified' ]
|
|
||||||
\ },
|
|
||||||
\ 'component': {
|
|
||||||
\ 'mode': '%{lightline#mode()}',
|
|
||||||
\ 'absolutepath': '%F', 'relativepath': '%f', 'filename': '%t', 'modified': '%M', 'bufnum': '%n',
|
|
||||||
\ 'paste': '%{&paste?"PASTE":""}', 'readonly': '%R', 'charvalue': '%b', 'charvaluehex': '%B',
|
|
||||||
\ 'spell': '%{&spell?&spelllang:""}', 'fileencoding': '%{&fenc!=#""?&fenc:&enc}', 'fileformat': '%{&ff}',
|
|
||||||
\ 'filetype': '%{&ft!=#""?&ft:"no ft"}', 'percent': '%3p%%', 'percentwin': '%P',
|
|
||||||
\ 'lineinfo': '%3l:%-2v', 'line': '%l', 'column': '%c', 'close': '%999X X ', 'winnr': '%{winnr()}'
|
|
||||||
\ },
|
|
||||||
\ 'component_visible_condition': {
|
|
||||||
\ 'modified': '&modified||!&modifiable', 'readonly': '&readonly', 'paste': '&paste', 'spell': '&spell'
|
|
||||||
\ },
|
|
||||||
\ 'component_function': {},
|
|
||||||
\ 'component_function_visible_condition': {},
|
|
||||||
\ 'component_expand': {
|
|
||||||
\ 'tabs': 'lightline#tabs'
|
|
||||||
\ },
|
|
||||||
\ 'component_type': {
|
|
||||||
\ 'tabs': 'tabsel', 'close': 'raw'
|
|
||||||
\ },
|
|
||||||
\ 'component_raw': {},
|
|
||||||
\ 'tab_component': {},
|
|
||||||
\ 'tab_component_function': {
|
|
||||||
\ 'filename': 'lightline#tab#filename', 'modified': 'lightline#tab#modified',
|
|
||||||
\ 'readonly': 'lightline#tab#readonly', 'tabnum': 'lightline#tab#tabnum'
|
|
||||||
\ },
|
|
||||||
\ 'colorscheme': 'default',
|
|
||||||
\ 'mode_map': {
|
|
||||||
\ 'n': 'NORMAL', 'i': 'INSERT', 'R': 'REPLACE', 'v': 'VISUAL', 'V': 'V-LINE', "\<C-v>": 'V-BLOCK',
|
|
||||||
\ 'c': 'COMMAND', 's': 'SELECT', 'S': 'S-LINE', "\<C-s>": 'S-BLOCK', 't': 'TERMINAL'
|
|
||||||
\ },
|
|
||||||
\ 'separator': { 'left': '', 'right': '' },
|
|
||||||
\ 'subseparator': { 'left': '|', 'right': '|' },
|
|
||||||
\ 'tabline_separator': {},
|
|
||||||
\ 'tabline_subseparator': {},
|
|
||||||
\ 'enable': { 'statusline': 1, 'tabline': 1 },
|
|
||||||
\ '_mode_': {
|
|
||||||
\ 'n': 'normal', 'i': 'insert', 'R': 'replace', 'v': 'visual', 'V': 'visual', "\<C-v>": 'visual',
|
|
||||||
\ 'c': 'command', 's': 'select', 'S': 'select', "\<C-s>": 'select', 't': 'terminal'
|
|
||||||
\ },
|
|
||||||
\ 'mode_fallback': { 'replace': 'insert', 'terminal': 'insert', 'select': 'visual' },
|
|
||||||
\ 'palette': {},
|
|
||||||
\ 'winwidth': winwidth(0),
|
|
||||||
\ }
|
|
||||||
function! lightline#init() abort
|
|
||||||
let s:lightline = deepcopy(get(g:, 'lightline', {}))
|
|
||||||
for [key, value] in items(s:_lightline)
|
|
||||||
if type(value) == 4
|
|
||||||
if !has_key(s:lightline, key)
|
|
||||||
let s:lightline[key] = {}
|
|
||||||
endif
|
|
||||||
call extend(s:lightline[key], value, 'keep')
|
|
||||||
elseif !has_key(s:lightline, key)
|
|
||||||
let s:lightline[key] = value
|
|
||||||
endif
|
|
||||||
unlet value
|
|
||||||
endfor
|
|
||||||
call extend(s:lightline.tabline_separator, s:lightline.separator, 'keep')
|
|
||||||
call extend(s:lightline.tabline_subseparator, s:lightline.subseparator, 'keep')
|
|
||||||
let s:lightline.tabline_configured = has_key(get(get(g:, 'lightline', {}), 'component_expand', {}), 'tabs')
|
|
||||||
for components in deepcopy(s:lightline.tabline.left + s:lightline.tabline.right)
|
|
||||||
if len(filter(components, 'v:val !=# "tabs" && v:val !=# "close"')) > 0
|
|
||||||
let s:lightline.tabline_configured = 1
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
if !exists('s:_statusline')
|
|
||||||
let s:_statusline = &statusline
|
|
||||||
endif
|
|
||||||
if !exists('s:_tabline')
|
|
||||||
let s:_tabline = &tabline
|
|
||||||
endif
|
|
||||||
if s:lightline.enable.tabline
|
|
||||||
set tabline=%!lightline#tabline()
|
|
||||||
else
|
|
||||||
let &tabline = get(s:, '_tabline', '')
|
|
||||||
endif
|
|
||||||
for f in values(s:lightline.component_function)
|
|
||||||
silent! call call(f, [])
|
|
||||||
endfor
|
|
||||||
for f in values(s:lightline.tab_component_function)
|
|
||||||
silent! call call(f, [1])
|
|
||||||
endfor
|
|
||||||
let s:mode = ''
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#colorscheme() abort
|
|
||||||
try
|
|
||||||
let s:lightline.palette = g:lightline#colorscheme#{s:lightline.colorscheme}#palette
|
|
||||||
catch
|
|
||||||
call lightline#error('Could not load colorscheme ' . s:lightline.colorscheme . '.')
|
|
||||||
let s:lightline.colorscheme = 'default'
|
|
||||||
let s:lightline.palette = g:lightline#colorscheme#{s:lightline.colorscheme}#palette
|
|
||||||
finally
|
|
||||||
if has('win32') && !has('gui_running') && &t_Co < 256
|
|
||||||
for u in values(s:lightline.palette)
|
|
||||||
for v in values(u)
|
|
||||||
for _ in v
|
|
||||||
let [_[2], _[3]] = [lightline#colortable#gui2cui(_[0], _[2]), lightline#colortable#gui2cui(_[1], _[3])]
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
endif
|
|
||||||
let s:highlight = {}
|
|
||||||
call lightline#highlight('normal')
|
|
||||||
call lightline#link()
|
|
||||||
let s:_ = 0
|
|
||||||
endtry
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#palette() abort
|
|
||||||
return s:lightline.palette
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#mode() abort
|
|
||||||
return get(s:lightline.mode_map, mode(), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let s:mode = ''
|
|
||||||
function! lightline#link(...) abort
|
|
||||||
let mode = get(s:lightline._mode_, a:0 ? a:1 : mode(), 'normal')
|
|
||||||
if s:mode == mode
|
|
||||||
return ''
|
|
||||||
endif
|
|
||||||
let s:mode = mode
|
|
||||||
if !has_key(s:highlight, mode)
|
|
||||||
call lightline#highlight(mode)
|
|
||||||
endif
|
|
||||||
let types = map(s:uniq(sort(filter(values(s:lightline.component_type), 'v:val !=# "raw"'))), '[v:val, 1]')
|
|
||||||
for [p, l] in [['Left', len(s:lightline.active.left)], ['Right', len(s:lightline.active.right)]]
|
|
||||||
for [i, t] in map(range(0, l), '[v:val, 0]') + types
|
|
||||||
if i != l
|
|
||||||
exec printf('hi link Lightline%s_active_%s Lightline%s_%s_%s', p, i, p, mode, i)
|
|
||||||
endif
|
|
||||||
for [j, s] in map(range(0, l), '[v:val, 0]') + types
|
|
||||||
if i + 1 == j || t || s && i != l
|
|
||||||
exec printf('hi link Lightline%s_active_%s_%s Lightline%s_%s_%s_%s', p, i, j, p, mode, i, j)
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
exec printf('hi link LightlineMiddle_active LightlineMiddle_%s', mode)
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:term(p) abort
|
|
||||||
return get(a:p, 4) !=# '' ? 'term='.a:p[4].' cterm='.a:p[4].' gui='.a:p[4] : ''
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
if exists('*uniq')
|
|
||||||
let s:uniq = function('uniq')
|
|
||||||
else
|
|
||||||
function! s:uniq(xs) abort
|
|
||||||
let i = len(a:xs) - 1
|
|
||||||
while i > 0
|
|
||||||
if a:xs[i] ==# a:xs[i - 1]
|
|
||||||
call remove(a:xs, i)
|
|
||||||
endif
|
|
||||||
let i -= 1
|
|
||||||
endwhile
|
|
||||||
return a:xs
|
|
||||||
endfunction
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! lightline#highlight(...) abort
|
|
||||||
let [c, f] = [s:lightline.palette, s:lightline.mode_fallback]
|
|
||||||
let [s:lightline.llen, s:lightline.rlen] = [len(c.normal.left), len(c.normal.right)]
|
|
||||||
let [s:lightline.tab_llen, s:lightline.tab_rlen] = [len(has_key(get(c, 'tabline', {}), 'left') ? c.tabline.left : c.normal.left), len(has_key(get(c, 'tabline', {}), 'right') ? c.tabline.right : c.normal.right)]
|
|
||||||
let types = map(s:uniq(sort(filter(values(s:lightline.component_type), 'v:val !=# "raw"'))), '[v:val, 1]')
|
|
||||||
let modes = a:0 ? [a:1] : extend(['normal', 'insert', 'replace', 'visual', 'inactive', 'command', 'select', 'tabline'], exists(':terminal') == 2 ? ['terminal'] : [])
|
|
||||||
for mode in modes
|
|
||||||
let s:highlight[mode] = 1
|
|
||||||
let d = has_key(c, mode) ? mode : has_key(f, mode) && has_key(c, f[mode]) ? f[mode] : 'normal'
|
|
||||||
let left = d ==# 'tabline' ? s:lightline.tabline.left : d ==# 'inactive' ? s:lightline.inactive.left : s:lightline.active.left
|
|
||||||
let right = d ==# 'tabline' ? s:lightline.tabline.right : d ==# 'inactive' ? s:lightline.inactive.right : s:lightline.active.right
|
|
||||||
let ls = has_key(get(c, d, {}), 'left') ? c[d].left : has_key(f, d) && has_key(get(c, f[d], {}), 'left') ? c[f[d]].left : c.normal.left
|
|
||||||
let ms = has_key(get(c, d, {}), 'middle') ? c[d].middle[0] : has_key(f, d) && has_key(get(c, f[d], {}), 'middle') ? c[f[d]].middle[0] : c.normal.middle[0]
|
|
||||||
let rs = has_key(get(c, d, {}), 'right') ? c[d].right : has_key(f, d) && has_key(get(c, f[d], {}), 'right') ? c[f[d]].right : c.normal.right
|
|
||||||
for [p, l, zs] in [['Left', len(left), ls], ['Right', len(right), rs]]
|
|
||||||
for [i, t] in map(range(0, l), '[v:val, 0]') + types
|
|
||||||
if i < l || i < 1
|
|
||||||
let r = t ? (has_key(get(c, d, []), i) ? c[d][i][0] : has_key(get(c, 'tabline', {}), i) ? c.tabline[i][0] : get(c.normal, i, zs)[0]) : get(zs, i, ms)
|
|
||||||
exec printf('hi Lightline%s_%s_%s guifg=%s guibg=%s ctermfg=%s ctermbg=%s %s', p, mode, i, r[0], r[1], r[2], r[3], s:term(r))
|
|
||||||
endif
|
|
||||||
for [j, s] in map(range(0, l), '[v:val, 0]') + types
|
|
||||||
if i + 1 == j || t || s && i != l
|
|
||||||
let q = s ? (has_key(get(c, d, []), j) ? c[d][j][0] : has_key(get(c, 'tabline', {}), j) ? c.tabline[j][0] : get(c.normal, j, zs)[0]) : (j != l ? get(zs, j, ms) :ms)
|
|
||||||
exec printf('hi Lightline%s_%s_%s_%s guifg=%s guibg=%s ctermfg=%s ctermbg=%s', p, mode, i, j, r[1], q[1], r[3], q[3])
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
exec printf('hi LightlineMiddle_%s guifg=%s guibg=%s ctermfg=%s ctermbg=%s %s', mode, ms[0], ms[1], ms[2], ms[3], s:term(ms))
|
|
||||||
endfor
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:subseparator(components, subseparator, expanded) abort
|
|
||||||
let [a, c, f, v, u ] = [ a:components, s:lightline.component, s:lightline.component_function, s:lightline.component_visible_condition, s:lightline.component_function_visible_condition ]
|
|
||||||
let xs = map(range(len(a:components)), 'a:expanded[v:val] ? "1" :
|
|
||||||
\ has_key(f, a[v:val]) ? (has_key(u, a[v:val]) ? "(".u[a[v:val]].")" : (exists("*".f[a[v:val]]) ? "" : "exists(\"*".f[a[v:val]]."\")&&").f[a[v:val]]."()!=#\"\"") :
|
|
||||||
\ has_key(v, a[v:val]) ? "(".v[a[v:val]].")" : has_key(c, a[v:val]) ? "1" : "0"')
|
|
||||||
return '%{' . (xs[0] ==# '1' || xs[0] ==# '(1)' ? '' : xs[0] . '&&(') . join(xs[1:], '||') . (xs[0] ==# '1' || xs[0] ==# '(1)' ? '' : ')') . '?"' . a:subseparator . '":""}'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#concatenate(xs, right) abort
|
|
||||||
let separator = a:right ? s:lightline.subseparator.right : s:lightline.subseparator.left
|
|
||||||
return join(filter(copy(a:xs), 'v:val !=# ""'), ' ' . separator . ' ')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#statusline(inactive) abort
|
|
||||||
if a:inactive && !has_key(s:highlight, 'inactive')
|
|
||||||
call lightline#highlight('inactive')
|
|
||||||
endif
|
|
||||||
return s:line(0, a:inactive)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:normalize(result) abort
|
|
||||||
if type(a:result) == 3
|
|
||||||
return map(a:result, 'type(v:val) == 1 ? v:val : string(v:val)')
|
|
||||||
elseif type(a:result) == 1
|
|
||||||
return [a:result]
|
|
||||||
else
|
|
||||||
return [string(a:result)]
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:evaluate_expand(component) abort
|
|
||||||
try
|
|
||||||
let result = eval(a:component . '()')
|
|
||||||
if type(result) == 1 && result ==# ''
|
|
||||||
return []
|
|
||||||
endif
|
|
||||||
catch
|
|
||||||
return []
|
|
||||||
endtry
|
|
||||||
return map(type(result) == 3 ? (result + [[], [], []])[:2] : [[], [result], []], 'filter(s:normalize(v:val), "v:val !=# ''''")')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:convert(name, index) abort
|
|
||||||
if has_key(s:lightline.component_expand, a:name)
|
|
||||||
let type = get(s:lightline.component_type, a:name, a:index)
|
|
||||||
let is_raw = get(s:lightline.component_raw, a:name) || type ==# 'raw'
|
|
||||||
return filter(s:map(s:evaluate_expand(s:lightline.component_expand[a:name]),
|
|
||||||
\ '[v:val, 1 + ' . is_raw . ', v:key == 1 && ' . (type !=# 'raw') . ' ? "' . type . '" : "' . a:index . '"]'), 'v:val[0] != []')
|
|
||||||
else
|
|
||||||
return [[[a:name], 0, a:index]]
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:flatten_twice(xss) abort
|
|
||||||
let ys = []
|
|
||||||
for xs in a:xss
|
|
||||||
for x in xs
|
|
||||||
let ys += x
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
return ys
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
if v:version > 702 || v:version == 702 && has('patch295')
|
|
||||||
let s:map = function('map')
|
|
||||||
else
|
|
||||||
function! s:map(xs, f) abort
|
|
||||||
let ys = []
|
|
||||||
for i in range(len(a:xs))
|
|
||||||
call extend(ys, map(a:xs[(i):(i)], substitute(a:f, 'v:key', i, 'g')))
|
|
||||||
endfor
|
|
||||||
return ys
|
|
||||||
endfunction
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! s:expand(components) abort
|
|
||||||
let components = []
|
|
||||||
let expanded = []
|
|
||||||
let indices = []
|
|
||||||
let previndex = -1
|
|
||||||
let xs = s:flatten_twice(s:map(deepcopy(a:components), 'map(v:val, "s:convert(v:val, ''" . v:key . "'')")'))
|
|
||||||
for [component, expand, index] in xs
|
|
||||||
if previndex != index
|
|
||||||
call add(indices, index)
|
|
||||||
call add(components, [])
|
|
||||||
call add(expanded, [])
|
|
||||||
endif
|
|
||||||
call extend(components[-1], component)
|
|
||||||
call extend(expanded[-1], repeat([expand], len(component)))
|
|
||||||
let previndex = index
|
|
||||||
endfor
|
|
||||||
call add(indices, string(len(a:components)))
|
|
||||||
return [components, expanded, indices]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:line(tabline, inactive) abort
|
|
||||||
let _ = a:tabline ? '' : '%{lightline#link()}'
|
|
||||||
if s:lightline.palette == {}
|
|
||||||
call lightline#colorscheme()
|
|
||||||
endif
|
|
||||||
let [l, r] = a:tabline ? [s:lightline.tab_llen, s:lightline.tab_rlen] : [s:lightline.llen, s:lightline.rlen]
|
|
||||||
let [p, s] = a:tabline ? [s:lightline.tabline_separator, s:lightline.tabline_subseparator] : [s:lightline.separator, s:lightline.subseparator]
|
|
||||||
let [c, f, t, w] = [s:lightline.component, s:lightline.component_function, s:lightline.component_type, s:lightline.component_raw]
|
|
||||||
let mode = a:tabline ? 'tabline' : a:inactive ? 'inactive' : 'active'
|
|
||||||
let l_ = has_key(s:lightline, mode) ? s:lightline[mode].left : s:lightline.active.left
|
|
||||||
let [lt, lc, ll] = s:expand(copy(l_))
|
|
||||||
let r_ = has_key(s:lightline, mode) ? s:lightline[mode].right : s:lightline.active.right
|
|
||||||
let [rt, rc, rl] = s:expand(copy(r_))
|
|
||||||
for i in range(len(lt))
|
|
||||||
let _ .= '%#LightlineLeft_' . mode . '_' . ll[i] . '#'
|
|
||||||
for j in range(len(lt[i]))
|
|
||||||
let x = lc[i][j] ? lt[i][j] : has_key(f, lt[i][j]) ? (exists('*' . f[lt[i][j]]) ? '%{' . f[lt[i][j]] . '()}' : '%{exists("*' . f[lt[i][j]] . '")?' . f[lt[i][j]] . '():""}') : get(c, lt[i][j], '')
|
|
||||||
let _ .= has_key(t, lt[i][j]) && t[lt[i][j]] ==# 'raw' || get(w, lt[i][j]) || lc[i][j] ==# 2 || x ==# '' ? x : '%( ' . x . ' %)'
|
|
||||||
if j < len(lt[i]) - 1 && s.left !=# ''
|
|
||||||
let _ .= s:subseparator(lt[i][(j):], s.left, lc[i][(j):])
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
let _ .= '%#LightlineLeft_' . mode . '_' . ll[i] . '_' . ll[i + 1] . '#'
|
|
||||||
let _ .= i < l + len(lt) - len(l_) && ll[i] < l || ll[i] != ll[i + 1] ? p.left : len(lt[i]) ? s.left : ''
|
|
||||||
endfor
|
|
||||||
let _ .= '%#LightlineMiddle_' . mode . '#%='
|
|
||||||
for i in reverse(range(len(rt)))
|
|
||||||
let _ .= '%#LightlineRight_' . mode . '_' . rl[i] . '_' . rl[i + 1] . '#'
|
|
||||||
let _ .= i < r + len(rt) - len(r_) && rl[i] < r || rl[i] != rl[i + 1] ? p.right : len(rt[i]) ? s.right : ''
|
|
||||||
let _ .= '%#LightlineRight_' . mode . '_' . rl[i] . '#'
|
|
||||||
for j in range(len(rt[i]))
|
|
||||||
let x = rc[i][j] ? rt[i][j] : has_key(f, rt[i][j]) ? (exists('*' . f[rt[i][j]]) ? '%{' . f[rt[i][j]] . '()}' : '%{exists("*' . f[rt[i][j]] . '")?' . f[rt[i][j]] . '():""}') : get(c, rt[i][j], '')
|
|
||||||
let _ .= has_key(t, rt[i][j]) && t[rt[i][j]] ==# 'raw' || get(w, rt[i][j]) || rc[i][j] ==# 2 || x ==# '' ? x : '%( ' . x . ' %)'
|
|
||||||
if j < len(rt[i]) - 1 && s.right !=# ''
|
|
||||||
let _ .= s:subseparator(rt[i][(j):], s.right, rc[i][(j):])
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
return _
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let s:tabnr = -1
|
|
||||||
let s:tabcnt = -1
|
|
||||||
let s:tabline = ''
|
|
||||||
function! lightline#tabline() abort
|
|
||||||
if !has_key(s:highlight, 'tabline')
|
|
||||||
call lightline#highlight('tabline')
|
|
||||||
endif
|
|
||||||
if s:lightline.tabline_configured || s:tabnr != tabpagenr() || s:tabcnt != tabpagenr('$')
|
|
||||||
let s:tabnr = tabpagenr()
|
|
||||||
let s:tabcnt = tabpagenr('$')
|
|
||||||
let s:tabline = s:line(1, 0)
|
|
||||||
endif
|
|
||||||
return s:tabline
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#tabs() abort
|
|
||||||
let [x, y, z] = [[], [], []]
|
|
||||||
let nr = tabpagenr()
|
|
||||||
let cnt = tabpagenr('$')
|
|
||||||
for i in range(1, cnt)
|
|
||||||
call add(i < nr ? x : i == nr ? y : z, (i > nr + 3 ? '%<' : '') . '%'. i . 'T%{lightline#onetab(' . i . ',' . (i == nr) . ')}' . (i == cnt ? '%T' : ''))
|
|
||||||
endfor
|
|
||||||
let abbr = '...'
|
|
||||||
let n = min([max([s:lightline.winwidth / 40, 2]), 8])
|
|
||||||
if len(x) > n && len(z) > n
|
|
||||||
let x = extend(add(x[:n/2-1], abbr), x[-(n+1)/2:])
|
|
||||||
let z = extend(add(z[:(n+1)/2-1], abbr), z[-n/2:])
|
|
||||||
elseif len(x) + len(z) > 2 * n
|
|
||||||
if len(x) > n
|
|
||||||
let x = extend(add(x[:(2*n-len(z))/2-1], abbr), x[-(2*n-len(z)+1)/2:])
|
|
||||||
elseif len(z) > n
|
|
||||||
let z = extend(add(z[:(2*n-len(x)+1)/2-1], abbr), z[-(2*n-len(x))/2:])
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
return [x, y, z]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#onetab(n, active) abort
|
|
||||||
let _ = []
|
|
||||||
for name in a:active ? s:lightline.tab.active : s:lightline.tab.inactive
|
|
||||||
if has_key(s:lightline.tab_component_function, name)
|
|
||||||
call add(_, call(s:lightline.tab_component_function[name], [a:n]))
|
|
||||||
else
|
|
||||||
call add(_, get(s:lightline.tab_component, name, ''))
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
return join(filter(_, 'v:val !=# ""'), ' ')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#error(msg) abort
|
|
||||||
echohl ErrorMsg
|
|
||||||
echomsg 'lightline.vim: '.a:msg
|
|
||||||
echohl None
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
@ -1,257 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2017/11/29 12:54:05.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
let s:cuicolor = {
|
|
||||||
\ 'black' : 16,
|
|
||||||
\ 'white' : 231,
|
|
||||||
\
|
|
||||||
\ 'darkestgreen' : 22,
|
|
||||||
\ 'darkgreen' : 28,
|
|
||||||
\ 'mediumgreen' : 70,
|
|
||||||
\ 'brightgreen' : 148,
|
|
||||||
\
|
|
||||||
\ 'darkestcyan' : 23,
|
|
||||||
\ 'mediumcyan' : 117,
|
|
||||||
\
|
|
||||||
\ 'darkestblue' : 24,
|
|
||||||
\ 'darkblue' : 31,
|
|
||||||
\
|
|
||||||
\ 'darkestred' : 52,
|
|
||||||
\ 'darkred' : 88,
|
|
||||||
\ 'mediumred' : 124,
|
|
||||||
\ 'brightred' : 160,
|
|
||||||
\ 'brightestred' : 196,
|
|
||||||
\
|
|
||||||
\ 'darkestpurple' : 55,
|
|
||||||
\ 'mediumpurple' : 98,
|
|
||||||
\ 'brightpurple' : 189,
|
|
||||||
\
|
|
||||||
\ 'brightorange' : 208,
|
|
||||||
\ 'brightestorange': 214,
|
|
||||||
\
|
|
||||||
\ 'gray0' : 233,
|
|
||||||
\ 'gray1' : 235,
|
|
||||||
\ 'gray2' : 236,
|
|
||||||
\ 'gray3' : 239,
|
|
||||||
\ 'gray4' : 240,
|
|
||||||
\ 'gray5' : 241,
|
|
||||||
\ 'gray6' : 244,
|
|
||||||
\ 'gray7' : 245,
|
|
||||||
\ 'gray8' : 247,
|
|
||||||
\ 'gray9' : 250,
|
|
||||||
\ 'gray10' : 252,
|
|
||||||
\
|
|
||||||
\ 'yellow' : 136,
|
|
||||||
\ 'orange' : 166,
|
|
||||||
\ 'red' : 160,
|
|
||||||
\ 'magenta' : 125,
|
|
||||||
\ 'violet' : 61,
|
|
||||||
\ 'blue' : 33,
|
|
||||||
\ 'cyan' : 37,
|
|
||||||
\ 'green' : 64,
|
|
||||||
\ }
|
|
||||||
|
|
||||||
let s:guicolor = {
|
|
||||||
\ 'black' : '#000000',
|
|
||||||
\ 'white' : '#ffffff',
|
|
||||||
\
|
|
||||||
\ 'darkestgreen' : '#005f00',
|
|
||||||
\ 'darkgreen' : '#008700',
|
|
||||||
\ 'mediumgreen' : '#5faf00',
|
|
||||||
\ 'brightgreen' : '#afdf00',
|
|
||||||
\
|
|
||||||
\ 'darkestcyan' : '#005f5f',
|
|
||||||
\ 'mediumcyan' : '#87dfff',
|
|
||||||
\
|
|
||||||
\ 'darkestblue' : '#005f87',
|
|
||||||
\ 'darkblue' : '#0087af',
|
|
||||||
\
|
|
||||||
\ 'darkestred' : '#5f0000',
|
|
||||||
\ 'darkred' : '#870000',
|
|
||||||
\ 'mediumred' : '#af0000',
|
|
||||||
\ 'brightred' : '#df0000',
|
|
||||||
\ 'brightestred' : '#ff0000',
|
|
||||||
\
|
|
||||||
\ 'darkestpurple' : '#5f00af',
|
|
||||||
\ 'mediumpurple' : '#875fdf',
|
|
||||||
\ 'brightpurple' : '#dfdfff',
|
|
||||||
\
|
|
||||||
\ 'brightorange' : '#ff8700',
|
|
||||||
\ 'brightestorange': '#ffaf00',
|
|
||||||
\
|
|
||||||
\ 'gray0' : '#121212',
|
|
||||||
\ 'gray1' : '#262626',
|
|
||||||
\ 'gray2' : '#303030',
|
|
||||||
\ 'gray3' : '#4e4e4e',
|
|
||||||
\ 'gray4' : '#585858',
|
|
||||||
\ 'gray5' : '#606060',
|
|
||||||
\ 'gray6' : '#808080',
|
|
||||||
\ 'gray7' : '#8a8a8a',
|
|
||||||
\ 'gray8' : '#9e9e9e',
|
|
||||||
\ 'gray9' : '#bcbcbc',
|
|
||||||
\ 'gray10' : '#d0d0d0',
|
|
||||||
\
|
|
||||||
\ 'yellow' : '#b58900',
|
|
||||||
\ 'orange' : '#cb4b16',
|
|
||||||
\ 'red' : '#dc322f',
|
|
||||||
\ 'magenta' : '#d33682',
|
|
||||||
\ 'violet' : '#6c71c4',
|
|
||||||
\ 'blue' : '#268bd2',
|
|
||||||
\ 'cyan' : '#2aa198',
|
|
||||||
\ 'green' : '#859900',
|
|
||||||
\ }
|
|
||||||
|
|
||||||
function! s:convert(rgb) abort
|
|
||||||
let rgb = map(matchlist(a:rgb, '#\(..\)\(..\)\(..\)')[1:3], '0 + ("0x".v:val)')
|
|
||||||
if len(rgb) == 0
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
if rgb[0] == 0xc0 && rgb[1] == 0xc0 && rgb[2] == 0xc0
|
|
||||||
return 7
|
|
||||||
elseif rgb[0] == 0x80 && rgb[1] == 0x80 && rgb[2] == 0x80
|
|
||||||
return 8
|
|
||||||
elseif (rgb[0] == 0x80 || rgb[0] == 0x00) && (rgb[1] == 0x80 || rgb[1] == 0x00) && (rgb[2] == 0x80 || rgb[2] == 0x00)
|
|
||||||
return (rgb[0] / 0x80) + (rgb[1] / 0x80) * 2 + (rgb[1] / 0x80) * 4
|
|
||||||
elseif abs(rgb[0]-rgb[1]) < 3 && abs(rgb[1]-rgb[2]) < 3 && abs(rgb[2]-rgb[0]) < 3
|
|
||||||
return s:black((rgb[0] + rgb[1] + rgb[2]) / 3)
|
|
||||||
else
|
|
||||||
return 16 + ((s:nr(rgb[0]) * 6) + s:nr(rgb[1])) * 6 + s:nr(rgb[2])
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:black(x) abort
|
|
||||||
if a:x < 0x04
|
|
||||||
return 16
|
|
||||||
elseif a:x > 0xf4
|
|
||||||
return 231
|
|
||||||
elseif index([0x00, 0x5f, 0x87, 0xaf, 0xdf, 0xff], a:x) >= 0
|
|
||||||
let l = a:x / 0x30
|
|
||||||
return ((l * 6) + l) * 6 + l + 16
|
|
||||||
else
|
|
||||||
return 232 + (a:x < 8 ? 0 : a:x < 0x60 ? (a:x-8)/10 : a:x < 0x76 ? (a:x-0x60)/6+9 : (a:x-8)/10)
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:nr(x) abort
|
|
||||||
return a:x < 0x2f ? 0 : a:x < 0x73 ? 1 : a:x < 0x9b ? 2 : a:x < 0xc7 ? 3 : a:x < 0xef ? 4 : 5
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:rgb(r, g, b) abort
|
|
||||||
return printf('#%02x%02x%02x', a:r, a:g, a:b)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:upconvert(nr) abort
|
|
||||||
let x = a:nr * 1
|
|
||||||
if x < 7
|
|
||||||
let [b, rg] = [x / 4, x % 4]
|
|
||||||
let [g, r] = [rg / 2, rg % 2]
|
|
||||||
return s:rgb(r * 0x80, g * 0x80, b * 0x80)
|
|
||||||
elseif x == 7
|
|
||||||
return s:rgb(0xc0, 0xc0, 0xc0)
|
|
||||||
elseif x == 8
|
|
||||||
return s:rgb(0x80, 0x80, 0x80)
|
|
||||||
elseif x < 16
|
|
||||||
let y = x - 8
|
|
||||||
let [b, rg] = [y / 4, y % 4]
|
|
||||||
let [g, r] = [rg / 2, rg % 2]
|
|
||||||
return s:rgb(r * 0xff, g * 0xff, b * 0xff)
|
|
||||||
elseif x < 232
|
|
||||||
let y = x - 16
|
|
||||||
let [rg, b] = [y / 6, y % 6]
|
|
||||||
let [r, g] = [rg / 6, rg % 6]
|
|
||||||
let l = [0x00, 0x5f, 0x87, 0xaf, 0xdf, 0xff]
|
|
||||||
return s:rgb(l[r], l[g], l[b])
|
|
||||||
elseif x < 241
|
|
||||||
let k = (x - 232) * 10 + 8
|
|
||||||
return s:rgb(k, k, k)
|
|
||||||
elseif x < 243
|
|
||||||
let k = (x - 241) * 6 + 0x60
|
|
||||||
return s:rgb(k, k, k)
|
|
||||||
else
|
|
||||||
let k = (x - 232) * 10 + 8
|
|
||||||
return s:rgb(k, k, k)
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#colorscheme#fill(p) abort
|
|
||||||
for k in values(a:p)
|
|
||||||
for l in values(k)
|
|
||||||
for m in l
|
|
||||||
if len(m) < 4
|
|
||||||
if type(m[0]) == 1 && type(m[1]) == 1
|
|
||||||
if m[0] =~# '^\d\+$' && m[1] =~# '^\d\+$'
|
|
||||||
call insert(m, s:upconvert(m[1]), 0)
|
|
||||||
call insert(m, s:upconvert(m[1]), 0)
|
|
||||||
else
|
|
||||||
call insert(m, get(s:cuicolor, m[0], s:convert(m[0])), 2)
|
|
||||||
call insert(m, get(s:cuicolor, m[1], s:convert(m[1])), 3)
|
|
||||||
let m[0] = get(s:guicolor, m[0], m[0])
|
|
||||||
let m[1] = get(s:guicolor, m[1], m[1])
|
|
||||||
endif
|
|
||||||
elseif type(m[0]) == 0 && type(m[1]) == 0
|
|
||||||
call insert(m, s:upconvert(m[1]), 0)
|
|
||||||
call insert(m, s:upconvert(m[1]), 0)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
return a:p
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#colorscheme#flatten(p) abort
|
|
||||||
for k in values(a:p)
|
|
||||||
for l in values(k)
|
|
||||||
for m in range(len(l))
|
|
||||||
let attr = ''
|
|
||||||
if len(l[m]) == 3 && type(l[m][2]) == 1
|
|
||||||
let attr = l[m][2]
|
|
||||||
endif
|
|
||||||
let l[m] = [l[m][0][0], l[m][1][0], l[m][0][1], l[m][1][1]]
|
|
||||||
if !empty(attr)
|
|
||||||
call add(l[m], attr)
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
return a:p
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
if has('gui_running')
|
|
||||||
function! lightline#colorscheme#background() abort
|
|
||||||
return &background
|
|
||||||
endfunction
|
|
||||||
else
|
|
||||||
" &background is set inappropriately when the colorscheme sets ctermbg of the Normal group
|
|
||||||
function! lightline#colorscheme#background() abort
|
|
||||||
let bg_color = synIDattr(synIDtrans(hlID('Normal')), 'bg', 'cterm')
|
|
||||||
if bg_color !=# ''
|
|
||||||
if bg_color < 16
|
|
||||||
return &background
|
|
||||||
elseif 232 <= bg_color && bg_color < 244
|
|
||||||
return 'dark'
|
|
||||||
elseif 244 <= bg_color
|
|
||||||
return 'light'
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
let fg_color = synIDattr(synIDtrans(hlID('Normal')), 'fg', 'cterm')
|
|
||||||
if fg_color !=# ''
|
|
||||||
if fg_color < 8 || 232 <= fg_color && fg_color < 244
|
|
||||||
return 'light'
|
|
||||||
elseif 8 <= fg_color && fg_color < 16 || 244 <= fg_color
|
|
||||||
return 'dark'
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
return &background
|
|
||||||
endfunction
|
|
||||||
endif
|
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
@ -1,49 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/16color.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2017/11/25 11:14:04.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:base03 = [ '#808080', 8 ]
|
|
||||||
let s:base02 = [ '#000000', 0 ]
|
|
||||||
let s:base01 = [ '#00ff00', 10 ]
|
|
||||||
let s:base00 = [ '#ffff00', 11 ]
|
|
||||||
let s:base0 = [ '#0000ff', 12 ]
|
|
||||||
let s:base1 = [ '#00ffff', 14 ]
|
|
||||||
let s:base2 = [ '#c0c0c0', 7 ]
|
|
||||||
let s:base3 = [ '#ffffff', 15 ]
|
|
||||||
let s:yellow = [ '#808000', 3 ]
|
|
||||||
let s:orange = [ '#ff0000', 9 ]
|
|
||||||
let s:red = [ '#800000', 1 ]
|
|
||||||
let s:magenta = [ '#800080', 5 ]
|
|
||||||
let s:violet = [ '#ff00ff', 13 ]
|
|
||||||
let s:blue = [ '#000080', 4 ]
|
|
||||||
let s:cyan = [ '#008080', 6 ]
|
|
||||||
let s:green = [ '#008000', 2 ]
|
|
||||||
|
|
||||||
if lightline#colorscheme#background() ==# 'light'
|
|
||||||
let [s:base03, s:base3] = [s:base3, s:base03]
|
|
||||||
let [s:base02, s:base2] = [s:base2, s:base02]
|
|
||||||
let [s:base01, s:base1] = [s:base1, s:base01]
|
|
||||||
let [s:base00, s:base0] = [s:base0, s:base00]
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:base3, s:blue ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:base02, s:base01 ], [ s:base00, s:base02 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base02 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:base3, s:green ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:base3, s:red ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:base3, s:magenta ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:base2, s:base02 ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:base01, s:base2 ] ]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
let s:p.normal.error = [ [ s:base2, s:red ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:base02, s:yellow ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#16color#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -1,36 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/Dracula.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2016/11/06 01:08:03.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:black = [ '#282a36', 235 ]
|
|
||||||
let s:gray = [ '#44475a', 236 ]
|
|
||||||
let s:white = [ '#f8f8f2', 231 ]
|
|
||||||
let s:darkblue = [ '#6272a4', 61 ]
|
|
||||||
let s:cyan = [ '#8be9fd', 117 ]
|
|
||||||
let s:green = [ '#50fa7b', 84 ]
|
|
||||||
let s:orange = [ '#ffb86c', 215 ]
|
|
||||||
let s:purple = [ '#bd93f9', 141 ]
|
|
||||||
let s:red = [ '#ff79c6', 212 ]
|
|
||||||
let s:yellow = [ '#f1fa8c', 228 ]
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:black, s:purple ], [ s:cyan, s:gray ] ]
|
|
||||||
let s:p.normal.right = [ [ s:black, s:purple ], [ s:white, s:darkblue ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:black, s:gray ], [ s:white, s:black ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:cyan, s:black ], [ s:white, s:black ] ]
|
|
||||||
let s:p.insert.left = [ [ s:black, s:green ], [ s:cyan, s:gray ] ]
|
|
||||||
let s:p.replace.left = [ [ s:black, s:red ], [ s:cyan, s:gray ] ]
|
|
||||||
let s:p.visual.left = [ [ s:black, s:orange ], [ s:cyan, s:gray ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:white, s:gray ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:white, s:gray ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:darkblue, s:gray ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:cyan, s:black ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:darkblue, s:gray ] ]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
let s:p.normal.error = [ [ s:red, s:black ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:yellow, s:black ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#Dracula#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -1,44 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/OldHope.vim
|
|
||||||
" Author: tomb0y
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2017/10/15 06:20:54.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:yellow = [ '#e5cd52' , 221 ]
|
|
||||||
let s:blue = [ '#4fb4d8' , 39 ]
|
|
||||||
let s:red = [ '#f92672' , 161 ]
|
|
||||||
let s:green = [ '#78bd65' , 41 ]
|
|
||||||
let s:orange = [ '#ef7c2a' , 202 ]
|
|
||||||
let s:white = [ '#ffffff' , 15 ]
|
|
||||||
let s:lightGray = [ '#848794' , 245 ]
|
|
||||||
let s:gray = [ '#686b78' , 242 ]
|
|
||||||
let s:darkGray = [ '#45474f' , 238 ]
|
|
||||||
let s:veryDarkGray = [ '#1c1d21' , 234 ]
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
|
|
||||||
let s:p.normal.left = [ [ s:white, s:blue ], [ s:white, s:gray ] ]
|
|
||||||
let s:p.insert.left = [ [ s:white, s:green ], [ s:white, s:gray ] ]
|
|
||||||
let s:p.visual.left = [ [ s:white, s:orange ], [ s:white, s:gray ] ]
|
|
||||||
let s:p.replace.left = [ [ s:white, s:red ], [ s:white, s:gray ] ]
|
|
||||||
|
|
||||||
let s:p.inactive.right = [ [ s:darkGray, s:gray ], [ s:darkGray, s:gray ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:lightGray, s:darkGray ], [ s:white, s:darkGray ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:white, s:darkGray ] ]
|
|
||||||
|
|
||||||
let s:p.normal.middle = [ [ s:white, s:darkGray ] ]
|
|
||||||
let s:p.normal.error = [ [ s:red, s:darkGray ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:orange, s:darkGray ] ]
|
|
||||||
|
|
||||||
let s:p.tabline.left = [ [ s:lightGray, s:darkGray ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:darkGray, s:yellow ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:yellow, s:veryDarkGray ] ]
|
|
||||||
|
|
||||||
let s:p.normal.right = copy(s:p.normal.left)
|
|
||||||
let s:p.insert.right = copy(s:p.insert.left)
|
|
||||||
let s:p.visual.right = copy(s:p.visual.left)
|
|
||||||
let s:p.replace.right = copy(s:p.replace.left)
|
|
||||||
let s:p.tabline.right = copy(s:p.tabline.left)
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#OldHope#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -1,12 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/PaperColor.vim
|
|
||||||
" Author: TKNGUE
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2017/11/25 11:13:35.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
if lightline#colorscheme#background() ==# 'light'
|
|
||||||
let g:lightline#colorscheme#PaperColor#palette = g:lightline#colorscheme#PaperColor_light#palette
|
|
||||||
else
|
|
||||||
let g:lightline#colorscheme#PaperColor#palette = g:lightline#colorscheme#PaperColor_dark#palette
|
|
||||||
endif
|
|
@ -1,60 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/PaperColor_dark.vim
|
|
||||||
" Author: TKNGUE
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2015-07-27 06:01
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:red = '#df0000'
|
|
||||||
let s:green = '#008700'
|
|
||||||
let s:blue = '#00afaf'
|
|
||||||
|
|
||||||
let s:pink = '#afdf00'
|
|
||||||
let s:olive = '#dfaf5f'
|
|
||||||
let s:navy = '#df875f'
|
|
||||||
|
|
||||||
let s:orange = '#d75f00'
|
|
||||||
let s:purple = '#8959a8'
|
|
||||||
let s:aqua = '#3e999f'
|
|
||||||
|
|
||||||
" Basics:
|
|
||||||
let s:foreground = '#d0d0d0'
|
|
||||||
let s:background = '#444444'
|
|
||||||
let s:window = '#efefef'
|
|
||||||
let s:status = '#c6c6c6'
|
|
||||||
let s:error = '#5f0000'
|
|
||||||
|
|
||||||
" Tabline:
|
|
||||||
let s:tabline_bg = '#3a3a3a'
|
|
||||||
let s:tabline_active_fg = '#1c1c1c'
|
|
||||||
let s:tabline_active_bg = '#00afaf'
|
|
||||||
let s:tabline_inactive_fg = '#c6c6c6'
|
|
||||||
let s:tabline_inactive_bg = '#585858'
|
|
||||||
|
|
||||||
" Statusline:
|
|
||||||
let s:statusline_active_fg = '#1c1c1c'
|
|
||||||
let s:statusline_active_bg = '#5f8787'
|
|
||||||
let s:statusline_inactive_fg = '#c6c6c6'
|
|
||||||
let s:statusline_inactive_bg = '#444444'
|
|
||||||
|
|
||||||
" Visual:
|
|
||||||
let s:visual_fg = '#000000'
|
|
||||||
let s:visual_bg = '#8787af'
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:foreground, s:background ], [ s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
|
|
||||||
let s:p.normal.right = [ [ s:foreground, s:background ], [ s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:statusline_active_fg, s:statusline_active_bg ]]
|
|
||||||
let s:p.inactive.right = [ [ s:foreground, s:background ], [ s:foreground, s:background ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:foreground, s:background ], [ s:foreground, s:background ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:foreground, s:background ], ]
|
|
||||||
let s:p.insert.left = [ [ s:background, s:blue], [ s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
|
|
||||||
let s:p.replace.left = [ [ s:background, s:pink ], [s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
|
|
||||||
let s:p.visual.left = [ [ s:visual_fg, s:visual_bg ], [s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
|
|
||||||
let s:p.tabline.left = [ [s:tabline_inactive_fg, s:tabline_inactive_bg ]]
|
|
||||||
let s:p.tabline.tabsel = [ [s:tabline_active_fg, s:tabline_active_bg ] ]
|
|
||||||
let s:p.tabline.middle = [ [s:tabline_bg, s:tabline_bg]]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
let s:p.normal.error = [ [ s:background, s:error ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#PaperColor_dark#palette = lightline#colorscheme#fill(s:p)
|
|
@ -1,55 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/PaperColor_light.vim
|
|
||||||
" Author: TKNGUE
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2015/07/28 07:46:40.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:red = '#df0000'
|
|
||||||
let s:green = '#008700'
|
|
||||||
let s:blue = '#4271ae'
|
|
||||||
let s:pink = '#d7005f'
|
|
||||||
let s:olive = '#718c00'
|
|
||||||
let s:navy = '#005f87'
|
|
||||||
let s:orange = '#d75f00'
|
|
||||||
let s:purple = '#8959a8'
|
|
||||||
let s:aqua = '#3e999f'
|
|
||||||
|
|
||||||
" Basics:
|
|
||||||
let s:foreground = '#4d4d4c'
|
|
||||||
let s:background = '#F5F5F5'
|
|
||||||
let s:window = '#efefef'
|
|
||||||
let s:status = s:aqua
|
|
||||||
let s:error = '#ffafdf'
|
|
||||||
|
|
||||||
" Tabline:
|
|
||||||
let s:tabline_bg = s:navy
|
|
||||||
let s:tabline_active_fg = s:foreground
|
|
||||||
let s:tabline_active_bg = s:window
|
|
||||||
let s:tabline_inactive_fg = s:background
|
|
||||||
let s:tabline_inactive_bg = s:aqua
|
|
||||||
|
|
||||||
" Statusline:
|
|
||||||
let s:statusline_active_fg = s:window
|
|
||||||
let s:statusline_active_bg = s:navy
|
|
||||||
let s:statusline_inactive_fg = s:foreground
|
|
||||||
let s:statusline_inactive_bg = '#dadada'
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:foreground, s:background ], [ s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
|
|
||||||
let s:p.normal.right = [ [ s:foreground, s:background ], [ s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:statusline_active_fg, s:statusline_active_bg ]]
|
|
||||||
let s:p.inactive.right = [ [ s:foreground, s:background ], [ s:foreground, s:background ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:foreground, s:background ], [ s:foreground, s:background ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:foreground, s:background ], ]
|
|
||||||
let s:p.insert.left = [ [ s:blue, s:background ], [ s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
|
|
||||||
let s:p.replace.left = [ [ s:background, s:pink ], [s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
|
|
||||||
let s:p.visual.left = [ [ s:background, s:orange ], [s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
|
|
||||||
let s:p.tabline.left = [ [s:tabline_inactive_fg, s:tabline_inactive_bg ]]
|
|
||||||
let s:p.tabline.tabsel = [ [s:tabline_active_fg, s:tabline_active_bg ] ]
|
|
||||||
let s:p.tabline.middle = [ [s:tabline_bg, s:tabline_bg]]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
let s:p.normal.error = [ [ s:background, s:error ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:background, s:olive ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#PaperColor_light#palette = lightline#colorscheme#fill(s:p)
|
|
@ -1,41 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/Tomorrow.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2013/09/07 12:22:37.
|
|
||||||
" =============================================================================
|
|
||||||
let s:base03 = '#fafafa'
|
|
||||||
let s:base023 = '#dfdfdf'
|
|
||||||
let s:base02 = '#c8c8c8'
|
|
||||||
let s:base01 = '#b4b4b4'
|
|
||||||
let s:base00 = '#808080'
|
|
||||||
let s:base0 = '#666666'
|
|
||||||
let s:base1 = '#555555'
|
|
||||||
let s:base2 = '#4f4f4f'
|
|
||||||
let s:base3 = '#4d4d4c'
|
|
||||||
let s:red = '#c82829'
|
|
||||||
let s:orange = '#f5871f'
|
|
||||||
let s:yellow = '#eab700'
|
|
||||||
let s:green = '#718c00'
|
|
||||||
let s:cyan = '#3e999f'
|
|
||||||
let s:blue = '#4271ae'
|
|
||||||
let s:magenta = '#8959a8'
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:base02, s:base00 ], [ s:base00, s:base02 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base03 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:base02, s:green ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:base02, s:orange ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:base02, s:magenta ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:base2, s:base023 ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:base01, s:base00 ] ]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
let s:p.normal.error = [ [ s:red, s:base01 ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:yellow, s:base0 ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#Tomorrow#palette = lightline#colorscheme#fill(s:p)
|
|
@ -1,41 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/Tomorrow_Night.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2013/09/07 12:23:38.
|
|
||||||
" =============================================================================
|
|
||||||
let s:base3 = '#c5c8c6'
|
|
||||||
let s:base2 = '#bababa'
|
|
||||||
let s:base1 = '#a0a0a0'
|
|
||||||
let s:base0 = '#909090'
|
|
||||||
let s:base00 = '#666666'
|
|
||||||
let s:base01 = '#555555'
|
|
||||||
let s:base02 = '#434343'
|
|
||||||
let s:base023 = '#303030'
|
|
||||||
let s:base03 = '#1d1f21'
|
|
||||||
let s:red = '#cc6666'
|
|
||||||
let s:orange = '#de935f'
|
|
||||||
let s:yellow = '#f0c674'
|
|
||||||
let s:green = '#b5bd68'
|
|
||||||
let s:cyan = '#8abeb7'
|
|
||||||
let s:blue = '#81a2be'
|
|
||||||
let s:magenta = '#b294bb'
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:base02, s:base00 ], [ s:base00, s:base02 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base03 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:base02, s:green ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:base02, s:orange ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:base02, s:magenta ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:base2, s:base023 ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:base01, s:base0 ] ]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
let s:p.normal.error = [ [ s:red, s:base023 ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:yellow, s:base02 ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#Tomorrow_Night#palette = lightline#colorscheme#fill(s:p)
|
|
@ -1,43 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/Tomorrow_Night_Blue.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2013/09/07 14:13:21.
|
|
||||||
" =============================================================================
|
|
||||||
let s:base3 = '#ffffff'
|
|
||||||
let s:base23 = '#ffffff'
|
|
||||||
let s:base2 = '#ffffff'
|
|
||||||
let s:base1 = '#ffffff'
|
|
||||||
let s:base0 = '#ffffff'
|
|
||||||
let s:base00 = '#6060df'
|
|
||||||
let s:base01 = '#6060af'
|
|
||||||
let s:base02 = '#606087'
|
|
||||||
let s:base023 = '#202087'
|
|
||||||
let s:base03 = '#002451'
|
|
||||||
let s:red = '#ff9da4'
|
|
||||||
let s:orange = '#ffc58f'
|
|
||||||
let s:yellow = '#ffeead'
|
|
||||||
let s:green = '#d1f1a9'
|
|
||||||
let s:cyan = '#99ffff'
|
|
||||||
let s:blue = '#bbdaff'
|
|
||||||
let s:magenta = '#ebbbff'
|
|
||||||
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:base023, s:blue ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.right = [ [ s:base02, s:base1 ], [ s:base2, s:base01 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:base02, s:base0 ], [ s:base00, s:base03 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:base023, s:green ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:base023, s:orange ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:base023, s:magenta ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:base2, s:base03 ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:base01, s:base1 ] ]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
let s:p.normal.error = [ [ s:base023, s:red ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:base023, s:yellow ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#Tomorrow_Night_Blue#palette = lightline#colorscheme#fill(s:p)
|
|
@ -1,42 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/Tomorrow_Night_Bright.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2013/09/07 14:13:26.
|
|
||||||
" =============================================================================
|
|
||||||
let s:base3 = '#eaeaea'
|
|
||||||
let s:base23 = '#d0d0d0'
|
|
||||||
let s:base2 = '#c6c6c6'
|
|
||||||
let s:base1 = '#b2b2b2'
|
|
||||||
let s:base0 = '#949494'
|
|
||||||
let s:base00 = '#767676'
|
|
||||||
let s:base01 = '#606060'
|
|
||||||
let s:base02 = '#4e4e4e'
|
|
||||||
let s:base023 = '#262626'
|
|
||||||
let s:base03 = '#12124c'
|
|
||||||
let s:red = '#d54e53'
|
|
||||||
let s:orange = '#e78c45'
|
|
||||||
let s:yellow = '#e7c547'
|
|
||||||
let s:green = '#b9ca4a'
|
|
||||||
let s:cyan = '#70c0b1'
|
|
||||||
let s:blue = '#7aa6da'
|
|
||||||
let s:magenta = '#c397d8'
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:base023, s:blue ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.right = [ [ s:base02, s:base1 ], [ s:base2, s:base01 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:base02, s:base0 ], [ s:base00, s:base03 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:base023, s:green ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:base023, s:orange ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:base023, s:magenta ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:base2, s:base023 ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:base01, s:base1 ] ]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
let s:p.normal.error = [ [ s:red, s:base023 ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:yellow, s:base02 ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#Tomorrow_Night_Bright#palette = lightline#colorscheme#fill(s:p)
|
|
@ -1,42 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/Tomorrow_Night_Eighties.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2013/09/07 14:14:14.
|
|
||||||
" =============================================================================
|
|
||||||
let s:base3 = '#cccccc'
|
|
||||||
let s:base23 = '#bbbbbb'
|
|
||||||
let s:base2 = '#aaaaaa'
|
|
||||||
let s:base1 = '#999999'
|
|
||||||
let s:base0 = '#777777'
|
|
||||||
let s:base00 = '#666666'
|
|
||||||
let s:base01 = '#555555'
|
|
||||||
let s:base02 = '#444444'
|
|
||||||
let s:base023 = '#333333'
|
|
||||||
let s:base03 = '#2d2d2d'
|
|
||||||
let s:red = '#f2777a'
|
|
||||||
let s:orange = '#f99157'
|
|
||||||
let s:yellow = '#ffcc66'
|
|
||||||
let s:green = '#99cc99'
|
|
||||||
let s:cyan = '#009999'
|
|
||||||
let s:blue = '#99cccc'
|
|
||||||
let s:magenta = '#cc99cc'
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:base023, s:blue ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.right = [ [ s:base02, s:base1 ], [ s:base2, s:base01 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:base02, s:base0 ], [ s:base00, s:base03 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:base023, s:green ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:base023, s:orange ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:base023, s:magenta ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:base2, s:base03 ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:base01, s:base1 ] ]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
let s:p.normal.error = [ [ s:base023, s:red ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:base023, s:yellow ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#Tomorrow_Night_Eighties#palette = lightline#colorscheme#fill(s:p)
|
|
@ -1,37 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/darcula.vim
|
|
||||||
" Author: kkopec
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2017/02/11 21:18:54.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:black = [ '#2b2b2b', 235 ]
|
|
||||||
let s:gray = [ '#323232', 236 ]
|
|
||||||
let s:white = [ '#a9b7c6', 250 ]
|
|
||||||
let s:blue = [ '#6897bb' , 67 ]
|
|
||||||
let s:green = [ '#629755', 71 ]
|
|
||||||
let s:purple = [ '#9876aa', 104 ]
|
|
||||||
let s:red = [ '#ff6b68', 204 ]
|
|
||||||
let s:yellow = [ '#ffc66d', 222 ]
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:black, s:purple ], [ s:purple, s:gray ] ]
|
|
||||||
let s:p.normal.right = [ [ s:black, s:purple ], [ s:purple, s:gray ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:black, s:blue ], [ s:blue, s:gray ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:black, s:blue ], [ s:blue, s:gray ] ]
|
|
||||||
let s:p.insert.left = [ [ s:black, s:green ], [ s:green, s:gray ] ]
|
|
||||||
let s:p.insert.right = [ [ s:black, s:green ], [ s:green, s:gray ] ]
|
|
||||||
let s:p.replace.left = [ [ s:black, s:red ], [ s:red, s:gray ] ]
|
|
||||||
let s:p.replace.right = [ [ s:black, s:red ], [ s:red, s:gray ] ]
|
|
||||||
let s:p.visual.left = [ [ s:black, s:yellow ], [ s:yellow, s:gray ] ]
|
|
||||||
let s:p.visual.right = [ [ s:black, s:yellow ], [ s:yellow, s:gray ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:white, s:gray ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:white, s:gray ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:blue, s:gray ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:black, s:blue ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:blue, s:gray ] ]
|
|
||||||
let s:p.tabline.right = [ [ s:black, s:blue ] ]
|
|
||||||
let s:p.normal.error = [ [ s:red, s:black ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:yellow, s:black ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#darcula#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -1,8 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/default.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2013/08/22 06:05:52.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#default#palette = g:lightline#colorscheme#powerline#palette
|
|
@ -1,40 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/jellybeans.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2013/09/07 12:21:04.
|
|
||||||
" =============================================================================
|
|
||||||
let s:base03 = [ '#151513', 233 ]
|
|
||||||
let s:base02 = [ '#30302c ', 236 ]
|
|
||||||
let s:base01 = [ '#4e4e43', 239 ]
|
|
||||||
let s:base00 = [ '#666656', 242 ]
|
|
||||||
let s:base0 = [ '#808070', 244 ]
|
|
||||||
let s:base1 = [ '#949484', 246 ]
|
|
||||||
let s:base2 = [ '#a8a897', 248 ]
|
|
||||||
let s:base3 = [ '#e8e8d3', 253 ]
|
|
||||||
let s:yellow = [ '#ffb964', 215 ]
|
|
||||||
let s:orange = [ '#fad07a', 222 ]
|
|
||||||
let s:red = [ '#cf6a4c', 167 ]
|
|
||||||
let s:magenta = [ '#f0a0c0', 217 ]
|
|
||||||
let s:blue = [ '#8197bf', 103 ]
|
|
||||||
let s:cyan = [ '#8fbfdc', 110 ]
|
|
||||||
let s:green = [ '#99ad6a', 107 ]
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.right = [ [ s:base02, s:base1 ], [ s:base2, s:base01 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:base02, s:base00 ], [ s:base0, s:base02 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base02 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:base02, s:green ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:base02, s:red ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:base02, s:magenta ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:base0, s:base02 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:base00, s:base02 ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:base3, s:base00 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:base3, s:base02 ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:base01, s:base1 ] ]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
let s:p.normal.error = [ [ s:red, s:base02 ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:yellow, s:base01 ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#jellybeans#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -1,25 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/landscape.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2015/11/26 21:49:44.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ ['#0000ff', '#ffffff', 21, 231, 'bold' ], [ '#ffffff', '#0000ff', 231, 21 ] ]
|
|
||||||
let s:p.normal.right = [ [ '#303030', '#d0d0d0', 236, 252 ], [ '#303030', '#8a8a8a', 236, 245 ], [ '#bcbcbc', '#585858', 250, 240 ] ]
|
|
||||||
let s:p.inactive.right = [ [ '#121212', '#606060', 233, 241 ], [ '#121212', '#3a3a3a', 233, 237 ], [ '#121212', '#262626', 233, 235 ] ]
|
|
||||||
let s:p.inactive.left = s:p.inactive.right[1:]
|
|
||||||
let s:p.insert.left = [ ['#005f00', '#ffffff', 22, 231, 'bold' ], [ '#ffffff', '#005f00', 231, 22 ] ]
|
|
||||||
let s:p.replace.left = [ [ '#af0000', '#ffffff', 124, 231, 'bold' ], [ '#ffffff', '#af0000', 231, 124 ] ]
|
|
||||||
let s:p.visual.left = [ [ '#5f00ff', '#ffffff', 57, 231, 'bold' ], [ '#ffffff', '#5f00ff', 231, 57 ] ]
|
|
||||||
let s:p.normal.middle = [ [ '#8a8a8a', '#303030', 245, 236 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ '#303030', '#121212', 236, 233 ] ]
|
|
||||||
let s:p.tabline.left = [ [ '#d0d0d0', '#666666', 252, 242 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ '#dadada', '#121212', 253, 233 ] ]
|
|
||||||
let s:p.tabline.middle = [ [ '#8a8a8a', '#3a3a3a', 245, 237 ] ]
|
|
||||||
let s:p.tabline.right = [ [ '#d0d0d0', '#666666', 252, 242 ] ]
|
|
||||||
let s:p.normal.error = [ [ '#d0d0d0', '#ff0000', 252, 196 ] ]
|
|
||||||
let s:p.normal.warning = [ [ '#262626', '#ffff00', 235, 226 ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#landscape#palette = s:p
|
|
@ -1,63 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/materia.vim
|
|
||||||
" Author: Lokesh Krishna
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2017/11/25 11:13:40.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Common colors
|
|
||||||
let s:fg = '#d5dbe5'
|
|
||||||
let s:blue = '#89ddff'
|
|
||||||
let s:green = '#8bd649'
|
|
||||||
let s:purple = '#82aaff'
|
|
||||||
let s:red1 = '#ec5f67'
|
|
||||||
let s:red2 = '#ec5f67'
|
|
||||||
let s:yellow = '#ffcc00'
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
|
|
||||||
if lightline#colorscheme#background() ==# 'light'
|
|
||||||
" Light variant
|
|
||||||
let s:bg = '#ffffff'
|
|
||||||
let s:gray1 = '#2c393f'
|
|
||||||
let s:gray2 = '#d5dbe5'
|
|
||||||
let s:gray3 = '#707880'
|
|
||||||
|
|
||||||
let s:p.normal.left = [ [ s:bg, s:green, 'bold' ], [ s:gray1, s:gray3 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:gray1, s:gray2 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:bg, s:gray3 ], [ s:bg, s:gray3 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:gray3, s:gray2 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:bg, s:gray3 ], [ s:bg, s:gray3 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:bg, s:blue, 'bold' ], [ s:gray1, s:gray3 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:bg, s:red1, 'bold' ], [ s:gray1, s:gray3 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:bg, s:purple, 'bold' ], [ s:gray1, s:gray3 ] ]
|
|
||||||
else
|
|
||||||
" Dark variant
|
|
||||||
let s:bg = '#263238'
|
|
||||||
let s:gray1 = '#37474f'
|
|
||||||
let s:gray2 = '#2c393f'
|
|
||||||
let s:gray3 = '#37474f'
|
|
||||||
|
|
||||||
let s:p.normal.left = [ [ s:bg, s:green, 'bold' ], [ s:fg, s:gray3 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:fg, s:gray2 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:gray1, s:bg ], [ s:gray1, s:bg ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:gray1, s:gray2 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:gray1, s:bg ], [ s:gray1, s:bg ] ]
|
|
||||||
let s:p.insert.left = [ [ s:bg, s:blue, 'bold' ], [ s:fg, s:gray3 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:bg, s:red1, 'bold' ], [ s:fg, s:gray3 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:bg, s:purple, 'bold' ], [ s:fg, s:gray3 ] ]
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Common
|
|
||||||
let s:p.normal.right = [ [ s:bg, s:green, 'bold' ], [ s:bg, s:green, 'bold' ] ]
|
|
||||||
let s:p.normal.error = [ [ s:red2, s:bg ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:yellow, s:bg ] ]
|
|
||||||
let s:p.insert.right = [ [ s:bg, s:blue, 'bold' ], [ s:bg, s:blue, 'bold' ] ]
|
|
||||||
let s:p.replace.right = [ [ s:bg, s:red1, 'bold' ], [ s:bg, s:red1, 'bold' ] ]
|
|
||||||
let s:p.visual.right = [ [ s:bg, s:purple, 'bold' ], [ s:bg, s:purple, 'bold' ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:bg, s:gray3 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:bg, s:purple, 'bold' ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:gray3, s:gray2 ] ]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#materia#palette = lightline#colorscheme#fill(s:p)
|
|
@ -1,63 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/material.vim
|
|
||||||
" Author: Lokesh Krishna
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2017/11/25 11:13:42.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Common colors
|
|
||||||
let s:fg = '#eeffff'
|
|
||||||
let s:blue = '#82aaff'
|
|
||||||
let s:green = '#c3e88d'
|
|
||||||
let s:purple = '#c792ea'
|
|
||||||
let s:red1 = '#f07178'
|
|
||||||
let s:red2 = '#ff5370'
|
|
||||||
let s:yellow = '#ffcb6b'
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
|
|
||||||
if lightline#colorscheme#background() ==# 'light'
|
|
||||||
" Light variant
|
|
||||||
let s:bg = '#ffffff'
|
|
||||||
let s:gray1 = '#2e3c43'
|
|
||||||
let s:gray2 = '#eeffff'
|
|
||||||
let s:gray3 = '#546e7a'
|
|
||||||
|
|
||||||
let s:p.normal.left = [ [ s:bg, s:blue, 'bold' ], [ s:gray1, s:gray3 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:gray1, s:gray2 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:bg, s:gray3 ], [ s:bg, s:gray3 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:gray3, s:gray2 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:bg, s:gray3 ], [ s:bg, s:gray3 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:bg, s:green, 'bold' ], [ s:gray1, s:gray3 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:bg, s:red1, 'bold' ], [ s:gray1, s:gray3 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:bg, s:purple, 'bold' ], [ s:gray1, s:gray3 ] ]
|
|
||||||
else
|
|
||||||
" Dark variant
|
|
||||||
let s:bg = '#263238'
|
|
||||||
let s:gray1 = '#314549'
|
|
||||||
let s:gray2 = '#2E3C43'
|
|
||||||
let s:gray3 = '#314549'
|
|
||||||
|
|
||||||
let s:p.normal.left = [ [ s:bg, s:blue, 'bold' ], [ s:fg, s:gray3 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:fg, s:gray2 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:gray1, s:bg ], [ s:gray1, s:bg ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:gray1, s:gray2 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:gray1, s:bg ], [ s:gray1, s:bg ] ]
|
|
||||||
let s:p.insert.left = [ [ s:bg, s:green, 'bold' ], [ s:fg, s:gray3 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:bg, s:red1, 'bold' ], [ s:fg, s:gray3 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:bg, s:purple, 'bold' ], [ s:fg, s:gray3 ] ]
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Common
|
|
||||||
let s:p.normal.right = [ [ s:bg, s:blue, 'bold' ], [ s:bg, s:blue, 'bold' ] ]
|
|
||||||
let s:p.normal.error = [ [ s:red2, s:bg ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:yellow, s:bg ] ]
|
|
||||||
let s:p.insert.right = [ [ s:bg, s:green, 'bold' ], [ s:bg, s:green, 'bold' ] ]
|
|
||||||
let s:p.replace.right = [ [ s:bg, s:red1, 'bold' ], [ s:bg, s:red1, 'bold' ] ]
|
|
||||||
let s:p.visual.right = [ [ s:bg, s:purple, 'bold' ], [ s:bg, s:purple, 'bold' ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:fg, s:gray3 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:bg, s:purple, 'bold' ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:gray3, s:gray2 ] ]
|
|
||||||
let s:p.tabline.right = [ [ s:bg, s:red1, 'bold' ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#material#palette = lightline#colorscheme#fill(s:p)
|
|
@ -1,36 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/molokai.vim
|
|
||||||
" Author: challsted
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2016/11/17 00:27:58.
|
|
||||||
" =============================================================================
|
|
||||||
"
|
|
||||||
let s:black = [ '#232526', 233 ]
|
|
||||||
let s:gray = [ '#808080', 244 ]
|
|
||||||
let s:white = [ '#f8f8f2', 234 ]
|
|
||||||
let s:cyan = [ '#66d9ef', 81 ]
|
|
||||||
let s:green = [ '#a6e22e', 118 ]
|
|
||||||
let s:orange = [ '#ef5939', 166 ]
|
|
||||||
let s:pink = [ '#f92672', 161 ]
|
|
||||||
let s:red = [ '#ff0000', 160 ]
|
|
||||||
let s:yellow = [ '#e6db74', 229 ]
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
|
|
||||||
let s:p.normal.left = [ [ s:black, s:cyan ], [ s:orange, s:black ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:orange, s:black ] ]
|
|
||||||
let s:p.normal.right = [ [ s:pink, s:black ], [ s:black, s:pink ] ]
|
|
||||||
let s:p.normal.error = [ [ s:pink, s:black ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:yellow, s:black ] ]
|
|
||||||
let s:p.insert.left = [ [ s:black, s:green ], [ s:green, s:black ] ]
|
|
||||||
let s:p.visual.left = [ [ s:black, s:yellow ], [ s:yellow, s:black ] ]
|
|
||||||
let s:p.replace.left = [ [ s:black, s:red ], [ s:red, s:black ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:pink, s:black ], [ s:white, s:black ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:gray, s:black ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:white, s:pink ], [ s:pink, s:black ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:pink, s:black ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:pink, s:black] ]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
let s:p.tabline.tabsel = [ [ s:black, s:pink ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#molokai#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -1,46 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/nord.vim
|
|
||||||
" Author: arcticicestudio
|
|
||||||
" License: MIT
|
|
||||||
" Last Change: 2017/11/12 20:27:51
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
|
|
||||||
let s:nord0 = ["#2E3440", "NONE"]
|
|
||||||
let s:nord1 = ["#3B4252", 0]
|
|
||||||
let s:nord2 = ["#434C5E", "NONE"]
|
|
||||||
let s:nord3 = ["#4C566A", 8]
|
|
||||||
let s:nord4 = ["#D8DEE9", "NONE"]
|
|
||||||
let s:nord5 = ["#E5E9F0", 7]
|
|
||||||
let s:nord6 = ["#ECEFF4", 15]
|
|
||||||
let s:nord7 = ["#8FBCBB", 14]
|
|
||||||
let s:nord8 = ["#88C0D0", 6]
|
|
||||||
let s:nord9 = ["#81A1C1", 4]
|
|
||||||
let s:nord10 = ["#5E81AC", 12]
|
|
||||||
let s:nord11 = ["#BF616A", 1]
|
|
||||||
let s:nord12 = ["#D08770", 11]
|
|
||||||
let s:nord13 = ["#EBCB8B", 3]
|
|
||||||
let s:nord14 = ["#A3BE8C", 2]
|
|
||||||
let s:nord15 = ["#B48EAD", 5]
|
|
||||||
|
|
||||||
let s:p.normal.left = [ [ s:nord1, s:nord8 ], [ s:nord5, s:nord1 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:nord5, s:nord3 ] ]
|
|
||||||
let s:p.normal.right = [ [ s:nord5, s:nord1 ], [ s:nord5, s:nord1 ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:nord1, s:nord13 ] ]
|
|
||||||
let s:p.normal.error = [ [ s:nord1, s:nord11 ] ]
|
|
||||||
|
|
||||||
let s:p.inactive.left = [ [ s:nord1, s:nord8 ], [ s:nord5, s:nord1 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:nord5, s:nord1 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:nord5, s:nord1 ], [ s:nord5, s:nord1 ] ]
|
|
||||||
|
|
||||||
let s:p.insert.left = [ [ s:nord1, s:nord6 ], [ s:nord5, s:nord1 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:nord1, s:nord13 ], [ s:nord5, s:nord1 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:nord1, s:nord7 ], [ s:nord5, s:nord1 ] ]
|
|
||||||
|
|
||||||
let s:p.tabline.left = [ [ s:nord5, s:nord3 ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:nord5, s:nord3 ] ]
|
|
||||||
let s:p.tabline.right = [ [ s:nord5, s:nord3 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:nord1, s:nord8 ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#nord#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -1,64 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/one.vim
|
|
||||||
" Author: Zoltan Dalmadi
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2017/11/28 21:53:01.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Common colors
|
|
||||||
let s:fg = [ '#abb2bf', 145 ]
|
|
||||||
let s:blue = [ '#61afef', 75 ]
|
|
||||||
let s:green = [ '#98c379', 76 ]
|
|
||||||
let s:purple = [ '#c678dd', 176 ]
|
|
||||||
let s:red1 = [ '#e06c75', 168 ]
|
|
||||||
let s:red2 = [ '#be5046', 168 ]
|
|
||||||
let s:yellow = [ '#e5c07b', 180 ]
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
|
|
||||||
if lightline#colorscheme#background() ==# 'light'
|
|
||||||
" Light variant
|
|
||||||
let s:bg = [ '#fafafa', 255 ]
|
|
||||||
let s:gray1 = [ '#494b53', 238 ]
|
|
||||||
let s:gray2 = [ '#f0f0f0', 255 ]
|
|
||||||
let s:gray3 = [ '#d0d0d0', 250 ]
|
|
||||||
let s:green = [ '#98c379', 35 ]
|
|
||||||
|
|
||||||
let s:p.normal.left = [ [ s:bg, s:green, 'bold' ], [ s:gray1, s:gray3 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:gray1, s:gray2 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:bg, s:gray3 ], [ s:bg, s:gray3 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:gray3, s:gray2 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:bg, s:gray3 ], [ s:bg, s:gray3 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:bg, s:blue, 'bold' ], [ s:gray1, s:gray3 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:bg, s:red1, 'bold' ], [ s:gray1, s:gray3 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:bg, s:purple, 'bold' ], [ s:gray1, s:gray3 ] ]
|
|
||||||
else
|
|
||||||
" Dark variant
|
|
||||||
let s:bg = [ '#282c34', 235 ]
|
|
||||||
let s:gray1 = [ '#5c6370', 241 ]
|
|
||||||
let s:gray2 = [ '#2c323d', 235 ]
|
|
||||||
let s:gray3 = [ '#3e4452', 240 ]
|
|
||||||
|
|
||||||
let s:p.normal.left = [ [ s:bg, s:green, 'bold' ], [ s:fg, s:gray3 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:fg, s:gray2 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:gray1, s:bg ], [ s:gray1, s:bg ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:gray1, s:gray2 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:gray1, s:bg ], [ s:gray1, s:bg ] ]
|
|
||||||
let s:p.insert.left = [ [ s:bg, s:blue, 'bold' ], [ s:fg, s:gray3 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:bg, s:red1, 'bold' ], [ s:fg, s:gray3 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:bg, s:purple, 'bold' ], [ s:fg, s:gray3 ] ]
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Common
|
|
||||||
let s:p.normal.right = [ [ s:bg, s:green, 'bold' ], [ s:bg, s:green, 'bold' ] ]
|
|
||||||
let s:p.normal.error = [ [ s:red2, s:bg ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:yellow, s:bg ] ]
|
|
||||||
let s:p.insert.right = [ [ s:bg, s:blue, 'bold' ], [ s:bg, s:blue, 'bold' ] ]
|
|
||||||
let s:p.replace.right = [ [ s:bg, s:red1, 'bold' ], [ s:bg, s:red1, 'bold' ] ]
|
|
||||||
let s:p.visual.right = [ [ s:bg, s:purple, 'bold' ], [ s:bg, s:purple, 'bold' ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:bg, s:gray3 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:bg, s:purple, 'bold' ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:gray3, s:gray2 ] ]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#one#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -1,28 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/powerline.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2013/09/07 15:54:41.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ ['darkestgreen', 'brightgreen', 'bold'], ['white', 'gray4'] ]
|
|
||||||
let s:p.normal.right = [ ['gray5', 'gray10'], ['gray9', 'gray4'], ['gray8', 'gray2'] ]
|
|
||||||
let s:p.inactive.right = [ ['gray1', 'gray5'], ['gray4', 'gray1'], ['gray4', 'gray0'] ]
|
|
||||||
let s:p.inactive.left = s:p.inactive.right[1:]
|
|
||||||
let s:p.insert.left = [ ['darkestcyan', 'white', 'bold'], ['white', 'darkblue'] ]
|
|
||||||
let s:p.insert.right = [ [ 'darkestcyan', 'mediumcyan' ], [ 'mediumcyan', 'darkblue' ], [ 'mediumcyan', 'darkestblue' ] ]
|
|
||||||
let s:p.replace.left = [ ['white', 'brightred', 'bold'], ['white', 'gray4'] ]
|
|
||||||
let s:p.visual.left = [ ['darkred', 'brightorange', 'bold'], ['white', 'gray4'] ]
|
|
||||||
let s:p.normal.middle = [ [ 'gray7', 'gray2' ] ]
|
|
||||||
let s:p.insert.middle = [ [ 'mediumcyan', 'darkestblue' ] ]
|
|
||||||
let s:p.replace.middle = s:p.normal.middle
|
|
||||||
let s:p.replace.right = s:p.normal.right
|
|
||||||
let s:p.tabline.left = [ [ 'gray9', 'gray4' ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ 'gray9', 'gray1' ] ]
|
|
||||||
let s:p.tabline.middle = [ [ 'gray2', 'gray8' ] ]
|
|
||||||
let s:p.tabline.right = [ [ 'gray9', 'gray3' ] ]
|
|
||||||
let s:p.normal.error = [ [ 'gray9', 'brightestred' ] ]
|
|
||||||
let s:p.normal.warning = [ [ 'gray1', 'yellow' ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#powerline#palette = lightline#colorscheme#fill(s:p)
|
|
@ -1,42 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/seoul256.vim
|
|
||||||
" Author: atweiden
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2015/11/02 08:23:27.
|
|
||||||
" =============================================================================
|
|
||||||
let s:base03 = [ '#151513', 233 ]
|
|
||||||
let s:base02 = [ '#30302c ', 236 ]
|
|
||||||
let s:base01 = [ '#4e4e43', 239 ]
|
|
||||||
let s:base00 = [ '#666656', 242 ]
|
|
||||||
let s:base0 = [ '#808070', 244 ]
|
|
||||||
let s:base1 = [ '#949484', 246 ]
|
|
||||||
let s:base2 = [ '#a8a897', 248 ]
|
|
||||||
let s:base3 = [ '#e8e8d3', 253 ]
|
|
||||||
let s:yellow = [ '#d8af5f', 3 ]
|
|
||||||
let s:orange = [ '#d7875f', 216 ]
|
|
||||||
let s:red = [ '#d68787', 131 ]
|
|
||||||
let s:magenta = [ '#df5f87', 168 ]
|
|
||||||
let s:peach = [ '#d7afaf', 181 ]
|
|
||||||
let s:blue = [ '#87afaf', 109 ]
|
|
||||||
let s:cyan = [ '#87d7d7', 23 ]
|
|
||||||
let s:green = [ '#87af87', 108 ]
|
|
||||||
let s:white = [ '#d0d0d0', 252 ]
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.right = [ [ s:base02, s:base1 ], [ s:base2, s:base01 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:base02, s:base00 ], [ s:base0, s:base02 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base02 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:base02, s:green ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:base02, s:magenta ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:base02, s:peach ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:base0, s:base02 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:base00, s:base02 ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:base3, s:base00 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:base3, s:base02 ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:base01, s:base1 ] ]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
let s:p.normal.error = [ [ s:red, s:base02 ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:yellow, s:base01 ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#seoul256#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -1,80 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/solarized.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2017/11/25 11:13:46.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:cuicolors = {
|
|
||||||
\ 'base03': [ '8', '234', 'DarkGray' ],
|
|
||||||
\ 'base02': [ '0', '235', 'Black' ],
|
|
||||||
\ 'base01': [ '10', '239', 'LightGreen' ],
|
|
||||||
\ 'base00': [ '11', '240', 'LightYellow' ],
|
|
||||||
\ 'base0': [ '12', '244', 'LightBlue' ],
|
|
||||||
\ 'base1': [ '14', '245', 'LightCyan' ],
|
|
||||||
\ 'base2': [ '7', '187', 'LightGray' ],
|
|
||||||
\ 'base3': [ '15', '230', 'White' ],
|
|
||||||
\ 'yellow': [ '3', '136', 'DarkYellow' ],
|
|
||||||
\ 'orange': [ '9', '166', 'LightRed' ],
|
|
||||||
\ 'red': [ '1', '124', 'DarkRed' ],
|
|
||||||
\ 'magenta': [ '5', '125', 'DarkMagenta' ],
|
|
||||||
\ 'violet': [ '13', '61', 'LightMagenta' ],
|
|
||||||
\ 'blue': [ '4', '33', 'DarkBlue' ],
|
|
||||||
\ 'cyan': [ '6', '37', 'DarkCyan' ],
|
|
||||||
\ 'green': [ '2', '64', 'DarkGreen' ],
|
|
||||||
\ }
|
|
||||||
|
|
||||||
" The following condition only applies for the console and is the same
|
|
||||||
" condition vim-colors-solarized uses to determine which set of colors
|
|
||||||
" to use.
|
|
||||||
let s:solarized_termcolors = get(g:, 'solarized_termcolors', 256)
|
|
||||||
if s:solarized_termcolors != 256 && &t_Co >= 16
|
|
||||||
let s:cuiindex = 0
|
|
||||||
elseif s:solarized_termcolors == 256
|
|
||||||
let s:cuiindex = 1
|
|
||||||
else
|
|
||||||
let s:cuiindex = 2
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:base03 = [ '#002b36', s:cuicolors.base03[s:cuiindex] ]
|
|
||||||
let s:base02 = [ '#073642', s:cuicolors.base02[s:cuiindex] ]
|
|
||||||
let s:base01 = [ '#586e75', s:cuicolors.base01[s:cuiindex] ]
|
|
||||||
let s:base00 = [ '#657b83', s:cuicolors.base00[s:cuiindex] ]
|
|
||||||
let s:base0 = [ '#839496', s:cuicolors.base0[s:cuiindex] ]
|
|
||||||
let s:base1 = [ '#93a1a1', s:cuicolors.base1[s:cuiindex] ]
|
|
||||||
let s:base2 = [ '#eee8d5', s:cuicolors.base2[s:cuiindex] ]
|
|
||||||
let s:base3 = [ '#fdf6e3', s:cuicolors.base3[s:cuiindex] ]
|
|
||||||
let s:yellow = [ '#b58900', s:cuicolors.yellow[s:cuiindex] ]
|
|
||||||
let s:orange = [ '#cb4b16', s:cuicolors.orange[s:cuiindex] ]
|
|
||||||
let s:red = [ '#dc322f', s:cuicolors.red[s:cuiindex] ]
|
|
||||||
let s:magenta = [ '#d33682', s:cuicolors.magenta[s:cuiindex] ]
|
|
||||||
let s:violet = [ '#6c71c4', s:cuicolors.violet[s:cuiindex] ]
|
|
||||||
let s:blue = [ '#268bd2', s:cuicolors.blue[s:cuiindex] ]
|
|
||||||
let s:cyan = [ '#2aa198', s:cuicolors.cyan[s:cuiindex] ]
|
|
||||||
let s:green = [ '#859900', s:cuicolors.green[s:cuiindex] ]
|
|
||||||
|
|
||||||
if lightline#colorscheme#background() ==# 'light'
|
|
||||||
let [ s:base03, s:base3 ] = [ s:base3, s:base03 ]
|
|
||||||
let [ s:base02, s:base2 ] = [ s:base2, s:base02 ]
|
|
||||||
let [ s:base01, s:base1 ] = [ s:base1, s:base01 ]
|
|
||||||
let [ s:base00, s:base0 ] = [ s:base0, s:base00 ]
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:base03, s:blue ], [ s:base03, s:base00 ] ]
|
|
||||||
let s:p.normal.right = [ [ s:base03, s:base1 ], [ s:base03, s:base00 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:base03, s:base00 ], [ s:base0, s:base02 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base0, s:base02 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:base03, s:green ], [ s:base03, s:base00 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:base03, s:red ], [ s:base03, s:base00 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:base03, s:magenta ], [ s:base03, s:base00 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:base01, s:base02 ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:base03, s:base00 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:base03, s:base1 ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:base0, s:base02 ] ]
|
|
||||||
let s:p.tabline.right = copy(s:p.normal.right)
|
|
||||||
let s:p.normal.error = [ [ s:base03, s:red ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:base03, s:yellow ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#solarized#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -1,40 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colorscheme/wombat.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2015/11/30 08:37:43.
|
|
||||||
" =============================================================================
|
|
||||||
let s:base03 = [ '#242424', 235 ]
|
|
||||||
let s:base023 = [ '#353535 ', 236 ]
|
|
||||||
let s:base02 = [ '#444444 ', 238 ]
|
|
||||||
let s:base01 = [ '#585858', 240 ]
|
|
||||||
let s:base00 = [ '#666666', 242 ]
|
|
||||||
let s:base0 = [ '#808080', 244 ]
|
|
||||||
let s:base1 = [ '#969696', 247 ]
|
|
||||||
let s:base2 = [ '#a8a8a8', 248 ]
|
|
||||||
let s:base3 = [ '#d0d0d0', 252 ]
|
|
||||||
let s:yellow = [ '#cae682', 180 ]
|
|
||||||
let s:orange = [ '#e5786d', 173 ]
|
|
||||||
let s:red = [ '#e5786d', 203 ]
|
|
||||||
let s:magenta = [ '#f2c68a', 216 ]
|
|
||||||
let s:blue = [ '#8ac6f2', 117 ]
|
|
||||||
let s:cyan = s:blue
|
|
||||||
let s:green = [ '#95e454', 119 ]
|
|
||||||
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
|
|
||||||
let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
|
|
||||||
let s:p.inactive.right = [ [ s:base023, s:base01 ], [ s:base00, s:base02 ] ]
|
|
||||||
let s:p.inactive.left = [ [ s:base1, s:base02 ], [ s:base00, s:base023 ] ]
|
|
||||||
let s:p.insert.left = [ [ s:base02, s:green ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.replace.left = [ [ s:base023, s:red ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.visual.left = [ [ s:base02, s:magenta ], [ s:base3, s:base01 ] ]
|
|
||||||
let s:p.normal.middle = [ [ s:base2, s:base02 ] ]
|
|
||||||
let s:p.inactive.middle = [ [ s:base1, s:base023 ] ]
|
|
||||||
let s:p.tabline.left = [ [ s:base3, s:base00 ] ]
|
|
||||||
let s:p.tabline.tabsel = [ [ s:base3, s:base03 ] ]
|
|
||||||
let s:p.tabline.middle = [ [ s:base2, s:base02 ] ]
|
|
||||||
let s:p.tabline.right = [ [ s:base2, s:base00 ] ]
|
|
||||||
let s:p.normal.error = [ [ s:base03, s:red ] ]
|
|
||||||
let s:p.normal.warning = [ [ s:base023, s:yellow ] ]
|
|
||||||
|
|
||||||
let g:lightline#colorscheme#wombat#palette = lightline#colorscheme#flatten(s:p)
|
|
@ -1,42 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/colortable.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2015/03/29 06:21:39.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! s:load() abort
|
|
||||||
let rgbfile = $VIMRUNTIME . '/rgb.txt'
|
|
||||||
let table = {}
|
|
||||||
if filereadable(rgbfile)
|
|
||||||
for _ in map(filter(readfile(rgbfile), 'v:val !~# "^!"'), 'matchlist(v:val, "^\\s*\\(\\d\\+\\)\\s\\+\\(\\d\\+\\)\\s\\+\\(\\d\\+\\)\\s\\+\\(.*\\)")[1:4]')
|
|
||||||
let table[tolower(_[3])] = _[0:2]
|
|
||||||
endfor
|
|
||||||
endif
|
|
||||||
return table
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let s:table = s:load()
|
|
||||||
|
|
||||||
function! lightline#colortable#name_to_rgb(name) abort
|
|
||||||
let name = tolower(a:name)
|
|
||||||
return has_key(s:table, name) ? s:table[name] : []
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#colortable#gui2cui(rgb, fallback) abort
|
|
||||||
let rgb = map(matchlist(a:rgb, '#\(..\)\(..\)\(..\)')[1:3], '0 + ("0x".v:val)')
|
|
||||||
if len(rgb) == 0
|
|
||||||
let rgb = lightline#colortable#name_to_rgb(a:rgb)
|
|
||||||
if len(rgb) == 0
|
|
||||||
return a:fallback % 128
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
let rgb = [rgb[0] > 127 ? 4 : 0, rgb[1] > 127 ? 2 : 0, rgb[2] > 127 ? 1 : 0]
|
|
||||||
return rgb[0] + rgb[1] + rgb[2]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
@ -1,33 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: autoload/lightline/tab.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2016/05/07 22:31:02.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! lightline#tab#filename(n) abort
|
|
||||||
let buflist = tabpagebuflist(a:n)
|
|
||||||
let winnr = tabpagewinnr(a:n)
|
|
||||||
let _ = expand('#'.buflist[winnr - 1].':t')
|
|
||||||
return _ !=# '' ? _ : '[No Name]'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#tab#modified(n) abort
|
|
||||||
let winnr = tabpagewinnr(a:n)
|
|
||||||
return gettabwinvar(a:n, winnr, '&modified') ? '+' : gettabwinvar(a:n, winnr, '&modifiable') ? '' : '-'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#tab#readonly(n) abort
|
|
||||||
let winnr = tabpagewinnr(a:n)
|
|
||||||
return gettabwinvar(a:n, winnr, '&readonly') ? 'RO' : ''
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#tab#tabnum(n) abort
|
|
||||||
return a:n
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
File diff suppressed because it is too large
Load Diff
@ -1,24 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
" Filename: plugin/lightline.vim
|
|
||||||
" Author: itchyny
|
|
||||||
" License: MIT License
|
|
||||||
" Last Change: 2016/03/14 03:31:58.
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
if exists('g:loaded_lightline') || v:version < 700
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
let g:loaded_lightline = 1
|
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
augroup lightline
|
|
||||||
autocmd!
|
|
||||||
autocmd WinEnter,BufWinEnter,FileType,ColorScheme,SessionLoadPost * call lightline#update()
|
|
||||||
autocmd ColorScheme,SessionLoadPost * call lightline#highlight()
|
|
||||||
autocmd CursorMoved,BufUnload * call lightline#update_once()
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
@ -1,20 +0,0 @@
|
|||||||
let s:sids = {}
|
|
||||||
function! s:sid(path) abort
|
|
||||||
if has_key(s:sids, a:path)
|
|
||||||
return s:sids[a:path]
|
|
||||||
endif
|
|
||||||
redir => scriptnames
|
|
||||||
silent! scriptnames
|
|
||||||
redir END
|
|
||||||
for line in split(scriptnames, '\n')
|
|
||||||
if line =~# a:path
|
|
||||||
let sid = matchstr(line, '\v^\s*\zs\d+\ze')
|
|
||||||
let s:sids[a:path] = sid
|
|
||||||
return sid
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! SID(name) abort
|
|
||||||
return function(printf("\<SNR>%d_%s", s:sid('autoload/lightline.vim'), a:name))
|
|
||||||
endfunction
|
|
@ -1,90 +0,0 @@
|
|||||||
let s:suite = themis#suite('concatenate')
|
|
||||||
let s:assert = themis#helper('assert')
|
|
||||||
|
|
||||||
function! s:suite.before_each()
|
|
||||||
let g:lightline = { 'subseparator': { 'left': '>', 'right': '<' } }
|
|
||||||
call lightline#init()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.nil()
|
|
||||||
call s:assert.equals(lightline#concatenate([], 0), '')
|
|
||||||
call s:assert.equals(lightline#concatenate([], 1), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.one()
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo'], 0), 'foo')
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo'], 1), 'foo')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.two()
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo', 'bar'], 0), 'foo > bar')
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo', 'bar'], 1), 'foo < bar')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.three()
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo', 'bar', 'baz'], 0), 'foo > bar > baz')
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo', 'bar', 'baz'], 1), 'foo < bar < baz')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.one_empty()
|
|
||||||
call s:assert.equals(lightline#concatenate([''], 0), '')
|
|
||||||
call s:assert.equals(lightline#concatenate([''], 1), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.two_empty_left()
|
|
||||||
call s:assert.equals(lightline#concatenate(['', 'bar'], 0), 'bar')
|
|
||||||
call s:assert.equals(lightline#concatenate(['', 'bar'], 1), 'bar')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.two_empty_right()
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo', ''], 0), 'foo')
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo', ''], 1), 'foo')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.two_empty_both()
|
|
||||||
call s:assert.equals(lightline#concatenate(['', ''], 0), '')
|
|
||||||
call s:assert.equals(lightline#concatenate(['', ''], 1), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.three_empty_left()
|
|
||||||
call s:assert.equals(lightline#concatenate(['', 'bar', 'baz'], 0), 'bar > baz')
|
|
||||||
call s:assert.equals(lightline#concatenate(['', 'bar', 'baz'], 1), 'bar < baz')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.three_empty_middle()
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo', '', 'baz'], 0), 'foo > baz')
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo', '', 'baz'], 1), 'foo < baz')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.three_empty_right()
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo', 'bar', ''], 0), 'foo > bar')
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo', 'bar', ''], 1), 'foo < bar')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.three_empty_middle_right()
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo', '', ''], 0), 'foo')
|
|
||||||
call s:assert.equals(lightline#concatenate(['foo', '', ''], 1), 'foo')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.three_empty_left_right()
|
|
||||||
call s:assert.equals(lightline#concatenate(['', 'bar', ''], 0), 'bar')
|
|
||||||
call s:assert.equals(lightline#concatenate(['', 'bar', ''], 1), 'bar')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.three_empty_left_middle()
|
|
||||||
call s:assert.equals(lightline#concatenate(['', '', 'baz'], 0), 'baz')
|
|
||||||
call s:assert.equals(lightline#concatenate(['', '', 'baz'], 1), 'baz')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.three_empty_all()
|
|
||||||
call s:assert.equals(lightline#concatenate(['', '', ''], 0), '')
|
|
||||||
call s:assert.equals(lightline#concatenate(['', '', ''], 1), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.keep_original()
|
|
||||||
let xs = ['', 'bar', '']
|
|
||||||
call s:assert.equals(lightline#concatenate(xs, 0), 'bar')
|
|
||||||
call s:assert.equals(xs, ['', 'bar', ''])
|
|
||||||
call s:assert.equals(lightline#concatenate(xs, 1), 'bar')
|
|
||||||
call s:assert.equals(xs, ['', 'bar', ''])
|
|
||||||
endfunction
|
|
@ -1,15 +0,0 @@
|
|||||||
let s:suite = themis#suite('error')
|
|
||||||
let s:assert = themis#helper('assert')
|
|
||||||
|
|
||||||
function! s:message() abort
|
|
||||||
redir => messages
|
|
||||||
silent! messages
|
|
||||||
redir END
|
|
||||||
return split(messages, '\n')[-1]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.error()
|
|
||||||
let message = 'An error occurred.'
|
|
||||||
call lightline#error(message)
|
|
||||||
call s:assert.equals(s:message(), 'lightline.vim: ' . message)
|
|
||||||
endfunction
|
|
@ -1,650 +0,0 @@
|
|||||||
let s:suite = themis#suite('expand')
|
|
||||||
let s:assert = themis#helper('assert')
|
|
||||||
|
|
||||||
function! s:expand(...)
|
|
||||||
return call(SID('expand'), a:000)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.expand()
|
|
||||||
let g:lightline = {}
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([]),
|
|
||||||
\ [[], [], ['0']])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.default()
|
|
||||||
let g:lightline = {}
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['mode', 'paste'], ['readonly', 'filename', 'modified']]),
|
|
||||||
\ [[['mode', 'paste'], ['readonly', 'filename', 'modified']], [[0, 0], [0, 0, 0]], ['0', '1', '2']])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom()
|
|
||||||
function! Custom()
|
|
||||||
return [ ['left'], ['middle'], ['right'] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type()
|
|
||||||
function! Custom()
|
|
||||||
return [ ['left'], ['middle'], ['right'] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left'], ['middle'], ['right'], ['modified']], [[0, 0], [1], [1], [1], [0]], ['0', '1', 'custom', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left'], ['middle'], ['right', 'modified']], [[0, 0, 1], [1], [1, 0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.raw_type()
|
|
||||||
function! Custom()
|
|
||||||
return [ ['left'], ['middle'], ['right'] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'raw' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [2, 2, 2], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 2, 2, 2, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.component_raw()
|
|
||||||
function! Custom()
|
|
||||||
return [ ['left'], ['middle'], ['right'] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' }, 'component_raw': { 'custom': 1 } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left'], ['middle'], ['right'], ['modified']], [[0, 0], [2], [2], [2], [0]], ['0', '1', 'custom', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left'], ['middle'], ['right', 'modified']], [[0, 0, 2], [2], [2, 0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.multiple()
|
|
||||||
function! Custom()
|
|
||||||
return [ ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['x0', 'x1', 'x2', 'y0', 'y1', 'y2', 'z0', 'z1', 'z2'], ['modified']], [[0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'x0', 'x1', 'x2', 'y0', 'y1', 'y2', 'z0', 'z1', 'z2', 'modified']], [[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.multiple_type()
|
|
||||||
function! Custom()
|
|
||||||
return [ ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'], ['modified']], [[0, 0], [1, 1, 1], [1, 1, 1], [1, 1, 1], [0]], ['0', '1', 'custom', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2', 'modified']], [[0, 0, 1, 1, 1], [1, 1, 1], [1, 1, 1, 0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.flatten()
|
|
||||||
function! Custom()
|
|
||||||
return [ 'left', 'middle', 'right' ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_flatten()
|
|
||||||
function! Custom()
|
|
||||||
return [ 'left', 'middle', 'right' ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left'], ['middle'], ['right'], ['modified']], [[0, 0], [1], [1], [1], [0]], ['0', '1', 'custom', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left'], ['middle'], ['right', 'modified']], [[0, 0, 1], [1], [1, 0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_string()
|
|
||||||
function! Custom()
|
|
||||||
return 'custom'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_string()
|
|
||||||
function! Custom()
|
|
||||||
return 'custom'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_void_string()
|
|
||||||
function! Custom()
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_void_string()
|
|
||||||
function! Custom()
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_number()
|
|
||||||
function! Custom()
|
|
||||||
return 24
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', '24', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_number()
|
|
||||||
function! Custom()
|
|
||||||
return 24
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_void_string_array()
|
|
||||||
function! Custom()
|
|
||||||
return ['', '', '']
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_void_string_array()
|
|
||||||
function! Custom()
|
|
||||||
return ['', '', '']
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_void_string_array_2()
|
|
||||||
function! Custom()
|
|
||||||
return [[''], [''], ['']]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_void_string_array_2()
|
|
||||||
function! Custom()
|
|
||||||
return [[''], [''], ['']]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_void_string_array_3()
|
|
||||||
function! Custom()
|
|
||||||
return ['', 'custom', '']
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_void_string_array_3()
|
|
||||||
function! Custom()
|
|
||||||
return ['', 'custom', '']
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_void_string_array_4()
|
|
||||||
function! Custom()
|
|
||||||
return [[''], ['custom'], ['']]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_void_string_array_4()
|
|
||||||
function! Custom()
|
|
||||||
return [[''], ['custom'], ['']]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_left_nil()
|
|
||||||
function! Custom()
|
|
||||||
return [ [], ['y0', 'y1'], ['z0', 'z1'] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['filename'], ['y0', 'y1', 'z0', 'z1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
|
|
||||||
\ [[['filename', 'y0', 'y1', 'z0', 'z1', 'modified']], [[0, 1, 1, 1, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_left_nil()
|
|
||||||
function! Custom()
|
|
||||||
return [ [], ['y0', 'y1'], ['z0', 'z1'] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['modified']], [[0], [1, 1], [1, 1], [0]], ['0', 'custom', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
|
|
||||||
\ [[['filename'], ['y0', 'y1'], ['z0', 'z1', 'modified']], [[0], [1, 1], [1, 1, 0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_right_nil()
|
|
||||||
function! Custom()
|
|
||||||
return [ ['x0', 'x1'], ['y0', 'y1'], [] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['filename'], ['x0', 'x1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
|
|
||||||
\ [[['filename', 'x0', 'x1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_right_nil()
|
|
||||||
function! Custom()
|
|
||||||
return [ ['x0', 'x1'], ['y0', 'y1'], [] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['filename'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0], [1, 1], [1, 1], [0]], ['0', '1', 'custom', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
|
|
||||||
\ [[['filename', 'x0', 'x1'], ['y0', 'y1'], ['modified']], [[0, 1, 1], [1, 1], [0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_one()
|
|
||||||
function! Custom()
|
|
||||||
return [ 'left' ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_one()
|
|
||||||
function! Custom()
|
|
||||||
return [ 'left' ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_two()
|
|
||||||
function! Custom()
|
|
||||||
return [ 'left', 'middle']
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left', 'middle'], ['modified']], [[0, 0], [1, 1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left', 'middle', 'modified']], [[0, 0, 1, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_two()
|
|
||||||
function! Custom()
|
|
||||||
return [ 'left', 'middle' ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left'], ['middle'], ['modified']], [[0, 0], [1], [1], [0]], ['0', '1', 'custom', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left'], ['middle'], ['modified']], [[0, 0, 1], [1], [0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_mixed()
|
|
||||||
function! Custom()
|
|
||||||
return ['left', { 'custom': 24 }, [function('tr')]]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left', '{''custom'': 24}', 'function(''tr'')'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left', '{''custom'': 24}', 'function(''tr'')', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_mixed()
|
|
||||||
function! Custom()
|
|
||||||
return ['left', { 'custom': 24 }, [function('tr')]]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left'], ['{''custom'': 24}'], ['function(''tr'')'], ['modified']], [[0, 0], [1], [1], [1], [0]], ['0', '1', 'custom', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left'], ['{''custom'': 24}'], ['function(''tr'')', 'modified']], [[0, 0, 1], [1], [1, 0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_mixed_2()
|
|
||||||
function! Custom()
|
|
||||||
return [['left', ''], ['', { 'custom': 24 }, ''], [[function('tr')], '']]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left', '{''custom'': 24}', '[function(''tr'')]'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left', '{''custom'': 24}', '[function(''tr'')]', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_mixed_2()
|
|
||||||
function! Custom()
|
|
||||||
return [['left', ''], ['', { 'custom': 24 }, ''], [[function('tr')], '']]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left'], ['{''custom'': 24}'], ['[function(''tr'')]'], ['modified']], [[0, 0], [1], [1], [1], [0]], ['0', '1', 'custom', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left'], ['{''custom'': 24}'], ['[function(''tr'')]', 'modified']], [[0, 0, 1], [1], [1, 0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_error()
|
|
||||||
function! Custom()
|
|
||||||
throw 'error'
|
|
||||||
return 'custom'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_error()
|
|
||||||
function! Custom()
|
|
||||||
throw 'error'
|
|
||||||
return 'custom'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.notfound()
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'NotFound' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.custom_type_notfound()
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'NotFound' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.duplicated_left_nil()
|
|
||||||
function! Custom()
|
|
||||||
return [ [], ['y0', 'y1'], ['z0', 'z1'] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
|
|
||||||
\ [[['filename'], ['y0', 'y1', 'z0', 'z1', 'y0', 'y1', 'z0', 'z1'], ['modified']], [[0], [1, 1, 1, 1, 1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
|
|
||||||
\ [[['filename', 'y0', 'y1', 'z0', 'z1', 'y0', 'y1', 'z0', 'z1', 'modified']], [[0, 1, 1, 1, 1, 1, 1, 1, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.duplicated_type_left_nil()
|
|
||||||
function! Custom()
|
|
||||||
return [ [], ['y0', 'y1'], ['z0', 'z1'] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
|
|
||||||
\ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['y0', 'y1'], ['z0', 'z1'], ['modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1], [0]], ['0', 'custom', '1', 'custom', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
|
|
||||||
\ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['y0', 'y1'], ['z0', 'z1', 'modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1, 0]], ['0', 'custom', '0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.duplicated_right_nil()
|
|
||||||
function! Custom()
|
|
||||||
return [ ['x0', 'x1'], ['y0', 'y1'], [] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
|
|
||||||
\ [[['filename'], ['x0', 'x1', 'y0', 'y1', 'x0', 'x1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1, 1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
|
|
||||||
\ [[['filename', 'x0', 'x1', 'y0', 'y1', 'x0', 'x1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 1, 1, 1, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.duplicated_type_right_nil()
|
|
||||||
function! Custom()
|
|
||||||
return [ ['x0', 'x1'], ['y0', 'y1'], [] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
|
|
||||||
\ [[['filename'], ['x0', 'x1'], ['y0', 'y1'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1], [0]], ['0', '1', 'custom', '1', 'custom', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
|
|
||||||
\ [[['filename', 'x0', 'x1'], ['y0', 'y1'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0, 1, 1], [1, 1], [1, 1], [1, 1], [0]], ['0', 'custom', '0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.duplicated_both_nil()
|
|
||||||
function! Custom()
|
|
||||||
return [ [], ['y0', 'y1'], [] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
|
|
||||||
\ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
|
|
||||||
\ [[['filename', 'y0', 'y1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.duplicated_type_both_nil()
|
|
||||||
function! Custom()
|
|
||||||
return [ [], ['y0', 'y1'], [] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
|
|
||||||
\ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', 'custom', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
|
|
||||||
\ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', 'custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.duplicated_both_nil_left_most()
|
|
||||||
function! Custom()
|
|
||||||
return [ [], ['y0', 'y1'], [] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['custom', 'custom'], ['modified']]),
|
|
||||||
\ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], ['0', '1', '2']])
|
|
||||||
call s:assert.equals(s:expand([['custom', 'custom', 'modified']]),
|
|
||||||
\ [[['y0', 'y1', 'y0', 'y1', 'modified']], [[1, 1, 1, 1, 0]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.duplicated_type_both_nil_left_most()
|
|
||||||
function! Custom()
|
|
||||||
return [ [], ['y0', 'y1'], [] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['custom', 'custom'], ['modified']]),
|
|
||||||
\ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], ['custom', '1', '2']])
|
|
||||||
call s:assert.equals(s:expand([['custom', 'custom', 'modified']]),
|
|
||||||
\ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], ['custom', '0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.duplicated_both_nil_right_most()
|
|
||||||
function! Custom()
|
|
||||||
return [ [], ['y0', 'y1'], [] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['filename'], ['custom', 'custom']]),
|
|
||||||
\ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], ['0', '1', '2']])
|
|
||||||
call s:assert.equals(s:expand([['filename', 'custom', 'custom']]),
|
|
||||||
\ [[['filename', 'y0', 'y1', 'y0', 'y1']], [[0, 1, 1, 1, 1]], ['0', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.duplicated_type_both_nil_right_most()
|
|
||||||
function! Custom()
|
|
||||||
return [ [], ['y0', 'y1'], [] ]
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['filename'], ['custom', 'custom']]),
|
|
||||||
\ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], ['0', 'custom', '2']])
|
|
||||||
call s:assert.equals(s:expand([['filename', 'custom', 'custom']]),
|
|
||||||
\ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], ['0', 'custom', '1']])
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.dictionary_function()
|
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'g:lightline.Custom' } }
|
|
||||||
function! g:lightline.Custom()
|
|
||||||
return [ ['left'], ['middle'], ['right'] ]
|
|
||||||
endfunction
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
|
||||||
\ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
|
|
||||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
|
||||||
\ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
|
|
||||||
endfunction
|
|
@ -1,171 +0,0 @@
|
|||||||
let s:suite = themis#suite('highlight')
|
|
||||||
let s:assert = themis#helper('assert')
|
|
||||||
|
|
||||||
function! s:suite.before_each()
|
|
||||||
hi clear
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:hi(name)
|
|
||||||
redir => hi
|
|
||||||
silent! exec 'hi' a:name
|
|
||||||
redir END
|
|
||||||
return substitute(join(split(hi, "\n"), ''), ' \+', ' ', 'g')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:pattern(xs, ...) abort
|
|
||||||
let ys = a:0 ? a:xs[1:] : a:xs
|
|
||||||
let zs = get(a:000, 0, a:xs)
|
|
||||||
return 'ctermfg=' . ys[2] . ' ctermbg=' . zs[3] . '.*guifg=' . ys[0] . ' guibg=' . zs[1]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.highlight()
|
|
||||||
let g:lightline = {}
|
|
||||||
call lightline#init()
|
|
||||||
call lightline#colorscheme()
|
|
||||||
let palette = lightline#palette()
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_normal_0'), s:pattern(palette.normal.left[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_normal_1'), s:pattern(palette.normal.left[1]))
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_normal_2'), 'E411: highlight group not found\|cleared')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_normal_0'), s:pattern(palette.normal.right[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_normal_1'), s:pattern(palette.normal.right[1]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_normal_2'), s:pattern(palette.normal.right[2]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_normal_3'), 'E411: highlight group not found\|cleared')
|
|
||||||
call s:assert.match(s:hi('LightlineMiddle_normal'), s:pattern(palette.normal.middle[0]))
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.insert()
|
|
||||||
let g:lightline = {}
|
|
||||||
call lightline#init()
|
|
||||||
call lightline#colorscheme()
|
|
||||||
call lightline#highlight('insert')
|
|
||||||
let palette = lightline#palette()
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_insert_0'), s:pattern(palette.insert.left[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_insert_1'), s:pattern(palette.insert.left[1]))
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_insert_2'), 'E411: highlight group not found\|cleared')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_insert_0'), s:pattern(palette.insert.right[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_insert_1'), s:pattern(palette.insert.right[1]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_insert_2'), s:pattern(palette.insert.right[2]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_insert_3'), 'E411: highlight group not found\|cleared')
|
|
||||||
call s:assert.match(s:hi('LightlineMiddle_insert'), s:pattern(palette.insert.middle[0]))
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
function! s:suite.visual()
|
|
||||||
let g:lightline = {}
|
|
||||||
call lightline#init()
|
|
||||||
call lightline#colorscheme()
|
|
||||||
call lightline#highlight('visual')
|
|
||||||
let palette = lightline#palette()
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_visual_0'), s:pattern(palette.visual.left[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_visual_1'), s:pattern(palette.visual.left[1]))
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_visual_2'), 'E411: highlight group not found\|cleared')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_visual_0'), s:pattern(palette.normal.right[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_visual_1'), s:pattern(palette.normal.right[1]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_visual_2'), s:pattern(palette.normal.right[2]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_visual_3'), 'E411: highlight group not found\|cleared')
|
|
||||||
call s:assert.match(s:hi('LightlineMiddle_normal'), s:pattern(palette.normal.middle[0]))
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.replace()
|
|
||||||
let g:lightline = {}
|
|
||||||
call lightline#init()
|
|
||||||
call lightline#colorscheme()
|
|
||||||
call lightline#highlight('replace')
|
|
||||||
let palette = lightline#palette()
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_replace_0'), s:pattern(palette.replace.left[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_replace_1'), s:pattern(palette.replace.left[1]))
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_replace_2'), 'E411: highlight group not found\|cleared')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_replace_0'), s:pattern(palette.replace.right[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_replace_1'), s:pattern(palette.replace.right[1]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_replace_2'), s:pattern(palette.replace.right[2]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_replace_3'), 'E411: highlight group not found\|cleared')
|
|
||||||
call s:assert.match(s:hi('LightlineMiddle_replace'), s:pattern(palette.replace.middle[0]))
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.left_right()
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'active': {
|
|
||||||
\ 'left': [ [ 'mode', 'paste' ], [ 'readonly' ], [ 'filename' ], [ 'modified' ] ],
|
|
||||||
\ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat' ], [ 'fileencoding' ], [ 'filetype' ] ]
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
call lightline#init()
|
|
||||||
call lightline#colorscheme()
|
|
||||||
let palette = lightline#palette()
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_normal_0'), s:pattern(palette.normal.left[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_normal_1'), s:pattern(palette.normal.left[1]))
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_normal_2'), s:pattern(palette.normal.middle[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_normal_3'), s:pattern(palette.normal.middle[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_normal_4'), 'E411: highlight group not found\|cleared')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_normal_0'), s:pattern(palette.normal.right[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_normal_1'), s:pattern(palette.normal.right[1]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_normal_2'), s:pattern(palette.normal.right[2]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_normal_3'), s:pattern(palette.normal.middle[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_normal_4'), s:pattern(palette.normal.middle[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_normal_5'), 'E411: highlight group not found\|cleared')
|
|
||||||
call s:assert.match(s:hi('LightlineMiddle_normal'), s:pattern(palette.normal.middle[0]))
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.no_components()
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'active': {
|
|
||||||
\ 'left': [],
|
|
||||||
\ 'right': []
|
|
||||||
\ },
|
|
||||||
\ 'inactive': {
|
|
||||||
\ 'left': [],
|
|
||||||
\ 'right': []
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
call lightline#init()
|
|
||||||
call lightline#colorscheme()
|
|
||||||
let palette = lightline#palette()
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_normal_0'), s:pattern(palette.normal.left[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_normal_1'), 'E411: highlight group not found\|cleared')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_normal_0'), s:pattern(palette.normal.right[0]))
|
|
||||||
call s:assert.match(s:hi('LightlineRight_normal_1'), 'E411: highlight group not found\|cleared')
|
|
||||||
call s:assert.match(s:hi('LightlineMiddle_normal'), s:pattern(palette.normal.middle[0]))
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator()
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'active': {
|
|
||||||
\ 'left': [ [ 'mode', 'paste' ], [ 'readonly' ], [ 'filename' ], [ 'modified' ] ],
|
|
||||||
\ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat' ], [ 'fileencoding' ], [ 'filetype' ] ]
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
call lightline#init()
|
|
||||||
call lightline#colorscheme()
|
|
||||||
let palette = lightline#palette()
|
|
||||||
for i in range(4)
|
|
||||||
for j in range(5)
|
|
||||||
if i + 1 == j
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_%s', i, j)), s:pattern(get(palette.normal.left, i, palette.normal.middle[0]), get(palette.normal.left, j, palette.normal.middle[0])))
|
|
||||||
else
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_%s', i, j)), 'E411: highlight group not found\|cleared')
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.component_type()
|
|
||||||
let g:lightline = { 'component_type': { 'error': 'error', 'warning': 'warning' } }
|
|
||||||
call lightline#init()
|
|
||||||
call lightline#colorscheme()
|
|
||||||
let palette = lightline#palette()
|
|
||||||
for type in ['error', 'warning']
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s', type)), s:pattern(palette.normal[type][0]))
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_0_%s', type)), s:pattern(palette.normal.left[0], palette.normal[type][0]))
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_1_%s', type)), s:pattern(palette.normal.left[1], palette.normal[type][0]))
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_2_%s', type)), 'E411: highlight group not found\|cleared')
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_0', type)), s:pattern(palette.normal[type][0], palette.normal.left[0]))
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_1', type)), s:pattern(palette.normal[type][0], palette.normal.left[1]))
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_2', type)), s:pattern(palette.normal[type][0], palette.normal.middle[0]))
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_3', type)), 'E411: highlight group not found\|cleared')
|
|
||||||
endfor
|
|
||||||
for type1 in ['error', 'warning']
|
|
||||||
for type2 in ['error', 'warning']
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_normal_%s_%s', type1, type2)), s:pattern(palette.normal[type1][0], palette.normal[type2][0]))
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
endfunction
|
|
@ -1,131 +0,0 @@
|
|||||||
let s:suite = themis#suite('link')
|
|
||||||
let s:assert = themis#helper('assert')
|
|
||||||
|
|
||||||
function! s:suite.before_each()
|
|
||||||
hi clear
|
|
||||||
let g:lightline = {}
|
|
||||||
call lightline#init()
|
|
||||||
call lightline#colorscheme()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:hi(name)
|
|
||||||
redir => hi
|
|
||||||
silent! exec 'hi' a:name
|
|
||||||
redir END
|
|
||||||
return substitute(join(split(hi, "\n"), ''), ' \+', ' ', 'g')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.link()
|
|
||||||
call lightline#link()
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_0'), 'LightlineLeft_normal_0')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_1'), 'LightlineLeft_normal_1')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_2'), 'E411: highlight group not found')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_0'), 'LightlineRight_normal_0')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_1'), 'LightlineRight_normal_1')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_2'), 'LightlineRight_normal_2')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_3'), 'E411: highlight group not found')
|
|
||||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_normal')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.insert()
|
|
||||||
call lightline#link('i')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_0'), 'LightlineLeft_insert_0')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_1'), 'LightlineLeft_insert_1')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_2'), 'E411: highlight group not found')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_0'), 'LightlineRight_insert_0')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_1'), 'LightlineRight_insert_1')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_2'), 'LightlineRight_insert_2')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_3'), 'E411: highlight group not found')
|
|
||||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_insert')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.visual()
|
|
||||||
call lightline#link('v')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_0'), 'LightlineLeft_visual_0')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_1'), 'LightlineLeft_visual_1')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_2'), 'E411: highlight group not found')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_0'), 'LightlineRight_visual_0')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_1'), 'LightlineRight_visual_1')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_2'), 'LightlineRight_visual_2')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_3'), 'E411: highlight group not found')
|
|
||||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_visual')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.replace()
|
|
||||||
call lightline#link('R')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_0'), 'LightlineLeft_replace_0')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_1'), 'LightlineLeft_replace_1')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_2'), 'E411: highlight group not found')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_0'), 'LightlineRight_replace_0')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_1'), 'LightlineRight_replace_1')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_2'), 'LightlineRight_replace_2')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_3'), 'E411: highlight group not found')
|
|
||||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_replace')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.left_right()
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'active': {
|
|
||||||
\ 'left': [ [ 'mode', 'paste' ], [ 'readonly' ], [ 'filename' ], [ 'modified' ] ],
|
|
||||||
\ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat' ], [ 'fileencoding' ], [ 'filetype' ] ]
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
call lightline#init()
|
|
||||||
call lightline#colorscheme()
|
|
||||||
call lightline#link()
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_0'), 'LightlineLeft_normal_0')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_1'), 'LightlineLeft_normal_1')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_2'), 'LightlineLeft_normal_2')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_3'), 'LightlineLeft_normal_3')
|
|
||||||
call s:assert.match(s:hi('LightlineLeft_active_4'), 'E411: highlight group not found')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_0'), 'LightlineRight_normal_0')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_1'), 'LightlineRight_normal_1')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_2'), 'LightlineRight_normal_2')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_3'), 'LightlineRight_normal_3')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_4'), 'LightlineRight_normal_4')
|
|
||||||
call s:assert.match(s:hi('LightlineRight_active_5'), 'E411: highlight group not found')
|
|
||||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_normal')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator()
|
|
||||||
let g:lightline = {
|
|
||||||
\ 'active': {
|
|
||||||
\ 'left': [ [ 'mode', 'paste' ], [ 'readonly' ], [ 'filename' ], [ 'modified' ] ],
|
|
||||||
\ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat' ], [ 'fileencoding' ], [ 'filetype' ] ]
|
|
||||||
\ },
|
|
||||||
\ }
|
|
||||||
call lightline#init()
|
|
||||||
call lightline#colorscheme()
|
|
||||||
call lightline#link()
|
|
||||||
for i in range(4)
|
|
||||||
for j in range(5)
|
|
||||||
if i + 1 == j
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_%s', i, j)), printf('LightlineLeft_normal_%s_%s', i, j))
|
|
||||||
else
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_%s', i, j)), 'E411: highlight group not found')
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.component_type()
|
|
||||||
let g:lightline = { 'component_type': { 'error': 'error', 'warning': 'warning' } }
|
|
||||||
call lightline#init()
|
|
||||||
call lightline#colorscheme()
|
|
||||||
call lightline#link()
|
|
||||||
for type in ['error', 'warning']
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s', type)), printf('LightlineLeft_normal_%s', type))
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_active_0_%s', type)), printf('LightlineLeft_normal_0_%s', type))
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_active_1_%s', type)), printf('LightlineLeft_normal_1_%s', type))
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_active_2_%s', type)), 'E411: highlight group not found')
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_0', type)), printf('LightlineLeft_normal_%s_0', type))
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_1', type)), printf('LightlineLeft_normal_%s_1', type))
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_2', type)), printf('LightlineLeft_normal_%s_2', type))
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_3', type)), 'E411: highlight group not found')
|
|
||||||
endfor
|
|
||||||
for type1 in ['error', 'warning']
|
|
||||||
for type2 in ['error', 'warning']
|
|
||||||
call s:assert.match(s:hi(printf('LightlineLeft_active_%s_%s', type1, type2)), printf('LightlineLeft_normal_%s_%s', type1, type2))
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
endfunction
|
|
@ -1,14 +0,0 @@
|
|||||||
let s:suite = themis#suite('mode')
|
|
||||||
let s:assert = themis#helper('assert')
|
|
||||||
|
|
||||||
function! s:suite.mode()
|
|
||||||
let g:lightline = {}
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(lightline#mode(), 'NORMAL')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.mode_map()
|
|
||||||
let g:lightline = { 'mode_map': { 'n': 'N' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(lightline#mode(), 'N')
|
|
||||||
endfunction
|
|
@ -1,98 +0,0 @@
|
|||||||
let s:suite = themis#suite('onetab')
|
|
||||||
let s:assert = themis#helper('assert')
|
|
||||||
|
|
||||||
function! s:suite.before_each()
|
|
||||||
let g:lightline = {}
|
|
||||||
call lightline#init()
|
|
||||||
tabnew
|
|
||||||
tabonly
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.onetab()
|
|
||||||
call s:assert.equals(lightline#onetab(1, 1), '1 [No Name]')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew()
|
|
||||||
tabnew
|
|
||||||
call s:assert.equals(lightline#onetab(1, 0), '1 [No Name]')
|
|
||||||
call s:assert.equals(lightline#onetab(2, 1), '2 [No Name]')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew_tabnew()
|
|
||||||
tabnew
|
|
||||||
tabnew
|
|
||||||
call s:assert.equals(lightline#onetab(1, 0), '1 [No Name]')
|
|
||||||
call s:assert.equals(lightline#onetab(2, 0), '2 [No Name]')
|
|
||||||
call s:assert.equals(lightline#onetab(3, 1), '3 [No Name]')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.modified()
|
|
||||||
call append(0, '')
|
|
||||||
call s:assert.equals(lightline#onetab(1, 1), '1 [No Name] +')
|
|
||||||
undo
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.filename()
|
|
||||||
edit test
|
|
||||||
call s:assert.equals(lightline#onetab(1, 1), '1 test')
|
|
||||||
tabnew
|
|
||||||
bunload test
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.filename_modified()
|
|
||||||
edit test
|
|
||||||
call append(0, '')
|
|
||||||
call s:assert.equals(lightline#onetab(1, 1), '1 test +')
|
|
||||||
tabnew
|
|
||||||
bunload! test
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.active_inactive()
|
|
||||||
let g:lightline = { 'tab': { 'active': [ 'tabnum', 'filename' ], 'inactive': [ 'filename' ] } }
|
|
||||||
call lightline#init()
|
|
||||||
edit test
|
|
||||||
call append(0, '')
|
|
||||||
call s:assert.equals(lightline#onetab(1, 1), '1 test')
|
|
||||||
call s:assert.equals(lightline#onetab(1, 0), 'test')
|
|
||||||
tabnew
|
|
||||||
bunload! test
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tab_component()
|
|
||||||
let g:lightline = { 'tab': { 'active': [ 'custom' ] }, 'tab_component': { 'custom': 'custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(lightline#onetab(1, 1), 'custom')
|
|
||||||
call s:assert.equals(lightline#onetab(2, 1), 'custom')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tab_component_function()
|
|
||||||
function! Custom(n)
|
|
||||||
return 'custom: ' . a:n
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'tab': { 'active': [ 'custom' ] }, 'tab_component_function': { 'custom': 'Custom' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(lightline#onetab(1, 1), 'custom: 1')
|
|
||||||
call s:assert.equals(lightline#onetab(2, 1), 'custom: 2')
|
|
||||||
delfunction Custom
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tab_component_empty_middle()
|
|
||||||
let g:lightline = { 'tab': { 'active': [ 'tabnum', 'custom', 'filename' ], 'inactive': [ 'tabnum', 'custom', 'custom', 'filename' ] }, 'tab_component': { 'custom': '' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(lightline#onetab(1, 1), '1 [No Name]')
|
|
||||||
call s:assert.equals(lightline#onetab(2, 1), '2 [No Name]')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tab_component_empty_left()
|
|
||||||
let g:lightline = { 'tab': { 'active': [ 'custom', 'filename' ], 'inactive': [ 'custom', 'custom', 'filename' ] }, 'tab_component': { 'custom': '' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(lightline#onetab(1, 1), '[No Name]')
|
|
||||||
call s:assert.equals(lightline#onetab(2, 1), '[No Name]')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tab_component_empty_middle()
|
|
||||||
let g:lightline = { 'tab': { 'active': [ 'tabnum', 'custom' ], 'inactive': [ 'tabnum', 'custom', 'custom' ] }, 'tab_component': { 'custom': '' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(lightline#onetab(1, 1), '1')
|
|
||||||
call s:assert.equals(lightline#onetab(2, 1), '2')
|
|
||||||
endfunction
|
|
@ -1,407 +0,0 @@
|
|||||||
let s:suite = themis#suite('subseparator')
|
|
||||||
let s:assert = themis#helper('assert')
|
|
||||||
|
|
||||||
function! s:subseparator(...)
|
|
||||||
return eval(substitute(call(SID('subseparator'), a:000), '^%{\|}$', '', 'g'))
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component()
|
|
||||||
let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_visible_condition_1()
|
|
||||||
let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1', 'custom2': '1', 'custom3': '1' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_visible_condition_2()
|
|
||||||
let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '0', 'custom2': '1', 'custom3': '1' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_visible_condition_3()
|
|
||||||
let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '1' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_visible_condition_4()
|
|
||||||
let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '0' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_visible_condition_5()
|
|
||||||
let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '0', 'custom2': '0', 'custom3': '0' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_visible_condition_6()
|
|
||||||
let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1||0', 'custom2': '0', 'custom3': '0' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_visible_condition_7()
|
|
||||||
let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1||1', 'custom2': '0', 'custom3': '0' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
|
||||||
delfunction Custom1
|
|
||||||
delfunction Custom2
|
|
||||||
delfunction Custom3
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_1()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
delfunction Custom1
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_2()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
|
||||||
delfunction Custom1
|
|
||||||
delfunction Custom2
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_3()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
|
||||||
delfunction Custom1
|
|
||||||
delfunction Custom3
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_4()
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
delfunction Custom2
|
|
||||||
delfunction Custom3
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_5()
|
|
||||||
function! Custom1()
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
delfunction Custom1
|
|
||||||
delfunction Custom2
|
|
||||||
delfunction Custom3
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_6()
|
|
||||||
function! Custom1()
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
delfunction Custom1
|
|
||||||
delfunction Custom2
|
|
||||||
delfunction Custom3
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_7()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
delfunction Custom1
|
|
||||||
delfunction Custom2
|
|
||||||
delfunction Custom3
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_visible_condition_1()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '1', 'custom2': '1', 'custom3': '1' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_visible_condition_2()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '0', 'custom2': '1', 'custom3': '1' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_visible_condition_3()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '1' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_visible_condition_4()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '0' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_visible_condition_5()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '0' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_visible_condition_6()
|
|
||||||
function! Custom1()
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom2': '1', 'custom3': '1' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_function_visible_condition_7()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom3': '1' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_expand()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [1, 1, 1]), '|')
|
|
||||||
delfunction Custom1
|
|
||||||
delfunction Custom2
|
|
||||||
delfunction Custom3
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_expand()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [1, 1, 1]), '|')
|
|
||||||
delfunction Custom1
|
|
||||||
delfunction Custom2
|
|
||||||
delfunction Custom3
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_expand_1()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom1': 'Custom1' }, 'component_function': { 'custom2': 'Custom2', 'custom3': 'Custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [1, 0, 0]), '|')
|
|
||||||
delfunction Custom1
|
|
||||||
delfunction Custom2
|
|
||||||
delfunction Custom3
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_expand_2()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_expand': { 'custom1': 'Custom1', 'custom2': 'Custom2' }, 'component_function': { 'custom3': 'Custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [1, 1, 0]), '|')
|
|
||||||
delfunction Custom1
|
|
||||||
delfunction Custom2
|
|
||||||
delfunction Custom3
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_expand_3()
|
|
||||||
function! Custom1()
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
function! Custom3()
|
|
||||||
return 'custom3'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2' }, 'component_expand': { 'custom3': 'Custom3' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 1]), '')
|
|
||||||
delfunction Custom1
|
|
||||||
delfunction Custom2
|
|
||||||
delfunction Custom3
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_not_found()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
delfunction Custom1
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_not_found_1()
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom2': 'Custom2' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
|
||||||
delfunction Custom2
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.subseparator_component_not_found_2()
|
|
||||||
function! Custom1()
|
|
||||||
return 'custom1'
|
|
||||||
endfunction
|
|
||||||
function! Custom2()
|
|
||||||
return 'custom2'
|
|
||||||
endfunction
|
|
||||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2' } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
|
||||||
delfunction Custom1
|
|
||||||
delfunction Custom2
|
|
||||||
endfunction
|
|
@ -1,67 +0,0 @@
|
|||||||
let s:suite = themis#suite('tabline')
|
|
||||||
let s:assert = themis#helper('assert')
|
|
||||||
|
|
||||||
function! s:suite.before_each()
|
|
||||||
let g:lightline = {}
|
|
||||||
call lightline#init()
|
|
||||||
tabnew
|
|
||||||
tabonly
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabline()
|
|
||||||
call s:assert.equals(&tabline, '%!lightline#tabline()')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.enabled()
|
|
||||||
let g:lightline = { 'enable': { 'tabline': 1 } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(&tabline, '%!lightline#tabline()')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.disabled()
|
|
||||||
let g:lightline = { 'enable': { 'tabline': 0 } }
|
|
||||||
call lightline#init()
|
|
||||||
call s:assert.equals(&tabline, '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew()
|
|
||||||
let tabline = lightline#tabline()
|
|
||||||
tabnew
|
|
||||||
call s:assert.not_equals(lightline#tabline(), tabline)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew_first()
|
|
||||||
let tabline = lightline#tabline()
|
|
||||||
0tabnew
|
|
||||||
call s:assert.not_equals(lightline#tabline(), tabline)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnext()
|
|
||||||
tabnew
|
|
||||||
let tabline = lightline#tabline()
|
|
||||||
tabnext
|
|
||||||
call s:assert.not_equals(lightline#tabline(), tabline)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabonly()
|
|
||||||
tabnew
|
|
||||||
tabfirst
|
|
||||||
let tabline = lightline#tabline()
|
|
||||||
tabonly
|
|
||||||
call s:assert.not_equals(lightline#tabline(), tabline)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabclose()
|
|
||||||
tabnew
|
|
||||||
let tabline = lightline#tabline()
|
|
||||||
tabclose
|
|
||||||
call s:assert.not_equals(lightline#tabline(), tabline)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabclose_last()
|
|
||||||
tabnew
|
|
||||||
tabfirst
|
|
||||||
let tabline = lightline#tabline()
|
|
||||||
$tabclose
|
|
||||||
call s:assert.not_equals(lightline#tabline(), tabline)
|
|
||||||
endfunction
|
|
@ -1,99 +0,0 @@
|
|||||||
let s:suite = themis#suite('tabs')
|
|
||||||
let s:assert = themis#helper('assert')
|
|
||||||
|
|
||||||
function! s:suite.before_each()
|
|
||||||
let g:lightline = { 'winwidth': 180 }
|
|
||||||
call lightline#init()
|
|
||||||
tabnew
|
|
||||||
tabonly
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:tab(number, ...) abort
|
|
||||||
let active = get(a:000, 0, 0)
|
|
||||||
let last = get(a:000, 1, 0)
|
|
||||||
return '%' . a:number . 'T%{lightline#onetab(' . a:number . ',' . active . ')}' . (last ? '%T' : '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabs()
|
|
||||||
call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1, 1)], []])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew()
|
|
||||||
tabnew
|
|
||||||
call s:assert.equals(lightline#tabs(), [[s:tab(1)], [s:tab(2, 1, 1)], []])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew_tabnew()
|
|
||||||
tabnew
|
|
||||||
tabnew
|
|
||||||
call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2)], [s:tab(3, 1, 1)], []])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew_tabfirst()
|
|
||||||
tabnew
|
|
||||||
tabfirst
|
|
||||||
call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1)], [s:tab(2, 0, 1)]])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew_tabnew_tabfirst()
|
|
||||||
tabnew
|
|
||||||
tabnew
|
|
||||||
tabfirst
|
|
||||||
call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1)], [s:tab(2), s:tab(3, 0, 1)]])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew_tabnew_tabprevious()
|
|
||||||
tabnew
|
|
||||||
tabnew
|
|
||||||
tabprevious
|
|
||||||
call s:assert.equals(lightline#tabs(), [[s:tab(1)], [s:tab(2, 1)], [s:tab(3, 0, 1)]])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew_20()
|
|
||||||
for i in range(19)
|
|
||||||
tabnew
|
|
||||||
endfor
|
|
||||||
call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), s:tab(3), s:tab(4), '...', s:tab(16), s:tab(17), s:tab(18), s:tab(19)], [s:tab(20, 1, 1)], []])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew_20_tabfirst()
|
|
||||||
for i in range(19)
|
|
||||||
tabnew
|
|
||||||
endfor
|
|
||||||
tabfirst
|
|
||||||
call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1)], [s:tab(2), s:tab(3), s:tab(4), '%<' . s:tab(5), '...', '%<' . s:tab(17), '%<' . s:tab(18), '%<' . s:tab(19), '%<' . s:tab(20, 0, 1)]])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew_20_tabfirst_tabnext()
|
|
||||||
for i in range(19)
|
|
||||||
tabnew
|
|
||||||
endfor
|
|
||||||
tabfirst
|
|
||||||
tabnext
|
|
||||||
call s:assert.equals(lightline#tabs(), [[s:tab(1)], [s:tab(2, 1)], [s:tab(3), s:tab(4), s:tab(5), '%<' . s:tab(6), '...', '%<' . s:tab(18), '%<' . s:tab(19), '%<' . s:tab(20, 0, 1)]])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew_20_tabnext_10()
|
|
||||||
for i in range(19)
|
|
||||||
tabnew
|
|
||||||
endfor
|
|
||||||
tabnext 10
|
|
||||||
call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), '...', s:tab(8), s:tab(9)], [s:tab(10, 1)], [s:tab(11), s:tab(12), '...', '%<' . s:tab(19), '%<' . s:tab(20, 0, 1)]])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew_20_tabprevious()
|
|
||||||
for i in range(19)
|
|
||||||
tabnew
|
|
||||||
endfor
|
|
||||||
tabprevious
|
|
||||||
call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), s:tab(3), '...', s:tab(15), s:tab(16), s:tab(17), s:tab(18)], [s:tab(19, 1)], [s:tab(20, 0, 1)]])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.tabnew_20_tabprevious_tabprevious()
|
|
||||||
for i in range(19)
|
|
||||||
tabnew
|
|
||||||
endfor
|
|
||||||
tabprevious
|
|
||||||
tabprevious
|
|
||||||
call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), s:tab(3), '...', s:tab(15), s:tab(16), s:tab(17)], [s:tab(18, 1)], [s:tab(19), s:tab(20, 0, 1)]])
|
|
||||||
endfunction
|
|
@ -1,37 +0,0 @@
|
|||||||
let s:suite = themis#suite('toggle')
|
|
||||||
let s:assert = themis#helper('assert')
|
|
||||||
|
|
||||||
function! s:suite.before_each()
|
|
||||||
let g:lightline = {}
|
|
||||||
call lightline#init()
|
|
||||||
tabnew
|
|
||||||
tabonly
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.default()
|
|
||||||
call s:assert.equals(exists('#lightline'), 1)
|
|
||||||
call s:assert.equals(exists('#lightline-disable'), 0)
|
|
||||||
call s:assert.not_equals(&tabline, '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.disable_enable()
|
|
||||||
call lightline#disable()
|
|
||||||
call s:assert.equals(exists('#lightline'), 0)
|
|
||||||
call s:assert.equals(exists('#lightline-disable'), 1)
|
|
||||||
call s:assert.equals(&tabline, '')
|
|
||||||
call lightline#enable()
|
|
||||||
call s:assert.equals(exists('#lightline'), 1)
|
|
||||||
call s:assert.equals(exists('#lightline-disable'), 0)
|
|
||||||
call s:assert.not_equals(&tabline, '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.toggle()
|
|
||||||
call lightline#toggle()
|
|
||||||
call s:assert.equals(exists('#lightline'), 0)
|
|
||||||
call s:assert.equals(exists('#lightline-disable'), 1)
|
|
||||||
call s:assert.equals(&tabline, '')
|
|
||||||
call lightline#toggle()
|
|
||||||
call s:assert.equals(exists('#lightline'), 1)
|
|
||||||
call s:assert.equals(exists('#lightline-disable'), 0)
|
|
||||||
call s:assert.not_equals(&tabline, '')
|
|
||||||
endfunction
|
|
@ -1,46 +0,0 @@
|
|||||||
let s:suite = themis#suite('uniq')
|
|
||||||
let s:assert = themis#helper('assert')
|
|
||||||
|
|
||||||
function! s:uniq(...)
|
|
||||||
try
|
|
||||||
return call(SID('uniq'), a:000)
|
|
||||||
catch
|
|
||||||
return call(function('uniq'), a:000)
|
|
||||||
endtry
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.nil()
|
|
||||||
call s:assert.equals(s:uniq([]), [])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.one()
|
|
||||||
call s:assert.equals(s:uniq(['foo']), ['foo'])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.two()
|
|
||||||
call s:assert.equals(s:uniq(['foo', 'bar']), ['foo', 'bar'])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.three()
|
|
||||||
call s:assert.equals(s:uniq(['foo', 'bar', 'baz']), ['foo', 'bar', 'baz'])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.two_duplicated()
|
|
||||||
call s:assert.equals(s:uniq(['foo', 'foo']), ['foo'])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.three_duplicated()
|
|
||||||
call s:assert.equals(s:uniq(['foo', 'bar', 'foo']), ['foo', 'bar', 'foo'])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.many1()
|
|
||||||
call s:assert.equals(s:uniq(['foo', 'foo', 'bar', 'baz', 'baz', 'qux', 'foo']), ['foo', 'bar', 'baz', 'qux', 'foo'])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.many2()
|
|
||||||
call s:assert.equals(s:uniq(['foo', 'foo', 'foo', 'foo', 'bar', 'bar', 'bar']), ['foo', 'bar'])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:suite.many3()
|
|
||||||
call s:assert.equals(s:uniq(['foo', 'foo', 'bar', 'bar', 'bar', 'foo', 'foo', 'foo']), ['foo', 'bar', 'foo'])
|
|
||||||
endfunction
|
|
@ -1,43 +0,0 @@
|
|||||||
This is a mirror of http://www.vim.org/scripts/script.php?script_id=3065
|
|
||||||
|
|
||||||
This is a pleasant and ergonomic light-background color scheme, designed for long hours of coding and working. The UI elements are muted without being drab, the syntax elements are colorful without being garish, and the background is relaxing without being soporific. It is of a low-enough contrast so as not to cause eye-burn, but high-enough contrast so as not to cause eye-strain. The syntax coloration offers just a little higher resolution than most, distinguishing between class names vs. functions, strings and numbers vs. other constants, etc. Many of the colors in this color scheme are drawn from Mayan murals, paintings and codices, and thus the name.
|
|
||||||
|
|
||||||
Screenshots:
|
|
||||||
==========
|
|
||||||
|
|
||||||
- Python: http://jeetworks.org/files/images/mayansmoke-python1.png
|
|
||||||
- C++: http://jeetworks.org/files/images/mayansmoke-cpp1.png
|
|
||||||
|
|
||||||
Customization:
|
|
||||||
==============
|
|
||||||
|
|
||||||
If any of the following highlights are defined (e.g., in your "~/.vimrc"), these will override the default highlight definitions:
|
|
||||||
|
|
||||||
MayanSmokeCursorLine (will be applied to: CursorColumn and CursorLine)
|
|
||||||
MayanSmokeSearch (will be applied to: Search and IncSearch)
|
|
||||||
MayanSmokeSpecialKey (will be applied to: SpecialKey)
|
|
||||||
|
|
||||||
For example, you can set the following in your "~/.vimrc" to select your own colors for these items:
|
|
||||||
|
|
||||||
hi MayanSmokeCursorLine guifg=NONE guibg=yellow gui=NONE
|
|
||||||
hi MayanSmokeSearch guifg=white guibg=blue gui=NONE
|
|
||||||
hi MayanSmokeSpecialKey guifg=NONE guibg=green gui=NONE
|
|
||||||
|
|
||||||
Alternatively, you can define one or more of the following values in your "~/.vimrc" to select different pre-defined levels of visibility for the above highlights:
|
|
||||||
|
|
||||||
let g:mayansmoke_cursor_line_visibility = 0 " lower visibility
|
|
||||||
let g:mayansmoke_cursor_line_visibility = 1 " medium visibility
|
|
||||||
let g:mayansmoke_cursor_line_visibility = 2 " higher visibility
|
|
||||||
|
|
||||||
let g:mayansmoke_search_visibility = 0 " low visibility
|
|
||||||
let g:mayansmoke_search_visibility = 1 " medium visibility (default)
|
|
||||||
let g:mayansmoke_search_visibility = 2 " high visibility
|
|
||||||
let g:mayansmoke_search_visibility = 3 " very high visibility
|
|
||||||
let g:mayansmoke_search_visibility = 4 " highest visibility
|
|
||||||
|
|
||||||
let g:mayansmoke_special_key_visibility = 0 " lower visibility
|
|
||||||
let g:mayansmoke_special_key_visibility = 1 " medium visibility
|
|
||||||
let g:mayansmoke_special_key_visibility = 2 " higher visibility
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,343 +0,0 @@
|
|||||||
" =============================================================================
|
|
||||||
"
|
|
||||||
" File: mayansmoke.vim
|
|
||||||
" Description: Vim color scheme file
|
|
||||||
" Maintainer: Jeet Sukumaran (GUI colors); Clayton Parker (cterm colors)
|
|
||||||
"
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" Initialization and Setup {{{1
|
|
||||||
" =============================================================================
|
|
||||||
set background=light
|
|
||||||
highlight clear
|
|
||||||
if exists("syntax_on")
|
|
||||||
syntax reset
|
|
||||||
endif
|
|
||||||
let colors_name = "mayansmoke"
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" Normal Color {{{1
|
|
||||||
" =============================================================================
|
|
||||||
hi Normal gui=NONE guifg=Black guibg=#F4F4E8
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" Highlight Groups {{{1
|
|
||||||
" =============================================================================
|
|
||||||
" Groups (see ':help highlight-groups'):
|
|
||||||
" ColorColumn highlight to use with ':set colorcolumn'
|
|
||||||
" Cursor the character under the cursor
|
|
||||||
" CursorIM like Cursor, but used when in IME mode |CursorIM|
|
|
||||||
" CursorColumn the screen column that the cursor is in when 'cursorcolumn' is set
|
|
||||||
" CursorLine the screen line that the cursor is in when 'cursorline' is set
|
|
||||||
" Directory directory names (and other special names in listings)
|
|
||||||
" DiffAdd diff mode: Added line |diff.txt|
|
|
||||||
" DiffChange diff mode: Changed line |diff.txt|
|
|
||||||
" DiffDelete diff mode: Deleted line |diff.txt|
|
|
||||||
" DiffText diff mode: Changed text within a changed line |diff.txt|
|
|
||||||
" ErrorMsg error messages on the command line
|
|
||||||
" VertSplit the column separating vertically split windows
|
|
||||||
" Folded line used for closed folds
|
|
||||||
" FoldColumn 'foldcolumn'
|
|
||||||
" SignColumn column where |signs| are displayed
|
|
||||||
" IncSearch 'incsearch' highlighting; also used for the text replaced with ":s///c"
|
|
||||||
" LineNr Line number for ":number" and ":#" commands, and when 'number' option is set.
|
|
||||||
" MatchParen The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
|
|
||||||
" ModeMsg 'showmode' message (e.g., "-- INSERT --")
|
|
||||||
" MoreMsg |more-prompt|
|
|
||||||
" NonText '~' and '@' at the end of the window, etc.
|
|
||||||
" Normal normal text
|
|
||||||
" Pmenu Popup menu: normal item.
|
|
||||||
" PmenuSel Popup menu: selected item.
|
|
||||||
" PmenuSbar Popup menu: scrollbar.
|
|
||||||
" PmenuThumb Popup menu: Thumb of the scrollbar.
|
|
||||||
" Question |hit-enter| prompt and yes/no questions
|
|
||||||
" Search Last search pattern highlighting (see 'hlsearch').
|
|
||||||
" SpecialKey Meta and special keys listed with ":map", text that is displayed differently from what it really is (such as tabs, spaces in listchars etc.).
|
|
||||||
" SpellBad Word that is not recognized by the spellchecker. |spell|
|
|
||||||
" SpellCap Word that should start with a capital. |spell|
|
|
||||||
" SpellLocal Word that is recognized by the spellchecker as one that is
|
|
||||||
" SpellRare Word that is recognized by the spellchecker as one that is hardly ever used. |spell|
|
|
||||||
" StatusLine status line of current window
|
|
||||||
" StatusLineNC status lines of not-current windows
|
|
||||||
" TabLine tab pages line, not active tab page label
|
|
||||||
" TabLineFill tab pages line, where there are no labels
|
|
||||||
" TabLineSel tab pages line, active tab page label
|
|
||||||
" Title titles for output from ":set all", ":autocmd" etc.
|
|
||||||
" Visual Visual mode selection
|
|
||||||
" VisualNOS Visual mode selection when vim is "Not Owning the Selection".
|
|
||||||
" WarningMsg warning messages
|
|
||||||
" WildMenu current match in 'wildmenu' completion
|
|
||||||
hi ColorColumn guifg=NONE guibg=#EEEEDD
|
|
||||||
hi Cursor guifg=bg guibg=fg gui=NONE
|
|
||||||
if hlexists('MayanSmokeCursorLine')
|
|
||||||
hi link CursorColumn MayanSmokeCursorLine
|
|
||||||
hi link CursorLine MayanSmokeCursorLine
|
|
||||||
elseif exists('g:mayansmoke_cursor_line_visibility') && g:mayansmoke_cursor_line_visibility >= 2
|
|
||||||
hi CursorColumn guifg=NONE guibg=NavajoWhite gui=NONE
|
|
||||||
hi CursorLine guifg=NONE guibg=NavajoWhite gui=NONE
|
|
||||||
elseif exists('g:mayansmoke_cursor_line_visibility') && g:mayansmoke_cursor_line_visibility >= 1
|
|
||||||
hi CursorColumn guifg=NONE guibg=white gui=NONE
|
|
||||||
hi CursorLine guifg=NONE guibg=white gui=NONE
|
|
||||||
else
|
|
||||||
hi CursorColumn guifg=NONE guibg=#FFFDD0 gui=NONE
|
|
||||||
hi CursorLine guifg=NONE guibg=#FFFDD0 gui=NONE
|
|
||||||
endif
|
|
||||||
hi CursorIM guifg=bg guibg=fg gui=NONE
|
|
||||||
hi lCursor guifg=bg guibg=fg gui=NONE
|
|
||||||
hi DiffAdd guifg=NONE guibg=SeaGreen1 gui=NONE
|
|
||||||
hi DiffChange guifg=NONE guibg=LightSkyBlue1 gui=NONE
|
|
||||||
hi DiffDelete guifg=NONE guibg=LightCoral gui=NONE
|
|
||||||
hi DiffText guifg=black guibg=LightCyan1 gui=NONE
|
|
||||||
hi Directory guifg=#1600FF guibg=bg gui=NONE
|
|
||||||
hi ErrorMsg guifg=Red2 guibg=NONE gui=NONE
|
|
||||||
hi FoldColumn guifg=SteelBlue4 guibg=LightYellow2 gui=bold
|
|
||||||
hi Folded guifg=SteelBlue4 guibg=Gainsboro gui=italic
|
|
||||||
if hlexists('MayanSmokeSearch')
|
|
||||||
hi link IncSearch MayanSmokeSearch
|
|
||||||
hi link Search MayanSmokeSearch
|
|
||||||
elseif exists('g:mayansmoke_search_visibility') && g:mayansmoke_search_visibility >= 4
|
|
||||||
hi IncSearch guifg=white guibg=red gui=NONE
|
|
||||||
hi Search guifg=white guibg=red gui=NONE
|
|
||||||
elseif exists('g:mayansmoke_search_visibility') && g:mayansmoke_search_visibility == 3
|
|
||||||
hi IncSearch guifg=black guibg=gold gui=NONE
|
|
||||||
hi Search guifg=black guibg=gold gui=NONE
|
|
||||||
elseif exists('g:mayansmoke_search_visibility') && g:mayansmoke_search_visibility == 2
|
|
||||||
hi IncSearch guifg=white guibg=darkorange gui=NONE
|
|
||||||
hi Search guifg=white guibg=darkorange gui=NONE
|
|
||||||
elseif exists('g:mayansmoke_search_visibility') && g:mayansmoke_search_visibility == 0
|
|
||||||
hi IncSearch guifg=black guibg=tan gui=NONE
|
|
||||||
hi Search guifg=black guibg=tan gui=NONE
|
|
||||||
else
|
|
||||||
hi IncSearch guifg=black guibg=khaki gui=NONE
|
|
||||||
hi Search guifg=black guibg=khaki gui=NONE
|
|
||||||
endif
|
|
||||||
hi LineNr guifg=#666677 guibg=#cccfbf gui=NONE
|
|
||||||
hi MatchParen guifg=black guibg=LemonChiffon3 gui=bold
|
|
||||||
hi ModeMsg guifg=White guibg=tomato1 gui=bold
|
|
||||||
hi MoreMsg guifg=SeaGreen4 guibg=bg gui=bold
|
|
||||||
hi NonText guifg=LightCyan3 guibg=bg gui=bold
|
|
||||||
|
|
||||||
hi Pmenu guifg=Orange4 guibg=LightYellow3 gui=NONE
|
|
||||||
hi PmenuSel guifg=ivory2 guibg=NavajoWhite4 gui=bold
|
|
||||||
hi PmenuSbar guifg=White guibg=#999666 gui=NONE
|
|
||||||
hi PmenuThumb guifg=White guibg=#7B7939 gui=NONE
|
|
||||||
|
|
||||||
hi Question guifg=Chartreuse4 guibg=bg gui=bold
|
|
||||||
hi SignColumn guifg=white guibg=LightYellow3 gui=NONE
|
|
||||||
if hlexists('MayanSmokeSpecialKey')
|
|
||||||
hi link SpecialKey MayanSmokeSpecialKey
|
|
||||||
elseif exists('g:mayansmoke_special_key_visibility') && g:mayansmoke_special_key_visibility >= 2
|
|
||||||
hi SpecialKey guifg=black guibg=NavajoWhite gui=NONE
|
|
||||||
elseif exists('g:mayansmoke_special_key_visibility') && g:mayansmoke_special_key_visibility == 0
|
|
||||||
hi SpecialKey guifg=bisque3 guibg=NONE gui=NONE
|
|
||||||
else
|
|
||||||
hi SpecialKey guifg=white guibg=ivory3 gui=NONE
|
|
||||||
endif
|
|
||||||
hi SpellBad guisp=Firebrick2 gui=undercurl
|
|
||||||
hi SpellCap guisp=Blue gui=undercurl
|
|
||||||
hi SpellLocal guisp=DarkCyan gui=undercurl
|
|
||||||
hi SpellRare guisp=Magenta gui=undercurl
|
|
||||||
hi StatusLine guifg=#FFFEEE guibg=#557788 gui=NONE
|
|
||||||
" hi StatusLineNC guifg=#EAE6E2 guibg=LightSteelBlue3 gui=italic
|
|
||||||
hi StatusLineNC guifg=#F4F4EE guibg=#99aabb gui=italic
|
|
||||||
hi TabLine guifg=fg guibg=LightGrey gui=underline
|
|
||||||
hi TabLineFill guifg=fg guibg=bg gui=reverse
|
|
||||||
hi TabLineSel guifg=fg guibg=bg gui=bold
|
|
||||||
hi Title guifg=DeepSkyBlue3 guibg=bg gui=bold
|
|
||||||
hi VertSplit guifg=#99aabb guibg=#99aabb
|
|
||||||
hi Visual guifg=white guibg=DeepSkyBlue1 gui=NONE
|
|
||||||
hi WarningMsg guifg=Firebrick2 guibg=bg gui=NONE
|
|
||||||
hi WildMenu guifg=Black guibg=SkyBlue gui=NONE
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" 256-Color Terminal Colors, by Clayton Parker {{{1
|
|
||||||
" =============================================================================
|
|
||||||
hi Normal cterm=NONE ctermfg=16 ctermbg=255
|
|
||||||
hi Comment ctermfg=110
|
|
||||||
hi Constant ctermfg=214
|
|
||||||
hi String ctermfg=30
|
|
||||||
hi Boolean ctermfg=88
|
|
||||||
hi Identifier ctermfg=160
|
|
||||||
hi Function ctermfg=132
|
|
||||||
hi Statement ctermfg=21
|
|
||||||
hi Keyword ctermfg=45
|
|
||||||
hi PreProc ctermfg=27
|
|
||||||
hi Type ctermfg=147
|
|
||||||
hi Special ctermfg=64
|
|
||||||
hi Ignore ctermfg=255
|
|
||||||
hi Error ctermfg=196 ctermbg=255 term=none
|
|
||||||
hi Todo ctermfg=136 ctermbg=255 cterm=NONE
|
|
||||||
hi VimError ctermfg=160 ctermbg=16
|
|
||||||
hi VimCommentTitle ctermfg=110
|
|
||||||
hi qfLineNr ctermfg=16 ctermbg=46 cterm=NONE
|
|
||||||
hi pythonDecorator ctermfg=208 ctermbg=255 cterm=NONE
|
|
||||||
hi Cursor ctermfg=255 ctermbg=16 cterm=NONE
|
|
||||||
hi CursorColumn ctermfg=NONE ctermbg=255 cterm=NONE
|
|
||||||
hi CursorIM ctermfg=255 ctermbg=16 cterm=NONE
|
|
||||||
hi CursorLine ctermfg=NONE ctermbg=254 cterm=NONE
|
|
||||||
hi lCursor ctermfg=255 ctermbg=16 cterm=NONE
|
|
||||||
hi DiffAdd ctermfg=16 ctermbg=48 cterm=NONE
|
|
||||||
hi DiffChange ctermfg=16 ctermbg=153 cterm=NONE
|
|
||||||
hi DiffDelete ctermfg=16 ctermbg=203 cterm=NONE
|
|
||||||
hi DiffText ctermfg=16 ctermbg=226 cterm=NONE
|
|
||||||
hi Directory ctermfg=21 ctermbg=255 cterm=NONE
|
|
||||||
hi ErrorMsg ctermfg=160 ctermbg=NONE cterm=NONE
|
|
||||||
hi FoldColumn ctermfg=24 ctermbg=252 cterm=NONE
|
|
||||||
hi Folded ctermfg=24 ctermbg=252 cterm=NONE
|
|
||||||
hi IncSearch ctermfg=255 ctermbg=160 cterm=NONE
|
|
||||||
hi LineNr ctermfg=253 ctermbg=110 cterm=NONE
|
|
||||||
hi NonText ctermfg=110 ctermbg=255 cterm=NONE
|
|
||||||
hi Pmenu ctermfg=fg ctermbg=195 cterm=NONE
|
|
||||||
hi PmenuSbar ctermfg=255 ctermbg=153 cterm=NONE
|
|
||||||
hi PmenuSel ctermfg=255 ctermbg=21 cterm=NONE
|
|
||||||
hi PmenuThumb ctermfg=111 ctermbg=255 cterm=NONE
|
|
||||||
hi SignColumn ctermfg=110 ctermbg=254 cterm=NONE
|
|
||||||
hi Search ctermfg=255 ctermbg=160 cterm=NONE
|
|
||||||
hi SpecialKey ctermfg=255 ctermbg=144 cterm=NONE
|
|
||||||
hi SpellBad ctermfg=16 ctermbg=229 cterm=NONE
|
|
||||||
hi SpellCap ctermfg=16 ctermbg=231 cterm=NONE
|
|
||||||
hi SpellLocal ctermfg=16 ctermbg=231 cterm=NONE
|
|
||||||
hi SpellRare ctermfg=16 ctermbg=226 cterm=NONE
|
|
||||||
hi StatusLine ctermfg=255 ctermbg=24 cterm=NONE
|
|
||||||
hi StatusLineNC ctermfg=253 ctermbg=110 cterm=NONE
|
|
||||||
hi Title ctermfg=75 ctermbg=255 cterm=NONE
|
|
||||||
hi VertSplit ctermfg=255 ctermbg=24 cterm=NONE
|
|
||||||
hi Visual ctermfg=255 ctermbg=153 cterm=NONE
|
|
||||||
hi WildMenu ctermfg=16 ctermbg=117 cterm=NONE
|
|
||||||
|
|
||||||
" 1}}}
|
|
||||||
|
|
||||||
" Syntax {{{1
|
|
||||||
" =============================================================================
|
|
||||||
|
|
||||||
" General {{{2
|
|
||||||
" -----------------------------------------------------------------------------
|
|
||||||
" Groups ('*' = major; see 'help group-name'):
|
|
||||||
" *Comment any comment
|
|
||||||
" *Constant any constant
|
|
||||||
" String a string constant: "this is a string"
|
|
||||||
" Character a character constant: 'c', '\n'
|
|
||||||
" Number a number constant: 234, 0xff
|
|
||||||
" Boolean a boolean constant: TRUE, false
|
|
||||||
" Float a floating point constant: 2.3e10
|
|
||||||
" *Identifier any variable name
|
|
||||||
" Function function name (also: methods for classes)
|
|
||||||
" *Statement any statement
|
|
||||||
" Conditional if, then, else, endif, switch, etc.
|
|
||||||
" Repeat for, do, while, etc.
|
|
||||||
" Label case, default, etc.
|
|
||||||
" Operator "sizeof", "+", "*", etc.
|
|
||||||
" Keyword any other keyword
|
|
||||||
" Exception try, catch, throw
|
|
||||||
" *PreProc generic Preprocessor
|
|
||||||
" Include preprocessor #include
|
|
||||||
" Define preprocessor #define
|
|
||||||
" Macro same as Define
|
|
||||||
" PreCondit preprocessor #if, #else, #endif, etc.
|
|
||||||
" *Type int, long, char, etc.
|
|
||||||
" StorageClass static, register, volatile, etc.
|
|
||||||
" Structure struct, union, enum, etc.
|
|
||||||
" Typedef A typedef
|
|
||||||
" *Special any special symbol
|
|
||||||
" SpecialChar special character in a constant
|
|
||||||
" Tag you can use CTRL-] on this
|
|
||||||
" Delimiter character that needs attention
|
|
||||||
" SpecialComment special things inside a comment
|
|
||||||
" Debug debugging statements
|
|
||||||
" *Error any erroneous construct
|
|
||||||
" *Todo anything that needs extra attention
|
|
||||||
" hi Comment guifg=#A2B5CD guibg=NONE gui=italic
|
|
||||||
hi Comment guifg=#96AAC2 guibg=NONE gui=italic
|
|
||||||
hi Constant guifg=DarkOrange guibg=NONE gui=NONE
|
|
||||||
hi String guifg=Aquamarine4 guibg=NONE gui=NONE
|
|
||||||
hi Boolean guifg=IndianRed4 guibg=NONE gui=NONE
|
|
||||||
hi Identifier guifg=brown3 guibg=NONE gui=NONE
|
|
||||||
hi Function guifg=VioletRed4 guibg=NONE gui=NONE
|
|
||||||
hi Statement guifg=blue1 guibg=NONE gui=NONE
|
|
||||||
hi Keyword guifg=DodgerBlue guibg=NONE gui=NONE
|
|
||||||
hi PreProc guifg=blue1 guibg=NONE gui=NONE
|
|
||||||
hi Type guifg=LightSlateBlue guibg=NONE gui=NONE
|
|
||||||
hi Special guifg=DarkOliveGreen4 guibg=NONE gui=NONE
|
|
||||||
hi Ignore guifg=bg guibg=NONE gui=NONE
|
|
||||||
hi Error guifg=Red guibg=NONE gui=underline
|
|
||||||
hi Todo guifg=tan4 guibg=NONE gui=underline
|
|
||||||
" 2}}}
|
|
||||||
|
|
||||||
" Vim {{{2
|
|
||||||
" -----------------------------------------------------------------------------
|
|
||||||
hi VimError guifg=red guibg=Black gui=bold
|
|
||||||
hi VimCommentTitle guifg=DarkSlateGray4 guibg=bg gui=bold,italic
|
|
||||||
" 2}}}
|
|
||||||
|
|
||||||
" QuickFix {{{2
|
|
||||||
" -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
" syn match qfFileName "^[^|]*" nextgroup=qfSeparator
|
|
||||||
" syn match qfSeparator "|" nextgroup=qfLineNr contained
|
|
||||||
" syn match qfLineNr "[^|]*" contained contains=qfError
|
|
||||||
" syn match qfError "error" contained
|
|
||||||
hi qfFileName guifg=LightSkyBlue4 guibg=NONE gui=italic
|
|
||||||
hi qfLineNr guifg=coral guibg=NONE gui=bold
|
|
||||||
hi qfError guifg=red guibg=NONE gui=bold
|
|
||||||
" 2}}}
|
|
||||||
|
|
||||||
" Python {{{2
|
|
||||||
" -----------------------------------------------------------------------------
|
|
||||||
hi pythonDecorator guifg=orange3 guibg=NONE gui=bold
|
|
||||||
hi link pythonDecoratorFunction pythonDecorator
|
|
||||||
" 2}}}
|
|
||||||
|
|
||||||
" Diff {{{2
|
|
||||||
" -----------------------------------------------------------------------------
|
|
||||||
hi diffOldFile guifg=#006666 guibg=NONE gui=NONE
|
|
||||||
hi diffNewFile guifg=#0088FF guibg=NONE gui=bold
|
|
||||||
hi diffFile guifg=#0000FF guibg=NONE gui=NONE
|
|
||||||
hi link diffOnly Constant
|
|
||||||
hi link diffIdentical Constant
|
|
||||||
hi link diffDiffer Constant
|
|
||||||
hi link diffBDiffer Constant
|
|
||||||
hi link diffIsA Constant
|
|
||||||
hi link diffNoEOL Constant
|
|
||||||
hi link diffCommon Constant
|
|
||||||
hi diffRemoved guifg=#BB0000 guibg=NONE gui=NONE
|
|
||||||
hi diffChanged guifg=DarkSeaGreen guibg=NONE gui=NONE
|
|
||||||
hi diffAdded guifg=#00AA00 guibg=NONE gui=NONE
|
|
||||||
hi diffLine guifg=thistle4 guibg=NONE gui=italic
|
|
||||||
hi link diffSubname diffLine
|
|
||||||
hi link diffComment Comment
|
|
||||||
" 2}}}
|
|
||||||
|
|
||||||
" PHP (contributed by Ryan Kulla) {{{2
|
|
||||||
" -----------------------------------------------------------------------------
|
|
||||||
" Ryan Kulla's addition for PHP syntax highlighting (for regular/terminal vim)
|
|
||||||
hi phpConditional ctermfg=21 cterm=NONE guifg=black
|
|
||||||
hi phpIdentifier ctermfg=0 cterm=NONE guifg=black
|
|
||||||
hi phpOperator ctermfg=black cterm=NONE guifg=black
|
|
||||||
hi phpRegion ctermfg=132 cterm=NONE guifg=VioletRed4
|
|
||||||
hi phpComparison ctermfg=black cterm=NONE guifg=black
|
|
||||||
hi phpType ctermfg=darkgreen cterm=NONE guifg=darkgreen
|
|
||||||
hi phpParent ctermfg=black cterm=NONE guifg=black
|
|
||||||
hi phpMethodsVar ctermfg=132 cterm=NONE guifg=VioletRed4
|
|
||||||
hi phpStatement ctermfg=21 cterm=NONE guifg=blue
|
|
||||||
hi phpStorageClass ctermfg=21 cterm=NONE guifg=blue
|
|
||||||
hi phpStringSingle ctermfg=30 cterm=NONE guifg=Aquamarine4
|
|
||||||
hi phpStringDouble ctermfg=30 cterm=NONE guifg=Aquamarine4
|
|
||||||
hi phpFunctions ctermfg=21 cterm=NONE guifg=blue
|
|
||||||
hi phpSpecialFunction ctermfg=21 cterm=NONE guifg=blue
|
|
||||||
hi phpRepeat ctermfg=21 cterm=NONE guifg=blue
|
|
||||||
hi phpNumber ctermfg=214 cterm=bold guifg=brown
|
|
||||||
hi phpTodo ctermfg=red cterm=bold guifg=red gui=bold
|
|
||||||
hi phpDefine ctermfg=21 cterm=NONE guifg=blue
|
|
||||||
hi phpConstant ctermfg=21 cterm=NONE guifg=black
|
|
||||||
hi phpCoreConstant ctermfg=21 cterm=NONE guifg=black
|
|
||||||
hi phpMemberSelector ctermfg=black cterm=NONE guifg=black
|
|
||||||
hi phpLabel ctermfg=21 cterm=NONE guifg=blue
|
|
||||||
hi phpStructure ctermfg=black cterm=NONE guifg=black
|
|
||||||
hi phpRelation ctermfg=black cterm=NONE guifg=black
|
|
||||||
hi phpEnvVar ctermfg=black cterm=NONE guifg=black
|
|
||||||
hi phpIntVar ctermfg=0 cterm=bold guifg=black gui=bold
|
|
||||||
hi phpBoolean ctermfg=58 cterm=NONE guifg=brown
|
|
||||||
" 2}}}
|
|
||||||
|
|
||||||
" 1}}}
|
|
||||||
|
|
@ -1,192 +0,0 @@
|
|||||||
This is a mirror of http://www.vim.org/scripts/script.php?script_id=521
|
|
||||||
|
|
||||||
Overview
|
|
||||||
|
|
||||||
The Most Recently Used (MRU) plugin provides an easy access to a list of
|
|
||||||
recently opened/edited files in Vim. This plugin automatically stores the
|
|
||||||
file names as you open/edit them in Vim.
|
|
||||||
|
|
||||||
This plugin will work on all the platforms where Vim is supported. This
|
|
||||||
plugin will work in both console and GUI Vim. This version of the MRU
|
|
||||||
plugin needs Vim 7.0 and above. If you are using an earlier version of
|
|
||||||
Vim, then you should use an older version of the MRU plugin.
|
|
||||||
|
|
||||||
The recently used filenames are stored in a file specified by the Vim
|
|
||||||
MRU_File variable.
|
|
||||||
|
|
||||||
The Github repository for the MRU plugin is available at:
|
|
||||||
|
|
||||||
http://github.com/yegappan/mru
|
|
||||||
|
|
||||||
Usage
|
|
||||||
|
|
||||||
To list and edit files from the MRU list, you can use the ":MRU" command.
|
|
||||||
The ":MRU" command displays the MRU file list in a temporary Vim window. If
|
|
||||||
the MRU window is already opened, then the MRU list displayed in the window
|
|
||||||
is refreshed.
|
|
||||||
|
|
||||||
If you are using GUI Vim, then the names of the recently edited files are
|
|
||||||
added to the "File->Recent Files" menu. You can select the name of a file
|
|
||||||
from this sub-menu to edit the file.
|
|
||||||
|
|
||||||
You can use the normal Vim commands to move around in the MRU window. You
|
|
||||||
cannot make changes in the MRU window.
|
|
||||||
|
|
||||||
You can select a file name to edit by pressing the <Enter> key or by double
|
|
||||||
clicking the left mouse button on a file name. The selected file will be
|
|
||||||
opened. If the file is already opened in a window, the cursor will be moved
|
|
||||||
to that window. Otherwise, the file is opened in the previous window. If the
|
|
||||||
previous window has a modified buffer or is the preview window or is used by
|
|
||||||
some other plugin, then the file is opened in a new window.
|
|
||||||
|
|
||||||
You can press the 'o' key to open the file name under the cursor in the
|
|
||||||
MRU window in a new window. You can also press <Shift-Enter> instead of 'o'
|
|
||||||
to open the file in a new window.
|
|
||||||
|
|
||||||
To open a file from the MRU window in read-only mode (view), press the 'v'
|
|
||||||
key.
|
|
||||||
|
|
||||||
To open a file from the MRU window in a new tab, press the 't' key. If the
|
|
||||||
file is already opened in a window in the current or in another tab, then
|
|
||||||
the cursor is moved to that tab. Otherwise, a new tab is opened.
|
|
||||||
|
|
||||||
You can open multiple files from the MRU window by specifying a count before
|
|
||||||
pressing '<Enter>' or 'v' or 'o' or 't'. You can also visually (using
|
|
||||||
linewise visual mode) select multiple filenames and invoke the commands to
|
|
||||||
open the files. Each selected file will be opened in a separate window or
|
|
||||||
tab.
|
|
||||||
|
|
||||||
You can press the 'u' key in the MRU window to update the file list. This is
|
|
||||||
useful if you keep the MRU window open always.
|
|
||||||
|
|
||||||
You can close the MRU window by pressing the 'q' key or the <Esc> key or
|
|
||||||
using one of the Vim window commands.
|
|
||||||
|
|
||||||
To display only files matching a pattern from the MRU list in the MRU
|
|
||||||
window, you can specify a pattern to the ":MRU" command. For example, to
|
|
||||||
display only file names matching "vim" in them, you can use the following
|
|
||||||
command ":MRU vim". When you specify a partial file name and only one
|
|
||||||
matching filename is found, then the ":MRU" command will edit that file.
|
|
||||||
|
|
||||||
The ":MRU" command supports command-line completion of file names from
|
|
||||||
the MRU list. You can enter a partial file name and then press <Tab>
|
|
||||||
or <Ctrl-D> to complete or list all the matching file names. Note that
|
|
||||||
after typing the ":MRU" command, you have to enter a space before completing
|
|
||||||
the file names with <Tab>.
|
|
||||||
|
|
||||||
When a file supplied to the ":MRU" command is not present in the MRU list,
|
|
||||||
but it is a readable file, then the file will be opened (even though it is
|
|
||||||
not present in the MRU list). This is useful if you want to open a file
|
|
||||||
present in the same directory as a file in the MRU list. You can use the
|
|
||||||
command-line completion of the ":MRU" command to complete the full path of a
|
|
||||||
file and then modify the path to open another file present in the same path.
|
|
||||||
|
|
||||||
Whenever the MRU list changes, the MRU file is updated with the latest MRU
|
|
||||||
list. When you have multiple instances of Vim running at the same time, the
|
|
||||||
latest MRU list will show up in all the instances of Vim.
|
|
||||||
|
|
||||||
The MRUFilename syntax group is used to highlight the file names in the MRU
|
|
||||||
window. By default, this syntax group is linked to the Identifier highlight
|
|
||||||
group. You can change the highlight group by adding the following line in
|
|
||||||
your .vimrc:
|
|
||||||
|
|
||||||
highlight link MRUFileName LineNr
|
|
||||||
|
|
||||||
The MRU buffer uses the 'mru file type. You can use this file type to add
|
|
||||||
custom auto commands, syntax highlighting, etc.
|
|
||||||
|
|
||||||
Configuration
|
|
||||||
|
|
||||||
By changing the following variables you can configure the behavior of this
|
|
||||||
plugin. Set the following variables in your .vimrc file using the 'let'
|
|
||||||
command.
|
|
||||||
|
|
||||||
The list of recently edited file names is stored in the file specified by the
|
|
||||||
MRU_File variable. The default setting for this variable is
|
|
||||||
$HOME/.vim_mru_files for Unix-like systems and $USERPROFILE/_vim_mru_files
|
|
||||||
for MS-Windows systems. You can change this variable to point to a file by
|
|
||||||
adding the following line to the .vimrc file:
|
|
||||||
|
|
||||||
let MRU_File = 'd:\myhome\_vim_mru_files'
|
|
||||||
|
|
||||||
By default, the plugin will remember the names of the last 100 used files.
|
|
||||||
As you edit more files, old file names will be removed from the MRU list.
|
|
||||||
You can set the 'MRU_Max_Entries' variable to remember more file names. For
|
|
||||||
example, to remember 1000 most recently used file names, you can use
|
|
||||||
|
|
||||||
let MRU_Max_Entries = 1000
|
|
||||||
|
|
||||||
By default, all the edited file names will be added to the MRU list. If you
|
|
||||||
want to exclude file names matching a list of patterns, you can set the
|
|
||||||
MRU_Exclude_Files variable to a list of Vim regular expressions. By default,
|
|
||||||
this variable is set to an empty string. For example, to not include files
|
|
||||||
in the temporary (/tmp, /var/tmp and d:\temp) directories, you can set the
|
|
||||||
MRU_Exclude_Files variable to
|
|
||||||
|
|
||||||
let MRU_Exclude_Files = '^/tmp/.*\|^/var/tmp/.*' " For Unix
|
|
||||||
let MRU_Exclude_Files = '^c:\\temp\\.*' " For MS-Windows
|
|
||||||
|
|
||||||
The specified pattern should be a Vim regular expression pattern.
|
|
||||||
|
|
||||||
If you want to add only file names matching a set of patterns to the MRU
|
|
||||||
list, then you can set the MRU_Include_Files variable. This variable should
|
|
||||||
be set to a Vim regular expression pattern. For example, to add only .c and
|
|
||||||
.h files to the MRU list, you can set this variable as below:
|
|
||||||
|
|
||||||
let MRU_Include_Files = '\.c$\|\.h$'
|
|
||||||
|
|
||||||
By default, MRU_Include_Files is set to an empty string and all the edited
|
|
||||||
filenames are added to the MRU list.
|
|
||||||
|
|
||||||
The default height of the MRU window is 8. You can set the MRU_Window_Height
|
|
||||||
variable to change the window height.
|
|
||||||
|
|
||||||
let MRU_Window_Height = 15
|
|
||||||
|
|
||||||
By default, when the :MRU command is invoked, the MRU list will be displayed
|
|
||||||
in a new window. Instead, if you want the MRU plugin to reuse the current
|
|
||||||
window, then you can set the 'MRU_Use_Current_Window' variable to one.
|
|
||||||
|
|
||||||
let MRU_Use_Current_Window = 1
|
|
||||||
|
|
||||||
The MRU plugin will reuse the current window. When a file name is selected,
|
|
||||||
the file is also opened in the current window.
|
|
||||||
|
|
||||||
When you select a file from the MRU window, the MRU window will be
|
|
||||||
automatically closed and the selected file will be opened in the previous
|
|
||||||
window. You can set the 'MRU_Auto_Close' variable to zero to keep the MRU
|
|
||||||
window open.
|
|
||||||
|
|
||||||
let MRU_Auto_Close = 0
|
|
||||||
|
|
||||||
If you don't use the "File->Recent Files" menu and want to disable it,
|
|
||||||
then you can set the 'MRU_Add_Menu' variable to zero. By default, the
|
|
||||||
menu is enabled.
|
|
||||||
|
|
||||||
let MRU_Add_Menu = 0
|
|
||||||
|
|
||||||
If too many file names are present in the MRU list, then updating the MRU
|
|
||||||
menu to list all the file names makes Vim slow. To avoid this, the
|
|
||||||
MRU_Max_Menu_Entries variable controls the number of file names to show in
|
|
||||||
the MRU menu. By default, this is set to 10. You can change this to show
|
|
||||||
more entries in the menu.
|
|
||||||
|
|
||||||
let MRU_Max_Menu_Entries = 20
|
|
||||||
|
|
||||||
If many file names are present in the MRU list, then the MRU menu is split
|
|
||||||
into sub-menus. Each sub-menu contains MRU_Max_Submenu_Entries file names.
|
|
||||||
The default setting for this is 10. You can change this to increase the
|
|
||||||
number of file names displayed in a single sub-menu:
|
|
||||||
|
|
||||||
let MRU_Max_Submenu_Entries = 15
|
|
||||||
|
|
||||||
In the MRU window, the filenames are displayed in two parts. The first part
|
|
||||||
contains the file name without the path and the second part contains the
|
|
||||||
full path to the file in parenthesis. This format is controlled by the
|
|
||||||
MRU_Filename_Format variable. If you prefer to change this to some other
|
|
||||||
format, then you can modify the MRU_Filename_Format variable. For example,
|
|
||||||
to display the full path without splitting it, you can set this variable
|
|
||||||
as shown below:
|
|
||||||
|
|
||||||
let MRU_Filename_Format={'formatter':'v:val', 'parser':'.*'}
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,37 +0,0 @@
|
|||||||
_To assist in resolving your issue, provide as much information as possible, in place of the ellipses (`…`) below._
|
|
||||||
|
|
||||||
---
|
|
||||||
**Environment:** _Describe your Vim/NERDTree setup._
|
|
||||||
|
|
||||||
>* Operating System: …
|
|
||||||
>* Vim version `:version`: …
|
|
||||||
>* NERDTree version `git rev-parse --short HEAD`: …
|
|
||||||
>* NERDTree settings applied in your vimrc, if any:
|
|
||||||
>
|
|
||||||
> ```
|
|
||||||
> …
|
|
||||||
> ```
|
|
||||||
|
|
||||||
**Process:** _List the steps that will recreate the issue._
|
|
||||||
|
|
||||||
>1. …
|
|
||||||
|
|
||||||
**Current Result:** _Describe what you you currently experience from this process._
|
|
||||||
|
|
||||||
>…
|
|
||||||
|
|
||||||
**Expected Result:** _Describe what you would expect to have resulted from this process._
|
|
||||||
|
|
||||||
>…
|
|
||||||
|
|
||||||
---
|
|
||||||
**Optional**
|
|
||||||
|
|
||||||
**Screenshot(s):**
|
|
||||||
|
|
||||||
>…
|
|
||||||
|
|
||||||
**Possible Fix:** _(Have you poked around in the code?)_
|
|
||||||
|
|
||||||
>…
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user