Compare commits
156 Commits
bdea77f86a
...
ansible-pl
| Author | SHA1 | Date | |
|---|---|---|---|
| a9316971f1 | |||
| ee5110efd8 | |||
| 330329ef2b | |||
| 32610db521 | |||
| 4c142d2fa5 | |||
| cde38c5469 | |||
| dfc26e9c40 | |||
| 5476d9ec86 | |||
| 78ae575efe | |||
| 3577aa13bc | |||
| 2ce3d322ca | |||
| 27c42a6a92 | |||
| 61ce53bfd3 | |||
| d0af1c7116 | |||
| ec2b973fc0 | |||
| 98b48377cd | |||
| eb9579e1b6 | |||
| a689039ae2 | |||
| 3da17559e9 | |||
| 68c699882d | |||
| 51c56a8633 | |||
| 14d34e0b6b | |||
| fd31549a32 | |||
| d66ff687d4 | |||
| db5ebc701d | |||
| e6e3a10c87 | |||
| 8277ad04ab | |||
| caa83e88d2 | |||
| 177dbad101 | |||
| d7c1bdd27c | |||
| 775d07414c | |||
| 49051cff43 | |||
| 8ffdfd41cd | |||
| aa2190daec | |||
| b2cf9ace96 | |||
| a46b128741 | |||
| c06b56115a | |||
| e1bc4428c5 | |||
| c9711deade | |||
| 0961c13316 | |||
| eabec4e9b6 | |||
| 7491736987 | |||
| c26d837047 | |||
| 38b8ab2fae | |||
| 30c601e8b3 | |||
| 2188095b2f | |||
| a881d3e62a | |||
| 2ab332db65 | |||
| dbff00b6fc | |||
| 9cc1ac8d87 | |||
| 34073608c8 | |||
| 06335a18da | |||
| 4a47908717 | |||
| 6053174173 | |||
| 0315c070f5 | |||
| 05b047f374 | |||
| 455c1f1b94 | |||
| 46283e3b95 | |||
| 0f1b35eda3 | |||
| 9aa45a4df5 | |||
| 78e821e386 | |||
| 2b02d0ae81 | |||
| f00eb38200 | |||
| 46d27c17fd | |||
| 4e00e225d4 | |||
| 3a44fa1e48 | |||
| 96ff72433d | |||
| 837aa12f9f | |||
| 41a0658cf2 | |||
| 3a2337cd63 | |||
| ecd8659df7 | |||
| d6106bac84 | |||
| 873acacaa6 | |||
| c284486540 | |||
| 587aeef5d7 | |||
| c67f11a8f5 | |||
| cef963d805 | |||
| dc6a8b0032 | |||
| 9a1b1ed2fc | |||
| bee751201d | |||
| eb1a4a71d8 | |||
| bf6deaf1ed | |||
| 8a2ca8c53f | |||
| 824aeb431a | |||
| 4a99f582f3 | |||
| 3b3121aa28 | |||
| 82303f075e | |||
| 92a23103e3 | |||
| 9c64158445 | |||
| eac02b26d3 | |||
| aaa8acf5a2 | |||
| c94bc3ba90 | |||
| a0df92852a | |||
| 0cd93f1823 | |||
| db2079994a | |||
| c17f7ea0d9 | |||
| 76acb9cd90 | |||
| 48913e09c3 | |||
| e4a11a2ffe | |||
| 3cc1e3d2d8 | |||
| 6435ed4c4d | |||
| d063e60559 | |||
| bc1de2d37f | |||
| 9e6169695d | |||
| 80c1b8653e | |||
| 445ca8d6fd | |||
| d960053dfc | |||
| b148f9fb68 | |||
| 529867b475 | |||
| 3449b3f815 | |||
| 67b9c6b45a | |||
| 01059ac01a | |||
| 858677ef79 | |||
| 22b969c989 | |||
| 158a6f5585 | |||
| 3ffda34a29 | |||
| 3e639c4936 | |||
| b40a9abb59 | |||
| 8fac5fb74f | |||
| 72316785d5 | |||
| b3a2208b42 | |||
| a93489efe9 | |||
| 489e6db231 | |||
| 2bef425dee | |||
| 7e79b97933 | |||
| aa3ae7df35 | |||
| 7fb1352108 | |||
| 23b9bf1f1b | |||
| cdcbab062e | |||
| 3bbbbe2a63 | |||
| b69f2d889d | |||
| 65d3e645b1 | |||
| 0d0e69a2ec | |||
| 2ee41bb80f | |||
| 57257c1c9a | |||
| c1d167f2e3 | |||
| 92d88b623d | |||
| f85d59197a | |||
| 27c77881a3 | |||
| 28804faf21 | |||
| e2e2be6e44 | |||
| 7af8660355 | |||
| 1f07473b57 | |||
| 10eb5fffea | |||
| 5f93199735 | |||
| 1e47926465 | |||
| 6f653e8ad9 | |||
| 2faa156aae | |||
| 856c66e150 | |||
| 51b95acf90 | |||
| 054507cdff | |||
| 5f7b05aab0 | |||
| bf9276aa1b | |||
| ef0f39b780 | |||
| 6d2fbc2ac5 | |||
| 72fe59ffaa |
@@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
- location: ~/.vim
|
|
||||||
- pip:
|
|
||||||
- vim-vint
|
|
||||||
- yamllint
|
|
||||||
- cmakelint
|
|
||||||
- repo:
|
|
||||||
- remote: https://github.com/k-takata/minpac.git
|
|
||||||
location: ~/.vim/pack/minpac/opt/minpac
|
|
||||||
- command:
|
|
||||||
- vim +PackUpdate +quitall
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@ local.vim
|
|||||||
.netrwhist
|
.netrwhist
|
||||||
pack/*
|
pack/*
|
||||||
spell/*
|
spell/*
|
||||||
|
*.pyc
|
||||||
|
|||||||
186
README.md
Normal file
186
README.md
Normal 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
|
||||||
@@ -11,6 +11,11 @@ def complete(t, opts):
|
|||||||
return '(' + '|'.join(opts) + ')'
|
return '(' + '|'.join(opts) + ')'
|
||||||
endglobal
|
endglobal
|
||||||
|
|
||||||
|
snippet /* "comment block"
|
||||||
|
/* $0
|
||||||
|
*/
|
||||||
|
endsnippet
|
||||||
|
|
||||||
snippet sizeof "sizeof" i
|
snippet sizeof "sizeof" i
|
||||||
sizeof($1)$0
|
sizeof($1)$0
|
||||||
endsnippet
|
endsnippet
|
||||||
@@ -157,7 +162,7 @@ default: {
|
|||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet main "Main function stub"
|
snippet main "Main function stub"
|
||||||
int main(${1:int argc, const char* argv[]}) {
|
int main(${1:int argc, const char** argv}) {
|
||||||
$0
|
$0
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
3
UltiSnips/jinja.snippets
Normal file
3
UltiSnips/jinja.snippets
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
extends html
|
||||||
|
|
||||||
|
priority 1
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
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"
|
||||||
|
|||||||
61
UltiSnips/rst.snippets
Normal file
61
UltiSnips/rst.snippets
Normal 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
|
||||||
@@ -9,11 +9,7 @@ setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
|
|||||||
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>
|
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
" Add omnifunc completion plugin.
|
|
||||||
packadd vim-cmake-completion
|
|
||||||
|
|
||||||
" Enable syntax folding, see .vim/after/syntax/cmake.vim
|
" Enable syntax folding, see .vim/after/syntax/cmake.vim
|
||||||
setlocal foldmethod=syntax
|
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>"
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
" Add Doxygen documentation generation plugin.
|
" Add Doxygen documentation generation plugin.
|
||||||
packadd DoxygenToolkit.vim
|
packadd DoxygenToolkit.vim
|
||||||
nnoremap <leader>d :Dox<CR>
|
nnoremap <leader>d :Dox<CR>
|
||||||
" Map K to get YouCompleteMe documentation
|
|
||||||
nnoremap K :YcmCompleter GetDoc<CR>
|
|
||||||
|
|||||||
@@ -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
2
after/ftplugin/man.vim
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
setlocal showbreak=
|
||||||
|
set signcolumn=no
|
||||||
@@ -25,6 +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>
|
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
" Add omnifunc completion package.
|
" Add omnifunc completion package.
|
||||||
packadd vimomni
|
packadd vimomni
|
||||||
|
|
||||||
" Mapping for Vim help of the word under cursor.
|
|
||||||
nnoremap K :help <C-r><C-w><CR>
|
|
||||||
|
|
||||||
" Set custom fold expression
|
" Set custom fold expression
|
||||||
setlocal foldmethod=expr
|
setlocal foldmethod=expr
|
||||||
setlocal foldexpr=VimFold(v:lnum)
|
setlocal foldexpr=VimFold(v:lnum)
|
||||||
|
|||||||
8
after/plugin/mappings.vim
Normal file
8
after/plugin/mappings.vim
Normal 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
|
||||||
@@ -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.
|
||||||
" ^^^^
|
" ^^^^
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
syn keyword htmlTodo TODO
|
|
||||||
syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=htmlTodo,@htmlPreProc,@Spell
|
|
||||||
|
|
||||||
hi default link htmlTodo Todo
|
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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
2
after/syntax/python.vim
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
highlight link pythonException Conditional
|
||||||
|
highlight link pythonExceptions Keyword
|
||||||
7
after/syntax/yaml.vim
Normal file
7
after/syntax/yaml.vim
Normal 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
|
||||||
@@ -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
110
autoload/build.vim
Normal 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
|
||||||
@@ -69,7 +69,7 @@ function! do#rename_include_guard(old)
|
|||||||
call setpos('.', l:pos)
|
call setpos('.', l:pos)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Setup and start a debugging command.
|
" Setup and start a debugging command
|
||||||
function! do#debug(...)
|
function! do#debug(...)
|
||||||
packadd termdebug
|
packadd termdebug
|
||||||
let l:command = 'TermdebugCommand'
|
let l:command = 'TermdebugCommand'
|
||||||
@@ -78,3 +78,36 @@ function! do#debug(...)
|
|||||||
endfor
|
endfor
|
||||||
exec l:command
|
exec l:command
|
||||||
endfunction
|
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
11
autoload/echo.vim
Normal 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
14
autoload/format.vim
Normal 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
27
autoload/osc52.vim
Normal 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
|
||||||
21
autoload/tmux.vim
Normal file
21
autoload/tmux.vim
Normal 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
3
autoload/wsl.vim
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
function! wsl#isDetected() abort
|
||||||
|
return $WSLENV !=# ''
|
||||||
|
endfunction
|
||||||
17
coc-settings.json
Normal file
17
coc-settings.json
Normal 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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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,6 +187,15 @@ 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')
|
||||||
@@ -196,11 +207,25 @@ if has('gui_running') || &t_Co == 256
|
|||||||
call s:hi('ALEErrorSign', '160', '233', 'bold')
|
call s:hi('ALEErrorSign', '160', '233', 'bold')
|
||||||
call s:hi('ALEWarningSign', '129', '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
1
ftdetect/cmakecache.vim
Normal file
@@ -0,0 +1 @@
|
|||||||
|
autocmd BufNewFile,BufReadPost CMakeCache.txt set filetype=cmakecache
|
||||||
1
ftdetect/requirements.vim
Normal file
1
ftdetect/requirements.vim
Normal file
@@ -0,0 +1 @@
|
|||||||
|
autocmd BufNewFile,BufReadPost */requirements.txt set filetype=requirements
|
||||||
3
ftplugin/c.vim
Normal file
3
ftplugin/c.vim
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
if has('pythonx')
|
||||||
|
setlocal formatexpr=format#clang_format()
|
||||||
|
endif
|
||||||
1
ftplugin/cmakecache.vim
Normal file
1
ftplugin/cmakecache.vim
Normal file
@@ -0,0 +1 @@
|
|||||||
|
setlocal nospell
|
||||||
6
ftplugin/cpp.vim
Normal file
6
ftplugin/cpp.vim
Normal 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
3
ftplugin/java.vim
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
if has('pythonx')
|
||||||
|
setlocal formatexpr=format#clang_format()
|
||||||
|
endif
|
||||||
3
ftplugin/javascript.vim
Normal file
3
ftplugin/javascript.vim
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
if has('pythonx')
|
||||||
|
setlocal formatexpr=format#clang_format()
|
||||||
|
endif
|
||||||
3
ftplugin/objc.vim
Normal file
3
ftplugin/objc.vim
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
if has('pythonx')
|
||||||
|
setlocal formatexpr=format#clang_format()
|
||||||
|
endif
|
||||||
3
ftplugin/objcpp.vim
Normal file
3
ftplugin/objcpp.vim
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
if has('pythonx')
|
||||||
|
setlocal formatexpr=format#clang_format()
|
||||||
|
endif
|
||||||
3
ftplugin/proto.vim
Normal file
3
ftplugin/proto.vim
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
if has('pythonx')
|
||||||
|
setlocal formatexpr=format#clang_format()
|
||||||
|
endif
|
||||||
3
ftplugin/python.vim
Normal file
3
ftplugin/python.vim
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
if has('pythonx')
|
||||||
|
setlocal formatexpr=format#yapf()
|
||||||
|
endif
|
||||||
1
ftplugin/requirements.vim
Normal file
1
ftplugin/requirements.vim
Normal file
@@ -0,0 +1 @@
|
|||||||
|
set commentstring=#%s
|
||||||
12
ginit.vim
Normal file
12
ginit.vim
Normal 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
2
gvimrc
@@ -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
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ setlocal indentkeys+=<:>,=elif,=except
|
|||||||
" Derived from the default GetPythonIndent removing deliberate use of invalid
|
" Derived from the default GetPythonIndent removing deliberate use of invalid
|
||||||
" expressions which show up with 'set debug=msg,throw', also remove the indent
|
" expressions which show up with 'set debug=msg,throw', also remove the indent
|
||||||
" config options.
|
" config options.
|
||||||
function PythonIndent(lnum)
|
function! PythonIndent(lnum)
|
||||||
" If this line is explicitly joined: If the previous line was also joined,
|
" If this line is explicitly joined: If the previous line was also joined,
|
||||||
" line it up with that one, otherwise add two 'shiftwidth'
|
" line it up with that one, otherwise add two 'shiftwidth'
|
||||||
if getline(a:lnum - 1) =~# '\\$'
|
if getline(a:lnum - 1) =~# '\\$'
|
||||||
|
|||||||
28
nodejs-linux.yaml
Normal file
28
nodejs-linux.yaml
Normal 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]
|
||||||
@@ -1,15 +1,20 @@
|
|||||||
augroup benieAugroup
|
augroup benieAugroup
|
||||||
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
|
||||||
|
|
||||||
" Highlight conflict markers in any filetype
|
" Update `Last change: <date>` on write & go back previous cursor position
|
||||||
au FileType * call matchadd('Todo', '^\(<<<<<<<\||||||||\|=======\|>>>>>>>\)\s\ze.*$')
|
au FileType help au BufWritePre <buffer>
|
||||||
|
\ 1s/Last change: \zs.*$/\=strftime('%Y %b %d')/e|norm!``
|
||||||
" Update `Last change: <date>` on write then jump back previous position
|
|
||||||
au BufWritePost *.txt 1s/Last change: \zs.*$/\=strftime('%Y %b %d')/e|norm!``
|
|
||||||
|
|
||||||
" Read template into buffer then send line 1 to the black hold register
|
" Read template into buffer then send line 1 to the black hold register
|
||||||
au BufNewFile todo.md read ~/.vim/templates/skeleton.todo.md | 1delete _
|
au BufNewFile todo.md read ~/.vim/templates/skeleton.todo.md | 1delete _
|
||||||
@@ -17,4 +22,25 @@ augroup benieAugroup
|
|||||||
au BufNewFile * silent! call snippet#template()
|
au BufNewFile * silent! call snippet#template()
|
||||||
" Do the same when filetype changes to help
|
" Do the same when filetype changes to help
|
||||||
au FileType help silent! call snippet#template()
|
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
|
||||||
|
|||||||
@@ -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=1000
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
" minpac
|
|
||||||
command! PackUpdate packadd minpac | source $MYVIMRC |
|
|
||||||
\ call minpac#update('', {'do': 'call minpac#status()'})
|
|
||||||
command! PackStatus packadd minpac | source $MYVIMRC |
|
|
||||||
\ call minpac#status()
|
|
||||||
command! PackClean packadd minpac | source $MYVIMRC |
|
|
||||||
\ call minpac#clean()
|
|
||||||
|
|
||||||
" Sort Python Imports
|
" Sort Python Imports
|
||||||
command! ISort call do#isort()
|
command! ISort call do#isort()
|
||||||
|
|
||||||
@@ -26,3 +18,10 @@ command! CursorHighlightGroups call do#cursor_highlight_groups()
|
|||||||
|
|
||||||
" Setup and invoke a :TermdebugCommand
|
" Setup and invoke a :TermdebugCommand
|
||||||
command! -nargs=+ -complete=file Debug call do#debug(<f-args>)
|
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
8
plugin/format.vim
Normal 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')
|
||||||
@@ -1,8 +1,17 @@
|
|||||||
" 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)
|
||||||
|
|
||||||
|
if has('nvim')
|
||||||
|
" Make nvim :terminal more like vim :terminal
|
||||||
|
tnoremap <C-w>N <C-\><C-n>
|
||||||
|
endif
|
||||||
|
|
||||||
" termdebug
|
" termdebug
|
||||||
" TODO: Detecet if termdebug is loaded, if not do the default action.
|
" TODO: Detecet if termdebug is loaded, if not do the default action.
|
||||||
@@ -13,10 +22,6 @@ tnoremap <C-G> :Gdb<CR>
|
|||||||
tnoremap <C-E> :Program<CR>
|
tnoremap <C-E> :Program<CR>
|
||||||
tnoremap <C-S> :Source<CR>
|
tnoremap <C-S> :Source<CR>
|
||||||
|
|
||||||
" GitGutter
|
|
||||||
nnoremap <leader>gn :GitGutterNextHunk<CR>
|
|
||||||
nnoremap <leader>gp :GitGutterPrevHunk<CR>
|
|
||||||
|
|
||||||
" Quickfix list
|
" Quickfix list
|
||||||
nnoremap <leader>qo :copen<CR>
|
nnoremap <leader>qo :copen<CR>
|
||||||
nnoremap <leader>qc :cclose<CR>
|
nnoremap <leader>qc :cclose<CR>
|
||||||
@@ -58,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>
|
||||||
@@ -76,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
|
||||||
@@ -88,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>
|
||||||
|
|||||||
@@ -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,12 +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
|
|
||||||
|
|
||||||
" Enhanced command line completion
|
" Enhanced command line completion
|
||||||
set wildmenu
|
set wildmenu
|
||||||
" Command line history
|
" Command line history
|
||||||
@@ -68,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
|
||||||
@@ -96,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
|
||||||
@@ -162,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
174
plugin/statusline.vim
Normal 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
117
pythonx/format.py
Normal 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]
|
||||||
17
syntax/cmakecache.vim
Normal file
17
syntax/cmakecache.vim
Normal 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
8
syntax/console.vim
Normal 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
|
||||||
@@ -109,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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
" Maintainer: The LLVM team, http://llvm.org/
|
" Maintainer: The LLVM team, http://llvm.org/
|
||||||
" Version: $Revision$
|
" 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
|
||||||
|
|
||||||
@@ -180,7 +180,8 @@ 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 none
|
syn keyword llvmConstant zeroinitializer undef null none
|
||||||
syn match llvmComment /;.*$/
|
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]*/
|
||||||
@@ -204,8 +205,8 @@ syn match llvmSpecialComment /;\s*CHECK:.*$/
|
|||||||
syn match llvmSpecialComment "\v;\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL):.*$"
|
syn match llvmSpecialComment "\v;\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL):.*$"
|
||||||
syn match llvmSpecialComment /;\s*XFAIL:.*$/
|
syn match llvmSpecialComment /;\s*XFAIL:.*$/
|
||||||
|
|
||||||
if version >= 508 || !exists("did_c_syn_inits")
|
if v:version >= 508 || !exists('did_c_syn_inits')
|
||||||
if version < 508
|
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
|
||||||
@@ -215,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
|
||||||
@@ -230,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
11
syntax/requirements.vim
Normal 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
10
syntax/sanitizer.vim
Normal 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
17
tasks.yaml
Normal 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")}}'
|
||||||
66
vars.yaml
Normal file
66
vars.yaml
Normal 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
|
||||||
117
vimrc
117
vimrc
@@ -11,60 +11,39 @@ if has('syntax') && !exists('g:syntax_on')
|
|||||||
syntax enable
|
syntax enable
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists('*minpac#init')
|
" Append work config to runtimepath and packpath.
|
||||||
" When minpac is loaded initialize and define the Pack command.
|
|
||||||
call minpac#init()
|
|
||||||
command! -nargs=+ Pack call minpac#add(<args>)
|
|
||||||
else
|
|
||||||
" Otherwise define the Pack command to do nothing.
|
|
||||||
command! -nargs=+ Pack
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Append work config to the runttime path.
|
|
||||||
set runtimepath+=~/.config/work
|
set runtimepath+=~/.config/work
|
||||||
|
set packpath+=~/.config/work
|
||||||
|
|
||||||
" vim-airline - improved status bar
|
|
||||||
Pack '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
|
||||||
Pack '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 = [
|
||||||
if platform#is_linux()
|
\ 'coc-clangd',
|
||||||
" YouCompleteMe with parameter completion
|
\ 'coc-cmake',
|
||||||
let s:YouCompleteMe = 'oblitum/YouCompleteMe'
|
\ 'coc-css',
|
||||||
else
|
\ 'coc-docker',
|
||||||
" YouCompleteMe upstream works best on macOS
|
\ 'coc-html',
|
||||||
let s:YouCompleteMe = 'Valloric/YouCompleteMe'
|
\ 'coc-jedi',
|
||||||
|
\ 'coc-json',
|
||||||
|
\ 'coc-marketplace',
|
||||||
|
\ 'coc-pyright',
|
||||||
|
\ 'coc-ultisnips',
|
||||||
|
\ 'coc-vimlsp',
|
||||||
|
\ 'coc-yaml',
|
||||||
|
\]
|
||||||
|
if has("win32")
|
||||||
|
let g:coc_global_extensions += [
|
||||||
|
\ 'coc-powershell'
|
||||||
|
\]
|
||||||
endif
|
endif
|
||||||
Pack s:YouCompleteMe,
|
let g:coc_default_semantic_highlight_groups = 0
|
||||||
\ {'type': 'opt', 'do': '!./install.py --clang-completer'}
|
|
||||||
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
|
|
||||||
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
|
|
||||||
let g:ycm_min_num_of_chars_for_completion = 1
|
|
||||||
let g:ycm_complete_in_comments = 1
|
|
||||||
let g:ycm_complete_in_strings = 1
|
|
||||||
let g:ycm_collect_identifiers_from_comments_and_strings = 1
|
|
||||||
let g:ycm_seed_identifiers_with_syntax = 1
|
|
||||||
let g:ycm_autoclose_preview_window_after_insertion = 1
|
|
||||||
let g:ycm_always_populate_location_list = 1
|
|
||||||
let g:ycm_error_symbol = '▸'
|
|
||||||
let g:ycm_warning_symbol = '▸'
|
|
||||||
let g:ycm_goto_buffer_command = 'horizontal-split'
|
|
||||||
endif
|
|
||||||
if has('python')
|
|
||||||
" ultisnips - snippet engine
|
" ultisnips - snippet engine
|
||||||
Pack 'SirVer/ultisnips'
|
Pack 'SirVer/ultisnips'
|
||||||
Pack 'honza/vim-snippets'
|
Pack 'honza/vim-snippets'
|
||||||
endif
|
|
||||||
" vim-cmake-completion - completion & help
|
|
||||||
Pack 'kbenzie/vim-cmake-completion', {'type': 'opt'}
|
|
||||||
" vimomni - Completion for vimscript
|
" vimomni - Completion for vimscript
|
||||||
Pack 'vim-scripts/vimomni', {'type': 'opt'}
|
Pack 'vim-scripts/vimomni', {'type': 'opt'}
|
||||||
|
|
||||||
@@ -74,19 +53,14 @@ 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': []}
|
||||||
|
let g:ale_cmake_cmakelint_options =
|
||||||
|
\ '-convention/filename,-package/consistency,-package/stdargs'
|
||||||
|
|
||||||
" git diff in the sign column
|
" vim-signify - Version control differences in the sign column
|
||||||
Pack '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
|
|
||||||
Pack 'git@bitbucket.org:infektor/format.vim.git'
|
|
||||||
endif
|
|
||||||
|
|
||||||
" vim-textobj-user - library for creating text objects
|
" vim-textobj-user - library for creating text objects
|
||||||
Pack 'kana/vim-textobj-user'
|
Pack 'kana/vim-textobj-user'
|
||||||
@@ -122,6 +96,10 @@ Pack 'tpope/vim-fugitive'
|
|||||||
Pack 'tpope/vim-eunuch'
|
Pack 'tpope/vim-eunuch'
|
||||||
" vim-vinegar - improved directory browser
|
" vim-vinegar - improved directory browser
|
||||||
Pack '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
|
||||||
Pack 'tpope/vim-abolish'
|
Pack 'tpope/vim-abolish'
|
||||||
@@ -137,7 +115,6 @@ Pack 'tpope/vim-jdaddy'
|
|||||||
Pack 'tpope/vim-projectionist'
|
Pack 'tpope/vim-projectionist'
|
||||||
|
|
||||||
" fzf.vim - Fuzzy finder
|
" fzf.vim - Fuzzy finder
|
||||||
if !platform#is_windows()
|
|
||||||
Pack 'junegunn/fzf'
|
Pack 'junegunn/fzf'
|
||||||
Pack 'junegunn/fzf.vim'
|
Pack 'junegunn/fzf.vim'
|
||||||
let g:fzf_action = {
|
let g:fzf_action = {
|
||||||
@@ -145,7 +122,6 @@ if !platform#is_windows()
|
|||||||
\ 'ctrl-s': 'split',
|
\ 'ctrl-s': 'split',
|
||||||
\ 'ctrl-v': 'vsplit'
|
\ 'ctrl-v': 'vsplit'
|
||||||
\ }
|
\ }
|
||||||
endif
|
|
||||||
|
|
||||||
Pack 'kbenzie/note.vim'
|
Pack 'kbenzie/note.vim'
|
||||||
let g:note_directory = '~/Sync/Notes'
|
let g:note_directory = '~/Sync/Notes'
|
||||||
@@ -153,6 +129,7 @@ let g:note_directory = '~/Sync/Notes'
|
|||||||
if !has('win32')
|
if !has('win32')
|
||||||
" Seemless vim/tmux pane navigation
|
" Seemless vim/tmux pane navigation
|
||||||
Pack '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
|
||||||
Pack 'tmux-plugins/vim-tmux-focus-events'
|
Pack 'tmux-plugins/vim-tmux-focus-events'
|
||||||
endif
|
endif
|
||||||
@@ -161,6 +138,7 @@ endif
|
|||||||
Pack 'wincent/replay'
|
Pack 'wincent/replay'
|
||||||
" vim-matchit - Improved % matching
|
" vim-matchit - Improved % matching
|
||||||
Pack '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
|
||||||
Pack 'dhruvasagar/vim-table-mode'
|
Pack 'dhruvasagar/vim-table-mode'
|
||||||
@@ -173,9 +151,21 @@ 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']
|
||||||
|
|
||||||
" Python folding
|
" 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'
|
Pack 'kalekundert/vim-coiled-snake'
|
||||||
|
|
||||||
" Enable builtin syntax folding
|
" Enable builtin syntax folding
|
||||||
@@ -185,11 +175,9 @@ let g:sh_fold_enabled = 1
|
|||||||
" xterm-color-table.vim - view term and hex colors
|
" xterm-color-table.vim - view term and hex colors
|
||||||
Pack 'guns/xterm-color-table.vim'
|
Pack 'guns/xterm-color-table.vim'
|
||||||
|
|
||||||
" SPIR-V syntax
|
" Syntax plugins
|
||||||
Pack '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'
|
||||||
|
|
||||||
" CMake, GLSL, HLSL, OpenCL C syntax
|
|
||||||
Pack 'rperier/vim-cmake-syntax'
|
Pack 'rperier/vim-cmake-syntax'
|
||||||
Pack 'tikhomirov/vim-glsl'
|
Pack 'tikhomirov/vim-glsl'
|
||||||
Pack 'beyondmarc/hlsl.vim'
|
Pack 'beyondmarc/hlsl.vim'
|
||||||
@@ -198,3 +186,4 @@ Pack 'asciidoc/vim-asciidoc'
|
|||||||
Pack 'mustache/vim-mustache-handlebars'
|
Pack 'mustache/vim-mustache-handlebars'
|
||||||
Pack 'joshglendenning/vim-caddyfile'
|
Pack 'joshglendenning/vim-caddyfile'
|
||||||
Pack 'kbenzie/vim-khr'
|
Pack 'kbenzie/vim-khr'
|
||||||
|
Pack 'jrozner/vim-antlr'
|
||||||
|
|||||||
Reference in New Issue
Block a user