Compare commits
326 Commits
legacy
..
bd739b0092
| Author | SHA1 | Date | |
|---|---|---|---|
|
bd739b0092
|
|||
|
e0eb3179fa
|
|||
|
d7721829b2
|
|||
|
21b90d8a22
|
|||
|
ebef24bec5
|
|||
|
a3698677ea
|
|||
|
206db58418
|
|||
|
93bd0c1cb7
|
|||
| fa3ec81cf3 | |||
| 9df3d54a4b | |||
| 2dad06edd8 | |||
| 30bcab5f3e | |||
|
49e7cf1816
|
|||
|
9a7378ef32
|
|||
|
7ed92881f1
|
|||
|
533b29e5e3
|
|||
|
daa73fbabc
|
|||
|
19933bf58d
|
|||
|
d471a8436a
|
|||
|
294210e113
|
|||
| 1f0acfed01 | |||
| c6ea3d1c8c | |||
| d3471e3dc8 | |||
| 8f11e727db | |||
|
12a16cf7f4
|
|||
|
5c7052140a
|
|||
|
eae08e98c5
|
|||
|
360e79aa8a
|
|||
| d84bc8062e | |||
| 4e3d0500b9 | |||
|
38f4c63336
|
|||
|
434ff26226
|
|||
|
af95197cb1
|
|||
|
c2772d1874
|
|||
|
dd22699549
|
|||
|
b35b35731b
|
|||
|
881f99ef16
|
|||
|
0117cc612e
|
|||
|
1d3ae136be
|
|||
|
362064b206
|
|||
|
c84b6b6584
|
|||
|
9108f57780
|
|||
|
e4d4be54c6
|
|||
|
54b1090984
|
|||
|
43b0059631
|
|||
|
5c64115e5d
|
|||
|
af1ddc5b3f
|
|||
|
c2f57e070c
|
|||
|
374825559b
|
|||
|
d8cf7121ef
|
|||
|
1176535475
|
|||
|
25b3a169a2
|
|||
|
254bfd4be2
|
|||
|
ba282e656d
|
|||
|
e10de143eb
|
|||
|
e22f0c594c
|
|||
|
b22739cb71
|
|||
|
a9163907be
|
|||
|
59b2334253
|
|||
|
17a23eb7e4
|
|||
|
9a76b5071e
|
|||
|
02d298a163
|
|||
|
87359588e0
|
|||
|
98aa0593c9
|
|||
|
f96eb0e234
|
|||
|
026e3f9fc2
|
|||
|
b15b68fa5d
|
|||
|
c906025f68
|
|||
|
c1b73e5822
|
|||
|
a60d4a8246
|
|||
| d59b067075 | |||
| 4daa29ada3 | |||
| a041084bef | |||
| 5b97d37ed3 | |||
| 35803b0b03 | |||
| f7cc6a8c51 | |||
| 5d16b49967 | |||
| f19466063a | |||
|
2f1c1460a6
|
|||
|
27d2c14665
|
|||
|
73d4fbbbfb
|
|||
|
c146ff0f95
|
|||
|
d755aa90f5
|
|||
|
7be1fa7a21
|
|||
|
90fb7736cf
|
|||
|
0458cb0825
|
|||
| da7c214afe | |||
| ffeb4d6f45 | |||
| 8026ec51d9 | |||
|
b11e2ec42c
|
|||
|
8d676a1e5e
|
|||
|
535ad35ded
|
|||
|
b4dfc6cfc0
|
|||
|
3e786561ab
|
|||
|
c33133f7c9
|
|||
|
bcce589cc1
|
|||
|
dccea7b3fd
|
|||
|
6ee3f0e346
|
|||
|
322fc37df0
|
|||
|
b6c9f2db01
|
|||
|
c8d442912f
|
|||
|
b696b9addd
|
|||
|
55e28be32c
|
|||
|
320d742b41
|
|||
|
5c946599bc
|
|||
|
0505c877fe
|
|||
|
6c5e5bb8c0
|
|||
|
707010aadc
|
|||
|
3be9780454
|
|||
|
2bbf10c370
|
|||
|
39f538418b
|
|||
|
01cca08739
|
|||
|
633df0af60
|
|||
|
525e9099e4
|
|||
|
1c42119291
|
|||
|
7723d66cbf
|
|||
|
649653ef8c
|
|||
|
18f15c5ab3
|
|||
|
5c774bbdfb
|
|||
|
e61c059de6
|
|||
|
82f6744c2f
|
|||
|
2e4796d7a7
|
|||
|
6c49b81f5a
|
|||
|
d2a4babb2e
|
|||
|
a2335bfd1b
|
|||
|
3efe02f0ab
|
|||
|
651f32bdaf
|
|||
|
900e844835
|
|||
|
f8ad93746b
|
|||
|
644edc8b2e
|
|||
|
3f9ec6a29f
|
|||
|
7d71427f28
|
|||
|
a96448db09
|
|||
|
244c1929a3
|
|||
|
3291fb8111
|
|||
|
9d72215ac6
|
|||
|
e6a7dd6af5
|
|||
|
dedbe6f2c8
|
|||
|
a5695d1e32
|
|||
|
703c0bb087
|
|||
|
0c074e2aec
|
|||
|
92f62551d9
|
|||
|
a11d93f6f4
|
|||
|
30d26ce769
|
|||
|
637c15299b
|
|||
|
66d933cbb3
|
|||
|
1ff53112ae
|
|||
|
38561b7dcc
|
|||
|
7e46d955c7
|
|||
|
b23736c335
|
|||
|
f08c4fddcd
|
|||
|
0a88d94e42
|
|||
|
ca2a7c6462
|
|||
|
76410a8a52
|
|||
|
fe7334fe81
|
|||
|
b05b3bb2ef
|
|||
|
b92f5348cf
|
|||
|
fc435a934c
|
|||
|
380308ceb6
|
|||
|
7a13c688d7
|
|||
|
ede63fa3f1
|
|||
|
98d9158287
|
|||
|
47d631ad21
|
|||
|
5ccfd77c84
|
|||
|
45c09c76e3
|
|||
|
cf94ba2e4b
|
|||
|
594200f88d
|
|||
|
a0421469c0
|
|||
|
7be3e952fc
|
|||
|
bfb870d59c
|
|||
|
64637b19ea
|
|||
|
994c0ac0b8
|
|||
| 243020a2c7 | |||
|
1df19a07cf
|
|||
|
c8377cdcf3
|
|||
|
684445b4f7
|
|||
|
bbe09a41e6
|
|||
|
53aaf53bde
|
|||
|
abba8c2901
|
|||
|
5f1666094c
|
|||
|
d3239f37f1
|
|||
|
0e3ae1c346
|
|||
|
fa5bf51d41
|
|||
|
5c8b71ceb8
|
|||
| a4a5afe3a9 | |||
|
b3e20c39c7
|
|||
|
fdaa5e752d
|
|||
|
ca6a204247
|
|||
|
84128270ff
|
|||
|
70b182d3cc
|
|||
|
7512d46578
|
|||
|
24313cc9c0
|
|||
|
1b8d2d0a3c
|
|||
|
b45e45939a
|
|||
|
6beca4a66b
|
|||
|
8ca75d2ecc
|
|||
|
9af50fc20b
|
|||
|
c7f3f3bb17
|
|||
|
b578e7bfd4
|
|||
|
327b4e03e8
|
|||
|
527b17f445
|
|||
|
7db0d085f2
|
|||
|
d5eba6dedb
|
|||
|
69b57a0238
|
|||
|
82cae9a0eb
|
|||
|
c04978b059
|
|||
|
9d2dc5a389
|
|||
|
e4f6d92e34
|
|||
|
2ac9d07cef
|
|||
|
b8f72ed2ec
|
|||
|
67180e1e1d
|
|||
|
e547e69766
|
|||
|
d97d8f78fb
|
|||
|
3c152c044c
|
|||
|
ad8a5caa99
|
|||
|
1125c6543a
|
|||
|
6a7bc6e6c2
|
|||
|
2060c74012
|
|||
|
e598cf8a0d
|
|||
|
294ea0a31a
|
|||
|
918be36a06
|
|||
|
1046d91a15
|
|||
|
3c71bd600c
|
|||
|
5667752cf5
|
|||
|
c133fd3861
|
|||
|
da3b98c0fc
|
|||
|
54d4d8f058
|
|||
|
7b9e749477
|
|||
|
a0ec7e7784
|
|||
|
f37e2a26dd
|
|||
|
ba2eae281b
|
|||
|
302888261f
|
|||
|
5574cc866a
|
|||
|
8031f3fe6a
|
|||
|
b361c8863e
|
|||
|
f6b0272bcc
|
|||
|
24a19a8ab1
|
|||
|
3e7f424616
|
|||
|
cf6ffdb83a
|
|||
|
228cd34087
|
|||
|
2ac26b8d7a
|
|||
|
b19f90dc7f
|
|||
|
f2d0e639b4
|
|||
|
0ec44b1306
|
|||
|
e5678437e8
|
|||
|
afed6c8ff5
|
|||
|
cbd71f346e
|
|||
|
1a854cfa58
|
|||
|
a4b767ac59
|
|||
|
f75c024e77
|
|||
|
ee4b2a5359
|
|||
|
2491100237
|
|||
|
175e305cb2
|
|||
|
8367bdcba0
|
|||
|
b8d05a78ce
|
|||
|
e1e79b1d13
|
|||
|
7b67f931cb
|
|||
|
56b21d796a
|
|||
|
341c2ca855
|
|||
|
14a09934fd
|
|||
|
8a9469e582
|
|||
|
7ee3d90d08
|
|||
|
f48fa6ae87
|
|||
|
e3b55ba5dc
|
|||
|
7cb056fb72
|
|||
|
48894989e8
|
|||
|
1640e1c3b6
|
|||
|
4edc2a87b0
|
|||
|
543e17ecf3
|
|||
|
8317381ebc
|
|||
|
04fdd708b2
|
|||
|
0a18490729
|
|||
|
21314f80a4
|
|||
|
2dc698b676
|
|||
|
7fead49895
|
|||
|
3094523b19
|
|||
|
c7e652d93a
|
|||
|
c2b6680375
|
|||
|
4e97e05d64
|
|||
|
2fb67ab8eb
|
|||
|
7473dba170
|
|||
|
e82f6c7b14
|
|||
|
5d4821348c
|
|||
|
d60a020487
|
|||
|
9bd672f82e
|
|||
|
1037c5c229
|
|||
|
9f0048bfb2
|
|||
|
eba93c0f1c
|
|||
|
4f387fcc6a
|
|||
|
011ee52d79
|
|||
|
4996ab0f5f
|
|||
|
8ca648760f
|
|||
|
e33a16da07
|
|||
| 59f55956ec | |||
| d4b470989f | |||
| 0688fe49dc | |||
| 8301ce0039 | |||
| 795552cf2e | |||
| c0b519ed25 | |||
| 9bb11d975f | |||
| 0762b5b896 | |||
| b2ce06ac46 | |||
| 75a09b17a7 | |||
| dd3714cd69 | |||
| 20e233eede | |||
| ea460e4541 | |||
| d0d99d71bc | |||
| 001a3c4161 | |||
| 385db48967 | |||
| 80ee563fb3 | |||
| 36c153b464 | |||
| dacbbab318 | |||
| 29a3ff9632 | |||
| fcea0eb494 | |||
| 57c82c4a34 | |||
| 76093987ef | |||
| d0a40498ae | |||
| 013c4c426e | |||
| 82e0622233 | |||
| b4fedfc8ef | |||
| dbcd0b84f2 | |||
| ca14315786 | |||
| cec0f5db85 | |||
| 05d2752cc5 | |||
| ac73691870 | |||
| df01147684 |
@@ -0,0 +1,4 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = tab
|
||||||
+21
-49
@@ -1,49 +1,21 @@
|
|||||||
[submodule "vim/.vim/bundle/nerdtree"]
|
[submodule "zsh/ohmyzsh"]
|
||||||
path = vim/.vim/bundle/nerdtree
|
path = zsh/ohmyzsh
|
||||||
url = https://github.com/scrooloose/nerdtree.git
|
url = https://github.com/ohmyzsh/ohmyzsh
|
||||||
[submodule "vim/.vim/bundle/vim-tmux-navigator"]
|
[submodule "zsh/custom/plugins/zsh-autosuggestions"]
|
||||||
path = vim/.vim/bundle/vim-tmux-navigator
|
path = zsh/custom/plugins/zsh-autosuggestions
|
||||||
url = https://github.com/christoomey/vim-tmux-navigator.git
|
url = https://github.com/zsh-users/zsh-autosuggestions/
|
||||||
[submodule "vim/.vim/bundle/YouCompleteMe"]
|
[submodule "tmux/tpm"]
|
||||||
path = vim/.vim/bundle/YouCompleteMe
|
path = tmux/tpm
|
||||||
url = https://github.com/Valloric/YouCompleteMe.git
|
url = https://github.com/tmux-plugins/tpm
|
||||||
ignore = dirty
|
[submodule "zsh/custom/plugins/zsh-autopair"]
|
||||||
[submodule "vim/.vim/bundle/tagbar"]
|
path = zsh/custom/plugins/zsh-autopair
|
||||||
path = vim/.vim/bundle/tagbar
|
url = https://github.com/hlissner/zsh-autopair
|
||||||
url = https://github.com/majutsushi/tagbar.git
|
[submodule "zsh/custom/plugins/fast-syntax-highlighting"]
|
||||||
[submodule "vim/.vim/bundle/tcomment_vim"]
|
path = zsh/custom/plugins/fast-syntax-highlighting
|
||||||
path = vim/.vim/bundle/tcomment_vim
|
url = https://github.com/zdharma-continuum/fast-syntax-highlighting.git
|
||||||
url = https://github.com/tomtom/tcomment_vim.git
|
[submodule "zsh/custom/plugins/zsh-completions"]
|
||||||
[submodule "vim/.vim/bundle/vim-exchange"]
|
path = zsh/custom/plugins/zsh-completions
|
||||||
path = vim/.vim/bundle/vim-exchange
|
url = https://github.com/zsh-users/zsh-completions.git
|
||||||
url = https://github.com/tommcdo/vim-exchange.git
|
[submodule "zsh/custom/plugins/zsh-vi-mode"]
|
||||||
[submodule "vim/.vim/bundle/tabular"]
|
path = zsh/custom/plugins/zsh-vi-mode
|
||||||
path = vim/.vim/bundle/tabular
|
url = https://github.com/jeffreytse/zsh-vi-mode
|
||||||
url = https://github.com/godlygeek/tabular.git
|
|
||||||
[submodule "vim/.vim/bundle/vim-surround"]
|
|
||||||
path = vim/.vim/bundle/vim-surround
|
|
||||||
url = https://github.com/tpope/vim-surround.git
|
|
||||||
[submodule "vim/.vim/bundle/vim-airline"]
|
|
||||||
path = vim/.vim/bundle/vim-airline
|
|
||||||
url = https://github.com/bling/vim-airline.git
|
|
||||||
[submodule "vim/.vim/bundle/gruvbox"]
|
|
||||||
path = vim/.vim/bundle/gruvbox
|
|
||||||
url = https://github.com/morhetz/gruvbox.git
|
|
||||||
[submodule "vim/.vim/bundle/vim-matchparenalways"]
|
|
||||||
path = vim/.vim/bundle/vim-matchparenalways
|
|
||||||
url = https://github.com/justinmk/vim-matchparenalways.git
|
|
||||||
[submodule "vim/.vim/bundle/vim-gradle"]
|
|
||||||
path = vim/.vim/bundle/vim-gradle
|
|
||||||
url = https://github.com/tfnico/vim-gradle.git
|
|
||||||
[submodule "vim/.vim/bundle/indentLine"]
|
|
||||||
path = vim/.vim/bundle/indentLine
|
|
||||||
url = https://github.com/Yggdroot/indentLine.git
|
|
||||||
[submodule "vim/.vim/bundle/delimitMate"]
|
|
||||||
path = vim/.vim/bundle/delimitMate
|
|
||||||
url = https://github.com/Raimondi/delimitMate.git
|
|
||||||
[submodule "vim/.vim/bundle/ctrlp.vim"]
|
|
||||||
path = vim/.vim/bundle/ctrlp.vim
|
|
||||||
url = https://github.com/kien/ctrlp.vim.git
|
|
||||||
[submodule "vim/.vim/bundle/vim-latex-live-preview"]
|
|
||||||
path = vim/.vim/bundle/vim-latex-live-preview
|
|
||||||
url = https://github.com/xuhdev/vim-latex-live-preview.git
|
|
||||||
|
|||||||
@@ -1,10 +1,20 @@
|
|||||||
#Dotfiles
|
## Tools
|
||||||
These are my personal dotfiles.
|
|
||||||
You are free to use and change them to your liking.
|
|
||||||
|
|
||||||
##Instal
|
### Core tools
|
||||||
````
|
|
||||||
git clone https://github.com/DreadedX/dotfiles.git ~/.dotfiles
|
```
|
||||||
cd .dotfiles
|
bat
|
||||||
./install.sh ~/.dotfiles
|
fd
|
||||||
````
|
fzf
|
||||||
|
git-delta
|
||||||
|
paru
|
||||||
|
rg
|
||||||
|
zoxide
|
||||||
|
```
|
||||||
|
|
||||||
|
### Useful
|
||||||
|
|
||||||
|
```
|
||||||
|
jq
|
||||||
|
git-cliff
|
||||||
|
```
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
[env]
|
||||||
|
TERM = "xterm-256color"
|
||||||
|
|
||||||
|
[font]
|
||||||
|
size = 10
|
||||||
|
|
||||||
|
[font.normal]
|
||||||
|
family = "Hack Nerd Font"
|
||||||
|
|
||||||
|
[window]
|
||||||
|
decorations = "none"
|
||||||
|
dynamic_padding = true
|
||||||
|
dynamic_title = true
|
||||||
|
resize_increments = true
|
||||||
|
|
||||||
|
[window.dimensions]
|
||||||
|
columns = 80
|
||||||
|
lines = 24
|
||||||
|
|
||||||
|
[general]
|
||||||
|
import = ["/home/tim/.config/alacritty/gruvbox_dark.toml"]
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
[colors.bright]
|
||||||
|
black = "#928374"
|
||||||
|
blue = "#83a598"
|
||||||
|
cyan = "#8ec07c"
|
||||||
|
green = "#b8bb26"
|
||||||
|
magenta = "#d3869b"
|
||||||
|
red = "#fb4934"
|
||||||
|
white = "#ebdbb2"
|
||||||
|
yellow = "#fabd2f"
|
||||||
|
|
||||||
|
[colors.normal]
|
||||||
|
black = "#282828"
|
||||||
|
blue = "#458588"
|
||||||
|
cyan = "#689d6a"
|
||||||
|
green = "#98971a"
|
||||||
|
magenta = "#b16286"
|
||||||
|
red = "#cc241d"
|
||||||
|
white = "#a89984"
|
||||||
|
yellow = "#d79921"
|
||||||
|
|
||||||
|
[colors.primary]
|
||||||
|
background = "#282828"
|
||||||
|
foreground = "#fbf1c7"
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
## Configuration file for CAVA. Default values are commented out. Use either ; or # for commenting.
|
|
||||||
|
|
||||||
|
|
||||||
[general]
|
|
||||||
|
|
||||||
# smoothing mode, can be normal, scientific or waves.
|
|
||||||
; mode = waves
|
|
||||||
|
|
||||||
# Framerate Default: 60. Accepts only non-negative values.
|
|
||||||
; framerate = 60
|
|
||||||
|
|
||||||
# Sensitivity in %. If you think the bars are to low/response is to littei, try
|
|
||||||
# increasing this value 200 means double height. Accepts only non-negative values.
|
|
||||||
# sensitivity = 4
|
|
||||||
sensitivity = 4
|
|
||||||
|
|
||||||
# Autosens will atempt to decrease sensitivity if cava peaks. 1 = on, 0 = off
|
|
||||||
autosens = 0
|
|
||||||
|
|
||||||
# The number of bars. 0 (default) sets it to auto (fil upp console).
|
|
||||||
# width of bras and space between bars in number of characters. Default witdth 3 and space 1.
|
|
||||||
; bars = 35
|
|
||||||
bar_width = 1
|
|
||||||
bar_spacing = 1
|
|
||||||
|
|
||||||
|
|
||||||
# Lower cutoff freq for lowest bar and higheset for highest bar
|
|
||||||
# the bandwith of the visualizer, defaults to 50 - 10000 Hz
|
|
||||||
# Note: there is a minimum total bandwith of 43Mhz x number of bars.
|
|
||||||
# Cava will automaticly increase the higher cuttoff if a too low band is specified.
|
|
||||||
lower_cutoff_freq = 50
|
|
||||||
higher_cutoff_freq = 10000
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[input]
|
|
||||||
|
|
||||||
# method of capturing audio, supported input methods are: 'pulse', 'alsa' or 'fifo'.
|
|
||||||
# Defaults to 'alsa'
|
|
||||||
#
|
|
||||||
# for pulseaudio 'source' wil be the source. Default: 'NULL', which uses system default source
|
|
||||||
# all pulseaudio sinks(outputs) have 'monitor' sources(inputs) associated with them
|
|
||||||
# but the default, might be your microphone, try the command 'pacmd list-sources' to find the right one
|
|
||||||
# you can change source here to the name of your prefered device, or cahnge your default pulseaudio source by running
|
|
||||||
# 'pacmd set-default-source NAME|#N'
|
|
||||||
#
|
|
||||||
# for alsa 'source' will be the capture device. Default: 'hw:Loopback,1'
|
|
||||||
# for fifo 'source' will be the path to fifo-file. Default: '/tmp/mpd.fifo'
|
|
||||||
; method = alsa
|
|
||||||
; source = hw:Loopback,1
|
|
||||||
|
|
||||||
; method = fifo
|
|
||||||
; source = /tmp/mpd.fifo
|
|
||||||
|
|
||||||
; method = pulse
|
|
||||||
; source = NULL
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[output]
|
|
||||||
|
|
||||||
# method used to draw output may be ncurses, noncurses.
|
|
||||||
; method = ncurses
|
|
||||||
|
|
||||||
# visual styles, may be 'stereo' or 'mono'.
|
|
||||||
# Stereo mirrors both channels with low frequencies in center.
|
|
||||||
# Mono avrages both channels and outputs left to right lowest to highest frequencies
|
|
||||||
style = stereo
|
|
||||||
|
|
||||||
|
|
||||||
[color]
|
|
||||||
|
|
||||||
# supported colors are: red, green, yellow, magenta, cyan, white, blue, black.
|
|
||||||
; background = black
|
|
||||||
; foreground = red
|
|
||||||
gradient = 1
|
|
||||||
gradient_color_1 = '#ff0000'
|
|
||||||
gradient_color_2 = '#220000'
|
|
||||||
|
|
||||||
|
|
||||||
[smoothing]
|
|
||||||
|
|
||||||
# multiplier for the integral smoothing calculations. Takes values from 0 - 0.99.
|
|
||||||
# Higher values means smoother, but less precise. 0 to disable.
|
|
||||||
integral = 0
|
|
||||||
|
|
||||||
# disables or enables the so-called "Monstercat smoothing". Default: 1. Set to 0 to disable.
|
|
||||||
monstercat = 1
|
|
||||||
|
|
||||||
# Set gravity multiplier for "drop off". Higher values means bars will drop faster.
|
|
||||||
# Accepts only non-negative values. 0.5 means half gravity, 2 means double. Set to 0 to disable "drop off".
|
|
||||||
gravity = 100
|
|
||||||
|
|
||||||
|
|
||||||
# In bar height, bars that whould have been lower that this will not be drawn.
|
|
||||||
; ignore = 0
|
|
||||||
|
|
||||||
|
|
||||||
[eq]
|
|
||||||
|
|
||||||
# This one is tricky. You can have as much keys as you want.
|
|
||||||
# remember to uncomment more then one key! More keys = more precision.
|
|
||||||
# Look at readme.md on github for further explanations and examples.
|
|
||||||
; 1 = 1 # bass
|
|
||||||
; 2 = 3
|
|
||||||
; 3 = 2 # midtone
|
|
||||||
; 4 = 2
|
|
||||||
; 5 = 1 # treble
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
[include]
|
||||||
|
path = ~/.dotfiles/git/configs/common.gitconfig
|
||||||
|
|
||||||
|
path = ~/.dotfiles/git/profiles/aim-robotics.gitconfig
|
||||||
|
|
||||||
|
[includeIf "gitdir:~/.dotfiles/"]
|
||||||
|
path = ~/.dotfiles/git/profiles/Dreaded_X.gitconfig
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../git/dot-local
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
[include]
|
||||||
|
path = ~/.dotfiles/git/configs/common.gitconfig
|
||||||
|
|
||||||
|
path = ~/.dotfiles/git/profiles/ALTEN.gitconfig
|
||||||
|
|
||||||
|
[includeIf "gitdir:~/.dotfiles"]
|
||||||
|
path = ~/.dotfiles/git/profiles/Dreaded_X.gitconfig
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../git/dot-local
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
# Created by https://www.gitignore.io
|
|
||||||
|
|
||||||
### Vim ###
|
|
||||||
[._]*.s[a-w][a-z]
|
|
||||||
[._]s[a-w][a-z]
|
|
||||||
*.un~
|
|
||||||
Session.vim
|
|
||||||
.netrwhist
|
|
||||||
*~
|
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
gitignore
|
||||||
|
profiles
|
||||||
|
configs
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
[include]
|
||||||
|
path = ~/.dotfiles/git/configs/lfs.gitconfig
|
||||||
|
path = ~/.dotfiles/git/configs/delta.gitconfig
|
||||||
|
path = ~/.dotfiles/git/configs/sign.gitconfig
|
||||||
|
|
||||||
|
[push]
|
||||||
|
default = simple
|
||||||
|
autoSetupRemote = true
|
||||||
|
|
||||||
|
[core]
|
||||||
|
excludesfile = ~/.dotfiles/git/gitignore
|
||||||
|
|
||||||
|
[color]
|
||||||
|
ui = true
|
||||||
|
|
||||||
|
[credential]
|
||||||
|
helper = store
|
||||||
|
|
||||||
|
[pull]
|
||||||
|
; If we pull we only want to fast forward, if that is not possible we should not allow pull to work
|
||||||
|
; Instead use fetch and then either rebase or merge
|
||||||
|
ff = only
|
||||||
|
; rebase = false
|
||||||
|
|
||||||
|
[diff]
|
||||||
|
tool = nvimdiff
|
||||||
|
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
|
|
||||||
|
[rebase]
|
||||||
|
autosquash = true
|
||||||
|
autostash = true
|
||||||
|
updateRefs = true
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
[delta "gruvmax-fang"]
|
||||||
|
# author: https://github.com/maxfangx
|
||||||
|
# Modified by: Dreaded_X
|
||||||
|
# General appearance
|
||||||
|
dark = true
|
||||||
|
syntax-theme = gruvbox-dark
|
||||||
|
# File
|
||||||
|
file-style = "#FFFFFF" bold
|
||||||
|
file-added-label = [+]
|
||||||
|
file-copied-label = [==]
|
||||||
|
file-modified-label = [*]
|
||||||
|
file-removed-label = [-]
|
||||||
|
file-renamed-label = [->]
|
||||||
|
file-decoration-style = "#434C5E" ul
|
||||||
|
file-decoration-style = "#84786A" ul
|
||||||
|
# No hunk headers
|
||||||
|
hunk-header-style = omit
|
||||||
|
# Line numbers
|
||||||
|
line-numbers = true
|
||||||
|
line-numbers-left-style = "#84786A"
|
||||||
|
line-numbers-right-style = "#84786A"
|
||||||
|
line-numbers-minus-style = "#A02A11"
|
||||||
|
line-numbers-plus-style = "#479B36"
|
||||||
|
line-numbers-zero-style = "#84786A"
|
||||||
|
line-numbers-left-format = " {nm:>3} │"
|
||||||
|
line-numbers-right-format = " {np:>3} │"
|
||||||
|
# Diff contents
|
||||||
|
inline-hint-style = syntax
|
||||||
|
minus-non-emph-style = syntax auto
|
||||||
|
plus-non-emph-style = syntax auto
|
||||||
|
whitespace-error-style = "#FB4934" reverse
|
||||||
|
# Blame
|
||||||
|
blame-code-style = syntax
|
||||||
|
# Merge conflicts
|
||||||
|
merge-conflict-begin-symbol = ⌃
|
||||||
|
merge-conflict-end-symbol = ⌄
|
||||||
|
merge-conflict-ours-diff-header-style = "#FABD2F" bold
|
||||||
|
merge-conflict-theirs-diff-header-style = "#FABD2F" bold overline
|
||||||
|
merge-conflict-ours-diff-header-decoration-style = ''
|
||||||
|
merge-conflict-theirs-diff-header-decoration-style = ''
|
||||||
|
|
||||||
|
[core]
|
||||||
|
pager = delta
|
||||||
|
|
||||||
|
[interactive]
|
||||||
|
diffFilter = delta --color-only
|
||||||
|
|
||||||
|
[delta]
|
||||||
|
features = gruvmax-fang
|
||||||
|
navigate = true
|
||||||
|
side-by-side = true
|
||||||
|
|
||||||
|
[merge]
|
||||||
|
conflictstyle = zdiff3
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[filter "lfs"]
|
||||||
|
process = git-lfs filter-process
|
||||||
|
required = true
|
||||||
|
clean = git-lfs clean -- %f
|
||||||
|
smudge = git-lfs smudge -- %f
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[user]
|
||||||
|
signingkey = CD17A34CBFB21DE9A73D47EB76BDEC4E165D8AD9
|
||||||
|
|
||||||
|
[commit]
|
||||||
|
gpgsign = true
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
[include]
|
||||||
|
path = ~/.dotfiles/git/configs/common.gitconfig
|
||||||
|
|
||||||
|
path = ~/.dotfiles/git/profiles/Dreaded_X.gitconfig
|
||||||
|
|
||||||
|
[includeIf "gitdir:~/Projects/ALTEN/"]
|
||||||
|
path = ~/.dotfiles/git/profiles/ALTEN.gitconfig
|
||||||
|
|
||||||
|
[includeIf "gitdir:~/Projects/aim-robotics/"]
|
||||||
|
path = ~/.dotfiles/git/profiles/aim-robotics.gitconfig
|
||||||
Executable
+19
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
TARGET=$1
|
||||||
|
|
||||||
|
|
||||||
|
if [ -z "$TARGET" ]; then
|
||||||
|
if hash fzf 2>/dev/null; then
|
||||||
|
TARGET=$(git log -n 50 --pretty=format:'%h %s' --no-merges | fzf --border-label=' Select commit ' | cut -c -7 )
|
||||||
|
else
|
||||||
|
echo "Not installed: fzf"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$TARGET" ]; then
|
||||||
|
echo "No target specified"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
git commit --fixup=$TARGET ${@:2} && GIT_SEQUENCE_EDITOR=true git rebase -i --autostash --autosquash $TARGET^
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Created by https://www.gitignore.io/api/vim
|
||||||
|
|
||||||
|
### Vim ###
|
||||||
|
# swap
|
||||||
|
.sw[a-p]
|
||||||
|
.*.sw[a-p]
|
||||||
|
# session
|
||||||
|
Session.vim
|
||||||
|
# temporary
|
||||||
|
.netrwhist
|
||||||
|
*~
|
||||||
|
# auto-generated tag files
|
||||||
|
tags
|
||||||
|
|
||||||
|
# End of https://www.gitignore.io/api/vim
|
||||||
|
|
||||||
|
# Make sure we do not include vimlocal files
|
||||||
|
.vimlocal
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[user]
|
||||||
|
name = Tim Huizinga
|
||||||
|
email = tim.huizinga@alten.nl
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[user]
|
||||||
|
name = Dreaded_X
|
||||||
|
email = tim@huizinga.dev
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[user]
|
||||||
|
name = Tim Huizinga
|
||||||
|
email = th@aimrobotics.nl
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
enable-ssh-support
|
||||||
|
|
||||||
|
default-cache-ttl 180800
|
||||||
|
max-cache-ttl 180800
|
||||||
|
default-cache-ttl-ssh 180800
|
||||||
|
max-cache-ttl-ssh 180800
|
||||||
|
|
||||||
|
pinentry-program /usr/bin/pinentry-tty
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
window.ssd separator:first-child + headerbar:backdrop,
|
|
||||||
window.ssd separator:first-child + headerbar,
|
|
||||||
window.ssd headerbar:first-child:backdrop,
|
|
||||||
window.ssd headerbar:first-child,
|
|
||||||
window.ssd headerbar:last-child:backdrop,
|
|
||||||
window.ssd headerbar:last-child,
|
|
||||||
window.ssd stack headerbar:first-child:backdrop,
|
|
||||||
window.ssd stack headerbar:first-child,
|
|
||||||
window.ssd stack headerbar:last-child:backdrop,
|
|
||||||
window.ssd stack headerbar:last-child,
|
|
||||||
window.ssd decoration,
|
|
||||||
window.ssd headerbar.titlebar {
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
window.ssd headerbar * {
|
|
||||||
margin-top: -100px;
|
|
||||||
color: #222d32; /* May need to tweak, this matches Adwaita Dark */
|
|
||||||
}
|
|
||||||
|
|
||||||
window.ssd headerbar.titlebar,
|
|
||||||
window.ssd headerbar.titlebar button.titlebutton {
|
|
||||||
border: none;
|
|
||||||
font-size: 0;
|
|
||||||
height: 0;
|
|
||||||
margin: 0;
|
|
||||||
max-height: 0;
|
|
||||||
min-height: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
Executable
+21
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Install additional dependencies
|
||||||
|
sudo apt-get install fuse libfuse2 unzip ripgrep python3-venv xclip -y --no-install-recommends
|
||||||
|
|
||||||
|
# Install new version of node
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_23.x -o /tmp/nodesource_setup.sh
|
||||||
|
sudo -E bash /tmp/nodesource_setup.sh
|
||||||
|
sudo apt-get install -y nodejs
|
||||||
|
|
||||||
|
# Install new version of neovim
|
||||||
|
sudo rm -rf /usr/local/bin/nvim
|
||||||
|
sudo wget https://github.com/neovim/neovim-releases/releases/download/v0.11.1/nvim-linux-x86_64.appimage -O /usr/local/bin/nvim
|
||||||
|
sudo chmod +x /usr/local/bin/nvim
|
||||||
|
|
||||||
|
# Get latest version of dotfiles
|
||||||
|
rm -rf ~/.dotfiles
|
||||||
|
git clone https://git.huizinga.dev/Dreaded_X/dotfiles ~/.dotfiles
|
||||||
|
mkdir -p ~/.config
|
||||||
|
ln -s ~/.dotfiles/nvim/dot-config/nvim ~/.config/nvim
|
||||||
-69
@@ -1,69 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Show help
|
|
||||||
function show_help {
|
|
||||||
echo "Specify existing directory";
|
|
||||||
}
|
|
||||||
|
|
||||||
# Ask user
|
|
||||||
function ask {
|
|
||||||
while true; do
|
|
||||||
read -p "$1 [Y/n] " yn
|
|
||||||
case $yn in
|
|
||||||
[Nn]* ) break;;
|
|
||||||
* ) $2; break;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Update submodules
|
|
||||||
function submodule {
|
|
||||||
git submodule update --init --recursive
|
|
||||||
}
|
|
||||||
# Apply patches
|
|
||||||
function patch {
|
|
||||||
cd $dotfiles
|
|
||||||
git am $dotfiles/patches/*.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
# Comple YouCompleteMe
|
|
||||||
function ycm {
|
|
||||||
$dotfiles/vim/bundle/YouCompleteMe/install.sh
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install tmux-vim-select-pane
|
|
||||||
function tvpane {
|
|
||||||
sudo curl -fsSL https://raw.github.com/mislav/dotfiles/1500cd2/bin/tmux-vim-select-pane -o /usr/local/bin/tmux-vim-select-pane
|
|
||||||
sudo chmod +x /usr/local/bin/tmux-vim-select-pane
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install fonts
|
|
||||||
function fonts {
|
|
||||||
curl -fsSL https://github.com/Lokaltog/powerline-fonts/raw/master/SourceCodePro/Sauce%20Code%20Powerline%20Regular.otf -o "$HOME/.fonts/Sauce Code Powerline Regular.otf"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Setup symlinks to config files
|
|
||||||
function symlink {
|
|
||||||
if [ ! -f ~/.tmux.conf ]; then ln -s $dotfiles/tmux.conf ~/.tmux.conf; fi
|
|
||||||
if [ ! -f ~/.zshrc ]; then ln -s $dotfiles/zshrc ~/.zshrc; fi
|
|
||||||
if [ ! -f ~/.vimrc ]; then ln -s $dotfiles/vimrc ~/.vimrc; fi
|
|
||||||
if [ ! -f ~/.yaourtrc ]; then ln -s $dotfiles/yaourtrc ~/.yaourtrc; fi
|
|
||||||
if [ ! -f ~/.gitignore ]; then ln -s $dotfiles/.gitignore ~/.gitignore; fi
|
|
||||||
if [ ! -d ~/.vim ]; then ln -s $dotfiles/vim ~/.vim; fi
|
|
||||||
if [ ! -d ~/.local/bin/scripts ]; then ln -s $dotfiles/scripts ~/.local/bin/scripts; fi
|
|
||||||
echo "All symlink have been made"
|
|
||||||
}
|
|
||||||
|
|
||||||
dotfiles="$1"
|
|
||||||
if [ -z "$1" ]; then show_help; exit 0; fi;
|
|
||||||
if [ ! -d $1 ]; then show_help; exit 0; fi;
|
|
||||||
|
|
||||||
cd $dotfiles
|
|
||||||
|
|
||||||
# Ask and execute the install script
|
|
||||||
ask "Update submodules" submodule
|
|
||||||
ask "Apply patches" patch
|
|
||||||
ask "Compile YCM" ycm
|
|
||||||
ask "Install tmux-vim-select-pane" tvpane
|
|
||||||
ask "Install fonts" fonts
|
|
||||||
# ask "Install gnome-terminal theme"
|
|
||||||
ask "Make symlinks" symlink
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
let g:netrw_dirhistmax =10
|
|
||||||
let g:netrw_dirhist_cnt =4
|
|
||||||
let g:netrw_dirhist_1='/home/tim/.nvim'
|
|
||||||
let g:netrw_dirhist_2='/home/tim/.dotfiles/nvim/.nvim'
|
|
||||||
let g:netrw_dirhist_3='/home/tim/Projects/cpp/arena'
|
|
||||||
let g:netrw_dirhist_4='/home/tim/Projects/cpp/stdany'
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
|||||||
" Vim Compiler File
|
|
||||||
" Compiler: gradle
|
|
||||||
|
|
||||||
if exists("current_compiler")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
let current_compiler = "gradle"
|
|
||||||
|
|
||||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
|
||||||
command -nargs=* CompilerSet setlocal <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
CompilerSet makeprg=gradle
|
|
||||||
|
|
||||||
CompilerSet errorformat=
|
|
||||||
\%-G:%.%\\+,
|
|
||||||
\%E%f:\ %\\d%\\+:\ %m\ @\ line\ %l\\,\ column\ %c.,%-C%.%#,%Z%p^,
|
|
||||||
\%E%>%f:\ %\\d%\\+:\ %m,%C\ @\ line\ %l\\,\ column\ %c.,%-C%.%#,%Z%p^,
|
|
||||||
\%-G\\s%#,
|
|
||||||
\%-GBUILD\ SUCCESSFUL#,
|
|
||||||
\%-GTotal\ \time:\ %.%#
|
|
||||||
|
|
||||||
@@ -1,204 +0,0 @@
|
|||||||
call plug#begin('~/.dotfiles/nvim/.config/nvim/plugged')
|
|
||||||
" Plug 'kien/ctrlp.vim'
|
|
||||||
" Plug 'FelikZ/ctrlp-py-matcher'
|
|
||||||
Plug 'Raimondi/delimitMate'
|
|
||||||
Plug 'morhetz/gruvbox'
|
|
||||||
" Plug 'Yggdroot/indentLine'
|
|
||||||
Plug 'scrooloose/nerdtree'
|
|
||||||
Plug 'godlygeek/tabular'
|
|
||||||
" Plug 'majutsushi/tagbar'
|
|
||||||
Plug 'tomtom/tcomment_vim'
|
|
||||||
Plug 'bling/vim-airline'
|
|
||||||
Plug 'tommcdo/vim-exchange'
|
|
||||||
Plug 'tpope/vim-surround'
|
|
||||||
Plug 'christoomey/vim-tmux-navigator'
|
|
||||||
Plug 'MarcWeber/vim-addon-mw-utils'
|
|
||||||
Plug 'tomtom/tlib_vim'
|
|
||||||
Plug 'SirVer/ultisnips'
|
|
||||||
Plug 'honza/vim-snippets'
|
|
||||||
" Plug 'beyondmarc/glsl.vim'
|
|
||||||
Plug 'tpope/vim-dispatch'
|
|
||||||
" Plug 'freitass/todo.txt-vim'
|
|
||||||
Plug 'tpope/vim-unimpaired'
|
|
||||||
Plug 'milkypostman/vim-togglelist'
|
|
||||||
Plug 'Valloric/YouCompleteMe'
|
|
||||||
" Plug 'Shougo/deoplete.nvim'
|
|
||||||
" Plug 'vim-scripts/LanguageTool'
|
|
||||||
" Plug 'pangloss/vim-javascript'
|
|
||||||
Plug 'moll/vim-bbye'
|
|
||||||
Plug 'tpope/vim-fugitive'
|
|
||||||
Plug 'tikhomirov/vim-glsl'
|
|
||||||
Plug 'rust-lang/rust.vim'
|
|
||||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
|
||||||
Plug 'digitaltoad/vim-pug'
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
silent! so .vimlocal
|
|
||||||
|
|
||||||
" let g:ctrlp_custom_ignore = '\v[\/](bin|build|docs)$'
|
|
||||||
map <silent> <C-P> :call fzf#run(fzf#wrap('custom', {'source': 'ag -g ""'}, 0))<cr>
|
|
||||||
let g:fzf_layout = { 'down': '~20%' }
|
|
||||||
let g:fzf_colors =
|
|
||||||
\ { 'fg': ['fg', 'Normal'],
|
|
||||||
\ 'bg': ['bg', 'Normal'],
|
|
||||||
\ 'hl': ['fg', 'Comment'],
|
|
||||||
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
|
|
||||||
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
|
|
||||||
\ 'hl+': ['fg', 'Statement'],
|
|
||||||
\ 'info': ['fg', 'PreProc'],
|
|
||||||
\ 'border': ['fg', 'Ignore'],
|
|
||||||
\ 'prompt': ['fg', 'Conditional'],
|
|
||||||
\ 'pointer': ['fg', 'Exception'],
|
|
||||||
\ 'marker': ['fg', 'Keyword'],
|
|
||||||
\ 'spinner': ['fg', 'Label'],
|
|
||||||
\ 'header': ['fg', 'Comment'] }
|
|
||||||
|
|
||||||
|
|
||||||
let delimitMate_expand_cr = 1
|
|
||||||
|
|
||||||
set mouse=a
|
|
||||||
|
|
||||||
colorscheme gruvbox
|
|
||||||
set t_Co=256
|
|
||||||
set t_ZH=[3m
|
|
||||||
set t_ZR=[23m
|
|
||||||
set background=dark
|
|
||||||
|
|
||||||
set list lcs=tab:\│\
|
|
||||||
|
|
||||||
map <silent> <F2> :NERDTreeToggle<cr>
|
|
||||||
|
|
||||||
" map <silent> <M-2> :TagbarToggle<cr>
|
|
||||||
" map <silent> <F3> :TagbarToggle<cr>
|
|
||||||
|
|
||||||
let g:airline_powerline_fonts = 1
|
|
||||||
let g:airline#extensions#tabline#enabled = 1
|
|
||||||
let g:airline_theme='gruvbox'
|
|
||||||
|
|
||||||
map <M-h> :TmuxNavigateLeft<cr>
|
|
||||||
map <M-j> :TmuxNavigateDown<cr>
|
|
||||||
map <M-k> :TmuxNavigateUp<cr>
|
|
||||||
map <M-l> :TmuxNavigateRight<cr>
|
|
||||||
|
|
||||||
" set omnifunc=syntaxcomplete#Complete " override built-in C omnicomplete with C++ OmniCppComplete plugin
|
|
||||||
" let OmniCpp_GlobalScopeSearch = 1
|
|
||||||
" let OmniCpp_DisplayMode = 1
|
|
||||||
" let OmniCpp_ShowScopeInAbbr = 0 "do not show namespace in pop-up
|
|
||||||
" let OmniCpp_ShowPrototypeInAbbr = 1 "show prototype in pop-up
|
|
||||||
" let OmniCpp_ShowAccess = 1 "show access in pop-up
|
|
||||||
" let OmniCpp_SelectFirstItem = 1 "select first item in pop-up
|
|
||||||
|
|
||||||
set completeopt=menuone,menu,preview
|
|
||||||
let g:ycm_confirm_extra_conf = 0
|
|
||||||
let g:ycm_error_symbol = ''
|
|
||||||
let g:ycm_warning_symbol = ''
|
|
||||||
|
|
||||||
let g:UltiSnipsExpandTrigger="<c-s>"
|
|
||||||
|
|
||||||
syntax on
|
|
||||||
filetype plugin indent on
|
|
||||||
|
|
||||||
au BufRead,BufNewFile *.lang setfiletype lang
|
|
||||||
|
|
||||||
set smartindent
|
|
||||||
set number
|
|
||||||
set relativenumber
|
|
||||||
set laststatus=2
|
|
||||||
set softtabstop=4
|
|
||||||
set tabstop=4
|
|
||||||
set shiftwidth=4
|
|
||||||
set noexpandtab
|
|
||||||
set completeopt-=preview
|
|
||||||
|
|
||||||
" I do not remember what this is for
|
|
||||||
" set cinkeys=0{,0},0),:,!^F,o,O,e
|
|
||||||
|
|
||||||
let g:languagetool_jar='$HOME/.local/bin/LanguageTool-3.2/languagetool-commandline.jar'
|
|
||||||
let g:languagetool_lang="nl"
|
|
||||||
|
|
||||||
map <silent> <tab> :bn<cr>
|
|
||||||
map <silent> <S-tab> :bp<cr>
|
|
||||||
|
|
||||||
map <S-J> 10j
|
|
||||||
map <S-K> 10k
|
|
||||||
|
|
||||||
map <silent> <C-B> :Bdelete<cr>
|
|
||||||
|
|
||||||
" autocmd FileType go let &makeprg="go run %:p:h/*.go"
|
|
||||||
" autocmd FileType go map <F10> :Make<cr>
|
|
||||||
"
|
|
||||||
" autocmd FileType tex map <F9> :Dispatch arara %<cr>
|
|
||||||
"
|
|
||||||
" autocmd FileType cpp map <F9> :Make<cr>
|
|
||||||
" autocmd FileType cpp map <S-F9> :Make clean all<cr>
|
|
||||||
|
|
||||||
" if filereadable(expand("%:p:h")."/CMake/default/Makefile")
|
|
||||||
" let &makeprg="cd CMake/default && make"
|
|
||||||
" autocmd FileType cpp map <F10> :Make debug<cr>
|
|
||||||
" endif
|
|
||||||
" if filereadable(expand("%:p:h")."/build/cmake/Makefile")
|
|
||||||
" function KeyBind(platform)
|
|
||||||
" let &makeprg="cd cmake/configs/".a:platform." && make"
|
|
||||||
" execute 'autocmd FileType cpp map <F10> :Start cd cmake/configs/'.a:platform.' && ./run-engine.sh; echo "\nPress [enter] to close" && read<cr>'
|
|
||||||
" execute 'autocmd FileType cpp map <S-F10> :Start cd cmake/configs/'.a:platform.' && ./debug-engine.sh<cr>'
|
|
||||||
" endfunction
|
|
||||||
" call KeyBind("linux")
|
|
||||||
" endif
|
|
||||||
|
|
||||||
map <silent> <F4> :call ToggleQuickfixList()<cr>
|
|
||||||
" map <silent> <F7> :grep -F TODO -R ./src/**/*.cpp ./include/**/*.h<cr> :cw<cr>
|
|
||||||
" map <silent> <F8> :grep -F NOTE -R ./src/**/*.cpp ./include/**/*.h<cr> :cw<cr>
|
|
||||||
|
|
||||||
function! NeatFoldText()
|
|
||||||
let line = ' ' . substitute(getline(v:foldstart), '^\s*"\?\s*\|\s*"\?\s*{{' . '{\d*\s*', '', 'g') . ' '
|
|
||||||
let lines_count = v:foldend - v:foldstart + 1
|
|
||||||
let lines_count_text = '| ' . printf("%10s", lines_count . ' lines') . ' |'
|
|
||||||
let foldchar = matchstr(&fillchars, 'fold:\zs.')
|
|
||||||
let foldtextstart = strpart('+' . repeat(foldchar, v:foldlevel*2) . line, 0, (winwidth(0)*2)/3)
|
|
||||||
let foldtextend = lines_count_text . repeat(foldchar, 8)
|
|
||||||
let foldtextlength = strlen(substitute(foldtextstart . foldtextend, '.', 'x', 'g')) + &foldcolumn
|
|
||||||
return foldtextstart . repeat(foldchar, winwidth(0)-foldtextlength) . foldtextend
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! MyFoldText() " {{{
|
|
||||||
let line = getline(v:foldstart)
|
|
||||||
|
|
||||||
let nucolwidth = &fdc + &number * &numberwidth
|
|
||||||
let windowwidth = winwidth(0) - nucolwidth - 3
|
|
||||||
let foldedlinecount = v:foldend - v:foldstart
|
|
||||||
|
|
||||||
" expand tabs into spaces
|
|
||||||
let onetab = strpart(' ', 0, &tabstop)
|
|
||||||
let line = substitute(line, '\t', onetab, 'g')
|
|
||||||
|
|
||||||
let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount))
|
|
||||||
let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
|
|
||||||
return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' '
|
|
||||||
endfunction " }}}
|
|
||||||
|
|
||||||
fu! CustomFoldText()
|
|
||||||
"get first non-blank line
|
|
||||||
let fs = v:foldstart
|
|
||||||
while getline(fs) =~ '^\s*$' | let fs = nextnonblank(fs + 1)
|
|
||||||
endwhile
|
|
||||||
if fs > v:foldend
|
|
||||||
let line = getline(v:foldstart)
|
|
||||||
else
|
|
||||||
let line = substitute(getline(fs), '\t', repeat(' ', &tabstop), 'g')
|
|
||||||
endif
|
|
||||||
|
|
||||||
let w = winwidth(0) - &foldcolumn - (&number ? 8 : 0)
|
|
||||||
let foldSize = 1 + v:foldend - v:foldstart
|
|
||||||
let foldSizeStr = " " . foldSize . " lines "
|
|
||||||
let foldLevelStr = repeat("+--", v:foldlevel)
|
|
||||||
let lineCount = line("$")
|
|
||||||
let foldPercentage = printf("[%.1f", (foldSize*1.0)/lineCount*100) . "%] "
|
|
||||||
let expansionString = repeat(".", w - strwidth(foldSizeStr.line.foldLevelStr.foldPercentage))
|
|
||||||
return line . expansionString . foldSizeStr . foldPercentage . foldLevelStr
|
|
||||||
endf
|
|
||||||
|
|
||||||
" set foldtext=NeatFoldText()
|
|
||||||
set foldtext=CustomFoldText()
|
|
||||||
set foldcolumn=1
|
|
||||||
au BufRead *.cpp,*.go,*.js setlocal foldmethod=syntax
|
|
||||||
au BufRead *.cpp,*go,*.js setlocal foldnestmax=1
|
|
||||||
Submodule nvim/.config/nvim/plugged/LanguageTool deleted from e4f234b8a0
Submodule nvim/.config/nvim/plugged/YouCompleteMe deleted from d183f11fa7
Submodule nvim/.config/nvim/plugged/ctrlp-py-matcher deleted from a0710a4937
Submodule nvim/.config/nvim/plugged/ctrlp.vim deleted from 564176f01d
Submodule nvim/.config/nvim/plugged/delimitMate deleted from 728b57a656
Submodule nvim/.config/nvim/plugged/deoplete.nvim deleted from 816bea3a9a
Submodule nvim/.config/nvim/plugged/glsl.vim deleted from 245c525804
Submodule nvim/.config/nvim/plugged/gruvbox deleted from 16504d394e
Submodule nvim/.config/nvim/plugged/indentLine deleted from 86b9824b89
Submodule nvim/.config/nvim/plugged/nerdtree deleted from 68572ef461
Submodule nvim/.config/nvim/plugged/rust.vim deleted from 8e75da9834
Submodule nvim/.config/nvim/plugged/tabular deleted from 00e1e7fcdb
Submodule nvim/.config/nvim/plugged/tagbar deleted from 7b36c46d17
Submodule nvim/.config/nvim/plugged/tcomment_vim deleted from a48da32365
Submodule nvim/.config/nvim/plugged/tlib_vim deleted from c96db6151f
Submodule nvim/.config/nvim/plugged/todo.txt-vim deleted from 1e3a5e58ae
Submodule nvim/.config/nvim/plugged/ultisnips deleted from 423f264e75
Submodule nvim/.config/nvim/plugged/vim-addon-mw-utils deleted from 0c5612fa31
Submodule nvim/.config/nvim/plugged/vim-airline deleted from c2ffb8b3ec
Submodule nvim/.config/nvim/plugged/vim-bbye deleted from a018cbc1ba
Submodule nvim/.config/nvim/plugged/vim-cpp deleted from 83469fd71b
Submodule nvim/.config/nvim/plugged/vim-cpp-enhanced-highlight deleted from 63072927d2
Submodule nvim/.config/nvim/plugged/vim-dispatch deleted from c5b1bbe166
Submodule nvim/.config/nvim/plugged/vim-exchange deleted from 05d82b8771
Submodule nvim/.config/nvim/plugged/vim-fugitive deleted from f3ccb0c12e
Submodule nvim/.config/nvim/plugged/vim-glsl deleted from 6ea4e1983b
Submodule nvim/.config/nvim/plugged/vim-javascript deleted from 1d8c2677d2
Submodule nvim/.config/nvim/plugged/vim-javascript-syntax deleted from 9e019fccd7
Submodule nvim/.config/nvim/plugged/vim-matchparenalways deleted from d2f514ded8
Submodule nvim/.config/nvim/plugged/vim-pug deleted from ddc5592f8c
Submodule nvim/.config/nvim/plugged/vim-snippets deleted from 71d91aec38
Submodule nvim/.config/nvim/plugged/vim-surround deleted from e49d6c2459
Submodule nvim/.config/nvim/plugged/vim-tmux-navigator deleted from d724094e71
Submodule nvim/.config/nvim/plugged/vim-togglelist deleted from cafedc4986
Submodule nvim/.config/nvim/plugged/vim-unimpaired deleted from 1ac95a86c0
Submodule nvim/.config/nvim/plugged/vim-z80 deleted from 3b9e2b2858
@@ -1,13 +0,0 @@
|
|||||||
#header
|
|
||||||
snippet header
|
|
||||||
#ifndef ${1:`toupper(vim_snippets#Filename('$1_H', 'UNTITLED_H'))`}
|
|
||||||
#define $1
|
|
||||||
|
|
||||||
${0}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
snippet incl
|
|
||||||
#include "standard.h"
|
|
||||||
|
|
||||||
${0}
|
|
||||||
@@ -1,491 +0,0 @@
|
|||||||
" Vim syntax file
|
|
||||||
" Language: C
|
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
|
||||||
" Last Change: 2016 Nov 17
|
|
||||||
|
|
||||||
" Quit when a (custom) syntax file was already loaded
|
|
||||||
if exists("b:current_syntax")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:cpo_save = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
let s:ft = matchstr(&ft, '^\([^.]\)\+')
|
|
||||||
|
|
||||||
" A bunch of useful C keywords
|
|
||||||
syn keyword cStatement goto break return continue asm
|
|
||||||
syn keyword cLabel case default
|
|
||||||
syn keyword cConditional if else switch
|
|
||||||
syn keyword cRepeat while for do
|
|
||||||
|
|
||||||
syn keyword cTodo contained TODO FIXME XXX
|
|
||||||
syn match cTodo contained "@todo"
|
|
||||||
syn match cTodo contained "@note"
|
|
||||||
|
|
||||||
" It's easy to accidentally add a space after a backslash that was intended
|
|
||||||
" for line continuation. Some compilers allow it, which makes it
|
|
||||||
" unpredictable and should be avoided.
|
|
||||||
syn match cBadContinuation contained "\\\s\+$"
|
|
||||||
|
|
||||||
" cCommentGroup allows adding matches for special things in comments
|
|
||||||
syn cluster cCommentGroup contains=cTodo,cBadContinuation
|
|
||||||
|
|
||||||
" String and Character constants
|
|
||||||
" Highlight special characters (those which have a backslash) differently
|
|
||||||
syn match cSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
|
|
||||||
if !exists("c_no_utf")
|
|
||||||
syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("c_no_cformat")
|
|
||||||
" Highlight % items in strings.
|
|
||||||
if !exists("c_no_c99") " ISO C99
|
|
||||||
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
|
||||||
else
|
|
||||||
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
|
||||||
endif
|
|
||||||
syn match cFormat display "%%" contained
|
|
||||||
endif
|
|
||||||
|
|
||||||
" cCppString: same as cString, but ends at end of line
|
|
||||||
if s:ft ==# "cpp" && !exists("cpp_no_cpp11") && !exists("c_no_cformat")
|
|
||||||
" ISO C++11
|
|
||||||
syn region cString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
|
||||||
syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
|
||||||
elseif s:ft ==# "c" && !exists("c_no_c11") && !exists("c_no_cformat")
|
|
||||||
" ISO C99
|
|
||||||
syn region cString start=+\%(L\|U\|u8\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
|
||||||
syn region cCppString start=+\%(L\|U\|u8\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
|
||||||
else
|
|
||||||
" older C or C++
|
|
||||||
syn match cFormat display "%%" contained
|
|
||||||
syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
|
||||||
syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
|
||||||
endif
|
|
||||||
|
|
||||||
syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
|
|
||||||
|
|
||||||
syn cluster cStringGroup contains=cCppString,cCppSkip
|
|
||||||
|
|
||||||
syn match cCharacter "L\='[^\\]'"
|
|
||||||
syn match cCharacter "L'[^']*'" contains=cSpecial
|
|
||||||
if exists("c_gnu")
|
|
||||||
syn match cSpecialError "L\='\\[^'\"?\\abefnrtv]'"
|
|
||||||
syn match cSpecialCharacter "L\='\\['\"?\\abefnrtv]'"
|
|
||||||
else
|
|
||||||
syn match cSpecialError "L\='\\[^'\"?\\abfnrtv]'"
|
|
||||||
syn match cSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
|
|
||||||
endif
|
|
||||||
syn match cSpecialCharacter display "L\='\\\o\{1,3}'"
|
|
||||||
syn match cSpecialCharacter display "'\\x\x\{1,2}'"
|
|
||||||
syn match cSpecialCharacter display "L'\\x\x\+'"
|
|
||||||
|
|
||||||
if (s:ft ==# "c" && !exists("c_no_c11")) || (s:ft ==# "cpp" && !exists("cpp_no_cpp11"))
|
|
||||||
" ISO C11 or ISO C++ 11
|
|
||||||
if exists("c_no_cformat")
|
|
||||||
syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
|
|
||||||
else
|
|
||||||
syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
|
||||||
endif
|
|
||||||
syn match cCharacter "[Uu]'[^\\]'"
|
|
||||||
syn match cCharacter "[Uu]'[^']*'" contains=cSpecial
|
|
||||||
if exists("c_gnu")
|
|
||||||
syn match cSpecialError "[Uu]'\\[^'\"?\\abefnrtv]'"
|
|
||||||
syn match cSpecialCharacter "[Uu]'\\['\"?\\abefnrtv]'"
|
|
||||||
else
|
|
||||||
syn match cSpecialError "[Uu]'\\[^'\"?\\abfnrtv]'"
|
|
||||||
syn match cSpecialCharacter "[Uu]'\\['\"?\\abfnrtv]'"
|
|
||||||
endif
|
|
||||||
syn match cSpecialCharacter display "[Uu]'\\\o\{1,3}'"
|
|
||||||
syn match cSpecialCharacter display "[Uu]'\\x\x\+'"
|
|
||||||
endif
|
|
||||||
|
|
||||||
"when wanted, highlight trailing white space
|
|
||||||
if exists("c_space_errors")
|
|
||||||
if !exists("c_no_trail_space_error")
|
|
||||||
syn match cSpaceError display excludenl "\s\+$"
|
|
||||||
endif
|
|
||||||
if !exists("c_no_tab_space_error")
|
|
||||||
syn match cSpaceError display " \+\t"me=e-1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
" This should be before cErrInParen to avoid problems with #define ({ xxx })
|
|
||||||
if exists("c_curly_error")
|
|
||||||
syn match cCurlyError "}"
|
|
||||||
syn region cBlock start="{" end="}" contains=ALLBUT,cBadBlock,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell fold
|
|
||||||
else
|
|
||||||
syn region cBlock start="{" end="}" transparent fold
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Catch errors caused by wrong parenthesis and brackets.
|
|
||||||
" Also accept <% for {, %> for }, <: for [ and :> for ] (C99)
|
|
||||||
" But avoid matching <::.
|
|
||||||
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
|
|
||||||
if exists("c_no_curly_error")
|
|
||||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
|
||||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
|
||||||
syn match cParenError display ")"
|
|
||||||
syn match cErrInParen display contained "^^<%\|^%>"
|
|
||||||
else
|
|
||||||
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
|
||||||
syn match cParenError display ")"
|
|
||||||
syn match cErrInParen display contained "^[{}]\|^<%\|^%>"
|
|
||||||
endif
|
|
||||||
elseif exists("c_no_bracket_error")
|
|
||||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
|
||||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
|
||||||
syn match cParenError display ")"
|
|
||||||
syn match cErrInParen display contained "<%\|%>"
|
|
||||||
else
|
|
||||||
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
|
||||||
syn match cParenError display ")"
|
|
||||||
syn match cErrInParen display contained "[{}]\|<%\|%>"
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
|
||||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
|
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
|
|
||||||
syn match cParenError display "[\])]"
|
|
||||||
syn match cErrInParen display contained "<%\|%>"
|
|
||||||
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,@cStringGroup,@Spell
|
|
||||||
else
|
|
||||||
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
|
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
|
|
||||||
syn match cParenError display "[\])]"
|
|
||||||
syn match cErrInParen display contained "[\]{}]\|<%\|%>"
|
|
||||||
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,@cStringGroup,@Spell
|
|
||||||
endif
|
|
||||||
" cCppBracket: same as cParen but ends at end-of-line; used in cDefine
|
|
||||||
syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
|
|
||||||
syn match cErrInBracket display contained "[);{}]\|<%\|%>"
|
|
||||||
endif
|
|
||||||
|
|
||||||
if s:ft ==# 'c' || exists("cpp_no_cpp11")
|
|
||||||
syn region cBadBlock keepend start="{" end="}" contained containedin=cParen,cBracket,cBadBlock transparent fold
|
|
||||||
endif
|
|
||||||
|
|
||||||
"integer number, or floating point number without a dot and with "f".
|
|
||||||
syn case ignore
|
|
||||||
syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal
|
|
||||||
" Same, but without octal error (for comments)
|
|
||||||
syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctal
|
|
||||||
syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
|
|
||||||
"hex number
|
|
||||||
syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
|
|
||||||
" Flag the first zero of an octal number as something special
|
|
||||||
syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
|
|
||||||
syn match cOctalZero display contained "\<0"
|
|
||||||
syn match cFloat display contained "\d\+f"
|
|
||||||
"floating point number, with dot, optional exponent
|
|
||||||
syn match cFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
|
|
||||||
"floating point number, starting with a dot, optional exponent
|
|
||||||
syn match cFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
|
|
||||||
"floating point number, without dot, with exponent
|
|
||||||
syn match cFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
|
|
||||||
if !exists("c_no_c99")
|
|
||||||
"hexadecimal floating point number, optional leading digits, with dot, with exponent
|
|
||||||
syn match cFloat display contained "0x\x*\.\x\+p[-+]\=\d\+[fl]\=\>"
|
|
||||||
"hexadecimal floating point number, with leading digits, optional dot, with exponent
|
|
||||||
syn match cFloat display contained "0x\x\+\.\=p[-+]\=\d\+[fl]\=\>"
|
|
||||||
endif
|
|
||||||
|
|
||||||
" flag an octal number with wrong digits
|
|
||||||
syn match cOctalError display contained "0\o*[89]\d*"
|
|
||||||
syn case match
|
|
||||||
|
|
||||||
if exists("c_comment_strings")
|
|
||||||
" A comment can contain cString, cCharacter and cNumber.
|
|
||||||
" But a "*/" inside a cString in a cComment DOES end the comment! So we
|
|
||||||
" need to use a special type of cString: cCommentString, which also ends on
|
|
||||||
" "*/", and sees a "*" at the start of the line as comment again.
|
|
||||||
" Unfortunately this doesn't very well work for // type of comments :-(
|
|
||||||
syn match cCommentSkip contained "^\s*\*\($\|\s\+\)"
|
|
||||||
syn region cCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=cSpecial,cCommentSkip
|
|
||||||
syn region cComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=cSpecial
|
|
||||||
syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cComment2String,cCharacter,cNumbersCom,cSpaceError,@Spell
|
|
||||||
if exists("c_no_comment_fold")
|
|
||||||
" Use "extend" here to have preprocessor lines not terminate halfway a
|
|
||||||
" comment.
|
|
||||||
syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell extend
|
|
||||||
else
|
|
||||||
syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell fold extend
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cSpaceError,@Spell
|
|
||||||
if exists("c_no_comment_fold")
|
|
||||||
syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell extend
|
|
||||||
else
|
|
||||||
syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell fold extend
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
" keep a // comment separately, it terminates a preproc. conditional
|
|
||||||
syn match cCommentError display "\*/"
|
|
||||||
syn match cCommentStartError display "/\*"me=e-1 contained
|
|
||||||
|
|
||||||
syn keyword cOperator sizeof
|
|
||||||
if exists("c_gnu")
|
|
||||||
syn keyword cStatement __asm__
|
|
||||||
syn keyword cOperator typeof __real__ __imag__
|
|
||||||
endif
|
|
||||||
syn keyword cType int long short char void
|
|
||||||
syn keyword cType signed unsigned float double
|
|
||||||
if !exists("c_no_ansi") || exists("c_ansi_typedefs")
|
|
||||||
syn keyword cType size_t ssize_t off_t wchar_t ptrdiff_t sig_atomic_t fpos_t
|
|
||||||
syn keyword cType clock_t time_t va_list jmp_buf FILE DIR div_t ldiv_t
|
|
||||||
syn keyword cType mbstate_t wctrans_t wint_t wctype_t
|
|
||||||
endif
|
|
||||||
if !exists("c_no_c99") " ISO C99
|
|
||||||
syn keyword cType _Bool bool _Complex complex _Imaginary imaginary
|
|
||||||
syn keyword cType int8_t int16_t int32_t int64_t
|
|
||||||
syn keyword cType uint8_t uint16_t uint32_t uint64_t
|
|
||||||
if !exists("c_no_bsd")
|
|
||||||
" These are BSD specific.
|
|
||||||
syn keyword cType u_int8_t u_int16_t u_int32_t u_int64_t
|
|
||||||
endif
|
|
||||||
syn keyword cType int_least8_t int_least16_t int_least32_t int_least64_t
|
|
||||||
syn keyword cType uint_least8_t uint_least16_t uint_least32_t uint_least64_t
|
|
||||||
syn keyword cType int_fast8_t int_fast16_t int_fast32_t int_fast64_t
|
|
||||||
syn keyword cType uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t
|
|
||||||
syn keyword cType intptr_t uintptr_t
|
|
||||||
syn keyword cType intmax_t uintmax_t
|
|
||||||
endif
|
|
||||||
if exists("c_gnu")
|
|
||||||
syn keyword cType __label__ __complex__ __volatile__
|
|
||||||
endif
|
|
||||||
|
|
||||||
syn keyword cStructure struct union enum typedef
|
|
||||||
syn keyword cStorageClass static register auto volatile extern const
|
|
||||||
if exists("c_gnu")
|
|
||||||
syn keyword cStorageClass inline __attribute__
|
|
||||||
endif
|
|
||||||
if !exists("c_no_c99") && s:ft !=# 'cpp'
|
|
||||||
syn keyword cStorageClass inline restrict
|
|
||||||
endif
|
|
||||||
if !exists("c_no_c11")
|
|
||||||
syn keyword cStorageClass _Alignas alignas
|
|
||||||
syn keyword cOperator _Alignof alignof
|
|
||||||
syn keyword cStorageClass _Atomic
|
|
||||||
syn keyword cOperator _Generic
|
|
||||||
syn keyword cStorageClass _Noreturn noreturn
|
|
||||||
syn keyword cOperator _Static_assert static_assert
|
|
||||||
syn keyword cStorageClass _Thread_local thread_local
|
|
||||||
syn keyword cType char16_t char32_t
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
|
|
||||||
if exists("c_gnu")
|
|
||||||
syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__ __func__
|
|
||||||
endif
|
|
||||||
syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__
|
|
||||||
syn keyword cConstant __STDC_VERSION__
|
|
||||||
syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX
|
|
||||||
syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX
|
|
||||||
syn keyword cConstant CHAR_MIN INT_MIN LONG_MIN SHRT_MIN
|
|
||||||
syn keyword cConstant CHAR_MAX INT_MAX LONG_MAX SHRT_MAX
|
|
||||||
syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN
|
|
||||||
syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX
|
|
||||||
if !exists("c_no_c99")
|
|
||||||
syn keyword cConstant __func__ __VA_ARGS__
|
|
||||||
syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX
|
|
||||||
syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN
|
|
||||||
syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX
|
|
||||||
syn keyword cConstant UINT8_MAX UINT16_MAX UINT32_MAX UINT64_MAX
|
|
||||||
syn keyword cConstant INT_LEAST8_MIN INT_LEAST16_MIN INT_LEAST32_MIN INT_LEAST64_MIN
|
|
||||||
syn keyword cConstant INT_LEAST8_MAX INT_LEAST16_MAX INT_LEAST32_MAX INT_LEAST64_MAX
|
|
||||||
syn keyword cConstant UINT_LEAST8_MAX UINT_LEAST16_MAX UINT_LEAST32_MAX UINT_LEAST64_MAX
|
|
||||||
syn keyword cConstant INT_FAST8_MIN INT_FAST16_MIN INT_FAST32_MIN INT_FAST64_MIN
|
|
||||||
syn keyword cConstant INT_FAST8_MAX INT_FAST16_MAX INT_FAST32_MAX INT_FAST64_MAX
|
|
||||||
syn keyword cConstant UINT_FAST8_MAX UINT_FAST16_MAX UINT_FAST32_MAX UINT_FAST64_MAX
|
|
||||||
syn keyword cConstant INTPTR_MIN INTPTR_MAX UINTPTR_MAX
|
|
||||||
syn keyword cConstant INTMAX_MIN INTMAX_MAX UINTMAX_MAX
|
|
||||||
syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX
|
|
||||||
syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX
|
|
||||||
endif
|
|
||||||
syn keyword cConstant FLT_RADIX FLT_ROUNDS
|
|
||||||
syn keyword cConstant FLT_DIG FLT_MANT_DIG FLT_EPSILON
|
|
||||||
syn keyword cConstant DBL_DIG DBL_MANT_DIG DBL_EPSILON
|
|
||||||
syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON
|
|
||||||
syn keyword cConstant FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP
|
|
||||||
syn keyword cConstant FLT_MIN_10_EXP FLT_MAX_10_EXP
|
|
||||||
syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP
|
|
||||||
syn keyword cConstant DBL_MIN_10_EXP DBL_MAX_10_EXP
|
|
||||||
syn keyword cConstant LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
|
|
||||||
syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP
|
|
||||||
syn keyword cConstant HUGE_VAL CLOCKS_PER_SEC NULL
|
|
||||||
syn keyword cConstant LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
|
|
||||||
syn keyword cConstant LC_NUMERIC LC_TIME
|
|
||||||
syn keyword cConstant SIG_DFL SIG_ERR SIG_IGN
|
|
||||||
syn keyword cConstant SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
|
|
||||||
" Add POSIX signals as well...
|
|
||||||
syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP
|
|
||||||
syn keyword cConstant SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV
|
|
||||||
syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU
|
|
||||||
syn keyword cConstant SIGUSR1 SIGUSR2
|
|
||||||
syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF
|
|
||||||
syn keyword cConstant FOPEN_MAX FILENAME_MAX L_tmpnam
|
|
||||||
syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
|
|
||||||
syn keyword cConstant TMP_MAX stderr stdin stdout
|
|
||||||
syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
|
|
||||||
" POSIX 2001
|
|
||||||
syn keyword cConstant SIGBUS SIGPOLL SIGPROF SIGSYS SIGURG
|
|
||||||
syn keyword cConstant SIGVTALRM SIGXCPU SIGXFSZ
|
|
||||||
" non-POSIX signals
|
|
||||||
syn keyword cConstant SIGWINCH SIGINFO
|
|
||||||
" Add POSIX errors as well
|
|
||||||
syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
|
|
||||||
syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
|
|
||||||
syn keyword cConstant EFBIG EILSEQ EINPROGRESS EINTR EINVAL EIO EISDIR
|
|
||||||
syn keyword cConstant EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENFILE ENODEV
|
|
||||||
syn keyword cConstant ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS
|
|
||||||
syn keyword cConstant ENOTDIR ENOTEMPTY ENOTSUP ENOTTY ENXIO EPERM
|
|
||||||
syn keyword cConstant EPIPE ERANGE EROFS ESPIPE ESRCH ETIMEDOUT EXDEV
|
|
||||||
" math.h
|
|
||||||
syn keyword cConstant M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI M_PI_2 M_PI_4
|
|
||||||
syn keyword cConstant M_1_PI M_2_PI M_2_SQRTPI M_SQRT2 M_SQRT1_2
|
|
||||||
endif
|
|
||||||
if !exists("c_no_c99") " ISO C99
|
|
||||||
syn keyword cConstant true false
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Accept %: for # (C99)
|
|
||||||
syn region cPreCondit start="^\s*\zs\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
|
|
||||||
syn match cPreConditMatch display "^\s*\zs\(%:\|#\)\s*\(else\|endif\)\>"
|
|
||||||
if !exists("c_no_if0")
|
|
||||||
syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip
|
|
||||||
syn region cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold
|
|
||||||
syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
|
|
||||||
if !exists("c_no_if0_fold")
|
|
||||||
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold
|
|
||||||
else
|
|
||||||
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
|
|
||||||
endif
|
|
||||||
syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
|
|
||||||
syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold
|
|
||||||
syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
|
|
||||||
if !exists("c_no_if0_fold")
|
|
||||||
syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
|
|
||||||
else
|
|
||||||
syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
|
|
||||||
endif
|
|
||||||
syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
|
|
||||||
syn region cCppOutSkip contained start="^\s*\zs\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
|
|
||||||
syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc
|
|
||||||
endif
|
|
||||||
syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
|
|
||||||
syn match cIncluded display contained "<[^>]*>"
|
|
||||||
syn match cInclude display "^\s*\zs\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
|
|
||||||
"syn match cLineSkip "\\$"
|
|
||||||
syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock
|
|
||||||
syn region cDefine start="^\s*\zs\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
|
|
||||||
syn region cPreProc start="^\s*\zs\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
|
|
||||||
|
|
||||||
" Highlight User Labels
|
|
||||||
syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
|
|
||||||
if s:ft ==# 'c' || exists("cpp_no_cpp11")
|
|
||||||
syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell,@cStringGroup
|
|
||||||
endif
|
|
||||||
" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
|
|
||||||
syn cluster cLabelGroup contains=cUserLabel
|
|
||||||
syn match cUserCont display "^\s*\zs\I\i*\s*:$" contains=@cLabelGroup
|
|
||||||
syn match cUserCont display ";\s*\zs\I\i*\s*:$" contains=@cLabelGroup
|
|
||||||
if s:ft ==# 'cpp'
|
|
||||||
syn match cUserCont display "^\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
|
||||||
syn match cUserCont display ";\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
|
||||||
else
|
|
||||||
syn match cUserCont display "^\s*\zs\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
|
||||||
syn match cUserCont display ";\s*\zs\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
|
||||||
endif
|
|
||||||
|
|
||||||
syn match cUserLabel display "\I\i*" contained
|
|
||||||
|
|
||||||
" Avoid recognizing most bitfields as labels
|
|
||||||
syn match cBitField display "^\s*\zs\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
|
|
||||||
syn match cBitField display ";\s*\zs\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
|
|
||||||
|
|
||||||
if exists("c_minlines")
|
|
||||||
let b:c_minlines = c_minlines
|
|
||||||
else
|
|
||||||
if !exists("c_no_if0")
|
|
||||||
let b:c_minlines = 50 " #if 0 constructs can be long
|
|
||||||
else
|
|
||||||
let b:c_minlines = 15 " mostly for () constructs
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
if exists("c_curly_error")
|
|
||||||
syn sync fromstart
|
|
||||||
else
|
|
||||||
exec "syn sync ccomment cComment minlines=" . b:c_minlines
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Define the default highlighting.
|
|
||||||
" Only used when an item doesn't have highlighting yet
|
|
||||||
hi def link cFormat cSpecial
|
|
||||||
hi def link cCppString cString
|
|
||||||
hi def link cCommentL cComment
|
|
||||||
hi def link cCommentStart cComment
|
|
||||||
hi def link cLabel Label
|
|
||||||
hi def link cUserLabel Label
|
|
||||||
hi def link cConditional Conditional
|
|
||||||
hi def link cRepeat Repeat
|
|
||||||
hi def link cCharacter Character
|
|
||||||
hi def link cSpecialCharacter cSpecial
|
|
||||||
hi def link cNumber Number
|
|
||||||
hi def link cOctal Number
|
|
||||||
hi def link cOctalZero PreProc " link this to Error if you want
|
|
||||||
hi def link cFloat Float
|
|
||||||
hi def link cOctalError cError
|
|
||||||
hi def link cParenError cError
|
|
||||||
hi def link cErrInParen cError
|
|
||||||
hi def link cErrInBracket cError
|
|
||||||
hi def link cCommentError cError
|
|
||||||
hi def link cCommentStartError cError
|
|
||||||
hi def link cSpaceError cError
|
|
||||||
hi def link cSpecialError cError
|
|
||||||
hi def link cCurlyError cError
|
|
||||||
hi def link cOperator Operator
|
|
||||||
hi def link cStructure Structure
|
|
||||||
hi def link cStorageClass StorageClass
|
|
||||||
hi def link cInclude Include
|
|
||||||
hi def link cPreProc PreProc
|
|
||||||
hi def link cDefine Macro
|
|
||||||
hi def link cIncluded cString
|
|
||||||
hi def link cError Error
|
|
||||||
hi def link cStatement Statement
|
|
||||||
hi def link cCppInWrapper cCppOutWrapper
|
|
||||||
hi def link cCppOutWrapper cPreCondit
|
|
||||||
hi def link cPreConditMatch cPreCondit
|
|
||||||
hi def link cPreCondit PreCondit
|
|
||||||
hi def link cType Type
|
|
||||||
hi def link cConstant Constant
|
|
||||||
hi def link cCommentString cString
|
|
||||||
hi def link cComment2String cString
|
|
||||||
hi def link cCommentSkip cComment
|
|
||||||
hi def link cString String
|
|
||||||
hi def link cComment Comment
|
|
||||||
hi def link cSpecial SpecialChar
|
|
||||||
hi def link cTodo Todo
|
|
||||||
hi def link cBadContinuation Error
|
|
||||||
hi def link cCppOutSkip cCppOutIf2
|
|
||||||
hi def link cCppInElse2 cCppOutIf2
|
|
||||||
hi def link cCppOutIf2 cCppOut
|
|
||||||
hi def link cCppOut Comment
|
|
||||||
|
|
||||||
let b:current_syntax = "c"
|
|
||||||
|
|
||||||
unlet s:ft
|
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
|
||||||
unlet s:cpo_save
|
|
||||||
" vim: ts=8
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
" Vim syntax file
|
|
||||||
" Language: C++
|
|
||||||
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
|
|
||||||
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
|
||||||
" Last Change: 2015 Nov 10
|
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Read the C syntax to start with
|
|
||||||
if version < 600
|
|
||||||
so <sfile>:p:h/c.vim
|
|
||||||
else
|
|
||||||
runtime! syntax/c.vim
|
|
||||||
unlet b:current_syntax
|
|
||||||
endif
|
|
||||||
|
|
||||||
" C++ extensions
|
|
||||||
syn keyword cppStatement new delete this friend using
|
|
||||||
syn keyword cppAccess public protected private
|
|
||||||
syn keyword cppModifier inline virtual explicit export
|
|
||||||
syn keyword cppType bool wchar_t
|
|
||||||
syn keyword cppExceptions throw try catch
|
|
||||||
syn keyword cppOperator operator typeid
|
|
||||||
syn keyword cppOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq
|
|
||||||
syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*<"me=e-1
|
|
||||||
syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
|
|
||||||
syn keyword cppStorageClass mutable
|
|
||||||
syn keyword cppStructure class typename template namespace
|
|
||||||
syn keyword cppBoolean true false
|
|
||||||
syn keyword cppConstant __cplusplus
|
|
||||||
|
|
||||||
" C++ 11 extensions
|
|
||||||
if !exists("cpp_no_cpp11")
|
|
||||||
syn keyword cppModifier override final
|
|
||||||
syn keyword cppType nullptr_t
|
|
||||||
syn keyword cppExceptions noexcept
|
|
||||||
syn keyword cppStorageClass constexpr decltype thread_local
|
|
||||||
syn keyword cppConstant nullptr
|
|
||||||
syn keyword cppConstant ATOMIC_FLAG_INIT ATOMIC_VAR_INIT
|
|
||||||
syn keyword cppConstant ATOMIC_BOOL_LOCK_FREE ATOMIC_CHAR_LOCK_FREE
|
|
||||||
syn keyword cppConstant ATOMIC_CHAR16_T_LOCK_FREE ATOMIC_CHAR32_T_LOCK_FREE
|
|
||||||
syn keyword cppConstant ATOMIC_WCHAR_T_LOCK_FREE ATOMIC_SHORT_LOCK_FREE
|
|
||||||
syn keyword cppConstant ATOMIC_INT_LOCK_FREE ATOMIC_LONG_LOCK_FREE
|
|
||||||
syn keyword cppConstant ATOMIC_LLONG_LOCK_FREE ATOMIC_POINTER_LOCK_FREE
|
|
||||||
syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
|
|
||||||
endif
|
|
||||||
|
|
||||||
" C++ 14 extensions
|
|
||||||
if !exists("cpp_no_cpp14")
|
|
||||||
syn match cppNumber display "\<0b[01]\+\(u\=l\{0,2}\|ll\=u\)\>"
|
|
||||||
endif
|
|
||||||
|
|
||||||
" The minimum and maximum operators in GNU C++
|
|
||||||
syn match cppMinMax "[<>]?"
|
|
||||||
|
|
||||||
" Default highlighting
|
|
||||||
if version >= 508 || !exists("did_cpp_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_cpp_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
HiLink cppAccess cppStatement
|
|
||||||
HiLink cppCast cppStatement
|
|
||||||
HiLink cppExceptions Exception
|
|
||||||
HiLink cppOperator Operator
|
|
||||||
HiLink cppStatement Statement
|
|
||||||
HiLink cppModifier Type
|
|
||||||
HiLink cppType Type
|
|
||||||
HiLink cppStorageClass StorageClass
|
|
||||||
HiLink cppStructure Structure
|
|
||||||
HiLink cppBoolean Boolean
|
|
||||||
HiLink cppConstant Constant
|
|
||||||
HiLink cppRawStringDelimiter Delimiter
|
|
||||||
HiLink cppRawString String
|
|
||||||
HiLink cppNumber Number
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
function! RawStringEnableCodeSnip(filetype,start,end,textSnipHl) abort
|
|
||||||
let ft=toupper(a:filetype)
|
|
||||||
let group='textGroup'.ft
|
|
||||||
if exists('b:current_syntax')
|
|
||||||
let s:current_syntax=b:current_syntax
|
|
||||||
" Remove current syntax definition, as some syntax files (e.g. cpp.vim)
|
|
||||||
" do nothing if b:current_syntax is defined.
|
|
||||||
unlet b:current_syntax
|
|
||||||
endif
|
|
||||||
execute 'syntax include @'.group.' syntax/'.a:filetype.'.vim'
|
|
||||||
try
|
|
||||||
execute 'syntax include @'.group.' after/syntax/'.a:filetype.'.vim'
|
|
||||||
catch
|
|
||||||
endtry
|
|
||||||
if exists('s:current_syntax')
|
|
||||||
let b:current_syntax=s:current_syntax
|
|
||||||
else
|
|
||||||
unlet b:current_syntax
|
|
||||||
endif
|
|
||||||
execute 'syntax region textSnip'.ft.'
|
|
||||||
\ matchgroup='.a:textSnipHl.'
|
|
||||||
\ start=+'.a:start.'+ end=+'.a:end.'+
|
|
||||||
\ contains=@'.group
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
call RawStringEnableCodeSnip("chaiscript", 'R"chaiscript(', ')chaiscript"', 'cppRawString')
|
|
||||||
call RawStringEnableCodeSnip("lua", 'R"lua(', ')lua"', 'cppRawString')
|
|
||||||
|
|
||||||
let b:current_syntax = "cpp"
|
|
||||||
|
|
||||||
" vim: ts=8
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
" quit when a syntax file was already loaded
|
|
||||||
if exists("b:current_syntax")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
" @todo \ at end of line should continue on next line
|
|
||||||
|
|
||||||
" Hello this is a test to see if it auto wraps the text when the text has been
|
|
||||||
" going on for way too long
|
|
||||||
|
|
||||||
" syn match langSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
|
|
||||||
" We only highlight valid escape characters as for now it just ignores unknown
|
|
||||||
" thing
|
|
||||||
syn match langSpecial display contained "\\[abfnrtv]"
|
|
||||||
syn match langError "^.\+"
|
|
||||||
syn keyword langTodo contained TODO FIXME XXX NOTE
|
|
||||||
syn match langTodo contained "@todo"
|
|
||||||
syn match langTodo contained "@note"
|
|
||||||
syn region langSection start="^\s*\[" end="\]"
|
|
||||||
syn match langKey "^.\{-}\ze="
|
|
||||||
syn match langValue "[#=]\zs.*$" contains=langSub,langSpecial,langValue
|
|
||||||
syn match langValue contained "\\\n.\+" contains=langValue
|
|
||||||
" syn match langSub "{[^}]\+}" " This is for fmt support
|
|
||||||
syn match langSub "{\d\+}"
|
|
||||||
syn match langComment "[#;].*$" contains=langTodo
|
|
||||||
|
|
||||||
hi def link langTodo Todo
|
|
||||||
hi def link langSpecial Special
|
|
||||||
hi def link langSection Type
|
|
||||||
hi def link langKey Identifier
|
|
||||||
hi def link langValue String
|
|
||||||
hi def link langValue2 String
|
|
||||||
hi def link langSub Constant
|
|
||||||
hi def link langComment Comment
|
|
||||||
hi def link langError Error
|
|
||||||
|
|
||||||
|
|
||||||
let b:current_syntax = "lang"
|
|
||||||
|
|
||||||
" vim: sts=2 sw=2 et
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
tags
|
||||||
|
test.sh
|
||||||
|
.luarc.json
|
||||||
|
nvim
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
The MIT License (MIT)
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2014 Markus Færevaag
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -18,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
# kickstart.nvim
|
||||||
|
|
||||||
|
### Introduction
|
||||||
|
|
||||||
|
A starting point for Neovim that is:
|
||||||
|
|
||||||
|
* Small
|
||||||
|
* Single-file (with examples of moving to multi-file)
|
||||||
|
* Documented
|
||||||
|
* Modular
|
||||||
|
|
||||||
|
This repo is meant to be used as by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss.
|
||||||
|
|
||||||
|
Distribution Alternatives:
|
||||||
|
- [LazyVim](https://www.lazyvim.org/): A delightful distribution maintained by @folke (the author of lazy.nvim, the package manager used here)
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
Kickstart.nvim targets *only* the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. If you are experiencing issues, please make sure you have the latest versions.
|
||||||
|
|
||||||
|
* Backup your previous configuration
|
||||||
|
* (Recommended) Fork this repo (so that you have your own copy that you can modify).
|
||||||
|
* Clone the kickstart repo into `$HOME/.config/nvim/` (Linux/Mac) or `~/AppData/Local/nvim/` (Windows)
|
||||||
|
* If you don't want to include it as a git repo, you can just clone it and then move the files to this location
|
||||||
|
* Start Neovim (`nvim`) and allow `lazy.nvim` to complete installation.
|
||||||
|
* Restart Neovim
|
||||||
|
* **You're ready to go!**
|
||||||
|
|
||||||
|
Additional system requirements:
|
||||||
|
- Make sure to review the readmes of the plugins if you are experiencing errors. In particular:
|
||||||
|
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers.
|
||||||
|
- See as well [Windows Installation](#Windows-Installation)
|
||||||
|
|
||||||
|
### Configuration And Extension
|
||||||
|
|
||||||
|
* Inside of your fork, feel free to modify any file you like! It's your fork!
|
||||||
|
* Then there are two primary configuration options available:
|
||||||
|
* Include the `lua/kickstart/plugins/*` files in your configuration.
|
||||||
|
* Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim`
|
||||||
|
* NOTE: To enable this, you need to uncomment `{ import = 'custom.plugins' }` in your `init.lua`
|
||||||
|
|
||||||
|
You can also merge updates/changes from the repo back into your fork, to keep up-to-date with any changes for the default configuration
|
||||||
|
|
||||||
|
#### Example: Adding an autopairs plugin
|
||||||
|
|
||||||
|
In the file: `lua/custom/plugins/autopairs.lua`, add:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
-- File: lua/custom/plugins/autopairs.lua
|
||||||
|
|
||||||
|
return {
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
config = function()
|
||||||
|
require("nvim-autopairs").setup {}
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
This will automatically install `nvim-autopairs` and enable it on startup. For more information, see documentation for [lazy.nvim](https://github.com/folke/lazy.nvim).
|
||||||
|
|
||||||
|
#### Example: Adding a file tree plugin
|
||||||
|
|
||||||
|
In the file: `lua/custom/plugins/filetree.lua`, add:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
-- Unless you are still migrating, remove the deprecated commands from v1.x
|
||||||
|
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
|
||||||
|
|
||||||
|
return {
|
||||||
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
|
version = "*",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
},
|
||||||
|
config = function ()
|
||||||
|
require('neo-tree').setup {}
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This will install the tree plugin and add the command `:NeoTree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information.
|
||||||
|
|
||||||
|
#### Example: Adding a file to change default options
|
||||||
|
|
||||||
|
To change default options, you can add a file in the `/after/plugin/` folder (see `:help load-plugins`) to include your own options, keymaps, autogroups, and more. The following is an example `defaults.lua` file (located at `$HOME/.config/nvim/after/plugin/defaults.lua`).
|
||||||
|
|
||||||
|
```lua
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' })
|
||||||
|
```
|
||||||
|
|
||||||
|
### Contribution
|
||||||
|
|
||||||
|
Pull-requests are welcome. The goal of this repo is not to create a Neovim configuration framework, but to offer a starting template that shows, by example, available features in Neovim. Some things that will not be included:
|
||||||
|
|
||||||
|
* Custom language server configuration (null-ls templates)
|
||||||
|
* Theming beyond a default colorscheme necessary for LSP highlight groups
|
||||||
|
|
||||||
|
Each PR, especially those which increase the line count, should have a description as to why the PR is necessary.
|
||||||
|
|
||||||
|
### FAQ
|
||||||
|
|
||||||
|
* What should I do if I already have a pre-existing neovim configuration?
|
||||||
|
* You should back it up, then delete all files associated with it.
|
||||||
|
* This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/`
|
||||||
|
* You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide)
|
||||||
|
* What if I want to "uninstall" this configuration:
|
||||||
|
* See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information
|
||||||
|
* Are there any cool videos about this plugin?
|
||||||
|
* Current iteration of kickstart (coming soon)
|
||||||
|
* Here is one about the previous iteration of kickstart: [video introduction to Kickstart.nvim](https://youtu.be/stqUbv-5u2s).
|
||||||
|
|
||||||
|
### Windows Installation
|
||||||
|
|
||||||
|
Installation may require installing build tools, and updating the run command for `telescope-fzf-native`
|
||||||
|
|
||||||
|
See `telescope-fzf-native` documention for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation)
|
||||||
|
|
||||||
|
This requires:
|
||||||
|
|
||||||
|
- Install CMake, and the Microsoft C++ Build Tools on Windows
|
||||||
|
|
||||||
|
```lua
|
||||||
|
{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
-- Install lazy package manager
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
-- Setup
|
||||||
|
require("keymaps")
|
||||||
|
require("options")
|
||||||
|
require("autocmds")
|
||||||
|
require("lsp")
|
||||||
|
|
||||||
|
-- Configure plugins
|
||||||
|
require("lazy").setup({
|
||||||
|
{ import = "themes" },
|
||||||
|
{ import = "plugins" },
|
||||||
|
}, {
|
||||||
|
install = {
|
||||||
|
colorscheme = {
|
||||||
|
"gruvbox",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
change_detection = {
|
||||||
|
notify = false,
|
||||||
|
},
|
||||||
|
rocks = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
ui = {
|
||||||
|
border = require("symbols.window").border,
|
||||||
|
backdrop = 100,
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
{
|
||||||
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
|
"actions-preview.nvim": { "branch": "master", "commit": "2b604b2e8e662c03b716436f6ffebcb19663e66a" },
|
||||||
|
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
|
||||||
|
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||||
|
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
|
||||||
|
"conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" },
|
||||||
|
"crates.nvim": { "branch": "main", "commit": "afcd1cc3eeceb5783676fc8464389b9216a29d05" },
|
||||||
|
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||||
|
"eyeliner.nvim": { "branch": "main", "commit": "8f197eb30cecdf4c2cc9988a5eecc6bc34c0c7d6" },
|
||||||
|
"fidget.nvim": { "branch": "main", "commit": "889e2e96edef4e144965571d46f7a77bcc4d0ddf" },
|
||||||
|
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
||||||
|
"gitlab.nvim": { "branch": "develop", "commit": "0f007fcf7934426338fcb5f2f17a8d6e9f3bc514" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "8d82c240f190fc33723d48c308ccc1ed8baad69d" },
|
||||||
|
"gruvbox.nvim": { "branch": "main", "commit": "334d5fd49fc8033f26408425366c66c6390c57bb" },
|
||||||
|
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
|
||||||
|
"inc-rename.nvim": { "branch": "main", "commit": "0074b551a17338ccdcd299bd86687cc651bcb33d" },
|
||||||
|
"kubernetes.nvim": { "branch": "main", "commit": "44daf998345628a1a7034e3aaa31f4e05e4dde7c" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
|
"lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "f5d2a8570f8b736ddb9bb4be504355bcd6e15ec8" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "0a3b42c3e503df87aef6d6513e13148381495c3a" },
|
||||||
|
"mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "b03fb0f20bc1d43daf558cda981a2be22e73ac42" },
|
||||||
|
"multicolumn.nvim": { "branch": "master", "commit": "a363bdfd422abf26256f343dac4df183031f8e94" },
|
||||||
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "84c75e7a7e443586f60508d12fc50f90d9aee14e" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
|
"nvim-colorizer.lua": { "branch": "master", "commit": "5cfe7fffbd01e17b3c1e14af85d5febdef88bd8c" },
|
||||||
|
"nvim-dap": { "branch": "master", "commit": "b0f983507e3702f073bfe1516846e58b56d4e42f" },
|
||||||
|
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "cb5bc0b2b35a6d513e3298d285db81453e791f4f" },
|
||||||
|
"nvim-surround": { "branch": "main", "commit": "9291040de8cd8a4439eb64c441e8d5d2bf884a5a" },
|
||||||
|
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
||||||
|
"nvim-treesitter-textobjects": { "branch": "main", "commit": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e" },
|
||||||
|
"nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" },
|
||||||
|
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||||
|
"ros-nvim": { "branch": "main", "commit": "1ad64cd3a1e144dfea67890845f9da2e82d96900" },
|
||||||
|
"schema-companion.nvim": { "branch": "main", "commit": "bcccfe46a1796f86b81dc3be6ab80ece3664d3b2" },
|
||||||
|
"schemastore.nvim": { "branch": "main", "commit": "f5df9e70403b5d4c0642702a64534f04f3d71d03" },
|
||||||
|
"scrollEOF.nvim": { "branch": "master", "commit": "e462b9a07b8166c3e8011f1dcbc6bf68b67cd8d7" },
|
||||||
|
"smart-open.nvim": { "branch": "0.3.x", "commit": "918c97cac0c33f7a116a822df144bc5bbefa4490" },
|
||||||
|
"smart-splits.nvim": { "branch": "master", "commit": "09796a7ad0776c92518e0afae8688ef8d7f720e6" },
|
||||||
|
"snacks.nvim": { "branch": "main", "commit": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e" },
|
||||||
|
"sqlite.lua": { "branch": "master", "commit": "50092d60feb242602d7578398c6eb53b4a8ffe7b" },
|
||||||
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||||
|
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "f7c673b8e46e8f233ff581d3624a517d33a7e264" },
|
||||||
|
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||||
|
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||||
|
"ultimate-autopair.nvim": { "branch": "v0.6", "commit": "6b58234de921437836efe27714b2026ed2ee235a" },
|
||||||
|
"undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" },
|
||||||
|
"which-key.nvim": { "branch": "winborder-support", "commit": "ab1a3b0d3005a95507ba6c18b96531d430370885" }
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
local function uv_script_interpreter(script_path)
|
||||||
|
local result = vim.system({ "uv", "python", "find", "--script", script_path }, { text = true }):wait()
|
||||||
|
if result.code == 0 then
|
||||||
|
return vim.fn.trim(result.stdout)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function uv_interpreter()
|
||||||
|
local result = vim.system({ "uv", "python", "find" }, { text = true }):wait()
|
||||||
|
if result.code == 0 then
|
||||||
|
return vim.fn.trim(result.stdout)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
basedpyright = {
|
||||||
|
analysis = {
|
||||||
|
typeCheckingMode = "standard",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
python = {},
|
||||||
|
},
|
||||||
|
before_init = function(_, config)
|
||||||
|
local script = vim.api.nvim_buf_get_name(0)
|
||||||
|
local python = uv_script_interpreter(script)
|
||||||
|
if not python then
|
||||||
|
python = uv_interpreter()
|
||||||
|
end
|
||||||
|
config.settings.python.pythonPath = python
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
cmd = { "clangd", "--offset-encoding=utf-16", "--clang-tidy" },
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
return require("schema-companion").setup_client(
|
||||||
|
require("schema-companion").adapters.jsonls.setup({
|
||||||
|
sources = {
|
||||||
|
require("schema-companion").sources.lsp.setup(),
|
||||||
|
require("schema-companion").sources.none.setup(),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
settings = {
|
||||||
|
json = {
|
||||||
|
validate = { enable = true },
|
||||||
|
schemas = require("schemastore").json.schemas(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
library = {
|
||||||
|
"./definitions",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
telemetry = { enable = false },
|
||||||
|
type = {
|
||||||
|
checkTableShape = true,
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
neededFileStatus = {
|
||||||
|
-- ["no-unknown"] = "Opened",
|
||||||
|
-- ["incomplete-signature-doc"] = "Opened",
|
||||||
|
-- ["await-in-sync"] = "Opened",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
check = {
|
||||||
|
command = "clippy",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
return require("schema-companion").setup_client(
|
||||||
|
require("schema-companion").adapters.taplo.setup({
|
||||||
|
sources = {
|
||||||
|
require("schema-companion").sources.lsp.setup(),
|
||||||
|
require("schema-companion").sources.none.setup(),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
{}
|
||||||
|
)
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
init_options = {
|
||||||
|
diagnosticSeverity = "Hint",
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
return require("schema-companion").setup_client(
|
||||||
|
require("schema-companion").adapters.yamlls.setup({
|
||||||
|
sources = {
|
||||||
|
require("matchers.kubernetes").setup({}),
|
||||||
|
require("schema-companion").sources.lsp.setup(),
|
||||||
|
require("schema-companion").sources.none.setup(),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
{}
|
||||||
|
)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
-- Highlight on yank
|
||||||
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
|
callback = function()
|
||||||
|
vim.highlight.on_yank({ higroup = "YankHighlight" })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- show cursor line only in active window
|
||||||
|
vim.api.nvim_create_autocmd({ "InsertLeave", "WinEnter" }, {
|
||||||
|
callback = function()
|
||||||
|
local ok, cl = pcall(vim.api.nvim_win_get_var, 0, "auto-cursorline")
|
||||||
|
if ok and cl then
|
||||||
|
vim.wo.cursorline = true
|
||||||
|
vim.api.nvim_win_del_var(0, "auto-cursorline")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, {
|
||||||
|
callback = function()
|
||||||
|
local cl = vim.wo.cursorline
|
||||||
|
if cl then
|
||||||
|
vim.api.nvim_win_set_var(0, "auto-cursorline", cl)
|
||||||
|
vim.wo.cursorline = false
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { noremap = true, silent = true })
|
||||||
|
|
||||||
|
-- Remap for dealing with word wrap
|
||||||
|
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||||
|
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||||
|
|
||||||
|
-- Some nice adjustments
|
||||||
|
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||||
|
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||||
|
vim.keymap.set("n", "n", "nzz")
|
||||||
|
vim.keymap.set("n", "N", "Nzz")
|
||||||
|
|
||||||
|
-- Clear search highlight by pressing esc
|
||||||
|
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = { "rust" },
|
||||||
|
callback = function(args)
|
||||||
|
local command = {
|
||||||
|
rust = "cargo run",
|
||||||
|
}
|
||||||
|
vim.keymap.set("n", "<F5>", function()
|
||||||
|
vim.system({ "tmux", "send-keys", "-t", ":shell", "c-u", command[args.match], "Enter" })
|
||||||
|
vim.system({ "tmux", "select-window", "-t", ":shell" })
|
||||||
|
end, { buffer = true })
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
local diagnostic = require("symbols.diagnostic")
|
||||||
|
local methods = vim.lsp.protocol.Methods
|
||||||
|
|
||||||
|
local map = function(keys, func, desc, mode, bufnr)
|
||||||
|
mode = mode or "n"
|
||||||
|
vim.keymap.set(mode, keys, func, { desc = desc, buffer = bufnr })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- General keymaps
|
||||||
|
map("[d", function()
|
||||||
|
vim.diagnostic.jump({ count = -1 })
|
||||||
|
end, "Go to previous diagnostic message")
|
||||||
|
map("]d", function()
|
||||||
|
vim.diagnostic.jump({ count = 1 })
|
||||||
|
end, "Go to next diagnostic message")
|
||||||
|
|
||||||
|
map("[e", function()
|
||||||
|
vim.diagnostic.jump({ count = -1, severity = vim.diagnostic.severity.ERROR })
|
||||||
|
end, "Go to previous error message")
|
||||||
|
map("]e", function()
|
||||||
|
vim.diagnostic.jump({ count = 1, severity = vim.diagnostic.severity.ERROR })
|
||||||
|
end, "Go to next error message")
|
||||||
|
|
||||||
|
map("<leader>e", vim.diagnostic.open_float, "Open floating diagnostic message")
|
||||||
|
|
||||||
|
map("<leader>th", function()
|
||||||
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
||||||
|
end, "Toggle inlay hints")
|
||||||
|
|
||||||
|
map("gra", function()
|
||||||
|
require("actions-preview").code_actions()
|
||||||
|
end, "Code actions", { "n", "x" })
|
||||||
|
map("grD", vim.lsp.buf.declaration, "Goto declaration")
|
||||||
|
map("grd", function()
|
||||||
|
require("telescope.builtin").lsp_definitions({ jump_type = "never" })
|
||||||
|
end, "Goto definition")
|
||||||
|
|
||||||
|
map("grt", function()
|
||||||
|
require("telescope.builtin").lsp_type_definitions()
|
||||||
|
end, "Type definition")
|
||||||
|
map("grr", function()
|
||||||
|
require("telescope.builtin").lsp_references()
|
||||||
|
end, "Goto references")
|
||||||
|
map("gri", function()
|
||||||
|
require("telescope.builtin").lsp_implementations()
|
||||||
|
end, "Goto implementation")
|
||||||
|
|
||||||
|
map("<leader>ss", function()
|
||||||
|
require("telescope.builtin").lsp_document_symbols()
|
||||||
|
end, "Document symbols")
|
||||||
|
map("<leader>sS", function()
|
||||||
|
require("telescope.builtin").lsp_dynamic_workspace_symbols()
|
||||||
|
end, "Workspace symbols")
|
||||||
|
|
||||||
|
-- Provide a placeholder rename keymap, otherwise the rename appears to works until you hit enter at which point it will fail
|
||||||
|
map("grn", function()
|
||||||
|
vim.api.nvim_echo({ { "Rename are not available in current buffer" } }, true, { err = true })
|
||||||
|
end, "Rename")
|
||||||
|
|
||||||
|
---@param client vim.lsp.Client
|
||||||
|
---@param bufnr integer
|
||||||
|
local function on_attach(client, bufnr)
|
||||||
|
-- Setup actual rename keymap if it is available
|
||||||
|
if client:supports_method(methods.textDocument_rename, bufnr) then
|
||||||
|
vim.keymap.set("n", "grn", function()
|
||||||
|
return ":IncRename " .. vim.fn.expand("<cword>")
|
||||||
|
end, { buffer = bufnr, expr = true, desc = "Rename" })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Disable lsp based syntax highlighting, I don't like it
|
||||||
|
-- TODO: Switch to this once it is available
|
||||||
|
-- vim.lsp.document_color.enable(false, bufnr)
|
||||||
|
if client.server_capabilities.semanticTokensProvider then
|
||||||
|
client.server_capabilities.semanticTokensProvider = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Highlight references under cursor
|
||||||
|
-- if client:supports_method(methods.textDocument_documentHighlight) then
|
||||||
|
-- local lsp_hover_hl = vim.api.nvim_create_augroup("LspHoverHighlight", { clear = false })
|
||||||
|
-- vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||||
|
-- buffer = bufnr,
|
||||||
|
-- group = lsp_hover_hl,
|
||||||
|
-- callback = vim.lsp.buf.document_highlight,
|
||||||
|
-- })
|
||||||
|
--
|
||||||
|
-- vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||||
|
-- buffer = bufnr,
|
||||||
|
-- group = lsp_hover_hl,
|
||||||
|
-- callback = vim.lsp.buf.clear_references,
|
||||||
|
-- })
|
||||||
|
-- end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
severity_sort = true,
|
||||||
|
signs = {
|
||||||
|
numhl = {
|
||||||
|
[vim.diagnostic.severity.ERROR] = "DiagnosticNumError",
|
||||||
|
[vim.diagnostic.severity.WARN] = "DiagnosticNumWarn",
|
||||||
|
[vim.diagnostic.severity.HINT] = "DiagnosticNumHint",
|
||||||
|
[vim.diagnostic.severity.INFO] = "DiagnosticNumInfo",
|
||||||
|
},
|
||||||
|
text = {
|
||||||
|
[vim.diagnostic.severity.ERROR] = "",
|
||||||
|
[vim.diagnostic.severity.WARN] = "",
|
||||||
|
[vim.diagnostic.severity.HINT] = "",
|
||||||
|
[vim.diagnostic.severity.INFO] = "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
float = {
|
||||||
|
severity_sort = false,
|
||||||
|
header = "",
|
||||||
|
suffix = function(d)
|
||||||
|
local code = d.code and string.format(" (%s)", d.code) or ""
|
||||||
|
|
||||||
|
return string.format("%s [%s]", code, d.source), "NormalFloat"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
virtual_text = {
|
||||||
|
prefix = function(d)
|
||||||
|
return diagnostic[d.severity]
|
||||||
|
end,
|
||||||
|
virt_text_pos = "eol_right_align",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local register_capability = vim.lsp.handlers[methods.client_registerCapability]
|
||||||
|
vim.lsp.handlers[methods.client_registerCapability] = function(err, res, ctx)
|
||||||
|
local client = vim.lsp.get_client_by_id(ctx.client_id)
|
||||||
|
if not client then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
on_attach(client, vim.api.nvim_get_current_buf())
|
||||||
|
|
||||||
|
return register_capability(err, res, ctx)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
desc = "Configure LSP keymaps",
|
||||||
|
callback = function(args)
|
||||||
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||||
|
if not client then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
on_attach(client, args.buf)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Manually enable lsps, if installed
|
||||||
|
if vim.fn.executable("rust_analyzer") then
|
||||||
|
vim.lsp.enable("rust_analyzer")
|
||||||
|
end
|
||||||
|
if vim.fn.executable("vtsls") then
|
||||||
|
vim.lsp.enable("vtsls")
|
||||||
|
end
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
---@class schema_companion.Source
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.name = "Kubernetes"
|
||||||
|
|
||||||
|
M.config = {}
|
||||||
|
|
||||||
|
---@param config {}
|
||||||
|
---@return schema_companion.Source
|
||||||
|
function M.setup(config)
|
||||||
|
setmetatable(M, {})
|
||||||
|
M.config = vim.tbl_deep_extend("force", {}, M.config, config)
|
||||||
|
|
||||||
|
return M
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:match(_, bufnr)
|
||||||
|
local resources = {}
|
||||||
|
|
||||||
|
local current = {}
|
||||||
|
for _, line in pairs(vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)) do
|
||||||
|
local _, _, group, version = line:find([[^apiVersion:%s*["']?([^%s"'/]*)/?([^%s"']*)]])
|
||||||
|
local _, _, kind = line:find([[^kind:%s*["']?([^%s"'/]*)]])
|
||||||
|
|
||||||
|
if group and group ~= "" then
|
||||||
|
current.group = group
|
||||||
|
end
|
||||||
|
if version and version ~= "" then
|
||||||
|
current.version = version
|
||||||
|
end
|
||||||
|
if kind and kind ~= "" then
|
||||||
|
current.kind = kind
|
||||||
|
end
|
||||||
|
|
||||||
|
if current.group and current.kind then
|
||||||
|
table.insert(resources, current)
|
||||||
|
current = {}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local schemas = {}
|
||||||
|
for _, resource in pairs(resources) do
|
||||||
|
local api = resource.version and ("%s/%s"):format(resource.group, resource.version) or resource.group
|
||||||
|
local schema = {
|
||||||
|
name = ("%s@%s"):format(resource.kind, api),
|
||||||
|
source = M.name,
|
||||||
|
uri = require("kubernetes").yamlls_schema(),
|
||||||
|
}
|
||||||
|
if schema then
|
||||||
|
table.insert(schemas, schema)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return schemas
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
local window = require("symbols.window")
|
||||||
|
|
||||||
|
-- Set highlight on search
|
||||||
|
vim.o.hlsearch = true
|
||||||
|
|
||||||
|
-- Make line numbers default
|
||||||
|
vim.wo.number = true
|
||||||
|
vim.wo.relativenumber = true
|
||||||
|
|
||||||
|
-- Enable mouse mode
|
||||||
|
vim.o.mouse = "a"
|
||||||
|
|
||||||
|
-- Sync clipboard between OS and Neovim.
|
||||||
|
-- Remove this option if you want your OS clipboard to remain independent.
|
||||||
|
-- See `:help 'clipboard'`
|
||||||
|
vim.o.clipboard = "unnamedplus"
|
||||||
|
|
||||||
|
-- Enable break indent
|
||||||
|
vim.o.breakindent = true
|
||||||
|
|
||||||
|
-- Save undo history
|
||||||
|
vim.o.undofile = true
|
||||||
|
|
||||||
|
-- Case insensitive searching UNLESS /C or capital in search
|
||||||
|
vim.o.ignorecase = true
|
||||||
|
vim.o.smartcase = true
|
||||||
|
|
||||||
|
-- Keep signcolumn on by default
|
||||||
|
vim.wo.signcolumn = "yes"
|
||||||
|
|
||||||
|
-- Decrease update time
|
||||||
|
vim.o.updatetime = 250
|
||||||
|
vim.o.timeout = true
|
||||||
|
vim.o.timeoutlen = 300
|
||||||
|
|
||||||
|
-- Set completeopt to have a better completion experience
|
||||||
|
-- vim.o.completeopt = "menuone,noselect"
|
||||||
|
|
||||||
|
-- NOTE: You should make sure your terminal supports this
|
||||||
|
vim.o.termguicolors = true
|
||||||
|
|
||||||
|
-- Default tab settings
|
||||||
|
-- Tab settings are automatically detected by vim-sleuth
|
||||||
|
-- Can be overridden by .editorconfig and modeline
|
||||||
|
vim.o.tabstop = 4
|
||||||
|
vim.o.softtabstop = 4
|
||||||
|
vim.o.shiftwidth = 4
|
||||||
|
vim.o.expandtab = false
|
||||||
|
vim.o.smarttab = true
|
||||||
|
|
||||||
|
-- Ask for confirmation instead of failing
|
||||||
|
vim.o.confirm = true
|
||||||
|
|
||||||
|
-- Turn on cursorline
|
||||||
|
vim.o.cursorline = true
|
||||||
|
|
||||||
|
-- Don't show mode, powerline already shows it
|
||||||
|
vim.o.showmode = false
|
||||||
|
|
||||||
|
-- Minimum number of screen lines above and below the cursor
|
||||||
|
vim.o.scrolloff = 10
|
||||||
|
|
||||||
|
-- Highlight tabs and trailing whitespace
|
||||||
|
vim.o.listchars = "trail:~,tab:¦⁃,nbsp:␣"
|
||||||
|
vim.o.list = true
|
||||||
|
|
||||||
|
-- Fold settings
|
||||||
|
vim.o.foldlevelstart = 99
|
||||||
|
|
||||||
|
-- Windows borders
|
||||||
|
vim.o.winborder = window.border
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
-- https://github.com/aznhe21/actions-preview.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
"aznhe21/actions-preview.nvim",
|
||||||
|
opts = function()
|
||||||
|
local hl = require("actions-preview.highlight")
|
||||||
|
return {
|
||||||
|
backend = { "telescope" },
|
||||||
|
highlight_command = {
|
||||||
|
hl.delta(),
|
||||||
|
},
|
||||||
|
telescope = {
|
||||||
|
sorting_strategy = "ascending",
|
||||||
|
layout_strategy = "vertical",
|
||||||
|
layout_config = {
|
||||||
|
width = 0.8,
|
||||||
|
height = 0.9,
|
||||||
|
prompt_position = "top",
|
||||||
|
preview_cutoff = 20,
|
||||||
|
preview_height = function(_, _, max_lines)
|
||||||
|
return max_lines - 15
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
-- https://github.com/altermo/ultimate-autopair.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
"altermo/ultimate-autopair.nvim",
|
||||||
|
event = { "InsertEnter", "CmdlineEnter" },
|
||||||
|
branch = "v0.6",
|
||||||
|
--- @module "ultimate-autopair"
|
||||||
|
--- @type prof.def.conf
|
||||||
|
opts = {
|
||||||
|
fastwarp = {
|
||||||
|
faster = true,
|
||||||
|
},
|
||||||
|
-- Fix single quotes in rust
|
||||||
|
config_internal_pairs = {
|
||||||
|
{
|
||||||
|
"'",
|
||||||
|
"'",
|
||||||
|
multiline = false,
|
||||||
|
nft = {},
|
||||||
|
suround = true,
|
||||||
|
cond = function(fn)
|
||||||
|
if fn.get_ft() ~= "rust" then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return not fn.in_node({ "bounded_type", "reference_type", "type_arguments", "type_parameters" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
-- https://github.com/saghen/blink.cmp
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
"saghen/blink.cmp",
|
||||||
|
dependencies = { "rafamadriz/friendly-snippets" },
|
||||||
|
event = "InsertEnter",
|
||||||
|
|
||||||
|
-- use a release tag to download pre-built binaries
|
||||||
|
version = "1.*",
|
||||||
|
|
||||||
|
--- @module "blink-cmp"
|
||||||
|
--- @type blink.cmp.Config
|
||||||
|
opts = {
|
||||||
|
keymap = {
|
||||||
|
preset = "default",
|
||||||
|
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
|
||||||
|
["<C-u>"] = { "scroll_documentation_up" },
|
||||||
|
["<C-d>"] = { "scroll_documentation_down" },
|
||||||
|
|
||||||
|
["<CR>"] = { "accept", "fallback" },
|
||||||
|
["<Esc>"] = {
|
||||||
|
function(cmp)
|
||||||
|
if cmp.is_visible() then
|
||||||
|
cmp.cancel()
|
||||||
|
if cmp.get_selected_item_idx() ~= nil or cmp.snippet_active() then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
elseif cmp.snippet_active() then
|
||||||
|
vim.snippet.stop()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
"fallback",
|
||||||
|
},
|
||||||
|
|
||||||
|
["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
|
||||||
|
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
|
||||||
|
["<Up>"] = { "select_prev", "fallback" },
|
||||||
|
["<Down>"] = { "select_next", "fallback" },
|
||||||
|
["<C-p>"] = { "select_prev", "fallback_to_mappings" },
|
||||||
|
["<C-n>"] = { "select_next", "fallback_to_mappings" },
|
||||||
|
|
||||||
|
["<C-k>"] = { "show_signature", "hide_signature", "fallback" },
|
||||||
|
},
|
||||||
|
|
||||||
|
appearance = {
|
||||||
|
nerd_font_variant = "normal",
|
||||||
|
},
|
||||||
|
|
||||||
|
completion = {
|
||||||
|
ghost_text = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
list = {
|
||||||
|
selection = {
|
||||||
|
preselect = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
documentation = {
|
||||||
|
auto_show = true,
|
||||||
|
auto_show_delay_ms = 0,
|
||||||
|
},
|
||||||
|
menu = {
|
||||||
|
auto_show = true,
|
||||||
|
draw = {
|
||||||
|
columns = {
|
||||||
|
{ "label", "label_description", gap = 1 },
|
||||||
|
{ "kind", "source_name", gap = 1 },
|
||||||
|
},
|
||||||
|
components = {
|
||||||
|
source_name = {
|
||||||
|
text = function(ctx)
|
||||||
|
if ctx.source_id ~= "snippets" then
|
||||||
|
return "[" .. ctx.source_name .. "]"
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
signature = {
|
||||||
|
enabled = true,
|
||||||
|
trigger = {
|
||||||
|
show_on_accept = true,
|
||||||
|
show_on_insert = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
sources = {
|
||||||
|
default = {
|
||||||
|
"lazydev",
|
||||||
|
"lsp",
|
||||||
|
"path",
|
||||||
|
"snippets",
|
||||||
|
"buffer",
|
||||||
|
},
|
||||||
|
providers = {
|
||||||
|
lazydev = {
|
||||||
|
name = "LazyDev",
|
||||||
|
module = "lazydev.integrations.blink",
|
||||||
|
score_offset = 100,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
cmdline = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||||
|
},
|
||||||
|
opts_extend = { "sources.default" },
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
-- https://github.com/akinsho/bufferline.nvim
|
||||||
|
local diagnostic = require("symbols.diagnostic")
|
||||||
|
local file = require("symbols.file")
|
||||||
|
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
"akinsho/bufferline.nvim",
|
||||||
|
--- @module "bufferline"
|
||||||
|
--- @type bufferline.UserConfig
|
||||||
|
opts = {
|
||||||
|
options = {
|
||||||
|
show_buffer_icons = false,
|
||||||
|
show_buffer_close_icons = false,
|
||||||
|
diagnostics = "nvim_lsp",
|
||||||
|
separator_style = "thick",
|
||||||
|
left_trunc_marker = "",
|
||||||
|
right_trunc_marker = "",
|
||||||
|
sort_by = "insert_at_end",
|
||||||
|
indicator = {
|
||||||
|
style = "none",
|
||||||
|
},
|
||||||
|
modified_icon = file.modified,
|
||||||
|
---@diagnostic disable-next-line: unused-local
|
||||||
|
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||||
|
local s = " "
|
||||||
|
for e, n in pairs(diagnostics_dict) do
|
||||||
|
local sym = e == "error" and diagnostic.error .. " "
|
||||||
|
or (e == "warning" and diagnostic.warn .. " ")
|
||||||
|
or (e == "info" and diagnostic.info .. " " or diagnostic.hint .. " ")
|
||||||
|
s = s .. n .. sym
|
||||||
|
end
|
||||||
|
return s
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
-- Setup keybinds to move between buffers
|
||||||
|
vim.keymap.set("n", "<tab>", function()
|
||||||
|
require("bufferline").cycle(1)
|
||||||
|
end, { silent = true, desc = "Goto next buffer" })
|
||||||
|
vim.keymap.set("n", "<S-tab>", function()
|
||||||
|
require("bufferline").cycle(-1)
|
||||||
|
end, { silent = true, desc = "Goto previous buffer" })
|
||||||
|
|
||||||
|
-- Setup keybinds to move buffers around
|
||||||
|
vim.keymap.set("n", "<leader>b[", function()
|
||||||
|
require("bufferline").move(-1)
|
||||||
|
end, { silent = true, desc = "Move buffer to left" })
|
||||||
|
vim.keymap.set("n", "<leader>b]", function()
|
||||||
|
require("bufferline").move(1)
|
||||||
|
end, { silent = true, desc = "Move buffer to right" })
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
-- https://github.com/kwkarlwang/bufresize.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
"kwkarlwang/bufresize.nvim",
|
||||||
|
opts = {},
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
-- https://github.com/NvChad/nvim-colorizer.lua
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
"NvChad/nvim-colorizer.lua",
|
||||||
|
opts = {
|
||||||
|
lazy_load = true,
|
||||||
|
filetypes = {
|
||||||
|
"*", -- Enable color highlighting for all files
|
||||||
|
"!neo-tree", -- Exclude neo-tree
|
||||||
|
},
|
||||||
|
buftypes = {
|
||||||
|
"*",
|
||||||
|
"!prompt",
|
||||||
|
"!popup",
|
||||||
|
},
|
||||||
|
always_update = true,
|
||||||
|
options = {
|
||||||
|
parsers = {
|
||||||
|
names = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
-- https://github.com/numToStr/Comment.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
"numToStr/Comment.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
--- @module "Comment"
|
||||||
|
--- @type CommentConfig
|
||||||
|
opts = {
|
||||||
|
toggler = {
|
||||||
|
block = "gBc",
|
||||||
|
},
|
||||||
|
opleader = {
|
||||||
|
block = "gB",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
-- https://github.com/stevearc/conform.nvim
|
||||||
|
local formatters_by_ft = {
|
||||||
|
c = { "clang-format" },
|
||||||
|
cpp = { "clang-format" },
|
||||||
|
go = { "goimports" },
|
||||||
|
python = { "ruff_organize_imports", "ruff_format" },
|
||||||
|
rust = { "rustfmt" },
|
||||||
|
javascript = { "prettier" },
|
||||||
|
javascriptreact = { "prettier" },
|
||||||
|
typescript = { "prettier" },
|
||||||
|
typescriptreact = { "prettier" },
|
||||||
|
css = { "prettier" },
|
||||||
|
markdown = { "prettier" },
|
||||||
|
yaml = { "prettier" },
|
||||||
|
lua = { "stylua" },
|
||||||
|
json = { "prettier" },
|
||||||
|
toml = { "taplo" },
|
||||||
|
-- ["*"] = { "injected" },
|
||||||
|
["_"] = { "trim_whitespace", "trim_newlines" },
|
||||||
|
}
|
||||||
|
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
event = { "BufWritePre" },
|
||||||
|
cmd = { "ConformInfo" },
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
-- Customize or remove this keymap to your liking
|
||||||
|
"<leader>f",
|
||||||
|
function()
|
||||||
|
require("conform").format({ async = true, lsp_fallback = true })
|
||||||
|
end,
|
||||||
|
mode = "",
|
||||||
|
desc = "Format buffer",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
--- @module "conform"
|
||||||
|
--- @type conform.setupOpts
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = formatters_by_ft,
|
||||||
|
notify_on_error = false,
|
||||||
|
format_on_save = function(bufnr)
|
||||||
|
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
--- @type conform.FormatOpts
|
||||||
|
return { lsp_format = "fallback" }
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
||||||
|
if args.bang then
|
||||||
|
-- FormatDisable! will disable formatting just for this buffer
|
||||||
|
vim.b.disable_autoformat = true
|
||||||
|
else
|
||||||
|
vim.g.disable_autoformat = true
|
||||||
|
end
|
||||||
|
end, {
|
||||||
|
desc = "Disable autoformat-on-save",
|
||||||
|
bang = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command("FormatEnable", function()
|
||||||
|
vim.b.disable_autoformat = false
|
||||||
|
vim.g.disable_autoformat = false
|
||||||
|
end, {
|
||||||
|
desc = "Re-enable autoformat-on-save",
|
||||||
|
})
|
||||||
|
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
-- https://github.com/Saecki/crates.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
"Saecki/crates.nvim",
|
||||||
|
event = { "BufRead Cargo.toml" },
|
||||||
|
tag = "stable",
|
||||||
|
--- @type crates.UserConfig
|
||||||
|
opts = {
|
||||||
|
popup = {
|
||||||
|
hide_on_select = true,
|
||||||
|
border = require("symbols.window").border,
|
||||||
|
},
|
||||||
|
lsp = {
|
||||||
|
enabled = true,
|
||||||
|
actions = true,
|
||||||
|
completion = true,
|
||||||
|
hover = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
-- https://github.com/mfussenegger/nvim-dap
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
enabled = false,
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
config = function()
|
||||||
|
local dap = require("dap")
|
||||||
|
dap.adapters.cppdbg = {
|
||||||
|
id = "cppdbg",
|
||||||
|
type = "executable",
|
||||||
|
command = "OpenDebugAD7",
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations.cpp = {
|
||||||
|
{
|
||||||
|
name = "Launch file",
|
||||||
|
type = "cppdbg",
|
||||||
|
request = "launch",
|
||||||
|
program = function()
|
||||||
|
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||||
|
end,
|
||||||
|
cwd = "${workspaceFolder}",
|
||||||
|
-- stopAtEntry = true,
|
||||||
|
},
|
||||||
|
-- {
|
||||||
|
-- name = "Attach to gdbserver :1234",
|
||||||
|
-- type = "cppdbg",
|
||||||
|
-- request = "launch",
|
||||||
|
-- MIMode = "gdb",
|
||||||
|
-- miDebuggerServerAddress = "localhost:1234",
|
||||||
|
-- miDebuggerPath = "/usr/bin/gdb",
|
||||||
|
-- cwd = "${workspaceFolder}",
|
||||||
|
--
|
||||||
|
-- program = function()
|
||||||
|
-- return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations.c = dap.configurations.cpp
|
||||||
|
dap.configurations.rust = dap.configurations.cpp
|
||||||
|
|
||||||
|
dap.defaults.fallback.force_external_terminal = true
|
||||||
|
dap.defaults.fallback.external_terminal = {
|
||||||
|
command = "tmux",
|
||||||
|
args = { "new-window" },
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<F5>", function()
|
||||||
|
require("dap").continue()
|
||||||
|
end, { desc = "Continue" })
|
||||||
|
vim.keymap.set("n", "<F10>", function()
|
||||||
|
require("dap").step_over()
|
||||||
|
end, { desc = "Step over" })
|
||||||
|
vim.keymap.set("n", "<F11>", function()
|
||||||
|
require("dap").step_into()
|
||||||
|
end, { desc = "Step into" })
|
||||||
|
vim.keymap.set("n", "<F12>", function()
|
||||||
|
require("dap").step_out()
|
||||||
|
end, { desc = "Step out" })
|
||||||
|
vim.keymap.set("n", "<Leader>bp", function()
|
||||||
|
require("dap").toggle_breakpoint()
|
||||||
|
end, { desc = "Breakpoint" })
|
||||||
|
-- vim.keymap.set("n", "<Leader>lp", function()
|
||||||
|
-- require("dap").set_breakpoint(nil, nil, vim.fn.input("Log point message: "))
|
||||||
|
-- end)
|
||||||
|
vim.keymap.set("n", "<Leader>dr", function()
|
||||||
|
require("dap").repl.open()
|
||||||
|
end, { desc = "Debug repl" })
|
||||||
|
-- vim.keymap.set("n", "<Leader>dl", function()
|
||||||
|
-- require("dap").run_last()
|
||||||
|
-- end)
|
||||||
|
vim.keymap.set({ "n", "v" }, "<Leader>dh", function()
|
||||||
|
require("dap.ui.widgets").hover()
|
||||||
|
end, { desc = "Debug hover" })
|
||||||
|
vim.keymap.set("n", "<Leader>df", function()
|
||||||
|
local widgets = require("dap.ui.widgets")
|
||||||
|
widgets.centered_float(widgets.frames)
|
||||||
|
end, { desc = "Debug frames" })
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = "dap-float",
|
||||||
|
callback = function()
|
||||||
|
vim.api.nvim_buf_set_keymap(0, "n", "q", "<cmd>close!<CR>", { noremap = true, silent = true })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
enabled = false,
|
||||||
|
"theHamsta/nvim-dap-virtual-text",
|
||||||
|
dependencies = {
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
virt_text_pos = "eol",
|
||||||
|
only_first_definition = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,412 @@
|
|||||||
|
-- https://github.com/sindrets/diffview.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
"sindrets/diffview.nvim",
|
||||||
|
opts = function()
|
||||||
|
local actions = require("diffview.actions")
|
||||||
|
|
||||||
|
return {
|
||||||
|
use_icons = false,
|
||||||
|
-- Disable default keymaps just so we can change <leader>e -> <leader>f
|
||||||
|
keymaps = {
|
||||||
|
disable_defaults = true,
|
||||||
|
view = {
|
||||||
|
-- The `view` bindings are active in the diff buffers, only when the current
|
||||||
|
-- tabpage is a Diffview.
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<tab>",
|
||||||
|
actions.select_next_entry,
|
||||||
|
{ desc = "Open the diff for the next file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<s-tab>",
|
||||||
|
actions.select_prev_entry,
|
||||||
|
{ desc = "Open the diff for the previous file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"[F",
|
||||||
|
actions.select_first_entry,
|
||||||
|
{ desc = "Open the diff for the first file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"]F",
|
||||||
|
actions.select_last_entry,
|
||||||
|
{ desc = "Open the diff for the last file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"gf",
|
||||||
|
actions.goto_file_edit,
|
||||||
|
{ desc = "Open the file in the previous tabpage" },
|
||||||
|
},
|
||||||
|
{ "n", "<C-w><C-f>", actions.goto_file_split, { desc = "Open the file in a new split" } },
|
||||||
|
{ "n", "<C-w>gf", actions.goto_file_tab, { desc = "Open the file in a new tabpage" } },
|
||||||
|
{ "n", "<leader>f", actions.focus_files, { desc = "Bring focus to the file panel" } },
|
||||||
|
{ "n", "<leader>b", actions.toggle_files, { desc = "Toggle the file panel." } },
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"g<C-x>",
|
||||||
|
actions.cycle_layout,
|
||||||
|
{ desc = "Cycle through available layouts." },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"[x",
|
||||||
|
actions.prev_conflict,
|
||||||
|
{ desc = "In the merge-tool: jump to the previous conflict" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"]x",
|
||||||
|
actions.next_conflict,
|
||||||
|
{ desc = "In the merge-tool: jump to the next conflict" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<leader>co",
|
||||||
|
actions.conflict_choose("ours"),
|
||||||
|
{ desc = "Choose the OURS version of a conflict" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<leader>ct",
|
||||||
|
actions.conflict_choose("theirs"),
|
||||||
|
{ desc = "Choose the THEIRS version of a conflict" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<leader>cb",
|
||||||
|
actions.conflict_choose("base"),
|
||||||
|
{ desc = "Choose the BASE version of a conflict" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<leader>ca",
|
||||||
|
actions.conflict_choose("all"),
|
||||||
|
{ desc = "Choose all the versions of a conflict" },
|
||||||
|
},
|
||||||
|
{ "n", "dx", actions.conflict_choose("none"), { desc = "Delete the conflict region" } },
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<leader>cO",
|
||||||
|
actions.conflict_choose_all("ours"),
|
||||||
|
{ desc = "Choose the OURS version of a conflict for the whole file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<leader>cT",
|
||||||
|
actions.conflict_choose_all("theirs"),
|
||||||
|
{ desc = "Choose the THEIRS version of a conflict for the whole file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<leader>cB",
|
||||||
|
actions.conflict_choose_all("base"),
|
||||||
|
{ desc = "Choose the BASE version of a conflict for the whole file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<leader>cA",
|
||||||
|
actions.conflict_choose_all("all"),
|
||||||
|
{ desc = "Choose all the versions of a conflict for the whole file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"dX",
|
||||||
|
actions.conflict_choose_all("none"),
|
||||||
|
{ desc = "Delete the conflict region for the whole file" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
file_panel = {
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"j",
|
||||||
|
actions.next_entry,
|
||||||
|
{ desc = "Bring the cursor to the next file entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<down>",
|
||||||
|
actions.next_entry,
|
||||||
|
{ desc = "Bring the cursor to the next file entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"k",
|
||||||
|
actions.prev_entry,
|
||||||
|
{ desc = "Bring the cursor to the previous file entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<up>",
|
||||||
|
actions.prev_entry,
|
||||||
|
{ desc = "Bring the cursor to the previous file entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<cr>",
|
||||||
|
actions.select_entry,
|
||||||
|
{ desc = "Open the diff for the selected entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"o",
|
||||||
|
actions.select_entry,
|
||||||
|
{ desc = "Open the diff for the selected entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"l",
|
||||||
|
actions.select_entry,
|
||||||
|
{ desc = "Open the diff for the selected entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<2-LeftMouse>",
|
||||||
|
actions.select_entry,
|
||||||
|
{ desc = "Open the diff for the selected entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"-",
|
||||||
|
actions.toggle_stage_entry,
|
||||||
|
{ desc = "Stage / unstage the selected entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"s",
|
||||||
|
actions.toggle_stage_entry,
|
||||||
|
{ desc = "Stage / unstage the selected entry" },
|
||||||
|
},
|
||||||
|
{ "n", "S", actions.stage_all, { desc = "Stage all entries" } },
|
||||||
|
{ "n", "U", actions.unstage_all, { desc = "Unstage all entries" } },
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"X",
|
||||||
|
actions.restore_entry,
|
||||||
|
{ desc = "Restore entry to the state on the left side" },
|
||||||
|
},
|
||||||
|
{ "n", "L", actions.open_commit_log, { desc = "Open the commit log panel" } },
|
||||||
|
{ "n", "zo", actions.open_fold, { desc = "Expand fold" } },
|
||||||
|
{ "n", "h", actions.close_fold, { desc = "Collapse fold" } },
|
||||||
|
{ "n", "zc", actions.close_fold, { desc = "Collapse fold" } },
|
||||||
|
{ "n", "za", actions.toggle_fold, { desc = "Toggle fold" } },
|
||||||
|
{ "n", "zR", actions.open_all_folds, { desc = "Expand all folds" } },
|
||||||
|
{ "n", "zM", actions.close_all_folds, { desc = "Collapse all folds" } },
|
||||||
|
{ "n", "<c-b>", actions.scroll_view(-0.25), { desc = "Scroll the view up" } },
|
||||||
|
{ "n", "<c-f>", actions.scroll_view(0.25), { desc = "Scroll the view down" } },
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<tab>",
|
||||||
|
actions.select_next_entry,
|
||||||
|
{ desc = "Open the diff for the next file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<s-tab>",
|
||||||
|
actions.select_prev_entry,
|
||||||
|
{ desc = "Open the diff for the previous file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"[F",
|
||||||
|
actions.select_first_entry,
|
||||||
|
{ desc = "Open the diff for the first file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"]F",
|
||||||
|
actions.select_last_entry,
|
||||||
|
{ desc = "Open the diff for the last file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"gf",
|
||||||
|
actions.goto_file_edit,
|
||||||
|
{ desc = "Open the file in the previous tabpage" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<C-w><C-f>",
|
||||||
|
actions.goto_file_split,
|
||||||
|
{ desc = "Open the file in a new split" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<C-w>gf",
|
||||||
|
actions.goto_file_tab,
|
||||||
|
{ desc = "Open the file in a new tabpage" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"i",
|
||||||
|
actions.listing_style,
|
||||||
|
{ desc = "Toggle between 'list' and 'tree' views" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"f",
|
||||||
|
actions.toggle_flatten_dirs,
|
||||||
|
{ desc = "Flatten empty subdirectories in tree listing style" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"R",
|
||||||
|
actions.refresh_files,
|
||||||
|
{ desc = "Update stats and entries in the file list" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<leader>f",
|
||||||
|
actions.focus_files,
|
||||||
|
{ desc = "Bring focus to the file panel" },
|
||||||
|
},
|
||||||
|
{ "n", "<leader>b", actions.toggle_files, { desc = "Toggle the file panel" } },
|
||||||
|
{ "n", "g<C-x>", actions.cycle_layout, { desc = "Cycle available layouts" } },
|
||||||
|
{ "n", "[x", actions.prev_conflict, { desc = "Go to the previous conflict" } },
|
||||||
|
{ "n", "]x", actions.next_conflict, { desc = "Go to the next conflict" } },
|
||||||
|
{ "n", "g?", actions.help("file_panel"), { desc = "Open the help panel" } },
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<leader>cO",
|
||||||
|
actions.conflict_choose_all("ours"),
|
||||||
|
{ desc = "Choose the OURS version of a conflict for the whole file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<leader>cT",
|
||||||
|
actions.conflict_choose_all("theirs"),
|
||||||
|
{ desc = "Choose the THEIRS version of a conflict for the whole file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<leader>cB",
|
||||||
|
actions.conflict_choose_all("base"),
|
||||||
|
{ desc = "Choose the BASE version of a conflict for the whole file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<leader>cA",
|
||||||
|
actions.conflict_choose_all("all"),
|
||||||
|
{ desc = "Choose all the versions of a conflict for the whole file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"dX",
|
||||||
|
actions.conflict_choose_all("none"),
|
||||||
|
{ desc = "Delete the conflict region for the whole file" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
file_history_panel = {
|
||||||
|
{ "n", "g!", actions.options, { desc = "Open the option panel" } },
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<C-A-d>",
|
||||||
|
actions.open_in_diffview,
|
||||||
|
{ desc = "Open the entry under the cursor in a diffview" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"y",
|
||||||
|
actions.copy_hash,
|
||||||
|
{ desc = "Copy the commit hash of the entry under the cursor" },
|
||||||
|
},
|
||||||
|
{ "n", "L", actions.open_commit_log, { desc = "Show commit details" } },
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"X",
|
||||||
|
actions.restore_entry,
|
||||||
|
{ desc = "Restore file to the state from the selected entry" },
|
||||||
|
},
|
||||||
|
{ "n", "zo", actions.open_fold, { desc = "Expand fold" } },
|
||||||
|
{ "n", "zc", actions.close_fold, { desc = "Collapse fold" } },
|
||||||
|
{ "n", "h", actions.close_fold, { desc = "Collapse fold" } },
|
||||||
|
{ "n", "za", actions.toggle_fold, { desc = "Toggle fold" } },
|
||||||
|
{ "n", "zR", actions.open_all_folds, { desc = "Expand all folds" } },
|
||||||
|
{ "n", "zM", actions.close_all_folds, { desc = "Collapse all folds" } },
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"j",
|
||||||
|
actions.next_entry,
|
||||||
|
{ desc = "Bring the cursor to the next file entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<down>",
|
||||||
|
actions.next_entry,
|
||||||
|
{ desc = "Bring the cursor to the next file entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"k",
|
||||||
|
actions.prev_entry,
|
||||||
|
{ desc = "Bring the cursor to the previous file entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<up>",
|
||||||
|
actions.prev_entry,
|
||||||
|
{ desc = "Bring the cursor to the previous file entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<cr>",
|
||||||
|
actions.select_entry,
|
||||||
|
{ desc = "Open the diff for the selected entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"o",
|
||||||
|
actions.select_entry,
|
||||||
|
{ desc = "Open the diff for the selected entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"l",
|
||||||
|
actions.select_entry,
|
||||||
|
{ desc = "Open the diff for the selected entry" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<2-LeftMouse>",
|
||||||
|
actions.select_entry,
|
||||||
|
{ desc = "Open the diff for the selected entry" },
|
||||||
|
},
|
||||||
|
{ "n", "<c-b>", actions.scroll_view(-0.25), { desc = "Scroll the view up" } },
|
||||||
|
{ "n", "<c-f>", actions.scroll_view(0.25), { desc = "Scroll the view down" } },
|
||||||
|
{ "n", "<tab>", actions.select_next_entry, { desc = "Open the diff for the next file" } },
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"<s-tab>",
|
||||||
|
actions.select_prev_entry,
|
||||||
|
{ desc = "Open the diff for the previous file" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"[F",
|
||||||
|
actions.select_first_entry,
|
||||||
|
{ desc = "Open the diff for the first file" },
|
||||||
|
},
|
||||||
|
{ "n", "]F", actions.select_last_entry, { desc = "Open the diff for the last file" } },
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"gf",
|
||||||
|
actions.goto_file_edit,
|
||||||
|
{ desc = "Open the file in the previous tabpage" },
|
||||||
|
},
|
||||||
|
{ "n", "<C-w><C-f>", actions.goto_file_split, { desc = "Open the file in a new split" } },
|
||||||
|
{ "n", "<C-w>gf", actions.goto_file_tab, { desc = "Open the file in a new tabpage" } },
|
||||||
|
{ "n", "<leader>f", actions.focus_files, { desc = "Bring focus to the file panel" } },
|
||||||
|
{ "n", "<leader>b", actions.toggle_files, { desc = "Toggle the file panel" } },
|
||||||
|
{ "n", "g<C-x>", actions.cycle_layout, { desc = "Cycle available layouts" } },
|
||||||
|
{ "n", "g?", actions.help("file_history_panel"), { desc = "Open the help panel" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user