Add dotfiles
This commit is contained in:
commit
aa37de5f47
94
.bashrc
Normal file
94
.bashrc
Normal file
@ -0,0 +1,94 @@
|
||||
#
|
||||
# ~/.bashrc
|
||||
#
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
[[ $- != *i* ]] && return
|
||||
|
||||
alias ls='ls --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
PS1='[\u@\h \W]\$ '
|
||||
alias ll='ls -alF'
|
||||
alias sd="cd \$(find . -type d -not -path '*/.*' 2>/dev/null | sed 's/^..//' | fzf)"
|
||||
alias asd="cd \$(find . -type d 2>/dev/null | sed 's/^..//' | fzf)"
|
||||
|
||||
export PATH=$PATH:/home/andreas/ext_sw/flutter/bin
|
||||
export PATH=$PATH:/home/andreas/.local/bin
|
||||
|
||||
alias get-idf='. $HOME/git/esp-idf/export.sh'
|
||||
alias clang-idf='export IDF_TOOLCHAIN=clang && . $HOME/git/esp-idf/export.sh'
|
||||
|
||||
alias c='cd ~/.config'
|
||||
alias nc='cd ~/.config/nvim'
|
||||
alias enc='nvim ~/.config/nvim && nvim'
|
||||
alias ebc='nvim ~/.bashrc'
|
||||
alias eic='nvim ~/.config/i3/config'
|
||||
alias ntp='cd ~/Documents/kit/NTP/tasks'
|
||||
alias eml='cd ~/Documents/kit/EMLLAB/emllab-challenge && . venv/bin/activate'
|
||||
alias let='cd ~/git/ba-letter'
|
||||
alias ams='cd ~/Documents/kit/AMS/'
|
||||
|
||||
source /usr/share/git/completion/git-completion.bash
|
||||
|
||||
eval "$(thefuck --alias)"
|
||||
|
||||
export VISUAL=nvim
|
||||
export EDITOR="$VISUAL"
|
||||
|
||||
function pym {
|
||||
python -m $@
|
||||
}
|
||||
|
||||
function _pym_complete {
|
||||
|
||||
local executable current previous options
|
||||
executable=${COMP_WORDS[0]}
|
||||
current="${COMP_WORDS[COMP_CWORD]}"
|
||||
previous="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
COMPREPLY=()
|
||||
if [[ ( "$executable" == python* && "$previous" == "-m" ) ||
|
||||
( "$executable" == pym && ! "$current" == -* ) ]]; then
|
||||
|
||||
options="`python <<EOF
|
||||
import os
|
||||
import pkgutil
|
||||
import sys
|
||||
current = '$current'
|
||||
if '.' in current:
|
||||
package_name = current.rsplit('.', 1)[0]
|
||||
try:
|
||||
package = __import__(package_name, fromlist=['__name__'])
|
||||
except:
|
||||
exit()
|
||||
else:
|
||||
package_name = ''
|
||||
package = None
|
||||
def walk_packages(paths, match, prefix=''):
|
||||
for loader, name, ispkg in pkgutil.iter_modules(paths, prefix):
|
||||
if not name.startswith(match):
|
||||
continue
|
||||
yield loader, name, ispkg
|
||||
if ispkg:
|
||||
for x in walk_packages([os.path.join(loader.path, name.split('.')[-1])], match, name + '.'):
|
||||
yield x
|
||||
for loader, name, ispkg in walk_packages(
|
||||
package and getattr(package, '__path__', ()),
|
||||
current,
|
||||
package_name and (package_name + '.'),
|
||||
):
|
||||
if ispkg:
|
||||
continue
|
||||
if name.endswith('.__main__'):
|
||||
print(name.rsplit('.', 1)[0])
|
||||
else:
|
||||
print(name)
|
||||
EOF
|
||||
`"
|
||||
COMPREPLY=( $(compgen -W "${options}") )
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
complete -F _pym_complete -o nospace -o bashdefault -o default pym
|
||||
complete -F _pym_complete -o nospace -o bashdefault -o default python
|
||||
28
.clang-format
Normal file
28
.clang-format
Normal file
@ -0,0 +1,28 @@
|
||||
BasedOnStyle: LLVM
|
||||
Language: Cpp
|
||||
|
||||
IndentWidth: 4
|
||||
UseTab: Never
|
||||
#NamespaceIndentation: All
|
||||
|
||||
PointerAlignment: Left
|
||||
AccessModifierOffset: -4
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
LambdaBodyIndentation: Signature
|
||||
|
||||
MaxEmptyLinesToKeep: 3
|
||||
#ColumnLimit: 128
|
||||
|
||||
CompactNamespaces: true
|
||||
FixNamespaceComments: true
|
||||
|
||||
AllowShortFunctionsOnASingleLine: false
|
||||
AllowShortIfStatementsOnASingleLine: true
|
||||
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignConsecutiveBitFields: true
|
||||
AlignConsecutiveDeclarations: true
|
||||
AlignConsecutiveMacros: true
|
||||
|
||||
#BraceWrapping:
|
||||
# BeforeElse: true
|
||||
38
.config/i3/config
Normal file
38
.config/i3/config
Normal file
@ -0,0 +1,38 @@
|
||||
set $mod Mod4
|
||||
# exec_always "setxkbmap -layout de"
|
||||
exec_always "setxkbmap -layout de -variant nodeadkeys"
|
||||
|
||||
include ~/.config/i3/config.d/*
|
||||
|
||||
bindsym $mod+d exec --no-startup-id rofi -show run -config ~/.config/rofi/config.rasi
|
||||
bindsym $mod+Return exec kitty
|
||||
bindsym $mod+Shift+q kill
|
||||
|
||||
bindsym $mod+Shift+c reload
|
||||
bindsym $mod+Shift+r restart
|
||||
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
|
||||
|
||||
mode "exit: [l]ogout, [r]eboot, [s]hutdown" {
|
||||
bindsym l exec i3-msg exit
|
||||
bindsym r exec systemctl reboot
|
||||
bindsym s exec systemctl shutdown
|
||||
bindsym Escape mode "default"
|
||||
bindsym Return mode "default"
|
||||
}
|
||||
|
||||
bindsym $mod+x mode "exit: [l]ogout, [r]eboot, [s]hutdown"
|
||||
bindsym $mod+Shift+x exec i3lock
|
||||
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +5 --max-volume 100 #increase sound volume
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -5 --max-volume 100 #decrease sound volume
|
||||
bindsym Shift+XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +5 --max-volume 300 #increase sound volume
|
||||
bindsym Shift+XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -5 --max-volume 300 #decrease sound volume
|
||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle # mute sound
|
||||
|
||||
bindsym XF86AudioPlay exec playerctl play-pause
|
||||
bindsym XF86AudioPause exec playerctl play-pause
|
||||
bindsym XF86AudioNext exec playerctl next
|
||||
bindsym XF86AudioPrev exec playerctl previous
|
||||
|
||||
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl set +5%
|
||||
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl set 5%-
|
||||
5
.config/i3/config.d/autostart.conf
Normal file
5
.config/i3/config.d/autostart.conf
Normal file
@ -0,0 +1,5 @@
|
||||
exec --no-startup-id dex --autostart --environment i3
|
||||
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
|
||||
exec --no-startup-id nm-applet &
|
||||
exec --no-startup-id blueman-applet &
|
||||
|
||||
10
.config/i3/config.d/gruvbox.conf
Executable file
10
.config/i3/config.d/gruvbox.conf
Executable file
@ -0,0 +1,10 @@
|
||||
#gruvbox
|
||||
# class border backgr. text indicator child_border
|
||||
client.focused #d65d0e #d65d0e #1a1826 #d65d0e #d65d0e
|
||||
client.focused_inactive #ebdbb2 #5f676a #ffffff #ebdbb2 #ebdbb2
|
||||
client.unfocused #333333 #222222 #888888 #292d2e #222222
|
||||
client.urgent #cc241d #900000 #ffffff #cc241d #cc241d
|
||||
client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
|
||||
|
||||
client.background #ffffff
|
||||
|
||||
0
.config/i3/config.d/keybindings.conf
Normal file
0
.config/i3/config.d/keybindings.conf
Normal file
54
.config/i3/config.d/navigation.conf
Normal file
54
.config/i3/config.d/navigation.conf
Normal file
@ -0,0 +1,54 @@
|
||||
bindsym $mod+h focus left
|
||||
bindsym $mod+j focus down
|
||||
bindsym $mod+k focus up
|
||||
bindsym $mod+l focus right
|
||||
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
bindsym $mod+Shift+h move left
|
||||
bindsym $mod+Shift+j move down
|
||||
bindsym $mod+Shift+k move up
|
||||
bindsym $mod+Shift+l move right
|
||||
|
||||
bindsym $mod+Shift+Left move left
|
||||
bindsym $mod+Shift+Down move down
|
||||
bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Right move right
|
||||
|
||||
bindsym $mod+p split h
|
||||
bindsym $mod+v split v
|
||||
|
||||
bindsym $mod+f fullscreen toggle
|
||||
|
||||
mode "resize" {
|
||||
bindsym h resize shrink width 10 px or 10 ppt
|
||||
bindsym j resize grow height 10 px or 10 ppt
|
||||
bindsym k resize shrink height 10 px or 10 ppt
|
||||
bindsym l resize grow width 10 px or 10 ppt
|
||||
|
||||
bindsym Left resize shrink width 10 px or 10 ppt
|
||||
bindsym Down resize grow height 10 px or 10 ppt
|
||||
bindsym Up resize shrink height 10 px or 10 ppt
|
||||
bindsym Right resize grow width 10 px or 10 ppt
|
||||
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
bindsym $mod+r mode "default"
|
||||
}
|
||||
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
bindsym $mod+space focus mode_toggle
|
||||
|
||||
bindsym $mod+a focus parent
|
||||
#bindsym $mod+d focus child
|
||||
|
||||
floating_modifier $mod
|
||||
13
.config/i3/config.d/ui.conf
Normal file
13
.config/i3/config.d/ui.conf
Normal file
@ -0,0 +1,13 @@
|
||||
exec_always --no-startup-id feh --bg-scale /usr/share/wallpapers/ColdRipple/contents/images/1920x1080.jpg
|
||||
|
||||
exec_always --no-startup-id "picom --config ~/.config/picom/picom.conf"
|
||||
exec_always --no-startup-id ~/.config/polybar/launch.sh &
|
||||
|
||||
for_window [class="^.*"] border pixel 3
|
||||
default_floating_border none
|
||||
default_floating_border normal 0
|
||||
hide_edge_borders smart
|
||||
|
||||
gaps inner 8
|
||||
smart_gaps on
|
||||
|
||||
38
.config/i3/config.d/workspaces.conf
Normal file
38
.config/i3/config.d/workspaces.conf
Normal file
@ -0,0 +1,38 @@
|
||||
set $ws1 "1: Terminal"
|
||||
set $ws2 "2: Firefox"
|
||||
set $ws3 "3: Music"
|
||||
set $ws4 "4"
|
||||
set $ws5 "5"
|
||||
set $ws6 "6"
|
||||
set $ws7 "7"
|
||||
set $ws8 "8"
|
||||
set $ws9 "9"
|
||||
set $ws10 "10"
|
||||
|
||||
bindsym $mod+1 workspace number $ws1
|
||||
bindsym $mod+2 workspace number $ws2
|
||||
bindsym $mod+3 workspace number $ws3
|
||||
bindsym $mod+4 workspace number $ws4
|
||||
bindsym $mod+5 workspace number $ws5
|
||||
bindsym $mod+6 workspace number $ws6
|
||||
bindsym $mod+7 workspace number $ws7
|
||||
bindsym $mod+8 workspace number $ws8
|
||||
bindsym $mod+9 workspace number $ws9
|
||||
bindsym $mod+0 workspace number $ws10
|
||||
|
||||
bindsym $mod+Shift+1 move container to workspace number $ws1
|
||||
bindsym $mod+Shift+2 move container to workspace number $ws2
|
||||
bindsym $mod+Shift+3 move container to workspace number $ws3
|
||||
bindsym $mod+Shift+4 move container to workspace number $ws4
|
||||
bindsym $mod+Shift+5 move container to workspace number $ws5
|
||||
bindsym $mod+Shift+6 move container to workspace number $ws6
|
||||
bindsym $mod+Shift+7 move container to workspace number $ws7
|
||||
bindsym $mod+Shift+8 move container to workspace number $ws8
|
||||
bindsym $mod+Shift+9 move container to workspace number $ws9
|
||||
bindsym $mod+Shift+0 move container to workspace number $ws10
|
||||
|
||||
assign [class="firefox"] $ws2
|
||||
assign [class="Spotify"] $ws3
|
||||
|
||||
exec --no-startup-id firefox
|
||||
exec --no-startup-id i3-msg 'workspace $ws1; exec kitty; $ws1'
|
||||
33
.config/kitty/current-theme.conf
Normal file
33
.config/kitty/current-theme.conf
Normal file
@ -0,0 +1,33 @@
|
||||
## name: Gruvbox Dark Hard
|
||||
## author: Pavel Pertsev
|
||||
## license: MIT/X11
|
||||
## upstream: https://raw.githubusercontent.com/gruvbox-community/gruvbox-contrib/master/kitty/gruvbox-dark-hard.conf
|
||||
|
||||
|
||||
selection_foreground #ebdbb2
|
||||
selection_background #d65d0e
|
||||
|
||||
background #1d2021
|
||||
foreground #ebdbb2
|
||||
|
||||
color0 #3c3836
|
||||
color1 #cc241d
|
||||
color2 #98971a
|
||||
color3 #d79921
|
||||
color4 #458588
|
||||
color5 #b16286
|
||||
color6 #689d6a
|
||||
color7 #a89984
|
||||
color8 #928374
|
||||
color9 #fb4934
|
||||
color10 #b8bb26
|
||||
color11 #fabd2f
|
||||
color12 #83a598
|
||||
color13 #d3869b
|
||||
color14 #8ec07c
|
||||
color15 #fbf1c7
|
||||
|
||||
cursor #bdae93
|
||||
cursor_text_color #665c54
|
||||
|
||||
url_color #458588
|
||||
6
.config/kitty/kitty.conf
Normal file
6
.config/kitty/kitty.conf
Normal file
@ -0,0 +1,6 @@
|
||||
# BEGIN_KITTY_THEME
|
||||
# Gruvbox Dark Hard
|
||||
include current-theme.conf
|
||||
# END_KITTY_THEME
|
||||
#
|
||||
background_opacity 0.95
|
||||
33
.config/nvim/.lua-format
Normal file
33
.config/nvim/.lua-format
Normal file
@ -0,0 +1,33 @@
|
||||
column_limit: 120
|
||||
|
||||
#indent_width: 4
|
||||
#use_tab: false
|
||||
#tab_width: 4
|
||||
#continuation_indent_width: 4
|
||||
#spaces_before_call: 1
|
||||
#keep_simple_control_block_one_line: true
|
||||
#keep_simple_function_one_line: true
|
||||
#align_args: true
|
||||
#break_after_functioncall_lp: false
|
||||
#break_before_functioncall_rp: false
|
||||
#spaces_inside_functioncall_parens: false
|
||||
#spaces_inside_functiondef_parens: false
|
||||
#align_parameter: true
|
||||
#chop_down_parameter: false
|
||||
#break_after_functiondef_lp: false
|
||||
#break_before_functiondef_rp: false
|
||||
#align_table_field: true
|
||||
#break_after_table_lb: true
|
||||
#break_before_table_rb: true
|
||||
#chop_down_table: false
|
||||
#chop_down_kv_table: true
|
||||
#table_sep: ","
|
||||
column_table_limit: 1
|
||||
#extra_sep_at_table_end: false
|
||||
#spaces_inside_table_braces: false
|
||||
#break_after_operator: true
|
||||
#double_quote_to_single_quote: false
|
||||
#single_quote_to_double_quote: false
|
||||
#spaces_around_equals_in_field: true
|
||||
#line_breaks_after_function_body: 1
|
||||
#line_separator: input
|
||||
38
.config/nvim/README.md
Normal file
38
.config/nvim/README.md
Normal file
@ -0,0 +1,38 @@
|
||||
# neovim config
|
||||
|
||||
`neovim` configuration files.
|
||||
|
||||
## Usage
|
||||
|
||||
1. Install depencencies
|
||||
* See one of the Dockerfiles in `dockerfiles` for the necessary packages
|
||||
* Use a patched font (see, e.g., [nerd fonts](https://www.nerdfonts.com/))
|
||||
2. Clone repository into configuration directory:
|
||||
```bash
|
||||
$ git clone ssh://git@git.mercurial-manifold.eu:2224/an.tsouchlos/config-nvim.git ~/.config/nvim
|
||||
```
|
||||
3. If desired, configure github copilot by running `:Copilot setup`
|
||||
|
||||
## Build docker images
|
||||
|
||||
### Arch linux
|
||||
|
||||
Because AUR package installation requires the `fakeroot` command, which is
|
||||
extremely slow when [no limit has been set on the maximum number of file
|
||||
descriptors](https://github.com/moby/moby/issues/45436), the image has to
|
||||
be build using the `--ulimit "nofile=1024:1048576"` option:
|
||||
|
||||
```bash
|
||||
$ docker build . -f dockerfiles/Dockerfile.archlinux --ulimit "nofile=1024:1048576" -t config
|
||||
$ docker run --rm -it config
|
||||
```
|
||||
|
||||
### Ubuntu
|
||||
|
||||
Because neovim is installed through an `AppImage`, the container has to be
|
||||
started with `--privileged` to be able to run `nvim`.
|
||||
|
||||
```bash
|
||||
$ docker build . -f dockerfiles/Dockerfile.ubuntu -t config
|
||||
$ docker run --rm -it --privileged config
|
||||
```
|
||||
61
.config/nvim/dockerfiles/Dockerfile.arch
Normal file
61
.config/nvim/dockerfiles/Dockerfile.arch
Normal file
@ -0,0 +1,61 @@
|
||||
FROM archlinux:latest
|
||||
|
||||
|
||||
#
|
||||
# General boiler plate
|
||||
#
|
||||
|
||||
|
||||
# Add mock non-root user for AUR package compilation
|
||||
|
||||
RUN useradd --no-create-home --shell=/bin/false build && usermod -L build
|
||||
RUN echo 'build ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
|
||||
# Ready image for installation
|
||||
|
||||
RUN pacman-key --init
|
||||
RUN pacman-key --populate archlinux
|
||||
RUN pacman -Sy archlinux-keyring --noconfirm && pacman -Su --noconfirm
|
||||
RUN pacman -Syu --noconfirm
|
||||
|
||||
# Install generic dependencies
|
||||
|
||||
RUN pacman -S git wget sudo base-devel --noconfirm
|
||||
|
||||
|
||||
#
|
||||
# Neovim specific
|
||||
#
|
||||
|
||||
|
||||
# Install nvim
|
||||
|
||||
RUN pacman -S neovim --noconfirm
|
||||
|
||||
# Install nvim module dependencies
|
||||
|
||||
RUN pacman -S python-pynvim --noconfirm # python3 provider
|
||||
RUN pacman -S npm --noconfirm # mason requirements
|
||||
RUN pacman -S fd ripgrep --noconfirm # Telescope requirements
|
||||
RUN pacman -S powerline-fonts --noconfirm # vim-airline requirements
|
||||
#RUN pacman -S autopep8 texlive-binextra \
|
||||
# perl-yaml-tiny perl-file-homedir --noconfirm # neoformat requirements
|
||||
|
||||
WORKDIR /tmp
|
||||
|
||||
USER build
|
||||
ARG HOME=/tmp
|
||||
RUN wget https://aur.archlinux.org/cgit/aur.git/snapshot/neovim-remote.tar.gz
|
||||
RUN tar xzvf neovim-remote.tar.gz
|
||||
RUN cd neovim-remote && makepkg -s --noconfirm
|
||||
|
||||
USER root
|
||||
RUN pacman -U neovim-remote/*.pkg.tar.zst --noconfirm # vimtex requirements
|
||||
|
||||
WORKDIR /
|
||||
|
||||
# Copy configuration
|
||||
|
||||
RUN mkdir -p /root/.config/nvim
|
||||
COPY . /root/.config/nvim
|
||||
|
||||
96
.config/nvim/dockerfiles/Dockerfile.devcontainer
Normal file
96
.config/nvim/dockerfiles/Dockerfile.devcontainer
Normal file
@ -0,0 +1,96 @@
|
||||
FROM ubuntu:22.04
|
||||
|
||||
|
||||
#
|
||||
# General boiler plate
|
||||
#
|
||||
|
||||
|
||||
# Ready image for installation
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt update -y && apt upgrade -y
|
||||
|
||||
# Install generic dependencies
|
||||
|
||||
RUN apt install git python3 python3-pip sudo -y
|
||||
|
||||
# Set up user
|
||||
|
||||
ARG UNAME=dev
|
||||
ARG UID=1000
|
||||
ARG GID=1000
|
||||
RUN groupadd -g $GID -o $UNAME
|
||||
RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME
|
||||
RUN adduser $UNAME sudo
|
||||
RUN echo "%sudo ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee -a /etc/sudoers.d/nopassword
|
||||
|
||||
|
||||
#
|
||||
# Install neovim
|
||||
#
|
||||
|
||||
|
||||
# Install neovim
|
||||
|
||||
WORKDIR /tmp
|
||||
RUN git clone https://github.com/neovim/neovim.git
|
||||
WORKDIR /tmp/neovim
|
||||
RUN git checkout stable
|
||||
RUN apt install ninja-build gettext cmake unzip curl -y
|
||||
RUN make CMAKE_BUILD_TYPE=Release -j `nproc` && make install
|
||||
WORKDIR /
|
||||
|
||||
# Install package dependencies
|
||||
|
||||
RUN python3 -m pip install pynvim # python3 provider
|
||||
RUN python3 -m pip install jupytext # jupytext requirements
|
||||
RUN apt install fd-find ripgrep -y # Telescope requirements
|
||||
RUN apt install fonts-powerline -y # vim-airline requirements
|
||||
RUN python3 -m pip install neovim-remote # vimtex requirements
|
||||
RUN apt install curl -y # vim-doge requirements
|
||||
RUN apt install npm python3-venv luarocks -y # mason build requirements
|
||||
RUN python3 -m pip install cairosvg pnglatex plotly kaleido pyperclip jupyter-client ipykernel # molten requirements
|
||||
|
||||
# Configure
|
||||
|
||||
RUN mkdir -p "/home/${UNAME}/.config/nvim"
|
||||
COPY . "/home/${UNAME}/.config/nvim"
|
||||
RUN chown -R $UNAME:$UNAME "/home/${UNAME}/.config"
|
||||
USER $UNAME
|
||||
RUN nvim --headless "+Lazy! sync" +qa
|
||||
RUN nvim --headless "+MasonInstall clangd pyright cmake-language-server bash-language-server texlab clang-format latexindent mdformat autopep8" +qa
|
||||
RUN nvim --headless "+TSInstallSync markdown" +qa # For some reason, without this markdown installation fails the first time
|
||||
USER root
|
||||
|
||||
|
||||
#
|
||||
# Install other tools
|
||||
#
|
||||
|
||||
|
||||
# Install firefox
|
||||
# (Taken from https://askubuntu.com/a/1404401)
|
||||
|
||||
RUN apt install software-properties-common -y
|
||||
RUN add-apt-repository ppa:mozillateam/ppa
|
||||
RUN echo '\n\
|
||||
Package: *\n\
|
||||
Pin: release o=LP-PPA-mozillateam\n\
|
||||
Pin-Priority: 1001\n\n\
|
||||
Package: firefox\n\
|
||||
Pin: version 1:1snap1-0ubuntu2\n\
|
||||
Pin-Priority: -1\n\
|
||||
' | tee /etc/apt/preferences.d/mozilla-firefox
|
||||
RUN apt install firefox -y
|
||||
RUN echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox
|
||||
|
||||
# Other stuff
|
||||
|
||||
RUN apt install fzf xclip -y
|
||||
|
||||
USER $UNAME
|
||||
WORKDIR /home/$UNAME
|
||||
CMD /bin/bash
|
||||
|
||||
52
.config/nvim/dockerfiles/Dockerfile.ubuntu
Normal file
52
.config/nvim/dockerfiles/Dockerfile.ubuntu
Normal file
@ -0,0 +1,52 @@
|
||||
FROM ubuntu:22.04
|
||||
|
||||
|
||||
#
|
||||
# General boiler plate
|
||||
#
|
||||
|
||||
|
||||
# Ready image for installation
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt update -y && apt upgrade -y
|
||||
|
||||
# Install generic dependencies
|
||||
|
||||
RUN apt install git python3 python3-pip -y
|
||||
|
||||
#
|
||||
# Install neovim
|
||||
#
|
||||
|
||||
|
||||
# Install neovim
|
||||
|
||||
WORKDIR /tmp
|
||||
RUN git clone https://github.com/neovim/neovim.git
|
||||
WORKDIR /tmp/neovim
|
||||
RUN git checkout stable
|
||||
RUN apt install ninja-build gettext cmake unzip curl -y
|
||||
RUN make CMAKE_BUILD_TYPE=Release -j `nproc` && make install
|
||||
WORKDIR /
|
||||
|
||||
# Install package dependencies
|
||||
|
||||
RUN python3 -m pip install pynvim # python3 provider
|
||||
RUN python3 -m pip install jupytext # jupytext requirements
|
||||
RUN apt install fd-find ripgrep -y # Telescope requirements
|
||||
RUN apt install fonts-powerline -y # vim-airline requirements
|
||||
RUN python3 -m pip install neovim-remote # vimtex requirements
|
||||
RUN apt install curl -y # vim-doge requirements
|
||||
RUN apt install npm python3-venv luarocks -y # mason build requirements
|
||||
RUN python3 -m pip install cairosvg pnglatex plotly kaleido pyperclip jupyter-client ipykernel # molten requirements
|
||||
|
||||
# Configure
|
||||
|
||||
RUN mkdir -p /root/.config/nvim
|
||||
COPY . /root/.config/nvim
|
||||
RUN nvim --headless "+Lazy! sync" +qa
|
||||
RUN nvim --headless "+MasonInstall clangd pyright cmake-language-server bash-language-server texlab clang-format latexindent luaformatter mdformat autopep8" +qa
|
||||
RUN nvim --headless "+TSInstallSync markdown" +qa # For some reason, without this markdown installation fails the first time
|
||||
|
||||
17
.config/nvim/init.lua
Normal file
17
.config/nvim/init.lua
Normal file
@ -0,0 +1,17 @@
|
||||
require("set")
|
||||
require("remap")
|
||||
|
||||
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)
|
||||
|
||||
require("lazy").setup("plugins")
|
||||
11
.config/nvim/lua/disabled_plugins/barbecue.lua
Normal file
11
.config/nvim/lua/disabled_plugins/barbecue.lua
Normal file
@ -0,0 +1,11 @@
|
||||
return {
|
||||
{
|
||||
"utilyre/barbecue.nvim",
|
||||
name = "barbecue",
|
||||
version = "*",
|
||||
dependencies = {"SmiteshP/nvim-navic", "nvim-tree/nvim-web-devicons"},
|
||||
config = function()
|
||||
require("barbecue").setup()
|
||||
end,
|
||||
}
|
||||
}
|
||||
9
.config/nvim/lua/disabled_plugins/cellular_automaton.lua
Normal file
9
.config/nvim/lua/disabled_plugins/cellular_automaton.lua
Normal file
@ -0,0 +1,9 @@
|
||||
return {
|
||||
{
|
||||
'Eandrju/cellular-automaton.nvim',
|
||||
cmd = {
|
||||
"CellularAutomaton"
|
||||
},
|
||||
init = function() vim.keymap.set("n", "<leader>fu", "<cmd>CellularAutomaton make_it_rain<CR>") end
|
||||
}
|
||||
}
|
||||
11
.config/nvim/lua/disabled_plugins/doge.lua
Normal file
11
.config/nvim/lua/disabled_plugins/doge.lua
Normal file
@ -0,0 +1,11 @@
|
||||
return {
|
||||
{
|
||||
'kkoomen/vim-doge',
|
||||
build = ':call doge#install()',
|
||||
init = function()
|
||||
vim.g.doge_doc_standard_cpp = 'doxygen_qt'
|
||||
vim.g.doge_mapping_comment_jump_forward = '<c-j>'
|
||||
vim.g.doge_mapping_comment_jump_backward = '<c-k>'
|
||||
end
|
||||
}
|
||||
}
|
||||
6
.config/nvim/lua/disabled_plugins/jupytext.lua
Normal file
6
.config/nvim/lua/disabled_plugins/jupytext.lua
Normal file
@ -0,0 +1,6 @@
|
||||
return {
|
||||
{
|
||||
"GCBallesteros/jupytext.nvim",
|
||||
config = true
|
||||
}
|
||||
}
|
||||
15
.config/nvim/lua/disabled_plugins/killersheep.lua
Normal file
15
.config/nvim/lua/disabled_plugins/killersheep.lua
Normal file
@ -0,0 +1,15 @@
|
||||
return {
|
||||
{
|
||||
"seandewar/killersheep.nvim",
|
||||
config = function()
|
||||
require("killersheep").setup {
|
||||
gore = true, -- Enables/disables blood and gore.
|
||||
keymaps = {
|
||||
move_left = "h", -- Keymap to move cannon to the left.
|
||||
move_right = "l", -- Keymap to move cannon to the right.
|
||||
shoot = "<Space>" -- Keymap to shoot the cannon.
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
}
|
||||
8
.config/nvim/lua/disabled_plugins/vim_be_good.lua
Normal file
8
.config/nvim/lua/disabled_plugins/vim_be_good.lua
Normal file
@ -0,0 +1,8 @@
|
||||
return {
|
||||
{
|
||||
"ThePrimeagen/vim-be-good",
|
||||
cmd = {
|
||||
"VimBeGood"
|
||||
}
|
||||
}
|
||||
}
|
||||
40
.config/nvim/lua/disabled_plugins/vimtex.lua
Normal file
40
.config/nvim/lua/disabled_plugins/vimtex.lua
Normal file
@ -0,0 +1,40 @@
|
||||
return {
|
||||
{
|
||||
"lervag/vimtex",
|
||||
ft = {"tex", "bib"},
|
||||
config = function()
|
||||
-- General configuration
|
||||
|
||||
vim.cmd("syntax enable")
|
||||
|
||||
vim.g.vimtex_compiler_latexmk = {
|
||||
out_dir = 'build',
|
||||
options = {
|
||||
'-shell-escape',
|
||||
'-verbose',
|
||||
'-file-line-error',
|
||||
'-interaction=nonstopmode',
|
||||
'-synctex=1'
|
||||
}
|
||||
}
|
||||
|
||||
vim.g.vimtex_view_general_viewer = 'sioyek'
|
||||
vim.g.vimtex_quickfix_mode = 0
|
||||
|
||||
-- Concealment
|
||||
|
||||
vim.cmd([[set conceallevel=1]])
|
||||
vim.g.tex_conceal = 'abdmg'
|
||||
|
||||
-- Synctex configuration
|
||||
|
||||
vim.g.vimtex_compiler_progname = 'nvr'
|
||||
|
||||
local options = string.format(
|
||||
'--reuse-window --inverse-search="nvr --servername %s +%%2 %%1" --forward-search-file @tex --forward-search-line @line @pdf',
|
||||
vim.v.servername)
|
||||
local command = string.format("let g:vimtex_view_general_options='%s'", options)
|
||||
vim.cmd(command)
|
||||
end
|
||||
}
|
||||
}
|
||||
15
.config/nvim/lua/disabled_plugins/whichkey.lua
Normal file
15
.config/nvim/lua/disabled_plugins/whichkey.lua
Normal file
@ -0,0 +1,15 @@
|
||||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
}
|
||||
}
|
||||
64
.config/nvim/lua/plugins/alpha.lua
Normal file
64
.config/nvim/lua/plugins/alpha.lua
Normal file
@ -0,0 +1,64 @@
|
||||
-------------------
|
||||
-- Helper functions
|
||||
-------------------
|
||||
local function clamp(x, min, max) return math.max(math.min(x, max), min) end
|
||||
|
||||
local function get_random_image()
|
||||
images = {
|
||||
{
|
||||
[[██╗ █████╗ ██████╗██╗ ██╗███████╗]],
|
||||
[[██║ ██╔══██╗██╔════╝██║ ██║██╔════╝]],
|
||||
[[██║ ███████║██║ ███████║███████╗]],
|
||||
[[██║ ██╔══██║██║ ██╔══██║╚════██║]],
|
||||
[[███████╗██║ ██║╚██████╗██║ ██║███████║]],
|
||||
[[╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝]]
|
||||
},
|
||||
{
|
||||
[[ ,,,╓▄▄▓▓▓▓▄ ,▄▓∩]],
|
||||
[[ ,╓▄▄▄▄▓▓▓▓▓▓▓▓▀▓▓▓▓▓▓▓▓▓▀▀▀▓@@æ▄╓,▄▄ ,▄▓▓▓▓ ]],
|
||||
[[ ,▄▄▓▓█████▀╫╫Ñ▒Ñ▒▒▒▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒▀▀▀▓@#▓▓▀▓▓▓Ñ ]],
|
||||
[[ -2▓╫▒▒▒▒▒╫▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▓▓▓ ]],
|
||||
[[ ª╨╩Ñ▒▒▒▒▒╫▄▒▒▒▒▒▒▒░░▒▒▒▒▒▒▒▒▒░▒░░░░░░░═╨` `╫╫▓▓▓▓ ]],
|
||||
[[ `ªº╩▒▒▒▒░░░░...░░▒▒▒▄▒▒▒ºª`` `▀▓▓▓ ]],
|
||||
[[ ╙▓µ ]]
|
||||
},
|
||||
{
|
||||
[[███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗]],
|
||||
[[████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║]],
|
||||
[[██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║]],
|
||||
[[██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║]],
|
||||
[[██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║]],
|
||||
[[╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]]
|
||||
}
|
||||
}
|
||||
|
||||
-- local i = math.random(#images)
|
||||
local i = clamp(math.random(1, 40), 1, #images)
|
||||
return images[i]
|
||||
end
|
||||
|
||||
-----------------
|
||||
-- Configurtation
|
||||
-----------------
|
||||
|
||||
return {
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
event = "VimEnter",
|
||||
config = function()
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
dashboard.section.header.val = get_random_image()
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'),
|
||||
dashboard.button('r', ' Recent files', ':Telescope oldfiles <CR>'),
|
||||
dashboard.button('f', ' Find file', ':Telescope find_files <CR>'),
|
||||
dashboard.button('g', ' Find text', ':Telescope live_grep <CR>'),
|
||||
dashboard.button('p', ' Open project', ':Telescope session-lens search_session<CR>'),
|
||||
dashboard.button('l', ' Lazy', ':Lazy<CR>'),
|
||||
dashboard.button('q', ' Quit', ':qa<CR>')
|
||||
}
|
||||
|
||||
require("alpha").setup(dashboard.opts)
|
||||
end
|
||||
}
|
||||
}
|
||||
38
.config/nvim/lua/plugins/auto_session.lua
Normal file
38
.config/nvim/lua/plugins/auto_session.lua
Normal file
@ -0,0 +1,38 @@
|
||||
return {
|
||||
{
|
||||
"rmagatti/auto-session",
|
||||
dependencies = {
|
||||
"nvim-lualine/lualine.nvim"
|
||||
},
|
||||
event = "VimEnter",
|
||||
init = function()
|
||||
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||
|
||||
vim.keymap.set('n', '<leader><C-s>', '<cmd>SessionSave<CR>')
|
||||
vim.keymap.set('n', '<leader><C-d>', '<cmd>SessionDelete<CR>')
|
||||
end,
|
||||
opts = {
|
||||
log_level = "error",
|
||||
auto_save_enabled = false
|
||||
}
|
||||
},
|
||||
{
|
||||
'rmagatti/session-lens',
|
||||
cmd = {
|
||||
"Autosession",
|
||||
"SearchSession"
|
||||
},
|
||||
dependencies = {
|
||||
'rmagatti/auto-session',
|
||||
'nvim-telescope/telescope.nvim'
|
||||
},
|
||||
init = function()
|
||||
vim.keymap.set('n', '<leader>p', function() require('session-lens').search_session() end)
|
||||
end,
|
||||
config = function()
|
||||
require('session-lens').setup({
|
||||
prompt_title = 'Projects'
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
20
.config/nvim/lua/plugins/copilot.lua
Normal file
20
.config/nvim/lua/plugins/copilot.lua
Normal file
@ -0,0 +1,20 @@
|
||||
return {
|
||||
{
|
||||
"github/copilot.vim",
|
||||
event = {
|
||||
"BufReadPost",
|
||||
"BufNewFile"
|
||||
},
|
||||
cmd = {
|
||||
"Copilot"
|
||||
},
|
||||
init = function()
|
||||
vim.g.copilot_no_tab_map = true
|
||||
vim.g.copilot_assume_mapped = true
|
||||
vim.api.nvim_set_keymap("i", "<C-y>", 'copilot#Accept("<CR>")', {
|
||||
silent = true,
|
||||
expr = true
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
6
.config/nvim/lua/plugins/dressing.lua
Normal file
6
.config/nvim/lua/plugins/dressing.lua
Normal file
@ -0,0 +1,6 @@
|
||||
return {
|
||||
{
|
||||
'stevearc/dressing.nvim',
|
||||
event = 'VimEnter'
|
||||
}
|
||||
}
|
||||
22
.config/nvim/lua/plugins/git.lua
Normal file
22
.config/nvim/lua/plugins/git.lua
Normal file
@ -0,0 +1,22 @@
|
||||
return {
|
||||
{
|
||||
'tpope/vim-fugitive',
|
||||
cmd = {
|
||||
"Git"
|
||||
},
|
||||
init = function() vim.keymap.set("n", "<leader>gs", vim.cmd.Git) end
|
||||
},
|
||||
{
|
||||
'rbong/vim-flog',
|
||||
cmd = {
|
||||
"Flog",
|
||||
"Floggit",
|
||||
"Flogsplit"
|
||||
},
|
||||
dependencies = {
|
||||
{
|
||||
'tpope/vim-fugitive'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
.config/nvim/lua/plugins/harpoon.lua
Normal file
21
.config/nvim/lua/plugins/harpoon.lua
Normal file
@ -0,0 +1,21 @@
|
||||
return {
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
-- branch = "harpoon2",
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-lua/plenary.nvim"
|
||||
}
|
||||
},
|
||||
init = function()
|
||||
vim.keymap.set("n", "<C-e>", function() require("harpoon.ui").toggle_quick_menu() end)
|
||||
vim.keymap.set("n", "<leader>a", function() require("harpoon.mark").add_file() end)
|
||||
|
||||
vim.keymap.set("n", "<C-h>", function() require("harpoon.ui").nav_file(1) end)
|
||||
vim.keymap.set("n", "<C-t>", function() require("harpoon.ui").nav_file(2) end)
|
||||
vim.keymap.set("n", "<C-n>", function() require("harpoon.ui").nav_file(3) end)
|
||||
vim.keymap.set("n", "<C-s>", function() require("harpoon.ui").nav_file(4) end)
|
||||
end
|
||||
}
|
||||
|
||||
}
|
||||
6
.config/nvim/lua/plugins/lazy.lua
Normal file
6
.config/nvim/lua/plugins/lazy.lua
Normal file
@ -0,0 +1,6 @@
|
||||
return {
|
||||
{
|
||||
"folke/lazy.nvim",
|
||||
tag = "stable"
|
||||
}
|
||||
}
|
||||
182
.config/nvim/lua/plugins/lsp.lua
Normal file
182
.config/nvim/lua/plugins/lsp.lua
Normal file
@ -0,0 +1,182 @@
|
||||
return {
|
||||
{
|
||||
{
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
branch = 'v3.x',
|
||||
lazy = true,
|
||||
config = false,
|
||||
init = function()
|
||||
-- Disable automatic setup, we are doing it manually
|
||||
vim.g.lsp_zero_extend_cmp = 0
|
||||
vim.g.lsp_zero_extend_lspconfig = 0
|
||||
end
|
||||
},
|
||||
{
|
||||
'williamboman/mason.nvim',
|
||||
lazy = false,
|
||||
config = true
|
||||
},
|
||||
|
||||
-- Autocompletion
|
||||
{
|
||||
'hrsh7th/nvim-cmp',
|
||||
event = 'InsertEnter',
|
||||
dependencies = {
|
||||
'L3MON4D3/LuaSnip',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-cmdline',
|
||||
'hrsh7th/cmp-nvim-lsp-signature-help',
|
||||
'saadparwaiz1/cmp_luasnip'
|
||||
},
|
||||
config = function()
|
||||
local lsp_zero = require('lsp-zero')
|
||||
lsp_zero.extend_cmp()
|
||||
|
||||
local cmp = require('cmp')
|
||||
|
||||
cmp.setup({
|
||||
sources = {
|
||||
{
|
||||
name = 'path'
|
||||
},
|
||||
{
|
||||
name = 'nvim_lsp'
|
||||
},
|
||||
{
|
||||
name = 'nvim_lua'
|
||||
},
|
||||
{
|
||||
name = 'luasnip',
|
||||
keyword_length = 2
|
||||
},
|
||||
{
|
||||
name = 'buffer',
|
||||
keyword_length = 3
|
||||
},
|
||||
{
|
||||
name = 'nvim_lsp_signature_help'
|
||||
}
|
||||
},
|
||||
formatting = lsp_zero.cmp_format(),
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<Tab>'] = cmp.mapping.confirm({
|
||||
select = true
|
||||
}),
|
||||
['<C-Space>'] = cmp.mapping.complete()
|
||||
}),
|
||||
snippet = {
|
||||
expand = function(args) require('luasnip').lsp_expand(args.body) end
|
||||
}
|
||||
})
|
||||
|
||||
cmp.setup.filetype('gitcommit', {
|
||||
sources = cmp.config.sources({
|
||||
{
|
||||
name = 'git'
|
||||
}
|
||||
}, {
|
||||
{
|
||||
name = 'buffer'
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
cmp.setup.cmdline({
|
||||
'/',
|
||||
'?'
|
||||
}, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{
|
||||
name = 'buffer'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{
|
||||
name = 'path'
|
||||
}
|
||||
}, {
|
||||
{
|
||||
name = 'cmdline'
|
||||
}
|
||||
})
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
-- LSP
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
cmd = {
|
||||
'LspInfo',
|
||||
'LspInstall',
|
||||
'LspStart'
|
||||
},
|
||||
event = {
|
||||
'BufReadPre',
|
||||
'BufNewFile'
|
||||
},
|
||||
dependencies = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'folke/trouble.nvim' -- required for the current config
|
||||
},
|
||||
config = function()
|
||||
local lsp_zero = require('lsp-zero')
|
||||
lsp_zero.extend_lspconfig()
|
||||
|
||||
lsp_zero.on_attach(function(client, bufnr)
|
||||
local opts = {
|
||||
buffer = bufnr,
|
||||
remap = false
|
||||
}
|
||||
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
|
||||
-- vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", "<cmd>Trouble lsp_references<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-p>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
vim.keymap.set("n", "<M-cr>", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("i", "<M-cr>", function() vim.lsp.buf.code_action() end, opts)
|
||||
end)
|
||||
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {
|
||||
'clangd',
|
||||
'pyright',
|
||||
'cmake',
|
||||
'texlab'
|
||||
},
|
||||
handlers = {
|
||||
lsp_zero.default_setup,
|
||||
lua_ls = function()
|
||||
local lua_opts = lsp_zero.nvim_lua_ls()
|
||||
require('lspconfig').lua_ls.setup(lua_opts)
|
||||
end
|
||||
}
|
||||
})
|
||||
|
||||
require('lspconfig')['clangd'].setup {
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--query-driver=/**/*g++",
|
||||
"--offset-encoding=utf-16"
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
}
|
||||
}
|
||||
18
.config/nvim/lua/plugins/lualine.lua
Normal file
18
.config/nvim/lua/plugins/lualine.lua
Normal file
@ -0,0 +1,18 @@
|
||||
return {
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
event = "VimEnter",
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
},
|
||||
opts = {
|
||||
extensions = {
|
||||
'nvim-tree',
|
||||
'trouble',
|
||||
'mason',
|
||||
'lazy',
|
||||
'toggleterm'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
48
.config/nvim/lua/plugins/luasnip.lua
Normal file
48
.config/nvim/lua/plugins/luasnip.lua
Normal file
@ -0,0 +1,48 @@
|
||||
return {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
dependencies = {
|
||||
{
|
||||
'rafamadriz/friendly-snippets'
|
||||
}
|
||||
},
|
||||
version = "v2.*",
|
||||
build = "make install_jsregexp",
|
||||
event = {
|
||||
"InsertEnter"
|
||||
},
|
||||
init = function()
|
||||
vim.keymap.set({
|
||||
"i"
|
||||
}, "<c-j>", function() require("luasnip").expand() end, {
|
||||
silent = true
|
||||
})
|
||||
vim.keymap.set({
|
||||
"i",
|
||||
"s"
|
||||
}, "<c-j>", function() require("luasnip").jump(1) end, {
|
||||
silent = true
|
||||
})
|
||||
vim.keymap.set({
|
||||
"i",
|
||||
"s"
|
||||
}, "<c-k>", function() require("luasnip").jump(-1) end, {
|
||||
silent = true
|
||||
})
|
||||
|
||||
end,
|
||||
config = function()
|
||||
local loader = require("luasnip.loaders.from_lua")
|
||||
loader.lazy_load({
|
||||
paths = {
|
||||
"./snippets"
|
||||
}
|
||||
})
|
||||
|
||||
require("luasnip").config.set_config({
|
||||
enable_autosnippets = true,
|
||||
store_selection_keys = "<leader>v"
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
15
.config/nvim/lua/plugins/markdown_preview.lua
Normal file
15
.config/nvim/lua/plugins/markdown_preview.lua
Normal file
@ -0,0 +1,15 @@
|
||||
return {
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = {
|
||||
"MarkdownPreviewToggle",
|
||||
"MarkdownPreview",
|
||||
"MarkdownPreviewStop"
|
||||
},
|
||||
ft = {
|
||||
"markdown"
|
||||
},
|
||||
build = function() vim.fn["mkdp#util#install"]() end
|
||||
}
|
||||
|
||||
}
|
||||
33
.config/nvim/lua/plugins/molten.lua
Normal file
33
.config/nvim/lua/plugins/molten.lua
Normal file
@ -0,0 +1,33 @@
|
||||
return {
|
||||
{
|
||||
"benlubas/molten-nvim",
|
||||
build = ":UpdateRemotePlugins",
|
||||
version = "v1.7.0",
|
||||
init = function()
|
||||
vim.keymap.set("n", "<localleader>mi", ":MoltenInit<CR>", {
|
||||
silent = true,
|
||||
desc = "Initialize the plugin"
|
||||
})
|
||||
vim.keymap.set("n", "<localleader>e", ":MoltenEvaluateOperator<CR>", {
|
||||
silent = true,
|
||||
desc = "run operator selection"
|
||||
})
|
||||
vim.keymap.set("n", "<localleader>rl", ":MoltenEvaluateLine<CR>", {
|
||||
silent = true,
|
||||
desc = "evaluate line"
|
||||
})
|
||||
vim.keymap.set("n", "<localleader>rr", ":MoltenReevaluateCell<CR>", {
|
||||
silent = true,
|
||||
desc = "re-evaluate cell"
|
||||
})
|
||||
vim.keymap.set("v", "<localleader>r", ":<C-u>MoltenEvaluateVisual<CR>gv", {
|
||||
silent = true,
|
||||
desc = "evaluate visual selection"
|
||||
})
|
||||
|
||||
vim.g.molten_auto_open_output = false
|
||||
vim.g.molten_virt_text_output = true
|
||||
vim.g.molten_virt_text_max_lines = 32
|
||||
end
|
||||
}
|
||||
}
|
||||
37
.config/nvim/lua/plugins/neoformat.lua
Normal file
37
.config/nvim/lua/plugins/neoformat.lua
Normal file
@ -0,0 +1,37 @@
|
||||
return {
|
||||
{
|
||||
'sbdchd/neoformat',
|
||||
event = {
|
||||
"BufReadPost",
|
||||
"BufNewFile"
|
||||
},
|
||||
init = function()
|
||||
vim.cmd([[
|
||||
let g:neoformat_enabled_python = ['autopep8']
|
||||
let g:neoformat_enabled_cpp = ['clangformat']
|
||||
let g:neoformat_enabled_c = ['clangformat']
|
||||
let g:neoformat_enable_lua = ['luaformatter']
|
||||
let g:neoformat_enabled_cmake = ['cmakeformat']
|
||||
|
||||
let g:neoformat_markdown_mdformat = {
|
||||
\ 'exe': 'mdformat',
|
||||
\ 'args': ['--wrap=79'],
|
||||
\ 'replace': 1,
|
||||
\ }
|
||||
let g:neoformat_enabled_markdown = ['mdformat']
|
||||
|
||||
let g:neoformat_enabled_latex = ['latexindent']
|
||||
let g:latexindent_opt="-m -l -g=/dev/null"
|
||||
]])
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<M-L>', '<cmd>Neoformat<cr>', {
|
||||
noremap = true,
|
||||
silent = true
|
||||
})
|
||||
vim.api.nvim_set_keymap('i', '<M-L>', '<cmd>Neoformat<cr>', {
|
||||
noremap = true,
|
||||
silent = true
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
14
.config/nvim/lua/plugins/nvim_tree.lua
Normal file
14
.config/nvim/lua/plugins/nvim_tree.lua
Normal file
@ -0,0 +1,14 @@
|
||||
return {
|
||||
{
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
cmd = {
|
||||
"NvimTreeToggle",
|
||||
"NvimTreeFocus"
|
||||
},
|
||||
init = function()
|
||||
vim.opt.termguicolors = true
|
||||
vim.keymap.set('n', '<leader>t', '<cmd>NvimTreeToggle<cr>', {noremap = true, silent = true})
|
||||
end,
|
||||
config = function() require("nvim-tree").setup() end
|
||||
}
|
||||
}
|
||||
6
.config/nvim/lua/plugins/surround.lua
Normal file
6
.config/nvim/lua/plugins/surround.lua
Normal file
@ -0,0 +1,6 @@
|
||||
return {
|
||||
{
|
||||
"tpope/vim-surround",
|
||||
event = "InsertEnter"
|
||||
}
|
||||
}
|
||||
50
.config/nvim/lua/plugins/telescope.lua
Normal file
50
.config/nvim/lua/plugins/telescope.lua
Normal file
@ -0,0 +1,50 @@
|
||||
-- -----------------
|
||||
-- -- Helper Functions
|
||||
-- -------------------
|
||||
-- -- If in a git repo, execute the given function with the option
|
||||
-- -- "cwd=<git root>". Otherwise, execute the function with no options.
|
||||
-- local function execute_in_repo_root(func)
|
||||
-- local function is_git_repo()
|
||||
-- vim.fn.system("git rev-parse --is-inside-work-tree")
|
||||
--
|
||||
-- return vim.v.shell_error == 0
|
||||
-- end
|
||||
--
|
||||
-- local function get_git_root()
|
||||
-- local dot_git_path = vim.fn.finddir(".git", ".;")
|
||||
-- return vim.fn.fnamemodify(dot_git_path, ":h")
|
||||
-- end
|
||||
--
|
||||
-- local opts = {}
|
||||
--
|
||||
-- if is_git_repo() then opts = {cwd = get_git_root()} end
|
||||
--
|
||||
-- func(opts)
|
||||
-- end
|
||||
-----------------------
|
||||
-- Plugin Configuration
|
||||
-----------------------
|
||||
return {
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
version = '0.1.5',
|
||||
dependencies = {
|
||||
{
|
||||
'nvim-lua/plenary.nvim'
|
||||
}
|
||||
},
|
||||
cmd = "Telescope",
|
||||
init = function()
|
||||
-- LuaFormatter off
|
||||
vim.keymap.set('n', '<leader>ff', function() require("telescope.builtin").find_files() end,{desc = "Telescope find files"})
|
||||
vim.keymap.set('n', '<leader>fg', function() require("telescope.builtin").live_grep() end,{desc = "Telescope live grep"})
|
||||
vim.keymap.set('n', '<leader>fa', function()
|
||||
require("telescope.builtin").find_files({hidden = true})
|
||||
end, {desc = "Telescope find all files"})
|
||||
|
||||
vim.keymap.set('n', '<leader>fb', function() require("telescope.builtin").buffers() end, {desc = "Telescope buffers"})
|
||||
vim.keymap.set('n', '<leader>fh', function() require("telescope.builtin").help_tags() end, {desc = "Telescope help tags"})
|
||||
-- LuaFormatter on
|
||||
end
|
||||
}
|
||||
}
|
||||
45
.config/nvim/lua/plugins/themes.lua
Normal file
45
.config/nvim/lua/plugins/themes.lua
Normal file
@ -0,0 +1,45 @@
|
||||
return {
|
||||
-- {'doums/darcula', config = function() vim.cmd('colorscheme darcula') end}
|
||||
-- {
|
||||
-- "folke/tokyonight.nvim",
|
||||
-- lazy = false,
|
||||
-- priority = 1000,
|
||||
-- opts = {},
|
||||
-- config = function() vim.cmd('colorscheme tokyonight-moon') end
|
||||
-- }
|
||||
-- {
|
||||
-- 'rose-pine/neovim',
|
||||
-- config = function() vim.cmd('colorscheme rose-pine-moon') end
|
||||
-- }
|
||||
-- {
|
||||
-- 'AlexvZyl/nordic.nvim',
|
||||
-- lazy = false,
|
||||
-- priority = 1000,
|
||||
-- init = function()
|
||||
-- require('nordic').setup {
|
||||
-- telescope = {
|
||||
-- style = 'classic'
|
||||
-- -- style = 'flat'
|
||||
-- }
|
||||
-- }
|
||||
-- require'nordic'.load()
|
||||
-- end
|
||||
-- }
|
||||
-- {
|
||||
-- "briones-gabriel/darcula-solid.nvim",
|
||||
-- dependencies = "rktjmp/lush.nvim",
|
||||
-- config = function()
|
||||
-- vim.cmd 'colorscheme darcula-solid'
|
||||
-- vim.cmd 'set termguicolors'
|
||||
-- end
|
||||
-- }
|
||||
{
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
priority = 1000,
|
||||
config = true,
|
||||
opts = {
|
||||
contrast = "hard"
|
||||
},
|
||||
init = function() vim.cmd("colorscheme gruvbox") end
|
||||
}
|
||||
}
|
||||
9
.config/nvim/lua/plugins/todo_comments.lua
Normal file
9
.config/nvim/lua/plugins/todo_comments.lua
Normal file
@ -0,0 +1,9 @@
|
||||
return {
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim"
|
||||
},
|
||||
opts = {}
|
||||
}
|
||||
}
|
||||
21
.config/nvim/lua/plugins/toggleterm.lua
Normal file
21
.config/nvim/lua/plugins/toggleterm.lua
Normal file
@ -0,0 +1,21 @@
|
||||
return {
|
||||
{
|
||||
"akinsho/toggleterm.nvim",
|
||||
version = '*',
|
||||
opts = {
|
||||
size = 30,
|
||||
open_mapping = [[<c-\>]]
|
||||
},
|
||||
cmd = {
|
||||
"ToggleTerm",
|
||||
"TermExec",
|
||||
"ToggleTermToggleAll",
|
||||
"ToggleTermSendCurrentLine",
|
||||
"ToggleTermSendVisualLines",
|
||||
"ToggleTermSendVisualSelection"
|
||||
},
|
||||
keys = {
|
||||
[[<c-\>]]
|
||||
}
|
||||
}
|
||||
}
|
||||
39
.config/nvim/lua/plugins/treesitter.lua
Normal file
39
.config/nvim/lua/plugins/treesitter.lua
Normal file
@ -0,0 +1,39 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = {
|
||||
"BufReadPost",
|
||||
"BufNewFile"
|
||||
},
|
||||
cmd = {
|
||||
"TSInstall",
|
||||
"TSBufEnable",
|
||||
"TSBufDisable",
|
||||
"TSModuleInfo",
|
||||
"TSInstallSync"
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"cpp",
|
||||
"c",
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"query"
|
||||
},
|
||||
sync_install = false,
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
disable = {
|
||||
"latex"
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
47
.config/nvim/lua/plugins/trouble.lua
Normal file
47
.config/nvim/lua/plugins/trouble.lua
Normal file
@ -0,0 +1,47 @@
|
||||
return {
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
{
|
||||
'folke/lsp-colors.nvim'
|
||||
},
|
||||
{
|
||||
'nvim-telescope/telescope.nvim'
|
||||
}
|
||||
},
|
||||
cmd = {
|
||||
"Trouble",
|
||||
"TroubleClose",
|
||||
"TroubleToggle",
|
||||
"TroubleRefresh"
|
||||
},
|
||||
init = function()
|
||||
vim.keymap.set("n", "<leader>xx", function() require("trouble").toggle() end)
|
||||
vim.keymap.set("n", "<leader>xw", function() require("trouble").toggle("workspace_diagnostics") end)
|
||||
vim.keymap.set("n", "<leader>xd", function() require("trouble").toggle("document_diagnostics") end)
|
||||
vim.keymap.set("n", "<leader>xq", function() require("trouble").toggle("quickfix") end)
|
||||
vim.keymap.set("n", "<leader>xl", function() require("trouble").toggle("loclist") end)
|
||||
vim.keymap.set("n", "gR", function() require("trouble").toggle("lsp_references") end)
|
||||
end,
|
||||
config = function()
|
||||
local trouble_provider = require("trouble.providers.telescope")
|
||||
local telescope = require("telescope")
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<c-t>"] = trouble_provider.open_with_trouble
|
||||
},
|
||||
n = {
|
||||
["<c-t>"] = trouble_provider.open_with_trouble
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
}
|
||||
13
.config/nvim/lua/plugins/undotree.lua
Normal file
13
.config/nvim/lua/plugins/undotree.lua
Normal file
@ -0,0 +1,13 @@
|
||||
return {
|
||||
{
|
||||
'mbbill/undotree',
|
||||
cmd = {
|
||||
"UndotreeToggle",
|
||||
"UndotreeHide",
|
||||
"UndotreeShow",
|
||||
"UndotreeFocus",
|
||||
"UndotreePersistUndo"
|
||||
},
|
||||
init = function() vim.keymap.set("n", "<leader>u", "<cmd>UndotreeToggle<CR>") end
|
||||
}
|
||||
}
|
||||
27
.config/nvim/lua/remap.lua
Normal file
27
.config/nvim/lua/remap.lua
Normal file
@ -0,0 +1,27 @@
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
vim.keymap.set("x", "<leader>p", "\"_dP")
|
||||
vim.keymap.set("n", "<leader>d", "\"_d")
|
||||
vim.keymap.set("v", "<leader>d", "\"_d")
|
||||
|
||||
vim.keymap.set("n", "<leader>y", "\"+y")
|
||||
vim.keymap.set("v", "<leader>y", "\"+y")
|
||||
vim.keymap.set("n", "<leader>Y", "\"+Y")
|
||||
|
||||
vim.keymap.set("n", "Q", "<nop>")
|
||||
vim.keymap.set("n", "q:", "<nop>")
|
||||
vim.cmd [[call nvim_create_user_command('W', 'w', {'nargs': 0})]]
|
||||
|
||||
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
|
||||
vim.keymap.set("n", "<leader>cb", [[:up | %bd | e#<CR>]])
|
||||
|
||||
-- vim.keymap.set('n', '<leader><C-s>', '<cmd>mksession! .nvim_session<CR>', {})
|
||||
-- vim.keymap
|
||||
-- .set('n', '<leader><C-l>', '<cmd>silent! source .nvim_session<CR>', {})
|
||||
28
.config/nvim/lua/set.lua
Normal file
28
.config/nvim/lua/set.lua
Normal file
@ -0,0 +1,28 @@
|
||||
vim.g.mapleader = " "
|
||||
|
||||
vim.opt.nu = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.opt.smartindent = true
|
||||
|
||||
vim.opt.wrap = false
|
||||
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.backup = false
|
||||
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||
vim.opt.undofile = true
|
||||
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.signcolumn = "yes"
|
||||
|
||||
vim.opt.updatetime = 50
|
||||
191
.config/nvim/snippets/tex/general.lua
Normal file
191
.config/nvim/snippets/tex/general.lua
Normal file
@ -0,0 +1,191 @@
|
||||
----------------
|
||||
-- Abbreviations
|
||||
----------------
|
||||
|
||||
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local d = ls.dynamic_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
local fmta = require("luasnip.extras.fmt").fmta
|
||||
local rep = require("luasnip.extras").rep
|
||||
local line_begin = require("luasnip.extras.expand_conditions").line_begin
|
||||
|
||||
---------------
|
||||
-- Environments
|
||||
---------------
|
||||
|
||||
|
||||
local tex_utils = {}
|
||||
|
||||
tex_utils.in_mathzone = function() -- math context detection
|
||||
return vim.fn['vimtex#syntax#in_mathzone']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_text = function()
|
||||
return not tex_utils.in_mathzone()
|
||||
end
|
||||
|
||||
tex_utils.in_comment = function() -- comment detection
|
||||
return vim.fn['vimtex#syntax#in_comment']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_env = function(name) -- generic environment detection
|
||||
local is_inside = vim.fn['vimtex#env#is_inside'](name)
|
||||
return (is_inside[1] > 0 and is_inside[2] > 0)
|
||||
end
|
||||
|
||||
local get_visual = function(args, parent)
|
||||
if (#parent.snippet.env.LS_SELECT_RAW > 0) then
|
||||
return sn(nil, i(1, parent.snippet.env.LS_SELECT_RAW))
|
||||
else
|
||||
return sn(nil, i(1))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-----------
|
||||
-- Snippets
|
||||
-----------
|
||||
|
||||
|
||||
return {
|
||||
|
||||
|
||||
s({trig="notes"},
|
||||
fmta(
|
||||
[[
|
||||
\documentclass[dvipsnames]{article}
|
||||
|
||||
\usepackage{float}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{amsfonts}
|
||||
\usepackage{mleftright}
|
||||
\usepackage{bm}
|
||||
\usepackage{tikz}
|
||||
\usepackage{xcolor}
|
||||
\usepackage{pgfplots}
|
||||
\pgfplotsset{compat=newest}
|
||||
|
||||
\title{<>}
|
||||
\author{<>}
|
||||
\date{<>}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
<>
|
||||
\end{document}
|
||||
]],
|
||||
{
|
||||
i(1, "Notes"),
|
||||
i(2, "Andreas Tsouchlos"),
|
||||
i(3, os.date("%d.%m.%y")),
|
||||
i(0),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="beg"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{<>}
|
||||
<>
|
||||
\end{<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(2),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="sec"},
|
||||
fmta(
|
||||
[[
|
||||
\section{<>}
|
||||
\label{sec:<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="ssec"},
|
||||
fmta(
|
||||
[[
|
||||
\subsection{<>}
|
||||
\label{subsec:<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="sssec"},
|
||||
fmta(
|
||||
[[
|
||||
\subsubsection{<>}
|
||||
\label{subsubsec:<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="csec"},
|
||||
fmta(
|
||||
[[
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\section{<>}
|
||||
\label{sec:<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="cssec"},
|
||||
fmta(
|
||||
[[
|
||||
%%%%%%%%%%%%%%%%
|
||||
\subsection{<>}
|
||||
\label{subsec:<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="csssec"},
|
||||
fmta(
|
||||
[[
|
||||
%%%%%%%%
|
||||
\subsubsection{<>}
|
||||
\label{subsubsec:<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
|
||||
} -- return
|
||||
|
||||
439
.config/nvim/snippets/tex/greek.lua
Normal file
439
.config/nvim/snippets/tex/greek.lua
Normal file
@ -0,0 +1,439 @@
|
||||
----------------
|
||||
-- Abbreviations
|
||||
----------------
|
||||
|
||||
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local d = ls.dynamic_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
local fmta = require("luasnip.extras.fmt").fmta
|
||||
local rep = require("luasnip.extras").rep
|
||||
|
||||
|
||||
---------------
|
||||
-- Environments
|
||||
---------------
|
||||
|
||||
|
||||
local tex_utils = {}
|
||||
|
||||
tex_utils.in_mathzone = function() -- math context detection
|
||||
return vim.fn['vimtex#syntax#in_mathzone']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_text = function()
|
||||
return not tex_utils.in_mathzone()
|
||||
end
|
||||
|
||||
tex_utils.in_comment = function() -- comment detection
|
||||
return vim.fn['vimtex#syntax#in_comment']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_env = function(name) -- generic environment detection
|
||||
local is_inside = vim.fn['vimtex#env#is_inside'](name)
|
||||
return (is_inside[1] > 0 and is_inside[2] > 0)
|
||||
end
|
||||
|
||||
local get_visual = function(args, parent)
|
||||
if (#parent.snippet.env.LS_SELECT_RAW > 0) then
|
||||
return sn(nil, i(1, parent.snippet.env.LS_SELECT_RAW))
|
||||
else
|
||||
return sn(nil, i(1))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-----------
|
||||
-- Snippets
|
||||
-----------
|
||||
|
||||
|
||||
return {
|
||||
|
||||
|
||||
s({trig="´a", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\alpha ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´b", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\beta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´g", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\gamma ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´d", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\delta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´e", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\epsilon ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´z", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\zeta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´h", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\eta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´q", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\theta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´i", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\iota ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´k", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\kappa ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´l", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\lambda ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´m", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\mu ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´n", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\nu ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´x", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\xi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´p", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\pi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´r", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\rho ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´s", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\sigma ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´t", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\tau ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´u", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\upsilon ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´f", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\phi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´c", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\chi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´y", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\psi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´w", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\omega ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´A", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Alpha ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´B", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Beta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´G", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Gamma ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´D", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Delta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´E", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Epsilon ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´Z", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Zeta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´H", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Eta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´Q", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Theta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´I", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Iota ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´K", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Kappa ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´L", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Lambda ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´M", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Mu ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´N", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Nu ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´X", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Xi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´P", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Pi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´R", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Rho ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´S", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Sigma ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´T", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Tau ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´U", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Upsilon ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´F", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Phi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´C", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Chi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´Y", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Psi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´W", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Omega ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
|
||||
-- Strictly speaking not greek characters, but very similar snippets
|
||||
|
||||
s({trig="´6", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\partial ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
} -- return
|
||||
|
||||
402
.config/nvim/snippets/tex/math.lua
Normal file
402
.config/nvim/snippets/tex/math.lua
Normal file
@ -0,0 +1,402 @@
|
||||
----------------
|
||||
-- Abbreviations
|
||||
----------------
|
||||
|
||||
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local d = ls.dynamic_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
local fmta = require("luasnip.extras.fmt").fmta
|
||||
local rep = require("luasnip.extras").rep
|
||||
|
||||
|
||||
---------------
|
||||
-- Environments
|
||||
---------------
|
||||
|
||||
|
||||
local tex_utils = {}
|
||||
|
||||
tex_utils.in_mathzone = function() -- math context detection
|
||||
return vim.fn['vimtex#syntax#in_mathzone']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_text = function()
|
||||
return not tex_utils.in_mathzone()
|
||||
end
|
||||
|
||||
tex_utils.in_comment = function() -- comment detection
|
||||
return vim.fn['vimtex#syntax#in_comment']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_env = function(name) -- generic environment detection
|
||||
local is_inside = vim.fn['vimtex#env#is_inside'](name)
|
||||
return (is_inside[1] > 0 and is_inside[2] > 0)
|
||||
end
|
||||
|
||||
local get_visual = function(args, parent)
|
||||
if (#parent.snippet.env.LS_SELECT_RAW > 0) then
|
||||
return sn(nil, i(1, parent.snippet.env.LS_SELECT_RAW))
|
||||
else
|
||||
return sn(nil, i(1))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-----------
|
||||
-- Snippets
|
||||
-----------
|
||||
|
||||
|
||||
return {
|
||||
|
||||
|
||||
s({trig="ali", snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{align*}
|
||||
<>
|
||||
<>%
|
||||
\end{align*}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
i(1, "."),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="cases"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{cases}
|
||||
<>
|
||||
\end{cases}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="matb"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{bmatrix}
|
||||
<>
|
||||
\end{bmatrix}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="matp"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{pmatrix}
|
||||
<>
|
||||
\end{pmatrix}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig='([^%a])int', regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\int_{<>}^{<>} <> d<> ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1, "-\\infty"),
|
||||
i(2, "\\infty"),
|
||||
i(4),
|
||||
i(3, "x"),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig='([^%a])prod', regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\prod_{<>}^{<>} ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1, "-\\infty"),
|
||||
i(2, "\\infty"),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig='([^%a])sum', regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\sum_{<>}^{<>} ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1, "n=0"),
|
||||
i(2, "N-1"),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig='([^%a])sqrt', regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\sqrt{<>} ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig='([^%a])log', regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\log_{<>} ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1, "2"),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig='([^%a])ln', regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\ln ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig = '([^%a])ff', regTrig = true, wordTrig = false, snippetType = "autosnippet"},
|
||||
fmta(
|
||||
[[<>\frac{<>}{<>} ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
i(2)
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])mcal", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\mathcal{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])mbb", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\mathbb{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])tt", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\text{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig=".", snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\cdot ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="$$", snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[$<>$]],
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])bm", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\bm{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="__", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[_{<>}]],
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="^^", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[^{<>}]],
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])oo", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\infty]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="((", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\mleft( <> \mright)]],
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="[[", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
"\\mleft[ <> \\mright]",
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="{{", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
"\\mleft\\{ <> \\mright\\}",
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="||", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
"\\lvert <> \\rvert ",
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])hat", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\hat{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])tld", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\tilde{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])bar", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\overline{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([%a])([%d])", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>_<>]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
f( function(_, snip) return snip.captures[2] end ),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="=>", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Rightarrow ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="->", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\rightarrow ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])nab", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\nabla ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
|
||||
} -- return
|
||||
|
||||
132
.config/nvim/snippets/tex/plotting.lua
Normal file
132
.config/nvim/snippets/tex/plotting.lua
Normal file
@ -0,0 +1,132 @@
|
||||
----------------
|
||||
-- Abbreviations
|
||||
----------------
|
||||
|
||||
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local d = ls.dynamic_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
local fmta = require("luasnip.extras.fmt").fmta
|
||||
local rep = require("luasnip.extras").rep
|
||||
|
||||
|
||||
---------------
|
||||
-- Environments
|
||||
---------------
|
||||
|
||||
|
||||
local tex_utils = {}
|
||||
|
||||
tex_utils.in_mathzone = function() -- math context detection
|
||||
return vim.fn['vimtex#syntax#in_mathzone']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_text = function()
|
||||
return not tex_utils.in_mathzone()
|
||||
end
|
||||
|
||||
tex_utils.in_comment = function() -- comment detection
|
||||
return vim.fn['vimtex#syntax#in_comment']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_env = function(name) -- generic environment detection
|
||||
local is_inside = vim.fn['vimtex#env#is_inside'](name)
|
||||
return (is_inside[1] > 0 and is_inside[2] > 0)
|
||||
end
|
||||
|
||||
local get_visual = function(args, parent)
|
||||
if (#parent.snippet.env.LS_SELECT_RAW > 0) then
|
||||
return sn(nil, i(1, parent.snippet.env.LS_SELECT_RAW))
|
||||
else
|
||||
return sn(nil, i(1))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-----------
|
||||
-- Snippets
|
||||
-----------
|
||||
|
||||
|
||||
return {
|
||||
|
||||
|
||||
s({trig="funcplot"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
|
||||
\begin{tikzpicture}
|
||||
\begin{axis}[
|
||||
domain=<>,
|
||||
width=\textwidth,
|
||||
height=0.75\textwidth,
|
||||
]
|
||||
\addplot+[mark=none, line width=1pt]
|
||||
{<>};
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
\end{figure}
|
||||
]],
|
||||
{
|
||||
i(1, "-5:5"),
|
||||
i(2),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="csvplot"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
|
||||
\begin{tikzpicture}
|
||||
\begin{axis}[
|
||||
width=\textwidth,
|
||||
height=0.75\textwidth,
|
||||
]
|
||||
\addplot+[mark=none, line width=1pt]
|
||||
table[col sep=comma, x=<>, y=<>]
|
||||
{<>};
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
\end{figure}
|
||||
]],
|
||||
{
|
||||
i(1, "x"),
|
||||
i(2, "y"),
|
||||
i(3),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="fig"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
|
||||
<>
|
||||
|
||||
\caption{<>}
|
||||
\label{fig:<>}
|
||||
\end{figure}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
i(1),
|
||||
i(2),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
|
||||
} -- return
|
||||
|
||||
415
.config/picom/picom.conf
Normal file
415
.config/picom/picom.conf
Normal file
@ -0,0 +1,415 @@
|
||||
#################################
|
||||
# Shadows #
|
||||
#################################
|
||||
|
||||
|
||||
# Enabled client-side shadows on windows. Note desktop windows
|
||||
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
|
||||
# unless explicitly requested using the wintypes option.
|
||||
#
|
||||
# shadow = false
|
||||
shadow = true;
|
||||
|
||||
# The blur radius for shadows, in pixels. (defaults to 12)
|
||||
# shadow-radius = 12
|
||||
shadow-radius = 7;
|
||||
|
||||
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
|
||||
# shadow-opacity = .75
|
||||
|
||||
# The left offset for shadows, in pixels. (defaults to -15)
|
||||
# shadow-offset-x = -15
|
||||
shadow-offset-x = -7;
|
||||
|
||||
# The top offset for shadows, in pixels. (defaults to -15)
|
||||
# shadow-offset-y = -15
|
||||
shadow-offset-y = -7;
|
||||
|
||||
# Red color value of shadow (0.0 - 1.0, defaults to 0).
|
||||
# shadow-red = 0
|
||||
|
||||
# Green color value of shadow (0.0 - 1.0, defaults to 0).
|
||||
# shadow-green = 0
|
||||
|
||||
# Blue color value of shadow (0.0 - 1.0, defaults to 0).
|
||||
# shadow-blue = 0
|
||||
|
||||
# Hex string color value of shadow (#000000 - #FFFFFF, defaults to #000000). This option will override options set shadow-(red/green/blue)
|
||||
# shadow-color = "#000000"
|
||||
|
||||
# Specify a list of conditions of windows that should have no shadow.
|
||||
#
|
||||
# examples:
|
||||
# shadow-exclude = "n:e:Notification";
|
||||
#
|
||||
# shadow-exclude = []
|
||||
shadow-exclude = [
|
||||
"name = 'Notification'",
|
||||
"class_g = 'Conky'",
|
||||
"class_g ?= 'Notify-osd'",
|
||||
"class_g = 'Cairo-clock'",
|
||||
"_GTK_FRAME_EXTENTS@:c"
|
||||
];
|
||||
|
||||
# Specify a list of conditions of windows that should have no shadow painted over, such as a dock window.
|
||||
# clip-shadow-above = []
|
||||
|
||||
# Specify a X geometry that describes the region in which shadow should not
|
||||
# be painted in, such as a dock window region. Use
|
||||
# shadow-exclude-reg = "x10+0+0"
|
||||
# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
|
||||
#
|
||||
# shadow-exclude-reg = ""
|
||||
|
||||
# Crop shadow of a window fully on a particular Xinerama screen to the screen.
|
||||
# xinerama-shadow-crop = false
|
||||
|
||||
|
||||
#################################
|
||||
# Fading #
|
||||
#################################
|
||||
|
||||
|
||||
# Fade windows in/out when opening/closing and when opacity changes,
|
||||
# unless no-fading-openclose is used.
|
||||
# fading = false
|
||||
fading = true;
|
||||
|
||||
# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
|
||||
# fade-in-step = 0.028
|
||||
fade-in-step = 0.03;
|
||||
|
||||
# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
|
||||
# fade-out-step = 0.03
|
||||
fade-out-step = 0.03;
|
||||
|
||||
# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
|
||||
# fade-delta = 10
|
||||
|
||||
# Specify a list of conditions of windows that should not be faded.
|
||||
# fade-exclude = []
|
||||
|
||||
# Do not fade on window open/close.
|
||||
# no-fading-openclose = false
|
||||
|
||||
# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
|
||||
# no-fading-destroyed-argb = false
|
||||
|
||||
|
||||
#################################
|
||||
# Transparency / Opacity #
|
||||
#################################
|
||||
|
||||
|
||||
# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
|
||||
# inactive-opacity = 1
|
||||
inactive-opacity = 1;
|
||||
|
||||
# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
|
||||
# frame-opacity = 1.0
|
||||
frame-opacity = 1;
|
||||
|
||||
# Let inactive opacity set by -i override the '_NET_WM_WINDOW_OPACITY' values of windows.
|
||||
# inactive-opacity-override = true
|
||||
inactive-opacity-override = false;
|
||||
|
||||
# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
|
||||
# active-opacity = 1.0
|
||||
|
||||
# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
|
||||
# inactive-dim = 0.0
|
||||
|
||||
# Specify a list of conditions of windows that should never be considered focused.
|
||||
# focus-exclude = []
|
||||
focus-exclude = [ "class_g = 'Cairo-clock'" ];
|
||||
|
||||
# Use fixed inactive dim value, instead of adjusting according to window opacity.
|
||||
# inactive-dim-fixed = 1.0
|
||||
|
||||
# Specify a list of opacity rules, in the format `PERCENT:PATTERN`,
|
||||
# like `50:name *= "Firefox"`. picom-trans is recommended over this.
|
||||
# Note we don't make any guarantee about possible conflicts with other
|
||||
# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
|
||||
# example:
|
||||
# opacity-rule = [ "80:class_g = 'URxvt'" ];
|
||||
#
|
||||
# opacity-rule = []
|
||||
|
||||
|
||||
#################################
|
||||
# Corners #
|
||||
#################################
|
||||
|
||||
# Sets the radius of rounded window corners. When > 0, the compositor will
|
||||
# round the corners of windows. Does not interact well with
|
||||
# `transparent-clipping`.
|
||||
corner-radius = 0
|
||||
round_borders = 1
|
||||
|
||||
# Exclude conditions for rounded corners.
|
||||
rounded-corners-exclude = [
|
||||
"window_type = 'dock'",
|
||||
"window_type = 'desktop'"
|
||||
];
|
||||
|
||||
|
||||
#################################
|
||||
# Background-Blurring #
|
||||
#################################
|
||||
|
||||
|
||||
# Parameters for background blurring, see the *BLUR* section for more information.
|
||||
# blur-method =
|
||||
# blur-size = 12
|
||||
#
|
||||
# blur-deviation = false
|
||||
#
|
||||
blur-strength = 7
|
||||
blur-method = "dual_kawase";
|
||||
|
||||
# Blur background of semi-transparent / ARGB windows.
|
||||
# Bad in performance, with driver-dependent behavior.
|
||||
# The name of the switch may change without prior notifications.
|
||||
#
|
||||
# blur-background = false
|
||||
|
||||
# Blur background of windows when the window frame is not opaque.
|
||||
# Implies:
|
||||
# blur-background
|
||||
# Bad in performance, with driver-dependent behavior. The name may change.
|
||||
#
|
||||
# blur-background-frame = false
|
||||
|
||||
|
||||
# Use fixed blur strength rather than adjusting according to window opacity.
|
||||
# blur-background-fixed = false
|
||||
|
||||
|
||||
# Specify the blur convolution kernel, with the following format:
|
||||
# example:
|
||||
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
|
||||
#
|
||||
# blur-kern = ""
|
||||
blur-kern = "3x3box";
|
||||
|
||||
|
||||
# Exclude conditions for background blur.
|
||||
# blur-background-exclude = []
|
||||
blur-background-exclude = [
|
||||
"window_type = 'dock'",
|
||||
"window_type = 'desktop'",
|
||||
"_GTK_FRAME_EXTENTS@:c"
|
||||
];
|
||||
|
||||
#################################
|
||||
# General Settings #
|
||||
#################################
|
||||
|
||||
# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
|
||||
# daemon = false
|
||||
|
||||
# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`.
|
||||
# `xrender` is the default one.
|
||||
#
|
||||
backend = "glx"
|
||||
#backend = "xrender";
|
||||
|
||||
# Enable/disable VSync.
|
||||
# vsync = false
|
||||
vsync = true;
|
||||
|
||||
# Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
|
||||
# dbus = false
|
||||
|
||||
# Try to detect WM windows (a non-override-redirect window with no
|
||||
# child that has 'WM_STATE') and mark them as active.
|
||||
#
|
||||
# mark-wmwin-focused = false
|
||||
mark-wmwin-focused = true;
|
||||
|
||||
# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused.
|
||||
# mark-ovredir-focused = false
|
||||
mark-ovredir-focused = true;
|
||||
|
||||
# Try to detect windows with rounded corners and don't consider them
|
||||
# shaped windows. The accuracy is not very high, unfortunately.
|
||||
#
|
||||
# detect-rounded-corners = false
|
||||
detect-rounded-corners = true;
|
||||
|
||||
# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers
|
||||
# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows.
|
||||
#
|
||||
# detect-client-opacity = false
|
||||
detect-client-opacity = true;
|
||||
|
||||
# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
|
||||
# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
|
||||
# provided that the WM supports it.
|
||||
#
|
||||
# use-ewmh-active-win = false
|
||||
|
||||
# Unredirect all windows if a full-screen opaque window is detected,
|
||||
# to maximize performance for full-screen windows. Known to cause flickering
|
||||
# when redirecting/unredirecting windows.
|
||||
#
|
||||
# unredir-if-possible = false
|
||||
|
||||
# Delay before unredirecting the window, in milliseconds. Defaults to 0.
|
||||
# unredir-if-possible-delay = 0
|
||||
|
||||
# Conditions of windows that shouldn't be considered full-screen for unredirecting screen.
|
||||
# unredir-if-possible-exclude = []
|
||||
|
||||
# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
|
||||
# in the same group focused at the same time.
|
||||
#
|
||||
# detect-transient = false
|
||||
detect-transient = true;
|
||||
|
||||
# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
|
||||
# group focused at the same time. This usually means windows from the same application
|
||||
# will be considered focused or unfocused at the same time.
|
||||
# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too.
|
||||
#
|
||||
# detect-client-leader = false
|
||||
|
||||
# Resize damaged region by a specific number of pixels.
|
||||
# A positive value enlarges it while a negative one shrinks it.
|
||||
# If the value is positive, those additional pixels will not be actually painted
|
||||
# to screen, only used in blur calculation, and such. (Due to technical limitations,
|
||||
# with use-damage, those pixels will still be incorrectly painted to screen.)
|
||||
# Primarily used to fix the line corruption issues of blur,
|
||||
# in which case you should use the blur radius value here
|
||||
# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`,
|
||||
# with a 5x5 one you use `--resize-damage 2`, and so on).
|
||||
# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly.
|
||||
#
|
||||
# resize-damage = 1
|
||||
|
||||
# Specify a list of conditions of windows that should be painted with inverted color.
|
||||
# Resource-hogging, and is not well tested.
|
||||
#
|
||||
# invert-color-include = []
|
||||
|
||||
# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer.
|
||||
# Might cause incorrect opacity when rendering transparent content (but never
|
||||
# practically happened) and may not work with blur-background.
|
||||
# My tests show a 15% performance boost. Recommended.
|
||||
#
|
||||
glx-no-stencil = true;
|
||||
|
||||
# GLX backend: Avoid rebinding pixmap on window damage.
|
||||
# Probably could improve performance on rapid window content changes,
|
||||
# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.).
|
||||
# Recommended if it works.
|
||||
#
|
||||
# glx-no-rebind-pixmap = false
|
||||
|
||||
# Disable the use of damage information.
|
||||
# This cause the whole screen to be redrawn everytime, instead of the part of the screen
|
||||
# has actually changed. Potentially degrades the performance, but might fix some artifacts.
|
||||
# The opposing option is use-damage
|
||||
#
|
||||
# no-use-damage = false
|
||||
use-damage = true;
|
||||
|
||||
# Use X Sync fence to sync clients' draw calls, to make sure all draw
|
||||
# calls are finished before picom starts drawing. Needed on nvidia-drivers
|
||||
# with GLX backend for some users.
|
||||
#
|
||||
# xrender-sync-fence = false
|
||||
|
||||
# GLX backend: Use specified GLSL fragment shader for rendering window contents.
|
||||
# See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl`
|
||||
# in the source tree for examples.
|
||||
#
|
||||
# glx-fshader-win = ""
|
||||
|
||||
# Force all windows to be painted with blending. Useful if you
|
||||
# have a glx-fshader-win that could turn opaque pixels transparent.
|
||||
#
|
||||
# force-win-blend = false
|
||||
|
||||
# Do not use EWMH to detect fullscreen windows.
|
||||
# Reverts to checking if a window is fullscreen based only on its size and coordinates.
|
||||
#
|
||||
# no-ewmh-fullscreen = false
|
||||
|
||||
# Dimming bright windows so their brightness doesn't exceed this set value.
|
||||
# Brightness of a window is estimated by averaging all pixels in the window,
|
||||
# so this could comes with a performance hit.
|
||||
# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0)
|
||||
#
|
||||
# max-brightness = 1.0
|
||||
|
||||
# Make transparent windows clip other windows like non-transparent windows do,
|
||||
# instead of blending on top of them.
|
||||
#
|
||||
# transparent-clipping = false
|
||||
|
||||
# Set the log level. Possible values are:
|
||||
# "trace", "debug", "info", "warn", "error"
|
||||
# in increasing level of importance. Case doesn't matter.
|
||||
# If using the "TRACE" log level, it's better to log into a file
|
||||
# using *--log-file*, since it can generate a huge stream of logs.
|
||||
#
|
||||
# log-level = "debug"
|
||||
log-level = "warn";
|
||||
|
||||
# Set the log file.
|
||||
# If *--log-file* is never specified, logs will be written to stderr.
|
||||
# Otherwise, logs will to written to the given file, though some of the early
|
||||
# logs might still be written to the stderr.
|
||||
# When setting this option from the config file, it is recommended to use an absolute path.
|
||||
#
|
||||
# log-file = "/path/to/your/log/file"
|
||||
|
||||
# Show all X errors (for debugging)
|
||||
# show-all-xerrors = false
|
||||
|
||||
# Write process ID to a file.
|
||||
# write-pid-path = "/path/to/your/log/file"
|
||||
|
||||
# Window type settings
|
||||
#
|
||||
# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard:
|
||||
# "unknown", "desktop", "dock", "toolbar", "menu", "utility",
|
||||
# "splash", "dialog", "normal", "dropdown_menu", "popup_menu",
|
||||
# "tooltip", "notification", "combo", and "dnd".
|
||||
#
|
||||
# Following per window-type options are available: ::
|
||||
#
|
||||
# fade, shadow:::
|
||||
# Controls window-type-specific shadow and fade settings.
|
||||
#
|
||||
# opacity:::
|
||||
# Controls default opacity of the window type.
|
||||
#
|
||||
# focus:::
|
||||
# Controls whether the window of this type is to be always considered focused.
|
||||
# (By default, all window types except "normal" and "dialog" has this on.)
|
||||
#
|
||||
# full-shadow:::
|
||||
# Controls whether shadow is drawn under the parts of the window that you
|
||||
# normally won't be able to see. Useful when the window has parts of it
|
||||
# transparent, and you want shadows in those areas.
|
||||
#
|
||||
# clip-shadow-above:::
|
||||
# Controls wether shadows that would have been drawn above the window should
|
||||
# be clipped. Useful for dock windows that should have no shadow painted on top.
|
||||
#
|
||||
# redir-ignore:::
|
||||
# Controls whether this type of windows should cause screen to become
|
||||
# redirected again after been unredirected. If you have unredir-if-possible
|
||||
# set, and doesn't want certain window to cause unnecessary screen redirection,
|
||||
# you can set this to `true`.
|
||||
#
|
||||
wintypes:
|
||||
{
|
||||
tooltip = { fade = false; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
|
||||
dock = { shadow = false; clip-shadow-above = true; }
|
||||
dnd = { shadow = false; }
|
||||
popup_menu = { opacity = 0.8; }
|
||||
dropdown_menu = { opacity = 0.8; }
|
||||
}
|
||||
220
.config/polybar/config.ini
Normal file
220
.config/polybar/config.ini
Normal file
@ -0,0 +1,220 @@
|
||||
[colors]
|
||||
background = #282828
|
||||
background-alt = #282828
|
||||
gray = #928374
|
||||
foreground = #ebdbb2
|
||||
;primary = #d5c4a1
|
||||
;secondary = #8ABEB7
|
||||
alert = #cc241d
|
||||
;disabled = #707880
|
||||
green = #98971a
|
||||
yellow = #d79921
|
||||
blue = #458588
|
||||
purple = #b16286
|
||||
aqua = #689d6a
|
||||
aqualight= #8ec07c
|
||||
red = #fb4934
|
||||
orange = #fe8019
|
||||
|
||||
[bar/bar]
|
||||
width = 100%
|
||||
;offset-x = 15%
|
||||
height = 24pt
|
||||
radius = 0
|
||||
; dpi = 96
|
||||
|
||||
background = ${colors.background}
|
||||
foreground = ${colors.foreground}
|
||||
|
||||
line-size = 3pt
|
||||
|
||||
border-size = 0
|
||||
border-color = #00000000
|
||||
|
||||
padding-left = 1
|
||||
padding-right = 1
|
||||
|
||||
module-margin = 1
|
||||
|
||||
;separator = |
|
||||
separator-foreground = ${colors.disabled}
|
||||
|
||||
font-0 = "Hack Nerd Font:size=10;2"
|
||||
font-1 = "Hack Nerd Font:size=10;2"
|
||||
|
||||
modules-left = xwindow xworkspaces
|
||||
modules-center = date
|
||||
modules-right = pulseaudio memory cpu cpu-temp battery wifi
|
||||
|
||||
cursor-click = pointer
|
||||
cursor-scroll = ns-resize
|
||||
|
||||
enable-ipc = true
|
||||
|
||||
tray-position = right
|
||||
|
||||
; wm-restack = generic
|
||||
; wm-restack = bspwm
|
||||
; wm-restack = i3
|
||||
|
||||
; override-redirect = true
|
||||
|
||||
[module/xworkspaces]
|
||||
type = internal/xworkspaces
|
||||
|
||||
label-active = %name%
|
||||
label-active-background = ${colors.background-alt}
|
||||
label-active-foreground = ${colors.foreground}
|
||||
label-active-underline= ${colors.yellow}
|
||||
label-active-padding = 1
|
||||
|
||||
label-occupied = %name%
|
||||
label-occupied-padding = 1
|
||||
label-occupied-foreground = ${colors.gray}
|
||||
|
||||
label-urgent = %name%
|
||||
label-urgent-background = ${colors.alert}
|
||||
label-urgent-padding = 1
|
||||
|
||||
label-empty = %name%
|
||||
label-empty-foreground = ${colors.disabled}
|
||||
label-empty-padding = 1
|
||||
|
||||
[module/xwindow]
|
||||
type = internal/xwindow
|
||||
label = %title:0:60:...%
|
||||
|
||||
[module/filesystem]
|
||||
type = internal/fs
|
||||
interval = 25
|
||||
|
||||
mount-0 = /
|
||||
|
||||
label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%%
|
||||
|
||||
label-unmounted = %mountpoint% not mounted
|
||||
label-unmounted-foreground = ${colors.disabled}
|
||||
|
||||
[module/pulseaudio]
|
||||
type = internal/pulseaudio
|
||||
|
||||
format-volume-prefix = " "
|
||||
format-volume-foreground = ${colors.foreground}
|
||||
format-volume-prefix-foreground = ${colors.yellow}
|
||||
format-volume = <label-volume>
|
||||
|
||||
label-volume = %percentage%%
|
||||
|
||||
label-muted = muted
|
||||
label-muted-foreground = ${colors.disabled}
|
||||
|
||||
[module/xkeyboard]
|
||||
type = internal/xkeyboard
|
||||
blacklist-0 = num lock
|
||||
|
||||
label-layout = %layout%
|
||||
label-layout-foreground = ${colors.primary}
|
||||
|
||||
label-indicator-padding = 2
|
||||
label-indicator-margin = 1
|
||||
label-indicator-foreground = ${colors.background}
|
||||
label-indicator-background = ${colors.secondary}
|
||||
|
||||
[module/memory]
|
||||
type = internal/memory
|
||||
interval = 2
|
||||
format-prefix = " "
|
||||
format-prefix-foreground = ${colors.green}
|
||||
label = %percentage_used:2%%
|
||||
|
||||
[module/cpu]
|
||||
type = internal/cpu
|
||||
interval = 2
|
||||
format-prefix = " "
|
||||
format-prefix-foreground = ${colors.aqualight}
|
||||
format-foreground = ${colors.foreground}
|
||||
label = %percentage:2%%
|
||||
|
||||
[network-base]
|
||||
type = internal/network
|
||||
interval = 5
|
||||
format-connected = <label-connected>
|
||||
format-disconnected = <label-disconnected>
|
||||
label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected
|
||||
|
||||
[module/wlan]
|
||||
inherit = network-base
|
||||
interface-type = wireless
|
||||
label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip%
|
||||
|
||||
[module/eth]
|
||||
inherit = network-base
|
||||
interface-type = wired
|
||||
label-connected = %{F#F0C674}%ifname%%{F-} %local_ip%
|
||||
|
||||
[module/date]
|
||||
type = internal/date
|
||||
interval = 1
|
||||
|
||||
date = %a, %d %B %Y | %I:%M %p
|
||||
;date = %H:%M
|
||||
;date-alt = %d-%m-%Y %r
|
||||
;%H:%M:%S
|
||||
|
||||
label = %date%
|
||||
label-foreground = ${colors.foreground}
|
||||
format-prefix = " "
|
||||
format-prefix-foreground = ${colors.orange}
|
||||
[settings]
|
||||
screenchange-reload = true
|
||||
pseudo-transparency = true
|
||||
|
||||
[module/battery]
|
||||
;https://github.com/jaagr/polybar/wiki/Module:-battery
|
||||
type = internal/battery
|
||||
battery = BAT0
|
||||
adapter = AC0
|
||||
full-at = 100
|
||||
|
||||
format-charging = <animation-charging> <label-charging>
|
||||
label-charging = %percentage%%
|
||||
format-charging-foreground = ${colors.foreground}
|
||||
format-charging-background = ${colors.background}
|
||||
;format-chaging-underline = #a3c725
|
||||
|
||||
format-discharging = <ramp-capacity> <label-discharging>
|
||||
label-discharging = %percentage%%
|
||||
;format-discharging-underline = #c7ae25
|
||||
format-discharging-foreground = ${colors.foreground}
|
||||
format-discharging-background = ${colors.background}
|
||||
|
||||
format-full-prefix = " "
|
||||
format-full-prefix-foreground = #a3c725
|
||||
;format-full-underline = #a3c725
|
||||
format-full-foreground = ${colors.foreground}
|
||||
format-full-background = ${colors.background}
|
||||
|
||||
ramp-capacity-0 =
|
||||
ramp-capacity-1 =
|
||||
ramp-capacity-2 =
|
||||
ramp-capacity-3 =
|
||||
ramp-capacity-4 =
|
||||
ramp-capacity-foreground = ${colors.aqua}
|
||||
|
||||
animation-charging-0 =
|
||||
animation-charging-1 =
|
||||
animation-charging-2 =
|
||||
animation-charging-3 =
|
||||
animation-charging-4 =
|
||||
animation-charging-foreground = ${colors.green}
|
||||
animation-charging-framerate = 750
|
||||
|
||||
[module/cpu-temp]
|
||||
type = custom/script
|
||||
exec = sensors| grep temp1 | awk '{print $2}' | sort -n | tail -n 1
|
||||
;/home/zaid/.config/custom-scripts/cputemp.sh
|
||||
format-prefix = " "
|
||||
format-prefix-foreground = ${colors.red}
|
||||
interval = 1
|
||||
|
||||
;vim:ft=dosini
|
||||
14
.config/polybar/launch.sh
Executable file
14
.config/polybar/launch.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Terminate already running bar instances
|
||||
# If all your bars have ipc enabled, you can use
|
||||
polybar-msg cmd quit
|
||||
# Otherwise you can use the nuclear option:
|
||||
# killall -q polybar
|
||||
|
||||
# Launch bar1 and bar2
|
||||
echo "---" | tee -a /tmp/polybar1.log /tmp/polybar2.log
|
||||
polybar bar 2>&1 | tee -a /tmp/polybar1.log & disown
|
||||
#polybar bar2 2>&1 | tee -a /tmp/polybar2.log & disown
|
||||
|
||||
echo "Bars launched..."
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.config/nvim/lazy-lock.json
|
||||
7
.stow-local-ignore
Normal file
7
.stow-local-ignore
Normal file
@ -0,0 +1,7 @@
|
||||
README.md
|
||||
.config/nvim/dockerfiles/
|
||||
.config/nvim/.lua-format
|
||||
.config/nvim/README.md
|
||||
.config/nvim/lua/disabled_plugins/
|
||||
.git/
|
||||
.gitignore
|
||||
Loading…
Reference in New Issue
Block a user