├── .github ├── FUNDING.yml └── workflows │ └── lint.yml ├── .gitignore ├── .luacheckrc ├── Makefile ├── README.md ├── Xmodmap ├── Xresources ├── ackrc ├── bin ├── csv_to_table ├── domaincheck ├── dwm_status ├── feh-random ├── flatten ├── git-praise ├── jpgtowebp.sh ├── move_to_dotfiles ├── pls ├── png2favico ├── png2ico ├── print_colors.sh ├── random_swaybg.sh ├── scaleimages.sh ├── sounds.sh ├── start_redshift ├── startup-social-media ├── transcript-video.sh ├── tsv_to_table ├── video_to_gif ├── whisper └── zsh_history_fix ├── config ├── GIMP │ └── 2.10 │ │ └── gimprc ├── alacritty │ ├── alacritty.yml │ ├── alacritty.yml.in │ └── startup.sh ├── blender │ └── 2.93 │ │ └── config │ │ ├── startup.blend │ │ └── userpref.blend ├── efm-langserver │ └── config.yaml ├── fontconfig │ └── fonts.conf ├── gtk-3.0 │ └── settings.ini ├── inkscape │ └── preferences.xml ├── kdeglobals ├── mpv │ ├── mpv.conf │ └── scripts │ │ └── clip.lua ├── ncspot │ └── config.toml ├── nvim │ ├── .luacheckrc │ ├── .luarc.json │ ├── after │ │ ├── ftdetect │ │ │ ├── elixir.vim │ │ │ ├── gleam.vim │ │ │ ├── gotmpl.vim │ │ │ ├── html.lua │ │ │ ├── javascript.lua │ │ │ └── typescript.vim │ │ ├── ftplugin │ │ │ ├── elixir.lua │ │ │ ├── elixir.vim │ │ │ ├── gdscript.lua │ │ │ ├── gitcommit.vim │ │ │ ├── gleam.lua │ │ │ ├── javascript.lua │ │ │ ├── javascriptreact.lua │ │ │ ├── lua.vim │ │ │ ├── markdown.lua │ │ │ ├── python.lua │ │ │ ├── python.vim │ │ │ ├── rust.lua │ │ │ ├── text.lua │ │ │ ├── toml.vim │ │ │ ├── typescript.lua │ │ │ ├── typescript.tsx.vim │ │ │ ├── typescript.vim │ │ │ ├── typescriptreact.lua │ │ │ ├── vim.vim │ │ │ └── yaml.lua │ │ ├── indent │ │ │ └── elixir.vim │ │ ├── plugin │ │ │ ├── ale.vim │ │ │ ├── dap.lua │ │ │ ├── dap.vim │ │ │ ├── diagnostic.vim │ │ │ ├── diffview.lua │ │ │ ├── elixir.lua │ │ │ ├── fzf.vim │ │ │ ├── keymaps.vim │ │ │ ├── lsp.lua │ │ │ ├── lsp.vim │ │ │ ├── luaformat.vim │ │ │ ├── mappings.vim │ │ │ ├── prettier.vim │ │ │ ├── rust.lua │ │ │ ├── telescope.vim │ │ │ └── typescript.nvim.lua │ │ └── queries │ │ │ ├── ecma.scm │ │ │ ├── ecma │ │ │ ├── highlights.scm │ │ │ └── injections.scm │ │ │ ├── eelixir │ │ │ └── highlights.scm │ │ │ ├── elixir │ │ │ └── old_custom_highlights.scm │ │ │ ├── gotmpl │ │ │ ├── highlights.scm │ │ │ └── injections.scm │ │ │ ├── html │ │ │ └── injections.scm │ │ │ ├── html_eex │ │ │ └── injections.scm │ │ │ ├── lua │ │ │ └── highlights.scm │ │ │ ├── tsx │ │ │ ├── ecma.scm │ │ │ ├── typescript.scm │ │ │ └── typescriptreact.scm │ │ │ └── typescript │ │ │ └── typescript.scm │ ├── ftplugin │ │ └── pest.lua │ ├── init.lua │ ├── lazy-lock.json │ ├── lua │ │ ├── lsp_config.lua │ │ ├── mappings.lua │ │ ├── plugin │ │ │ ├── colorizer.lua │ │ │ ├── completion.lua │ │ │ ├── dap.lua │ │ │ ├── dap │ │ │ │ └── mappings.lua │ │ │ ├── dressing.lua │ │ │ ├── expressline.lua │ │ │ ├── formatter.lua │ │ │ ├── jest-test.lua │ │ │ ├── jester.lua │ │ │ ├── lint.lua │ │ │ ├── linters │ │ │ │ └── gdlint.lua │ │ │ ├── nvim-dap-ui.lua │ │ │ ├── symbols-outline.lua │ │ │ ├── telescope.lua │ │ │ ├── telescope │ │ │ │ └── mappings.lua │ │ │ ├── treesitter.lua │ │ │ └── zip.lua │ │ ├── plugins │ │ │ ├── ai.lua │ │ │ ├── color.lua │ │ │ ├── colorscheme.lua │ │ │ ├── comment.lua │ │ │ ├── completion.lua │ │ │ ├── config.lua │ │ │ ├── dap.lua │ │ │ ├── db.lua │ │ │ ├── elixir.lua │ │ │ ├── filetree.lua │ │ │ ├── format.lua │ │ │ ├── icons.lua │ │ │ ├── lib.lua │ │ │ ├── lint.lua │ │ │ ├── lsp.lua │ │ │ ├── rust.lua │ │ │ ├── schema.lua │ │ │ ├── snippet.lua │ │ │ ├── statusbar.lua │ │ │ ├── telescope.lua │ │ │ ├── test.lua │ │ │ ├── textobject.lua │ │ │ ├── treesitter.lua │ │ │ ├── typescript.lua │ │ │ └── ui.lua │ │ ├── plugins_init.lua │ │ ├── rockerboo │ │ │ ├── functional.lua │ │ │ ├── functional.test.lua │ │ │ ├── functional_spec.lua │ │ │ ├── lsp.lua │ │ │ ├── lsp_status.lua │ │ │ ├── scratch.lua │ │ │ ├── tests.lua │ │ │ ├── typescript.lua │ │ │ ├── utils.lua │ │ │ └── voices.lua │ │ └── setup.lua │ ├── queries │ │ ├── gotmpl │ │ │ └── injections.scm │ │ └── html_eex │ │ │ ├── highlights.scm │ │ │ └── injections.scm │ ├── spell │ │ ├── en.utf-8.add │ │ └── en.utf-8.add.spl │ └── stylua.toml ├── obs-studio │ └── basic │ │ └── scenes │ │ └── rockerBOO.json ├── starship.toml ├── systemd │ └── user │ │ ├── spotifyd.service │ │ └── ssh-agent.service └── wezterm │ └── wezterm.lua ├── gitconfig ├── gitignore ├── hushlogin ├── iex.exs ├── profile ├── scripts ├── install.sh ├── osx │ └── defaults.sh └── uninstall.sh ├── tmux.conf ├── vimrc ├── xbindkeysrc ├── xinitrc ├── xsession ├── yarnrc.yml ├── zprofile ├── zshenv └── zshrc /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: rockerBOO 2 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | ################################# 2 | ################################# 3 | ## Super Linter GitHub Actions ## 4 | ################################# 5 | ################################# 6 | --- 7 | name: Lint Code Base 8 | 9 | # 10 | # Documentation: 11 | # https://help.github.com/en/articles/workflow-syntax-for-github-actions 12 | # 13 | 14 | ############################# 15 | # Start the job on all push # 16 | ############################# 17 | on: 18 | push: 19 | pull_request: 20 | branches: [current] 21 | 22 | ############### 23 | # Set the Job # 24 | ############### 25 | jobs: 26 | build: 27 | # Name the Job 28 | name: Lint Code Base 29 | # Set the agent to run on 30 | runs-on: ubuntu-latest 31 | 32 | ################## 33 | # Load all steps # 34 | ################## 35 | steps: 36 | ########################## 37 | # Checkout the code base # 38 | ########################## 39 | - name: Checkout Code 40 | uses: actions/checkout@v2 41 | with: 42 | # Full git history is needed to get a proper 43 | # list of changed files within `super-linter` 44 | fetch-depth: 0 45 | 46 | ################################ 47 | # Run Linter against code base # 48 | ################################ 49 | - name: Lint Code Base 50 | uses: github/super-linter/slim@v4 51 | env: 52 | VALIDATE_ALL_CODEBASE: false 53 | DEFAULT_BRANCH: current 54 | LINTER_RULES_PATH: / 55 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | /config/nvim/plugged/ 4 | /config/nvim/rplugin/ 5 | /config/nvim/undo/ 6 | 7 | config/nvim/lua/plugin/dadbod.lua 8 | 9 | /bin/exercism 10 | /bin/pob 11 | /bin/godot 12 | 13 | config/blender/2.93/config/recent-files.txt 14 | config/blender/2.93/config/bookmarks.txt 15 | config/blender/2.93/config/platform_support.txt 16 | 17 | -------------------------------------------------------------------------------- /.luacheckrc: -------------------------------------------------------------------------------- 1 | cache = true 2 | 3 | std = luajit 4 | 5 | self = false 6 | 7 | globals = {"vim", "describe", "it", "use"} 8 | 9 | 10 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | lint: 3 | luacheck config/nvim 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dotfiles 2 | 3 | Linux 4 | 5 | ## Neovim Nightly 6 | 7 | - LSP 8 | - Treesitter 9 | - Telescope 10 | - DAP 11 | - Lua Autocmd 12 | - vim.keymap 13 | 14 | ![Linux — Neofetch](https://user-images.githubusercontent.com/15027/165008185-61f42397-57ba-403f-a835-1bfcd1b39e6b.png) 15 | 16 | ## Install 17 | 18 | To install: 19 | 20 | ```bash 21 | $ git clone git://github.com/rockerBOO/dotfiles.git ~/.dotfiles 22 | $ ~/.dotfiles/scripts/install.sh 23 | ``` 24 | 25 | The installer will **never** delete a file from your $HOME directory. If it encounters a 26 | file that isn't a symlink, it lets you handle the situation. 27 | 28 | ## Uninstall 29 | 30 | To uninstall: 31 | 32 | ```bash 33 | $ ~/.dotfiles/scripts/uninstall.sh 34 | ``` 35 | 36 | This will only remove files of interest from `$HOME` that are symlinks. 37 | 38 | ## Font 39 | 40 | - [ioveskaBOO](https://github.com/rockerBOO/IosevkaBOO/releases/tag/1.0) - Customized version of Ioveska 41 | -------------------------------------------------------------------------------- /Xmodmap: -------------------------------------------------------------------------------- 1 | clear lock 2 | clear control 3 | keycode 66 = Control_L 4 | add control = Control_L Control_R 5 | 6 | ! https://schnouki.net/post/2019/how-to-use-a-keychron-k2-usb-keyboard-on-linux/ 7 | keycode 119 = Delete Insert Delete Insert 8 | 9 | -------------------------------------------------------------------------------- /Xresources: -------------------------------------------------------------------------------- 1 | ! special 2 | !*.foreground: #ffffff 3 | !*.background: #1a1e1d 4 | !*.cursorColor: #ffffff 5 | 6 | ! black 7 | *.color0: #1a1e1d 8 | *.color8: #5d6f74 9 | 10 | ! red 11 | *.color1: #dbabeb 12 | *.color9: #d95490 13 | 14 | ! green 15 | *.color2: #9c75dd 16 | *.color10: #63b0b0 17 | 18 | ! yellow 19 | *.color3: #7fa7af 20 | *.color11: #c0c0dd 21 | 22 | ! blue 23 | *.color4: #64629f 24 | *.color12: #5786bc 25 | 26 | ! magenta 27 | *.color5: #5f4c65 28 | *.color13: #3f3442 29 | 30 | ! cyan 31 | *.color6: #a9d1df 32 | *.color14: #849da2 33 | 34 | ! white 35 | *.color7: #f0f4ef 36 | *.color15: #f5f4ef 37 | 38 | ! font config 39 | Xft.hinting: 1 40 | Xft.hintstyle: hintslight 41 | Xft.antialias: 1 42 | Xft.rgba: rgb 43 | 44 | Xft.size: 16 45 | Xft.family: JetBrainsMono Nerd Font 46 | 47 | -------------------------------------------------------------------------------- /ackrc: -------------------------------------------------------------------------------- 1 | --ignore-dir=.bundle 2 | -------------------------------------------------------------------------------- /bin/csv_to_table: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function usage { 4 | echo "Usage: $0 []" 5 | exit 1 6 | } 7 | 8 | [ $# -lt 1 ] && usage 9 | csvfile="$1" 10 | [ ! -s "$csvfile" ] && echo "missing or empty file: $csvfile" && exit 1 11 | 12 | tablename="${csvfile%%\.csv}" 13 | [ -z "$tablename" ] && echo "unable to determine tablename" 14 | if [[ $tablename =~ [-] ]]; then 15 | echo "tablename cannot contain hypen - converting to underscore (_)" 16 | tablename=$(echo "$tablename" | tr "-" "_") 17 | fi 18 | 19 | echo "csv file : $csvfile" 20 | echo "table name: $tablename" 21 | 22 | sqlite3 -interactive \ 23 | -cmd ".mode csv" \ 24 | -cmd ".mode columns" \ 25 | -cmd ".headers on" \ 26 | -cmd ".import $csvfile '$tablename'" 27 | -------------------------------------------------------------------------------- /bin/domaincheck: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # http://gilesbowkett.blogspot.com/2009/02/simple-bash-domain-availability.html 4 | 5 | for d in $@; 6 | do 7 | if host $d | grep "NXDOMAIN" >&/dev/null; then 8 | if whois $d | grep -E "(No match for|NOT FOUND)" >&/dev/null; then 9 | echo "$d AVAILABLE"; 10 | else 11 | echo "$d TAKEN"; 12 | fi 13 | else 14 | echo "$d TAKEN"; 15 | fi 16 | sleep 0.1; 17 | done 18 | -------------------------------------------------------------------------------- /bin/dwm_status: -------------------------------------------------------------------------------- 1 | slstatus & 2 | -------------------------------------------------------------------------------- /bin/feh-random: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | feh --bg-max --randomize /home/rockerboo/art/ai-submission-large/* 4 | 5 | while sleep 300; do 6 | feh --bg-max --randomize /home/rockerboo/art/ai-submission-large/* 7 | done 8 | 9 | -------------------------------------------------------------------------------- /bin/flatten: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import argparse 3 | import os 4 | from pathlib import Path 5 | 6 | parser = argparse.ArgumentParser() 7 | 8 | parser.add_argument("file") 9 | 10 | args = parser.parse_args() 11 | 12 | file = Path(args.file) 13 | 14 | new_file = ( 15 | file.name.replace(" ", "-") 16 | .replace(":", "-") 17 | .replace(" ", "-") 18 | .replace(":", "-") 19 | .replace("'", "") 20 | .replace(",", "-") 21 | .replace("[", "") 22 | .replace("]", "") 23 | .replace("&", "-") 24 | .replace("’", "-") 25 | .replace("?", "") 26 | .replace("/", "-") 27 | .replace("⧸", "-") 28 | .replace("(", "") 29 | .replace(")", "") 30 | ).replace("--", "-") 31 | 32 | os.rename(file, new_file) 33 | -------------------------------------------------------------------------------- /bin/git-praise: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | exec git blame "$@" 3 | -------------------------------------------------------------------------------- /bin/jpgtowebp.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit 3 | set -o nounset 4 | set -o pipefail 5 | 6 | if [[ "${TRACE-0}" == "1" ]]; then 7 | set -o xtrace 8 | fi 9 | 10 | if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then 11 | echo 'Usage: ./jpgtowebp.sh 12 | 13 | Converts jpg to webp inside the current directory 14 | ' 15 | exit 16 | fi 17 | 18 | main() { 19 | for file in *.jpg; do cwebp -q 50 "$file" -o "${file%.*}.webp"; done 20 | } 21 | 22 | main "$@" 23 | -------------------------------------------------------------------------------- /bin/move_to_dotfiles: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # vim: filetype=sh 3 | # Move a configuration to the dotfiles config and make a link to it. 4 | 5 | dotfile=~/$1 6 | postdotfile=~/.dotfiles/${1:1} # remove the dot 7 | 8 | echo "$dotfile $postdotfile moving..." 9 | 10 | cp -ruv "$dotfile" "$postdotfile" 11 | 12 | if [ ! -f "$postdotfile" ]; then 13 | echo "Failed to make destination file. $postdotfile" 14 | exit 1 15 | fi 16 | 17 | ln -snf "$postdotfile" "$dotfile" 18 | 19 | if [ ! -L "$dotfile" ]; then 20 | echo "Failed to link file $dotfile" 21 | exit 2 22 | fi 23 | 24 | echo "$dotfile $postdotfile moved" 25 | -------------------------------------------------------------------------------- /bin/pls: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # https://sleeplessbeastie.eu/2019/06/03/how-to-display-memory-used-by-processes-in-human-readable-form/ 3 | 4 | ps -ax --no-headers --format=pid,rss,command --sort=-rss,pid | awk 'BEGIN{suffixes_len=split("kB MB GB TB",suffixes)} {n_suffix=1; while($2 > 1000 && n_suffix < suffixes_len) {$2 /= 1024; n_suffix++;}; printf "%5s %7.2f %2s %s\n",$1,$2,suffixes[n_suffix],substr($0, index($0,$3))}' 5 | -------------------------------------------------------------------------------- /bin/png2favico: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ -z "$1" ] || [ -z "$2" ]; then 4 | echo "png2favico input output" 5 | exit 2 6 | fi 7 | 8 | size=32 9 | 10 | convert -resize x"$size" -gravity center -crop "${size}"x"${size}"+0+0 "$1" -flatten -colors 256 -background transparent "$2" 11 | -------------------------------------------------------------------------------- /bin/png2ico: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -z "$1" ] || [ -z "$2" ]; then 4 | echo "png2favico input output" 5 | exit 2 6 | fi 7 | 8 | size=32 9 | 10 | convert -resize x$size -gravity center -crop 32x32+0+0 "$1" -flatten -colors 256 -background transparent "$2" 11 | -------------------------------------------------------------------------------- /bin/print_colors.sh: -------------------------------------------------------------------------------- 1 | 2 | #!/usr/bin/env sh 3 | 4 | printf "|039| \033[39mDefault \033[m |049| \033[49mDefault \033[m |037| \033[37mLight gray \033[m |047| \033[47mLight gray \033[m\n" 5 | printf "|030| \033[30mBlack \033[m |040| \033[40mBlack \033[m |090| \033[90mDark gray \033[m |100| \033[100mDark gray \033[m\n" 6 | printf "|031| \033[31mRed \033[m |041| \033[41mRed \033[m |091| \033[91mLight red \033[m |101| \033[101mLight red \033[m\n" 7 | printf "|032| \033[32mGreen \033[m |042| \033[42mGreen \033[m |092| \033[92mLight green \033[m |102| \033[102mLight green \033[m\n" 8 | printf "|033| \033[33mYellow \033[m |043| \033[43mYellow \033[m |093| \033[93mLight yellow \033[m |103| \033[103mLight yellow \033[m\n" 9 | printf "|034| \033[34mBlue \033[m |044| \033[44mBlue \033[m |094| \033[94mLight blue \033[m |104| \033[104mLight blue \033[m\n" 10 | printf "|035| \033[35mMagenta \033[m |045| \033[45mMagenta \033[m |095| \033[95mLight magenta \033[m |105| \033[105mLight magenta \033[m\n" 11 | printf "|036| \033[36mCyan \033[m |046| \033[46mCyan \033[m |096| \033[96mLight cyan \033[m |106| \033[106mLight cyan \033[m\n" 12 | -------------------------------------------------------------------------------- /bin/random_swaybg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Directory containing images 4 | image_dir=$1 5 | 6 | shopt -s nullglob 7 | # Get a list of image files in the directory 8 | images="$image_dir/*.{png,jpg,jpeg,gif}" 9 | # Initialize the images array 10 | images=() 11 | 12 | # Collect images with specific extensions 13 | for ext in png jpg jpeg gif; do 14 | images+=("$image_dir"/*."$ext") 15 | done 16 | 17 | # Check if the directory contains images 18 | if [ ${#images[@]} -eq 0 ]; then 19 | echo "No image files found in $image_dir" 20 | exit 1 21 | fi 22 | 23 | 24 | # Pick a random image 25 | random_image="${images[RANDOM % ${#images[@]}]}" 26 | 27 | # Get the connected outputs from wlr-randr 28 | outputs=$(wlr-randr | rg 'HDMI|DP' | awk '{print $1}') 29 | 30 | # Prepare the swaybg command 31 | swaybg_cmd="/usr/bin/swaybg --mode fill" 32 | 33 | # Add each output to the command 34 | for output in $outputs; do 35 | swaybg_cmd+=" --output $output --image \"$random_image\"" 36 | done 37 | 38 | set -x 39 | 40 | # Execute the command 41 | eval "$swaybg_cmd" 42 | -------------------------------------------------------------------------------- /bin/scaleimages.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit 3 | set -o nounset 4 | set -o pipefail 5 | 6 | if [[ "${TRACE-0}" == "1" ]]; then 7 | set -o xtrace 8 | fi 9 | 10 | if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then 11 | echo 'Usage: ./scaleimages.sh input/images/x.png ../prs/ 12 | 13 | Upscales images 4x using realesrgan-ncnn-vulkan 14 | 15 | Note: output directory must end in a slash 16 | ' 17 | exit 18 | fi 19 | 20 | main() { 21 | if [[ $(file "$1" | sed -n '/directory/') ]]; then 22 | for file in "$1"/*.png; do 23 | 24 | filename=$(basename "$file") 25 | /mnt/900/builds/prs/real/realesrgan-ncnn-vulkan -i "$file" -o "$2$filename" 26 | done 27 | else 28 | filename=$(basename "$1") 29 | echo "/mnt/900/builds/prs/real/realesrgan-ncnn-vulkan -i ""$1"" -o ""$2$filename""" 30 | /mnt/900/builds/prs/real/realesrgan-ncnn-vulkan -i "$1" -o "$2$filename" 31 | fi 32 | } 33 | 34 | main "$@" 35 | -------------------------------------------------------------------------------- /bin/sounds.sh: -------------------------------------------------------------------------------- 1 | /home/rockerboo/code/tmp/error-sounds/sounds.sh -------------------------------------------------------------------------------- /bin/start_redshift: -------------------------------------------------------------------------------- 1 | redshift & 2 | -------------------------------------------------------------------------------- /bin/startup-social-media: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | podman run -p 10000:8080 -d libreddit 4 | podman run -p 9000:8080 -d nitter 5 | -------------------------------------------------------------------------------- /bin/transcript-video.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # we want ffmpeg to conver the video to audio 4 | # then we can get the transcript from the audio 5 | 6 | file=$(mktemp) 7 | 8 | ffmpeg -y -i "$1" -vn -acodec pcm_s16le -ac 1 -ar 16000 -f wav "$file" 9 | whisper "$file" --output-txt --output-file "${1%.*}" 10 | 11 | rm "$file" 12 | -------------------------------------------------------------------------------- /bin/tsv_to_table: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function usage { 4 | echo "Usage: $0 []" 5 | exit 1 6 | } 7 | 8 | [ $# -lt 1 ] && usage 9 | csvfile="$1" 10 | [ ! -s "$csvfile" ] && echo "missing or empty file: $csvfile" && exit 1 11 | 12 | tablename="${csvfile%%\.csv}" 13 | [ -z "$tablename" ] && echo "unable to determine tablename" 14 | if [[ $tablename =~ [-] ]]; then 15 | echo "tablename cannot contain hypen - converting to underscore (_)" 16 | tablename=$(echo "$tablename" | tr "-" "_") 17 | fi 18 | 19 | echo "csv file : $csvfile" 20 | echo "table name: $tablename" 21 | 22 | # -cmd ".mode columns" \ 23 | sqlite3 -interactive \ 24 | -cmd ".mode tabs" \ 25 | -cmd ".headers on" \ 26 | -cmd ".import $csvfile '$tablename'" 27 | -------------------------------------------------------------------------------- /bin/video_to_gif: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "$#" -ne 2 ]; then 4 | echo "Usage: video_to_gif video_file gif_file_output" 5 | exit 2 6 | fi 7 | 8 | input=$1 9 | output=$2 10 | 11 | ffmpeg -ss 30 -t 3 -i "$input" -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 $output 12 | -------------------------------------------------------------------------------- /bin/whisper: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | whisper.cpp --model /usr/share/whisper.cpp-model-base.en/base.en.bin "$@" 4 | -------------------------------------------------------------------------------- /bin/zsh_history_fix: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # George Ornbo (shapeshed) http://shapeshed.com 3 | # License - http://unlicense.org 4 | # 5 | # Fixes a corrupt .zsh_history file 6 | 7 | mv ~/.zsh_history ~/.zsh_history_bad 8 | strings -eS ~/.zsh_history_bad > ~/.zsh_history 9 | #R in capital gives an error so the solution 10 | fc -r ~/.zsh_history 11 | rm ~/.zsh_history_bad 12 | -------------------------------------------------------------------------------- /config/GIMP/2.10/gimprc: -------------------------------------------------------------------------------- 1 | # GIMP gimprc 2 | # 3 | # This is your personal gimprc file. Any variable defined in this file takes 4 | # precedence over the value defined in the system-wide gimprc: 5 | # /etc/gimp/2.0/gimprc 6 | # Most values can be set within GIMP by changing some options in the 7 | # Preferences dialog. 8 | 9 | (color-management 10 | (mode display) 11 | (display-profile-from-gdk yes) 12 | (display-rendering-intent relative-colorimetric) 13 | (display-use-black-point-compensation yes) 14 | (display-optimize yes) 15 | (simulation-rendering-intent perceptual) 16 | (simulation-use-black-point-compensation no) 17 | (simulation-optimize yes) 18 | (simulation-gamut-check no) 19 | (out-of-gamut-color (color-rgb 1 0 1)) 20 | (display-module "CdisplayLcms")) 21 | (import-raw-plug-in "${gimp_plug_in_dir}/plug-ins/file-raw-placeholder/file-raw-placeholder") 22 | (monitor-xresolution 109) 23 | (monitor-yresolution 109) 24 | (color-profile-path "${gimp_installation_dir}/share/color/icc/colord") 25 | (fill-options 26 | (style solid) 27 | (antialias yes) 28 | (feather no) 29 | (feather-radius 10)) 30 | (stroke-options 31 | (style solid) 32 | (antialias yes) 33 | (feather no) 34 | (feather-radius 10) 35 | (method line) 36 | (width 6) 37 | (unit pixels) 38 | (cap-style butt) 39 | (join-style miter) 40 | (miter-limit 10) 41 | (dash-offset 0) 42 | (dash-info 0) 43 | (emulate-brush-dynamics no)) 44 | 45 | 46 | # end of gimprc 47 | -------------------------------------------------------------------------------- /config/alacritty/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # https://www.reddit.com/r/unixporn/comments/8giij5/guide_defining_program_colors_through_xresources/ 3 | # Update alacritty config to apply Xresources color scheme 4 | 5 | # Target file 6 | target_file="$HOME/.config/alacritty/alacritty.yml" 7 | 8 | # copy input file to temporary file for black magic fuckery 9 | # (alacritty applies colors when the config file is written, so we want to do it 10 | # all in one write) 11 | cp "$target_file".in "$target_file".tmp 12 | 13 | # Grab colors from Xresources 14 | xrdb ~/.Xresources 15 | 16 | # Numbered colors 17 | for i in {0..15} 18 | do 19 | v=$(xrdb -query | awk '/*.color'"$i":'/ { print substr($2,2) }') 20 | eval "sed -i 's/%cl${i}%/\x270x${v}\x27/g' $target_file.tmp"; 21 | done 22 | 23 | # Named colors 24 | foreground=$(xrdb -query | awk '/*.foreground/ { print substr($2,2) }') 25 | background=$(xrdb -query | awk '/*.background/ { print substr($2,2) }') 26 | sed -i "s/%clfg%/\x270x${foreground}\x27/g" "$target_file".tmp 27 | sed -i "s/%clbg%/\x270x${background}\x27/g" "$target_file".tmp 28 | 29 | # Finally, replace target file with our updated one 30 | rm "$target_file" 31 | mv "$target_file".tmp "$target_file" 32 | -------------------------------------------------------------------------------- /config/blender/2.93/config/startup.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockerBOO/dotfiles/17bfb24bbfc0e3ef2985700f81ec74ca4a20c482/config/blender/2.93/config/startup.blend -------------------------------------------------------------------------------- /config/blender/2.93/config/userpref.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockerBOO/dotfiles/17bfb24bbfc0e3ef2985700f81ec74ca4a20c482/config/blender/2.93/config/userpref.blend -------------------------------------------------------------------------------- /config/fontconfig/fonts.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | sans-serif 6 | 7 | Inter V 8 | Inter 9 | Open Sans 10 | 11 | 12 | 13 | 14 | sans-serif 15 | 16 | Inter V 17 | Inter 18 | Open Sans 19 | 20 | 21 | 22 | serif 23 | 24 | IBM Plex Serif 25 | 26 | 27 | 28 | 29 | monospace 30 | 31 | Iosevka Custom 32 | Iosevka Nerd Font Mono 33 | Hermit Nerd Font 34 | Syne Mono 35 | Recusive Mono 36 | Cascadia Code 37 | Space Mono 38 | 39 | 40 | 41 | 42 | 92.0 43 | 44 | 45 | 46 | 47 | 48 | 49 | family 50 | Arial 51 | 52 | 53 | family 54 | Arial Black 55 | 56 | 57 | family 58 | Calibri 59 | 60 | 61 | family 62 | Calibri Light 63 | 64 | 65 | family 66 | Cambria 67 | 68 | 69 | family 70 | Cambria Math 71 | 72 | 73 | family 74 | Comic Sans MS 75 | 76 | 77 | family 78 | Consolas 79 | 80 | 81 | family 82 | Georgia 83 | 84 | 85 | family 86 | Impact 87 | 88 | 89 | family 90 | Javanese Text 91 | 92 | 93 | family 94 | Segoe Print 95 | 96 | 97 | family 98 | Segoe Script 99 | 100 | family 101 | Segoe UI 102 | 103 | 104 | family 105 | Segoe UI Emoji 106 | 107 | 108 | family 109 | Segoe UI Historic 110 | 111 | 112 | family 113 | Segoe UI Black 114 | 115 | 116 | family 117 | Segoe UI Light 118 | 119 | 120 | family 121 | Segoe UI Semibold 122 | 123 | 124 | family 125 | Segoe UI Semilight 126 | 127 | 128 | family 129 | Segoe UI Symbol 130 | 131 | 132 | family 133 | Tahoma 134 | 135 | 136 | family 137 | Times New Roman 138 | 139 | 140 | family 141 | Trebuchet MS 142 | 143 | 144 | family 145 | Verdana 146 | 147 | 148 | family 149 | Webdings 150 | 151 | 152 | family 153 | Wingdings 154 | 155 | 156 | 157 | 158 | 159 | 160 | true 161 | 162 | 163 | false 164 | 165 | 166 | false 167 | 168 | 169 | hintnone 170 | 171 | 172 | true 173 | 174 | 175 | false 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /config/gtk-3.0/settings.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | gtk-icon-theme-name =Arc-Darker 3 | gtk-theme-name=Arc-Darker 4 | gtk-font-name = Inter 10 5 | gtk-application-prefer-dark-theme=true 6 | -------------------------------------------------------------------------------- /config/kdeglobals: -------------------------------------------------------------------------------- 1 | [Colors:View] 2 | BackgroundNormal=23,24,24 3 | 4 | [KDE] 5 | ShowDeleteCommand=false 6 | 7 | [PreviewSettings] 8 | MaximumRemoteSize=0 9 | -------------------------------------------------------------------------------- /config/mpv/mpv.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example mpv configuration file 3 | # 4 | # Warning: 5 | # 6 | # The commented example options usually do _not_ set the default values. Call 7 | # mpv with --list-options to see the default values for most options. There is 8 | # no builtin or example mpv.conf with all the defaults. 9 | # 10 | # 11 | # Configuration files are read system-wide from /usr/local/etc/mpv.conf 12 | # and per-user from ~/.config/mpv/mpv.conf, where per-user settings override 13 | # system-wide settings, all of which are overridden by the command line. 14 | # 15 | # Configuration file settings and the command line options use the same 16 | # underlying mechanisms. Most options can be put into the configuration file 17 | # by dropping the preceding '--'. See the man page for a complete list of 18 | # options. 19 | # 20 | # Lines starting with '#' are comments and are ignored. 21 | # 22 | # See the CONFIGURATION FILES section in the man page 23 | # for a detailed description of the syntax. 24 | # 25 | # Profiles should be placed at the bottom of the configuration file to ensure 26 | # that settings wanted as defaults are not restricted to specific profiles. 27 | 28 | ################## 29 | # video settings # 30 | ################## 31 | 32 | # Start in fullscreen mode by default. 33 | #fs=yes 34 | 35 | # force starting with centered window 36 | #geometry=50%:50% 37 | 38 | # don't allow a new window to have a size larger than 90% of the screen size 39 | #autofit-larger=90%x90% 40 | 41 | # Do not close the window on exit. 42 | #keep-open=yes 43 | 44 | # Do not wait with showing the video window until it has loaded. (This will 45 | # resize the window once video is loaded. Also always shows a window with 46 | # audio.) 47 | #force-window=immediate 48 | 49 | # Disable the On Screen Controller (OSC). 50 | #osc=no 51 | 52 | # Keep the player window on top of all other windows. 53 | #ontop=yes 54 | 55 | # Specify high quality video rendering preset (for --vo=gpu only) 56 | # Can cause performance problems with some drivers and GPUs. 57 | #profile=gpu-hq 58 | 59 | # Force video to lock on the display's refresh rate, and change video and audio 60 | # speed to some degree to ensure synchronous playback - can cause problems 61 | # with some drivers and desktop environments. 62 | #video-sync=display-resample 63 | 64 | # Enable hardware decoding if available. Often, this does not work with all 65 | # video outputs, but should work well with default settings on most systems. 66 | # If performance or energy usage is an issue, forcing the vdpau or vaapi VOs 67 | # may or may not help. 68 | hwdec=auto 69 | 70 | ################## 71 | # audio settings # 72 | ################## 73 | 74 | # Specify default audio device. You can list devices with: --audio-device=help 75 | # The option takes the device string (the stuff between the '...'). 76 | #audio-device=alsa/default 77 | 78 | # Do not filter audio to keep pitch when changing playback speed. 79 | #audio-pitch-correction=no 80 | 81 | # Output 5.1 audio natively, and upmix/downmix audio with a different format. 82 | #audio-channels=5.1 83 | # Disable any automatic remix, _if_ the audio output accepts the audio format. 84 | # of the currently played file. See caveats mentioned in the manpage. 85 | # (The default is "auto-safe", see manpage.) 86 | #audio-channels=auto 87 | 88 | ################## 89 | # other settings # 90 | ################## 91 | 92 | # Pretend to be a web browser. Might fix playback with some streaming sites, 93 | # but also will break with shoutcast streams. 94 | #user-agent="Mozilla/5.0" 95 | 96 | # cache settings 97 | # 98 | # Use a large seekable RAM cache even for local input. 99 | #cache=yes 100 | # 101 | # Use extra large RAM cache (needs cache=yes to make it useful). 102 | #demuxer-max-bytes=500M 103 | #demuxer-max-back-bytes=100M 104 | # 105 | # Disable the behavior that the player will pause if the cache goes below a 106 | # certain fill size. 107 | #cache-pause=no 108 | # 109 | # Store cache payload on the hard disk instead of in RAM. (This may negatively 110 | # impact performance unless used for slow input such as network.) 111 | #cache-dir=~/.cache/ 112 | #cache-on-disk=yes 113 | 114 | # Display English subtitles if available. 115 | #slang=en 116 | 117 | # Play Finnish audio if available, fall back to English otherwise. 118 | #alang=fi,en 119 | 120 | # Change subtitle encoding. For Arabic subtitles use 'cp1256'. 121 | # If the file seems to be valid UTF-8, prefer UTF-8. 122 | # (You can add '+' in front of the codepage to force it.) 123 | #sub-codepage=cp1256 124 | 125 | # You can also include other configuration files. 126 | #include=/path/to/the/file/you/want/to/include 127 | 128 | ############ 129 | # Profiles # 130 | ############ 131 | 132 | # The options declared as part of profiles override global default settings, 133 | # but only take effect when the profile is active. 134 | 135 | # The following profile can be enabled on the command line with: --profile=eye-cancer 136 | 137 | #[eye-cancer] 138 | #sharpen=5 139 | sub-auto=all 140 | 141 | osd-font='Iosevka Custom,monospace' 142 | sub-font='Iosevka Custom,monospace' 143 | 144 | # sub-ass-force-style='FontName=Isoevka Custom,Default.Bold=1' 145 | sub-ass-hinting='normal' 146 | 147 | screenshot-directory=~/Pictures 148 | -------------------------------------------------------------------------------- /config/mpv/scripts/clip.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2017 ParadoxSpiral 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with Parabot. If not, see . 15 | 16 | -- Encode a clip of the current file 17 | 18 | local mp = require("mp") 19 | local options = require("mp.options") 20 | 21 | require("os") 22 | 23 | -- Options 24 | local o = { 25 | -- Key bindings 26 | key_set_start_frame = "c", 27 | key_set_stop_frame = "C", 28 | key_start_encode = "ctrl+C", 29 | 30 | -- Audio settings 31 | audio_codec = "libopus", 32 | audio_bitrate = "192k", 33 | 34 | -- Video settings 35 | video_codec = "libx265", 36 | video_crf = "24", 37 | video_pixel_format = "yuv420p10", 38 | video_width = "", -- source width if not specified 39 | video_height = "", -- source height if not specified 40 | video_upscale = false, -- upscale if video res is lower than desired res 41 | 42 | -- Misc settings 43 | encoding_preset = "medium", -- empty for no preset 44 | output_directory = "/tmp", 45 | clear_start_stop_on_encode = true, 46 | block_exit = false, -- stop mpv from quitting before the encode finished, if false… 47 | -- …mpv will quit but ffmpeg will be kept alive 48 | } 49 | options.read_options(o) 50 | 51 | -- Global mutable variables 52 | local start_frame = nil 53 | local stop_frame = nil 54 | 55 | function encode() 56 | if not start_frame then 57 | mp.osd_message("No start frame set!") 58 | return 59 | end 60 | if not stop_frame then 61 | mp.osd_message("No stop frame set!") 62 | return 63 | end 64 | if start_frame == stop_frame then 65 | mp.osd_message("Cannot create zero length clip!", 1.5) 66 | end 67 | 68 | local path = mp.get_property("path") 69 | local out = o.output_directory 70 | .. "/" 71 | .. mp.get_property("media-title") 72 | .. "-clip-" 73 | .. start_frame 74 | .. "-" 75 | .. stop_frame 76 | .. ".mkv" 77 | 78 | local width = mp.get_property("width") 79 | local height = mp.get_property("height") 80 | if o.video_width ~= "" and (o.video_width < width or o.video_upscale) then 81 | width = o.video_width 82 | end 83 | if o.video_height ~= "" and (o.video_height < height or o.video_upscale) then 84 | height = o.video_height 85 | end 86 | 87 | local saf = start_frame 88 | local sof = stop_frame 89 | if o.clear_start_stop_on_encode then 90 | start_frame = nil 91 | stop_fram = nil 92 | end 93 | 94 | local preset = "" 95 | if o.encoding_preset ~= "" then 96 | preset = "-preset " .. o.encoding_preset 97 | end 98 | 99 | -- Check if ytdl is needed 100 | local input 101 | if not os.execute('ffprobe "' .. path .. '"') then 102 | input = 'youtube-dl "' .. path .. '" -o - | ffmpeg -i -' 103 | else 104 | input = 'ffmpeg -i "' .. path .. '"' 105 | end 106 | 107 | -- FIXME: Map metadata properly, like chapters or embedded fonts 108 | local command = input 109 | .. " -ss " 110 | .. saf 111 | .. " -t " 112 | .. sof - saf 113 | .. " -c:a " 114 | .. o.audio_codec 115 | .. " -b:a " 116 | .. o.audio_bitrate 117 | .. " -c:v " 118 | .. o.video_codec 119 | .. " -pix_fmt " 120 | .. o.video_pixel_format 121 | .. " -crf " 122 | .. o.video_crf 123 | .. " -s " 124 | .. width 125 | .. "x" 126 | .. height 127 | .. " " 128 | .. preset 129 | .. ' "' 130 | .. out 131 | .. '"' 132 | local time = os.time() 133 | 134 | mp.osd_message("Starting encode from " .. saf .. " to " .. sof .. " into " .. out, 3.5) 135 | if o.block_exit then 136 | os.execute(command) 137 | mp.osd_message("Finished encode of " .. out .. " in " .. os.time() - time .. " seconds", 3.5) 138 | else 139 | -- FIXME: Won't work on Windows, because of special snowflake pipe naming 140 | local ipc = mp.get_property("input-ipc-server") 141 | local del_tmp = "" 142 | if ipc == "" then 143 | ipc = os.tmpname() 144 | mp.set_property("input-ipc-server", ipc) 145 | del_tmp = " && lua -e 'os.remove(\"" .. ipc .. "\")'" 146 | end 147 | os.execute( 148 | command 149 | .. ' && echo "{ \\"command\\": [\\"show-text\\", \\"Finished encode of \'' 150 | .. out 151 | .. "' in $(lua -e \"print(os.time()-" 152 | .. time 153 | .. ')") seconds\\", 3500] }" | socat - ' 154 | .. ipc 155 | .. del_tmp 156 | .. " &" 157 | ) 158 | end 159 | end 160 | 161 | -- Start frame key binding 162 | mp.add_key_binding(o.key_set_start_frame, "clip-start", function() 163 | start_frame = mp.get_property("playback-time") 164 | if not start_frame then 165 | start_frame = 0 166 | end 167 | mp.osd_message("Clip start at " .. start_frame .. "s") 168 | end) 169 | -- Stop frame key binding 170 | mp.add_key_binding(o.key_set_stop_frame, "clip-end", function() 171 | stop_frame = mp.get_property("playback-time") 172 | if not stop_frame then 173 | mp.osd_message("playback-time is nil! (file not yet loaded?)") 174 | else 175 | mp.osd_message("Clip end at " .. stop_frame .. "s") 176 | end 177 | end) 178 | -- Start encode key binding 179 | mp.add_key_binding(o.key_start_encode, "clip-encode", function() 180 | encode() 181 | end) 182 | 183 | -- Reset start/stop frame when a new file is loaded 184 | mp.register_event("start-file", function() 185 | start_frame = nil 186 | stop_frame = nil 187 | end) 188 | -------------------------------------------------------------------------------- /config/ncspot/config.toml: -------------------------------------------------------------------------------- 1 | use_nerdfont = true 2 | 3 | [keybindings] 4 | "Ctrl+f" = "focus search" 5 | "Ctrl+g" = "focus queue" 6 | "Ctrl+l" = "focus library" 7 | 8 | # Spotify 9 | [theme] 10 | background = "#181818" 11 | primary = "#F1F1F1" 12 | secondary = "#DCDCDC" 13 | title = "#1ED760" 14 | playing = "#1ED760" 15 | playing_selected = "#1ED760" 16 | playing_bg = "#181818" 17 | highlight = "#1DB954" 18 | highlight_bg = "#000000" 19 | error = "#FFE4E4" 20 | error_bg = "#A50000" 21 | statusbar = "#000000" 22 | statusbar_progress = "#00AC4C" 23 | statusbar_bg = "#00AC4C" 24 | cmdline = "#CBFFDE" 25 | cmdline_bg = "#444444" 26 | 27 | -------------------------------------------------------------------------------- /config/nvim/.luacheckrc: -------------------------------------------------------------------------------- 1 | exclude_files = { "undo/**/*.lua", "plugin/packer_compiled.lua" } 2 | 3 | std = "luajit" 4 | codes = true 5 | 6 | self = false 7 | 8 | cache = true 9 | 10 | globals = { "vim" } 11 | -------------------------------------------------------------------------------- /config/nvim/.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "workspace.library": [ 3 | "/home/rockerboo/.config/nvim", 4 | "/home/rockerboo/.config/local/share/nvim/site", 5 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/Comment.nvim", 6 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/LuaSnip", 7 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/boo-colorscheme-nvim", 8 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/cmp-git", 9 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/cmp-nvim-lsp", 10 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/cmp-nvim-lsp-signature-help", 11 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/cmp-nvim-lua", 12 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/cmp-treesitter", 13 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/cmp-vsnip", 14 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/cmp_luasnip", 15 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/diffview.nvim", 16 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/dressing.nvim", 17 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/editorconfig.nvim", 18 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/express_line.nvim", 19 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/fidget.nvim", 20 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/formatter.nvim", 21 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/gleam.vim", 22 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/goyo.vim", 23 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/harpoon", 24 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/impatient.nvim", 25 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/limelight.vim", 26 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/lsp-status.nvim", 27 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/lspkind-nvim", 28 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/luv-vimdocs", 29 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/neogen", 30 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nim.nvim", 31 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-cmp", 32 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-colorizer.lua", 33 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-dap", 34 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-dap-python", 35 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-dap-ui", 36 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-dap-virtual-text", 37 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-lint", 38 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-lspconfig", 39 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-luaref", 40 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-semantic-tokens", 41 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-terminal.lua", 42 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-tree.lua", 43 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-treesitter", 44 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-treesitter-textsubjects", 45 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-ts-autotag", 46 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-ts-context-commentstring", 47 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-ts-hint-textobject", 48 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/nvim-web-devicons", 49 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/octo.nvim", 50 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/one-small-step-for-vimkind", 51 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/playground", 52 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/plenary.nvim", 53 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/popup.nvim", 54 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/rust-tools.nvim", 55 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/symbols-outline.nvim", 56 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/telescope-dap.nvim", 57 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/telescope-fzf-native.nvim", 58 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/telescope.nvim", 59 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/tokyonight.nvim", 60 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/trouble.nvim", 61 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/typescript.nvim", 62 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/vim-dadbod", 63 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/vim-dadbod-ui", 64 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/vim-doge", 65 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/vim-erlang-runtime", 66 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/vim-fugitive", 67 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/vim-hardtime", 68 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/vim-nightfly-guicolors", 69 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/vim-styled-components", 70 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/vim-surround", 71 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/opt/packer.nvim", 72 | "/usr/local/share/nvim/runtime", 73 | "/usr/local/lib/nvim", 74 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/cmp-nvim-lsp/after", 75 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/cmp-nvim-lsp-signature-help/after", 76 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/cmp-nvim-lua/after", 77 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/cmp-treesitter/after", 78 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/cmp-vsnip/after", 79 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/cmp_luasnip/after", 80 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/editorconfig.nvim/after", 81 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/octo.nvim/after", 82 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/playground/after", 83 | "/home/rockerboo/.config/local/share/nvim/site/pack/packer/start/vim-styled-components/after", 84 | "/home/rockerboo/.config/nvim/after", 85 | "${3rd}/luassert/library", 86 | "${3rd}/luassert/library" 87 | ] 88 | } -------------------------------------------------------------------------------- /config/nvim/after/ftdetect/elixir.vim: -------------------------------------------------------------------------------- 1 | 2 | " au BufRead,BufNewFile *.ex,*.exs set filetype=elixir 3 | " au BufRead,BufNewFile *.eex,*.leex,*.sface set filetype=eelixir 4 | " au BufRead,BufNewFile mix.lock set filetype=elixir 5 | " au BufRead,BufNewFile * call s:DetectElixir() 6 | 7 | " function! s:DetectElixir() 8 | " if (!did_filetype() || &filetype !=# 'elixir') && getline(1) =~# '^#!.*\' 9 | " set filetype=elixir 10 | " endif 11 | " endfunction 12 | -------------------------------------------------------------------------------- /config/nvim/after/ftdetect/gleam.vim: -------------------------------------------------------------------------------- 1 | au BufRead,BufNewFile *.gleam set filetype=gleam 2 | 3 | -------------------------------------------------------------------------------- /config/nvim/after/ftdetect/gotmpl.vim: -------------------------------------------------------------------------------- 1 | " autocmd BufNewFile,BufRead * if search('{{.\+}}', 'nw') | setlocal filetype=gotmpl | endif 2 | -------------------------------------------------------------------------------- /config/nvim/after/ftdetect/html.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { 2 | pattern = "*.html.eex", 3 | command = "set filetype=html_eex", 4 | }) 5 | -------------------------------------------------------------------------------- /config/nvim/after/ftdetect/javascript.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockerBOO/dotfiles/17bfb24bbfc0e3ef2985700f81ec74ca4a20c482/config/nvim/after/ftdetect/javascript.lua -------------------------------------------------------------------------------- /config/nvim/after/ftdetect/typescript.vim: -------------------------------------------------------------------------------- 1 | " autocmd BufNewFile,BufRead set filetype=typescript 2 | 3 | " autocmd BufNewFile,BufReadPost setfiletype typescript.vim 4 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/elixir.lua: -------------------------------------------------------------------------------- 1 | local set = vim.keymap.set 2 | local silent = { silent = true } 3 | local n = "n" 4 | 5 | local add_newline = function(data) 6 | if type(data) == "table" then 7 | if data[#data] ~= "" then 8 | table.insert(data, "") 9 | end 10 | elseif type(data) == "string" then 11 | if data:sub(-1) ~= "\n" then 12 | data = data .. "\n" 13 | end 14 | end 15 | return data 16 | end 17 | 18 | local skip_blank_lines = function(data) 19 | if type(data) == "string" then 20 | data = vim.fn.split(data, "\n") 21 | end 22 | return vim.tbl_filter(function(line) 23 | return line ~= "" 24 | end, data) 25 | end 26 | 27 | local unindent = function(data) 28 | if type(data) == "string" then 29 | data = vim.fn.split(data, "\n") 30 | end 31 | return vim.tbl_map(vim.fn.trim, data) 32 | end 33 | 34 | vim.keymap.set( 35 | n, 36 | "tt", 37 | -- ":sp:term python %", 38 | ":sp:term mix test %", 39 | silent 40 | ) 41 | 42 | vim.keymap.set(n, "tr", function() 43 | local position = vim.api.nvim_win_get_cursor(0) 44 | vim.print(position) 45 | 46 | local name = vim.api.nvim_buf_get_name(0) 47 | 48 | local buf = vim.api.nvim_create_buf(false, false) 49 | local winid = vim.api.nvim_open_win(buf, true, { split = "below" }) 50 | local chan = vim.api.nvim_open_term(buf, {}) 51 | local cmd = { "mix test --include line:" .. position[1] .. " " .. name } 52 | 53 | cmd = unindent(cmd) 54 | cmd = skip_blank_lines(cmd) 55 | cmd = add_newline(cmd) 56 | vim.api.nvim_chan_send( 57 | chan, 58 | vim.iter(cmd):fold("", function(acc, v) 59 | return acc .. v 60 | end) 61 | ) 62 | -- ":sp:term mix test %", 63 | end, silent) 64 | 65 | -- get the test blocks in elixir using treesitter 66 | -- (call 67 | -- target: (identifier) @block 68 | -- (arguments) @t 69 | -- (do_block) @b) 70 | 71 | -- local capabilities = require("cmp_nvim_lsp").update_capabilities( 72 | -- vim.lsp.protocol.make_client_capabilities() 73 | -- ) 74 | -- require("elixir").setup({ 75 | -- cmd = "elixir-ls", 76 | -- capabilities = capabilities, 77 | -- on_attach = function(client, bufnr) 78 | -- print("Connected to elixir ls") 79 | -- require("lsp").on_attach_buffer(client, bufnr) 80 | -- 81 | -- local map_opts = { buffer = true, noremap = true } 82 | -- vim.keymap.set("n", "co", function() 83 | -- vim.cmd([[ echo codelens run ]]) 84 | -- vim.lsp.codelens.run() 85 | -- end, map_opts) 86 | -- end, 87 | -- }) 88 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/elixir.vim: -------------------------------------------------------------------------------- 1 | set path=.,lib/**,test/** 2 | 3 | " nnoremap r :Dispatch mix run 4 | " nnoremap t :Dispatch mix test 5 | 6 | setlocal shiftwidth=2 softtabstop=2 expandtab iskeyword+=!,? 7 | setlocal comments=:# 8 | setlocal commentstring=#\ %s 9 | 10 | " setlocal suffixesadd=.ex,.exs,.eex,.leex,.sface,.erl,.xrl,.yrl,.hrl 11 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/gdscript.lua: -------------------------------------------------------------------------------- 1 | vim.opt.expandtab = false 2 | vim.opt.tabstop = 4 3 | vim.opt.shiftwidth = 4 4 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/gitcommit.vim: -------------------------------------------------------------------------------- 1 | set tw=68 spell 2 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/gleam.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("n", "rr", function() 2 | vim.cmd("new") 3 | 4 | vim.cmd("terminal /home/rockerboo/code/others/gleam/target/release/gleam run") 5 | -- vim.api.nvim_feedkeys("i", "n", false) 6 | end, { desc = "Run a gleam program" }) 7 | 8 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/javascript.lua: -------------------------------------------------------------------------------- 1 | require("plugin.jester").mappings() 2 | 3 | vim.keymap.set("n", "rr", function() 4 | local file = vim.fn.expand("%") -- Get the current file name 5 | local escaped_file = vim.fn.shellescape(file) 6 | vim.cmd("new") 7 | vim.cmd("terminal node " .. escaped_file) 8 | vim.api.nvim_feedkeys("i", "n", false) 9 | end, { desc = "Execute javascript file with nodejs" }) 10 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/javascriptreact.lua: -------------------------------------------------------------------------------- 1 | -- require("plugin.jester").mappings() 2 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/lua.vim: -------------------------------------------------------------------------------- 1 | setlocal tabstop=2 expandtab 2 | 3 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/markdown.lua: -------------------------------------------------------------------------------- 1 | -- vim.bo.spell = true 2 | vim.opt_local.spell = true 3 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/python.lua: -------------------------------------------------------------------------------- 1 | -- vim.keymap.set( 2 | -- "n", 3 | -- "rr", 4 | -- -- ":sp:term python %", 5 | -- ":sp:term poetry run python %", 6 | -- { silent = true } 7 | -- ) 8 | 9 | vim.keymap.set("n", "rr", function() 10 | local file = vim.fn.expand("%") -- Get the current file name 11 | local escaped_file = vim.fn.shellescape(file) 12 | vim.cmd("new") 13 | vim.cmd("terminal source .env && python " .. escaped_file) 14 | vim.api.nvim_feedkeys("i", "n", false) 15 | end, { desc = "Execute python file with .env" }) 16 | 17 | vim.keymap.set("n", "ra", function() 18 | vim.cmd(":sp") 19 | vim.cmd(":term accelerate launch %") 20 | end, {}) 21 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/python.vim: -------------------------------------------------------------------------------- 1 | set shiftwidth=4 tabstop=4 softtabstop=4 expandtab autoindent smartindent 2 | setlocal colorcolumn=80 3 | 4 | setlocal path=.,**,tests,bin/** 5 | setlocal wildignore=*/__pycache__/*,*.pyc 6 | 7 | " nnoremap tt sp:term pytest % 8 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/rust.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("n", "tt", ":RustLastRun", { silent = true, buffer = 0 }) 2 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/text.lua: -------------------------------------------------------------------------------- 1 | local n = "n" 2 | local v = "v" 3 | 4 | local voices = require("rockerboo.voices") 5 | 6 | local silent = { silent = true } 7 | 8 | vim.keymap.set(n, "tr", voices.voices) 9 | vim.keymap.set(n, "ss", voices.save_voice) 10 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/toml.vim: -------------------------------------------------------------------------------- 1 | set softtabstop=2 shiftwidth=2 expandtab 2 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/typescript.lua: -------------------------------------------------------------------------------- 1 | -- require("plugin.jester").mappings() 2 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/typescript.tsx.vim: -------------------------------------------------------------------------------- 1 | 2 | " autocmd BufWritePre :lua vim.lsp.buf.formatting_sync(opts, 1000) 3 | 4 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/typescript.vim: -------------------------------------------------------------------------------- 1 | 2 | " autocmd BufWritePre :lua vim.lsp.buf.formatting_sync(opts, 1000) 3 | 4 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/typescriptreact.lua: -------------------------------------------------------------------------------- 1 | -- require("plugin.jester").mappings() 2 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/vim.vim: -------------------------------------------------------------------------------- 1 | set tabstop=2 expandtab 2 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/yaml.lua: -------------------------------------------------------------------------------- 1 | vim.opt_local.tabstop = 2 2 | vim.opt_local.softtabstop = 2 3 | vim.opt_local.shiftwidth = 2 4 | 5 | vim.opt_local.expandtab = true 6 | vim.opt_local.autoindent = false 7 | vim.opt_local.smartindent = false 8 | -------------------------------------------------------------------------------- /config/nvim/after/indent/elixir.vim: -------------------------------------------------------------------------------- 1 | " if exists("b:did_indent") 2 | " finish 3 | " end 4 | " let b:did_indent = 1 5 | 6 | " setlocal indentexpr=elixir#indent(v:lnum) 7 | 8 | " setlocal indentkeys+==after,=catch,=do,=else,=end,=rescue, 9 | " setlocal indentkeys+=*,=->,=\|>,=<>,0},0],0) 10 | 11 | " " TODO: @jbodah 2017-02-27: all operators should cause reindent when typed 12 | 13 | " function! elixir#indent(lnum) 14 | " return elixir#indent#indent(a:lnum) 15 | " endfunction 16 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/ale.vim: -------------------------------------------------------------------------------- 1 | " dense-analysis/ale 2 | 3 | let g:ale_sign_error = '>' 4 | let g:ale_sign_warning = '-' 5 | 6 | 7 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/dap.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("n", "dk", function() 2 | require("dap").continue() 3 | end) 4 | vim.keymap.set("n", "ddt", function() 5 | require("dap").step_over() 6 | end) 7 | vim.keymap.set("n", "do", function() 8 | require("dap").step_into() 9 | end) 10 | vim.keymap.set("n", "di", function() 11 | require("dap").step_out() 12 | end) 13 | vim.keymap.set("n", "b", function() 14 | require("dap").toggle_breakpoint() 15 | end) 16 | vim.keymap.set("n", "B", function() 17 | require("dap").set_breakpoint() 18 | end) 19 | vim.keymap.set("n", "lp", function() 20 | require("dap").set_breakpoint(nil, nil, vim.fn.input("Log point message: ")) 21 | end) 22 | vim.keymap.set("n", "dr", function() 23 | require("dap").repl.open() 24 | end) 25 | vim.keymap.set("n", "dl", function() 26 | require("dap").run_last() 27 | end) 28 | vim.keymap.set({ "n", "v" }, "dh", function() 29 | require("dap.ui.widgets").hover(nil, { border = "none" }) 30 | end) 31 | vim.keymap.set({ "n", "v" }, "dp", function() 32 | require("dap.ui.widgets").preview() 33 | end) 34 | vim.keymap.set("n", "df", function() 35 | local widgets = require("dap.ui.widgets") 36 | widgets.centered_float(widgets.frames) 37 | end) 38 | vim.keymap.set("n", "ds", function() 39 | local widgets = require("dap.ui.widgets") 40 | widgets.centered_float(widgets.scopes) 41 | end) 42 | 43 | local dap = require("dap") 44 | 45 | -- ADAPTERS 46 | -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 47 | 48 | dap.adapters.node2 = function(cb, config) 49 | if config.preLaunchTask then 50 | vim.fn.system(config.preLaunchTask) 51 | end 52 | local adapter = { 53 | type = "executable", 54 | command = "node", 55 | args = { 56 | "/mnt/900/builds/vscode-node-debug2/out/src/nodeDebug.js", 57 | }, 58 | } 59 | cb(adapter) 60 | end 61 | 62 | -- WIP does not execute 63 | dap.adapters.deno = function(cb) 64 | local adapter = { 65 | type = "executable", 66 | command = "deno", 67 | } 68 | cb(adapter) 69 | end 70 | 71 | dap.adapters.firefox = { 72 | type = "executable", 73 | command = "node", 74 | args = { 75 | os.getenv("HOME") .. "/build/vscode-firefox-debug/dist/adapter.bundle.js", 76 | }, 77 | } 78 | 79 | dap.adapters.yarn = { 80 | type = "executable", 81 | command = "yarn", 82 | args = { 83 | "run", 84 | "--inspect-brk", 85 | "/mnt/900/builds/vscode-node-debug2/out/src/nodeDebug.js", 86 | }, 87 | } 88 | 89 | dap.adapters.yarn_jest = { 90 | type = "executable", 91 | command = "yarn", 92 | args = { 93 | "run", 94 | "--inspect-brk", 95 | "jest", 96 | }, 97 | } 98 | 99 | dap.adapters.yarn_firefox = { 100 | type = "executable", 101 | command = "yarn", 102 | args = { 103 | "node", 104 | "--inspect-brk", 105 | os.getenv("HOME") .. "/build/vscode-firefox-debug/dist/adapter.bundle.js", 106 | }, 107 | } 108 | 109 | -- lldb/rust 110 | dap.adapters.lldb = { 111 | type = "executable", 112 | command = "/usr/bin/lldb-vscode", -- adjust as needed 113 | name = "lldb", 114 | } 115 | 116 | -- need to update this to work 117 | -- dap.adapters.nlua = function(callback, config) 118 | -- callback({ 119 | -- type = "server", 120 | -- host = config.host, 121 | -- port = config.port, 122 | -- }) 123 | -- end 124 | 125 | -- LAUNCHERS 126 | -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 127 | 128 | local nlua = { 129 | type = "nlua", 130 | request = "attach", 131 | name = "Attach to running Neovim instance", 132 | host = function() 133 | local value = vim.fn.input("Host [127.0.0.1]: ") 134 | if value ~= "" then 135 | return value 136 | end 137 | return "127.0.0.1" 138 | end, 139 | port = function() 140 | local val = tonumber(vim.fn.input("Port: ")) 141 | assert(val, "Please provide a port number") 142 | return val 143 | end, 144 | } 145 | 146 | local firefox = { 147 | name = "Debug with Firefox", 148 | type = "firefox", 149 | request = "launch", 150 | reAttach = true, 151 | sourceMaps = true, 152 | url = "http://localhost:6969", 153 | webRoot = "${workspaceFolder}", 154 | firefoxExecutable = "/usr/bin/firefox", 155 | } 156 | 157 | local node2 = { 158 | name = "Launch node", 159 | type = "node2", 160 | request = "launch", 161 | program = "${file}", 162 | cwd = vim.fn.getcwd(), 163 | sourceMaps = true, 164 | protocol = "inspector", 165 | console = "integratedTerminal", 166 | } 167 | 168 | local yarn = { 169 | name = "Launch node", 170 | type = "yarn", 171 | request = "launch", 172 | program = "${file}", 173 | cwd = vim.fn.getcwd(), 174 | sourceMaps = true, 175 | protocol = "inspector", 176 | console = "integratedTerminal", 177 | } 178 | 179 | local tauri_dev = { 180 | type = "lldb", 181 | request = "launch", 182 | name = "Tauri Development Debug", 183 | args = { 184 | "cargo", 185 | "build", 186 | "--manifest-path=./src-tauri/Cargo.toml", 187 | "--no-default-features", 188 | }, 189 | -- task for the `beforeDevCommand` if used, must be configured in `.vscode/tasks.json` 190 | -- preLaunchTask = "ui:dev" 191 | } 192 | 193 | local tauri_prod = { 194 | type = "lldb", 195 | request = "launch", 196 | name = "Tauri Production Debug", 197 | args = { 198 | "cargo", 199 | "build", 200 | "--release", 201 | "--manifest-path=./src-tauri/Cargo.toml", 202 | }, 203 | -- // task for the `beforeBuildCommand` if used, must be configured in `.vscode/tasks.json` 204 | -- "preLaunchTask": "ui:build" 205 | } 206 | 207 | local lldb = { 208 | name = "Launch lldb", 209 | type = "lldb", 210 | request = "launch", 211 | program = function() 212 | return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") 213 | end, 214 | cwd = "${workspaceFolder}", 215 | stopOnEntry = false, 216 | args = {}, 217 | 218 | -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting: 219 | -- 220 | -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope 221 | -- 222 | -- Otherwise you might get the following error: 223 | -- 224 | -- Error on launch: Failed to attach to the target process 225 | -- 226 | -- But you should be aware of the implications: 227 | -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html 228 | runInTerminal = false, 229 | } 230 | 231 | -- WIP does not launch properly, maybe needs a different runtime args 232 | local deno = { 233 | name = "Launch Deno", 234 | type = "deno", 235 | request = "launch", 236 | cwd = "${workspaceFolder}", 237 | runtimeExecutable = "deno", 238 | runtimeArgs = { "run", "--inspect-brk", "-A", "${file}" }, 239 | port = 9229, 240 | } 241 | 242 | -- ADAPTERS 243 | -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 244 | 245 | local node_attach = { 246 | -- For this to work you need to make sure the node process is started with the `--inspect` flag. 247 | name = "Attach to node process", 248 | type = "node2", 249 | request = "attach", 250 | processId = require("dap.utils").pick_process, 251 | } 252 | 253 | -- CONFIGURATIONS 254 | -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 255 | 256 | dap.configurations.javascript = { firefox, node2, deno, node_attach } 257 | dap.configurations.javascriptreact = { 258 | firefox, 259 | node2, 260 | deno, 261 | node_attach, 262 | } 263 | 264 | dap.configurations.typescript = { firefox, node2, deno, node_attach } 265 | dap.configurations.typescriptreact = { 266 | node2, 267 | firefox, 268 | deno, 269 | node_attach, 270 | } 271 | 272 | -- dap.configurations.rust = { 273 | -- lldb, 274 | -- tauri_dev, 275 | -- tauri_prod, 276 | -- } 277 | 278 | dap.configurations.lua = { 279 | nlua, 280 | } 281 | 282 | -- au FileType dap-repl lua require('dap.ext.autocompl').attach() 283 | 284 | vim.api.nvim_create_autocmd("FileType", { 285 | pattern = "dap-repl", 286 | callback = function() 287 | require("dap.ext.autocompl").attach() 288 | end, 289 | }) 290 | 291 | -- require('dap-python').setup('/mnt/900/builds/prs/.virtualenvs/debugpy/bin/python') 292 | 293 | -- prs 294 | require("dap-python").setup("/mnt/900/builds/miniconda3/envs/prs/bin/python") 295 | 296 | table.insert(require("dap").configurations.python, { 297 | type = "python", 298 | request = "launch", 299 | name = "My custom launch configuration", 300 | program = "${file}", 301 | justMyCode = false, 302 | -- ... more options, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings 303 | }) 304 | 305 | -- setup extensions 306 | require("nvim-dap-virtual-text").setup() 307 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/dap.vim: -------------------------------------------------------------------------------- 1 | au FileType dap-repl lua require('dap.ext.autocompl').attach() 2 | " nnoremap :lua require'dap'.continue() 3 | " nnoremap :lua require'dap'.step_over() 4 | " nnoremap :lua require'dap'.step_into() 5 | " nnoremap :lua require'dap'.step_out() 6 | " nnoremap b :lua require'dap'.toggle_breakpoint() 7 | " nnoremap B :lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: ')) 8 | " nnoremap lp :lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) 9 | " nnoremap dr :lua require'dap'.repl.open() 10 | " nnoremap dl :lua require'dap'.run_last() 11 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/diagnostic.vim: -------------------------------------------------------------------------------- 1 | " diagnostic-nvim 2 | 3 | " let g:diagnostic_enable_virtual_text = 1 4 | " let g:diagnostic_auto_popup_while_jump = 1 5 | 6 | " nnoremap ? :OpenDiagnostic 7 | 8 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/elixir.lua: -------------------------------------------------------------------------------- 1 | 2 | -- local capabilities = require("cmp_nvim_lsp").update_capabilities( 3 | -- vim.lsp.protocol.make_client_capabilities() 4 | -- ) 5 | -- require("elixir").setup({ 6 | -- cmd = { "elixir-ls" }, 7 | -- capabilities = capabilities, 8 | -- on_attach = function(client, bufnr) 9 | -- print("Connected to elixir ls") 10 | -- require("lsp").on_attach_buffer(client, bufnr) 11 | -- 12 | -- local map_opts = { buffer = true, noremap = true } 13 | -- vim.keymap.set("n", "co", function() 14 | -- vim.cmd([[ echo codelens run ]]) 15 | -- vim.lsp.codelens.run() 16 | -- end, map_opts) 17 | -- end, 18 | -- }) 19 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/fzf.vim: -------------------------------------------------------------------------------- 1 | 2 | " fzf file fuzzy search that respects .gitignore 3 | " If in git directory, show only files that are committed, staged, or unstaged 4 | " else use regular :Files 5 | " nnoremap p (len(system('git rev-parse')) > 0 ? ':Files' : ':GFiles --exclude-standard --others --cached')."\" 6 | 7 | 8 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/keymaps.vim: -------------------------------------------------------------------------------- 1 | nnoremap {-> v:hlsearch ? ":nohl\" : "\"}() 2 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/lsp.lua: -------------------------------------------------------------------------------- 1 | -- local on_list = typescript.on_list 2 | 3 | local set = vim.keymap.set 4 | local n = "n" 5 | 6 | local group = vim.api.nvim_create_augroup("LspMappings", { clear = true }) 7 | 8 | vim.api.nvim_create_autocmd("LspAttach", { 9 | group = group, 10 | callback = function(args) 11 | local opts = { buffer = args.buf, silent = true } 12 | 13 | set(n, "gd", function() 14 | -- vim.lsp.buf.definition({ on_list = on_list }) 15 | vim.lsp.buf.definition({}) 16 | end, opts) 17 | set(n, "K", vim.lsp.buf.hover, opts) 18 | set(n, "", vim.lsp.buf.signature_help, opts) 19 | 20 | set(n, "gD", function() 21 | -- vim.lsp.buf.implementation({ on_list = on_list }) 22 | vim.lsp.buf.implementation({}) 23 | end, opts) 24 | 25 | set(n, "1gD", function() 26 | -- vim.lsp.buf.type_definition({ on_list = on_list }) 27 | vim.lsp.buf.type_definition({}) 28 | end, opts) 29 | set(n, "gr", function() 30 | vim.lsp.buf.references() 31 | end, opts) 32 | 33 | set(n, "", function() 34 | -- vim.lsp.buf.declaration({ on_list = on_list }) 35 | vim.lsp.buf.declaration({}) 36 | end, opts) 37 | 38 | set(n, "re", vim.lsp.buf.rename, opts) 39 | set(n, "ca", vim.lsp.buf.code_action, opts) 40 | 41 | set(n, "ih", function() 42 | vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) 43 | end, opts) 44 | 45 | -- diagnostics 46 | set(n, "di", vim.diagnostic.open_float, opts) 47 | set(n, "k", function() 48 | vim.diagnostic.jump({ float = true, count = -1 }) 49 | end, opts) 50 | set(n, "j", function() 51 | vim.diagnostic.jump({ float = true, count = 1 }) 52 | end, opts) 53 | end, 54 | }) 55 | 56 | -- vim.api.nvim_create_autocmd("LspDetach", { 57 | -- group = group, 58 | -- callback = function(args) 59 | -- local opts = { buffer = args.buf } 60 | -- 61 | -- -- vim.keymap.del errors if keymap doesn't exist 62 | -- -- so we get one of the keymaps that should exist 63 | -- -- and exit if it doesn't exist 64 | -- local has_keymap = vim.tbl_filter(function(v) 65 | -- return v.lhs == "gd" 66 | -- end, vim.api.nvim_buf_get_keymap(args.buf, n)) 67 | -- 68 | -- if #has_keymap == 0 then 69 | -- return 70 | -- end 71 | -- 72 | -- del(n, "gd", opts) 73 | -- del(n, "K", opts) 74 | -- del(n, "", opts) 75 | -- 76 | -- del(n, "gD", opts) 77 | -- 78 | -- del(n, "1gD", opts) 79 | -- del(n, "gr", opts) 80 | -- 81 | -- del(n, "", opts) 82 | -- 83 | -- del(n, "re", opts) 84 | -- del(n, "ca", opts) 85 | -- 86 | -- -- diagnostics 87 | -- del(n, "di", opts) 88 | -- del(n, "k", opts) 89 | -- del(n, "j", opts) 90 | -- end, 91 | -- }) 92 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/lsp.vim: -------------------------------------------------------------------------------- 1 | augroup LSPCursor 2 | autocmd! 3 | " autocmd CursorHold,CursorHoldI :lua vim.lsp.buf.hover() 4 | augroup END 5 | 6 | " Setup default LSP keybinds 7 | " MOVED TO lua/mappings.lua 8 | " nnoremap gd lua vim.lsp.buf.definition() 9 | " nnoremap K lua vim.lsp.buf.hover() 10 | " nnoremap gD lua vim.lsp.buf.implementation() 11 | " nnoremap 1gD lua vim.lsp.buf.type_definition() 12 | " nnoremap gr lua require'telescope.builtin'.lsp_references{} 13 | " nnoremap g0 lua vim.lsp.buf.document_symbol() 14 | " nnoremap gW lua vim.lsp.buf.workspace_symbol() 15 | " nnoremap re lua vim.lsp.buf.rename() 16 | " nnoremap ca lua vim.lsp.buf.code_action() 17 | " nnoremap lua vim.lsp.buf.declaration() 18 | 19 | 20 | " nnoremap di lua vim.lsp.util.show_line_diagnostics() 21 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/luaformat.vim: -------------------------------------------------------------------------------- 1 | " augroup LuaFormatter 2 | " autocmd! 3 | " autocmd FileType lua nnoremap :call LuaFormat() 4 | " "autocmd BufWrite *.lua call LuaFormat() 5 | " augroup end 6 | " 7 | 8 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/mappings.vim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockerBOO/dotfiles/17bfb24bbfc0e3ef2985700f81ec74ca4a20c482/config/nvim/after/plugin/mappings.vim -------------------------------------------------------------------------------- /config/nvim/after/plugin/prettier.vim: -------------------------------------------------------------------------------- 1 | " augroup Prettier 2 | " autocmd! 3 | " " Run Prettier on save 4 | " autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.md,*.json,*.graphql,*.vue,*.yaml,*.html Prettier 5 | " augroup end 6 | 7 | 8 | 9 | " prettier 10 | " let g:prettier#autoformat = 1 11 | " let g:prettier#autoformat_require_pragma = 0 12 | " let g:prettier#autoformat_config_present = 1 13 | " let g:prettier#autoformat_config_files = ['.prettierrc'] 14 | " let g:prettier#quickfix_enabled = 0 15 | 16 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/rust.lua: -------------------------------------------------------------------------------- 1 | local lsp = require("rockerboo.lsp") 2 | local capabilities = require("cmp_nvim_lsp").default_capabilities() 3 | local rt = require("rust-tools") 4 | 5 | require("rust-tools").setup({ 6 | tools = { 7 | hover_actions = { border = false }, 8 | cache = true, 9 | inlay_hints = { auto = false }, 10 | }, 11 | server = { 12 | on_attach = function(client, bufnr) 13 | -- Hover actions 14 | vim.keymap.set( 15 | "n", 16 | "", 17 | rt.hover_actions.hover_actions, 18 | { buffer = bufnr } 19 | ) 20 | -- Code action groups 21 | vim.keymap.set( 22 | "n", 23 | "a", 24 | rt.code_action_group.code_action_group, 25 | { buffer = bufnr } 26 | ) 27 | 28 | if require("rust-tools.cached_commands").execute_last_runnable then 29 | vim.keymap.set( 30 | "n", 31 | "tl", 32 | require("rust-tools.cached_commands").execute_last_runnable, 33 | { buffer = bufnr } 34 | ) 35 | end 36 | 37 | if 38 | require("rust-tools.cached_commands").execute_last_debuggable 39 | then 40 | vim.keymap.set( 41 | "n", 42 | "dl", 43 | require("rust-tools.cached_commands").execute_last_debuggable, 44 | 45 | { buffer = bufnr } 46 | ) 47 | end 48 | 49 | vim.keymap.set( 50 | "n", 51 | "dd", 52 | require("rust-tools.debuggables").debuggables, 53 | { buffer = bufnr } 54 | ) 55 | 56 | vim.keymap.set( 57 | "n", 58 | "tt", 59 | require("rust-tools.runnables").runnables, 60 | { buffer = bufnr } 61 | ) 62 | 63 | lsp.on_attach_buffer(client, bufnr) 64 | end, 65 | capabilities = capabilities, 66 | -- cmd = { 67 | -- "rustup", 68 | -- "run", 69 | -- "nightly", 70 | -- "rust-analyzer", 71 | -- }, 72 | settings = { 73 | ["rust-analyzer"] = { 74 | checkOnSave = { 75 | command = "clippy", 76 | }, 77 | diagnostics = { 78 | experimental = { 79 | enable = true, 80 | }, 81 | }, 82 | }, 83 | }, 84 | }, 85 | }) 86 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/telescope.vim: -------------------------------------------------------------------------------- 1 | " telescope.nvim 2 | " --- 3 | " let g:telescope_cache_results = 1 4 | 5 | " Open this file in a new tab 6 | nnoremap en lua require'plugin.telescope'.find_files{ cwd = "~/.config/nvim" } 7 | nnoremap eN lua require'telescope.builtin'.live_grep{ cwd = "~/.config/nvim" } 8 | 9 | " Telescope binds 10 | nnoremap gf :lua require'telescope.builtin'.git_files(require'telescope.themes'.get_dropdown()) 11 | nnoremap gg :lua require'plugin.telescope'.find_files_plugins() 12 | 13 | nnoremap gt :lua require'telescope.builtin'.treesitter(require'telescope.themes'.get_dropdown()) 14 | 15 | nnoremap gW :lua require'telescope.builtin'.lsp_workspace_symbols(require'telescope.themes'.get_dropdown()) 16 | nnoremap g0 :lua require'telescope.builtin'.lsp_document_symbols(require'telescope.themes'.get_dropdown()) 17 | 18 | " LSP 19 | 20 | " Grep files 21 | nnoremap gl :lua require'telescope.builtin'.live_grep{} 22 | 23 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/typescript.nvim.lua: -------------------------------------------------------------------------------- 1 | -- local lsp = require("rockerboo.lsp") 2 | -- local capabilities = require("cmp_nvim_lsp").default_capabilities() 3 | -- capabilities["textDocument"]["formatting"] = false 4 | -- 5 | -- require("typescript").setup({ 6 | -- server = { 7 | -- on_attach = lsp.on_attach_buffer, 8 | -- capabilities = capabilities, 9 | -- }, 10 | -- }) 11 | -------------------------------------------------------------------------------- /config/nvim/after/queries/ecma.scm: -------------------------------------------------------------------------------- 1 | 2 | 3 | ; (object_pattern (shorthand_property_identifier_pattern) @variable) 4 | -------------------------------------------------------------------------------- /config/nvim/after/queries/ecma/highlights.scm: -------------------------------------------------------------------------------- 1 | 2 | ; (object_pattern (shorthand_property_identifier_pattern) @variable) 3 | 4 | 5 | -------------------------------------------------------------------------------- /config/nvim/after/queries/ecma/injections.scm: -------------------------------------------------------------------------------- 1 | ;emotionStyled(Component)`` 2 | ; (call_expression 3 | ; function: (call_expression 4 | ; function: (identifier) @_name 5 | ; (#eq? @_name "emotionStyled")) 6 | ; arguments: ((template_string) @css 7 | ; (#offset! @css 0 1 0 -1))) 8 | -------------------------------------------------------------------------------- /config/nvim/after/queries/eelixir/highlights.scm: -------------------------------------------------------------------------------- 1 | ; inherits: eex 2 | 3 | [ 4 | "%>" 5 | "--%>" 6 | "<%!--" 7 | "<%" 8 | "<%#" 9 | "<%%=" 10 | "<%=" 11 | ] @tag.delimiter 12 | 13 | ; EEx comments are highlighted as such 14 | (comment) @comment 15 | 16 | ; Tree-sitter parser errors 17 | (ERROR) @error 18 | -------------------------------------------------------------------------------- /config/nvim/after/queries/elixir/old_custom_highlights.scm: -------------------------------------------------------------------------------- 1 | 2 | ;; anonymous 3 | 4 | "(" @punctuation.bracket 5 | ")" @punctuation.bracket 6 | "=" @operator 7 | "==" @operator 8 | "=>" @operator 9 | "->" @operator 10 | "!" @operator 11 | "+" @operator 12 | "-" @operator 13 | "<>" @operator 14 | "<<" @operator 15 | ">>" @operator 16 | "::" @operator 17 | "," @punctuation.delimiter 18 | "[" @punctuation.bracket 19 | "]" @punctuation.bracket 20 | 21 | "case" @keyword 22 | "cond" @keyword 23 | "fn" @keyword 24 | "do" @keyword 25 | "end" @keyword 26 | "def" @keyword 27 | "defp" @keyword 28 | 29 | "for" @keyword 30 | "if" @keyword 31 | "unless" @keyword 32 | "when" @keyword 33 | 34 | ;; Function calls 35 | 36 | ; (qualified_function_name 37 | ; "." @operator 38 | ; function_name: (variable) @function.call) 39 | 40 | (computed_function_name 41 | (variable) @function.call) 42 | 43 | ;; Definitions 44 | (defmodule 45 | "defmodule" @keyword 46 | modulename: (_) @type 47 | (do_block)) 48 | 49 | (module_attribute 50 | "@" @property 51 | (identifier) @property 52 | (_)) 53 | 54 | (def 55 | ["def" "defp"] 56 | [(atom) 57 | (identifier) @function] 58 | arguments: (variable)? 59 | (guard_clause)? 60 | (do_block)) 61 | 62 | (do_block 63 | [("do" @keyword 64 | (_) 65 | "end" @keyword) 66 | (", " @punctuation.delimiter 67 | "do:" @keyword 68 | (_))]) 69 | 70 | (alias) @type 71 | 72 | ;; Literals 73 | (number) @number 74 | 75 | ((variable) @comment 76 | (.match? @comment "^_")) 77 | (variable) @variable 78 | 79 | (boolean) @constant.builtin 80 | (comment) @comment 81 | 82 | ;; string 83 | 84 | (interpolation 85 | "#{" @punctuation.special 86 | (_)? 87 | "}" @punctuation.special) 88 | 89 | (module_attribute 90 | "@" @property.definition 91 | ((identifier) @property 92 | (.match? @property "doc$")) 93 | (string) @comment) 94 | 95 | (string) @string 96 | 97 | (charlist) @string 98 | 99 | (char) @string 100 | 101 | (bin_type) @type.builtin 102 | 103 | ;; map 104 | 105 | (map 106 | "%" @punctuation.special 107 | "{" @punctuation.special 108 | "}" @punctuation.special) 109 | 110 | (struct 111 | "%" @punctuation.special 112 | "{" @punctuation.special 113 | "}" @punctuation.special) 114 | 115 | ;; sigil 116 | 117 | (sigil) @string 118 | 119 | ; (identifier) @variable 120 | (def (identifier) @function) 121 | 122 | ; ; (function_name: (variable) @function) 123 | 124 | ; (variable) @variable 125 | 126 | ; ; keywords 127 | 128 | ; ; [ 129 | ; ; "defmodule" 130 | ; ; "def" 131 | ; ; "defp" 132 | ; ; "end" 133 | ; ; "try" 134 | ; ; ] @keyword 135 | 136 | [ 137 | "defmodule" 138 | ; "defstruct" 139 | "do" 140 | "def" 141 | "end" 142 | ; "use" 143 | ; "import" 144 | ] @keyword 145 | 146 | (computed_function_name (variable) @function) 147 | 148 | (expr_op rhs: (variable) @type) 149 | 150 | (defmodule (do_block (variable) @function)) 151 | 152 | ; ; ((module_attribute) @attribute 153 | ; ; (#match? @attribute "^@[a-z]+\s")) 154 | 155 | ; ; [ 156 | ; ; "case" 157 | ; ; ; "else" 158 | ; ; ; "elsif" 159 | ; ; ; "if" 160 | ; ; ; "unless" 161 | ; ; ; "when" 162 | ; ; ] @conditional 163 | 164 | ; ; (keyword_list ":" @punctuation.delimiter) 165 | ; ; (list "," @punctuation.delimiter) 166 | 167 | ; (case) @conditional 168 | 169 | (qualified_function_name 170 | module_name: (alias) @type 171 | function_name: (variable) @function 172 | ) 173 | 174 | ; ; (function_call 175 | ; ; function_name: (variable) @function) 176 | 177 | ; ; (arguments: struct (variable) @parameter) 178 | 179 | ; ; (map_entry (atom) @variable) 180 | ; ; (map_entry (atom) ":") @punctuation 181 | ; ; (map "%" @punctuation) 182 | (struct "%" @punctuation) 183 | 184 | (list (atom) @property) 185 | (map_entry (atom) @property) 186 | (tuple (atom) @property) 187 | ; ; (arguments: (keyword_list (atom) @property)) 188 | 189 | (string) @string 190 | (number) @number 191 | (atom) @property 192 | ; (comment) @comment 193 | 194 | (function_call (variable) @function) 195 | 196 | ; ; ["in","with"] @keyword 197 | 198 | [ 199 | "|" 200 | "^" 201 | "\\\\" 202 | "::" 203 | ] @operator 204 | 205 | [ 206 | "=" 207 | "==" 208 | "=>" 209 | "->" 210 | "|>" 211 | "+" 212 | "-" 213 | "*" 214 | "/" 215 | ] @operator 216 | 217 | [ 218 | "," 219 | "." 220 | ] @punctuation.delimiter 221 | 222 | [ 223 | "(" 224 | ")" 225 | "[" 226 | "]" 227 | "{" 228 | "}" 229 | ; "%{" 230 | ] @punctuation.bracket 231 | 232 | ; ; ["%{"] @punctuation.bracket 233 | 234 | (module_attribute (string) @comment) 235 | -------------------------------------------------------------------------------- /config/nvim/after/queries/gotmpl/highlights.scm: -------------------------------------------------------------------------------- 1 | ; Identifiers 2 | 3 | ([ 4 | (field) 5 | (field_identifier) 6 | ] @variable.member (#set! priority 105)) 7 | 8 | ((variable) @variable (#set! priority 105)) 9 | 10 | ; Function calls 11 | 12 | (function_call 13 | function: (identifier) @function (#set! priority 105)) 14 | 15 | (method_call 16 | method: (selector_expression 17 | field: (field_identifier) @function (#set! priority 105))) 18 | 19 | ; Builtin functions 20 | 21 | (function_call 22 | function: (identifier) @function.builtin 23 | (#set! priority 105) 24 | (#any-of? @function.builtin 25 | "and" "call" "html" "index" "slice" "js" "len" "not" "or" "print" "printf" "println" "urlquery" 26 | "eq" "ne" "lt" "ge" "gt" "ge")) 27 | 28 | ; Operators 29 | 30 | ([ 31 | "|" 32 | ":=" 33 | ] @operator (#set! priority 105)) 34 | 35 | ; Delimiters 36 | 37 | ([ 38 | "." 39 | "," 40 | ] @punctuation.delimiter (#set! priority 105)) 41 | 42 | ([ 43 | "{{" 44 | "}}" 45 | "{{-" 46 | "-}}" 47 | ")" 48 | "(" 49 | ] @punctuation.bracket (#set! priority 105)) 50 | 51 | ; Actions 52 | 53 | (if_action 54 | [ 55 | "if" 56 | "else" 57 | "else if" 58 | "end" 59 | ] @keyword.conditional (#set! priority 105)) 60 | 61 | (range_action 62 | [ 63 | "range" 64 | "else" 65 | "end" 66 | ] @keyword.repeat (#set! priority 105)) 67 | 68 | (template_action 69 | [ 70 | "template" 71 | ] @function.builtin (#set! priority 105)) 72 | 73 | (block_action 74 | [ 75 | "block" 76 | "end" 77 | ] @keyword.directive (#set! priority 105)) 78 | 79 | (define_action 80 | [ 81 | "define" 82 | "end" 83 | ] @keyword.directive.define (#set! priority 105)) 84 | 85 | (with_action 86 | [ 87 | "with" 88 | "else" 89 | "end" 90 | ] @keyword.conditional (#set! priority 105)) 91 | 92 | ; Literals 93 | 94 | ([ 95 | (interpreted_string_literal) 96 | (raw_string_literal) 97 | ] @string (#set! priority 105)) 98 | 99 | ((rune_literal) @string.special.symbol (#set! priority 105)) 100 | 101 | ((escape_sequence) @string.escape (#set! priority 105)) 102 | 103 | ([ 104 | (int_literal) 105 | (imaginary_literal) 106 | ] @number (#set! priority 105)) 107 | 108 | ((float_literal) @number.float (#set! priority 105)) 109 | 110 | ([ 111 | (true) 112 | (false) 113 | ] @boolean (#set! priority 105)) 114 | 115 | ((nil) @constant.builtin (#set! priority 105)) 116 | 117 | ((comment) @comment @spell (#set! priority 105)) 118 | 119 | 120 | -------------------------------------------------------------------------------- /config/nvim/after/queries/gotmpl/injections.scm: -------------------------------------------------------------------------------- 1 | ((comment) @injection.content 2 | (#set! injection.language "comment")) 3 | 4 | ; {{"put" | printf "%s%s" "out" | printf "%q"}} 5 | (function_call 6 | function: (identifier) @_function 7 | arguments: 8 | (argument_list 9 | . 10 | (interpreted_string_literal) @injection.content) 11 | (#eq? @_function "printf") 12 | (#set! injection.language "printf")) 13 | 14 | ; {{ js "var a = 1 + 1" }} 15 | (function_call 16 | function: (identifier) @_function 17 | arguments: 18 | (argument_list 19 | . 20 | (interpreted_string_literal) @injection.content) 21 | (#eq? @_function "js") 22 | (#offset! @injection.content 0 1 0 -1) 23 | (#set! injection.language "javascript")) 24 | 25 | ; {{ html "

hello

" }} 26 | (function_call 27 | function: (identifier) @_function 28 | arguments: 29 | (argument_list 30 | . 31 | (interpreted_string_literal) @injection.content) 32 | (#eq? @_function "html") 33 | (#offset! @injection.content 0 1 0 -1) 34 | (#set! injection.language "html")) 35 | 36 | (define_action (text) @_function 37 | (#eq? @_function "html") 38 | (#set! injection.language "html")) 39 | -------------------------------------------------------------------------------- /config/nvim/after/queries/html/injections.scm: -------------------------------------------------------------------------------- 1 | ((attribute_name) @_attribute 2 | (quoted_attribute_value 3 | (attribute_value) @css) 4 | (#match? @_attribute "style")) 5 | 6 | -------------------------------------------------------------------------------- /config/nvim/after/queries/html_eex/injections.scm: -------------------------------------------------------------------------------- 1 | ; ((attribute_name) @_attr 2 | ; (quoted_attribute_value 3 | ; (attribute_value) @css) 4 | ; (#match? @_attr "style")) 5 | 6 | ; ((attribute 7 | ; (attribute_name) @_attr 8 | ; (quoted_attribute_value (attribute_value) @css)) 9 | ; (#eq? @_attr "style")) 10 | -------------------------------------------------------------------------------- /config/nvim/after/queries/lua/highlights.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | 3 | (("return" @return) (#set! conceal "ƒ")) 4 | -------------------------------------------------------------------------------- /config/nvim/after/queries/tsx/ecma.scm: -------------------------------------------------------------------------------- 1 | (object_pattern (shorthand_property_identifier_pattern) @variable) 2 | -------------------------------------------------------------------------------- /config/nvim/after/queries/tsx/typescript.scm: -------------------------------------------------------------------------------- 1 | 2 | 3 | (object_pattern (shorthand_property_identifier_pattern) @variable) 4 | -------------------------------------------------------------------------------- /config/nvim/after/queries/tsx/typescriptreact.scm: -------------------------------------------------------------------------------- 1 | 2 | (object_pattern (shorthand_property_identifier_pattern) @variable) 3 | -------------------------------------------------------------------------------- /config/nvim/after/queries/typescript/typescript.scm: -------------------------------------------------------------------------------- 1 | (switch_case ":" @punctuation) 2 | -------------------------------------------------------------------------------- /config/nvim/ftplugin/pest.lua: -------------------------------------------------------------------------------- 1 | vim.lsp.start({ 2 | name = "pest-language-server", 3 | cmd = { "pest-language-server" }, 4 | root_dir = vim.fs.dirname(vim.fs.find({ "Cargo.toml" }, { upward = true })[1]), 5 | }) 6 | 7 | vim.api.nvim_create_autocmd("LspAttach", { 8 | callback = function() 9 | vim.api.nvim_create_autocmd("BufWrite", { 10 | callback = function() 11 | vim.lsp.buf.format() 12 | end, 13 | }) 14 | end, 15 | buffer = 0, 16 | }) 17 | 18 | -- Allow access to run the last runnable 19 | vim.keymap.set("n", "tt", function() 20 | require("rust-tools").cached_commands.execute_last_runnable() 21 | end, { buffer = 0 }) 22 | -------------------------------------------------------------------------------- /config/nvim/init.lua: -------------------------------------------------------------------------------- 1 | --ini 2 | -- Hello 3 | -- 4 | local g, o, cmd, opt = vim.g, vim.o, vim.cmd, vim.opt 5 | 6 | -- Colors 7 | o.termguicolors = true -- Support 24bit colors 8 | 9 | g.mapleader = " " 10 | 11 | o.splitbelow = true -- Default split below 12 | o.splitright = true -- Default split right 13 | 14 | o.showmatch = true 15 | 16 | -- Compositor transparency on pum menus 17 | o.pumblend = 10 18 | 19 | o.laststatus = 3 -- only show 1 statusbar 20 | o.ff = "unix" 21 | 22 | -- No show modes twice with status bar 23 | o.showmode = false 24 | -- cmd [[ set noshowmode ]] 25 | 26 | -- Files 27 | o.hidden = true 28 | -- if you had like noswapfile you should use o.swapfile = false 29 | -- simular throughout for when you had `set noswapfile` 30 | o.swapfile = false 31 | o.backup = false 32 | o.writebackup = false 33 | 34 | -- Lower update time for CursorHold event 35 | o.updatetime = 1000 36 | 37 | -- Undo 38 | o.undodir = vim.fn.expand("~/.config/nvim/undo") 39 | o.undofile = true 40 | 41 | -- Shada 42 | o.shada = "!,'1000,<50,s10,h" 43 | 44 | -- Tabs 45 | o.tabstop = 2 46 | o.shiftwidth = 2 47 | o.softtabstop = 2 48 | o.expandtab = false 49 | 50 | o.clipboard = "unnamedplus" 51 | o.scrolloff = 10 -- Leave 10 rows when scrolling 52 | o.emoji = true -- Use emojis 53 | 54 | o.signcolumn = "yes:1" 55 | 56 | o.formatoptions = "cqrnj" 57 | 58 | -- Completion 59 | o.completeopt = "menu,menuone,noselect" 60 | o.shortmess = "filnxtToOFc" -- Avoid showing extra messages when using completion 61 | 62 | -- now enabled by default 63 | o.mouse = "nv" 64 | 65 | opt.lcs = "tab:>-,eol:<,nbsp:%,space:." 66 | 67 | -- diff 68 | opt.diffopt = { 69 | "internal", 70 | "filler", 71 | "closeoff", 72 | "hiddenoff", 73 | "algorithm:minimal", 74 | } 75 | 76 | -- Tmux support 77 | g["&t_8f"] = "[38;2;%lu;%lu;%lum]" 78 | g["&t_8b"] = "[48;2;%lu;%lu;%lum]" 79 | 80 | -- Plugins 81 | -- g.loaded_netrwPlugin = 1 -- Don't load netrw 82 | 83 | -- Highlight yank'd text after yankin' 84 | vim.api.nvim_create_augroup("YankHighlight", {}) 85 | vim.api.nvim_create_autocmd("TextYankPost", { 86 | group = "YankHighlight", 87 | callback = function() 88 | vim.highlight.on_yank({ higroup = "IncSearch", timeout = 100 }) 89 | end, 90 | }) 91 | 92 | -- Reload module after saving 93 | vim.api.nvim_create_augroup("ReloadNeovim", {}) 94 | vim.api.nvim_create_autocmd("BufWritePost", { 95 | group = "ReloadNeovim", 96 | pattern = "/home/rockerboo/.dotfiles/config/nvim/init.lua", 97 | callback = function() 98 | package.loaded["/home/rockerboo/.dotfiles/config/nvim/init.lua"] = nil 99 | end, 100 | }) 101 | 102 | -- autocmd BufRead,BufNewFile *.ex,*.exs,mix.lock set filetype=elixir 103 | -- 104 | vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { 105 | pattern = { "*.eex" }, 106 | command = "set filetype=elixir", 107 | }) 108 | 109 | function R(module) 110 | return require(module) 111 | end 112 | 113 | -- configure dianostics 114 | vim.diagnostic.config({ 115 | virtual_text = false, 116 | update_in_insert = false, 117 | }) 118 | 119 | require("plugins_init") 120 | 121 | -- Setup key mappings 122 | require("mappings").setup() 123 | 124 | -- Configure plugins 125 | require("setup").setup() 126 | 127 | cmd([[ aunmenu PopUp.How-to\ disable\ mouse ]]) 128 | cmd([[ aunmenu PopUp.-1- ]]) 129 | 130 | cmd([[ set mousemodel=extend ]]) 131 | 132 | -- Colorscheme 133 | cmd([[ colorscheme boo ]]) 134 | -------------------------------------------------------------------------------- /config/nvim/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, 3 | "LuaSnip": { "branch": "master", "commit": "8d7aa7a7b7c0875e4878d1d2590924bc1c229305" }, 4 | "cmp-git": { "branch": "main", "commit": "ec049036e354ed8ed0215f2427112882e1ea7051" }, 5 | "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, 6 | "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, 7 | "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, 8 | "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, 9 | "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, 10 | "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, 11 | "dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" }, 12 | "editorconfig.nvim": { "branch": "master", "commit": "5b9e303e1d6f7abfe616ce4cc8d3fffc554790bf" }, 13 | "elixir-tools.nvim": { "branch": "main", "commit": "b465f6aff50257fa466de3886fc3e7de2dcff0de" }, 14 | "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, 15 | "force-cul.nvim": { "branch": "main", "commit": "33ad230b3c9dcced351adbd82e26fa6806208f1f" }, 16 | "formatter.nvim": { "branch": "master", "commit": "db71fdb31cee8ae33573b5cf1910e477360678b2" }, 17 | "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, 18 | "jester": { "branch": "main", "commit": "424b96970ac49da7b1298502e03143a8f11d5bcf" }, 19 | "lazy.nvim": { "branch": "main", "commit": "cf8ecc2c5e4332760431a33534240b0cbc6680ab" }, 20 | "lspkind-nvim": { "branch": "master", "commit": "a700f1436d4a938b1a1a93c9962dc796afbaef4d" }, 21 | "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, 22 | "nvcode-color-schemes.vim": { "branch": "master", "commit": "3a0e624a67ecd2c7f990bc3c25a1044e85782b10" }, 23 | "nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" }, 24 | "nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" }, 25 | "nvim-dap-python": { "branch": "master", "commit": "3e3dd98d4d83715c9e0e429b4a5da7bd706e6ceb" }, 26 | "nvim-dap-virtual-text": { "branch": "master", "commit": "52638640ae309cacdaff785fdbb854437bd1ee5c" }, 27 | "nvim-lint": { "branch": "master", "commit": "36da8dd0ddc4f88e0beae234c20e75397326f143" }, 28 | "nvim-lspconfig": { "branch": "master", "commit": "54617a18f4cf46f0c2f6d024fa6feb7515fe036d" }, 29 | "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, 30 | "nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" }, 31 | "nvim-semantic-tokens": { "branch": "master", "commit": "5e49f71faef9c8df92d784e5f2752d67b1c7fc7c" }, 32 | "nvim-tree.lua": { "branch": "master", "commit": "120ba58254835d412bbc91cffe847e9be835fadd" }, 33 | "nvim-treesitter": { "branch": "master", "commit": "92d2501d698e0fe855bd222540f9648890fab6c7" }, 34 | "nvim-treesitter-textsubjects": { "branch": "master", "commit": "a8d2844bba925d9450ef7ab215f3b054028288ca" }, 35 | "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, 36 | "nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" }, 37 | "nvim-ts-hint-textobject": { "branch": "master", "commit": "e87002968983ed23836dfad53bcf023e609db42d" }, 38 | "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, 39 | "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, 40 | "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, 41 | "render-markdown.nvim": { "branch": "main", "commit": "fc05fb7c56795f191b6800799a2ec6ea325ba715" }, 42 | "schemastore.nvim": { "branch": "main", "commit": "a5f6e784d2000f9570791d5f43040ab29e13f9e3" }, 43 | "telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" }, 44 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, 45 | "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, 46 | "tokyonight.nvim": { "branch": "main", "commit": "2e1daa1d164ad8cc3e99b44ca68e990888a66038" }, 47 | "trouble.nvim": { "branch": "main", "commit": "2f3b537f2207ce32f4459f9d56746ee013b5e01b" }, 48 | "typescript-tools.nvim": { "branch": "master", "commit": "f8c2e0b36b651c85f52ad5c5373ff8b07adc15a7" }, 49 | "vim-dadbod": { "branch": "master", "commit": "fe5a55e92b2dded7c404006147ef97fb073d8b1b" }, 50 | "vim-dadbod-ui": { "branch": "master", "commit": "f29c85ab42861c6ef683289b0c6a51e0d436dcf6" }, 51 | "vim-moonfly-colors": { "branch": "master", "commit": "38de7cd9ef630bd3e5a45938ef77f248e2fe639d" }, 52 | "vim-nightfly-guicolors": { "branch": "master", "commit": "48d074b8a2557b4f88a1f5dd2b21fc479ef6fbf2" }, 53 | "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" } 54 | } 55 | -------------------------------------------------------------------------------- /config/nvim/lua/mappings.lua: -------------------------------------------------------------------------------- 1 | local mappings = {} 2 | local typescript = require("rockerboo.typescript") 3 | local on_list = typescript.on_list 4 | 5 | -- Helper variables 6 | local n, i, t, c, v, esc = "n", "i", "t", "c", "v", "" 7 | local silent = { silent = true } 8 | 9 | function Reload(module) 10 | require("plenary.reload").reload_module(module) 11 | end 12 | 13 | local plenary_reload = function() 14 | require("plenary.reload").reload_module("telescope") 15 | require("plenary.reload").reload_module("plenary") 16 | require("plenary.reload").reload_module("boo-colorscheme") 17 | require("plenary.reload").reload_module("plugin") 18 | require("plenary.reload").reload_module("rust-tools") 19 | require("plenary.reload").reload_module("jester") 20 | Reload("lsp_config") 21 | Reload("plugin.telescope") 22 | -- require("plenary.reload").reload_module("lsp_extensions") 23 | -- require("boo-colorscheme").use({ theme = "sunset_cloud" }) 24 | -- require("boo-colorscheme").use({}) 25 | require("plugin.telescope").setup_defaults() 26 | require("mappings").setup() 27 | -- require("setup").setup() 28 | end 29 | 30 | -- @param {table} maps - mode, key, cmd, options 31 | local maps = { 32 | -- Quick pane 33 | { n, "", "l" }, 34 | { n, "", "h" }, 35 | { n, "", "j" }, 36 | { n, "", "k" }, 37 | 38 | -- Resize the panes 39 | -- { n, "", ":resize +2" }, 40 | -- { n, "", ":resize -2" }, 41 | -- { n, "", ":vertical resize +2" }, 42 | -- { n, "", ":vertical resize -2" }, 43 | 44 | -- Treesitter quickfix 45 | { n, "", ":write | edit | TSBufEnable highlight" }, 46 | 47 | -- {n, "hhi", ":TSPlaygroundToggle"}, 48 | 49 | -- Escape 50 | { i, "jk", esc }, 51 | { i, "JK", esc }, 52 | { i, "Jk", esc }, 53 | { i, "jK", esc }, 54 | 55 | { n, "asdf", plenary_reload }, 56 | 57 | { n, "", "set list!" }, 58 | { i, "", "set list!" }, 59 | { c, "", "set list!" }, 60 | 61 | { 62 | n, 63 | "hi", 64 | [[ echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" 65 | -- ]], 66 | }, 67 | 68 | { n, "gh", "^" }, 69 | { n, "gl", "$" }, 70 | 71 | -- Escape for terminal (aka spam escape will get me out) 72 | { t, "", "" }, 73 | 74 | -- Disable up/down in insert mode 75 | { i, "", "" }, 76 | { i, "", "" }, 77 | 78 | { n, "", ":bp", silent }, 79 | { n, "", ":bp", silent }, 80 | 81 | -- Quick quick file/buffer commands 82 | { n, "w", ":w", silent }, 83 | { n, "q", ":q", silent }, 84 | 85 | { i, "", "A" }, 86 | { i, "", "pumvisible() ? '' : ''", { expr = true } }, 87 | { i, "", "pumvisible() ? '' : ''", { expr = true } }, 88 | 89 | { n, "", "zz" }, 90 | { n, "", "zz" }, 91 | 92 | { n, "n", "nzzzv" }, 93 | { n, "N", "Nzzzv" }, 94 | 95 | -- override to use black hole buffer for delete 96 | -- { n, "dd", "\"_dd" }, 97 | -- { v, "d", "\"_d" }, 98 | 99 | -- really cool? 100 | -- { "x", "p", '"_Dp' }, 101 | 102 | -- nvim-ts-hint-textobject 103 | { v, "m", R("tsht").nodes, silent }, 104 | 105 | { 106 | n, 107 | "pp", 108 | function() 109 | require("player").select() 110 | end, 111 | }, 112 | 113 | { n, "gh", "TSHighlightCapturesUnderCursor", silent }, 114 | } 115 | 116 | -- Mappings 117 | mappings.setup = function() 118 | -- Apply the keymaps 119 | require("rockerboo.utils").keymaps(maps) 120 | end 121 | 122 | return mappings 123 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/colorizer.lua: -------------------------------------------------------------------------------- 1 | require("colorizer").setup() 2 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/completion.lua: -------------------------------------------------------------------------------- 1 | -- require("compe").setup({ 2 | -- enabled = true, 3 | -- source = { nvim_lsp = true, nvim_lua = true, vsnip = true, nvim_treesitter = true }, 4 | -- }) 5 | local lspkind = require("lspkind") 6 | local cmp = require("cmp") 7 | 8 | local source_mapping = { 9 | buffer = "[Buffer]", 10 | nvim_lsp = "LSP", 11 | nvim_lua = "[Lua]", 12 | treesitter = "Tree", 13 | cmp_tabnine = "TN", 14 | luasnip = "[LuaSnip]", 15 | path = "[Path]", 16 | calc = "[calc]", 17 | } 18 | 19 | local t = function(str) 20 | return vim.api.nvim_replace_termcodes(str, true, true, true) 21 | end 22 | 23 | require("cmp").setup({ 24 | mapping = { 25 | [""] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), 26 | [""] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), 27 | [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), 28 | [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. 29 | [""] = cmp.mapping({ 30 | c = function() 31 | if cmp.visible() then 32 | cmp.select_next_item({ 33 | behavior = cmp.SelectBehavior.Select, 34 | }) 35 | else 36 | vim.api.nvim_feedkeys(t(""), "n", true) 37 | end 38 | end, 39 | i = function(fallback) 40 | if cmp.visible() then 41 | cmp.select_next_item({ 42 | behavior = cmp.SelectBehavior.Select, 43 | }) 44 | else 45 | fallback() 46 | end 47 | end, 48 | }), 49 | [""] = cmp.mapping({ 50 | c = function() 51 | if cmp.visible() then 52 | cmp.select_prev_item({ 53 | behavior = cmp.SelectBehavior.Select, 54 | }) 55 | else 56 | vim.api.nvim_feedkeys(t(""), "n", true) 57 | end 58 | end, 59 | i = function(fallback) 60 | if cmp.visible() then 61 | cmp.select_prev_item({ 62 | behavior = cmp.SelectBehavior.Select, 63 | }) 64 | else 65 | fallback() 66 | end 67 | end, 68 | }), 69 | [""] = cmp.mapping({ 70 | i = cmp.mapping.abort(), 71 | c = cmp.mapping.close(), 72 | }), 73 | [""] = cmp.mapping.confirm({ select = false }), 74 | }, 75 | sources = { 76 | { name = "nvim_lsp" }, 77 | -- { name = "cmp_tabnine" }, 78 | { name = "luasnip" }, 79 | { name = "treesitter" }, 80 | { name = "nvim_lsp_signature_help" }, 81 | -- { name = "buffers" }, 82 | { name = "nvim_lua" }, 83 | }, 84 | -- formatting = { 85 | -- format = function(entry, vim_item) 86 | -- vim_item.kind = lspkind.presets.default[vim_item.kind] 87 | -- local menu = source_mapping[entry.source.name] 88 | -- if 89 | -- entry.source.name == "cmp_tabnine" 90 | -- and entry.completion_item.data ~= nil 91 | -- and entry.completion_item.data.details ~= nil 92 | -- then 93 | -- menu = entry.data.details .. " " .. menu 94 | -- end 95 | -- vim_item.menu = menu 96 | -- return vim_item 97 | -- end, 98 | -- }, 99 | experimental = { 100 | native_menu = false, 101 | ghost_text = true, 102 | }, 103 | 104 | snippet = { 105 | expand = function(args) 106 | require("luasnip").lsp_expand(args.body) 107 | end, 108 | }, 109 | }) 110 | 111 | vim.api.nvim_create_autocmd("FileType", { 112 | pattern = { "sql", "mysql", "plsql" }, 113 | callback = function() 114 | require("cmp").setup.buffer({ 115 | sources = { { name = "vim-dadbod-completion" } }, 116 | }) 117 | end, 118 | }) 119 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/dap.lua: -------------------------------------------------------------------------------- 1 | -- return { 2 | -- setup = function() 3 | -- local dap = require("dap") 4 | -- 5 | -- -- ADAPTERS 6 | -- -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 7 | -- 8 | -- dap.adapters.node2 = function(cb, config) 9 | -- if config.preLaunchTask then 10 | -- vim.fn.system(config.preLaunchTask) 11 | -- end 12 | -- local adapter = { 13 | -- type = "executable", 14 | -- command = "node", 15 | -- args = { 16 | -- "/mnt/900/builds/vscode-node-debug2/out/src/nodeDebug.js", 17 | -- }, 18 | -- } 19 | -- cb(adapter) 20 | -- end 21 | -- 22 | -- -- WIP does not execute 23 | -- dap.adapters.deno = function(cb) 24 | -- local adapter = { 25 | -- type = "executable", 26 | -- command = "deno", 27 | -- } 28 | -- cb(adapter) 29 | -- end 30 | -- 31 | -- dap.adapters.firefox = { 32 | -- type = "executable", 33 | -- command = "node", 34 | -- args = { 35 | -- os.getenv("HOME") 36 | -- .. "/build/vscode-firefox-debug/dist/adapter.bundle.js", 37 | -- }, 38 | -- } 39 | -- 40 | -- dap.adapters.yarn = { 41 | -- type = "executable", 42 | -- command = "yarn", 43 | -- args = { 44 | -- "run", 45 | -- "--inspect-brk", 46 | -- "/mnt/900/builds/vscode-node-debug2/out/src/nodeDebug.js", 47 | -- }, 48 | -- } 49 | -- 50 | -- dap.adapters.yarn_jest = { 51 | -- type = "executable", 52 | -- command = "yarn", 53 | -- args = { 54 | -- "run", 55 | -- "--inspect-brk", 56 | -- "jest", 57 | -- }, 58 | -- } 59 | -- 60 | -- dap.adapters.yarn_firefox = { 61 | -- type = "executable", 62 | -- command = "yarn", 63 | -- args = { 64 | -- "node", 65 | -- "--inspect-brk", 66 | -- os.getenv("HOME") 67 | -- .. "/build/vscode-firefox-debug/dist/adapter.bundle.js", 68 | -- }, 69 | -- } 70 | -- 71 | -- -- lldb/rust 72 | -- dap.adapters.lldb = { 73 | -- type = "executable", 74 | -- command = "/usr/bin/lldb-vscode", -- adjust as needed 75 | -- name = "lldb", 76 | -- } 77 | -- 78 | -- -- need to update this to work 79 | -- -- dap.adapters.nlua = function(callback, config) 80 | -- -- callback({ 81 | -- -- type = "server", 82 | -- -- host = config.host, 83 | -- -- port = config.port, 84 | -- -- }) 85 | -- -- end 86 | -- 87 | -- -- LAUNCHERS 88 | -- -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 89 | -- 90 | -- local nlua = { 91 | -- type = "nlua", 92 | -- request = "attach", 93 | -- name = "Attach to running Neovim instance", 94 | -- host = function() 95 | -- local value = vim.fn.input("Host [127.0.0.1]: ") 96 | -- if value ~= "" then 97 | -- return value 98 | -- end 99 | -- return "127.0.0.1" 100 | -- end, 101 | -- port = function() 102 | -- local val = tonumber(vim.fn.input("Port: ")) 103 | -- assert(val, "Please provide a port number") 104 | -- return val 105 | -- end, 106 | -- } 107 | -- 108 | -- local firefox = { 109 | -- name = "Debug with Firefox", 110 | -- type = "firefox", 111 | -- request = "launch", 112 | -- reAttach = true, 113 | -- sourceMaps = true, 114 | -- url = "http://localhost:6969", 115 | -- webRoot = "${workspaceFolder}", 116 | -- firefoxExecutable = "/usr/bin/firefox", 117 | -- } 118 | -- 119 | -- local node2 = { 120 | -- name = "Launch node", 121 | -- type = "node2", 122 | -- request = "launch", 123 | -- program = "${file}", 124 | -- cwd = vim.fn.getcwd(), 125 | -- sourceMaps = true, 126 | -- protocol = "inspector", 127 | -- console = "integratedTerminal", 128 | -- } 129 | -- 130 | -- local yarn = { 131 | -- name = "Launch node", 132 | -- type = "yarn", 133 | -- request = "launch", 134 | -- program = "${file}", 135 | -- cwd = vim.fn.getcwd(), 136 | -- sourceMaps = true, 137 | -- protocol = "inspector", 138 | -- console = "integratedTerminal", 139 | -- } 140 | -- 141 | -- local tauri_dev = { 142 | -- type = "lldb", 143 | -- request = "launch", 144 | -- name = "Tauri Development Debug", 145 | -- args = { 146 | -- "cargo", 147 | -- "build", 148 | -- "--manifest-path=./src-tauri/Cargo.toml", 149 | -- "--no-default-features", 150 | -- }, 151 | -- -- task for the `beforeDevCommand` if used, must be configured in `.vscode/tasks.json` 152 | -- -- preLaunchTask = "ui:dev" 153 | -- } 154 | -- 155 | -- local tauri_prod = { 156 | -- type = "lldb", 157 | -- request = "launch", 158 | -- name = "Tauri Production Debug", 159 | -- args = { 160 | -- "cargo", 161 | -- "build", 162 | -- "--release", 163 | -- "--manifest-path=./src-tauri/Cargo.toml", 164 | -- }, 165 | -- -- // task for the `beforeBuildCommand` if used, must be configured in `.vscode/tasks.json` 166 | -- -- "preLaunchTask": "ui:build" 167 | -- } 168 | -- 169 | -- local lldb = { 170 | -- name = "Launch lldb", 171 | -- type = "lldb", 172 | -- request = "launch", 173 | -- program = function() 174 | -- return vim.fn.input( 175 | -- "Path to executable: ", 176 | -- vim.fn.getcwd() .. "/", 177 | -- "file" 178 | -- ) 179 | -- end, 180 | -- cwd = "${workspaceFolder}", 181 | -- stopOnEntry = false, 182 | -- args = {}, 183 | -- 184 | -- -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting: 185 | -- -- 186 | -- -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope 187 | -- -- 188 | -- -- Otherwise you might get the following error: 189 | -- -- 190 | -- -- Error on launch: Failed to attach to the target process 191 | -- -- 192 | -- -- But you should be aware of the implications: 193 | -- -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html 194 | -- runInTerminal = false, 195 | -- } 196 | -- 197 | -- -- WIP does not launch properly, maybe needs a different runtime args 198 | -- local deno = { 199 | -- name = "Launch Deno", 200 | -- type = "deno", 201 | -- request = "launch", 202 | -- cwd = "${workspaceFolder}", 203 | -- runtimeExecutable = "deno", 204 | -- runtimeArgs = { "run", "--inspect-brk", "-A", "${file}" }, 205 | -- port = 9229, 206 | -- } 207 | -- 208 | -- -- ADAPTERS 209 | -- -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 210 | -- 211 | -- local node_attach = { 212 | -- -- For this to work you need to make sure the node process is started with the `--inspect` flag. 213 | -- name = "Attach to node process", 214 | -- type = "node2", 215 | -- request = "attach", 216 | -- processId = require("dap.utils").pick_process, 217 | -- } 218 | -- 219 | -- -- CONFIGURATIONS 220 | -- -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 221 | -- 222 | -- dap.configurations.javascript = { firefox, node2, deno, node_attach } 223 | -- dap.configurations.javascriptreact = { 224 | -- firefox, 225 | -- node2, 226 | -- deno, 227 | -- node_attach, 228 | -- } 229 | -- 230 | -- dap.configurations.typescript = { firefox, node2, deno, node_attach } 231 | -- dap.configurations.typescriptreact = { 232 | -- node2, 233 | -- firefox, 234 | -- deno, 235 | -- node_attach, 236 | -- } 237 | -- 238 | -- -- dap.configurations.rust = { 239 | -- -- lldb, 240 | -- -- tauri_dev, 241 | -- -- tauri_prod, 242 | -- -- } 243 | -- 244 | -- dap.configurations.lua = { 245 | -- nlua, 246 | -- } 247 | -- 248 | -- -- au FileType dap-repl lua require('dap.ext.autocompl').attach() 249 | -- 250 | -- vim.api.nvim_create_autocmd("FileType", { 251 | -- pattern = "dap-repl", 252 | -- callback = function() 253 | -- require("dap.ext.autocompl").attach() 254 | -- end, 255 | -- }) 256 | -- 257 | -- -- require('dap-python').setup('/mnt/900/builds/prs/.virtualenvs/debugpy/bin/python') 258 | -- 259 | -- -- prs 260 | -- require("dap-python").setup( 261 | -- "/mnt/900/builds/miniconda3/envs/prs/bin/python" 262 | -- ) 263 | -- 264 | -- table.insert(require("dap").configurations.python, { 265 | -- type = "python", 266 | -- request = "launch", 267 | -- name = "My custom launch configuration", 268 | -- program = "${file}", 269 | -- justMyCode = false, 270 | -- -- ... more options, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings 271 | -- }) 272 | -- 273 | -- -- setup extensions 274 | -- require("nvim-dap-virtual-text").setup() 275 | -- require("plugin.dap.mappings").setup() 276 | -- end, 277 | -- } 278 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/dap/mappings.lua: -------------------------------------------------------------------------------- 1 | -- use nvim/after/plugin/dap.lua 2 | 3 | -- -- local dap = require("dap") 4 | -- -- local n = "n" 5 | -- local mappings = {} 6 | -- -- local silent = { silent = true } 7 | -- -- local maps = { 8 | -- -- -- { n, "", dap.continue, silent }, 9 | -- -- { n, "dk", dap.continue, silent }, 10 | -- -- { n, "ddt", dap.terminate, silent }, 11 | -- -- { n, "do", dap.step_over, silent }, 12 | -- -- { n, "di", dap.step_into, silent }, 13 | -- -- -- { n, "d", dap.step_out, silent }, 14 | -- -- { n, "b", dap.toggle_breakpoint, silent }, 15 | -- -- { n, "", dap.clear_breakpoints, silent }, 16 | -- -- { 17 | -- -- n, 18 | -- -- "B", 19 | -- -- function() 20 | -- -- dap.toggle_breakpoint(vim.fn.input("Breakpoint condition")) 21 | -- -- end, 22 | -- -- silent, 23 | -- -- }, 24 | -- -- { 25 | -- -- n, 26 | -- -- "lp", 27 | -- -- function() 28 | -- -- dap.set_breakpoint(nil, nil, vim.fn.input("Log point message")) 29 | -- -- end, 30 | -- -- silent, 31 | -- -- }, 32 | -- -- { 33 | -- -- n, 34 | -- -- "dr", 35 | -- -- dap.repl.open, 36 | -- -- silent, 37 | -- -- }, 38 | -- -- { n, "dc", dap.run_to_cursor, silent }, 39 | -- -- { n, "dl", dap.run_last, silent }, 40 | -- -- { n, "du", dap.up, silent }, 41 | -- -- { n, "dd", dap.down, silent }, 42 | -- -- { n, "db", dap.step_back, silent }, 43 | -- -- { 44 | -- -- n, 45 | -- -- "K", 46 | -- -- function() 47 | -- -- local api = vim.api 48 | -- -- local function new_buf() 49 | -- -- local buf = api.nvim_create_buf(false, true) 50 | -- -- api.nvim_set_option_value("buftype", "nofile", { buf = buf}) 51 | -- -- api.nvim_set_option_value("modifiable", false, { buf = buf}) 52 | -- -- api.nvim_buf_set_keymap( 53 | -- -- buf, 54 | -- -- "n", 55 | -- -- "", 56 | -- -- "lua require('dap.ui').trigger_actions({ mode = 'first' })", 57 | -- -- {} 58 | -- -- ) 59 | -- -- api.nvim_buf_set_keymap(buf, "n", "a", "lua require('dap.ui').trigger_actions()", {}) 60 | -- -- api.nvim_buf_set_keymap(buf, "n", "o", "lua require('dap.ui').trigger_actions()", {}) 61 | -- -- api.nvim_buf_set_keymap( 62 | -- -- buf, 63 | -- -- "n", 64 | -- -- "<2-LeftMouse>", 65 | -- -- "lua require('dap.ui').trigger_actions()", 66 | -- -- {} 67 | -- -- ) 68 | -- -- return buf 69 | -- -- end 70 | -- -- local widgets = require("dap.ui.widgets") 71 | -- -- 72 | -- -- local new_cursor_anchored_float_win = function(buf) 73 | -- -- vim.api.nvim_set_option_value("bufhidden", "wipe", { buf = buf }) 74 | -- -- vim.api.nvim_set_option_value("filetype", "dap-float", { buf = buf }) 75 | -- -- local opts = vim.lsp.util.make_floating_popup_options(50, 30, { border = false }) 76 | -- -- local win = vim.api.nvim_open_win(buf, true, opts) 77 | -- -- vim.api.nvim_set_option_value("scrolloff", 0, { win = win }) 78 | -- -- return win 79 | -- -- end 80 | -- -- 81 | -- -- local widget = widgets 82 | -- -- .builder(widgets.expression) 83 | -- -- .new_buf(new_buf) 84 | -- -- .new_win(widgets.with_resize(new_cursor_anchored_float_win)) 85 | -- -- .build() 86 | -- -- 87 | -- -- widget.open() 88 | -- -- widgets.hover("", { border = false }) 89 | -- -- end, 90 | -- -- silent, 91 | -- -- }, 92 | -- -- } 93 | -- 94 | -- mappings.setup = function() 95 | -- 96 | -- -- { n, "dk", dap.continue, silent }, 97 | -- -- { n, "ddt", dap.terminate, silent }, 98 | -- -- { n, "do", dap.step_over, silent }, 99 | -- -- { n, "di", dap.step_into, silent }, 100 | -- -- -- { n, "d", dap.step_out, silent }, 101 | -- -- { n, "b", dap.toggle_breakpoint, silent }, 102 | -- -- { n, "", dap.clear_breakpoints, silent }, 103 | -- vim.keymap.set("n", "dk", function() 104 | -- require("dap").continue() 105 | -- end) 106 | -- vim.keymap.set("n", "ddt", function() 107 | -- require("dap").step_over() 108 | -- end) 109 | -- vim.keymap.set("n", "do", function() 110 | -- require("dap").step_into() 111 | -- end) 112 | -- vim.keymap.set("n", "di", function() 113 | -- require("dap").step_out() 114 | -- end) 115 | -- vim.keymap.set("n", "b", function() 116 | -- require("dap").toggle_breakpoint() 117 | -- end) 118 | -- vim.keymap.set("n", "B", function() 119 | -- require("dap").set_breakpoint() 120 | -- end) 121 | -- vim.keymap.set("n", "lp", function() 122 | -- require("dap").set_breakpoint( 123 | -- nil, 124 | -- nil, 125 | -- vim.fn.input("Log point message: ") 126 | -- ) 127 | -- end) 128 | -- vim.keymap.set("n", "dr", function() 129 | -- require("dap").repl.open() 130 | -- end) 131 | -- vim.keymap.set("n", "dl", function() 132 | -- require("dap").run_last() 133 | -- end) 134 | -- vim.keymap.set({ "n", "v" }, "dh", function() 135 | -- require("dap.ui.widgets").hover() 136 | -- end) 137 | -- vim.keymap.set({ "n", "v" }, "dp", function() 138 | -- require("dap.ui.widgets").preview() 139 | -- end) 140 | -- vim.keymap.set("n", "df", function() 141 | -- local widgets = require("dap.ui.widgets") 142 | -- widgets.centered_float(widgets.frames) 143 | -- end) 144 | -- vim.keymap.set("n", "ds", function() 145 | -- local widgets = require("dap.ui.widgets") 146 | -- widgets.centered_float(widgets.scopes) 147 | -- end) 148 | -- -- -- Apply the keymaps 149 | -- -- require("rockerboo.utils").keymaps(maps) 150 | -- end 151 | -- 152 | -- -- 3F79Z 153 | -- 154 | -- return mappings 155 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/dressing.lua: -------------------------------------------------------------------------------- 1 | return function() 2 | require("dressing").setup({ 3 | input = { 4 | enabled = false, 5 | border = false, 6 | }, 7 | select = { 8 | telescope = require("telescope.themes").get_cursor({ 9 | layout_config = { width = 120 }, 10 | }), 11 | }, 12 | }) 13 | end 14 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/expressline.lua: -------------------------------------------------------------------------------- 1 | -- Express Line 2 | local builtin = require("el.builtin") 3 | local extensions = require("el.extensions") 4 | local sections = require("el.sections") 5 | local subscribe = require("el.subscribe") 6 | -- local lsp_statusline = require("el.plugins.lsp_status") 7 | 8 | require("el").reset_windows() 9 | 10 | -- generator(win_id) 11 | local generator = function(_) 12 | return { 13 | extensions.gen_mode({ format_string = "%s" }), 14 | sections.split, 15 | subscribe.buf_autocmd("el_file_icon", "BufRead", function(_, bufnr) 16 | local icon = extensions.file_icon(_, bufnr) 17 | if icon then 18 | return icon .. " " 19 | end 20 | return "" 21 | end), 22 | builtin.make_responsive_file(140, 90), 23 | sections.collapse_builtin({ " ", builtin.modified_flag }), 24 | sections.split, 25 | -- lsp_statusline.server_progress, 26 | require("dap").status(), 27 | builtin.line, 28 | ",", 29 | builtin.column, 30 | " ", 31 | sections.collapse_builtin({ "", builtin.help_list, builtin.readonly_list, "" }), 32 | function(_, buffer) 33 | return buffer.filetype 34 | end, 35 | } 36 | end 37 | 38 | require("el").setup({ generator = generator }) 39 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/formatter.lua: -------------------------------------------------------------------------------- 1 | local util = require("formatter.util") 2 | local defaults = require("formatter.defaults") 3 | 4 | local local_prettier_d_slim = function() 5 | print(vim.inspect({ 6 | exe = "yarn", 7 | args = { 8 | "prettier_d_slim", 9 | "--stdin", 10 | "--stdin-filepath", 11 | util.get_current_buffer_file_path(), 12 | }, 13 | stdin = true, 14 | })) 15 | return { 16 | exe = "yarn", 17 | args = { 18 | "prettier_d_slim", 19 | "--stdin", 20 | "--stdin-filepath", 21 | util.get_current_buffer_file_path(), 22 | }, 23 | stdin = true, 24 | } 25 | end 26 | 27 | local local_prettier = function(parser) 28 | if not parser then 29 | return { 30 | exe = "yarn", 31 | args = { 32 | "run", 33 | "prettier", 34 | "--stdin-filepath", 35 | util.get_current_buffer_file_path(), 36 | }, 37 | stdin = true, 38 | try_node_modules = true, 39 | } 40 | end 41 | return { 42 | exe = "yarn", 43 | args = { 44 | "run", 45 | "prettier", 46 | "--stdin-filepath", 47 | util.get_current_buffer_file_path(), 48 | "--parser", 49 | parser, 50 | }, 51 | stdin = true, 52 | try_node_modules = true, 53 | } 54 | end 55 | 56 | local rome = function() 57 | return { 58 | exe = "yarn", 59 | args = { 60 | "rome", 61 | "format", 62 | "--stdin-file-path", 63 | string.format( 64 | '"%s"', 65 | util.escape_path(util.get_current_buffer_file_path()) 66 | ), 67 | }, 68 | stdin = true, 69 | } 70 | end 71 | 72 | local mixformat = function() 73 | return { 74 | exe = "mix", 75 | args = { 76 | "format", 77 | "--stdin-filename", 78 | util.get_current_buffer_file_path(), 79 | "-", 80 | }, 81 | stdin = true, 82 | } 83 | end 84 | 85 | local prettier_d_slim = function() 86 | return { 87 | exe = "prettier_d_slim", 88 | args = { 89 | "--stdin", 90 | "--stdin-filepath", 91 | util.get_current_buffer_file_path(), 92 | }, 93 | stdin = true, 94 | } 95 | end 96 | 97 | local nginxfmt = function() 98 | return { 99 | exe = "/mnt/900/builds/nginx-config-formatter/nginxfmt.py", 100 | args = { 101 | "-", 102 | -- util.escape_path(util.get_current_buffer_file_path()), 103 | }, 104 | stdin = true, 105 | } 106 | end 107 | 108 | -- Removes extra new lines between sections 109 | local google_yamlfmt = function() 110 | return { 111 | exe = "yamlfmt", 112 | args = { 113 | "-", 114 | }, 115 | stdin = true, 116 | } 117 | end 118 | 119 | local gdformat = function() 120 | return { 121 | exe = "gdformat", 122 | stdin = false, 123 | } 124 | end 125 | 126 | local dprint = function() 127 | return { 128 | exe = "dprint", 129 | args = { 130 | "fmt", 131 | "--stdin", 132 | util.get_current_buffer_file_path(), 133 | }, 134 | stdin = true, 135 | } 136 | end 137 | 138 | return { 139 | setup = function() 140 | ---@diagnostic disable-next-line: redundant-parameter 141 | require("formatter").setup({ 142 | logging = true, 143 | filetype = { 144 | sh = { 145 | require("formatter.filetypes.sh").shfmt, 146 | }, 147 | bash = { 148 | require("formatter.filetypes.sh").shfmt, 149 | }, 150 | gleam = { 151 | function() 152 | return { 153 | exe = "gleam", 154 | args = { "format", "--stdin" }, 155 | stdin = true, 156 | } 157 | end, 158 | }, 159 | gdscript = { 160 | gdformat, 161 | }, 162 | gotmpl = { 163 | -- require("formatter.filetypes.html").prettierd 164 | -- local_prettier_d_slim, 165 | -- require("formatter.filetypes.javascript").prettier, 166 | local_prettier, 167 | }, 168 | 169 | elixir = { 170 | mixformat, 171 | }, 172 | 173 | eelixir = { 174 | mixformat, 175 | }, 176 | html_eex = { 177 | mixformat, 178 | }, 179 | 180 | heex = { 181 | mixformat, 182 | }, 183 | 184 | lua = { require("formatter.filetypes.lua").stylua }, 185 | 186 | python = { 187 | -- Configuration for psf/black 188 | -- function() 189 | -- return { 190 | -- exe = "black", -- this should be available on your $PATH 191 | -- args = { "-" }, 192 | -- stdin = true, 193 | -- } 194 | -- end, 195 | -- Configuration for ruff 196 | function() 197 | return { 198 | exe = "ruff", 199 | args = { 200 | "format", 201 | "--stdin-filename", 202 | util.get_current_buffer_file_path(), 203 | }, 204 | 205 | stdin = true, 206 | } 207 | end, 208 | }, 209 | typescriptreact = { 210 | -- prettier_d_slim, 211 | -- local_prettier, 212 | -- prettier_d_slim, 213 | -- require("formatter.filetypes.javascript").prettierd, 214 | -- require("formatter.filetypes.javascript").prettier, 215 | -- local_prettier_d_slim, 216 | -- require("formatter.filetypes.javascript").prettier, 217 | -- rome, 218 | -- local_prettier, 219 | dprint 220 | }, 221 | typescript = { 222 | -- local_prettier_d_slim, 223 | local_prettier, 224 | -- require("formatter.filetypes.javascript").prettier, 225 | -- prettier_d_slim, 226 | }, 227 | html = { 228 | -- require("formatter.filetypes.html").prettierd 229 | -- local_prettier_d_slim, 230 | require("formatter.filetypes.javascript").prettier, 231 | -- local_prettier, 232 | }, 233 | htmlangular = { 234 | -- require("formatter.filetypes.html").prettierd 235 | -- local_prettier_d_slim, 236 | -- require("formatter.filetypes.javascript").prettier, 237 | local_prettier, 238 | }, 239 | css = { 240 | require("formatter.filetypes.javascript").prettier, 241 | -- local_prettier, 242 | }, 243 | javascript = { 244 | -- local_prettier, 245 | -- rome 246 | -- require("formatter.filetypes.javascript").prettierd, 247 | require("formatter.filetypes.javascript").prettier, 248 | }, 249 | javascriptreact = { 250 | -- rome 251 | -- require("formatter.filetypes.javascript").prettierd, 252 | require("formatter.filetypes.javascript").prettier, 253 | }, 254 | json = { 255 | -- rome 256 | -- require("formatter.filetypes.javascript").prettierd, 257 | dprint, 258 | -- require("formatter.filetypes.javascript").prettier, 259 | }, 260 | jsonc = { 261 | -- rome 262 | -- require("formatter.filetypes.javascript").prettierd, 263 | dprint, 264 | -- require("formatter.filetypes.javascript").prettier, 265 | }, 266 | markdown = { 267 | -- local_prettier_d_slim, 268 | dprint, 269 | require("formatter.filetypes.html").prettier, 270 | -- prettier_d_slim, 271 | -- require("formatter.filetypes.html").prettierd 272 | -- prettier_d_slim, 273 | -- local_prettier, 274 | }, 275 | toml = { dprint }, 276 | rust = { require("formatter.filetypes.rust").rustfmt }, 277 | nginx = { nginxfmt }, 278 | -- yaml = { google_yamlfmt } 279 | }, 280 | }) 281 | 282 | vim.keymap.set("n", "aa", ":Format", { silent = true }) 283 | end, 284 | } 285 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/jest-test.lua: -------------------------------------------------------------------------------- 1 | local m = {} 2 | 3 | m.run_single_test = function() 4 | local file = vim.fn.expand("%:p") 5 | local block = "" 6 | 7 | local output = os.execute(string.format('yarn jest --json -i %s -t "%s"', file, block)) 8 | 9 | print("got output " .. #output) 10 | end 11 | 12 | m.run_single_file = function() 13 | local file = vim.fn.expand("%:p") 14 | 15 | local output = os.execute("yarn jest --json --useStderr -i " .. file) 16 | print("got output " .. #output) 17 | end 18 | 19 | return m 20 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/jester.lua: -------------------------------------------------------------------------------- 1 | return { 2 | yarn_debug = function() 3 | -- require("jester").debug({ 4 | -- path_to_jest_debug = "yarn jest", 5 | -- dap = { 6 | -- type = "yarn", 7 | -- outdir = "${workspaceroot}", 8 | -- runtiumeExecutable = "yarn", 9 | -- runtimeArgs = { 10 | -- "run", 11 | -- "--inspect", 12 | -- "--inspect-brk", 13 | -- "jest", 14 | -- "--no-coverage", 15 | -- "-t", 16 | -- "$result", 17 | -- "--", 18 | -- "$file", 19 | -- }, 20 | -- }, 21 | -- }) 22 | -- require("jester").debug() 23 | -- 24 | require("jester").debug({ 25 | path_to_jest = "jest", 26 | dap = { 27 | type = "yarn", 28 | }, 29 | }) 30 | end, 31 | 32 | yarn_debug_file = function() 33 | -- require("jester").debug_file({ yarn = true, path_to_jest = "jest" }) 34 | -- require("jester").debug_file() 35 | -- require("jester").debug_file() 36 | require("jester").debug_file({ 37 | dap = { 38 | type = "yarn", 39 | runtimeArgs = { 40 | -- "yarn", 41 | "run", 42 | "--inspect", 43 | "--inspect-brk", 44 | "jest", 45 | "--no-coverage", 46 | "-t", 47 | "$result", 48 | "--", 49 | "$file", 50 | }, 51 | }, 52 | }) 53 | end, 54 | 55 | yarn_debug_last = function() 56 | -- require("jester").debug_last({ yarn = true, path_to_jest = "jest" }) 57 | require("jester").debug_last({ 58 | path_to_jest = "jest", 59 | dap = { 60 | type = "yarn_jest", 61 | runtimeArgs = { 62 | "--no-coverage", 63 | "-t", 64 | "$result", 65 | "--", 66 | "$file", 67 | }, 68 | }, 69 | }) 70 | end, 71 | 72 | yarn_test = function() 73 | -- require("jester").run() 74 | require("jester").run({ 75 | -- yarn = true, 76 | cmd = "yarn run jest -t '$result' -- $file", 77 | }) 78 | end, 79 | 80 | yarn_test_file = function() 81 | require("jester").run_file() 82 | -- require("jester").run_file({ 83 | -- yarn = true, 84 | -- cmd = "yarn run jest -- $file", 85 | -- }) 86 | end, 87 | 88 | yarn_test_last = function() 89 | -- require("jester").run_last() 90 | require("jester").run_last({ 91 | yarn = true, 92 | cmd = "yarn run jest -t '$result' -- $file", 93 | }) 94 | end, 95 | 96 | -- setup = function() 97 | -- require("jester").setup() 98 | -- end, 99 | 100 | mappings = function() 101 | local n = "n" 102 | local keymaps = { 103 | { n, "dt", require("plugin.jester").yarn_debug }, 104 | { n, "df", require("plugin.jester").yarn_debug_file }, 105 | { n, "dl", require("plugin.jester").yarn_debug_last }, 106 | 107 | { n, "tt", require("plugin.jester").yarn_test }, 108 | { n, "tf", require("plugin.jester").yarn_test_file }, 109 | -- j n, "tl", require("plugin.jester").yarn_test_last }, 110 | { 111 | n, 112 | "tl", 113 | function() 114 | require("jester").run_last() 115 | end, 116 | }, 117 | } 118 | 119 | for _, keymap in ipairs(keymaps) do 120 | vim.keymap.set(keymap[1], keymap[2], keymap[3], { buffer = true }) 121 | end 122 | end, 123 | } 124 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/lint.lua: -------------------------------------------------------------------------------- 1 | return { 2 | setup = function() 3 | require("lint").linters_by_ft = { 4 | markdown = { "vale" }, 5 | elixir = { "credo" }, 6 | python = { "ruff", "flake8" }, 7 | -- gdscript = { "gdlint" }, 8 | } 9 | 10 | -- "InsertLeave" 11 | vim.api.nvim_create_autocmd({ "BufWritePost" }, { 12 | callback = function() 13 | require("lint").try_lint() 14 | end, 15 | }) 16 | end, 17 | } 18 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/linters/gdlint.lua: -------------------------------------------------------------------------------- 1 | -- ./Glow.gd:10: Error: unused function argument 'delta' (unused-argument) 2 | -- ./mob.gd:5: Error: Trailing whitespace(s) (trailing-whitespace) 3 | local pattern = [[%s*(%d+):(%d+)%s+(%w+)%s+(.+%S)%s+(%S+)]] 4 | local groups = { "lnum", "col", "severity", "message", "code" } 5 | local severity_map = { 6 | ["Error"] = vim.diagnostic.severity.ERROR, 7 | -- ["warn"] = vim.diagnostic.severity.WARN, 8 | -- ["warning"] = vim.diagnostic.severity.WARN, 9 | } 10 | 11 | -- require("lint").linters.gdlint = { 12 | -- cmd = "gdlint", 13 | -- stdin = false, 14 | -- parser = require("lint.parser").from_pattern( 15 | -- pattern, 16 | -- groups, 17 | -- severity_map, 18 | -- { ["source"] = "gdlint" } 19 | -- ), 20 | -- } 21 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/nvim-dap-ui.lua: -------------------------------------------------------------------------------- 1 | return { 2 | setup = function() 3 | require("dapui").setup() 4 | 5 | local dap, dapui = require("dap"), require("dapui") 6 | dap.listeners.after.event_initialized["dapui_config"] = function() 7 | dapui.open() 8 | end 9 | dap.listeners.before.event_terminated["dapui_config"] = function() 10 | dapui.close() 11 | end 12 | dap.listeners.before.event_exited["dapui_config"] = function() 13 | dapui.close() 14 | end 15 | end, 16 | } 17 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/symbols-outline.lua: -------------------------------------------------------------------------------- 1 | local setup = function() 2 | require("symbols-outline").setup({ 3 | auto_preview = false, 4 | width = 35, 5 | }) 6 | vim.cmd("highlight! link FocusedSymbol Search") 7 | -- vim.api.nvim_create_autocmd("FileType", { 8 | -- pattern = "Outline", 9 | -- callback = function() 10 | -- vim.opt_local.signcolumn = false 11 | -- end, 12 | -- }) 13 | 14 | vim.cmd([[autocmd FileType Outline setlocal signcolumn=no]]) 15 | end 16 | 17 | return { setup = setup } 18 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/telescope.lua: -------------------------------------------------------------------------------- 1 | local telescope = require("telescope") 2 | local themes = require("telescope.themes") 3 | local utils = require("rockerboo.utils") 4 | 5 | local plugins_directory = function() 6 | return require("packer.util").join_paths(vim.fn.stdpath("data"), "site", "pack") 7 | end 8 | 9 | local tele = {} 10 | 11 | -- Telescope defaults 12 | tele.setup_defaults = function() 13 | local telescope_config = { 14 | selection_strategy = "reset", 15 | layout_strategy = "flex", 16 | layout_config = { prompt_position = "top", width = 0.8, height = 0.7 }, 17 | sorting_strategy = "ascending", 18 | winblend = 3, 19 | 20 | prompt_prefix = " ", 21 | } 22 | 23 | telescope.setup({ defaults = telescope_config }) 24 | 25 | -- fzf native 26 | telescope.load_extension("fzf") 27 | 28 | utils.keymap({ 29 | "n", 30 | "gt", 31 | require("plugin.telescope").treesitter, 32 | }) 33 | utils.keymap({ 34 | "n", 35 | "pl", 36 | require("plugin.telescope").find_files_plugins, 37 | }) 38 | 39 | require("plugin.telescope.mappings").setup() 40 | end 41 | 42 | -- Themes 43 | -- >>- ------- -< 44 | 45 | tele.theme = function(opts) 46 | local theme = themes.get_dropdown({ 47 | layout_config = { height = 15 }, 48 | 49 | -- borderchars = { 50 | -- prompt = { "─", "│", " ", "│", "╭", "╮", "│", "│" }, 51 | -- results = { "─", "│", "─", "│", "├", "┤", "╯", "╰" }, 52 | -- preview = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, 53 | -- }, 54 | -- 55 | -- borderchars = { 56 | -- prompt = { "▔", "▔", " ", "▎", "▎", "▐", " ", " " }, 57 | -- results = { "▂", "▐", "▂", "▌", "┣", "▅", "▀", "▀" }, 58 | -- preview = { "─", "▍", "▀", "", " ", "▁", "▀", "▀" }, 59 | -- }, 60 | -- borderchars = { 61 | -- prompt = { "░", "░", " ", "░", "░", "░", " ", " " }, 62 | -- results = { "░", "░", "░", "░", "░", "░", "░", "░" }, 63 | -- preview = { "─", "░", "░", "", " ", " ", "░", "░" }, 64 | -- }, 65 | -- borderchars = { 66 | -- prompt = { "▓", "▓", " ", "▓", "▓", "▓", " ", " " }, 67 | -- results = { "▓", "▓", "▓", "▓", "▓", "▓", "▓", "▓" }, 68 | -- preview = { "─", "▓", "▓", "", " ", " ", "▓", "▓" }, 69 | -- }, 70 | }) 71 | return vim.tbl_deep_extend("force", theme, opts or {}) 72 | end 73 | 74 | -- File Functions 75 | -- >>- ------- -< 76 | 77 | tele.find_files = function(input_opts) 78 | local options = vim.tbl_deep_extend("force", { 79 | previewer = false, 80 | debounce = 30, 81 | }, input_opts or {}) 82 | require("telescope.builtin").find_files(tele.theme(options)) 83 | end 84 | 85 | tele.find_files_plugins = function() 86 | require("telescope.builtin").find_files(tele.theme({ cwd = plugins_directory() })) 87 | end 88 | 89 | -- Tree sitter 90 | -- >>- ------- -< 91 | 92 | tele.treesitter = function() 93 | return require("telescope.builtin").treesitter(tele.theme()) 94 | end 95 | 96 | return tele 97 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/telescope/mappings.lua: -------------------------------------------------------------------------------- 1 | local utils = require("rockerboo.utils") 2 | local mappings = {} 3 | 4 | mappings.setup = function() 5 | local n = "n" 6 | 7 | local maps = { 8 | { 9 | n, 10 | "en", 11 | function() 12 | require("telescope.builtin").find_files({ 13 | cwd = "~/.config/nvim", 14 | }) 15 | end, 16 | }, 17 | { 18 | n, 19 | "gp", 20 | function() 21 | require("telescope.builtin").live_grep({ 22 | cwd = "~/.config/nvim", 23 | }) 24 | end, 25 | }, 26 | { 27 | n, 28 | "f", 29 | require("plugin.telescope").find_files, 30 | }, 31 | { 32 | n, 33 | "gf", 34 | function() 35 | require("telescope.builtin").git_files({ theme = "dropdown" }) 36 | end, 37 | { silent = true }, 38 | }, 39 | { 40 | n, 41 | "gd", 42 | function() 43 | require("telescope.builtin").lsp_dynamic_workspace_symbols({ 44 | theme = "dropdown", 45 | }) 46 | end, 47 | }, 48 | { 49 | n, 50 | "dd", 51 | function() 52 | require("telescope.builtin").diagnostics({ 53 | theme = "dropdown", 54 | }) 55 | end, 56 | }, 57 | { 58 | n, 59 | "ds", 60 | function() 61 | require("telescope.builtin").lsp_document_symbols({ 62 | theme = "dropdown", 63 | }) 64 | end, 65 | }, 66 | { 67 | n, 68 | "gW", 69 | function() 70 | require("telescope.builtin").lsp_workspace_symbols(require("telescope.themes").get_dropdown()) 71 | end, 72 | }, 73 | { 74 | n, 75 | "ggr", 76 | require("telescope.builtin").lsp_workspace_symbols, 77 | }, 78 | -- {n, "gl", builtin .. "live_grep"}, 79 | -- { 80 | -- n, 81 | -- "gp", 82 | -- function() 83 | -- require("telescope.builtin")( 84 | -- string.format( 85 | -- "find_files{ cwd = '%s' }", 86 | -- vim.fn.stdpath("cache") 87 | -- ) 88 | -- ) 89 | -- end, 90 | -- }, 91 | { 92 | n, 93 | "cs", 94 | function() 95 | require("telescope.builtin").colorscheme({ 96 | theme = "dropdown", 97 | enable_preview = true, 98 | }) 99 | end, 100 | }, 101 | 102 | -- help 103 | { n, "hh", require("telescope.builtin").help_tags }, 104 | 105 | { 106 | n, 107 | "z=", 108 | function() 109 | require("telescope.builtin").spell_suggest(require("telescope.themes").get_dropdown({ 110 | layout_config = { 111 | prompt_position = "top", 112 | width = 50, 113 | height = 0.7, 114 | }, 115 | })) 116 | end, 117 | }, 118 | } 119 | 120 | utils.keymaps(maps) 121 | end 122 | 123 | return mappings 124 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/treesitter.lua: -------------------------------------------------------------------------------- 1 | local treesitter = {} 2 | -- local ft_to_parser = require("nvim-treesitter.parsers").filetype_to_parsername 3 | 4 | treesitter.setup = function() 5 | require("nvim-treesitter.configs").setup({ 6 | -- modules and its options go here 7 | highlight = { enable = true }, 8 | -- context_commentstring = { 9 | -- enable = true, 10 | -- }, 11 | incremental_selection = { 12 | enable = true, 13 | keymaps = { 14 | init_selection = "gnn", 15 | node_incremental = "gnr", 16 | scope_incremental = "gnc", 17 | node_decremental = "gnm", 18 | }, 19 | }, 20 | indent = { 21 | enable = true, 22 | }, 23 | textsubjects = { 24 | enable = true, 25 | keymaps = { 26 | ["."] = "textsubjects-smart", 27 | [";"] = "textsubjects-container-outer", 28 | }, 29 | }, 30 | textobjects = { 31 | enable = true, 32 | select = { 33 | enable = true, 34 | keymaps = { 35 | ["af"] = "@function.outer", 36 | ["if"] = "@function.inner", 37 | ["ac"] = "@class.outer", 38 | ["ic"] = "@class.inner", 39 | }, 40 | }, 41 | }, 42 | -- playground = { 43 | -- enable = true, 44 | -- disable = {}, 45 | -- updatetime = 25, 46 | -- persist_queries = false, 47 | -- }, 48 | query_linter = { 49 | enable = true, 50 | use_virtual_text = true, 51 | lint_events = { "BufWrite", "CursorHold" }, 52 | }, 53 | additional_vim_regex_hjighlighting = false, 54 | ensure_installed = { 55 | "elixir", 56 | "lua", 57 | "eex", 58 | "html", 59 | "css", 60 | "typescript", 61 | "javascript", 62 | "tsx", 63 | "rust", 64 | "python", 65 | "json", 66 | }, 67 | }) 68 | 69 | -- Not quite sure but deprecated module said to use this 70 | require("ts_context_commentstring").setup({}) 71 | vim.g.skip_ts_context_commentstring_module = true 72 | 73 | local parser_config = 74 | require("nvim-treesitter.parsers").get_parser_configs() 75 | 76 | -- parser_config.gleam = { 77 | -- install_info = { 78 | -- url = "~/code/tree-sitter-gleam", -- local path or git repo 79 | -- files = { "src/parser.c" }, 80 | -- }, 81 | -- filetype = "gleam", -- if filetype does not agrees with parser name 82 | -- } 83 | 84 | -- parser_config.markdown = { 85 | -- install_info = { 86 | -- url = "~/code/tree-sitter-markdown", -- local path or git repo 87 | -- files = { "src/parser.c" }, 88 | -- }, 89 | -- filetype = "markdown", -- if filetype does not agrees with parser name 90 | -- } 91 | 92 | -- parser_config.elixir = { 93 | -- install_info = { 94 | -- url = "~/code/tree-sitter-elixir-ananthakumaran", 95 | -- files = { "src/parser.c", "src/scanner.cc" }, 96 | -- requires_generate_from_grammar = true, 97 | -- }, 98 | -- maintainers = { "@nifoc" }, 99 | -- } 100 | -- parser_config.eex = { 101 | -- install_info = { 102 | -- url = "https://github.com/connorlay/tree-sitter-eex", 103 | -- files = { "src/parser.c" }, 104 | -- branch = "main" 105 | -- }, 106 | -- filetype = "eelixir", 107 | -- maintainers = { "@connorlay" }, 108 | -- } 109 | parser_config.html_eex = { 110 | install_info = { 111 | url = "https://github.com/rockerBOO/tree-sitter-html-eex", 112 | -- url = "/home/rockerboo/code/others/tree-sitter-html-eex", 113 | files = { "src/parser.c", "src/scanner.cc" }, 114 | }, 115 | filetype = "html_eex", 116 | maintainers = { "@connorlay", "@rockerBOO" }, 117 | } 118 | 119 | parser_config.embedded_template = { 120 | install_info = { 121 | url = "https://github.com/tree-sitter/tree-sitter-embedded-template", 122 | files = { "src/parser.c" }, 123 | -- branch = "", 124 | }, 125 | filetype = { "eex", "eelixir" }, 126 | } 127 | parser_config.gotmpl = { 128 | install_info = { 129 | url = "https://github.com/ngalaiko/tree-sitter-go-template", 130 | files = {"src/parser.c"} 131 | }, 132 | filetype = "gotmpl", 133 | -- used_by = {"gohtmltmpl", "gotexttmpl", "gotmpl", "yaml"} 134 | } 135 | vim.treesitter.language.register("eelixir", "eex") 136 | -- local ft_to_parser = require"nvim-treesitter.parsers".filetype_to_parsername 137 | -- ft_to_parser.eelixir = "eex" -- the someft filetype will use the python parser and queries. 138 | vim.filetype.add({ 139 | extension = { 140 | gotmpl = "gotmpl", 141 | }, 142 | pattern = { 143 | ["layouts/.*%.html"] = "gotmpl", 144 | [".*/templates/.*%.tpl"] = "helm", 145 | [".*/templates/.*%.ya?ml"] = "helm", 146 | ["helmfile.*%.ya?ml"] = "helm", 147 | }, 148 | }) 149 | 150 | vim.treesitter.query.set( 151 | "gotmpl", 152 | "injections", 153 | "(define_action (text) @html)" 154 | ) 155 | end 156 | 157 | return treesitter 158 | -------------------------------------------------------------------------------- /config/nvim/lua/plugin/zip.lua: -------------------------------------------------------------------------------- 1 | -- WIP 2 | -- zip to handle yarn packages and be able unzip them for handling finding source files 3 | -- neovim/vim has a zipPlugin.vim which mostly works by executing commands on the OS (zip) 4 | -- would this be faster or better by reworking zip into lua instead of using the vimscript version? 5 | 6 | local decode_uri = function(uri) 7 | -- vim.fn.substitute( 8 | -- uri, 9 | -- "%([a-fA-F0-9][a-fA-F0-9])", 10 | -- '=nr2char("0x", submatch(1))', 11 | -- "g" 12 | -- ) 13 | 14 | return uri:gsub("%([a-fA-F0-9][a-fA-F0-9])", '=nr2char("0x", submatch(1))') 15 | end 16 | 17 | local clear_duplicate_buffers = function(uri) 18 | local decoded = decode_uri(uri) 19 | if decoded ~= uri then 20 | local escaped = vim.fn.fnameescape(decoded) 21 | vim.cmd(string.format([[ sil! exe "bwipeout " . %s ]], escaped)) 22 | vim.cmd(string.format([[ exe "keepalt file " . %s ]], escaped)) 23 | vim.cmd(string.format([[ sil! exe "bwipeout " . %s ]], vim.fn.fnameescape(uri))) 24 | end 25 | end 26 | 27 | local rzip_override = function() 28 | -- local autocmd = vim.api.nvim_create_autocmd 29 | -- local clear_autocmds = vim.api.nvim_clear_autocmds 30 | -- local delete_autocmd = vim.api.nvim_del_autocmd 31 | 32 | -- clear_autocmds({'zip'} 33 | end 34 | 35 | return { 36 | decode_uri = decode_uri, 37 | clear_duplicate_buffers = clear_duplicate_buffers, 38 | rzip_override = rzip_override, 39 | } 40 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/ai.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- { 3 | -- "yetone/avante.nvim", 4 | -- event = "VeryLazy", 5 | -- lazy = false, 6 | -- build = ":AvanteBuild source=false", 7 | -- opts = { 8 | -- provider = "ollama", 9 | -- vendors = { 10 | -- ---@type AvanteProvider 11 | -- ollama = { 12 | -- ["local"] = true, 13 | -- endpoint = "127.0.0.1:11434/v1", 14 | -- -- model = "gemma2:2b", 15 | -- model = "example:latest", 16 | -- -- model = "llama3.1:latest", 17 | -- parse_curl_args = function(opts, code_opts) 18 | -- return { 19 | -- url = opts.endpoint .. "/chat/completions", 20 | -- headers = { 21 | -- ["Accept"] = "application/json", 22 | -- ["Content-Type"] = "application/json", 23 | -- }, 24 | -- body = { 25 | -- model = opts.model, 26 | -- messages = require("avante.providers").copilot.parse_message( 27 | -- code_opts 28 | -- ), -- you can make your own message, but this is very advanced 29 | -- max_tokens = 2048, 30 | -- stream = true, 31 | -- }, 32 | -- } 33 | -- end, 34 | -- parse_response_data = function( 35 | -- data_stream, 36 | -- event_state, 37 | -- opts 38 | -- ) 39 | -- require("avante.providers").openai.parse_response( 40 | -- data_stream, 41 | -- event_state, 42 | -- opts 43 | -- ) 44 | -- end, 45 | -- }, 46 | -- }, 47 | -- hints = { 48 | -- enabled = false, 49 | -- }, 50 | -- }, 51 | -- cmd = { 52 | -- "AvanteAsk", 53 | -- }, 54 | -- dependencies = { 55 | -- "stevearc/dressing.nvim", 56 | -- "nvim-lua/plenary.nvim", 57 | -- "MunifTanjim/nui.nvim", 58 | -- --- The below dependencies are optional, 59 | -- "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons 60 | -- -- "zbirenbaum/copilot.lua", -- for providers='copilot' 61 | -- { 62 | -- -- support for image pasting 63 | -- "HakonHarnes/img-clip.nvim", 64 | -- event = "VeryLazy", 65 | -- opts = { 66 | -- -- recommended settings 67 | -- default = { 68 | -- embed_image_as_base64 = false, 69 | -- prompt_for_file_name = false, 70 | -- drag_and_drop = { 71 | -- insert_mode = true, 72 | -- }, 73 | -- -- required for Windows users 74 | -- use_absolute_path = true, 75 | -- }, 76 | -- }, 77 | -- }, 78 | -- { 79 | -- -- Make sure to setup it properly if you have lazy=true 80 | -- "MeanderingProgrammer/render-markdown.nvim", 81 | -- opts = { 82 | -- file_types = { "markdown", "Avante" }, 83 | -- }, 84 | -- ft = { "markdown", "Avante" }, 85 | -- }, 86 | -- }, 87 | -- }, 88 | } 89 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/color.lua: -------------------------------------------------------------------------------- 1 | return { { dir = "~/code/nvim-colorizer.lua" } } 2 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/colorscheme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "bluz71/vim-moonfly-colors", 3 | "ChristianChiarulli/nvcode-color-schemes.vim", 4 | { 5 | dir = "/mnt/500h/rockerboo/code/boo-colorscheme-nvim" 6 | }, 7 | "bluz71/vim-nightfly-guicolors", 8 | "folke/tokyonight.nvim" 9 | } 10 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/comment.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "numToStr/Comment.nvim", 4 | config = function() 5 | require("Comment").setup() 6 | end, 7 | }, 8 | "JoosepAlviste/nvim-ts-context-commentstring", 9 | } 10 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/completion.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "hrsh7th/nvim-cmp", 4 | dependencies = { 5 | -- "hrsh7th/cmp-buffer", 6 | "hrsh7th/cmp-nvim-lsp", 7 | { 8 | "hrsh7th/cmp-nvim-lua", 9 | ft = "lua", 10 | -- this is after/plugin content 11 | config = function() 12 | require("cmp").register_source( 13 | "nvim_lua", 14 | require("cmp_nvim_lua").new() 15 | ) 16 | end, 17 | }, 18 | { 19 | "L3MON4D3/LuaSnip", 20 | wants = "rafamadriz/friendly-snippets", 21 | }, 22 | "hrsh7th/cmp-vsnip", 23 | "saadparwaiz1/cmp_luasnip", 24 | "ray-x/cmp-treesitter", 25 | }, 26 | }, 27 | { 28 | "petertriho/cmp-git", 29 | dependencies = { "nvim-lua/plenary.nvim", "hrsh7th/nvim-cmp" }, 30 | }, 31 | 32 | "hrsh7th/cmp-nvim-lua", 33 | } 34 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/config.lua: -------------------------------------------------------------------------------- 1 | return { "gpanders/editorconfig.nvim" } 2 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/dap.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "mfussenegger/nvim-dap", 3 | "nvim-neotest/nvim-nio", 4 | { 5 | "rcarriga/nvim-dap-ui", 6 | dev = true, 7 | dir = "~/code/others/nvim-dap-ui", 8 | dependencies = { 9 | "mfussenegger/nvim-dap", 10 | "nvim-neotest/nvim-nio", 11 | }, 12 | config = function() 13 | require("dapui").setup({ 14 | layouts = { 15 | 16 | { 17 | elements = { 18 | "repl", 19 | "console", 20 | }, 21 | size = 0.25, -- 25% of total lines 22 | position = "bottom", 23 | }, 24 | { 25 | elements = { 26 | -- Elements can be strings or table with id and size keys. 27 | { id = "scopes", size = 0.25 }, 28 | "breakpoints", 29 | "stacks", 30 | "watches", 31 | }, 32 | size = 40, -- 40 columns 33 | position = "left", 34 | }, 35 | }, 36 | }) 37 | end, 38 | }, 39 | 40 | { 41 | "theHamsta/nvim-dap-virtual-text", 42 | dependencies = { "mfussenegger/nvim-dap" }, 43 | }, 44 | 45 | { 46 | "mfussenegger/nvim-dap-python", 47 | dependencies = { "nvim-telescope/telescope-dap.nvim" }, 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/db.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "tpope/vim-dadbod", 3 | "kristijanhusak/vim-dadbod-ui" 4 | } 5 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/elixir.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "elixir-tools/elixir-tools.nvim", 4 | version = "*", 5 | event = { "BufReadPre", "BufNewFile" }, 6 | config = function() 7 | local elixir = require("elixir") 8 | local elixirls = require("elixir.elixirls") 9 | 10 | elixir.setup({ 11 | nextls = { enable = true }, 12 | elixirls = { 13 | enable = true, 14 | settings = elixirls.settings({ 15 | dialyzerEnabled = false, 16 | enableTestLenses = false, 17 | }), 18 | on_attach = function(client, bufnr) 19 | -- vim.keymap.set( 20 | -- "n", 21 | -- "fp", 22 | -- ":ElixirFromPipe", 23 | -- { buffer = true, noremap = true } 24 | -- ) 25 | -- vim.keymap.set( 26 | -- "n", 27 | -- "tp", 28 | -- ":ElixirToPipe", 29 | -- { buffer = true, noremap = true } 30 | -- ) 31 | -- vim.keymap.set( 32 | -- "v", 33 | -- "em", 34 | -- ":ElixirExpandMacro", 35 | -- { buffer = true, noremap = true } 36 | -- ) 37 | end, 38 | }, 39 | projectionist = { 40 | enable = true, 41 | }, 42 | }) 43 | end, 44 | dependencies = { 45 | "nvim-lua/plenary.nvim", 46 | }, 47 | }, 48 | } 49 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/filetree.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "kyazdani42/nvim-tree.lua", 4 | dependencies = { 5 | -- "kyazdani42/nvim-web-devicons", -- optional, for file icons 6 | "nvim-tree/nvim-web-devicons", 7 | }, 8 | config = function() 9 | require("nvim-tree").setup() 10 | end, 11 | }, 12 | } 13 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/format.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "mhartington/formatter.nvim" 3 | } 4 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/icons.lua: -------------------------------------------------------------------------------- 1 | return { "nvim-tree/nvim-web-devicons" } 2 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/lib.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-lua/plenary.nvim" 3 | } 4 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/lint.lua: -------------------------------------------------------------------------------- 1 | return { "mfussenegger/nvim-lint" } 2 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/lsp.lua: -------------------------------------------------------------------------------- 1 | return { "neovim/nvim-lspconfig", 2 | { dir = "~/code/symbols-outline.nvim" }, 3 | "onsails/lspkind-nvim", 4 | 5 | { 6 | "hrsh7th/cmp-nvim-lsp", 7 | dependencies = "onsails/lspkind-nvim", 8 | }, 9 | 10 | { 11 | "hrsh7th/cmp-nvim-lsp-signature-help", 12 | dependencies = { "hrsh7th/nvim-cmp" }, 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/rust.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { dir = "/home/rockerboo/code/rust-tools.nvim", } 3 | } 4 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/schema.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "b0o/schemastore.nvim", 3 | } 4 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/snippet.lua: -------------------------------------------------------------------------------- 1 | return { "L3MON4D3/LuaSnip" } 2 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/statusbar.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { dir = "~/code/express_line.nvim" } 3 | } 4 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-telescope/telescope.nvim", 4 | dependencies = { "nvim-lua/plenary.nvim" }, 5 | }, 6 | { 7 | "nvim-telescope/telescope-fzf-native.nvim", 8 | build = "make", 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/test.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "David-Kunz/jester", 4 | config = function() 5 | require("jester").setup({ 6 | dap = { 7 | type = "yarn", 8 | }, 9 | path_to_jest_debug = "test", 10 | path_to_jest_run = "test", 11 | -- cmd = "test -t '$result' -- $file", -- run command 12 | }) 13 | end, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/textobject.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "tpope/vim-surround", 3 | 4 | } 5 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | build = function() 5 | require("nvim-treesitter.install").update({ with_sync = true })() 6 | end, 7 | }, 8 | { 9 | "windwp/nvim-ts-autotag", 10 | dependencies = { "nvim-treesitter/nvim-treesitter" }, 11 | }, 12 | { 13 | "RRethy/nvim-treesitter-textsubjects", 14 | dependencies = { "nvim-treesitter/nvim-treesitter" }, 15 | }, 16 | { 17 | "mfussenegger/nvim-ts-hint-textobject", 18 | config = function() 19 | require("tsht").config.hint_keys = { 20 | "h", 21 | "j", 22 | "f", 23 | "d", 24 | "n", 25 | "v", 26 | "s", 27 | "l", 28 | "a", 29 | } 30 | end, 31 | 32 | dependencies = { "nvim-treesitter/nvim-treesitter" }, 33 | }, 34 | { 35 | "theHamsta/nvim-semantic-tokens", 36 | config = function() 37 | require("nvim-semantic-tokens").setup({ 38 | preset = "default", 39 | highlighters = { 40 | require("nvim-semantic-tokens.table-highlighter"), 41 | }, 42 | }) 43 | end, 44 | ependencies = { "nvim-treesitter/nvim-treesitter" }, 45 | }, 46 | } 47 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/typescript.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "pmizio/typescript-tools.nvim", 3 | dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" }, 4 | opts = {}, 5 | } 6 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/ui.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "stevearc/dressing.nvim", 3 | "nvim-lua/popup.nvim", 4 | "ThePrimeagen/harpoon", 5 | 6 | { 7 | "folke/trouble.nvim", 8 | config = function() 9 | require("trouble").setup({}) 10 | end, 11 | }, 12 | 13 | "MunifTanjim/nui.nvim", 14 | { 15 | "j-hui/fidget.nvim", 16 | tag = "legacy", 17 | config = function() 18 | require("fidget").setup({ 19 | sources = { -- Sources to configure 20 | itex = { -- Name of source 21 | ignore = true, -- Ignore notifications from this source 22 | }, 23 | }, 24 | -- fmt = { 25 | -- max_messages = 2, 26 | -- }, 27 | }) 28 | end, 29 | }, 30 | 31 | { 32 | -- Make sure to setup it properly if you have lazy=true 33 | "MeanderingProgrammer/render-markdown.nvim", 34 | opts = { 35 | file_types = { "markdown", "Avante" }, 36 | bullet = { 37 | -- Turn on / off list bullet rendering 38 | enabled = false, 39 | }, 40 | }, 41 | ft = { "markdown", "Avante" }, 42 | }, 43 | 44 | { 45 | dir = "~/code/others/player.nvim", 46 | cmd = "Player", 47 | config = function() 48 | require("player").setup() 49 | end, 50 | }, 51 | { 52 | "rcarriga/nvim-notify", 53 | config = function() 54 | require("notify").setup({ 55 | render = "minimal", 56 | timeout = 3000, 57 | }) 58 | vim.notify = require("notify") 59 | end, 60 | }, 61 | 62 | { "jake-stewart/force-cul.nvim" }, 63 | } 64 | -------------------------------------------------------------------------------- /config/nvim/lua/rockerboo/functional.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Functional functions for lists which are tables 3 | -- 4 | local F = {} 5 | 6 | -- @param array = table -- { "value", "x" } 7 | -- @param fn = function -- function(currentValue, index, array) 8 | F.map = function(fn) 9 | return function(array) 10 | local result = {} 11 | 12 | for i, v in pairs(array) do 13 | table.insert(result, fn(v, i, array)) 14 | end 15 | 16 | print(vim.inspect(result)) 17 | 18 | return result 19 | end 20 | end 21 | 22 | -- @param array = table -- { "value", "x" } 23 | -- @param fn = function -- function(accumulator, currentValue, index, array) 24 | F.reduce = function(fn, initial) 25 | return function(array) 26 | local result = initial 27 | for i, v in ipairs(array) do 28 | result = fn(result, v, i, array) 29 | end 30 | 31 | return result 32 | end 33 | end 34 | 35 | -- @param array = table -- { "value", "x" } 36 | -- @param fn = function -- function(currentValue, index, array) 37 | F.filter = function(fn) 38 | return function(array) 39 | local result = {} 40 | 41 | for i, v in ipairs(array) do 42 | if fn(v, i, array) then 43 | table.insert(result, v) 44 | end 45 | end 46 | 47 | return result 48 | end 49 | end 50 | 51 | ---Execute functions until one results in true 52 | ---@param fn function 53 | F.any = function(fn) 54 | ---@param array table 55 | return function(array) 56 | for _, v in ipairs(array) do 57 | if fn(v) then 58 | return true 59 | end 60 | end 61 | 62 | return false 63 | end 64 | end 65 | 66 | F.find = function(fn) 67 | return function(array) 68 | for _, v in ipairs(array) do 69 | if fn(v) then 70 | return v 71 | end 72 | end 73 | end 74 | end 75 | 76 | F.flatten = function(array) 77 | return F.reduce(function(acc, value) 78 | if type(value) == "table" then 79 | for _, v in ipairs(value) do 80 | table.insert(acc, v) 81 | end 82 | else 83 | table.insert(acc, value) 84 | end 85 | 86 | return acc 87 | end, {})(array) 88 | end 89 | 90 | -- @param array = table -- { "a", "b" } 91 | -- @param value = string | number -- "a" 92 | -- @return boolean 93 | F.contains = function(value) 94 | return function(array) 95 | for _, v in ipairs(array) do 96 | if v == value then 97 | return true 98 | end 99 | end 100 | 101 | return false 102 | end 103 | end 104 | 105 | -- @param array = table -- { "value", "x" } 106 | -- @param sep = string -- ", " 107 | -- @return string -- "value, x" 108 | F.join = function(sep) 109 | return function(array) 110 | local i = 1 111 | local result = "" 112 | 113 | while i < #array + 1 do 114 | if i == 1 then 115 | result = array[i] 116 | elseif array[i] ~= nil then 117 | result = result .. sep .. array[i] 118 | end 119 | i = i + 1 120 | end 121 | 122 | return result 123 | end 124 | end 125 | 126 | return F 127 | -------------------------------------------------------------------------------- /config/nvim/lua/rockerboo/functional.test.lua: -------------------------------------------------------------------------------- 1 | local f = require("rockerboo.functional") 2 | 3 | describe("functional", function() 4 | it("map list", function() 5 | assert.is_equal( 6 | f.map({ 1, 2, 3 }, function(v) 7 | return v + 1 8 | end), 9 | { 2, 3, 4 } 10 | ) 11 | end) 12 | 13 | it("reduce list", function() 14 | assert.is_equal( 15 | f.reduce({ 1, 2, 3 }, function(acc, v) 16 | return acc + v 17 | end), 18 | 6 19 | ) 20 | end) 21 | 22 | it("filter list", function() 23 | assert.is_equal( 24 | f.filter({ 1, 2, 3 }, function(v) 25 | return v < 2 26 | end), 27 | { 2, 3 } 28 | ) 29 | end) 30 | 31 | it("join list", function() 32 | assert.is_equal(f.join({ "a", "b", "c" }, ""), "abc") 33 | end) 34 | end) 35 | -------------------------------------------------------------------------------- /config/nvim/lua/rockerboo/functional_spec.lua: -------------------------------------------------------------------------------- 1 | local f = require("rockerboo.functional") 2 | 3 | describe("functional", function() 4 | it("map list", function() 5 | assert.are.same( 6 | f.map(function(v) 7 | return v + 1 8 | end)({ 1, 2, 3 }), 9 | { 2, 3, 4 } 10 | ) 11 | end) 12 | 13 | it("reduce list", function() 14 | assert.are.same( 15 | f.reduce(function(acc, v) 16 | return acc + v 17 | end, 0)({ 1, 2, 3 }), 18 | 6 19 | ) 20 | end) 21 | 22 | it("filter list", function() 23 | assert.are.same( 24 | f.filter(function(v) 25 | return v < 2 26 | end)({ 1, 2, 3 }), 27 | { 1 } 28 | ) 29 | end) 30 | 31 | it("contains in list", function() 32 | assert.is_true(f.contains(1)({ 1, 2, 3 })) 33 | end) 34 | 35 | it("join list", function() 36 | assert.are.same(f.join("")({ "a", "b", "c" }), "abc") 37 | end) 38 | end) 39 | -------------------------------------------------------------------------------- /config/nvim/lua/rockerboo/lsp.lua: -------------------------------------------------------------------------------- 1 | -- local lsp_status = require("lsp-status") 2 | local utils = require("rockerboo.utils") 3 | -- utils.log_to_file("/tmp/nvim-lsp-client.log")(vim.inspect(client)) 4 | 5 | local on_attach_buffer = function(client, bufnr) 6 | -- print("'" .. client.name .. "' language server attached") 7 | 8 | utils.log_to_file("/tmp/nvim-lsp-client.log")(vim.inspect(client)) 9 | 10 | -- lsp_status.on_attach(client) 11 | 12 | -- local capLog = utils.log_to_file("/tmp/capabilities.log") 13 | -- capLog( 14 | -- "client.name: " 15 | -- .. client.name 16 | -- .. "\n" 17 | -- .. vim.inspect(client.server_capabilities) 18 | -- ) 19 | 20 | -- if client.server_capabilities.document_formatting then 21 | -- utils.keymap({ 22 | -- "n", 23 | -- "aa", 24 | -- "lua vim.lsp.buf.formatting()", 25 | -- {}, 26 | -- }) 27 | -- vim.api.nvim_define_augroup({ name = "Format" }) 28 | -- vim.api.nvim_define_autocmd({ 29 | -- group = "Format", 30 | -- event = "BufWritePre", 31 | -- pattern = "", 32 | -- callback = function() 33 | -- vim.lsp.buf.format({ 34 | -- timeout_ms = 1000, 35 | -- filter = function(c) 36 | -- return c.name ~= "tsserver" 37 | -- end, 38 | -- }) 39 | -- end, 40 | -- }) 41 | -- 42 | -- vim.cmd( 43 | -- "echo " .. string.format("Formatting supported %s", client.name) 44 | -- ) 45 | -- end 46 | 47 | local caps = client.server_capabilities 48 | 49 | if caps.documentHighlightProvider then 50 | local group = vim.api.nvim_create_augroup("LSPDocumentHighlight", {}) 51 | 52 | vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { 53 | buffer = bufnr, 54 | group = group, 55 | callback = function() 56 | vim.lsp.buf.document_highlight() 57 | end, 58 | }) 59 | vim.api.nvim_create_autocmd({ "CursorMoved" }, { 60 | buffer = bufnr, 61 | group = group, 62 | callback = function() 63 | vim.lsp.buf.clear_references() 64 | end, 65 | }) 66 | end 67 | -- 68 | -- if 69 | -- caps.inlayHintProvider ~= nil 70 | -- and caps.inlayHintProvider.resolveProvider == true 71 | -- then 72 | -- -- vim.cmd("echo attach inlay hints") 73 | -- -- print("attach inlay hints") 74 | -- vim.api.nvim_create_autocmd({ "InsertEnter" }, { 75 | -- buffer = bufnr, 76 | -- callback = function(args) 77 | -- vim.lsp.buf.inlay_hint(args.buf, true) 78 | -- end, 79 | -- }) 80 | -- vim.api.nvim_create_autocmd({ "InsertLeave" }, { 81 | -- buffer = bufnr, 82 | -- callback = function(args) 83 | -- vim.lsp.buf.inlay_hint(args.buf, false) 84 | -- end, 85 | -- }) 86 | -- end 87 | 88 | if caps.semanticTokensProvider and caps.semanticTokensProvider.full then 89 | local augroup = vim.api.nvim_create_augroup("SemanticTokens", {}) 90 | vim.api.nvim_create_autocmd("TextChanged", { 91 | group = augroup, 92 | buffer = bufnr, 93 | callback = function() 94 | if vim.lsp.buf.semantic_tokens_full then 95 | vim.lsp.buf.semantic_tokens_full() 96 | end 97 | end, 98 | }) 99 | if vim.lsp.buf.semantic_tokens_full then 100 | -- fire it first time on load as well 101 | vim.lsp.buf.semantic_tokens_full() 102 | end 103 | end 104 | end 105 | 106 | return { 107 | on_attach_buffer = on_attach_buffer, 108 | } 109 | -------------------------------------------------------------------------------- /config/nvim/lua/rockerboo/lsp_status.lua: -------------------------------------------------------------------------------- 1 | local lsp_status = require("lsp-status") 2 | 3 | local status = {} 4 | 5 | status.select_symbol = function(cursor_pos, symbol) 6 | if symbol.valueRange then 7 | local value_range = { 8 | ["start"] = { character = 0, line = vim.fn.byte2line(symbol.valueRange[1]) }, 9 | ["end"] = { character = 0, line = vim.fn.byte2line(symbol.valueRange[2]) }, 10 | } 11 | 12 | return require("lsp-status.util").in_range(cursor_pos, value_range) 13 | end 14 | end 15 | 16 | status.activate = function() 17 | lsp_status.config({ select_symbol = status.select_symbol }) 18 | 19 | lsp_status.register_progress() 20 | end 21 | 22 | return status 23 | -------------------------------------------------------------------------------- /config/nvim/lua/rockerboo/scratch.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.run_script = function() 4 | -- vim.cmd(":vsplit term://top") 5 | -- require("FTerm").run({ "python", "nsfw.py" }) 6 | -- require("FTerm").run({ "python", "lora-inspector.py", "/mnt/900/lora/latentlabs360_v01.safetensors" }) 7 | require("FTerm").run({ "python", "parsers.py" }) 8 | end 9 | 10 | return M 11 | -------------------------------------------------------------------------------- /config/nvim/lua/rockerboo/tests.lua: -------------------------------------------------------------------------------- 1 | -- [[ 2 | -- Configuration for running the plenary test harness 3 | -- ]] 4 | local test_runner = {} 5 | 6 | -- local keymap = function(mode, key, map, opts) 7 | -- opts = opts or {} 8 | 9 | -- vim.api.nvim_set_keymap(mode, key, ":lua " .. map .. "", opts) 10 | -- end 11 | 12 | test_runner.setup = function() 13 | -- keymap("n", "t", "require('rockerboo.tests').run(vim.fn.expand('%:p'))") 14 | end 15 | 16 | test_runner.run = function(file_or_directory) 17 | local opts = { 18 | winopts = { 19 | topleft = "┌", 20 | topright = "┐", 21 | top = "-", 22 | left = "|", 23 | right = "|", 24 | botleft = "└", 25 | botright = "┘", 26 | bot = "─", 27 | }, 28 | } 29 | return require("plenary.test_harness").test_directory(file_or_directory, opts) 30 | end 31 | 32 | -- vim-test settings 33 | vim.g["test#strategy"] = "dispatch" 34 | vim.g["test#javascript#jest#options"] = "--color=always" 35 | 36 | return test_runner 37 | -------------------------------------------------------------------------------- /config/nvim/lua/rockerboo/typescript.lua: -------------------------------------------------------------------------------- 1 | local function filter(arr, fn) 2 | if type(arr) ~= "table" then 3 | return arr 4 | end 5 | 6 | local filtered = {} 7 | for k, v in pairs(arr) do 8 | if fn(v, k, arr) then 9 | table.insert(filtered, v) 10 | end 11 | end 12 | 13 | return filtered 14 | end 15 | 16 | local function filterReactDTS(value) 17 | return string.match(value.filename, "react/index.d.ts") == nil 18 | end 19 | 20 | local function on_list(options) 21 | -- https://github.com/typescript-language-server/typescript-language-server/issues/216 22 | local items = options.items 23 | if #items > 1 then 24 | items = filter(items, filterReactDTS) 25 | end 26 | 27 | vim.fn.setqflist({}, " ", { title = options.title, items = items, context = options.context }) 28 | vim.api.nvim_command("cfirst") 29 | end 30 | 31 | return { 32 | on_list = on_list, 33 | } 34 | -------------------------------------------------------------------------------- /config/nvim/lua/rockerboo/utils.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | -- @param map {{mode, lhs, rhs, opts}, ..} 4 | -- @param mode string 'n' | 'i' | 'v' 5 | -- @param lhs string key to map 6 | -- @param rhs string command to run 7 | M.keymap = function(map) 8 | map = map or {} 9 | local opts = map[4] or {} 10 | vim.keymap.set(map[1], map[2], map[3], opts) 11 | end 12 | 13 | -- @param maps list of keymaps 14 | M.keymaps = function(maps) 15 | for _, m in ipairs(maps) do 16 | M.keymap(m) 17 | end 18 | end 19 | 20 | -- Skip these servers for formatting 21 | local skip_formatting_lsp = { "diagnosticls", "sumneko_lua", "tsserver" } 22 | 23 | -- Format the file using the lsp formatter 24 | M.lsp_format = function() 25 | -- @param client lsp client 26 | local format = function(client) 27 | print(string.format("Formatting for attached client: %s", client.name)) 28 | 29 | vim.lsp.buf.formatting_sync(nil, 1000) 30 | end 31 | 32 | -- Run the function if it passes all the checks 33 | -- @param client lsp client 34 | local once = function(client) 35 | return function(skip, f) 36 | for _, key in ipairs(skip) do 37 | if client.name == key then 38 | return 39 | end 40 | end 41 | 42 | f(client) 43 | end 44 | end 45 | 46 | -- Run our formatters 47 | for _, client in pairs(vim.lsp.get_clients()) do 48 | once(client)(skip_formatting_lsp, format) 49 | end 50 | end 51 | 52 | M.log_to_file = function(logfile) 53 | return function(log_value) 54 | local file = io.open(logfile, "a") 55 | if not file then 56 | return 57 | end 58 | 59 | file:write(log_value .. "\n") 60 | file:close() 61 | end 62 | end 63 | 64 | M.request_refact_file_context = function() 65 | -- what is the current cursor location 66 | -- what is the current file 67 | -- take the preceding part of the file after the current location and add it to the suffix portion 68 | -- https://codeium.com/blog/why-code-completion-needs-fill-in-the-middle 69 | -- need to flip the suffix context into the suffix section of the prompt 70 | -- (move things after the cursor into the suffix section) 71 | -- def x():def another_function():\nprint("hello world") 72 | -- this lets us keep this context and let the model know to complete at the middle section 73 | -- must be aware of the context we are sharing as it can be too big for the model 74 | -- in these cases we might want to reduce the size of the context 75 | return false 76 | end 77 | 78 | M.request_refact = function() 79 | local endpoint = "http://localhost:8000/infer" 80 | 81 | -- local selection = M.get_text_from_selection(M.get_selection()) 82 | local selection = M.get_visual() 83 | local result = M.raw_request_refact(endpoint)("" .. table.concat(selection, "\n") .. "") 84 | 85 | if result ~= nil then 86 | end 87 | end 88 | 89 | M.raw_request_refact = function(endpoint) 90 | return function(prompt) 91 | local result = nil 92 | vim.system({ 93 | "curl", 94 | "--no-progress-meter", 95 | "-X", 96 | "POST", 97 | "-H", 98 | "Content-Type: application/json", 99 | "-d", 100 | vim.json.encode({ prompt = prompt, temperature = 0.4 }), 101 | endpoint, 102 | }, { 103 | text = true, 104 | stdout = function(err, data) 105 | if err ~= nil then 106 | print(err) 107 | end 108 | 109 | if data ~= nil then 110 | print("out") 111 | print(data) 112 | result = vim.json.decode(data) 113 | print(result["result"]) 114 | end 115 | end, 116 | -- stderr = function(err, data) 117 | -- if err ~= nil then 118 | -- print(err) 119 | -- end 120 | -- 121 | -- print("err") 122 | -- print(data) 123 | -- end, 124 | }):wait() 125 | 126 | return result 127 | end 128 | end 129 | 130 | function M.get_visual() 131 | local _, ls, cs = unpack(vim.fn.getpos("v")) 132 | local _, le, ce = unpack(vim.fn.getpos(".")) 133 | 134 | -- reverse the order if we go from bottom/right to top left 135 | if ls > le then 136 | local temp = ls 137 | ls = le 138 | le = temp 139 | end 140 | 141 | print(vim.inspect({ ls, cs })) 142 | print(vim.inspect({ le, ce })) 143 | return vim.api.nvim_buf_get_text(0, ls - 1, cs - 1, le - 1, ce, {}) 144 | end 145 | 146 | function M.get_selection() 147 | local start = vim.fn.getpos("'<") 148 | local stop = vim.fn.getpos("'>") 149 | 150 | print(vim.inspect(stop)) 151 | print(vim.inspect(start)) 152 | -- print('start: ' .. start .. ' stop: ' .. stop) 153 | 154 | return { 155 | start = { 156 | row = start[2] - 1, 157 | col = start[3] - 1, 158 | }, 159 | stop = { 160 | row = stop[2] - 1, 161 | col = stop[3], -- stop col can be vim.v.maxcol which means entire line 162 | }, 163 | } 164 | end 165 | 166 | local COL_ENTIRE_LINE = vim.v.maxcol or 2147483647 167 | 168 | -- https://github.com/gsuuon/llm.nvim/blob/main/lua/llm/util.lua#L335C1-L359C4 169 | function M.get_text_from_selection(selection) 170 | local start_row = selection.start.row 171 | local start_col = selection.start.col 172 | 173 | if start_col == COL_ENTIRE_LINE then 174 | start_row = start_row + 1 175 | start_col = 0 176 | end 177 | 178 | local success, text = pcall( 179 | vim.api.nvim_buf_get_text, 180 | 0, 181 | start_row, 182 | start_col, 183 | selection.stop.row, 184 | selection.stop.col == COL_ENTIRE_LINE and -1 or selection.stop.col, 185 | {} 186 | ) 187 | 188 | if success then 189 | return text 190 | else 191 | return {} 192 | end 193 | end 194 | 195 | -- https://github.com/gsuuon/llm.nvim/blob/main/lua/llm/util.lua#L361C1-L378C4 196 | function M.set_text(selection, lines) 197 | local stop_col = selection.stop.col == M.COL_ENTIRE_LINE 198 | and #assert( 199 | vim.api.nvim_buf_get_lines(0, selection.stop.row, selection.stop.row + 1, true)[1], 200 | "No line at " .. tostring(selection.stop.row) 201 | ) 202 | or selection.stop.col 203 | 204 | vim.api.nvim_buf_set_text(0, selection.start.row, selection.start.col, selection.stop.row, stop_col, lines) 205 | end 206 | 207 | return M 208 | -------------------------------------------------------------------------------- /config/nvim/lua/rockerboo/voices.lua: -------------------------------------------------------------------------------- 1 | local function list_files(directory, callback) 2 | local req, err, name = vim.uv.fs_scandir(directory) 3 | if not req then 4 | print("Error opening directory: " .. err) 5 | return 6 | end 7 | 8 | local files = {} 9 | 10 | coroutine.wrap(function() 11 | while true do 12 | local name, type = vim.uv.fs_scandir_next(req) 13 | if not name then 14 | break 15 | end 16 | table.insert(files, name) 17 | print(name, type) 18 | end 19 | callback(files) 20 | end)() 21 | end 22 | 23 | local voices = function() 24 | -- local pickers = require("telescope.pickers") 25 | -- local finders = require("telescope.finders") 26 | -- local sorters = require("telescope.sorters") 27 | local themes = require("telescope.themes") 28 | -- local action_state = require("telescope.actions.state") 29 | -- local conf = require("telescope.config").values 30 | 31 | list_files("/home/rockerboo/code/others/VALL-E-X/customs", function(files) 32 | local filename = vim.fn.expand("%") 33 | local opts = themes.get_dropdown({}) 34 | 35 | vim.ui.select(files, { prompt = "Voices" }, function(choice) 36 | if choice == nil then 37 | return 38 | end 39 | 40 | vim.cmd("sp") 41 | -- Get the handle of the current buffer in the new window 42 | local new_buf = vim.api.nvim_get_current_buf() 43 | 44 | -- Set the current buffer in the new window 45 | vim.api.nvim_set_current_buf(new_buf) 46 | 47 | vim.cmd( 48 | 'term echo "' 49 | .. choice:gsub("%.npz", "") 50 | .. '" && cd /home/rockerboo/code/others/VALL-E-X && source .env && python test.py --prompt "' 51 | .. choice:gsub("%.npz", "") 52 | .. '" --file ' 53 | .. filename 54 | .. " && audio-player -v 0.2 completed-compiling.wav" 55 | ) 56 | end) 57 | -- pickers 58 | -- .new(opts, { 59 | -- prompt_title = "Voices", 60 | -- finder = finders.new_table({ 61 | -- results = files, 62 | -- entry_maker = opts.entry_maker, 63 | -- }), 64 | -- previewer = conf.grep_previewer(opts), 65 | -- sorter = sorters.highlighter_only(opts), 66 | -- attach_mappings = function(prompt_bufnr, map) 67 | -- map("i", "", function() 68 | -- local selection = action_state.get_selected_entry() 69 | -- vim.cmd("sp") 70 | -- -- Get the handle of the current buffer in the new window 71 | -- local new_buf = vim.api.nvim_get_current_buf() 72 | -- 73 | -- -- Set the current buffer in the new window 74 | -- vim.api.nvim_set_current_buf(new_buf) 75 | -- 76 | -- vim.cmd( 77 | -- 'term echo "' 78 | -- .. selection[1]:gsub("%.npz", "") 79 | -- .. '" && cd /home/rockerboo/code/others/VALL-E-X && source .env && python test.py --prompt "' 80 | -- .. selection[1]:gsub("%.npz", "") 81 | -- .. '" --file ' 82 | -- .. filename 83 | -- .. " && audio-player -v 0.2 completed-compiling.wav" 84 | -- ) 85 | -- end) 86 | -- return true 87 | -- end, 88 | -- }) 89 | -- :find() 90 | end) 91 | end 92 | 93 | local save_voice = function() 94 | local datetime = vim.fn.strftime("%Y-%m-%d-%H%M%S") 95 | 96 | vim.system({ "cat", "meta.json", "|", "jq", "-r", "'.voice'" }, { 97 | stdout = function(err, data) 98 | if err ~= nil then 99 | print(err) 100 | elseif data == nil then 101 | print("unable to get voice from meta.json") 102 | 103 | vim.system({ 104 | "cp", 105 | "/home/rockerboo/code/others/VALL-E-X/completed-compiling.wav", 106 | "/home/rockerboo/code/others/VALL-E-X/long/" 107 | .. datetime 108 | .. ".wav", 109 | }) 110 | else 111 | vim.system({ 112 | "cp", 113 | "/home/rockerboo/code/others/VALL-E-X/completed-compiling.wav", 114 | "/home/rockerboo/code/others/VALL-E-X/long/" 115 | .. datetime 116 | .. "-" 117 | .. data 118 | .. ".wav", 119 | }) 120 | end 121 | end, 122 | }) 123 | end 124 | 125 | return { voices = voices, save_voice = save_voice } 126 | -------------------------------------------------------------------------------- /config/nvim/lua/setup.lua: -------------------------------------------------------------------------------- 1 | return { 2 | setup = function() 3 | require("lsp_config").setup() 4 | require("plugin.treesitter").setup() 5 | require("plugin.formatter").setup() 6 | -- require("plugin.rust_tools").setup() 7 | require("plugin.telescope").setup_defaults() 8 | require("plugin.dressing")() 9 | require("plugin.colorizer") 10 | require("plugin.expressline") 11 | require("plugin.nvim-dap-ui").setup() 12 | -- require("plugin.dap").setup() 13 | require("plugin.lint").setup() 14 | require("rockerboo.tests").setup() 15 | require("nvim-ts-autotag").setup() 16 | 17 | require("plugin.completion") 18 | require("plugin.symbols-outline").setup() 19 | end, 20 | } 21 | -------------------------------------------------------------------------------- /config/nvim/queries/gotmpl/injections.scm: -------------------------------------------------------------------------------- 1 | ((comment) @injection.content 2 | (#set! injection.language "comment")) 3 | 4 | ; {{"put" | printf "%s%s" "out" | printf "%q"}} 5 | (function_call 6 | function: (identifier) @_function 7 | arguments: 8 | (argument_list 9 | . 10 | (interpreted_string_literal) @injection.content) 11 | (#eq? @_function "printf") 12 | (#set! injection.language "printf")) 13 | 14 | ; {{ js "var a = 1 + 1" }} 15 | (function_call 16 | function: (identifier) @_function 17 | arguments: 18 | (argument_list 19 | . 20 | (interpreted_string_literal) @injection.content) 21 | (#eq? @_function "js") 22 | (#offset! @injection.content 0 1 0 -1) 23 | (#set! injection.language "javascript")) 24 | 25 | ; {{ html "

hello

" }} 26 | (function_call 27 | function: (identifier) @_function 28 | arguments: 29 | (argument_list 30 | . 31 | (interpreted_string_literal) @injection.content) 32 | (#eq? @_function "html") 33 | (#offset! @injection.content 0 1 0 -1) 34 | (#set! injection.language "html")) 35 | 36 | (define_action (text) @_function 37 | (#eq? @_function "html") 38 | (#set! injection.language "html")) 39 | -------------------------------------------------------------------------------- /config/nvim/queries/html_eex/highlights.scm: -------------------------------------------------------------------------------- 1 | ;inherits: html 2 | 3 | -------------------------------------------------------------------------------- /config/nvim/queries/html_eex/injections.scm: -------------------------------------------------------------------------------- 1 | ;inherits: html 2 | 3 | ((template) @eex) 4 | -------------------------------------------------------------------------------- /config/nvim/spell/en.utf-8.add: -------------------------------------------------------------------------------- 1 | lua 2 | TSX 3 | JSX 4 | Neovim 5 | Linter 6 | Ecogarden 7 | Switchgrass 8 | LoRA 9 | Dreambooth 10 | Dreambooth 11 | hyperparameters 12 | DAdapation 13 | Dreambooth 14 | Lua 15 | overfitting 16 | compatility/! 17 | Lage 18 | Tokenizer 19 | tokenization 20 | -------------------------------------------------------------------------------- /config/nvim/spell/en.utf-8.add.spl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockerBOO/dotfiles/17bfb24bbfc0e3ef2985700f81ec74ca4a20c482/config/nvim/spell/en.utf-8.add.spl -------------------------------------------------------------------------------- /config/nvim/stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 80 2 | # collapse_simple_statement = "Always" 3 | -------------------------------------------------------------------------------- /config/starship.toml: -------------------------------------------------------------------------------- 1 | # Get editor completions based on the config schema 2 | "$schema" = 'https://starship.rs/config-schema.json' 3 | 4 | # Wait 10 milliseconds for starship to check files under the current directory. 5 | scan_timeout = 10 6 | 7 | # Inserts a blank line between shell prompts 8 | add_newline = false 9 | 10 | # Replace the "❯" symbol in the prompt with "➜" 11 | [character] # The name of the module we are configuring is "character" 12 | success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" 13 | 14 | # Disable the package module, hiding it from the prompt completely 15 | [package] 16 | disabled = true 17 | 18 | [docker_context] 19 | format = "via [🐋 $context](blue bold)" 20 | -------------------------------------------------------------------------------- /config/systemd/user/spotifyd.service: -------------------------------------------------------------------------------- 1 | ; spotifyd.service as a user service. 2 | ; https://github.com/Spotifyd/spotifyd/pull/600/ 3 | ; 4 | 5 | [Unit] 6 | Description=A spotify playing daemon 7 | Documentation=https://github.com/Spotifyd/spotifyd 8 | Wants=sound.target 9 | After=sound.target 10 | 11 | [Service] 12 | Type=exec 13 | ExecStart=/home/rockerboo/build/spotifyd/target/release/spotifyd --no-daemon 14 | Restart=always 15 | RestartSec=12 16 | 17 | ;Hardening https://www.ctrl.blog/entry/systemd-service-hardening.html 18 | 19 | KeyringMode= 20 | ProtectControlGroups=true 21 | ProtectKernelTunables=true 22 | ProtectSystem=strict 23 | RestrictSUIDSGID=true 24 | 25 | ProtectKernalLogs=true 26 | ProtectHostname=true 27 | PrivateTmp=true 28 | ProtectHome=true 29 | 30 | ;https://news.ycombinator.com/item?id=29976096 31 | DevicePolicy=closed 32 | LockPersonality=true 33 | NoNewPrivileges=true 34 | 35 | RestrictNamespaces=net 36 | PrivateNetwork=true 37 | 38 | ; TemporaryFileSystem=/etc 39 | BindReadOnlyPaths=/etc/nsswitch.conf 40 | BindReadOnlyPaths=/etc/nsswitch.conf 41 | BindReadOnlyPaths=/etc/resolv.conf 42 | BindReadOnlyPaths=/etc/host.conf 43 | BindReadOnlyPaths=/etc/resolv.conf 44 | BindReadOnlyPaths=/etc/gai.conf 45 | BindReadOnlyPaths=/etc/nsswitch.conf 46 | BindReadOnlyPaths=/etc/resolv.conf 47 | 48 | InaccessiblePaths=/usr/bin/at 49 | InaccessiblePaths=/usr/bin/cron 50 | InaccessiblePaths=/usr/bin/bash 51 | InaccessiblePaths=/usr/bin/sh 52 | InaccessiblePaths=/usr/bin/zsh 53 | InaccessiblePaths=/usr/bin/wget 54 | InaccessiblePaths=/usr/bin/curl 55 | InaccessiblePaths=/usr/bin/ssh 56 | InaccessiblePaths=/usr/bin/scp 57 | InaccessiblePaths=/usr/bin/python 58 | InaccessiblePaths=/usr/bin/perl 59 | InaccessiblePaths=/usr/local/ 60 | 61 | MemoryDenyWriteExecute=true 62 | ProtectHostname=true 63 | ProtectControlGroups=true 64 | ProtectKernelTunables=true 65 | LockPersonality=true 66 | RestrictSUIDSGID=true 67 | SystemCallArchitectures=native 68 | 69 | ; RestrictAddressFamilies=AF_(INET|INET6) 70 | 71 | RuntimeDirectory=spotifyd # adds /var/run/appname 72 | StateDirectory=spotifyd # adds /var/lib/appname 73 | CacheDirectory=spotifyd # adds /var/cache/appname 74 | LogsDirectory=spotifyd # adds /var/log/appname 75 | ConfigurationDirectory=spotifyd # adds /etc/appname 76 | 77 | [Install] 78 | WantedBy=default.target 79 | 80 | -------------------------------------------------------------------------------- /config/systemd/user/ssh-agent.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=SSH key agent 3 | 4 | [Service] 5 | Type=simple 6 | Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket 7 | # DISPLAY required for ssh-askpass to work 8 | Environment=DISPLAY=:0 9 | ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK 10 | 11 | [Install] 12 | WantedBy=default.target 13 | -------------------------------------------------------------------------------- /config/wezterm/wezterm.lua: -------------------------------------------------------------------------------- 1 | local wezterm = require("wezterm") 2 | 3 | -- pub struct Palette { 4 | -- /// The text color to use when the attributes are reset to default 5 | -- pub foreground: Option, 6 | -- /// The background color to use when the attributes are reset to default 7 | -- pub background: Option, 8 | -- /// The color of the cursor 9 | -- pub cursor_fg: Option, 10 | -- pub cursor_bg: Option, 11 | -- pub cursor_border: Option, 12 | -- /// The color of selected text 13 | -- pub selection_fg: Option, 14 | -- pub selection_bg: Option, 15 | -- /// A list of 8 colors corresponding to the basic ANSI palette 16 | -- pub ansi: Option<[RgbColor; 8]>, 17 | -- /// A list of 8 colors corresponding to bright versions of the 18 | -- /// ANSI palette 19 | -- pub brights: Option<[RgbColor; 8]>, 20 | -- /// Configure the colors and styling of the tab bar 21 | -- pub tab_bar: Option, 22 | -- /// The color of the "thumb" of the scrollbar; the segment that 23 | -- /// represents the current viewable area 24 | -- pub scrollbar_thumb: Option, 25 | -- /// The color of the split line between panes 26 | -- pub split: Option, 27 | -- } 28 | 29 | return { 30 | enable_tab_bar = false, 31 | font = wezterm.font("JetBrainsMono Nerd Font"), 32 | font_size = 16.0, 33 | window_padding = { 34 | left = 8, 35 | right = 8, 36 | top = 8, 37 | bottom = 8, 38 | }, 39 | color_scheme = "Cloud", 40 | color_schemes = { 41 | ["Cloud"] = { 42 | foreground = "#ffffff", 43 | background = "#000000", 44 | ansi = { "#1a1e1d", "#dbabeb", "#9c75dd", "#7fa7af", "#64629f", "#5f4c65", "#a9d1df", "#f0f4ef" }, 45 | brights = { "#5d6f74", "#d95490", "#63b0b0", "#c0c0dd", "#5786bc", "#3f3442", "#849da2", "#f5f4ef" }, 46 | }, 47 | }, 48 | } 49 | -------------------------------------------------------------------------------- /gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = rockerBOO 3 | email = rockerboo@gmail.com 4 | signingkey = 0D4EAF00DCABC97B 5 | [github] 6 | user = rockerboo 7 | [branch] 8 | autosetuprebase = always 9 | [core] 10 | excludesfile = ~/.gitignore 11 | editor = nvim 12 | autocrlf = input 13 | pager = delta 14 | [color] 15 | branch = auto 16 | diff = auto 17 | status = auto 18 | [diff] 19 | # https://matklad.github.io/2023/12/31/git-things.html#Git-Things 20 | colormoved = "default" 21 | colormovedws = "allow-indentation-change" 22 | tool = nvimdiff 23 | colorMoved = default 24 | [difftool "nvimdiff"] 25 | cmd = "nvim -d -u ~/.config/nvim/init.lua \"$LOCAL\" \"$REMOTE\"" 26 | [help] 27 | autocorrect = 1 28 | [alias] 29 | switch = !legit switch \"$@\" 30 | branches = !legit branches 31 | sprout = !legit sprout \"$@\" 32 | unpublish = !legit unpublish \"$@\" 33 | harvest = !legit harvest \"$@\" 34 | sync = !legit sync \"$@\" 35 | publish = !legit publish \"$@\" 36 | graft = !legit graft \"$@\" 37 | [merge] 38 | tool = nvimdiff 39 | [mergetool] 40 | prompt = true 41 | conflictstyle = diff3 42 | [mergetool "nvimdiff"] 43 | cmd = nvim -d $BASE $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J' 44 | [delta] 45 | line-numbers = true 46 | syntax-theme = Dracula 47 | features = side-by-side line-numbers decorations collared-trogon zebra-dark 48 | hyperlinks = true 49 | hyperlinks-file-link-format = "file-line://{path}:{line}" 50 | [delta "decorations"] 51 | commit-decoration-style = bold yellow box ul 52 | file-style = bold yellow ul 53 | file-decoration-style = none 54 | hunk-header-decoration-style = cyan box ul 55 | [delta "line-numbers"] 56 | line-numbers-left-style = cyan 57 | line-numbers-right-style = cyan 58 | line-numbers-minus-style = 124 59 | line-numbers-plus-style = 28 60 | [push] 61 | default = tracking 62 | [interactive] 63 | diffFilter = delta --color-only 64 | [filter "lfs"] 65 | required = true 66 | clean = git-lfs clean -- %f 67 | smudge = git-lfs smudge -- %f 68 | process = git-lfs filter-process 69 | [init] 70 | defaultBranch = main 71 | [commit] 72 | gpgsign = true 73 | [credential] 74 | helper = store 75 | -------------------------------------------------------------------------------- /gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /hushlogin: -------------------------------------------------------------------------------- 1 | # 2 | # .hushlogin 3 | # 4 | 5 | # The mere presence of this file in the home directory disables the system 6 | # copyright notice, the date and time of the last login, the message of the 7 | # day as well as other information that may otherwise appear on login. 8 | # See `man login`. 9 | 10 | -------------------------------------------------------------------------------- /iex.exs: -------------------------------------------------------------------------------- 1 | IEx.configure( 2 | colors: [ 3 | enabled: true, 4 | syntax_colors: [ 5 | number: :magenta, 6 | atom: :cyan, 7 | string: :green, 8 | boolean: :magenta, 9 | nil: :magenta 10 | ], 11 | ls_directory: :cyan, 12 | ls_device: :yellow, 13 | doc_code: :green, 14 | doc_inline_code: :magenta, 15 | doc_headings: [:cyan, :underline], 16 | doc_title: [:cyan, :bright, :underline] 17 | ], 18 | default_prompt: 19 | [ 20 | # ANSI CHA, move cursor to column 1 21 | # "\e[G", 22 | :light_magenta, 23 | # plain string 24 | "IEEEX", 25 | ">", 26 | :white, 27 | :reset 28 | ] 29 | |> IO.ANSI.format() 30 | |> IO.chardata_to_string() 31 | ) 32 | -------------------------------------------------------------------------------- /profile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # export GTK_THEME=Nordic 4 | export MANPATH="/usr/local/man:$MANPATH" 5 | # export WLR_NO_HARDWARE_CURSORS=1 6 | 7 | # You may need to manually set your language environment 8 | export LANG=en_US.UTF-8 9 | 10 | # Preferred editor for local and remote sessions 11 | if [[ -n $SSH_CONNECTION ]]; then 12 | export EDITOR='nvim' 13 | else 14 | export EDITOR='nvim' 15 | fi 16 | 17 | # 18 | # setup ssh-agent 19 | # 20 | 21 | #shopt -s extglob 22 | # set environment variables if user's agent already exists 23 | # [ -z "$SSH_AUTH_SOCK" ] && SSH_AUTH_SOCK=$(ls -l /tmp/ssh-*/agent.* 2>/dev/null | grep $(whoami) | awk '{print $9}') 24 | # [ -z "$SSH_AGENT_PID" ] && [ -z $(echo "$SSH_AUTH_SOCK" | cut -d. -f2) ] && SSH_AGENT_PID=$(($(echo "$SSH_AUTH_SOCK" | cut -d. -f2) + 1)) 25 | # [ -n "$SSH_AUTH_SOCK" ] && export SSH_AUTH_SOCK 26 | # [ -n "$SSH_AGENT_PID" ] && export SSH_AGENT_PID 27 | # 28 | # # start agent if necessary 29 | # if [ -z "$SSH_AGENT_PID" ] && [ -z "$SSH_TTY" ]; then # if no agent & not in ssh 30 | # eval $(ssh-agent -s) >/dev/null 31 | # fi 32 | # 33 | # if [ "$XDG_SESSION_TYPE" = "xorg" ]; then 34 | # # setup addition of keys when needed 35 | # if [ -z "$SSH_TTY" ]; then # if not using ssh 36 | # ssh-add -l >/dev/null # check for keys 37 | # if [ $? -ne 0 ]; then 38 | # alias ssh='ssh-add -l > /dev/null || ssh-add && unalias ssh ; ssh' 39 | # if [ -f "/usr/lib/ssh/x11-ssh-askpass" ]; then 40 | # SSH_ASKPASS="/usr/lib/ssh/x11-ssh-askpass" 41 | # export SSH_ASKPASS 42 | # fi 43 | # fi 44 | # fi 45 | # fi 46 | # 47 | # SSH_ENV="$HOME/.ssh/environment" 48 | # 49 | # function start_agent { 50 | # echo "Initialising new SSH agent..." 51 | # /usr/bin/ssh-agent | sed 's/^echo/#echo/' >"${SSH_ENV}" 52 | # echo succeeded 53 | # chmod 600 "${SSH_ENV}" 54 | # . "${SSH_ENV}" >/dev/null 55 | # /usr/bin/ssh-add 56 | # } 57 | # 58 | # # Source SSH settings, if applicable 59 | # 60 | # if [ -f "${SSH_ENV}" ]; then 61 | # . "${SSH_ENV}" >/dev/null 62 | # #ps ${SSH_AGENT_PID} doesn't work under cywgin 63 | # pgrep ssh-agent >/dev/null || { 64 | # start_agent 65 | # } 66 | # else 67 | # start_agent 68 | # fi 69 | 70 | export NVM_DIR="$HOME/.config/nvm" 71 | # [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 72 | 73 | # export PYENV_ROOT="$HOME/.pyenv" 74 | # export PATH="$PYENV_ROOT/bin:$PATH" 75 | # eval "$(pyenv init --path)" 76 | 77 | # complete -C /usr/bin/vault vault 78 | 79 | # hardware acceleration in firefox 80 | # export LIBVA_DRIVER_NAME=nvidia 81 | # export MOZ_DISABLE_RDD_SANDBOX=1 82 | 83 | # export GEM_HOME="$(ruby -e 'puts Gem.user_dir')" 84 | export PATH="$PATH:$GEM_HOME/bin" 85 | 86 | # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. 87 | export PATH="$PATH:$HOME/.rvm/bin" 88 | 89 | # [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* 90 | 91 | if [ -d "$HOME/.local/bin" ]; then 92 | PATH="$HOME/.local/bin:$PATH" 93 | fi 94 | 95 | alias spot=ncspot 96 | alias rust-analyzer="rustup run nightly rust-analyzer" 97 | alias open="xdg-open" 98 | 99 | # Setup nvidia shader cache 100 | export __GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1 101 | export __GL_SHADER_DISK_CACHE_SIZE=1000000000 102 | # . "$HOME/.cargo/env" 103 | # 104 | # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cuda-11.7/lib64 105 | # export PATH=$PATH:/cuda-11.7/bin 106 | 107 | if [ "$XDG_SESSION_TYPE" = "wayland" ]; then 108 | export MOZ_ENABLE_WAYLAND=1 109 | # export WLR_NO_HARDWARE_CURSORS=1 110 | export WLR_NO_HARDWARE_CURSORS=0 111 | export XDG_CURRENT_DESKTOP=dwl 112 | export QT_QPA_PLATFORM=wayland 113 | export QT_QPA_PLATFORMTHEME=qt6ct 114 | 115 | # https://github.com/Vladimir-csp/uwsm?tab=readme-ov-file#3-applications-and-slices 116 | export UWSM_USE_SESSION_SLICE=true 117 | 118 | systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP 119 | 120 | if which dbus-update-activation-environment >/dev/null 2>&1; then 121 | dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP 122 | fi 123 | wlr-randr --output DP-3 --mode 2560x1440@143.964005 --adaptive-sync enabled 124 | fi 125 | 126 | if [ "$XDG_SESSION_TYPE" = "tty" ]; then 127 | export XDG_CURRENT_DESKTOP=dwm 128 | fi 129 | -------------------------------------------------------------------------------- /scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | dotfiles_dir="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )"/.. && pwd )" 4 | excluded=("scripts" "README.markdown" "Makefile" ".github") 5 | 6 | function isExcluded() { 7 | if [ -z "$1" ] 8 | then 9 | return 10 | fi 11 | 12 | for i in "${excluded[@]}" 13 | do 14 | if [ "$i" == "$1" ] 15 | then 16 | return 1 17 | fi 18 | done 19 | 20 | return 0 21 | } 22 | 23 | for path in "$dotfiles_dir"/* 24 | do 25 | name=$(basename "$path") 26 | target="$HOME/.$name" 27 | 28 | if [ -e "$target" ] 29 | then 30 | if [ -L "$target" ] 31 | then 32 | echo "Updating $target" 33 | ln -f -n -s "$dotfiles_dir/$name" "$target" 34 | else 35 | echo "$target is not a symlink" 36 | fi 37 | else 38 | if isExcluded "$name" 39 | then 40 | echo "Creating $target" 41 | ln -s "$dotfiles_dir/$name" "$target" 42 | fi 43 | fi 44 | done 45 | 46 | -------------------------------------------------------------------------------- /scripts/osx/defaults.sh: -------------------------------------------------------------------------------- 1 | # Enable the 2D Dock 2 | defaults write com.apple.dock no-glass -bool true 3 | 4 | # Make Dock icons of hidden applications translucent 5 | defaults write com.apple.dock showhidden -bool false 6 | 7 | # Disable menu bar transparency 8 | defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false 9 | 10 | # Expand save panel by default 11 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true 12 | 13 | # Expand print panel by default 14 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true 15 | 16 | # Disable the “Are you sure you want to open this application?” dialog 17 | defaults write com.apple.LaunchServices LSQuarantine -bool false 18 | 19 | # Enable spring loading for all Dock items 20 | defaults write enable-spring-load-actions-on-all-items -bool true 21 | 22 | # Show indicator lights for open applications in the Dock 23 | defaults write com.apple.dock show-process-indicators -bool true 24 | 25 | # Don’t animate opening applications from the Dock 26 | defaults write com.apple.dock launchanim -bool false 27 | 28 | # Disable press-and-hold for keys in favor of key repeat 29 | defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false 30 | 31 | # Disable auto-correct 32 | # defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false 33 | 34 | # Disable window animations 35 | defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false 36 | 37 | # Enable AirDrop over Ethernet and on unsupported Macs running Lion 38 | defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true 39 | 40 | # Increase window resize speed for Cocoa applications 41 | defaults write NSGlobalDomain NSWindowResizeTime -float 0.005 42 | 43 | # Avoid creating .DS_Store files on network volumes 44 | defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true 45 | 46 | # Disable Safari’s thumbnail cache for History and Top Sites 47 | defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2 48 | 49 | # Enable Safari’s debug menu 50 | defaults write com.apple.Safari IncludeDebugMenu -bool true 51 | 52 | # Remove useless icons from Safari’s bookmarks bar 53 | defaults write com.apple.Safari ProxiesInBookmarksBar "()" 54 | 55 | # Disable send and reply animations in Mail.app 56 | defaults write com.apple.Mail DisableReplyAnimations -bool true 57 | defaults write com.apple.Mail DisableSendAnimations -bool true 58 | 59 | # Disable Resume system-wide 60 | defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false 61 | 62 | # Reset Launchpad 63 | rm ~/Library/Application\ Support/Dock/*.db 64 | 65 | # Show the ~/Library folder 66 | chflags nohidden ~/Library 67 | 68 | # Disable local Time Machine backups 69 | sudo tmutil disablelocal 70 | 71 | # Kill affected applications 72 | for app in Safari Finder Mail; do killall "$app"; done 73 | -------------------------------------------------------------------------------- /scripts/uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | dotfiles_dir="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )"/.. && pwd )" 4 | excluded=("scripts" "README.markdown" "Makefile" ".github") 5 | 6 | function isExcluded() { 7 | if [ -z "$1" ] 8 | then 9 | return 10 | fi 11 | 12 | for i in "${excluded[@]}" 13 | do 14 | if [ "$i" == "$1" ] 15 | then 16 | return 1 17 | fi 18 | done 19 | 20 | return 0 21 | } 22 | 23 | for path in "$dotfiles_dir"/* 24 | do 25 | name=$(basename "$path") 26 | target="$HOME/.$name" 27 | 28 | if [ -e "$target" ] 29 | then 30 | if isExcluded "$name" 31 | then 32 | if [ -L "$target" ] 33 | then 34 | echo "Removing $target" 35 | rm "$target" 36 | else 37 | echo "$target is not a symlink" 38 | fi 39 | fi 40 | fi 41 | done 42 | 43 | -------------------------------------------------------------------------------- /tmux.conf: -------------------------------------------------------------------------------- 1 | unbind-key C-b 2 | set-option -g prefix C-\\ 3 | 4 | set-option -g default-terminal "screen-256color" 5 | set-option -g history-limit 5000 6 | 7 | set-option -g base-index 1 8 | 9 | # Messages 10 | set-option -g display-time 1500 11 | 12 | # Status bar 13 | set-option -g status-bg black 14 | set-option -g status-left '#[fg=250] ' 15 | set-option -g status-right '' 16 | set-option -g status-left-length 120 17 | set-option -g status-right-length 100 18 | set-option -g status-interval 1 19 | set-option -g status-fg colour240 20 | 21 | # Key bindings 22 | bind-key h select-pane -L 23 | bind-key ^H select-pane -L 24 | bind-key k select-pane -U 25 | bind-key ^K select-pane -U 26 | bind-key j select-pane -D 27 | bind-key ^J select-pane -D 28 | bind-key l select-pane -R 29 | bind-key ^L select-pane -R 30 | 31 | bind-key J resize-pane -D 5 32 | bind-key K resize-pane -U 5 33 | bind-key H resize-pane -L 5 34 | bind-key L resize-pane -R 5 35 | 36 | bind-key M-j resize-pane -D 37 | bind-key M-k resize-pane -U 38 | bind-key M-h resize-pane -L 39 | bind-key M-l resize-pane -R 40 | 41 | set-option -s escape-time 10 42 | 43 | set-window-option -g mode-keys vi 44 | 45 | # Setup 24bit colors 46 | set -ga terminal-overrides ',screen-256color:Tc' 47 | 48 | bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' 49 | 50 | -------------------------------------------------------------------------------- /xbindkeysrc: -------------------------------------------------------------------------------- 1 | # For the benefit of emacs users: -*- shell-script -*- 2 | ########################### 3 | # xbindkeys configuration # 4 | ########################### 5 | # 6 | # Version: 1.8.7 7 | # 8 | # If you edit this file, do not forget to uncomment any lines 9 | # that you change. 10 | # The pound(#) symbol may be used anywhere for comments. 11 | # 12 | # To specify a key, you can use 'xbindkeys --key' or 13 | # 'xbindkeys --multikey' and put one of the two lines in this file. 14 | # 15 | # The format of a command line is: 16 | # "command to start" 17 | # associated key 18 | # 19 | # 20 | # A list of keys is in /usr/include/X11/keysym.h and in 21 | # /usr/include/X11/keysymdef.h 22 | # The XK_ is not needed. 23 | # 24 | # List of modifier: 25 | # Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock), 26 | # Mod3 (CapsLock), Mod4, Mod5 (Scroll). 27 | # 28 | 29 | # The release modifier is not a standard X modifier, but you can 30 | # use it if you want to catch release events instead of press events 31 | 32 | # By defaults, xbindkeys does not pay attention with the modifiers 33 | # NumLock, CapsLock and ScrollLock. 34 | # Uncomment the lines above if you want to pay attention to them. 35 | 36 | #keystate_numlock = enable 37 | # keystate_capslock = enable 38 | #keystate_scrolllock= enable 39 | 40 | # Examples of commands: 41 | 42 | # "xbindkeys_show" 43 | # control+shift + q 44 | 45 | # set directly keycode (here control + f with my keyboard) 46 | # "xterm" 47 | # c:41 + m:0x4 48 | 49 | # specify a mouse button 50 | # "xterm" 51 | # control + b:2 52 | 53 | # Increase volume 54 | # "pactl set-sink-volume @DEFAULT_SINK@ +1000" 55 | # XF86AudioRaiseVolume 56 | 57 | # Decrease volume 58 | # "pactl set-sink-volume @DEFAULT_SINK@ -1000" 59 | # XF86AudioLowerVolume 60 | 61 | # Mute volume 62 | #"pactl set-sink-mute @DEFAULT_SINK@ toggle" 63 | # XF86AudioMute 64 | 65 | # Mute microphone 66 | #"pactl set-source-mute @DEFAULT_SOURCE@ toggle" 67 | # XF86AudioMicMute 68 | 69 | #"xterm -geom 50x20+20+20" 70 | # Shift+Mod2+alt + s 71 | # 72 | ## set directly keycode (here control+alt+mod2 + f with my keyboard) 73 | #"xterm" 74 | # alt + c:0x29 + m:4 + mod2 75 | # 76 | ## Control+Shift+a release event starts rxvt 77 | #"rxvt" 78 | # release+control+shift + a 79 | # 80 | ## Control + mouse button 2 release event starts rxvt 81 | #"rxvt" 82 | # Control + b:2 + Release 83 | 84 | ################################## 85 | # End of xbindkeys configuration # 86 | ################################## 87 | -------------------------------------------------------------------------------- /xinitrc: -------------------------------------------------------------------------------- 1 | # Setup Xorg environment 2 | [[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources 3 | xsetroot -cursor_name left_ptr & 4 | 5 | # Set inside kernal startup 6 | # xrandr --setprovideroutputsource modesetting NVIDIA-0 7 | 8 | # Previous 9 | # nvidia-settings --assign "CurrentMetaMode= DPY-2: nvidia-auto-select @1920x1080 +0+0 {ViewPortIn=1920x1080, ViewPortOut=1920x1080+0+0}, DPY-5: 2560x1440_144 @2560x1440 +1920+0 {ViewPortIn=2560x1440, ViewPortOut=2560x1440+0+0}" 10 | nvidia-settings --assign "CurrentMetaMode= DPY-2: nvidia-auto-select @1920x1080 +0+0 {ViewPortIn=1920x1080, ViewPortOut=1920x1080+0+0}, DPY-3: 2560x1440_144 @2560x1440 +1920+0 {ViewPortIn=2560x1440, ViewPortOut=2560x1440+0+0}" 11 | 12 | # Might not need now 13 | # xrandr --auto 14 | 15 | # Main monitor to 144hz 16 | xrandr --output DP-2 --mode 2560x1440 --rate 144 17 | 18 | # Map capslock key to escape 19 | setxkbmap -option caps:ctrl 20 | 21 | # Setup keybinds 22 | xbindkeys 23 | 24 | # Start the agent 25 | # eval $(ssh-agent) 26 | 27 | # Setup terminal 28 | # $HOME/.config/alacritty/startup.sh 29 | # 30 | # 31 | 32 | # export QT_QPA_PLATFORMTHEME=qt5ct 33 | 34 | # Scale screen UI elements (mostly for lmms) 35 | export QT_AUTO_SCREEN_SCALE_FACTOR=1 36 | export QT_SCREEN_SCALE_FACTORS=1.275 37 | 38 | export WLR_NO_HARDWARE_CURSORS=1 39 | 40 | # Fsync/Futex2 41 | # export WINEFSYNC=1 42 | 43 | # Use xinput2 for firefox 44 | export MOZ_USE_XINPUT2=true 45 | 46 | # Start dwm slstatus 47 | #~/.bin/dwm_status 48 | 49 | # Start redshift 50 | #~/.bin/start_redshift 51 | 52 | # Start dwm 53 | exec dwm 54 | #dwl 55 | -------------------------------------------------------------------------------- /xsession: -------------------------------------------------------------------------------- 1 | slstatus & 2 | redshift & 3 | -------------------------------------------------------------------------------- /yarnrc.yml: -------------------------------------------------------------------------------- 1 | cacheFolder: "./.yarn/cache" 2 | -------------------------------------------------------------------------------- /zprofile: -------------------------------------------------------------------------------- 1 | # Seeing if this is a good thing 2 | # https://wiki.archlinux.org/title/Start_X_at_boot 3 | #if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then 4 | # exec startx 5 | #fi 6 | 7 | # export PYENV_ROOT="$HOME/.pyenv" 8 | # export PATH="$PYENV_ROOT/bin:$PATH" 9 | # eval "$(pyenv init --path)" 10 | 11 | emulate sh -c '. ~/.profile' 12 | -------------------------------------------------------------------------------- /zshenv: -------------------------------------------------------------------------------- 1 | # export XDG_CONFIG_HOME="$HOME/.config" 2 | # export XDG_DATA_HOME="$XDG_CONFIG_HOME/local/share" 3 | # export XDG_CACHE_HOME="$XDG_CONFIG_HOME/cache" 4 | 5 | export PATH=$HOME/.local/bin:$PATH 6 | export PATH=$HOME/.local/share/npm/bin/:$PATH 7 | export PATH=$HOME/.gem/ruby/2.7.0/bin:$PATH 8 | export PATH=$HOME/.cargo/bin:$PATH 9 | export PATH=$HOME/go/bin:$PATH 10 | export PATH=$HOME/.yarn/bin:$PATH 11 | 12 | export EDITOR="nvim" 13 | export VISUAL="nvim" 14 | . "$HOME/.cargo/env" 15 | -------------------------------------------------------------------------------- /zshrc: -------------------------------------------------------------------------------- 1 | # If you come from bash you might have to change your $PATH. 2 | export PATH=$HOME/bin:$HOME/.bin:/usr/local/bin:$PATH 3 | 4 | # Configure the oh-my-zsh ssh-agent plugin 5 | zstyle :omz:plugins:ssh-agent agent-forwarding on 6 | zstyle :omz:plugins:ssh-agent lifetime 4h 7 | 8 | # Path to your oh-my-zsh installation. 9 | # export ZSH=$HOME/.oh-my-zsh 10 | 11 | # Set name of the theme to load --- if set to "random", it will 12 | # load a random theme each time oh-my-zsh is loaded, in which case, 13 | # to know which specific one was loaded, run: echo $RANDOM_THEME 14 | # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes 15 | ZSH_THEME="rockerboo" 16 | 17 | # Set list of themes to pick from when loading at random 18 | # Setting this variable when ZSH_THEME=random will cause zsh to load 19 | # a theme from this variable instead of looking in $ZSH/themes/ 20 | # If set to an empty array, this variable will have no effect. 21 | # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) 22 | 23 | # Uncomment the following line to use case-sensitive completion. 24 | # CASE_SENSITIVE="true" 25 | 26 | # Uncomment the following line to use hyphen-insensitive completion. 27 | # Case-sensitive completion must be off. _ and - will be interchangeable. 28 | # HYPHEN_INSENSITIVE="true" 29 | 30 | # Uncomment the following line to disable bi-weekly auto-update checks. 31 | # DISABLE_AUTO_UPDATE="true" 32 | 33 | # Uncomment the following line to automatically update without prompting. 34 | # DISABLE_UPDATE_PROMPT="true" 35 | 36 | # Uncomment the following line to change how often to auto-update (in days). 37 | # export UPDATE_ZSH_DAYS=13 38 | 39 | # Uncomment the following line if pasting URLs and other text is messed up. 40 | # DISABLE_MAGIC_FUNCTIONS="true" 41 | 42 | # Uncomment the following line to disable colors in ls. 43 | # DISABLE_LS_COLORS="true" 44 | 45 | # Uncomment the following line to disable auto-setting terminal title. 46 | # DISABLE_AUTO_TITLE="true" 47 | 48 | # Uncomment the following line to enable command auto-correction. 49 | # ENABLE_CORRECTION="true" 50 | 51 | # Uncomment the following line to display red dots whilst waiting for completion. 52 | # COMPLETION_WAITING_DOTS="true" 53 | 54 | # Uncomment the following line if you want to disable marking untracked files 55 | # under VCS as dirty. This makes repository status check for large repositories 56 | # much, much faster. 57 | # DISABLE_UNTRACKED_FILES_DIRTY="true" 58 | 59 | # Uncomment the following line if you want to change the command execution time 60 | # stamp shown in the history command output. 61 | # You can set one of the optional three formats: 62 | # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" 63 | # or set a custom format using the strftime function format specifications, 64 | # see 'man strftime' for details. 65 | # HIST_STAMPS="mm/dd/yyyy" 66 | 67 | # Would you like to use another custom folder than $ZSH/custom? 68 | ZSH_CUSTOM=~/.local/share/zsh 69 | 70 | # Which plugins would you like to load? 71 | # Standard plugins can be found in $ZSH/plugins/ 72 | # Custom plugins may be added to $ZSH_CUSTOM/plugins/ 73 | # Example format: plugins=(rails git textmate ruby lighthouse) 74 | # Add wisely, as too many plugins slow down shell startup. 75 | plugins=(asdf git gh node docker fzf tmux rust fancy-ctrl-z mix extract archlinux yarn systemd themes ssh-agent zsh-aliases-exa ripgrep kubectl) 76 | 77 | #source $ZSH/oh-my-zsh.sh 78 | 79 | # User configuration 80 | # 81 | # https://docs.docker.com/engine/security/rootless/ 82 | # disabling to check root version to be working 83 | # export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock 84 | 85 | 86 | # Starship https://starship.rs/ 87 | eval "$(starship init zsh)" 88 | 89 | # Add API keys 90 | #source $HOME/.config/private/keys 91 | #source $HOME/.config/keys/reddit 92 | 93 | # Compilation flags 94 | # export ARCHFLAGS="-arch x86_64" 95 | 96 | # Set personal aliases, overriding those provided by oh-my-zsh libs, 97 | # plugins, and themes. Aliases can be placed here, though oh-my-zsh 98 | # users are encouraged to define aliases within the ZSH_CUSTOM folder. 99 | # For a full list of active aliases, run `alias`. 100 | # 101 | # Example aliases 102 | # alias zshconfig="mate ~/.zshrc" 103 | # alias ohmyzsh="mate ~/.oh-my-zsh" 104 | #alias eg="cd ~/code/ecogarden/create" 105 | #alias ecogarden="~/code/ecogarden/create/src-tauri/target/release/ecogarden" 106 | # alias docker=podman 107 | alias spot=ncspot 108 | alias rust-analyzer="rustup run nightly rust-analyzer" 109 | alias open="xdg-open" 110 | 111 | # NVM node version manager 112 | # source /usr/share/nvm/init-nvm.sh 113 | 114 | # Python environment manager 115 | eval "$(pyenv init -)" 116 | 117 | # Zoxide 118 | eval "$(zoxide init zsh)" 119 | 120 | # Add luarocks paths 121 | # eval "$(luarocks path --bin)" 122 | 123 | # Setup nvidia shader cache 124 | export __GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1 125 | export __GL_SHADER_DISK_CACHE_SIZE=1000000000 126 | 127 | # Bat 128 | export BAT_THEME=ansi 129 | 130 | # Systemd 131 | export SYSTEMD_EDITOR=nvim 132 | 133 | alias luamake=/home/rockerboo/build/lua-language-server/3rd/luamake/luamake 134 | alias gitlab-run="gitlab-runner exec docker --cache-dir /cache --docker-volumes `pwd`/build-output:/cache" 135 | # alias nvim=/home/rockerboo/build/lua_autocmds/build/bin/nvim 136 | # alias bun="sde -- bun" 137 | 138 | # autoload -U +X bashcompinit && bashcompinit 139 | # complete -o nospace -C /usr/bin/vault vault 140 | [[ /usr/bin/kubectl ]] && source <(kubectl completion zsh) 141 | source <(podman completion zsh) 142 | 143 | # source /mnt/900/builds/miniconda3/etc/profile.d/conda.sh 144 | # export PATH="/mnt/900/builds/miniconda3/bin:$PATH" 145 | 146 | export PATH="/home/rockerboo/.config/local/share/gem/ruby/3.0.0/bin:$PATH" 147 | 148 | # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. 149 | export PATH="$PATH:$HOME/.rvm/bin" 150 | 151 | # Fly 152 | export FLYCTL_INSTALL="/home/rockerboo/.fly" 153 | export PATH="$FLYCTL_INSTALL/bin:$PATH" 154 | 155 | # Libtorch 156 | export LIBTORCH=/mnt/900/builds/libtorch-cxx11-abi-shared-with-deps-1.13.0+cu117/libtorch 157 | export LD_LIBRARY_PATH=${LIBTORCH}/lib:$LD_LIBRARY_PATH 158 | 159 | # LIBTORCH_INCLUDE must contains `include` directory. 160 | export LIBTORCH_INCLUDE=/mnt/900/builds/libtorch-cxx11-abi-shared-with-deps-1.13.0+cu117/libtorch 161 | 162 | # # LIBTORCH_LIB must contains `lib` directory. 163 | # export LIBTORCH_LIB=/mnt/900/builds/libtorch/libtorch/ 164 | 165 | alias cr="cargo run && audio-player --volume 0.1 \"$HOME/code/audio-player/output.ogg\" || audio-player --volume 0.1 \"$HOME/code/tmp/error-sounds/priceisright.ogg\"" 166 | alias cb="cargo build && audio-player --volume 0.1 \"$HOME/code/audio-player/output.ogg\" || audio-player --volume 0.1 \"$HOME/code/tmp/error-sounds/priceisright.ogg\"" 167 | alias ct="cargo test && audio-player --volume 0.1 \"$HOME/code/audio-player/output.ogg\" || audio-player --volume 0.1 \"$HOME/code/tmp/error-sounds/priceisright.ogg\"" 168 | 169 | export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" 170 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 171 | source /usr/share/nvm/init-nvm.sh 172 | 173 | # bun completions 174 | [ -s "/home/rockerboo/.bun/_bun" ] && source "/home/rockerboo/.bun/_bun" 175 | 176 | # bun 177 | export BUN_INSTALL="$HOME/.bun" 178 | export PATH="$BUN_INSTALL/bin:$PATH" 179 | 180 | HISTFILE=~/.zsh_history 181 | HISTSIZE=999999999 182 | SAVEHIST=$HISTSIZE 183 | --------------------------------------------------------------------------------