Browse Source

Update master branch

Maxim Likhachev 5 years ago
parent
commit
6a5db637a7
  1. 5
      etc/shell/bash/aliases
  2. 10
      etc/shell/bash/bashrc
  3. 9
      etc/soft/git/gitconfig
  4. 92
      etc/soft/joplin/userstyle.css
  5. 61
      etc/soft/nvim/+ftplugin/haskell.vim
  6. 83
      etc/soft/nvim/+plugins/auto-git-diff/README.md
  7. 132
      etc/soft/nvim/+plugins/auto-git-diff/autoload/auto_git_diff.vim
  8. 16
      etc/soft/nvim/+plugins/auto-git-diff/plugin/auto-git-diff.vim
  9. 147
      etc/soft/nvim/+plugins/vim-haskellConcealPlus/README.md
  10. 494
      etc/soft/nvim/+plugins/vim-haskellConcealPlus/after/syntax/haskell.vim
  11. 477
      etc/soft/nvim/+plugins/vim-haskellConcealPlus/after/syntax/lhaskell.vim
  12. 46
      etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.hs
  13. 90
      etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.lhs
  14. BIN
      etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.png
  15. 6
      etc/soft/nvim/+plugins/vim-haskellConcealPlus/gendemo.sh
  16. 38
      etc/soft/nvim/+plugins/vim-haskellConcealPlus/tests/test-with-pack.sh
  17. 37
      etc/soft/nvim/+plugins/vim-haskellConcealPlus/tests/test-with-pathogen.sh
  18. 14
      etc/soft/nvim/+plugins/vim-haskellfold/README.md
  19. 121
      etc/soft/nvim/+plugins/vim-haskellfold/autoload/haskellFold.vim
  20. 1
      etc/soft/nvim/+plugins/vim-haskellfold/ftplugin/haskell.vim
  21. 11
      etc/soft/nvim/+plugins/vim-haskellfold/plugin/haskellFold.vim
  22. 33
      etc/soft/nvim/+plugins/vim-helm/LICENSE
  23. 8
      etc/soft/nvim/+plugins/vim-helm/README.md
  24. 1
      etc/soft/nvim/+plugins/vim-helm/ftdetect/helm.vim
  25. 95
      etc/soft/nvim/+plugins/vim-helm/syntax/helm.vim
  26. 0
      etc/soft/nvim/+plugins_disabled/vim-haskellConceal/README
  27. 0
      etc/soft/nvim/+plugins_disabled/vim-haskellConceal/after/syntax/haskell.vim
  28. 17
      etc/soft/nvim/cheat40.txt
  29. 1323
      etc/soft/nvim/colors/PaperColor_Edit.vim
  30. 11
      etc/soft/nvim/ftdetect/detect.vim
  31. 30
      etc/soft/nvim/syntax/haskell.vim
  32. 86
      etc/soft/nvim/vimrc

5
etc/shell/bash/aliases

@ -408,6 +408,11 @@ map() { @@ -408,6 +408,11 @@ map() {
telnet mapscii.me
}
#- Отображение настоящего URL ссылки
realurl() {
curl -ILs "$1" | grep '^Location:'
}
#- Консольный калькулятор
=() { echo "$*" | bc -l; }

10
etc/shell/bash/bashrc

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#!/bin/bash ####################################################################
#
# Изменён: Ср 01 июл 2020 00:07:20
# Изменён: Ср 29 июл 2020 11:55:43
#
################################################################################
@ -225,9 +225,11 @@ esac @@ -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 ' '

9
etc/soft/git/gitconfig

@ -35,6 +35,12 @@ @@ -35,6 +35,12 @@
[gc]
writeCommitGraph = true
[blame]
coloring = repeatedLines
[color "blame"]
repeatedLines = yellow
# ----[ DIFF METHODS ]--------------------------------------------------------
[diff "plist"]
@ -77,6 +83,9 @@ @@ -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 }'"

92
etc/soft/joplin/userstyle.css

@ -45,3 +45,95 @@ a { @@ -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%;
}
}

61
etc/soft/nvim/+ftplugin/haskell.vim

@ -1,63 +1,4 @@ @@ -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()

83
etc/soft/nvim/+plugins/auto-git-diff/README.md

@ -0,0 +1,83 @@ @@ -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:
`<Plug>(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
- `<Plug>(auto_git_diff_manual_update)`
This key mapping updates the diff window manully.
- `<Plug>(auto_git_diff_scroll_down_1)`
- `<Plug>(auto_git_diff_scroll_up_1)`
- `<Plug>(auto_git_diff_scroll_down_half)`
- `<Plug>(auto_git_diff_scroll_up_half)`
- `<Plug>(auto_git_diff_scroll_down_page)`
- `<Plug>(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 (`<C-e>` or `<C-y>`), `_half` means
scrolling half a page (`<C-d>` or `<C-u>`) and `_page` means scrolling one page
(`<C-f>` or `<C-b>`).
Following is an example to configure the mappings in your `vimrc`.
```vim
function! s:setup_auto_git_diff() abort
nmap <buffer><C-l> <Plug>(auto_git_diff_scroll_manual_update)
nmap <buffer><C-n> <Plug>(auto_git_diff_scroll_down_half)
nmap <buffer><C-p> <Plug>(auto_git_diff_scroll_up_half)
endfunction
autocmd FileType gitrebase call <SID>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.

132
etc/soft/nvim/+plugins/auto-git-diff/autoload/auto_git_diff.vim

@ -0,0 +1,132 @@ @@ -0,0 +1,132 @@
let s:save_cpo = &cpo
let s:previous_hash_string = ""
set cpo&vim
nnoremap <silent> <Plug>(auto_git_diff_manual_update) :<C-u>call auto_git_diff#show_git_diff()<CR>
" 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 <buffer> q :bw<cr>
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

16
etc/soft/nvim/+plugins/auto-git-diff/plugin/auto-git-diff.vim

@ -0,0 +1,16 @@ @@ -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 <silent><Plug>(auto_git_diff_scroll_down_1) :<C-u>call auto_git_diff#scroll_in_preview_window("C-e")<CR>
nnoremap <silent><Plug>(auto_git_diff_scroll_up_1) :<C-u>call auto_git_diff#scroll_in_preview_window("C-y")<CR>
nnoremap <silent><Plug>(auto_git_diff_scroll_down_half) :<C-u>call auto_git_diff#scroll_in_preview_window("C-d")<CR>
nnoremap <silent><Plug>(auto_git_diff_scroll_up_half) :<C-u>call auto_git_diff#scroll_in_preview_window("C-u")<CR>
nnoremap <silent><Plug>(auto_git_diff_scroll_down_page) :<C-u>call auto_git_diff#scroll_in_preview_window("C-f")<CR>
nnoremap <silent><Plug>(auto_git_diff_scroll_up_page) :<C-u>call auto_git_diff#scroll_in_preview_window("C-b")<CR>

147
etc/soft/nvim/+plugins/vim-haskellConcealPlus/README.md

@ -0,0 +1,147 @@ @@ -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`:
```
<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>~/.fonts</dir>
<alias>
<family>monospace</family>
<prefer>
<family>TeX Gyre Schola Math monospacified for DejaVu Sans Mono</family>
</prefer>
</alias>
</fontconfig>
```
- 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.

494
etc/soft/nvim/+plugins/vim-haskellConcealPlus/after/syntax/haskell.vim

@ -0,0 +1,494 @@ @@ -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 "\<pi\>" conceal cchar=π
syntax match hsNiceOperator "\<tau\>" conceal cchar=τ
syntax match hsNiceOperator "\<planckConstant\>" conceal cchar=
syntax match hsNiceOperator "\<reducedPlanckConstant\|planckConstantOver2Pi\|hbar\|hslash\>" 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 "\<undefined\>" 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 "\<forall\>" 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 "\<mappend\>" conceal cchar=⊕
syntax match hsNiceOperator "<>" conceal cchar=
syntax match hsNiceOperator "\<empty\>" conceal cchar=
syntax match hsNiceOperator "\<mzero\>" conceal cchar=
syntax match hsNiceOperator "\<mempty\>" 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 "\<powerset\>" conceal cchar=
endif
" '𝐒' option to disable String type to 𝐒 concealing
if !Cf('𝐒')
syntax match hsNiceOperator "\<String\>" conceal cchar=𝐒
endif
" '𝐓' option to disable Text type to 𝐓 concealing
if !Cf('𝐓')
syntax match hsNiceOperator "\<Text\>" conceal cchar=𝐓
endif
" '𝐄' option to disable Either/Right/Left to 𝐄/𝑅/𝐿 concealing
if !Cf('𝐄')
syntax match hsNiceOperator "\<Either\>" conceal cchar=𝐄
syntax match hsNiceOperator "\<Right\>" conceal cchar=𝑅
syntax match hsNiceOperator "\<Left\>" conceal cchar=𝐿
endif
" '𝐌' option to disable Maybe/Just/Nothing to 𝐌/𝐽/𝑁 concealing
if !Cf('𝐌')
syntax match hsNiceOperator "\<Maybe\>" conceal cchar=𝐌
syntax match hsNiceOperator "\<Just\>" conceal cchar=𝐽
syntax match hsNiceOperator "\<Nothing\>" 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 "\<sum\>" conceal cchar=
syntax match hsNiceOperator "\<product\>" conceal cchar=
syntax match hsNiceOperator "\<sqrt\>" conceal cchar=
syntax match hsNiceOperator "\<not\>" conceal cchar=¬
else
syntax match hsNiceOperator "\<sum\>\(\ze\s*[.$]\|\s*\)" conceal cchar=
syntax match hsNiceOperator "\<product\>\(\ze\s*[.$]\|\s*\)" conceal cchar=
syntax match hsNiceOperator "\<sqrt\>\(\ze\s*[.$]\|\s*\)" conceal cchar=
syntax match hsNiceOperator "\<not\>\(\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 "\<return\>" conceal cchar=η
syntax match hsNiceOperator "\<join\>" 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 "\<fmap\>\s*" contains=FMAPf,FMAPm,FMAPa,FMAPp,FMAPSPC
syntax match LIFTSPC contained " " conceal
syntax match hsNiceOperator "\<liftA\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTA,LIFTSPC
syntax match hsNiceOperator "\<liftA2\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTA,LIFT2,LIFTSPC
syntax match hsNiceOperator "\<liftA3\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTA,LIFT3,LIFTSPC
syntax match hsNiceOperator "\<liftM\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFTSPC
syntax match hsNiceOperator "\<liftM2\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT2,LIFTSPC
syntax match hsNiceOperator "\<liftM3\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT3,LIFTSPC
syntax match hsNiceOperator "\<liftM4\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT4,LIFTSPC
syntax match hsNiceOperator "\<liftM5\>\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 "\<liftIO\>" 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 "\<mapM\>\s*" contains=MAPMm,MAPMa,MAPMp,MAPMM,SPC
syntax match hsNiceOperator "\<mapM_\>\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 "\<forM\>\s*" contains=FORMf,FORMo,FORMr,FORMM,SPC
syntax match hsNiceOperator "\<forM_\>\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 "\<where\>" 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 "\<realPart\>" conceal cchar=
syntax match hsNiceOperator "\<imagPart\>" conceal cchar=
endif
" 'T' option to enable True/False constants concealing with bold 𝐓/𝐅.
if Cf('T')
syntax match hsNiceSpecial "\<True\>" conceal cchar=𝐓
syntax match hsNiceSpecial "\<False\>" conceal cchar=𝐅
" 't' option to disable True/False constants concealing with italic 𝑇/𝐹.
elseif !Cf('t')
syntax match hsNiceSpecial "\<True\>" conceal cchar=𝑇
syntax match hsNiceSpecial "\<False\>" 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 "\<Bool\>" conceal cchar=𝔹
endif
" 'Q' option to disable Rational type to ℚ concealing.
if !Cf('Q')
syntax match hsNiceOperator "\<Rational\>" conceal cchar=
endif
" 'Z' option to disable Integer type to ℤ concealing.
if !Cf('Z')
syntax match hsNiceOperator "\<Int\>" conceal cchar=
syntax match hsNiceOperator "\<Integer\>" conceal cchar=
endif
" 'N' option to disable Natural, Nat types to ℕ concealing.
if !Cf('N')
syntax match hsNiceOperator "\<Natural\>" conceal cchar=
syntax match hsNiceOperator "\<Nat\>" conceal cchar=
endif
" 'D' option to disable Double type to 𝔻 concealing
if !Cf('D')
syntax match hsNiceOperator "\<Double\>" conceal cchar=𝔻
endif
" 'C' option to disable Complex type to ℂ concealing
if !Cf('C')
syntax match hasNiceOperator "\<Complex\>" 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 "\<therefore\>" conceal cchar=
syntax match hsNiceOperator "\<exists\>" conceal cchar=
syntax match hsNiceOperator "\<notExist\>" 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

477
etc/soft/nvim/+plugins/vim-haskellConcealPlus/after/syntax/lhaskell.vim

@ -0,0 +1,477 @@ @@ -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 "\<pi\>" conceal cchar=π contained
syntax match hsNiceOperator "\<tau\>" conceal cchar=τ contained
syntax match hsNiceOperator "\<planckConstant\>" conceal cchar= contained
syntax match hsNiceOperator "\<reducedPlanckConstant\|planckConstantOver2Pi\|hbar\|hslash\>" 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 "\<undefined\>" 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 "\<forall\>" 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 "\<mappend\>" conceal cchar=
syntax match hsNiceOperator "<>" conceal cchar=contained
syntax match hsNiceOperator "\<empty\>" conceal cchar=contained
syntax match hsNiceOperator "\<mzero\>" conceal cchar=contained
syntax match hsNiceOperator "\<mempty\>" 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 "\<powerset\>" conceal cchar=contained
endif
" '𝐒' option to disable String type to 𝐒 concealing
if !Cf('𝐒')
syntax match hsNiceOperator "\<String\>" conceal cchar=𝐒 contained
endif
" '𝐓' option to disable Text type to 𝐓 concealing
if !Cf('𝐓')
syntax match hsNiceOperator "\<Text\>" conceal cchar=𝐓 contained
endif
" '𝐄' option to disable Either/Right/Left to 𝐄/𝑅/𝐿 concealing
if !Cf('𝐄')
syntax match hsNiceOperator "\<Either\>" conceal cchar=𝐄 contained
syntax match hsNiceOperator "\<Right\>" conceal cchar=𝑅 contained
syntax match hsNiceOperator "\<Left\>" conceal cchar=𝐿 contained
endif
" '𝐌' option to disable Maybe/Just/Nothing to 𝐌/𝐽/𝑁 concealing
if !Cf('𝐌')
syntax match hsNiceOperator "\<Maybe\>" conceal cchar=𝐌 contained
syntax match hsNiceOperator "\<Just\>" conceal cchar=𝐽 contained
syntax match hsNiceOperator "\<Nothing\>" 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 "\<sum\>" conceal cchar=contained
syntax match hsNiceOperator "\<product\>" conceal cchar=contained
syntax match hsNiceOperator "\<sqrt\>" conceal cchar=contained
syntax match hsNiceOperator "\<not\>" conceal cchar=¬ contained
else
syntax match hsNiceOperator "\<sum\>\(\ze\s*[.$]\|\s*\)" conceal cchar=contained
syntax match hsNiceOperator "\<product\>\(\ze\s*[.$]\|\s*\)" conceal cchar=contained
syntax match hsNiceOperator "\<sqrt\>\(\ze\s*[.$]\|\s*\)" conceal cchar=contained
syntax match hsNiceOperator "\<not\>\(\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 "\<return\>" conceal cchar=η contained
syntax match hsNiceOperator "\<join\>" 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 "\<fmap\>\s*" contains=FMAPf,FMAPm,FMAPa,FMAPp,FMAPSPC contained
syntax match LIFTSPC contained " " conceal contained
syntax match hsNiceOperator "\<liftA\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTA,LIFTSPC contained
syntax match hsNiceOperator "\<liftA2\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTA,LIFT2,LIFTSPC contained
syntax match hsNiceOperator "\<liftA3\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTA,LIFT3,LIFTSPC contained
syntax match hsNiceOperator "\<liftM\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFTSPC contained
syntax match hsNiceOperator "\<liftM2\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT2,LIFTSPC contained
syntax match hsNiceOperator "\<liftM3\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT3,LIFTSPC contained
syntax match hsNiceOperator "\<liftM4\>\s*" contains=LIFTl,LIFTi,LIFTf,LIFTt,LIFTM,LIFT4,LIFTSPC contained
syntax match hsNiceOperator "\<liftM5\>\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 "\<liftIO\>" 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 "\<mapM\>\s*" contains=MAPMm,MAPMa,MAPMp,MAPMM,SPC contained
syntax match hsNiceOperator "\<mapM_\>\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 "\<forM\>\s*" contains=FORMf,FORMo,FORMr,FORMM,SPC contained
syntax match hsNiceOperator "\<forM_\>\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 "\<where\>" 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 "\<realPart\>" conceal cchar= contained
syntax match hsNiceOperator "\<imagPart\>" conceal cchar= contained
endif
" 'T' option to enable True/False constants concealing with bold 𝐓/𝐅.
if Cf('T')
syntax match hsNiceSpecial "\<True\>" conceal cchar=𝐓 contained
syntax match hsNiceSpecial "\<False\>" conceal cchar=𝐅 contained
" 't' option to disable True/False constants concealing with italic 𝑇/𝐹.
elseif !Cf('t')
syntax match hsNiceSpecial "\<True\>" conceal cchar=𝑇 contained
syntax match hsNiceSpecial "\<False\>" 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 "\<Bool\>" conceal cchar=𝔹 contained
endif
" 'Q' option to disable Rational type to ℚ concealing.
if !Cf('Q')
syntax match hsNiceOperator "\<Rational\>" conceal cchar=
endif
" 'Z' option to disable Integer type to ℤ concealing.
if !Cf('Z')
syntax match hsNiceOperator "\<Integer\>" conceal cchar= contained
endif
" 'N' option to disable Natural, Nat types to ℕ concealing.
if !Cf('N')
syntax match hsNiceOperator "\<Natural\>" conceal cchar= contained
syntax match hsNiceOperator "\<Nat\>" conceal cchar= contained
endif
" '𝔻' option to disable Double type to 𝔻 concealing
if !Cf('𝔻')
syntax match hsNiceOperator "\<Double\>" 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 "\<therefore\>" conceal cchar=contained
syntax match hsNiceOperator "\<exists\>" conceal cchar=contained
syntax match hsNiceOperator "\<notExist\>" 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
" (<|) = (⊲ )
" (|>) = (⊳ )
" (><) = (⋈ )

46
etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.hs

@ -0,0 +1,46 @@ @@ -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

90
etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.lhs

@ -0,0 +1,90 @@ @@ -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

BIN
etc/soft/nvim/+plugins/vim-haskellConcealPlus/demo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

6
etc/soft/nvim/+plugins/vim-haskellConcealPlus/gendemo.sh

@ -0,0 +1,6 @@ @@ -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

38
etc/soft/nvim/+plugins/vim-haskellConcealPlus/tests/test-with-pack.sh

@ -0,0 +1,38 @@ @@ -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" "$@"

37
etc/soft/nvim/+plugins/vim-haskellConcealPlus/tests/test-with-pathogen.sh

@ -0,0 +1,37 @@ @@ -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" "$@"

14
etc/soft/nvim/+plugins/vim-haskellfold/README.md

@ -0,0 +1,14 @@ @@ -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

121
etc/soft/nvim/+plugins/vim-haskellfold/autoload/haskellFold.vim

@ -0,0 +1,121 @@ @@ -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 "}}}

1
etc/soft/nvim/+plugins/vim-haskellfold/ftplugin/haskell.vim

@ -0,0 +1 @@ @@ -0,0 +1 @@
call SetHaskellFolding()

11
etc/soft/nvim/+plugins/vim-haskellfold/plugin/haskellFold.vim

@ -0,0 +1,11 @@ @@ -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 "}}}

33
etc/soft/nvim/+plugins/vim-helm/LICENSE

@ -0,0 +1,33 @@ @@ -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.

8
etc/soft/nvim/+plugins/vim-helm/README.md

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
# vim-helm
vim syntax for helm templates (yaml + gotmpl + sprig + custom)
Install via vundle:
```vim
Plugin 'towolf/vim-helm'
```

1
etc/soft/nvim/+plugins/vim-helm/ftdetect/helm.vim

@ -0,0 +1 @@ @@ -0,0 +1 @@
autocmd BufRead,BufNewFile */templates/*.yaml,*/templates/*.tpl set ft=helm

95
etc/soft/nvim/+plugins/vim-helm/syntax/helm.vim

@ -0,0 +1,95 @@ @@ -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

0
etc/soft/nvim/+plugins/vim-haskellConceal/README → etc/soft/nvim/+plugins_disabled/vim-haskellConceal/README

0
etc/soft/nvim/+plugins/vim-haskellConceal/after/syntax/haskell.vim → etc/soft/nvim/+plugins_disabled/vim-haskellConceal/after/syntax/haskell.vim

17
etc/soft/nvim/cheat40.txt

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Press q to dismiss, <Tab> to lose focus
Перемещение {{{1
Перемещение {{{2
В начало экрана H N
В центр экрана M N
@ -15,6 +15,9 @@ Press q to dismiss, <Tab> to lose focus @@ -15,6 +15,9 @@ Press q to dismiss, <Tab> to lose focus
Строку в центр экрана z. N
Строку вниз экрана z- N
Конец предыдущего слова ge
Конец предыдущего СЛОВА gE
ex {{{1
Замена в найденных стр. :g/../s/a/b/g C
@ -31,3 +34,15 @@ ex {{{1 @@ -31,3 +34,15 @@ ex {{{1
Открыть ссылку gx N
Регулярные выражения {{{1
идентификатор isident \i
~ \i без цифр \I
ключевое слово iskeyword \k
~ \k без цифр \K
имя файла isfname \f
~ \f без цифр \F
печатные символы \p
~ \p без цифр \P
последняя строка поиска ~

1323
etc/soft/nvim/colors/PaperColor_Edit.vim

File diff suppressed because it is too large Load Diff

11
etc/soft/nvim/ftdetect/detect.vim

@ -1,6 +1,3 @@ @@ -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 @@ -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 @@ -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

30
etc/soft/nvim/syntax/haskell.vim

@ -60,20 +60,20 @@ syn match hsConditional "\<\(if\|then\|else\)\>" @@ -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") @@ -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

86
etc/soft/nvim/vimrc

@ -97,6 +97,8 @@ set iminsert=0 " Раскладка по умолчанию - английс @@ -97,6 +97,8 @@ set iminsert=0 " Раскладка по умолчанию - английс
"match ErrorMsg '\%>80v.\+' " Подсветка выхода за 80-й символ
match ErrorMsg /\s\+\%#\@<!$\| \+\ze\t/ " Подсветка висящих пробелов
" }}}---------------------------------------------------------------------------
" {{{-------------------------- Настройка табуляции ----------------------------
@ -104,7 +106,9 @@ set iminsert=0 " Раскладка по умолчанию - английс @@ -104,7 +106,9 @@ set iminsert=0 " Раскладка по умолчанию - английс
set tabstop=8 " Размер табуляции
set softtabstop=8 " Табуляция
set shiftwidth=8 " Размер сдвига блоков ( << , >> )
set listchars=tab:>.,trail:+,extends:#,nbsp:. " Показывать табуляцию и висящие пробелы
" Показывать табуляцию и висящие пробелы
set listchars=tab:▸·,space,nbsp:␣,trail:+,eol,precedes,extends
" }}}---------------------------------------------------------------------------
@ -198,7 +202,7 @@ set undoreload=10000" @@ -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 <ESC><C-H> <C-W> @@ -434,7 +438,7 @@ cnoremap <ESC><C-H> <C-W>
" Редактирование макросов ("X,@")
nn <leader>@ :<c-u><c-r><c-r>='let @'.v:register.' =
\ '.string(getreg(v:register))<cr><c-f><left>
\ '.string(getreg(v:register))<cr><c-f><left>
" Редактирование окружений (cib/dap/...) {{{
" Редактирование СЛЕДУЮЩЕГО окружения"
@ -803,20 +807,20 @@ nnoremap <leader>n :NnnPicker '%:p:h'<CR> @@ -803,20 +807,20 @@ nnoremap <leader>n :NnnPicker '%:p:h'<CR>
" 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('<SID>layout')) . '()'
@ -848,7 +852,7 @@ let g:CheatSheetUrlGetterIdFlag='-b' @@ -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 @@ -876,7 +880,7 @@ let g:CheatSheetDefaultMode=0
let g:CheatSheetFrameworks = {}
imap <script> <silent> <C-O>
\ <ESC>:call cheat#cheat("", getcurpos()[1], getcurpos()[1], 0, 0, '!')<CR>
\ <ESC>:call cheat#cheat("", getcurpos()[1], getcurpos()[1], 0, 0, '!')<CR>
" }}}
@ -888,9 +892,9 @@ let g:startify_bookmarks = [ @@ -888,9 +892,9 @@ let g:startify_bookmarks = [
\ ]
let g:startify_commands = [
\ {'d': ['Open current directory (GUI)', 'silent exec "!x-open ."']},
\ {'m': ['Make current project ($ make)', 'make']},
\ ]
\ {'d': ['Open current directory (GUI)', 'silent exec "!x-open ."']},
\ {'m': ['Make current project ($ make)', 'make']},
\ ]
let g:ascii = systemlist('git-cal --unicode 2>/dev/null | head -n 10 | grep -v fatal || echo; echo; todolist | sed "s/^/ /" ')
let g:startify_custom_header = g:ascii
@ -941,5 +945,49 @@ let g:committia_min_window_width = 80 @@ -941,5 +945,49 @@ let g:committia_min_window_width = 80
" }}}
" HaskellConcealPlus {{{
" [ ] '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
" [X] 'A' option to not try to preserve indentation
" [ ] 's' option to disable space consumption after ∑,∏,√ and ¬ functions
" [X] '*' option to enable concealing of asterisk with '⋅' sign
" [X] 'x' option to disable default concealing of asterisk with '×' sign
" [X] 'E' option to enable ellipsis concealing with ‥ (two dot leader)
" [X] 'e' option to disable ellipsis concealing with … (ellipsis sign)
" [ ] '⇒' option to disable `implies` concealing with ⇒
" [ ] '⇔' option to disable `iff` concealing with ⇔
" [X] '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
" [X] 'l' option to disable fmap/lift concealing with ↥
" [X] '↱' option to disable mapM/forM concealing with ↱/↰
" [X] 'w' option to disable 'where' concealing with "due to"/∵ symbol
" [X] '-' 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 ℜ/ℑ
" [X] 'T' option to enable True/False constants concealing with bold 𝐓/𝐅
" [X] '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ⁿ
let hscoptions="Ax*Eerl↱w-Tt"
" }}}
" }}}###########################################################################

Loading…
Cancel
Save