diff --git a/etc/shell/bash/aliases b/etc/shell/bash/aliases index 6a673bb..ff11ef3 100755 --- a/etc/shell/bash/aliases +++ b/etc/shell/bash/aliases @@ -408,6 +408,11 @@ map() { telnet mapscii.me } +#- Отображение настоящего URL ссылки +realurl() { + curl -ILs "$1" | grep '^Location:' +} + #- Консольный калькулятор =() { echo "$*" | bc -l; } diff --git a/etc/shell/bash/bashrc b/etc/shell/bash/bashrc index a30b53e..11c9e77 100755 --- a/etc/shell/bash/bashrc +++ b/etc/shell/bash/bashrc @@ -1,6 +1,6 @@ #!/bin/bash #################################################################### # -# Изменён: Ср 01 июл 2020 00:07:20 +# Изменён: Ср 29 июл 2020 11:55:43 # ################################################################################ @@ -225,9 +225,11 @@ esac [ -n "$SSH_CLIENT" ] && PROMPT_SHH="[${red}ssh${PROMPT_COLOR}]" -PS2="$green-> $rstc" -PS3="$green+> $rstc" -PS4="$green++ $rstc" +export PS2="$green-> $rstc" +export PS3="$green+> $rstc" + +# + filename.sh:00NN: function(): command +export PS4='$(printf "+ \033[1;32m%s:\033[0;36m%04d: \033[1;35m%s\033[00m" $(basename $BASH_SOURCE) $LINENO ${FUNCNAME[0]:+${FUNCNAME[0]}():\ })' short_pwd() { # echo -en '  ' diff --git a/etc/soft/git/gitconfig b/etc/soft/git/gitconfig index 7195480..823b4a8 100644 --- a/etc/soft/git/gitconfig +++ b/etc/soft/git/gitconfig @@ -35,6 +35,12 @@ [gc] writeCommitGraph = true +[blame] + coloring = repeatedLines + +[color "blame"] + repeatedLines = yellow + # ----[ DIFF METHODS ]-------------------------------------------------------- [diff "plist"] @@ -77,6 +83,9 @@ # Исправление последнего коммита ca = commit --amend + # Blame с подсветкой синтаксиса + cblame = !git-cblame + # Список diff-методов для сохранения в .gitattributes diffs = "!grep '\\[diff \"' ~/.gitconfig | cut -d '\"' -f 2 | awk '{ print \"*.\" $0 \" diff=\" $0 }'" diff --git a/etc/soft/joplin/userstyle.css b/etc/soft/joplin/userstyle.css index efed138..bbf7932 100644 --- a/etc/soft/joplin/userstyle.css +++ b/etc/soft/joplin/userstyle.css @@ -45,3 +45,95 @@ a { font-weight: bold; text-decoration: none; } + +b-gray, b-green, b-red, b-blue, b-orange, b-pink, b-purple { + width: 90%; + display: block; + margin-left: 20px; + padding: 10px; + border: 1px solid; + border-left: 5px solid; + border-radius: 2px; + word-wrap: break-word; + box-shadow: 3px 3px 7px 0 rgba(0,0,0,0.3) ; +} + +b-gray { + border-color: #b1bcc2; + background-color: #e9edf0; +} + +b-green { + border-color: #5fa04e; + background-color: #c5e5b4; +} + +b-red { + border-color: #f65354; + background-color: #fad3d4; +} + +b-blue { + border-color: #229ade; + background-color: #bbe5fb; +} + +b-orange { + border-color: #cf7506; + background-color: #faf3d3; +} + +b-purple { + border-color: #af74e8; + background-color: #ead9fb; +} + +b-pink { + border-color: #ed5393; + background-color: #fad3e5; +} + +/* TOC */ + +nav.table-of-contents>ul { + background: var(--Sidebar-background); + font-size: 12px; + text-transform: uppercase !important; + padding: 10px; + margin: 0px; + margin-bottom: 50px; +} + +nav.table-of-contents ul { + list-style-type: none +} + +nav.table-of-contents li { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +nav.table-of-contents li a { + padding: 0; +} + +@media all and (min-width: 920px) { + nav.table-of-contents>ul { + position: fixed; + top: 0; + right: 0; + z-index: 99; + /* margin-right: 10px; */ + border-radius: 4px; + max-width: 15%; + overflow:auto; + height: 100%; + font-size: 12px; + } + + #rendered-md { + width: 82%; + } +} + diff --git a/etc/soft/nvim/+ftplugin/haskell.vim b/etc/soft/nvim/+ftplugin/haskell.vim index 6af0832..3223120 100644 --- a/etc/soft/nvim/+ftplugin/haskell.vim +++ b/etc/soft/nvim/+ftplugin/haskell.vim @@ -1,63 +1,4 @@ set makeprg=ghc\ %\ -o\ %< " Компилятор -set foldexpr=HaskellFold(v:lnum) -set foldmethod=expr - -" ============================================================================= -" Descriptions: Provide a function providing folding information for haskell -" files. -" Maintainer: Vincent B (twinside@gmail.com) -" Warning: Assume the presence of type signatures on top of your functions to -" work well. -" Usage: drop in ~/vimfiles/plugin or ~/.vim/plugin -" Version: 1.0 -" Changelog: - 1.0 : initial version -" ============================================================================= -if exists("g:__HASKELLFOLD_VIM__") - finish -endif -let g:__HASKELLFOLD_VIM__ = 1 - -" Top level bigdefs -fun! s:HaskellFoldMaster( line ) "{{{ - return a:line =~ '^data\s' - \ || a:line =~ '^type\s' - \ || a:line =~ '^newdata\s' - \ || a:line =~ '^class\s' - \ || a:line =~ '^instance\s' - \ || a:line =~ '^[^:]\+\s*::' -endfunction "}}} - -" Top Level one line shooters. -fun! s:HaskellSnipGlobal(line) "{{{ - return a:line =~ '^module' - \ || a:line =~ '^import' - \ || a:line =~ '^infix[lr]\s' -endfunction "}}} - -" The real folding function -fun! HaskellFold( lineNum ) "{{{ - let line = getline( a:lineNum ) - - " Beginning of comment - if line =~ '^\s*--' - return 2 - endif - - if s:HaskellSnipGlobal( line ) - return 0 - endif - - if line =~ '^\s*$' - let nextline = getline(a:lineNum + 1) - if s:HaskellFoldMaster( nextline ) > 0 || s:HaskellSnipGlobal( nextline ) > 0 - \ || nextline =~ "^--" - return 0 - else - return -1 - endif - endif - - return 1 -endfunction "}}} +call SetHaskellFolding() diff --git a/etc/soft/nvim/+plugins/auto-git-diff/README.md b/etc/soft/nvim/+plugins/auto-git-diff/README.md new file mode 100644 index 0000000..91f928a --- /dev/null +++ b/etc/soft/nvim/+plugins/auto-git-diff/README.md @@ -0,0 +1,83 @@ +Show git diff for Git Rebase Interactive +======================================= + +`auto-git-diff` is a vim plugin which shows git diff between each commit and +its parent commit below the commit list window of git rebase interactive. + +When you move a text-cursor in `git-rebase-todo` file, `auto-git-diff` gets +a commit hash of the line where the cursor exists and update the diff window. + + +![sample_image](https://user-images.githubusercontent.com/359226/33921582-2319e7a0-e008-11e7-8be3-ba9f68a78217.gif) + +## Variables + + - `g:auto_git_diff_disable_auto_update` + +If this variable is set to 1, the diff window won't update automatically. You +can update the diff window manually with the following key mapping: +`(auto_git_diff_manual_update)`. + + - `g:auto_git_diff_show_window_at_right` + +If this variable is set to 1, the diff window will be created at right on the +commit list window. + + - `g:auto_git_diff_command_options` + +The options passed to `git diff` command. If this variable is not defined, +`--stat -p --submodule -C -C` will be used. + +## Mappings + + - `(auto_git_diff_manual_update)` + +This key mapping updates the diff window manully. + + - `(auto_git_diff_scroll_down_1)` + - `(auto_git_diff_scroll_up_1)` + - `(auto_git_diff_scroll_down_half)` + - `(auto_git_diff_scroll_up_half)` + - `(auto_git_diff_scroll_down_page)` + - `(auto_git_diff_scroll_up_page)` + +These key mappings scroll the diff window without moving the cursor into the +window. `_1` means scrolling one line (`` or ``), `_half` means +scrolling half a page (`` or ``) and `_page` means scrolling one page +(`` or ``). + +Following is an example to configure the mappings in your `vimrc`. + +```vim +function! s:setup_auto_git_diff() abort + nmap (auto_git_diff_scroll_manual_update) + nmap (auto_git_diff_scroll_down_half) + nmap (auto_git_diff_scroll_up_half) +endfunction +autocmd FileType gitrebase call setup_auto_git_diff() +``` + +## License + + The MIT License (MIT) + Copyright (c) 2015 hotwatermorning + + 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. + diff --git a/etc/soft/nvim/+plugins/auto-git-diff/autoload/auto_git_diff.vim b/etc/soft/nvim/+plugins/auto-git-diff/autoload/auto_git_diff.vim new file mode 100644 index 0000000..b2d2830 --- /dev/null +++ b/etc/soft/nvim/+plugins/auto-git-diff/autoload/auto_git_diff.vim @@ -0,0 +1,132 @@ +let s:save_cpo = &cpo +let s:previous_hash_string = "" +set cpo&vim + +nnoremap (auto_git_diff_manual_update) :call auto_git_diff#show_git_diff() + +" Get commit hash from current line. +" The first colomn(pick, r, ...) can be empty. +function! s:get_git_hash() abort + return matchstr(getline('.'), '^\(\w\+\>\)\=\(\s*\)\zs\x\{4,40\}\>\ze') +endfunction + +" Find the preview window. +" If not found, return zero. +function! s:find_preview_window() abort + for nr in range(1, winnr('$')) + if getwinvar(nr, "&pvw") == 1 + " found a preview + return nr + endif + endfor + return 0 +endfunction + +" Execute git diff between hash~1 and hash with options a:opts, +" and show the result into the preview window. +function! s:show_git_diff_impl(hash, vertsplit, opts) abort + + let wn = s:find_preview_window() + + if wn == 0 + " The preview window is not found. + " => Open new window + + if a:vertsplit + rightbelow vnew + else + rightbelow new + endif + + silent! setlocal previewwindow bufhidden=delete nobackup noswf nobuflisted nowrap buftype=nofile + + let wn = bufwinnr('%') + else + " Preview window is found" + " Move to the window + silent execute wn."wincmd w" + endif + + let out = s:get_git_diff(a:hash, a:opts) + + if v:shell_error + setlocal ft= + else + setlocal ft=diff + endif + + setlocal modifiable + + silent! % delete _ + silent! $ put=out + silent! 1 delete _ + + setlocal nomodifiable + + noremap q :bw + + silent wincmd p +endfunction + +function! s:get_git_diff(hash, opts) abort + let prefix = has("win32") ? "set LANG=C & " : "env LANG=C " + + let diff_command = "git diff ".a:opts." ".a:hash."~1 ".a:hash + silent let out = system(prefix.diff_command) + if !v:shell_error + return out + endif + let save_out = out + + let empty_tree_sha1_hex = "4b825dc642cb6eb9a060e54bf8d69288fbee4904" + let diff_command = "git diff ".a:opts." ".empty_tree_sha1_hex." ".a:hash + silent let out = system(prefix.diff_command) + if !v:shell_error + return out + endif + + return save_out +endfunction + +function! auto_git_diff#show_git_diff() abort + + let hash_string = s:get_git_hash() + if hash_string == "" || hash_string == s:previous_hash_string + return + else + let s:previous_hash_string = hash_string + endif + + call s:show_git_diff_impl( s:get_git_hash() +\ , get(g:, "auto_git_diff_show_window_at_right", 0) +\ , get(g:, "auto_git_diff_command_options", "--stat -p --submodule -C -C") +\ ) +endfunction + +" Called when text-cursor is moved. +function! auto_git_diff#auto_update_git_diff() abort + + if get(g:, "auto_git_diff_disable_auto_update", 0) + return + endif + + if mode() != "n" + return + endif + + call auto_git_diff#show_git_diff() +endfunction + +function! auto_git_diff#scroll_in_preview_window(map) abort + if s:find_preview_window() == 0 + return + endif + wincmd P + sandbox let input = eval('"\<'.a:map.'>"') + execute "normal!" input + wincmd p +endfunction + +let &cpo = s:save_cpo +unlet s:save_cpo + diff --git a/etc/soft/nvim/+plugins/auto-git-diff/plugin/auto-git-diff.vim b/etc/soft/nvim/+plugins/auto-git-diff/plugin/auto-git-diff.vim new file mode 100644 index 0000000..8be9d82 --- /dev/null +++ b/etc/soft/nvim/+plugins/auto-git-diff/plugin/auto-git-diff.vim @@ -0,0 +1,16 @@ +if exists("g:did_auto_git_diff") | finish | endif +let g:did_auto_git_diff = 1 + +augroup auto_git_diff_command_group + autocmd! + autocmd CursorMoved git-rebase-todo call auto_git_diff#auto_update_git_diff() + autocmd FileType gitrebase setlocal nowarn nowb +augroup END + +nnoremap (auto_git_diff_scroll_down_1) :call auto_git_diff#scroll_in_preview_window("C-e") +nnoremap (auto_git_diff_scroll_up_1) :call auto_git_diff#scroll_in_preview_window("C-y") +nnoremap (auto_git_diff_scroll_down_half) :call auto_git_diff#scroll_in_preview_window("C-d") +nnoremap (auto_git_diff_scroll_up_half) :call auto_git_diff#scroll_in_preview_window("C-u") +nnoremap (auto_git_diff_scroll_down_page) :call auto_git_diff#scroll_in_preview_window("C-f") +nnoremap (auto_git_diff_scroll_up_page) :call auto_git_diff#scroll_in_preview_window("C-b") + diff --git a/etc/soft/nvim/+plugins/vim-haskellConcealPlus/README.md b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/README.md new file mode 100644 index 0000000..04c3a31 --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/README.md @@ -0,0 +1,147 @@ +## Vim Haskell Conceal+ + +This bundle provides extended Haskell Conceal feature for Vim. The feature +is used to display unicode operators in Haskell code without changing the +underlying file. + +This package offers more (and, more importantly, configurable) features +than the +[baseline vim-haskellConcealbundle](https://github.com/Twinside/vim-haskellConceal). +The baseline bundle has numerous forks, which is possible to combine, so +everyone is welcome to share, improve or contribute new notations to this +Conceal Plus package. + +GitHub: https://github.com/enomsg/vim-haskellConcealPlus + +### Why Concealing + +- Using things like '->' instead real arrows '→' was never a deliberate + choice, but a choice made due to limitations of teletypewriters and + input inconvenience. + +- With concealing you don't have to deal with cumbersome unicode-input + methods, yet you can enjoy proper notation. + +- It is not only about aesthetics. Excess of multi-character functions may + create visual noise, which negatively affects readability. Using special + symbols and true arrows, together with colors and bold/italic face seems + to improve the situation. The image shows Vim with and without + concealing, both running in a plain terminal emulator: + +![demo](https://github.com/enomsg/vim-haskellConcealPlus/raw/master/demo.png) + +- Using concealing instead of *-unicode* versions of packages also has + some advantages. Mainly, concealing does not require any changes to the + source code, it is backwards-compatible with idiomatic code. Secondly, + with concealing no special input methods are needed. Plus, currently + some features are hardly possible without editor's concealing (e.g. + power superscripts). + +### Installation + +Using Vim built-in `pack` support: + +``` +$ mkdir -p ~/.vim/pack/vim-haskellConcealPlus/start +$ cd ~/.vim/pack/vim-haskellConcealPlus/start +$ git clone https://github.com/enomsg/vim-haskellConcealPlus +$ echo "syn on" >> ~/.vimrc # If not already in .vimrc +$ echo "setlocal conceallevel=2" >> ~/.vimrc # If not already in .vimrc +$ echo "set concealcursor=nciv" >> ~/.vimrc # Optional +``` + +### Available Options + + 'q' option to disable concealing of scientific constants (e.g. π) + '℘' option to disable concealing of powerset function + '𝐒' option to disable String type to 𝐒 concealing + '𝐓' option to disable Text type to 𝐓 concealing + '𝐄' option to disable Either/Right/Left to 𝐄/𝑅/𝐿 concealing + '𝐌' option to disable Maybe/Just/Nothing to 𝐌/𝐽/𝑁 concealing + 'A' option to not try to preserve indentation + 's' option to disable space consumption after ∑,∏,√ and ¬ functions + '*' option to enable concealing of asterisk with '⋅' sign + 'x' option to disable default concealing of asterisk with '×' sign + 'E' option to enable ellipsis concealing with ‥ (two dot leader) + 'e' option to disable ellipsis concealing with … (ellipsis sign) + '⇒' option to disable `implies` concealing with ⇒ + '⇔' option to disable `iff` concealing with ⇔ + 'r' option to disable return (η) and join (µ) concealing + 'b' option to disable bind (left and right) concealing + 'f' option to enable formal (★) right bind concealing + 'c' option to enable encircled b/d (ⓑ/ⓓ) for right and left binds + 'h' option to enable partial concealing of binds (e.g. »=) + 'C' option to enable encircled 'm' letter ⓜ concealing for fmap + 'l' option to disable fmap/lift concealing with ↥ + '↱' option to disable mapM/forM concealing with ↱/↰ + 'w' option to disable 'where' concealing with "due to"/∵ symbol + '-' option to disable subtract/(-) concealing with ⊟ + 'I' option to enable alternative ':+' concealing with with ⨢ + 'i' option to disable default concealing of ':+' with ⅈ + 'R' option to disable realPart/imagPart concealing with ℜ/ℑ + 'T' option to enable True/False constants concealing with bold 𝐓/𝐅 + 't' option to disable True/False constants concealing with italic 𝑇/𝐹 + 'B' option to disable Bool type to 𝔹 concealing + 'Q' option to disable Rational type to ℚ concealing + 'Z' option to disable Integer type to ℤ concealing + 'N' option to disable Natural, Nat types to ℕ concealing + 'D' option to disable Double type to 𝔻 concealing + 'C' option to disable Complex type to ℂ concealing + '1' option to disable numeric superscripts concealing, e.g. x² + 'a' option to disable alphabet superscripts concealing, e.g. xⁿ + +The flags can be specified via hscoptions variable. For example, *let +hscoptions="fc"* in your *~/.vimrc*. + +### Known Issues and Hints: + +- Concealing may seriously mess up indentation. By default the bundle + tries to preserve spaces for commonly troublesome symbols (e.g. ->, <- + and => arrows). But to be sure about indentation, you still have to see + the non-concealed code. *set conceallevel=0* might be handy in these + cases. + +- *set concealcursor=nciv* seem to not play well with Vim matchparen + feature (which is enabled by default). You can either disable concealing + under the cursor, or disable matchparen by adding *let + loaded_matchparen=1* at the very top of your *~/.vimrc*. + +- With *set concealcursor=nciv* navigation through concealed parts of code + might be somewhat irritating because the cursor behaves a bit + differently. It becomes less of an issue if you are used to Vim's *w/b* + commands (word forward/backward). You can also try *set + concealcursor=ncv* instead. + +- Finding proper fonts might be a pain. Most of modern, so called + programming fonts (*Inconsolata*, *Anonymous Pro*, etc.) often lack + decent unicode support. As a recommendation, try *DejaVu Sans Mono*. + + **Update**: thanks to [monospacifier](https://github.com/cpitclaudel/monospacifier) + package, fonts are no longer a problem. Pick your favourite font, then in + addition download one of the "monospacified" fallback fonts, save into + `~/.fonts`, and adjust fontconfig, e.g. + `~/.config/fontconfig/fonts.conf`: + + ``` + + + ~/.fonts + + monospace + + TeX Gyre Schola Math monospacified for DejaVu Sans Mono + + + + ``` + +- Most of the terminal emulators have one or more issues with regard to the + unicode characters handling. Emulators that don't have problems with unicode + might be pretty slow. As a recommendation, try xst, or *evilvte* (it has weird + configuration, but draws things correctly) or *lxterminal* (seems to be quite + capable, but limited configurability) or any other terminal emulator that + happened to work for you. + + [xst](https://github.com/gnotclub/xst) is known to work well with DejaVu Sans + Mono, plus [monospacified](https://github.com/cpitclaudel/monospacifier) fonts + as a fallback. diff --git a/etc/soft/nvim/+plugins/vim-haskellConcealPlus/after/syntax/haskell.vim b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/after/syntax/haskell.vim new file mode 100644 index 0000000..46ec4fd --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/after/syntax/haskell.vim @@ -0,0 +1,494 @@ +" vim: sw=4 +"============================================================================= +" What Is This: Add some conceal operator for your haskell files +" File: haskell.vim (conceal enhancement) +" Last Change: 2011-09-07 +" Version: 1.3.2 +" Require: +" set nocompatible +" somewhere on your .vimrc +" +" Vim 7.3 or Vim compiled with conceal patch. +" Use --with-features=big or huge in order to compile it in. +" +" Usage: +" Drop this file in your +" ~/.vim/after/syntax folder (Linux/MacOSX/BSD...) +" ~/vimfiles/after/syntax folder (Windows) +" +" For this script to work, you have to set the encoding +" to utf-8 :set enc=utf-8 +" +" Additional: +" * if you want to avoid the loading, add the following +" line in your .vimrc : +" let g:no_haskell_conceal = 1 +" Changelog: +" - 1.3.1: putting undefined in extra conceal, not appearing on windows +" - 1.3: adding new arrow characters used by GHC in Unicode extension. +" - 1.2: Fixing conceal level to be local (thx Erlend Hamberg) +" - 1.1: Better handling of non utf-8 systems, and avoid some +" concealing operations on windows on some fonts +" + +" Cf - check a flag. Return true if the flag is specified. +function! Cf(flag) + return exists('g:hscoptions') && stridx(g:hscoptions, a:flag) >= 0 +endfunction + +if exists('g:no_haskell_conceal') || !has('conceal') || &enc != 'utf-8' + finish +endif + +" vim: set fenc=utf-8: +syntax match hsNiceOperator "\\\ze[[:alpha:][:space:]_([]" conceal cchar=λ + +" 'q' option to disable concealing of scientific constants (e.g. π). +if !Cf('q') + syntax match hsNiceOperator "\" conceal cchar=π + syntax match hsNiceOperator "\" conceal cchar=τ + syntax match hsNiceOperator "\" conceal cchar=ℎ + syntax match hsNiceOperator "\" conceal cchar=ℏ +endif + +syntax match hsNiceOperator "==" conceal cchar=≡ +syntax match hsNiceOperator "\/=" conceal cchar=≢ + +let s:extraConceal = 1 +" Some windows font don't support some of the characters, +" so if they are the main font, we don't load them :) +if has("win32") + let s:incompleteFont = [ 'Consolas' + \ , 'Lucida Console' + \ , 'Courier New' + \ ] + let s:mainfont = substitute( &guifont, '^\([^:,]\+\).*', '\1', '') + for s:fontName in s:incompleteFont + if s:mainfont ==? s:fontName + let s:extraConceal = 0 + break + endif + endfor +endif + +if s:extraConceal + " syntax match hsNiceOperator "\" conceal cchar=⊥ + + " Match greater than and lower than w/o messing with Kleisli composition + syntax match hsNiceOperator "<=\ze[^<]" conceal cchar=≤ + syntax match hsNiceOperator ">=\ze[^>]" conceal cchar=≥ + + " Redfining to get proper '::' concealing + syntax match hs_DeclareFunction /^[a-z_(]\S*\(\s\|\n\)*::/me=e-2 nextgroup=hsNiceOperator contains=hs_FunctionName,hs_OpFunctionName + + syntax match hsNiceoperator "!!" conceal cchar=‼ + syntax match hsNiceoperator "++\ze[^+]" conceal cchar=⧺ + syntax match hsNiceOperator "\" conceal cchar=∀ + syntax match hsNiceOperator "-<" conceal cchar=↢ + syntax match hsNiceOperator ">-" conceal cchar=↣ + syntax match hsNiceOperator "-<<" conceal cchar=⤛ + syntax match hsNiceOperator ">>-" conceal cchar=⤜ + " the star does not seem so good... + " syntax match hsNiceOperator "*" conceal cchar=★ + syntax match hsNiceOperator "`div`" conceal cchar=÷ + + " Only replace the dot, avoid taking spaces around. + syntax match hsNiceOperator /\s\.\s/ms=s+1,me=e-1 conceal cchar=∘ + + syntax match hsQQEnd "|\]" contained conceal cchar=〛 + " sy match hsQQEnd "|\]" contained conceal=〚 + + syntax match hsNiceOperator "`elem`" conceal cchar=∈ + syntax match hsNiceOperator "`notElem`" conceal cchar=∉ + syntax match hsNiceOperator "`isSubsetOf`" conceal cchar=⊆ + syntax match hsNiceOperator "`union`" conceal cchar=∪ + syntax match hsNiceOperator "`intersect`" conceal cchar=∩ + syntax match hsNiceOperator "\\\\\ze[[:alpha:][:space:]_([]" conceal cchar=∖ + + syntax match hsNiceOperator "||\ze[[:alpha:][:space:]_([]" conceal cchar=∨ + syntax match hsNiceOperator "&&\ze[[:alpha:][:space:]_([]" conceal cchar=∧ + + " syntax match hsNiceOperator "<\*>" conceal cchar=⊛ + " syntax match hsNiceOperator "`mappend`" conceal cchar=⊕ + " syntax match hsNiceOperator "\" conceal cchar=⊕ + syntax match hsNiceOperator "<>" conceal cchar=⊕ + syntax match hsNiceOperator "\" conceal cchar=∅ + syntax match hsNiceOperator "\" conceal cchar=∅ + syntax match hsNiceOperator "\" conceal cchar=∅ +endif + +" hi link hsNiceOperator Operator +" hi! link Conceal Operator +hi link hsNiceOperator haskellOperators +hi! link Conceal haskellOperators +setlocal conceallevel=2 + +" '℘' option to disable concealing of powerset function +if !Cf('℘') + syntax match hsNiceOperator "\" conceal cchar=℘ +endif + +" '𝐒' option to disable String type to 𝐒 concealing +if !Cf('𝐒') + syntax match hsNiceOperator "\" conceal cchar=𝐒 +endif + +" '𝐓' option to disable Text type to 𝐓 concealing +if !Cf('𝐓') + syntax match hsNiceOperator "\" conceal cchar=𝐓 +endif + +" '𝐄' option to disable Either/Right/Left to 𝐄/𝑅/𝐿 concealing +if !Cf('𝐄') + syntax match hsNiceOperator "\" conceal cchar=𝐄 + syntax match hsNiceOperator "\" conceal cchar=𝑅 + syntax match hsNiceOperator "\" conceal cchar=𝐿 +endif + +" '𝐌' option to disable Maybe/Just/Nothing to 𝐌/𝐽/𝑁 concealing +if !Cf('𝐌') + syntax match hsNiceOperator "\" conceal cchar=𝐌 + syntax match hsNiceOperator "\" conceal cchar=𝐽 + syntax match hsNiceOperator "\" conceal cchar=𝑁 +endif + +" 'A' option to not try to preserve indentation. +if Cf('A') + syntax match hsNiceOperator "<-" conceal cchar=← + syntax match hsNiceOperator "->" conceal cchar=→ + syntax match hsNiceOperator "=>" conceal cchar=⇒ + syntax match hsNiceOperator "\:\:" conceal cchar=∷ +else + syntax match hsLRArrowHead contained ">" conceal cchar= + syntax match hsLRArrowTail contained "-" conceal cchar=→ + syntax match hsLRArrowFull "->" contains=hsLRArrowHead,hsLRArrowTail + + syntax match hsRLArrowHead contained "<" conceal cchar=← + syntax match hsRLArrowTail contained "-" conceal cchar= + syntax match hsRLArrowFull "<-" contains=hsRLArrowHead,hsRLArrowTail + + syntax match hsLRDArrowHead contained ">" conceal cchar= + syntax match hsLRDArrowTail contained "=" conceal cchar=⇒ + syntax match hsLRDArrowFull "=>" contains=hsLRDArrowHead,hsLRDArrowTail +endif + +" 's' option to disable space consumption after ∑,∏,√ and ¬ functions. +if Cf('s') + syntax match hsNiceOperator "\" conceal cchar=∑ + syntax match hsNiceOperator "\" conceal cchar=∏ + syntax match hsNiceOperator "\" conceal cchar=√ + syntax match hsNiceOperator "\" conceal cchar=¬ +else + syntax match hsNiceOperator "\\(\ze\s*[.$]\|\s*\)" conceal cchar=∑ + syntax match hsNiceOperator "\\(\ze\s*[.$]\|\s*\)" conceal cchar=∏ + syntax match hsNiceOperator "\\(\ze\s*[.$]\|\s*\)" conceal cchar=√ + syntax match hsNiceOperator "\\(\ze\s*[.$]\|\s*\)" conceal cchar=¬ +endif + +" '*' option to enable concealing of asterisk with '⋅' sign. +if Cf('*') + syntax match hsNiceOperator "*" conceal cchar=⋅ +" 'x' option to disable default concealing of asterisk with '×' sign. +elseif !Cf('x') + syntax match hsNiceOperator "*" conceal cchar=× +endif + +" 'E' option to enable ellipsis concealing with ‥ (two dot leader). +if Cf('E') + " The two dot leader is not guaranteed to be at the bottom. So, it + " will break on some fonts. + syntax match hsNiceOperator "\.\." conceal cchar=‥ +" 'e' option to disable ellipsis concealing with … (ellipsis sign). +elseif !Cf('e') + syntax match hsNiceOperator "\.\." conceal cchar=… +end + +" '⇒' option to disable `implies` concealing with ⇒ +if !Cf('⇒') + " Easily distinguishable from => keyword since the keyword can only be + " used in type signatures. + syntax match hsNiceOperator "`implies`" conceal cchar=⇒ +endif + +" '⇔' option to disable `iff` concealing with ⇔ +if !Cf('⇔') + syntax match hsNiceOperator "`iff`" conceal cchar=⇔ +endif + +" 'r' option to disable return (η) and join (µ) concealing. +if !Cf('r') + syntax match hsNiceOperator "\" conceal cchar=η + syntax match hsNiceOperator "\" conceal cchar=µ +endif + +" 'b' option to disable bind (left and right) concealing +if Cf('b') + " Vim has some issues concealing with composite symbols like '«̳', and + " unfortunately there is no other common short notation for both + " binds. So 'b' option to disable bind concealing altogether. +" 'f' option to enable formal (★) right bind concealing +elseif Cf('f') + syntax match hsNiceOperator ">>=" conceal cchar=★ +" 'c' option to enable encircled b/d (ⓑ/ⓓ) for right and left binds. +elseif Cf('c') + syntax match hsNiceOperator ">>=" conceal cchar=ⓑ + syntax match hsNiceOperator "=<<" conceal cchar=ⓓ +" 'h' option to enable partial concealing of binds (e.g. »=). +elseif Cf('h') + syntax match hsNiceOperator ">>" conceal cchar=» + syntax match hsNiceOperator "<<" conceal cchar=« + syntax match hsNiceOperator "=\zs<<" conceal cchar=« +" Left and right arrows with hooks are the default option for binds. +else + syntax match hsNiceOperator ">>=\ze\_[[:alpha:][:space:]_()[\]]" conceal cchar=↪ + syntax match hsNiceOperator "=<<\ze\_[[:alpha:][:space:]_()[\]]" conceal cchar=↩ +endif + +if !Cf('h') + syntax match hsNiceOperator ">>\ze\_[[:alpha:][:space:]_()[\]]" conceal cchar=» + syntax match hsNiceOperator "<<\ze\_[[:alpha:][:space:]_()[\]]" conceal cchar=« +endif + +" 'C' option to enable encircled 'm' letter ⓜ concealing for fmap. +if Cf('C') + syntax match hsNiceOperator "<$>" conceal cchar=ⓜ + syntax match hsNiceOperator "`fmap`" conceal cchar=ⓜ +" 'l' option to disable fmap/lift concealing with ↥. +elseif !Cf('l') + syntax match hsNiceOperator "`liftM`" conceal cchar=↥ + syntax match hsNiceOperator "`liftA`" conceal cchar=↥ + syntax match hsNiceOperator "`fmap`" conceal cchar=↥ + syntax match hsNiceOperator "<$>" conceal cchar=↥ + + syntax match LIFTQ contained "`" conceal + syntax match LIFTQl contained "l" conceal cchar=↥ + syntax match LIFTl contained "l" conceal cchar=↥ + syntax match LIFTi contained "i" conceal + syntax match LIFTf contained "f" conceal + syntax match LIFTt contained "t" conceal + syntax match LIFTA contained "A" conceal + syntax match LIFTM contained "M" conceal + syntax match LIFT2 contained "2" conceal cchar=² + syntax match LIFT3 contained "3" conceal cchar=³ + syntax match LIFT4 contained "4" conceal cchar=⁴ + syntax match LIFT5 contained "5" conceal cchar=⁵ + + syntax match hsNiceOperator "`liftM2`" contains=LIFTQ,LIFTQl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT2 + syntax match hsNiceOperator "`liftM3`" contains=LIFTQ,LIFTQl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT3 + syntax match hsNiceOperator "`liftM4`" contains=LIFTQ,LIFTQl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT4 + syntax match hsNiceOperator "`liftM5`" contains=LIFTQ,LIFTQl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT5 + syntax match hsNiceOperator "`liftA2`" contains=LIFTQ,LIFTQl,LIFTi,LIFTf,LIFTt,LIFTA,LIFT2 + syntax match hsNiceOperator "`liftA3`" contains=LIFTQ,LIFTQl,LIFTi,LIFTf,LIFTt,LIFTA,LIFT3 + + syntax match FMAPf contained "f" conceal cchar=↥ + syntax match FMAPm contained "m" conceal + syntax match FMAPa contained "a" conceal + syntax match FMAPp contained "p" conceal + syntax match FMAPSPC contained " " conceal + syntax match hsNiceOperator "\\s*" contains=FMAPf,FMAPm,FMAPa,FMAPp,FMAPSPC + + syntax match LIFTSPC contained " " conceal + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTA,LIFTSPC + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTA,LIFT2,LIFTSPC + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTA,LIFT3,LIFTSPC + + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFTSPC + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT2,LIFTSPC + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT3,LIFTSPC + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT4,LIFTSPC + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT5,LIFTSPC + + " TODO: Move liftIO to its own flag? + syntax match LIFTIOL contained "l" conceal + syntax match LIFTI contained "I" conceal cchar=i + syntax match LIFTO contained "O" conceal cchar=o + syntax match hsNiceOperator "\" contains=LIFTIOl,LIFTi,LIFTf,LIFTt,LIFTI,LIFTO +endif + +" '↱' option to disable mapM/forM concealing with ↱/↰ +if !Cf('↱') + syntax match MAPMQ contained "`" conceal + syntax match MAPMm contained "m" conceal cchar=↱ + syntax match MAPMmQ contained "m" conceal cchar=↰ + syntax match MAPMa contained "a" conceal + syntax match MAPMp contained "p" conceal + syntax match MAPMM contained "M" conceal + syntax match MAPMM contained "M" conceal + syntax match MAPMU contained "_" conceal cchar=_ + syntax match SPC contained " " conceal + syntax match hsNiceOperator "`mapM_`" contains=MAPMQ,MAPMmQ,MAPMa,MAPMp,MAPMM,MAPMU + syntax match hsNiceOperator "`mapM`" contains=MAPMQ,MAPMmQ,MAPMa,MAPMp,MAPMM + syntax match hsNiceOperator "\\s*" contains=MAPMm,MAPMa,MAPMp,MAPMM,SPC + syntax match hsNiceOperator "\\s*" contains=MAPMm,MAPMa,MAPMp,MAPMM,MAPMU,SPC + + syntax match FORMQ contained "`" conceal + syntax match FORMfQ contained "f" conceal cchar=↱ + syntax match FORMf contained "f" conceal cchar=↰ + syntax match FORMo contained "o" conceal + syntax match FORMr contained "r" conceal + syntax match FORMM contained "M" conceal + syntax match FORMU contained "_" conceal cchar=_ + + syntax match hsNiceOperator "`forM`" contains=FORMQ,FORMfQ,FORMo,FORMr,FORMM + syntax match hsNiceOperator "`forM_`" contains=FORMQ,FORMfQ,FORMo,FORMr,FORMM,FORMU + + syntax match hsNiceOperator "\\s*" contains=FORMf,FORMo,FORMr,FORMM,SPC + syntax match hsNiceOperator "\\s*" contains=FORMf,FORMo,FORMr,FORMM,FORMU,SPC +endif + +" 'w' option to disable 'where' concealing with "due to"/∵ symbol. +if !Cf('w') + " ∵ means "because/since/due to." With quite a stretch this can be + " used for 'where'. We preserve spacing, otherwise it breaks indenting + " in a major way. + syntax match WS contained "w" conceal cchar=∵ + syntax match HS contained "h" conceal cchar= + syntax match ES contained "e" conceal cchar= + syntax match RS contained "r" conceal cchar= + syntax match hsNiceOperator "\" contains=WS,HS,ES,RS,ES +endif + +" '-' option to disable subtract/(-) concealing with ⊟. +if !Cf('-') + " Minus is a special syntax construct in Haskell. We use squared minus to + " tell the syntax from the binary function. + syntax match hsNiceOperator "(-)" conceal cchar=⊟ + syntax match hsNiceOperator "`subtract`" conceal cchar=⊟ +endif + +" 'I' option to enable alternative ':+' concealing with with ⨢. +if Cf('I') + " With some fonts might look better than ⅈ. + syntax match hsNiceOperator ":+" conceal cchar=⨢ +" 'i' option to disable default concealing of ':+' with ⅈ. +elseif !Cf('i') + syntax match COLON contained ":" conceal cchar=+ + syntax match PLUS contained "+" conceal cchar= + syntax match SPACE contained " " conceal cchar=ⅈ + syntax match hsNiceOperator ":+ " contains=COLON,PLUS,SPACE + "syntax match hsNiceOperator ":+" conceal cchar=ⅈ +endif + +" 'R' option to disable realPart/imagPart concealing with ℜ/ℑ. +if !Cf('R') + syntax match hsNiceOperator "\" conceal cchar=ℜ + syntax match hsNiceOperator "\" conceal cchar=ℑ +endif + +" 'T' option to enable True/False constants concealing with bold 𝐓/𝐅. +if Cf('T') + syntax match hsNiceSpecial "\" conceal cchar=𝐓 + syntax match hsNiceSpecial "\" conceal cchar=𝐅 +" 't' option to disable True/False constants concealing with italic 𝑇/𝐹. +elseif !Cf('t') + syntax match hsNiceSpecial "\" conceal cchar=𝑇 + syntax match hsNiceSpecial "\" conceal cchar=𝐹 +endif + +" 'B' option to disable Bool type to 𝔹 concealing +if !Cf('B') + " Not an official notation ttbomk. But at least + " http://www.haskell.org/haskellwiki/Unicode-symbols mentions it. + syntax match hsNiceOperator "\" conceal cchar=𝔹 +endif + +" 'Q' option to disable Rational type to ℚ concealing. +if !Cf('Q') + syntax match hsNiceOperator "\" conceal cchar=ℚ +endif + +" 'Z' option to disable Integer type to ℤ concealing. +if !Cf('Z') + syntax match hsNiceOperator "\" conceal cchar=ℤ + syntax match hsNiceOperator "\" conceal cchar=ℤ +endif + +" 'N' option to disable Natural, Nat types to ℕ concealing. +if !Cf('N') + syntax match hsNiceOperator "\" conceal cchar=ℕ + syntax match hsNiceOperator "\" conceal cchar=ℕ +endif + +" 'D' option to disable Double type to 𝔻 concealing +if !Cf('D') + syntax match hsNiceOperator "\" conceal cchar=𝔻 +endif + +" 'C' option to disable Complex type to ℂ concealing +if !Cf('C') + syntax match hasNiceOperator "\" conceal cchar=ℂ +endif + +" '1' option to disable numeric superscripts concealing, e.g. x². +if !Cf('1') + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)0\ze\_W" conceal cchar=⁰ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)1\ze\_W" conceal cchar=¹ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)2\ze\_W" conceal cchar=² + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)3\ze\_W" conceal cchar=³ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)4\ze\_W" conceal cchar=⁴ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)5\ze\_W" conceal cchar=⁵ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)6\ze\_W" conceal cchar=⁶ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)7\ze\_W" conceal cchar=⁷ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)8\ze\_W" conceal cchar=⁸ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)9\ze\_W" conceal cchar=⁹ +endif + +" 'a' option to disable alphabet superscripts concealing, e.g. xⁿ. +if !Cf('a') + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)a\ze\_W" conceal cchar=ᵃ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)b\ze\_W" conceal cchar=ᵇ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)c\ze\_W" conceal cchar=ᶜ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)d\ze\_W" conceal cchar=ᵈ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)e\ze\_W" conceal cchar=ᵉ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)f\ze\_W" conceal cchar=ᶠ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)g\ze\_W" conceal cchar=ᵍ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)h\ze\_W" conceal cchar=ʰ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)i\ze\_W" conceal cchar=ⁱ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)j\ze\_W" conceal cchar=ʲ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)k\ze\_W" conceal cchar=ᵏ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)l\ze\_W" conceal cchar=ˡ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)m\ze\_W" conceal cchar=ᵐ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)n\ze\_W" conceal cchar=ⁿ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)o\ze\_W" conceal cchar=ᵒ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)p\ze\_W" conceal cchar=ᵖ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)r\ze\_W" conceal cchar=ʳ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)s\ze\_W" conceal cchar=ˢ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)t\ze\_W" conceal cchar=ᵗ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)u\ze\_W" conceal cchar=ᵘ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)v\ze\_W" conceal cchar=ᵛ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)w\ze\_W" conceal cchar=ʷ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)x\ze\_W" conceal cchar=ˣ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)y\ze\_W" conceal cchar=ʸ + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)z\ze\_W" conceal cchar=ᶻ +endif + +" Not really Haskell, but quite handy for writing proofs in pseudo-code. +if Cf('∴') + syntax match hsNiceOperator "\" conceal cchar=∴ + syntax match hsNiceOperator "\" conceal cchar=∃ + syntax match hsNiceOperator "\" conceal cchar=∄ + syntax match hsNiceOperator ":=" conceal cchar=≝ +endif + +" TODO: +" See Basic Syntax Extensions - School of Haskell | FP Complete +" intersection = (∩) +" +" From the Data.IntMap.Strict.Unicode +" notMember = (∉) = flip (∌) +" member = (∈) = flip (∋) +" isProperSubsetOf = (⊂) = flip (⊃) +" +" From Data.Sequence.Unicode +" (<|) = (⊲ ) +" (|>) = (⊳ ) +" (><) = (⋈ ) + +sy match hsTHIDTopLevel "^[a-z]\S*" +sy match hsTHTopLevel "^\$(\?" nextgroup=hsTHTopLevelName +sy match hsTHTopLevelName "[a-z]\S*" contained + +hi def link hsTHTopLevelName Identifier +hi def link hsTHTopLevel Identifier +hi def link hsTHIDTopLevel Identifier + diff --git a/etc/soft/nvim/+plugins/vim-haskellConcealPlus/after/syntax/lhaskell.vim b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/after/syntax/lhaskell.vim new file mode 100644 index 0000000..f6edcfb --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/after/syntax/lhaskell.vim @@ -0,0 +1,477 @@ +" vim: sw=4 +"============================================================================= +" What Is This: Add some conceal operator for your literate haskell files +" File: lhaskell.vim (conceal enhancement) +" Last Change: 2015-11-13 +" Version: 1.3.3 +" Require: +" set nocompatible +" somewhere on your .vimrc +" +" Vim 7.3 or Vim compiled with conceal patch. +" Use --with-features=big or huge in order to compile it in. +" +" Usage: +" Drop this file in your +" ~/.vim/after/syntax folder (Linux/MacOSX/BSD...) +" ~/vimfiles/after/syntax folder (Windows) +" +" For this script to work, you have to set the encoding +" to utf-8 :set enc=utf-8 +" +" Additional: +" * if you want to avoid the loading, add the following +" line in your .vimrc : +" let g:no_haskell_conceal = 1 +" Changelog: +" - 1.3.3: lhaskell.vim added, only concealing inside code (\begin, >>) tags. +" - 1.3.1: putting undefined in extra conceal, not appearing on windows +" - 1.3: adding new arrow characters used by GHC in Unicode extension. +" - 1.2: Fixing conceal level to be local (thx Erlend Hamberg) +" - 1.1: Better handling of non utf-8 systems, and avoid some +" concealing operations on windows on some fonts +" + + +" Cf - check a flag. Return true if the flag is specified. +function! Cf(flag) + return exists('g:hscoptions') && stridx(g:hscoptions, a:flag) >= 0 +endfunction + +if exists('g:no_haskell_conceal') || !has('conceal') || &enc != 'utf-8' + finish +endif + +syntax cluster haskellTop add=hsNiceOperator + +" vim: set fenc=utf-8: +syntax match hsNiceOperator "\\\ze[[:alpha:][:space:]_([]" conceal cchar=λ contained + +" 'q' option to disable concealing of scientific constants (e.g. π). +if !Cf('q') + syntax match hsNiceOperator "\" conceal cchar=π contained + syntax match hsNiceOperator "\" conceal cchar=τ contained + syntax match hsNiceOperator "\" conceal cchar=ℎ contained + syntax match hsNiceOperator "\" conceal cchar=ℏ contained +endif + +syntax match hsNiceOperator "==" conceal cchar=≡ contained +syntax match hsNiceOperator "\/=" conceal cchar=≢ contained + +let s:extraConceal = 1 +" Some windows font don't support some of the characters, +" so if they are the main font, we don't load them :) +if has("win32") + let s:incompleteFont = [ 'Consolas' + \ , 'Lucida Console' + \ , 'Courier New' + \ ] + let s:mainfont = substitute( &guifont, '^\([^:,]\+\).*', '\1', '') + for s:fontName in s:incompleteFont + if s:mainfont ==? s:fontName + let s:extraConceal = 0 + break + endif + endfor +endif + +if s:extraConceal + syntax match hsNiceOperator "\" conceal cchar=⊥ contained + + " Match greater than and lower than w/o messing with Kleisli composition + syntax match hsNiceOperator "<=\ze[^<]" conceal cchar=≤ contained + syntax match hsNiceOperator ">=\ze[^>]" conceal cchar=≥ contained + + " Redfining to get proper '::' concealing + syntax match hs_DeclareFunction /^[a-z_(]\S*\(\s\|\n\)*::/me=e-2 nextgroup=hsNiceOperator contains=hs_FunctionName,hs_OpFunctionName contained + + syntax match hsNiceoperator "!!" conceal cchar=‼ contained + syntax match hsNiceoperator "++\ze[^+]" conceal cchar=⧺ contained + syntax match hsNiceOperator "\" conceal cchar=∀ contained + syntax match hsNiceOperator "-<" conceal cchar=↢ contained + syntax match hsNiceOperator ">-" conceal cchar=↣ contained + syntax match hsNiceOperator "-<<" conceal cchar=⤛ contained + syntax match hsNiceOperator ">>-" conceal cchar=⤜ contained + " the star does not seem so good... + " syntax match hsNiceOperator "*" conceal cchar=★ + syntax match hsNiceOperator "`div`" conceal cchar=÷ contained + + " Only replace the dot, avoid taking spaces around. + syntax match hsNiceOperator /\s\.\s/ms=s+1,me=e-1 conceal cchar=∘ contained + + syntax match hsQQEnd "|\]" contained conceal cchar=〛 contained + " sy match hsQQEnd "|\]" contained conceal=〚 + + syntax match hsNiceOperator "`elem`" conceal cchar=∈ contained + syntax match hsNiceOperator "`notElem`" conceal cchar=∉ contained + syntax match hsNiceOperator "`isSubsetOf`" conceal cchar=⊆ contained + syntax match hsNiceOperator "`union`" conceal cchar=∪ contained + syntax match hsNiceOperator "`intersect`" conceal cchar=∩ contained + syntax match hsNiceOperator "\\\\\ze[[:alpha:][:space:]_([]" conceal cchar=∖ contained + + syntax match hsNiceOperator "||\ze[[:alpha:][:space:]_([]" conceal cchar=∨ contained + syntax match hsNiceOperator "&&\ze[[:alpha:][:space:]_([]" conceal cchar=∧ contained + + syntax match hsNiceOperator "<\*>" conceal cchar=⊛ contained + syntax match hsNiceOperator "`mappend`" conceal cchar=⊕ contained + syntax match hsNiceOperator "\" conceal cchar=⊕ + syntax match hsNiceOperator "<>" conceal cchar=⊕ contained + syntax match hsNiceOperator "\" conceal cchar=∅ contained + syntax match hsNiceOperator "\" conceal cchar=∅ contained + syntax match hsNiceOperator "\" conceal cchar=∅ contained +endif + +hi link hsNiceOperator Operator +hi! link Conceal Operator +setlocal conceallevel=2 + +" '℘' option to disable concealing of powerset function +if !Cf('℘') + syntax match hsNiceOperator "\" conceal cchar=℘ contained +endif + +" '𝐒' option to disable String type to 𝐒 concealing +if !Cf('𝐒') + syntax match hsNiceOperator "\" conceal cchar=𝐒 contained +endif + +" '𝐓' option to disable Text type to 𝐓 concealing +if !Cf('𝐓') + syntax match hsNiceOperator "\" conceal cchar=𝐓 contained +endif + +" '𝐄' option to disable Either/Right/Left to 𝐄/𝑅/𝐿 concealing +if !Cf('𝐄') + syntax match hsNiceOperator "\" conceal cchar=𝐄 contained + syntax match hsNiceOperator "\" conceal cchar=𝑅 contained + syntax match hsNiceOperator "\" conceal cchar=𝐿 contained +endif + +" '𝐌' option to disable Maybe/Just/Nothing to 𝐌/𝐽/𝑁 concealing +if !Cf('𝐌') + syntax match hsNiceOperator "\" conceal cchar=𝐌 contained + syntax match hsNiceOperator "\" conceal cchar=𝐽 contained + syntax match hsNiceOperator "\" conceal cchar=𝑁 contained +endif + +" 'A' option to not try to preserve indentation. +if Cf('A') + syntax match hsNiceOperator "<-" conceal cchar=← contained + syntax match hsNiceOperator "->" conceal cchar=→ contained + syntax match hsNiceOperator "=>" conceal cchar=⇒ contained + syntax match hsNiceOperator "\:\:" conceal cchar=∷ contained +else + syntax match hsLRArrowHead contained ">" conceal cchar= contained + syntax match hsLRArrowTail contained "-" conceal cchar=→ contained + syntax match hsLRArrowFull "->" contains=hsLRArrowHead,hsLRArrowTail contained + + syntax match hsRLArrowHead contained "<" conceal cchar=← contained + syntax match hsRLArrowTail contained "-" conceal cchar= contained + syntax match hsRLArrowFull "<-" contains=hsRLArrowHead,hsRLArrowTail contained + + syntax match hsLRDArrowHead contained ">" conceal cchar= contained + syntax match hsLRDArrowTail contained "=" conceal cchar=⇒ contained + syntax match hsLRDArrowFull "=>" contains=hsLRDArrowHead,hsLRDArrowTail contained +endif + +" 's' option to disable space consumption after ∑,∏,√ and ¬ functions. +if Cf('s') + syntax match hsNiceOperator "\" conceal cchar=∑ contained + syntax match hsNiceOperator "\" conceal cchar=∏ contained + syntax match hsNiceOperator "\" conceal cchar=√ contained + syntax match hsNiceOperator "\" conceal cchar=¬ contained +else + syntax match hsNiceOperator "\\(\ze\s*[.$]\|\s*\)" conceal cchar=∑ contained + syntax match hsNiceOperator "\\(\ze\s*[.$]\|\s*\)" conceal cchar=∏ contained + syntax match hsNiceOperator "\\(\ze\s*[.$]\|\s*\)" conceal cchar=√ contained + syntax match hsNiceOperator "\\(\ze\s*[.$]\|\s*\)" conceal cchar=¬ contained +endif + +" '*' option to enable concealing of asterisk with '⋅' sign. +if Cf('*') + syntax match hsNiceOperator "*" conceal cchar=⋅ contained +" 'x' option to disable default concealing of asterisk with '×' sign. +elseif !Cf('x') + syntax match hsNiceOperator "*" conceal cchar=× contained +endif + +" 'E' option to enable ellipsis concealing with ‥ (two dot leader). +if Cf('E') + " The two dot leader is not guaranteed to be at the bottom. So, it + " will break on some fonts. + syntax match hsNiceOperator "\.\." conceal cchar=‥ contained +" 'e' option to disable ellipsis concealing with … (ellipsis sign). +elseif !Cf('e') + syntax match hsNiceOperator "\.\." conceal cchar=… contained +end + +" '⇒' option to disable `implies` concealing with ⇒ +if !Cf('⇒') + " Easily distinguishable from => keyword since the keyword can only be + " used in type signatures. + syntax match hsNiceOperator "`implies`" conceal cchar=⇒ contained +endif + +" '⇔' option to disable `iff` concealing with ⇔ +if !Cf('⇔') + syntax match hsNiceOperator "`iff`" conceal cchar=⇔ contained +endif + +" 'r' option to disable return (η) and join (µ) concealing. +if !Cf('r') + syntax match hsNiceOperator "\" conceal cchar=η contained + syntax match hsNiceOperator "\" conceal cchar=µ contained +endif + +" 'b' option to disable bind (left and right) concealing +if Cf('b') + " Vim has some issues concealing with composite symbols like '«̳', and + " unfortunately there is no other common short notation for both + " binds. So 'b' option to disable bind concealing altogether. +" 'f' option to enable formal (★) right bind concealing +elseif Cf('f') + syntax match hsNiceOperator ">>=" conceal cchar=★ contained +" 'c' option to enable encircled b/d (ⓑ/ⓓ) for right and left binds. +elseif Cf('c') + syntax match hsNiceOperator ">>=" conceal cchar=ⓑ contained + syntax match hsNiceOperator "=<<" conceal cchar=ⓓ contained +" 'h' option to enable partial concealing of binds (e.g. »=). +elseif Cf('h') + syntax match hsNiceOperator ">>" conceal cchar=» contained + syntax match hsNiceOperator "<<" conceal cchar=« contained + syntax match hsNiceOperator "=\zs<<" conceal cchar=« contained +" Left and right arrows with hooks are the default option for binds. +else + syntax match hsNiceOperator ">>=\ze\_[[:alpha:][:space:]_()[\]]" conceal cchar=↪ contained + syntax match hsNiceOperator "=<<\ze\_[[:alpha:][:space:]_()[\]]" conceal cchar=↩ contained +endif + +if !Cf('h') + syntax match hsNiceOperator ">>\ze\_[[:alpha:][:space:]_()[\]]" conceal cchar=» contained + syntax match hsNiceOperator "<<\ze\_[[:alpha:][:space:]_()[\]]" conceal cchar=« contained +endif + +" 'C' option to enable encircled 'm' letter ⓜ concealing for fmap. +if Cf('C') + syntax match hsNiceOperator "<$>" conceal cchar=ⓜ contained + syntax match hsNiceOperator "`fmap`" conceal cchar=ⓜ contained +" 'l' option to disable fmap/lift concealing with ↥. +elseif !Cf('l') + syntax match hsNiceOperator "`liftM`" conceal cchar=↥ contained + syntax match hsNiceOperator "`liftA`" conceal cchar=↥ contained + syntax match hsNiceOperator "`fmap`" conceal cchar=↥ contained + syntax match hsNiceOperator "<$>" conceal cchar=↥ contained + + syntax match LIFTQ contained "`" conceal contained + syntax match LIFTQl contained "l" conceal cchar=↥ contained + syntax match LIFTl contained "l" conceal cchar=↥ contained + syntax match LIFTi contained "i" conceal contained + syntax match LIFTf contained "f" conceal contained + syntax match LIFTt contained "t" conceal contained + syntax match LIFTA contained "A" conceal contained + syntax match LIFTM contained "M" conceal contained + syntax match LIFT2 contained "2" conceal cchar=² contained + syntax match LIFT3 contained "3" conceal cchar=³ contained + syntax match LIFT4 contained "4" conceal cchar=⁴ contained + syntax match LIFT5 contained "5" conceal cchar=⁵ contained + + syntax match hsNiceOperator "`liftM2`" contains=LIFTQ,LIFTQl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT2 contained + syntax match hsNiceOperator "`liftM3`" contains=LIFTQ,LIFTQl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT3 contained + syntax match hsNiceOperator "`liftM4`" contains=LIFTQ,LIFTQl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT4 contained + syntax match hsNiceOperator "`liftM5`" contains=LIFTQ,LIFTQl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT5 contained + syntax match hsNiceOperator "`liftA2`" contains=LIFTQ,LIFTQl,LIFTi,LIFTf,LIFTt,LIFTA,LIFT2 contained + syntax match hsNiceOperator "`liftA3`" contains=LIFTQ,LIFTQl,LIFTi,LIFTf,LIFTt,LIFTA,LIFT3 contained + + syntax match FMAPf contained "f" conceal cchar=↥ contained + syntax match FMAPm contained "m" conceal contained + syntax match FMAPa contained "a" conceal contained + syntax match FMAPp contained "p" conceal contained + syntax match FMAPSPC contained " " conceal contained + syntax match hsNiceOperator "\\s*" contains=FMAPf,FMAPm,FMAPa,FMAPp,FMAPSPC contained + + syntax match LIFTSPC contained " " conceal contained + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTA,LIFTSPC contained + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTA,LIFT2,LIFTSPC contained + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTA,LIFT3,LIFTSPC contained + + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFTSPC contained + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT2,LIFTSPC contained + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT3,LIFTSPC contained + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT4,LIFTSPC contained + syntax match hsNiceOperator "\\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT5,LIFTSPC contained + + " TODO: Move liftIO to its own flag? + syntax match LIFTIOL contained "l" conceal contained + syntax match LIFTI contained "I" conceal cchar=i contained + syntax match LIFTO contained "O" conceal cchar=o contained + syntax match hsNiceOperator "\" contains=LIFTIOl,LIFTi,LIFTf,LIFTt,LIFTI,LIFTO contained +endif + +" '↱' option to disable mapM/forM concealing with ↱/↰ +if !Cf('↱') + syntax match MAPMQ contained "`" conceal contained + syntax match MAPMm contained "m" conceal cchar=↱ contained + syntax match MAPMmQ contained "m" conceal cchar=↰ contained + syntax match MAPMa contained "a" conceal contained + syntax match MAPMp contained "p" conceal contained + syntax match MAPMM contained "M" conceal contained + syntax match MAPMM contained "M" conceal contained + syntax match MAPMU contained "_" conceal cchar=_ contained + syntax match SPC contained " " conceal contained + syntax match hsNiceOperator "`mapM_`" contains=MAPMQ,MAPMmQ,MAPMa,MAPMp,MAPMM,MAPMU contained + syntax match hsNiceOperator "`mapM`" contains=MAPMQ,MAPMmQ,MAPMa,MAPMp,MAPMM contained + syntax match hsNiceOperator "\\s*" contains=MAPMm,MAPMa,MAPMp,MAPMM,SPC contained + syntax match hsNiceOperator "\\s*" contains=MAPMm,MAPMa,MAPMp,MAPMM,MAPMU,SPC contained + + syntax match FORMQ contained "`" conceal contained + syntax match FORMfQ contained "f" conceal cchar=↱ contained + syntax match FORMf contained "f" conceal cchar=↰ contained + syntax match FORMo contained "o" conceal contained + syntax match FORMr contained "r" conceal contained + syntax match FORMM contained "M" conceal contained + syntax match FORMU contained "_" conceal cchar=_ contained + + syntax match hsNiceOperator "`forM`" contains=FORMQ,FORMfQ,FORMo,FORMr,FORMM contained + syntax match hsNiceOperator "`forM_`" contains=FORMQ,FORMfQ,FORMo,FORMr,FORMM,FORMU contained + + syntax match hsNiceOperator "\\s*" contains=FORMf,FORMo,FORMr,FORMM,SPC contained + syntax match hsNiceOperator "\\s*" contains=FORMf,FORMo,FORMr,FORMM,FORMU,SPC contained +endif + +" 'w' option to disable 'where' concealing with "due to"/∵ symbol. +if !Cf('w') + " ∵ means "because/since/due to." With quite a stretch this can be + " used for 'where'. We preserve spacing, otherwise it breaks indenting + " in a major way. + syntax match WS contained "w" conceal cchar=∵ contained + syntax match HS contained "h" conceal cchar= contained + syntax match ES contained "e" conceal cchar= contained + syntax match RS contained "r" conceal cchar= contained + syntax match hsNiceOperator "\" contains=WS,HS,ES,RS,ES contained +endif + +" '-' option to disable subtract/(-) concealing with ⊟. +if !Cf('-') + " Minus is a special syntax construct in Haskell. We use squared minus to + " tell the syntax from the binary function. + syntax match hsNiceOperator "(-)" conceal cchar=⊟ contained + syntax match hsNiceOperator "`subtract`" conceal cchar=⊟ contained +endif + +" 'I' option to enable alternative ':+' concealing with with ⨢. +if Cf('I') + " With some fonts might look better than ⅈ. + syntax match hsNiceOperator ":+" conceal cchar=⨢ contained +" 'i' option to disable default concealing of ':+' with ⅈ. +elseif !Cf('i') + syntax match hsNiceOperator ":+" conceal cchar=ⅈ contained +endif + +" 'R' option to disable realPart/imagPart concealing with ℜ/ℑ. +if !Cf('R') + syntax match hsNiceOperator "\" conceal cchar=ℜ contained + syntax match hsNiceOperator "\" conceal cchar=ℑ contained +endif + +" 'T' option to enable True/False constants concealing with bold 𝐓/𝐅. +if Cf('T') + syntax match hsNiceSpecial "\" conceal cchar=𝐓 contained + syntax match hsNiceSpecial "\" conceal cchar=𝐅 contained +" 't' option to disable True/False constants concealing with italic 𝑇/𝐹. +elseif !Cf('t') + syntax match hsNiceSpecial "\" conceal cchar=𝑇 contained + syntax match hsNiceSpecial "\" conceal cchar=𝐹 contained +endif + +" 'B' option to disable Bool type to 𝔹 concealing +if !Cf('B') + " Not an official notation ttbomk. But at least + " http://www.haskell.org/haskellwiki/Unicode-symbols mentions it. + syntax match hsNiceOperator "\" conceal cchar=𝔹 contained +endif + +" 'Q' option to disable Rational type to ℚ concealing. +if !Cf('Q') + syntax match hsNiceOperator "\" conceal cchar=ℚ +endif + +" 'Z' option to disable Integer type to ℤ concealing. +if !Cf('Z') + syntax match hsNiceOperator "\" conceal cchar=ℤ contained +endif + +" 'N' option to disable Natural, Nat types to ℕ concealing. +if !Cf('N') + syntax match hsNiceOperator "\" conceal cchar=ℕ contained + syntax match hsNiceOperator "\" conceal cchar=ℕ contained +endif + +" '𝔻' option to disable Double type to 𝔻 concealing +if !Cf('𝔻') + syntax match hsNiceOperator "\" conceal cchar=𝔻 contained +endif + +" '1' option to disable numeric superscripts concealing, e.g. x². +if !Cf('1') + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)0\ze\_W" conceal cchar=⁰ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)1\ze\_W" conceal cchar=¹ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)2\ze\_W" conceal cchar=² contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)3\ze\_W" conceal cchar=³ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)4\ze\_W" conceal cchar=⁴ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)5\ze\_W" conceal cchar=⁵ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)6\ze\_W" conceal cchar=⁶ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)7\ze\_W" conceal cchar=⁷ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)8\ze\_W" conceal cchar=⁸ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)9\ze\_W" conceal cchar=⁹ contained +endif + +" 'a' option to disable alphabet superscripts concealing, e.g. xⁿ. +if !Cf('a') + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)a\ze\_W" conceal cchar=ᵃ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)b\ze\_W" conceal cchar=ᵇ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)c\ze\_W" conceal cchar=ᶜ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)d\ze\_W" conceal cchar=ᵈ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)e\ze\_W" conceal cchar=ᵉ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)f\ze\_W" conceal cchar=ᶠ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)g\ze\_W" conceal cchar=ᵍ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)h\ze\_W" conceal cchar=ʰ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)i\ze\_W" conceal cchar=ⁱ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)j\ze\_W" conceal cchar=ʲ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)k\ze\_W" conceal cchar=ᵏ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)l\ze\_W" conceal cchar=ˡ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)m\ze\_W" conceal cchar=ᵐ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)n\ze\_W" conceal cchar=ⁿ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)o\ze\_W" conceal cchar=ᵒ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)p\ze\_W" conceal cchar=ᵖ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)r\ze\_W" conceal cchar=ʳ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)s\ze\_W" conceal cchar=ˢ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)t\ze\_W" conceal cchar=ᵗ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)u\ze\_W" conceal cchar=ᵘ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)v\ze\_W" conceal cchar=ᵛ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)w\ze\_W" conceal cchar=ʷ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)x\ze\_W" conceal cchar=ˣ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)y\ze\_W" conceal cchar=ʸ contained + syntax match hsNiceOperator "\(\*\*\|\^\|\^\^\)z\ze\_W" conceal cchar=ᶻ contained +endif + +" Not really Haskell, but quite handy for writing proofs in pseudo-code. +if Cf('∴') + syntax match hsNiceOperator "\" conceal cchar=∴ contained + syntax match hsNiceOperator "\" conceal cchar=∃ contained + syntax match hsNiceOperator "\" conceal cchar=∄ contained + syntax match hsNiceOperator ":=" conceal cchar=≝ contained +endif + +" TODO: +" See Basic Syntax Extensions - School of Haskell | FP Complete +" intersection = (∩) +" +" From the Data.IntMap.Strict.Unicode +" notMember = (∉) = flip (∌) +" member = (∈) = flip (∋) +" isProperSubsetOf = (⊂) = flip (⊃) +" +" From Data.Sequence.Unicode +" (<|) = (⊲ ) +" (|>) = (⊳ ) +" (><) = (⋈ ) diff --git a/etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.hs b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.hs new file mode 100644 index 0000000..932b643 --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.hs @@ -0,0 +1,46 @@ +{-# LANGUAGE ExistentialQuantification, RankNTypes #-} +import Control.Applicative +import Data.Monoid +import Control.Monad.ST.Lazy +import Control.Monad +import Numeric +import Data.Complex +import Data.List + +factorial :: Integer -> Integer +factorial n = product as + where as = [n, n-1..1] + +integral :: (Num a, Enum a) => (a -> a) -> a -> (a,a) -> a +integral f dx (a,b) = sum ((\x -> f(x)*dx) <$> ab) + where ab = [a,a+dx..b-dx] + +isValid :: Integer -> Bool -> Bool -> Bool +isValid a b c = (a >= 0 && a <= 10) || (b && not c) + +rs :: forall a. (forall s. ST s a) -> a +rs = runST + +main :: IO () +main = do + let tau = 2*pi + putSL $ showF 2 $ integral sin 0.001 (pi,tau) + print $ unsafe [pi,tau] + print $ factorial <$> [1..13`div`2] + print $ texNum . showF 2 <$> (mag <$> [1,2] <*> [3,4]) + print $ Just True >>= (\x -> return $ x `elem` [True, False, False]) + >>= (\x -> if x /= True + then Nothing + else return True) + >>= (\x -> return $ isValid 1 True x) + print $ [1,2] `union` [3,4] == [-9,-8..4] `intersect` [1,2..9] + print $ (++"il") <$> (Just "fa" >> guard False >> return undefined) + print $ realPart(4:+2) == imagPart(2:+4) + print $ liftM3 (\x y z -> x+y+z) [1] [2] [39] + putSL $ "Hask" <> "ell" + where + mag a b = sqrt(a^2 + b^2) + showF n f = showFFloat (Just n) f empty + unsafe xs = (xs!!0,xs!!1) + texNum num = "$\\num{" ++ num ++ "}$" + putSL = putStrLn diff --git a/etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.lhs b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.lhs new file mode 100644 index 0000000..ca75204 --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.lhs @@ -0,0 +1,90 @@ +{-# LANGUAGE ExistentialQuantification, RankNTypes #-} +import Control.Applicative +>> import Control.Applicative +import Data.Monoid +>> import Data.Monoid +import Control.Monad.ST.Lazy +>> import Control.Monad.ST.Lazy +import Control.Monad +>> import Control.Monad +import Numeric +>> import Numeric +import Data.Complex +>> import Data.Complex +import Data.List +>> import Data.List + +factorial :: Integer -> Integer +factorial n = product as + where as = [n, n-1..1] + +>> factorial :: Integer -> Integer +>> factorial n = product as +>> where as = [n, n-1..1] + +integral :: (Num a, Enum a) => (a -> a) -> a -> (a,a) -> a +integral f dx (a,b) = sum ((\x -> f(x)*dx) <$> ab) + where ab = [a,a+dx..b-dx] + +>> integral :: (Num a, Enum a) => (a -> a) -> a -> (a,a) -> a +>> integral f dx (a,b) = sum ((\x -> f(x)*dx) <$> ab) +>> where ab = [a,a+dx..b-dx] + +isValid :: Integer -> Bool -> Bool -> Bool +isValid a b c = (a >= 0 && a <= 10) || (b && not c) + +>> isValid :: Integer -> Bool -> Bool -> Bool +>> isValid a b c = (a >= 0 && a <= 10) || (b && not c) + +rs :: forall a. (forall s. ST s a) -> a +rs = runST +>> rs :: forall a. (forall s. ST s a) -> a +>> rs = runST + +main :: IO () +main = do + let tau = 2*pi + putSL $ showF 2 $ integral sin 0.001 (pi,tau) + print $ unsafe [pi,tau] + print $ factorial <$> [1..13`div`2] + print $ texNum . showF 2 <$> (mag <$> [1,2] <*> [3,4]) + print $ Just True >>= (\x -> return $ x `elem` [True, False, False]) + >>= (\x -> if x /= True + then Nothing + else return True) + >>= (\x -> return $ isValid 1 True x) + print $ [1,2] `union` [3,4] == [-9,-8..4] `intersect` [1,2..9] + print $ (++"il") <$> (Just "fa" >> guard False >> return undefined) + print $ realPart(4:+2) == imagPart(2:+4) + print $ liftM3 (\x y z -> x+y+z) [1] [2] [39] + putSL $ "Hask" <> "ell" + where + mag a b = sqrt(a^2 + b^2) + showF n f = showFFloat (Just n) f empty + unsafe xs = (xs!!0,xs!!1) + texNum num = "$\\num{" ++ num ++ "}$" + putSL = putStrLn + +>> main :: IO () +>> main = do +>> let tau = 2*pi +>> putSL $ showF 2 $ integral sin 0.001 (pi,tau) +>> print $ unsafe [pi,tau] +>> print $ factorial <$> [1..13`div`2] +>> print $ texNum . showF 2 <$> (mag <$> [1,2] <*> [3,4]) +>> print $ Just True >>= (\x -> return $ x `elem` [True, False, False]) +>> >>= (\x -> if x /= True +>> then Nothing +>> else return True) +>> >>= (\x -> return $ isValid 1 True x) +>> print $ [1,2] `union` [3,4] == [-9,-8..4] `intersect` [1,2..9] +>> print $ (++"il") <$> (Just "fa" >> guard False >> return undefined) +>> print $ realPart(4:+2) == imagPart(2:+4) +>> print $ liftM3 (\x y z -> x+y+z) [1] [2] [39] +>> putSL $ "Hask" <> "ell" +>> where +>> mag a b = sqrt(a^2 + b^2) +>> showF n f = showFFloat (Just n) f empty +>> unsafe xs = (xs!!0,xs!!1) +>> texNum num = "$\\num{" ++ num ++ "}$" +>> putSL = putStrLn diff --git a/etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.png b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.png new file mode 100644 index 0000000..9d898cc Binary files /dev/null and b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.png differ diff --git a/etc/soft/nvim/+plugins/vim-haskellConcealPlus/gendemo.sh b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/gendemo.sh new file mode 100755 index 0000000..38fb02b --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/gendemo.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +rm s{l,r}.png +convert -crop 490x685+0+35 l.png sl.png +convert -crop 640x685+0+35 r.png sr.png +convert sl.png sr.png +append demo.png diff --git a/etc/soft/nvim/+plugins/vim-haskellConcealPlus/tests/test-with-pack.sh b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/tests/test-with-pack.sh new file mode 100755 index 0000000..2c048bb --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/tests/test-with-pack.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +set -e + +tag=test + +docker build -t "$tag" - << EOF_DOCKERFILE +from debian:buster + +run apt-get update + +run apt-get install -y locales +run echo en_US.UTF-8 UTF-8 > /etc/locale.gen +run dpkg-reconfigure locales --frontend=noninteractive + +run apt-get install -y vim +run apt-get install -y git +run apt-get install -y screen + +run useradd -m -s /bin/bash user +env SHELL /bin/bash +env LANG en_US.UTF-8 +env LC_CTYPE en_US.UTF8 + +user user +run mkdir -p ~/.vim/pack/vim-haskellConcealPlus/start && \ + cd ~/.vim/pack/vim-haskellConcealPlus/start && \ + git clone https://github.com/enomsg/vim-haskellConcealPlus +run echo "syn on\nsetlocal conceallevel=2\nset concealcursor=nciv" > ~/.vimrc +# Run in screen as it handles terminal capabilities better than most of the raw +# terminals. +cmd screen vim ~/.vim/pack/vim-haskellConcealPlus/start/vim-haskellConcealPlus/demo.hs +#cmd bash +EOF_DOCKERFILE + +docker run \ + -e TERM="$TERM" \ + -w /home/user \ + -it "$tag" "$@" diff --git a/etc/soft/nvim/+plugins/vim-haskellConcealPlus/tests/test-with-pathogen.sh b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/tests/test-with-pathogen.sh new file mode 100755 index 0000000..385a118 --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-haskellConcealPlus/tests/test-with-pathogen.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -e + +tag=test + +docker build -t "$tag" - << EOF_DOCKERFILE +from debian:buster + +run apt-get update + +run apt-get install -y locales +run echo en_US.UTF-8 UTF-8 > /etc/locale.gen +run dpkg-reconfigure locales --frontend=noninteractive + +run apt-get install -y vim +run apt-get install -y vim-pathogen +run apt-get install -y git +run apt-get install -y screen + +run useradd -m -s /bin/bash user +env SHELL /bin/bash +env LANG en_US.UTF-8 +env LC_CTYPE en_US.UTF8 + +user user +run mkdir -p ~/.vim/bundle && cd ~/.vim/bundle && git clone https://github.com/enomsg/vim-haskellConcealPlus +run echo "execute pathogen#infect()\nsyn on\nsetlocal conceallevel=2\nset concealcursor=nciv" > ~/.vimrc +# Run in screen as it handles terminal capabilities better than most of the raw +# terminals. +cmd screen vim ~/.vim/bundle/vim-haskellConcealPlus/demo.hs +#cmd bash +EOF_DOCKERFILE + +docker run \ + -e TERM="$TERM" \ + -w /home/user \ + -it "$tag" "$@" diff --git a/etc/soft/nvim/+plugins/vim-haskellfold/README.md b/etc/soft/nvim/+plugins/vim-haskellfold/README.md new file mode 100644 index 0000000..6c32307 --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-haskellfold/README.md @@ -0,0 +1,14 @@ +# haskellFold + +Provide a better folding for haskell file. The folded lines are transformed +to display the type signature (if any) of the function, providing a great +overview of your file content. + +You can get a shorter version of the foldtext (only the first relevant line) +by setting `g:haskellFold_ShortText = 1` + +# Installation + +Drop the file in ~/.vim/plugin or ~/vimfiles/plugin folder, or if you +use pathogen into the ~/.vim/bundle/vim-haskellFold or +~/vimfiles/bundle/vim-haskellFold diff --git a/etc/soft/nvim/+plugins/vim-haskellfold/autoload/haskellFold.vim b/etc/soft/nvim/+plugins/vim-haskellfold/autoload/haskellFold.vim new file mode 100644 index 0000000..492040f --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-haskellfold/autoload/haskellFold.vim @@ -0,0 +1,121 @@ +" ============================================================================= +" Descriptions: Provide a function providing folding information for haskell +" files. +" Maintainer: Vincent B (twinside@gmail.com) +" Warning: Assume the presence of type signatures on top of your functions to +" work well. +" Usage: drop in ~/vimfiles/plugin or ~/.vim/plugin +" Version: 1.2 +" Changelog: - 1.2 : Reacting to file type instead of file extension. +" - 1.1 : Adding foldtext to bet more information. +" - 1.0 : initial version +" ============================================================================= +" Top level bigdefs +fun! s:HaskellFoldMaster( line ) "{{{ + return a:line =~# '^data\s' + \ || a:line =~# '^type\s' + \ || a:line =~# '^newtype\s' + \ || a:line =~# '^class\s' + \ || a:line =~# '^instance\s' + \ || a:line =~ '^[^:]\+\s*::' +endfunction "}}} + +" Top Level one line shooters. +fun! s:HaskellSnipGlobal(line) "{{{ + return a:line =~# '^module' + \ || a:line =~# '^import' + \ || a:line =~# '^infix[lr]\s' +endfunction "}}} + +" The real folding function +fun! haskellFold#HaskellFold( lineNum ) "{{{ + let line = getline( a:lineNum ) + + " Beginning of comment + if line =~ '^\s*--' || line =~ '^\s*{-' + return 2 + endif + + if line =~ '^import' + return 2 + endif + + if s:HaskellSnipGlobal( line ) + return 0 + endif + + if line =~ '^\s*$' + let nextline = getline(a:lineNum + 1) + if s:HaskellFoldMaster( nextline ) > 0 || s:HaskellSnipGlobal( nextline ) > 0 + \ || nextline =~ "^--" || nextline =~ "^{-" + return 0 + else + return -1 + endif + endif + + return 1 +endfunction "}}} + +" This function skim over function definitions +" skiping comments line : +" -- .... +" and merging lines without first non space element, to +" catch the full type expression. +fun! haskellFold#HaskellFoldText() "{{{ + let i = v:foldstart + let retVal = '' + let began = 0 + + let commentOnlyLine = '^\s*--.*$' + let monoLineComment = '\s*--.*$' + let nonEmptyLine = '^\s\+\S' + let emptyLine = '^\s*$' + let multilineCommentBegin = '^\s*{-' + let multilineCommentEnd = '-}' + + let short = get(g:, 'haskellFold_ShortText', 0) + let isMultiLine = 0 + + let line = getline(i) + while i <= v:foldend + + if isMultiLine + if line =~ multilineCommentEnd + let isMultiLine = 0 + let line = substitute(line, '.*-}', '', '') + + if line =~ emptyLine + let i = i + 1 + let line = getline(i) + end + else + let i = i + 1 + let line = getline(i) + end + else + if line =~ multilineCommentBegin + let isMultiLine = 1 + continue + elseif began == 0 && !(line =~ commentOnlyLine) + let retVal = substitute(line, monoLineComment, ' ','') + let began = 1 + elseif began != 0 && line =~ nonEmptyLine && !short + let tempVal = substitute( line, '\s\+\(.*\)$', ' \1', '' ) + let retVal = retVal . substitute(tempVal, '\s\+--.*', ' ','') + elseif began != 0 + break + endif + + let i = i + 1 + let line = getline(i) + endif + endwhile + + if retVal == '' + " We didn't found any meaningfull text + return foldtext() + endif + + return retVal +endfunction "}}} diff --git a/etc/soft/nvim/+plugins/vim-haskellfold/ftplugin/haskell.vim b/etc/soft/nvim/+plugins/vim-haskellfold/ftplugin/haskell.vim new file mode 100644 index 0000000..eb5daee --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-haskellfold/ftplugin/haskell.vim @@ -0,0 +1 @@ +call SetHaskellFolding() diff --git a/etc/soft/nvim/+plugins/vim-haskellfold/plugin/haskellFold.vim b/etc/soft/nvim/+plugins/vim-haskellfold/plugin/haskellFold.vim new file mode 100644 index 0000000..74f19ba --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-haskellfold/plugin/haskellFold.vim @@ -0,0 +1,11 @@ +if exists("g:__HASKELLFOLD_VIM__") + finish +endif + +let g:__HASKELLFOLD_VIM__ = 1 + +fun! SetHaskellFolding() "{{{ + setlocal foldexpr=haskellFold#HaskellFold(v:lnum) + setlocal foldtext=haskellFold#HaskellFoldText() + setlocal foldmethod=expr +endfunction "}}} diff --git a/etc/soft/nvim/+plugins/vim-helm/LICENSE b/etc/soft/nvim/+plugins/vim-helm/LICENSE new file mode 100644 index 0000000..7edb88b --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-helm/LICENSE @@ -0,0 +1,33 @@ +Copyright (c) 2018, Tobias Wolf +All rights reserved. + +Contains syntax portions licensed from: +https://github.com/fatih/vim-go + +Copyright (c) 2015, Fatih Arslan +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/etc/soft/nvim/+plugins/vim-helm/README.md b/etc/soft/nvim/+plugins/vim-helm/README.md new file mode 100644 index 0000000..1a38dcc --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-helm/README.md @@ -0,0 +1,8 @@ +# vim-helm +vim syntax for helm templates (yaml + gotmpl + sprig + custom) + +Install via vundle: + +```vim +Plugin 'towolf/vim-helm' +``` diff --git a/etc/soft/nvim/+plugins/vim-helm/ftdetect/helm.vim b/etc/soft/nvim/+plugins/vim-helm/ftdetect/helm.vim new file mode 100644 index 0000000..9a502ac --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-helm/ftdetect/helm.vim @@ -0,0 +1 @@ +autocmd BufRead,BufNewFile */templates/*.yaml,*/templates/*.tpl set ft=helm diff --git a/etc/soft/nvim/+plugins/vim-helm/syntax/helm.vim b/etc/soft/nvim/+plugins/vim-helm/syntax/helm.vim new file mode 100644 index 0000000..0b874fc --- /dev/null +++ b/etc/soft/nvim/+plugins/vim-helm/syntax/helm.vim @@ -0,0 +1,95 @@ +if exists("b:current_syntax") + finish +endif + +if !exists("main_syntax") + let main_syntax = 'yaml' +endif + +let b:current_syntax = '' +unlet b:current_syntax +runtime! syntax/yaml.vim + +let b:current_syntax = '' +unlet b:current_syntax +syntax include @Yaml syntax/yaml.vim + +syn case match + +" Go escapes +syn match goEscapeOctal display contained "\\[0-7]\{3}" +syn match goEscapeC display contained +\\[abfnrtv\\'"]+ +syn match goEscapeX display contained "\\x\x\{2}" +syn match goEscapeU display contained "\\u\x\{4}" +syn match goEscapeBigU display contained "\\U\x\{8}" +syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+ + +hi def link goEscapeOctal goSpecialString +hi def link goEscapeC goSpecialString +hi def link goEscapeX goSpecialString +hi def link goEscapeU goSpecialString +hi def link goEscapeBigU goSpecialString +hi def link goSpecialString Special +hi def link goEscapeError Error + +" Strings and their contents +syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError +syn region goString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup +syn region goRawString contained start=+`+ end=+`+ + +hi def link goString String +hi def link goRawString String + +" Characters; their contents +syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU +syn region goCharacter contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup + +hi def link goCharacter Character + +" Integers +syn match goDecimalInt contained "\<\d\+\([Ee]\d\+\)\?\>" +syn match goHexadecimalInt contained "\<0x\x\+\>" +syn match goOctalInt contained "\<0\o\+\>" +syn match goOctalError contained "\<0\o*[89]\d*\>" +syn cluster goInt contains=goDecimalInt,goHexadecimalInt,goOctalInt +" Floating point +syn match goFloat contained "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>" +syn match goFloat contained "\<\.\d\+\([Ee][-+]\d\+\)\?\>" +syn match goFloat contained "\<\d\+[Ee][-+]\d\+\>" +" Imaginary literals +syn match goImaginary contained "\<\d\+i\>" +syn match goImaginary contained "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>" +syn match goImaginary contained "\<\.\d\+\([Ee][-+]\d\+\)\?i\>" +syn match goImaginary contained "\<\d\+[Ee][-+]\d\+i\>" + +hi def link goInt Number +hi def link goFloat Number +hi def link goImaginary Number + +" Token groups +syn cluster gotplLiteral contains=goString,goRawString,goCharacter,@goInt,goFloat,goImaginary +syn keyword gotplControl contained if else end range with template include tpl required define +syn keyword gotplFunctions contained and call html index js len not or print printf println urlquery eq ne lt le gt ge +syn keyword goSprigFunctions contained abbrev abbrevboth add add1 adler32sum ago append atoi b32dec b32enc b64dec b64enc base biggest buildCustomCert camelcase cat ceil clean coalesce \contains compact date dateInZone dateModify date_in_zone date_modify default derivePassword dict dir div empty ext fail first float64 floor fromJson fromYaml genCA genPrivateKey genSelfSignedCert genSignedCert has hasKey hasPrefix hasSuffix hello htmlDate htmlDateInZone indent initial initials int int64 isAbs join kebabcase keys kindIs kindOf last list lower max merge mergeOverwrite min mod mul nindent nospace now omit pick pluck plural prepend quote randAlpha randAlphaNum randAscii randNumeric regexFind regexFindAll regexMatch regexReplaceAll regexReplaceAllLiteral regexSplit repeat replace rest reverse round semver semverCompare set sha1sum sha256sum shuffle slice snakecase sortAlpha split splitList splitn squote sub substr swapcase ternary title toDate toJson toPrettyJson toString toStrings toToml toYaml trim trimAll trimPrefix trimSuffix trimall trunc tuple typeIs typeIsLike typeOf uniq unixEpoch unset until untilStep untitle upper uuidv4 values without wrap wrapWith +syn match goTplVariable contained /\$[a-zA-Z0-9_]*\>/ +syn match goTplIdentifier contained /\.[^\s}]+\>/ + +" hi def link gotplControl Keyword +" hi def link gotplFunctions Function +" hi def link goSprigFunctions Function +" hi def link goTplVariable Special +hi def link gotplControl goConditional +hi def link gotplFunctions goConditional +hi def link goSprigFunctions goConditional +hi def link goTplVariable goStatement + +syn region gotplAction start="{{\(-? \)\?" end="\( -?\)\?}}" contains=@gotplLiteral,gotplControl,gotplFunctions,goSprigFunctions,gotplVariable,goTplIdentifier containedin=yamlFlowString display +syn region gotplAction start="\[\[\(-? \)\?" end="\( -?\)\?\]\]" contains=@gotplLiteral,gotplControl,gotplFunctions,goSprigFunctions,gotplVariable containedin=yamlFlowString display +syn region goTplComment start="{{\(-? \)\?/\*" end="\*/\( -?\)\?}}" display +syn region goTplComment start="\[\[\(-? \)\?/\*" end="\*/\( -?\)\?\]\]" display + +hi def link goTplAction Operator +hi def link goTplComment Comment +let b:current_syntax = "helm" + +" vim: sw=2 ts=2 et diff --git a/etc/soft/nvim/+plugins/vim-haskellConceal/README b/etc/soft/nvim/+plugins_disabled/vim-haskellConceal/README similarity index 100% rename from etc/soft/nvim/+plugins/vim-haskellConceal/README rename to etc/soft/nvim/+plugins_disabled/vim-haskellConceal/README diff --git a/etc/soft/nvim/+plugins/vim-haskellConceal/after/syntax/haskell.vim b/etc/soft/nvim/+plugins_disabled/vim-haskellConceal/after/syntax/haskell.vim similarity index 100% rename from etc/soft/nvim/+plugins/vim-haskellConceal/after/syntax/haskell.vim rename to etc/soft/nvim/+plugins_disabled/vim-haskellConceal/after/syntax/haskell.vim diff --git a/etc/soft/nvim/cheat40.txt b/etc/soft/nvim/cheat40.txt index c32907d..08256fd 100644 --- a/etc/soft/nvim/cheat40.txt +++ b/etc/soft/nvim/cheat40.txt @@ -1,6 +1,6 @@ Press q to dismiss, to lose focus -Перемещение {{{1 +Перемещение {{{2 В начало экрана H N В центр экрана M N @@ -15,6 +15,9 @@ Press q to dismiss, to lose focus Строку в центр экрана z. N Строку вниз экрана z- N + Конец предыдущего слова ge + Конец предыдущего СЛОВА gE + ex {{{1 Замена в найденных стр. :g/../s/a/b/g C @@ -31,3 +34,15 @@ ex {{{1 Открыть ссылку gx N +Регулярные выражения {{{1 + + идентификатор isident \i + ~ \i без цифр \I + ключевое слово iskeyword \k + ~ \k без цифр \K + имя файла isfname \f + ~ \f без цифр \F + печатные символы \p + ~ \p без цифр \P + последняя строка поиска ~ + diff --git a/etc/soft/nvim/colors/PaperColor_Edit.vim b/etc/soft/nvim/colors/PaperColor_Edit.vim new file mode 100644 index 0000000..be5c59b --- /dev/null +++ b/etc/soft/nvim/colors/PaperColor_Edit.vim @@ -0,0 +1,1323 @@ +" Theme: PaperColor +" Author: Nguyen Nguyen +" License: MIT +" Origin: http://github.com/NLKNguyen/papercolor-theme.git +" +" Modified from the theme 'Tomorrow' + +hi clear +syntax reset +let g:colors_name = "PaperColor" + +" Helper Functions: {{{ +" Returns an approximate grey index for the given grey level +fun s:grey_number(x) + if &t_Co == 88 + if a:x < 23 + return 0 + elseif a:x < 69 + return 1 + elseif a:x < 103 + return 2 + elseif a:x < 127 + return 3 + elseif a:x < 150 + return 4 + elseif a:x < 173 + return 5 + elseif a:x < 196 + return 6 + elseif a:x < 219 + return 7 + elseif a:x < 243 + return 8 + else + return 9 + endif + else + if a:x < 14 + return 0 + else + let l:n = (a:x - 8) / 10 + let l:m = (a:x - 8) % 10 + if l:m < 5 + return l:n + else + return l:n + 1 + endif + endif + endif +endfun + +" Returns the actual grey level represented by the grey index +fun s:grey_level(n) + if &t_Co == 88 + if a:n == 0 + return 0 + elseif a:n == 1 + return 46 + elseif a:n == 2 + return 92 + elseif a:n == 3 + return 115 + elseif a:n == 4 + return 139 + elseif a:n == 5 + return 162 + elseif a:n == 6 + return 185 + elseif a:n == 7 + return 208 + elseif a:n == 8 + return 231 + else + return 255 + endif + else + if a:n == 0 + return 0 + else + return 8 + (a:n * 10) + endif + endif +endfun + +" Returns the palette index for the given grey index +fun s:grey_colour(n) + if &t_Co == 88 + if a:n == 0 + return 16 + elseif a:n == 9 + return 79 + else + return 79 + a:n + endif + else + if a:n == 0 + return 16 + elseif a:n == 25 + return 231 + else + return 231 + a:n + endif + endif +endfun + +" Returns an approximate colour index for the given colour level +fun s:rgb_number(x) + if &t_Co == 88 + if a:x < 69 + return 0 + elseif a:x < 172 + return 1 + elseif a:x < 230 + return 2 + else + return 3 + endif + else + if a:x < 75 + return 0 + else + let l:n = (a:x - 55) / 40 + let l:m = (a:x - 55) % 40 + if l:m < 20 + return l:n + else + return l:n + 1 + endif + endif + endif +endfun + +" Returns the actual colour level for the given colour index +fun s:rgb_level(n) + if &t_Co == 88 + if a:n == 0 + return 0 + elseif a:n == 1 + return 139 + elseif a:n == 2 + return 205 + else + return 255 + endif + else + if a:n == 0 + return 0 + else + return 55 + (a:n * 40) + endif + endif +endfun + +" Returns the palette index for the given R/G/B colour indices +fun s:rgb_colour(x, y, z) + if &t_Co == 88 + return 16 + (a:x * 16) + (a:y * 4) + a:z + else + return 16 + (a:x * 36) + (a:y * 6) + a:z + endif +endfun + +" Returns the palette index to approximate the given R/G/B colour levels +fun s:colour(r, g, b) + " Get the closest grey + let l:gx = s:grey_number(a:r) + let l:gy = s:grey_number(a:g) + let l:gz = s:grey_number(a:b) + + " Get the closest colour + let l:x = s:rgb_number(a:r) + let l:y = s:rgb_number(a:g) + let l:z = s:rgb_number(a:b) + + if l:gx == l:gy && l:gy == l:gz + " There are two possibilities + let l:dgr = s:grey_level(l:gx) - a:r + let l:dgg = s:grey_level(l:gy) - a:g + let l:dgb = s:grey_level(l:gz) - a:b + let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) + let l:dr = s:rgb_level(l:gx) - a:r + let l:dg = s:rgb_level(l:gy) - a:g + let l:db = s:rgb_level(l:gz) - a:b + let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db) + if l:dgrey < l:drgb + " Use the grey + return s:grey_colour(l:gx) + else + " Use the colour + return s:rgb_colour(l:x, l:y, l:z) + endif + else + " Only one possibility + return s:rgb_colour(l:x, l:y, l:z) + endif +endfun + +" Returns the palette index to approximate the '#rrggbb' hex string +fun s:rgb(rgb) + let l:r = ("0x" . strpart(a:rgb, 1, 2)) + 0 + let l:g = ("0x" . strpart(a:rgb, 3, 2)) + 0 + let l:b = ("0x" . strpart(a:rgb, 5, 2)) + 0 + + return s:colour(l:r, l:g, l:b) +endfun + +" Sets the highlighting for the given group +fun s:HL(group, fg, bg, attr) + if !empty(a:fg) + " echo "['" . a:fg . "', " . s:rgb(a:fg) . "]" + exec "hi " . a:group . " guifg=" . a:fg[0] . " ctermfg=" . a:fg[1] + endif + if !empty(a:bg) + " echo "['" . a:bg . "', " . s:rgb(a:bg) . "]" + exec "hi " . a:group . " guibg=" . a:bg[0] . " ctermbg=" . a:bg[1] + endif + if a:attr != "" + exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr + endif +endfun + +fun s:Load_Settings_Override(custom) + if has_key(a:custom, 'cursorline') + let s:cursorline = [a:custom['cursorline'], '' . s:rgb(a:custom['cursorline'])] + endif + if has_key(a:custom, 'background') + let s:background = [a:custom['background'], '' . s:rgb(a:custom['background'])] + endif + if has_key(a:custom, 'matchparen') + let s:matchparen = [a:custom['matchparen'], '' . s:rgb(a:custom['matchparen'])] + endif + if has_key(a:custom, 'comment') + let s:comment = [a:custom['comment'], '' . s:rgb(a:custom['comment'])] + endif +endfun +" }}} + +" Color Palette: {{{ +let s:is_dark=(&background == 'dark') + +if s:is_dark " DARK VARIANT + " These color names are corresponding to the original light version, + " and they don't represent the HEX code that they store in this block. + let s:red = ['#5faf5f', '71'] "Include/Exception + let s:green = ['#dfaf00', '178'] "Boolean/Special + let s:blue = ['#00afaf', '37'] "Keyword + + let s:pink = ['#afdf00', '148'] "Type + let s:olive = ['#dfaf5f', '179'] "String + let s:navy = ['#df875f', '173'] "StorageClass + + let s:orange = ['#ff5faf', '205'] "Number + let s:purple = ['#af87af', '139'] "Repeat/Conditional + let s:aqua = ['#5fafdf', '74'] "Operator/Delimiter + + let s:wine = ['#af8787', '138'] + + " Basics: + let s:foreground = ['#d0d0d0', '251'] + let s:background = ['#262626', '234'] + let s:selection = ['#3a3a3a', '236'] + let s:nontext = ['#444444', '237'] + let s:window = ['#3a3a3a', '236'] + let s:divider = ['#5f8787', '66'] + let s:linenumber = ['#606060', '240'] + let s:comment = ['#8a8a8a', '244'] + let s:todo = ['#ff8700', '208'] + let s:cursorline = ['#303030', '235'] + let s:cursorlinenr = ['#ffff00', '226'] + let s:cursorcolumn = ['#303030', '235'] + let s:error = ['#5f0000', '52'] + let s:matchparen = ['#4e4e4e', '239'] + + " Spelling: + let s:spellbad = ['#5f0000', '52'] + let s:spellcap = ['#5f005f', '53'] + let s:spellrare = ['#005f00', '22'] + let s:spelllocal = ['#00005f', '17'] + + " Tabline: + let s:tabline_bg = ['#3a3a3a', '235'] + let s:tabline_active_fg = ['#1c1c1c', '233'] + let s:tabline_active_bg = ['#00afaf', '37'] + let s:tabline_inactive_fg = ['#c6c6c6', '250'] + let s:tabline_inactive_bg = ['#585858', '240'] + + " BufTabLine: + let s:buftabline_bg = ['#3a3a3a', '235'] + let s:buftabline_current_fg = ['#1c1c1c', '233'] + let s:buftabline_current_bg = ['#00afaf', '37'] + let s:buftabline_active_fg = ['#1c1c1c', '233'] + let s:buftabline_active_bg = ['#00afaf', '37'] + let s:buftabline_inactive_fg = ['#c6c6c6', '250'] + let s:buftabline_inactive_bg = ['#585858', '240'] + + " Statusline: + let s:statusline_active_fg = ['#1c1c1c', '233'] + let s:statusline_active_bg = ['#5f8787', '66'] + let s:statusline_inactive_fg = ['#c6c6c6', '250'] + let s:statusline_inactive_bg = ['#444444', '237'] + + " Search: + let s:search_fg = ['#000000', '16'] + let s:search_bg = ['#00875f', '29'] + + " Visual: + let s:visual_fg = ['#000000', '16'] + let s:visual_bg = ['#8787af', '103'] + + " Folded: + let s:folded_fg = ['#afdf00', '148'] + let s:folded_bg = ['#444444', '237'] + + " WildMenu: + let s:wildmenu_fg = s:background + let s:wildmenu_bg = ['#afdf00', '148'] + + " Diff: + let s:diffadd_fg = ['#000000', '16'] + let s:diffadd_bg = ['#5faf00', '70'] + + let s:diffdelete_fg = ['#000000', '16'] + let s:diffdelete_bg = ['#5f0000', '52'] + + let s:difftext_fg = ['#000000', '16'] + let s:difftext_bg = ['#ffdf5f', '221'] + + let s:diffchange_fg = ['#000000', '16'] + let s:diffchange_bg = ['#dfaf00', '178'] + + " User Override Settings: + if exists("g:PaperColor_Dark_Override") + call s:Load_Settings_Override(g:PaperColor_Dark_Override) + endif + +else " LIGHT VARIANT + + let s:red = ['#df0000', '160'] "Include/Exception + let s:green = ['#008700', '28'] "Boolean/Special + let s:blue = ['#4271ae', '25'] "Keyword + + let s:pink = ['#d7005f', '161'] "Type + let s:olive = ['#718c00', '64'] "String + let s:navy = ['#005f87', '24'] "StorageClass + + let s:orange = ['#d75f00', '166'] "Number + let s:purple = ['#8959a8', '97'] "Repeat/Conditional + let s:aqua = ['#3e999f', '31'] "Operator/Delimiter + + let s:wine = ['#870087', '90'] + + " Basics: + let s:foreground = ['#444444', '238'] + let s:background = ['none', 'none'] + let s:selection = ['#d0d0d0', '252'] + let s:nontext = ['#dfafff', '189'] + let s:window = ['#e4e4e4', '254'] + let s:divider = s:navy + let s:linenumber = ['#bcbcbc', '249'] + let s:comment = ['#878787', '102'] + let s:todo = ['#00af5f', '35'] + let s:cursorline = ['#e4e4e4', '254'] + let s:cursorlinenr = ['#af0000', '124'] + let s:cursorcolumn = ['#e4e4e4', '254'] + let s:error = ['#ffafdf', 'red'] + let s:matchparen = ['#c6c6c6', '251'] + + " Spelling: + let s:spellbad = ['#ffafdf', '218'] + let s:spellcap = ['#ffffaf', '229'] + let s:spellrare = ['#afff87', '156'] + let s:spelllocal = ['#dfdfff', '189'] + + " 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 + + " BufTabLine: + let s:buftabline_bg = s:navy + let s:buftabline_current_fg = s:foreground + let s:buftabline_current_bg = s:window + let s:buftabline_active_fg = s:background + let s:buftabline_active_bg = s:blue + let s:buftabline_inactive_fg = s:background + let s:buftabline_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 = ['#d0d0d0', '252'] + + " Search: + let s:search_fg = s:foreground + let s:search_bg = ['#ffff5f', '227'] + + " Visual: + " let s:visual_fg = s:background + let s:visual_fg = ['#D9D9D9', 'white'] + let s:visual_bg = s:blue + + " Folded: + let s:folded_fg = s:navy + let s:folded_bg = ['#afdfff', '153'] + + " WildMenu: + let s:wildmenu_fg = s:foreground + let s:wildmenu_bg = ['#ffff00', '226'] + + " Diff: + let s:diffadd_fg = [] + let s:diffadd_bg = ['#afffaf', '157'] + + let s:diffdelete_fg = [] + let s:diffdelete_bg = ['#ffdfff', '225'] + + let s:difftext_fg = [] + let s:difftext_bg = ['#ffffdf', '230'] + + let s:diffchange_fg = [] + let s:diffchange_bg = ['#ffffaf', '229'] + + " User Override Settings: + if exists("g:PaperColor_Light_Override") + call s:Load_Settings_Override(g:PaperColor_Light_Override) + endif +endif +" }}} + +" Syntax Highlighting: {{{ +if has("gui_running") || &t_Co == 88 || &t_Co == 256 + + " Vim Highlighting + call s:HL("Normal", s:foreground, s:background, "") + + " Switching between dark & light variant through `set background` + " https://github.com/NLKNguyen/papercolor-theme/pull/20 + if s:is_dark " DARK VARIANT + set background=dark + else " LIGHT VARIANT + set background=light + endif + + highlight LineNr term=bold cterm=NONE ctermfg=darkgrey ctermbg=NONE gui=NONE guifg=darkgrey guibg=NONE + call s:HL("NonText", s:nontext, "", "") + call s:HL("SpecialKey", s:nontext, "", "") + call s:HL("Search", s:search_fg, s:search_bg, "") + call s:HL("LineNr", s:linenumber, "", "") + call s:HL("TabLine", s:tabline_inactive_fg, s:tabline_inactive_bg, "None") + call s:HL("TabLineFill", "", s:tabline_bg, "None") + call s:HL("TabLineSel", s:tabline_active_fg, s:tabline_active_bg, "None") + + call s:HL("BufTabLineCurrent", s:buftabline_current_fg, s:buftabline_current_bg, "None") + call s:HL("BufTabLineActive", s:buftabline_active_fg, s:buftabline_active_bg, "None") + call s:HL("BufTabLineHidden", s:buftabline_inactive_fg, s:buftabline_inactive_bg, "None") + call s:HL("BufTabLineFill", "", s:buftabline_bg, "None") + + call s:HL("StatusLine", s:statusline_active_fg, s:statusline_active_bg, "bold") + call s:HL("StatusLineNC", s:statusline_inactive_fg, s:statusline_inactive_bg, "None") + call s:HL("VertSplit", s:divider, s:background, "none") + " call s:HL("VertSplit", s:red, s:background, "none") + call s:HL("Visual", s:visual_fg, s:visual_bg, "") + call s:HL("Directory", s:blue, "", "") + call s:HL("ModeMsg", s:olive, "", "") + call s:HL("MoreMsg", s:olive, "", "") + call s:HL("Question", s:olive, "", "") + call s:HL("WarningMsg", s:pink, "", "") + call s:HL("MatchParen", "", s:matchparen, "") + call s:HL("Folded", s:folded_fg, s:folded_bg, "") + call s:HL("FoldColumn", "", s:background, "") + call s:HL("WildMenu", s:wildmenu_fg, s:wildmenu_bg, "bold") + if version >= 700 + call s:HL("CursorLine", "", s:cursorline, "none") + call s:HL("CursorLineNr", s:cursorlinenr, "", "none") + call s:HL("CursorColumn", "", s:cursorcolumn, "none") + call s:HL("PMenu", s:foreground, s:selection, "none") + call s:HL("PMenuSel", s:foreground, s:selection, "reverse") + call s:HL("SignColumn", s:green, s:background, "none") + end + if version >= 703 + call s:HL("ColorColumn", "", s:cursorcolumn, "none") + end + + " Standard Group Highlighting: + call s:HL("Comment", s:comment, "", "") + + call s:HL("Constant", s:orange, "", "") + call s:HL("String", s:olive, "", "") + call s:HL("Character", s:olive, "", "") + call s:HL("Number", s:orange, "", "") + call s:HL("Boolean", s:green, "", "bold") + call s:HL("Float", s:orange, "", "") + + call s:HL("Identifier", s:navy, "", "") + " call s:HL("Function", s:foreground, "", "") + call s:HL("Function", s:navy, "", "bold") + + call s:HL("Statement", s:pink, "", "none") + call s:HL("Conditional", s:purple, "", "bold") + call s:HL("Repeat", s:purple, "", "bold") + call s:HL("Label", s:blue, "", "") + call s:HL("Operator", s:aqua, "", "none") + call s:HL("Keyword", s:blue, "", "") + call s:HL("Exception", s:red, "", "") + + call s:HL("PreProc", s:blue, "", "") + call s:HL("Include", s:red, "", "") + call s:HL("Define", s:blue, "", "") + call s:HL("Macro", s:blue, "", "") + call s:HL("PreCondit", s:aqua, "", "") + + call s:HL("Type", s:pink, "", "bold") + call s:HL("StorageClass", s:navy, "", "bold") + call s:HL("Structure", s:blue, "", "bold") + call s:HL("Typedef", s:pink, "", "bold") + + call s:HL("Special", s:foreground, "", "") + call s:HL("SpecialChar", s:foreground, "", "") + call s:HL("Tag", s:green, "", "") + call s:HL("Delimiter",s:aqua, "", "") + call s:HL("SpecialComment", s:comment, "", "bold") + call s:HL("Debug", s:orange, "", "") + + "call s:HL("Ignore", "666666", "", "") + + call s:HL("Error", s:foreground, s:error, "") + call s:HL("Todo", s:todo, s:background, "bold") + + call s:HL("Title", s:comment, "", "") + call s:HL("Global", s:blue, "", "") + + + " Extension {{{ + " VimL Highlighting + call s:HL("vimCommand", s:pink, "", "none") + call s:HL("vimVar", s:navy, "", "") + call s:HL("vimFuncKey", s:pink, "", "") + call s:HL("vimFunction", s:blue, "", "bold") + call s:HL("vimNotFunc", s:pink, "", "") + call s:HL("vimMap", s:red, "", "") + call s:HL("vimAutoEvent", s:aqua, "", "bold") + call s:HL("vimMapModKey", s:aqua, "", "") + call s:HL("vimFuncName", s:purple, "", "") + call s:HL("vimIsCommand", s:foreground, "", "") + call s:HL("vimFuncVar", s:aqua, "", "") + call s:HL("vimLet", s:red, "", "") + call s:HL("vimMapRhsExtend", s:foreground, "", "") + call s:HL("vimCommentTitle", s:comment, "", "bold") + call s:HL("vimBracket", s:aqua, "", "") + call s:HL("vimParenSep", s:aqua, "", "") + call s:HL("vimSynType", s:olive, "", "bold") + call s:HL("vimNotation", s:aqua, "", "") + call s:HL("vimOper", s:foreground, "", "") + call s:HL("vimOperParen", s:foreground, "", "") + call s:HL("vimSynType", s:purple, "", "none") + call s:HL("vimSynReg", s:pink, "", "none") + call s:HL("vimSynKeyRegion", s:green, "", "") + call s:HL("vimSynRegOpt", s:blue, "", "") + call s:HL("vimSynMtchOpt", s:blue, "", "") + call s:HL("vimSynContains", s:pink, "", "") + call s:HL("vimGroupName", s:foreground, "", "") + call s:HL("vimGroupList", s:foreground, "", "") + call s:HL("vimHiGroup", s:foreground, "", "") + call s:HL("vimGroup", s:navy, "", "bold") + + " Makefile Highlighting + call s:HL("makeIdent", s:blue, "", "") + call s:HL("makeSpecTarget", s:olive, "", "") + call s:HL("makeTarget", s:red, "", "") + call s:HL("makeStatement", s:aqua, "", "bold") + call s:HL("makeCommands", s:foreground, "", "") + call s:HL("makeSpecial", s:orange, "", "bold") + + " CMake Highlighting + call s:HL("cmakeStatement", s:pink, "", "") + call s:HL("cmakeArguments", s:foreground, "", "") + call s:HL("cmakeVariableValue", s:blue, "", "") + call s:HL("cmakeOperators", s:red, "", "") + + " C Highlighting + call s:HL("cType", s:pink, "", "bold") + call s:HL("cFormat", s:olive, "", "") + call s:HL("cStorageClass", s:navy, "", "bold") + + call s:HL("cBoolean", s:green, "", "") + call s:HL("cCharacter", s:olive, "", "") + call s:HL("cConstant", s:green, "", "bold") + call s:HL("cConditional", s:purple, "", "bold") + call s:HL("cSpecial", s:olive, "", "bold") + call s:HL("cDefine", s:blue, "", "") + call s:HL("cNumber", s:orange, "", "") + call s:HL("cPreCondit", s:aqua, "", "") + call s:HL("cRepeat", s:purple, "", "bold") + call s:HL("cLabel",s:aqua, "", "") + " call s:HL("cAnsiFunction",s:aqua, "", "bold") + " call s:HL("cAnsiName",s:pink, "", "") + call s:HL("cDelimiter",s:blue, "", "") + " call s:HL("cBraces",s:foreground, "", "") + " call s:HL("cIdentifier",s:blue, s:pink, "") + " call s:HL("cSemiColon","", s:blue, "") + call s:HL("cOperator",s:aqua, "", "") + " call s:HL("cStatement",s:pink, "", "") + call s:HL("cFunction", s:foreground, "", "") + " call s:HL("cTodo", s:comment, "", "bold") + " call s:HL("cStructure", s:blue, "", "bold") + call s:HL("cCustomParen", s:foreground, "", "") + " call s:HL("cCustomFunc", s:foreground, "", "") + " call s:HL("cUserFunction",s:blue, "", "bold") + call s:HL("cOctalZero", s:purple, "", "bold") + + " CPP highlighting + call s:HL("cppBoolean", s:navy, "", "") + call s:HL("cppSTLnamespace", s:purple, "", "") + call s:HL("cppSTLconstant", s:foreground, "", "") + call s:HL("cppSTLtype", s:foreground, "", "") + call s:HL("cppSTLexception", s:pink, "", "") + call s:HL("cppSTLfunctional", s:foreground, "", "bold") + call s:HL("cppSTLiterator", s:foreground, "", "bold") + " call s:HL("cppSTLfunction", s:aqua, "", "bold") + call s:HL("cppExceptions", s:red, "", "") + call s:HL("cppStatement", s:blue, "", "") + call s:HL("cppStorageClass", s:navy, "", "bold") + call s:HL("cppAccess",s:blue, "", "") + " call s:HL("cppSTL",s:blue, "", "") + + + " Lex highlighting + call s:HL("lexCFunctions", s:foreground, "", "") + call s:HL("lexAbbrv", s:purple, "", "") + call s:HL("lexAbbrvRegExp", s:aqua, "", "") + call s:HL("lexAbbrvComment", s:comment, "", "") + call s:HL("lexBrace", s:navy, "", "") + call s:HL("lexPat", s:aqua, "", "") + call s:HL("lexPatComment", s:comment, "", "") + call s:HL("lexPatTag", s:orange, "", "") + " call s:HL("lexPatBlock", s:foreground, "", "bold") + call s:HL("lexSlashQuote", s:foreground, "", "") + call s:HL("lexSep", s:foreground, "", "") + call s:HL("lexStartState", s:orange, "", "") + call s:HL("lexPatTagZone", s:olive, "", "bold") + call s:HL("lexMorePat", s:olive, "", "bold") + call s:HL("lexOptions", s:olive, "", "bold") + call s:HL("lexPatString", s:olive, "", "") + + " Yacc highlighting + call s:HL("yaccNonterminal", s:navy, "", "") + call s:HL("yaccDelim", s:orange, "", "") + call s:HL("yaccInitKey", s:aqua, "", "") + call s:HL("yaccInit", s:navy, "", "") + call s:HL("yaccKey", s:purple, "", "") + call s:HL("yaccVar", s:aqua, "", "") + + " NASM highlighting + call s:HL("nasmStdInstruction", s:navy, "", "") + call s:HL("nasmGen08Register", s:aqua, "", "") + call s:HL("nasmGen16Register", s:aqua, "", "") + call s:HL("nasmGen32Register", s:aqua, "", "") + call s:HL("nasmGen64Register", s:aqua, "", "") + call s:HL("nasmHexNumber", s:purple, "", "") + call s:HL("nasmStorage", s:aqua, "", "bold") + call s:HL("nasmLabel", s:pink, "", "") + call s:HL("nasmDirective", s:blue, "", "bold") + call s:HL("nasmLocalLabel", s:orange, "", "") + + " GAS highlighting + call s:HL("gasSymbol", s:pink, "", "") + call s:HL("gasDirective", s:blue, "", "bold") + call s:HL("gasOpcode_386_Base", s:navy, "", "") + call s:HL("gasDecimalNumber", s:purple, "", "") + call s:HL("gasSymbolRef", s:pink, "", "") + call s:HL("gasRegisterX86", s:blue, "", "") + call s:HL("gasOpcode_P6_Base", s:navy, "", "") + call s:HL("gasDirectiveStore", s:foreground, "", "bold") + + " MIPS highlighting + call s:HL("mipsInstruction", s:pink, "", "") + call s:HL("mipsRegister", s:navy, "", "") + call s:HL("mipsLabel", s:aqua, "", "bold") + call s:HL("mipsDirective", s:purple, "", "bold") + + " Shell/Bash highlighting + call s:HL("bashStatement", s:foreground, "", "bold") + call s:HL("shDerefVar", s:aqua, "", "bold") + call s:HL("shDerefSimple", s:aqua, "", "") + call s:HL("shFunction", s:orange, "", "bold") + call s:HL("shStatement", s:foreground, "", "") + call s:HL("shLoop", s:purple, "", "bold") + call s:HL("shQuote", s:olive, "", "") + call s:HL("shCaseEsac", s:aqua, "", "bold") + call s:HL("shSnglCase", s:purple, "", "none") + call s:HL("shFunctionOne", s:navy, "", "") + call s:HL("shCase", s:navy, "", "") + call s:HL("shSetList", s:navy, "", "") + " @see Dockerfile Highlighting section for more sh* + + " HTML Highlighting + call s:HL("htmlTitle", s:green, "", "bold") + call s:HL("htmlH1", s:green, "", "bold") + call s:HL("htmlH2", s:aqua, "", "bold") + call s:HL("htmlH3", s:purple, "", "bold") + call s:HL("htmlH4", s:orange, "", "bold") + call s:HL("htmlTag", s:comment, "", "") + call s:HL("htmlTagName", s:wine, "", "") + call s:HL("htmlArg", s:pink, "", "") + call s:HL("htmlEndTag", s:comment, "", "") + call s:HL("htmlString", s:blue, "", "") + call s:HL("htmlScriptTag", s:comment, "", "") + call s:HL("htmlBold", s:foreground, "", "bold") + call s:HL("htmlItalic", s:comment, "", "bold") + call s:HL("htmlBoldItalic", s:navy, "", "bold") + " call s:HL("htmlLink", s:blue, "", "bold") + call s:HL("htmlTagN", s:wine, "", "bold") + call s:HL("htmlSpecialTagName", s:wine, "", "") + call s:HL("htmlComment", s:comment, "", "") + call s:HL("htmlCommentPart", s:comment, "", "") + + " CSS Highlighting + call s:HL("cssIdentifier", s:pink, "", "") + call s:HL("cssPositioningProp", s:foreground, "", "") + call s:HL("cssNoise", s:foreground, "", "") + call s:HL("cssBoxProp", s:foreground, "", "") + call s:HL("cssTableAttr", s:purple, "", "") + call s:HL("cssPositioningAttr", s:navy, "", "") + call s:HL("cssValueLength", s:orange, "", "") + +call s:HL("cssFunctionName", s:blue, "", "") +call s:HL("cssUnitDecorators", s:aqua, "", "") +call s:HL("cssColor", s:blue, "", "bold") +call s:HL("cssBraces", s:pink, "", "") +call s:HL("cssBackgroundProp", s:foreground, "", "") +call s:HL("cssTextProp", s:foreground, "", "") +call s:HL("cssDimensionProp", s:foreground, "", "") +call s:HL("cssClassName", s:pink, "", "") + + " Markdown Highlighting + call s:HL("markdownHeadingRule", s:pink, "", "bold") + call s:HL("markdownH1", s:pink, "", "bold") + call s:HL("markdownH2", s:orange, "", "bold") + call s:HL("markdownBlockquote", s:pink, "", "") + call s:HL("markdownCodeBlock", s:olive, "", "") + call s:HL("markdownCode", s:olive, "", "") + call s:HL("markdownLink", s:blue, "", "bold") + call s:HL("markdownUrl", s:blue, "", "") + call s:HL("markdownLinkText", s:pink, "", "") + call s:HL("markdownLinkTextDelimiter", s:purple, "", "") + call s:HL("markdownLinkDelimiter", s:purple, "", "") + call s:HL("markdownCodeDelimiter", s:blue, "", "") + + call s:HL("mkdCode", s:olive, "", "none") + call s:HL("mkdLink", s:blue, "", "bold") + call s:HL("mkdURL", s:comment, "", "none") + call s:HL("mkdString", s:foreground, "", "none") + call s:HL("mkdBlockQuote", s:foreground, s:window, "none") + call s:HL("mkdLinkTitle", s:pink, "", "none") + call s:HL("mkdDelimiter", s:aqua, "", "") + call s:HL("mkdRule", s:pink, "", "") + + " reStructuredText Highlighting + call s:HL("rstSections", s:pink, "", "bold") + call s:HL("rstDelimiter", s:pink, "", "bold") + call s:HL("rstExplicitMarkup", s:pink, "", "bold") + call s:HL("rstDirective", s:blue, "", "") + call s:HL("rstHyperlinkTarget", s:green, "", "") + call s:HL("rstExDirective", s:foreground, "", "") + call s:HL("rstInlineLiteral", s:olive, "", "") + call s:HL("rstInterpretedTextOrHyperlinkReference", s:blue, "", "") + + " Python Highlighting + call s:HL("pythonImport", s:pink, "", "bold") + call s:HL("pythonExceptions", s:red, "", "") + call s:HL("pythonException", s:purple, "", "bold") + call s:HL("pythonInclude", s:red, "", "") + call s:HL("pythonStatement", s:pink, "", "") + call s:HL("pythonConditional", s:purple, "", "bold") + call s:HL("pythonRepeat", s:purple, "", "bold") + call s:HL("pythonFunction", s:aqua, "", "bold") + call s:HL("pythonPreCondit", s:purple, "", "") + call s:HL("pythonExClass", s:orange, "", "") + call s:HL("pythonOperator", s:purple, "", "bold") + call s:HL("pythonBuiltin", s:foreground, "", "") + call s:HL("pythonDecorator", s:orange, "", "") + + call s:HL("pythonString", s:olive, "", "") + call s:HL("pythonEscape", s:olive, "", "bold") + call s:HL("pythonStrFormatting", s:olive, "", "bold") + + call s:HL("pythonBoolean", s:green, "", "bold") + call s:HL("pythonExClass", s:red, "", "") + call s:HL("pythonBytesEscape", s:olive, "", "bold") + call s:HL("pythonDottedName", s:purple, "", "") + call s:HL("pythonStrFormat", s:foreground, "", "") + call s:HL("pythonBuiltinFunc", s:foreground, "", "") + call s:HL("pythonBuiltinObj", s:foreground, "", "") + + " Java Highlighting + call s:HL("javaExternal", s:pink, "", "") + call s:HL("javaAnnotation", s:orange, "", "") + call s:HL("javaTypedef", s:aqua, "", "") + call s:HL("javaClassDecl", s:aqua, "", "bold") + call s:HL("javaScopeDecl", s:blue, "", "bold") + call s:HL("javaStorageClass", s:navy, "", "bold") + call s:HL("javaBoolean", s:green, "", "bold") + call s:HL("javaConstant", s:blue, "", "") + call s:HL("javaCommentTitle", s:wine, "", "") + call s:HL("javaDocTags", s:aqua, "", "") + call s:HL("javaDocComment", s:comment, "", "") + call s:HL("javaDocParam", s:foreground, "", "") + + " JavaScript Highlighting + call s:HL("javaScriptBraces", s:blue, "", "") + call s:HL("javaScriptParens", s:blue, "", "") + call s:HL("javaScriptIdentifier", s:pink, "", "") + call s:HL("javaScriptFunction", s:blue, "", "bold") + call s:HL("javaScriptConditional", s:purple, "", "bold") + call s:HL("javaScriptRepeat", s:purple, "", "bold") + call s:HL("javaScriptBoolean", s:green, "", "bold") + call s:HL("javaScriptNumber", s:orange, "", "") + call s:HL("javaScriptMember", s:navy, "", "") + call s:HL("javaScriptReserved", s:navy, "", "") + call s:HL("javascriptNull", s:comment, "", "bold") + call s:HL("javascriptGlobal", s:foreground, "", "") + call s:HL("javascriptStatement", s:pink, "", "") + call s:HL("javaScriptMessage", s:foreground, "", "") + call s:HL("javaScriptMember", s:foreground, "", "") + + " @target https://github.com/pangloss/vim-javascript + call s:HL("jsFuncParens", s:blue, "", "") + call s:HL("jsFuncBraces", s:blue, "", "") + call s:HL("jsParens", s:blue, "", "") + call s:HL("jsBraces", s:blue, "", "") + call s:HL("jsNoise", s:blue, "", "") + + " Json Highlighting + " @target https://github.com/elzr/vim-json + call s:HL("jsonKeyword", s:blue, "", "") + call s:HL("jsonString", s:olive, "", "") + call s:HL("jsonQuote", s:comment, "", "") + call s:HL("jsonNoise", s:foreground, "", "") + call s:HL("jsonKeywordMatch", s:foreground, "", "") + call s:HL("jsonBraces", s:foreground, "", "") + call s:HL("jsonNumber", s:orange, "", "") + call s:HL("jsonNull", s:purple, "", "bold") + call s:HL("jsonBoolean", s:green, "", "bold") + call s:HL("jsonCommentError", s:pink, s:background , "") + + " Go Highlighting + call s:HL("goDirective", s:red, "", "") + call s:HL("goDeclaration", s:blue, "", "bold") + call s:HL("goStatement", s:pink, "", "") + call s:HL("goConditional", s:purple, "", "bold") + call s:HL("goConstants", s:orange, "", "") + call s:HL("goFunction", s:orange, "", "") + " call s:HL("goTodo", s:comment, "", "bold") + call s:HL("goDeclType", s:blue, "", "") + call s:HL("goBuiltins", s:purple, "", "") + + " Systemtap Highlighting + " call s:HL("stapBlock", s:comment, "", "none") + call s:HL("stapComment", s:comment, "", "none") + call s:HL("stapProbe", s:aqua, "", "bold") + call s:HL("stapStat", s:navy, "", "bold") + call s:HL("stapFunc", s:foreground, "", "") + call s:HL("stapString", s:olive, "", "") + call s:HL("stapTarget", s:navy, "", "") + call s:HL("stapStatement", s:pink, "", "") + call s:HL("stapType", s:pink, "", "bold") + call s:HL("stapSharpBang", s:comment, "", "") + call s:HL("stapDeclaration", s:pink, "", "") + call s:HL("stapCMacro", s:blue, "", "") + + " DTrace Highlighting + call s:HL("dtraceProbe", s:blue, "", "") + call s:HL("dtracePredicate", s:purple, "", "bold") + call s:HL("dtraceComment", s:comment, "", "") + call s:HL("dtraceFunction", s:foreground, "", "") + call s:HL("dtraceAggregatingFunction", s:blue, "", "bold") + call s:HL("dtraceStatement", s:navy, "", "bold") + call s:HL("dtraceIdentifier", s:pink, "", "") + call s:HL("dtraceOption", s:pink, "", "") + call s:HL("dtraceConstant", s:orange, "", "") + call s:HL("dtraceType", s:pink, "", "bold") + + " PlantUML Highlighting + call s:HL("plantumlPreProc", s:orange, "", "bold") + call s:HL("plantumlDirectedOrVerticalArrowRL", s:pink, "", "") + call s:HL("plantumlDirectedOrVerticalArrowLR", s:pink, "", "") + call s:HL("plantumlString", s:olive, "", "") + call s:HL("plantumlActivityThing", s:purple, "", "") + call s:HL("plantumlText", s:navy, "", "") + call s:HL("plantumlClassPublic", s:olive, "", "bold") + call s:HL("plantumlClassPrivate", s:red, "", "") + call s:HL("plantumlColonLine", s:orange, "", "") + call s:HL("plantumlClass", s:navy, "", "") + call s:HL("plantumlHorizontalArrow", s:pink, "", "") + call s:HL("plantumlTypeKeyword", s:blue, "", "bold") + call s:HL("plantumlKeyword", s:pink, "", "bold") + + call s:HL("plantumlType", s:blue, "", "bold") + call s:HL("plantumlBlock", s:pink, "", "bold") + call s:HL("plantumlPreposition", s:orange, "", "") + call s:HL("plantumlLayout", s:blue, "", "bold") + call s:HL("plantumlNote", s:orange, "", "") + call s:HL("plantumlLifecycle", s:aqua, "", "") + call s:HL("plantumlParticipant", s:foreground, "", "bold") + + + " Haskell Highlighting + " call s:HL("haskellType", s:aqua, "", "bold") + call s:HL("haskellType", s:pink, "", "") + call s:HL("haskellIdentifier", s:orange, "", "bold") + call s:HL("haskellOperators", s:pink, "", "") + call s:HL("haskellWhere", s:foreground, "", "bold") + call s:HL("haskellDelimiter", s:aqua, "", "") + call s:HL("haskellImportKeywords", s:pink, "", "") + call s:HL("haskellStatement", s:purple, "", "bold") + + + " SQL/MySQL Highlighting + call s:HL("sqlStatement", s:pink, "", "bold") + call s:HL("sqlType", s:blue, "", "bold") + call s:HL("sqlKeyword", s:pink, "", "") + call s:HL("sqlOperator", s:aqua, "", "") + call s:HL("sqlSpecial", s:green, "", "bold") + + call s:HL("mysqlVariable", s:olive, "", "bold") + call s:HL("mysqlType", s:blue, "", "bold") + call s:HL("mysqlKeyword", s:pink, "", "") + call s:HL("mysqlOperator", s:aqua, "", "") + call s:HL("mysqlSpecial", s:green, "", "bold") + + + " Octave/MATLAB Highlighting + call s:HL("octaveVariable", s:foreground, "", "") + call s:HL("octaveDelimiter", s:pink, "", "") + call s:HL("octaveQueryVar", s:foreground, "", "") + call s:HL("octaveSemicolon", s:purple, "", "") + call s:HL("octaveFunction", s:navy, "", "") + call s:HL("octaveSetVar", s:blue, "", "") + call s:HL("octaveUserVar", s:foreground, "", "") + call s:HL("octaveArithmeticOperator", s:aqua, "", "") + call s:HL("octaveBeginKeyword", s:purple, "", "bold") + call s:HL("octaveElseKeyword", s:purple, "", "bold") + call s:HL("octaveEndKeyword", s:purple, "", "bold") + call s:HL("octaveStatement", s:pink, "", "") + + " Ruby Highlighting + call s:HL("rubyModule", s:navy, "", "bold") + call s:HL("rubyClass", s:pink, "", "bold") + call s:HL("rubyPseudoVariable", s:comment, "", "bold") + call s:HL("rubyKeyword", s:pink, "", "") + call s:HL("rubyInstanceVariable", s:purple, "", "") + call s:HL("rubyFunction", s:foreground, "", "bold") + call s:HL("rubyDefine", s:pink, "", "") + call s:HL("rubySymbol", s:aqua, "", "") + call s:HL("rubyConstant", s:blue, "", "") + call s:HL("rubyAccess", s:navy, "", "") + call s:HL("rubyAttribute", s:green, "", "") + call s:HL("rubyInclude", s:red, "", "") + call s:HL("rubyLocalVariableOrMethod", s:orange, "", "") + call s:HL("rubyCurlyBlock", s:foreground, "", "") + call s:HL("rubyCurlyBlockDelimiter", s:aqua, "", "") + call s:HL("rubyArrayDelimiter", s:aqua, "", "") + call s:HL("rubyStringDelimiter", s:olive, "", "") + call s:HL("rubyInterpolationDelimiter", s:orange, "", "") + call s:HL("rubyConditional", s:purple, "", "bold") + call s:HL("rubyRepeat", s:purple, "", "bold") + call s:HL("rubyControl", s:purple, "", "bold") + call s:HL("rubyException", s:purple, "", "bold") + call s:HL("rubyExceptional", s:purple, "", "bold") + call s:HL("rubyBoolean", s:green, "", "bold") + + " Fortran Highlighting + call s:HL("fortranUnitHeader", s:foreground, "", "bold") + call s:HL("fortranType", s:pink, "", "bold") + call s:HL("fortranStructure", s:blue, "", "bold") + call s:HL("fortranStorageClass", s:navy, "", "bold") + call s:HL("fortranStorageClassR", s:navy, "", "bold") + call s:HL("fortranKeyword", s:pink, "", "") + call s:HL("fortranReadWrite", s:blue, "", "") + call s:HL("fortranIO", s:navy, "", "") + + " R Highlighting + call s:HL("rType", s:blue, "", "") + call s:HL("rArrow", s:pink, "", "") + call s:HL("rDollar", s:blue, "", "") + + " XXD Highlighting + call s:HL("xxdAddress", s:navy, "", "") + call s:HL("xxdSep", s:pink, "", "") + call s:HL("xxdAscii", s:pink, "", "") + call s:HL("xxdDot", s:aqua, "", "") + + " PHP Highlighting + call s:HL("phpIdentifier", s:foreground, "", "") + call s:HL("phpVarSelector", s:pink, "", "") + call s:HL("phpKeyword", s:blue, "", "") + call s:HL("phpRepeat", s:purple, "", "bold") + call s:HL("phpConditional", s:purple, "", "bold") + call s:HL("phpStatement", s:pink, "", "") + call s:HL("phpAssignByRef", s:aqua, "", "bold") + call s:HL("phpSpecialFunction", s:blue, "", "") + call s:HL("phpFunctions", s:blue, "", "") + call s:HL("phpComparison", s:aqua, "", "") + call s:HL("phpBackslashSequences", s:olive, "", "bold") + call s:HL("phpMemberSelector", s:blue, "", "") + call s:HL("phpStorageClass", s:purple, "", "bold") + call s:HL("phpDefine", s:navy, "", "") + + " Perl Highlighting + call s:HL("perlFiledescRead", s:green, "", "") + call s:HL("perlMatchStartEnd", s:pink, "", "") + call s:HL("perlStatementFlow", s:pink, "", "") + call s:HL("perlStatementStorage", s:pink, "", "") + call s:HL("perlFunction", s:pink, "", "bold") + call s:HL("perlMethod", s:foreground, "", "") + call s:HL("perlStatementFiledesc", s:orange, "", "") + call s:HL("perlVarPlain", s:navy, "", "") + call s:HL("perlSharpBang", s:comment, "", "") + call s:HL("perlStatementInclude", s:aqua, "", "bold") + call s:HL("perlStatementScalar", s:purple, "", "") + call s:HL("perlSubName", s:aqua, "", "bold") + call s:HL("perlSpecialString", s:olive, "", "bold") + + " Pascal Highlighting + call s:HL("pascalType", s:pink, "", "bold") + call s:HL("pascalStatement", s:blue, "", "bold") + call s:HL("pascalPredefined", s:pink, "", "") + call s:HL("pascalFunction", s:foreground, "", "") + call s:HL("pascalStruct", s:navy, "", "bold") + call s:HL("pascalOperator", s:aqua, "", "bold") + call s:HL("pascalPreProc", s:green, "", "") + call s:HL("pascalAcces", s:navy, "", "bold") + + " Lua Highlighting + call s:HL("luaFunc", s:foreground, "", "") + call s:HL("luaIn", s:blue, "", "bold") + call s:HL("luaFunction", s:pink, "", "") + call s:HL("luaStatement", s:blue, "", "") + call s:HL("luaRepeat", s:blue, "", "bold") + call s:HL("luaCondStart", s:purple, "", "bold") + call s:HL("luaTable", s:aqua, "", "bold") + call s:HL("luaConstant", s:green, "", "bold") + call s:HL("luaElse", s:purple, "", "bold") + call s:HL("luaCondElseif", s:purple, "", "bold") + call s:HL("luaCond", s:purple, "", "bold") + call s:HL("luaCondEnd", s:purple, "", "") + + " Clojure highlighting: + call s:HL("clojureConstant", s:blue, "", "") + call s:HL("clojureBoolean", s:orange, "", "") + call s:HL("clojureCharacter", s:olive, "", "") + call s:HL("clojureKeyword", s:pink, "", "") + call s:HL("clojureNumber", s:orange, "", "") + call s:HL("clojureString", s:olive, "", "") + call s:HL("clojureRegexp", s:purple, "", "") + call s:HL("clojureRegexpEscape", s:pink, "", "") + call s:HL("clojureParen", s:aqua, "", "") + call s:HL("clojureVariable", s:olive, "", "") + call s:HL("clojureCond", s:blue, "", "") + call s:HL("clojureDefine", s:blue, "", "bold") + call s:HL("clojureException", s:red, "", "") + call s:HL("clojureFunc", s:navy, "", "") + call s:HL("clojureMacro", s:blue, "", "") + call s:HL("clojureRepeat", s:blue, "", "") + call s:HL("clojureSpecial", s:blue, "", "bold") + call s:HL("clojureQuote", s:blue, "", "") + call s:HL("clojureUnquote", s:blue, "", "") + call s:HL("clojureMeta", s:blue, "", "") + call s:HL("clojureDeref", s:blue, "", "") + call s:HL("clojureAnonArg", s:blue, "", "") + call s:HL("clojureRepeat", s:blue, "", "") + call s:HL("clojureDispatch", s:aqua, "", "") + + " Dockerfile Highlighting + " @target https://github.com/docker/docker/tree/master/contrib/syntax/vim + call s:HL("dockerfileKeyword", s:blue, "", "") + call s:HL("shDerefVar", s:purple, "", "bold") + call s:HL("shOperator", s:aqua, "", "") + call s:HL("shOption", s:navy, "", "") + call s:HL("shLine", s:foreground, "", "") + call s:HL("shWrapLineOperator", s:pink, "", "") + + " NGINX Highlighting + " @target https://github.com/evanmiller/nginx-vim-syntax + call s:HL("ngxDirectiveBlock", s:pink, "", "bold") + call s:HL("ngxDirective", s:blue, "", "none") + call s:HL("ngxDirectiveImportant", s:blue, "", "bold") + call s:HL("ngxString", s:olive, "", "") + call s:HL("ngxVariableString", s:purple, "", "") + call s:HL("ngxVariable", s:purple, "", "none") + + " Yaml Highlighting + call s:HL("yamlBlockMappingKey", s:blue, "", "") + call s:HL("yamlKeyValueDelimiter", s:pink, "", "") + call s:HL("yamlBlockCollectionItemStart", s:pink, "", "") + + " Qt QML Highlighting + call s:HL("qmlObjectLiteralType", s:pink, "", "") + call s:HL("qmlReserved", s:purple, "", "") + call s:HL("qmlBindingProperty", s:navy, "", "") + call s:HL("qmlType", s:navy, "", "") + + " Dosini Highlighting + call s:HL("dosiniHeader", s:pink, "", "") + call s:HL("dosiniLabel", s:blue, "", "") + + " Mail highlighting + call s:HL("mailHeaderKey", s:blue, "", "") + call s:HL("mailHeaderEmail", s:purple, "", "") + call s:HL("mailSubject", s:pink, "", "") + call s:HL("mailHeader", s:comment, "", "") + call s:HL("mailURL", s:aqua, "", "") + call s:HL("mailEmail", s:purple, "", "") + call s:HL("mailQuoted1", s:olive, "", "") + call s:HL("mailQuoted2", s:navy, "", "") + + " XML Highlighting + call s:HL("xmlProcessingDelim", s:pink, "", "") + call s:HL("xmlString", s:olive, "", "") + call s:HL("xmlEqual", s:orange, "", "") + call s:HL("xmlAttrib", s:navy, "", "") + call s:HL("xmlAttribPunct", s:pink, "", "") + call s:HL("xmlTag", s:blue, "", "") + call s:HL("xmlTagName", s:blue, "", "") + call s:HL("xmlEndTag", s:blue, "", "") + call s:HL("xmlNamespace", s:orange, "", "") + + " Exlixir Highlighting + " @target https://github.com/elixir-lang/vim-elixir + call s:HL("elixirAlias", s:blue, "", "bold") + call s:HL("elixirAtom", s:navy, "", "") + call s:HL("elixirVariable", s:navy, "", "") + call s:HL("elixirUnusedVariable", s:comment, "", "") + call s:HL("elixirInclude", s:purple, "", "") + call s:HL("elixirStringDelimiter", s:olive, "", "") + call s:HL("elixirKeyword", s:purple, "", "bold") + call s:HL("elixirFunctionDeclaration", s:foreground, "", "bold") + call s:HL("elixirBlockDefinition", s:pink, "", "") + call s:HL("elixirDefine", s:pink, "", "") + call s:HL("elixirStructDefine", s:pink, "", "") + call s:HL("elixirPrivateDefine", s:pink, "", "") + call s:HL("elixirModuleDefine", s:pink, "", "") + call s:HL("elixirProtocolDefine", s:pink, "", "") + call s:HL("elixirImplDefine", s:pink, "", "") + + " Erlang Highlighting + call s:HL("erlangBIF", s:purple, "", "bold,") + call s:HL("erlangBracket", s:pink, "", "") + call s:HL("erlangLocalFuncCall", s:foreground, "", "") + call s:HL("erlangVariable", s:foreground, "", "") + call s:HL("erlangAtom", s:navy, "", "") + call s:HL("erlangAttribute", s:blue, "", "bold") + call s:HL("erlangRecordDef", s:blue, "", "bold") + call s:HL("erlangRecord", s:blue, "", "") + call s:HL("erlangRightArrow", s:blue, "", "bold") + call s:HL("erlangStringModifier", s:olive, "", "bold") + call s:HL("erlangInclude", s:blue, "", "bold") + call s:HL("erlangKeyword", s:pink, "", "") + call s:HL("erlangGlobalFuncCall", s:foreground, "", "") + + " Cucumber Highlighting + call s:HL("cucumberFeature", s:blue, "", "bold") + call s:HL("cucumberBackground", s:pink, "", "bold") + call s:HL("cucumberScenario", s:pink, "", "bold") + call s:HL("cucumberGiven", s:orange, "", "") + call s:HL("cucumberGivenAnd", s:blue, "", "") + call s:HL("cucumberThen", s:orange, "", "") + call s:HL("cucumberThenAnd", s:blue, "", "") + call s:HL("cucumberWhen", s:purple, "", "bold") + call s:HL("cucumberScenarioOutline", s:pink, "", "bold") + call s:HL("cucumberExamples", s:aqua, "", "") + call s:HL("cucumberTags", s:aqua, "", "") + call s:HL("cucumberPlaceholder", s:aqua, "", "") + " }}} + + " Plugin: Netrw + call s:HL("netrwVersion", s:red, "", "") + call s:HL("netrwList", s:pink, "", "") + call s:HL("netrwHidePat", s:olive, "", "") + call s:HL("netrwQuickHelp", s:blue, "", "") + call s:HL("netrwHelpCmd", s:blue, "", "") + call s:HL("netrwDir", s:aqua, "", "bold") + call s:HL("netrwClassify", s:pink, "", "") + call s:HL("netrwExe", s:green, "", "") + call s:HL("netrwSuffixes", s:comment, "", "") + call s:HL("netrwTreeBar", s:linenumber, "", "") + + " Plugin: NERDTree + call s:HL("NERDTreeUp", s:comment, "", "") + call s:HL("NERDTreeHelpCommand", s:pink, "", "") + call s:HL("NERDTreeHelpTitle", s:blue, "", "bold") + call s:HL("NERDTreeHelpKey", s:pink, "", "") + call s:HL("NERDTreeHelp", s:foreground, "", "") + call s:HL("NERDTreeToggleOff", s:red, "", "") + call s:HL("NERDTreeToggleOn", s:green, "", "") + call s:HL("NERDTreeDir", s:blue, "", "bold") + call s:HL("NERDTreeDirSlash", s:pink, "", "") + call s:HL("NERDTreeFile", s:foreground, "", "") + call s:HL("NERDTreeExecFile", s:green, "", "") + call s:HL("NERDTreeOpenable", s:pink, "", "bold") + call s:HL("NERDTreeClosable", s:pink, "", "") + + " Plugin: Tagbar + call s:HL("TagbarHelpTitle", s:blue, "", "bold") + call s:HL("TagbarHelp", s:foreground, "", "") + call s:HL("TagbarKind", s:pink, "", "") + call s:HL("TagbarSignature", s:aqua, "", "") + + " Plugin: Vimdiff + call s:HL("DiffAdd", s:diffadd_fg, s:diffadd_bg, "none") + call s:HL("DiffChange", s:diffchange_fg, s:diffchange_bg, "none") + call s:HL("DiffDelete", s:diffdelete_fg, s:diffdelete_bg, "none") + call s:HL("DiffText", s:difftext_fg, s:difftext_bg, "none") + + " Plugin: Spell Checking + call s:HL("SpellBad", s:foreground, s:spellbad, "") + call s:HL("SpellCap", s:foreground, s:spellcap, "") + call s:HL("SpellRare", s:foreground, s:spellrare, "") + call s:HL("SpellLocal", s:foreground, s:spelllocal, "") + + " Plugin: Indent Guides + call s:HL("IndentGuidesOdd", "", s:background, "") + call s:HL("IndentGuidesEven", "", s:cursorline, "") + + " Plugin: Startify + call s:HL("StartifyFile", s:blue, "", "bold") + call s:HL("StartifyPath", s:foreground, "", "") + call s:HL("StartifySlash", s:navy, "", "") + call s:HL("StartifyBracket", s:aqua, "", "") + call s:HL("StartifySpecial", s:aqua, "", "") + + "===================================================================== + " SYNTAX HIGHLIGHTING CODE BELOW THIS LINE ISN'T TESTED FOR THIS THEME + "===================================================================== + + + " " CoffeeScript Highlighting + " call s:HL("coffeeRepeat", s:purple, "", "") + " call s:HL("coffeeConditional", s:purple, "", "") + " call s:HL("coffeeKeyword", s:purple, "", "") + " call s:HL("coffeeObject", s:yellow, "", "") + + + " " ShowMarks Highlighting + " call s:HL("ShowMarksHLl", s:orange, s:background, "none") + " call s:HL("ShowMarksHLo", s:purple, s:background, "none") + " call s:HL("ShowMarksHLu", s:yellow, s:background, "none") + " call s:HL("ShowMarksHLm", s:aqua, s:background, "none") + + + + + + " " Scala "highlighting + " call s:HL("scalaKeyword", s:purple, "", "") + " call s:HL("scalaKeywordModifier", s:purple, "", "") + " call s:HL("scalaOperator", s:blue, "", "") + " call s:HL("scalaPackage", s:pink, "", "") + " call s:HL("scalaFqn", s:foreground, "", "") + " call s:HL("scalaFqnSet", s:foreground, "", "") + " call s:HL("scalaImport", s:purple, "", "") + " call s:HL("scalaBoolean", s:orange, "", "") + " call s:HL("scalaDef", s:purple, "", "") + " call s:HL("scalaVal", s:purple, "", "") + " call s:HL("scalaVar", s:aqua, "", "") + " call s:HL("scalaClass", s:purple, "", "") + " call s:HL("scalaObject", s:purple, "", "") + " call s:HL("scalaTrait", s:purple, "", "") + " call s:HL("scalaDefName", s:blue, "", "") + " call s:HL("scalaValName", s:foreground, "", "") + " call s:HL("scalaVarName", s:foreground, "", "") + " call s:HL("scalaClassName", s:foreground, "", "") + " call s:HL("scalaType", s:yellow, "", "") + " call s:HL("scalaTypeSpecializer", s:yellow, "", "") + " call s:HL("scalaAnnotation", s:orange, "", "") + " call s:HL("scalaNumber", s:orange, "", "") + " call s:HL("scalaDefSpecializer", s:yellow, "", "") + " call s:HL("scalaClassSpecializer", s:yellow, "", "") + " call s:HL("scalaBackTick", s:olive, "", "") + " call s:HL("scalaRoot", s:foreground, "", "") + " call s:HL("scalaMethodCall", s:blue, "", "") + " call s:HL("scalaCaseType", s:yellow, "", "") + " call s:HL("scalaLineComment", s:comment, "", "") + " call s:HL("scalaComment", s:comment, "", "") + " call s:HL("scalaDocComment", s:comment, "", "") + " call s:HL("scalaDocTags", s:comment, "", "") + " call s:HL("scalaEmptyString", s:olive, "", "") + " call s:HL("scalaMultiLineString", s:olive, "", "") + " call s:HL("scalaUnicode", s:orange, "", "") + " call s:HL("scalaString", s:olive, "", "") + " call s:HL("scalaStringEscape", s:olive, "", "") + " call s:HL("scalaSymbol", s:orange, "", "") + " call s:HL("scalaChar", s:orange, "", "") + " call s:HL("scalaXml", s:olive, "", "") + " call s:HL("scalaConstructorSpecializer", s:yellow, "", "") + " call s:HL("scalaBackTick", s:blue, "", "") + + " Git + call s:HL("diffAdded", s:olive, "", "") + call s:HL("diffRemoved", s:pink, "", "") + call s:HL("gitcommitSummary", "", "", "bold") + +endif +" }}} + +" Delete Helper Functions: {{{ +delf s:Load_Settings_Override +delf s:HL +delf s:rgb +delf s:colour +delf s:rgb_colour +delf s:rgb_level +delf s:rgb_number +delf s:grey_colour +delf s:grey_level +delf s:grey_number +" }}} + +" vim: fdm=marker diff --git a/etc/soft/nvim/ftdetect/detect.vim b/etc/soft/nvim/ftdetect/detect.vim index d7c1d78..eeb3659 100644 --- a/etc/soft/nvim/ftdetect/detect.vim +++ b/etc/soft/nvim/ftdetect/detect.vim @@ -1,6 +1,3 @@ -au BufNewFile,BufRead *.hs set foldexpr=HaskellFold(v:lnum) -au BufNewFile,BufRead *.hs set foldmethod=expr - au BufNewFile,BufRead *.test set filetype=tcl au BufNewFile,BufRead *.txt set textwidth=80 au BufNewFile,BufRead *.txt set filetype=txt @@ -11,7 +8,7 @@ au BufRead,BufNewFile *.xpt.vim set filetype=xpt.vim au BufRead,BufNewFile *.xpt.vim set filetype=xpt.vim au BufRead,BufNewFile *.vim set filetype=vim au BufRead,BufNewFile *.mutt set filetype=muttrc -au BufRead,BufNewFile *rtorrent.rc* set filetype=rtorrent +au BufRead,BufNewFile *rtorrent.rc* set filetype=rtorrent au BufRead,BufNewFile *.gv set filetype=graphviz au BufRead,BufNewFile *.r set filetype=rebol au BufRead,BufNewFile rfc* set filetype=rfc @@ -21,9 +18,9 @@ au BufWinEnter,BufRead,BufNewFile *.wiki set nocursorline au BufRead,BufNewFile *.timelog set filetype=timelog au BufRead,BufNewFile *.rkt set filetype=racket -au BufRead,BufNewFile *.scm runtime plugin/RainbowParenthsis.vim -au BufRead,BufNewFile *.lisp runtime plugin/RainbowParenthsis.vim -au BufRead,BufNewFile *.rkt runtime plugin/RainbowParenthsis.vim +au BufRead,BufNewFile *.scm runtime plugin/RainbowParenthsis.vim +au BufRead,BufNewFile *.lisp runtime plugin/RainbowParenthsis.vim +au BufRead,BufNewFile *.rkt runtime plugin/RainbowParenthsis.vim au BufRead,BufNewFile *.scm set lisp au BufRead,BufNewFile *.lisp set lisp diff --git a/etc/soft/nvim/syntax/haskell.vim b/etc/soft/nvim/syntax/haskell.vim index b8df3bf..95939b9 100644 --- a/etc/soft/nvim/syntax/haskell.vim +++ b/etc/soft/nvim/syntax/haskell.vim @@ -60,20 +60,20 @@ syn match hsConditional "\<\(if\|then\|else\)\>" " Types -syn keyword hsType Array -syn keyword hsType Bool BufferMode -syn keyword hsType CalendarTime Char ClockTime Complex Complex -syn keyword hsType Day Double -syn keyword hsType Either ExitCode -syn keyword hsType FilePath Float -syn keyword hsType Handle HandlePosn -syn keyword hsType Int Integer IO IOError IOMode -syn keyword hsType Maybe Month -syn keyword hsType Ordering -syn keyword hsType Permissions -syn keyword hsType Ratio Rational Rational Read ReadS -syn keyword hsType SeekMode Show ShowS StdGen String -syn keyword hsType TimeDiff TimeLocale +" syn keyword hsType Array +" syn keyword hsType Bool BufferMode +" syn keyword hsType CalendarTime Char ClockTime Complex Complex +" syn keyword hsType Day Double +" syn keyword hsType Either ExitCode +" syn keyword hsType FilePath Float +" syn keyword hsType Handle HandlePosn +" syn keyword hsType Int Integer IO IOError IOMode +" syn keyword hsType Maybe Month +" syn keyword hsType Ordering +" syn keyword hsType Permissions +" syn keyword hsType Ratio Rational Rational Read ReadS +" syn keyword hsType SeekMode Show ShowS StdGen String +" syn keyword hsType TimeDiff TimeLocale " Classes from the standard prelude @@ -563,7 +563,7 @@ if version >= 508 || !exists("did_hs_syntax_inits") hi link hsPragma SpecialComment hi link hsBoolean Boolean hi link hsType Type - hi link hsFunc Function + hi link hsFunc Function hi link hsMaybe hsEnumConst hi link hsOrdering hsEnumConst hi link hsEnumConst Constant diff --git a/etc/soft/nvim/vimrc b/etc/soft/nvim/vimrc index a90fe8c..83cf659 100644 --- a/etc/soft/nvim/vimrc +++ b/etc/soft/nvim/vimrc @@ -97,6 +97,8 @@ set iminsert=0 " Раскладка по умолчанию - английс "match ErrorMsg '\%>80v.\+' " Подсветка выхода за 80-й символ +match ErrorMsg /\s\+\%#\@> ) -set listchars=tab:>.,trail:+,extends:#,nbsp:. " Показывать табуляцию и висящие пробелы + +" Показывать табуляцию и висящие пробелы +set listchars=tab:▸·,space:·,nbsp:␣,trail:+,eol:¶,precedes:«,extends:» " }}}--------------------------------------------------------------------------- @@ -198,7 +202,7 @@ set undoreload=10000" " colo wombat_converted " Цветовая схема " set termguicolors set background=light -colo PaperColor +colo PaperColor_Edit " Грамматические ошибки " hi clear SpellBad @@ -434,7 +438,7 @@ cnoremap " Редактирование макросов ("X,@") nn @ :='let @'.v:register.' = - \ '.string(getreg(v:register)) + \ '.string(getreg(v:register)) " Редактирование окружений (cib/dap/...) {{{ " Редактирование СЛЕДУЮЩЕГО окружения" @@ -803,20 +807,20 @@ nnoremap n :NnnPicker '%:p:h' " Floating window (neovim) function! s:layout() - let buf = nvim_create_buf(v:false, v:true) + let buf = nvim_create_buf(v:false, v:true) - let height = &lines - (float2nr(&lines / 3)) - let width = float2nr(&columns - (&columns * 2 / 3)) + let height = &lines - (float2nr(&lines / 3)) + let width = float2nr(&columns - (&columns * 2 / 3)) - let opts = { - \ 'relative': 'editor', - \ 'row': 2, - \ 'col': 8, - \ 'width': width, - \ 'height': height - \ } + let opts = { + \ 'relative': 'editor', + \ 'row': 2, + \ 'col': 8, + \ 'width': width, + \ 'height': height + \ } - call nvim_open_win(buf, v:true, opts) + call nvim_open_win(buf, v:true, opts) endfunction let g:nnn#layout = 'call ' . string(function('layout')) . '()' @@ -848,7 +852,7 @@ let g:CheatSheetUrlGetterIdFlag='-b' " cheat sheet base url let g:CheatSheetBaseUrl='https://cht.sh' -" cheat sheet settings do not include style settings neiter comments, +" cheat sheet settings do not include style settings neiter comments, " see other options below let g:CheatSheetUrlSettings='q' @@ -876,7 +880,7 @@ let g:CheatSheetDefaultMode=0 let g:CheatSheetFrameworks = {} imap