Compare commits

..

528 Commits

Author SHA1 Message Date
a9316971f1 temp! 2022-11-08 11:21:35 +00:00
ee5110efd8 Remove minpac in preparation for using Ansible 2022-11-08 11:21:08 +00:00
330329ef2b Replace ad hoc conflict markers with plugin 2022-11-07 14:27:13 +00:00
32610db521 Make gx work in WSL 2022-11-06 11:21:32 +00:00
4c142d2fa5 Only setup cursor shape in vim, not nvim
Neovim already changes cursor shape by default, there's no need to
override it.
2022-11-06 11:12:06 +00:00
cde38c5469 Make CocInlayHint look like Comment 2022-10-31 11:48:44 +00:00
dfc26e9c40 Disable coc-powershell integrated console 2022-10-29 11:44:15 +01:00
5476d9ec86 Fix coc.nvim change of default first selection 2022-10-25 11:08:25 +01:00
78ae575efe Disable clangd inlay type hints 2022-10-13 10:45:01 +01:00
3577aa13bc Drop some coc-yaml schemas 2022-09-09 22:49:07 +01:00
2ce3d322ca Add coc-powershell on Windows only 2022-06-15 22:15:23 +01:00
27c42a6a92 Don't use GUI tabs in neovim-qt 2022-06-15 22:15:23 +01:00
61ce53bfd3 Don't conceal things in json 2022-06-08 13:56:37 +01:00
d0af1c7116 Fix Doxygen @param highlight
There are two forms of `@param`:

* `@param <name> <description>`
* `@param[<use>] <name> <description>`

Prior to this patch only the latter was highlighting `<name>` as a
special comment, now both forms do this.
2022-05-31 10:59:28 +01:00
ec2b973fc0 Update schemastore URLs 2022-05-22 15:57:11 +01:00
98b48377cd Add GitLab CI schema paths 2022-05-04 14:14:03 +01:00
eb9579e1b6 Add more ansible tasks lsp matches 2022-04-30 13:31:29 +01:00
a689039ae2 Add yaml.schemas not matches by default 2022-04-30 09:38:25 +01:00
3da17559e9 Update minpac submodule 2022-04-29 21:58:31 +01:00
68c699882d Use Source Code Pro 10 on Windows GUI 2022-04-29 21:57:05 +01:00
51c56a8633 Fix glitch in StatusLineTerm highlight group 2022-04-22 15:53:01 +01:00
14d34e0b6b Don't set formatexpr globally, only in specific filetypes 2022-04-14 10:50:52 +01:00
fd31549a32 Add coc-docker to list of global extensions 2022-02-26 17:25:09 +00:00
d66ff687d4 Install node.js dependency for coc.nvim 2022-02-19 14:39:20 +00:00
db5ebc701d Bump unmap Y version check 2022-02-18 19:51:29 +00:00
e6e3a10c87 Don't unmap Y before nvim 0.5
This version check might need some refinement, not actually sure when it
was introduced but it's deffo not in 0.4.4.
2022-02-15 10:53:58 +00:00
8277ad04ab Add <> to % matches in cpp filetype 2022-02-03 14:25:41 +00:00
caa83e88d2 Undo neovims default mapping of Y to y$ 2022-01-14 20:03:07 +00:00
177dbad101 Use ! to silence font warning on Windows
See https://github.com/equalsraf/neovim-qt/issues/732 for more context.
2021-12-22 12:05:16 +00:00
d7c1bdd27c Fix bug in #tmux#isOption()
Actually use `a:option` instead of `'set-clipboard'` string when
comparing the tmux option value. This hasn't been an issue because the
only use of the function happens to be checking the value of
`'set-clipboard'`.
2021-12-16 23:06:03 +00:00
775d07414c Use package name lists 2021-12-15 00:31:50 +00:00
49051cff43 Only install clangd-12 on Ubuntu 20.04 2021-11-19 22:34:46 +00:00
8ffdfd41cd Move main.yaml to tasks.yaml 2021-11-19 21:49:13 +00:00
aa2190daec Install clangd language server on Debian 2021-11-11 21:52:42 +00:00
b2cf9ace96 Install cmake-language-server 2021-11-11 21:35:29 +00:00
a46b128741 Start using Ansible for config management 2021-11-05 14:13:41 +00:00
c06b56115a Add minpac as a submodule 2021-07-27 23:04:35 +01:00
e1bc4428c5 Disable coc.nvim semantic highlights 2021-07-18 16:19:48 +01:00
c9711deade Only display coc#status() in regular active buffer
The statusline is only dynamically updated for the active buffer, thus
when there are multiple splits the statusline for inactive buffers may
include non-updated output of `coc#status()`. This patch adds a boolean
flag to `statusline#generic()` which enables `statusline#active()` and
`statusline#inactive()` to control when `coc#status()` is included in
the statusline.
2021-07-14 17:33:54 +01:00
0961c13316 Use compdb to post-process compile_commands.json
When selecting a `:BuildDir` for the `clangd` LSP use `compdb` to
post-process the `compile_commands.json` to also include flags for
stand alone header files.
2021-07-14 11:38:21 +01:00
eabec4e9b6 Add build#dir() popup_menu() fallback
When `popup_menu()` is not available, i.e. neovim or old version of vim,
fallback to using `inputlist()` instead.
2021-07-13 21:00:48 +01:00
7491736987 Don't set nospell in requirements.txt 2021-07-12 13:47:00 +01:00
c26d837047 Add init.vim as a regular file 2021-07-12 13:41:26 +01:00
38b8ab2fae Remove init.vim symlink 2021-07-12 13:41:04 +01:00
30c601e8b3 Add pip requirements.txt syntax highlighting 2021-07-12 13:36:44 +01:00
2188095b2f Always use fresh colorscheme on Windows
Windows Terminal has support for 256 color so there is not need to
restrict where to use `fresh` as the `colorscheme`.
2021-07-11 16:53:22 +01:00
a881d3e62a Add nvim-qt configuration
Set font and colorscheme for `nvim-qt`.
2021-07-10 14:49:16 +01:00
2ab332db65 Don't use tmux navigation mappings on Windows
Since `tmux` integration is not enabled on Windows, don't use the
`vim-tmux-natigation` command mappings for movingin between splits.
2021-07-10 14:46:52 +01:00
dbff00b6fc Make init.vim work on Windows
Symbolic links committed to Git repositories do not work on Windows.
Repalce the `init.vim` symbolic link with a regular file which loads
`vimrc`, this should work on all platforms.
2021-07-10 14:43:39 +01:00
9cc1ac8d87 Fix statusline background higlights in gui 2021-07-10 14:42:12 +01:00
34073608c8 Update Python main snippet 2021-05-30 20:51:55 +01:00
06335a18da Change vim-signify changed sign from ! to ~ 2021-05-22 17:02:04 +01:00
4a47908717 Customize coc.nvim highlights in fresh colorscheme 2021-04-27 23:37:06 +01:00
6053174173 Don't let coc.nvim highlight the number column 2021-04-27 23:36:49 +01:00
0315c070f5 Customise coc.nvim signcolumn signs 2021-04-27 18:01:33 +01:00
05b047f374 Add coc.nvim next/previous diagnostic mappings 2021-04-27 17:34:54 +01:00
455c1f1b94 Move statusline truncation market after mode 2021-04-20 23:20:51 +01:00
46283e3b95 Remove unused vim-gitgutter mappings 2021-04-19 20:28:08 +01:00
0f1b35eda3 Don't call coc#status() if it doesn't exist 2021-04-19 20:10:29 +01:00
9aa45a4df5 Use coc-jedi and coc-pyright instead of coc-pyls 2021-04-19 20:10:29 +01:00
78e821e386 Add a call to coc#status() in statusline
Don't miss out on the status of coc.nvim by insuring updates are
rendered in the statusline.
2021-04-19 20:10:29 +01:00
2b02d0ae81 Ignore compiled python files 2021-04-19 20:10:29 +01:00
f00eb38200 Fix coc.nvim mappings in C/C++ files 2021-04-19 20:10:29 +01:00
46d27c17fd Move formatexpr config in-tree, out of plugin
Introduces the `format` Python module which provides `clang_format()`
and `yapf()` functions which efficiently (compared to vimscript) invoke
`clang-format` or `yapf` respectively then apply the minimal number of
changes using `difflib.SequenceMatcher`.

Additionally, in order to invoke these Python functions add |autoload|
functions `format#clang_format()` and `format#yapf()` which can be
directly used by the 'formatexpr' setting.

Finally, add |ftplugin| files which set 'formatexpr' when the |autoload|
functions are available.
2021-04-19 20:10:29 +01:00
4e00e225d4 Don't show signcolumn when filetype man 2021-04-18 14:42:33 +01:00
3a44fa1e48 Fix vim :terminal window mappings 2021-04-18 14:42:33 +01:00
96ff72433d Change yaml default syntax highlights 2021-04-18 14:42:33 +01:00
837aa12f9f Replace osc52yank.vim with autoload script 2021-04-18 14:42:33 +01:00
41a0658cf2 Always enable signcolum except in nvim terminal 2021-04-18 14:42:33 +01:00
3a2337cd63 Add do#show_documentation() using coc.nvim
Change the `K` normal mode overrides to use the example given in the
coc.nvim README file which uses Vim's builtin help when in `vim` or
`help` files, or checks if coc.nvim is ready and invokes
`CocActionAsync('doHover')`, otherwise fallback to using `keywordprg`.
2021-04-18 14:42:33 +01:00
ecd8659df7 Use tab width of 2 in yaml files 2021-04-18 14:42:33 +01:00
d6106bac84 Add statusline support for nvim's man pager filetype 2021-04-18 14:42:33 +01:00
873acacaa6 Make terminal mode feel like insert mode statusline 2021-04-18 14:42:33 +01:00
c284486540 Make nvim :terminal more consistent with vim
Vim's :terminal feels much more ergonomic, adding various mappings to
make the experience more similar, mainly by adding a few `<C-w>`
mappings for the most common actions.

Additionally, disable vim-tmux-navigators default mappings and setup
both normal and terminal mode mappings for `<C-w>{h,j,k,l}` in addition
to the normal mode mappings for `<C-{h,j,j,l}>` to make the pane
switching experience more consistent across all buffer types.
2021-04-18 14:42:33 +01:00
587aeef5d7 Use signcolumn=number when available 2021-04-18 14:42:33 +01:00
c67f11a8f5 Fix statusline l:mode map indentation 2021-04-18 14:42:33 +01:00
cef963d805 Remove a unused scriptencoding
There are no utf-8 special characters in the file anymore.
2021-04-18 14:42:33 +01:00
dc6a8b0032 Get rid of scrolloff 2021-04-18 14:42:33 +01:00
9a1b1ed2fc Replace vim-airline with a custom statusline
Finally got round to making a custom statusline after being inspired by
https://pastebin.com/Fm1NEgBf
2021-04-18 14:42:33 +01:00
bee751201d Add list of global coc extensions 2021-04-18 14:42:33 +01:00
eb1a4a71d8 Check if .vim directory exists before use
Update `build#dir()` to check for the existence of the `.vim` directory
containing `coc_settings.json` before attempting to read the file. If it
doesn't exist then create it.
2021-04-18 14:42:33 +01:00
bf6deaf1ed Configure cmake-language-server and coc-cmake
Utilises the following Python package:

```console
$ pip3 install --user cmake-language-server
```
2021-04-18 14:42:33 +01:00
8a2ca8c53f Update build#dir() to configure coc-clangd 2021-04-18 14:42:33 +01:00
824aeb431a Replace remaining YouCompleteMe mappings 2021-04-18 14:42:33 +01:00
4a99f582f3 Replace YouCompleteMe with coc.nvim 2021-04-18 14:42:33 +01:00
3b3121aa28 fresh: NonText as SpecialKey
Don't use `set highlight` to highlight `NonText` like `SpecialKey`,
instead simply set the color of `NonText` in the colorscheme.
2021-04-18 14:42:33 +01:00
82303f075e Move RST settings together 2021-02-06 11:05:23 +00:00
92a23103e3 Fix vim-tmux-focus-events errors in command-line
When changing focus away and back to vim while in the middle of editing
the command-line, vim-tmux-focus-events emits errors from the function
called by the `:cnoremap` mappings. This patch replaces these mappings
with a call to `do#sink()` which does nothing. Simply removing the
mappings will result in `<F24><F25>` being inserted on the command-line
since tmux will send this text when `tmux set-option -g focus-events
on`, this is why `do#sink()` is needed.
2021-01-27 19:23:13 +00:00
9c64158445 Replace vim-gitgutter with vim-signify
vim-gitgutter is buggy. vim-signify might be better, it does allow
configuration of which events trigger a sign column update and this
patch takes advantage of that. Firstly, the `CursorHold` and
`CursorHoldI` events are disabled and replaced with `InsertLeave` and
`TextChanged` events. This makes the sign column updates immediate, and
since vim-signify is asynchronous it's faster too.
2021-01-26 23:45:49 +00:00
eac02b26d3 Add xterm-kitty to list of supported $TERM values 2021-01-25 21:37:09 +00:00
aaa8acf5a2 Update build#dir() to open a popup_menu()
Use `popup_menu()` in `build#dir()` when the `:BuildDir` command is uses
without an argument to specify a build directory. If there are no build
directories, print an error message. If there is a single build
directory, use it. If there are multiple build directories use
`popup_menu()` to prompt the user to select the desired build directory.

Update `build#targets()` and `build#run()` with comments and error
messages.
2021-01-06 00:23:32 +00:00
c94bc3ba90 Add autoloaded echomsg utility functions
* `echo#warning({message})` sets `echohl WarningMsg` and echos the message
* `echo#error({message})` sets `echohl ErrorMsg` and echos the message
2021-01-06 00:23:19 +00:00
a0df92852a Add :Build command to invoke ninja or make
The `:Build [<target> ...]` command utilises the `$BUILD_DIR` variable set
by `:BuildDir {directory}` to invoke `ninja` or `make` based on the
existence of `$BUILD_DIR/build.ninja` or `$BUILD_DIR/Makefile`
respectively. The following commands are invoked in a new `:terminal`
window.

* `ninja -C $BUILD_DIR [<target> ...]` when `$BUILD_DIR/build.ninja` exists
* `make -C $BUILD_DIR [<target> ...]` when `$BUILD_DIR/Makefile` exists

In the case of `ninja`, completion for the targets supplied to the
`:Build` command is made available by the `build#targets()` function.
The list of targets returned by `ninja -C $BUILD_DIR -t targets` is
processed to generate the list of targets. Support for `make` target
completion is less straight forwards so has been omitted for now.
2021-01-05 21:45:43 +00:00
0cd93f1823 Generalise tmux option check 2020-12-31 18:22:37 +00:00
db2079994a Disable some cmakelint checks in ale
Some of `cmakelint`s opinions around convention don't provide a benefit.
2020-12-14 15:14:24 +00:00
c17f7ea0d9 Refactor tmux and set-clipboard detection
Move logic to `autoload/tmux.vim` to detect the `vim` is being run
inside a `tmux` sessions and if the `set-clipboard` option is enabled.
This cleans up adding the optional `oscyank.vim` plugin when needed.
2020-12-10 18:07:24 +00:00
76acb9cd90 Once again fix minpac initialization 2020-12-10 17:41:17 +00:00
48913e09c3 Fix isdirectory() uses with relative paths
After upgrading VIM 8.2 (2019 Dec 12, compiled Oct 24 2020 16:26:37)
uses of `isdirectory()` with relative paths in `$MYVIMRC` stopped
working. These must now be absolute paths.
2020-12-10 17:38:58 +00:00
e4a11a2ffe Fix package load init order bugs
* Move calls to `minpac#init()` into commands which use minpac
* Check if optional package directories exist before using `packadd`
2020-11-28 17:16:11 +00:00
3cc1e3d2d8 Change some Python highlight groups 2020-10-26 13:33:43 +00:00
6435ed4c4d Add TODO to cpp syntax 2020-10-26 13:33:14 +00:00
d063e60559 Make explicit more implicit (and changed) hl groups 2020-10-26 13:32:47 +00:00
bc1de2d37f Change Markdown default conceallevel 2020-10-07 11:31:08 +01:00
9e6169695d Use the patience diff method 2020-10-07 11:30:48 +01:00
80c1b8653e Highlight Exception group as Conditional 2020-10-07 11:30:08 +01:00
445ca8d6fd Highlight the delimiter group 2020-10-06 17:17:13 +01:00
d960053dfc Add :BuildDir to select YouCompleteMe build directory 2020-10-06 17:12:06 +01:00
b148f9fb68 Make sure CMake statements are highlighted as statements 2020-10-06 17:11:17 +01:00
529867b475 conduit: Don't automatically install/update packs 2020-08-04 13:59:08 +01:00
3449b3f815 Disable automatic hover in YouCompleteMe 2020-07-21 12:01:41 +01:00
67b9c6b45a Check tmux exists before loading osc52 2020-07-19 20:25:29 +01:00
01059ac01a Enable YouCompleteMe on Windows 2020-07-19 20:25:29 +01:00
858677ef79 Add jinja snippets inheriting from html 2020-07-18 13:54:22 +01:00
22b969c989 Add README file 2020-06-04 17:36:18 +01:00
158a6f5585 Don't let vim-matchup overwrite statusline 2020-05-14 12:53:21 +01:00
3ffda34a29 Remove Markdown todo highlights 2020-04-07 13:23:16 +01:00
3e639c4936 Remove extra HTML syntax todo highlights 2020-04-07 13:22:35 +01:00
b40a9abb59 Only load YouCompleteMe when :TermDebug isn't 2020-04-02 12:14:13 +01:00
8fac5fb74f Add OSC 52 escape sequence yank
If the `tmux` `set-clipboard` option is set to `on` add the `osc52yank`
plugin and change `<leader>y` mapping to use it.
2020-04-02 12:12:57 +01:00
72316785d5 Add CMake reStructuredText block snippet 2020-04-02 12:11:46 +01:00
b3a2208b42 Don't gate Python plugins on has('python') 2020-01-28 10:48:28 +00:00
a93489efe9 Add console filetype for Markdown/RST code blocks 2020-01-28 10:48:22 +00:00
489e6db231 Use tip YouCompleteMe from ycm-core org
Update to latest, community maintained, YouCompleteMe version and use
the same version on all platforms.
2020-01-16 23:27:15 +00:00
2bef425dee Enable fzf plugins on Windows 2020-01-14 10:41:49 +00:00
7e79b97933 Add POC sanitizer filetype 2019-12-10 13:28:06 +00:00
aa3ae7df35 Don't use clangd with YouCompleteMe 2019-11-07 20:43:05 +00:00
7fb1352108 Improve C++ template snippet 2019-11-07 20:43:05 +00:00
23b9bf1f1b Limit rst code block highlighting 2019-11-05 16:19:31 +00:00
cdcbab062e Fix Doxygen retval highlights 2019-10-14 22:45:35 +01:00
3bbbbe2a63 Enable reStructuredText style option 2019-10-14 21:49:38 +01:00
b69f2d889d Allow white space in cmake region matches 2019-10-09 16:53:41 +01:00
65d3e645b1 Add cmakecache filetype for CMakeCache.txt files 2019-10-04 20:30:04 +01:00
0d0e69a2ec Add ANTLR filetype syntax 2019-09-08 17:09:59 +01:00
2ee41bb80f Don't use array syntax in C main snippet 2019-09-07 23:41:05 +01:00
57257c1c9a Add generic admonition snippet for rst files 2019-09-05 11:17:25 +01:00
c1d167f2e3 Add rst code-block snippet 2019-08-29 14:58:21 +01:00
92d88b623d Disable airline word-count
When editing `rst` filetypes for longer periods airline started
producing errors when attempting to count the number of words in the
document, so disable this feature.
2019-08-29 14:57:11 +01:00
f85d59197a Add reStructuredText admonition snippets 2019-08-26 15:22:00 +01:00
27c77881a3 Silent call tmux navigation flag functions 2019-08-21 14:57:43 +01:00
28804faf21 Add todo highlights to llvm syntax 2019-08-21 10:08:22 +01:00
e2e2be6e44 Don't syntax highlight text after #{warning,error} 2019-08-17 15:00:27 +01:00
7af8660355 Also set tmux navigation flag on FocusGained
Make using the `@vim$TMUX_PANE` window flag much more robust by
unsetting it every time the zsh prompt is drawn and setting it again
using a `FocusGained` `autocmd` in vim. This removes the need for the
hacky check for zsh in the conditional defined in the `in_vim` variable.
2019-08-16 21:58:38 +01:00
1f07473b57 Use tmux window option for pane change detection
Improve tmux integration when changing buffers or panes when vim was
invoked by another process so that seamless navigation works when the
`vim$TMUX_PANE` window option has been set, not only when the pane's
command matches a simple regex.
2019-08-11 18:58:55 +01:00
10eb5fffea Add TODO highlights to groovy 2019-08-07 15:01:37 +01:00
5f93199735 Improve the list of indent keys for cmake filetype 2019-07-24 13:57:22 +01:00
1e47926465 Don't add conflict marker highlight in help files 2019-07-24 13:57:22 +01:00
6f653e8ad9 Add C comment block snippet 2019-07-14 21:14:43 +01:00
2faa156aae Only add help autocmd's in help buffers 2019-06-10 10:23:34 +01:00
856c66e150 Add :TodoFile command to find TODOs
Find all TODOs in the current file and populate the location list with
the results.
2019-06-05 11:32:59 +01:00
51b95acf90 Improve Python snippets 2019-05-15 11:56:39 +01:00
054507cdff Fix formatting of C/C++ debug snippet 2019-05-03 11:02:05 +01:00
5f7b05aab0 Fix not loading packages from ~/.config/work 2019-05-02 12:01:43 +01:00
bf9276aa1b Customize termdebug highlight groups 2019-04-11 16:11:07 +01:00
ef0f39b780 Make add ! to function PythonIndent 2019-04-05 17:40:07 +01:00
6d2fbc2ac5 Add cmake surround for generator expressions 2019-04-04 17:24:32 +01:00
72fe59ffaa Only invoke last change substitution in help files
Previously the `autocmd` to replace the date on the first line if `Last
change: ` was present resulted in the cursor being moved in non `help`
filetypes due to the substitution failing. Now the substitution is only
attempted if the current file is a `help` file.
2019-04-04 16:53:46 +01:00
bdea77f86a Auto update Last change in vim help files 2019-03-31 23:17:02 +01:00
01b027b5ac Support snippet templates and add help snippets
Add `autocmd` to automatically expand the `_template` snippet on the
`BufNewFile` event, if the expansion fails because the `_template`
snippet does not exist for the current `filetype` undo the changes. Do
the same thing when the `filetype` changes to `help`, since these are
`text` files to begin with the first `autocmd` has no effect.
2019-03-31 15:04:08 +01:00
65c219c98d Add todo.md template 2019-03-30 20:13:28 +00:00
baff9ae3fd Improve global snippets
* `todo`, `note` now do not add comment strings when in a comment line
* `fixme` added to match `todo` and `note
* `date` renamed `datetime` and updated to match the unix `date` command
* `date`, `time` added inserting only the date or time now
* `utc` updated, no longer spitting the timezone offset
2019-03-30 17:07:29 +00:00
9d6a9925e5 Copy default GetPythonIndent 2019-03-28 20:58:39 +00:00
ab0b81b6de Remove .env/.out filetype detection 2019-03-27 14:51:57 +00:00
3576ca02fe Update fresh DiffChange fg color to yellow 2019-03-27 10:23:01 +00:00
91c85da67b Add C ANSI color escape sequence snippets 2019-03-27 10:01:55 +00:00
e9051dc246 Override default Python indent settings 2019-03-23 23:40:17 +00:00
84e310a28f Fix Python 3 issue in todo snippet 2019-03-23 23:15:13 +00:00
ce6ec3d410 Improve vim function snippet 2019-03-23 21:06:45 +00:00
f730d382bc Highlight *.ronn as markdown 2019-03-17 16:03:33 +00:00
c8ac5496ca Add Python raw string snippet 2019-03-17 14:56:25 +00:00
74c73066f4 Escape ¯\_(ツ)_/¯ snippet except in text documents 2019-03-08 15:48:54 +00:00
aff61cd8a8 Change *x snippet to mark the checkbox checked 2019-02-27 09:40:42 +00:00
709408fdeb Add lit global ID regex snippet 2019-02-27 09:40:34 +00:00
d0ce0a66ad Add more flexible lit regex snippets 2019-02-26 16:19:22 +00:00
b493ad17e5 Make minpac commands have consistent format 2019-02-21 11:47:23 +00:00
d555afe61e Move minpac command into plugin/commands.vim 2019-02-21 11:46:28 +00:00
65a6178bec Add ansi filetype for handling escape sequences
Based on [AnsiEsc.vim](https://github.com/vim-scripts/AnsiEsc.vim)
separate out the syntax highlighting into a separate `ansi` filetype.
This conceals escape sequences and highlights ansi color escape
sequences in text files so that they have the same appearance as in the
terminal.
2019-02-16 09:51:38 +00:00
8a10516961 Extend syntax/llvm.vim for better highlighting 2018-12-13 16:19:46 +00:00
e3886d08f8 Only install fzf as a plugin, not the cli tool 2018-12-13 16:18:58 +00:00
eab3090da7 Add termdebug window selection mappings 2018-12-13 16:13:12 +00:00
5f4e6c7636 Remove bundle/* from ignore file 2018-12-03 11:49:29 +00:00
bdb9504aec Use selected YouCompleteMe repo 2018-12-03 11:44:41 +00:00
97904dd47e Add shrug and tableflip snippets 2018-12-03 11:39:51 +00:00
34ba64980a Change main C snippet to an array of const char* 2018-12-03 11:39:51 +00:00
8fc26f9227 Add python highlight blocks to gdbinit syntax 2018-12-03 11:39:51 +00:00
51621e8134 Remove vim-plug and use minpac
* Add `Pack`, `PackUpdate`, `PackStatus` and `PackClean` commands to
  manage plugins.
* Don't load `minpac` by default.
* Remove `vim-plug` completely.
2018-11-30 19:41:21 +00:00
971d510f22 Add pack/* to ignore file 2018-11-30 17:49:07 +00:00
3a60c0abcf Improve static_assert snippet & increase sync minlines 2018-11-30 17:46:46 +00:00
446063c2e3 Add sizeof, decltype, and declval snippets 2018-11-30 17:46:46 +00:00
91dc036e8f Open *.def has cpp filetype 2018-10-25 19:06:00 +01:00
d3a8920bf7 Set viminfofile to ~/.cache/vim/info 2018-10-19 12:01:03 +01:00
61599e0b05 Disable experimental C++ syntax highlighting 2018-10-05 17:59:15 +01:00
64c8bc6b40 Use upstream YouCompleteMe on macOS
The oblitum fork of YouCompleteMe is getting dated and uses LLVM 4.0 on
macOS, this results in erroneous errors in the system headers on macOS
since it's not been updated to match upstream. Use Valloric's repo to
avoid these errors on macOS.
2018-10-04 10:20:02 +01:00
c326a04f70 Don't use normal mode mappings in vimscript 2018-09-14 16:37:14 +01:00
992096a2a0 Add :Debug command
The :Debug command quickly starts a new debugging sessions.

* adds the `termdebug` package
* invokes `TermdebugCommand` with the given arguments
2018-09-14 16:17:09 +01:00
2414a94684 Update llvm syntax file 2018-09-12 16:05:52 +01:00
c80ddd3617 Add mapping to rename include guards in c/cpp 2018-09-07 22:13:29 +01:00
25c18763bc Move ale highlight groups to fresh colorscheme 2018-09-05 19:08:19 +01:00
53c971b802 Use vim-coiled-snake instead of custom Python fold 2018-09-03 22:16:40 +01:00
6fb2f7a01c Remove cursorline option 2018-08-30 23:37:28 +01:00
6c818dd2d7 Remove duplicate Doxygen snippets 2018-08-28 11:11:56 +01:00
e745c6ebdf Improve C/C++ intent settings 2018-08-28 11:10:40 +01:00
5f7ba84ce6 Don't highlight cursor line 2018-08-26 19:14:59 +01:00
531502633f Add ~/.config/work to runtimepath
Enable using work specific config from a separate repository.
2018-08-26 13:25:37 +01:00
c714c43e65 Update ignore file 2018-08-26 12:50:18 +01:00
9d850aa457 Add linters to conduit file 2018-08-26 12:01:42 +01:00
825b947de6 Fix switch case statement indentation 2018-08-26 11:49:11 +01:00
c019ce9d67 Use default tabstop width 2018-08-26 11:48:55 +01:00
c9ae77e5a2 Open .enter and .exit as zsh filetype 2018-08-26 11:25:41 +01:00
9cf385ee95 Add conduit file 2018-08-26 11:25:03 +01:00
72dec6009d Change backgroup highlight of cursor line 2018-08-26 10:51:11 +01:00
10fd48a703 Improve cpp template snippet 2018-08-26 10:51:11 +01:00
3777a990f2 Show cursor line with different highlight group 2018-08-26 10:51:11 +01:00
f7d07f23da Add TODO's for :LStripLines 2018-08-26 10:51:11 +01:00
eabffa9354 Add new C++ feature to syntax highlighting 2018-08-26 10:51:11 +01:00
6cc8627c97 Add a lit named ID match snippet 2018-08-26 10:51:11 +01:00
3757da8e96 Improve vim-spirv ID match highlights 2018-08-26 10:51:11 +01:00
91eeee13bc Add delimiter highlighting to zsh 2018-08-26 10:51:11 +01:00
0db9d470ee Use signcolumn when available 2018-08-26 10:51:11 +01:00
970c674381 Set lit[.local].cfg to Python & disable ALE 2018-08-26 10:51:11 +01:00
1be7ef4250 Don't highlight markdown errors 2018-08-26 10:51:11 +01:00
ab5428e7fa Make .test files llvm filetype 2018-08-26 10:51:11 +01:00
ca84ee59ed Actually enable relative number when available 2018-08-26 10:51:11 +01:00
456e52467a Update C++ namespace snippet to match clang-format
New snippet outputs this

```cpp
namespace {
}  // namespace
```

instead of

```cpp
namespace {
}  // anonymous
```

and this

```cpp
namespace foo {
}  // namespace foo
```

instead of

```cpp
namespace foo {
}  // foo
```
2018-08-26 10:51:11 +01:00
e7c20a3cc5 Add vim-projectionist plugin 2018-08-26 10:51:11 +01:00
7ace086458 Don't match non conflict markers 2018-08-26 10:51:11 +01:00
5391645629 Use own fork for vim-cmake-completion 2018-08-26 10:51:11 +01:00
fe197a4c76 Add conflict marker highlights as TODO's
For all filetype's highlight conflict markers with the Todo highlight
group and leave trailing text as before. This makes conflict markers
very obvious, in C/C++ where I have operator highlighting conflict
markers are not longer highlighted as operators.
2018-08-26 10:51:11 +01:00
5380ea7c78 Remove relativenumber autocmds
These kept disabling relativenumber when editing which was annoying.
2018-08-26 10:51:11 +01:00
1c114b7135 Improve Jenkins groovy syntax highlights 2018-08-26 10:51:11 +01:00
2c842cea09 Add Doxygen @retval snippet & other improvements 2018-08-26 10:51:11 +01:00
83114d25a9 Add extern "C" block snippet 2018-08-26 10:51:11 +01:00
287e52fb2a Add bool to C string snippet 2018-08-26 10:51:11 +01:00
f4915efffd Add string_view c++ printf snippet 2018-08-26 10:51:11 +01:00
1d3d06bf0d Cleanup vim dictionary syntax 2018-08-26 10:51:11 +01:00
d225180985 Change netrw highlight group 2018-08-26 10:51:11 +01:00
3f36156521 Always load vim-cmake-syntax
Avoid the cmake syntax highlighting being different when a file is
loaded and when it is reloaded. This was cause by the plugin not being
enabled until after a buffer with the cmake filetype was loaded
causing the builtin cmake syntax highlighting to show on initial load
then the plugins syntax highlighting to show on reload.
2018-08-26 10:51:11 +01:00
a2c59d8ca3 Add the linter code to ale messages 2018-08-26 10:51:11 +01:00
02370ce6e7 Add TODO for Python syntax folding bug 2018-08-26 10:51:11 +01:00
0fe8e5dfed Add improved sentence text object 2018-08-26 10:51:11 +01:00
d13bf0bd81 Disable airline git integration 2018-08-26 10:51:11 +01:00
b3ba84fa4c Replace matchit.vim with vim-matchup 2018-08-26 10:51:11 +01:00
bc014309ef Remove vim-sensible
vim-sensible includes and old matchit.vim which interfears with
vim-matchup and sets some defaults which are then overridden in
plugins/settings.vim. Remove vim-sensible and document the retained
settings.
2018-08-26 10:51:11 +01:00
0416a42e08 Support changing cursor shape for iTerm2 in tmux 2018-08-26 10:51:11 +01:00
ec0ad0ae00 Add another variant of GitHub checkbox snip 2018-08-26 10:51:11 +01:00
f75b723ec6 Add make filetype config 2018-08-26 10:51:11 +01:00
ce97e935a8 Add more intuitive GitHub checkbox snippet 2018-08-26 10:51:11 +01:00
3dedbaf1c4 Set commentstring for OpenCL files 2018-08-26 10:51:11 +01:00
6b6b44e43d Clean up documentation 2018-08-26 10:51:11 +01:00
eebe101050 Fix vim cursor shape after tmux terminal-overrides 2018-08-26 10:51:11 +01:00
d8ad04297b Use tmux terminal-override for cursor shape on VTE 2018-08-26 10:51:11 +01:00
47bc7f0eb3 Use 4 space tabs in YAML files 2018-08-26 10:51:11 +01:00
d4239e2dc3 Add more Doxygen snippets for C/C++ 2018-08-26 10:51:09 +01:00
87d78f9c7a Move relevant settings closer together 2018-08-26 10:50:08 +01:00
1db9ea30ee Enable cursor shape changes by default 2018-08-26 10:50:08 +01:00
4c2d9b8089 Add do#cursor_escape_sequences()
Control the cursor shape based on the current mode.
2018-08-26 10:50:08 +01:00
603ed76994 Move mouse setting 2018-08-26 10:50:08 +01:00
b46d172e02 Extend enabled listchars, enable showbreak 2018-08-26 10:50:08 +01:00
1ace437587 Guard relativenumber setting 2018-08-26 10:50:08 +01:00
e32c6824f6 Remove cruft and add TODO's 2018-08-26 10:50:08 +01:00
4040dc7508 Move rarely used functions to autoload 2018-08-26 10:50:08 +01:00
e292b937d0 Enable visual highlight of trail spaces and tabs 2018-08-26 10:50:08 +01:00
e049445284 Remove autocmd to right string white space 2018-08-26 10:50:08 +01:00
d494a0f543 Add highlight group for SpecialKey 2018-08-26 10:50:08 +01:00
5f2c083d7b Fix Markdown fenced code block snippet 2018-08-26 10:50:08 +01:00
b059c48b2f Add groovy syntax support for keyword args 2018-08-26 10:50:08 +01:00
07c093e9e0 Add python snippet to insert ipdb breakpoint 2018-08-26 10:50:08 +01:00
08f3f8d38f Add CMake debug snippet 2018-08-26 10:50:08 +01:00
0f852b0518 Add fprintf debug snippet for C/C++ files 2018-08-26 10:50:08 +01:00
2dea77ba81 Add asciidoc refpage snippet 2018-08-26 10:50:08 +01:00
946c5bc252 Enable spelling for asciidoc filetype 2018-08-26 10:50:08 +01:00
981cb46c7c Add :ISort vim command 2018-08-26 10:50:08 +01:00
c2799dd5de Add vim command snippet 2018-08-26 10:50:08 +01:00
0e419ee514 Add .env/.out filetype autocmds 2018-08-26 10:50:08 +01:00
aecdb9a11a Add augroup vim snippet 2018-08-26 10:50:08 +01:00
e8a6098bd6 Update gitconfig filetype to use tabstop=8 2018-08-26 10:50:08 +01:00
f9115f0495 Remove lexima because it broke vim-endwise
Also change to fork of vim-endwise with CMake support
2018-08-26 10:50:08 +01:00
3b528fcb19 Only match = default when ends on word boundary 2018-08-26 10:50:08 +01:00
ac0f5b0b93 Add GitGutter next/prev hunk mappings 2018-08-26 10:50:07 +01:00
67257ebb98 Use global setting for Python highlights 2018-08-26 10:50:07 +01:00
5f08372d83 Obey cpp options in c syntax file 2018-08-26 10:50:07 +01:00
4f232a0f2d Add cpp explicit function template highlight 2018-08-26 10:50:07 +01:00
e032ced9f4 Add more vim colorschemes 2018-08-26 10:50:07 +01:00
bd2301e3e8 Add main Python snippet 2018-08-26 10:50:07 +01:00
87d9693973 Add mapping for :Ag <cword> 2018-08-26 10:50:07 +01:00
3dd8259c01 Add missing zsh option keyword to vim syntax 2018-08-26 10:50:07 +01:00
b5f51c0542 Add function folding to zsh filetype 2018-08-26 10:50:07 +01:00
c4dcb5668d Make fresh colors less garish
Make SpellBad and Underlined readable and make SpellCap purple.
2018-08-26 10:50:07 +01:00
f90b63d30d Add % and . to llvm iskeyword list 2018-08-26 10:50:07 +01:00
fbba77dede Use default tab width in markdown
Also check if +syntax is available before enabling spell.
2018-08-26 10:50:07 +01:00
c2040731f2 Add zsh snippets 2018-08-26 10:50:07 +01:00
60664eaa16 Add std::printf and std::fprintf snippets 2018-08-26 10:50:07 +01:00
ccc214436c Improve groovy syntax highlighting 2018-08-26 10:50:07 +01:00
7f63041695 Enable folding is sh filetype 2018-08-26 10:50:07 +01:00
939e5e0599 Don't set global settings in ftplugin 2018-08-26 10:50:07 +01:00
be47e8ec7b Update vim-plug 2018-08-26 10:50:07 +01:00
c953ae7dbf Fix vint warning and errors in functions.vim 2018-08-26 10:50:07 +01:00
384a4dc236 Update mappings to {i,n,v}noremap 2018-08-26 10:50:07 +01:00
0d66f1acec Use existing windows/tabs when jumping to errors 2018-08-26 10:50:07 +01:00
c28e93210e Check features are available before using them 2018-08-26 10:50:07 +01:00
df48f1f607 Add syntax folding for cmake 2018-08-26 10:50:07 +01:00
7df1cb7b26 Document indent options & check they exist 2018-08-26 10:50:07 +01:00
22a36a177a Add vim-khr plugin 2018-08-26 10:50:07 +01:00
c3bca15641 Add comment text object plugin 2018-08-26 10:50:07 +01:00
06633f3394 Add ; to do/while snippet 2018-08-26 10:50:07 +01:00
e2be2de00b Use setlocal in TabWidth command 2018-08-26 10:50:07 +01:00
f6892126df Add URI text object plugin 2018-08-26 10:50:07 +01:00
c727e7647a Allow C++ lambda snippet to be inline 2018-08-26 10:50:07 +01:00
919c3e6b88 Tweet json filetype & syntax settings 2018-08-26 10:50:07 +01:00
aac31f7831 Add preview window mappings 2018-08-26 10:50:07 +01:00
12755c630b Add C inline comment surround mapping 2018-08-26 10:50:07 +01:00
13acc08b4f Fix vint warnings in vimrc 2018-08-26 10:50:07 +01:00
b0c7eafb4a Use '' not "" in fresh colorscheme 2018-08-26 10:50:07 +01:00
090ffcbcc8 Override groovy syntax 2018-08-26 10:50:07 +01:00
a2c1476bba Enable clang-tidy ale checker 2018-08-26 10:50:07 +01:00
dcea5ede4a Revert to default json syntax 2018-08-26 10:50:07 +01:00
bef689ae13 Improve ale echo message 2018-08-26 10:50:07 +01:00
cea38efd76 Make YCM goto buffer command split horizontally 2018-08-26 10:50:07 +01:00
07764831ba Remove dev hack for format.vim loading 2018-08-26 10:50:07 +01:00
607157b004 Load local plugins first 2018-08-26 10:50:07 +01:00
4038e95d4f Replace syntastic with ale 2018-08-26 10:50:07 +01:00
eeca17ad49 Add LLVM IR syntax 2018-08-26 10:50:07 +01:00
62380deefc Move plugins to .vim/bundle 2018-08-26 10:50:07 +01:00
5651bb8b03 Simplify xterm256-color detection 2018-08-26 10:50:07 +01:00
f19f507833 Add missing <CR> from :lfirst mapping 2018-08-26 10:50:07 +01:00
b5772a3821 Change markdown comment string to html 2018-08-26 10:50:07 +01:00
53b0bfb646 Conceal on cursor hover normal mode for markdown 2018-08-26 10:50:07 +01:00
6736b8d8a3 Improve doxygen header snippet 2018-08-26 10:50:05 +01:00
e48cd16f23 Remove vim-instant-markdown 2018-08-26 10:49:14 +01:00
c6d13d85f6 Enable folding in xml 2018-08-26 10:49:14 +01:00
d02030b9af Improve fzf mappings 2018-08-26 10:49:14 +01:00
504b7f110f Namespace syntax match 2018-08-26 10:49:14 +01:00
e635d62e0c Change relativenumber behaviour 2018-08-26 10:49:14 +01:00
8355c9e571 Match operator on word boundary only 2018-08-26 10:49:14 +01:00
a8c012881a Update vim TERM checks 2018-08-26 10:49:14 +01:00
1059eb7259 Increase syntax syn minlines to 500 2018-08-26 10:49:14 +01:00
03de858c9b Only flip relativenumber for cpp files 2018-08-26 10:49:14 +01:00
ab8e113145 Enabling folding in javascript files 2018-08-26 10:49:14 +01:00
8185da77a6 Add vim Caddyfile syntax 2018-08-26 10:49:14 +01:00
27110ff0ea Change markdown fenced code block snippet trigger 2018-08-26 10:49:14 +01:00
53782a0213 Add markdown frontmatter snippet 2018-08-26 10:49:14 +01:00
b6ae985dd2 Add markdown link snippet 2018-08-26 10:49:14 +01:00
c513b908dc Add utc date time snippet 2018-08-26 10:49:14 +01:00
6cd3e58b14 Make json syntax embed aware 2018-08-26 10:49:14 +01:00
b27cee4756 Change div snippet, add nav snippet for html 2018-08-26 10:49:14 +01:00
5f5ecde607 Extend html, css, and javascript syntaxes 2018-08-26 10:49:14 +01:00
c0a2bb9bb2 Add yaml frontmatter support to markdown 2018-08-26 10:49:14 +01:00
f851feb40d Add javascript function snippet 2018-08-26 10:49:14 +01:00
a97e9a4589 Fix C ternary operator match 2018-08-26 10:49:14 +01:00
5076be4792 Customize json syntax highlights 2018-08-26 10:49:14 +01:00
54ce7c0767 More cleanup let statements 2018-08-26 10:49:14 +01:00
9c5b193efd Swap autopairs.vim for leima.vim 2018-08-26 10:49:14 +01:00
0ac64c7215 Change setting leader 2018-08-26 10:49:14 +01:00
3651e021a5 Cleanup C/C++ syntax files 2018-08-26 10:49:14 +01:00
a8a1666ff0 Improve markdown GitHub checkbox highlights 2018-08-26 10:49:14 +01:00
ff6d949028 Fix cpp syntax match 2018-08-26 10:49:14 +01:00
a9ad1f0543 Fix end of multi-line doxygen highlight 2018-08-26 10:49:14 +01:00
567b93b256 Enable Doxygen mapping only for c, cpp filetypes 2018-08-26 10:49:14 +01:00
bd7dcb738f Add :Syntack command to view syntax group stack 2018-08-26 10:49:14 +01:00
9fbe25fee7 Add function to clone highlight groups with attrs 2018-08-26 10:49:14 +01:00
dda5ee4e8b Change name of checkbox toggle functionality 2018-08-26 10:49:14 +01:00
41aa424a57 Simplify fold text 2018-08-26 10:49:14 +01:00
80f6215530 Remap <C-L> to <C-W>L to get redraw back 2018-08-26 10:49:14 +01:00
3d43c5460c Refactor and optimize C/C++ syntax highlights 2018-08-26 10:49:14 +01:00
ddc24d7fda Change show highlight mapping to use <leader> 2018-08-26 10:49:14 +01:00
4ac2924f7b Improve GitHub checkbox highlighting 2018-08-26 10:49:14 +01:00
e8af28bc59 Set all.snippets to -1 priority 2018-08-26 10:49:14 +01:00
1a2f732259 Add std::enable_if snippet 2018-08-26 10:49:14 +01:00
927889ce74 Remove macro_mode functions, use vim-replace 2018-08-26 10:49:14 +01:00
a78356bdb4 Add vim-endwise 2018-08-26 10:49:14 +01:00
dd257d069d Add doxygen @see snippet 2018-08-26 10:49:13 +01:00
d730b5b7d9 Default to a space in * [ ] snippet 2018-08-26 10:48:16 +01:00
239ffea954 Move json highlight overrides to after/syntax 2018-08-26 10:48:16 +01:00
b0b66de642 Add vim replay plugin for easy macro replay 2018-08-26 10:48:16 +01:00
ee1b482762 Improve doxygen markdown highlighting 2018-08-26 10:48:16 +01:00
7623fc8706 Improve YouCompleteMe/syntastic error/warning symbols 2018-08-26 10:48:16 +01:00
f6302d03bd Move .local_plugins.vim to .vim/local.vim 2018-08-26 10:48:16 +01:00
9e1b0c9ddd Add vim-spirv plugin 2018-08-26 10:48:16 +01:00
80b16bfb41 Replace vim-notes with note.vim 2018-08-26 10:48:16 +01:00
98708c1ee4 Add vim colorscheme morning-white for presentations 2018-08-26 10:48:16 +01:00
6b0bb3e128 Update syntastic URL 2018-08-26 10:48:16 +01:00
4e8d2294f7 Make sign column color match number column 2018-08-26 10:48:16 +01:00
804c05e3e1 Improve some CMake snippets 2018-08-26 10:48:16 +01:00
93c8302e99 Add vim-gitgutter plugin 2018-08-26 10:48:16 +01:00
2c0d66ffe1 Add CMake generator expression snippet 2018-08-26 10:48:16 +01:00
54a85a5911 Improve GitHub markdown checkbox snippet 2018-08-26 10:48:16 +01:00
d0019fdc0d Improve C++ namespace snippet 2018-08-26 10:48:16 +01:00
7c9b97ef82 Improve Doxygen snippets 2018-08-26 10:48:14 +01:00
11b71bc1e0 De-noise c pre-processor snippets 2018-08-26 10:46:20 +01:00
23b7aeb64d Add asciidoc filetype plugin 2018-08-26 10:45:25 +01:00
bcd7877df0 Add TODO surround mapping for C/C++ 2018-08-26 10:45:25 +01:00
e4a8ba61b1 Improve XML attribute snippet, add XML comment snippet 2018-08-26 10:45:25 +01:00
4297e753eb Add todo's to investigate interesting vim settings 2018-08-26 10:45:25 +01:00
9a07c179fa Improve support for GitHub style checkboxes 2018-08-26 10:45:25 +01:00
4a9d8df177 Add highlighting of ternary operator in C/C++ 2018-08-26 10:45:25 +01:00
20ca44e2ff Add GitHub check box to markdown syntax 2018-08-26 10:45:25 +01:00
d9374ba8ac Add Google Test snippets 2018-08-26 10:45:25 +01:00
d1fc400a90 Move doxygen snippets to separate file 2018-08-26 10:45:20 +01:00
dab43be08c Add noisy struct snippet 2018-08-26 10:42:42 +01:00
c63b47517d Change diff highlight groups 2018-08-26 10:42:42 +01:00
cc04761f21 Add googletest snippets 2018-08-26 10:42:42 +01:00
aaf73e3988 Allow C++ casts to be substring 2018-08-26 10:42:42 +01:00
b2f9c43e6a Change template snippet to use class not typename 2018-08-26 10:42:42 +01:00
277210751c Improve C main snippet 2018-08-26 10:42:42 +01:00
1c08e92063 Improve C++ for loop snippet 2018-08-26 10:42:42 +01:00
4af3c4acd5 Improve doxygen param snippet at brief snippet 2018-08-26 10:42:42 +01:00
b297bb2491 Update todo snippet 2018-08-26 10:42:42 +01:00
69b97dc3d8 Add static_assert snippet 2018-08-26 10:42:41 +01:00
ce1d85c7b4 Add macro mode helpers
* Easily {un}map <CR> to @@
* Add macro_mode#{en,dis}able autoload functions
* Add MacroMode{En,Dis}able commands
2018-08-26 10:42:41 +01:00
4fafc13487 Switch to vim-table-mode from Tabular 2018-08-26 10:42:41 +01:00
d67e7cd062 Use <Space> in mappings instead of exec 2018-08-26 10:42:41 +01:00
1c9dae7b20 Add comprehensive mappings for QuickFix and Location lists 2018-08-26 10:42:41 +01:00
48d3f26a8a Move mapping into mappings.vim 2018-08-26 10:42:41 +01:00
fc9af59d2b Add statement highlight for = delete in C/C++ 2018-08-26 10:42:41 +01:00
ca656087ed Fix bug in Doxygen highlighting 2018-08-26 10:42:41 +01:00
e9ef5c3138 Add image link snippet for markdown 2018-08-26 10:42:41 +01:00
f5afcc4cc2 Change highlight group of nested name specifiers 2018-08-26 10:42:41 +01:00
d080f003d4 Highlight new/delete as operators 2018-08-26 10:42:41 +01:00
f86447e378 Conditionally enable plugins on Windows 2018-08-26 10:42:41 +01:00
f68769accf Add ignore file 2018-08-26 10:42:41 +01:00
0aa63ffb34 Improve C Doxygen highlights 2018-08-26 10:42:41 +01:00
659bcc73e8 Disabled annoying airline features 2018-08-26 10:42:41 +01:00
7202a5c6a9 Don't show mode in command line 2018-08-26 10:42:41 +01:00
48e53ccd0c Fix Python tab error highlighting 2018-08-26 10:42:41 +01:00
2a159c8f5b Swap <C-f>c from :Commits to :Colors 2018-08-26 10:42:41 +01:00
4adb4d22fe Use K for YouCompleteMe GetDoc in C/C++ files 2018-08-26 10:42:41 +01:00
d3ee7b2c73 Document weird behaviour in gitcommit files 2018-08-26 10:42:41 +01:00
c7eea18cf4 Override groovy syntax file 2018-08-26 10:42:41 +01:00
4180ce4d69 Change Folded foreground highlight 2018-08-26 10:42:41 +01:00
99f64f8a47 Add support for folding python blocks in vim files 2018-08-26 10:42:41 +01:00
6c95bd94ee Move notes highlight overrides to ftplugin 2018-08-26 10:42:41 +01:00
7bfa6da603 Add custom fold functions for json 2018-08-26 10:42:41 +01:00
5dda38ebeb Remove {{{ markers }}} from vimrc 2018-08-26 10:42:41 +01:00
972cc60236 Remove vim-flake8 plugin 2018-08-26 10:42:41 +01:00
8b29d0bebb Rename options.vim to settings.vim 2018-08-26 10:42:41 +01:00
6156a95cc4 Reorder fileformats 2018-08-26 10:42:41 +01:00
baac442996 Remove groovy.vim plugin 2018-08-26 10:42:41 +01:00
4bb91a7cb2 Only load vim-cmake-completion for cmake files 2018-08-26 10:42:41 +01:00
641d3a514a Improve custom vim fold expression 2018-08-26 10:42:41 +01:00
e5b886be58 Improve Python folding behaviour 2018-08-26 10:42:41 +01:00
d6fafcf4c2 Simplify C/C++ {} matching 2018-08-26 10:42:41 +01:00
39d8230c75 Improve DiffText highlight color 2018-08-26 10:42:41 +01:00
a4f997c1e1 Rename option to enable Doxygen comment highlights 2018-08-26 10:42:41 +01:00
657a029acc Enable folding {} in C/C++ & delimiter highlights 2018-08-26 10:42:41 +01:00
0bc30ad5c9 Extend groovy syntax with Jenkins DSL tweeks 2018-08-26 10:42:41 +01:00
2c2ed3c099 Improve markdown folding & syntax highlights 2018-08-26 10:42:41 +01:00
042b8fb304 Simplify C param snippet 2018-08-26 10:42:41 +01:00
b8bd9729d7 Escape - cOperator match 2018-08-26 10:42:41 +01:00
e4cd16ff5b Specialize << and >> highlight matches 2018-08-26 10:42:41 +01:00
d04bb01d16 Add ? to C operator highlighting 2018-08-26 10:42:41 +01:00
8ed09b1597 Add C++ lambda function snippet 2018-08-26 10:42:41 +01:00
ce0402522c Add alignas, alignof, decltype to cppOperator group 2018-08-26 10:42:41 +01:00
d4102cb636 Update fresh colorscheme 2018-08-26 10:42:41 +01:00
a7630ace55 Improve C/C++ syntax highlighting 2018-08-26 10:42:41 +01:00
b1af2d0eff Refactor C/C++ snippets 2018-08-26 10:42:41 +01:00
8fb6507c1c Add C++ cast snippets 2018-08-26 10:42:41 +01:00
02520a6a20 Simplify C++ class snippet 2018-08-26 10:42:41 +01:00
68bf0a0618 Add date snippet to display Month DD, YYYY 2018-08-26 10:42:39 +01:00
3079e450bf Update me snippet to include nickname 2018-08-26 10:40:44 +01:00
47b8b5861b Add improved additional C++ syntax highlighting 2018-08-26 10:40:44 +01:00
b5c24ed587 Remove plugin vim-native-syntax 2018-08-26 10:40:44 +01:00
d54535c639 User nicer blue for Vim Type highlight group 2018-08-26 10:40:44 +01:00
e09f187c82 Make it easier to repeat vim macros 2018-08-26 10:40:44 +01:00
265c851f37 Remove autocmd from custom surround variables 2018-08-26 10:40:44 +01:00
eb3550a197 Add vim-surround cmake mapping to make a variable 2018-08-26 10:40:44 +01:00
ad59766ace Change vim leader key to space 2018-08-26 10:40:44 +01:00
20e4ab57e5 Change surround mapping for creating markdown link 2018-08-26 10:40:44 +01:00
5299184d0b Enable tmux mouse support & add open, urlview 2018-08-26 10:40:44 +01:00
48306a25ed Add K mapping for Python docs 2018-08-26 10:40:44 +01:00
9c4caee646 Customise vim-surround for markdown link syntax 2018-08-26 10:40:44 +01:00
edce545a0e Load local vim plugins from non git file 2018-08-26 10:40:44 +01:00
b4ef88d28c Add syntastic vim plugin 2018-08-26 10:40:44 +01:00
c742b7281f Remove some markers after adding vim foldexpr 2018-08-26 10:40:44 +01:00
a32264fcd8 Improve the vim fold text, line content first 2018-08-26 10:40:44 +01:00
8eb08c17a6 Improve vim script fold with custom foldexpr 2018-08-26 10:40:44 +01:00
61e47dac00 Make K mapping no remap for vim script 2018-08-26 10:40:44 +01:00
af4e0ecd8a Add vim-jdaddy json plugin 2018-08-26 10:40:44 +01:00
2eeab947c8 Optionally load ~/Sandbox/format.vim if available 2018-08-26 10:40:44 +01:00
bcea0d1ffd Improve gitcommit ftplugin settings 2018-08-26 10:40:44 +01:00
d713dd4619 Remove ftdetect/python.vim due to wrong location 2018-08-26 10:40:44 +01:00
4e38d2f43f Remove <tab> from YouCompleteMe menu mappings 2018-08-26 10:40:44 +01:00
ebc5941b52 Improve vmap 0 to play nice with comments 2018-08-26 10:40:44 +01:00
2d90a55ddd Move fzf mappings to plugin/mappings.vim 2018-08-26 10:40:44 +01:00
e26b13c742 Restructure vim config 2018-08-26 10:40:44 +01:00
5465bef85d Remove clang-format.py script 2018-08-26 10:40:44 +01:00
3a63738fa1 Move vim color settings to .vim/plugin/color.vim 2018-08-26 10:40:44 +01:00
c57679dbb7 Move vim GUI options to .vim/gvimrc 2018-08-26 10:40:44 +01:00
5b2a04a499 Change <C-f>l to use :BLines 2018-08-26 10:40:44 +01:00
5b27fcdbb1 Move .vimrc to .vim/vimrc split platform detection 2018-08-26 10:40:44 +01:00
8bde17924c Fix xml snippet for api generator 2018-08-26 10:40:44 +01:00
6a27676b8c Rename and move GitHub style checkboxes snippet 2018-08-26 10:40:44 +01:00
e31952ea5d Update vim WarningMsg highlight group 2018-08-26 10:40:44 +01:00
a72bd9b03e Add get vim function snippet 2018-08-26 10:40:44 +01:00
e233973f4c Add me snippet for my name and email address 2018-08-26 10:40:44 +01:00
46aa25f6be Add vim normal mode filetype mapping K opens help 2018-08-26 10:40:44 +01:00
77735726d9 Add noexpandtag for tags filetype 2018-08-26 10:40:44 +01:00
e8f642dfc0 Add vim-flake8 & don't use textwidth=80 in Python 2018-08-26 10:40:44 +01:00
af6705736c Add vim if snippet 2018-08-26 10:40:44 +01:00
c77fbe9b59 Don't expand tabs in gitconfig files 2018-08-26 10:40:44 +01:00
318de00d36 Add snippet for vim function 2018-08-26 10:40:44 +01:00
b03ff98e4d Improve TODO and NOTE snippets when in comments 2018-08-26 10:40:44 +01:00
02de482df9 Add Error and Question highlights to fresh.vim 2018-08-26 10:40:44 +01:00
3cbbe22ac6 Disable open on left and scroll off for help 2018-08-26 10:40:44 +01:00
60621989e1 Update fresh.vim 2018-08-26 10:40:44 +01:00
91e4ae9983 Add GitHub markdown checklist snippet 2018-08-26 10:40:44 +01:00
b0210e4f5c Add API snippets 2018-08-26 10:40:44 +01:00
4cf7ce0d32 Update vim-plug 2018-08-26 10:40:44 +01:00
e7b011c367 Final tweak vim-airline theme 2018-08-26 10:40:44 +01:00
1a43d6e810 Tweak colors for vim-airline fresh theme 2018-08-26 10:40:44 +01:00
cfec8fd3e6 Add StatusLine & WildMenu highlights 2018-08-26 10:40:44 +01:00
e3ba637473 Add fresh vim-airline theme 2018-08-26 10:40:44 +01:00
9ed2d9cc48 Improve vim python filetype settings 2018-08-26 10:40:44 +01:00
cdd1a8d959 Tweek vim gitcommit settings 2018-08-26 10:40:44 +01:00
be94e9f9db Add more snippets 2018-08-26 10:40:44 +01:00
9ff37a4055 Add generic TODO snippet using commentstring 2018-08-26 10:40:34 +01:00
437476694c Add vim mappings around yapf python formatter 2018-08-26 10:36:10 +01:00
6363c75535 Add python formatting options 2018-08-26 10:36:10 +01:00
e4c2c59a63 Add TODO snippet for CMake 2018-08-26 10:36:10 +01:00
1d80cbb679 Simplify .vimrc layout & folds 2018-08-26 10:36:10 +01:00
277de97a36 Move vim autocommands into ftdetect or ftplugin 2018-08-26 10:36:10 +01:00
3b1d816705 Add vim-plug script & update .vimrc 2018-08-26 10:36:10 +01:00
19aa697862 Remove Vundle submodule 2018-08-26 10:36:10 +01:00
f57e1a9fb7 Complete CMake snippets targeting version 3.0 2018-08-26 10:36:10 +01:00
5a72231b97 Add remaining CMake string() snippets 2018-08-26 10:36:10 +01:00
947a20746b Add more CMake snippets 2018-08-26 10:36:10 +01:00
bef1581105 Add more CMake snippets 2018-08-26 10:36:10 +01:00
371432423e Make TODO and NOTE C snippets more general 2018-08-26 10:36:10 +01:00
837fd5cef3 Updates to fresh.vim colorscheme 2018-08-26 10:36:10 +01:00
9d0a0f85f7 Add UltiSnips snippets 2018-08-26 10:36:05 +01:00
92 changed files with 2554 additions and 2906 deletions

5
.gitignore vendored
View File

@@ -1,2 +1,5 @@
local.vim
.netrwhist .netrwhist
plugs/* pack/*
spell/*
*.pyc

186
README.md Normal file
View File

@@ -0,0 +1,186 @@
# Vim Configuration
## Plugins
### [YouCompleteMe][ycm]
The plugin is cloned to `~/.vim/pack/minpac/opt/YouCompleteMe` recursively using
[minpac][minpac]. Making the plugin optional can be useful when completion is
not desired and for fast Vim loading times, when completion is desired it can be
loaded with Vim command:
```console
$ :packadd YouCompleteMe
```
Post clone the compiled C++ components must be built before completion can be
used, run the following command from the root of the [YouCompleteMe][ycm]
repository:
```console
$ ./install --clang-completer
```
This uses the older `libclang.so` based completer despite [YouCompleteMe][ycm]
recommending the use of `clangd` due to working on projects which predate the
newer completer and the migration overhead of switching to it. To completely
disable the `clangd` completer this must also be present in `~/.vim/vimrc`:
```vim
let g:ycm_use_clangd = 0
```
The following two options are for customising bindings for cycling through the
completion menu when multiple completions are available.
* [g:ycm_key_list_select_completion](https://github.com/ycm-core/YouCompleteMe#the-gycm_key_list_select_completion-option)
* [g:ycm_key_list_previous_completion](https://github.com/ycm-core/YouCompleteMe#the-gycm_key_list_previous_completion-option)
```vim
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
```
The next options enable populating the list of potential completions beyond
those suggested by the semantic language completer.
* [g:ycm_collect_identifiers_from_comments_and_strings](https://github.com/ycm-core/YouCompleteMe#the-gycm_collect_identifiers_from_comments_and_strings-option)
* [g:ycm_seed_identifiers_with_syntax](https://github.com/ycm-core/YouCompleteMe#the-gycm_seed_identifiers_with_syntax-option)
```vim
let g:ycm_collect_identifiers_from_comments_and_strings = 1
let g:ycm_seed_identifiers_with_syntax = 1
```
These options enable completions inside comments and strings.
* [g:ycm_complete_in_comments](https://github.com/ycm-core/YouCompleteMe#the-gycm_complete_in_comments-option)
* [g:ycm_complete_in_strings](https://github.com/ycm-core/YouCompleteMe#the-gycm_complete_in_strings-option)
```vim
let g:ycm_complete_in_comments = 1
let g:ycm_complete_in_strings = 1
```
Trigger the completion menu after entering a single character.
* [g:ycm_min_num_of_chars_for_completion](https://github.com/ycm-core/YouCompleteMe#the-gycm_min_num_of_chars_for_completion-option)
```vim
let g:ycm_min_num_of_chars_for_completion = 1
```
Populating the location list with warnings and errors in the current buffer is
very useful for jumping to those source locations, especially when using
[mappings][location-list-mappings].
* [g:ycm_always_populate_location_list](https://github.com/ycm-core/YouCompleteMe#the-gycm_always_populate_location_list-option)
```vim
let g:ycm_always_populate_location_list = 1
```
When a completion is selected the signature, and help comments if there is any
available, are displayed in a separate buffer. This option enables
automatically closing that buffer.
* [g:ycm_autoclose_preview_window_after_insertion](https://github.com/ycm-core/YouCompleteMe#the-gycm_autoclose_preview_window_after_insertion-option)
```vim
let g:ycm_autoclose_preview_window_after_insertion = 1
```
Control how a split is created when using the `:YcmCompleter Goto` command.
* [g:ycm_goto_buffer_command](https://github.com/ycm-core/YouCompleteMe#the-gycm_goto_buffer_command-option)
```vim
let g:ycm_goto_buffer_command = 'horizontal-split'
```
Warnings and errors are displayed in the Vim gutter, to the left of line
numbers, these override the default characters used to display them.
* [g:ycm_error_symbol](https://github.com/ycm-core/YouCompleteMe#the-gycm_error_symbol-option)
* [g:ycm_warning_symbol](https://github.com/ycm-core/YouCompleteMe#the-gycm_warning_symbol-option)
```vim
let g:ycm_error_symbol = '▸'
let g:ycm_warning_symbol = '▸'
```
## Mappings
### [YouCompleteMe][ycm] Mappings
Apply the compilers suggestion to fix a warning or error.
```vim
nnoremap <leader>fi :YcmCompleter FixIt<CR>
```
Go to the declaration of the symbol under the cursor.
```vim
nnoremap <leader>gd :YcmCompleter GoTo<CR>
```
Get the type of the symbol under the cursor.
```vim
nnoremap <leader>gt :YcmCompleter GetType<CR>
```
Display the full compiler diagnostic output for the warning or error on the
line under the cursor.
```vim
nnoremap <leader>sd :YcmShowDetailedDiagnostic<CR>
```
### Location List Mappings
Open the location list buffer.
```vim
nnoremap <leader>lo :lopen<CR>
```
Close the location list buffer.
```vim
nnoremap <leader>lc :lclose<CR>
```
Jump to the current location in the location list.
```vim
nnoremap <leader>ll :ll<CR>
```
Jump to the next location in the location list.
```vim
nnoremap <leader>ln :lnext<CR>
```
Jump to the previous location in the location list.
```vim
nnoremap <leader>lp :lprevious<CR>
```
Jump to the first location in the location list.
```vim
nnoremap <leader>lf :lfirst<CR>
```
Jump to the last location in the location list.
```vim
nnoremap <leader>la :llast<CR>
```
[ycm]: https://github.com/ycm-core/YouCompleteMe
[minpac]: https://github.com/k-takata/minpac

View File

@@ -5,78 +5,89 @@ Kenneth Benzie (Benie) <k.benzie83@gmail.com>
endsnippet endsnippet
global !p global !p
comment=vim.current.buffer.options['commentstring'].strip() class Comment(object):
def __init__(self):
# Get the commentstring.
commentstring = snip.opt('&commentstring').strip()
# Slipt it into before and after parts.
commentparts = [part.strip() for part in commentstring.split('%s')]
self.commentbefore = commentparts[0] + ' '
self.commentafter = ' ' + commentparts[1] if commentparts[1] else ''
# Determine if we are in an existing comment.
line = vim.current.buffer[vim.current.window.cursor[0] - 1].strip()
# If interpolation has not occcured and the current line starts with the
# comment leader, we are in a comment.
self.incomment = not snip.c and line.startswith(commentparts[0])
def commentbefore(): def before(self):
commentbefore = comment[0:comment.find('%s')].strip() return '' if self.incomment else self.commentbefore
row, col = vim.current.window.cursor
row -= 1
col -= 1
line = vim.current.buffer[row]
if (col - 1) >= 0 and commentbefore == line[col - 1:len(commentbefore)]:
return ''
return commentbefore + ' '
def commentafter(): def after(self):
after=comment[comment.find('%s')+2:].strip() return '' if self.incomment else self.commentafter
if 0 < len(after): endglobal
return ' ' + after
return ''
import datetime snippet todo "TODO commment"
import time `!p comment=Comment()
snip.rv=comment.before()`TODO${1/.+/(/}$1${1/.+/)/}: $0`!p snip.rv=comment.after()`
endsnippet
def date(): snippet fixme "FIXME comment"
return datetime.datetime.now().strftime('%B %d, %Y') `!p comment=Comment()
snip.rv=comment.before()`FIXME${1/.+/(/}$1${1/.+/)/}: $0`!p snip.rv=comment.after()`
endsnippet
class LocalTZ(datetime.tzinfo): snippet note "NOTE comment"
`!p comment=Comment()
snip.rv=comment.before()`NOTE: $0`!p snip.rv=comment.after()`
endsnippet
global !p
from datetime import datetime, timedelta, tzinfo
from time import daylight, gmtime, localtime, timezone, tzname
class LocalTZ(tzinfo):
"""Query OS for local timezone offset.""" """Query OS for local timezone offset."""
def __init__(self): def __init__(self):
"""Initialize LocalTZ.""" """Initialize LocalTZ."""
datetime.tzinfo.__init__(self) tzinfo.__init__(self)
self._unixEpochOrdinal = datetime.datetime.utcfromtimestamp( self.unixEpochOrdinal = datetime.utcfromtimestamp(
0).toordinal() 0).toordinal()
def dst(self, _): def dst(self, _):
return datetime.timedelta(0) return timedelta(0)
def utcoffset(self, dt): def utcoffset(self, dt):
t = ((dt.toordinal() - self._unixEpochOrdinal) * 86400 + dt.hour * 3600 t = ((dt.toordinal() - self.unixEpochOrdinal) * 86400 + dt.hour * 3600
+ dt.second + time.timezone) + dt.second + timezone)
utc = datetime.datetime(*time.gmtime(t)[:6]) utc = datetime(*gmtime(t)[:6])
local = datetime.datetime(*time.localtime(t)[:6]) local = datetime(*localtime(t)[:6])
return local - utc return local - utc
def utc(): def tzname(self, dt):
value = datetime.datetime.strftime( if daylight and localtime().tm_isdst:
datetime.datetime.now(LocalTZ()), '%Y-%m-%dT%H:%M:%S%z') return tzname[daylight]
return '%s:%s' % (value[:-2], value[-2:]) return tzname[0]
endglobal endglobal
snippet date "Today's date" snippet date "date now"
`!p snip.rv=date()` `!p snip.rv=datetime.now().strftime('%a %d %b %Y')`
endsnippet
snippet time "time now"
`!p snip.rv=datetime.now().strftime('%H:%M:%S')`
endsnippet
snippet datetime "date and time now"
`!p snip.rv=datetime.now(LocalTZ()).strftime('%a %d %b %Y %H:%M:%S %Z')`
endsnippet endsnippet
snippet utc "UTC date time now" i snippet utc "UTC date time now" i
`!p snip.rv=utc()` `!p snip.rv=datetime.now(LocalTZ()).strftime('%Y-%m-%dT%H:%M:%S%z')`
endsnippet
snippet codeplay "Codeplay Software Ltd. copywrite"
`!p snip.rv=commentbefore()`Copyright (C) Codeplay Software Limited. All Rights Reserved.`!p snip.rv=commentafter()`
$0
endsnippet
snippet todo "TODO commment"
`!p snip.rv=commentbefore()`TODO${1/.+/(/}$1${1/.+/)/}: $0`!p snip.rv=commentafter()`
endsnippet
snippet note "NOTE comment"
`!p snip.rv=commentbefore()`NOTE: $0`!p snip.rv=commentafter()`
endsnippet endsnippet
snippet *x "GitHub style checkbox" snippet *x "GitHub style checkbox"
* [${1: }] $0 * [${1:x}] $0
endsnippet endsnippet
snippet "* [" "GitHub style checkbox" snippet "* [" "GitHub style checkbox"
@@ -87,6 +98,10 @@ snippet *[ "GitHub style checkbox"
* [${1: }] $0 * [${1: }] $0
endsnippet endsnippet
snippet [[ "lit named ID match" i snippet shrug "¯\\_(ツ)_/¯" i
[[${1:name}:%[a-zA-Z0-9]+]] ¯\_(ツ)_/¯
endsnippet
snippet tableflip "(╯°▪°)╯︵┻━┻" i
(╯°▪°)╯︵┻━┻
endsnippet endsnippet

View File

@@ -4,3 +4,7 @@ snippet refpage "Vulkan Spec refpage"
$0 $0
endsnippet endsnippet
snippet shrug "¯\_(ツ)_/¯" i
¯\_(ツ)_/¯
endsnippet

View File

@@ -11,6 +11,15 @@ def complete(t, opts):
return '(' + '|'.join(opts) + ')' return '(' + '|'.join(opts) + ')'
endglobal endglobal
snippet /* "comment block"
/* $0
*/
endsnippet
snippet sizeof "sizeof" i
sizeof($1)$0
endsnippet
snippet i8 "int8_t" i snippet i8 "int8_t" i
int8_t int8_t
endsnippet endsnippet
@@ -153,7 +162,7 @@ default: {
endsnippet endsnippet
snippet main "Main function stub" snippet main "Main function stub"
int main(${1:int argc, char **argv}) { int main(${1:int argc, const char** argv}) {
$0 $0
} }
endsnippet endsnippet

59
UltiSnips/c_ansi.snippets Normal file
View File

@@ -0,0 +1,59 @@
snippet esc "ANSI escape sequence" i
\x1b$1m
endsnippet
snippet black "ANSI escape black" i
\x1b[0;30m
endsnippet
snippet red "ANSI escape red" i
\x1b[0;31m
endsnippet
snippet green "ANSI escape green" i
\x1b[0;32m
endsnippet
snippet yellow "ANSI escape yellow" i
\x1b[0;33m
endsnippet
snippet blue "ANSI escape blue" i
\x1b[0;34m
endsnippet
snippet magenta "ANSI escape magenta" i
\x1b[0;35m
endsnippet
snippet cyan "ANSI escape cyan" i
\x1b[0;36m
endsnippet
snippet bblack "ANSI escape bright black" i
\x1b[0;30m
endsnippet
snippet bred "ANSI escape bright red" i
\x1b[0;31m
endsnippet
snippet bgreen "ANSI escape bright green" i
\x1b[0;32m
endsnippet
snippet byellow "ANSI escape bright yellow" i
\x1b[0;33m
endsnippet
snippet bblue "ANSI escape bright blue" i
\x1b[0;34m
endsnippet
snippet bmagenta "ANSI escape bright magenta" i
\x1b[0;35m
endsnippet
snippet reset "ANSI escape reset" i
\x1b[0m
endsnippet

View File

@@ -27,6 +27,10 @@ snippet "/// n" "Doxygen note block"
/// @note $0 /// @note $0
endsnippet endsnippet
snippet copydoc "Doxygen copydoc block"
/// @copydoc $0
endsnippet
snippet "/// s" "Doxygen see block" snippet "/// s" "Doxygen see block"
/// @see $0 /// @see $0
endsnippet endsnippet

View File

@@ -9,6 +9,12 @@ def complete(t, opts):
return '|'.join(opts) return '|'.join(opts)
endglobal endglobal
snippet rst
#[=======================================================================[.rst:
$0
#]=======================================================================]
endsnippet
snippet add_compile_options snippet add_compile_options
add_compile_options($1) add_compile_options($1)
endsnippet endsnippet

View File

@@ -32,7 +32,7 @@ class ${1:name} {
endsnippet endsnippet
snippet template "Template" snippet template "Template"
template <class ${1:T}$2>$0 template <${1:class} ${2:T}$3>$0
endsnippet endsnippet
snippet namespace "Named or anonymous namespace" snippet namespace "Named or anonymous namespace"
@@ -62,7 +62,15 @@ snippet [] "Labmda function" i
endsnippet endsnippet
snippet static_assert "Static assert" snippet static_assert "Static assert"
static_assert($1, "$2"); static_assert($1${2:, "$3"});
endsnippet
snippet decltype "decltype" i
decltype($1)$0
endsnippet
snippet declval "declval" i
declval<$1>()$0
endsnippet endsnippet
snippet noisy "A noise class" snippet noisy "A noise class"

1
UltiSnips/glsl.snippets Normal file
View File

@@ -0,0 +1 @@
extends lit

24
UltiSnips/help.snippets Normal file
View File

@@ -0,0 +1,24 @@
snippet _template "help file template"
*`!p snip.rv = snip.fn`* For Vim version 8.0 Last change: `!p
from datetime import datetime
snip.rv = datetime.now().strftime('%B %d, %Y')`
$0
vim:tw=78:ts=8:ft=help:norl:
endsnippet
snippet s "help section"
==============================================================================
${1:1}. ${2:Section}`!p
spaces = 78 - len(t[1]) - len(snip.basename) - (2 * len(t[2])) - 3
snip.rv = spaces * ' ' + '*' + snip.basename + '-' + t[2].lower() + '*'`
$0
endsnippet
snippet d "help detail"
`!p spaces = 78 - len(t[1])
snip.rv = spaces * ' '`*${1:}*
$0
endsnippet

3
UltiSnips/jinja.snippets Normal file
View File

@@ -0,0 +1,3 @@
extends html
priority 1

15
UltiSnips/lit.snippets Normal file
View File

@@ -0,0 +1,15 @@
snippet [[ "lit named regex" i
[[${1:name}${2::${3:regex}}]]
endsnippet
snippet {{ "lit regex" i
{{${1:regex}}}
endsnippet
snippet gid "lit global ID regex" i
@[a-zA-Z0-9_]+
endsnippet
snippet id "lit ID regex" i
%[a-zA-Z0-9_]+
endsnippet

1
UltiSnips/llvm.snippets Normal file
View File

@@ -0,0 +1 @@
extends lit

View File

@@ -17,3 +17,7 @@ snippet --- "frontmatter" b
$0 $0
--- ---
endsnippet endsnippet
snippet shrug "¯\_(ツ)_/¯" i
¯\_(ツ)_/¯
endsnippet

View File

@@ -1,3 +1,7 @@
snippet * "bullet point" b snippet * "bullet point" b
* $0 * $0
endsnippet endsnippet
snippet shrug "¯\_(ツ)_/¯" i
¯\_(ツ)_/¯
endsnippet

View File

@@ -0,0 +1 @@
extends lit

View File

@@ -1,24 +1,28 @@
snippet main "Python main stub" snippet #! "Shebang"
#!/usr/bin/env python #!/usr/bin/env python
"""${1:docstring}""" endsnippet
snippet main "Python main stub"
from argparse import ArgumentParser from argparse import ArgumentParser
def main(): def main():
"""Main entry point.""" parser = ArgumentParser()
parser = ArgumentParser(description='${2:description}') $0
parser.add_argument('${3:argument}') args = parser.parse_args()
args = parser.parse_args()$0
if __name__ == '__main__': if __name__ == '__main__':
try: try:
main() main()
except KeyboardInterrupt: except KeyboardInterrupt:
pass exit(130)
endsnippet endsnippet
snippet debug "Set ipdb breakpoint" snippet debug "Set ipdb breakpoint"
import ipdb; ipdb.set_trace() import ipdb; ipdb.set_trace()
endsnippet endsnippet
snippet ''' "Triple quote string" i
'''$1'''$0
endsnippet

61
UltiSnips/rst.snippets Normal file
View File

@@ -0,0 +1,61 @@
snippet admon "generic admonition"
.. admonition:: ${1:title}
$0
endsnippet
snippet todo "todo admonition"
.. todo::
$0
endsnippet
snippet attention "attention admonition"
.. attention::
$0
endsnippet
snippet caution "caution admonition"
.. caution::
$0
endsnippet
snippet danger "danger admonition"
.. danger::
$0
endsnippet
snippet error "error admonition"
.. error::
$0
endsnippet
snippet hint "hint admonition"
.. hint::
$0
endsnippet
snippet important "important admonition"
.. important::
$0
endsnippet
snippet note "note admonition"
.. note::
$0
endsnippet
snippet tip "tip admonition"
.. tip::
$0
endsnippet
snippet warning "warning admonition"
.. warning::
$0
endsnippet
snippet code "code-block"
.. code-block:: ${1:lang}
$0
endsnippet

1
UltiSnips/spirv.snippets Normal file
View File

@@ -0,0 +1 @@
extends lit

3
UltiSnips/text.snippets Normal file
View File

@@ -0,0 +1,3 @@
snippet shrug "¯\_(ツ)_/¯" i
¯\_(ツ)_/¯
endsnippet

View File

@@ -3,7 +3,7 @@ command! $1${2:cmd} ${3:rep}$0
endsnippet endsnippet
snippet function "VIM function" snippet function "VIM function"
function! ${1:name}($2) function! ${1:name}($2) ${3:abort}
$0 $0
endfunction endfunction
endsnippet endsnippet

2
after/ftdetect/cpp.vim Normal file
View File

@@ -0,0 +1,2 @@
" Force *.def to C++ filetype for LLVM
au BufNewFile,BufReadPost *.def set filetype=cpp

View File

@@ -1,2 +1,3 @@
" Force *.md to markdown filetype " Force *.md to markdown filetype
au BufNewFile,BufReadPost *.md set filetype=markdown au BufNewFile,BufReadPost *.md set filetype=markdown
au BufNewFile,BufReadPost *.ronn set filetype=markdown

2
after/ftdetect/zsh.vim Normal file
View File

@@ -0,0 +1,2 @@
au BufNewFile,BufReadPost .enter set filetype=zsh
au BufNewFile,BufReadPost .exit set filetype=zsh

View File

@@ -1,18 +1,15 @@
" Surround visual block in #if 0 block " Add Doxygen documentation generation plugin.
packadd DoxygenToolkit.vim
nnoremap <leader>d :Dox<CR>
" Surround visual block in #if 0 block.
vmap 0 V'<[ ki#if 0<Esc>'>o#endif<Esc> vmap 0 V'<[ ki#if 0<Esc>'>o#endif<Esc>
" Set 'comments' to format dashed lists in comments. " Set 'comments' to format dashed lists in comments.
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
" Set 'commentstring' to single line comment style. " Set 'commentstring' to single line comment style.
setlocal commentstring=//%s setlocal commentstring=//%s
" Stop automatic new lines which typing long single liners " Stop automatic new lines which typing long single liners.
setlocal textwidth=0 setlocal textwidth=0
" Map K to get YouCompleteMe documentation
nnoremap K :YcmCompleter GetDoc<CR>
" "ys{motion}t" turns "word" -> "TODO(word):" " "ys{motion}t" turns "word" -> "TODO(word):"
let b:surround_{char2nr("t")} = "TODO(\r):" let b:surround_{char2nr("t")} = "TODO(\r):"
" "ys{motion}/" turns "text" into "/*text*/" " "ys{motion}/" turns "text" into "/*text*/"
let b:surround_{char2nr("/")} = "/*\r*/" let b:surround_{char2nr("/")} = "/*\r*/"
" Map K to get YouCompleteMe documentation
nnoremap K :YcmCompleter GetDoc<CR>
" DoxygenToolkit
nnoremap <leader>d :Dox<CR>

View File

@@ -3,6 +3,13 @@ setlocal foldmethod=syntax
" Set comment string " Set comment string
setlocal commentstring=#%s setlocal commentstring=#%s
" setlocal indentkeys=0{,0},:,0#,!^F,o,O,e,=ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(
setlocal indentkeys=:,!^F,o,O,e,=endif(,=ENDIF(,endforeach(,ENDFOREACH(,endmacro(,ENDMACRO(,else(,ELSE(,elseif(,ELSEIF(,endwhile(,ENDWHILE(
" Custon surround for creating a CMake variable from a text object. " Custon surround for creating a CMake variable from a text object.
" "ys{motion}v" makes a variable out of "<text-obj>" - > "${<text-obj>}" " "ys{motion}v" makes a variable out of "text-obj" -> "${text-obj}"
let b:surround_{char2nr("v")} = "${\r}" let b:surround_{char2nr("v")} = "${\r}"
" Custom surround for createing a CMake generator expression from a test object.
" "ys{motion}g" makes a generator expression out of "text-obj" -> "$<text-obj>"
let b:surround_{char2nr("g")} = "$<\r>"

View File

@@ -1,4 +1,3 @@
" Map K to get YouCompleteMe documentation " Add Doxygen documentation generation plugin.
nnoremap K :YcmCompleter GetDoc<CR> packadd DoxygenToolkit.vim
" DoxygenToolkit
nnoremap <leader>d :Dox<CR> nnoremap <leader>d :Dox<CR>

View File

@@ -5,4 +5,4 @@ setlocal nospell
setlocal scrolloff=0 setlocal scrolloff=0
" Don't display line numbers " Don't display line numbers
setlocal nonumber norelativenumber setlocal nonumber norelativenumber signcolumn=no

2
after/ftplugin/man.vim Normal file
View File

@@ -0,0 +1,2 @@
setlocal showbreak=
set signcolumn=no

View File

@@ -25,54 +25,3 @@ setlocal encoding=utf-8
" Set up file format " Set up file format
setlocal fileformat=unix setlocal fileformat=unix
let g:python_highlight_all=1 let g:python_highlight_all=1
" Mappings
nnoremap K :YcmCompleter GetDoc<CR>
" Set custom fold expression
setlocal foldmethod=expr
setlocal foldexpr=PythonFold(v:lnum)
" Custom fold function greedyily matches following blank lines
function! PythonFold(lnum)
let l:line = getline(a:lnum)
" TODO: Folding breaks around method decorators:
" class Class(object):
" @property
" def method(self):
" pass
" Blank lines, comments, and docstrings use previous fold level
if l:line =~ '^\(\s*\|#.*\|"\(""\)\=.*\)$'
return '='
" Keywords beginning indented blocks start a fold
elseif l:line =~ '^\s*class\s\+\w*(\w*)\s*:\s*$'
\ || l:line =~ '^\s*def\s\+\w\+\s*(.*)\s*:\s*$'
\ || l:line =~ '^\s*if\s\+.*:\s*$'
\ || l:line =~ '^\s*elif\s\+.*:\s*$'
\ || l:line =~ '^\s*else\s*:\s*$'
\ || l:line =~ '^\s*for\s\+.*:\s*$'
\ || l:line =~ '^\s*while\s\+.*:\s*$'
\ || l:line =~ '^\s*try\s*:\s*$'
\ || l:line =~ '^\s*except\s*.*:\s*$'
return '>'.string((indent(a:lnum) / &shiftwidth) + 1)
" Opening curly braces, not in a string, add a fold level
elseif l:line =~ '{' && l:line !~ '}' && l:line !~ "'.*{.*'" && l:line !~ '".*{.*"'
return 'a1'
" Closing curly braces, not in a string, substract a fold level
elseif l:line =~ '}' && l:line !~ '{' && l:line !~ "'.*}.*'" && l:line !~ '".*}.*"'
return 's1'
" Opening square braces, not in a string, add a fold level
elseif l:line =~ '[' && l:line !~ ']' && l:line !~ "'.*[.*'" && l:line !~ '".*].*"'
return 'a1'
" Closing square braces, not in a string, substract a fold level
elseif l:line =~ ']' && l:line !~ '[' && l:line !~ "'.*].*'" && l:line !~ '".*[.*"'
return 's1'
" Calculate lines with a lower indent than the previous line
elseif indent(a:lnum) < indent(a:lnum - 1)
return string((indent(a:lnum) / &shiftwidth))
endif
" Finally all unmatched lines use fold level from previous line
return '='
endfunction

View File

@@ -1,5 +1,5 @@
" Mapping for Vim help of the word under cursor. " Add omnifunc completion package.
nnoremap K :help <C-r><C-w><CR> packadd vimomni
" Set custom fold expression " Set custom fold expression
setlocal foldmethod=expr setlocal foldmethod=expr

View File

@@ -1,6 +1,5 @@
" Tabs " Tabs
set expandtab set expandtab
set tabstop=2
set shiftwidth=2 set shiftwidth=2
set softtabstop=2 set softtabstop=2
@@ -18,7 +17,7 @@ if has('cindent')
" * g1 - indent scope declarations {public,private,protected} 1 space " * g1 - indent scope declarations {public,private,protected} 1 space
" * h1 - indent statements after scope declarations 1 space more " * h1 - indent statements after scope declarations 1 space more
" * l1 - indent case statement scopes with the case label " * l1 - indent case statement scopes with the case label
" * (0 - don't indent inside unclosed parenthesis " * (0,W4 - indent inside unclosed parenthesis
" * i4 - indent C++ class base declarations and constructor initializers " * i2 - indent C++ class base declarations and constructor initializers
set cinoptions=N-sE-sg1h1l(01i4 set cinoptions=N-sE-sg1h1l1(0,W4i2
endif endif

View File

@@ -0,0 +1,8 @@
if get(g:, 'loaded_tmux_focus_events', 0)
" Override vim-tmux-focue-events command-line mappings when tmux send <F24>
" FocusLost and <F25> FocusLost instead of to call do#sink() which does
" nothing. This is required due to errors emitted from the
" vim-tmux-focus-events plugin when chaning focus.
cnoremap <silent> <F24> <C-\>edo#sink()<CR>
cnoremap <silent> <F25> <C-\>edo#sink()<CR>
endif

View File

@@ -1,6 +1,9 @@
" Language: C " Language: C
" Description: Additional C syntax file. " Description: Additional C syntax file.
" Don't syntax highlight text after #warning or #error
syn region cPreProc start="^\s*\zs\(%:\|#\)\s*\(warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend
if !exists('c_no_function') && !exists('cpp_no_function') if !exists('c_no_function') && !exists('cpp_no_function')
" Match function expressions: expr() " Match function expressions: expr()
" ^^^^ " ^^^^
@@ -40,9 +43,9 @@ if exists('g:c_doxygen') && g:c_doxygen
" Match: comment leader " Match: comment leader
syn match cDoxygenLeader '^\s*\/\/\/' contained display syn match cDoxygenLeader '^\s*\/\/\/' contained display
" Match: @param name description. " Match: @param name description. @retval name description.
" ^^^^ " ^^^^ ^^^^
syn region cDoxygenSpecial matchgroup=cDoxygenComment start='@param\(\[\(\|in\|out\|in,out\)\]\)\=\s\+' end='\(\s\|$\)' contained display syn region cDoxygenSpecial matchgroup=cDoxygenComment start='@\(param\(\[\(\|in\|out\|in,out\)\]\)\?\|retval\)\=\s\+' end='\(\s\|$\)' contained display
" Match: @tparam name description. " Match: @tparam name description.
" ^^^^ " ^^^^

View File

@@ -1,6 +1,8 @@
" Transparent regions to enable syntax based folding. " Transparent regions to enable syntax based folding.
syntax region cmakeIfBlock start='if(.*)' end='endif(.*)' fold transparent keepend syntax region cmakeIfBlock start='if\s*(.*)' end='endif\s*(.*)' fold transparent keepend
syntax region cmakeFunctionBlock start='function(.*)' end='endfunction(.*)' fold transparent keepend syntax region cmakeFunctionBlock start='function\s*(.*)' end='endfunction\s*(.*)' fold transparent keepend
syntax region cmakeMacroBlock start='macro(.*)' end='endmacro(.*)' fold transparent keepend syntax region cmakeMacroBlock start='macro\s*(.*)' end='endmacro\s*(.*)' fold transparent keepend
syntax region cmakeForeachBlock start='foreach(.*)' end='endforeach(.*)' fold transparent keepend syntax region cmakeForeachBlock start='foreach\s*(.*)' end='endforeach\s*(.*)' fold transparent keepend
syntax region cmakeWhileBlock start='while(.*)' end='endwhile(.*)' fold transparent keepend syntax region cmakeWhileBlock start='while\s*(.*)' end='endwhile\s*(.*)' fold transparent keepend
highlight link cmakeStatement Statement

6
after/syntax/gdb.vim Normal file
View File

@@ -0,0 +1,6 @@
unlet b:current_syntax
syntax include @gdbPythonSyntax syntax/python.vim
syntax region gdbPythonBlock matchgroup=gdbStatement start='^python' keepend end='^end' contains=@gdbPythonSyntax
let b:current_syntax = 'gdb'

View File

@@ -1,4 +0,0 @@
syn keyword htmlTodo TODO
syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=htmlTodo,@htmlPreProc,@Spell
hi default link htmlTodo Todo

View File

@@ -1,3 +1,4 @@
hi link jsonKeyword Function hi link jsonKeyword Function
hi link jsonNull Constant hi link jsonNull Constant
hi link jsonQuote Delimiter hi link jsonQuote Delimiter
setlocal conceallevel=0

29
after/syntax/llvm.vim Normal file
View File

@@ -0,0 +1,29 @@
" Highlight: %"constant string"
" ^----------------^
syntax region llvmIdentifier start=+%"+ end=+"+ oneline
" Highlight: { ... }
" ^ ^
syntax region llvmScope matchgroup=llvmDelimiter start="{" end="}" transparent
" Highlight: ( ... )
" ^ ^
syntax region llvmScope matchgroup=llvmDelimiter start="(" end=")" transparent
" Highlight: < ... x ... >
" ^ ^ ^
syntax match llvmVectorDelimiter " \zsx\ze " contained
syntax region llvmScope matchgroup=llvmDelimiter start="<" end=">" transparent oneline contains=llvmDelimiter,llvmVectorDelimiter,llvmType,llvmNumber,llvmFloat,llvmBoolean,llvmConstant
syntax match llvmDelimiter ","
" Named metadata and specialized metadata keywords.
syn match llvmMetadata /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*$/
syn match llvmMetadata /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*[=!]/
" syn match llvmType /!\zs\a\+\ze\s*(/
syn match llvmMetadata /!\(\d\+\>\|\ze{\|\ze\".*"\)/
" Define extended highlight groups
highlight default link llvmDelimiter Delimiter
highlight default link llvmVectorDelimiter llvmDelimiter
highlight default link llvmMetadata Include

View File

@@ -13,9 +13,12 @@ syn match markdownCheckboxDelimiter '\[[ x]\]' contained contains=markdownCheckb
syn match markdownCheckbox '\s*\* \[[ x]\] ' contains=markdownCheckboxDelimiter,markdownListMarker syn match markdownCheckbox '\s*\* \[[ x]\] ' contains=markdownCheckboxDelimiter,markdownListMarker
syn region markdownCheckboxDone start='\s*\* \ze\[x\] ' keepend end='\ze\(\n^\s*\*\|\n^\s*\n\)' contains=markdownCheckbox,@markdownCheckboxDoneInline syn region markdownCheckboxDone start='\s*\* \ze\[x\] ' keepend end='\ze\(\n^\s*\*\|\n^\s*\n\)' contains=markdownCheckbox,@markdownCheckboxDoneInline
if has('conceal') && get(g:, 'markdown_syntax_conceal', 1) == 1 if has('conceal')
setlocal conceallevel=0
if get(g:, 'markdown_syntax_conceal', 1) == 1
let s:concealends = ' concealends' let s:concealends = ' concealends'
endif endif
endif
exe 'syn region markdownCheckboxItalic matchgroup=markdownCheckboxItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart,@Spell contained' . s:concealends exe 'syn region markdownCheckboxItalic matchgroup=markdownCheckboxItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart,@Spell contained' . s:concealends
exe 'syn region markdownCheckboxItalic matchgroup=markdownCheckboxItalicDelimiter start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart,@Spell contained' . s:concealends exe 'syn region markdownCheckboxItalic matchgroup=markdownCheckboxItalicDelimiter start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart,@Spell contained' . s:concealends
exe 'syn region markdownCheckboxBold matchgroup=markdownCheckboxBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic,@Spell contained' . s:concealends exe 'syn region markdownCheckboxBold matchgroup=markdownCheckboxBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic,@Spell contained' . s:concealends
@@ -44,13 +47,6 @@ hi link markdownCheckboxBoldItalicDelimiter markdownCheckboxBoldItalic
hi link markdownCheckboxCode SpecialComment hi link markdownCheckboxCode SpecialComment
hi link markdownCheckboxCodeDelimiter PreProc hi link markdownCheckboxCodeDelimiter PreProc
" Add match for TODO
syn match markdownTodo 'TODO'
hi link markdownTodo Todo
syn cluster markdownInline add=markdownTodo
" yaml frontmatter " yaml frontmatter
syn region markdownFrontmatter matchgroup=markdownFrontmatterDelimiter start='\%^---' keepend end='^---' contains=@markdownHighlightyaml syn region markdownFrontmatter matchgroup=markdownFrontmatterDelimiter start='\%^---' keepend end='^---' contains=@markdownHighlightyaml
hi default link markdownFrontmatterDelimiter Special hi default link markdownFrontmatterDelimiter Special

2
after/syntax/python.vim Normal file
View File

@@ -0,0 +1,2 @@
highlight link pythonException Conditional
highlight link pythonExceptions Keyword

7
after/syntax/yaml.vim Normal file
View File

@@ -0,0 +1,7 @@
setlocal tabstop=2
setlocal shiftwidth=2
setlocal softtabstop=2
highlight link yamlBlockMappingKey Keyword
highlight link yamlAnchor PreProc
highlight link yamlAlias PreProc

View File

@@ -1,73 +0,0 @@
" fresh palette
let g:airline#themes#fresh#palette = {}
" NORMAL mode
let s:N1 = ['#005f00', '#afdf00', 22, 148, '']
let s:N2 = ['#ffffff', '#005f00', 15, 22, '']
let s:N3 = ['#ffffff', '#121212', 15, 233, 'bold']
let s:W = ['#000000', '#8700df', 232, 92, '']
let s:E = ['#000000', '#990000', 232, 160]
let g:airline#themes#fresh#palette.normal =
\ airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#fresh#palette.normal.airline_warning = s:W
let g:airline#themes#fresh#palette.normal.airline_error = s:E
let g:airline#themes#fresh#palette.normal_modified = {
\ 'airline_c': ['#ffffff', '#5f0087', 15, 53, 'bold'], }
" INSERT mode
let s:I1 = ['#0000df', '#00dfff', 20, 45, '']
let s:I2 = ['#ffffff', '#005fdf', 15, 26, '']
let s:I3 = ['#ffffff', '#121212', 15, 233, 'bold']
let g:airline#themes#fresh#palette.insert =
\ airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#fresh#palette.insert.airline_warning = s:W
let g:airline#themes#fresh#palette.insert.airline_error = s:E
let g:airline#themes#fresh#palette.insert_modified =
\ g:airline#themes#fresh#palette.normal_modified
let g:airline#themes#fresh#palette.insert_paste = {
\ 'airline_a': [s:I1[0], '#ffff00', s:I1[2], 11, ''], }
" REPLACE mode
let s:R1 = [s:I2[0], '#af0000', s:I2[2], 124, '']
let s:R2 = ['#ffffff', '#5f0000', 15, 52, '']
let s:R3 = ['#ffffff', '#121212', 15, 233, 'bold']
let g:airline#themes#fresh#palette.replace =
\ airline#themes#generate_color_map(s:R1, s:R2, s:R3)
let g:airline#themes#fresh#palette.replace.airline_warning = s:W
let g:airline#themes#fresh#palette.replace.airline_error = s:E
let g:airline#themes#fresh#palette.replace_modified =
\ g:airline#themes#fresh#palette.normal_modified
" VISAUL mode
let s:V1 = ['#ff5f00', '#ff5f00', 52, 208, '']
let s:V2 = ['#ffffff', '#005f00', 15, 124, '']
let s:V3 = ['#ffffff', '#121212', 15, 233, 'bold']
let g:airline#themes#fresh#palette.visual =
\ airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#fresh#palette.visual.airline_warning = s:W
let g:airline#themes#fresh#palette.visual.airline_error = s:E
let g:airline#themes#fresh#palette.visual_modified =
\ g:airline#themes#fresh#palette.normal_modified
" INACTIVE mode
let s:IA1 = ['#4e4e4e', '#1c1c1c', 239, 234, '']
let s:IA2 = ['#4e4e4e', '#262626', 239, 235, '']
let s:IA3 = ['#ffffff', '#121212', 15, 233, 'bold']
let g:airline#themes#fresh#palette.inactive =
\ airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
let g:airline#themes#fresh#palette.inactive.airline_warning = s:IA2
let g:airline#themes#fresh#palette.inactive.airline_error = s:IA2
let g:airline#themes#fresh#palette.inactive_modified = {
\ 'airline_c': ['#875faf', '', 97, '', ''], }
let g:airline#themes#fresh#palette.accents = {
\ 'red': [ '#ff0000' , '' , 160 , '' ] }
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let g:airline#themes#fresh#palette.ctrlp =
\ airline#extensions#ctrlp#generate_color_map(
\ ['#d7d7ff', '#5f00af', 189, 55, ''],
\ ['#ffffff', '#875fd7', 231, 98, ''],
\ ['#5f00af', '#ffffff', 55, 231, 'bold'] )

110
autoload/build.vim Normal file
View File

@@ -0,0 +1,110 @@
function! build#dir(...) abort
if a:0 == 0
" No arguments, find build directories.
let s:dirs = split(substitute(globpath('.', 'build*'), '\.\/', '', 'g'), '\n')
let l:len = len(s:dirs)
if l:len == 0
echoerr 'no build directories found'
elseif l:len == 1
" One build directory found, use it.
let l:dir = s:dirs[0]
unlet s:dirs
else
" Multiple build directories found, select one.
if exists('*popup_menu')
" Create popup menu to select the build directory. Callback to this
" function on completion, handled in the else branch below.
call popup_menu(s:dirs, #{
\ filter: 'popup_filter_menu',
\ callback: 'build#dir',
\ })
else
" Fallback to inputlist when popup_menu is not available.
let l:choices = []
let l:index = 1
for l:dir in s:dirs
call add(l:choices, string(l:index).': '.l:dir)
let l:index += 1
endfor
let l:index = inputlist(l:choices)
let l:dir = s:dirs[l:index - 1]
echomsg ' '.l:dir
endif
endif
else
if a:0 == 1
" Single argument, invoked by :BuildDir.
let l:dir = a:1
elseif a:0 == 2
" Two arguments, called back by popup_menu().
let l:dirs = s:dirs
unlet s:dirs
if a:2 == -1
" Selection in popup_menu() was cancelled.
return
endif
let l:dir = l:dirs[a:2 - 1]
else
echoerr 'build#dir called with too many arguments'
endif
endif
if exists('l:dir')
" Set build directory.
let l:cwd = substitute(getcwd(), '\\', '\/', 'g')
let $BUILD_DIR = l:cwd.'/'.substitute(l:dir, '\/$', '', '')
if executable('compdb')
" Post-process compile_commands.json with compdb, adds header files to
" missing compile_commands.json for more accurate diagnostics.
let l:database_dir = l:cwd.'/.vim'
let l:compile_commands = l:database_dir.'/compile_commands.json'
call systemlist('compdb -p '.$BUILD_DIR.' list > '.l:compile_commands)
else
let l:database_dir = $BUILD_DIR
endif
" Read/create .vim/coc-settings.json
let l:coc_settings = {}
if isdirectory('.vim')
let l:coc_settings = json_decode(join(readfile('.vim/coc-settings.json'), ''))
else
call mkdir('.vim')
endif
" Update .vim/coc-settings.json with new build directory.
let l:coc_settings['clangd.compilationDatabasePath'] = l:database_dir
let l:coc_settings['cmake.lsp.buildDirectory'] = $BUILD_DIR
call writefile([json_encode(l:coc_settings)], '.vim/coc-settings.json')
" Finally restart coc.nvim with new config.
CocRestart
endif
endfunction
function! build#targets(ArgLead, CmdLine, CursorPos) abort
if !exists('$BUILD_DIR')
echoerr 'build directory not set'
return ''
endif
let l:targets = []
if filereadable($BUILD_DIR.'/build.ninja')
" Ask ninja for the list of targets and prepare for returning.
for l:target in split(system('ninja -C '.$BUILD_DIR.' -t targets'), '\n')
call add(l:targets, substitute(l:target, ':.*$', '', ''))
endfor
elseif filereadable($BUILD_DIR.'/Makefile')
" TODO: Support make, it's much less straight forwards than ninja.
endif
return join(l:targets, "\n")
endfunction
function! build#run(...) abort
if !exists('$BUILD_DIR')
call echo#error('build directory not set')
return
endif
let l:build_dir = $BUILD_DIR
if filereadable($BUILD_DIR.'/build.ninja')
" Execute ninja in a terminal window.
execute 'terminal ninja -C '.l:build_dir.' '.join(a:000, ' ')
elseif filereadable($BUILD_DIR.'/Makefile')
" Execute make in a terminal window.
execute 'terminal make -C '.l:build_dir.' '.join(a:000, ' ')
endif
endfunction

View File

@@ -54,3 +54,60 @@ function! do#cursor_highlight_groups()
let l:lo = synIDattr(synIDtrans(synID(line('.'),col('.'),1)),'name') let l:lo = synIDattr(synIDtrans(synID(line('.'),col('.'),1)),'name')
echo 'hi<'.l:hi.'> trans<'.l:trans.'> lo<'.l:lo.'>' echo 'hi<'.l:hi.'> trans<'.l:trans.'> lo<'.l:lo.'>'
endfunction endfunction
" Rename C/C++ include guard
function! do#rename_include_guard(old)
" Prompt for new guard name
let l:new = input('Rename include guard: ', a:old)
" Get the current position
let l:pos = getpos('.')
" Replace the old guard name with the new one
exec '%s/\(#ifndef\|#define\|#endif\s\+\/\/\)\s\+\zs'.a:old.'/'.l:new.'/g'
" Stop highlighting search results
nohlsearch
" Jump back to the start position
call setpos('.', l:pos)
endfunction
" Setup and start a debugging command
function! do#debug(...)
packadd termdebug
let l:command = 'TermdebugCommand'
for l:arg in a:000
let l:command = l:command.' '.l:arg
endfor
exec l:command
endfunction
function! do#last_change()
if &filetype ==# 'help'
" vint: next-line -ProhibitCommandRelyOnUser -ProhibitCommandWithUnintendedSideEffect
1s/Last change: \zs.*$/\=strftime('%Y %b %d')/e
norm!``
endif
endfunction
" Augment vim-signify update events
function! do#signify() abort
" Disable update on cursor hold
autocmd! signify CursorHold,CursorHoldI
" Enable updates on leaving insert mode
autocmd signify InsertLeave,TextChanged <buffer> call sy#start()
" Enable update on text change e.g. undo/redo
autocmd signify TextChanged <buffer> call sy#start()
endfunction
" A sink for mappings to do nothing
function! do#sink() abort
endfunction
" Used by normal mode K mapping to show documentation
function! do#show_documentation()
if index(['vim','help'], &filetype) >= 0
execute 'help '.expand('<cword>')
elseif coc#rpc#ready() " TODO: Check if the LS supports doHover
call CocActionAsync('doHover')
else
execute '!'.&keywordprg.' '.expand('<cword>')
endif
endfunction

11
autoload/echo.vim Normal file
View File

@@ -0,0 +1,11 @@
function! echo#warning(message) abort
echohl WarningMsg
echomsg a:message
echohl None
endfunction
function! echo#error(message) abort
echohl ErrorMsg
echomsg a:message
echohl None
endfunction

14
autoload/format.vim Normal file
View File

@@ -0,0 +1,14 @@
if !has('pythonx')
finish
endif
" set debug=msg,throw
pythonx import format
function! format#clang_format() abort
pythonx format.clang_format()
endfunction
function! format#yapf() abort
pythonx format.yapf()
endfunction

27
autoload/osc52.vim Normal file
View File

@@ -0,0 +1,27 @@
" Use the OSC 52 escape sequence to copy text to the local system clipboard
" when connected to a remote machine.
" Add an autocmd to run after text is yanked.
function! osc52#autocmd()
augroup osc52
autocmd!
autocmd TextYankPost * call osc52#copy()
augroup END
endfunction
function! osc52#copy()
" Only use OSC 52 when text is yanked with the z register.
if v:event['regname'] ==# 'z'
" Get the register contents and join the list into a string.
let l:content = join(v:event['regcontents'], "\n")
if v:event['regtype'] ==# 'V'
" Append a new line in linewise-visual mode to avoid surprises.
let l:content = l:content."\n"
endif
" Get the parent tty while being compatible with vim and neovim, originally
" from https://github.com/greymd/oscyank.vim
let l:tty = system('(tty || tty < /proc/$PPID/fd/0) 2> /dev/null | grep /dev/')
" Base 64 encode the content, and print OSC 52 escape sequence to the tty.
call system('base64 | xargs -0 printf "\\033]52;c;%s\\a" > '.l:tty, l:content)
endif
endfunction

File diff suppressed because it is too large Load Diff

16
autoload/snippet.vim Normal file
View File

@@ -0,0 +1,16 @@
" Description: Expand snippet on file creation.
" Attempt to expand the _template snippet if this is a new file.
" https://noahfrederick.com/log/vim-templates-with-ultisnips-and-projectionist
function! snippet#template() abort
" Return if non-empty buffer or file exists.
if !(line('$') == 1 && getline('$') ==# '') || filereadable(expand('%'))
return
endif
" Attempt to expand the _template snippet.
execute "normal! i_template\<C-r>=UltiSnips#ExpandSnippet()\<CR>"
if g:ulti_expand_res == 0
" Expansions failed, undo insert.
silent! undo
endif
endfunction

21
autoload/tmux.vim Normal file
View File

@@ -0,0 +1,21 @@
let s:tmux_option = '@vim'.substitute($TMUX_PANE, '%', '\\%', 'g')
function! tmux#inSession() abort
return $TMUX !=# ''
endfunction
function! tmux#setNavigationFlag() abort
call system('tmux set-window-option '.s:tmux_option.' 1')
endfunction
function! tmux#unsetNavigationFlag() abort
call system('tmux set-window-option -u '.s:tmux_option)
endfunction
function! tmux#isOption(option, value) abort
if !tmux#inSession()
return 0
endif
let l:option = trim(system('tmux show-options -g '.a:option))
return l:option ==# a:option.' '.a:value
endfunction

3
autoload/wsl.vim Normal file
View File

@@ -0,0 +1,3 @@
function! wsl#isDetected() abort
return $WSLENV !=# ''
endfunction

17
coc-settings.json Normal file
View File

@@ -0,0 +1,17 @@
{
"clangd.inlayHints.enable": false,
"cmake.lsp.enable": true,
"diagnostic.enableHighlightLineNumber": false,
"diagnostic.errorSign": "▸",
"diagnostic.hintSign": "▸",
"diagnostic.infoSign": "▸",
"diagnostic.warningSign": "▸",
"powershell.integratedConsole.showOnStartup": false,
"suggest.noselect": true,
"yaml.schemas": {
"https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json": [
".gitlab-ci.yml",
".gitlab/ci/*.yml"
]
}
}

View File

@@ -95,10 +95,10 @@ if has('gui_running') || &t_Co == 256
call s:hi('Cursor', '', '', 'reverse') call s:hi('Cursor', '', '', 'reverse')
call s:hi('CursorIM', '', '', '') call s:hi('CursorIM', '', '', '')
call s:hi('CursorColumn', '235', '', '') call s:hi('CursorColumn', '235', '', '')
call s:hi('CursorLine', '', '0', '') call s:hi('CursorLine', '', '', '')
call s:hi('Directory', '', '', '') call s:hi('Directory', '', '', '')
call s:hi('DiffAdd', '2', '', '') call s:hi('DiffAdd', '2', '', '')
call s:hi('DiffChange', '', '', '') call s:hi('DiffChange', '3', '', '')
call s:hi('DiffDelete', '1', '', '') call s:hi('DiffDelete', '1', '', '')
call s:hi('DiffText', '3', '', '') call s:hi('DiffText', '3', '', '')
call s:hi('ErrorMsg', '1', '', '') call s:hi('ErrorMsg', '1', '', '')
@@ -112,7 +112,7 @@ if has('gui_running') || &t_Co == 256
call s:hi('MatchParen', '', '', '') call s:hi('MatchParen', '', '', '')
call s:hi('ModeMsg', '', '', '') call s:hi('ModeMsg', '', '', '')
call s:hi('MoreMsg', '12', '', '') call s:hi('MoreMsg', '12', '', '')
call s:hi('NonText', '', '', '') call s:hi('NonText', '238', '', '')
call s:hi('Normal', '7', '232', '') call s:hi('Normal', '7', '232', '')
call s:hi('Pmenu', '', '235', '') call s:hi('Pmenu', '', '235', '')
call s:hi('PmenuSel', '', '', 'reverse') call s:hi('PmenuSel', '', '', 'reverse')
@@ -126,7 +126,9 @@ if has('gui_running') || &t_Co == 256
call s:hi('SpellLocal', '5', '', '') call s:hi('SpellLocal', '5', '', '')
call s:hi('SpellRare', '3', '', '') call s:hi('SpellRare', '3', '', '')
call s:hi('StatusLine', '15', '233', '') call s:hi('StatusLine', '15', '233', '')
call s:hi('StatusLineTerm', '15', '233', '')
call s:hi('StatusLineNC', '', '235', '') call s:hi('StatusLineNC', '', '235', '')
call s:hi('StatusLineTermNC', '', '235', '')
call s:hi('TabLine', '246', '235', 'bold') call s:hi('TabLine', '246', '235', 'bold')
call s:hi('TabLineFill', '', '235', '') call s:hi('TabLineFill', '', '235', '')
call s:hi('TabLineSel', '248', '', 'bold') call s:hi('TabLineSel', '248', '', 'bold')
@@ -158,13 +160,13 @@ if has('gui_running') || &t_Co == 256
call s:hi('Repeat', '69', '', '') call s:hi('Repeat', '69', '', '')
call s:hi('Label', '69', '', '') call s:hi('Label', '69', '', '')
call s:hi('Operator', '166', '', '') call s:hi('Operator', '166', '', '')
call s:hi('Keyword', '', '', '') call s:hi('Keyword', '72', '', '')
call s:hi('Exception', '', '', '') call s:hi('Exception', '69', '', '')
call s:hi('PreProc', '102', '', '') call s:hi('PreProc', '102', '', '')
call s:hi('Include', '65', '', '') call s:hi('Include', '65', '', '')
call s:hi('Define', '', '', '') call s:hi('Define', '102', '', '')
call s:hi('Macro', '', '', '') call s:hi('Macro', '102', '', '')
call s:hi('PreCondit', '61', '', '') call s:hi('PreCondit', '61', '', '')
call s:hi('Type', '75', '', '') call s:hi('Type', '75', '', '')
@@ -173,11 +175,11 @@ if has('gui_running') || &t_Co == 256
call s:hi('Typedef', '75', '', '') call s:hi('Typedef', '75', '', '')
call s:hi('Special', '179', '', '') call s:hi('Special', '179', '', '')
call s:hi('SpecialChar', '', '', '') call s:hi('SpecialChar', '179', '', '')
call s:hi('Tag', '', '', '') call s:hi('Tag', '', '', '')
call s:hi('Delimiter', '', '', '') call s:hi('Delimiter', '179', '', '')
call s:hi('SpecialComment', '246', '', '') call s:hi('SpecialComment', '246', '', '')
call s:hi('Debug', '', '', '') call s:hi('Debug', '179', '', '')
call s:hi('Underlined', '38', '', 'underline') call s:hi('Underlined', '38', '', 'underline')
call s:hi('Ignore', '', '', '') call s:hi('Ignore', '', '', '')
@@ -185,17 +187,45 @@ if has('gui_running') || &t_Co == 256
call s:hi('Todo', '202', '', 'bold') call s:hi('Todo', '202', '', 'bold')
"" }}} "" }}}
"" NVIM Groups {{
call s:hi('NormalFloat', '', '235', '')
"" }}
"" Terminal Groups {{{
call s:hi('debugBreakpoint', '1', '', 'reverse')
call s:hi('debugPC', '25', '', 'reverse')
""}}}
"" Custom Groups {{{ "" Custom Groups {{{
call s:hi('Block', '', '', '') call s:hi('Block', '', '', '')
call s:hi('Note', '40', '', 'bold') call s:hi('Note', '40', '', 'bold')
call s:hi('Important', '220', '', 'bold') call s:hi('Important', '220', '', 'bold')
call s:hi('Research', '202', '', 'bold') call s:hi('Research', '202', '', 'bold')
call s:hi('ALEError', '160', '', '')
call s:hi('ALEWarning', '129', '', '')
call s:hi('ALEErrorSign', '160', '233', 'bold')
call s:hi('ALEWarningSign', '129', '233', 'bold')
call s:hi('CocErrorSign', '160', '233', '')
call s:hi('CocErrorFloat', '160', '235', '')
call s:hi('CocWarningSign', '129', '233', '')
call s:hi('CocWarningFloat', '129', '235', '')
call s:hi('CocInfoSign', '8', '233', '')
call s:hi('CocInfoFloat', '8', '235', '')
call s:hi('CocHintSign', '33', '233', '')
call s:hi('CocHintFloat', '33', '235', '')
call s:hi('CocInlayHint', '8', '', '')
call s:hi('SyntasticErrorSign', '160', '233', 'bold') call s:hi('SyntasticErrorSign', '160', '233', 'bold')
call s:hi('SyntasticWarningSign', '129', '233', 'bold') call s:hi('SyntasticWarningSign', '129', '233', 'bold')
call s:hi('SyntasticErrorLine', '', '', '') call s:hi('SyntasticErrorLine', '', '', '')
call s:hi('SyntasticWarningLine', '', '', '') call s:hi('SyntasticWarningLine', '', '', '')
call s:hi('SyntasticError', '160', '', '') call s:hi('SyntasticError', '160', '', '')
call s:hi('SyntasticWarning', '129', '', '') call s:hi('SyntasticWarning', '129', '', '')
call s:hi('SignifySignAdd', '2', '233', '')
call s:hi('SignifySignChange', '3', '233', '')
call s:hi('SignifySignDelete', '1', '233', '')
"" }}} "" }}}
endif endif

1
ftdetect/cmakecache.vim Normal file
View File

@@ -0,0 +1 @@
autocmd BufNewFile,BufReadPost CMakeCache.txt set filetype=cmakecache

View File

@@ -0,0 +1 @@
autocmd BufNewFile,BufReadPost */requirements.txt set filetype=requirements

3
ftplugin/c.vim Normal file
View File

@@ -0,0 +1,3 @@
if has('pythonx')
setlocal formatexpr=format#clang_format()
endif

1
ftplugin/cmakecache.vim Normal file
View File

@@ -0,0 +1 @@
setlocal nospell

6
ftplugin/cpp.vim Normal file
View File

@@ -0,0 +1,6 @@
" Add <> to % matches
setlocal matchpairs+=<:>
if has('pythonx')
setlocal formatexpr=format#clang_format()
endif

3
ftplugin/java.vim Normal file
View File

@@ -0,0 +1,3 @@
if has('pythonx')
setlocal formatexpr=format#clang_format()
endif

3
ftplugin/javascript.vim Normal file
View File

@@ -0,0 +1,3 @@
if has('pythonx')
setlocal formatexpr=format#clang_format()
endif

3
ftplugin/objc.vim Normal file
View File

@@ -0,0 +1,3 @@
if has('pythonx')
setlocal formatexpr=format#clang_format()
endif

3
ftplugin/objcpp.vim Normal file
View File

@@ -0,0 +1,3 @@
if has('pythonx')
setlocal formatexpr=format#clang_format()
endif

3
ftplugin/proto.vim Normal file
View File

@@ -0,0 +1,3 @@
if has('pythonx')
setlocal formatexpr=format#clang_format()
endif

3
ftplugin/python.vim Normal file
View File

@@ -0,0 +1,3 @@
if has('pythonx')
setlocal formatexpr=format#yapf()
endif

View File

@@ -0,0 +1 @@
set commentstring=#%s

12
ginit.vim Normal file
View File

@@ -0,0 +1,12 @@
if exists(':GuiFont')
if platform#is_windows()
GuiFont! Source\ Code\ Pro:h10
else
GuiFont Source\ Code\ Pro:h9
endif
endif
if exists(':GuiTabline')
" Don't use GUI tabline, matches terminal tabline.
GuiTabline 0
endif

2
gvimrc
View File

@@ -6,7 +6,7 @@
set guioptions=aegi set guioptions=aegi
if platform#is_windows() if platform#is_windows()
set guifont=Consolas:h10:cDEFAULT set guifont=Source\ Code\ Pro:h10
else else
" Set default font " Set default font
set guifont=Source\ Code\ Pro\ Medium\ 9 set guifont=Source\ Code\ Pro\ Medium\ 9

166
indent/python.vim Normal file
View File

@@ -0,0 +1,166 @@
" Override default Python indent file
if exists('b:did_indent')
finish
endif
let b:did_indent = 1
" Make sure lisp indenting doesn't supersede us
setlocal nolisp
" indentexpr isn't much help otherwise
setlocal autoindent
" Use custom indent expression
setlocal indentexpr=PythonIndent(v:lnum)
" List of keys that trigger indentexpr in insert mode
setlocal indentkeys+=<:>,=elif,=except
" Derived from the default GetPythonIndent removing deliberate use of invalid
" expressions which show up with 'set debug=msg,throw', also remove the indent
" config options.
function! PythonIndent(lnum)
" If this line is explicitly joined: If the previous line was also joined,
" line it up with that one, otherwise add two 'shiftwidth'
if getline(a:lnum - 1) =~# '\\$'
if a:lnum > 1 && getline(a:lnum - 2) =~# '\\$'
return indent(a:lnum - 1)
endif
return indent(a:lnum - 1) + (shiftwidth() * 2)
endif
" If the start of the line is in a string don't change the indent.
if has('syntax_items')
\ && synIDattr(synID(a:lnum, 1, 1), 'name') =~# 'String$'
return -1
endif
" Search backwards for the previous non-empty line.
let plnum = prevnonblank(v:lnum - 1)
if plnum == 0
" This is the first non-empty line, use zero indent.
return 0
endif
" If the previous line is inside parenthesis, use the indent of the starting
" line.
call cursor(plnum, 1)
let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW', '', 0, 100)
if parlnum > 0
let plindent = indent(parlnum)
let plnumstart = parlnum
else
let plindent = indent(plnum)
let plnumstart = plnum
endif
" When inside parenthesis: If at the first line below the parenthesis add
" 'shiftwidth', otherwise same as previous line.
" i = (a
" + b
" + c)
call cursor(a:lnum, 1)
let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW', '', 0, 100)
if p > 0
if p == plnum
" When the start is inside parenthesis, only indent one 'shiftwidth'.
let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW', '', 0, 100)
return indent(plnum) + shiftwidth()
endif
if plnumstart == p
return indent(plnum)
endif
return plindent
endif
" Get the line and remove a trailing comment.
" Use syntax highlighting attributes when possible.
let pline = getline(plnum)
let pline_len = strlen(pline)
if has('syntax_items')
" If the last character in the line is a comment, do a binary search for
" the start of the comment. synID() is slow, a linear search would take
" too long on a long line.
if synIDattr(synID(plnum, pline_len, 1), 'name') =~# '\\(Comment\\|Todo\\)$'
let min = 1
let max = pline_len
while min < max
let col = (min + max) / 2
if synIDattr(synID(plnum, col, 1), 'name') =~# '\\(Comment\\|Todo\\)$'
let max = col
else
let min = col + 1
endif
endwhile
let pline = strpart(pline, 0, min - 1)
endif
else
let col = 0
while col < pline_len
if pline[col] ==# '#'
let pline = strpart(pline, 0, col)
break
endif
let col = col + 1
endwhile
endif
" If the previous line ended with a colon, indent this line
if pline =~# ':\s*$'
return plindent + shiftwidth()
endif
" If the previous line was a stop-execution statement...
if getline(plnum) =~# '^\s*\(break\|continue\|raise\|return\|pass\)\>'
" See if the user has already dedented
if indent(a:lnum) > indent(plnum) - shiftwidth()
" If not, recommend one dedent
return indent(plnum) - shiftwidth()
endif
" Otherwise, trust the user
return -1
endif
" If the current line begins with a keyword that lines up with try
if getline(a:lnum) =~# '^\s*\(except\|finally\)\>'
let lnum = a:lnum - 1
while lnum >= 1
if getline(lnum) =~# '^\s*\(try\|except\)\>'
let ind = indent(lnum)
if ind >= indent(a:lnum)
" indent is already less than this
return -1
endif
" line up with previous try or except
return ind
endif
let lnum = lnum - 1
endwhile
" no matching try!
return -1
endif
" If the current line begins with a header keyword, dedent
if getline(a:lnum) =~# '^\s*\(elif\|else\)\>'
" Unless the previous line was a one-liner
if getline(plnumstart) =~# '^\s*\(for\|if\|try\)\>'
return plindent
endif
" Or the user has already dedented
if indent(a:lnum) <= plindent - shiftwidth()
return -1
endif
return plindent - shiftwidth()
endif
" When after a () construct we probably want to go back to the start line.
" a = (b
" + c)
" here
if parlnum > 0
return plindent
endif
return -1
endfunction

1
init.vim Normal file
View File

@@ -0,0 +1 @@
runtime vimrc

28
nodejs-linux.yaml Normal file
View File

@@ -0,0 +1,28 @@
---
- name: nodejs get json containing latest version
uri:
url: https://nodejs.org/dist/index.json
register: latest
- name: nodejs create directory for downloaded package
file:
state: directory
dest: ~/.local/src
- name: nodejs download latest package
get_url:
url: 'https://nodejs.org/dist/{{latest.json[0].version}}/node-{{latest.json[0].version}}-linux-x64.tar.gz'
dest: ~/.local/src/node.tar.gz
- name: nodejs extract downloaded package
unarchive:
src: ~/.local/src/node.tar.gz
dest: ~/.local/src
remote_src: true
- name: nodejs create symlink links
file:
state: link
src: '~/.local/src/node-{{latest.json[0].version}}-linux-x64/bin/{{item}}'
dest: '~/.local/bin/{{item}}'
with_items: [corepack, node, npm, npx]

View File

@@ -1,15 +1,46 @@
augroup benieAugroup augroup benieAugroup
" Clear all autocmd's in this group
autocmd! autocmd!
if tmux#inSession()
" [Un]set tmux window option to detect when to change pane.
call tmux#setNavigationFlag()
au FocusGained * silent call tmux#setNavigationFlag()
au VimLeave * silent call tmux#unsetNavigationFlag()
endif
" Reopening a file at last curson position " Reopening a file at last curson position
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\ | exe "normal! g'\"" | endif \ | exe "normal! g'\"" | endif
" TODO: Move this to a plugin & rename to .enter .exit " Update `Last change: <date>` on write & go back previous cursor position
au BufRead,BufNewFile .env set filetype=zsh au FileType help au BufWritePre <buffer>
au BufRead,BufNewFile .out set filetype=zsh \ 1s/Last change: \zs.*$/\=strftime('%Y %b %d')/e|norm!``
" Highlight conflict markers in any filefile " Read template into buffer then send line 1 to the black hold register
au FileType * :call matchadd('Todo', '^\(<<<<<<<\||||||||\|=======\|>>>>>>>\)\s\ze.*$') au BufNewFile todo.md read ~/.vim/templates/skeleton.todo.md | 1delete _
" Attempt to expand snippet named `_template` if it exists
au BufNewFile * silent! call snippet#template()
" Do the same when filetype changes to help
au FileType help silent! call snippet#template()
" Augment vim-signify by modifying it's autocmds
au User SignifyAutocmds call do#signify()
if has('nvim')
" Start in terminal-insert mode.
autocmd TermOpen term://* startinsert
" Don't show the line number column in terminal-insert mode.
autocmd TermEnter term://*
\ set nonumber | set norelativenumber | set signcolumn=no
" But do show the line number column in terminal-normal mode.
autocmd TermLeave term://*
\ set number | set relativenumber | set signcolumn=auto
" Automatically press enter when the terminal process exits.
autocmd TermClose term://*
\ if (expand('<afile>') !~ "fzf") &&
\ (expand('<afile>') !~ "ranger") &&
\ (expand('<afile>') !~ "coc") |
\ call nvim_input('<CR>') |
\ endif
endif
augroup END augroup END

View File

@@ -1,13 +1,12 @@
if !platform#is_windows() && if !platform#is_windows() &&
\ !has("gui_running") && \ !has("gui_running") &&
\ $TERM != 'xterm-256color' && \ $TERM != 'xterm-256color' &&
\ $TERM != 'xterm-kitty' &&
\ $TERM != 'screen-256color' && \ $TERM != 'screen-256color' &&
\ $TERM != 'tmux-256color' \ $TERM != 'tmux-256color'
echo "This terminal does not report 256 color support but probaly supports it" echo "This terminal does not report 256 color support but probaly supports it"
echo "Setup the shell to do something similar on load" echo "Setup the shell to do something similar on load"
echo "env TERM=xterm-256color /usr/bin/zsh" echo "env TERM=xterm-256color /usr/bin/zsh"
endif endif
if !platform#is_windows() || has("gui_running")
colorscheme fresh colorscheme fresh
endif syntax sync minlines=1000
syntax sync minlines=500

View File

@@ -14,4 +14,14 @@ command! -nargs=1 TabWidth call do#set_tab_width(<f-args>)
command! ToggleCheckbox call do#toggle_checkbox() command! ToggleCheckbox call do#toggle_checkbox()
" Show highlight groups under the cursor " Show highlight groups under the cursor
command! CursorHighlightGroups :call do#cursor_highlight_groups() command! CursorHighlightGroups call do#cursor_highlight_groups()
" Setup and invoke a :TermdebugCommand
command! -nargs=+ -complete=file Debug call do#debug(<f-args>)
" Find all TODO items in the current file and populate the location list
command! TodoFile lvimgrep /todo/ %
" Change build directory
command! -nargs=? -complete=dir BuildDir call build#dir(<f-args>)
command! -nargs=* -complete=custom,build#targets Build call build#run(<f-args>)

8
plugin/format.vim Normal file
View File

@@ -0,0 +1,8 @@
if !has('pythonx')
finish
endif
let g:clang_format_path = get(g:, 'clang_format_path', 'clang-format')
let g:clang_format_style = get(g:, 'clang_format_style', 'google')
let g:yapf_path = get(g:, 'yapf_path', 'yapf')
let g:yapf_style = get(g:, 'yapf_style', 'pep8')

View File

@@ -1,12 +1,26 @@
" YouCompleteMe " coc.nvim
nnoremap <leader>fi :YcmCompleter FixIt<CR> nmap <silent> <leader>fi <Plug>(coc-fix-current)
nnoremap <leader>gd :YcmCompleter GoTo<CR> nmap <silent> <leader>gd <Plug>(coc-definition)
nnoremap <leader>gt :YcmCompleter GetType<CR> nmap <silent> <leader>gt <Plug>(coc-type-definition)
nnoremap <leader>sd :YcmShowDetailedDiagnostic<CR> nmap <silent> <leader>sd <Plug>(coc-diagnostic-info)
nmap <silent> <leader>gr <Plug>(coc-references)
nmap <silent> K :call do#show_documentation()<CR>
nmap <silent> <C-n> <Plug>(coc-diagnostic-next)
nmap <silent> <C-p> <Plug>(coc-diagnostic-prev)
" GitGutter if has('nvim')
nnoremap <leader>gn :GitGutterNextHunk<CR> " Make nvim :terminal more like vim :terminal
nnoremap <leader>gp :GitGutterPrevHunk<CR> tnoremap <C-w>N <C-\><C-n>
endif
" termdebug
" TODO: Detecet if termdebug is loaded, if not do the default action.
nnoremap <C-W><C-G> :Gdb<CR>
nnoremap <C-W><C-E> :Program<CR>
nnoremap <C-W><C-S> :Source<CR>
tnoremap <C-G> :Gdb<CR>
tnoremap <C-E> :Program<CR>
tnoremap <C-S> :Source<CR>
" Quickfix list " Quickfix list
nnoremap <leader>qo :copen<CR> nnoremap <leader>qo :copen<CR>
@@ -49,14 +63,33 @@ nnoremap k gk
" Quick write " Quick write
nnoremap <leader>w :w!<CR> nnoremap <leader>w :w!<CR>
" Switch panes " Switch panes in a tmux aware way
nnoremap <C-h> <C-w>h if !has('win32')
nnoremap <C-j> <C-w>j nnoremap <silent> <C-h> :TmuxNavigateLeft<CR>
nnoremap <C-k> <C-w>k nnoremap <silent> <C-j> :TmuxNavigateDown<CR>
nnoremap <C-l> <C-w>l nnoremap <silent> <C-k> :TmuxNavigateUp<CR>
nnoremap <silent> <C-l> :TmuxNavigateRight<CR>
" Redraw window nnoremap <silent> <C-w>h :TmuxNavigateLeft<CR>
nnoremap <C-w>l <C-l> nnoremap <silent> <C-w>j :TmuxNavigateDown<CR>
nnoremap <silent> <C-w>k :TmuxNavigateUp<CR>
nnoremap <silent> <C-w>l :TmuxNavigateRight<CR>
if has('nvim')
tnoremap <silent> <C-w>h <C-\><C-n>:TmuxNavigateLeft<CR>
tnoremap <silent> <C-w>j <C-\><C-n>:TmuxNavigateDown<CR>
tnoremap <silent> <C-w>k <C-\><C-n>:TmuxNavigateUp<CR>
tnoremap <silent> <C-w>l <C-\><C-n>:TmuxNavigateRight<CR>
else
tnoremap <silent> <C-w>h <C-w>N:TmuxNavigateLeft<CR>
tnoremap <silent> <C-w>j <C-w>N:TmuxNavigateDown<CR>
tnoremap <silent> <C-w>k <C-w>N:TmuxNavigateUp<CR>
tnoremap <silent> <C-w>l <C-w>N:TmuxNavigateRight<CR>
endif
else
nnoremap <silent> <C-h> <C-w>h
nnoremap <silent> <C-j> <C-w>j
nnoremap <silent> <C-k> <C-w>k
nnoremap <silent> <C-l> <C-w>l
endif
" Quick tabs " Quick tabs
nnoremap <leader>tn :tabnew<Space> nnoremap <leader>tn :tabnew<Space>
@@ -67,11 +100,25 @@ nnoremap <leader>tm :tabmove<Space>
" Clear search highlights " Clear search highlights
nnoremap <leader><Space> :nohlsearch<CR> nnoremap <leader><Space> :nohlsearch<CR>
if tmux#isOption('set-clipboard', 'on') || $SSH_CONNECTION !=# ''
" When connected to a remote session the + selection register is not
" available and the unnamed register is used instead. Add mappings using the
" z register instead.
noremap <leader>y "zy
noremap <leader>Y "zY
" Enable OSC 52 copy on yank.
call osc52#autocmd()
else
" System clipboard yank/put " System clipboard yank/put
noremap <leader>y "+y noremap <leader>y "+y
noremap <leader>Y "+Y noremap <leader>Y "+Y
noremap <leader>p "+p noremap <leader>p "+p
noremap <leader>P "+P noremap <leader>P "+P
endif
if has('nvim-0.5.2')
" Undo neovim's default mapping of Y to y$
unmap Y
endif
" Quickly access spelling menu " Quickly access spelling menu
inoremap <C-s> <C-g>u<C-X>s inoremap <C-s> <C-g>u<C-X>s
@@ -79,8 +126,6 @@ nnoremap <C-s> i<C-g>u<C-X>s
" Disable 'Q' from opening Ex mode " Disable 'Q' from opening Ex mode
nnoremap Q <nop> nnoremap Q <nop>
" Disable 'K' from loading man pages
noremap K <nop>
" Split line at the cursor " Split line at the cursor
nnoremap [j i<CR><Esc> nnoremap [j i<CR><Esc>
@@ -91,3 +136,6 @@ nnoremap <leader><CR> :ToggleCheckbox<CR>
" Show highlight groups under the cursor " Show highlight groups under the cursor
nnoremap <leader>hi :CursorHighlightGroups<CR> nnoremap <leader>hi :CursorHighlightGroups<CR>
" Rename C/C++ include guard
nnoremap <leader>rg :call do#rename_include_guard(expand('<cword>'))<cr>

View File

@@ -1,6 +1,3 @@
" TODO: Move these settings to vimrc when after switching to vim8 packages
scriptencoding 'utf-8'
" Copy indent from current line " Copy indent from current line
set autoindent set autoindent
@@ -16,14 +13,6 @@ if !has('nvim') && &ttimeoutlen == -1
set ttimeoutlen=100 set ttimeoutlen=100
endif endif
" TODO: These might be irrelevant with vim-airline
" Show 2 line status
set laststatus=2
" Show the line and colum number of a cursor position
set ruler
" Show the current line with different highlighting
set cursorline
" Enhanced command line completion " Enhanced command line completion
set wildmenu set wildmenu
" Command line history " Command line history
@@ -39,7 +28,7 @@ if &listchars ==# 'eol:$'
set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+ set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
endif endif
if v:version > 703 || v:version == 703 && has("patch541") if v:version > 703 || v:version == 703 && has('patch541')
" Delete comment character when joining commented lines " Delete comment character when joining commented lines
set formatoptions+=j set formatoptions+=j
endif endif
@@ -70,8 +59,6 @@ if has('linebreak')
set linebreak set linebreak
" Downwards Arrow With Tip Rightwards (U+21B3, utf-8: E2 86 B3) " Downwards Arrow With Tip Rightwards (U+21B3, utf-8: E2 86 B3)
let &showbreak='↳ ' let &showbreak='↳ '
" Use same highlight group as listchars for showbreak
set highlight+=@:SpecialKey
endif endif
" TODO: spellcapcheck " TODO: spellcapcheck
@@ -98,7 +85,6 @@ if exists('+relativenumber')
endif endif
" Keep cursor from buffer edges " Keep cursor from buffer edges
set scrolloff=8
set sidescrolloff=5 set sidescrolloff=5
" Turn backup off " Turn backup off
@@ -107,6 +93,15 @@ if has('writebackup')
set nowritebackup set nowritebackup
endif endif
" Change info file location
if has('viminfo') && has('unix')
let s:cache_dir = expand('~/.cache/vim')
if !isdirectory(s:cache_dir)
call mkdir(s:cache_dir)
endif
execute 'set viminfofile='.s:cache_dir.'/info'
endif
" Use Unix as standard file type " Use Unix as standard file type
set fileformats=unix,mac,dos set fileformats=unix,mac,dos
@@ -155,19 +150,33 @@ set mouse=a
" q - allow formatting with 'gq' " q - allow formatting with 'gq'
set formatoptions+=rq set formatoptions+=rq
" Always show the signcolum
if exists('&signcolumn')
try
set signcolumn=number
catch /E474/
set signcolumn=yes
endtry
endif
" Enable modeline " Enable modeline
set modeline set modeline
" Don't redraw during execution macros, registers, commands, etc. " Don't redraw during execution macros, registers, commands, etc.
set lazyredraw set lazyredraw
" When in diff mode, use the patience algorithm for more readable diffs.
if &diff
set diffopt+=algorithm:patience
endif
" Allow color schemes to do bright colors without forcing bold " Allow color schemes to do bright colors without forcing bold
if &t_Co == 8 && $TERM !~# '^linux\|^Eterm' if &t_Co == 8 && $TERM !~# '^linux\|^Eterm'
set t_Co=16 set t_Co=16
endif endif
" Change cursor dependant on current mode " Change cursor dependant on current mode
if has('cursorshape') && has('unix') && !has('gui_running') if !has('nvim') && has('cursorshape') && has('unix') && !has('gui_running')
if $TMUX ==# '' && $ITERM_PROFILE !=# '' if $TMUX ==# '' && $ITERM_PROFILE !=# ''
let &t_SI = "\<Esc>]50;CursorShape=1\x7" let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7" let &t_EI = "\<Esc>]50;CursorShape=0\x7"

174
plugin/statusline.vim Normal file
View File

@@ -0,0 +1,174 @@
" Show the statusline above the commandline.
scriptencoding utf-8
set laststatus=2
" Define color variables.
let g:statusline#light_green = {'fg': ['235', '#080808'], 'bg': [ '35', '#0087ff']}
let g:statusline#light_blue = {'fg': ['235', '#080808'], 'bg': [ '33', '#0087ff']}
let g:statusline#light_orange = {'fg': ['235', '#080808'], 'bg': ['209', '#eb754d']}
let g:statusline#light_red = {'fg': ['235', '#080808'], 'bg': ['124', '#af0000']}
let g:statusline#light_grey = {'fg': ['250', '#bcbcbc'], 'bg': ['236', '#303030']}
let g:statusline#light_violet = {'fg': ['235', '#080808'], 'bg': [ '99', '#986fec']}
let g:statusline#dark_white = {'fg': [ '15', '#ffffff'], 'bg': ['233', '#121212']}
let g:statusline#dark_yellow = {'fg': ['179', '#dfaf5f'], 'bg': ['233', '#121212']}
let g:statusline#dark_grey = {'fg': ['244', '#808080'], 'bg': ['233', '#121212']}
" Create highlight groups.
function! s:hi(group, color) abort
execute 'highlight '.a:group
\.' ctermfg='.a:color['fg'][0].' ctermbg='.a:color['bg'][0]
\.' guifg='.a:color['fg'][1].' guibg='.a:color['bg'][1]
endfunction
" StatusLineLight is shows the mode and cursor information, it is dynamically
" changed by statusline#mode(), give it a default.
call s:hi('StatusLineLight', g:statusline#light_grey)
" StatusLineDusk is shows additional information which is not always present,
" give it a muted color.
call s:hi('StatusLineDusk', g:statusline#light_grey)
" StatusLineDark shows the filename and filetype and takes up most of the
" statusline, give it a dark background.
call s:hi('StatusLineDark', g:statusline#dark_white)
" StatusLineChange shows changes in the file by changing the colour of the
" filename, give if a dark background.
call s:hi('StatusLineChange', g:statusline#dark_yellow)
" StatusLineFade shows the status of completion engines but using colors which
" fade into the background to avoid grabbing attention.
call s:hi('StatusLineDuskFade', g:statusline#dark_grey)
" Construct a statusline for special buffer types.
function! statusline#special(group, name, title)
" Display current mode with dynamic highlights.
let l:mode = '%#'.a:group.'# '.a:name.' '
" Display filename with dark highlights.
let l:file = '%#StatusLineDark# '.a:title
" Display current/total lines and column with dynamic highlights.
let l:line = '%#'.a:group.'# ☰ %l/%L ㏑%2c '
" Combine the elements into a single string to be evaluated.
return l:mode.l:file.'%='.l:line
endfunction
" Construct a statusline for generic buffer types.
function! statusline#generic(group, mode, coc)
" Display current mode with dynamic highlights.
let l:mode = '%#'.a:group.'# '.a:mode.' '
" Display spell or paste if set with dusk highlights in a group to swallow
" the spaces when empty.
let l:edit = '%#StatusLineDusk#%( '
\.'%{&spell ? "Spell " : ""}'
\.'%{&paste ? "Paste " : ""}'
\.'%)'
" Display filename with dark or changed highlights.
let l:file = (&modified ? '%#StatusLineChange#' : '%#StatusLineDark#').' %<%f'
" Display readonly and nomodifiable if set.
let l:state = '%#StatusLineDark#'
\.'%{&readonly ? " 🔒" : ""}'
\.'%{&modifiable ? "" : " ⛔"}'
if a:coc && exists('*coc#status')
" Display coc.nvim status.
let l:coc = '%#StatusLineDuskFade#%( %{coc#status()}%)'
else
let l:coc = ''
endif
" Display filetype if set.
let l:type = '%#StatusLineDark# %{&filetype} '
" Display fileencoding if not utf-8 and fileformat if not unix with dusk
" highlights in a group to swallow spaces when empty.
let l:format = '%#StatusLineDusk#%( '
\.'%{&fileencoding ==# "utf-8" ? "" : &fileencoding}'
\.'%{&fileformat ==# "unix" ? "" : "[".&fileformat."]"}'
\.' %)'
" Display current/total lines and column with dynamic highlights.
let l:line = '%#'.a:group.'# ☰ %l/%L ㏑%2c '
" Combine the elements into a single string to be evaluated.
return l:mode.l:edit.l:file.l:state.l:coc.'%='.l:type.l:format.l:line
endfunction
" Define active statusline, this statusline is dynamic with StatusLineLight
" being updated based on the current mode and only used for current buffer.
function! statusline#active()
let l:mode = statusline#mode()
if &buftype ==# 'help'
if l:mode ==# 'Normal'
let l:mode = 'Help'
endif
return statusline#special('StatusLineLight', l:mode, '%F')
elseif &buftype ==# 'quickfix'
" Quickfix list and location list have the same buftype, the window has a
" loclist flag, query the window info.
let l:info = getwininfo(win_getid())[0]
if l:mode ==# 'Normal'
let l:mode = l:info['loclist'] ? 'Location' : 'Quickfix'
endif
return statusline#special('StatusLineLight', l:mode,
\ get(l:info['variables'], 'quickfix_title', ''))
elseif &buftype ==# 'terminal'
return statusline#special('StatusLineLight', 'Terminal', '%f')
elseif &previewwindow
if l:mode ==# 'Normal'
let l:mode = 'Preview'
endif
return statusline#generic('StatusLineLight', l:mode, v:false)
elseif &filetype ==# 'man'
return statusline#special('StatusLineDusk', 'Manual', '%f')
endif
return statusline#generic('StatusLineLight', l:mode, v:true)
endfunction
" Define inactive statusline, this remains static until the buffer gains
" focus again.
function! statusline#inactive()
if &buftype ==# 'help'
let l:statusline = statusline#special('StatusLineDusk', 'Help', '%F')
elseif &buftype ==# 'quickfix'
" Quickfix list and location list have the same buftype, the window has a
" loclist flag, query the window info.
let l:info = getwininfo(win_getid())[0]
let l:statusline = statusline#special('StatusLineDusk',
\ l:info['loclist'] ? 'Location' : 'Quickfix',
\ get(l:info['variables'], 'quickfix_title', ''))
elseif &buftype ==# 'terminal'
let l:statusline = statusline#special('StatusLineDusk', 'Terminal', '%f')
elseif &previewwindow
let l:statusline = statusline#generic('StatusLineDusk', 'Preview', v:false)
elseif &filetype ==# 'man'
let l:statusline = statusline#special('StatusLineDusk', 'Manual', '%f')
else
let l:statusline = statusline#generic('StatusLineDusk', 'Idle', v:false)
endif
" Escape spaces and double quotes for use in setlocal.
let l:statusline = substitute(l:statusline, '\([ "]\)', '\\\0', 'g')
execute 'setlocal statusline='.l:statusline
endfunction
" Get statusline mode and update StatusLineLight.
function! statusline#mode()
" Map modes to a human readable name and a color.
let l:mode = {
\ 'n': ['Normal', g:statusline#light_green],
\ 'i': ['Insert', g:statusline#light_blue],
\ 'c': ['Command', g:statusline#light_green],
\ 'v': ['Visual', g:statusline#light_orange],
\ 'V': ['V-Line', g:statusline#light_orange],
\ '': ['V-Block', g:statusline#light_orange],
\ 'R': ['Replace', g:statusline#light_red],
\ 's': ['Select', g:statusline#light_violet],
\ 'S': ['S-Line', g:statusline#light_violet],
\ '': ['S-Block', g:statusline#light_violet],
\ 't': ['Terminal', g:statusline#light_blue],
\ '!': ['Shell', g:statusline#light_grey],
\}[mode()]
" Update the StatusLineLight color.
call s:hi('StatusLineLight', l:mode[1])
return l:mode[0]
endfunction
" Setup autocmds to set the statusline per buffer.
augroup benieStatusLine
autocmd!
" Dynamically update the current buffer mode and color changes using %! to
" call a function which is always evaluated on statusline update.
autocmd BufEnter,WinEnter,BufWinEnter * setlocal statusline=%!statusline#active()
" Statically set the statusline when leaving the buffer.
autocmd BufLeave,WinLeave * call statusline#inactive()
augroup END

117
pythonx/format.py Normal file
View File

@@ -0,0 +1,117 @@
"""Python formatexpr for clang-format & yapf"""
import json
import sys
import subprocess
import difflib
import vim
class FormatError(Exception):
"""A formatting error."""
def clang_format():
"""Call clang-format on the current text object."""
clang_format = vim.vars['clang_format_path']
# TODO: The cursor position before gq is invoked is not preserved in the
# jump list, this expression will return the cursor position at the
# beginning of the motion or text object.
# Is there a way to get the cursor position immediately before gq is
# invoked? So that we can pass the position to clang-format in order for
# it to return the updated position to continue editing.
# Query the current absolute cursor positon.
cursor = int(vim.eval('line2byte(".") + col(".")')) - 2
if cursor < 0:
return
# Determine the lines to format.
startline = int(vim.eval('v:lnum'))
endline = startline + int(vim.eval('v:count')) - 1
lines = f'{startline}:{endline}'
fallback_style = vim.vars['clang_format_style']
# Construct the clang-format command to call.
command = [
clang_format, '-style', 'file', '-cursor',
str(cursor), '-lines', lines, '-fallback-style', fallback_style
]
if vim.current.buffer.name:
command += ['-assume-filename', vim.current.buffer.name]
# Call the clang-format command.
output = call(command)
if not output:
return
# Read the clang-format json header.
header = json.loads(output[0])
if header.get('IncompleteFormat'):
raise FormatError('clang-format: incomplete (syntax errors).')
# Replace the formatted regions.
replace_regions(output[1:])
# Set the updated cursor position.
vim.command('goto %d' % (header['Cursor'] + 1))
def yapf():
"""Call yapf on the current text object."""
yapf = vim.vars['yapf_path']
# Determine the lines to format.
start = int(vim.eval('v:lnum'))
end = start + int(vim.eval('v:count'))
lines = '{0}-{1}'.format(start, end)
style = vim.vars['yapf_style']
# Construct the clang-format command to call.
command = [yapf, '--style', style, '--lines', lines]
# TODO: Since yapf is a Python package, we could import the module and
# call it directly instead. It would then be possible to output better
# error messages and act on the buffer directly.
# Call the yapf command.
output = call(command)
if not output:
return
# Replace the formatted regions.
replace_regions(output[:-1])
def call(command):
"""Call the command to format the text.
Arguments:
command (list): Formatting command to call.
text (str): Text to be passed to stdin of command.
Returns:
list: The output of the formatter split on new lines.
None: If the subprocess failed.
"""
# Don't open a cmd prompt window on Windows.
startupinfo = None
if sys.platform.startswith('win32'):
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
startupinfo.wShowWindow = subprocess.SW_HIDE
# Call the formatting command.
process = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=subprocess.PIPE,
startupinfo=startupinfo)
stdout, stderr = process.communicate(
input='\n'.join(vim.current.buffer).encode('utf-8'))
if stderr:
raise FormatError(stderr)
if not stdout:
raise FormatError('No output from {0}.'.format(command[0]))
# Split the lines into a list of elements.
return stdout.decode('utf-8').split('\n')
def replace_regions(lines):
"""Replace formatted regions in the current buffer.
Arguments:
lines (list): The formatted buffer lines.
"""
matcher = difflib.SequenceMatcher(None, vim.current.buffer, lines)
for tag, i1, i2, j1, j2 in reversed(matcher.get_opcodes()):
if tag != 'equal':
vim.current.buffer[i1:i2] = lines[j1:j2]

541
syntax/ansi.vim Normal file
View File

@@ -0,0 +1,541 @@
" Derived from https://github.com/vim-scripts/AnsiEsc.vim
if has("conceal")
echohl ErrorMsg
echomsg 'vim was not built with the conceal feature'
echohl None
endif
" Make sure that escape sequences are concealed.
setlocal conceallevel=3
setlocal concealcursor=nvc
" suppress escaped sequences that don't involve colors (which may or may not be ansi-compliant)
syn match ansiSuppress conceal '\e\[[0-9;]*[^m]'
syn match ansiSuppress conceal '\e\[?\d*[^m]'
syn match ansiSuppress conceal '\b'
" ------------------------------
" Ansi Escape Sequence Handling: {{{2
" ------------------------------
syn region ansiNone start="\e\[[01;]m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiNone start="\e\[m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlack start="\e\[;\=0\{0,2};\=30m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRed start="\e\[;\=0\{0,2};\=31m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiGreen start="\e\[;\=0\{0,2};\=32m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiYellow start="\e\[;\=0\{0,2};\=33m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlue start="\e\[;\=0\{0,2};\=34m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiMagenta start="\e\[;\=0\{0,2};\=35m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiCyan start="\e\[;\=0\{0,2};\=36m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiWhite start="\e\[;\=0\{0,2};\=37m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlackBg start="\e\[;\=0\{0,2};\=\%(1;\)\=40\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRedBg start="\e\[;\=0\{0,2};\=\%(1;\)\=41\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiGreenBg start="\e\[;\=0\{0,2};\=\%(1;\)\=42\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiYellowBg start="\e\[;\=0\{0,2};\=\%(1;\)\=43\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlueBg start="\e\[;\=0\{0,2};\=\%(1;\)\=44\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiMagentaBg start="\e\[;\=0\{0,2};\=\%(1;\)\=45\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiCyanBg start="\e\[;\=0\{0,2};\=\%(1;\)\=46\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiWhiteBg start="\e\[;\=0\{0,2};\=\%(1;\)\=47\%(1;\)\=m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBoldBlack start="\e\[;\=0\{0,2};\=\%(1;30\|30;1\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBoldRed start="\e\[;\=0\{0,2};\=\%(1;31\|31;1\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBoldGreen start="\e\[;\=0\{0,2};\=\%(1;32\|32;1\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBoldYellow start="\e\[;\=0\{0,2};\=\%(1;33\|33;1\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBoldBlue start="\e\[;\=0\{0,2};\=\%(1;34\|34;1\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBoldMagenta start="\e\[;\=0\{0,2};\=\%(1;35\|35;1\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBoldCyan start="\e\[;\=0\{0,2};\=\%(1;36\|36;1\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBoldWhite start="\e\[;\=0\{0,2};\=\%(1;37\|37;1\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiStandoutBlack start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;30\|30;3\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiStandoutRed start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;31\|31;3\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiStandoutGreen start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;32\|32;3\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiStandoutYellow start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;33\|33;3\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiStandoutBlue start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;34\|34;3\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiStandoutMagenta start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;35\|35;3\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiStandoutCyan start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;36\|36;3\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiStandoutWhite start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(3;37\|37;3\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiItalicBlack start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;30\|30;2\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiItalicRed start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;31\|31;2\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiItalicGreen start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;32\|32;2\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiItalicYellow start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;33\|33;2\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiItalicBlue start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;34\|34;2\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiItalicMagenta start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;35\|35;2\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiItalicCyan start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;36\|36;2\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiItalicWhite start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(2;37\|37;2\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiUnderlineBlack start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;30\|30;4\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiUnderlineRed start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;31\|31;4\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiUnderlineGreen start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;32\|32;4\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiUnderlineYellow start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;33\|33;4\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiUnderlineBlue start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;34\|34;4\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiUnderlineMagenta start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;35\|35;4\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiUnderlineCyan start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;36\|36;4\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiUnderlineWhite start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(4;37\|37;4\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlinkBlack start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;30\|30;5\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlinkRed start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;31\|31;5\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlinkGreen start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;32\|32;5\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlinkYellow start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;33\|33;5\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlinkBlue start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;34\|34;5\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlinkMagenta start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;35\|35;5\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlinkCyan start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;36\|36;5\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlinkWhite start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(5;37\|37;5\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRapidBlinkBlack start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;30\|30;6\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRapidBlinkRed start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;31\|31;6\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRapidBlinkGreen start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;32\|32;6\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRapidBlinkYellow start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;33\|33;6\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRapidBlinkBlue start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;34\|34;6\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRapidBlinkMagenta start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;35\|35;6\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRapidBlinkCyan start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;36\|36;6\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRapidBlinkWhite start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(6;37\|37;6\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRVBlack start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;30\|30;7\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRVRed start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;31\|31;7\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRVGreen start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;32\|32;7\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRVYellow start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;33\|33;7\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRVBlue start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;34\|34;7\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRVMagenta start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;35\|35;7\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRVCyan start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;36\|36;7\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRVWhite start="\e\[;\=0\{0,2};\=\%(1;\)\=\%(7;37\|37;7\)m" end="\e\["me=e-2 contains=ansiConceal
syn match ansiStop conceal "\e\[;\=0\{1,2}m"
syn match ansiStop conceal "\e\[K"
syn match ansiStop conceal "\e\[H"
syn match ansiStop conceal "\e\[2J"
"syn match ansiIgnore conceal "\e\[\([56];3[0-9]\|3[0-9];[56]\)m"
"syn match ansiIgnore conceal "\e\[\([0-9]\+;\)\{2,}[0-9]\+m"
" ---------------------------------------------------------------------
" Some Color Combinations: - can't do 'em all, the qty of highlighting groups is limited! {{{2
" ---------------------------------------------------------------------
syn region ansiBlackBlack start="\e\[0\{0,2};\=\(30;40\|40;30\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRedBlack start="\e\[0\{0,2};\=\(31;40\|40;31\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiGreenBlack start="\e\[0\{0,2};\=\(32;40\|40;32\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiYellowBlack start="\e\[0\{0,2};\=\(33;40\|40;33\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlueBlack start="\e\[0\{0,2};\=\(34;40\|40;34\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiMagentaBlack start="\e\[0\{0,2};\=\(35;40\|40;35\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiCyanBlack start="\e\[0\{0,2};\=\(36;40\|40;36\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiWhiteBlack start="\e\[0\{0,2};\=\(37;40\|40;37\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlackRed start="\e\[0\{0,2};\=\(30;41\|41;30\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRedRed start="\e\[0\{0,2};\=\(31;41\|41;31\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiGreenRed start="\e\[0\{0,2};\=\(32;41\|41;32\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiYellowRed start="\e\[0\{0,2};\=\(33;41\|41;33\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlueRed start="\e\[0\{0,2};\=\(34;41\|41;34\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiMagentaRed start="\e\[0\{0,2};\=\(35;41\|41;35\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiCyanRed start="\e\[0\{0,2};\=\(36;41\|41;36\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiWhiteRed start="\e\[0\{0,2};\=\(37;41\|41;37\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlackGreen start="\e\[0\{0,2};\=\(30;42\|42;30\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRedGreen start="\e\[0\{0,2};\=\(31;42\|42;31\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiGreenGreen start="\e\[0\{0,2};\=\(32;42\|42;32\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiYellowGreen start="\e\[0\{0,2};\=\(33;42\|42;33\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlueGreen start="\e\[0\{0,2};\=\(34;42\|42;34\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiMagentaGreen start="\e\[0\{0,2};\=\(35;42\|42;35\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiCyanGreen start="\e\[0\{0,2};\=\(36;42\|42;36\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiWhiteGreen start="\e\[0\{0,2};\=\(37;42\|42;37\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlackYellow start="\e\[0\{0,2};\=\(30;43\|43;30\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRedYellow start="\e\[0\{0,2};\=\(31;43\|43;31\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiGreenYellow start="\e\[0\{0,2};\=\(32;43\|43;32\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiYellowYellow start="\e\[0\{0,2};\=\(33;43\|43;33\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlueYellow start="\e\[0\{0,2};\=\(34;43\|43;34\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiMagentaYellow start="\e\[0\{0,2};\=\(35;43\|43;35\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiCyanYellow start="\e\[0\{0,2};\=\(36;43\|43;36\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiWhiteYellow start="\e\[0\{0,2};\=\(37;43\|43;37\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlackBlue start="\e\[0\{0,2};\=\(30;44\|44;30\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRedBlue start="\e\[0\{0,2};\=\(31;44\|44;31\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiGreenBlue start="\e\[0\{0,2};\=\(32;44\|44;32\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiYellowBlue start="\e\[0\{0,2};\=\(33;44\|44;33\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlueBlue start="\e\[0\{0,2};\=\(34;44\|44;34\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiMagentaBlue start="\e\[0\{0,2};\=\(35;44\|44;35\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiCyanBlue start="\e\[0\{0,2};\=\(36;44\|44;36\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiWhiteBlue start="\e\[0\{0,2};\=\(37;44\|44;37\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlackMagenta start="\e\[0\{0,2};\=\(30;45\|45;30\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRedMagenta start="\e\[0\{0,2};\=\(31;45\|45;31\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiGreenMagenta start="\e\[0\{0,2};\=\(32;45\|45;32\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiYellowMagenta start="\e\[0\{0,2};\=\(33;45\|45;33\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlueMagenta start="\e\[0\{0,2};\=\(34;45\|45;34\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiMagentaMagenta start="\e\[0\{0,2};\=\(35;45\|45;35\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiCyanMagenta start="\e\[0\{0,2};\=\(36;45\|45;36\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiWhiteMagenta start="\e\[0\{0,2};\=\(37;45\|45;37\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlackCyan start="\e\[0\{0,2};\=\(30;46\|46;30\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRedCyan start="\e\[0\{0,2};\=\(31;46\|46;31\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiGreenCyan start="\e\[0\{0,2};\=\(32;46\|46;32\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiYellowCyan start="\e\[0\{0,2};\=\(33;46\|46;33\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlueCyan start="\e\[0\{0,2};\=\(34;46\|46;34\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiMagentaCyan start="\e\[0\{0,2};\=\(35;46\|46;35\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiCyanCyan start="\e\[0\{0,2};\=\(36;46\|46;36\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiWhiteCyan start="\e\[0\{0,2};\=\(37;46\|46;37\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlackWhite start="\e\[0\{0,2};\=\(30;47\|47;30\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiRedWhite start="\e\[0\{0,2};\=\(31;47\|47;31\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiGreenWhite start="\e\[0\{0,2};\=\(32;47\|47;32\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiYellowWhite start="\e\[0\{0,2};\=\(33;47\|47;33\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiBlueWhite start="\e\[0\{0,2};\=\(34;47\|47;34\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiMagentaWhite start="\e\[0\{0,2};\=\(35;47\|47;35\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiCyanWhite start="\e\[0\{0,2};\=\(36;47\|47;36\)m" end="\e\["me=e-2 contains=ansiConceal
syn region ansiWhiteWhite start="\e\[0\{0,2};\=\(37;47\|47;37\)m" end="\e\["me=e-2 contains=ansiConceal
syn match ansiExtended "\e\[;\=\(0;\)\=[34]8;\(\d*;\)*\d*m" contains=ansiConceal
syn match ansiConceal contained conceal "\e\[\(\d*;\)*\d*m"
" -------------
" Highlighting: {{{2
" -------------
let s:hlkeep_{bufnr("%")}= &l:hl
exe "setlocal hl=".substitute(&hl,'8:[^,]\{-},','8:Ignore,',"")
" handle 3 or more element ansi escape sequences by building syntax and highlighting rules
" specific to the current file
" call s:MultiElementHandler()
hi ansiNone cterm=NONE gui=NONE
if &t_Co == 8 || &t_Co == 256
" ---------------------
" eight-color handling: {{{3
" ---------------------
" call Decho("set up 8-color highlighting groups")
hi ansiBlack ctermfg=black guifg=black cterm=none gui=none
hi ansiRed ctermfg=red guifg=red cterm=none gui=none
hi ansiGreen ctermfg=green guifg=green cterm=none gui=none
hi ansiYellow ctermfg=yellow guifg=yellow cterm=none gui=none
hi ansiBlue ctermfg=blue guifg=blue cterm=none gui=none
hi ansiMagenta ctermfg=magenta guifg=magenta cterm=none gui=none
hi ansiCyan ctermfg=cyan guifg=cyan cterm=none gui=none
hi ansiWhite ctermfg=white guifg=white cterm=none gui=none
hi ansiBlackBg ctermbg=black guibg=black cterm=none gui=none
hi ansiRedBg ctermbg=red guibg=red cterm=none gui=none
hi ansiGreenBg ctermbg=green guibg=green cterm=none gui=none
hi ansiYellowBg ctermbg=yellow guibg=yellow cterm=none gui=none
hi ansiBlueBg ctermbg=blue guibg=blue cterm=none gui=none
hi ansiMagentaBg ctermbg=magenta guibg=magenta cterm=none gui=none
hi ansiCyanBg ctermbg=cyan guibg=cyan cterm=none gui=none
hi ansiWhiteBg ctermbg=white guibg=white cterm=none gui=none
hi ansiBoldBlack ctermfg=black guifg=black cterm=bold gui=bold
hi ansiBoldRed ctermfg=red guifg=red cterm=bold gui=bold
hi ansiBoldGreen ctermfg=green guifg=green cterm=bold gui=bold
hi ansiBoldYellow ctermfg=yellow guifg=yellow cterm=bold gui=bold
hi ansiBoldBlue ctermfg=blue guifg=blue cterm=bold gui=bold
hi ansiBoldMagenta ctermfg=magenta guifg=magenta cterm=bold gui=bold
hi ansiBoldCyan ctermfg=cyan guifg=cyan cterm=bold gui=bold
hi ansiBoldWhite ctermfg=white guifg=white cterm=bold gui=bold
hi ansiStandoutBlack ctermfg=black guifg=black cterm=standout gui=standout
hi ansiStandoutRed ctermfg=red guifg=red cterm=standout gui=standout
hi ansiStandoutGreen ctermfg=green guifg=green cterm=standout gui=standout
hi ansiStandoutYellow ctermfg=yellow guifg=yellow cterm=standout gui=standout
hi ansiStandoutBlue ctermfg=blue guifg=blue cterm=standout gui=standout
hi ansiStandoutMagenta ctermfg=magenta guifg=magenta cterm=standout gui=standout
hi ansiStandoutCyan ctermfg=cyan guifg=cyan cterm=standout gui=standout
hi ansiStandoutWhite ctermfg=white guifg=white cterm=standout gui=standout
hi ansiItalicBlack ctermfg=black guifg=black cterm=italic gui=italic
hi ansiItalicRed ctermfg=red guifg=red cterm=italic gui=italic
hi ansiItalicGreen ctermfg=green guifg=green cterm=italic gui=italic
hi ansiItalicYellow ctermfg=yellow guifg=yellow cterm=italic gui=italic
hi ansiItalicBlue ctermfg=blue guifg=blue cterm=italic gui=italic
hi ansiItalicMagenta ctermfg=magenta guifg=magenta cterm=italic gui=italic
hi ansiItalicCyan ctermfg=cyan guifg=cyan cterm=italic gui=italic
hi ansiItalicWhite ctermfg=white guifg=white cterm=italic gui=italic
hi ansiUnderlineBlack ctermfg=black guifg=black cterm=underline gui=underline
hi ansiUnderlineRed ctermfg=red guifg=red cterm=underline gui=underline
hi ansiUnderlineGreen ctermfg=green guifg=green cterm=underline gui=underline
hi ansiUnderlineYellow ctermfg=yellow guifg=yellow cterm=underline gui=underline
hi ansiUnderlineBlue ctermfg=blue guifg=blue cterm=underline gui=underline
hi ansiUnderlineMagenta ctermfg=magenta guifg=magenta cterm=underline gui=underline
hi ansiUnderlineCyan ctermfg=cyan guifg=cyan cterm=underline gui=underline
hi ansiUnderlineWhite ctermfg=white guifg=white cterm=underline gui=underline
hi ansiBlinkBlack ctermfg=black guifg=black cterm=standout gui=undercurl
hi ansiBlinkRed ctermfg=red guifg=red cterm=standout gui=undercurl
hi ansiBlinkGreen ctermfg=green guifg=green cterm=standout gui=undercurl
hi ansiBlinkYellow ctermfg=yellow guifg=yellow cterm=standout gui=undercurl
hi ansiBlinkBlue ctermfg=blue guifg=blue cterm=standout gui=undercurl
hi ansiBlinkMagenta ctermfg=magenta guifg=magenta cterm=standout gui=undercurl
hi ansiBlinkCyan ctermfg=cyan guifg=cyan cterm=standout gui=undercurl
hi ansiBlinkWhite ctermfg=white guifg=white cterm=standout gui=undercurl
hi ansiRapidBlinkBlack ctermfg=black guifg=black cterm=standout gui=undercurl
hi ansiRapidBlinkRed ctermfg=red guifg=red cterm=standout gui=undercurl
hi ansiRapidBlinkGreen ctermfg=green guifg=green cterm=standout gui=undercurl
hi ansiRapidBlinkYellow ctermfg=yellow guifg=yellow cterm=standout gui=undercurl
hi ansiRapidBlinkBlue ctermfg=blue guifg=blue cterm=standout gui=undercurl
hi ansiRapidBlinkMagenta ctermfg=magenta guifg=magenta cterm=standout gui=undercurl
hi ansiRapidBlinkCyan ctermfg=cyan guifg=cyan cterm=standout gui=undercurl
hi ansiRapidBlinkWhite ctermfg=white guifg=white cterm=standout gui=undercurl
hi ansiRVBlack ctermfg=black guifg=black cterm=reverse gui=reverse
hi ansiRVRed ctermfg=red guifg=red cterm=reverse gui=reverse
hi ansiRVGreen ctermfg=green guifg=green cterm=reverse gui=reverse
hi ansiRVYellow ctermfg=yellow guifg=yellow cterm=reverse gui=reverse
hi ansiRVBlue ctermfg=blue guifg=blue cterm=reverse gui=reverse
hi ansiRVMagenta ctermfg=magenta guifg=magenta cterm=reverse gui=reverse
hi ansiRVCyan ctermfg=cyan guifg=cyan cterm=reverse gui=reverse
hi ansiRVWhite ctermfg=white guifg=white cterm=reverse gui=reverse
hi ansiBlackBlack ctermfg=black ctermbg=black guifg=Black guibg=Black cterm=none gui=none
hi ansiRedBlack ctermfg=red ctermbg=black guifg=Red guibg=Black cterm=none gui=none
hi ansiGreenBlack ctermfg=green ctermbg=black guifg=Green guibg=Black cterm=none gui=none
hi ansiYellowBlack ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black cterm=none gui=none
hi ansiBlueBlack ctermfg=blue ctermbg=black guifg=Blue guibg=Black cterm=none gui=none
hi ansiMagentaBlack ctermfg=magenta ctermbg=black guifg=Magenta guibg=Black cterm=none gui=none
hi ansiCyanBlack ctermfg=cyan ctermbg=black guifg=Cyan guibg=Black cterm=none gui=none
hi ansiWhiteBlack ctermfg=white ctermbg=black guifg=White guibg=Black cterm=none gui=none
hi ansiBlackRed ctermfg=black ctermbg=red guifg=Black guibg=Red cterm=none gui=none
hi ansiRedRed ctermfg=red ctermbg=red guifg=Red guibg=Red cterm=none gui=none
hi ansiGreenRed ctermfg=green ctermbg=red guifg=Green guibg=Red cterm=none gui=none
hi ansiYellowRed ctermfg=yellow ctermbg=red guifg=Yellow guibg=Red cterm=none gui=none
hi ansiBlueRed ctermfg=blue ctermbg=red guifg=Blue guibg=Red cterm=none gui=none
hi ansiMagentaRed ctermfg=magenta ctermbg=red guifg=Magenta guibg=Red cterm=none gui=none
hi ansiCyanRed ctermfg=cyan ctermbg=red guifg=Cyan guibg=Red cterm=none gui=none
hi ansiWhiteRed ctermfg=white ctermbg=red guifg=White guibg=Red cterm=none gui=none
hi ansiBlackGreen ctermfg=black ctermbg=green guifg=Black guibg=Green cterm=none gui=none
hi ansiRedGreen ctermfg=red ctermbg=green guifg=Red guibg=Green cterm=none gui=none
hi ansiGreenGreen ctermfg=green ctermbg=green guifg=Green guibg=Green cterm=none gui=none
hi ansiYellowGreen ctermfg=yellow ctermbg=green guifg=Yellow guibg=Green cterm=none gui=none
hi ansiBlueGreen ctermfg=blue ctermbg=green guifg=Blue guibg=Green cterm=none gui=none
hi ansiMagentaGreen ctermfg=magenta ctermbg=green guifg=Magenta guibg=Green cterm=none gui=none
hi ansiCyanGreen ctermfg=cyan ctermbg=green guifg=Cyan guibg=Green cterm=none gui=none
hi ansiWhiteGreen ctermfg=white ctermbg=green guifg=White guibg=Green cterm=none gui=none
hi ansiBlackYellow ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow cterm=none gui=none
hi ansiRedYellow ctermfg=red ctermbg=yellow guifg=Red guibg=Yellow cterm=none gui=none
hi ansiGreenYellow ctermfg=green ctermbg=yellow guifg=Green guibg=Yellow cterm=none gui=none
hi ansiYellowYellow ctermfg=yellow ctermbg=yellow guifg=Yellow guibg=Yellow cterm=none gui=none
hi ansiBlueYellow ctermfg=blue ctermbg=yellow guifg=Blue guibg=Yellow cterm=none gui=none
hi ansiMagentaYellow ctermfg=magenta ctermbg=yellow guifg=Magenta guibg=Yellow cterm=none gui=none
hi ansiCyanYellow ctermfg=cyan ctermbg=yellow guifg=Cyan guibg=Yellow cterm=none gui=none
hi ansiWhiteYellow ctermfg=white ctermbg=yellow guifg=White guibg=Yellow cterm=none gui=none
hi ansiBlackBlue ctermfg=black ctermbg=blue guifg=Black guibg=Blue cterm=none gui=none
hi ansiRedBlue ctermfg=red ctermbg=blue guifg=Red guibg=Blue cterm=none gui=none
hi ansiGreenBlue ctermfg=green ctermbg=blue guifg=Green guibg=Blue cterm=none gui=none
hi ansiYellowBlue ctermfg=yellow ctermbg=blue guifg=Yellow guibg=Blue cterm=none gui=none
hi ansiBlueBlue ctermfg=blue ctermbg=blue guifg=Blue guibg=Blue cterm=none gui=none
hi ansiMagentaBlue ctermfg=magenta ctermbg=blue guifg=Magenta guibg=Blue cterm=none gui=none
hi ansiCyanBlue ctermfg=cyan ctermbg=blue guifg=Cyan guibg=Blue cterm=none gui=none
hi ansiWhiteBlue ctermfg=white ctermbg=blue guifg=White guibg=Blue cterm=none gui=none
hi ansiBlackMagenta ctermfg=black ctermbg=magenta guifg=Black guibg=Magenta cterm=none gui=none
hi ansiRedMagenta ctermfg=red ctermbg=magenta guifg=Red guibg=Magenta cterm=none gui=none
hi ansiGreenMagenta ctermfg=green ctermbg=magenta guifg=Green guibg=Magenta cterm=none gui=none
hi ansiYellowMagenta ctermfg=yellow ctermbg=magenta guifg=Yellow guibg=Magenta cterm=none gui=none
hi ansiBlueMagenta ctermfg=blue ctermbg=magenta guifg=Blue guibg=Magenta cterm=none gui=none
hi ansiMagentaMagenta ctermfg=magenta ctermbg=magenta guifg=Magenta guibg=Magenta cterm=none gui=none
hi ansiCyanMagenta ctermfg=cyan ctermbg=magenta guifg=Cyan guibg=Magenta cterm=none gui=none
hi ansiWhiteMagenta ctermfg=white ctermbg=magenta guifg=White guibg=Magenta cterm=none gui=none
hi ansiBlackCyan ctermfg=black ctermbg=cyan guifg=Black guibg=Cyan cterm=none gui=none
hi ansiRedCyan ctermfg=red ctermbg=cyan guifg=Red guibg=Cyan cterm=none gui=none
hi ansiGreenCyan ctermfg=green ctermbg=cyan guifg=Green guibg=Cyan cterm=none gui=none
hi ansiYellowCyan ctermfg=yellow ctermbg=cyan guifg=Yellow guibg=Cyan cterm=none gui=none
hi ansiBlueCyan ctermfg=blue ctermbg=cyan guifg=Blue guibg=Cyan cterm=none gui=none
hi ansiMagentaCyan ctermfg=magenta ctermbg=cyan guifg=Magenta guibg=Cyan cterm=none gui=none
hi ansiCyanCyan ctermfg=cyan ctermbg=cyan guifg=Cyan guibg=Cyan cterm=none gui=none
hi ansiWhiteCyan ctermfg=white ctermbg=cyan guifg=White guibg=Cyan cterm=none gui=none
hi ansiBlackWhite ctermfg=black ctermbg=white guifg=Black guibg=White cterm=none gui=none
hi ansiRedWhite ctermfg=red ctermbg=white guifg=Red guibg=White cterm=none gui=none
hi ansiGreenWhite ctermfg=green ctermbg=white guifg=Green guibg=White cterm=none gui=none
hi ansiYellowWhite ctermfg=yellow ctermbg=white guifg=Yellow guibg=White cterm=none gui=none
hi ansiBlueWhite ctermfg=blue ctermbg=white guifg=Blue guibg=White cterm=none gui=none
hi ansiMagentaWhite ctermfg=magenta ctermbg=white guifg=Magenta guibg=White cterm=none gui=none
hi ansiCyanWhite ctermfg=cyan ctermbg=white guifg=Cyan guibg=White cterm=none gui=none
hi ansiWhiteWhite ctermfg=white ctermbg=white guifg=White guibg=White cterm=none gui=none
if v:version >= 700 && exists("&t_Co") && &t_Co == 256 && exists("g:ansiesc_256color")
" ---------------------------
" handle 256-color terminals: {{{3
" ---------------------------
" call Decho("set up 256-color highlighting groups")
let icolor= 1
while icolor < 256
let jcolor= 1
exe "hi ansiHL_".icolor."_0 ctermfg=".icolor
exe "hi ansiHL_0_".icolor." ctermbg=".icolor
" call Decho("exe hi ansiHL_".icolor." ctermfg=".icolor)
while jcolor < 256
exe "hi ansiHL_".icolor."_".jcolor." ctermfg=".icolor." ctermbg=".jcolor
" call Decho("exe hi ansiHL_".icolor."_".jcolor." ctermfg=".icolor." ctermbg=".jcolor)
let jcolor= jcolor + 1
endwhile
let icolor= icolor + 1
endwhile
endif
else
" ----------------------------------
" not 8 or 256 color terminals (gui): {{{3
" ----------------------------------
" call Decho("set up gui highlighting groups")
hi ansiBlack ctermfg=black guifg=black cterm=none gui=none
hi ansiRed ctermfg=red guifg=red cterm=none gui=none
hi ansiGreen ctermfg=green guifg=green cterm=none gui=none
hi ansiYellow ctermfg=yellow guifg=yellow cterm=none gui=none
hi ansiBlue ctermfg=blue guifg=blue cterm=none gui=none
hi ansiMagenta ctermfg=magenta guifg=magenta cterm=none gui=none
hi ansiCyan ctermfg=cyan guifg=cyan cterm=none gui=none
hi ansiWhite ctermfg=white guifg=white cterm=none gui=none
hi ansiBlackBg ctermbg=black guibg=black cterm=none gui=none
hi ansiRedBg ctermbg=red guibg=red cterm=none gui=none
hi ansiGreenBg ctermbg=green guibg=green cterm=none gui=none
hi ansiYellowBg ctermbg=yellow guibg=yellow cterm=none gui=none
hi ansiBlueBg ctermbg=blue guibg=blue cterm=none gui=none
hi ansiMagentaBg ctermbg=magenta guibg=magenta cterm=none gui=none
hi ansiCyanBg ctermbg=cyan guibg=cyan cterm=none gui=none
hi ansiWhiteBg ctermbg=white guibg=white cterm=none gui=none
hi ansiBoldBlack ctermfg=black guifg=black cterm=bold gui=bold
hi ansiBoldRed ctermfg=red guifg=red cterm=bold gui=bold
hi ansiBoldGreen ctermfg=green guifg=green cterm=bold gui=bold
hi ansiBoldYellow ctermfg=yellow guifg=yellow cterm=bold gui=bold
hi ansiBoldBlue ctermfg=blue guifg=blue cterm=bold gui=bold
hi ansiBoldMagenta ctermfg=magenta guifg=magenta cterm=bold gui=bold
hi ansiBoldCyan ctermfg=cyan guifg=cyan cterm=bold gui=bold
hi ansiBoldWhite ctermfg=white guifg=white cterm=bold gui=bold
hi ansiStandoutBlack ctermfg=black guifg=black cterm=standout gui=standout
hi ansiStandoutRed ctermfg=red guifg=red cterm=standout gui=standout
hi ansiStandoutGreen ctermfg=green guifg=green cterm=standout gui=standout
hi ansiStandoutYellow ctermfg=yellow guifg=yellow cterm=standout gui=standout
hi ansiStandoutBlue ctermfg=blue guifg=blue cterm=standout gui=standout
hi ansiStandoutMagenta ctermfg=magenta guifg=magenta cterm=standout gui=standout
hi ansiStandoutCyan ctermfg=cyan guifg=cyan cterm=standout gui=standout
hi ansiStandoutWhite ctermfg=white guifg=white cterm=standout gui=standout
hi ansiItalicBlack ctermfg=black guifg=black cterm=italic gui=italic
hi ansiItalicRed ctermfg=red guifg=red cterm=italic gui=italic
hi ansiItalicGreen ctermfg=green guifg=green cterm=italic gui=italic
hi ansiItalicYellow ctermfg=yellow guifg=yellow cterm=italic gui=italic
hi ansiItalicBlue ctermfg=blue guifg=blue cterm=italic gui=italic
hi ansiItalicMagenta ctermfg=magenta guifg=magenta cterm=italic gui=italic
hi ansiItalicCyan ctermfg=cyan guifg=cyan cterm=italic gui=italic
hi ansiItalicWhite ctermfg=white guifg=white cterm=italic gui=italic
hi ansiUnderlineBlack ctermfg=black guifg=black cterm=underline gui=underline
hi ansiUnderlineRed ctermfg=red guifg=red cterm=underline gui=underline
hi ansiUnderlineGreen ctermfg=green guifg=green cterm=underline gui=underline
hi ansiUnderlineYellow ctermfg=yellow guifg=yellow cterm=underline gui=underline
hi ansiUnderlineBlue ctermfg=blue guifg=blue cterm=underline gui=underline
hi ansiUnderlineMagenta ctermfg=magenta guifg=magenta cterm=underline gui=underline
hi ansiUnderlineCyan ctermfg=cyan guifg=cyan cterm=underline gui=underline
hi ansiUnderlineWhite ctermfg=white guifg=white cterm=underline gui=underline
hi ansiBlinkBlack ctermfg=black guifg=black cterm=standout gui=undercurl
hi ansiBlinkRed ctermfg=red guifg=red cterm=standout gui=undercurl
hi ansiBlinkGreen ctermfg=green guifg=green cterm=standout gui=undercurl
hi ansiBlinkYellow ctermfg=yellow guifg=yellow cterm=standout gui=undercurl
hi ansiBlinkBlue ctermfg=blue guifg=blue cterm=standout gui=undercurl
hi ansiBlinkMagenta ctermfg=magenta guifg=magenta cterm=standout gui=undercurl
hi ansiBlinkCyan ctermfg=cyan guifg=cyan cterm=standout gui=undercurl
hi ansiBlinkWhite ctermfg=white guifg=white cterm=standout gui=undercurl
hi ansiRapidBlinkBlack ctermfg=black guifg=black cterm=standout gui=undercurl
hi ansiRapidBlinkRed ctermfg=red guifg=red cterm=standout gui=undercurl
hi ansiRapidBlinkGreen ctermfg=green guifg=green cterm=standout gui=undercurl
hi ansiRapidBlinkYellow ctermfg=yellow guifg=yellow cterm=standout gui=undercurl
hi ansiRapidBlinkBlue ctermfg=blue guifg=blue cterm=standout gui=undercurl
hi ansiRapidBlinkMagenta ctermfg=magenta guifg=magenta cterm=standout gui=undercurl
hi ansiRapidBlinkCyan ctermfg=cyan guifg=cyan cterm=standout gui=undercurl
hi ansiRapidBlinkWhite ctermfg=white guifg=white cterm=standout gui=undercurl
hi ansiRVBlack ctermfg=black guifg=black cterm=reverse gui=reverse
hi ansiRVRed ctermfg=red guifg=red cterm=reverse gui=reverse
hi ansiRVGreen ctermfg=green guifg=green cterm=reverse gui=reverse
hi ansiRVYellow ctermfg=yellow guifg=yellow cterm=reverse gui=reverse
hi ansiRVBlue ctermfg=blue guifg=blue cterm=reverse gui=reverse
hi ansiRVMagenta ctermfg=magenta guifg=magenta cterm=reverse gui=reverse
hi ansiRVCyan ctermfg=cyan guifg=cyan cterm=reverse gui=reverse
hi ansiRVWhite ctermfg=white guifg=white cterm=reverse gui=reverse
hi ansiBlackBlack ctermfg=black ctermbg=black guifg=Black guibg=Black cterm=none gui=none
hi ansiRedBlack ctermfg=black ctermbg=black guifg=Black guibg=Black cterm=none gui=none
hi ansiRedBlack ctermfg=red ctermbg=black guifg=Red guibg=Black cterm=none gui=none
hi ansiGreenBlack ctermfg=green ctermbg=black guifg=Green guibg=Black cterm=none gui=none
hi ansiYellowBlack ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black cterm=none gui=none
hi ansiBlueBlack ctermfg=blue ctermbg=black guifg=Blue guibg=Black cterm=none gui=none
hi ansiMagentaBlack ctermfg=magenta ctermbg=black guifg=Magenta guibg=Black cterm=none gui=none
hi ansiCyanBlack ctermfg=cyan ctermbg=black guifg=Cyan guibg=Black cterm=none gui=none
hi ansiWhiteBlack ctermfg=white ctermbg=black guifg=White guibg=Black cterm=none gui=none
hi ansiBlackRed ctermfg=black ctermbg=red guifg=Black guibg=Red cterm=none gui=none
hi ansiRedRed ctermfg=red ctermbg=red guifg=Red guibg=Red cterm=none gui=none
hi ansiGreenRed ctermfg=green ctermbg=red guifg=Green guibg=Red cterm=none gui=none
hi ansiYellowRed ctermfg=yellow ctermbg=red guifg=Yellow guibg=Red cterm=none gui=none
hi ansiBlueRed ctermfg=blue ctermbg=red guifg=Blue guibg=Red cterm=none gui=none
hi ansiMagentaRed ctermfg=magenta ctermbg=red guifg=Magenta guibg=Red cterm=none gui=none
hi ansiCyanRed ctermfg=cyan ctermbg=red guifg=Cyan guibg=Red cterm=none gui=none
hi ansiWhiteRed ctermfg=white ctermbg=red guifg=White guibg=Red cterm=none gui=none
hi ansiBlackGreen ctermfg=black ctermbg=green guifg=Black guibg=Green cterm=none gui=none
hi ansiRedGreen ctermfg=red ctermbg=green guifg=Red guibg=Green cterm=none gui=none
hi ansiGreenGreen ctermfg=green ctermbg=green guifg=Green guibg=Green cterm=none gui=none
hi ansiYellowGreen ctermfg=yellow ctermbg=green guifg=Yellow guibg=Green cterm=none gui=none
hi ansiBlueGreen ctermfg=blue ctermbg=green guifg=Blue guibg=Green cterm=none gui=none
hi ansiMagentaGreen ctermfg=magenta ctermbg=green guifg=Magenta guibg=Green cterm=none gui=none
hi ansiCyanGreen ctermfg=cyan ctermbg=green guifg=Cyan guibg=Green cterm=none gui=none
hi ansiWhiteGreen ctermfg=white ctermbg=green guifg=White guibg=Green cterm=none gui=none
hi ansiBlackYellow ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow cterm=none gui=none
hi ansiRedYellow ctermfg=red ctermbg=yellow guifg=Red guibg=Yellow cterm=none gui=none
hi ansiGreenYellow ctermfg=green ctermbg=yellow guifg=Green guibg=Yellow cterm=none gui=none
hi ansiYellowYellow ctermfg=yellow ctermbg=yellow guifg=Yellow guibg=Yellow cterm=none gui=none
hi ansiBlueYellow ctermfg=blue ctermbg=yellow guifg=Blue guibg=Yellow cterm=none gui=none
hi ansiMagentaYellow ctermfg=magenta ctermbg=yellow guifg=Magenta guibg=Yellow cterm=none gui=none
hi ansiCyanYellow ctermfg=cyan ctermbg=yellow guifg=Cyan guibg=Yellow cterm=none gui=none
hi ansiWhiteYellow ctermfg=white ctermbg=yellow guifg=White guibg=Yellow cterm=none gui=none
hi ansiBlackBlue ctermfg=black ctermbg=blue guifg=Black guibg=Blue cterm=none gui=none
hi ansiRedBlue ctermfg=red ctermbg=blue guifg=Red guibg=Blue cterm=none gui=none
hi ansiGreenBlue ctermfg=green ctermbg=blue guifg=Green guibg=Blue cterm=none gui=none
hi ansiYellowBlue ctermfg=yellow ctermbg=blue guifg=Yellow guibg=Blue cterm=none gui=none
hi ansiBlueBlue ctermfg=blue ctermbg=blue guifg=Blue guibg=Blue cterm=none gui=none
hi ansiMagentaBlue ctermfg=magenta ctermbg=blue guifg=Magenta guibg=Blue cterm=none gui=none
hi ansiCyanBlue ctermfg=cyan ctermbg=blue guifg=Cyan guibg=Blue cterm=none gui=none
hi ansiWhiteBlue ctermfg=white ctermbg=blue guifg=White guibg=Blue cterm=none gui=none
hi ansiBlackMagenta ctermfg=black ctermbg=magenta guifg=Black guibg=Magenta cterm=none gui=none
hi ansiRedMagenta ctermfg=red ctermbg=magenta guifg=Red guibg=Magenta cterm=none gui=none
hi ansiGreenMagenta ctermfg=green ctermbg=magenta guifg=Green guibg=Magenta cterm=none gui=none
hi ansiYellowMagenta ctermfg=yellow ctermbg=magenta guifg=Yellow guibg=Magenta cterm=none gui=none
hi ansiBlueMagenta ctermfg=blue ctermbg=magenta guifg=Blue guibg=Magenta cterm=none gui=none
hi ansiMagentaMagenta ctermfg=magenta ctermbg=magenta guifg=Magenta guibg=Magenta cterm=none gui=none
hi ansiCyanMagenta ctermfg=cyan ctermbg=magenta guifg=Cyan guibg=Magenta cterm=none gui=none
hi ansiWhiteMagenta ctermfg=white ctermbg=magenta guifg=White guibg=Magenta cterm=none gui=none
hi ansiBlackCyan ctermfg=black ctermbg=cyan guifg=Black guibg=Cyan cterm=none gui=none
hi ansiRedCyan ctermfg=red ctermbg=cyan guifg=Red guibg=Cyan cterm=none gui=none
hi ansiGreenCyan ctermfg=green ctermbg=cyan guifg=Green guibg=Cyan cterm=none gui=none
hi ansiYellowCyan ctermfg=yellow ctermbg=cyan guifg=Yellow guibg=Cyan cterm=none gui=none
hi ansiBlueCyan ctermfg=blue ctermbg=cyan guifg=Blue guibg=Cyan cterm=none gui=none
hi ansiMagentaCyan ctermfg=magenta ctermbg=cyan guifg=Magenta guibg=Cyan cterm=none gui=none
hi ansiCyanCyan ctermfg=cyan ctermbg=cyan guifg=Cyan guibg=Cyan cterm=none gui=none
hi ansiWhiteCyan ctermfg=white ctermbg=cyan guifg=White guibg=Cyan cterm=none gui=none
hi ansiBlackWhite ctermfg=black ctermbg=white guifg=Black guibg=White cterm=none gui=none
hi ansiRedWhite ctermfg=red ctermbg=white guifg=Red guibg=White cterm=none gui=none
hi ansiGreenWhite ctermfg=green ctermbg=white guifg=Green guibg=White cterm=none gui=none
hi ansiYellowWhite ctermfg=yellow ctermbg=white guifg=Yellow guibg=White cterm=none gui=none
hi ansiBlueWhite ctermfg=blue ctermbg=white guifg=Blue guibg=White cterm=none gui=none
hi ansiMagentaWhite ctermfg=magenta ctermbg=white guifg=Magenta guibg=White cterm=none gui=none
hi ansiCyanWhite ctermfg=cyan ctermbg=white guifg=Cyan guibg=White cterm=none gui=none
hi ansiWhiteWhite ctermfg=white ctermbg=white guifg=White guibg=White cterm=none gui=none
endif

17
syntax/cmakecache.vim Normal file
View File

@@ -0,0 +1,17 @@
if exists('b:current_syntax')
finish
endif
highlight default link cmakecacheComment Comment
highlight default link cmakecacheVariable Identifier
highlight default link cmakecacheType Type
highlight default link cmakecacheValue String
highlight default link cmakecacheDelimiter Delimiter
syntax region cmakecacheComment start='#' end='$'
syntax region cmakecacheComment start='//' end='$'
syntax region cmakecacheVariable matchgroup=cmakecacheDelimiter start='^\ze\w\+' end=':'
syntax keyword cmakecacheType
\ BOOL PATH FILEPATH STRING INTERNAL STATIC UNINITIALIZED
syntax region cmakecacheValue start='=\zs' end='$' contains=cmakecacheDelimiter
syntax match cmakecacheDelimiter ';' contained

8
syntax/console.vim Normal file
View File

@@ -0,0 +1,8 @@
if exists('b:current_syntax')
finish
endif
syntax region consoleCommand matchgroup=consolePrompt start='^\s*\$' skip='\\$' end='$'
highlight link consoleCommand Special
highlight consolePrompt cterm=bold gui=bold

View File

@@ -71,8 +71,9 @@ if !exists('cpp_no_cpp14')
endif endif
" C++17 " C++17
if !exists('cpp_no_cpp17') if exists('cpp_experimental') && !exists('cpp_no_cpp17')
" Attribute Specifier Sequence " Attribute Specifier Sequence
" FIXME: This matches range-for and switch case statements
" Match: [[using attribute-namespace: attribute-list]] " Match: [[using attribute-namespace: attribute-list]]
syn match cppAttributeUsingNamespace '\s\+\zs\w\+\ze\s*:' contained contains=cppAttributeUsing syn match cppAttributeUsingNamespace '\s\+\zs\w\+\ze\s*:' contained contains=cppAttributeUsing
syn keyword cppAttributeUsing using contained syn keyword cppAttributeUsing using contained
@@ -86,7 +87,7 @@ if !exists('cpp_no_cpp17')
endif endif
" C++20 " C++20
if !exists('cpp_no_cpp20') if exists('cpp_experimental') && !exists('cpp_no_cpp20')
syn keyword cppStatement concept requires syn keyword cppStatement concept requires
" TODO: Attribute Specifier Sequence " TODO: Attribute Specifier Sequence
@@ -108,6 +109,7 @@ endif
if !exists('cpp_no_function') if !exists('cpp_no_function')
" Match function expressions: expr<T>() " Match function expressions: expr<T>()
" ^^^^ " ^^^^
" TODO: change .* to a not be greedy
syn match cppFunction '\h\w*\ze<.*>\s*(' display syn match cppFunction '\h\w*\ze<.*>\s*(' display
hi default link cppFunction Function hi default link cppFunction Function

View File

@@ -38,8 +38,9 @@ syn match groovyNumber "\<\(0[bB][0-1]\+\|0[0-7]*\|0[xX]\x\+\|\d\(\d\|_\d\)*\)[l
syn match groovyNumber "\(\<\d\(\d\|_\d\)*\.\(\d\(\d\|_\d\)*\)\=\|\.\d\(\d\|_\d\)*\)\([eE][-+]\=\d\(\d\|_\d\)*\)\=[fFdD]\=" syn match groovyNumber "\(\<\d\(\d\|_\d\)*\.\(\d\(\d\|_\d\)*\)\=\|\.\d\(\d\|_\d\)*\)\([eE][-+]\=\d\(\d\|_\d\)*\)\=[fFdD]\="
syn match groovyNumber "\<\d\(\d\|_\d\)*[eE][-+]\=\d\(\d\|_\d\)*[fFdD]\=\>" syn match groovyNumber "\<\d\(\d\|_\d\)*[eE][-+]\=\d\(\d\|_\d\)*[fFdD]\=\>"
syn match groovyNumber "\<\d\(\d\|_\d\)*\([eE][-+]\=\d\(\d\|_\d\)*\)\=[fFdD]\>" syn match groovyNumber "\<\d\(\d\|_\d\)*\([eE][-+]\=\d\(\d\|_\d\)*\)\=[fFdD]\>"
syn region groovyComment start='\/\*' end='\*\/' fold syn match groovyTodo "\(TODO\|FIXME\)" contained
syn match groovyComment '\/\/.*$' syn region groovyComment start='\/\*' end='\*\/' contains=groovyTodo fold
syn match groovyComment '\/\/.*$' contains=groovyTodo
syn match groovyDelimiter '[()\[\]]' syn match groovyDelimiter '[()\[\]]'
syn region groovyBlock matchgroup=groovyDelimiter start='{' end='}' transparent fold syn region groovyBlock matchgroup=groovyDelimiter start='{' end='}' transparent fold
syn match groovyStructure '\w\+\ze\s*{' syn match groovyStructure '\w\+\ze\s*{'
@@ -71,6 +72,7 @@ hi default link groovyAssert Keyword
hi default link groovyBoolean Boolean hi default link groovyBoolean Boolean
hi default link groovyBranch Conditional hi default link groovyBranch Conditional
hi default link groovyClassDecl Structure hi default link groovyClassDecl Structure
hi default link groovyTodo Todo
hi default link groovyComment Comment hi default link groovyComment Comment
hi default link groovyConditional Conditional hi default link groovyConditional Conditional
hi default link groovyConstant Constant hi default link groovyConstant Constant

View File

@@ -1,11 +1,11 @@
" Vim syntax file " Vim syntax file
" Language: llvm " Language: llvm
" Maintainer: The LLVM team, http://llvm.org/ " Maintainer: The LLVM team, http://llvm.org/
" Version: $Revision: 137806 $ " Version: $Revision$
if version < 600 if v:version < 600
syntax clear syntax clear
elseif exists("b:current_syntax") elseif exists('b:current_syntax')
finish finish
endif endif
@@ -14,75 +14,199 @@ syn case match
" Types. " Types.
" Types also include struct, array, vector, etc. but these don't " Types also include struct, array, vector, etc. but these don't
" benefit as much from having dedicated highlighting rules. " benefit as much from having dedicated highlighting rules.
syn keyword llvmType void float double syn keyword llvmType void half float double x86_fp80 fp128 ppc_fp128
syn keyword llvmType x86_fp80 fp128 ppc_fp128 syn keyword llvmType label metadata x86_mmx
syn keyword llvmType type label opaque syn keyword llvmType type label opaque token
syn match llvmType /\<i\d\+\>/ syn match llvmType /\<i\d\+\>/
" Instructions. " Instructions.
" The true and false tokens can be used for comparison opcodes, but it's " The true and false tokens can be used for comparison opcodes, but it's
" much more common for these tokens to be used for boolean constants. " much more common for these tokens to be used for boolean constants.
syn keyword llvmStatement add fadd sub fsub mul fmul syn keyword llvmStatement add addrspacecast alloca and arcp ashr atomicrmw
syn keyword llvmStatement sdiv udiv fdiv srem urem frem syn keyword llvmStatement bitcast br catchpad catchswitch catchret call
syn keyword llvmStatement and or xor syn keyword llvmStatement cleanuppad cleanupret cmpxchg eq exact extractelement
syn keyword llvmStatement icmp fcmp syn keyword llvmStatement extractvalue fadd fast fcmp fdiv fence fmul fpext
syn keyword llvmStatement eq ne ugt uge ult ule sgt sge slt sle syn keyword llvmStatement fptosi fptoui fptrunc free frem fsub getelementptr
syn keyword llvmStatement oeq ogt oge olt ole one ord ueq ugt uge syn keyword llvmStatement icmp inbounds indirectbr insertelement insertvalue
syn keyword llvmStatement ult ule une uno syn keyword llvmStatement inttoptr invoke landingpad load lshr malloc max min
syn keyword llvmStatement nuw nsw exact inbounds syn keyword llvmStatement mul nand ne ninf nnan nsw nsz nuw oeq oge ogt ole
syn keyword llvmStatement phi call select shl lshr ashr va_arg syn keyword llvmStatement olt one or ord phi ptrtoint resume ret sdiv select
syn keyword llvmStatement trunc zext sext syn keyword llvmStatement sext sge sgt shl shufflevector sitofp sle slt srem
syn keyword llvmStatement fptrunc fpext fptoui fptosi uitofp sitofp syn keyword llvmStatement store sub switch trunc udiv ueq uge ugt uitofp ule ult
syn keyword llvmStatement ptrtoint inttoptr bitcast syn keyword llvmStatement umax umin une uno unreachable unwind urem va_arg
syn keyword llvmStatement ret br indirectbr switch invoke unwind unreachable syn keyword llvmStatement xchg xor zext
syn keyword llvmStatement malloc alloca free load store getelementptr
syn keyword llvmStatement extractelement insertelement shufflevector
syn keyword llvmStatement extractvalue insertvalue
" Keywords. " Keywords.
syn keyword llvmKeyword define declare global constant syn keyword llvmKeyword
syn keyword llvmKeyword internal external private \ acq_rel
syn keyword llvmKeyword linkonce linkonce_odr weak weak_odr appending \ acquire
syn keyword llvmKeyword common extern_weak \ addrspace
syn keyword llvmKeyword thread_local dllimport dllexport \ alias
syn keyword llvmKeyword hidden protected default \ align
syn keyword llvmKeyword except deplibs \ alignstack
syn keyword llvmKeyword volatile fastcc coldcc cc ccc \ alwaysinline
syn keyword llvmKeyword x86_stdcallcc x86_fastcallcc \ appending
syn keyword llvmKeyword ptx_kernel ptx_device \ argmemonly
syn keyword llvmKeyword signext zeroext inreg sret nounwind noreturn \ arm_aapcscc
syn keyword llvmKeyword nocapture byval nest readnone readonly noalias uwtable \ arm_aapcs_vfpcc
syn keyword llvmKeyword inlinehint noinline alwaysinline optsize ssp sspreq \ arm_apcscc
syn keyword llvmKeyword noredzone noimplicitfloat naked alignstack \ asm
syn keyword llvmKeyword module asm align tail to \ atomic
syn keyword llvmKeyword addrspace section alias sideeffect c gc \ available_externally
syn keyword llvmKeyword target datalayout triple \ blockaddress
syn keyword llvmKeyword blockaddress \ builtin
\ byval
\ c
\ catch
\ caller
\ cc
\ ccc
\ cleanup
\ coldcc
\ comdat
\ common
\ constant
\ datalayout
\ declare
\ default
\ define
\ deplibs
\ dereferenceable
\ distinct
\ dllexport
\ dllimport
\ dso_local
\ dso_preemptable
\ except
\ external
\ externally_initialized
\ extern_weak
\ fastcc
\ filter
\ from
\ gc
\ global
\ hhvmcc
\ hhvm_ccc
\ hidden
\ initialexec
\ inlinehint
\ inreg
\ inteldialect
\ intel_ocl_bicc
\ internal
\ linkonce
\ linkonce_odr
\ localdynamic
\ localexec
\ local_unnamed_addr
\ minsize
\ module
\ monotonic
\ msp430_intrcc
\ musttail
\ naked
\ nest
\ noalias
\ nobuiltin
\ nocapture
\ noimplicitfloat
\ noinline
\ nonlazybind
\ nonnull
\ norecurse
\ noredzone
\ noreturn
\ nounwind
\ optnone
\ optsize
\ personality
\ private
\ protected
\ ptx_device
\ ptx_kernel
\ readnone
\ readonly
\ release
\ returned
\ returns_twice
\ sanitize_address
\ sanitize_memory
\ sanitize_thread
\ section
\ seq_cst
\ sideeffect
\ signext
\ syncscope
\ source_filename
\ speculatable
\ spir_func
\ spir_kernel
\ sret
\ ssp
\ sspreq
\ sspstrong
\ strictfp
\ swiftcc
\ tail
\ target
\ thread_local
\ to
\ triple
\ unnamed_addr
\ unordered
\ uselistorder
\ uselistorder_bb
\ uwtable
\ volatile
\ weak
\ weak_odr
\ within
\ writeonly
\ x86_64_sysvcc
\ win64cc
\ x86_fastcallcc
\ x86_stdcallcc
\ x86_thiscallcc
\ zeroext
" Obsolete keywords. " Obsolete keywords.
syn keyword llvmError getresult begin end syn keyword llvmError getresult begin end
" Misc syntax. " Misc syntax.
syn match llvmNoName /[%@]\d\+\>/ syn match llvmNoName /[%@!]\d\+\>/
syn match llvmNumber /-\?\<\d\+\>/ syn match llvmNumber /-\?\<\d\+\>/
syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/ syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
syn match llvmFloat /\<0x\x\+\>/ syn match llvmFloat /\<0x\x\+\>/
syn keyword llvmBoolean true false syn keyword llvmBoolean true false
syn keyword llvmConstant zeroinitializer undef null syn keyword llvmConstant zeroinitializer undef null none
syn match llvmComment /;.*$/ contains=@Spell syn match llvmTodo /\(TODO\|FIXME\|XXX\)/
syn match llvmComment /;.*$/ contains=llvmTodo
syn region llvmString start=/"/ skip=/\\"/ end=/"/ syn region llvmString start=/"/ skip=/\\"/ end=/"/
syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/ syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/
syn match llvmIdentifier /[%@][-a-zA-Z$._][-a-zA-Z$._0-9]*/ syn match llvmIdentifier /[%@][-a-zA-Z$._][-a-zA-Z$._0-9]*/
" Syntax-highlight dejagnu test commands. " Named metadata and specialized metadata keywords.
syn match llvmSpecialComment /;\s*RUN:.*$/ syn match llvmIdentifier /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*$/
syn match llvmSpecialComment /;\s*PR\d*\s*$/ syn match llvmIdentifier /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*[=!]/
syn match llvmSpecialComment /;\s*END\.\s*$/ syn match llvmType /!\zs\a\+\ze\s*(/
syn match llvmSpecialComment /;\s*XFAIL:.*$/ syn match llvmConstant /\<DW_TAG_[a-z_]\+\>/
syn match llvmSpecialComment /;\s*XTARGET:.*$/ syn match llvmConstant /\<DW_ATE_[a-zA-Z_]\+\>/
syn match llvmConstant /\<DW_OP_[a-zA-Z0-9_]\+\>/
syn match llvmConstant /\<DW_LANG_[a-zA-Z0-9_]\+\>/
syn match llvmConstant /\<DW_VIRTUALITY_[a-z_]\+\>/
syn match llvmConstant /\<DIFlag[A-Za-z]\+\>/
if version >= 508 || !exists("did_c_syn_inits") " Syntax-highlight lit test commands and bug numbers.
if version < 508 syn match llvmSpecialComment /;\s*PR\d*\s*$/
syn match llvmSpecialComment /;\s*REQUIRES:.*$/
syn match llvmSpecialComment /;\s*RUN:.*$/
syn match llvmSpecialComment /;\s*CHECK:.*$/
syn match llvmSpecialComment "\v;\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL):.*$"
syn match llvmSpecialComment /;\s*XFAIL:.*$/
if v:version >= 508 || !exists('did_c_syn_inits')
if v:version < 508
let did_c_syn_inits = 1 let did_c_syn_inits = 1
command -nargs=+ HiLink hi link <args> command -nargs=+ HiLink hi link <args>
else else
@@ -92,6 +216,7 @@ if version >= 508 || !exists("did_c_syn_inits")
HiLink llvmType Type HiLink llvmType Type
HiLink llvmStatement Statement HiLink llvmStatement Statement
HiLink llvmNumber Number HiLink llvmNumber Number
HiLink llvmTodo Todo
HiLink llvmComment Comment HiLink llvmComment Comment
HiLink llvmString String HiLink llvmString String
HiLink llvmLabel Label HiLink llvmLabel Label
@@ -107,4 +232,4 @@ if version >= 508 || !exists("did_c_syn_inits")
delcommand HiLink delcommand HiLink
endif endif
let b:current_syntax = "llvm" let b:current_syntax = 'llvm'

11
syntax/requirements.vim Normal file
View File

@@ -0,0 +1,11 @@
if exists('b:current_syntax')
finish
endif
highlight default link requirementsComment Comment
highlight default link requirementsVersion Identifier
highlight default link requirementsOperator Operator
syntax region requirementsComment start='^\w*#' end='$' contains=@Spell
syntax match requirementsVersion '\d\+\.\d\+\.\d\+\w*'
syntax match requirementsOperator '=='

10
syntax/sanitizer.vim Normal file
View File

@@ -0,0 +1,10 @@
if exists('b:current_syntax')
finish
endif
syntax include @sanitizerCppSyntax syntax/cpp.vim
syntax region sanitizerBacktraceRegion matchgroup=sanitizerBacktrace start='\s\+\zs#\d\+' end='(.*)' oneline
syntax region sanitizerBacktraceRegion matchgroup=sanitizerBacktrace start='\s\+\zs#\d\+' end='\(\/.*\)\+:\d\+:\d\+ (.*)' oneline contains=@sanitizerCppSyntax
highlight default link sanitizerBacktrace Comment

17
tasks.yaml Normal file
View File

@@ -0,0 +1,17 @@
---
- include_vars: ~/.config/nvim/vars.yaml
- name: clone plugin repos
when: ansible_os_family != "Windows"
git:
repo: 'https://github.com/{{item.repo}}.git'
dest: '~/.config/nvim/pack/minpac/{{lookup("vars", "item.mode", default="start")}}/{{item.repo | regex_replace("^.*\/(.*)$", "\1")}}'
version: '{{lookup("vars", "item.branch", default="HEAD")}}'
with_items: '{{plugins}}'
- name: clone plugin repos
when: ansible_os_family == "Windows"
win_git:
repo: 'https://github.com/{{item.repo}}.git'
dest: '{{ansible_env.LOCALAPPDATA}}/nvim/pack/minpac/{{lookup("vars", "item.mode", default="start")}}/{{item.repo | regex_replace("^.*\/(.*)$", "\1")}}'
version: '{{lookup("vars", "item.branch", default="HEAD")}}'

View File

@@ -0,0 +1,15 @@
# TODO
## High
* [ ]
## Normal
* [ ]
## Low
* [ ]
<!-- vim: nospell textwidth=0

66
vars.yaml Normal file
View File

@@ -0,0 +1,66 @@
---
plugins:
- repo: mkitt/tabline.vim
- repo: neoclide/coc.nvim
branch: release
- repo: SirVer/ultisnips
- repo: honza/vim-snippets
- repo: vim-scripts/vimomni
mode: opt
- repo: w0rp/ale
- repo: mhinz/vim-signify
# Text Objects
- repo: kana/vim-textobj-user
# TODO: Doesn't work with nvim
- repo: kana/vim-textobj-entire
- repo: sgur/vim-textobj-parameter
- repo: jceb/vim-textobj-uri
- repo: glts/vim-textobj-comment
- repo: reedes/vim-textobj-sentence
# Tim Pope
- repo: tpope/vim-commentary
- repo: tpope/vim-surround
- repo: tpope/vim-repeat
- repo: tpope/vim-fugitive
- repo: tpope/vim-eunuch
- repo: tpope/vim-vinegar
- repo: tpope/vim-abolish
- repo: tpope/vim-unimpaired
- repo: tpope/vim-speeddating
- repo: godbyk/vim-endwise
branch: patch-1
- repo: tpope/vim-jdaddy
- repo: tpope/vim-projectionist
# Still necessary?
- repo: junegunn/fzf
- repo: junegunn/fzf.vim
# Forgot about this...
- repo: kbenzie/note.vim
# TODO: Move to tmux role?
# Pack 'christoomey/vim-tmux-navigator'
# Pack 'tmux-plugins/vim-tmux-focus-events'
- repo: wincent/replay
- repo: andymass/vim-matchup
- repo: dhruvasagar/vim-table-mode
- repo: vim-scripts/DoxygenToolkit.vim
mode: opt
- repo: guns/xterm-color-table.vim
# Syntax
- repo: kalekundert/vim-coiled-snake
- repo: kbenzie/vim-spirv
- repo: rperier/vim-cmake-syntax
- repo: tikhomirov/vim-glsl
- repo: beyondmarc/hlsl.vim
- repo: frasercrmck/opencl.vim
- repo: asciidoc/vim-asciidoc
- repo: mustache/vim-mustache-handlebars
- repo: joshglendenning/vim-caddyfile
- repo: kbenzie/vim-khr
- repo: jrozner/vim-antlr

201
vimrc
View File

@@ -11,182 +11,179 @@ if has('syntax') && !exists('g:syntax_on')
syntax enable syntax enable
endif endif
" Plugins " Append work config to runtimepath and packpath.
call plug#begin('~/.vim/bundle') set runtimepath+=~/.config/work
set packpath+=~/.config/work
" Load local plugins first, allows local dev whilst also being installed.
if filereadable(expand('~/.vim/local.vim'))
source ~/.vim/local.vim
endif
" vim-airline - improved status bar
" TODO: Get rid of airline and roll your own
Plug 'vim-airline/vim-airline'
let g:airline#extensions#branch#enabled = 0
let g:airline#extensions#hunks#enabled = 0
for s:setting in ['left_sep', 'right_sep', 'section_error', 'section_warning']
exec 'let g:airline_'.s:setting.' = ""'
endfor
" tabline.vim - sanely numbered tabs " tabline.vim - sanely numbered tabs
Plug 'mkitt/tabline.vim' Pack 'mkitt/tabline.vim'
" YouCompleteMe " coc.nvim - Conqueror of Completion
" TODO: Try out neovim completion plugins to see if they are better Pack 'neoclide/coc.nvim', {'branch': 'release'}
if !platform#is_windows() let g:coc_global_extensions = [
" YouCompleteMe with parameter completion \ 'coc-clangd',
Plug 'oblitum/YouCompleteMe', {'do': './install.py --clang-completer'} \ 'coc-cmake',
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>'] \ 'coc-css',
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>'] \ 'coc-docker',
let g:ycm_min_num_of_chars_for_completion = 1 \ 'coc-html',
let g:ycm_complete_in_comments = 1 \ 'coc-jedi',
let g:ycm_complete_in_strings = 1 \ 'coc-json',
let g:ycm_collect_identifiers_from_comments_and_strings = 1 \ 'coc-marketplace',
let g:ycm_seed_identifiers_with_syntax = 1 \ 'coc-pyright',
let g:ycm_autoclose_preview_window_after_insertion = 1 \ 'coc-ultisnips',
let g:ycm_always_populate_location_list = 1 \ 'coc-vimlsp',
let g:ycm_error_symbol = '▸' \ 'coc-yaml',
let g:ycm_warning_symbol = '▸' \]
let g:ycm_goto_buffer_command = 'horizontal-split' if has("win32")
let g:coc_global_extensions += [
\ 'coc-powershell'
\]
endif endif
if has('python') let g:coc_default_semantic_highlight_groups = 0
" ultisnips - snippet engine " ultisnips - snippet engine
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' Pack 'SirVer/ultisnips'
endif Pack 'honza/vim-snippets'
" vim-cmake-completion - completion & help
Plug 'kbenzie/vim-cmake-completion', {'for': ['cmake']}
" vimomni - Completion for vimscript " vimomni - Completion for vimscript
Plug 'vim-scripts/vimomni', {'for': ['vim']} Pack 'vim-scripts/vimomni', {'type': 'opt'}
" ale - Asynchronous Lint Engine " ale - Asynchronous Lint Engine
Plug 'w0rp/ale' Pack 'w0rp/ale'
let g:ale_sign_error = '▸' let g:ale_sign_error = '▸'
let g:ale_sign_warning = '▸' let g:ale_sign_warning = '▸'
let g:ale_echo_msg_format = '[%linter%] %s (%code%)' let g:ale_echo_msg_format = '[%linter%] %s (%code%)'
let g:ale_linters = {'c': [], 'cpp': []} let g:ale_linters = {'c': [], 'cpp': []}
hi link ALEError SyntasticError let g:ale_cmake_cmakelint_options =
hi link ALEWarning SyntasticWarning \ '-convention/filename,-package/consistency,-package/stdargs'
hi link ALEErrorSign SyntasticErrorSign
hi link ALEWarningSign SyntasticWarningSign
" git diff in the sign column " vim-signify - Version control differences in the sign column
Plug 'airblade/vim-gitgutter' Pack 'mhinz/vim-signify'
if exists('&signcolumn') let g:signify_sign_change = '~'
set signcolumn=yes " Conflict marker utilities
else Pack 'rhysd/conflict-marker.vim'
let g:gitgutter_sign_column_always = 1
endif
if has('python')
" format.vim - format with text objects
Plug 'git@bitbucket.org:infektor/format.vim.git'
endif
" vim-textobj-user - library for creating text objects " vim-textobj-user - library for creating text objects
Plug 'kana/vim-textobj-user' Pack 'kana/vim-textobj-user'
" vim-textobj-entire - Entire file text object " vim-textobj-entire - Entire file text object
let g:textobj_entire_no_default_key_mappings = 1 let g:textobj_entire_no_default_key_mappings = 1
Plug 'kana/vim-textobj-entire' Pack 'kana/vim-textobj-entire'
xmap a% <Plug>(textobj-entire-a) xmap a% <Plug>(textobj-entire-a)
omap a% <Plug>(textobj-entire-a) omap a% <Plug>(textobj-entire-a)
xmap i% <Plug>(textobj-entire-i) xmap i% <Plug>(textobj-entire-i)
omap i% <Plug>(textobj-entire-i) omap i% <Plug>(textobj-entire-i)
" vim-textobj-parameter - Parameter text object " vim-textobj-parameter - Parameter text object
Plug 'sgur/vim-textobj-parameter' Pack 'sgur/vim-textobj-parameter'
" vim-textobj-uri - URI text object " vim-textobj-uri - URI text object
Plug 'jceb/vim-textobj-uri' Pack 'jceb/vim-textobj-uri'
" vim-textobj-comment - Comment text object " vim-textobj-comment - Comment text object
Plug 'glts/vim-textobj-comment' Pack 'glts/vim-textobj-comment'
omap a/ <Plug>(textobj-comment-a) omap a/ <Plug>(textobj-comment-a)
xmap a/ <Plug>(textobj-comment-a) xmap a/ <Plug>(textobj-comment-a)
omap i/ <Plug>(textobj-comment-i) omap i/ <Plug>(textobj-comment-i)
xmap i/ <Plug>(textobj-comment-i) xmap i/ <Plug>(textobj-comment-i)
" vim-textobj-sentence - Improved sentence text object " vim-textobj-sentence - Improved sentence text object
Plug 'reedes/vim-textobj-sentence' Pack 'reedes/vim-textobj-sentence'
" vim-commentary - toggle comments " vim-commentary - toggle comments
Plug 'tpope/vim-commentary' Pack 'tpope/vim-commentary'
" vim-surround - edit delimiters " vim-surround - edit delimiters
Plug 'tpope/vim-surround' Pack 'tpope/vim-surround'
" vim-repeat - better dot command " vim-repeat - better dot command
Plug 'tpope/vim-repeat' Pack 'tpope/vim-repeat'
" vim-fugitive - git wrapper " vim-fugitive - git wrapper
Plug 'tpope/vim-fugitive' Pack 'tpope/vim-fugitive'
" vim-eunuch - unix command warppers " vim-eunuch - unix command warppers
Plug 'tpope/vim-eunuch' Pack 'tpope/vim-eunuch'
" vim-vinegar - improved directory browser " vim-vinegar - improved directory browser
Plug 'tpope/vim-vinegar' Pack 'tpope/vim-vinegar'
if wsl#isDetected()
" Make gx work in WSL
let g:netrw_browsex_viewer='cmd.exe /C start'
endif
" vim-abolish - CamelCase to under_score to mixedCase " vim-abolish - CamelCase to under_score to mixedCase
" TODO: Copy the good bit remove this plugin " TODO: Copy the good bit remove this plugin
Plug 'tpope/vim-abolish' Pack 'tpope/vim-abolish'
" vim-unimpaired - for pairs of tasks " vim-unimpaired - for pairs of tasks
Plug 'tpope/vim-unimpaired' Pack 'tpope/vim-unimpaired'
" vim-speeddating - sane date manipulation " vim-speeddating - sane date manipulation
Plug 'tpope/vim-speeddating' Pack 'tpope/vim-speeddating'
" vim-endwise - wisely add end{if,function}, fork with cmake support " vim-endwise - wisely add end{if,function}, fork with cmake support
Plug 'godbyk/vim-endwise', {'branch': 'patch-1'} Pack 'godbyk/vim-endwise', {'rev': 'patch-1'}
" vim-jdaddy - text object & formatting for json " vim-jdaddy - text object & formatting for json
Plug 'tpope/vim-jdaddy' Pack 'tpope/vim-jdaddy'
" vim-projectionist - granular project configuration " vim-projectionist - granular project configuration
Plug 'tpope/vim-projectionist' Pack 'tpope/vim-projectionist'
" fzf.vim - Fuzzy finder " fzf.vim - Fuzzy finder
if !platform#is_windows() Pack 'junegunn/fzf'
Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all --no-update-rc'} Pack 'junegunn/fzf.vim'
Plug 'junegunn/fzf.vim'
let g:fzf_action = { let g:fzf_action = {
\ 'ctrl-t': 'tab split', \ 'ctrl-t': 'tab split',
\ 'ctrl-s': 'split', \ 'ctrl-s': 'split',
\ 'ctrl-v': 'vsplit' \ 'ctrl-v': 'vsplit'
\ } \ }
endif
Plug 'kbenzie/note.vim' Pack 'kbenzie/note.vim'
let g:note_directory = '~/Sync/Notes' let g:note_directory = '~/Sync/Notes'
if !platform#is_windows() if !has('win32')
" Seemless vim/tmux pane navigation " Seemless vim/tmux pane navigation
Plug 'christoomey/vim-tmux-navigator' Pack 'christoomey/vim-tmux-navigator'
let g:tmux_navigator_no_mappings = 1
" Enable focus events when in tmux session " Enable focus events when in tmux session
Plug 'tmux-plugins/vim-tmux-focus-events' Pack 'tmux-plugins/vim-tmux-focus-events'
endif endif
" replay macros with the enter key " replay macros with the enter key
Plug 'wincent/replay' Pack 'wincent/replay'
" vim-matchit - Improved % matching " vim-matchit - Improved % matching
Plug 'andymass/vim-matchup' Pack 'andymass/vim-matchup'
let g:matchup_matchparen_offscreen = {'method': 'status_manual'}
" vim-table-mode - Easy table manipulation " vim-table-mode - Easy table manipulation
Plug 'dhruvasagar/vim-table-mode' Pack 'dhruvasagar/vim-table-mode'
let g:table_mode_map_prefix = '<leader>t' let g:table_mode_map_prefix = '<leader>t'
let g:table_mode_toggle_map = 'M' let g:table_mode_toggle_map = 'M'
" DoxygenToolkit.vim - documentation stubs " DoxygenToolkit.vim - documentation stubs
Plug 'vim-scripts/DoxygenToolkit.vim', {'for': ['cpp', 'c']} Pack 'vim-scripts/DoxygenToolkit.vim', {'type': 'opt'}
let g:DoxygenToolkit_commentType = 'C++' let g:DoxygenToolkit_commentType = 'C++'
" markdown fenced code block languages " markdown fenced code block languages
let g:markdown_fenced_languages = let g:markdown_fenced_languages =
\ ['cpp', 'c', 'cmake', 'sh', 'vim', 'python', 'yaml'] \ ['cpp', 'c', 'cmake', 'console', 'sh', 'vim', 'python', 'yaml']
" reStructedText enable code styles
let g:rst_style = 1
" reStructuredText code block languages
let g:rst_syntax_code_list = {
\ 'vim': ['vim'],
\ 'java': ['java'],
\ 'c': ['c'],
\ 'cpp': ['cpp', 'c++'],
\ 'console': ['console'],
\ 'python': ['python']
\ }
" vim-coiled-snake - Python folding
Pack 'kalekundert/vim-coiled-snake'
" Enable builtin syntax folding " Enable builtin syntax folding
let g:xml_syntax_folding = 1 let g:xml_syntax_folding = 1
let g:sh_fold_enabled = 1 let g:sh_fold_enabled = 1
" xterm-color-table.vim - view term and hex colors " xterm-color-table.vim - view term and hex colors
Plug 'guns/xterm-color-table.vim' Pack 'guns/xterm-color-table.vim'
" SPIR-V syntax " Syntax plugins
Plug 'kbenzie/vim-spirv' Pack 'kbenzie/vim-spirv'
let g:spirv_current_id_highlight = 'ctermbg=234, guibg=#1c1c1c' let g:spirv_current_id_highlight = 'ctermbg=234, guibg=#1c1c1c'
Pack 'rperier/vim-cmake-syntax'
" CMake, GLSL, HLSL, OpenCL C syntax Pack 'tikhomirov/vim-glsl'
Plug 'rperier/vim-cmake-syntax' Pack 'beyondmarc/hlsl.vim'
Plug 'tikhomirov/vim-glsl' Pack 'frasercrmck/opencl.vim'
Plug 'beyondmarc/hlsl.vim' Pack 'asciidoc/vim-asciidoc'
Plug 'frasercrmck/opencl.vim' Pack 'mustache/vim-mustache-handlebars'
Plug 'asciidoc/vim-asciidoc' Pack 'joshglendenning/vim-caddyfile'
Plug 'mustache/vim-mustache-handlebars' Pack 'kbenzie/vim-khr'
Plug 'joshglendenning/vim-caddyfile' Pack 'jrozner/vim-antlr'
Plug 'kbenzie/vim-khr'
call plug#end()