From 9924869df86dce29f9d6741acafd82e83648de07 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 11:56:55 +0200 Subject: [PATCH 001/280] Add README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..6c7a90c --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# dotfiles + +This is a collection of my dotfiles for my personal development setup. +Other than the dotfiles, I also have a few scripts that I use to automate some tasks. From 04f5c7737175b6d61d3459db789c9eb83e4bd840 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 12:29:26 +0200 Subject: [PATCH 002/280] Add alacritty config --- .config/alacritty/alacritty.yml | 237 ++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 .config/alacritty/alacritty.yml diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml new file mode 100644 index 0000000..9c3a8e3 --- /dev/null +++ b/.config/alacritty/alacritty.yml @@ -0,0 +1,237 @@ +font: + size: 20.0 + normal: + family: JetBrainsMono Nerd Font + use_thin_stroke: true + +window: + opacity: 1 + dynamic_title: true + decorations_theme_variant: None + decorations: buttonless + padding: + x: 10 + y: 10 + +colors: + # Default colors + primary: + padding_color: "#00FF00" + background: "#24273A" # base + foreground: "#CAD3F5" # text + # Bright and dim foreground colors + dim_foreground: "#CAD3F5" # text + bright_foreground: "#CAD3F5" # text + + # Cursor colors + cursor: + text: "#24273A" # base + cursor: "#F4DBD6" # rosewater + vi_mode_cursor: + text: "#24273A" # base + cursor: "#B7BDF8" # lavender + + # Search colors + search: + matches: + foreground: "#24273A" # base + background: "#A5ADCB" # subtext0 + focused_match: + foreground: "#24273A" # base + background: "#A6DA95" # green + footer_bar: + foreground: "#24273A" # base + background: "#A5ADCB" # subtext0 + + # Keyboard regex hints + hints: + start: + foreground: "#24273A" # base + background: "#EED49F" # yellow + end: + foreground: "#24273A" # base + background: "#A5ADCB" # subtext0 + + # Selection colors + selection: + text: "#24273A" # base + background: "#F4DBD6" # rosewater + + # Normal colors + normal: + black: "#494D64" # surface1 + red: "#ED8796" # red + green: "#A6DA95" # green + yellow: "#EED49F" # yellow + blue: "#494D64" # blue + magenta: "#b884aa" # pink + cyan: "#5b8a83" # teal + white: "#B8C0E0" # subtext1 + + # Bright colors + bright: + black: "#5B6078" # surface2 + red: "#ED8796" # red + green: "#A6DA95" # green + yellow: "#EED49F" # yellow + blue: "#8AADF4" # blue + magenta: "#F5BDE6" # pink + cyan: "#8BD5CA" # teal + white: "#A5ADCB" # subtext0 + + # Dim colors + dim: + black: "#494D64" # surface1 + red: "#ED8796" # red + green: "#A6DA95" # green + yellow: "#EED49F" # yellow + blue: "#8AADF4" # blue + magenta: "#F5BDE6" # pink + cyan: "#8BD5CA" # teal + white: "#B8C0E0" # subtext1 + + indexed_colors: + - { index: 16, color: "#9c715a" } + - { index: 17, color: "#F4DBD6" } + +# To get keybinding, just run: xxd -psd +key_bindings: + - { key: Home, chars: "\x1bOH", mode: AppCursor } + - { key: Home, chars: "\x1b[H", mode: ~AppCursor } + - { key: End, chars: "\x1bOF", mode: AppCursor } + - { key: End, chars: "\x1b[F", mode: ~AppCursor } + - { key: PageUp, mods: Shift, chars: "\x1b[5;2~" } + - { key: PageUp, mods: Control, chars: "\x1b[5;5~" } + - { key: PageUp, chars: "\x1b[5~" } + - { key: PageDown, mods: Shift, chars: "\x1b[6;2~" } + - { key: Space, mods: Alt, chars: " " } + - { key: Back, mods: Alt, chars: "\x1b\x7f" } # Delete word + - { key: Left, mods: Alt, chars: "\x1bb" } # one word left + - { key: Right, mods: Alt, chars: "\x1bf" } # one word right + - { key: Left, mods: Control, chars: "\x1bb" } # one word left + - { key: Right, mods: Control, chars: "\x1bf" } # one word right + - { key: Delete, mods: Shift, chars: "\x7f" } + + - { key: Back, mods: Shift, chars: "\x1b\x7f" } + - { key: R, mods: Alt, chars: "\x18\x2c" } + - { key: Return, mods: Shift, chars: "\x00" } + - { key: Space, mods: Control, chars: "\x00" } + - { key: Space, mods: Alt, chars: "\x00" } + - { key: Space, mods: Command, chars: "\x00" } + - { key: N, mods: Shift|Command, chars: "\x18\x29" } + - { key: N, mods: Shift|Alt, chars: "\x18\x29" } + - { key: P, mods: Shift|Command, chars: "\x18\x28" } + - { key: P, mods: Shift|Alt, chars: "\x18\x28" } + - { key: T, mods: Shift|Command, chars: "\x18\x43" } + - { key: T, mods: Shift|Alt, chars: "\x18\x43" } + - { key: R, mods: Shift|Command, chars: "\x18\x24" } + - { key: R, mods: Shift|Alt, chars: "\x18\x24" } + - { key: Comma, mods: Shift|Alt, chars: "\x18<" } + - { key: Period, mods: Shift|Alt, chars: "\x18>" } + - { key: Comma, mods: Alt, chars: "\x1b," } + + # Mac + - { key: V, mods: Command, action: Paste } + - { key: B, mods: Command, chars: "\x1b\x62" } + - { key: D, mods: Command, chars: "\x1b\x64" } + - { key: J, mods: Command, chars: "\x18\x6d" } + - { key: K, mods: Command, chars: "\x18\x62" } + - { key: C, mods: Command, action: Copy } + - { key: Q, mods: Command, action: Quit } + - { key: W, mods: Command, action: Quit } + - { key: Key0, mods: Command, action: ResetFontSize } + - { key: Equals, mods: Command, action: IncreaseFontSize } + - { key: Minus, mods: Command, action: DecreaseFontSize } + - { key: Back, mods: Command, chars: "\x15" } # delete word/line + - { key: D, mods: Shift|Command, chars: "\x18\x64" } + - { key: V, mods: Shift|Command, chars: "\x18\x76" } + - { key: A, mods: Shift|Command, chars: "\x18\x73" } + - { key: S, mods: Shift|Command, chars: "\x18\x56" } + - { key: H, mods: Shift|Command, chars: "\x18\x08" } + - { key: J, mods: Shift|Command, chars: "\x18\x0a" } + - { key: K, mods: Shift|Command, chars: "\x18\x0b" } + - { key: L, mods: Shift|Command, chars: "\x18\x0c" } + - { key: Key1, mods: Command, chars: "\x18\x31" } + - { key: Key2, mods: Command, chars: "\x18\x32" } + - { key: Key3, mods: Command, chars: "\x18\x33" } + - { key: Key4, mods: Command, chars: "\x18\x34" } + - { key: Key5, mods: Command, chars: "\x18\x35" } + - { key: Key6, mods: Command, chars: "\x18\x36" } + - { key: Key7, mods: Command, chars: "\x18\x37" } + - { key: Key8, mods: Command, chars: "\x18\x38" } + - { key: Key9, mods: Command, chars: "\x18\x39" } + - { key: T, mods: Command, chars: "\x18\x63" } + - { key: X, mods: Command, chars: "\x18\x78" } + - { key: S, mods: Command, chars: "\x18\x77" } + - { key: Slash, mods: Control|Command, chars: "\x18\x2f" } + - { key: R, mods: Command, chars: "\x18\x2c" } + - { key: LBracket, mods: Command, chars: "\x18\x5b" } + - { key: A, mods: Command, chars: "\x18\x3d" } + - { key: O, mods: Command, chars: "\x18\x6f" } + - { key: O, mods: Shift|Command, chars: "\x18\x7a" } + - { key: Return, mods: Command, chars: "\x18\x7a" } + - { key: Escape, mods: Command, chars: "\x18\x01" } + - { key: Comma, mods: Command, chars: "\x18\x10" } + - { key: Semicolon, mods: Command, chars: "\x18\x0e" } + - { key: F, mods: Shift|Command, chars: "\x18\x09" } + - { key: E, mods: Command, chars: "\x18\x09" } + - { key: N, mods: Command, chars: "\x18\x6e" } + - { key: P, mods: Command, chars: "\x18\x70" } + - { key: Slash, mods: Command, chars: "\x18\x2f" } + - { key: F, mods: Command, chars: "\x1b\x66" } + - { key: I, mods: Command, chars: "\x18\x21" } + - { key: I, mods: Shift|Command, chars: "\x18\x24" } + + # Linux + - { key: V, mods: Alt, action: Paste } + - { key: D, mods: Alt, chars: "\x1b\x64" } + - { key: B, mods: Alt, chars: "\x1b\x62" } + - { key: J, mods: Alt, chars: "\x18\x6d" } + - { key: K, mods: Alt, chars: "\x18\x62" } + - { key: C, mods: Alt, action: Copy } + - { key: Q, mods: Alt, action: Quit } + - { key: W, mods: Alt, action: Quit } + - { key: Key0, mods: Alt, action: ResetFontSize } + - { key: Equals, mods: Alt, action: IncreaseFontSize } + - { key: Minus, mods: Alt, action: DecreaseFontSize } + - { key: Back, mods: Alt, chars: "\x15" } # delete word/line + - { key: D, mods: Shift|Alt, chars: "\x18\x64" } + - { key: V, mods: Shift|Alt, chars: "\x18\x76" } + - { key: A, mods: Shift|Alt, chars: "\x18\x73" } + - { key: S, mods: Shift|Alt, chars: "\x18\x56" } + - { key: H, mods: Shift|Alt, chars: "\x18\x08" } + - { key: J, mods: Shift|Alt, chars: "\x18\x0a" } + - { key: K, mods: Shift|Alt, chars: "\x18\x0b" } + - { key: L, mods: Shift|Alt, chars: "\x18\x0c" } + - { key: Key1, mods: Alt, chars: "\x18\x31" } + - { key: Key2, mods: Alt, chars: "\x18\x32" } + - { key: Key3, mods: Alt, chars: "\x18\x33" } + - { key: Key4, mods: Alt, chars: "\x18\x34" } + - { key: Key5, mods: Alt, chars: "\x18\x35" } + - { key: Key6, mods: Alt, chars: "\x18\x36" } + - { key: Key7, mods: Alt, chars: "\x18\x37" } + - { key: Key8, mods: Alt, chars: "\x18\x38" } + - { key: Key9, mods: Alt, chars: "\x18\x39" } + - { key: T, mods: Alt, chars: "\x18\x63" } + - { key: X, mods: Alt, chars: "\x18\x78" } + - { key: S, mods: Alt, chars: "\x18\x77" } + - { key: Slash, mods: Control|Alt, chars: "\x18\x2f" } + - { key: R, mods: Alt, chars: "\x18\x2c" } + - { key: LBracket, mods: Alt, chars: "\x18\x5b" } + - { key: A, mods: Alt, chars: "\x18\x3d" } + - { key: O, mods: Alt, chars: "\x18\x6f" } + - { key: O, mods: Shift|Alt, chars: "\x18\x7a" } + - { key: Return, mods: Alt, chars: "\x18\x7a" } + - { key: Escape, mods: Alt, chars: "\x18\x01" } + - { key: Comma, mods: Shift|Command, chars: "\x18<" } + - { key: Period, mods: Shift|Command, chars: "\x18>" } + - { key: Comma, mods: Alt, chars: "\x18\x10" } + - { key: Semicolon, mods: Alt, chars: "\x18\x0e" } + - { key: F, mods: Shift|Alt, chars: "\x18\x09" } + - { key: E, mods: Alt, chars: "\x18\x09" } + - { key: N, mods: Alt, chars: "\x18\x6e" } + - { key: P, mods: Alt, chars: "\x18\x70" } + - { key: Slash, mods: Alt, chars: "\x18\x2f" } + - { key: F, mods: Alt, chars: "\x1b\x66" } + - { key: I, mods: Alt, chars: "\x18\x21" } + - { key: I, mods: Shift|Alt, chars: "\x18\x24" } From b81775d34ce09d91f62387d7032246d4162624f9 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 12:40:20 +0200 Subject: [PATCH 003/280] Update aliases --- .zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index c7aa615..9ebb4a4 100644 --- a/.zshrc +++ b/.zshrc @@ -67,12 +67,13 @@ alias '...'='cd ../../' function rr() { rustc "$@.rs" && ./"$@"} # [r]ust [r]un alias zshrc='nvim ~/.zshrc' # Idea from Chris +alias alacritty='nvim ~/.config/alacritty/alacritty.yml' alias g="grep" # [g]rep alias bra="bundle exec rubocop -A" # [b]undle exec [r]ubocop -[A] alias spec="be rspec" alias f="fork ." alias rsf='be rspec spec/$(cd spec/ && fzf)' # [r][s]pec [f]uzzy find -alias nvcon="cd ~/.config/nvim && nvim init.lua" +alias cnvim="cd ~/.config/nvim && nvim init.lua" alias glog_="git log --pretty=format:'%D %n %C(yellow)%h %C(reset)%ad %C(reset)%s' --date=format:'%d-%m-%Y %H:%M'" alias glog="glog_ | grep -v -e '^\s*$' --color=always | less --use-color" From 05c1d0b6f2d7f61a1fb4a8bc95b2750d8e148420 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 13:16:00 +0200 Subject: [PATCH 004/280] Add nvim config --- .config/nvim/.gitignore | 8 + .config/nvim/.neoconf.json | 15 ++ .config/nvim/LICENSE | 201 ++++++++++++++ .config/nvim/README.md | 4 + .config/nvim/init.lua | 52 ++++ .config/nvim/lazy-lock.json | 96 +++++++ .config/nvim/lazyvim.json | 20 ++ .config/nvim/lua/config/autocmds.lua | 3 + .config/nvim/lua/config/keymaps.lua | 6 + .config/nvim/lua/config/lazy.lua | 48 ++++ .config/nvim/lua/config/options.lua | 3 + .config/nvim/lua/plugins/barbecue.lua | 12 + .config/nvim/lua/plugins/bufferline.lua | 16 ++ .config/nvim/lua/plugins/bundler.lua | 3 + .../nvim/lua/plugins/cellular-automaton.lua | 9 + .config/nvim/lua/plugins/endwise.lua | 13 + .config/nvim/lua/plugins/example.lua | 245 ++++++++++++++++++ .config/nvim/lua/plugins/git-time-lapse.lua | 6 + .config/nvim/lua/plugins/mini-starter.lua | 75 ++++++ .config/nvim/lua/plugins/multiple-cursors.lua | 15 ++ .config/nvim/lua/plugins/nvim-emmet.lua | 6 + .config/nvim/lua/plugins/nvim-surround.lua | 10 + .config/nvim/lua/plugins/nvim_tools.lua | 6 + .config/nvim/lua/plugins/octo.lua | 14 + .config/nvim/lua/plugins/other.lua | 56 ++++ .config/nvim/lua/plugins/refactoring.lua | 17 ++ .config/nvim/lua/plugins/repeat.lua | 3 + .config/nvim/lua/plugins/rest.lua | 16 ++ .config/nvim/lua/plugins/ror.lua | 10 + .config/nvim/lua/plugins/solargraph.lua | 23 ++ .config/nvim/lua/plugins/speedtyper.lua | 7 + .config/nvim/lua/plugins/test.lua | 58 +++++ .config/nvim/lua/plugins/text_case.lua | 24 ++ .config/nvim/lua/plugins/train.lua | 3 + .config/nvim/lua/plugins/treesitter.lua | 28 ++ .config/nvim/lua/plugins/vim-be-good.lua | 5 + .config/nvim/lua/plugins/vim-dispatch.lua | 3 + .config/nvim/lua/plugins/vim-fugitive.lua | 6 + .config/nvim/lua/plugins/vim-localoire.lua | 5 + .config/nvim/lua/plugins/vim-rails.lua | 3 + .config/nvim/stylua.toml | 3 + 41 files changed, 1156 insertions(+) create mode 100644 .config/nvim/.gitignore create mode 100644 .config/nvim/.neoconf.json create mode 100644 .config/nvim/LICENSE create mode 100644 .config/nvim/README.md create mode 100644 .config/nvim/init.lua create mode 100644 .config/nvim/lazy-lock.json create mode 100644 .config/nvim/lazyvim.json create mode 100644 .config/nvim/lua/config/autocmds.lua create mode 100644 .config/nvim/lua/config/keymaps.lua create mode 100644 .config/nvim/lua/config/lazy.lua create mode 100644 .config/nvim/lua/config/options.lua create mode 100644 .config/nvim/lua/plugins/barbecue.lua create mode 100644 .config/nvim/lua/plugins/bufferline.lua create mode 100644 .config/nvim/lua/plugins/bundler.lua create mode 100644 .config/nvim/lua/plugins/cellular-automaton.lua create mode 100644 .config/nvim/lua/plugins/endwise.lua create mode 100644 .config/nvim/lua/plugins/example.lua create mode 100644 .config/nvim/lua/plugins/git-time-lapse.lua create mode 100644 .config/nvim/lua/plugins/mini-starter.lua create mode 100644 .config/nvim/lua/plugins/multiple-cursors.lua create mode 100644 .config/nvim/lua/plugins/nvim-emmet.lua create mode 100644 .config/nvim/lua/plugins/nvim-surround.lua create mode 100644 .config/nvim/lua/plugins/nvim_tools.lua create mode 100644 .config/nvim/lua/plugins/octo.lua create mode 100644 .config/nvim/lua/plugins/other.lua create mode 100644 .config/nvim/lua/plugins/refactoring.lua create mode 100644 .config/nvim/lua/plugins/repeat.lua create mode 100644 .config/nvim/lua/plugins/rest.lua create mode 100644 .config/nvim/lua/plugins/ror.lua create mode 100644 .config/nvim/lua/plugins/solargraph.lua create mode 100644 .config/nvim/lua/plugins/speedtyper.lua create mode 100644 .config/nvim/lua/plugins/test.lua create mode 100644 .config/nvim/lua/plugins/text_case.lua create mode 100644 .config/nvim/lua/plugins/train.lua create mode 100644 .config/nvim/lua/plugins/treesitter.lua create mode 100644 .config/nvim/lua/plugins/vim-be-good.lua create mode 100644 .config/nvim/lua/plugins/vim-dispatch.lua create mode 100644 .config/nvim/lua/plugins/vim-fugitive.lua create mode 100644 .config/nvim/lua/plugins/vim-localoire.lua create mode 100644 .config/nvim/lua/plugins/vim-rails.lua create mode 100644 .config/nvim/stylua.toml diff --git a/.config/nvim/.gitignore b/.config/nvim/.gitignore new file mode 100644 index 0000000..cc5457a --- /dev/null +++ b/.config/nvim/.gitignore @@ -0,0 +1,8 @@ +tt.* +.tests +doc/tags +debug +.repro +foo.* +*.log +data diff --git a/.config/nvim/.neoconf.json b/.config/nvim/.neoconf.json new file mode 100644 index 0000000..7c48087 --- /dev/null +++ b/.config/nvim/.neoconf.json @@ -0,0 +1,15 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + } +} diff --git a/.config/nvim/LICENSE b/.config/nvim/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/.config/nvim/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/.config/nvim/README.md b/.config/nvim/README.md new file mode 100644 index 0000000..185280b --- /dev/null +++ b/.config/nvim/README.md @@ -0,0 +1,4 @@ +# 💤 LazyVim + +A starter template for [LazyVim](https://github.com/LazyVim/LazyVim). +Refer to the [documentation](https://lazyvim.github.io/installation) to get started. diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..520d19a --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,52 @@ +-- bootstrap lazy.nvim, LazyVim and your plugins +require("config.lazy") + +vim.opt.title = true +vim.opt.titlelen = 0 +vim.opt.titlestring = 'nvim %{expand("%:p")}' + +-- require("telescope").setup({ +-- defaults = { +-- vimgrep_arguments = { +-- "rg", +-- "--color=never", +-- "--no-heading", +-- "--with-filename", +-- "--line-number", +-- "--column", +-- "--smart-case", +-- }, +-- prompt_position = "bottom", +-- prompt_prefix = "> ", +-- initial_mode = "insert", +-- layout_strategy = "horizontal", +-- layout_config = { +-- horizontal = { +-- mirror = false, +-- }, +-- vertical = { +-- mirror = false, +-- }, +-- }, +-- file_sorter = require("telescope.sorters").get_fuzzy_file, +-- file_ignore_patterns = {}, +-- generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, +-- path_display = true, +-- winblend = 0, +-- selection_strategy = "reset", +-- sorting_strategy = "descending", +-- scroll_strategy = "cycle", +-- color_devicons = true, +-- use_less = true, +-- set_env = { ["COLORTERM"] = "truecolor" }, +-- }, +-- }) +-- +-- -- nnoremap fr :exec("Telescope live_grep grep_string=" . system("bundle exec rails routes | awk 'NR>1{ print $2 }' | rg . | tr '\n' ' '")) +-- the abve but in lua +-- vim.keymap.nnoremap("yu", function() +-- vim.cmd( +-- "Telescope live_grep grep_string=" +-- .. vim.fn.system("bundle exec rails routes | awk 'NR>1{ print $2 }' | rg . | tr '\n' ' '") +-- ) +-- end) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..7f09192 --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,96 @@ +{ + "LazyVim": { "branch": "main", "commit": "5646ee5191da244ff8ea57b9dba8a7e0d1dbdd42" }, + "LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" }, + "SchemaStore.nvim": { "branch": "main", "commit": "1cfa6871f0374b21e894aad646366e89a747107e" }, + "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, + "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, + "catppuccin": { "branch": "main", "commit": "02bdd749931a5d739063562e57531c118e081882" }, + "cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" }, + "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, + "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, + "crates.nvim": { "branch": "main", "commit": "e8fa8ec62ded43c3b06bca7ef36be26b924681bb" }, + "dashboard-nvim": { "branch": "master", "commit": "681300934baf36f6184ca41f0b26aed22056d4ee" }, + "dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" }, + "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, + "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, + "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, + "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, + "gitsigns.nvim": { "branch": "main", "commit": "1a50b94066def8591d5f65bd60a4233902e9def4" }, + "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, + "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, + "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "luarocks.nvim": { "branch": "main", "commit": "d73f4bbbeea9eeb9b66a0c6431db402654f43cb8" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" }, + "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, + "mini.ai": { "branch": "main", "commit": "ee9446a17c160aba6a04ff22097389c41872c878" }, + "mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" }, + "mini.comment": { "branch": "main", "commit": "5707e22dd38f7b0d0ea7b273a43948fe203ff3a4" }, + "mini.indentscope": { "branch": "main", "commit": "cf07f19e718ebb0bcc5b00999083ce11c37b8d40" }, + "mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" }, + "mini.starter": { "branch": "main", "commit": "a9497931da60bbf04180077ee452ccf3e57af9bd" }, + "mini.surround": { "branch": "main", "commit": "49e0364b8c9a3258b485c5ece40bb0f3a5e94b1c" }, + "multiple-cursors.nvim": { "branch": "main", "commit": "ca966b288d4fda046d38a213b628cf5edb452a82" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "16d1b194376bf1fc2acd89ccb3c29ba8315bfcea" }, + "neoconf.nvim": { "branch": "main", "commit": "7b989fb3a180ec79b78a183d10e417b2fdeb3c05" }, + "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, + "neotest": { "branch": "master", "commit": "f03a78cef74db5638e4312e18b767294a90de8da" }, + "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, + "neotest-rspec": { "branch": "main", "commit": "c1c3f36e1b1a23698534e6326e90876f87b773a4" }, + "neotest-vitest": { "branch": "main", "commit": "102e7494bbe0f205d28c31a3fd75a9dfbcc78c73" }, + "noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" }, + "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, + "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, + "nvim-emmet": { "branch": "main", "commit": "928cfb74ed436d6d326ccab2061cf3592de1bf55" }, + "nvim-i18n-tools": { "branch": "master", "commit": "ab2f883e3d8e4abb90f3882aacdfd34067cafc24" }, + "nvim-lint": { "branch": "master", "commit": "3317b73ec3eb76cd8ca83e05880c07c83e368c1e" }, + "nvim-lspconfig": { "branch": "master", "commit": "e25c4cdecd3d58c0deccce0f372426c8c480bcce" }, + "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, + "nvim-nio": { "branch": "master", "commit": "5800f585def265d52f1d8848133217c800bcb25d" }, + "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, + "nvim-spectre": { "branch": "master", "commit": "2b012554a2536465243c0dff3605b5927c49ed23" }, + "nvim-surround": { "branch": "main", "commit": "18016d6af52edc9f1c794dcf6665a26a2962d2ee" }, + "nvim-treesitter": { "branch": "master", "commit": "fbe76211f45413feadb155a89073bf65b5766b2e" }, + "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "60e8c288e011403f248b5f6478dde12bed8a6c55" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "2aa454e4037424c678a8ff033951a5be39e54b9c" }, + "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "734ebad31c81c6198dfe102aa23280937c937c42" }, + "nvim-web-devicons": { "branch": "master", "commit": "fd4abfc5237246670977972c6f518186b621a32d" }, + "octo.nvim": { "branch": "master", "commit": "a511b52fbf040f928a24deb72e17ec465613b442" }, + "other.nvim": { "branch": "main", "commit": "301671214246963cd6b398c177e130cff81451d9" }, + "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, + "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, + "refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" }, + "rest.nvim": { "branch": "main", "commit": "3fc2bb8b927a5001069ea5a53a93d47656823f14" }, + "ror.nvim": { "branch": "main", "commit": "9d31ad3953be83ac8dd542725ca4881c861f64a5" }, + "rustaceanvim": { "branch": "master", "commit": "e2dbf91daed26d4dd7263affbecbf9a36e0096e5" }, + "speedtyper.nvim": { "branch": "main", "commit": "2d158eed4c753995b0501a3a7a72464fbb213e3d" }, + "sqlite.lua": { "branch": "master", "commit": "b7e28c8463254c46a8e61c52d27d6a2040492fc3" }, + "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, + "telescope.nvim": { "branch": "master", "commit": "d26b666b45e5dde23332e4bde1227677f2d92e31" }, + "text-case.nvim": { "branch": "main", "commit": "d62c63a4e9a996c7321885937ab89920fca2c1c8" }, + "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, + "tokyonight.nvim": { "branch": "main", "commit": "9bf9ec53d5e87b025e2404069b71e7ebdc3a13e5" }, + "train.nvim": { "branch": "master", "commit": "87a45f805497e7e929702c75187704de8990de14" }, + "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, + "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, + "vim-bundler": { "branch": "master", "commit": "c261509e78fc8dc55ad1fcf3cd7cdde49f35435c" }, + "vim-dispatch": { "branch": "master", "commit": "4c695bc052cad2ae6b980aebbe48d046466e27ae" }, + "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, + "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, + "vim-localorie": { "branch": "master", "commit": "9d4c7fc72c85c53668cde26b84845b28ad1c9945" }, + "vim-rails": { "branch": "master", "commit": "3a155462d1c346e291595400ca238037d02a357f" }, + "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, + "vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" }, + "vimtex": { "branch": "master", "commit": "ac0a41b297a70c101df89bc9c8d43341ba00fd4f" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, + "yanky.nvim": { "branch": "main", "commit": "6bb9ffd3cad4c9876bda54e19d0659de28a4f84f" } +} \ No newline at end of file diff --git a/.config/nvim/lazyvim.json b/.config/nvim/lazyvim.json new file mode 100644 index 0000000..48cb907 --- /dev/null +++ b/.config/nvim/lazyvim.json @@ -0,0 +1,20 @@ +{ + "extras": [ + "lazyvim.plugins.extras.coding.copilot", + "lazyvim.plugins.extras.coding.yanky", + "lazyvim.plugins.extras.editor.dial", + "lazyvim.plugins.extras.lang.json", + "lazyvim.plugins.extras.lang.markdown", + "lazyvim.plugins.extras.lang.ruby", + "lazyvim.plugins.extras.lang.rust", + "lazyvim.plugins.extras.lang.tailwind", + "lazyvim.plugins.extras.lang.tex", + "lazyvim.plugins.extras.lang.typescript", + "lazyvim.plugins.extras.lang.yaml", + "lazyvim.plugins.extras.test.core" + ], + "news": { + "NEWS.md": "3314" + }, + "version": 3 +} \ No newline at end of file diff --git a/.config/nvim/lua/config/autocmds.lua b/.config/nvim/lua/config/autocmds.lua new file mode 100644 index 0000000..27e9e06 --- /dev/null +++ b/.config/nvim/lua/config/autocmds.lua @@ -0,0 +1,3 @@ +-- Autocmds are automatically loaded on the VeryLazy event +-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua +-- Add any additional autocmds here diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..3351742 --- /dev/null +++ b/.config/nvim/lua/config/keymaps.lua @@ -0,0 +1,6 @@ +-- Keymaps are automatically loaded on the VeryLazy event +-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua +-- Add any additional keymaps here + +vim.keymap.set("n", "", "lua require('flash').jump()") +-- vim.keymap.set("n", "cs") diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..5e87e60 --- /dev/null +++ b/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,48 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + +if not (vim.uv or vim.loop).fs_stat(lazypath) then + -- bootstrap lazy.nvim + -- stylua: ignore + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) +end +vim.opt.rtp:prepend(vim.env.LAZY or lazypath) + +require("lazy").setup({ + spec = { + -- add LazyVim and import its plugins + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, + -- import any extras modules here + -- { import = "lazyvim.plugins.extras.lang.typescript" }, + -- { import = "lazyvim.plugins.extras.lang.json" }, + -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, + -- import/override with your plugins + { import = "plugins" }, + }, + defaults = { + -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. + -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. + lazy = false, + -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, + -- have outdated releases, which may break your Neovim install. + version = false, -- always use the latest git commit + -- version = "*", -- try installing the latest stable version for plugins that support semver + }, + install = { colorscheme = { "tokyonight", "habamax" } }, + checker = { enabled = true }, -- automatically check for plugin updates + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + -- "matchit", + -- "matchparen", + -- "netrwPlugin", + "tarPlugin", + "tohtml", + -- "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua new file mode 100644 index 0000000..3ea1454 --- /dev/null +++ b/.config/nvim/lua/config/options.lua @@ -0,0 +1,3 @@ +-- Options are automatically loaded before lazy.nvim startup +-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua +-- Add any additional options here diff --git a/.config/nvim/lua/plugins/barbecue.lua b/.config/nvim/lua/plugins/barbecue.lua new file mode 100644 index 0000000..9fbbec3 --- /dev/null +++ b/.config/nvim/lua/plugins/barbecue.lua @@ -0,0 +1,12 @@ +return { + "utilyre/barbecue.nvim", + name = "barbecue", + version = "*", + dependencies = { + "SmiteshP/nvim-navic", + "nvim-tree/nvim-web-devicons", -- optional dependency + }, + opts = { + -- configurations go here + }, +} diff --git a/.config/nvim/lua/plugins/bufferline.lua b/.config/nvim/lua/plugins/bufferline.lua new file mode 100644 index 0000000..f303f31 --- /dev/null +++ b/.config/nvim/lua/plugins/bufferline.lua @@ -0,0 +1,16 @@ +return { + { + "akinsho/bufferline.nvim", + config = { + options = { + separator_style = "slope", + always_show_bufferline = true, + groups = { + items = { + require("bufferline.groups").builtin.pinned:with({ icon = "🔥" }), + }, + }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/bundler.lua b/.config/nvim/lua/plugins/bundler.lua new file mode 100644 index 0000000..33f1c4a --- /dev/null +++ b/.config/nvim/lua/plugins/bundler.lua @@ -0,0 +1,3 @@ +return { + "tpope/vim-bundler", +} diff --git a/.config/nvim/lua/plugins/cellular-automaton.lua b/.config/nvim/lua/plugins/cellular-automaton.lua new file mode 100644 index 0000000..8007ca6 --- /dev/null +++ b/.config/nvim/lua/plugins/cellular-automaton.lua @@ -0,0 +1,9 @@ +return { + { + "Eandrju/cellular-automaton.nvim", + lazy = false, + setup = function() + -- vim.keymap.set("n", "fml", "CellularAutomaton make_it_rain") + end, + }, +} diff --git a/.config/nvim/lua/plugins/endwise.lua b/.config/nvim/lua/plugins/endwise.lua new file mode 100644 index 0000000..1723500 --- /dev/null +++ b/.config/nvim/lua/plugins/endwise.lua @@ -0,0 +1,13 @@ +return { + { + "RRethy/nvim-treesitter-endwise", + setup = function() + -- Requires nvim-treesitter installed + require("nvim-treesitter.configs").setup({ + endwise = { + enable = true, + }, + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/example.lua b/.config/nvim/lua/plugins/example.lua new file mode 100644 index 0000000..d2f406f --- /dev/null +++ b/.config/nvim/lua/plugins/example.lua @@ -0,0 +1,245 @@ +-- since this is just an example spec, don't actually load anything here and return an empty spec +-- stylua: ignore +if true then return {} end + +-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim +-- +-- In your plugin files, you can: +-- * add extra plugins +-- * disable/enabled LazyVim plugins +-- * override the configuration of LazyVim plugins +return { + -- add gruvbox + { "ellisonleao/gruvbox.nvim" }, + + -- Configure LazyVim to load gruvbox + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, + }, + + -- change trouble config + { + "folke/trouble.nvim", + -- opts will be merged with the parent spec + opts = { use_diagnostic_signs = true }, + }, + + -- disable trouble + { "folke/trouble.nvim", enabled = false }, + + -- override nvim-cmp and add cmp-emoji + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-emoji" }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + table.insert(opts.sources, { name = "emoji" }) + end, + }, + + -- change some telescope options and a keymap to browse plugin files + -- { + -- "nvim-telescope/telescope.nvim", + -- keys = { + -- -- add a keymap to browse plugin files + -- -- stylua: ignore + -- { + -- "fp", + -- function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, + -- desc = "Find Plugin File", + -- }, + -- }, + -- -- change some options + -- opts = { + -- defaults = { + -- layout_strategy = "horizontal", + -- layout_config = { prompt_position = "top" }, + -- sorting_strategy = "ascending", + -- winblend = 0, + -- }, + -- }, + -- }, + + -- add pyright to lspconfig + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- pyright will be automatically installed with mason and loaded with lspconfig + pyright = {}, + }, + }, + }, + + -- add tsserver and setup with typescript.nvim instead of lspconfig + { + "neovim/nvim-lspconfig", + dependencies = { + "jose-elias-alvarez/typescript.nvim", + init = function() + require("lazyvim.util").lsp.on_attach(function(_, buffer) + -- stylua: ignore + vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) + vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) + end) + end, + }, + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- tsserver will be automatically installed with mason and loaded with lspconfig + tsserver = {}, + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + tsserver = function(_, opts) + require("typescript").setup({ server = opts }) + return true + end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + }, + }, + + -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, + -- treesitter, mason and typescript.nvim. So instead of the above, you can use: + { import = "lazyvim.plugins.extras.lang.typescript" }, + + -- add more treesitter parsers + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "tsx", + "typescript", + "vim", + "yaml", + }, + }, + }, + + -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above + -- would overwrite `ensure_installed` with the new value. + -- If you'd rather extend the default config, use the code below instead: + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- add tsx and treesitter + vim.list_extend(opts.ensure_installed, { + "tsx", + "typescript", + }) + end, + }, + + -- the opts function can also be used to change the default opts: + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function(_, opts) + table.insert(opts.sections.lualine_x, "😄") + end, + }, + + -- or you can return new options to override all the defaults + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function() + return { + --[[add your custom lualine config here]] + } + end, + }, + + -- use mini.starter instead of alpha + { import = "lazyvim.plugins.extras.ui.mini-starter" }, + + -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc + { import = "lazyvim.plugins.extras.lang.json" }, + + -- add any tools you want to have installed below + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + }, + }, + }, + + -- Use for completion and snippets (supertab) + -- first: disable default and behavior in LuaSnip + { + "L3MON4D3/LuaSnip", + keys = function() + return {} + end, + }, + -- then: setup supertab in cmp + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-emoji", + }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + local luasnip = require("luasnip") + local cmp = require("cmp") + + opts.mapping = vim.tbl_extend("force", opts.mapping, { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- this way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/git-time-lapse.lua b/.config/nvim/lua/plugins/git-time-lapse.lua new file mode 100644 index 0000000..e3fd222 --- /dev/null +++ b/.config/nvim/lua/plugins/git-time-lapse.lua @@ -0,0 +1,6 @@ +return { + "junkblocker/git-time-lapse", + config = function() + vim.keymap.set("n", "gt", "(git-time-lapse)", { noremap = false }) + end, +} diff --git a/.config/nvim/lua/plugins/mini-starter.lua b/.config/nvim/lua/plugins/mini-starter.lua new file mode 100644 index 0000000..7a55866 --- /dev/null +++ b/.config/nvim/lua/plugins/mini-starter.lua @@ -0,0 +1,75 @@ +return { + { + "echasnovski/mini.starter", + version = false, -- wait till new 0.7.0 release to put it back on semver + event = "VimEnter", + opts = function() + local logo = table.concat({ + " ██████ █████ █████ █████ ███ ", + " ░░██████ ░░███ ░░███ ░░███ ░░░ ", + " ░███░███ ░███ ██████ ██████ ░███ ░███ ████ █████████████ ", + " ░███░░███░███ ███░░███ ███░░███ ░███ ░███ ░░███ ░░███░░███░░███ ", + " ░███ ░░██████ ░███████ ░███ ░███ ░░███ ███ ░███ ░███ ░███ ░███ ", + " ░███ ░░█████ ░███░░░ ░███ ░███ ░░░█████░ ░███ ░███ ░███ ░███ ", + " █████ ░░█████░░██████ ░░██████ ░░███ █████ █████░███ █████ ", + " ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ ", + }, "\n") + local pad = string.rep(" ", 22) + local new_section = function(name, action, section) + return { name = name, action = action, section = pad .. section } + end + + local starter = require("mini.starter") + --stylua: ignore + local config = { + evaluate_single = true, + header = logo, + items = { + new_section("Find file", "Telescope find_files", "Telescope"), + new_section("Recent files", "Telescope oldfiles", "Telescope"), + new_section("Grep text", "Telescope live_grep", "Telescope"), + new_section("Config", "lua require('lazyvim.util').telescope.config_files()()", "Config"), + new_section("Extras", "LazyExtras", "Config"), + new_section("Lazy", "Lazy", "Config"), + new_section("New file", "ene | startinsert", "Built-in"), + new_section("Quit", "qa", "Built-in"), + new_section("Session Restore", [[lua require("persistence").load()]], "Session"), + new_section("VimBeGood", "VimBeGood", "Training"), + new_section("Tutor", "Tutor", "Training"), + new_section("Peed Styper", "Speedtyper", "Training"), + }, + content_hooks = { + starter.gen_hook.adding_bullet(pad .. "░ ", false), + starter.gen_hook.aligning("center", "center"), + }, + } + return config + end, + config = function(_, config) + -- close Lazy and re-open when starter is ready + if vim.o.filetype == "lazy" then + vim.cmd.close() + vim.api.nvim_create_autocmd("User", { + pattern = "MiniStarterOpened", + callback = function() + require("lazy").show() + end, + }) + end + + local starter = require("mini.starter") + starter.setup(config) + + vim.api.nvim_create_autocmd("User", { + pattern = "LazyVimStarted", + callback = function() + local stats = require("lazy").stats() + local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) + local pad_footer = string.rep(" ", 8) + starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" + pcall(starter.refresh) + end, + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/multiple-cursors.lua b/.config/nvim/lua/plugins/multiple-cursors.lua new file mode 100644 index 0000000..87068b9 --- /dev/null +++ b/.config/nvim/lua/plugins/multiple-cursors.lua @@ -0,0 +1,15 @@ +return { + "brenton-leighton/multiple-cursors.nvim", + version = "*", -- Use the latest tagged version + opts = {}, -- This causes the plugin setup function to be called + keys = { + { "", "MultipleCursorsAddDown" }, + { "", "MultipleCursorsAddUp" }, + { "", "MultipleCursorsMouseAddDelete", mode = { "n", "i" } }, + { "a", "MultipleCursorsAddMatches", mode = { "n", "x" } }, + { "A", "MultipleCursorsAddMatchesV", mode = { "n", "x" } }, + { "d", "MultipleCursorsAddJumpNextMatch", mode = { "n", "x" } }, + { "D", "MultipleCursorsJumpNextMatch" }, + { "l", "MultipleCursorsLockToggle", mode = { "n", "x" } }, + }, +} diff --git a/.config/nvim/lua/plugins/nvim-emmet.lua b/.config/nvim/lua/plugins/nvim-emmet.lua new file mode 100644 index 0000000..1f96293 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-emmet.lua @@ -0,0 +1,6 @@ +return { + "olrtg/nvim-emmet", + config = function() + vim.keymap.set({ "n", "v" }, "xe", require("nvim-emmet").wrap_with_abbreviation) + end, +} diff --git a/.config/nvim/lua/plugins/nvim-surround.lua b/.config/nvim/lua/plugins/nvim-surround.lua new file mode 100644 index 0000000..b9ee8f7 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-surround.lua @@ -0,0 +1,10 @@ +return { + "kylechui/nvim-surround", + version = "*", -- Use for stability; omit to use `main` branch for the latest features + event = "VeryLazy", + config = function() + require("nvim-surround").setup({ + -- Configuration here, or leave empty to use defaults + }) + end, +} diff --git a/.config/nvim/lua/plugins/nvim_tools.lua b/.config/nvim/lua/plugins/nvim_tools.lua new file mode 100644 index 0000000..ed0e0c1 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim_tools.lua @@ -0,0 +1,6 @@ +return { + "valen20Chx/nvim-i18n-tools", + config = function() + require("nvim-i18n-tools").setup() + end, +} diff --git a/.config/nvim/lua/plugins/octo.lua b/.config/nvim/lua/plugins/octo.lua new file mode 100644 index 0000000..ce29bd3 --- /dev/null +++ b/.config/nvim/lua/plugins/octo.lua @@ -0,0 +1,14 @@ +return { + { + "pwntester/octo.nvim", + requires = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + -- OR 'ibhagwan/fzf-lua', + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("octo").setup() + end, + }, +} diff --git a/.config/nvim/lua/plugins/other.lua b/.config/nvim/lua/plugins/other.lua new file mode 100644 index 0000000..9fcb4be --- /dev/null +++ b/.config/nvim/lua/plugins/other.lua @@ -0,0 +1,56 @@ +return { + -- default settings + + { + "rgroli/other.nvim", + config = function() + require("other-nvim").setup({ + mappings = { + -- builtin mappings + "livewire", + "angular", + "laravel", + "rails", + "golang", + -- custom mapping + { + pattern = "/app/.+(.*)_controller.rb", + target = "/spec/request/%1_spec.rb", + transformer = "lowercase", + }, + }, + transformers = { + -- defining a custom transformer + lowercase = function(inputString) + return inputString:lower() + end, + }, + style = { + -- How the plugin paints its window borders + -- Allowed values are none, single, double, rounded, solid and shadow + border = "solid", + + -- Column seperator for the window + seperator = "|", + + -- width of the window in percent. e.g. 0.5 is 50%, 1.0 is 100% + width = 0.7, + + -- min height in rows. + -- when more columns are needed this value is extended automatically + minHeight = 2, + }, + }) + + vim.api.nvim_set_keymap("n", "ll", ":Other", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "ltn", ":OtherTabNew", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "lp", ":OtherSplit", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "lv", ":OtherVSplit", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "lc", ":OtherClear", { noremap = true, silent = true }) + + -- Context specific bindings + vim.api.nvim_set_keymap("n", "lt", ":Other test", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "ls", ":Other scss", { noremap = true, silent = true }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/refactoring.lua b/.config/nvim/lua/plugins/refactoring.lua new file mode 100644 index 0000000..62a94f2 --- /dev/null +++ b/.config/nvim/lua/plugins/refactoring.lua @@ -0,0 +1,17 @@ +return { + { + "ThePrimeagen/refactoring.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("refactoring").setup() + require("telescope").load_extension("refactoring") + + vim.keymap.set({ "n", "x" }, "rr", function() + require("telescope").extensions.refactoring.refactors() + end) + end, + }, +} diff --git a/.config/nvim/lua/plugins/repeat.lua b/.config/nvim/lua/plugins/repeat.lua new file mode 100644 index 0000000..1622ffa --- /dev/null +++ b/.config/nvim/lua/plugins/repeat.lua @@ -0,0 +1,3 @@ +return { + "tpope/vim-repeat", +} diff --git a/.config/nvim/lua/plugins/rest.lua b/.config/nvim/lua/plugins/rest.lua new file mode 100644 index 0000000..53a079c --- /dev/null +++ b/.config/nvim/lua/plugins/rest.lua @@ -0,0 +1,16 @@ +return { + { + "vhyrro/luarocks.nvim", + priority = 1000, + config = true, + }, + { + "rest-nvim/rest.nvim", + ft = "http", + dependencies = { "luarocks.nvim" }, + lazy = false, + config = function() + require("rest-nvim").setup() + end, + }, +} diff --git a/.config/nvim/lua/plugins/ror.lua b/.config/nvim/lua/plugins/ror.lua new file mode 100644 index 0000000..d8fdb7f --- /dev/null +++ b/.config/nvim/lua/plugins/ror.lua @@ -0,0 +1,10 @@ +return { + { + "weizheheng/ror.nvim", + config = function() + require("ror").setup() + vim.keymap.set("n", "rc", ":lua require('ror.commands').list_commands()", { silent = true }) + -- vim.keymap.sot("n", "fv", ":lua require('ror.commands').find_view()", { silent = true }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/solargraph.lua b/.config/nvim/lua/plugins/solargraph.lua new file mode 100644 index 0000000..275eb03 --- /dev/null +++ b/.config/nvim/lua/plugins/solargraph.lua @@ -0,0 +1,23 @@ +return { + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + solargraph = { + settings = { + solargraph = { + autoformat = true, + -- bundlerPath = "bundle", + diagnostics = true, + completion = true, + formatting = true, + definitions = true, + }, + }, + }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/speedtyper.lua b/.config/nvim/lua/plugins/speedtyper.lua new file mode 100644 index 0000000..68ec472 --- /dev/null +++ b/.config/nvim/lua/plugins/speedtyper.lua @@ -0,0 +1,7 @@ +return { + "NStefan002/speedtyper.nvim", + cmd = "Speedtyper", + opts = { + -- your config + }, +} diff --git a/.config/nvim/lua/plugins/test.lua b/.config/nvim/lua/plugins/test.lua new file mode 100644 index 0000000..a3af3f5 --- /dev/null +++ b/.config/nvim/lua/plugins/test.lua @@ -0,0 +1,58 @@ +return { + { + "nvim-neotest/neotest", + dependencies = { + "haydenmeade/neotest-jest", + "marilari88/neotest-vitest", + "olimorris/neotest-rspec", + }, + keys = { + { + "tl", + function() + require("neotest").run.run_last() + end, + desc = "Run Last Test", + }, + { + "tL", + function() + require("neotest").run.run_last({ strategy = "dap" }) + end, + desc = "Debug Last Test", + }, + { + "tw", + "lua require('neotest').run.run({ jestCommand = 'jest --watch ' })", + desc = "Run Watch", + }, + }, + opts = function(_, opts) + table.insert( + opts.adapters, + require("neotest-jest")({ + jestCommand = "npm test --", + jestConfigFile = "custom.jest.config.ts", + env = { CI = true }, + cwd = function() + return vim.fn.getcwd() + end, + }) + ) + table.insert(opts.adapters, require("neotest-vitest")) + + table.insert( + opts.adapters, + require("neotest-rspec")({ + -- jestCommand = "npm test --", + -- jestConfigFile = "custom.jest.config.ts", + -- env = { CI = true }, + -- cwd = function() + -- return vim.fn.getcwd() + -- end, + }) + ) + table.insert(opts.adapters, require("neotest-rspec")) + end, + }, +} diff --git a/.config/nvim/lua/plugins/text_case.lua b/.config/nvim/lua/plugins/text_case.lua new file mode 100644 index 0000000..fa55425 --- /dev/null +++ b/.config/nvim/lua/plugins/text_case.lua @@ -0,0 +1,24 @@ +return { + "johmsalas/text-case.nvim", + dependencies = { "nvim-telescope/telescope.nvim" }, + config = function() + require("textcase").setup({}) + require("telescope").load_extension("textcase") + end, + keys = { + "ga", -- Default invocation prefix + { "ga.", "TextCaseOpenTelescope", mode = { "n", "x" }, desc = "Telescope" }, + }, + cmd = { + -- NOTE: The Subs command name can be customized via the option "substitude_command_name" + "Subs", + "TextCaseOpenTelescope", + "TextCaseOpenTelescopeQuickChange", + "TextCaseOpenTelescopeLSPChange", + "TextCaseStartReplacingCommand", + }, + -- If you want to use the interactive feature of the `Subs` command right away, text-case.nvim + -- has to be loaded on startup. Otherwise, the interactive feature of the `Subs` will only be + -- available after the first executing of it or after a keymap of text-case.nvim has been used. + lazy = false, +} diff --git a/.config/nvim/lua/plugins/train.lua b/.config/nvim/lua/plugins/train.lua new file mode 100644 index 0000000..b3cd6a9 --- /dev/null +++ b/.config/nvim/lua/plugins/train.lua @@ -0,0 +1,3 @@ +return { + "tjdevries/train.nvim", +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..1fc3442 --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,28 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + dependencies = { "RRethy/nvim-treesitter-endwise" }, + opts = function(_, opts) + opts.endwise = { enable = true } + opts.indent = { enable = true, disable = { "yaml", "ruby" } } + opts.ensure_installed = { + "bash", + "embedded_template", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "ruby", + "tsx", + "typescript", + "vim", + "yaml", + } + end, + }, +} diff --git a/.config/nvim/lua/plugins/vim-be-good.lua b/.config/nvim/lua/plugins/vim-be-good.lua new file mode 100644 index 0000000..43448f5 --- /dev/null +++ b/.config/nvim/lua/plugins/vim-be-good.lua @@ -0,0 +1,5 @@ +return { + { + "ThePrimeagen/vim-be-good", + }, +} diff --git a/.config/nvim/lua/plugins/vim-dispatch.lua b/.config/nvim/lua/plugins/vim-dispatch.lua new file mode 100644 index 0000000..e91cec8 --- /dev/null +++ b/.config/nvim/lua/plugins/vim-dispatch.lua @@ -0,0 +1,3 @@ +return { + "tpope/vim-dispatch", +} diff --git a/.config/nvim/lua/plugins/vim-fugitive.lua b/.config/nvim/lua/plugins/vim-fugitive.lua new file mode 100644 index 0000000..d7f59af --- /dev/null +++ b/.config/nvim/lua/plugins/vim-fugitive.lua @@ -0,0 +1,6 @@ +return { + { + "tpope/vim-fugitive", + lazy = false, + }, +} diff --git a/.config/nvim/lua/plugins/vim-localoire.lua b/.config/nvim/lua/plugins/vim-localoire.lua new file mode 100644 index 0000000..b2c0f16 --- /dev/null +++ b/.config/nvim/lua/plugins/vim-localoire.lua @@ -0,0 +1,5 @@ +return { + { + "airblade/vim-localorie", + }, +} diff --git a/.config/nvim/lua/plugins/vim-rails.lua b/.config/nvim/lua/plugins/vim-rails.lua new file mode 100644 index 0000000..6455dc6 --- /dev/null +++ b/.config/nvim/lua/plugins/vim-rails.lua @@ -0,0 +1,3 @@ +return { + { "tpope/vim-rails" }, +} diff --git a/.config/nvim/stylua.toml b/.config/nvim/stylua.toml new file mode 100644 index 0000000..5d6c50d --- /dev/null +++ b/.config/nvim/stylua.toml @@ -0,0 +1,3 @@ +indent_type = "Spaces" +indent_width = 2 +column_width = 120 \ No newline at end of file From bcd31552c61737f4055dccb951b85b556031252b Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 13:17:35 +0200 Subject: [PATCH 005/280] Add global git ignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3bf32f3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +**/node_modules/** +**/.DS_Store/** + From cec123b0c12e7be45bfae6eb0ab90c7d095ead3d Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 14:28:20 +0200 Subject: [PATCH 006/280] Add scripts --- .gitignore | 1 + .zshrc | 20 +++---- scripts/branch-checkout.ts | 36 +++++++++++++ scripts/bun.lockb | Bin 0 -> 4877 bytes scripts/copy-ticket-number.ts | 28 ++++++++++ scripts/copy_remote_to_clipboard.sh | 7 +++ scripts/create_executable_script.sh | 35 ++++++++++++ scripts/get-pr-template.ts | 32 +++++++++++ scripts/git-smart-log.ts | 80 ++++++++++++++++++++++++++++ scripts/index.ts | 76 ++++++++++++++++++++++++++ scripts/open-repo-in-browser.ts | 24 +++++++++ scripts/open-ticket-in-browser.ts | 29 ++++++++++ scripts/package.json | 9 ++++ scripts/startup-communications.sh | 16 ++++++ scripts/tsconfig.json | 22 ++++++++ 15 files changed, 405 insertions(+), 10 deletions(-) create mode 100755 scripts/branch-checkout.ts create mode 100755 scripts/bun.lockb create mode 100755 scripts/copy-ticket-number.ts create mode 100755 scripts/copy_remote_to_clipboard.sh create mode 100755 scripts/create_executable_script.sh create mode 100755 scripts/get-pr-template.ts create mode 100755 scripts/git-smart-log.ts create mode 100755 scripts/index.ts create mode 100755 scripts/open-repo-in-browser.ts create mode 100755 scripts/open-ticket-in-browser.ts create mode 100644 scripts/package.json create mode 100755 scripts/startup-communications.sh create mode 100644 scripts/tsconfig.json diff --git a/.gitignore b/.gitignore index 3bf32f3..974e04c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ **/node_modules/** **/.DS_Store/** +**/.ignore/** diff --git a/.zshrc b/.zshrc index 9ebb4a4..31d33ab 100644 --- a/.zshrc +++ b/.zshrc @@ -51,16 +51,16 @@ eval "$(fzf --zsh)" alias ls="eza" alias l="ls -lah" -alias go="~/scripts/js/open-repo-in-browser.ts" -alias gtable="~/scripts/js/git-smart-log.ts" -alias gitcopy='~/scripts/copy_remote_to_clipboard.sh' -alias cscript='~/scripts/create_executable_script.sh' -alias timelog='bun ~/scripts/js/my-ticketing-query/index.ts' -alias crails='~/renuo/personal/rails-generator/bin/crails' -alias openticket='~/scripts/js/open-ticket-in-browser.ts' -alias ot='~/scripts/js/open-ticket-in-browser.ts' -alias prt='~/scripts/js/get-pr-template.ts' -alias cpt='~/scripts/js/copy-ticket-number.ts' +function go() { ./scripts/open-repo-in-browser.ts } +function gtable() { ./scripts/git-smart-log.ts } +function gitcopy() { ./scripts/copy_remote_to_clipboard.sh } +function cscript() { ./scripts/create_executable_script.sh } +function timelog() { ./scripts/index.ts } +function openticket() { ./scripts/open-ticket-in-browser.ts } +function ot() { ./scripts/open-ticket-in-browser.ts } +function prt() { ./scripts/get-pr-template.ts } +function cpt() { ./scripts/copy-ticket-number.ts } + alias '..'='cd ..' alias '...'='cd ../../' diff --git a/scripts/branch-checkout.ts b/scripts/branch-checkout.ts new file mode 100755 index 0000000..d81211d --- /dev/null +++ b/scripts/branch-checkout.ts @@ -0,0 +1,36 @@ +#!/usr/bin/env node + +import { execSync } from 'child_process'; + +// copilot prompt: +// this script gets a branch name from the command line +// it fuzzy searches for a branch containing the substring with grep +// it checks out the branch, if it exists and then exitts + +const branchName = process.argv[2]; + +if (!branchName) { + // get branches + console.log("Please provide a branch name"); + const branches = execSync('git branch').toString().split('\n'); + console.log(branches); + process.exit(1); +} + +const branches = execSync(`git branch | grep ${branchName}`).toString().split('\n').filter(b => b.length > 0); + +if (branches.length === 0) { + console.log(`No branch found containing ${branchName}`); + process.exit(1); +} + +if (branches.length > 1) { + console.log(`Found ${branches.length} branches containing ${branchName}`); + console.log(branches) +} else { + const branch = branches[0].trim(); + console.log(`Found branch ${branch}`); + console.log(`Checking out ${branch}`); + execSync(`git checkout ${branch}`); +} + diff --git a/scripts/bun.lockb b/scripts/bun.lockb new file mode 100755 index 0000000000000000000000000000000000000000..53e2708721996c316b53bcc5268debaf6418e7ee GIT binary patch literal 4877 zcmeHL3sh9q8a~i~GNM)sycaDUMa_aa^8(~C5Q!S4c}2=d(Hv&Z45Q4$IcE^KrDNLl zQBgEK@WBnZNO)B;1Igv0iBV{&*+A+DVuIJWD5+e$q8I7P{r6!uo{Y!b9&5F#f7Utw zetqBn@BQz+&-y2DqR32}L@8Rmh|;GEQp|cjJi;`Ca)nx(MhVphlTN`1)5UyGf*?*i zGtR6#w!z=i}%AI5Z_)!48KcTT=ir;z*Q%R zhoQtL2#bnJF>9c#qkFs7g9?ClBWOR+0?edzvY*E>pV#7Tdu2PTCGlS=E(X9V?>HB|)Fn;jOvBX

&4BD-VXsXK!fa@N(}XUO++pw$_lS6M@vYvce2+ zuQC7lYrEj-dme0ws868@-2FGmM)npa3siI|MbQKc}+cml4)L^b+!ZTK4$|t zyxe`t+t$>zOl7{dKwLdBuBu~t{;0-9ZIwCB(zc5un_t{D<#K_)ck;MeL44-D<$}(Z z55`o6PjEO3bF4wrI@kVZrysW)NSI@rHG|A~15NW^m;d_BsRyXeJ$)Eg< zE$!cleO4<3hsy&YZ||SEhDuDlx{*t$OPG#W%jr_L+IC@ZDjp z{?(a_8xPKUg3M@m@KC&?MEQrNl9!GR+c9T*;oDK!H5^`iepz1T<2~bSOa4QdLv5!N zpROAdbR=VsV)G?o=kU7F#N7){UUQb2mu;I`q_AqTHWfNb50w`uEfpscOK!-O1ywV+ z`vKnrEU$gf1A@s#Gs_pPF?$DBZQS4PD0fB`>^Kv6{h7qe)W#k2$^*`vy`I#%KWxf$pF#@8_(i1 z&4A7~-h;oEwgINxZ!`CP>vzEKjlbCy$aj6j%Uqf-r%g&ytEU-7S{jK{4Dx9cMa2lD zVgaqqq73R_L5M(+rq$>TYS$%kyQf#sLZb8C?Beqs*}JrSxmhNS0oVWpXpf@rCHl6Z z?-1fZ)acxzdmi1%=>80M@uj-Ki}2`fL|DXu?*YV*Z6S?#k-c0OXYDAcfbivurD03V z;V|*AKEEa3ojBkuIN$K}SSl5hVWf<}nGViKpeK}+k>XxEC?~?X3&M~R2`ME6U=h5v z;Oxc|xyH)F@P@fqaDD_B83~re1kSi{W&}MF5`F}+9xx~;!@1L)9-O`5EDL%JUzfQ@Qfh(#jth+;3dlKa1O@W5hD+pp$9gB1!rNN9;-u1X&4w93jicoe|OK( zlrEhzk+U)w%A{AMB{C+hUK1mb+zCN=UkKt|OlDV33%d-WB^e-Cu}r3sqD6Xxic%W% zv;k6QMv($yTFZb%HcO{6fPwC7Gnx!KElmkkl$tV`DAgdA*wqIktQNAt zLiB?mbTkat(Ly$ULyR5JBcQn3Ng=zt+$H2p8@M<%w`lsJ0ocB>FqA~U!DruZa1l#? zK}TyO?Twc!qN|kjDy@o19b|p)8VTHYwZIJF5Deuf`acBug*40zE{GuzoE;1}w2_5y m4}kyE5zwqxX_ZNfC)5T2 literal 0 HcmV?d00001 diff --git a/scripts/copy-ticket-number.ts b/scripts/copy-ticket-number.ts new file mode 100755 index 0000000..ada34fd --- /dev/null +++ b/scripts/copy-ticket-number.ts @@ -0,0 +1,28 @@ +#!/usr/bin/env bun + +import { execSync } from 'child_process'; + +const pipe = (...fns: Array<(arg: T) => T>) => (value: T) => fns.reduce((acc, fn) => fn(acc), value); + +try { + execSync('git status') +} catch (e) { + console.log('Not a git repository') + process.exit(1) +} + +const branchPattern = /feature\/(\d+)/ + +const openGitInBrowser = pipe( + () => execSync('git branch --list | grep "*"'), + (branch) => branchPattern.exec(branch.toString()), + (matches) => { + if (!matches?.[1]) throw new Error('Current branch invalid') + return matches[1] + }, + (ticketNumber) => `echo ${ticketNumber} | pbcopy`, + (command: string) => execSync(command), + () => execSync('echo "The PR template has been copied to your clipboard\!"') +) + +openGitInBrowser('') diff --git a/scripts/copy_remote_to_clipboard.sh b/scripts/copy_remote_to_clipboard.sh new file mode 100755 index 0000000..4ada773 --- /dev/null +++ b/scripts/copy_remote_to_clipboard.sh @@ -0,0 +1,7 @@ +#!/bin/zsh + +# Get the git remote origin URL +remote_url=$(git remote -v | awk '/origin.*fetch/ { print $2 }') + +# Copy the remote URL to the clipboard +echo "$remote_url" | pbcopy diff --git a/scripts/create_executable_script.sh b/scripts/create_executable_script.sh new file mode 100755 index 0000000..a7dd75f --- /dev/null +++ b/scripts/create_executable_script.sh @@ -0,0 +1,35 @@ +#!/bin/zsh +# Author: ChatGPT 3.5 Turbo + +# Check if both the directory and script name are provided as arguments +if [ $# -lt 2 ]; then + echo "Usage: create_executable_script.sh directory_name script_name" + exit 1 +fi + +# Extract directory name and script name from input arguments +directory_name="$1" +script_name="$2" + +# Create the directory if it doesn't exist +if [ ! -d "$directory_name" ]; then + mkdir -p "$directory_name" +fi + +# Change to the specified directory +cd "$directory_name" || exit + +# Check if the script name already exists +if [ -f "$script_name" ]; then + echo "A script with the name $script_name already exists in the directory $directory_name." + exit 1 +fi + +# Create the new script file +touch "$script_name" + +# Make the script executable +chmod +x "$script_name" + +# Open the script file in a text editor for further editing +nvim "$script_name" diff --git a/scripts/get-pr-template.ts b/scripts/get-pr-template.ts new file mode 100755 index 0000000..9ffb13f --- /dev/null +++ b/scripts/get-pr-template.ts @@ -0,0 +1,32 @@ +#!/usr/bin/env bun + +import { execSync } from 'child_process'; + +const pipe = (...fns: Array<(arg: T) => T>) => (value: T) => fns.reduce((acc, fn) => fn(acc), value); + +try { + execSync('git status') +} catch (e) { + console.log('Not a git repository') + process.exit(1) +} + +const redmineBaseUrl = 'https://redmine.renuo.ch/issues/' +const branchPattern = /feature\/(\d+)/ + +const openGitInBrowser = pipe( + () => execSync('git branch --list | grep "*"'), + (branch) => branchPattern.exec(branch.toString()), + (matches) => { + if (!matches?.[1]) throw new Error('Current branch invalid') + return matches[1] + }, + (ticketNumber) => { + return `TICKET-${ticketNumber}` + }, + (prTemplate) => `echo ${JSON.stringify(prTemplate)} | pbcopy`, + (command) => execSync(command), + () => execSync('echo "The PR template has been copied to your clipboard\!"') +) + +openGitInBrowser('') diff --git a/scripts/git-smart-log.ts b/scripts/git-smart-log.ts new file mode 100755 index 0000000..482ad5b --- /dev/null +++ b/scripts/git-smart-log.ts @@ -0,0 +1,80 @@ +#!/usr/bin/env bun + +import { execSync } from "child_process"; +import { printTable } from 'console-table-printer'; +import simpleGit from 'simple-git'; + +const params = process.argv.slice(2) +let filterDate = new Date() + +if (params[0] === '--help' || params[0] === '-h') { + console.log(` + Usage: git-smart-log [date] + + date: Date in format dd.mm.yyyy + `) + process.exit(0) +} + +if (params.length) { + const [day, month, year] = params[0].split('.').map(Number) + + filterDate = new Date( + year ?? new Date().getFullYear(), + month ? month - 1 : new Date().getMonth(), + day ?? new Date().getDate() + ) + if (isNaN(filterDate.getTime())) { + throw new Error('Invalid date') + } +} + +const cwd = process.cwd(); +const { all } = await simpleGit().cwd(cwd).log(['--all']) + +const filteredCommits = all.filter(commit => { + const date = new Date(commit.date) + return date.toDateString() === filterDate.toDateString() +}) + +const commits = filteredCommits.map(commit => { + const branch = execSync(`git branch --contains ${commit.hash}`, { cwd }) + .toString() + .split('\n')[0] + .trim() + .replace('* ', '') + .replace(/^\s+/, '') + + return { + ...commit, + branch + } +}) + +const sortedCommits = commits.sort((a, b) => { + const dateA = new Date(a.date) + const dateB = new Date(b.date) + return dateA.getTime() - dateB.getTime() +}) + +const textElipsis = (str: string, maxLength: number) => { + if (str.length < maxLength) return str + + return str.substring(0, maxLength) + '...' +} + +const formatedCommits = sortedCommits.map(commit => { + const formatedDate = new Date(commit.date).toLocaleTimeString() + + return { + branch: textElipsis(commit.branch, 20), + author: textElipsis(commit.author_name, 10), + hash: commit.hash.slice(0, 7), + date: formatedDate, + message: textElipsis(commit.message, 80) + } +}) + +console.log(`${formatedCommits.length} commits found for ${filterDate.toDateString()}`) + +printTable(formatedCommits) diff --git a/scripts/index.ts b/scripts/index.ts new file mode 100755 index 0000000..498795f --- /dev/null +++ b/scripts/index.ts @@ -0,0 +1,76 @@ +#!/usr/bin/env bun + +import { parse } from "csv-parse"; +import { createReadStream } from "fs"; +import chalk from "chalk"; + +const { log } = console; + +const filename = process.argv[2]; +const pretendDayEnd = process.argv[3] === 'y'; + +const columns = ['Project', 'Date', 'Hours', 'Issue']; +const indicies: Record = {}; + +const dateDict: Record = {}; // use a dict to aggregate hours by date + +log(chalk.blue(`Reading ${filename}`)); + +let index = 0; +createReadStream(filename) + .pipe(parse({ delimiter: "," })) + .on("data", (row) => { + // get the indicies of the columns we care about + if (index++ === 0) { + columns.forEach((column) => { + indicies[column] = row.indexOf(column); + }); + return; + } + + // get the values of the columns we care about + const values = columns.map((column) => row[indicies[column]]); + const [project, date, hours, issue] = values; + + dateDict[date] = (dateDict[date] || 0) + Number(hours); + }) + .on("end", () => { + log(chalk.green("Done!")); + + const dateList: [string, number][] = Object.entries(dateDict); + + let totalHours = 0; + dateList.forEach(([date, hours], index) => { + if (index === 0 && hours < 8.4 && pretendDayEnd) { + totalHours += 8.4; + log(chalk.magenta(`${date}: ${format(hours)}, counted as 8.4`)) + } else { + totalHours += hours; + + if (isHourSussy(hours)) { + log(chalk.red(`⚠️ ${date}: ${format(hours)}`)); + } else { + log(chalk.gray(`${date}: ${format(hours)}`)); + } + } + }); + + log(`\nTotal hours: ${format(totalHours)}`); + log(`Expected hours: ${format(8.4 * dateList.length)}`) + log(`\nOvertime in this period: ${format(totalHours - 8.4 * dateList.length)}`) + + log(`Average hours: ${format(totalHours / dateList.length)}`); + log(`Total days: ${dateList.length}`) + }); + +// helpers +function isHourSussy(hours: number) { + const workDay = 8.4; + const deviation = 1.0; + + return hours > workDay + deviation || hours < workDay - deviation; +} + +function format(num: number) { + return num.toFixed(1); +} diff --git a/scripts/open-repo-in-browser.ts b/scripts/open-repo-in-browser.ts new file mode 100755 index 0000000..8120425 --- /dev/null +++ b/scripts/open-repo-in-browser.ts @@ -0,0 +1,24 @@ +#!/usr/bin/env bun + +import { execSync } from 'child_process'; + +const pipe = (...fns: Array<(arg: T) => T>) => (value: T) => fns.reduce((acc, fn) => fn(acc), value); + +try { + execSync('git status') +} catch (e) { + console.log('Not a git repository') + process.exit(1) +} + +const branch = execSync('git rev-parse --abbrev-ref HEAD').toString() + +const openGitInBrowser = pipe( + () => execSync('git remote get-url origin').toString().trim(), + (output) => output.split('@')[1].replace(':', '/'), + (path) => `https://${path.replace('.git', '')}`, + (url) => `open ${url}/tree/${branch}`, + (command) => execSync(command).toString() +) + +openGitInBrowser('') diff --git a/scripts/open-ticket-in-browser.ts b/scripts/open-ticket-in-browser.ts new file mode 100755 index 0000000..e0bf9e1 --- /dev/null +++ b/scripts/open-ticket-in-browser.ts @@ -0,0 +1,29 @@ +#!/usr/bin/env bun + +import {exec, execSync} from 'child_process'; + +const pipe = (...fns: Array<(arg: T) => T>) => (value: T) => fns.reduce((acc, fn) => fn(acc), value); + +try { + execSync('git status') +} catch (e) { + console.log('Not a git repository') + process.exit(1) +} + +const redmineBaseUrl = 'https://redmine.renuo.ch/issues/' +const branchPattern = /feature\/(\d+)/ + +const openGitInBrowser = pipe( + () => execSync('git branch --list | grep "*"'), + (branch) => branchPattern.exec(branch), + (matches) => { + if (!matches?.[1]) throw new Error('Current branch invalid') + return matches[1] + }, + (ticketNumber) => `open ${redmineBaseUrl}${ticketNumber}`, + (command) => execSync(command) +) + +openGitInBrowser('') + diff --git a/scripts/package.json b/scripts/package.json new file mode 100644 index 0000000..93ab2d3 --- /dev/null +++ b/scripts/package.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@types/node": "^20.6.3", + "chalk": "^5.3.0", + "console-table-printer": "^2.11.2", + "csv-parse": "^5.5.5", + "simple-git": "^3.20.0" + } +} diff --git a/scripts/startup-communications.sh b/scripts/startup-communications.sh new file mode 100755 index 0000000..720df10 --- /dev/null +++ b/scripts/startup-communications.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Startup communications +# @raycast.mode compact + +# Optional parameters: +# @raycast.icon 🤖 + +# Documentation: +# @raycast.author Dani + +open -a "Slack" +open -a "Spark Mail" + diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json new file mode 100644 index 0000000..1449bc3 --- /dev/null +++ b/scripts/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "lib": ["ESNext"], + "module": "esnext", + "target": "esnext", + "moduleResolution": "bundler", + "moduleDetection": "force", + "allowImportingTsExtensions": true, + "noEmit": true, + "composite": true, + "strict": true, + "downlevelIteration": true, + "skipLibCheck": true, + "jsx": "preserve", + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "allowJs": true, + "types": [ + "bun-types" // add Bun global + ] + } +} From 507c56c057f58767af24aae5b006f28d448f2650 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 14:39:46 +0200 Subject: [PATCH 007/280] Add hidden files list --- .zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 31d33ab..130312c 100644 --- a/.zshrc +++ b/.zshrc @@ -50,7 +50,8 @@ eval "$(jenv init -)" eval "$(fzf --zsh)" alias ls="eza" -alias l="ls -lah" +alias l="eza -lah" +alias lh="eza -lah | grep -E ' \.\w+$'" # [l]ist [h]idden function go() { ./scripts/open-repo-in-browser.ts } function gtable() { ./scripts/git-smart-log.ts } function gitcopy() { ./scripts/copy_remote_to_clipboard.sh } From 7d30528f93e7c0895da167e4b960fe2076104fcd Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 14:52:24 +0200 Subject: [PATCH 008/280] Improve performance of zsh --- .zshrc | 88 ++++++++++++++++++++++++++++------------------------------ 1 file changed, 43 insertions(+), 45 deletions(-) diff --git a/.zshrc b/.zshrc index 130312c..645039a 100644 --- a/.zshrc +++ b/.zshrc @@ -1,32 +1,32 @@ source ~/.import-secrets.sh -if [ "$TERM_PROGRAM" = "WarpTerminal" ] && [ "$TERMINAL_EMULATOR" != "JetBrains-JediTerm" ]; then - printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "zsh"}}\x9c' -else - [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh - - source /opt/homebrew/share/antigen/antigen.zsh - antigen apply - - if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" - fi -fi - -# BEGIN mood-nvim https://github.com/otavioschwanck/mood-nvim/wiki/Manual-Installation#manual-installation -if [ -n "$NVIM_LISTEN_ADDRESS" ]; then - alias nvim=nvr -cc split --remote-wait +'set bufhidden=wipe' -fi - -if [ -n "$NVIM_LISTEN_ADDRESS" ]; then - export VISUAL="nvr -cc split --remote-wait +'set bufhidden=wipe'" - export EDITOR="nvr -cc split --remote-wait +'set bufhidden=wipe'" -else - export VISUAL="nvim" - export EDITOR="nvim" -fi -# END mood-nvim +# if [ "$TERM_PROGRAM" = "WarpTerminal" ] && [ "$TERMINAL_EMULATOR" != "JetBrains-JediTerm" ]; then +# printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "zsh"}}\x9c' +# else +# [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +# + # source /opt/homebrew/share/antigen/antigen.zsh + # antigen apply +# +# if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then +# source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +# fi +# fi +# +# # BEGIN mood-nvim https://github.com/otavioschwanck/mood-nvim/wiki/Manual-Installation#manual-installation +# if [ -n "$NVIM_LISTEN_ADDRESS" ]; then +# alias nvim=nvr -cc split --remote-wait +'set bufhidden=wipe' +# fi +# +# if [ -n "$NVIM_LISTEN_ADDRESS" ]; then +# export VISUAL="nvr -cc split --remote-wait +'set bufhidden=wipe'" +# export EDITOR="nvr -cc split --remote-wait +'set bufhidden=wipe'" +# else +# export VISUAL="nvim" +# export EDITOR="nvim" +# fi +# # END mood-nvim export PATH="$HOME/.jenv/bin:$PATH" export PATH="~/renuo/personal/rails-generator/bin:$PATH" @@ -45,9 +45,9 @@ source /opt/homebrew/opt/autojump/etc/autojump.sh source "$HOME/.cargo/env" source /opt/homebrew/opt/asdf/libexec/asdf.sh -eval $(thefuck --alias) -eval "$(jenv init -)" -eval "$(fzf --zsh)" +# eval $(thefuck --alias) +# eval "$(jenv init -)" +# eval "$(fzf --zsh)" alias ls="eza" alias l="eza -lah" @@ -72,26 +72,24 @@ alias alacritty='nvim ~/.config/alacritty/alacritty.yml' alias g="grep" # [g]rep alias bra="bundle exec rubocop -A" # [b]undle exec [r]ubocop -[A] alias spec="be rspec" -alias f="fork ." +alias f="fork ." alias rsf='be rspec spec/$(cd spec/ && fzf)' # [r][s]pec [f]uzzy find -alias cnvim="cd ~/.config/nvim && nvim init.lua" - -alias glog_="git log --pretty=format:'%D %n %C(yellow)%h %C(reset)%ad %C(reset)%s' --date=format:'%d-%m-%Y %H:%M'" -alias glog="glog_ | grep -v -e '^\s*$' --color=always | less --use-color" -alias glag="glog_ --all --since='00:00' --until='NOW' | grep -v -e '^\s*$' --color=always" -alias gb="if ( git branch | grep '* develop' ); then; git checkout -b ; else; echo 'You can only start a new feature from the development branch' ;fi;" -alias gs="git status" -alias gp="git push" -alias gpp="git pull && git push" +alias cnvim="cd ~/.config/nvim && nvim init.lua" # [c]onfigure [nvim] + +alias glog="glog_ | grep -v -e '^\s*$' --color=always | less --use-color" # [g]it [log] +alias glag="glog_ --all --since='00:00' --until='NOW' | grep -v -e '^\s*$' --color=always" # [g]it [l]og [a]ll [g]rep +alias gb="if ( git branch | grep '* develop' ); then; git checkout -b ; else; echo 'You can only start a new feature from the development branch' ;fi;" # [g]it [b]ranch +alias gs="git status" # [g]it [s]tatus +alias gp="git push" # [g]it [p]ush +alias gpp="git pull && git push" # [g]it [p]ull and [p]ush alias gpl="git pull" # [g]it [p]u[l]l alias gc="git commit" # [g]it [c]ommit -alias ga="git add" +alias ga="git add" # [g]it [a]dd alias gac="git add . && git commit" # [g]it [a]dd and [c]ommit -# alias gpsup="git push –-set-upstream origin $(git_current_branch)" -alias lg="lazygit" -alias gcl="git clone" -alias gss="git stash" -alias cl="clear" +alias lg="lazygit" # [l]azy[g]it +alias gcl="git clone" # [g]it [cl]one +alias gss="git stash" # [g]it [s]tash [s]ave +alias cl="clear" # [cl]ear # IDEA: gsf TICKET NAME => git checkout -b feature/TICKET-NAME + check if user on develop # IDEA: grd => git pull origin develop && fork . => rebase From 980f7ffd9901b4624eb22d75f3f6934f6aca7a10 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 15:35:24 +0200 Subject: [PATCH 009/280] Replace p10k with startship Decrease startup time significantly by leveraging zim and a lightweight alternative to p10k --- .zshrc | 61 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/.zshrc b/.zshrc index 645039a..b2eca1b 100644 --- a/.zshrc +++ b/.zshrc @@ -1,32 +1,8 @@ source ~/.import-secrets.sh - -# if [ "$TERM_PROGRAM" = "WarpTerminal" ] && [ "$TERMINAL_EMULATOR" != "JetBrains-JediTerm" ]; then -# printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "zsh"}}\x9c' -# else -# [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh -# - # source /opt/homebrew/share/antigen/antigen.zsh - # antigen apply -# -# if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then -# source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" -# fi -# fi -# -# # BEGIN mood-nvim https://github.com/otavioschwanck/mood-nvim/wiki/Manual-Installation#manual-installation -# if [ -n "$NVIM_LISTEN_ADDRESS" ]; then -# alias nvim=nvr -cc split --remote-wait +'set bufhidden=wipe' -# fi -# -# if [ -n "$NVIM_LISTEN_ADDRESS" ]; then -# export VISUAL="nvr -cc split --remote-wait +'set bufhidden=wipe'" -# export EDITOR="nvr -cc split --remote-wait +'set bufhidden=wipe'" -# else -# export VISUAL="nvim" -# export EDITOR="nvim" -# fi -# # END mood-nvim +if [ "$TERM_PROGRAM" = "WarpTerminal" ] && [ "$TERMINAL_EMULATOR" != "JetBrains-JediTerm" ]; then + printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "zsh"}}\x9c' +fi export PATH="$HOME/.jenv/bin:$PATH" export PATH="~/renuo/personal/rails-generator/bin:$PATH" @@ -45,9 +21,7 @@ source /opt/homebrew/opt/autojump/etc/autojump.sh source "$HOME/.cargo/env" source /opt/homebrew/opt/asdf/libexec/asdf.sh -# eval $(thefuck --alias) -# eval "$(jenv init -)" -# eval "$(fzf --zsh)" +eval "$(fzf --zsh)" alias ls="eza" alias l="eza -lah" @@ -193,3 +167,30 @@ zle -N accept-line sticky-prompt-accept-line bindkey '^S' sticky-prompt-set # END zsh-sticky-prompt + +### Added by Zinit's installer +if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then + print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" + command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" + command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ + print -P "%F{33} %F{34}Installation successful.%f%b" || \ + print -P "%F{160} The clone has failed.%f%b" +fi + +source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" +autoload -Uz _zinit +(( ${+_comps} )) && _comps[zinit]=_zinit + +# Load a few important annexes, without Turbo +# (this is currently required for annexes) +zinit light-mode for \ + zdharma-continuum/zinit-annex-as-monitor \ + zdharma-continuum/zinit-annex-bin-gem-node \ + zdharma-continuum/zinit-annex-patch-dl \ + zdharma-continuum/zinit-annex-rust + +### End of Zinit's installer chunk + +# Load pure theme +zinit ice pick"async.zsh" src"pure.zsh" # with zsh-async library that's bundled with it. +zinit light sindresorhus/pure From 3a827170a25b777e40474cf6e55e4fbb5dd77bf1 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 16:43:07 +0200 Subject: [PATCH 010/280] Add tmux --- .tmux.conf | 241 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 .tmux.conf diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..5544e08 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,241 @@ +# INSTALL +# cp tmuxconf ~/.tmux.conf +# +# Set prefix key to c-f instead of default c-b +unbind C-b +set -g prefix C-f +bind C-f send-prefix + +set-option -g default-shell /bin/zsh + +# toogle last window by hitting again C-f +bind-key C-f last-window + +# if multiple clients are attached to the same window, maximize it to the +# bigger one +set-window-option -g aggressive-resize + +# Start windows and pane numbering with index 1 instead of 0 +set -g base-index 1 +setw -g pane-base-index 1 + +# re-number windows when one is closed +set -g renumber-windows on + +# word separators for automatic word selection +setw -g word-separators ' @"=()[]_-:,.' +setw -ag word-separators "'" + +# Show times longer than supposed +set -g display-panes-time 2000 + +# tmux messages are displayed for 4 seconds +set -g display-time 4000 + +# {n}vim compability +set -g default-terminal "screen-256color" + +# Split horiziontal and vertical splits, instead of % and " +# Also open them in the same directory +bind-key v split-window -h -c '#{pane_current_path}' +bind-key s split-window -v -c '#{pane_current_path}' + +# Pressing Ctrl+Shift+Left (will move the current window to the left. Similarly +# right. No need to use the modifier (C-b). +bind-key -n C-S-Left swap-window -t -1 +bind-key -n C-S-Right swap-window -t +1 + +# Source file +unbind r +bind r source-file ~/.tmux.conf \; display "Reloaded!" + +# Use vim keybindings in copy mode +setw -g mode-keys vi + +# Update default binding of `Enter` and `Space to also use copy-pipe +unbind -T copy-mode-vi Enter +unbind -T copy-mode-vi Space + +bind-key -T edit-mode-vi Up send-keys -X history-up +bind-key -T edit-mode-vi Down send-keys -X history-down + +# setup 'v' to begin selection as in Vim +bind-key -T copy-mode-vi 'v' send-keys -X begin-selection + +# copy text with `y` in copy mode +# bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel\; run "tmux save -|pbcopy >/dev/null 2>&1" +bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel + +# copy text with mouse selection without pressing any key +bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel\; run "tmux save -|pbcopy >/dev/null 2>&1" +# bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel + +# emacs key bindings in tmux command prompt (prefix + :) are better than +# vi keys, even for vim users +set -g status-keys emacs + +# focus events enabled for terminals that support them +set -g focus-events on + +# Sync panes (Send input to all panes in the window). When enabled, pane +# borders become red as an indication. +bind C-s if -F '#{pane_synchronized}' \ + 'setw synchronize-panes off; \ + setw pane-active-border-style fg=colour63,bg=default; \ + setw pane-border-format " #P "' \ + 'setw synchronize-panes on; \ + setw pane-active-border-style fg=red; \ + setw pane-border-format " #P - Pane Synchronization ON "' + +# Faster command sequence +set -s escape-time 0 + +# Have a very large history +set -g history-limit 1000000 + +# Mouse mode on +set -g terminal-overrides 'xterm*:smcup@:rmcup@' +set -g mouse on + +# Set title +set -g set-titles on +set -g set-titles-string "#T" + +# Equally resize all panes +bind-key = select-layout even-horizontal +bind-key | select-layout even-vertical + +# Resize panes +bind-key J resize-pane -D 10 +bind-key K resize-pane -U 10 +bind-key H resize-pane -L 10 +bind-key L resize-pane -R 10 + +# Select panes +# NOTE(arslan): See to prevent cycling https://github.com/tmux/tmux/issues/1158 +bind-key j select-pane -D +bind-key k select-pane -U +bind-key h select-pane -L +bind-key l select-pane -R + +# Disable confirm before killing +bind-key x kill-pane + +# This tmux statusbar config was created by tmuxline.vim +# on Wed, 25 Nov 2015 +set -g status "on" +set -g status-bg "colour236" +set -g status-justify "left" +set -g status-position "top" +set -g status-left-length "100" +set -g status-right-length "100" +set -g status-left "#{prefix_highlight}#[fg=colour22,bg=colour148,bold] #S #[fg=colour148,bg=colour236,nobold,nounderscore,noitalics]" +set -g status-right "#[fg=colour240,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour250,bg=colour240] %Y-%m-%d %H:%M #[fg=colour252,bg=colour240,nobold,nounderscore,noitalics]#[fg=colour241,bg=colour252] #h " + +setw -g window-status-separator "" +setw -g window-status-format "#[fg=colour245,bg=colour236] #I #[fg=colour245,bg=colour236]#W " +setw -g window-status-current-format "#[fg=colour236,bg=colour240,nobold,nounderscore,noitalics]#[fg=colour231,bg=colour240] #I #[fg=colour231,bg=colour240]#{?window_zoomed_flag,#[fg=green][],}#W #[fg=colour240,bg=colour236,nobold,nounderscore,noitalics]" + +# List of plugins +# see this https://github.com/tmux-plugins/tpm to installation +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-open' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'tmux-plugins/tmux-prefix-highlight' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run -b '~/.tmux/plugins/tpm/tpm' + + +# The followings are not any kind of setting for Tmux, but crucial to my +# own productivity. Setting them up is really pain, and I probably going to +# forget it. So I'm just putting them here again. + +######## iTerm + Tmux key integration ######### +# First of all, iTerm can send hex codes for shortcuts you define. So for +# example you can send a hex code for the shortcut "c-f v" which in my case +# opens a vertical pane (see setting above). The hex code for this combination +# is: 0x06 0x76. There are many cases to find it out. One of them is the tool +# 'xxd' + +# If you run "xxd -psd" and hit "c-f v" and then enter and finally c-c to exit +# , it outputs the following: +# +# $ xxd -psd +# ^Fv +# 06760a^C +# +# What matters is the sequence 06760a^C where: +# +# 06 -> c-f +# 76 -> v +# 0a -> return +# ^C -> c-c +# +# From here, we know that 0x06 0x76 corresponds to "c-f v". +# +# Finally, inside the iTerm2 Key settings, I'm adding just various shortcuts, +# such as cmd-j, cmd-left, etc.. , select the option "send hex code" and the +# enter the hex code which I want to be executed, hence the tmux sequence. So +# when I press CMD + d in iterm, I send the sequence 0x06 0x76, +# which tmux inteprets it as opening a new pane. +############################################### + +######## Alacritty + Tmux key integration ######### +# First of all, Alacritty can send hex codes for shortcuts you define. So for +# example you can send a hex code for the shortcut "c-f v" which in my case +# opens a vertical pane (see setting above). The hex code for this combination +# is: 0x06 0x76. There are many cases to find it out. One of them is the tool +# 'xxd' + +# If you run "xxd -psd" and hit "c-f v" and then enter and finally c-c to exit +# , it outputs the following: +# +# $ xxd -psd +# ^Fv +# 06760a^C +# +# What matters is the sequence 06760a^C where: +# +# 06 -> c-f +# 76 -> v +# 0a -> return +# ^C -> c-c +# +# From here, we know that 0x06 0x76 corresponds to "c-f v". +# +# Next step is to add a line to 'key_binding' setting in Alacritty: +# +# - { key: D, mods: Command, chars: "\x06\x76" } +# +# That's it! The followings are the ones that I'm using: +# +# key_bindings: +# - { key: D, mods: Command, chars: "\x06\x76" } +# - { key: D, mods: Command|Shift, chars: "\x06\x73" } +# - { key: W, mods: Command, chars: "\x06\x78" } +# - { key: H, mods: Command, chars: "\x06\x68" } +# - { key: J, mods: Command, chars: "\x06\x6a" } +# - { key: K, mods: Command, chars: "\x06\x6b" } +# - { key: L, mods: Command, chars: "\x06\x6c" } +# - { key: T, mods: Command, chars: "\x06\x63" } +# - { key: Key1, mods: Command, chars: "\x06\x31" } +# - { key: Key2, mods: Command, chars: "\x06\x32" } +# - { key: Key3, mods: Command, chars: "\x06\x33" } +# - { key: Key4, mods: Command, chars: "\x06\x34" } +# - { key: Key5, mods: Command, chars: "\x06\x35" } +# - { key: Key6, mods: Command, chars: "\x06\x36" } +# - { key: Key7, mods: Command, chars: "\x06\x37" } +# - { key: Key8, mods: Command, chars: "\x06\x38" } +# - { key: Key9, mods: Command, chars: "\x06\x39" } +# - { key: Left, mods: Command, chars: "\x06\x48" } +# - { key: Down, mods: Command, chars: "\x06\x4a" } +# - { key: Up, mods: Command, chars: "\x06\x4b" } +# - { key: Right, mods: Command, chars: "\x06\x4c" } +# +# Finally, inside the iTerm2 Key settings, I'm adding just various shortcuts, +# such as cmd-j, cmd-left, etc.. , select the option "send hex code" and the +# enter the hex code which I want to be executed, hence the tmux sequence. So +# when I press CMD + d in iterm, I send the sequence 0x06 0x76, +# which tmux inteprets it as opening a new pane. +############################################### From be0b7b163a7c44505ba4040c3d2c7d2884920c94 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 19:11:01 +0200 Subject: [PATCH 011/280] Update alacritty config --- .config/alacritty/alacritty.yml | 64 +++++---------------------------- .zshrc | 3 +- 2 files changed, 11 insertions(+), 56 deletions(-) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 9c3a8e3..3f8b150 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -10,8 +10,8 @@ window: decorations_theme_variant: None decorations: buttonless padding: - x: 10 - y: 10 + x: 5 + y: 5 colors: # Default colors @@ -94,6 +94,13 @@ colors: - { index: 16, color: "#9c715a" } - { index: 17, color: "#F4DBD6" } +shell: + program: /bin/zsh + args: + - -l + - -c + - "tmux attach || tmux" + # To get keybinding, just run: xxd -psd key_bindings: - { key: Home, chars: "\x1bOH", mode: AppCursor } @@ -182,56 +189,3 @@ key_bindings: - { key: I, mods: Command, chars: "\x18\x21" } - { key: I, mods: Shift|Command, chars: "\x18\x24" } - # Linux - - { key: V, mods: Alt, action: Paste } - - { key: D, mods: Alt, chars: "\x1b\x64" } - - { key: B, mods: Alt, chars: "\x1b\x62" } - - { key: J, mods: Alt, chars: "\x18\x6d" } - - { key: K, mods: Alt, chars: "\x18\x62" } - - { key: C, mods: Alt, action: Copy } - - { key: Q, mods: Alt, action: Quit } - - { key: W, mods: Alt, action: Quit } - - { key: Key0, mods: Alt, action: ResetFontSize } - - { key: Equals, mods: Alt, action: IncreaseFontSize } - - { key: Minus, mods: Alt, action: DecreaseFontSize } - - { key: Back, mods: Alt, chars: "\x15" } # delete word/line - - { key: D, mods: Shift|Alt, chars: "\x18\x64" } - - { key: V, mods: Shift|Alt, chars: "\x18\x76" } - - { key: A, mods: Shift|Alt, chars: "\x18\x73" } - - { key: S, mods: Shift|Alt, chars: "\x18\x56" } - - { key: H, mods: Shift|Alt, chars: "\x18\x08" } - - { key: J, mods: Shift|Alt, chars: "\x18\x0a" } - - { key: K, mods: Shift|Alt, chars: "\x18\x0b" } - - { key: L, mods: Shift|Alt, chars: "\x18\x0c" } - - { key: Key1, mods: Alt, chars: "\x18\x31" } - - { key: Key2, mods: Alt, chars: "\x18\x32" } - - { key: Key3, mods: Alt, chars: "\x18\x33" } - - { key: Key4, mods: Alt, chars: "\x18\x34" } - - { key: Key5, mods: Alt, chars: "\x18\x35" } - - { key: Key6, mods: Alt, chars: "\x18\x36" } - - { key: Key7, mods: Alt, chars: "\x18\x37" } - - { key: Key8, mods: Alt, chars: "\x18\x38" } - - { key: Key9, mods: Alt, chars: "\x18\x39" } - - { key: T, mods: Alt, chars: "\x18\x63" } - - { key: X, mods: Alt, chars: "\x18\x78" } - - { key: S, mods: Alt, chars: "\x18\x77" } - - { key: Slash, mods: Control|Alt, chars: "\x18\x2f" } - - { key: R, mods: Alt, chars: "\x18\x2c" } - - { key: LBracket, mods: Alt, chars: "\x18\x5b" } - - { key: A, mods: Alt, chars: "\x18\x3d" } - - { key: O, mods: Alt, chars: "\x18\x6f" } - - { key: O, mods: Shift|Alt, chars: "\x18\x7a" } - - { key: Return, mods: Alt, chars: "\x18\x7a" } - - { key: Escape, mods: Alt, chars: "\x18\x01" } - - { key: Comma, mods: Shift|Command, chars: "\x18<" } - - { key: Period, mods: Shift|Command, chars: "\x18>" } - - { key: Comma, mods: Alt, chars: "\x18\x10" } - - { key: Semicolon, mods: Alt, chars: "\x18\x0e" } - - { key: F, mods: Shift|Alt, chars: "\x18\x09" } - - { key: E, mods: Alt, chars: "\x18\x09" } - - { key: N, mods: Alt, chars: "\x18\x6e" } - - { key: P, mods: Alt, chars: "\x18\x70" } - - { key: Slash, mods: Alt, chars: "\x18\x2f" } - - { key: F, mods: Alt, chars: "\x1b\x66" } - - { key: I, mods: Alt, chars: "\x18\x21" } - - { key: I, mods: Shift|Alt, chars: "\x18\x24" } diff --git a/.zshrc b/.zshrc index b2eca1b..e5339f8 100644 --- a/.zshrc +++ b/.zshrc @@ -42,7 +42,8 @@ alias '...'='cd ../../' function rr() { rustc "$@.rs" && ./"$@"} # [r]ust [r]un alias zshrc='nvim ~/.zshrc' # Idea from Chris -alias alacritty='nvim ~/.config/alacritty/alacritty.yml' +alias calacritty='nvim ~/.config/alacritty/alacritty.yml' +alias ctmux='nvim ~/.tmux.conf' alias g="grep" # [g]rep alias bra="bundle exec rubocop -A" # [b]undle exec [r]ubocop -[A] alias spec="be rspec" From 76249208517e5c029b2dbf57629fa4f249d94672 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 19:11:44 +0200 Subject: [PATCH 012/280] Update tmux config --- .config/nvim/lazy-lock.json | 5 +- .tmux.conf | 245 ++---------------------------------- 2 files changed, 14 insertions(+), 236 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 7f09192..6e585c5 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -7,6 +7,7 @@ "catppuccin": { "branch": "main", "commit": "02bdd749931a5d739063562e57531c118e081882" }, "cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, @@ -14,13 +15,13 @@ "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "crates.nvim": { "branch": "main", "commit": "e8fa8ec62ded43c3b06bca7ef36be26b924681bb" }, - "dashboard-nvim": { "branch": "master", "commit": "681300934baf36f6184ca41f0b26aed22056d4ee" }, "dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" }, "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, "gitsigns.nvim": { "branch": "main", "commit": "1a50b94066def8591d5f65bd60a4233902e9def4" }, + "gruvbox.nvim": { "branch": "main", "commit": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f" }, "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, @@ -80,7 +81,7 @@ "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, "tokyonight.nvim": { "branch": "main", "commit": "9bf9ec53d5e87b025e2404069b71e7ebdc3a13e5" }, "train.nvim": { "branch": "master", "commit": "87a45f805497e7e929702c75187704de8990de14" }, - "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, + "typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" }, "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, "vim-bundler": { "branch": "master", "commit": "c261509e78fc8dc55ad1fcf3cd7cdde49f35435c" }, "vim-dispatch": { "branch": "master", "commit": "4c695bc052cad2ae6b980aebbe48d046466e27ae" }, diff --git a/.tmux.conf b/.tmux.conf index 5544e08..b11687a 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,241 +1,18 @@ -# INSTALL -# cp tmuxconf ~/.tmux.conf -# -# Set prefix key to c-f instead of default c-b unbind C-b -set -g prefix C-f -bind C-f send-prefix +set -g prefix C-a +bind a send-prefix -set-option -g default-shell /bin/zsh +bind - split-window -v +unbind '"' +unbind % +bind | split-window -h -# toogle last window by hitting again C-f -bind-key C-f last-window - -# if multiple clients are attached to the same window, maximize it to the -# bigger one -set-window-option -g aggressive-resize - -# Start windows and pane numbering with index 1 instead of 0 -set -g base-index 1 -setw -g pane-base-index 1 - -# re-number windows when one is closed -set -g renumber-windows on - -# word separators for automatic word selection -setw -g word-separators ' @"=()[]_-:,.' -setw -ag word-separators "'" - -# Show times longer than supposed -set -g display-panes-time 2000 - -# tmux messages are displayed for 4 seconds -set -g display-time 4000 - -# {n}vim compability -set -g default-terminal "screen-256color" - -# Split horiziontal and vertical splits, instead of % and " -# Also open them in the same directory -bind-key v split-window -h -c '#{pane_current_path}' -bind-key s split-window -v -c '#{pane_current_path}' - -# Pressing Ctrl+Shift+Left (will move the current window to the left. Similarly -# right. No need to use the modifier (C-b). -bind-key -n C-S-Left swap-window -t -1 -bind-key -n C-S-Right swap-window -t +1 - -# Source file -unbind r -bind r source-file ~/.tmux.conf \; display "Reloaded!" - -# Use vim keybindings in copy mode -setw -g mode-keys vi - -# Update default binding of `Enter` and `Space to also use copy-pipe -unbind -T copy-mode-vi Enter -unbind -T copy-mode-vi Space - -bind-key -T edit-mode-vi Up send-keys -X history-up -bind-key -T edit-mode-vi Down send-keys -X history-down - -# setup 'v' to begin selection as in Vim -bind-key -T copy-mode-vi 'v' send-keys -X begin-selection - -# copy text with `y` in copy mode -# bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel\; run "tmux save -|pbcopy >/dev/null 2>&1" -bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel - -# copy text with mouse selection without pressing any key -bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel\; run "tmux save -|pbcopy >/dev/null 2>&1" -# bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel - -# emacs key bindings in tmux command prompt (prefix + :) are better than -# vi keys, even for vim users -set -g status-keys emacs - -# focus events enabled for terminals that support them -set -g focus-events on - -# Sync panes (Send input to all panes in the window). When enabled, pane -# borders become red as an indication. -bind C-s if -F '#{pane_synchronized}' \ - 'setw synchronize-panes off; \ - setw pane-active-border-style fg=colour63,bg=default; \ - setw pane-border-format " #P "' \ - 'setw synchronize-panes on; \ - setw pane-active-border-style fg=red; \ - setw pane-border-format " #P - Pane Synchronization ON "' - -# Faster command sequence -set -s escape-time 0 - -# Have a very large history -set -g history-limit 1000000 - -# Mouse mode on -set -g terminal-overrides 'xterm*:smcup@:rmcup@' -set -g mouse on - -# Set title -set -g set-titles on -set -g set-titles-string "#T" - -# Equally resize all panes -bind-key = select-layout even-horizontal -bind-key | select-layout even-vertical - -# Resize panes -bind-key J resize-pane -D 10 -bind-key K resize-pane -U 10 -bind-key H resize-pane -L 10 -bind-key L resize-pane -R 10 - -# Select panes -# NOTE(arslan): See to prevent cycling https://github.com/tmux/tmux/issues/1158 -bind-key j select-pane -D -bind-key k select-pane -U -bind-key h select-pane -L -bind-key l select-pane -R - -# Disable confirm before killing -bind-key x kill-pane - -# This tmux statusbar config was created by tmuxline.vim -# on Wed, 25 Nov 2015 -set -g status "on" -set -g status-bg "colour236" -set -g status-justify "left" -set -g status-position "top" -set -g status-left-length "100" -set -g status-right-length "100" -set -g status-left "#{prefix_highlight}#[fg=colour22,bg=colour148,bold] #S #[fg=colour148,bg=colour236,nobold,nounderscore,noitalics]" -set -g status-right "#[fg=colour240,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour250,bg=colour240] %Y-%m-%d %H:%M #[fg=colour252,bg=colour240,nobold,nounderscore,noitalics]#[fg=colour241,bg=colour252] #h " - -setw -g window-status-separator "" -setw -g window-status-format "#[fg=colour245,bg=colour236] #I #[fg=colour245,bg=colour236]#W " -setw -g window-status-current-format "#[fg=colour236,bg=colour240,nobold,nounderscore,noitalics]#[fg=colour231,bg=colour240] #I #[fg=colour231,bg=colour240]#{?window_zoomed_flag,#[fg=green][],}#W #[fg=colour240,bg=colour236,nobold,nounderscore,noitalics]" +setw -g mouse on # List of plugins -# see this https://github.com/tmux-plugins/tpm to installation set -g @plugin 'tmux-plugins/tpm' -set -g @plugin 'tmux-plugins/tmux-open' -set -g @plugin 'tmux-plugins/tmux-yank' -set -g @plugin 'tmux-plugins/tmux-prefix-highlight' - -# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) -run -b '~/.tmux/plugins/tpm/tpm' - - -# The followings are not any kind of setting for Tmux, but crucial to my -# own productivity. Setting them up is really pain, and I probably going to -# forget it. So I'm just putting them here again. - -######## iTerm + Tmux key integration ######### -# First of all, iTerm can send hex codes for shortcuts you define. So for -# example you can send a hex code for the shortcut "c-f v" which in my case -# opens a vertical pane (see setting above). The hex code for this combination -# is: 0x06 0x76. There are many cases to find it out. One of them is the tool -# 'xxd' - -# If you run "xxd -psd" and hit "c-f v" and then enter and finally c-c to exit -# , it outputs the following: -# -# $ xxd -psd -# ^Fv -# 06760a^C -# -# What matters is the sequence 06760a^C where: -# -# 06 -> c-f -# 76 -> v -# 0a -> return -# ^C -> c-c -# -# From here, we know that 0x06 0x76 corresponds to "c-f v". -# -# Finally, inside the iTerm2 Key settings, I'm adding just various shortcuts, -# such as cmd-j, cmd-left, etc.. , select the option "send hex code" and the -# enter the hex code which I want to be executed, hence the tmux sequence. So -# when I press CMD + d in iterm, I send the sequence 0x06 0x76, -# which tmux inteprets it as opening a new pane. -############################################### - -######## Alacritty + Tmux key integration ######### -# First of all, Alacritty can send hex codes for shortcuts you define. So for -# example you can send a hex code for the shortcut "c-f v" which in my case -# opens a vertical pane (see setting above). The hex code for this combination -# is: 0x06 0x76. There are many cases to find it out. One of them is the tool -# 'xxd' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'wfxr/tmux-power' +set -g @tmux_power_theme 'gold' -# If you run "xxd -psd" and hit "c-f v" and then enter and finally c-c to exit -# , it outputs the following: -# -# $ xxd -psd -# ^Fv -# 06760a^C -# -# What matters is the sequence 06760a^C where: -# -# 06 -> c-f -# 76 -> v -# 0a -> return -# ^C -> c-c -# -# From here, we know that 0x06 0x76 corresponds to "c-f v". -# -# Next step is to add a line to 'key_binding' setting in Alacritty: -# -# - { key: D, mods: Command, chars: "\x06\x76" } -# -# That's it! The followings are the ones that I'm using: -# -# key_bindings: -# - { key: D, mods: Command, chars: "\x06\x76" } -# - { key: D, mods: Command|Shift, chars: "\x06\x73" } -# - { key: W, mods: Command, chars: "\x06\x78" } -# - { key: H, mods: Command, chars: "\x06\x68" } -# - { key: J, mods: Command, chars: "\x06\x6a" } -# - { key: K, mods: Command, chars: "\x06\x6b" } -# - { key: L, mods: Command, chars: "\x06\x6c" } -# - { key: T, mods: Command, chars: "\x06\x63" } -# - { key: Key1, mods: Command, chars: "\x06\x31" } -# - { key: Key2, mods: Command, chars: "\x06\x32" } -# - { key: Key3, mods: Command, chars: "\x06\x33" } -# - { key: Key4, mods: Command, chars: "\x06\x34" } -# - { key: Key5, mods: Command, chars: "\x06\x35" } -# - { key: Key6, mods: Command, chars: "\x06\x36" } -# - { key: Key7, mods: Command, chars: "\x06\x37" } -# - { key: Key8, mods: Command, chars: "\x06\x38" } -# - { key: Key9, mods: Command, chars: "\x06\x39" } -# - { key: Left, mods: Command, chars: "\x06\x48" } -# - { key: Down, mods: Command, chars: "\x06\x4a" } -# - { key: Up, mods: Command, chars: "\x06\x4b" } -# - { key: Right, mods: Command, chars: "\x06\x4c" } -# -# Finally, inside the iTerm2 Key settings, I'm adding just various shortcuts, -# such as cmd-j, cmd-left, etc.. , select the option "send hex code" and the -# enter the hex code which I want to be executed, hence the tmux sequence. So -# when I press CMD + d in iterm, I send the sequence 0x06 0x76, -# which tmux inteprets it as opening a new pane. -############################################### +run '~/.tmux/plugins/tpm/tpm' From 1514125ecdb126dc1f16efb6e33384341375bf36 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 19:11:54 +0200 Subject: [PATCH 013/280] Update notify --- .config/nvim/lua/plugins/notify.lua | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .config/nvim/lua/plugins/notify.lua diff --git a/.config/nvim/lua/plugins/notify.lua b/.config/nvim/lua/plugins/notify.lua new file mode 100644 index 0000000..015b0f8 --- /dev/null +++ b/.config/nvim/lua/plugins/notify.lua @@ -0,0 +1,8 @@ +return { + "rcarriga/nvim-notify", + opts = { + level = 3, + render = "minimal", + stages = "static", + }, +} From 999d0a92211a723242685eb4494ba64a52e3e260 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 19:12:00 +0200 Subject: [PATCH 014/280] Update bufferline --- .config/nvim/lua/plugins/bufferline.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/bufferline.lua b/.config/nvim/lua/plugins/bufferline.lua index f303f31..0ebfcf8 100644 --- a/.config/nvim/lua/plugins/bufferline.lua +++ b/.config/nvim/lua/plugins/bufferline.lua @@ -3,8 +3,10 @@ return { "akinsho/bufferline.nvim", config = { options = { - separator_style = "slope", - always_show_bufferline = true, + separator_style = "thin", + always_show_bufferline = false, + color_icons = false, + show_buffer_icons = false, groups = { items = { require("bufferline.groups").builtin.pinned:with({ icon = "🔥" }), From 129259c0a711de6e44ea03bb6cba69273abe85e1 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 19:19:47 +0200 Subject: [PATCH 015/280] Fix color scheme --- .config/alacritty/alacritty.yml | 3 +++ .tmux.conf | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 3f8b150..65f1f17 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -94,6 +94,9 @@ colors: - { index: 16, color: "#9c715a" } - { index: 17, color: "#F4DBD6" } +env: + TERM: xterm-256color + shell: program: /bin/zsh args: diff --git a/.tmux.conf b/.tmux.conf index b11687a..b22d7a2 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -9,6 +9,9 @@ bind | split-window -h setw -g mouse on +set -g default-terminal "screen-256color" +set -ag terminal-overrides ",xterm-256color:RGB" + # List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' From bd6a4370728738de6a616bc7d0db2129370e7cfe Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 13 Apr 2024 19:53:44 +0200 Subject: [PATCH 016/280] Update tmux --- .tmux.conf | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index b22d7a2..2a646e0 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -7,15 +7,28 @@ unbind '"' unbind % bind | split-window -h -setw -g mouse on +bind r source-file ~/.tmux.conf \; display-message "Config reloaded" +set -g mouse on set -g default-terminal "screen-256color" set -ag terminal-overrides ",xterm-256color:RGB" +set-option -g status-position top # List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' + +# Not working :/ +# set -g @plugin 'b0o/tmux-autoreload' +# set -g @tmux-autoreload-entrypoints '~/.tmux.conf' + +# Powertab +# set -g @plugin 'jabirali/tmux-powertab' +# set -g @powertab-pathname on +# set -g @powertab-foreground '#1d1d1d' + +# Power set -g @plugin 'wfxr/tmux-power' -set -g @tmux_power_theme 'gold' +set -g @tmux_power_theme '#999999' run '~/.tmux/plugins/tpm/tpm' From 19a9de5d5d3a38fa376684f5c4ede0c301f9b67c Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 14 Apr 2024 00:55:21 +0200 Subject: [PATCH 017/280] Update tmux configuration --- .tmux.conf | 16 ++++++++++++++-- my-status-bar.tmux | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100755 my-status-bar.tmux diff --git a/.tmux.conf b/.tmux.conf index 2a646e0..9606814 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -7,16 +7,27 @@ unbind '"' unbind % bind | split-window -h +setw -g mode-keys vi +bind-key h select-pane -L +bind-key j select-pane -D +bind-key k select-pane -U +bind-key l select-pane -R + bind r source-file ~/.tmux.conf \; display-message "Config reloaded" set -g mouse on set -g default-terminal "screen-256color" set -ag terminal-overrides ",xterm-256color:RGB" set-option -g status-position top +set -g pane-border-lines "heavy" +set -g pane-border-indicators "arrows +set -g base-index 0 # List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' +run-shell "~/my-status-bar.tmux" +# set -g @plugin 'erikw/tmux-powerline' # Not working :/ # set -g @plugin 'b0o/tmux-autoreload' @@ -24,11 +35,12 @@ set -g @plugin 'tmux-plugins/tmux-sensible' # Powertab # set -g @plugin 'jabirali/tmux-powertab' +# set -g @powertab-powerline 'on' # set -g @powertab-pathname on # set -g @powertab-foreground '#1d1d1d' # Power -set -g @plugin 'wfxr/tmux-power' -set -g @tmux_power_theme '#999999' +# set -g @plugin 'wfxr/tmux-power' +# set -g @tmux_power_theme '#999999' run '~/.tmux/plugins/tpm/tpm' diff --git a/my-status-bar.tmux b/my-status-bar.tmux new file mode 100755 index 0000000..0cd890a --- /dev/null +++ b/my-status-bar.tmux @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +#=============================================================================== +# Author: CuddlyBunion341 +# Created: 2024-04-13 22:25 +#=============================================================================== + +tmux_get() { + local value="$(tmux show -gqv "$1")" + [ -n "$value" ] && echo "$value" || echo "$2" +} + +tmux_set() { + tmux set-option -gq "$1" "$2" +} + +color1="#000000" +color2="green" + +primary="#[fg=$color1,bg=$color2]" +secondary="#[fg=$color2,bg=$color1]" +tertiary="#[fg=orange,bg=$color1]" +background="#[fg=$color2,bg=$color1]" + +title="#W:#I" +tmux_set status-fg "$color2" +tmux_set status-bg "$color1" +# tmux_set window-status-format "$secondary""$primary$title""$secondary""" +# tmux_set window-status-format "$secondary"" $primary$title""$secondary""" +tmux_set window-status-current-format "$secondary""$primary $title ""$secondary""" +tmux_set window-status-format " $title " +tmux_set window-status-separator " " +#    +# Window status style +# tmux_set window-status-style "fg=$tertiary,bg=$primary,none" +# tmux_set window-status-last-style "fg=$tertiary,bg=$primary,bold" +# tmux_set window-status-activity-style "fg=$tertiary,bg=$primary,bold" From 8c789fa3aec22363dc2f1f1f998bb7b058e709ce Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 14 Apr 2024 00:55:42 +0200 Subject: [PATCH 018/280] Change nvim colorscheme --- .config/nvim/lazy-lock.json | 9 +++++---- .config/nvim/lua/plugins/example.lua | 24 +++++++++++++++++++++++- .config/nvim/lua/plugins/tokyonight.lua | 12 ++++++++++++ 3 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 .config/nvim/lua/plugins/tokyonight.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 6e585c5..d44ff31 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -7,7 +7,6 @@ "catppuccin": { "branch": "main", "commit": "02bdd749931a5d739063562e57531c118e081882" }, "cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, @@ -15,13 +14,14 @@ "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "crates.nvim": { "branch": "main", "commit": "e8fa8ec62ded43c3b06bca7ef36be26b924681bb" }, + "dashboard-nvim": { "branch": "master", "commit": "681300934baf36f6184ca41f0b26aed22056d4ee" }, "dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" }, "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, + "edgy.nvim": { "branch": "main", "commit": "de79b7d92a5979cd71a9a1d8b6282515345e5055" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, "gitsigns.nvim": { "branch": "main", "commit": "1a50b94066def8591d5f65bd60a4233902e9def4" }, - "gruvbox.nvim": { "branch": "main", "commit": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f" }, "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, @@ -37,7 +37,6 @@ "mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" }, "mini.starter": { "branch": "main", "commit": "a9497931da60bbf04180077ee452ccf3e57af9bd" }, "mini.surround": { "branch": "main", "commit": "49e0364b8c9a3258b485c5ece40bb0f3a5e94b1c" }, - "multiple-cursors.nvim": { "branch": "main", "commit": "ca966b288d4fda046d38a213b628cf5edb452a82" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "16d1b194376bf1fc2acd89ccb3c29ba8315bfcea" }, "neoconf.nvim": { "branch": "main", "commit": "7b989fb3a180ec79b78a183d10e417b2fdeb3c05" }, "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, @@ -48,6 +47,7 @@ "noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" }, "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, "nvim-emmet": { "branch": "main", "commit": "928cfb74ed436d6d326ccab2061cf3592de1bf55" }, "nvim-i18n-tools": { "branch": "master", "commit": "ab2f883e3d8e4abb90f3882aacdfd34067cafc24" }, "nvim-lint": { "branch": "master", "commit": "3317b73ec3eb76cd8ca83e05880c07c83e368c1e" }, @@ -81,10 +81,11 @@ "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, "tokyonight.nvim": { "branch": "main", "commit": "9bf9ec53d5e87b025e2404069b71e7ebdc3a13e5" }, "train.nvim": { "branch": "master", "commit": "87a45f805497e7e929702c75187704de8990de14" }, - "typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" }, + "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, "vim-bundler": { "branch": "master", "commit": "c261509e78fc8dc55ad1fcf3cd7cdde49f35435c" }, "vim-dispatch": { "branch": "master", "commit": "4c695bc052cad2ae6b980aebbe48d046466e27ae" }, + "vim-distinguished": { "branch": "develop", "commit": "62b360dc81355b53d124cd06218a9ba2496563fc" }, "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, "vim-localorie": { "branch": "master", "commit": "9d4c7fc72c85c53668cde26b84845b28ad1c9945" }, diff --git a/.config/nvim/lua/plugins/example.lua b/.config/nvim/lua/plugins/example.lua index d2f406f..491022a 100644 --- a/.config/nvim/lua/plugins/example.lua +++ b/.config/nvim/lua/plugins/example.lua @@ -1,6 +1,28 @@ -- since this is just an example spec, don't actually load anything here and return an empty spec -- stylua: ignore -if true then return {} end +vim.g.lazygit_floating_window_winblend = 0 +if true then + return { + { "Lokaltog/vim-distinguished" }, + { + "LazyVim/LazyVim", + opts = { + transparent = true, + colorscheme = "tokyonight", + }, + }, + { + "wk13eagle/telescope.nvim", + opts = { + pickers = { + colorscheme = { + enable_preview = true, + }, + }, + }, + }, + } +end -- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim -- diff --git a/.config/nvim/lua/plugins/tokyonight.lua b/.config/nvim/lua/plugins/tokyonight.lua new file mode 100644 index 0000000..c933040 --- /dev/null +++ b/.config/nvim/lua/plugins/tokyonight.lua @@ -0,0 +1,12 @@ +return { + { + "folke/tokyonight.nvim", + opts = { + transparent = true, + styles = { + sidebars = "transparent", + floats = "transparent", + }, + }, + }, +} From 2e9c00856ddd348443002649fb410d10c3d36b0c Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 14 Apr 2024 01:13:18 +0200 Subject: [PATCH 019/280] Update nvim --- .config/nvim/lazy-lock.json | 2 +- .config/nvim/lazyvim.json | 1 + .config/nvim/lua/plugins/bufferline.lua | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index d44ff31..a76cff8 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -17,11 +17,11 @@ "dashboard-nvim": { "branch": "master", "commit": "681300934baf36f6184ca41f0b26aed22056d4ee" }, "dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" }, "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, - "edgy.nvim": { "branch": "main", "commit": "de79b7d92a5979cd71a9a1d8b6282515345e5055" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, "gitsigns.nvim": { "branch": "main", "commit": "1a50b94066def8591d5f65bd60a4233902e9def4" }, + "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, diff --git a/.config/nvim/lazyvim.json b/.config/nvim/lazyvim.json index 48cb907..1191ff8 100644 --- a/.config/nvim/lazyvim.json +++ b/.config/nvim/lazyvim.json @@ -3,6 +3,7 @@ "lazyvim.plugins.extras.coding.copilot", "lazyvim.plugins.extras.coding.yanky", "lazyvim.plugins.extras.editor.dial", + "lazyvim.plugins.extras.editor.harpoon2", "lazyvim.plugins.extras.lang.json", "lazyvim.plugins.extras.lang.markdown", "lazyvim.plugins.extras.lang.ruby", diff --git a/.config/nvim/lua/plugins/bufferline.lua b/.config/nvim/lua/plugins/bufferline.lua index 0ebfcf8..1deccc7 100644 --- a/.config/nvim/lua/plugins/bufferline.lua +++ b/.config/nvim/lua/plugins/bufferline.lua @@ -9,7 +9,7 @@ return { show_buffer_icons = false, groups = { items = { - require("bufferline.groups").builtin.pinned:with({ icon = "🔥" }), + require("bufferline.groups").builtin.pinned:with({ icon = "" }), }, }, }, From 94369029fd38da76594eb3413aa42f1f918c3534 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 14 Apr 2024 01:13:56 +0200 Subject: [PATCH 020/280] Update alacritty --- .config/alacritty/alacritty.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 65f1f17..9943bf4 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -9,15 +9,15 @@ window: dynamic_title: true decorations_theme_variant: None decorations: buttonless + dynamic_padding: false padding: - x: 5 - y: 5 + x: 0 + y: 0 colors: # Default colors primary: - padding_color: "#00FF00" - background: "#24273A" # base + background: "#000000" # base foreground: "#CAD3F5" # text # Bright and dim foreground colors dim_foreground: "#CAD3F5" # text From 9042a028e7be808ab6c616ae64a28adacc2b6b4b Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 14 Apr 2024 10:13:33 +0200 Subject: [PATCH 021/280] Add cheatsheet nvim --- .config/nvim/lazy-lock.json | 2 ++ .config/nvim/lua/plugins/cheatsheet.lua | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 .config/nvim/lua/plugins/cheatsheet.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index a76cff8..2f1f2f1 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -6,6 +6,7 @@ "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, "catppuccin": { "branch": "main", "commit": "02bdd749931a5d739063562e57531c118e081882" }, "cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" }, + "cheatsheet.nvim": { "branch": "master", "commit": "9716f9aaa94dd1fd6ce59b5aae0e5f25e2a463ef" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, @@ -68,6 +69,7 @@ "other.nvim": { "branch": "main", "commit": "301671214246963cd6b398c177e130cff81451d9" }, "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, + "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" }, "rest.nvim": { "branch": "main", "commit": "3fc2bb8b927a5001069ea5a53a93d47656823f14" }, "ror.nvim": { "branch": "main", "commit": "9d31ad3953be83ac8dd542725ca4881c861f64a5" }, diff --git a/.config/nvim/lua/plugins/cheatsheet.lua b/.config/nvim/lua/plugins/cheatsheet.lua new file mode 100644 index 0000000..9da104c --- /dev/null +++ b/.config/nvim/lua/plugins/cheatsheet.lua @@ -0,0 +1,9 @@ +return { + "sudormrfbin/cheatsheet.nvim", + + dependencies = { + { "nvim-telescope/telescope.nvim" }, + { "nvim-lua/popup.nvim" }, + { "nvim-lua/plenary.nvim" }, + }, +} From 99fa3351c0b0ab25ba1cdf784803651f71a12bc3 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 14 Apr 2024 10:14:35 +0200 Subject: [PATCH 022/280] Update tmux config --- .tmux.conf | 12 ++++++++++-- my-status-bar.tmux | 20 +++++++++++++++----- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 9606814..665e8bf 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -13,19 +13,27 @@ bind-key j select-pane -D bind-key k select-pane -U bind-key l select-pane -R -bind r source-file ~/.tmux.conf \; display-message "Config reloaded" +bind r source-file ~/.tmux.conf; set -g mouse on set -g default-terminal "screen-256color" set -ag terminal-overrides ",xterm-256color:RGB" set-option -g status-position top set -g pane-border-lines "heavy" -set -g pane-border-indicators "arrows +set -s escape-time 0 set -g base-index 0 +set -g pane-active-border-style "bg=#000000,fg=white" +set -g pane-border-style "bg=#000000,fg=white" + +set -g focus-events on +set-hook -g pane-focus-out 'select-pane -P bg=colour235,fg=colour10' +set-hook -g pane-focus-in 'select-pane -P bg=default,fg=default' # List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-prefix-highlight' + run-shell "~/my-status-bar.tmux" # set -g @plugin 'erikw/tmux-powerline' diff --git a/my-status-bar.tmux b/my-status-bar.tmux index 0cd890a..125ee76 100755 --- a/my-status-bar.tmux +++ b/my-status-bar.tmux @@ -14,11 +14,11 @@ tmux_set() { } color1="#000000" -color2="green" +color2="white" -primary="#[fg=$color1,bg=$color2]" secondary="#[fg=$color2,bg=$color1]" tertiary="#[fg=orange,bg=$color1]" +primary="#[fg=$color1,bg=$color2]" background="#[fg=$color2,bg=$color1]" title="#W:#I" @@ -26,11 +26,21 @@ tmux_set status-fg "$color2" tmux_set status-bg "$color1" # tmux_set window-status-format "$secondary""$primary$title""$secondary""" # tmux_set window-status-format "$secondary"" $primary$title""$secondary""" -tmux_set window-status-current-format "$secondary""$primary $title ""$secondary""" -tmux_set window-status-format " $title " -tmux_set window-status-separator " " +# tmux_set window-status-current-format "$secondary""$primary $title ""$secondary""" +tmux_set window-status-current-format "#[underscore]$title" +tmux_set window-status-format "$title" +tmux_set window-status-separator " | " #    +cmd="#[fg=orange]#{pane_current_command}" +path="#(echo #{pane_current_path} | sed 's#$HOME#~#g')" +ruby_version=$(ruby -v | awk '{print $2}') +ruby="#[fg=red] $ruby_version" + +tmux_set status-left " #H [#S] " +tmux_set status-right "#{prefix_highlight} $cmd $path $ruby" # Window status style # tmux_set window-status-style "fg=$tertiary,bg=$primary,none" # tmux_set window-status-last-style "fg=$tertiary,bg=$primary,bold" # tmux_set window-status-activity-style "fg=$tertiary,bg=$primary,bold" +tmux_set status-right-length 200 +tmux_set status-left-length 200 From 0c99cfb80eb5cd2a1947106374da49738f09d697 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 14 Apr 2024 10:35:03 +0200 Subject: [PATCH 023/280] Enable tmux auto resize --- .tmux.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.tmux.conf b/.tmux.conf index 665e8bf..91f17e1 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -12,9 +12,15 @@ bind-key h select-pane -L bind-key j select-pane -D bind-key k select-pane -U bind-key l select-pane -R +set -g window-size latest +setw -g aggressive-resize on bind r source-file ~/.tmux.conf; +set-hook -g after-kill-pane 'select-layout -E' +set-hook -g pane-exited 'select-layout -E' +set-hook -g window-pane-changed 'select-layout -E' + set -g mouse on set -g default-terminal "screen-256color" set -ag terminal-overrides ",xterm-256color:RGB" From eb265147790900f67b323ac9d48dc700a7b18f57 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 14 Apr 2024 20:38:36 +0200 Subject: [PATCH 024/280] Add new window binding --- .config/alacritty/alacritty.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 9943bf4..720ebff 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -102,10 +102,11 @@ shell: args: - -l - -c - - "tmux attach || tmux" + - 'session_name=$(tmux ls | grep -v ''(attached)'' | head -1 | cut -d: -f1); [ -n "$session_name" ] && tmux attach -t "$session_name" || tmux new-session' # To get keybinding, just run: xxd -psd key_bindings: + - { key: N, mods: Command, action: SpawnNewInstance } - { key: Home, chars: "\x1bOH", mode: AppCursor } - { key: Home, chars: "\x1b[H", mode: ~AppCursor } - { key: End, chars: "\x1bOF", mode: AppCursor } From 0c17194f93da5dd775fe4582d97d140b4f33f43f Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 14 Apr 2024 22:13:14 +0200 Subject: [PATCH 025/280] Add lspimport nvim plugin --- .config/nvim/lua/plugins/lspimport.lua | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .config/nvim/lua/plugins/lspimport.lua diff --git a/.config/nvim/lua/plugins/lspimport.lua b/.config/nvim/lua/plugins/lspimport.lua new file mode 100644 index 0000000..bf46c73 --- /dev/null +++ b/.config/nvim/lua/plugins/lspimport.lua @@ -0,0 +1,3 @@ +return { + { "stevanmilic/nvim-lspimport" }, +} From 72b183f9ffce3290bd8c04104a1987e940a72c87 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 15 Apr 2024 20:35:34 +0200 Subject: [PATCH 026/280] Refactor lazyvim config --- .config/nvim/init.lua | 46 --- .config/nvim/lazy-lock.json | 6 +- .config/nvim/lazyvim.json | 1 - .config/nvim/lua/config/lazy.lua | 3 +- .config/nvim/lua/plugins/barbecue.lua | 12 - .config/nvim/lua/plugins/bufferline.lua | 18 -- .config/nvim/lua/plugins/bundler.lua | 3 - .../nvim/lua/plugins/cellular-automaton.lua | 9 - .config/nvim/lua/plugins/cheatsheet.lua | 9 - .config/nvim/lua/plugins/endwise.lua | 13 - .config/nvim/lua/plugins/essential.lua | 65 +++++ .config/nvim/lua/plugins/example.lua | 267 ------------------ .config/nvim/lua/plugins/fun.lua | 20 ++ .config/nvim/lua/plugins/git-time-lapse.lua | 6 - .config/nvim/lua/plugins/git.lua | 26 ++ .config/nvim/lua/plugins/help.lua | 11 + .config/nvim/lua/plugins/lspimport.lua | 3 - .config/nvim/lua/plugins/multiple-cursors.lua | 15 - .config/nvim/lua/plugins/notify.lua | 8 - .config/nvim/lua/plugins/nvim-emmet.lua | 6 - .config/nvim/lua/plugins/nvim-surround.lua | 10 - .config/nvim/lua/plugins/nvim_tools.lua | 6 - .config/nvim/lua/plugins/octo.lua | 14 - .config/nvim/lua/plugins/other.lua | 75 ++--- .config/nvim/lua/plugins/rails.lua | 165 +++++++++++ .config/nvim/lua/plugins/refactoring.lua | 17 -- .config/nvim/lua/plugins/repeat.lua | 3 - .config/nvim/lua/plugins/rest.lua | 16 -- .config/nvim/lua/plugins/ror.lua | 10 - .config/nvim/lua/plugins/solargraph.lua | 23 -- .config/nvim/lua/plugins/speedtyper.lua | 7 - .config/nvim/lua/plugins/test.lua | 58 ---- .config/nvim/lua/plugins/text_case.lua | 24 -- .config/nvim/lua/plugins/themes.lua | 32 +++ .config/nvim/lua/plugins/tokyonight.lua | 12 - .config/nvim/lua/plugins/train.lua | 3 - .config/nvim/lua/plugins/treesitter.lua | 28 -- .../lua/plugins/{mini-starter.lua => ui.lua} | 50 ++++ .config/nvim/lua/plugins/vim-be-good.lua | 5 - .config/nvim/lua/plugins/vim-dispatch.lua | 3 - .config/nvim/lua/plugins/vim-fugitive.lua | 6 - .config/nvim/lua/plugins/vim-localoire.lua | 5 - .config/nvim/lua/plugins/vim-rails.lua | 3 - 43 files changed, 400 insertions(+), 722 deletions(-) delete mode 100644 .config/nvim/lua/plugins/barbecue.lua delete mode 100644 .config/nvim/lua/plugins/bufferline.lua delete mode 100644 .config/nvim/lua/plugins/bundler.lua delete mode 100644 .config/nvim/lua/plugins/cellular-automaton.lua delete mode 100644 .config/nvim/lua/plugins/cheatsheet.lua delete mode 100644 .config/nvim/lua/plugins/endwise.lua create mode 100644 .config/nvim/lua/plugins/essential.lua delete mode 100644 .config/nvim/lua/plugins/example.lua create mode 100644 .config/nvim/lua/plugins/fun.lua delete mode 100644 .config/nvim/lua/plugins/git-time-lapse.lua create mode 100644 .config/nvim/lua/plugins/git.lua create mode 100644 .config/nvim/lua/plugins/help.lua delete mode 100644 .config/nvim/lua/plugins/lspimport.lua delete mode 100644 .config/nvim/lua/plugins/multiple-cursors.lua delete mode 100644 .config/nvim/lua/plugins/notify.lua delete mode 100644 .config/nvim/lua/plugins/nvim-emmet.lua delete mode 100644 .config/nvim/lua/plugins/nvim-surround.lua delete mode 100644 .config/nvim/lua/plugins/nvim_tools.lua delete mode 100644 .config/nvim/lua/plugins/octo.lua create mode 100644 .config/nvim/lua/plugins/rails.lua delete mode 100644 .config/nvim/lua/plugins/refactoring.lua delete mode 100644 .config/nvim/lua/plugins/repeat.lua delete mode 100644 .config/nvim/lua/plugins/rest.lua delete mode 100644 .config/nvim/lua/plugins/ror.lua delete mode 100644 .config/nvim/lua/plugins/solargraph.lua delete mode 100644 .config/nvim/lua/plugins/speedtyper.lua delete mode 100644 .config/nvim/lua/plugins/test.lua delete mode 100644 .config/nvim/lua/plugins/text_case.lua create mode 100644 .config/nvim/lua/plugins/themes.lua delete mode 100644 .config/nvim/lua/plugins/tokyonight.lua delete mode 100644 .config/nvim/lua/plugins/train.lua delete mode 100644 .config/nvim/lua/plugins/treesitter.lua rename .config/nvim/lua/plugins/{mini-starter.lua => ui.lua} (79%) delete mode 100644 .config/nvim/lua/plugins/vim-be-good.lua delete mode 100644 .config/nvim/lua/plugins/vim-dispatch.lua delete mode 100644 .config/nvim/lua/plugins/vim-fugitive.lua delete mode 100644 .config/nvim/lua/plugins/vim-localoire.lua delete mode 100644 .config/nvim/lua/plugins/vim-rails.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 520d19a..ebd6419 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -4,49 +4,3 @@ require("config.lazy") vim.opt.title = true vim.opt.titlelen = 0 vim.opt.titlestring = 'nvim %{expand("%:p")}' - --- require("telescope").setup({ --- defaults = { --- vimgrep_arguments = { --- "rg", --- "--color=never", --- "--no-heading", --- "--with-filename", --- "--line-number", --- "--column", --- "--smart-case", --- }, --- prompt_position = "bottom", --- prompt_prefix = "> ", --- initial_mode = "insert", --- layout_strategy = "horizontal", --- layout_config = { --- horizontal = { --- mirror = false, --- }, --- vertical = { --- mirror = false, --- }, --- }, --- file_sorter = require("telescope.sorters").get_fuzzy_file, --- file_ignore_patterns = {}, --- generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, --- path_display = true, --- winblend = 0, --- selection_strategy = "reset", --- sorting_strategy = "descending", --- scroll_strategy = "cycle", --- color_devicons = true, --- use_less = true, --- set_env = { ["COLORTERM"] = "truecolor" }, --- }, --- }) --- --- -- nnoremap fr :exec("Telescope live_grep grep_string=" . system("bundle exec rails routes | awk 'NR>1{ print $2 }' | rg . | tr '\n' ' '")) --- the abve but in lua --- vim.keymap.nnoremap("yu", function() --- vim.cmd( --- "Telescope live_grep grep_string=" --- .. vim.fn.system("bundle exec rails routes | awk 'NR>1{ print $2 }' | rg . | tr '\n' ' '") --- ) --- end) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 2f1f2f1..5d86ee1 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -2,7 +2,6 @@ "LazyVim": { "branch": "main", "commit": "5646ee5191da244ff8ea57b9dba8a7e0d1dbdd42" }, "LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" }, "SchemaStore.nvim": { "branch": "main", "commit": "1cfa6871f0374b21e894aad646366e89a747107e" }, - "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, "catppuccin": { "branch": "main", "commit": "02bdd749931a5d739063562e57531c118e081882" }, "cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" }, @@ -15,7 +14,6 @@ "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "crates.nvim": { "branch": "main", "commit": "e8fa8ec62ded43c3b06bca7ef36be26b924681bb" }, - "dashboard-nvim": { "branch": "master", "commit": "681300934baf36f6184ca41f0b26aed22056d4ee" }, "dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" }, "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, @@ -24,6 +22,7 @@ "gitsigns.nvim": { "branch": "main", "commit": "1a50b94066def8591d5f65bd60a4233902e9def4" }, "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, + "impatient.nvim": { "branch": "main", "commit": "47302af74be7b79f002773011f0d8e85679a7618" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, @@ -41,6 +40,7 @@ "neo-tree.nvim": { "branch": "v3.x", "commit": "16d1b194376bf1fc2acd89ccb3c29ba8315bfcea" }, "neoconf.nvim": { "branch": "main", "commit": "7b989fb3a180ec79b78a183d10e417b2fdeb3c05" }, "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, + "neoi18n": { "branch": "master", "commit": "87c645dadb195a65d6ee5a5e3513f259f4fb436b" }, "neotest": { "branch": "master", "commit": "f03a78cef74db5638e4312e18b767294a90de8da" }, "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, "neotest-rspec": { "branch": "main", "commit": "c1c3f36e1b1a23698534e6326e90876f87b773a4" }, @@ -53,7 +53,7 @@ "nvim-i18n-tools": { "branch": "master", "commit": "ab2f883e3d8e4abb90f3882aacdfd34067cafc24" }, "nvim-lint": { "branch": "master", "commit": "3317b73ec3eb76cd8ca83e05880c07c83e368c1e" }, "nvim-lspconfig": { "branch": "master", "commit": "e25c4cdecd3d58c0deccce0f372426c8c480bcce" }, - "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, + "nvim-lspimport": { "branch": "main", "commit": "9c1c61a5020faeb1863bb66eb4b2a9107e641876" }, "nvim-nio": { "branch": "master", "commit": "5800f585def265d52f1d8848133217c800bcb25d" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, "nvim-spectre": { "branch": "master", "commit": "2b012554a2536465243c0dff3605b5927c49ed23" }, diff --git a/.config/nvim/lazyvim.json b/.config/nvim/lazyvim.json index 1191ff8..66dee23 100644 --- a/.config/nvim/lazyvim.json +++ b/.config/nvim/lazyvim.json @@ -7,7 +7,6 @@ "lazyvim.plugins.extras.lang.json", "lazyvim.plugins.extras.lang.markdown", "lazyvim.plugins.extras.lang.ruby", - "lazyvim.plugins.extras.lang.rust", "lazyvim.plugins.extras.lang.tailwind", "lazyvim.plugins.extras.lang.tex", "lazyvim.plugins.extras.lang.typescript", diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua index 5e87e60..8cfd3a2 100644 --- a/.config/nvim/lua/config/lazy.lua +++ b/.config/nvim/lua/config/lazy.lua @@ -18,11 +18,12 @@ require("lazy").setup({ -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, -- import/override with your plugins { import = "plugins" }, + { "nvimdev/dashboard-nvim", enabled = false }, }, defaults = { -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. - lazy = false, + lazy = true, -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, -- have outdated releases, which may break your Neovim install. version = false, -- always use the latest git commit diff --git a/.config/nvim/lua/plugins/barbecue.lua b/.config/nvim/lua/plugins/barbecue.lua deleted file mode 100644 index 9fbbec3..0000000 --- a/.config/nvim/lua/plugins/barbecue.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - "utilyre/barbecue.nvim", - name = "barbecue", - version = "*", - dependencies = { - "SmiteshP/nvim-navic", - "nvim-tree/nvim-web-devicons", -- optional dependency - }, - opts = { - -- configurations go here - }, -} diff --git a/.config/nvim/lua/plugins/bufferline.lua b/.config/nvim/lua/plugins/bufferline.lua deleted file mode 100644 index 1deccc7..0000000 --- a/.config/nvim/lua/plugins/bufferline.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - { - "akinsho/bufferline.nvim", - config = { - options = { - separator_style = "thin", - always_show_bufferline = false, - color_icons = false, - show_buffer_icons = false, - groups = { - items = { - require("bufferline.groups").builtin.pinned:with({ icon = "" }), - }, - }, - }, - }, - }, -} diff --git a/.config/nvim/lua/plugins/bundler.lua b/.config/nvim/lua/plugins/bundler.lua deleted file mode 100644 index 33f1c4a..0000000 --- a/.config/nvim/lua/plugins/bundler.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "tpope/vim-bundler", -} diff --git a/.config/nvim/lua/plugins/cellular-automaton.lua b/.config/nvim/lua/plugins/cellular-automaton.lua deleted file mode 100644 index 8007ca6..0000000 --- a/.config/nvim/lua/plugins/cellular-automaton.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { - "Eandrju/cellular-automaton.nvim", - lazy = false, - setup = function() - -- vim.keymap.set("n", "fml", "CellularAutomaton make_it_rain") - end, - }, -} diff --git a/.config/nvim/lua/plugins/cheatsheet.lua b/.config/nvim/lua/plugins/cheatsheet.lua deleted file mode 100644 index 9da104c..0000000 --- a/.config/nvim/lua/plugins/cheatsheet.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - "sudormrfbin/cheatsheet.nvim", - - dependencies = { - { "nvim-telescope/telescope.nvim" }, - { "nvim-lua/popup.nvim" }, - { "nvim-lua/plenary.nvim" }, - }, -} diff --git a/.config/nvim/lua/plugins/endwise.lua b/.config/nvim/lua/plugins/endwise.lua deleted file mode 100644 index 1723500..0000000 --- a/.config/nvim/lua/plugins/endwise.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - { - "RRethy/nvim-treesitter-endwise", - setup = function() - -- Requires nvim-treesitter installed - require("nvim-treesitter.configs").setup({ - endwise = { - enable = true, - }, - }) - end, - }, -} diff --git a/.config/nvim/lua/plugins/essential.lua b/.config/nvim/lua/plugins/essential.lua new file mode 100644 index 0000000..189026f --- /dev/null +++ b/.config/nvim/lua/plugins/essential.lua @@ -0,0 +1,65 @@ +return { + { + "tpope/vim-repeat", + }, + { + "zbirenbaum/copilot-cmp", + lazy = true, + }, + { + "kylechui/nvim-surround", + version = "*", -- Use for stability; omit to use `main` branch for the latest features + event = "VeryLazy", + config = function() + require("nvim-surround").setup({ + -- Configuration here, or leave empty to use defaults + }) + end, + }, + { + "olrtg/nvim-emmet", + config = function() + vim.keymap.set({ "n", "v" }, "xe", require("nvim-emmet").wrap_with_abbreviation) + end, + }, + { "stevanmilic/nvim-lspimport" }, + { + "ThePrimeagen/refactoring.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("refactoring").setup() + require("telescope").load_extension("refactoring") + + vim.keymap.set({ "n", "x" }, "rr", function() + require("telescope").extensions.refactoring.refactors() + end) + end, + }, + { + "johmsalas/text-case.nvim", + dependencies = { "nvim-telescope/telescope.nvim" }, + config = function() + require("textcase").setup({}) + require("telescope").load_extension("textcase") + end, + keys = { + "ga", -- Default invocation prefix + { "ga.", "TextCaseOpenTelescope", mode = { "n", "x" }, desc = "Telescope" }, + }, + cmd = { + -- NOTE: The Subs command name can be customized via the option "substitude_command_name" + "Subs", + "TextCaseOpenTelescope", + "TextCaseOpenTelescopeQuickChange", + "TextCaseOpenTelescopeLSPChange", + "TextCaseStartReplacingCommand", + }, + -- If you want to use the interactive feature of the `Subs` command right away, text-case.nvim + -- has to be loaded on startup. Otherwise, the interactive feature of the `Subs` will only be + -- available after the first executing of it or after a keymap of text-case.nvim has been used. + lazy = true, + }, +} diff --git a/.config/nvim/lua/plugins/example.lua b/.config/nvim/lua/plugins/example.lua deleted file mode 100644 index 491022a..0000000 --- a/.config/nvim/lua/plugins/example.lua +++ /dev/null @@ -1,267 +0,0 @@ --- since this is just an example spec, don't actually load anything here and return an empty spec --- stylua: ignore -vim.g.lazygit_floating_window_winblend = 0 -if true then - return { - { "Lokaltog/vim-distinguished" }, - { - "LazyVim/LazyVim", - opts = { - transparent = true, - colorscheme = "tokyonight", - }, - }, - { - "wk13eagle/telescope.nvim", - opts = { - pickers = { - colorscheme = { - enable_preview = true, - }, - }, - }, - }, - } -end - --- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim --- --- In your plugin files, you can: --- * add extra plugins --- * disable/enabled LazyVim plugins --- * override the configuration of LazyVim plugins -return { - -- add gruvbox - { "ellisonleao/gruvbox.nvim" }, - - -- Configure LazyVim to load gruvbox - { - "LazyVim/LazyVim", - opts = { - colorscheme = "gruvbox", - }, - }, - - -- change trouble config - { - "folke/trouble.nvim", - -- opts will be merged with the parent spec - opts = { use_diagnostic_signs = true }, - }, - - -- disable trouble - { "folke/trouble.nvim", enabled = false }, - - -- override nvim-cmp and add cmp-emoji - { - "hrsh7th/nvim-cmp", - dependencies = { "hrsh7th/cmp-emoji" }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - table.insert(opts.sources, { name = "emoji" }) - end, - }, - - -- change some telescope options and a keymap to browse plugin files - -- { - -- "nvim-telescope/telescope.nvim", - -- keys = { - -- -- add a keymap to browse plugin files - -- -- stylua: ignore - -- { - -- "fp", - -- function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, - -- desc = "Find Plugin File", - -- }, - -- }, - -- -- change some options - -- opts = { - -- defaults = { - -- layout_strategy = "horizontal", - -- layout_config = { prompt_position = "top" }, - -- sorting_strategy = "ascending", - -- winblend = 0, - -- }, - -- }, - -- }, - - -- add pyright to lspconfig - { - "neovim/nvim-lspconfig", - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- pyright will be automatically installed with mason and loaded with lspconfig - pyright = {}, - }, - }, - }, - - -- add tsserver and setup with typescript.nvim instead of lspconfig - { - "neovim/nvim-lspconfig", - dependencies = { - "jose-elias-alvarez/typescript.nvim", - init = function() - require("lazyvim.util").lsp.on_attach(function(_, buffer) - -- stylua: ignore - vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) - vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) - end) - end, - }, - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- tsserver will be automatically installed with mason and loaded with lspconfig - tsserver = {}, - }, - -- you can do any additional lsp server setup here - -- return true if you don't want this server to be setup with lspconfig - ---@type table - setup = { - -- example to setup with typescript.nvim - tsserver = function(_, opts) - require("typescript").setup({ server = opts }) - return true - end, - -- Specify * to use this function as a fallback for any server - -- ["*"] = function(server, opts) end, - }, - }, - }, - - -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, - -- treesitter, mason and typescript.nvim. So instead of the above, you can use: - { import = "lazyvim.plugins.extras.lang.typescript" }, - - -- add more treesitter parsers - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "bash", - "html", - "javascript", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "tsx", - "typescript", - "vim", - "yaml", - }, - }, - }, - - -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above - -- would overwrite `ensure_installed` with the new value. - -- If you'd rather extend the default config, use the code below instead: - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - -- add tsx and treesitter - vim.list_extend(opts.ensure_installed, { - "tsx", - "typescript", - }) - end, - }, - - -- the opts function can also be used to change the default opts: - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function(_, opts) - table.insert(opts.sections.lualine_x, "😄") - end, - }, - - -- or you can return new options to override all the defaults - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function() - return { - --[[add your custom lualine config here]] - } - end, - }, - - -- use mini.starter instead of alpha - { import = "lazyvim.plugins.extras.ui.mini-starter" }, - - -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc - { import = "lazyvim.plugins.extras.lang.json" }, - - -- add any tools you want to have installed below - { - "williamboman/mason.nvim", - opts = { - ensure_installed = { - "stylua", - "shellcheck", - "shfmt", - "flake8", - }, - }, - }, - - -- Use for completion and snippets (supertab) - -- first: disable default and behavior in LuaSnip - { - "L3MON4D3/LuaSnip", - keys = function() - return {} - end, - }, - -- then: setup supertab in cmp - { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-emoji", - }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end - - local luasnip = require("luasnip") - local cmp = require("cmp") - - opts.mapping = vim.tbl_extend("force", opts.mapping, { - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- this way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }) - end, - }, -} diff --git a/.config/nvim/lua/plugins/fun.lua b/.config/nvim/lua/plugins/fun.lua new file mode 100644 index 0000000..2492e32 --- /dev/null +++ b/.config/nvim/lua/plugins/fun.lua @@ -0,0 +1,20 @@ +return { + { + { + "Eandrju/cellular-automaton.nvim", + cmd = "CellularAutomaton", + }, + }, + { + "NStefan002/speedtyper.nvim", + cmd = "Speedtyper", + opts = { + -- your config + }, + }, + { "tjdevries/train.nvim" }, + { + "ThePrimeagen/vim-be-good", + cmd = "VimBeGood", + }, +} diff --git a/.config/nvim/lua/plugins/git-time-lapse.lua b/.config/nvim/lua/plugins/git-time-lapse.lua deleted file mode 100644 index e3fd222..0000000 --- a/.config/nvim/lua/plugins/git-time-lapse.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "junkblocker/git-time-lapse", - config = function() - vim.keymap.set("n", "gt", "(git-time-lapse)", { noremap = false }) - end, -} diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..a771e1e --- /dev/null +++ b/.config/nvim/lua/plugins/git.lua @@ -0,0 +1,26 @@ +return { + { + "tpope/vim-fugitive", + lazy = false, + }, + { + { + "pwntester/octo.nvim", + requires = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + -- OR 'ibhagwan/fzf-lua', + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("octo").setup() + end, + }, + }, + { + "junkblocker/git-time-lapse", + config = function() + vim.keymap.set("n", "gt", "(git-time-lapse)", { noremap = false }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/help.lua b/.config/nvim/lua/plugins/help.lua new file mode 100644 index 0000000..1a75080 --- /dev/null +++ b/.config/nvim/lua/plugins/help.lua @@ -0,0 +1,11 @@ +return { + { + "sudormrfbin/cheatsheet.nvim", + + dependencies = { + { "nvim-telescope/telescope.nvim" }, + { "nvim-lua/popup.nvim" }, + { "nvim-lua/plenary.nvim" }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/lspimport.lua b/.config/nvim/lua/plugins/lspimport.lua deleted file mode 100644 index bf46c73..0000000 --- a/.config/nvim/lua/plugins/lspimport.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - { "stevanmilic/nvim-lspimport" }, -} diff --git a/.config/nvim/lua/plugins/multiple-cursors.lua b/.config/nvim/lua/plugins/multiple-cursors.lua deleted file mode 100644 index 87068b9..0000000 --- a/.config/nvim/lua/plugins/multiple-cursors.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - "brenton-leighton/multiple-cursors.nvim", - version = "*", -- Use the latest tagged version - opts = {}, -- This causes the plugin setup function to be called - keys = { - { "", "MultipleCursorsAddDown" }, - { "", "MultipleCursorsAddUp" }, - { "", "MultipleCursorsMouseAddDelete", mode = { "n", "i" } }, - { "a", "MultipleCursorsAddMatches", mode = { "n", "x" } }, - { "A", "MultipleCursorsAddMatchesV", mode = { "n", "x" } }, - { "d", "MultipleCursorsAddJumpNextMatch", mode = { "n", "x" } }, - { "D", "MultipleCursorsJumpNextMatch" }, - { "l", "MultipleCursorsLockToggle", mode = { "n", "x" } }, - }, -} diff --git a/.config/nvim/lua/plugins/notify.lua b/.config/nvim/lua/plugins/notify.lua deleted file mode 100644 index 015b0f8..0000000 --- a/.config/nvim/lua/plugins/notify.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "rcarriga/nvim-notify", - opts = { - level = 3, - render = "minimal", - stages = "static", - }, -} diff --git a/.config/nvim/lua/plugins/nvim-emmet.lua b/.config/nvim/lua/plugins/nvim-emmet.lua deleted file mode 100644 index 1f96293..0000000 --- a/.config/nvim/lua/plugins/nvim-emmet.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "olrtg/nvim-emmet", - config = function() - vim.keymap.set({ "n", "v" }, "xe", require("nvim-emmet").wrap_with_abbreviation) - end, -} diff --git a/.config/nvim/lua/plugins/nvim-surround.lua b/.config/nvim/lua/plugins/nvim-surround.lua deleted file mode 100644 index b9ee8f7..0000000 --- a/.config/nvim/lua/plugins/nvim-surround.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "kylechui/nvim-surround", - version = "*", -- Use for stability; omit to use `main` branch for the latest features - event = "VeryLazy", - config = function() - require("nvim-surround").setup({ - -- Configuration here, or leave empty to use defaults - }) - end, -} diff --git a/.config/nvim/lua/plugins/nvim_tools.lua b/.config/nvim/lua/plugins/nvim_tools.lua deleted file mode 100644 index ed0e0c1..0000000 --- a/.config/nvim/lua/plugins/nvim_tools.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "valen20Chx/nvim-i18n-tools", - config = function() - require("nvim-i18n-tools").setup() - end, -} diff --git a/.config/nvim/lua/plugins/octo.lua b/.config/nvim/lua/plugins/octo.lua deleted file mode 100644 index ce29bd3..0000000 --- a/.config/nvim/lua/plugins/octo.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - { - "pwntester/octo.nvim", - requires = { - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim", - -- OR 'ibhagwan/fzf-lua', - "nvim-tree/nvim-web-devicons", - }, - config = function() - require("octo").setup() - end, - }, -} diff --git a/.config/nvim/lua/plugins/other.lua b/.config/nvim/lua/plugins/other.lua index 9fcb4be..c68ec7e 100644 --- a/.config/nvim/lua/plugins/other.lua +++ b/.config/nvim/lua/plugins/other.lua @@ -1,56 +1,33 @@ return { - -- default settings - { - "rgroli/other.nvim", - config = function() - require("other-nvim").setup({ - mappings = { - -- builtin mappings - "livewire", - "angular", - "laravel", - "rails", - "golang", - -- custom mapping - { - pattern = "/app/.+(.*)_controller.rb", - target = "/spec/request/%1_spec.rb", - transformer = "lowercase", - }, - }, - transformers = { - -- defining a custom transformer - lowercase = function(inputString) - return inputString:lower() - end, - }, - style = { - -- How the plugin paints its window borders - -- Allowed values are none, single, double, rounded, solid and shadow - border = "solid", - - -- Column seperator for the window - seperator = "|", - - -- width of the window in percent. e.g. 0.5 is 50%, 1.0 is 100% - width = 0.7, - - -- min height in rows. - -- when more columns are needed this value is extended automatically - minHeight = 2, + "tpope/vim-dispatch", + }, + { + "NvChad/nvim-colorizer.lua", + setup = function() + require("colorizer").setup({ + filetypes = { + "*", -- Highlight all files, but customize some others. + cmp_docs = { always_update = true }, }, }) - - vim.api.nvim_set_keymap("n", "ll", ":Other", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "ltn", ":OtherTabNew", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "lp", ":OtherSplit", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "lv", ":OtherVSplit", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "lc", ":OtherClear", { noremap = true, silent = true }) - - -- Context specific bindings - vim.api.nvim_set_keymap("n", "lt", ":Other test", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "ls", ":Other scss", { noremap = true, silent = true }) end, }, + { + "vhyrro/luarocks.nvim", + priority = 1000, + config = true, + }, + -- { + -- "rest-nvim/rest.nvim", + -- ft = "http", + -- lazy = true, + -- dependencies = { "luarocks.nvim" }, + -- config = function() + -- require("rest-nvim").setup() + -- end, + -- }, + { + "dstein64/vim-startuptime", + }, } diff --git a/.config/nvim/lua/plugins/rails.lua b/.config/nvim/lua/plugins/rails.lua new file mode 100644 index 0000000..5dc47d0 --- /dev/null +++ b/.config/nvim/lua/plugins/rails.lua @@ -0,0 +1,165 @@ +return { + { "tpope/vim-rails" }, + { "namadnuno/neoi18n" }, + { + "airblade/vim-localorie", + }, + { + "valen20Chx/nvim-i18n-tools", + config = function() + require("nvim-i18n-tools").setup() + end, + }, + { + "weizheheng/ror.nvim", + config = function() + require("ror").setup() + vim.keymap.set("n", "rc", ":lua require('ror.commands').list_commands()", { silent = true }) + -- vim.keymap.sot("n", "fv", ":lua require('ror.commands').find_view()", { silent = true }) + end, + }, + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + solargraph = { + settings = { + solargraph = { + autoformat = false, + -- bundlerPath = "bundle", + diagnostics = true, + completion = true, + formatting = false, + definitions = true, + }, + }, + }, + }, + }, + }, + { + "RRethy/nvim-treesitter-endwise", + lazy = true, + setup = function() + -- Requires nvim-treesitter installed + require("nvim-treesitter.configs").setup({ + endwise = { + enable = true, + }, + }) + end, + }, + { "tpope/vim-bundler" }, + { + "rgroli/other.nvim", + config = function() + require("other-nvim").setup({ + mappings = { + -- builtin mappings + "livewire", + "angular", + "laravel", + "rails", + "golang", + -- custom mapping + { + pattern = "/app/.+(.*)_controller.rb", + target = "/spec/request/%1_spec.rb", + transformer = "lowercase", + }, + }, + transformers = { + -- defining a custom transformer + lowercase = function(inputString) + return inputString:lower() + end, + }, + style = { + -- How the plugin paints its window borders + -- Allowed values are none, single, double, rounded, solid and shadow + border = "solid", + + -- Column seperator for the window + seperator = "|", + + -- width of the window in percent. e.g. 0.5 is 50%, 1.0 is 100% + width = 0.7, + + -- min height in rows. + -- when more columns are needed this value is extended automatically + minHeight = 2, + }, + }) + + vim.api.nvim_set_keymap("n", "ll", ":Other", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "ltn", ":OtherTabNew", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "lp", ":OtherSplit", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "lv", ":OtherVSplit", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "lc", ":OtherClear", { noremap = true, silent = true }) + + -- Context specific bindings + vim.api.nvim_set_keymap("n", "lt", ":Other test", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "ls", ":Other scss", { noremap = true, silent = true }) + end, + }, + { + { + "nvim-neotest/neotest", + dependencies = { + "haydenmeade/neotest-jest", + "marilari88/neotest-vitest", + "olimorris/neotest-rspec", + }, + keys = { + { + "tl", + function() + require("neotest").run.run_last() + end, + desc = "Run Last Test", + }, + { + "tL", + function() + require("neotest").run.run_last({ strategy = "dap" }) + end, + desc = "Debug Last Test", + }, + { + "tw", + "lua require('neotest').run.run({ jestCommand = 'jest --watch ' })", + desc = "Run Watch", + }, + }, + opts = function(_, opts) + table.insert( + opts.adapters, + require("neotest-jest")({ + jestCommand = "npm test --", + jestConfigFile = "custom.jest.config.ts", + env = { CI = true }, + cwd = function() + return vim.fn.getcwd() + end, + }) + ) + table.insert(opts.adapters, require("neotest-vitest")) + + table.insert( + opts.adapters, + require("neotest-rspec")({ + -- jestCommand = "npm test --", + -- jestConfigFile = "custom.jest.config.ts", + -- env = { CI = true }, + -- cwd = function() + -- return vim.fn.getcwd() + -- end, + }) + ) + table.insert(opts.adapters, require("neotest-rspec")) + end, + }, + }, +} diff --git a/.config/nvim/lua/plugins/refactoring.lua b/.config/nvim/lua/plugins/refactoring.lua deleted file mode 100644 index 62a94f2..0000000 --- a/.config/nvim/lua/plugins/refactoring.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - { - "ThePrimeagen/refactoring.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - config = function() - require("refactoring").setup() - require("telescope").load_extension("refactoring") - - vim.keymap.set({ "n", "x" }, "rr", function() - require("telescope").extensions.refactoring.refactors() - end) - end, - }, -} diff --git a/.config/nvim/lua/plugins/repeat.lua b/.config/nvim/lua/plugins/repeat.lua deleted file mode 100644 index 1622ffa..0000000 --- a/.config/nvim/lua/plugins/repeat.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "tpope/vim-repeat", -} diff --git a/.config/nvim/lua/plugins/rest.lua b/.config/nvim/lua/plugins/rest.lua deleted file mode 100644 index 53a079c..0000000 --- a/.config/nvim/lua/plugins/rest.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - { - "vhyrro/luarocks.nvim", - priority = 1000, - config = true, - }, - { - "rest-nvim/rest.nvim", - ft = "http", - dependencies = { "luarocks.nvim" }, - lazy = false, - config = function() - require("rest-nvim").setup() - end, - }, -} diff --git a/.config/nvim/lua/plugins/ror.lua b/.config/nvim/lua/plugins/ror.lua deleted file mode 100644 index d8fdb7f..0000000 --- a/.config/nvim/lua/plugins/ror.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - { - "weizheheng/ror.nvim", - config = function() - require("ror").setup() - vim.keymap.set("n", "rc", ":lua require('ror.commands').list_commands()", { silent = true }) - -- vim.keymap.sot("n", "fv", ":lua require('ror.commands').find_view()", { silent = true }) - end, - }, -} diff --git a/.config/nvim/lua/plugins/solargraph.lua b/.config/nvim/lua/plugins/solargraph.lua deleted file mode 100644 index 275eb03..0000000 --- a/.config/nvim/lua/plugins/solargraph.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - { - "neovim/nvim-lspconfig", - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - solargraph = { - settings = { - solargraph = { - autoformat = true, - -- bundlerPath = "bundle", - diagnostics = true, - completion = true, - formatting = true, - definitions = true, - }, - }, - }, - }, - }, - }, -} diff --git a/.config/nvim/lua/plugins/speedtyper.lua b/.config/nvim/lua/plugins/speedtyper.lua deleted file mode 100644 index 68ec472..0000000 --- a/.config/nvim/lua/plugins/speedtyper.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "NStefan002/speedtyper.nvim", - cmd = "Speedtyper", - opts = { - -- your config - }, -} diff --git a/.config/nvim/lua/plugins/test.lua b/.config/nvim/lua/plugins/test.lua deleted file mode 100644 index a3af3f5..0000000 --- a/.config/nvim/lua/plugins/test.lua +++ /dev/null @@ -1,58 +0,0 @@ -return { - { - "nvim-neotest/neotest", - dependencies = { - "haydenmeade/neotest-jest", - "marilari88/neotest-vitest", - "olimorris/neotest-rspec", - }, - keys = { - { - "tl", - function() - require("neotest").run.run_last() - end, - desc = "Run Last Test", - }, - { - "tL", - function() - require("neotest").run.run_last({ strategy = "dap" }) - end, - desc = "Debug Last Test", - }, - { - "tw", - "lua require('neotest').run.run({ jestCommand = 'jest --watch ' })", - desc = "Run Watch", - }, - }, - opts = function(_, opts) - table.insert( - opts.adapters, - require("neotest-jest")({ - jestCommand = "npm test --", - jestConfigFile = "custom.jest.config.ts", - env = { CI = true }, - cwd = function() - return vim.fn.getcwd() - end, - }) - ) - table.insert(opts.adapters, require("neotest-vitest")) - - table.insert( - opts.adapters, - require("neotest-rspec")({ - -- jestCommand = "npm test --", - -- jestConfigFile = "custom.jest.config.ts", - -- env = { CI = true }, - -- cwd = function() - -- return vim.fn.getcwd() - -- end, - }) - ) - table.insert(opts.adapters, require("neotest-rspec")) - end, - }, -} diff --git a/.config/nvim/lua/plugins/text_case.lua b/.config/nvim/lua/plugins/text_case.lua deleted file mode 100644 index fa55425..0000000 --- a/.config/nvim/lua/plugins/text_case.lua +++ /dev/null @@ -1,24 +0,0 @@ -return { - "johmsalas/text-case.nvim", - dependencies = { "nvim-telescope/telescope.nvim" }, - config = function() - require("textcase").setup({}) - require("telescope").load_extension("textcase") - end, - keys = { - "ga", -- Default invocation prefix - { "ga.", "TextCaseOpenTelescope", mode = { "n", "x" }, desc = "Telescope" }, - }, - cmd = { - -- NOTE: The Subs command name can be customized via the option "substitude_command_name" - "Subs", - "TextCaseOpenTelescope", - "TextCaseOpenTelescopeQuickChange", - "TextCaseOpenTelescopeLSPChange", - "TextCaseStartReplacingCommand", - }, - -- If you want to use the interactive feature of the `Subs` command right away, text-case.nvim - -- has to be loaded on startup. Otherwise, the interactive feature of the `Subs` will only be - -- available after the first executing of it or after a keymap of text-case.nvim has been used. - lazy = false, -} diff --git a/.config/nvim/lua/plugins/themes.lua b/.config/nvim/lua/plugins/themes.lua new file mode 100644 index 0000000..cff7637 --- /dev/null +++ b/.config/nvim/lua/plugins/themes.lua @@ -0,0 +1,32 @@ +vim.g.lazygit_floating_window_winblend = 0 + +return { + { + "folke/tokyonight.nvim", + opts = { + transparent = true, + styles = { + sidebars = "transparent", + floats = "transparent", + }, + }, + }, + { "Lokaltog/vim-distinguished" }, + { + "LazyVim/LazyVim", + opts = { + transparent = true, + colorscheme = "tokyonight", + }, + }, + { + "wk13eagle/telescope.nvim", + opts = { + pickers = { + colorscheme = { + enable_preview = true, + }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/tokyonight.lua b/.config/nvim/lua/plugins/tokyonight.lua deleted file mode 100644 index c933040..0000000 --- a/.config/nvim/lua/plugins/tokyonight.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - { - "folke/tokyonight.nvim", - opts = { - transparent = true, - styles = { - sidebars = "transparent", - floats = "transparent", - }, - }, - }, -} diff --git a/.config/nvim/lua/plugins/train.lua b/.config/nvim/lua/plugins/train.lua deleted file mode 100644 index b3cd6a9..0000000 --- a/.config/nvim/lua/plugins/train.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "tjdevries/train.nvim", -} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua deleted file mode 100644 index 1fc3442..0000000 --- a/.config/nvim/lua/plugins/treesitter.lua +++ /dev/null @@ -1,28 +0,0 @@ -return { - { - "nvim-treesitter/nvim-treesitter", - dependencies = { "RRethy/nvim-treesitter-endwise" }, - opts = function(_, opts) - opts.endwise = { enable = true } - opts.indent = { enable = true, disable = { "yaml", "ruby" } } - opts.ensure_installed = { - "bash", - "embedded_template", - "html", - "javascript", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "ruby", - "tsx", - "typescript", - "vim", - "yaml", - } - end, - }, -} diff --git a/.config/nvim/lua/plugins/mini-starter.lua b/.config/nvim/lua/plugins/ui.lua similarity index 79% rename from .config/nvim/lua/plugins/mini-starter.lua rename to .config/nvim/lua/plugins/ui.lua index 7a55866..55d8f97 100644 --- a/.config/nvim/lua/plugins/mini-starter.lua +++ b/.config/nvim/lua/plugins/ui.lua @@ -1,4 +1,54 @@ return { + { + "rcarriga/nvim-notify", + opts = { + level = 3, + render = "minimal", + stages = "static", + }, + }, + { + "akinsho/bufferline.nvim", + config = { + options = { + separator_style = "thin", + always_show_bufferline = false, + color_icons = false, + show_buffer_icons = false, + groups = { + items = { + require("bufferline.groups").builtin.pinned:with({ icon = "" }), + }, + }, + }, + }, + }, + { + "nvim-treesitter/nvim-treesitter", + dependencies = { "RRethy/nvim-treesitter-endwise" }, + opts = function(_, opts) + opts.endwise = { enable = true } + opts.indent = { enable = true, disable = { "yaml", "ruby" } } + opts.ensure_installed = { + "bash", + "embedded_template", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "ruby", + "tsx", + "typescript", + "vim", + "yaml", + } + end, + }, { "echasnovski/mini.starter", version = false, -- wait till new 0.7.0 release to put it back on semver diff --git a/.config/nvim/lua/plugins/vim-be-good.lua b/.config/nvim/lua/plugins/vim-be-good.lua deleted file mode 100644 index 43448f5..0000000 --- a/.config/nvim/lua/plugins/vim-be-good.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - { - "ThePrimeagen/vim-be-good", - }, -} diff --git a/.config/nvim/lua/plugins/vim-dispatch.lua b/.config/nvim/lua/plugins/vim-dispatch.lua deleted file mode 100644 index e91cec8..0000000 --- a/.config/nvim/lua/plugins/vim-dispatch.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "tpope/vim-dispatch", -} diff --git a/.config/nvim/lua/plugins/vim-fugitive.lua b/.config/nvim/lua/plugins/vim-fugitive.lua deleted file mode 100644 index d7f59af..0000000 --- a/.config/nvim/lua/plugins/vim-fugitive.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - { - "tpope/vim-fugitive", - lazy = false, - }, -} diff --git a/.config/nvim/lua/plugins/vim-localoire.lua b/.config/nvim/lua/plugins/vim-localoire.lua deleted file mode 100644 index b2c0f16..0000000 --- a/.config/nvim/lua/plugins/vim-localoire.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - { - "airblade/vim-localorie", - }, -} diff --git a/.config/nvim/lua/plugins/vim-rails.lua b/.config/nvim/lua/plugins/vim-rails.lua deleted file mode 100644 index 6455dc6..0000000 --- a/.config/nvim/lua/plugins/vim-rails.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - { "tpope/vim-rails" }, -} From 7a51feb2fd625fbe0238a86b336f66cc3c4d379f Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 15 Apr 2024 21:04:02 +0200 Subject: [PATCH 027/280] Add search forward key mapping --- .config/alacritty/alacritty.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 720ebff..8c3c4e7 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -185,6 +185,7 @@ key_bindings: - { key: Comma, mods: Command, chars: "\x18\x10" } - { key: Semicolon, mods: Command, chars: "\x18\x0e" } - { key: F, mods: Shift|Command, chars: "\x18\x09" } + - { key: F, mods: Command, action: SearchForward } - { key: E, mods: Command, chars: "\x18\x09" } - { key: N, mods: Command, chars: "\x18\x6e" } - { key: P, mods: Command, chars: "\x18\x70" } From 815ff48229ce76580a4160aec3724ede8a37948f Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 15 Apr 2024 21:06:19 +0200 Subject: [PATCH 028/280] Replace new instance with new window --- .config/alacritty/alacritty.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 8c3c4e7..13a2fca 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -106,7 +106,7 @@ shell: # To get keybinding, just run: xxd -psd key_bindings: - - { key: N, mods: Command, action: SpawnNewInstance } + - { key: N, mods: Command, action: CreateNewWindow } - { key: Home, chars: "\x1bOH", mode: AppCursor } - { key: Home, chars: "\x1b[H", mode: ~AppCursor } - { key: End, chars: "\x1bOF", mode: AppCursor } From 297ee3fd5c8340ecefa747d761783584d3d141a9 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 15 Apr 2024 22:38:19 +0200 Subject: [PATCH 029/280] Update commands --- .zshrc | 74 +++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 27 deletions(-) diff --git a/.zshrc b/.zshrc index e5339f8..e515a3c 100644 --- a/.zshrc +++ b/.zshrc @@ -26,30 +26,65 @@ eval "$(fzf --zsh)" alias ls="eza" alias l="eza -lah" alias lh="eza -lah | grep -E ' \.\w+$'" # [l]ist [h]idden -function go() { ./scripts/open-repo-in-browser.ts } -function gtable() { ./scripts/git-smart-log.ts } -function gitcopy() { ./scripts/copy_remote_to_clipboard.sh } -function cscript() { ./scripts/create_executable_script.sh } -function timelog() { ./scripts/index.ts } -function openticket() { ./scripts/open-ticket-in-browser.ts } -function ot() { ./scripts/open-ticket-in-browser.ts } -function prt() { ./scripts/get-pr-template.ts } -function cpt() { ./scripts/copy-ticket-number.ts } +function go() { ~/scripts/open-repo-in-browser.ts } +function gtable() { ~/scripts/git-smart-log.ts $@ } +function gitcopy() { ~/scripts/copy_remote_to_clipboard.sh } +function cscript() { ~/scripts/create_executable_script.sh } +function timelog() { ~/scripts/index.ts } +function openticket() { ~/scripts/open-ticket-in-browser.ts } +function ot() { ~/scripts/open-ticket-in-browser.ts } +function prt() { ~/scripts/get-pr-template.ts } +function cpt() { ~/scripts/copy-ticket-number.ts } +function rsf() { bundle exec rspec $(find spec/**/*_spec.rb | fzf --preview 'bat --color "always" {}') } # [r]spec [s]earch [f]ile + +function search_history() { + local selected_command=$( cat $HISTFILE | sort -u | fzf ) + + if [ -z "$selected_command" ]; then + echo "No command selected." + return 1 + fi + + echo "Executing: $selected_command" + eval "$selected_command" +} + +reimport_abbr() { + rm -rf $ABBR_TMPDIR + rm $ABBR_USER_ABBREVIATIONS_FILE + abbr import-aliases +} + +backup_directory() { + if [ -z "$1" ]; then + echo "Please provide a directory to backup" + return + fi + + directory_name_with_timestamp_suffix=$1-$(date +%Y-%m-%d:%H:%M:%S) + cp -r "$1" "$directory_name_with_timestamp_suffix" + printf "Backup created at $directory_name_with_timestamp_suffix" +} + +alias '~'='cd ~' alias '..'='cd ..' alias '...'='cd ../../' function rr() { rustc "$@.rs" && ./"$@"} # [r]ust [r]un +function rgs() { rg --json -C 2 "$@" | delta } # [r]ip[g]rep [s]earch alias zshrc='nvim ~/.zshrc' # Idea from Chris alias calacritty='nvim ~/.config/alacritty/alacritty.yml' alias ctmux='nvim ~/.tmux.conf' +alias clazygit='nvim ~/Library/Application\ Support/lazygit/config.yml' +alias v='nvim' alias g="grep" # [g]rep alias bra="bundle exec rubocop -A" # [b]undle exec [r]ubocop -[A] alias spec="be rspec" alias f="fork ." -alias rsf='be rspec spec/$(cd spec/ && fzf)' # [r][s]pec [f]uzzy find alias cnvim="cd ~/.config/nvim && nvim init.lua" # [c]onfigure [nvim] +alias dbreset="bundle exec rails db:drop db:create db:schema:load db:seed" # [d]ata[b]ase [reset] alias glog="glog_ | grep -v -e '^\s*$' --color=always | less --use-color" # [g]it [log] alias glag="glog_ --all --since='00:00' --until='NOW' | grep -v -e '^\s*$' --color=always" # [g]it [l]og [a]ll [g]rep @@ -94,23 +129,6 @@ alias gch="git checkout" alias gcf="git checkout -b feature/" -reimport_abbr() { - rm -rf $ABBR_TMPDIR - rm $ABBR_USER_ABBREVIATIONS_FILE - abbr import-aliases -} - -backup_directory() { - if [ -z "$1" ]; then - echo "Please provide a directory to backup" - return - fi - - directory_name_with_timestamp_suffix=$1-$(date +%Y-%m-%d:%H:%M:%S) - cp -r "$1" "$directory_name_with_timestamp_suffix" - printf "Backup created at $directory_name_with_timestamp_suffix" -} - compinit -C # BEGIN zsh-sticky-prompt @@ -195,3 +213,5 @@ zinit light-mode for \ # Load pure theme zinit ice pick"async.zsh" src"pure.zsh" # with zsh-async library that's bundled with it. zinit light sindresorhus/pure + +PATH=~/.console-ninja/.bin:$PATH From 89db64ce427611365c6ad06a3f181c1b0efc0396 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 16 Apr 2024 07:49:17 +0200 Subject: [PATCH 030/280] Add lazygit config --- lazygit/.gitignore | 1 + lazygit/config.yml | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 lazygit/.gitignore create mode 100644 lazygit/config.yml diff --git a/lazygit/.gitignore b/lazygit/.gitignore new file mode 100644 index 0000000..ace2661 --- /dev/null +++ b/lazygit/.gitignore @@ -0,0 +1 @@ +state.yml diff --git a/lazygit/config.yml b/lazygit/config.yml new file mode 100644 index 0000000..bebd563 --- /dev/null +++ b/lazygit/config.yml @@ -0,0 +1,39 @@ +customCommands: + - key: "F" + command: "git fetch --prune" + context: "localBranches" + stream: true + +os: + editPreset: "nvim" + +git: + paging: + colorArg: always + pager: delta --dark --paging=never + # pager: diff-so-fancy + +theme: + activeBorderColor: + #- "#8caaee" + #- bold + - "#FF0000" + inactiveBorderColor: + - "#a5adce" + optionsTextColor: + - "#8caaee" + selectedLineBgColor: + - "#414559" + cherryPickedCommitBgColor: + - "#51576d" + cherryPickedCommitFgColor: + - "#8caaee" + unstagedChangesColor: + - "#e78284" + defaultFgColor: + - "#c6d0f5" + searchingActiveBorderColor: + - "#e5c890" + +authorColors: + "*": "#babbf1" From 692a87ea4de5331b99e6ff90e52abab6114341b7 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 17 Apr 2024 21:09:37 +0200 Subject: [PATCH 031/280] Update tmux attach command --- .config/alacritty/alacritty.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 13a2fca..51fdaa3 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -102,7 +102,7 @@ shell: args: - -l - -c - - 'session_name=$(tmux ls | grep -v ''(attached)'' | head -1 | cut -d: -f1); [ -n "$session_name" ] && tmux attach -t "$session_name" || tmux new-session' + - 'session_name=$(tmux ls | grep -v "(attached)" | head -n 1 | cut -d: -f1); [ -n "$session_name" ] && tmux attach -t "$session_name" || tmux new-session' # To get keybinding, just run: xxd -psd key_bindings: From 6a5cac3b1f48d677cf0ec14c01038ce178f87e9b Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 17 Apr 2024 22:48:40 +0200 Subject: [PATCH 032/280] Update nvim config --- .config/nvim/lazy-lock.json | 5 +-- .config/nvim/lua/config/keymaps.lua | 5 +-- .config/nvim/lua/config/lazy.lua | 2 +- .config/nvim/lua/plugins/essential.lua | 33 ++++++++++++++++- .config/nvim/lua/plugins/help.lua | 19 +++++----- .config/nvim/lua/plugins/other.lua | 9 ----- .config/nvim/lua/plugins/rails.lua | 50 ++++++++++++++++++-------- .config/nvim/lua/plugins/themes.lua | 1 + .config/nvim/lua/plugins/ui.lua | 3 +- 9 files changed, 85 insertions(+), 42 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 5d86ee1..ce0150e 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -13,7 +13,6 @@ "conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, - "crates.nvim": { "branch": "main", "commit": "e8fa8ec62ded43c3b06bca7ef36be26b924681bb" }, "dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" }, "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, @@ -22,7 +21,6 @@ "gitsigns.nvim": { "branch": "main", "commit": "1a50b94066def8591d5f65bd60a4233902e9def4" }, "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, - "impatient.nvim": { "branch": "main", "commit": "47302af74be7b79f002773011f0d8e85679a7618" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, @@ -71,13 +69,12 @@ "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" }, - "rest.nvim": { "branch": "main", "commit": "3fc2bb8b927a5001069ea5a53a93d47656823f14" }, "ror.nvim": { "branch": "main", "commit": "9d31ad3953be83ac8dd542725ca4881c861f64a5" }, - "rustaceanvim": { "branch": "master", "commit": "e2dbf91daed26d4dd7263affbecbf9a36e0096e5" }, "speedtyper.nvim": { "branch": "main", "commit": "2d158eed4c753995b0501a3a7a72464fbb213e3d" }, "sqlite.lua": { "branch": "master", "commit": "b7e28c8463254c46a8e61c52d27d6a2040492fc3" }, "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, + "telescope-rails.nvim": { "branch": "master", "commit": "d09155e33beaf252b6e1ca479437c00d1c6318d0" }, "telescope.nvim": { "branch": "master", "commit": "d26b666b45e5dde23332e4bde1227677f2d92e31" }, "text-case.nvim": { "branch": "main", "commit": "d62c63a4e9a996c7321885937ab89920fca2c1c8" }, "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index 3351742..25d0ba4 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -2,5 +2,6 @@ -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here -vim.keymap.set("n", "", "lua require('flash').jump()") --- vim.keymap.set("n", "cs") +vim.keymap.set("n", "", "lua require('flash').jump()") +vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) +vim.keymap.set("n", "?", "Telescope keymaps") diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua index 8cfd3a2..29e2672 100644 --- a/.config/nvim/lua/config/lazy.lua +++ b/.config/nvim/lua/config/lazy.lua @@ -23,7 +23,7 @@ require("lazy").setup({ defaults = { -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. - lazy = true, + lazy = false, -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, -- have outdated releases, which may break your Neovim install. version = false, -- always use the latest git commit diff --git a/.config/nvim/lua/plugins/essential.lua b/.config/nvim/lua/plugins/essential.lua index 189026f..6b79b81 100644 --- a/.config/nvim/lua/plugins/essential.lua +++ b/.config/nvim/lua/plugins/essential.lua @@ -1,6 +1,14 @@ return { { "tpope/vim-repeat", + lazy = false, + }, + { + "stevearc/oil.nvim", + lazy = false, + config = function() + require("oil").setup() + end, }, { "zbirenbaum/copilot-cmp", @@ -30,14 +38,37 @@ return { "nvim-treesitter/nvim-treesitter", }, config = function() - require("refactoring").setup() + require("refactoring").setup({}) require("telescope").load_extension("refactoring") vim.keymap.set({ "n", "x" }, "rr", function() require("telescope").extensions.refactoring.refactors() end) + + vim.keymap.set("x", "re", ":Refactor extract ") + vim.keymap.set("x", "rf", ":Refactor extract_to_file ") + + vim.keymap.set("x", "rv", ":Refactor extract_var ") + + vim.keymap.set({ "n", "x" }, "ri", ":Refactor inline_var") + + vim.keymap.set("n", "rI", ":Refactor inline_func") + + vim.keymap.set("n", "rb", ":Refactor extract_block") + vim.keymap.set("n", "rbf", ":Refactor extract_block_to_file") end, }, + { + "folke/flash.nvim", + opts = { + ---@type table + modes = { + char = { + enabled = true, + }, + }, + }, + }, { "johmsalas/text-case.nvim", dependencies = { "nvim-telescope/telescope.nvim" }, diff --git a/.config/nvim/lua/plugins/help.lua b/.config/nvim/lua/plugins/help.lua index 1a75080..011dc47 100644 --- a/.config/nvim/lua/plugins/help.lua +++ b/.config/nvim/lua/plugins/help.lua @@ -1,11 +1,12 @@ return { - { - "sudormrfbin/cheatsheet.nvim", - - dependencies = { - { "nvim-telescope/telescope.nvim" }, - { "nvim-lua/popup.nvim" }, - { "nvim-lua/plenary.nvim" }, - }, - }, + -- { + -- "sudormrfbin/cheatsheet.nvim", + -- dependencies = { + -- { "nvim-telescope/telescope.nvim" }, + -- { "nvim-lua/popup.nvim" }, + -- { "nvim-lua/plenary.nvim" }, + -- }, + -- keys = { "?" }, + -- lazy = false, + -- }, } diff --git a/.config/nvim/lua/plugins/other.lua b/.config/nvim/lua/plugins/other.lua index c68ec7e..0599877 100644 --- a/.config/nvim/lua/plugins/other.lua +++ b/.config/nvim/lua/plugins/other.lua @@ -18,15 +18,6 @@ return { priority = 1000, config = true, }, - -- { - -- "rest-nvim/rest.nvim", - -- ft = "http", - -- lazy = true, - -- dependencies = { "luarocks.nvim" }, - -- config = function() - -- require("rest-nvim").setup() - -- end, - -- }, { "dstein64/vim-startuptime", }, diff --git a/.config/nvim/lua/plugins/rails.lua b/.config/nvim/lua/plugins/rails.lua index 5dc47d0..826fc93 100644 --- a/.config/nvim/lua/plugins/rails.lua +++ b/.config/nvim/lua/plugins/rails.lua @@ -1,5 +1,5 @@ return { - { "tpope/vim-rails" }, + { "tpope/vim-rails", lazy = false }, { "namadnuno/neoi18n" }, { "airblade/vim-localorie", @@ -14,9 +14,24 @@ return { "weizheheng/ror.nvim", config = function() require("ror").setup() - vim.keymap.set("n", "rc", ":lua require('ror.commands').list_commands()", { silent = true }) - -- vim.keymap.sot("n", "fv", ":lua require('ror.commands').find_view()", { silent = true }) end, + keys = { + { "rg", ":lua require('ror.commands').list_commands()", desc = "List Rails Commands" }, + }, + }, + { + "sato-s/telescope-rails.nvim", + config = function() + require("telescope").load_extension("rails") + end, + keys = { + { "rs", ":Telescope rails specs" }, + { "rc", ":Telescope rails controllers" }, + { "rm", ":Telescope rails models" }, + { "rv", ":Telescope rails views" }, + { "ri", ":Telescope rails migrations" }, + { "rl", ":Telescope rails libs" }, + }, }, { "neovim/nvim-lspconfig", @@ -24,18 +39,23 @@ return { opts = { ---@type lspconfig.options servers = { - solargraph = { - settings = { - solargraph = { - autoformat = false, - -- bundlerPath = "bundle", - diagnostics = true, - completion = true, - formatting = false, - definitions = true, - }, - }, - }, + -- solargraph = { + -- settings = { + -- solargraph = { + -- useBundler = false, + -- autoformat = false, + -- -- bundlerPath = "bundle", + -- diagnostics = true, + -- completion = true, + -- formatting = false, + -- definitions = true, + -- symbols = true, + -- rename = true, + -- transport = "stdio", + -- logLevel = "warn", + -- }, + -- }, + -- }, }, }, }, diff --git a/.config/nvim/lua/plugins/themes.lua b/.config/nvim/lua/plugins/themes.lua index cff7637..9c18c38 100644 --- a/.config/nvim/lua/plugins/themes.lua +++ b/.config/nvim/lua/plugins/themes.lua @@ -1,4 +1,5 @@ vim.g.lazygit_floating_window_winblend = 0 +vim.g.lazygit_floating_window_scaling_factor = 0.5 return { { diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua index 55d8f97..f2ebf9e 100644 --- a/.config/nvim/lua/plugins/ui.lua +++ b/.config/nvim/lua/plugins/ui.lua @@ -9,10 +9,11 @@ return { }, { "akinsho/bufferline.nvim", + lazy = false, config = { options = { separator_style = "thin", - always_show_bufferline = false, + always_show_bufferline = true, color_icons = false, show_buffer_icons = false, groups = { From 88671e41c7512dd1bd327bb657d73d722b782bea Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 17 Apr 2024 22:49:20 +0200 Subject: [PATCH 033/280] Update config --- .config/alacritty/alacritty.yml | 53 ++++++++++++++++++------- .tmux.conf | 17 +++++--- .zshrc | 15 ++------ my-status-bar.tmux | 17 ++++---- scripts/open-ticket-in-browser.ts | 8 ++-- scripts/pretty-pulls.ts | 64 +++++++++++++++++++++++++++++++ 6 files changed, 131 insertions(+), 43 deletions(-) create mode 100755 scripts/pretty-pulls.ts diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 51fdaa3..efcec69 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -11,8 +11,8 @@ window: decorations: buttonless dynamic_padding: false padding: - x: 0 - y: 0 + x: 10 + y: 10 colors: # Default colors @@ -107,6 +107,10 @@ shell: # To get keybinding, just run: xxd -psd key_bindings: - { key: N, mods: Command, action: CreateNewWindow } + - { key: F, mods: Command, action: SearchForward } + - { key: P, mods: Command, chars: "alacritty -e 'htop' & \x0D" } + - { key: Slash, mods: Command, mode: AppCursor, chars: "search_history \x0D" } + - { key: Home, chars: "\x1bOH", mode: AppCursor } - { key: Home, chars: "\x1b[H", mode: ~AppCursor } - { key: End, chars: "\x1bOF", mode: AppCursor } @@ -121,32 +125,32 @@ key_bindings: - { key: Right, mods: Alt, chars: "\x1bf" } # one word right - { key: Left, mods: Control, chars: "\x1bb" } # one word left - { key: Right, mods: Control, chars: "\x1bf" } # one word right - - { key: Delete, mods: Shift, chars: "\x7f" } + - { key: Delete, mods: Shift, chars: "\x6f" } - - { key: Back, mods: Shift, chars: "\x1b\x7f" } + - { key: Back, mods: Shift, chars: "\x1b\x6f" } - { key: R, mods: Alt, chars: "\x18\x2c" } - { key: Return, mods: Shift, chars: "\x00" } - { key: Space, mods: Control, chars: "\x00" } - { key: Space, mods: Alt, chars: "\x00" } - { key: Space, mods: Command, chars: "\x00" } - - { key: N, mods: Shift|Command, chars: "\x18\x29" } + - { key: N, mods: Shift|Command, chars: "\x18\x28" } - { key: N, mods: Shift|Alt, chars: "\x18\x29" } - - { key: P, mods: Shift|Command, chars: "\x18\x28" } + - { key: P, mods: Shift|Command, chars: "\x18\x27" } - { key: P, mods: Shift|Alt, chars: "\x18\x28" } - - { key: T, mods: Shift|Command, chars: "\x18\x43" } + - { key: T, mods: Shift|Command, chars: "\x18\x42" } - { key: T, mods: Shift|Alt, chars: "\x18\x43" } - - { key: R, mods: Shift|Command, chars: "\x18\x24" } + - { key: R, mods: Shift|Command, chars: "\x18\x23" } - { key: R, mods: Shift|Alt, chars: "\x18\x24" } - { key: Comma, mods: Shift|Alt, chars: "\x18<" } - - { key: Period, mods: Shift|Alt, chars: "\x18>" } - - { key: Comma, mods: Alt, chars: "\x1b," } + - { key: Period, mods: Shift|Alt, chars: "\x17>" } + - { key: Comma, mods: Alt, chars: "\x0b," } # Mac - { key: V, mods: Command, action: Paste } - - { key: B, mods: Command, chars: "\x1b\x62" } - - { key: D, mods: Command, chars: "\x1b\x64" } + - { key: B, mods: Command, chars: "\x1b\x61" } + - { key: D, mods: Command, chars: "\x1b\x63" } - { key: J, mods: Command, chars: "\x18\x6d" } - - { key: K, mods: Command, chars: "\x18\x62" } + - { key: K, mods: Command, chars: "\x18\x61" } - { key: C, mods: Command, action: Copy } - { key: Q, mods: Command, action: Quit } - { key: W, mods: Command, action: Quit } @@ -185,7 +189,6 @@ key_bindings: - { key: Comma, mods: Command, chars: "\x18\x10" } - { key: Semicolon, mods: Command, chars: "\x18\x0e" } - { key: F, mods: Shift|Command, chars: "\x18\x09" } - - { key: F, mods: Command, action: SearchForward } - { key: E, mods: Command, chars: "\x18\x09" } - { key: N, mods: Command, chars: "\x18\x6e" } - { key: P, mods: Command, chars: "\x18\x70" } @@ -194,3 +197,25 @@ key_bindings: - { key: I, mods: Command, chars: "\x18\x21" } - { key: I, mods: Shift|Command, chars: "\x18\x24" } + # Tmux + - { key: D, mods: Command, chars: "\x06\x76" } + - { key: D, mods: Command|Shift, chars: "\x06\x73" } + - { key: W, mods: Command, chars: "\x06\x78" } + - { key: H, mods: Command, chars: "\x06\x68" } + - { key: J, mods: Command, chars: "\x06\x6a" } + - { key: K, mods: Command, chars: "\x06\x6b" } + - { key: L, mods: Command, chars: "\x06\x6c" } + - { key: T, mods: Command, chars: "\x06\x63" } + - { key: Key1, mods: Command, chars: "\x06\x31" } + - { key: Key2, mods: Command, chars: "\x06\x32" } + - { key: Key3, mods: Command, chars: "\x06\x33" } + - { key: Key4, mods: Command, chars: "\x06\x34" } + - { key: Key5, mods: Command, chars: "\x06\x35" } + - { key: Key6, mods: Command, chars: "\x06\x36" } + - { key: Key7, mods: Command, chars: "\x06\x37" } + - { key: Key8, mods: Command, chars: "\x06\x38" } + - { key: Key9, mods: Command, chars: "\x06\x39" } + - { key: Left, mods: Command, chars: "\x07\x51" } + - { key: Down, mods: Command, chars: "\x06\x4a" } + - { key: Up, mods: Command, chars: "\x06\x4b" } + - { key: Right, mods: Command, chars: "\x06\x4c" } diff --git a/.tmux.conf b/.tmux.conf index 91f17e1..1d865e8 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -12,27 +12,32 @@ bind-key h select-pane -L bind-key j select-pane -D bind-key k select-pane -U bind-key l select-pane -R -set -g window-size latest -setw -g aggressive-resize on +# set -g window-size latest +# setw -g aggressive-resize on bind r source-file ~/.tmux.conf; -set-hook -g after-kill-pane 'select-layout -E' -set-hook -g pane-exited 'select-layout -E' +# set-hook -g after-kill-pane 'select-layout -E' +# set-hook -g pane-exited 'select-layout -E' set-hook -g window-pane-changed 'select-layout -E' +set-hook -g client-resized 'select-layout -E' set -g mouse on set -g default-terminal "screen-256color" set -ag terminal-overrides ",xterm-256color:RGB" set-option -g status-position top set -g pane-border-lines "heavy" -set -s escape-time 0 +set -s escape-time 100 set -g base-index 0 set -g pane-active-border-style "bg=#000000,fg=white" set -g pane-border-style "bg=#000000,fg=white" set -g focus-events on -set-hook -g pane-focus-out 'select-pane -P bg=colour235,fg=colour10' +#set-hook -g pane-focus-out 'select-pane -P bg=colour235,fg=colour10' +#set-hook -g pane-focus-in 'select-pane -P bg=default,fg=default' + +# set-hook -g pane-focus-out 'select-pane -P bg=colour233,fg=colour10' +set-hook -g pane-focus-out 'select-pane -P bg=colour233,fg=default' set-hook -g pane-focus-in 'select-pane -P bg=default,fg=default' # List of plugins diff --git a/.zshrc b/.zshrc index e515a3c..29fc1dd 100644 --- a/.zshrc +++ b/.zshrc @@ -4,6 +4,7 @@ if [ "$TERM_PROGRAM" = "WarpTerminal" ] && [ "$TERMINAL_EMULATOR" != "JetBrains- printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "zsh"}}\x9c' fi +PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH" export PATH="$HOME/.jenv/bin:$PATH" export PATH="~/renuo/personal/rails-generator/bin:$PATH" export PATH="~/.asdf/shims/:$PATH" @@ -36,18 +37,7 @@ function ot() { ~/scripts/open-ticket-in-browser.ts } function prt() { ~/scripts/get-pr-template.ts } function cpt() { ~/scripts/copy-ticket-number.ts } function rsf() { bundle exec rspec $(find spec/**/*_spec.rb | fzf --preview 'bat --color "always" {}') } # [r]spec [s]earch [f]ile - -function search_history() { - local selected_command=$( cat $HISTFILE | sort -u | fzf ) - - if [ -z "$selected_command" ]; then - echo "No command selected." - return 1 - fi - - echo "Executing: $selected_command" - eval "$selected_command" -} +function vg() { nvim $(fzf) } # [v]im [g]rep reimport_abbr() { rm -rf $ABBR_TMPDIR @@ -79,6 +69,7 @@ alias calacritty='nvim ~/.config/alacritty/alacritty.yml' alias ctmux='nvim ~/.tmux.conf' alias clazygit='nvim ~/Library/Application\ Support/lazygit/config.yml' alias v='nvim' +alias cpp='pbcopy' alias g="grep" # [g]rep alias bra="bundle exec rubocop -A" # [b]undle exec [r]ubocop -[A] alias spec="be rspec" diff --git a/my-status-bar.tmux b/my-status-bar.tmux index 125ee76..8d5c4b0 100755 --- a/my-status-bar.tmux +++ b/my-status-bar.tmux @@ -24,12 +24,14 @@ background="#[fg=$color2,bg=$color1]" title="#W:#I" tmux_set status-fg "$color2" tmux_set status-bg "$color1" -# tmux_set window-status-format "$secondary""$primary$title""$secondary""" -# tmux_set window-status-format "$secondary"" $primary$title""$secondary""" -# tmux_set window-status-current-format "$secondary""$primary $title ""$secondary""" -tmux_set window-status-current-format "#[underscore]$title" -tmux_set window-status-format "$title" -tmux_set window-status-separator " | " +# tmux_set window-status-current-format "#[underscore]$title" +# tmux_set window-status-format "$title" +# tmux_set window-status-separator " | " + +tmux_set window-status-current-format "#[bg=white,fg=black] $title " +tmux_set window-status-format "#[bg=black] $title " +tmux_set window-status-separator " " + #    cmd="#[fg=orange]#{pane_current_command}" path="#(echo #{pane_current_path} | sed 's#$HOME#~#g')" @@ -37,7 +39,8 @@ ruby_version=$(ruby -v | awk '{print $2}') ruby="#[fg=red] $ruby_version" tmux_set status-left " #H [#S] " -tmux_set status-right "#{prefix_highlight} $cmd $path $ruby" +# tmux_set status-right "#{prefix_highlight} $cmd $path $ruby" +tmux_set status-right "#{prefix_highlight} $cmd $path" # Window status style # tmux_set window-status-style "fg=$tertiary,bg=$primary,none" # tmux_set window-status-last-style "fg=$tertiary,bg=$primary,bold" diff --git a/scripts/open-ticket-in-browser.ts b/scripts/open-ticket-in-browser.ts index e0bf9e1..49efaee 100755 --- a/scripts/open-ticket-in-browser.ts +++ b/scripts/open-ticket-in-browser.ts @@ -1,14 +1,14 @@ #!/usr/bin/env bun -import {exec, execSync} from 'child_process'; +import { exec, execSync } from 'child_process'; const pipe = (...fns: Array<(arg: T) => T>) => (value: T) => fns.reduce((acc, fn) => fn(acc), value); try { - execSync('git status') + execSync('git status') } catch (e) { - console.log('Not a git repository') - process.exit(1) + console.log('Not a git repository') + process.exit(1) } const redmineBaseUrl = 'https://redmine.renuo.ch/issues/' diff --git a/scripts/pretty-pulls.ts b/scripts/pretty-pulls.ts new file mode 100755 index 0000000..fe5c205 --- /dev/null +++ b/scripts/pretty-pulls.ts @@ -0,0 +1,64 @@ +#!/usr/bin/env bun + +/* +Example usage: + +curl -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $(echo $GITHUB_REST_TOKEN)" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/renuo/khw2/pulls\?state=all | ./pretty-pulls.ts > file.html && open file.html +*/ + +let data = ''; + +process.stdin.resume(); +process.stdin.setEncoding('utf8'); + +process.stdin.on('data', (chunk) => { + data += chunk; +}); + +type PullRequest = { + html_url: string + number: number + title: string + user: { login: string } +} + +const prs: { username: string, url: string, number: number, title: string }[] = [] + +process.stdin.on('end', () => { + try { + const pulls = JSON.parse(data) as PullRequest[] + pulls.forEach(pull => { + const { title, number, html_url, user } = pull + prs.push({ title, number, url: html_url, username: user.login }) + }) + + console.log(` + + + + + +${prs.map(pr => {) + }.join('') + +${prs.map(pr => { + return ` + + +`}).join('')} +
#${pr.number}
+ + +`) + } catch (e) { + console.error(e); + } +}) + From 43934d964c4b4c0b9b6a4f1727f0943f16f66c32 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Thu, 18 Apr 2024 16:57:07 +0200 Subject: [PATCH 034/280] Update color scheme --- .config/alacritty/alacritty.yml | 96 ++++++++------------------------- my-status-bar.tmux | 22 +++++--- 2 files changed, 37 insertions(+), 81 deletions(-) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index efcec69..6b2136e 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -15,84 +15,32 @@ window: y: 10 colors: - # Default colors primary: - background: "#000000" # base - foreground: "#CAD3F5" # text - # Bright and dim foreground colors - dim_foreground: "#CAD3F5" # text - bright_foreground: "#CAD3F5" # text - - # Cursor colors - cursor: - text: "#24273A" # base - cursor: "#F4DBD6" # rosewater - vi_mode_cursor: - text: "#24273A" # base - cursor: "#B7BDF8" # lavender - - # Search colors - search: - matches: - foreground: "#24273A" # base - background: "#A5ADCB" # subtext0 - focused_match: - foreground: "#24273A" # base - background: "#A6DA95" # green - footer_bar: - foreground: "#24273A" # base - background: "#A5ADCB" # subtext0 - - # Keyboard regex hints - hints: - start: - foreground: "#24273A" # base - background: "#EED49F" # yellow - end: - foreground: "#24273A" # base - background: "#A5ADCB" # subtext0 - - # Selection colors - selection: - text: "#24273A" # base - background: "#F4DBD6" # rosewater - - # Normal colors + background: "#1a1b26" + foreground: "#c0caf5" normal: - black: "#494D64" # surface1 - red: "#ED8796" # red - green: "#A6DA95" # green - yellow: "#EED49F" # yellow - blue: "#494D64" # blue - magenta: "#b884aa" # pink - cyan: "#5b8a83" # teal - white: "#B8C0E0" # subtext1 - - # Bright colors + black: "#15161e" + red: "#f7768e" + green: "#9ece6a" + yellow: "#e0af68" + blue: "#7aa2f7" + magenta: "#bb9af7" + cyan: "#7dcfff" + white: "#a9b1d6" bright: - black: "#5B6078" # surface2 - red: "#ED8796" # red - green: "#A6DA95" # green - yellow: "#EED49F" # yellow - blue: "#8AADF4" # blue - magenta: "#F5BDE6" # pink - cyan: "#8BD5CA" # teal - white: "#A5ADCB" # subtext0 - - # Dim colors - dim: - black: "#494D64" # surface1 - red: "#ED8796" # red - green: "#A6DA95" # green - yellow: "#EED49F" # yellow - blue: "#8AADF4" # blue - magenta: "#F5BDE6" # pink - cyan: "#8BD5CA" # teal - white: "#B8C0E0" # subtext1 - + black: "#414868" + red: "#f7768e" + green: "#9ece6a" + yellow: "#e0af68" + blue: "#7aa2f7" + magenta: "#bb9af7" + cyan: "#7dcfff" + white: "#c0caf5" indexed_colors: - - { index: 16, color: "#9c715a" } - - { index: 17, color: "#F4DBD6" } + - index: 16 + color: "#ff9e64" + - index: 17 + color: "#db4b4b" env: TERM: xterm-256color diff --git a/my-status-bar.tmux b/my-status-bar.tmux index 8d5c4b0..3cff16c 100755 --- a/my-status-bar.tmux +++ b/my-status-bar.tmux @@ -13,8 +13,9 @@ tmux_set() { tmux set-option -gq "$1" "$2" } -color1="#000000" -color2="white" +color1="#1a1b25" +color2="colour68" +color3="black" secondary="#[fg=$color2,bg=$color1]" tertiary="#[fg=orange,bg=$color1]" @@ -22,15 +23,21 @@ primary="#[fg=$color1,bg=$color2]" background="#[fg=$color2,bg=$color1]" title="#W:#I" -tmux_set status-fg "$color2" +# tmux_set status-fg "$colork" +# tmux_set status-bg "$color1" tmux_set status-bg "$color1" +tmux_set status-fg "white" # tmux_set window-status-current-format "#[underscore]$title" # tmux_set window-status-format "$title" # tmux_set window-status-separator " | " -tmux_set window-status-current-format "#[bg=white,fg=black] $title " -tmux_set window-status-format "#[bg=black] $title " -tmux_set window-status-separator " " +# tmux_set window-status-format "#[bg=black] $title " +# tmux_set window-status-current-format "#[bg=khite,fg=black] $title " +# tmux_set window-status-separator " " + +tmux_set window-status-current-format "#[bg=$color1,fg=$color2]#[bg=$color2,fg=$color3] $title #[bg=$color1,fg=$color2]" +tmux_set window-status-separator "" +tmux_set window-status-format "#[bg=$color1,fg=$color3]#[bg=$color3,fg=$color2] $title #[bg=$color1,fg=$color3]" #    cmd="#[fg=orange]#{pane_current_command}" @@ -38,7 +45,8 @@ path="#(echo #{pane_current_path} | sed 's#$HOME#~#g')" ruby_version=$(ruby -v | awk '{print $2}') ruby="#[fg=red] $ruby_version" -tmux_set status-left " #H [#S] " +# tmux_set status-left " #H [#S] " +tmux_set status-left "" # tmux_set status-right "#{prefix_highlight} $cmd $path $ruby" tmux_set status-right "#{prefix_highlight} $cmd $path" # Window status style From 2acbdc17851aa922eb96ca4f9b07b4fdbeae3f4d Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Thu, 18 Apr 2024 17:55:00 +0200 Subject: [PATCH 035/280] Add some cool plugins --- .config/nvim/lazy-lock.json | 4 +-- .config/nvim/lazyvim.json | 1 - .config/nvim/lua/config/keymaps.lua | 1 + .config/nvim/lua/plugins/essential.lua | 35 +++++++++++++++++++++++ .config/nvim/lua/plugins/lsp.lua | 14 +++++++++ .config/nvim/lua/plugins/rails.lua | 39 +++++++++++++++----------- .tmux.conf | 19 +++++++------ .zshrc | 19 +++++++++++++ my-status-bar.tmux | 4 +-- 9 files changed, 106 insertions(+), 30 deletions(-) create mode 100644 .config/nvim/lua/plugins/lsp.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index ce0150e..b538230 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -5,7 +5,6 @@ "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, "catppuccin": { "branch": "main", "commit": "02bdd749931a5d739063562e57531c118e081882" }, "cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" }, - "cheatsheet.nvim": { "branch": "master", "commit": "9716f9aaa94dd1fd6ce59b5aae0e5f25e2a463ef" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, @@ -15,6 +14,7 @@ "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" }, "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, + "easypick.nvim": { "branch": "main", "commit": "3ce209d05d402ba40e29e6b69b759eb8421b145a" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, @@ -64,10 +64,10 @@ "nvim-ts-context-commentstring": { "branch": "main", "commit": "734ebad31c81c6198dfe102aa23280937c937c42" }, "nvim-web-devicons": { "branch": "master", "commit": "fd4abfc5237246670977972c6f518186b621a32d" }, "octo.nvim": { "branch": "master", "commit": "a511b52fbf040f928a24deb72e17ec465613b442" }, + "oil.nvim": { "branch": "master", "commit": "e89a8f8adeef2dfab851fd056d38ee7afc97c249" }, "other.nvim": { "branch": "main", "commit": "301671214246963cd6b398c177e130cff81451d9" }, "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, - "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" }, "ror.nvim": { "branch": "main", "commit": "9d31ad3953be83ac8dd542725ca4881c861f64a5" }, "speedtyper.nvim": { "branch": "main", "commit": "2d158eed4c753995b0501a3a7a72464fbb213e3d" }, diff --git a/.config/nvim/lazyvim.json b/.config/nvim/lazyvim.json index 66dee23..34e2eac 100644 --- a/.config/nvim/lazyvim.json +++ b/.config/nvim/lazyvim.json @@ -2,7 +2,6 @@ "extras": [ "lazyvim.plugins.extras.coding.copilot", "lazyvim.plugins.extras.coding.yanky", - "lazyvim.plugins.extras.editor.dial", "lazyvim.plugins.extras.editor.harpoon2", "lazyvim.plugins.extras.lang.json", "lazyvim.plugins.extras.lang.markdown", diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index 25d0ba4..1efc225 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -5,3 +5,4 @@ vim.keymap.set("n", "", "lua require('flash').jump()") vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) vim.keymap.set("n", "?", "Telescope keymaps") +vim.keymap.set("n", "@", "@q") diff --git a/.config/nvim/lua/plugins/essential.lua b/.config/nvim/lua/plugins/essential.lua index 6b79b81..68bddf2 100644 --- a/.config/nvim/lua/plugins/essential.lua +++ b/.config/nvim/lua/plugins/essential.lua @@ -10,6 +10,41 @@ return { require("oil").setup() end, }, + { + "axkirillov/easypick.nvim", + config = function() + local easypick = require("easypick") + easypick.setup({ + pickers = { + -- add your custom pickers here + -- below you can find some examples of what those can look like + + -- list files inside current folder with default previewer + { + name = "routes", + previewer = easypick.previewers.default(), + command = "cached_routes", + }, + + { + -- name for your custom picker, that can be invoked using :Easypick (supports tab completion) + name = "ls", + -- the command to execute, output has to be a list of plain text entries + command = "ls", + -- specify your custom previwer, or use one of the easypick.previewers + previewer = easypick.previewers.default(), + }, + + -- list files that have conflicts with diffs in preview + { + name = "conflicts", + command = "git diff --name-only --diff-filter=U --relative", + previewer = easypick.previewers.file_diff(), + }, + }, + }) + end, + }, { "zbirenbaum/copilot-cmp", lazy = true, diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..7b11a8d --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,14 @@ +return { + { + "neovim/nvim-lspconfig", + opts = { + servers = { + ltex = { + cmd = { "ltex-ls" }, + filetypes = { "markdown", "text", "cff", "tex" }, + flags = { debounce_text_changes = 299 }, + }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/rails.lua b/.config/nvim/lua/plugins/rails.lua index 826fc93..1d1c5b5 100644 --- a/.config/nvim/lua/plugins/rails.lua +++ b/.config/nvim/lua/plugins/rails.lua @@ -39,23 +39,28 @@ return { opts = { ---@type lspconfig.options servers = { - -- solargraph = { - -- settings = { - -- solargraph = { - -- useBundler = false, - -- autoformat = false, - -- -- bundlerPath = "bundle", - -- diagnostics = true, - -- completion = true, - -- formatting = false, - -- definitions = true, - -- symbols = true, - -- rename = true, - -- transport = "stdio", - -- logLevel = "warn", - -- }, - -- }, - -- }, + erblint = { + cmd = { "erblint", "lint" }, + filetypes = { "erb" }, + root_dir = require("lspconfig.util").root_pattern(".git", "app", "config", "db", "lib", "test"), + }, + solargraph = { + settings = { + solargraph = { + useBundler = false, + autoformat = false, + -- bundlerPath = "bundle", + diagnostics = true, + completion = true, + formatting = false, + definitions = true, + symbols = true, + rename = true, + transport = "stdio", + logLevel = "warn", + }, + }, + }, }, }, }, diff --git a/.tmux.conf b/.tmux.conf index 1d865e8..96ff4a7 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,7 +1,9 @@ unbind C-b -set -g prefix C-a +set -g prefix C-s bind a send-prefix +bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." + bind - split-window -v unbind '"' unbind % @@ -19,18 +21,18 @@ bind r source-file ~/.tmux.conf; # set-hook -g after-kill-pane 'select-layout -E' # set-hook -g pane-exited 'select-layout -E' -set-hook -g window-pane-changed 'select-layout -E' -set-hook -g client-resized 'select-layout -E' +# set-hook -g window-pane-changed 'select-layout -E' +# set-hook -g client-resized 'select-layout -E' set -g mouse on set -g default-terminal "screen-256color" set -ag terminal-overrides ",xterm-256color:RGB" set-option -g status-position top set -g pane-border-lines "heavy" -set -s escape-time 100 -set -g base-index 0 -set -g pane-active-border-style "bg=#000000,fg=white" -set -g pane-border-style "bg=#000000,fg=white" +set -s escape-time 1 +set -g base-index 4 +set -g pane-active-border-style "bg=black,fg=white" +set -g pane-border-style "bg=black,fg=white" set -g focus-events on #set-hook -g pane-focus-out 'select-pane -P bg=colour235,fg=colour10' @@ -44,6 +46,7 @@ set-hook -g pane-focus-in 'select-pane -P bg=default,fg=default' set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-prefix-highlight' +set -g @plugin 'jimeh/tmuxifier' run-shell "~/my-status-bar.tmux" # set -g @plugin 'erikw/tmux-powerline' @@ -60,6 +63,6 @@ run-shell "~/my-status-bar.tmux" # Power # set -g @plugin 'wfxr/tmux-power' -# set -g @tmux_power_theme '#999999' +# set -g @tmux_power_theme '#1000001' run '~/.tmux/plugins/tpm/tpm' diff --git a/.zshrc b/.zshrc index 29fc1dd..b1b8c0b 100644 --- a/.zshrc +++ b/.zshrc @@ -1,10 +1,13 @@ source ~/.import-secrets.sh +set -o vi + if [ "$TERM_PROGRAM" = "WarpTerminal" ] && [ "$TERMINAL_EMULATOR" != "JetBrains-JediTerm" ]; then printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "zsh"}}\x9c' fi PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH" +export PATH="$HOME/.tmux/plugins/tmuxifier/bin:$PATH" export PATH="$HOME/.jenv/bin:$PATH" export PATH="~/renuo/personal/rails-generator/bin:$PATH" export PATH="~/.asdf/shims/:$PATH" @@ -23,6 +26,7 @@ source "$HOME/.cargo/env" source /opt/homebrew/opt/asdf/libexec/asdf.sh eval "$(fzf --zsh)" +eval "$(tmuxifier init -)" alias ls="eza" alias l="eza -lah" @@ -39,6 +43,20 @@ function cpt() { ~/scripts/copy-ticket-number.ts } function rsf() { bundle exec rspec $(find spec/**/*_spec.rb | fzf --preview 'bat --color "always" {}') } # [r]spec [s]earch [f]ile function vg() { nvim $(fzf) } # [v]im [g]rep +function cached_routes() { + if ( [ ! -f config/routes.rb ]); then + echo "No routes file found" + return "Empty" + fi + + + if ( [ ! -f tmp/cache/routes-$(md5 -q config/routes.rb).txt ] ); then + bundle exec rails routes > tmp/cache/routes-$(md5 -q config/routes.rb).txt + fi + + cat tmp/cache/routes-$(md5 -q config/routes.rb).txt +} + reimport_abbr() { rm -rf $ABBR_TMPDIR rm $ABBR_USER_ABBREVIATIONS_FILE @@ -68,6 +86,7 @@ alias zshrc='nvim ~/.zshrc' # Idea from Chris alias calacritty='nvim ~/.config/alacritty/alacritty.yml' alias ctmux='nvim ~/.tmux.conf' alias clazygit='nvim ~/Library/Application\ Support/lazygit/config.yml' +alias cgit='nvim ~/.gitconfig' alias v='nvim' alias cpp='pbcopy' alias g="grep" # [g]rep diff --git a/my-status-bar.tmux b/my-status-bar.tmux index 3cff16c..c20f078 100755 --- a/my-status-bar.tmux +++ b/my-status-bar.tmux @@ -35,9 +35,9 @@ tmux_set status-fg "white" # tmux_set window-status-current-format "#[bg=khite,fg=black] $title " # tmux_set window-status-separator " " -tmux_set window-status-current-format "#[bg=$color1,fg=$color2]#[bg=$color2,fg=$color3] $title #[bg=$color1,fg=$color2]" +tmux_set window-status-current-format "#[bg=$color1,fg=$color2]#[bg=$color2,fg=$color3] $title #[bg=$color1,fg=$color2]" tmux_set window-status-separator "" -tmux_set window-status-format "#[bg=$color1,fg=$color3]#[bg=$color3,fg=$color2] $title #[bg=$color1,fg=$color3]" +tmux_set window-status-format "#[bg=$color1,fg=$color3]#[bg=$color3,fg=$color2] $title #[bg=$color1,fg=$color3]" #    cmd="#[fg=orange]#{pane_current_command}" From 5ae4ffead9cadf68e815c372bb6612e3eaebb18e Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Thu, 18 Apr 2024 19:50:54 +0200 Subject: [PATCH 036/280] Add something --- .config/nvim/lazy-lock.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index b538230..3ffafb6 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -81,6 +81,7 @@ "tokyonight.nvim": { "branch": "main", "commit": "9bf9ec53d5e87b025e2404069b71e7ebdc3a13e5" }, "train.nvim": { "branch": "master", "commit": "87a45f805497e7e929702c75187704de8990de14" }, "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, + "vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" }, "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, "vim-bundler": { "branch": "master", "commit": "c261509e78fc8dc55ad1fcf3cd7cdde49f35435c" }, "vim-dispatch": { "branch": "master", "commit": "4c695bc052cad2ae6b980aebbe48d046466e27ae" }, From 0dfbd6409587c0733ef93f94f709871be4120938 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 28 Apr 2024 22:32:57 +0200 Subject: [PATCH 037/280] Simplify nvim config --- .config/nvim/LICENSE | 201 ------------------------- .config/nvim/README.md | 4 - .config/nvim/init.lua | 39 ++++- .config/nvim/lazy-lock.json | 101 +------------ .config/nvim/lazyvim.json | 19 --- .config/nvim/lua/config/autocmds.lua | 3 - .config/nvim/lua/config/keymaps.lua | 8 - .config/nvim/lua/config/lazy.lua | 49 ------ .config/nvim/lua/config/options.lua | 3 - .config/nvim/lua/plugins/essential.lua | 131 ---------------- .config/nvim/lua/plugins/fun.lua | 20 --- .config/nvim/lua/plugins/git.lua | 26 ---- .config/nvim/lua/plugins/help.lua | 12 -- .config/nvim/lua/plugins/lsp.lua | 14 -- .config/nvim/lua/plugins/other.lua | 24 --- .config/nvim/lua/plugins/rails.lua | 190 ----------------------- .config/nvim/lua/plugins/themes.lua | 33 ---- .config/nvim/lua/plugins/ui.lua | 126 ---------------- .config/nvim/stylua.toml | 3 - 19 files changed, 42 insertions(+), 964 deletions(-) delete mode 100644 .config/nvim/LICENSE delete mode 100644 .config/nvim/README.md delete mode 100644 .config/nvim/lazyvim.json delete mode 100644 .config/nvim/lua/config/autocmds.lua delete mode 100644 .config/nvim/lua/config/keymaps.lua delete mode 100644 .config/nvim/lua/config/lazy.lua delete mode 100644 .config/nvim/lua/config/options.lua delete mode 100644 .config/nvim/lua/plugins/essential.lua delete mode 100644 .config/nvim/lua/plugins/fun.lua delete mode 100644 .config/nvim/lua/plugins/git.lua delete mode 100644 .config/nvim/lua/plugins/help.lua delete mode 100644 .config/nvim/lua/plugins/lsp.lua delete mode 100644 .config/nvim/lua/plugins/other.lua delete mode 100644 .config/nvim/lua/plugins/rails.lua delete mode 100644 .config/nvim/lua/plugins/themes.lua delete mode 100644 .config/nvim/lua/plugins/ui.lua delete mode 100644 .config/nvim/stylua.toml diff --git a/.config/nvim/LICENSE b/.config/nvim/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/.config/nvim/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/.config/nvim/README.md b/.config/nvim/README.md deleted file mode 100644 index 185280b..0000000 --- a/.config/nvim/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# 💤 LazyVim - -A starter template for [LazyVim](https://github.com/LazyVim/LazyVim). -Refer to the [documentation](https://lazyvim.github.io/installation) to get started. diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index ebd6419..a2dabda 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,6 +1,39 @@ --- bootstrap lazy.nvim, LazyVim and your plugins -require("config.lazy") - vim.opt.title = true vim.opt.titlelen = 0 vim.opt.titlestring = 'nvim %{expand("%:p")}' +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" +vim.opt.termguicolors = true + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end + +vim.opt.rtp:prepend(lazypath) + +local plugins = { +{ "sainnhe/sonokai", priority = 9999 }, + "folke/which-key.nvim", + "christoomey/vim-tmux-navigator", + { "folke/neoconf.nvim", cmd = "Neoconf" }, + "folke/neodev.nvim", +} + +local opts = {} + +require("lazy").setup(plugins, opts) + +vim.g.sonokai_better_performance = 1 +vim.g.sonokai_style = 'andromeda' +vim.cmd.colorscheme "sonokai" + + + diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 3ffafb6..5b92b20 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,98 +1,9 @@ { - "LazyVim": { "branch": "main", "commit": "5646ee5191da244ff8ea57b9dba8a7e0d1dbdd42" }, - "LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" }, - "SchemaStore.nvim": { "branch": "main", "commit": "1cfa6871f0374b21e894aad646366e89a747107e" }, - "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, - "catppuccin": { "branch": "main", "commit": "02bdd749931a5d739063562e57531c118e081882" }, - "cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" }, - "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, - "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, - "dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" }, - "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, - "easypick.nvim": { "branch": "main", "commit": "3ce209d05d402ba40e29e6b69b759eb8421b145a" }, - "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, - "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, - "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, - "gitsigns.nvim": { "branch": "main", "commit": "1a50b94066def8591d5f65bd60a4233902e9def4" }, - "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, - "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, - "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, - "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, - "luarocks.nvim": { "branch": "main", "commit": "d73f4bbbeea9eeb9b66a0c6431db402654f43cb8" }, - "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" }, - "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, - "mini.ai": { "branch": "main", "commit": "ee9446a17c160aba6a04ff22097389c41872c878" }, - "mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" }, - "mini.comment": { "branch": "main", "commit": "5707e22dd38f7b0d0ea7b273a43948fe203ff3a4" }, - "mini.indentscope": { "branch": "main", "commit": "cf07f19e718ebb0bcc5b00999083ce11c37b8d40" }, - "mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" }, - "mini.starter": { "branch": "main", "commit": "a9497931da60bbf04180077ee452ccf3e57af9bd" }, - "mini.surround": { "branch": "main", "commit": "49e0364b8c9a3258b485c5ece40bb0f3a5e94b1c" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "16d1b194376bf1fc2acd89ccb3c29ba8315bfcea" }, - "neoconf.nvim": { "branch": "main", "commit": "7b989fb3a180ec79b78a183d10e417b2fdeb3c05" }, + "catppuccin": { "branch": "main", "commit": "a1439ad7c584efb3d0ce14ccb835967f030450fe" }, + "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, + "neoconf.nvim": { "branch": "main", "commit": "ba3503e246ea687732e51f7f9878e653e2e2039b" }, "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, - "neoi18n": { "branch": "master", "commit": "87c645dadb195a65d6ee5a5e3513f259f4fb436b" }, - "neotest": { "branch": "master", "commit": "f03a78cef74db5638e4312e18b767294a90de8da" }, - "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, - "neotest-rspec": { "branch": "main", "commit": "c1c3f36e1b1a23698534e6326e90876f87b773a4" }, - "neotest-vitest": { "branch": "main", "commit": "102e7494bbe0f205d28c31a3fd75a9dfbcc78c73" }, - "noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" }, - "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, - "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, - "nvim-emmet": { "branch": "main", "commit": "928cfb74ed436d6d326ccab2061cf3592de1bf55" }, - "nvim-i18n-tools": { "branch": "master", "commit": "ab2f883e3d8e4abb90f3882aacdfd34067cafc24" }, - "nvim-lint": { "branch": "master", "commit": "3317b73ec3eb76cd8ca83e05880c07c83e368c1e" }, - "nvim-lspconfig": { "branch": "master", "commit": "e25c4cdecd3d58c0deccce0f372426c8c480bcce" }, - "nvim-lspimport": { "branch": "main", "commit": "9c1c61a5020faeb1863bb66eb4b2a9107e641876" }, - "nvim-nio": { "branch": "master", "commit": "5800f585def265d52f1d8848133217c800bcb25d" }, - "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, - "nvim-spectre": { "branch": "master", "commit": "2b012554a2536465243c0dff3605b5927c49ed23" }, - "nvim-surround": { "branch": "main", "commit": "18016d6af52edc9f1c794dcf6665a26a2962d2ee" }, - "nvim-treesitter": { "branch": "master", "commit": "fbe76211f45413feadb155a89073bf65b5766b2e" }, - "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, - "nvim-treesitter-endwise": { "branch": "master", "commit": "60e8c288e011403f248b5f6478dde12bed8a6c55" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "2aa454e4037424c678a8ff033951a5be39e54b9c" }, - "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "734ebad31c81c6198dfe102aa23280937c937c42" }, - "nvim-web-devicons": { "branch": "master", "commit": "fd4abfc5237246670977972c6f518186b621a32d" }, - "octo.nvim": { "branch": "master", "commit": "a511b52fbf040f928a24deb72e17ec465613b442" }, - "oil.nvim": { "branch": "master", "commit": "e89a8f8adeef2dfab851fd056d38ee7afc97c249" }, - "other.nvim": { "branch": "main", "commit": "301671214246963cd6b398c177e130cff81451d9" }, - "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, - "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, - "refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" }, - "ror.nvim": { "branch": "main", "commit": "9d31ad3953be83ac8dd542725ca4881c861f64a5" }, - "speedtyper.nvim": { "branch": "main", "commit": "2d158eed4c753995b0501a3a7a72464fbb213e3d" }, - "sqlite.lua": { "branch": "master", "commit": "b7e28c8463254c46a8e61c52d27d6a2040492fc3" }, - "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, - "telescope-rails.nvim": { "branch": "master", "commit": "d09155e33beaf252b6e1ca479437c00d1c6318d0" }, - "telescope.nvim": { "branch": "master", "commit": "d26b666b45e5dde23332e4bde1227677f2d92e31" }, - "text-case.nvim": { "branch": "main", "commit": "d62c63a4e9a996c7321885937ab89920fca2c1c8" }, - "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, - "tokyonight.nvim": { "branch": "main", "commit": "9bf9ec53d5e87b025e2404069b71e7ebdc3a13e5" }, - "train.nvim": { "branch": "master", "commit": "87a45f805497e7e929702c75187704de8990de14" }, - "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, - "vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" }, - "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, - "vim-bundler": { "branch": "master", "commit": "c261509e78fc8dc55ad1fcf3cd7cdde49f35435c" }, - "vim-dispatch": { "branch": "master", "commit": "4c695bc052cad2ae6b980aebbe48d046466e27ae" }, - "vim-distinguished": { "branch": "develop", "commit": "62b360dc81355b53d124cd06218a9ba2496563fc" }, - "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, - "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, - "vim-localorie": { "branch": "master", "commit": "9d4c7fc72c85c53668cde26b84845b28ad1c9945" }, - "vim-rails": { "branch": "master", "commit": "3a155462d1c346e291595400ca238037d02a357f" }, - "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, - "vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" }, - "vimtex": { "branch": "master", "commit": "ac0a41b297a70c101df89bc9c8d43341ba00fd4f" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, - "yanky.nvim": { "branch": "main", "commit": "6bb9ffd3cad4c9876bda54e19d0659de28a4f84f" } + "sonokai": { "branch": "master", "commit": "da162343354fbd9bf9cd49293a856f0e3761e8ac" }, + "vim-tmux-navigator": { "branch": "master", "commit": "a26954a585b02a2ac02f87145e204f8798a7cbc2" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/.config/nvim/lazyvim.json b/.config/nvim/lazyvim.json deleted file mode 100644 index 34e2eac..0000000 --- a/.config/nvim/lazyvim.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extras": [ - "lazyvim.plugins.extras.coding.copilot", - "lazyvim.plugins.extras.coding.yanky", - "lazyvim.plugins.extras.editor.harpoon2", - "lazyvim.plugins.extras.lang.json", - "lazyvim.plugins.extras.lang.markdown", - "lazyvim.plugins.extras.lang.ruby", - "lazyvim.plugins.extras.lang.tailwind", - "lazyvim.plugins.extras.lang.tex", - "lazyvim.plugins.extras.lang.typescript", - "lazyvim.plugins.extras.lang.yaml", - "lazyvim.plugins.extras.test.core" - ], - "news": { - "NEWS.md": "3314" - }, - "version": 3 -} \ No newline at end of file diff --git a/.config/nvim/lua/config/autocmds.lua b/.config/nvim/lua/config/autocmds.lua deleted file mode 100644 index 27e9e06..0000000 --- a/.config/nvim/lua/config/autocmds.lua +++ /dev/null @@ -1,3 +0,0 @@ --- Autocmds are automatically loaded on the VeryLazy event --- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua --- Add any additional autocmds here diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua deleted file mode 100644 index 1efc225..0000000 --- a/.config/nvim/lua/config/keymaps.lua +++ /dev/null @@ -1,8 +0,0 @@ --- Keymaps are automatically loaded on the VeryLazy event --- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua --- Add any additional keymaps here - -vim.keymap.set("n", "", "lua require('flash').jump()") -vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) -vim.keymap.set("n", "?", "Telescope keymaps") -vim.keymap.set("n", "@", "@q") diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua deleted file mode 100644 index 29e2672..0000000 --- a/.config/nvim/lua/config/lazy.lua +++ /dev/null @@ -1,49 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" - -if not (vim.uv or vim.loop).fs_stat(lazypath) then - -- bootstrap lazy.nvim - -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) -end -vim.opt.rtp:prepend(vim.env.LAZY or lazypath) - -require("lazy").setup({ - spec = { - -- add LazyVim and import its plugins - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, - -- import any extras modules here - -- { import = "lazyvim.plugins.extras.lang.typescript" }, - -- { import = "lazyvim.plugins.extras.lang.json" }, - -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, - -- import/override with your plugins - { import = "plugins" }, - { "nvimdev/dashboard-nvim", enabled = false }, - }, - defaults = { - -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. - -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. - lazy = false, - -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, - -- have outdated releases, which may break your Neovim install. - version = false, -- always use the latest git commit - -- version = "*", -- try installing the latest stable version for plugins that support semver - }, - install = { colorscheme = { "tokyonight", "habamax" } }, - checker = { enabled = true }, -- automatically check for plugin updates - performance = { - rtp = { - -- disable some rtp plugins - disabled_plugins = { - "gzip", - -- "matchit", - -- "matchparen", - -- "netrwPlugin", - "tarPlugin", - "tohtml", - -- "tutor", - "zipPlugin", - }, - }, - }, -}) diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua deleted file mode 100644 index 3ea1454..0000000 --- a/.config/nvim/lua/config/options.lua +++ /dev/null @@ -1,3 +0,0 @@ --- Options are automatically loaded before lazy.nvim startup --- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua --- Add any additional options here diff --git a/.config/nvim/lua/plugins/essential.lua b/.config/nvim/lua/plugins/essential.lua deleted file mode 100644 index 68bddf2..0000000 --- a/.config/nvim/lua/plugins/essential.lua +++ /dev/null @@ -1,131 +0,0 @@ -return { - { - "tpope/vim-repeat", - lazy = false, - }, - { - "stevearc/oil.nvim", - lazy = false, - config = function() - require("oil").setup() - end, - }, - { - "axkirillov/easypick.nvim", - config = function() - local easypick = require("easypick") - easypick.setup({ - pickers = { - -- add your custom pickers here - -- below you can find some examples of what those can look like - - -- list files inside current folder with default previewer - { - name = "routes", - previewer = easypick.previewers.default(), - command = "cached_routes", - }, - - { - -- name for your custom picker, that can be invoked using :Easypick (supports tab completion) - name = "ls", - -- the command to execute, output has to be a list of plain text entries - command = "ls", - -- specify your custom previwer, or use one of the easypick.previewers - previewer = easypick.previewers.default(), - }, - - -- list files that have conflicts with diffs in preview - { - name = "conflicts", - command = "git diff --name-only --diff-filter=U --relative", - previewer = easypick.previewers.file_diff(), - }, - }, - }) - end, - }, - { - "zbirenbaum/copilot-cmp", - lazy = true, - }, - { - "kylechui/nvim-surround", - version = "*", -- Use for stability; omit to use `main` branch for the latest features - event = "VeryLazy", - config = function() - require("nvim-surround").setup({ - -- Configuration here, or leave empty to use defaults - }) - end, - }, - { - "olrtg/nvim-emmet", - config = function() - vim.keymap.set({ "n", "v" }, "xe", require("nvim-emmet").wrap_with_abbreviation) - end, - }, - { "stevanmilic/nvim-lspimport" }, - { - "ThePrimeagen/refactoring.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - config = function() - require("refactoring").setup({}) - require("telescope").load_extension("refactoring") - - vim.keymap.set({ "n", "x" }, "rr", function() - require("telescope").extensions.refactoring.refactors() - end) - - vim.keymap.set("x", "re", ":Refactor extract ") - vim.keymap.set("x", "rf", ":Refactor extract_to_file ") - - vim.keymap.set("x", "rv", ":Refactor extract_var ") - - vim.keymap.set({ "n", "x" }, "ri", ":Refactor inline_var") - - vim.keymap.set("n", "rI", ":Refactor inline_func") - - vim.keymap.set("n", "rb", ":Refactor extract_block") - vim.keymap.set("n", "rbf", ":Refactor extract_block_to_file") - end, - }, - { - "folke/flash.nvim", - opts = { - ---@type table - modes = { - char = { - enabled = true, - }, - }, - }, - }, - { - "johmsalas/text-case.nvim", - dependencies = { "nvim-telescope/telescope.nvim" }, - config = function() - require("textcase").setup({}) - require("telescope").load_extension("textcase") - end, - keys = { - "ga", -- Default invocation prefix - { "ga.", "TextCaseOpenTelescope", mode = { "n", "x" }, desc = "Telescope" }, - }, - cmd = { - -- NOTE: The Subs command name can be customized via the option "substitude_command_name" - "Subs", - "TextCaseOpenTelescope", - "TextCaseOpenTelescopeQuickChange", - "TextCaseOpenTelescopeLSPChange", - "TextCaseStartReplacingCommand", - }, - -- If you want to use the interactive feature of the `Subs` command right away, text-case.nvim - -- has to be loaded on startup. Otherwise, the interactive feature of the `Subs` will only be - -- available after the first executing of it or after a keymap of text-case.nvim has been used. - lazy = true, - }, -} diff --git a/.config/nvim/lua/plugins/fun.lua b/.config/nvim/lua/plugins/fun.lua deleted file mode 100644 index 2492e32..0000000 --- a/.config/nvim/lua/plugins/fun.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - { - { - "Eandrju/cellular-automaton.nvim", - cmd = "CellularAutomaton", - }, - }, - { - "NStefan002/speedtyper.nvim", - cmd = "Speedtyper", - opts = { - -- your config - }, - }, - { "tjdevries/train.nvim" }, - { - "ThePrimeagen/vim-be-good", - cmd = "VimBeGood", - }, -} diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua deleted file mode 100644 index a771e1e..0000000 --- a/.config/nvim/lua/plugins/git.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - { - "tpope/vim-fugitive", - lazy = false, - }, - { - { - "pwntester/octo.nvim", - requires = { - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim", - -- OR 'ibhagwan/fzf-lua', - "nvim-tree/nvim-web-devicons", - }, - config = function() - require("octo").setup() - end, - }, - }, - { - "junkblocker/git-time-lapse", - config = function() - vim.keymap.set("n", "gt", "(git-time-lapse)", { noremap = false }) - end, - }, -} diff --git a/.config/nvim/lua/plugins/help.lua b/.config/nvim/lua/plugins/help.lua deleted file mode 100644 index 011dc47..0000000 --- a/.config/nvim/lua/plugins/help.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - -- { - -- "sudormrfbin/cheatsheet.nvim", - -- dependencies = { - -- { "nvim-telescope/telescope.nvim" }, - -- { "nvim-lua/popup.nvim" }, - -- { "nvim-lua/plenary.nvim" }, - -- }, - -- keys = { "?" }, - -- lazy = false, - -- }, -} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua deleted file mode 100644 index 7b11a8d..0000000 --- a/.config/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - { - "neovim/nvim-lspconfig", - opts = { - servers = { - ltex = { - cmd = { "ltex-ls" }, - filetypes = { "markdown", "text", "cff", "tex" }, - flags = { debounce_text_changes = 299 }, - }, - }, - }, - }, -} diff --git a/.config/nvim/lua/plugins/other.lua b/.config/nvim/lua/plugins/other.lua deleted file mode 100644 index 0599877..0000000 --- a/.config/nvim/lua/plugins/other.lua +++ /dev/null @@ -1,24 +0,0 @@ -return { - { - "tpope/vim-dispatch", - }, - { - "NvChad/nvim-colorizer.lua", - setup = function() - require("colorizer").setup({ - filetypes = { - "*", -- Highlight all files, but customize some others. - cmp_docs = { always_update = true }, - }, - }) - end, - }, - { - "vhyrro/luarocks.nvim", - priority = 1000, - config = true, - }, - { - "dstein64/vim-startuptime", - }, -} diff --git a/.config/nvim/lua/plugins/rails.lua b/.config/nvim/lua/plugins/rails.lua deleted file mode 100644 index 1d1c5b5..0000000 --- a/.config/nvim/lua/plugins/rails.lua +++ /dev/null @@ -1,190 +0,0 @@ -return { - { "tpope/vim-rails", lazy = false }, - { "namadnuno/neoi18n" }, - { - "airblade/vim-localorie", - }, - { - "valen20Chx/nvim-i18n-tools", - config = function() - require("nvim-i18n-tools").setup() - end, - }, - { - "weizheheng/ror.nvim", - config = function() - require("ror").setup() - end, - keys = { - { "rg", ":lua require('ror.commands').list_commands()", desc = "List Rails Commands" }, - }, - }, - { - "sato-s/telescope-rails.nvim", - config = function() - require("telescope").load_extension("rails") - end, - keys = { - { "rs", ":Telescope rails specs" }, - { "rc", ":Telescope rails controllers" }, - { "rm", ":Telescope rails models" }, - { "rv", ":Telescope rails views" }, - { "ri", ":Telescope rails migrations" }, - { "rl", ":Telescope rails libs" }, - }, - }, - { - "neovim/nvim-lspconfig", - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - erblint = { - cmd = { "erblint", "lint" }, - filetypes = { "erb" }, - root_dir = require("lspconfig.util").root_pattern(".git", "app", "config", "db", "lib", "test"), - }, - solargraph = { - settings = { - solargraph = { - useBundler = false, - autoformat = false, - -- bundlerPath = "bundle", - diagnostics = true, - completion = true, - formatting = false, - definitions = true, - symbols = true, - rename = true, - transport = "stdio", - logLevel = "warn", - }, - }, - }, - }, - }, - }, - { - "RRethy/nvim-treesitter-endwise", - lazy = true, - setup = function() - -- Requires nvim-treesitter installed - require("nvim-treesitter.configs").setup({ - endwise = { - enable = true, - }, - }) - end, - }, - { "tpope/vim-bundler" }, - { - "rgroli/other.nvim", - config = function() - require("other-nvim").setup({ - mappings = { - -- builtin mappings - "livewire", - "angular", - "laravel", - "rails", - "golang", - -- custom mapping - { - pattern = "/app/.+(.*)_controller.rb", - target = "/spec/request/%1_spec.rb", - transformer = "lowercase", - }, - }, - transformers = { - -- defining a custom transformer - lowercase = function(inputString) - return inputString:lower() - end, - }, - style = { - -- How the plugin paints its window borders - -- Allowed values are none, single, double, rounded, solid and shadow - border = "solid", - - -- Column seperator for the window - seperator = "|", - - -- width of the window in percent. e.g. 0.5 is 50%, 1.0 is 100% - width = 0.7, - - -- min height in rows. - -- when more columns are needed this value is extended automatically - minHeight = 2, - }, - }) - - vim.api.nvim_set_keymap("n", "ll", ":Other", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "ltn", ":OtherTabNew", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "lp", ":OtherSplit", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "lv", ":OtherVSplit", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "lc", ":OtherClear", { noremap = true, silent = true }) - - -- Context specific bindings - vim.api.nvim_set_keymap("n", "lt", ":Other test", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "ls", ":Other scss", { noremap = true, silent = true }) - end, - }, - { - { - "nvim-neotest/neotest", - dependencies = { - "haydenmeade/neotest-jest", - "marilari88/neotest-vitest", - "olimorris/neotest-rspec", - }, - keys = { - { - "tl", - function() - require("neotest").run.run_last() - end, - desc = "Run Last Test", - }, - { - "tL", - function() - require("neotest").run.run_last({ strategy = "dap" }) - end, - desc = "Debug Last Test", - }, - { - "tw", - "lua require('neotest').run.run({ jestCommand = 'jest --watch ' })", - desc = "Run Watch", - }, - }, - opts = function(_, opts) - table.insert( - opts.adapters, - require("neotest-jest")({ - jestCommand = "npm test --", - jestConfigFile = "custom.jest.config.ts", - env = { CI = true }, - cwd = function() - return vim.fn.getcwd() - end, - }) - ) - table.insert(opts.adapters, require("neotest-vitest")) - - table.insert( - opts.adapters, - require("neotest-rspec")({ - -- jestCommand = "npm test --", - -- jestConfigFile = "custom.jest.config.ts", - -- env = { CI = true }, - -- cwd = function() - -- return vim.fn.getcwd() - -- end, - }) - ) - table.insert(opts.adapters, require("neotest-rspec")) - end, - }, - }, -} diff --git a/.config/nvim/lua/plugins/themes.lua b/.config/nvim/lua/plugins/themes.lua deleted file mode 100644 index 9c18c38..0000000 --- a/.config/nvim/lua/plugins/themes.lua +++ /dev/null @@ -1,33 +0,0 @@ -vim.g.lazygit_floating_window_winblend = 0 -vim.g.lazygit_floating_window_scaling_factor = 0.5 - -return { - { - "folke/tokyonight.nvim", - opts = { - transparent = true, - styles = { - sidebars = "transparent", - floats = "transparent", - }, - }, - }, - { "Lokaltog/vim-distinguished" }, - { - "LazyVim/LazyVim", - opts = { - transparent = true, - colorscheme = "tokyonight", - }, - }, - { - "wk13eagle/telescope.nvim", - opts = { - pickers = { - colorscheme = { - enable_preview = true, - }, - }, - }, - }, -} diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua deleted file mode 100644 index f2ebf9e..0000000 --- a/.config/nvim/lua/plugins/ui.lua +++ /dev/null @@ -1,126 +0,0 @@ -return { - { - "rcarriga/nvim-notify", - opts = { - level = 3, - render = "minimal", - stages = "static", - }, - }, - { - "akinsho/bufferline.nvim", - lazy = false, - config = { - options = { - separator_style = "thin", - always_show_bufferline = true, - color_icons = false, - show_buffer_icons = false, - groups = { - items = { - require("bufferline.groups").builtin.pinned:with({ icon = "" }), - }, - }, - }, - }, - }, - { - "nvim-treesitter/nvim-treesitter", - dependencies = { "RRethy/nvim-treesitter-endwise" }, - opts = function(_, opts) - opts.endwise = { enable = true } - opts.indent = { enable = true, disable = { "yaml", "ruby" } } - opts.ensure_installed = { - "bash", - "embedded_template", - "html", - "javascript", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "ruby", - "tsx", - "typescript", - "vim", - "yaml", - } - end, - }, - { - "echasnovski/mini.starter", - version = false, -- wait till new 0.7.0 release to put it back on semver - event = "VimEnter", - opts = function() - local logo = table.concat({ - " ██████ █████ █████ █████ ███ ", - " ░░██████ ░░███ ░░███ ░░███ ░░░ ", - " ░███░███ ░███ ██████ ██████ ░███ ░███ ████ █████████████ ", - " ░███░░███░███ ███░░███ ███░░███ ░███ ░███ ░░███ ░░███░░███░░███ ", - " ░███ ░░██████ ░███████ ░███ ░███ ░░███ ███ ░███ ░███ ░███ ░███ ", - " ░███ ░░█████ ░███░░░ ░███ ░███ ░░░█████░ ░███ ░███ ░███ ░███ ", - " █████ ░░█████░░██████ ░░██████ ░░███ █████ █████░███ █████ ", - " ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ ", - }, "\n") - local pad = string.rep(" ", 22) - local new_section = function(name, action, section) - return { name = name, action = action, section = pad .. section } - end - - local starter = require("mini.starter") - --stylua: ignore - local config = { - evaluate_single = true, - header = logo, - items = { - new_section("Find file", "Telescope find_files", "Telescope"), - new_section("Recent files", "Telescope oldfiles", "Telescope"), - new_section("Grep text", "Telescope live_grep", "Telescope"), - new_section("Config", "lua require('lazyvim.util').telescope.config_files()()", "Config"), - new_section("Extras", "LazyExtras", "Config"), - new_section("Lazy", "Lazy", "Config"), - new_section("New file", "ene | startinsert", "Built-in"), - new_section("Quit", "qa", "Built-in"), - new_section("Session Restore", [[lua require("persistence").load()]], "Session"), - new_section("VimBeGood", "VimBeGood", "Training"), - new_section("Tutor", "Tutor", "Training"), - new_section("Peed Styper", "Speedtyper", "Training"), - }, - content_hooks = { - starter.gen_hook.adding_bullet(pad .. "░ ", false), - starter.gen_hook.aligning("center", "center"), - }, - } - return config - end, - config = function(_, config) - -- close Lazy and re-open when starter is ready - if vim.o.filetype == "lazy" then - vim.cmd.close() - vim.api.nvim_create_autocmd("User", { - pattern = "MiniStarterOpened", - callback = function() - require("lazy").show() - end, - }) - end - - local starter = require("mini.starter") - starter.setup(config) - - vim.api.nvim_create_autocmd("User", { - pattern = "LazyVimStarted", - callback = function() - local stats = require("lazy").stats() - local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) - local pad_footer = string.rep(" ", 8) - starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" - pcall(starter.refresh) - end, - }) - end, - }, -} diff --git a/.config/nvim/stylua.toml b/.config/nvim/stylua.toml deleted file mode 100644 index 5d6c50d..0000000 --- a/.config/nvim/stylua.toml +++ /dev/null @@ -1,3 +0,0 @@ -indent_type = "Spaces" -indent_width = 2 -column_width = 120 \ No newline at end of file From b37518d15bdd7a50d8fd4218f609063fbdbc518d Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 28 Apr 2024 22:59:58 +0200 Subject: [PATCH 038/280] Update tabstop --- .config/nvim/init.lua | 17 +++++++++++++++-- .config/nvim/lazy-lock.json | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index a2dabda..fa78cb9 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -3,8 +3,14 @@ vim.opt.titlelen = 0 vim.opt.titlestring = 'nvim %{expand("%:p")}' vim.g.mapleader = " " vim.g.maplocalleader = "\\" +vim.wo.number = true vim.opt.termguicolors = true +vim.opt.expandtab = true +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ @@ -20,17 +26,24 @@ end vim.opt.rtp:prepend(lazypath) local plugins = { -{ "sainnhe/sonokai", priority = 9999 }, + { "sainnhe/sonokai", priority = 9999 }, + { "nvim-treesitter/nvim-treesitter" }, "folke/which-key.nvim", "christoomey/vim-tmux-navigator", { "folke/neoconf.nvim", cmd = "Neoconf" }, "folke/neodev.nvim", } -local opts = {} +local opts = { + defaults = { + lazy = false + } +} require("lazy").setup(plugins, opts) +vim.keymap.set('n', 'l', 'Lazy') + vim.g.sonokai_better_performance = 1 vim.g.sonokai_style = 'andromeda' vim.cmd.colorscheme "sonokai" diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 5b92b20..c63ace3 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,8 +1,8 @@ { - "catppuccin": { "branch": "main", "commit": "a1439ad7c584efb3d0ce14ccb835967f030450fe" }, "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, "neoconf.nvim": { "branch": "main", "commit": "ba3503e246ea687732e51f7f9878e653e2e2039b" }, "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, + "nvim-treesitter": { "branch": "master", "commit": "19f69a5b434470723c32311cdc4d8d0e8db76358" }, "sonokai": { "branch": "master", "commit": "da162343354fbd9bf9cd49293a856f0e3761e8ac" }, "vim-tmux-navigator": { "branch": "master", "commit": "a26954a585b02a2ac02f87145e204f8798a7cbc2" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } From c3825debd098f1f04b635ef4ec8de0a013b473c6 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 28 Apr 2024 23:38:10 +0200 Subject: [PATCH 039/280] Add plugins --- .config/nvim/init.lua | 46 ++++++++++++++++++++++++++++++++++++- .config/nvim/lazy-lock.json | 5 ++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index fa78cb9..a70226a 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -11,6 +11,7 @@ vim.opt.tabstop = 2 vim.opt.softtabstop = 2 vim.opt.shiftwidth = 2 + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ @@ -28,7 +29,50 @@ vim.opt.rtp:prepend(lazypath) local plugins = { { "sainnhe/sonokai", priority = 9999 }, { "nvim-treesitter/nvim-treesitter" }, - "folke/which-key.nvim", + "christoomey/vim-system-copy", + { + 'nvim-telescope/telescope.nvim', tag = '0.1.6', + dependencies = { 'nvim-lua/plenary.nvim' }, + keys = { + { "ff", "Telescope find_files", desc = "Telescope File" }, + { "fg", "Telescope git_files", desc = "Telescope Git File" }, + { "fb", "Telescope buffers", desc = "Telescope Buffer" }, + { "fw", "Telescope live_grep", desc = "Telescope Grep" }, + { "fk", "Telescope keymaps", desc = "Telescope Keymap" }, + { "", "Telescope commands", desc = "Telescope Command" }, + } + }, + { + "kylechui/nvim-surround", + version = "*", + event = "VeryLazy", + config = function() + require("nvim-surround").setup({}) + end + }, + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 0 + end, + opts = {} + }, + { + "folke/flash.nvim", + event = "VeryLazy", + ---@type Flash.Config + opts = {}, + -- stylua: ignore + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, + }, "christoomey/vim-tmux-navigator", { "folke/neoconf.nvim", cmd = "Neoconf" }, "folke/neodev.nvim", diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index c63ace3..d330136 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,9 +1,14 @@ { + "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, "neoconf.nvim": { "branch": "main", "commit": "ba3503e246ea687732e51f7f9878e653e2e2039b" }, "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, + "nvim-surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" }, "nvim-treesitter": { "branch": "master", "commit": "19f69a5b434470723c32311cdc4d8d0e8db76358" }, + "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, "sonokai": { "branch": "master", "commit": "da162343354fbd9bf9cd49293a856f0e3761e8ac" }, + "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, + "vim-system-copy": { "branch": "master", "commit": "8abd9ed21016bdc21b458c79da3b9ac0ee25c1ce" }, "vim-tmux-navigator": { "branch": "master", "commit": "a26954a585b02a2ac02f87145e204f8798a7cbc2" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file From 67eeb1a81ad1b2bc52bd94c0d38384820b8b1d44 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 12:41:28 +0200 Subject: [PATCH 040/280] Update config --- .config/nvim/init.lua | 56 ++-- .config/nvim/lua/languages/markdown.lua | 8 + .config/nvim/lua/languages/rails.lua | 15 ++ .config/nvim/lua/plugins/coding.lua | 10 + .config/nvim/lua/plugins/editor.lua | 46 ++++ .config/nvim/lua/plugins/git.lua | 24 ++ .config/nvim/lua/plugins/lsp.lua | 335 ++++++++++++++++++++++++ .config/nvim/lua/plugins/navigation.lua | 17 ++ .config/nvim/lua/plugins/telescope.lua | 14 + 9 files changed, 484 insertions(+), 41 deletions(-) create mode 100644 .config/nvim/lua/languages/markdown.lua create mode 100644 .config/nvim/lua/languages/rails.lua create mode 100644 .config/nvim/lua/plugins/coding.lua create mode 100644 .config/nvim/lua/plugins/editor.lua create mode 100644 .config/nvim/lua/plugins/git.lua create mode 100644 .config/nvim/lua/plugins/lsp.lua create mode 100644 .config/nvim/lua/plugins/navigation.lua create mode 100644 .config/nvim/lua/plugins/telescope.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index a70226a..20658dd 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -11,6 +11,7 @@ vim.opt.tabstop = 2 vim.opt.softtabstop = 2 vim.opt.shiftwidth = 2 +vim.keymap.set('n', 'qq', 'wqa') local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then @@ -28,19 +29,17 @@ vim.opt.rtp:prepend(lazypath) local plugins = { { "sainnhe/sonokai", priority = 9999 }, - { "nvim-treesitter/nvim-treesitter" }, - "christoomey/vim-system-copy", { - 'nvim-telescope/telescope.nvim', tag = '0.1.6', - dependencies = { 'nvim-lua/plenary.nvim' }, - keys = { - { "ff", "Telescope find_files", desc = "Telescope File" }, - { "fg", "Telescope git_files", desc = "Telescope Git File" }, - { "fb", "Telescope buffers", desc = "Telescope Buffer" }, - { "fw", "Telescope live_grep", desc = "Telescope Grep" }, - { "fk", "Telescope keymaps", desc = "Telescope Keymap" }, - { "", "Telescope commands", desc = "Telescope Command" }, - } + "nvim-telescope/telescope.nvim", tag = "0.1.6", + dependencies = { "nvim-lua/plenary.nvim" }, + keys = { + { "ff", "Telescope find_files", desc = "Telescope File" }, + { "fg", "Telescope git_files", desc = "Telescope Git File" }, + { "fb", "Telescope buffers", desc = "Telescope Buffer" }, + { "fw", "Telescope live_grep", desc = "Telescope Grep" }, + { "fk", "Telescope keymaps", desc = "Telescope Keymap" }, + { "", "Telescope commands", desc = "Telescope Command" }, + } }, { "kylechui/nvim-surround", @@ -50,37 +49,14 @@ local plugins = { require("nvim-surround").setup({}) end }, - { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 0 - end, - opts = {} - }, - { - "folke/flash.nvim", - event = "VeryLazy", - ---@type Flash.Config - opts = {}, - -- stylua: ignore - keys = { - { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, - { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, - { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, - { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, - { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, - }, - }, - "christoomey/vim-tmux-navigator", - { "folke/neoconf.nvim", cmd = "Neoconf" }, "folke/neodev.nvim", + { import = "plugins" }, + { import = "languages" }, } local opts = { defaults = { - lazy = false + lazy = true } } @@ -89,8 +65,6 @@ require("lazy").setup(plugins, opts) vim.keymap.set('n', 'l', 'Lazy') vim.g.sonokai_better_performance = 1 -vim.g.sonokai_style = 'andromeda' +vim.g.sonokai_style = "andromeda" vim.cmd.colorscheme "sonokai" - - diff --git a/.config/nvim/lua/languages/markdown.lua b/.config/nvim/lua/languages/markdown.lua new file mode 100644 index 0000000..713b3e7 --- /dev/null +++ b/.config/nvim/lua/languages/markdown.lua @@ -0,0 +1,8 @@ +return { + { + "tadmccorkle/markdown.nvim", + -- ft = "markdown", + event = "VeryLazy", + lazy = false + }, +} diff --git a/.config/nvim/lua/languages/rails.lua b/.config/nvim/lua/languages/rails.lua new file mode 100644 index 0000000..0f0381a --- /dev/null +++ b/.config/nvim/lua/languages/rails.lua @@ -0,0 +1,15 @@ +return { + { "tpope/vim-rails", event = "VeryLazy" }, + { + "sato-s/telescope-rails.nvim", + dependencies = {"nvim-telescope/telescope.nvim"}, + keys = { + { "rs", "Telescope rails specs", desc = "Telescope rails specs" }, + { "rc", "Telescope rails controllers", desc = "Telescope rails controllers" }, + { "rm", "Telescope rails models", desc = "Telescope rails models" }, + { "rv", "Telescope rails views", desc = "Telescope rails views" }, + { "ri", "Telescope rails migrations", desc = "Telescope rails migrations" }, + { "rl", "Telescope rails libs", desc = "Telescope rails libs" }, + } + } +} diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua new file mode 100644 index 0000000..f119735 --- /dev/null +++ b/.config/nvim/lua/plugins/coding.lua @@ -0,0 +1,10 @@ +return { + { + "kylechui/nvim-surround", + version = "*", + event = "VeryLazy", + config = function() + require("nvim-surround").setup({}) + end + } +} diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua new file mode 100644 index 0000000..8fa51e3 --- /dev/null +++ b/.config/nvim/lua/plugins/editor.lua @@ -0,0 +1,46 @@ +return { + { "christoomey/vim-system-copy", lazy = false }, + { "folke/neoconf.nvim", cmd = "Neoconf" }, + { + "folke/persistence.nvim", + event = "BufReadPre", + opts = { options = vim.opt.sessionoptions:get() }, + -- stylua: ignore + keys = { + { "qs", function() require("persistence").load() end, desc = "Restore Session" }, + { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, + { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, + }, + }, + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 0 + end, + opts = {} + }, + { + + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + keys = { + { "e", "Neotree position=float", desc = "Neotree" } + } + }, + { "nvim-treesitter/nvim-treesitter" }, + { + "stevearc/oil.nvim", + opts = {}, + dependencies = { "nvim-tree/nvim-web-devicons" }, + keys = { + { "-", "Oil", desc = "Oil" } + }, + } +} diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..799cea0 --- /dev/null +++ b/.config/nvim/lua/plugins/git.lua @@ -0,0 +1,24 @@ +return { + { + "kdheepak/lazygit.nvim", + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, + -- optional for floating window border decoration + dependencies = { + "nvim-lua/plenary.nvim", + }, + -- setting the keybinding for LazyGit with 'keys' is recommended in + -- order to load the plugin when the command is run for the first time + keys = { + { "gg", "LazyGit", desc = "LazyGit" } + } + }, + { + "lewis6991/gitsigns.nvim", lazy = false + } +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..1fe6720 --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,335 @@ +return { + { + "ThePrimeagen/refactoring.nvim", + event = "VeryLazy", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("refactoring").setup({}) + end, + keys = { + { "rr", function() require('refactoring').select_refactor() end, desc = "Refactor" } + } + }, + { + "hrsh7th/nvim-cmp", + version = false, -- last release is way too old + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + }, + opts = function() + vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) + local cmp = require("cmp") + local defaults = require("cmp.config.default")() + return { + auto_brackets = {}, -- configure any filetype to auto add brackets + completion = { + completeopt = "menu,menuone,noinsert", + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = function(fallback) + cmp.abort() + fallback() + end, + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "path" }, + }, { + { name = "buffer" }, + }), + formatting = { + format = function(_, item) + return item + end, + }, + experimental = { + ghost_text = { + hl_group = "CmpGhostText", + }, + }, + sorting = defaults.sorting, + } + end, + ---@param opts cmp.ConfigSchema | {auto_brackets?: string[]} + config = function(_, opts) + for _, source in ipairs(opts.sources) do + source.group_index = source.group_index or 1 + end + local cmp = require("cmp") + local Kind = cmp.lsp.CompletionItemKind + cmp.setup(opts) + cmp.event:on("confirm_done", function(event) + if not vim.tbl_contains(opts.auto_brackets or {}, vim.bo.filetype) then + return + end + local entry = event.entry + local item = entry:get_completion_item() + if vim.tbl_contains({ Kind.Function, Kind.Method }, item.kind) then + local keys = vim.api.nvim_replace_termcodes("()", false, false, true) + vim.api.nvim_feedkeys(keys, "i", true) + end + end) + end, +}, +{ + "neovim/nvim-lspconfig", + --event = "LazyFile", + lazy = false, + dependencies = { + { "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } }, + { "folke/neodev.nvim", opts = {} }, + "mason.nvim", + "williamboman/mason-lspconfig.nvim", + }, + ---@class PluginLspOpts + opts = { + -- options for vim.diagnostic.config() + ---@type vim.diagnostic.Opts + diagnostics = { + underline = true, + update_in_insert = false, + virtual_text = { + spacing = 4, + source = "if_many", + prefix = "●", + -- this will set set the prefix to a function that returns the diagnostics icon based on the severity + -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported + -- prefix = "icons", + }, + severity_sort = true, + signs = { + text = { + }, + }, + }, + -- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0 + -- Be aware that you also will need to properly configure your LSP server to + -- provide the inlay hints. + inlay_hints = { + enabled = false + }, + -- Enable this to enable the builtin LSP code lenses on Neovim >= 0.10.0 + -- Be aware that you also will need to properly configure your LSP server to + -- provide the code lenses. + codelens = { + enabled = false, + }, + -- add any global capabilities here + capabilities = {}, + -- options for vim.lsp.buf.format + -- `bufnr` and `filter` is handled by the LazyVim formatter, + -- but can be also overridden when specified + format = { + formatting_options = nil, + timeout_ms = nil, + }, + -- LSP Server Settings + ---@type lspconfig.options + servers = { + lua_ls = { + -- mason = false, -- set to false if you don't want this server to be installed with mason + -- Use this to add any additional keymaps + -- for specific lsp servers + ---@type LazyKeysSpec[] + -- keys = {}, + settings = { + Lua = { + workspace = { + checkThirdParty = false, + }, + codeLens = { + enable = true, + }, + completion = { + callSnippet = "Replace", + }, + }, + }, + }, + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + -- tsserver = function(_, opts) + -- require("typescript").setup({ server = opts }) + -- return true + -- end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + }, + ---@param opts PluginLspOpts + config = function(_, opts) + -- if LazyVim.has("neoconf.nvim") then + local plugin = require("lazy.core.config").spec.plugins["neoconf.nvim"] + require("neoconf").setup(require("lazy.core.plugin").values(plugin, "opts", false)) + -- end + + -- setup autoformat + -- LazyVim.format.register(LazyVim.lsp.formatter()) + + -- setup keymaps + -- LazyVim.lsp.on_attach(function(client, buffer) + -- require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) + -- end) + + local register_capability = vim.lsp.handlers["client/registerCapability"] + + vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx) + ---@diagnostic disable-next-line: no-unknown + local ret = register_capability(err, res, ctx) + local client = vim.lsp.get_client_by_id(ctx.client_id) + local buffer = vim.api.nvim_get_current_buf() + require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) + return ret + end + + -- diagnostics signs + if vim.fn.has("nvim-0.10.0") == 0 then + for severity, icon in pairs(opts.diagnostics.signs.text) do + local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper) + name = "DiagnosticSign" .. name + vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) + end + end + + -- inlay hints + if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then + opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●" + or function(diagnostic) + local icons = require("lazyvim.config").icons.diagnostics + for d, icon in pairs(icons) do + if diagnostic.severity == vim.diagnostic.severity[d:upper()] then + return icon + end + end + end + end + + vim.diagnostic.config(vim.deepcopy(opts.diagnostics)) + + local servers = opts.servers + local has_cmp, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") + local capabilities = vim.tbl_deep_extend( + "force", + {}, + vim.lsp.protocol.make_client_capabilities(), + has_cmp and cmp_nvim_lsp.default_capabilities() or {}, + opts.capabilities or {} + ) + + local function setup(server) + local server_opts = vim.tbl_deep_extend("force", { + capabilities = vim.deepcopy(capabilities), + }, servers[server] or {}) + + if opts.setup[server] then + if opts.setup[server](server, server_opts) then + return + end + elseif opts.setup["*"] then + if opts.setup["*"](server, server_opts) then + return + end + end + require("lspconfig")[server].setup(server_opts) + end + + -- get all the servers that are available through mason-lspconfig + local have_mason, mlsp = pcall(require, "mason-lspconfig") + local all_mslp_servers = {} + if have_mason then + all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package) + end + + local ensure_installed = {} ---@type string[] + for server, server_opts in pairs(servers) do + if server_opts then + server_opts = server_opts == true and {} or server_opts + -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig + if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then + setup(server) + elseif server_opts.enabled ~= false then + ensure_installed[#ensure_installed + 1] = server + end + end + end + + if have_mason then + mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } }) + end + + end, +}, +{ "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } }, +{ "nvim-lspconfig" }, +{ "folke/neodev.nvim", opts = {} }, +{ "mason.nvim" }, +{"williamboman/mason-lspconfig.nvim" }, +{ + + "williamboman/mason.nvim", + cmd = "Mason", + keys = { { "cm", "Mason", desc = "Mason" } }, + build = ":MasonUpdate", + opts = { + ensure_installed = { + "stylua", + "shfmt", + -- "flake8", + }, + }, + ---@param opts MasonSettings | {ensure_installed: string[]} + config = function(_, opts) + require("mason").setup(opts) + local mr = require("mason-registry") + mr:on("package:install:success", function() + vim.defer_fn(function() + -- trigger FileType event to possibly load this newly installed LSP server + require("lazy.core.handler.event").trigger({ + event = "FileType", + buf = vim.api.nvim_get_current_buf(), + }) + end, 100) + end) + local function ensure_installed() + for _, tool in ipairs(opts.ensure_installed) do + local p = mr.get_package(tool) + if not p:is_installed() then + p:install() + end + end + end + if mr.refresh then + mr.refresh(ensure_installed) + else + ensure_installed() + end + end, + keys = { + { "m", "Mason", desc = "Mason" } + } +}, +{ "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } } + + +} diff --git a/.config/nvim/lua/plugins/navigation.lua b/.config/nvim/lua/plugins/navigation.lua new file mode 100644 index 0000000..b770bb1 --- /dev/null +++ b/.config/nvim/lua/plugins/navigation.lua @@ -0,0 +1,17 @@ +return { + { "christoomey/vim-tmux-navigator", lazy = false }, + { + "folke/flash.nvim", + event = "VeryLazy", + ---@type Flash.Config + opts = {}, + -- stylua: ignore + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, + } +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..17deee2 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,14 @@ +return { + { + 'nvim-telescope/telescope.nvim', tag = '0.1.6', + dependencies = { 'nvim-lua/plenary.nvim' }, + keys = { + { "ff", "Telescope find_files", desc = "Telescope File" }, + { "fg", "Telescope git_files", desc = "Telescope Git File" }, + { "fb", "Telescope buffers", desc = "Telescope Buffer" }, + { "fw", "Telescope live_grep", desc = "Telescope Grep" }, + { "fk", "Telescope keymaps", desc = "Telescope Keymap" }, + { "", "Telescope commands", desc = "Telescope Command" }, + } + } +} From 4fc0a84ec8262da34005f0c7011771df17e098a0 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 13:03:20 +0200 Subject: [PATCH 041/280] Update lsp config --- .config/nvim/init.lua | 1 + .config/nvim/lua/plugins/lsp.lua | 337 +++---------------------------- 2 files changed, 25 insertions(+), 313 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 20658dd..ab6acb4 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -4,6 +4,7 @@ vim.opt.titlestring = 'nvim %{expand("%:p")}' vim.g.mapleader = " " vim.g.maplocalleader = "\\" vim.wo.number = true +vim.wo.relativenumber = true vim.opt.termguicolors = true vim.opt.expandtab = true diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 1fe6720..638f2e5 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -14,322 +14,33 @@ return { } }, { - "hrsh7th/nvim-cmp", - version = false, -- last release is way too old - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - }, - opts = function() - vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) - local cmp = require("cmp") - local defaults = require("cmp.config.default")() - return { - auto_brackets = {}, -- configure any filetype to auto add brackets - completion = { - completeopt = "menu,menuone,noinsert", - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [""] = function(fallback) - cmp.abort() - fallback() - end, - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "path" }, - }, { - { name = "buffer" }, - }), - formatting = { - format = function(_, item) - return item - end, - }, - experimental = { - ghost_text = { - hl_group = "CmpGhostText", - }, - }, - sorting = defaults.sorting, - } - end, - ---@param opts cmp.ConfigSchema | {auto_brackets?: string[]} - config = function(_, opts) - for _, source in ipairs(opts.sources) do - source.group_index = source.group_index or 1 - end - local cmp = require("cmp") - local Kind = cmp.lsp.CompletionItemKind - cmp.setup(opts) - cmp.event:on("confirm_done", function(event) - if not vim.tbl_contains(opts.auto_brackets or {}, vim.bo.filetype) then - return - end - local entry = event.entry - local item = entry:get_completion_item() - if vim.tbl_contains({ Kind.Function, Kind.Method }, item.kind) then - local keys = vim.api.nvim_replace_termcodes("()", false, false, true) - vim.api.nvim_feedkeys(keys, "i", true) - end - end) - end, -}, -{ - "neovim/nvim-lspconfig", - --event = "LazyFile", - lazy = false, - dependencies = { - { "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } }, - { "folke/neodev.nvim", opts = {} }, - "mason.nvim", - "williamboman/mason-lspconfig.nvim", - }, - ---@class PluginLspOpts - opts = { - -- options for vim.diagnostic.config() - ---@type vim.diagnostic.Opts - diagnostics = { - underline = true, - update_in_insert = false, - virtual_text = { - spacing = 4, - source = "if_many", - prefix = "●", - -- this will set set the prefix to a function that returns the diagnostics icon based on the severity - -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported - -- prefix = "icons", - }, - severity_sort = true, - signs = { - text = { - }, - }, - }, - -- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0 - -- Be aware that you also will need to properly configure your LSP server to - -- provide the inlay hints. - inlay_hints = { - enabled = false - }, - -- Enable this to enable the builtin LSP code lenses on Neovim >= 0.10.0 - -- Be aware that you also will need to properly configure your LSP server to - -- provide the code lenses. - codelens = { - enabled = false, - }, - -- add any global capabilities here - capabilities = {}, - -- options for vim.lsp.buf.format - -- `bufnr` and `filter` is handled by the LazyVim formatter, - -- but can be also overridden when specified - format = { - formatting_options = nil, - timeout_ms = nil, - }, - -- LSP Server Settings - ---@type lspconfig.options - servers = { - lua_ls = { - -- mason = false, -- set to false if you don't want this server to be installed with mason - -- Use this to add any additional keymaps - -- for specific lsp servers - ---@type LazyKeysSpec[] - -- keys = {}, - settings = { - Lua = { - workspace = { - checkThirdParty = false, - }, - codeLens = { - enable = true, - }, - completion = { - callSnippet = "Replace", - }, - }, - }, - }, - }, - -- you can do any additional lsp server setup here - -- return true if you don't want this server to be setup with lspconfig - ---@type table - setup = { - -- example to setup with typescript.nvim - -- tsserver = function(_, opts) - -- require("typescript").setup({ server = opts }) - -- return true - -- end, - -- Specify * to use this function as a fallback for any server - -- ["*"] = function(server, opts) end, + "williamboman/mason.nvim", + lazy = false, + keys = { + { "m", "Mason" } }, - }, - ---@param opts PluginLspOpts - config = function(_, opts) - -- if LazyVim.has("neoconf.nvim") then - local plugin = require("lazy.core.config").spec.plugins["neoconf.nvim"] - require("neoconf").setup(require("lazy.core.plugin").values(plugin, "opts", false)) - -- end - - -- setup autoformat - -- LazyVim.format.register(LazyVim.lsp.formatter()) - - -- setup keymaps - -- LazyVim.lsp.on_attach(function(client, buffer) - -- require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) - -- end) - - local register_capability = vim.lsp.handlers["client/registerCapability"] - - vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx) - ---@diagnostic disable-next-line: no-unknown - local ret = register_capability(err, res, ctx) - local client = vim.lsp.get_client_by_id(ctx.client_id) - local buffer = vim.api.nvim_get_current_buf() - require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) - return ret - end - - -- diagnostics signs - if vim.fn.has("nvim-0.10.0") == 0 then - for severity, icon in pairs(opts.diagnostics.signs.text) do - local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper) - name = "DiagnosticSign" .. name - vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) - end - end - - -- inlay hints - if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then - opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●" - or function(diagnostic) - local icons = require("lazyvim.config").icons.diagnostics - for d, icon in pairs(icons) do - if diagnostic.severity == vim.diagnostic.severity[d:upper()] then - return icon - end - end - end - end - - vim.diagnostic.config(vim.deepcopy(opts.diagnostics)) - - local servers = opts.servers - local has_cmp, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") - local capabilities = vim.tbl_deep_extend( - "force", - {}, - vim.lsp.protocol.make_client_capabilities(), - has_cmp and cmp_nvim_lsp.default_capabilities() or {}, - opts.capabilities or {} - ) - - local function setup(server) - local server_opts = vim.tbl_deep_extend("force", { - capabilities = vim.deepcopy(capabilities), - }, servers[server] or {}) - - if opts.setup[server] then - if opts.setup[server](server, server_opts) then - return - end - elseif opts.setup["*"] then - if opts.setup["*"](server, server_opts) then - return - end - end - require("lspconfig")[server].setup(server_opts) - end - - -- get all the servers that are available through mason-lspconfig - local have_mason, mlsp = pcall(require, "mason-lspconfig") - local all_mslp_servers = {} - if have_mason then - all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package) - end - - local ensure_installed = {} ---@type string[] - for server, server_opts in pairs(servers) do - if server_opts then - server_opts = server_opts == true and {} or server_opts - -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig - if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then - setup(server) - elseif server_opts.enabled ~= false then - ensure_installed[#ensure_installed + 1] = server - end - end - end - - if have_mason then - mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } }) + config = function() + require("mason").setup() end - - end, -}, -{ "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } }, -{ "nvim-lspconfig" }, -{ "folke/neodev.nvim", opts = {} }, -{ "mason.nvim" }, -{"williamboman/mason-lspconfig.nvim" }, -{ - - "williamboman/mason.nvim", - cmd = "Mason", - keys = { { "cm", "Mason", desc = "Mason" } }, - build = ":MasonUpdate", - opts = { - ensure_installed = { - "stylua", - "shfmt", - -- "flake8", - }, }, - ---@param opts MasonSettings | {ensure_installed: string[]} - config = function(_, opts) - require("mason").setup(opts) - local mr = require("mason-registry") - mr:on("package:install:success", function() - vim.defer_fn(function() - -- trigger FileType event to possibly load this newly installed LSP server - require("lazy.core.handler.event").trigger({ - event = "FileType", - buf = vim.api.nvim_get_current_buf(), - }) - end, 100) - end) - local function ensure_installed() - for _, tool in ipairs(opts.ensure_installed) do - local p = mr.get_package(tool) - if not p:is_installed() then - p:install() - end - end - end - if mr.refresh then - mr.refresh(ensure_installed) - else - ensure_installed() + { + "williamboman/mason-lspconfig.nvim", + lazy = false, + config = function() + require("mason-lspconfig").setup { + ensure_installed = { "lua_ls", "rust_analyzer" }, + } end - end, - keys = { - { "m", "Mason", desc = "Mason" } + }, + { + "nvim-lspconfig", + lazy = false, + config = function() + local lspconfig = require('lspconfig') + lspconfig.lua_ls.setup({}) + end, + keys = { + { "K", function() vim.lsp.buf.hover() end } + } } -}, -{ "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } } - - } From 8ad0e654811377fdc68d9a7dc1c055069eb2b118 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 13:31:54 +0200 Subject: [PATCH 042/280] Update lspconfig --- .config/nvim/lua/plugins/lsp.lua | 11 +++++++---- .config/nvim/lua/plugins/telescope.lua | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 638f2e5..0b0d7c8 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -28,7 +28,7 @@ return { lazy = false, config = function() require("mason-lspconfig").setup { - ensure_installed = { "lua_ls", "rust_analyzer" }, + ensure_installed = { "lua_ls", "tsserver", "solargraph" }, } end }, @@ -38,9 +38,12 @@ return { config = function() local lspconfig = require('lspconfig') lspconfig.lua_ls.setup({}) + lspconfig.tsserver.setup({}) + lspconfig.solargraph.setup({}) + + vim.keymap.set('n', "K", vim.lsp.buf.hover, {}) + vim.keymap.set('n', "gd", vim.lsp.buf.definition, {}) + vim.keymap.set('n', "ca", vim.lsp.buf.code_action, {}) end, - keys = { - { "K", function() vim.lsp.buf.hover() end } - } } } diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 17deee2..a6a512c 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -10,5 +10,19 @@ return { { "fk", "Telescope keymaps", desc = "Telescope Keymap" }, { "", "Telescope commands", desc = "Telescope Command" }, } + }, + { + "nvim-telescope/telescope-ui-select.nvim", + lazy = false, + config = function() + require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown {} + } + } + }) + require("telescope").load_extension("ui-select") + end } } From db59a264fb9d56b79ed12f98325b41724df1ed5f Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 15:12:19 +0200 Subject: [PATCH 043/280] Update lspconfig --- .config/nvim/lua/plugins/lsp.lua | 115 ++++++++++++++++++------------- 1 file changed, 69 insertions(+), 46 deletions(-) diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 0b0d7c8..ee8357f 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,49 +1,72 @@ return { - { - "ThePrimeagen/refactoring.nvim", - event = "VeryLazy", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - config = function() - require("refactoring").setup({}) - end, - keys = { - { "rr", function() require('refactoring').select_refactor() end, desc = "Refactor" } - } - }, - { - "williamboman/mason.nvim", - lazy = false, - keys = { - { "m", "Mason" } - }, - config = function() - require("mason").setup() - end - }, - { - "williamboman/mason-lspconfig.nvim", - lazy = false, - config = function() - require("mason-lspconfig").setup { - ensure_installed = { "lua_ls", "tsserver", "solargraph" }, - } - end - }, - { - "nvim-lspconfig", - lazy = false, - config = function() - local lspconfig = require('lspconfig') - lspconfig.lua_ls.setup({}) - lspconfig.tsserver.setup({}) - lspconfig.solargraph.setup({}) + { + "ThePrimeagen/refactoring.nvim", + event = "VeryLazy", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("refactoring").setup({}) + end, + keys = { + { + "rr", + function() + require("refactoring").select_refactor() + end, + desc = "Refactor", + }, + }, + }, + { + "williamboman/mason.nvim", + lazy = false, + keys = { + { "m", "Mason" }, + }, + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + lazy = false, + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "tsserver", "solargraph" }, + }) + end, + }, + { + "nvim-lspconfig", + lazy = false, + config = function() + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup({}) + lspconfig.tsserver.setup({}) + lspconfig.solargraph.setup({}) - vim.keymap.set('n', "K", vim.lsp.buf.hover, {}) - vim.keymap.set('n', "gd", vim.lsp.buf.definition, {}) - vim.keymap.set('n', "ca", vim.lsp.buf.code_action, {}) - end, - } + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + end, + }, + { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.diagnostics.erb_format, + null_ls.builtins.formatting.erb_lint, + }, + }) + end, + keys = { + { "gf", vim.lsp.buf.format }, + }, + }, } From b8018ba9b494b147d948a924f36f2f49051a70f9 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 15:37:23 +0200 Subject: [PATCH 044/280] Update gitconfig --- .config/nvim/init.lua | 56 +++++++++-------------------- .config/nvim/lua/plugins/coding.lua | 22 +++++++----- .config/nvim/lua/plugins/git.lua | 50 +++++++++++++++++++++++++- 3 files changed, 80 insertions(+), 48 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index ab6acb4..77b42ee 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -12,60 +12,38 @@ vim.opt.tabstop = 2 vim.opt.softtabstop = 2 vim.opt.shiftwidth = 2 -vim.keymap.set('n', 'qq', 'wqa') +vim.keymap.set("n", "qq", "wqa") local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) end vim.opt.rtp:prepend(lazypath) local plugins = { - { "sainnhe/sonokai", priority = 9999 }, - { - "nvim-telescope/telescope.nvim", tag = "0.1.6", - dependencies = { "nvim-lua/plenary.nvim" }, - keys = { - { "ff", "Telescope find_files", desc = "Telescope File" }, - { "fg", "Telescope git_files", desc = "Telescope Git File" }, - { "fb", "Telescope buffers", desc = "Telescope Buffer" }, - { "fw", "Telescope live_grep", desc = "Telescope Grep" }, - { "fk", "Telescope keymaps", desc = "Telescope Keymap" }, - { "", "Telescope commands", desc = "Telescope Command" }, - } - }, - { - "kylechui/nvim-surround", - version = "*", - event = "VeryLazy", - config = function() - require("nvim-surround").setup({}) - end - }, - "folke/neodev.nvim", - { import = "plugins" }, - { import = "languages" }, + { "sainnhe/sonokai", priority = 9999 }, + { import = "plugins" }, + { import = "languages" }, } local opts = { - defaults = { - lazy = true - } + defaults = { + lazy = true, + }, } require("lazy").setup(plugins, opts) -vim.keymap.set('n', 'l', 'Lazy') +vim.keymap.set("n", "l", "Lazy") vim.g.sonokai_better_performance = 1 vim.g.sonokai_style = "andromeda" -vim.cmd.colorscheme "sonokai" - +vim.cmd.colorscheme("sonokai") diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index f119735..6a2fd02 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -1,10 +1,16 @@ return { - { - "kylechui/nvim-surround", - version = "*", - event = "VeryLazy", - config = function() - require("nvim-surround").setup({}) - end - } + { + "kylechui/nvim-surround", + version = "*", + event = "VeryLazy", + config = function() + require("nvim-surround").setup({}) + end, + }, + { + "m4xshen/autoclose.nvim", + config = function() + require("autoclose").setup() + end, + }, } diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index 799cea0..10cd5c5 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -19,6 +19,54 @@ return { } }, { - "lewis6991/gitsigns.nvim", lazy = false + "lewis6991/gitsigns.nvim", + lazy = false, + config = function() + require('gitsigns').setup({ + + on_attach = function(bufnr) + local gitsigns = require('gitsigns') + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map('n', ']c', function() + if vim.wo.diff then + vim.cmd.normal({ ']c', bang = true }) + else + gitsigns.nav_hunk('next') + end + end) + + map('n', '[c', function() + if vim.wo.diff then + vim.cmd.normal({ '[c', bang = true }) + else + gitsigns.nav_hunk('prev') + end + end) + end + }) + end, + keys = { + { "hs", function() require("gitsigns").stage_hunk { vim.fn.line("."), vim.fn.line("v") } end, desc = "stage_hunk", mode = "v" }, + { "hr", function() require("gitsigns").reset_hunk { vim.fn.line("."), vim.fn.line("v") } end, desc = "reset_hunk", mode = "v" }, + { "ih", ":Gitsigns select_hunk", mode = { "o", "x" } }, + { "hb", function() require("gitsigns").blame_line { full = true } end, desc = "blame_line" }, + { "hD", function() require("gitsigns").diffthis("~") end, desc = "diffthis" }, + { "hs", function() require("gitsigns").stage_hunk() end, desc = "stage_hunk" }, + { "hr", function() require("gitsigns").reset_hunk() end, desc = "reset_hunk" }, + { "hS", function() require("gitsigns").stage_buffer() end, desc = "stage_buffer" }, + { "hu", function() require("gitsigns").undo_stage_hunk() end, desc = "undo_stage_hunk" }, + { "hR", function() require("gitsigns").reset_buffer() end, desc = "reset_buffer" }, + { "hp", function() require("gitsigns").preview_hunk() end, desc = "preview_hunk" }, + { "tb", function() require("gitsigns").toggle_current_line_blame() end, desc = "toggle_current_line_blame" }, + { "hd", function() require("gitsigns").diffthis() end, desc = "diffthis" }, + { "td", function() require("gitsigns").toggle_deleted() end, desc = "toggle_deleted" }, + } } } From 26619bd329c7f722b1b21abaee46942ef57147b7 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 15:52:14 +0200 Subject: [PATCH 045/280] Update git (via fugitive) --- .config/nvim/lua/plugins/coding.lua | 1 + .config/nvim/lua/plugins/git.lua | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index 6a2fd02..1d27814 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -9,6 +9,7 @@ return { }, { "m4xshen/autoclose.nvim", + event = "VeryLazy", config = function() require("autoclose").setup() end, diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index 10cd5c5..d0b4531 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -18,6 +18,10 @@ return { { "gg", "LazyGit", desc = "LazyGit" } } }, + { + "tpope/vim-fugitive", + lazy = false + }, { "lewis6991/gitsigns.nvim", lazy = false, From 96acc04882cb269d1e3411c56742f0a678c04f73 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 17:07:31 +0200 Subject: [PATCH 046/280] Update config --- .config/nvim/lua/plugins/coding.lua | 39 +++++++---- .config/nvim/lua/plugins/editor.lua | 92 +++++++++++++++----------- .config/nvim/lua/plugins/telescope.lua | 2 + 3 files changed, 82 insertions(+), 51 deletions(-) diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index 1d27814..84f50f0 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -1,17 +1,28 @@ return { - { - "kylechui/nvim-surround", - version = "*", - event = "VeryLazy", - config = function() - require("nvim-surround").setup({}) - end, - }, - { - "m4xshen/autoclose.nvim", + { + "kylechui/nvim-surround", + version = "*", event = "VeryLazy", - config = function() - require("autoclose").setup() - end, - }, + config = function() + require("nvim-surround").setup({}) + end, + }, + { + "m4xshen/autoclose.nvim", + event = "VeryLazy", + config = function() + require("autoclose").setup() + end, + }, + { + "nat-418/boole.nvim", + config = function() + require("boole").setup({ + allow_caps_additions = { + { "enable", "disable" }, + { "foo", "bar" }, + }, + }) + end, + }, } diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 8fa51e3..a085feb 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -1,46 +1,64 @@ return { - { "christoomey/vim-system-copy", lazy = false }, - { "folke/neoconf.nvim", cmd = "Neoconf" }, - { - "folke/persistence.nvim", - event = "BufReadPre", - opts = { options = vim.opt.sessionoptions:get() }, + { "christoomey/vim-system-copy", lazy = false }, + { "folke/neoconf.nvim", cmd = "Neoconf" }, + { + "folke/persistence.nvim", + event = "BufReadPre", + opts = { options = vim.opt.sessionoptions:get() }, -- stylua: ignore keys = { - { "qs", function() require("persistence").load() end, desc = "Restore Session" }, + { "qs", function() require("persistence").load() end, desc = "Restore Session" }, { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, - { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, + { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, }, - }, - { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 0 - end, - opts = {} - }, - { + }, + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 0 + end, + opts = {}, + }, + { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + keys = { + { "e", "Neotree position=float", desc = "Neotree" }, + }, + }, + { + "nvim-treesitter/nvim-treesitter", + event = "VeryLazy", dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", + "RRethy/nvim-treesitter-endwise" }, - keys = { - { "e", "Neotree position=float", desc = "Neotree" } - } - }, - { "nvim-treesitter/nvim-treesitter" }, - { - "stevearc/oil.nvim", - opts = {}, - dependencies = { "nvim-tree/nvim-web-devicons" }, - keys = { - { "-", "Oil", desc = "Oil" } - }, - } + setup = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { "lua", "vim", "vimdoc", "help" }, + auto_install = true, + endwise = { + enable = true, + }, + highlight = { + enable = true, + }, + }) + end, + }, + { + "stevearc/oil.nvim", + opts = {}, + dependencies = { "nvim-tree/nvim-web-devicons" }, + keys = { + { "-", "Oil", desc = "Oil" }, + }, + }, } diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index a6a512c..9fd3edc 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -4,8 +4,10 @@ return { dependencies = { 'nvim-lua/plenary.nvim' }, keys = { { "ff", "Telescope find_files", desc = "Telescope File" }, + { "fc", "Telescope find_files search_dirs={'~/.config/nvim/'}", desc = "Telescope Config" }, { "fg", "Telescope git_files", desc = "Telescope Git File" }, { "fb", "Telescope buffers", desc = "Telescope Buffer" }, + { "fs", "Telescope grep_string", desc = "Telescope Grep" }, { "fw", "Telescope live_grep", desc = "Telescope Grep" }, { "fk", "Telescope keymaps", desc = "Telescope Keymap" }, { "", "Telescope commands", desc = "Telescope Command" }, From 267931313bd759114713dd3acbc164af9bd54608 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 17:17:54 +0200 Subject: [PATCH 047/280] Add luasnip cmp --- .config/nvim/lua/plugins/lsp.lua | 43 +++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index ee8357f..cbbe97c 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -67,6 +67,47 @@ return { end, keys = { { "gf", vim.lsp.buf.format }, - }, + }, + }, + { + 'L3MON4D3/LuaSnip', + dependencies = { + 'saadparwaiz1/cmp_luasnip', + 'rafamadriz/friendly-snippets', + }, + }, + { + "hrsh7th/nvim-cmp", + lazy = false, + config = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup({ + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + -- { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), + }) + end, }, } From 7c28418ed207f80e44eddca3b492833bf62079e7 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 19:21:16 +0200 Subject: [PATCH 048/280] Update config --- .config/nvim/.luarc.json | 5 ++ .config/nvim/init.lua | 29 ++++---- .config/nvim/lazy-lock.json | 30 +++++++- .config/nvim/lua/plugins/coding.lua | 19 ++++- .config/nvim/lua/plugins/editor.lua | 104 ++++++++++++++-------------- .config/nvim/lua/plugins/lsp.lua | 71 ++++++++++++++----- 6 files changed, 173 insertions(+), 85 deletions(-) create mode 100644 .config/nvim/.luarc.json diff --git a/.config/nvim/.luarc.json b/.config/nvim/.luarc.json new file mode 100644 index 0000000..1e1765c --- /dev/null +++ b/.config/nvim/.luarc.json @@ -0,0 +1,5 @@ +{ + "diagnostics.globals": [ + "vim" + ] +} \ No newline at end of file diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 77b42ee..e4df269 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -13,31 +13,32 @@ vim.opt.softtabstop = 2 vim.opt.shiftwidth = 2 vim.keymap.set("n", "qq", "wqa") +vim.keymap.set("n", "/", "noh") local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) end vim.opt.rtp:prepend(lazypath) local plugins = { - { "sainnhe/sonokai", priority = 9999 }, - { import = "plugins" }, - { import = "languages" }, + { "sainnhe/sonokai", priority = 9999 }, + { import = "plugins" }, + { import = "languages" }, } local opts = { - defaults = { - lazy = true, - }, + defaults = { + lazy = true, + }, } require("lazy").setup(plugins, opts) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index d330136..d4523f7 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,13 +1,39 @@ { + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, + "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, + "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, + "friendly-snippets": { "branch": "main", "commit": "d5f74ce4dfdd82848f3f4eac65fe6e29ac5df4c2" }, + "gitsigns.nvim": { "branch": "main", "commit": "035da036e68e509ed158414416c827d022d914bd" }, "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, + "lazygit.nvim": { "branch": "main", "commit": "0ada6c6e7e138df92f5009b6952f4ac41248305a" }, + "markdown.nvim": { "branch": "master", "commit": "951b7b567668608d60637d2c9e97f4baea5fdbbe" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, + "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" }, "neoconf.nvim": { "branch": "main", "commit": "ba3503e246ea687732e51f7f9878e653e2e2039b" }, - "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, + "none-ls.nvim": { "branch": "main", "commit": "709a5e56f4273deca737d43355212ac94c1b5083" }, + "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, + "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, + "nvim-lspconfig": { "branch": "master", "commit": "ae0651d850f8f9313d4db3f96fe24dbf054edeb4" }, "nvim-surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" }, - "nvim-treesitter": { "branch": "master", "commit": "19f69a5b434470723c32311cdc4d8d0e8db76358" }, + "nvim-treesitter": { "branch": "master", "commit": "160e5d52c841dc9261c0b2dc6f253bddbcf3d766" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "156d5782b3a68845f824156e45fc5bb038211e7b" }, + "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" }, + "oil.nvim": { "branch": "master", "commit": "f3a31eba24587bc038592103d8f7e64648292115" }, + "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, + "refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" }, "sonokai": { "branch": "master", "commit": "da162343354fbd9bf9cd49293a856f0e3761e8ac" }, + "telescope-rails.nvim": { "branch": "master", "commit": "e0addf3751b0af1fc0bc4706ff25ba73949a98ae" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, + "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, + "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, + "vim-rails": { "branch": "master", "commit": "8972461e64c7c4bf049f2f86ea1bc571e8077b55" }, "vim-system-copy": { "branch": "master", "commit": "8abd9ed21016bdc21b458c79da3b9ac0ee25c1ce" }, "vim-tmux-navigator": { "branch": "master", "commit": "a26954a585b02a2ac02f87145e204f8798a7cbc2" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index 84f50f0..19c29a1 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -16,13 +16,30 @@ return { }, { "nat-418/boole.nvim", + lazy = false, config = function() require("boole").setup({ + mappings = { + increment = "", + decrement = "", + }, + additions = { + { "Foo", "Bar" }, + { "tic", "tac", "toe" }, + }, allow_caps_additions = { { "enable", "disable" }, - { "foo", "bar" }, }, }) end, }, + { + "numToStr/Comment.nvim", + opts = {}, + lazy = false, + }, + { + "machakann/vim-highlightedyank", + lazy = false + } } diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index a085feb..314ec91 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -1,64 +1,64 @@ return { - { "christoomey/vim-system-copy", lazy = false }, - { "folke/neoconf.nvim", cmd = "Neoconf" }, - { - "folke/persistence.nvim", - event = "BufReadPre", - opts = { options = vim.opt.sessionoptions:get() }, + { "christoomey/vim-system-copy", lazy = false }, + { "folke/neoconf.nvim", cmd = "Neoconf" }, + { + "folke/persistence.nvim", + event = "BufReadPre", + opts = { options = vim.opt.sessionoptions:get() }, -- stylua: ignore keys = { { "qs", function() require("persistence").load() end, desc = "Restore Session" }, { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, }, - }, - { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 0 - end, - opts = {}, - }, - { + }, + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 0 + end, + opts = {}, + }, + { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - }, - keys = { - { "e", "Neotree position=float", desc = "Neotree" }, - }, - }, - { - "nvim-treesitter/nvim-treesitter", - event = "VeryLazy", + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + keys = { + { "e", "Neotree position=float", desc = "Neotree" }, + }, + }, + { + "nvim-treesitter/nvim-treesitter", + event = "VeryLazy", dependencies = { "RRethy/nvim-treesitter-endwise" }, - setup = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = { "lua", "vim", "vimdoc", "help" }, - auto_install = true, - endwise = { - enable = true, - }, - highlight = { - enable = true, - }, - }) - end, - }, - { - "stevearc/oil.nvim", - opts = {}, - dependencies = { "nvim-tree/nvim-web-devicons" }, - keys = { - { "-", "Oil", desc = "Oil" }, - }, - }, + setup = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { "lua", "vim", "vimdoc", "help", "ruby" }, + auto_install = true, + endwise = { + enable = true, + }, + highlight = { + enable = true, + }, + }) + end, + }, + { + "stevearc/oil.nvim", + opts = {}, + dependencies = { "nvim-tree/nvim-web-devicons" }, + keys = { + { "-", "Oil", desc = "Oil" }, + }, + }, } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index cbbe97c..4671c89 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -42,10 +42,45 @@ return { "nvim-lspconfig", lazy = false, config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + -- https://www.mitchellhanberg.com/modern-format-on-save-in-neovim/ + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("lsp", { clear = true }), + callback = function(args) + vim.api.nvim_create_autocmd("BufWritePre", { + buffer = args.buf, + callback = function() + vim.lsp.buf.format({ async = false, id = args.data.client_id }) + end, + }) + end, + }) + local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup({}) - lspconfig.tsserver.setup({}) - lspconfig.solargraph.setup({}) + lspconfig.lua_ls.setup({ capabilities = capabilities }) + lspconfig.tsserver.setup({ capabilities = capabilities }) + lspconfig.standardrb.setup({ capabilities = capabilities }) + + lspconfig.solargraph.setup({ + capabilities = capabilities, + cmd = { + "asdf", + "exec", + "solargraph", + "stdio", + }, + -- -- settings = { + -- -- solargraph = { + -- -- autoformat = false, + -- -- completion = true, + -- -- diagnostic = true, + -- -- folding = true, + -- -- references = true, + -- -- rename = true, + -- -- symbols = true + -- -- } + -- -- } + }) vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) @@ -57,6 +92,7 @@ return { "nvimtools/none-ls.nvim", config = function() local null_ls = require("null-ls") + null_ls.disable({ "rubocop" }) null_ls.setup({ sources = { null_ls.builtins.formatting.stylua, @@ -67,26 +103,29 @@ return { end, keys = { { "gf", vim.lsp.buf.format }, - }, - }, - { - 'L3MON4D3/LuaSnip', - dependencies = { - 'saadparwaiz1/cmp_luasnip', - 'rafamadriz/friendly-snippets', - }, - }, + }, + }, + { + "hrsh7th/cmp-nvim-lsp", + lazy = false, + }, + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + }, { "hrsh7th/nvim-cmp", - lazy = false, + lazy = false, config = function() local cmp = require("cmp") - require("luasnip.loaders.from_vscode").lazy_load() + require("luasnip.loaders.from_vscode").lazy_load() cmp.setup({ snippet = { expand = function(args) - vim.fn["vsnip#anonymous"](args.body) require("luasnip").lsp_expand(args.body) end, }, @@ -102,7 +141,7 @@ return { [""] = cmp.mapping.confirm({ select = true }), }), sources = cmp.config.sources({ - -- { name = "nvim_lsp" }, + { name = "nvim_lsp" }, { name = "luasnip" }, }, { { name = "buffer" }, From 85e5e8abc01b20f80cda9f9b59c159b2bbc52a6b Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 19:22:53 +0200 Subject: [PATCH 049/280] Add neotest --- .config/nvim/lua/plugins/test.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .config/nvim/lua/plugins/test.lua diff --git a/.config/nvim/lua/plugins/test.lua b/.config/nvim/lua/plugins/test.lua new file mode 100644 index 0000000..1a17372 --- /dev/null +++ b/.config/nvim/lua/plugins/test.lua @@ -0,0 +1,22 @@ +return { + { + "nvim-neotest/neotest", + optional = true, + dependencies = { + "olimorris/neotest-rspec", + }, + opts = { + adapters = { + ["neotest-rspec"] = { + rspec_cmd = function() + return vim.tbl_flatten({ + "bundle", + "exec", + "rspec", + }) + end, + }, + }, + }, + }, +} From 8a1942f426a16aa2cf1034966e06ef5606d20fec Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 19:51:35 +0200 Subject: [PATCH 050/280] Update luasnip config --- .config/nvim/lua/plugins/lsp.lua | 305 ++++++++++++++++--------------- 1 file changed, 159 insertions(+), 146 deletions(-) diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 4671c89..a8f15b7 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,152 +1,165 @@ return { - { - "ThePrimeagen/refactoring.nvim", - event = "VeryLazy", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - config = function() - require("refactoring").setup({}) - end, - keys = { - { - "rr", - function() - require("refactoring").select_refactor() - end, - desc = "Refactor", - }, - }, - }, - { - "williamboman/mason.nvim", - lazy = false, - keys = { - { "m", "Mason" }, - }, - config = function() - require("mason").setup() - end, - }, - { - "williamboman/mason-lspconfig.nvim", - lazy = false, - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "tsserver", "solargraph" }, - }) - end, - }, - { - "nvim-lspconfig", - lazy = false, - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() - -- https://www.mitchellhanberg.com/modern-format-on-save-in-neovim/ - vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup("lsp", { clear = true }), - callback = function(args) - vim.api.nvim_create_autocmd("BufWritePre", { - buffer = args.buf, - callback = function() - vim.lsp.buf.format({ async = false, id = args.data.client_id }) - end, - }) - end, - }) + { + "ThePrimeagen/refactoring.nvim", + event = "VeryLazy", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("refactoring").setup({}) + end, + keys = { + { + "rr", + function() + require("refactoring").select_refactor() + end, + desc = "Refactor", + }, + }, + }, + { + "williamboman/mason.nvim", + lazy = false, + keys = { + { "m", "Mason" }, + }, + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + lazy = false, + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "tsserver", "solargraph" }, + }) + end, + }, + { + "nvim-lspconfig", + lazy = false, + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + -- https://www.mitchellhanberg.com/modern-format-on-save-in-neovim/ + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("lsp", { clear = true }), + callback = function(args) + vim.api.nvim_create_autocmd("BufWritePre", { + buffer = args.buf, + callback = function() + vim.lsp.buf.format({ async = false, id = args.data.client_id }) + end, + }) + end, + }) - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup({ capabilities = capabilities }) - lspconfig.tsserver.setup({ capabilities = capabilities }) - lspconfig.standardrb.setup({ capabilities = capabilities }) + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup({ capabilities = capabilities }) + lspconfig.tsserver.setup({ capabilities = capabilities }) + lspconfig.standardrb.setup({ capabilities = capabilities }) - lspconfig.solargraph.setup({ - capabilities = capabilities, - cmd = { - "asdf", - "exec", - "solargraph", - "stdio", - }, - -- -- settings = { - -- -- solargraph = { - -- -- autoformat = false, - -- -- completion = true, - -- -- diagnostic = true, - -- -- folding = true, - -- -- references = true, - -- -- rename = true, - -- -- symbols = true - -- -- } - -- -- } - }) + lspconfig.solargraph.setup({ + capabilities = capabilities, + cmd = { + "asdf", + "exec", + "solargraph", + "stdio", + }, + -- -- settings = { + -- -- solargraph = { + -- -- autoformat = false, + -- -- completion = true, + -- -- diagnostic = true, + -- -- folding = true, + -- -- references = true, + -- -- rename = true, + -- -- symbols = true + -- -- } + -- -- } + }) - vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) - vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) - end, - }, - { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.disable({ "rubocop" }) - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.diagnostics.erb_format, - null_ls.builtins.formatting.erb_lint, - }, - }) - end, - keys = { - { "gf", vim.lsp.buf.format }, - }, - }, - { - "hrsh7th/cmp-nvim-lsp", - lazy = false, - }, - { - "L3MON4D3/LuaSnip", - dependencies = { - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets", - }, - }, - { - "hrsh7th/nvim-cmp", - lazy = false, - config = function() - local cmp = require("cmp") - require("luasnip.loaders.from_vscode").lazy_load() + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + end, + }, + { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.disable({ "rubocop" }) + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.diagnostics.erb_format, + null_ls.builtins.formatting.erb_lint, + }, + }) + end, + keys = { + { "gf", vim.lsp.buf.format }, + }, + }, + { + "hrsh7th/cmp-nvim-lsp", + lazy = false, + }, + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + keys = { + { + "", + function() + return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" + end, + expr = true, + silent = true, + mode = "i", + }, + { "", function() require("luasnip").jump(1) end, mode = "s" }, + { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, + } + }, + { + "hrsh7th/nvim-cmp", + lazy = false, + config = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() - cmp.setup({ - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - }), - }) - end, - }, + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), + }) + end, + }, } From 7f4c238a6fe145fa62b28bba9a899037b9d1b2a8 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 19:51:41 +0200 Subject: [PATCH 051/280] Add neotest --- .config/nvim/lazy-lock.json | 5 ++++ .config/nvim/lua/plugins/test.lua | 22 --------------- .config/nvim/lua/plugins/testing.lua | 40 ++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 22 deletions(-) delete mode 100644 .config/nvim/lua/plugins/test.lua create mode 100644 .config/nvim/lua/plugins/testing.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index d4523f7..e27d597 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,5 +1,6 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, @@ -15,10 +16,14 @@ "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" }, "neoconf.nvim": { "branch": "main", "commit": "ba3503e246ea687732e51f7f9878e653e2e2039b" }, + "neotest": { "branch": "master", "commit": "5caac5cc235d495a2382bc2980630ef36ac87032" }, + "neotest-minitest": { "branch": "main", "commit": "0543bf4e997b2c970707cb297e2f74c438eb0653" }, + "neotest-rspec": { "branch": "main", "commit": "201f4891b5a0edc2e5f12196f35726f4d4eca410" }, "none-ls.nvim": { "branch": "main", "commit": "709a5e56f4273deca737d43355212ac94c1b5083" }, "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, "nvim-lspconfig": { "branch": "master", "commit": "ae0651d850f8f9313d4db3f96fe24dbf054edeb4" }, + "nvim-nio": { "branch": "master", "commit": "79e8968769d4422c08d514a413815bea6c1f67f9" }, "nvim-surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" }, "nvim-treesitter": { "branch": "master", "commit": "160e5d52c841dc9261c0b2dc6f253bddbcf3d766" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "156d5782b3a68845f824156e45fc5bb038211e7b" }, diff --git a/.config/nvim/lua/plugins/test.lua b/.config/nvim/lua/plugins/test.lua deleted file mode 100644 index 1a17372..0000000 --- a/.config/nvim/lua/plugins/test.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - { - "nvim-neotest/neotest", - optional = true, - dependencies = { - "olimorris/neotest-rspec", - }, - opts = { - adapters = { - ["neotest-rspec"] = { - rspec_cmd = function() - return vim.tbl_flatten({ - "bundle", - "exec", - "rspec", - }) - end, - }, - }, - }, - }, -} diff --git a/.config/nvim/lua/plugins/testing.lua b/.config/nvim/lua/plugins/testing.lua new file mode 100644 index 0000000..fb9efe4 --- /dev/null +++ b/.config/nvim/lua/plugins/testing.lua @@ -0,0 +1,40 @@ +return { + { + "nvim-neotest/neotest", + lazy = false, + dependencies = { + "nvim-neotest/nvim-nio", + "nvim-lua/plenary.nvim", + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter", + "olimorris/neotest-rspec", + "zidhuss/neotest-minitest" + }, + config = function() + require("neotest").setup({ + adapters = { + require("neotest-minitest"), + require("neotest-rspec")({ + rspec_cmd = function() + return vim.tbl_flatten({ + "bundle", + "exec", + "rspec", + }) + end, + }), + }, + }) + end, + keys = { + { "tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, + { "tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files" }, + { "tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, + { "tl", function() require("neotest").run.run_last() end, desc = "Run Last" }, + { "ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" }, + { "to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" }, + { "tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" }, + { "tS", function() require("neotest").run.stop() end, desc = "Stop" }, + }, + }, +} From 8677db7d0402ecc332abdd1f2a771315dc8e6248 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 20:34:34 +0200 Subject: [PATCH 052/280] Fix solargraph config --- .config/nvim/lua/plugins/lsp.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index a8f15b7..95a4459 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -69,17 +69,17 @@ return { "solargraph", "stdio", }, - -- -- settings = { - -- -- solargraph = { - -- -- autoformat = false, - -- -- completion = true, - -- -- diagnostic = true, - -- -- folding = true, - -- -- references = true, - -- -- rename = true, - -- -- symbols = true - -- -- } - -- -- } + settings = { + solargraph = { + autoformat = false, + completion = true, + diagnostic = true, + folding = true, + references = true, + rename = true, + symbols = true + } + } }) vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) From 8a82482f2ce65286e5366319e56d9c888248fd34 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 29 Apr 2024 20:54:09 +0200 Subject: [PATCH 053/280] Add copilot --- .config/nvim/lazy-lock.json | 4 ++++ .config/nvim/lua/plugins/lsp.lua | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index e27d597..8a21c2f 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -4,8 +4,12 @@ "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, + "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "d5f74ce4dfdd82848f3f4eac65fe6e29ac5df4c2" }, "gitsigns.nvim": { "branch": "main", "commit": "035da036e68e509ed158414416c827d022d914bd" }, diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 95a4459..b601c09 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -19,6 +19,26 @@ return { }, }, }, + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + config = function() + require("copilot").setup({}) + end, + }, + { + "zbirenbaum/copilot-cmp", + lazy = false, + event = "InsertEnter", + config = function() + require("copilot_cmp").setup() + require("copilot").setup({ + suggestion = { enabled = false }, + panel = { enabled = false }, + }) + end + }, { "williamboman/mason.nvim", lazy = false, @@ -132,6 +152,11 @@ return { { "hrsh7th/nvim-cmp", lazy = false, + dependencies = { + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-cmdline', + }, config = function() local cmp = require("cmp") require("luasnip.loaders.from_vscode").lazy_load() @@ -154,6 +179,7 @@ return { [""] = cmp.mapping.confirm({ select = true }), }), sources = cmp.config.sources({ + { name = "copilot", group_index = 2 }, { name = "nvim_lsp" }, { name = "luasnip" }, }, { @@ -162,4 +188,11 @@ return { }) end, }, + { + "zbirenbaum/copilot-cmp", + lazy = false, + config = function() + require("copilot_cmp").setup() + end + } } From f0de0cffa7f82a492eda0f58eb645a0cd7ac7c83 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 1 May 2024 10:52:21 +0200 Subject: [PATCH 054/280] Add latex --- .config/nvim/lazy-lock.json | 1 + .config/nvim/lua/languages/latex.lua | 10 ++++++++++ .config/nvim/lua/plugins/editor.lua | 2 +- .config/nvim/lua/plugins/lsp.lua | 7 +++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .config/nvim/lua/languages/latex.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 8a21c2f..f9a30be 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -45,5 +45,6 @@ "vim-rails": { "branch": "master", "commit": "8972461e64c7c4bf049f2f86ea1bc571e8077b55" }, "vim-system-copy": { "branch": "master", "commit": "8abd9ed21016bdc21b458c79da3b9ac0ee25c1ce" }, "vim-tmux-navigator": { "branch": "master", "commit": "a26954a585b02a2ac02f87145e204f8798a7cbc2" }, + "vimtex": { "branch": "master", "commit": "a80934749c69cc6875b3c9b13ef59573a4824fb2" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/.config/nvim/lua/languages/latex.lua b/.config/nvim/lua/languages/latex.lua new file mode 100644 index 0000000..b2d2dc2 --- /dev/null +++ b/.config/nvim/lua/languages/latex.lua @@ -0,0 +1,10 @@ +return { + { + "lervag/vimtex", + lazy = false, -- we don't want to lazy load VimTeX + -- tag = "v2.15", -- uncomment to pin to a specific release + init = function() + -- VimTeX configuration goes here + end + } +} diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 314ec91..527a5fe 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -42,7 +42,7 @@ return { }, setup = function() require("nvim-treesitter.configs").setup({ - ensure_installed = { "lua", "vim", "vimdoc", "help", "ruby" }, + ensure_installed = { "lua", "vim", "vimdoc", "help", "ruby", "bibtex", "latex" }, auto_install = true, endwise = { enable = true, diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index b601c09..5a16781 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -81,6 +81,13 @@ return { lspconfig.tsserver.setup({ capabilities = capabilities }) lspconfig.standardrb.setup({ capabilities = capabilities }) + lspconfig.ltex.setup({ + cmd = { "ltex-ls" }, + filetypes = { "markdown", "text", "cff", "tex" }, + flags = { debounce_text_changes = 299 }, + }) + + lspconfig.solargraph.setup({ capabilities = capabilities, cmd = { From b5e8e4143e1ee2b5073f41d46dec1e2c622043ca Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 1 May 2024 18:18:23 +0200 Subject: [PATCH 055/280] Update neotree config --- .config/nvim/lua/plugins/editor.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 527a5fe..8456bd7 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -22,7 +22,6 @@ return { opts = {}, }, { - "nvim-neo-tree/neo-tree.nvim", branch = "v3.x", dependencies = { @@ -31,8 +30,17 @@ return { "MunifTanjim/nui.nvim", }, keys = { - { "e", "Neotree position=float", desc = "Neotree" }, + { "e", "Neotree position=float reveal toggle", desc = "Neotree" }, }, + config = function() + require("neo-tree").setup({ + window = { + mappings = { + [""] = "none" + } + } + }) + end }, { "nvim-treesitter/nvim-treesitter", @@ -61,4 +69,8 @@ return { { "-", "Oil", desc = "Oil" }, }, }, + { + "jlanzarotta/bufexplorer", + lazy = false + } } From a9cde2004d0deaeb3f63ff0a21d531ffb1cdef6e Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 1 May 2024 18:26:47 +0200 Subject: [PATCH 056/280] Add nvim-spectre --- .config/nvim/lua/plugins/editor.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 8456bd7..9f4e022 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -72,5 +72,21 @@ return { { "jlanzarotta/bufexplorer", lazy = false + }, + { + "nvim-pack/nvim-spectre", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + }, + config = function() + require('spectre').setup() + end, + keys = { + { mode = 'n', 'S', 'lua require("spectre").toggle()', desc = "Toggle Spectre" }, + { mode = 'n', 'sw', 'lua require("spectre").open_visual({select_word=true})', desc = "Search current word" }, + { mode = 'v', 'sw', 'lua require("spectre").open_visual()', desc = "Search current word" }, + { mode = 'n', 'sp', 'lua require("spectre").open_file_search({select_word=true})', desc = "Search on current file" }, + } } } From 7435d19bd1cd3cd7254a532c06334a92e0d560cf Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 1 May 2024 19:12:38 +0200 Subject: [PATCH 057/280] Update config, improve loading time --- .config/nvim/lua/languages/latex.lua | 2 +- .config/nvim/lua/languages/rails.lua | 34 +++++++++++++++++++++++----- .config/nvim/lua/plugins/coding.lua | 2 +- .config/nvim/lua/plugins/editor.lua | 22 +++++++++++++++--- .config/nvim/lua/plugins/git.lua | 2 +- .config/nvim/lua/plugins/lsp.lua | 2 +- .config/nvim/lua/plugins/testing.lua | 4 +++- 7 files changed, 54 insertions(+), 14 deletions(-) diff --git a/.config/nvim/lua/languages/latex.lua b/.config/nvim/lua/languages/latex.lua index b2d2dc2..e559295 100644 --- a/.config/nvim/lua/languages/latex.lua +++ b/.config/nvim/lua/languages/latex.lua @@ -1,7 +1,7 @@ return { { "lervag/vimtex", - lazy = false, -- we don't want to lazy load VimTeX + ft = "tex", -- tag = "v2.15", -- uncomment to pin to a specific release init = function() -- VimTeX configuration goes here diff --git a/.config/nvim/lua/languages/rails.lua b/.config/nvim/lua/languages/rails.lua index 0f0381a..f1fe617 100644 --- a/.config/nvim/lua/languages/rails.lua +++ b/.config/nvim/lua/languages/rails.lua @@ -2,14 +2,36 @@ return { { "tpope/vim-rails", event = "VeryLazy" }, { "sato-s/telescope-rails.nvim", - dependencies = {"nvim-telescope/telescope.nvim"}, + dependencies = { "nvim-telescope/telescope.nvim" }, keys = { - { "rs", "Telescope rails specs", desc = "Telescope rails specs" }, + { "rs", "Telescope rails specs", desc = "Telescope rails specs" }, { "rc", "Telescope rails controllers", desc = "Telescope rails controllers" }, - { "rm", "Telescope rails models", desc = "Telescope rails models" }, - { "rv", "Telescope rails views", desc = "Telescope rails views" }, - { "ri", "Telescope rails migrations", desc = "Telescope rails migrations" }, - { "rl", "Telescope rails libs", desc = "Telescope rails libs" }, + { "rm", "Telescope rails models", desc = "Telescope rails models" }, + { "rv", "Telescope rails views", desc = "Telescope rails views" }, + { "ri", "Telescope rails migrations", desc = "Telescope rails migrations" }, + { "rl", "Telescope rails libs", desc = "Telescope rails libs" }, } + }, + { + "rgroli/other.nvim", + keys = { + { "ll", ":Other", desc = "Other" }, + { "leader>ltn", ":OtherTabNew", desc = "OtherTabNew" }, + { "leader>lp", ":OtherSplit", desc = "OtherSplit" }, + { "leader>lv", ":OtherVSplit", desc = "OtherVSplit" }, + { "leader>lc", ":OtherClear", desc = "OtherClear" }, + { "leader>lt", ":Other test", desc = "Other test" }, + }, + config = function() + require("other-nvim").setup({ + mappings = { + "livewire", + "angular", + "laravel", + "rails", + "golang", + }, + }) + end } } diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index 19c29a1..0382035 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -16,7 +16,7 @@ return { }, { "nat-418/boole.nvim", - lazy = false, + event = "VeryLazy", config = function() require("boole").setup({ mappings = { diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 9f4e022..3246fc3 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -48,10 +48,10 @@ return { dependencies = { "RRethy/nvim-treesitter-endwise" }, - setup = function() + config = function() require("nvim-treesitter.configs").setup({ - ensure_installed = { "lua", "vim", "vimdoc", "help", "ruby", "bibtex", "latex" }, - auto_install = true, + ensure_installed = { "lua", "vim", "vimdoc", "vimdoc", "ruby", "bibtex", "latex", "yaml" }, + auto_install = false, endwise = { enable = true, }, @@ -88,5 +88,21 @@ return { { mode = 'v', 'sw', 'lua require("spectre").open_visual()', desc = "Search current word" }, { mode = 'n', 'sp', 'lua require("spectre").open_file_search({select_word=true})', desc = "Search on current file" }, } + }, + { "folke/trouble.nvim" }, + { + "folke/todo-comments.nvim", + cmd = { "TodoTrouble", "TodoTelescope" }, + event = "VeryLazy", + config = true, + -- stylua: ignore + keys = { + { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" }, + { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" }, + { "xt", "TodoTrouble", desc = "Todo (Trouble)" }, + { "xT", "TodoTrouble keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme (Trouble)" }, + { "st", "TodoTelescope", desc = "Todo" }, + { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, + }, } } diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index d0b4531..b05b5e6 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -20,7 +20,7 @@ return { }, { "tpope/vim-fugitive", - lazy = false + cmd = { "Git" } }, { "lewis6991/gitsigns.nvim", diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 5a16781..fb3dc4f 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -197,7 +197,7 @@ return { }, { "zbirenbaum/copilot-cmp", - lazy = false, + event = "InsertEnter", config = function() require("copilot_cmp").setup() end diff --git a/.config/nvim/lua/plugins/testing.lua b/.config/nvim/lua/plugins/testing.lua index fb9efe4..6bea093 100644 --- a/.config/nvim/lua/plugins/testing.lua +++ b/.config/nvim/lua/plugins/testing.lua @@ -1,7 +1,9 @@ return { { "nvim-neotest/neotest", - lazy = false, + modules = { "neotest" }, + events = { "InsertEnter" }, + cmd = { "Neotest" }, dependencies = { "nvim-neotest/nvim-nio", "nvim-lua/plenary.nvim", From 1271b0428a0a665449fca437902892233b49c555 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 3 May 2024 09:38:44 +0200 Subject: [PATCH 058/280] Update lazygit config --- .config/nvim/lua/plugins/git.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index b05b5e6..9d0bc29 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -8,15 +8,16 @@ return { "LazyGitFilter", "LazyGitFilterCurrentFile", }, - -- optional for floating window border decoration - dependencies = { - "nvim-lua/plenary.nvim", - }, - -- setting the keybinding for LazyGit with 'keys' is recommended in - -- order to load the plugin when the command is run for the first time keys = { { "gg", "LazyGit", desc = "LazyGit" } - } + }, + config = function() + vim.g.lazygit_floating_window_winblend = 0 + vim.g.lazygit_floating_window_scaling_factor = 1 + vim.g.lazygit_floating_window_use_plenary = 0 + vim.g.lazygit_use_neovim_remote = 1 + vim.g.lazygit_config_file_path = '' + end }, { "tpope/vim-fugitive", From b2da897cd9bc5cb2e3f736f4dccfd02de1248a51 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 3 May 2024 09:41:32 +0200 Subject: [PATCH 059/280] Change default tmux index --- .tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index 96ff4a7..adc1efe 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -30,7 +30,7 @@ set -ag terminal-overrides ",xterm-256color:RGB" set-option -g status-position top set -g pane-border-lines "heavy" set -s escape-time 1 -set -g base-index 4 +set -g base-index 0 set -g pane-active-border-style "bg=black,fg=white" set -g pane-border-style "bg=black,fg=white" From fedf5869e27257c6411055196b2b0302657dd86f Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 3 May 2024 18:00:01 +0200 Subject: [PATCH 060/280] Update config --- .config/nvim/init.lua | 2 +- .config/nvim/lua/plugins/editor.lua | 17 ++++++++++++++++- .config/nvim/lua/plugins/git.lua | 4 ++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index e4df269..5bd4868 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -43,7 +43,7 @@ local opts = { require("lazy").setup(plugins, opts) -vim.keymap.set("n", "l", "Lazy") +vim.keymap.set("n", "L", "Lazy") vim.g.sonokai_better_performance = 1 vim.g.sonokai_style = "andromeda" diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 3246fc3..110e03b 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -34,9 +34,24 @@ return { }, config = function() require("neo-tree").setup({ + sources = { "filesystem", "document_symbols" }, window = { mappings = { - [""] = "none" + [""] = "none", + ["Y"] = { + function(state) + local node = state.tree:get_node() + local path = node:get_id() + vim.fn.setreg("+", path, "c") + end, + desc = "Copy Path to Clipboard", + }, + ["O"] = { + function(state) + require("lazy.util").open(state.tree:get_node().path, { system = true }) + end, + desc = "Open with System Application", + }, } } }) diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index 9d0bc29..c3900e2 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -1,6 +1,9 @@ return { { "kdheepak/lazygit.nvim", + dependencies = { + "nvim-telescope/telescope.nvim", + }, cmd = { "LazyGit", "LazyGitConfig", @@ -12,6 +15,7 @@ return { { "gg", "LazyGit", desc = "LazyGit" } }, config = function() + require("telescope").load_extension("lazygit") vim.g.lazygit_floating_window_winblend = 0 vim.g.lazygit_floating_window_scaling_factor = 1 vim.g.lazygit_floating_window_use_plenary = 0 From 8c7b5d2c16bc855078ceaf48ee825f5f98dffbfd Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 3 May 2024 18:01:43 +0200 Subject: [PATCH 061/280] Add alt keys --- .config/alacritty/alacritty.yml | 4 ++++ .config/nvim/init.lua | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 6b2136e..60caeef 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -144,6 +144,10 @@ key_bindings: - { key: F, mods: Command, chars: "\x1b\x66" } - { key: I, mods: Command, chars: "\x18\x21" } - { key: I, mods: Shift|Command, chars: "\x18\x24" } + - { key: J, mods: Alt, chars: "\x1bj" } + - { key: K, mods: Alt, chars: "\x1bk" } + - { key: H, mods: Alt, chars: "\x1bh" } + - { key: L, mods: Alt, chars: "\x1bl" } # Tmux - { key: D, mods: Command, chars: "\x06\x76" } diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 5bd4868..f15f1af 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -11,10 +11,21 @@ vim.opt.expandtab = true vim.opt.tabstop = 2 vim.opt.softtabstop = 2 vim.opt.shiftwidth = 2 +vim.opt.scrolloff = 10 + +vim.opt.winbar = "%f" +vim.opt.laststatus = 3 vim.keymap.set("n", "qq", "wqa") +vim.keymap.set("n", "q!", "qa!") vim.keymap.set("n", "/", "noh") +vim.keymap.set("n", "n", "nzz") +vim.keymap.set("n", "N", "Nzz") + +vim.keymap.set("n", "", "5jzz") +vim.keymap.set("n", "", "5kzz") + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ From 84b956f0bc5467ae04c379ba479c03c1ad09b42c Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 3 May 2024 18:01:58 +0200 Subject: [PATCH 062/280] Add some plugins --- .config/nvim/lazy-lock.json | 9 +++++++++ .config/nvim/lua/plugins/editor.lua | 24 ++++++++++++++++++++++++ .config/nvim/lua/plugins/lsp.lua | 1 + 3 files changed, 34 insertions(+) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index f9a30be..d4c7ca8 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -4,6 +4,7 @@ "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, + "bufexplorer": { "branch": "master", "commit": "20f0440948653b5482d555a35a432135ba46a26d" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, @@ -26,20 +27,28 @@ "none-ls.nvim": { "branch": "main", "commit": "709a5e56f4273deca737d43355212ac94c1b5083" }, "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, + "nvim-highlight-colors": { "branch": "main", "commit": "432dc7a817a4973041f02b418169667c491f60fd" }, "nvim-lspconfig": { "branch": "master", "commit": "ae0651d850f8f9313d4db3f96fe24dbf054edeb4" }, "nvim-nio": { "branch": "master", "commit": "79e8968769d4422c08d514a413815bea6c1f67f9" }, + "nvim-spectre": { "branch": "master", "commit": "4651801ba37a9407b7257287aec45b6653ffc5e9" }, "nvim-surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" }, "nvim-treesitter": { "branch": "master", "commit": "160e5d52c841dc9261c0b2dc6f253bddbcf3d766" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "156d5782b3a68845f824156e45fc5bb038211e7b" }, "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" }, "oil.nvim": { "branch": "master", "commit": "f3a31eba24587bc038592103d8f7e64648292115" }, + "other.nvim": { "branch": "main", "commit": "2a82971d3763474df29d5d32d0699b5bb13c551f" }, "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, "refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" }, "sonokai": { "branch": "master", "commit": "da162343354fbd9bf9cd49293a856f0e3761e8ac" }, + "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, "telescope-rails.nvim": { "branch": "master", "commit": "e0addf3751b0af1fc0bc4706ff25ba73949a98ae" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, + "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, + "toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" }, + "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, + "vim-LanguageTool": { "branch": "master", "commit": "0372ffae78aa3eac3bfa48ba3bf2f4015a86385a" }, "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, "vim-rails": { "branch": "master", "commit": "8972461e64c7c4bf049f2f86ea1bc571e8077b55" }, diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 110e03b..1fb5ae5 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -119,5 +119,29 @@ return { { "st", "TodoTelescope", desc = "Todo" }, { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, }, + }, + { + 'akinsho/toggleterm.nvim', + version = "*", + opts = {}, + keys = { + { "", "ToggleTerm", desc = "Toggle Terminal" } + } + }, + { + "simrat39/symbols-outline.nvim", + config = function() + require("symbols-outline").setup() + end, + keys = { + { "so", "SymbolsOutline", desc = "SymbolsOutline" } + } + }, + { + "brenoprata10/nvim-highlight-colors", + event = "VeryLazy", + config = function() + require('nvim-highlight-colors').setup({}) + end } } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index fb3dc4f..f497bd8 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -80,6 +80,7 @@ return { lspconfig.lua_ls.setup({ capabilities = capabilities }) lspconfig.tsserver.setup({ capabilities = capabilities }) lspconfig.standardrb.setup({ capabilities = capabilities }) + lspconfig.rust_analyzer.setup({ capabilities = capabilities }) lspconfig.ltex.setup({ cmd = { "ltex-ls" }, From 51c7039a86fa5dfe449cdc38190430bfcecea33b Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 3 May 2024 18:02:05 +0200 Subject: [PATCH 063/280] Update config --- .tmux.conf | 13 ++++++++++-- .zshrc | 12 ++++++++++- my-status-bar.tmux | 12 +++++------ scripts/pretty-pulls.ts | 45 +++++++++++++++++++++++++++++++---------- 4 files changed, 62 insertions(+), 20 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index adc1efe..96c7111 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -4,10 +4,11 @@ bind a send-prefix bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." -bind - split-window -v +bind - split-window -v -c "#{pane_current_path}" unbind '"' unbind % -bind | split-window -h +bind | split-window -h -c "#{pane_current_path}" +bind c new-window -c "#{pane_current_path}" setw -g mode-keys vi bind-key h select-pane -L @@ -28,12 +29,18 @@ set -g mouse on set -g default-terminal "screen-256color" set -ag terminal-overrides ",xterm-256color:RGB" set-option -g status-position top +set-option -g renumber-windows on set -g pane-border-lines "heavy" set -s escape-time 1 set -g base-index 0 set -g pane-active-border-style "bg=black,fg=white" set -g pane-border-style "bg=black,fg=white" +# Some hacks for OSX Alacritty audio bell +set -g monitor-bell on +set -g bell-action other +set-hook -g alert-bell 'run-shell "afplay /System/Library/Sounds/Funk.aiff"' + set -g focus-events on #set-hook -g pane-focus-out 'select-pane -P bg=colour235,fg=colour10' #set-hook -g pane-focus-in 'select-pane -P bg=default,fg=default' @@ -47,6 +54,8 @@ set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-prefix-highlight' set -g @plugin 'jimeh/tmuxifier' +set -g @plugin 'christoomey/vim-tmux-navigator' +# set -g @plugin 'arcticicestudio/nord-tmux' run-shell "~/my-status-bar.tmux" # set -g @plugin 'erikw/tmux-powerline' diff --git a/.zshrc b/.zshrc index b1b8c0b..aa6237c 100644 --- a/.zshrc +++ b/.zshrc @@ -1,6 +1,7 @@ source ~/.import-secrets.sh set -o vi +bindkey -v if [ "$TERM_PROGRAM" = "WarpTerminal" ] && [ "$TERMINAL_EMULATOR" != "JetBrains-JediTerm" ]; then printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "zsh"}}\x9c' @@ -14,8 +15,12 @@ export PATH="~/.asdf/shims/:$PATH" export BUN_INSTALL="$HOME/.bun" export PATH="$BUN_INSTALL/bin:$PATH" export PATH=~/dev/flutter/bin:$PATH -export PATH="/Users/dani/.gem/ruby/3.2.0/bin:$PATH" +# export PATH="/Users/dani/.gem/ruby/3.2.0/bin:$PATH" +export PATH="/opt/homebrew/opt/ruby/bin:$PATH" export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES # fix libcurl error +unset LIBRARY_PATH +unset LDFLAGS + source $HOMEBREW_PREFIX/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc" source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc" @@ -26,6 +31,8 @@ source "$HOME/.cargo/env" source /opt/homebrew/opt/asdf/libexec/asdf.sh eval "$(fzf --zsh)" +bindkey -r "^t" # Unbind fzf keybinding + eval "$(tmuxifier init -)" alias ls="eza" @@ -87,14 +94,17 @@ alias calacritty='nvim ~/.config/alacritty/alacritty.yml' alias ctmux='nvim ~/.tmux.conf' alias clazygit='nvim ~/Library/Application\ Support/lazygit/config.yml' alias cgit='nvim ~/.gitconfig' +alias kts='tmux kill-server' # [k]ill [t]mux [s]erver alias v='nvim' alias cpp='pbcopy' +alias bo='tectonic -X build && open build/default/default.pdf' # [b]uild and [o]pen alias g="grep" # [g]rep alias bra="bundle exec rubocop -A" # [b]undle exec [r]ubocop -[A] alias spec="be rspec" alias f="fork ." alias cnvim="cd ~/.config/nvim && nvim init.lua" # [c]onfigure [nvim] alias dbreset="bundle exec rails db:drop db:create db:schema:load db:seed" # [d]ata[b]ase [reset] +alias cpb="git branch | grep '*' | tr -d '*' | tr -d ' ' | pbcopy" # [c]o[p]y [b]ranch to clipboard alias glog="glog_ | grep -v -e '^\s*$' --color=always | less --use-color" # [g]it [log] alias glag="glog_ --all --since='00:00' --until='NOW' | grep -v -e '^\s*$' --color=always" # [g]it [l]og [a]ll [g]rep diff --git a/my-status-bar.tmux b/my-status-bar.tmux index c20f078..a7eb027 100755 --- a/my-status-bar.tmux +++ b/my-status-bar.tmux @@ -31,13 +31,13 @@ tmux_set status-fg "white" # tmux_set window-status-format "$title" # tmux_set window-status-separator " | " -# tmux_set window-status-format "#[bg=black] $title " -# tmux_set window-status-current-format "#[bg=khite,fg=black] $title " -# tmux_set window-status-separator " " +tmux_set window-status-format "#[bg=black] $title " +tmux_set window-status-current-format "#[bg=white,fg=black] $title " +tmux_set window-status-separator " " -tmux_set window-status-current-format "#[bg=$color1,fg=$color2]#[bg=$color2,fg=$color3] $title #[bg=$color1,fg=$color2]" -tmux_set window-status-separator "" -tmux_set window-status-format "#[bg=$color1,fg=$color3]#[bg=$color3,fg=$color2] $title #[bg=$color1,fg=$color3]" +# tmux_set window-status-current-format "#[bg=$color1,fg=$color2]#[bg=$color2,fg=$color3] $title #[bg=$color1,fg=$color2]" +# tmux_set window-status-separator "" +# tmux_set window-status-format "#[bg=$color1,fg=$color3]#[bg=$color3,fg=$color2] $title #[bg=$color1,fg=$color3]" #    cmd="#[fg=orange]#{pane_current_command}" diff --git a/scripts/pretty-pulls.ts b/scripts/pretty-pulls.ts index fe5c205..f941ee4 100755 --- a/scripts/pretty-pulls.ts +++ b/scripts/pretty-pulls.ts @@ -23,37 +23,60 @@ type PullRequest = { html_url: string number: number title: string + merged_at: string | null user: { login: string } } -const prs: { username: string, url: string, number: number, title: string }[] = [] +const prs: { username: string, url: string, number: number, title: string, mergedAt: string | null }[] = [] process.stdin.on('end', () => { try { const pulls = JSON.parse(data) as PullRequest[] pulls.forEach(pull => { - const { title, number, html_url, user } = pull - prs.push({ title, number, url: html_url, username: user.login }) + const { title, number, html_url, user, merged_at } = pull + prs.push({ title, number, url: html_url, username: user.login, mergedAt: merged_at }) }) console.log(` + + + + + + -${prs.map(pr => {) - }.join('') + + + + + + ${prs.map(pr => { - return ` - - + return ` + + + + +`}).join('')}
#${pr.number}
${pr.title}${pr.title}#${pr.number}${pr.username}${pr.mergedAt}#${pr.number}
+

`) From e457c7e4806da8407d6d126a283bd2e02f0d477b Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 5 May 2024 17:38:15 +0200 Subject: [PATCH 064/280] Add git signs keymap description --- .config/nvim/lua/plugins/git.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index c3900e2..f52be19 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -49,7 +49,7 @@ return { else gitsigns.nav_hunk('next') end - end) + end, { desc = "Next Hunk" }) map('n', '[c', function() if vim.wo.diff then @@ -57,7 +57,7 @@ return { else gitsigns.nav_hunk('prev') end - end) + end, { desc = "Previous Hunk" }) end }) end, From 1861dd38439d3baa6eda01c497bd2db18dc80d67 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 5 May 2024 17:54:24 +0200 Subject: [PATCH 065/280] Update gitsigns config --- .config/nvim/lua/plugins/git.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index f52be19..b46c158 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -29,10 +29,15 @@ return { }, { "lewis6991/gitsigns.nvim", - lazy = false, config = function() require('gitsigns').setup({ - + numhl = true, + current_line_blame_opts = { + virt_text_pos = "right_align", + delay = 0, + }, + show_deleted = true, + update_debounce = 100, on_attach = function(bufnr) local gitsigns = require('gitsigns') From 583323d3f8cac7b26fece65d4869d93e5923fc8a Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Thu, 9 May 2024 00:42:38 +0200 Subject: [PATCH 066/280] Update alacritty config --- .config/alacritty/alacritty.toml | 612 +++++++++++++++++++++++++++++++ .config/alacritty/alacritty.yml | 173 --------- 2 files changed, 612 insertions(+), 173 deletions(-) create mode 100644 .config/alacritty/alacritty.toml delete mode 100644 .config/alacritty/alacritty.yml diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml new file mode 100644 index 0000000..3ccbc45 --- /dev/null +++ b/.config/alacritty/alacritty.toml @@ -0,0 +1,612 @@ +[[colors.indexed_colors]] +color = "#ff9e64" +index = 16 + +[[colors.indexed_colors]] +color = "#db4b4b" +index = 17 + +[colors.bright] +black = "0x7f8490" +blue = "0x76cce0" +cyan = "0xf39660" +green = "0x9ed072" +magenta = "0xb39df3" +red = "0xfc5d7c" +white = "0xe2e2e3" +yellow = "0xe7c664" + +[colors.normal] +black = "0x181819" +blue = "0x76cce0" +cyan = "0xf39660" +green = "0x9ed072" +magenta = "0xb39df3" +red = "0xfc5d7c" +white = "0xe2e2e3" +yellow = "0xe7c664" + +[colors.primary] +background = "0x2c2e34" +foreground = "0xe2e2e3" + +[env] +TERM = "xterm-256color" + +[font] +size = 20.0 + +[font.normal] +family = "JetBrainsMono Nerd Font" + +[[keyboard.bindings]] +action = "CreateNewWindow" +key = "N" +mods = "Command" + +[[keyboard.bindings]] +action = "SearchForward" +key = "F" +mods = "Command" + +[[keyboard.bindings]] +chars = "alacritty -e 'htop' & \r" +key = "P" +mods = "Command" + +[[keyboard.bindings]] +chars = "search_history \r" +key = "Slash" +mode = "AppCursor" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u001BOH" +key = "Home" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[H" +key = "Home" +mode = "~AppCursor" + +[[keyboard.bindings]] +chars = "\u001BOF" +key = "End" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[F" +key = "End" +mode = "~AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[5;2~" +key = "PageUp" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[5;5~" +key = "PageUp" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[5~" +key = "PageUp" + +[[keyboard.bindings]] +chars = "\u001B[6;2~" +key = "PageDown" +mods = "Shift" + +[[keyboard.bindings]] +chars = " " +key = "Space" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B\u007F" +key = "Back" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001Bb" +key = "Left" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001Bf" +key = "Right" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001Bb" +key = "Left" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001Bf" +key = "Right" +mods = "Control" + +[[keyboard.bindings]] +chars = "o" +key = "Delete" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001Bo" +key = "Back" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u0018," +key = "R" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u0000" +key = "Return" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u0000" +key = "Space" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u0000" +key = "Space" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u0000" +key = "Space" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018(" +key = "N" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u0018)" +key = "N" +mods = "Shift|Alt" + +[[keyboard.bindings]] +chars = "\u0018'" +key = "P" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u0018(" +key = "P" +mods = "Shift|Alt" + +[[keyboard.bindings]] +chars = "\u0018B" +key = "T" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u0018C" +key = "T" +mods = "Shift|Alt" + +[[keyboard.bindings]] +chars = "\u0018#" +key = "R" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u0018$" +key = "R" +mods = "Shift|Alt" + +[[keyboard.bindings]] +chars = "\u0018<" +key = "Comma" +mods = "Shift|Alt" + +[[keyboard.bindings]] +chars = "\u0017>" +key = "Period" +mods = "Shift|Alt" + +[[keyboard.bindings]] +chars = "\u000B," +key = "Comma" +mods = "Alt" + +[[keyboard.bindings]] +action = "Paste" +key = "V" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u001Ba" +key = "B" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u001Bc" +key = "D" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018m" +key = "J" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018a" +key = "K" +mods = "Command" + +[[keyboard.bindings]] +action = "Copy" +key = "C" +mods = "Command" + +[[keyboard.bindings]] +action = "Quit" +key = "Q" +mods = "Command" + +[[keyboard.bindings]] +action = "Quit" +key = "W" +mods = "Command" + +[[keyboard.bindings]] +action = "ResetFontSize" +key = "Key0" +mods = "Command" + +[[keyboard.bindings]] +action = "IncreaseFontSize" +key = "Equals" +mods = "Command" + +[[keyboard.bindings]] +action = "DecreaseFontSize" +key = "Minus" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0015" +key = "Back" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018d" +key = "D" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u0018v" +key = "V" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u0018s" +key = "A" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u0018V" +key = "S" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u0018\b" +key = "H" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = """ +\u0018 +""" +key = "J" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u0018\u000B" +key = "K" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u0018\f" +key = "L" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u00181" +key = "Key1" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00182" +key = "Key2" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00183" +key = "Key3" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00184" +key = "Key4" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00185" +key = "Key5" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00186" +key = "Key6" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00187" +key = "Key7" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00188" +key = "Key8" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00189" +key = "Key9" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018c" +key = "T" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018x" +key = "X" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018w" +key = "S" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018/" +key = "Slash" +mods = "Control|Command" + +[[keyboard.bindings]] +chars = "\u0018," +key = "R" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018[" +key = "LBracket" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018=" +key = "A" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018o" +key = "O" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018z" +key = "O" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u0018z" +key = "Return" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018\u0001" +key = "Escape" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018\u0010" +key = "Comma" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018\u000E" +key = "Semicolon" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018\t" +key = "F" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u0018\t" +key = "E" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018n" +key = "N" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018p" +key = "P" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018/" +key = "Slash" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u001Bf" +key = "F" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018!" +key = "I" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0018$" +key = "I" +mods = "Shift|Command" + +[[keyboard.bindings]] +chars = "\u001Bj" +key = "J" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001Bk" +key = "K" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001Bh" +key = "H" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001Bl" +key = "L" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u0006v" +key = "D" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0006s" +key = "D" +mods = "Command|Shift" + +[[keyboard.bindings]] +chars = "\u0006x" +key = "W" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0006h" +key = "H" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0006j" +key = "J" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0006k" +key = "K" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0006l" +key = "L" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0006c" +key = "T" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00061" +key = "Key1" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00062" +key = "Key2" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00063" +key = "Key3" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00064" +key = "Key4" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00065" +key = "Key5" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00066" +key = "Key6" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00067" +key = "Key7" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00068" +key = "Key8" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u00069" +key = "Key9" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0007Q" +key = "Left" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0006J" +key = "Down" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0006K" +key = "Up" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u0006L" +key = "Right" +mods = "Command" + +[shell] +args = ["-l", "-c", "session_name=$(tmux ls | grep -v \"(attached)\" | head -n 1 | cut -d: -f1); [ -n \"$session_name\" ] && tmux attach -t \"$session_name\" || tmux new-session"] +program = "/bin/zsh" + +[window] +decorations = "buttonless" +decorations_theme_variant = "None" +dynamic_padding = false +dynamic_title = true +opacity = 1 + +[window.padding] +x = 10 +y = 10 diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml deleted file mode 100644 index 60caeef..0000000 --- a/.config/alacritty/alacritty.yml +++ /dev/null @@ -1,173 +0,0 @@ -font: - size: 20.0 - normal: - family: JetBrainsMono Nerd Font - use_thin_stroke: true - -window: - opacity: 1 - dynamic_title: true - decorations_theme_variant: None - decorations: buttonless - dynamic_padding: false - padding: - x: 10 - y: 10 - -colors: - primary: - background: "#1a1b26" - foreground: "#c0caf5" - normal: - black: "#15161e" - red: "#f7768e" - green: "#9ece6a" - yellow: "#e0af68" - blue: "#7aa2f7" - magenta: "#bb9af7" - cyan: "#7dcfff" - white: "#a9b1d6" - bright: - black: "#414868" - red: "#f7768e" - green: "#9ece6a" - yellow: "#e0af68" - blue: "#7aa2f7" - magenta: "#bb9af7" - cyan: "#7dcfff" - white: "#c0caf5" - indexed_colors: - - index: 16 - color: "#ff9e64" - - index: 17 - color: "#db4b4b" - -env: - TERM: xterm-256color - -shell: - program: /bin/zsh - args: - - -l - - -c - - 'session_name=$(tmux ls | grep -v "(attached)" | head -n 1 | cut -d: -f1); [ -n "$session_name" ] && tmux attach -t "$session_name" || tmux new-session' - -# To get keybinding, just run: xxd -psd -key_bindings: - - { key: N, mods: Command, action: CreateNewWindow } - - { key: F, mods: Command, action: SearchForward } - - { key: P, mods: Command, chars: "alacritty -e 'htop' & \x0D" } - - { key: Slash, mods: Command, mode: AppCursor, chars: "search_history \x0D" } - - - { key: Home, chars: "\x1bOH", mode: AppCursor } - - { key: Home, chars: "\x1b[H", mode: ~AppCursor } - - { key: End, chars: "\x1bOF", mode: AppCursor } - - { key: End, chars: "\x1b[F", mode: ~AppCursor } - - { key: PageUp, mods: Shift, chars: "\x1b[5;2~" } - - { key: PageUp, mods: Control, chars: "\x1b[5;5~" } - - { key: PageUp, chars: "\x1b[5~" } - - { key: PageDown, mods: Shift, chars: "\x1b[6;2~" } - - { key: Space, mods: Alt, chars: " " } - - { key: Back, mods: Alt, chars: "\x1b\x7f" } # Delete word - - { key: Left, mods: Alt, chars: "\x1bb" } # one word left - - { key: Right, mods: Alt, chars: "\x1bf" } # one word right - - { key: Left, mods: Control, chars: "\x1bb" } # one word left - - { key: Right, mods: Control, chars: "\x1bf" } # one word right - - { key: Delete, mods: Shift, chars: "\x6f" } - - - { key: Back, mods: Shift, chars: "\x1b\x6f" } - - { key: R, mods: Alt, chars: "\x18\x2c" } - - { key: Return, mods: Shift, chars: "\x00" } - - { key: Space, mods: Control, chars: "\x00" } - - { key: Space, mods: Alt, chars: "\x00" } - - { key: Space, mods: Command, chars: "\x00" } - - { key: N, mods: Shift|Command, chars: "\x18\x28" } - - { key: N, mods: Shift|Alt, chars: "\x18\x29" } - - { key: P, mods: Shift|Command, chars: "\x18\x27" } - - { key: P, mods: Shift|Alt, chars: "\x18\x28" } - - { key: T, mods: Shift|Command, chars: "\x18\x42" } - - { key: T, mods: Shift|Alt, chars: "\x18\x43" } - - { key: R, mods: Shift|Command, chars: "\x18\x23" } - - { key: R, mods: Shift|Alt, chars: "\x18\x24" } - - { key: Comma, mods: Shift|Alt, chars: "\x18<" } - - { key: Period, mods: Shift|Alt, chars: "\x17>" } - - { key: Comma, mods: Alt, chars: "\x0b," } - - # Mac - - { key: V, mods: Command, action: Paste } - - { key: B, mods: Command, chars: "\x1b\x61" } - - { key: D, mods: Command, chars: "\x1b\x63" } - - { key: J, mods: Command, chars: "\x18\x6d" } - - { key: K, mods: Command, chars: "\x18\x61" } - - { key: C, mods: Command, action: Copy } - - { key: Q, mods: Command, action: Quit } - - { key: W, mods: Command, action: Quit } - - { key: Key0, mods: Command, action: ResetFontSize } - - { key: Equals, mods: Command, action: IncreaseFontSize } - - { key: Minus, mods: Command, action: DecreaseFontSize } - - { key: Back, mods: Command, chars: "\x15" } # delete word/line - - { key: D, mods: Shift|Command, chars: "\x18\x64" } - - { key: V, mods: Shift|Command, chars: "\x18\x76" } - - { key: A, mods: Shift|Command, chars: "\x18\x73" } - - { key: S, mods: Shift|Command, chars: "\x18\x56" } - - { key: H, mods: Shift|Command, chars: "\x18\x08" } - - { key: J, mods: Shift|Command, chars: "\x18\x0a" } - - { key: K, mods: Shift|Command, chars: "\x18\x0b" } - - { key: L, mods: Shift|Command, chars: "\x18\x0c" } - - { key: Key1, mods: Command, chars: "\x18\x31" } - - { key: Key2, mods: Command, chars: "\x18\x32" } - - { key: Key3, mods: Command, chars: "\x18\x33" } - - { key: Key4, mods: Command, chars: "\x18\x34" } - - { key: Key5, mods: Command, chars: "\x18\x35" } - - { key: Key6, mods: Command, chars: "\x18\x36" } - - { key: Key7, mods: Command, chars: "\x18\x37" } - - { key: Key8, mods: Command, chars: "\x18\x38" } - - { key: Key9, mods: Command, chars: "\x18\x39" } - - { key: T, mods: Command, chars: "\x18\x63" } - - { key: X, mods: Command, chars: "\x18\x78" } - - { key: S, mods: Command, chars: "\x18\x77" } - - { key: Slash, mods: Control|Command, chars: "\x18\x2f" } - - { key: R, mods: Command, chars: "\x18\x2c" } - - { key: LBracket, mods: Command, chars: "\x18\x5b" } - - { key: A, mods: Command, chars: "\x18\x3d" } - - { key: O, mods: Command, chars: "\x18\x6f" } - - { key: O, mods: Shift|Command, chars: "\x18\x7a" } - - { key: Return, mods: Command, chars: "\x18\x7a" } - - { key: Escape, mods: Command, chars: "\x18\x01" } - - { key: Comma, mods: Command, chars: "\x18\x10" } - - { key: Semicolon, mods: Command, chars: "\x18\x0e" } - - { key: F, mods: Shift|Command, chars: "\x18\x09" } - - { key: E, mods: Command, chars: "\x18\x09" } - - { key: N, mods: Command, chars: "\x18\x6e" } - - { key: P, mods: Command, chars: "\x18\x70" } - - { key: Slash, mods: Command, chars: "\x18\x2f" } - - { key: F, mods: Command, chars: "\x1b\x66" } - - { key: I, mods: Command, chars: "\x18\x21" } - - { key: I, mods: Shift|Command, chars: "\x18\x24" } - - { key: J, mods: Alt, chars: "\x1bj" } - - { key: K, mods: Alt, chars: "\x1bk" } - - { key: H, mods: Alt, chars: "\x1bh" } - - { key: L, mods: Alt, chars: "\x1bl" } - - # Tmux - - { key: D, mods: Command, chars: "\x06\x76" } - - { key: D, mods: Command|Shift, chars: "\x06\x73" } - - { key: W, mods: Command, chars: "\x06\x78" } - - { key: H, mods: Command, chars: "\x06\x68" } - - { key: J, mods: Command, chars: "\x06\x6a" } - - { key: K, mods: Command, chars: "\x06\x6b" } - - { key: L, mods: Command, chars: "\x06\x6c" } - - { key: T, mods: Command, chars: "\x06\x63" } - - { key: Key1, mods: Command, chars: "\x06\x31" } - - { key: Key2, mods: Command, chars: "\x06\x32" } - - { key: Key3, mods: Command, chars: "\x06\x33" } - - { key: Key4, mods: Command, chars: "\x06\x34" } - - { key: Key5, mods: Command, chars: "\x06\x35" } - - { key: Key6, mods: Command, chars: "\x06\x36" } - - { key: Key7, mods: Command, chars: "\x06\x37" } - - { key: Key8, mods: Command, chars: "\x06\x38" } - - { key: Key9, mods: Command, chars: "\x06\x39" } - - { key: Left, mods: Command, chars: "\x07\x51" } - - { key: Down, mods: Command, chars: "\x06\x4a" } - - { key: Up, mods: Command, chars: "\x06\x4b" } - - { key: Right, mods: Command, chars: "\x06\x4c" } From 55892f78751f8ea7b36d1b68f0a6b519b3e6762c Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 13 May 2024 13:54:02 +0200 Subject: [PATCH 067/280] Add harpoon, window picker --- .config/nvim/lua/plugins/editor.lua | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 1fb5ae5..08d745d 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -17,7 +17,7 @@ return { event = "VeryLazy", init = function() vim.o.timeout = true - vim.o.timeoutlen = 0 + vim.o.timeoutlen = 300 end, opts = {}, }, @@ -28,6 +28,7 @@ return { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons", "MunifTanjim/nui.nvim", + "s1n7ax/nvim-window-picker" }, keys = { { "e", "Neotree position=float reveal toggle", desc = "Neotree" }, @@ -65,7 +66,8 @@ return { }, config = function() require("nvim-treesitter.configs").setup({ - ensure_installed = { "lua", "vim", "vimdoc", "vimdoc", "ruby", "bibtex", "latex", "yaml" }, + ensure_installed = { "lua", "vim", "vimdoc", "vimdoc", "ruby", "bibtex", "yaml" }, + ignore_install = { "latex" }, -- highlighting by vimtex auto_install = false, endwise = { enable = true, @@ -143,5 +145,26 @@ return { config = function() require('nvim-highlight-colors').setup({}) end - } + }, + { + "ThePrimeagen/harpoon", + event = "VeryLazy", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("harpoon").setup({}) + end, + keys = { + { "1", function() require("harpoon.ui").nav_file(1) end, desc = "Harpoon file 1" }, + { "2", function() require("harpoon.ui").nav_file(2) end, desc = "Harpoon file 2" }, + { "3", function() require("harpoon.ui").nav_file(3) end, desc = "Harpoon file 3" }, + { "4", function() require("harpoon.ui").nav_file(4) end, desc = "Harpoon file 4" }, + { "5", function() require("harpoon.ui").nav_file(5) end, desc = "Harpoon file 5" }, + { "6", function() require("harpoon.ui").nav_file(6) end, desc = "Harpoon file 6" }, + { "7", function() require("harpoon.ui").nav_file(7) end, desc = "Harpoon file 7" }, + { "8", function() require("harpoon.ui").nav_file(8) end, desc = "Harpoon file 8" }, + { "9", function() require("harpoon.ui").nav_file(9) end, desc = "Harpoon file 9" }, + { "hh", function() require("harpoon.ui").toggle_quick_menu() end, desc = "Harpoon toggle quick menu" }, + { "H", function() require("harpoon.mark").add_file() end, desc = "Harpoon add file" }, + } + }, } From 15acb2e8104225fc984429b10e0eae8f3c448de6 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 10 Jun 2024 18:40:43 +0200 Subject: [PATCH 068/280] Breaking changes i guess --- .config/alacritty/alacritty.toml | 2 +- .config/nvim/init.lua | 11 +- .config/nvim/lazy-lock.json | 68 ++-- .config/nvim/lua/languages/latex.lua | 4 + .config/nvim/lua/languages/markdown.lua | 14 +- .config/nvim/lua/languages/plantuml.lua | 10 + .config/nvim/lua/languages/rust.lua | 5 + .config/nvim/lua/plugins/coding.lua | 150 ++++++--- .config/nvim/lua/plugins/editor.lua | 409 +++++++++++++++--------- .config/nvim/lua/plugins/git.lua | 7 +- .config/nvim/lua/plugins/lsp.lua | 25 +- .config/nvim/lua/plugins/navigation.lua | 2 +- .tmux.conf | 10 +- .zshrc | 20 +- my-status-bar.tmux | 12 +- 15 files changed, 488 insertions(+), 261 deletions(-) create mode 100644 .config/nvim/lua/languages/plantuml.lua create mode 100644 .config/nvim/lua/languages/rust.lua diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 3ccbc45..029e111 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -50,7 +50,7 @@ key = "F" mods = "Command" [[keyboard.bindings]] -chars = "alacritty -e 'htop' & \r" +chars = "alacritty -e 'btop' & \r" key = "P" mods = "Command" diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index f15f1af..b25d094 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -16,9 +16,12 @@ vim.opt.scrolloff = 10 vim.opt.winbar = "%f" vim.opt.laststatus = 3 +vim.opt.spelllang = "de_ch" + vim.keymap.set("n", "qq", "wqa") vim.keymap.set("n", "q!", "qa!") vim.keymap.set("n", "/", "noh") +vim.api.nvim_set_keymap('n', 'gw', 'diw"apviwo"bpviwo', { noremap = true, silent = true }) vim.keymap.set("n", "n", "nzz") vim.keymap.set("n", "N", "Nzz") @@ -58,4 +61,10 @@ vim.keymap.set("n", "L", "Lazy") vim.g.sonokai_better_performance = 1 vim.g.sonokai_style = "andromeda" -vim.cmd.colorscheme("sonokai") +-- vim.cmd.colorscheme("tokyonight") + +-- vim.api.nvim_command('highlight Normal guibg=NONE ctermbg=NONE') +-- vim.api.nvim_command('highlight NonText guibg=NONE ctermbg=NONE') +-- vim.api.nvim_command('highlight LineNr guibg=NONE ctermbg=NONE') +-- vim.api.nvim_command('highlight SignColumn guibg=NONE ctermbg=NONE') +-- vim.api.nvim_command('highlight VertSplit guibg=NONE ctermbg=NONE') diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index d4c7ca8..98d7a30 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,59 +1,67 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, + "LuaSnip": { "branch": "master", "commit": "de1a287c9cb525ae52bc846e8f6207e5ef1da5ac" }, "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "bufexplorer": { "branch": "master", "commit": "20f0440948653b5482d555a35a432135ba46a26d" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, - "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, - "friendly-snippets": { "branch": "main", "commit": "d5f74ce4dfdd82848f3f4eac65fe6e29ac5df4c2" }, - "gitsigns.nvim": { "branch": "main", "commit": "035da036e68e509ed158414416c827d022d914bd" }, - "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, - "lazygit.nvim": { "branch": "main", "commit": "0ada6c6e7e138df92f5009b6952f4ac41248305a" }, + "diffview.nvim": { "branch": "main", "commit": "9bdd5537575c2ea7925b71ae06585b934beea13d" }, + "flash.nvim": { "branch": "main", "commit": "11a2e667d19d8f48c93c6ed2e2e525ac6b1b79be" }, + "friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" }, + "gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" }, + "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, + "lazy.nvim": { "branch": "main", "commit": "5d29ffeaa0f2d91f1dfbc21943d19a11e59a6fc6" }, + "lazygit.nvim": { "branch": "main", "commit": "ad3e1ea592f9d13e86e0d4e850224d9d78069508" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown.nvim": { "branch": "master", "commit": "951b7b567668608d60637d2c9e97f4baea5fdbbe" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, - "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, + "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" }, - "neoconf.nvim": { "branch": "main", "commit": "ba3503e246ea687732e51f7f9878e653e2e2039b" }, + "neoconf.nvim": { "branch": "main", "commit": "0065de89c834e1090a847a9aa126af5dce1db4dc" }, "neotest": { "branch": "master", "commit": "5caac5cc235d495a2382bc2980630ef36ac87032" }, "neotest-minitest": { "branch": "main", "commit": "0543bf4e997b2c970707cb297e2f74c438eb0653" }, - "neotest-rspec": { "branch": "main", "commit": "201f4891b5a0edc2e5f12196f35726f4d4eca410" }, - "none-ls.nvim": { "branch": "main", "commit": "709a5e56f4273deca737d43355212ac94c1b5083" }, - "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, - "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, - "nvim-highlight-colors": { "branch": "main", "commit": "432dc7a817a4973041f02b418169667c491f60fd" }, + "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, + "none-ls.nvim": { "branch": "main", "commit": "37671797d6e5f9bd0ee3ab965ab2e6de251e1930" }, + "nui.nvim": { "branch": "main", "commit": "b1b3dcd6ed8f355c78bad3d395ff645be5f8b6ae" }, + "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, "nvim-lspconfig": { "branch": "master", "commit": "ae0651d850f8f9313d4db3f96fe24dbf054edeb4" }, - "nvim-nio": { "branch": "master", "commit": "79e8968769d4422c08d514a413815bea6c1f67f9" }, - "nvim-spectre": { "branch": "master", "commit": "4651801ba37a9407b7257287aec45b6653ffc5e9" }, - "nvim-surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" }, - "nvim-treesitter": { "branch": "master", "commit": "160e5d52c841dc9261c0b2dc6f253bddbcf3d766" }, - "nvim-treesitter-endwise": { "branch": "master", "commit": "156d5782b3a68845f824156e45fc5bb038211e7b" }, - "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" }, - "oil.nvim": { "branch": "master", "commit": "f3a31eba24587bc038592103d8f7e64648292115" }, + "nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" }, + "nvim-spectre": { "branch": "master", "commit": "50e96602153f14c913e1969aaf9720e080394eb3" }, + "nvim-surround": { "branch": "main", "commit": "79aaa42da1f698ed31bcbe7f83081f69dca7ba17" }, + "nvim-treesitter": { "branch": "master", "commit": "ccfa76d4cb53224cb0ecefb12f79ecdbbf1fd62d" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, + "nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" }, + "nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }, + "oil.nvim": { "branch": "master", "commit": "06a19f77f1a1da37b675635e6f9c5b5d50bcaacd" }, + "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, "other.nvim": { "branch": "main", "commit": "2a82971d3763474df29d5d32d0699b5bb13c551f" }, - "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, - "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, + "oxocarbon.nvim": { "branch": "main", "commit": "c5846d10cbe4131cc5e32c6d00beaf59cb60f6a2" }, + "persistence.nvim": { "branch": "main", "commit": "5fe077056c821aab41f87650bd6e1c48cd7dd047" }, + "plantuml-previewer.vim": { "branch": "master", "commit": "1dd4d0f2b09cd80a217f76d82f93830dbbe689b3" }, + "plantuml-syntax": { "branch": "master", "commit": "44054d6d2cbcf01a064858faa3364cd30d38057d" }, + "plenary.nvim": { "branch": "master", "commit": "b5c8de02a44ffeabff678090edd6a132ff8ab77d" }, "refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" }, - "sonokai": { "branch": "master", "commit": "da162343354fbd9bf9cd49293a856f0e3761e8ac" }, + "sonokai": { "branch": "master", "commit": "239c228a5ea2e141377b6727ee79731a289f123a" }, "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, "telescope-rails.nvim": { "branch": "master", "commit": "e0addf3751b0af1fc0bc4706ff25ba73949a98ae" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, "toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" }, - "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, - "vim-LanguageTool": { "branch": "master", "commit": "0372ffae78aa3eac3bfa48ba3bf2f4015a86385a" }, - "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, + "trouble.nvim": { "branch": "main", "commit": "551105a339159841fe8d490330a65268ce931fe8" }, + "vim-fugitive": { "branch": "master", "commit": "09ffa8fc08c27b47790f954396adacfe6c450130" }, + "vim-grammarous": { "branch": "master", "commit": "db46357465ce587d5325e816235b5e92415f8c05" }, "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, "vim-rails": { "branch": "master", "commit": "8972461e64c7c4bf049f2f86ea1bc571e8077b55" }, + "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-system-copy": { "branch": "master", "commit": "8abd9ed21016bdc21b458c79da3b9ac0ee25c1ce" }, - "vim-tmux-navigator": { "branch": "master", "commit": "a26954a585b02a2ac02f87145e204f8798a7cbc2" }, - "vimtex": { "branch": "master", "commit": "a80934749c69cc6875b3c9b13ef59573a4824fb2" }, + "vim-tmux-navigator": { "branch": "master", "commit": "c600cf10db1bf933aab9e357158bf9b202ecf99b" }, + "vimtex": { "branch": "master", "commit": "9665df7f51ee24aa81dbd81782e0a22480209753" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/.config/nvim/lua/languages/latex.lua b/.config/nvim/lua/languages/latex.lua index e559295..301d1e5 100644 --- a/.config/nvim/lua/languages/latex.lua +++ b/.config/nvim/lua/languages/latex.lua @@ -6,5 +6,9 @@ return { init = function() -- VimTeX configuration goes here end + }, + { + "rhysd/vim-grammarous", + ft = "tex", } } diff --git a/.config/nvim/lua/languages/markdown.lua b/.config/nvim/lua/languages/markdown.lua index 713b3e7..4a068ca 100644 --- a/.config/nvim/lua/languages/markdown.lua +++ b/.config/nvim/lua/languages/markdown.lua @@ -1,8 +1,16 @@ return { - { + { "tadmccorkle/markdown.nvim", - -- ft = "markdown", + ft = "markdown", event = "VeryLazy", - lazy = false + }, + { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = "cd app && yarn install", + init = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + ft = { "markdown" }, }, } diff --git a/.config/nvim/lua/languages/plantuml.lua b/.config/nvim/lua/languages/plantuml.lua new file mode 100644 index 0000000..2068bb3 --- /dev/null +++ b/.config/nvim/lua/languages/plantuml.lua @@ -0,0 +1,10 @@ +return { + { + "weirongxu/plantuml-previewer.vim", + dependencies = { "tyru/open-browser.vim", "aklt/plantuml-syntax" }, + lazy = false, + config = function() + vim.g.plantuml_previewer_plantuml_jar_path = '/opt/homebrew/bin/plantuml' + end + } +} diff --git a/.config/nvim/lua/languages/rust.lua b/.config/nvim/lua/languages/rust.lua new file mode 100644 index 0000000..f7808ad --- /dev/null +++ b/.config/nvim/lua/languages/rust.lua @@ -0,0 +1,5 @@ +return {{ +-- 'mrcjkb/rustaceanvim', +-- version = '^4', -- Recommended +-- lazy = false, -- This plugin is already lazy +}} diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index 0382035..cab8190 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -1,45 +1,109 @@ return { - { - "kylechui/nvim-surround", - version = "*", - event = "VeryLazy", - config = function() - require("nvim-surround").setup({}) - end, - }, - { - "m4xshen/autoclose.nvim", - event = "VeryLazy", - config = function() - require("autoclose").setup() - end, - }, - { - "nat-418/boole.nvim", - event = "VeryLazy", - config = function() - require("boole").setup({ - mappings = { - increment = "", - decrement = "", - }, - additions = { - { "Foo", "Bar" }, - { "tic", "tac", "toe" }, - }, - allow_caps_additions = { - { "enable", "disable" }, - }, - }) - end, - }, - { - "numToStr/Comment.nvim", - opts = {}, - lazy = false, - }, - { - "machakann/vim-highlightedyank", - lazy = false - } + { + "kylechui/nvim-surround", + version = "*", + event = "VeryLazy", + config = function() + require("nvim-surround").setup({}) + end, + }, + { + "m4xshen/autoclose.nvim", + event = "VeryLazy", + config = function() + require("autoclose").setup() + end, + }, + { + "nat-418/boole.nvim", + event = "VeryLazy", + config = function() + require("boole").setup({ + mappings = { + increment = "", + decrement = "", + }, + additions = { + { "Foo", "Bar" }, + { "tic", "tac", "toe" }, + -- plantuml sequence + { "->", "<--" }, + { "++", "--" }, + }, + allow_caps_additions = { + { "enable", "disable" }, + }, + }) + end, + }, + -- { + -- "monaqa/dial.nvim", + -- lazy = false, + -- config = function() + -- local augend = require("dial.augend") + -- + -- vim.keymap.set("n", "", function() + -- require("dial.map").manipulate("increment", "normal") + -- end) + -- vim.keymap.set("n", "", function() + -- require("dial.map").manipulate("decrement", "normal") + -- end) + -- vim.keymap.set("n", "g", function() + -- require("dial.map").manipulate("increment", "gnormal") + -- end) + -- vim.keymap.set("n", "g", function() + -- require("dial.map").manipulate("decrement", "gnormal") + -- end) + -- vim.keymap.set("v", "", function() + -- require("dial.map").manipulate("increment", "visual") + -- end) + -- vim.keymap.set("v", "", function() + -- require("dial.map").manipulate("decrement", "visual") + -- end) + -- vim.keymap.set("v", "g", function() + -- require("dial.map").manipulate("increment", "gvisual") + -- end) + -- vim.keymap.set("v", "g", function() + -- require("dial.map").manipulate("decrement", "gvisual") + -- end) + -- + -- require("dial.config").augends:register_group({ + -- default = { + -- augend.constant.new({ + -- elements = { "true", "false" }, + -- word = true, + -- cyclic = true, + -- }), + -- augend.constant.new({ + -- elements = { "->", "<--" }, + -- word = true, + -- cyclic = true, + -- }), + -- augend.constant.new({ + -- elements = { "++", "--" }, + -- word = true, + -- cyclic = true, + -- }), + -- augend.constant.new({ + -- elements = { "&&", "||" }, + -- word = false, + -- cyclic = true, + -- }), + -- }, + -- }) + -- end, + -- }, + { + "numToStr/Comment.nvim", + opts = {}, + lazy = false, + }, + { + "machakann/vim-highlightedyank", + lazy = false, + }, + { + "tpope/vim-repeat", + lazy = false, + }, } diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 08d745d..15dfd25 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -1,117 +1,144 @@ return { - { "christoomey/vim-system-copy", lazy = false }, - { "folke/neoconf.nvim", cmd = "Neoconf" }, - { - "folke/persistence.nvim", - event = "BufReadPre", - opts = { options = vim.opt.sessionoptions:get() }, + { "christoomey/vim-system-copy", lazy = false }, + { "folke/neoconf.nvim", cmd = "Neoconf" }, + { + "nyoom-engineering/oxocarbon.nvim", + lazy = false, + config = function() + vim.cmd.colorscheme "oxocarbon" + end + }, + { + "folke/persistence.nvim", + event = "BufReadPre", + opts = { options = vim.opt.sessionoptions:get() }, -- stylua: ignore keys = { { "qs", function() require("persistence").load() end, desc = "Restore Session" }, { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, }, - }, - { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 - end, - opts = {}, - }, - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - "s1n7ax/nvim-window-picker" - }, - keys = { - { "e", "Neotree position=float reveal toggle", desc = "Neotree" }, - }, - config = function() - require("neo-tree").setup({ - sources = { "filesystem", "document_symbols" }, - window = { - mappings = { - [""] = "none", - ["Y"] = { - function(state) - local node = state.tree:get_node() - local path = node:get_id() - vim.fn.setreg("+", path, "c") - end, - desc = "Copy Path to Clipboard", - }, - ["O"] = { - function(state) - require("lazy.util").open(state.tree:get_node().path, { system = true }) - end, - desc = "Open with System Application", - }, - } - } - }) - end - }, - { - "nvim-treesitter/nvim-treesitter", - event = "VeryLazy", - dependencies = { - "RRethy/nvim-treesitter-endwise" - }, - config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = { "lua", "vim", "vimdoc", "vimdoc", "ruby", "bibtex", "yaml" }, - ignore_install = { "latex" }, -- highlighting by vimtex - auto_install = false, - endwise = { - enable = true, - }, - highlight = { - enable = true, - }, - }) - end, - }, - { - "stevearc/oil.nvim", - opts = {}, - dependencies = { "nvim-tree/nvim-web-devicons" }, - keys = { - { "-", "Oil", desc = "Oil" }, - }, - }, - { - "jlanzarotta/bufexplorer", - lazy = false - }, - { - "nvim-pack/nvim-spectre", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - }, - config = function() - require('spectre').setup() - end, - keys = { - { mode = 'n', 'S', 'lua require("spectre").toggle()', desc = "Toggle Spectre" }, - { mode = 'n', 'sw', 'lua require("spectre").open_visual({select_word=true})', desc = "Search current word" }, - { mode = 'v', 'sw', 'lua require("spectre").open_visual()', desc = "Search current word" }, - { mode = 'n', 'sp', 'lua require("spectre").open_file_search({select_word=true})', desc = "Search on current file" }, - } - }, - { "folke/trouble.nvim" }, - { - "folke/todo-comments.nvim", - cmd = { "TodoTrouble", "TodoTelescope" }, - event = "VeryLazy", - config = true, + }, + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 0 + end, + opts = {}, + }, + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + "s1n7ax/nvim-window-picker", + }, + keys = { + { "e", "Neotree position=float reveal toggle", desc = "Neotree" }, + }, + config = function() + require("neo-tree").setup({ + sources = { "filesystem", "document_symbols" }, + window = { + mappings = { + [""] = "none", + ["Y"] = { + function(state) + local node = state.tree:get_node() + local path = node:get_id() + vim.fn.setreg("+", path, "c") + end, + desc = "Copy Path to Clipboard", + }, + ["O"] = { + function(state) + require("lazy.util").open(state.tree:get_node().path, { system = true }) + end, + desc = "Open with System Application", + }, + }, + }, + }) + end, + }, + { + "nvim-treesitter/nvim-treesitter", + event = "VeryLazy", + dependencies = { + "RRethy/nvim-treesitter-endwise", + }, + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { "lua", "vim", "vimdoc", "vimdoc", "ruby", "bibtex", "yaml" }, + ignore_install = { "latex" }, -- highlighting by vimtex + auto_install = false, + endwise = { + enable = true, + }, + highlight = { + enable = true, + }, + }) + end, + }, + { + "stevearc/oil.nvim", + opts = {}, + dependencies = { "nvim-tree/nvim-web-devicons" }, + keys = { + { "-", "Oil", desc = "Oil" }, + }, + }, + { + "jlanzarotta/bufexplorer", + lazy = false, + }, + { + "nvim-pack/nvim-spectre", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("spectre").setup() + end, + keys = { + { + mode = "n", + "S", + 'lua require("spectre").toggle()', + desc = "Toggle Spectre", + }, + { + mode = "n", + "sw", + 'lua require("spectre").open_visual({select_word=true})', + desc = "Search current word", + }, + { + mode = "v", + "sw", + 'lua require("spectre").open_visual()', + desc = "Search current word", + }, + { + mode = "n", + "sp", + 'lua require("spectre").open_file_search({select_word=true})', + desc = "Search on current file", + }, + }, + }, + { "folke/trouble.nvim" }, + { + "folke/todo-comments.nvim", + cmd = { "TodoTrouble", "TodoTelescope" }, + event = "VeryLazy", + config = true, -- stylua: ignore keys = { { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" }, @@ -121,50 +148,126 @@ return { { "st", "TodoTelescope", desc = "Todo" }, { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, }, - }, - { - 'akinsho/toggleterm.nvim', - version = "*", - opts = {}, - keys = { - { "", "ToggleTerm", desc = "Toggle Terminal" } - } - }, - { - "simrat39/symbols-outline.nvim", - config = function() - require("symbols-outline").setup() - end, - keys = { - { "so", "SymbolsOutline", desc = "SymbolsOutline" } - } - }, - { - "brenoprata10/nvim-highlight-colors", - event = "VeryLazy", - config = function() - require('nvim-highlight-colors').setup({}) - end - }, - { - "ThePrimeagen/harpoon", - event = "VeryLazy", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - require("harpoon").setup({}) - end, - keys = { - { "1", function() require("harpoon.ui").nav_file(1) end, desc = "Harpoon file 1" }, - { "2", function() require("harpoon.ui").nav_file(2) end, desc = "Harpoon file 2" }, - { "3", function() require("harpoon.ui").nav_file(3) end, desc = "Harpoon file 3" }, - { "4", function() require("harpoon.ui").nav_file(4) end, desc = "Harpoon file 4" }, - { "5", function() require("harpoon.ui").nav_file(5) end, desc = "Harpoon file 5" }, - { "6", function() require("harpoon.ui").nav_file(6) end, desc = "Harpoon file 6" }, - { "7", function() require("harpoon.ui").nav_file(7) end, desc = "Harpoon file 7" }, - { "8", function() require("harpoon.ui").nav_file(8) end, desc = "Harpoon file 8" }, - { "9", function() require("harpoon.ui").nav_file(9) end, desc = "Harpoon file 9" }, - { "hh", function() require("harpoon.ui").toggle_quick_menu() end, desc = "Harpoon toggle quick menu" }, - { "H", function() require("harpoon.mark").add_file() end, desc = "Harpoon add file" }, - } - }, + }, + { + "akinsho/toggleterm.nvim", + version = "*", + opts = function() + require("toggleterm").setup({ + float_opts = { + border = "curved", + }, + }) + + opts = {} + vim.keymap.set("t", "", [[]], opts) + vim.keymap.set("t", "jk", [[]], opts) + end, + keys = { + { "!", "ToggleTerm direction=float", desc = "Toggle Terminal" }, + }, + }, + { + "simrat39/symbols-outline.nvim", + config = function() + require("symbols-outline").setup() + end, + keys = { + { "so", "SymbolsOutline", desc = "SymbolsOutline" }, + }, + }, + -- { + -- "brenoprata10/nvim-highlight-colors", + -- event = "VeryLazy", + -- config = function() + -- require('nvim-highlight-colors').setup({}) + -- end + -- }, + { + "ThePrimeagen/harpoon", + event = "VeryLazy", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("harpoon").setup({}) + end, + keys = { + { + "1", + function() + require("harpoon.ui").nav_file(1) + end, + desc = "Harpoon file 1", + }, + { + "2", + function() + require("harpoon.ui").nav_file(2) + end, + desc = "Harpoon file 2", + }, + { + "3", + function() + require("harpoon.ui").nav_file(3) + end, + desc = "Harpoon file 3", + }, + { + "4", + function() + require("harpoon.ui").nav_file(4) + end, + desc = "Harpoon file 4", + }, + { + "5", + function() + require("harpoon.ui").nav_file(5) + end, + desc = "Harpoon file 5", + }, + { + "6", + function() + require("harpoon.ui").nav_file(6) + end, + desc = "Harpoon file 6", + }, + { + "7", + function() + require("harpoon.ui").nav_file(7) + end, + desc = "Harpoon file 7", + }, + { + "8", + function() + require("harpoon.ui").nav_file(8) + end, + desc = "Harpoon file 8", + }, + { + "9", + function() + require("harpoon.ui").nav_file(9) + end, + desc = "Harpoon file 9", + }, + { + "hh", + function() + require("harpoon.ui").toggle_quick_menu() + end, + desc = "Harpoon toggle quick menu", + }, + { + "H", + function() + require("harpoon.mark").add_file() + end, + desc = "Harpoon add file", + }, + }, + }, } diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index b46c158..7fb711b 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -27,8 +27,13 @@ return { "tpope/vim-fugitive", cmd = { "Git" } }, + { + "sindrets/diffview.nvim", + lazy = false + }, { "lewis6991/gitsigns.nvim", + lazy = false, config = function() require('gitsigns').setup({ numhl = true, @@ -36,7 +41,7 @@ return { virt_text_pos = "right_align", delay = 0, }, - show_deleted = true, + show_deleted = false, update_debounce = 100, on_attach = function(bufnr) local gitsigns = require('gitsigns') diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index f497bd8..f2c18ce 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -64,24 +64,24 @@ return { config = function() local capabilities = require("cmp_nvim_lsp").default_capabilities() -- https://www.mitchellhanberg.com/modern-format-on-save-in-neovim/ - vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup("lsp", { clear = true }), - callback = function(args) - vim.api.nvim_create_autocmd("BufWritePre", { - buffer = args.buf, - callback = function() - vim.lsp.buf.format({ async = false, id = args.data.client_id }) - end, - }) - end, - }) + -- vim.api.nvim_create_autocmd("LspAttach", { + -- group = vim.api.nvim_create_augroup("lsp", { clear = true }), + -- callback = function(args) + -- vim.api.nvim_create_autocmd("BufWritePre", { + -- buffer = args.buf, + -- callback = function() + -- vim.lsp.buf.format({ async = false, id = args.data.client_id }) + -- end, + -- }) + -- end, + -- }) local lspconfig = require("lspconfig") lspconfig.lua_ls.setup({ capabilities = capabilities }) lspconfig.tsserver.setup({ capabilities = capabilities }) lspconfig.standardrb.setup({ capabilities = capabilities }) + -- lspconfig.rubocop.setup({ capabilities = capabilities }) lspconfig.rust_analyzer.setup({ capabilities = capabilities }) - lspconfig.ltex.setup({ cmd = { "ltex-ls" }, filetypes = { "markdown", "text", "cff", "tex" }, @@ -114,6 +114,7 @@ return { vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) end, }, { diff --git a/.config/nvim/lua/plugins/navigation.lua b/.config/nvim/lua/plugins/navigation.lua index b770bb1..6dbecc1 100644 --- a/.config/nvim/lua/plugins/navigation.lua +++ b/.config/nvim/lua/plugins/navigation.lua @@ -8,7 +8,7 @@ return { -- stylua: ignore keys = { { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, - { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + -- { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, diff --git a/.tmux.conf b/.tmux.conf index 96c7111..1d4a13a 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -30,11 +30,11 @@ set -g default-terminal "screen-256color" set -ag terminal-overrides ",xterm-256color:RGB" set-option -g status-position top set-option -g renumber-windows on -set -g pane-border-lines "heavy" +set -g pane-border-lines "single" set -s escape-time 1 set -g base-index 0 -set -g pane-active-border-style "bg=black,fg=white" -set -g pane-border-style "bg=black,fg=white" +set -g pane-active-border-style "bg=default,fg=colour233" +set -g pane-border-style "bg=default,fg=colour235" # Some hacks for OSX Alacritty audio bell set -g monitor-bell on @@ -46,8 +46,8 @@ set -g focus-events on #set-hook -g pane-focus-in 'select-pane -P bg=default,fg=default' # set-hook -g pane-focus-out 'select-pane -P bg=colour233,fg=colour10' -set-hook -g pane-focus-out 'select-pane -P bg=colour233,fg=default' -set-hook -g pane-focus-in 'select-pane -P bg=default,fg=default' +# set-hook -g pane-focus-out 'select-pane -P bg=colour233,fg=default' +# set-hook -g pane-focus-in 'select-pane -P bg=default,fg=default' # List of plugins set -g @plugin 'tmux-plugins/tpm' diff --git a/.zshrc b/.zshrc index aa6237c..488148b 100644 --- a/.zshrc +++ b/.zshrc @@ -18,6 +18,7 @@ export PATH=~/dev/flutter/bin:$PATH # export PATH="/Users/dani/.gem/ruby/3.2.0/bin:$PATH" export PATH="/opt/homebrew/opt/ruby/bin:$PATH" export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES # fix libcurl error +export EDITOR="nvim" unset LIBRARY_PATH unset LDFLAGS @@ -90,23 +91,31 @@ function rr() { rustc "$@.rs" && ./"$@"} # [r]ust [r]un function rgs() { rg --json -C 2 "$@" | delta } # [r]ip[g]rep [s]earch alias zshrc='nvim ~/.zshrc' # Idea from Chris -alias calacritty='nvim ~/.config/alacritty/alacritty.yml' +alias calacritty='nvim ~/.config/alacritty/alacritty.toml' alias ctmux='nvim ~/.tmux.conf' alias clazygit='nvim ~/Library/Application\ Support/lazygit/config.yml' +alias cneovide='nvim ~/.config/neovide/config.toml' +alias nv='neovide' alias cgit='nvim ~/.gitconfig' alias kts='tmux kill-server' # [k]ill [t]mux [s]erver alias v='nvim' alias cpp='pbcopy' alias bo='tectonic -X build && open build/default/default.pdf' # [b]uild and [o]pen +alias bno='tectonic -X build' # [b]uild and do[n]'t [o]pen alias g="grep" # [g]rep +alias myip="ipconfig getifaddr en0" alias bra="bundle exec rubocop -A" # [b]undle exec [r]ubocop -[A] alias spec="be rspec" alias f="fork ." alias cnvim="cd ~/.config/nvim && nvim init.lua" # [c]onfigure [nvim] +alias yabairc="v ~/.yabairc" +alias skhdrc="v ~/.config/skhd/skhdrc" alias dbreset="bundle exec rails db:drop db:create db:schema:load db:seed" # [d]ata[b]ase [reset] alias cpb="git branch | grep '*' | tr -d '*' | tr -d ' ' | pbcopy" # [c]o[p]y [b]ranch to clipboard +alias tks="tmux kill-server" # [t]mux [k]ill [s]erver -alias glog="glog_ | grep -v -e '^\s*$' --color=always | less --use-color" # [g]it [log] +#alias glog="git log --oneline | grep -v -e '^\s*$' --color=always | less --use-color" # [g]it [log] +alias glog="git log --oneline" alias glag="glog_ --all --since='00:00' --until='NOW' | grep -v -e '^\s*$' --color=always" # [g]it [l]og [a]ll [g]rep alias gb="if ( git branch | grep '* develop' ); then; git checkout -b ; else; echo 'You can only start a new feature from the development branch' ;fi;" # [g]it [b]ranch alias gs="git status" # [g]it [s]tatus @@ -138,12 +147,13 @@ alias yt="yarn test" alias brc="be rspec --format doc" # [b]undle [e]xec run [c]hecks alias nvimc="cd ~/.config/nvim && nvim ." alias gcf="git checkout -b feature/" -alias rr="rails routes | grep" +alias rr="rails routes | rg" alias c="code" -alias bat="bat --style plain " +alias bat="bat --style plain --theme OneHalfDark" alias cat="bat" alias gdu="git diff @{upstream}" alias spf="~/bin/spf" +alias clines="find . -type f -name '*.txt' -exec wc -l {} +" alias gch="git checkout" @@ -203,7 +213,7 @@ zle -N _zle-line-init zle -N zle-line-init sticky-prompt-zle-line-init zle -N sticky-prompt-set zle -N accept-line sticky-prompt-accept-line -bindkey '^S' sticky-prompt-set +bindkey '^F' sticky-prompt-set # END zsh-sticky-prompt diff --git a/my-status-bar.tmux b/my-status-bar.tmux index a7eb027..cd77928 100755 --- a/my-status-bar.tmux +++ b/my-status-bar.tmux @@ -13,9 +13,9 @@ tmux_set() { tmux set-option -gq "$1" "$2" } -color1="#1a1b25" -color2="colour68" -color3="black" +color1="#2c2e34" +color2="blue" +color3="orange" secondary="#[fg=$color2,bg=$color1]" tertiary="#[fg=orange,bg=$color1]" @@ -31,8 +31,8 @@ tmux_set status-fg "white" # tmux_set window-status-format "$title" # tmux_set window-status-separator " | " -tmux_set window-status-format "#[bg=black] $title " -tmux_set window-status-current-format "#[bg=white,fg=black] $title " +tmux_set window-status-format "#[bg=$color1] $title " +tmux_set window-status-current-format "#[bg=white,fg=$color1] $title " tmux_set window-status-separator " " # tmux_set window-status-current-format "#[bg=$color1,fg=$color2]#[bg=$color2,fg=$color3] $title #[bg=$color1,fg=$color2]" @@ -46,7 +46,7 @@ ruby_version=$(ruby -v | awk '{print $2}') ruby="#[fg=red] $ruby_version" # tmux_set status-left " #H [#S] " -tmux_set status-left "" +tmux_set status-left "#[bg=green,fg=black][#S]#[bg=default] " # tmux_set status-right "#{prefix_highlight} $cmd $path $ruby" tmux_set status-right "#{prefix_highlight} $cmd $path" # Window status style From 593a39810998da5670261e5857062e2b809c6af2 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 28 Jun 2024 23:10:33 +0200 Subject: [PATCH 069/280] Update dotfiles --- .config/alacritty/alacritty.toml | 4 +- .config/nvim/init.lua | 61 ++- .config/nvim/lazy-lock.json | 12 + .config/nvim/lua/languages/rails.lua | 4 + .config/nvim/lua/languages/rust.lua | 19 +- .config/nvim/lua/plugins/coding.lua | 3 +- .config/nvim/lua/plugins/editor.lua | 594 +++++++++++++++------------ .config/nvim/lua/plugins/git.lua | 17 + .config/nvim/lua/plugins/lsp.lua | 3 +- .zshrc | 21 +- my-status-bar.tmux | 2 +- scripts/get-pr-template.ts | 4 +- 12 files changed, 461 insertions(+), 283 deletions(-) diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 029e111..147c4a9 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -27,8 +27,8 @@ white = "0xe2e2e3" yellow = "0xe7c664" [colors.primary] -background = "0x2c2e34" -foreground = "0xe2e2e3" +# background = "0x2c2e34" +# foreground = "0xe2e2e3" [env] TERM = "xterm-256color" diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index b25d094..e5a0419 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -6,12 +6,15 @@ vim.g.maplocalleader = "\\" vim.wo.number = true vim.wo.relativenumber = true vim.opt.termguicolors = true +vim.opt.cursorline = true +vim.opt.cursorcolumn = true vim.opt.expandtab = true vim.opt.tabstop = 2 vim.opt.softtabstop = 2 vim.opt.shiftwidth = 2 vim.opt.scrolloff = 10 +vim.opt.hlsearch = true vim.opt.winbar = "%f" vim.opt.laststatus = 3 @@ -21,7 +24,7 @@ vim.opt.spelllang = "de_ch" vim.keymap.set("n", "qq", "wqa") vim.keymap.set("n", "q!", "qa!") vim.keymap.set("n", "/", "noh") -vim.api.nvim_set_keymap('n', 'gw', 'diw"apviwo"bpviwo', { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "gw", 'diw"apviwo"bpviwo', { noremap = true, silent = true }) vim.keymap.set("n", "n", "nzz") vim.keymap.set("n", "N", "Nzz") @@ -29,30 +32,56 @@ vim.keymap.set("n", "N", "Nzz") vim.keymap.set("n", "", "5jzz") vim.keymap.set("n", "", "5kzz") +vim.opt.wildmenu = true +vim.opt.wildmode = "longest:full" +vim.opt.wildignore = { + "*.docx", + "*.jpg", + "*.png", + "*.gif", + "*.pdf", + "*.pyc", + "*.exe", + "*.flv", + "*.img", + "*.xlsx", +} + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) end vim.opt.rtp:prepend(lazypath) local plugins = { - { "sainnhe/sonokai", priority = 9999 }, - { import = "plugins" }, - { import = "languages" }, + { "sainnhe/sonokai", priority = 9999 }, + { + "catppuccin/nvim", + priority = 9999, + config = function() + require("catppuccin").setup({ + flavour = "mocha", + transparent_background = true, + show_end_of_buffer = true, + }) + end, + }, + { import = "plugins" }, + { import = "languages" }, } local opts = { - defaults = { - lazy = true, - }, + defaults = { + lazy = true, + }, } require("lazy").setup(plugins, opts) @@ -61,7 +90,7 @@ vim.keymap.set("n", "L", "Lazy") vim.g.sonokai_better_performance = 1 vim.g.sonokai_style = "andromeda" --- vim.cmd.colorscheme("tokyonight") +vim.cmd.colorscheme("catppuccin") -- vim.api.nvim_command('highlight Normal guibg=NONE ctermbg=NONE') -- vim.api.nvim_command('highlight NonText guibg=NONE ctermbg=NONE') diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 98d7a30..8afb447 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -3,32 +3,41 @@ "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "de1a287c9cb525ae52bc846e8f6207e5ef1da5ac" }, "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, + "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "bufexplorer": { "branch": "master", "commit": "20f0440948653b5482d555a35a432135ba46a26d" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "commander.nvim": { "branch": "main", "commit": "84101e8eb1613a72bbdec655b734f891d8a00694" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "diffview.nvim": { "branch": "main", "commit": "9bdd5537575c2ea7925b71ae06585b934beea13d" }, "flash.nvim": { "branch": "main", "commit": "11a2e667d19d8f48c93c6ed2e2e525ac6b1b79be" }, "friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" }, + "fzf-lua": { "branch": "main", "commit": "ac4900872cc6aa0c37a03fc6e7901ec59aa00378" }, + "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, "gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" }, "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, + "inc-rename.nvim": { "branch": "main", "commit": "535b508c0cb14d00c1836ad901b3c531cb1152bb" }, "lazy.nvim": { "branch": "main", "commit": "5d29ffeaa0f2d91f1dfbc21943d19a11e59a6fc6" }, "lazygit.nvim": { "branch": "main", "commit": "ad3e1ea592f9d13e86e0d4e850224d9d78069508" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown.nvim": { "branch": "master", "commit": "951b7b567668608d60637d2c9e97f4baea5fdbbe" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, + "mini.ai": { "branch": "main", "commit": "a7e90f110e6274262616311b93cef12cd2667a2d" }, + "mini.indentscope": { "branch": "main", "commit": "f0d7faa064c892b96997810afcddfadc3f2a15b3" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" }, "neoconf.nvim": { "branch": "main", "commit": "0065de89c834e1090a847a9aa126af5dce1db4dc" }, + "neogit": { "branch": "master", "commit": "e11bd464f3a3b4b3af8ea0a8e54ee1b70fee7371" }, "neotest": { "branch": "master", "commit": "5caac5cc235d495a2382bc2980630ef36ac87032" }, "neotest-minitest": { "branch": "main", "commit": "0543bf4e997b2c970707cb297e2f74c438eb0653" }, "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, "none-ls.nvim": { "branch": "main", "commit": "37671797d6e5f9bd0ee3ab965ab2e6de251e1930" }, "nui.nvim": { "branch": "main", "commit": "b1b3dcd6ed8f355c78bad3d395ff645be5f8b6ae" }, + "nvim": { "branch": "main", "commit": "894efb557728e532aa98b98029d16907a214ec05" }, "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, "nvim-lspconfig": { "branch": "master", "commit": "ae0651d850f8f9313d4db3f96fe24dbf054edeb4" }, "nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" }, @@ -47,11 +56,13 @@ "plantuml-syntax": { "branch": "master", "commit": "44054d6d2cbcf01a064858faa3364cd30d38057d" }, "plenary.nvim": { "branch": "master", "commit": "b5c8de02a44ffeabff678090edd6a132ff8ab77d" }, "refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" }, + "rustaceanvim": { "branch": "master", "commit": "2fa45427c01ded4d3ecca72e357f8a60fd8e46d4" }, "sonokai": { "branch": "master", "commit": "239c228a5ea2e141377b6727ee79731a289f123a" }, "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, "telescope-rails.nvim": { "branch": "master", "commit": "e0addf3751b0af1fc0bc4706ff25ba73949a98ae" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, + "toast.vim": { "branch": "master", "commit": "6ef5cea8298e64a555cfaf7541bb94781d06dc69" }, "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, "toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" }, "trouble.nvim": { "branch": "main", "commit": "551105a339159841fe8d490330a65268ce931fe8" }, @@ -60,6 +71,7 @@ "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, "vim-rails": { "branch": "master", "commit": "8972461e64c7c4bf049f2f86ea1bc571e8077b55" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, + "vim-slim": { "branch": "master", "commit": "a0a57f75f20a03d5fa798484743e98f4af623926" }, "vim-system-copy": { "branch": "master", "commit": "8abd9ed21016bdc21b458c79da3b9ac0ee25c1ce" }, "vim-tmux-navigator": { "branch": "master", "commit": "c600cf10db1bf933aab9e357158bf9b202ecf99b" }, "vimtex": { "branch": "master", "commit": "9665df7f51ee24aa81dbd81782e0a22480209753" }, diff --git a/.config/nvim/lua/languages/rails.lua b/.config/nvim/lua/languages/rails.lua index f1fe617..3138a58 100644 --- a/.config/nvim/lua/languages/rails.lua +++ b/.config/nvim/lua/languages/rails.lua @@ -33,5 +33,9 @@ return { }, }) end + }, + { + "slim-template/vim-slim", + ft = "slim", } } diff --git a/.config/nvim/lua/languages/rust.lua b/.config/nvim/lua/languages/rust.lua index f7808ad..5d2ab79 100644 --- a/.config/nvim/lua/languages/rust.lua +++ b/.config/nvim/lua/languages/rust.lua @@ -1,5 +1,14 @@ -return {{ --- 'mrcjkb/rustaceanvim', --- version = '^4', -- Recommended --- lazy = false, -- This plugin is already lazy -}} +return { + { + "mrcjkb/rustaceanvim", + version = "^4", -- Recommended + lazy = false, -- This plugin is already lazy + config = function() + local bufnr = vim.api.nvim_get_current_buf() + vim.keymap.set("n", "ca", function() + vim.cmd.RustLsp("codeAction") -- supports rust-analyzer's grouping + -- or vim.lsp.buf.codeAction() if you don't want grouping. + end, { silent = true, buffer = bufnr }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index cab8190..7b2fc8e 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -26,9 +26,10 @@ return { additions = { { "Foo", "Bar" }, { "tic", "tac", "toe" }, - -- plantuml sequence { "->", "<--" }, { "++", "--" }, + { "light", "dark" }, + { "public", "private", "protected" }, }, allow_caps_additions = { { "enable", "disable" }, diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 15dfd25..fe18fb4 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -1,144 +1,222 @@ return { - { "christoomey/vim-system-copy", lazy = false }, - { "folke/neoconf.nvim", cmd = "Neoconf" }, - { - "nyoom-engineering/oxocarbon.nvim", - lazy = false, + { "christoomey/vim-system-copy", lazy = false }, + { "folke/neoconf.nvim", cmd = "Neoconf" }, + { + "nyoom-engineering/oxocarbon.nvim", + lazy = false, config = function() - vim.cmd.colorscheme "oxocarbon" - end - }, - { - "folke/persistence.nvim", - event = "BufReadPre", - opts = { options = vim.opt.sessionoptions:get() }, + -- vim.cmd.colorscheme("oxocarbon") + end, + }, + -- TODO: fix + { + "max397574/better-escape.nvim", + lazy = false, + config = function() + require("better_escape").setup( + { + mapping = { "jk", "jj" }, + timeout = 100, + clear_empty_lines = false, + keys = function() + return vim.api.nvim_win_get_cursor(0)[2] > 1 and 'l' or '' + end, + } + ) + end, + }, + { + "jsit/toast.vim", + lazy = false, + config = function() + -- vim.cmd "set background=light" + -- vim.cmd.colorscheme "toast" + end, + }, + { + "folke/persistence.nvim", + event = "BufReadPre", + opts = { options = vim.opt.sessionoptions:get() }, -- stylua: ignore keys = { { "qs", function() require("persistence").load() end, desc = "Restore Session" }, { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, }, - }, - { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 0 - end, - opts = {}, - }, - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - "s1n7ax/nvim-window-picker", - }, - keys = { - { "e", "Neotree position=float reveal toggle", desc = "Neotree" }, - }, - config = function() - require("neo-tree").setup({ - sources = { "filesystem", "document_symbols" }, - window = { - mappings = { - [""] = "none", - ["Y"] = { - function(state) - local node = state.tree:get_node() - local path = node:get_id() - vim.fn.setreg("+", path, "c") - end, - desc = "Copy Path to Clipboard", - }, - ["O"] = { - function(state) - require("lazy.util").open(state.tree:get_node().path, { system = true }) - end, - desc = "Open with System Application", - }, - }, - }, - }) - end, - }, - { - "nvim-treesitter/nvim-treesitter", - event = "VeryLazy", - dependencies = { - "RRethy/nvim-treesitter-endwise", - }, - config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = { "lua", "vim", "vimdoc", "vimdoc", "ruby", "bibtex", "yaml" }, - ignore_install = { "latex" }, -- highlighting by vimtex - auto_install = false, - endwise = { - enable = true, - }, - highlight = { - enable = true, - }, - }) - end, - }, - { - "stevearc/oil.nvim", - opts = {}, - dependencies = { "nvim-tree/nvim-web-devicons" }, - keys = { - { "-", "Oil", desc = "Oil" }, - }, - }, - { - "jlanzarotta/bufexplorer", - lazy = false, - }, - { - "nvim-pack/nvim-spectre", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - }, - config = function() - require("spectre").setup() - end, - keys = { - { - mode = "n", - "S", - 'lua require("spectre").toggle()', - desc = "Toggle Spectre", - }, - { - mode = "n", - "sw", - 'lua require("spectre").open_visual({select_word=true})', - desc = "Search current word", - }, - { - mode = "v", - "sw", - 'lua require("spectre").open_visual()', - desc = "Search current word", - }, - { - mode = "n", - "sp", - 'lua require("spectre").open_file_search({select_word=true})', - desc = "Search on current file", - }, - }, - }, - { "folke/trouble.nvim" }, - { - "folke/todo-comments.nvim", - cmd = { "TodoTrouble", "TodoTelescope" }, - event = "VeryLazy", - config = true, + }, + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 0 + end, + opts = {}, + }, + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + "s1n7ax/nvim-window-picker", + }, + keys = { + { "e", "Neotree position=float reveal toggle", desc = "Neotree" }, + }, + config = function() + require("neo-tree").setup({ + sources = { "filesystem", "document_symbols" }, + window = { + mappings = { + [""] = "none", + ["Y"] = { + function(state) + local node = state.tree:get_node() + local path = node:get_id() + vim.fn.setreg("+", path, "c") + end, + desc = "Copy Path to Clipboard", + }, + ["O"] = { + function(state) + require("lazy.util").open(state.tree:get_node().path, { system = true }) + end, + desc = "Open with System Application", + }, + }, + }, + }) + end, + }, + { + "nvim-treesitter/nvim-treesitter", + event = "VeryLazy", + dependencies = { + "RRethy/nvim-treesitter-endwise", + }, + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { "lua", "vim", "vimdoc", "vimdoc", "ruby", "bibtex", "yaml" }, + ignore_install = { "latex" }, -- highlighting by vimtex + auto_install = false, + endwise = { + enable = true, + }, + highlight = { + enable = true, + }, + }) + end, + }, + { + "stevearc/oil.nvim", + opts = {}, + dependencies = { "nvim-tree/nvim-web-devicons" }, + keys = { + { "-", "Oil", desc = "Oil" }, + -- { "-", function() require("oil").toggle_float() end, desc = "Oil" } + }, + }, + { + "FeiyouG/commander.nvim", + dependencies = { + "nvim-telescope/telescope.nvim", + }, + keys = { + { "f", "Telescope commander", mode = "n" }, + { "fc", "Telescope commander", mode = "n" }, + }, + config = function() + require("commander").setup({ + components = { + "DESC", + "KEYS", + "CAT", + }, + sort_by = { + "DESC", + "KEYS", + "CAT", + "CMD", + }, + integration = { + telescope = { + enable = true, + }, + lazy = { + enable = true, + set_plugin_name_as_cat = true, + }, + }, + }) + end, + }, + { "echasnovski/mini.indentscope", version = "*", lazy = false }, + { + "jlanzarotta/bufexplorer", + lazy = false, + }, + { + "nvim-pack/nvim-spectre", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("spectre").setup() + end, + keys = { + { + mode = "n", + "S", + 'lua require("spectre").toggle()', + desc = "Toggle Spectre", + }, + { + mode = "n", + "sw", + 'lua require("spectre").open_visual({select_word=true})', + desc = "Search current word", + }, + { + mode = "v", + "sw", + 'lua require("spectre").open_visual()', + desc = "Search current word", + }, + { + mode = "n", + "sp", + 'lua require("spectre").open_file_search({select_word=true})', + desc = "Search on current file", + }, + }, + }, + { + "folke/trouble.nvim", + lazy = false, + keys = { + { + "j", + function() + require("trouble").next({ skip_groups = true, jump = true }) + end, + }, + { + "k", + function() + require("trouble").previous({ skip_groups = true, jump = true }) + end, + }, + }, + }, + { + "folke/todo-comments.nvim", + cmd = { "TodoTrouble", "TodoTelescope" }, + event = "VeryLazy", + config = true, -- stylua: ignore keys = { { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" }, @@ -148,126 +226,134 @@ return { { "st", "TodoTelescope", desc = "Todo" }, { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, }, - }, - { - "akinsho/toggleterm.nvim", - version = "*", - opts = function() - require("toggleterm").setup({ - float_opts = { - border = "curved", - }, - }) + }, + { + "akinsho/toggleterm.nvim", + version = "*", + opts = function() + require("toggleterm").setup({ + float_opts = { + border = "curved", + }, + }) - opts = {} - vim.keymap.set("t", "", [[]], opts) - vim.keymap.set("t", "jk", [[]], opts) - end, - keys = { - { "!", "ToggleTerm direction=float", desc = "Toggle Terminal" }, - }, - }, - { - "simrat39/symbols-outline.nvim", - config = function() - require("symbols-outline").setup() - end, - keys = { - { "so", "SymbolsOutline", desc = "SymbolsOutline" }, - }, - }, - -- { - -- "brenoprata10/nvim-highlight-colors", - -- event = "VeryLazy", - -- config = function() - -- require('nvim-highlight-colors').setup({}) - -- end - -- }, - { - "ThePrimeagen/harpoon", - event = "VeryLazy", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - require("harpoon").setup({}) - end, - keys = { - { - "1", - function() - require("harpoon.ui").nav_file(1) - end, - desc = "Harpoon file 1", - }, - { - "2", - function() - require("harpoon.ui").nav_file(2) - end, - desc = "Harpoon file 2", - }, - { - "3", - function() - require("harpoon.ui").nav_file(3) - end, - desc = "Harpoon file 3", - }, - { - "4", - function() - require("harpoon.ui").nav_file(4) - end, - desc = "Harpoon file 4", - }, - { - "5", - function() - require("harpoon.ui").nav_file(5) - end, - desc = "Harpoon file 5", - }, - { - "6", - function() - require("harpoon.ui").nav_file(6) - end, - desc = "Harpoon file 6", - }, - { - "7", - function() - require("harpoon.ui").nav_file(7) - end, - desc = "Harpoon file 7", - }, - { - "8", - function() - require("harpoon.ui").nav_file(8) - end, - desc = "Harpoon file 8", - }, - { - "9", - function() - require("harpoon.ui").nav_file(9) - end, - desc = "Harpoon file 9", - }, - { - "hh", - function() - require("harpoon.ui").toggle_quick_menu() - end, - desc = "Harpoon toggle quick menu", - }, - { - "H", - function() - require("harpoon.mark").add_file() - end, - desc = "Harpoon add file", - }, - }, - }, + opts = {} + vim.keymap.set("t", "", [[]], opts) + vim.keymap.set("t", "jk", [[]], opts) + end, + keys = { + { "!", "ToggleTerm direction=float", desc = "Toggle Terminal" }, + }, + }, + { + "simrat39/symbols-outline.nvim", + config = function() + require("symbols-outline").setup() + end, + keys = { + { "so", "SymbolsOutline", desc = "SymbolsOutline" }, + }, + }, + -- { + -- "brenoprata10/nvim-highlight-colors", + -- event = "VeryLazy", + -- config = function() + -- require('nvim-highlight-colors').setup({}) + -- end + -- }, + { + "ThePrimeagen/harpoon", + event = "VeryLazy", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("harpoon").setup({}) + end, + keys = { + { + "1", + function() + require("harpoon.ui").nav_file(1) + end, + desc = "Harpoon file 1", + }, + { + "2", + function() + require("harpoon.ui").nav_file(2) + end, + desc = "Harpoon file 2", + }, + { + "3", + function() + require("harpoon.ui").nav_file(3) + end, + desc = "Harpoon file 3", + }, + { + "4", + function() + require("harpoon.ui").nav_file(4) + end, + desc = "Harpoon file 4", + }, + { + "5", + function() + require("harpoon.ui").nav_file(5) + end, + desc = "Harpoon file 5", + }, + { + "6", + function() + require("harpoon.ui").nav_file(6) + end, + desc = "Harpoon file 6", + }, + { + "7", + function() + require("harpoon.ui").nav_file(7) + end, + desc = "Harpoon file 7", + }, + { + "8", + function() + require("harpoon.ui").nav_file(8) + end, + desc = "Harpoon file 8", + }, + { + "9", + function() + require("harpoon.ui").nav_file(9) + end, + desc = "Harpoon file 9", + }, + { + "hh", + function() + require("harpoon.ui").toggle_quick_menu() + end, + desc = "Harpoon toggle quick menu", + }, + { + "H", + function() + require("harpoon.mark").add_file() + end, + desc = "Harpoon add file", + }, + }, + }, + { + "smjonas/inc-rename.nvim", + config = function() + require("inc_rename").setup() + end, + lazy = false, + }, + { "echasnovski/mini.ai", version = false, lazy = false }, } diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index 7fb711b..db9c542 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -87,5 +87,22 @@ return { { "hd", function() require("gitsigns").diffthis() end, desc = "diffthis" }, { "td", function() require("gitsigns").toggle_deleted() end, desc = "toggle_deleted" }, } + }, + { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", -- required + "sindrets/diffview.nvim", -- optional - Diff integration + + -- Only one of these is needed, not both. + "nvim-telescope/telescope.nvim", -- optional + "ibhagwan/fzf-lua", -- optional + }, + config = true, + lazy = false + }, + { + "junkblocker/git-time-lapse", + lazy = false } } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index f2c18ce..f45ff5e 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -81,7 +81,7 @@ return { lspconfig.tsserver.setup({ capabilities = capabilities }) lspconfig.standardrb.setup({ capabilities = capabilities }) -- lspconfig.rubocop.setup({ capabilities = capabilities }) - lspconfig.rust_analyzer.setup({ capabilities = capabilities }) + -- lspconfig.rust_analyzer.setup({ capabilities = capabilities }) lspconfig.ltex.setup({ cmd = { "ltex-ls" }, filetypes = { "markdown", "text", "cff", "tex" }, @@ -165,6 +165,7 @@ return { 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-cmdline', + 'rafamadriz/friendly-snippets', }, config = function() local cmp = require("cmp") diff --git a/.zshrc b/.zshrc index 488148b..0408b85 100644 --- a/.zshrc +++ b/.zshrc @@ -1,7 +1,7 @@ source ~/.import-secrets.sh set -o vi -bindkey -v +# bindkey -v if [ "$TERM_PROGRAM" = "WarpTerminal" ] && [ "$TERMINAL_EMULATOR" != "JetBrains-JediTerm" ]; then printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "zsh"}}\x9c' @@ -50,6 +50,11 @@ function prt() { ~/scripts/get-pr-template.ts } function cpt() { ~/scripts/copy-ticket-number.ts } function rsf() { bundle exec rspec $(find spec/**/*_spec.rb | fzf --preview 'bat --color "always" {}') } # [r]spec [s]earch [f]ile function vg() { nvim $(fzf) } # [v]im [g]rep +function pkill() { + port=$1 + process=$(lsof -i :$port | fzf | awk '{print $2}') + kill $process +} # [k]ill [p]rocess function cached_routes() { if ( [ ! -f config/routes.rb ]); then @@ -82,6 +87,16 @@ backup_directory() { printf "Backup created at $directory_name_with_timestamp_suffix" } +parallel_exec() { + # Example usage: + # parallel_exec "sleep 1" "echo 'Hello, World!'" "ls -l" + + trap 'kill $(jobs -p)' SIGINT SIGTERM # Kill child processes on interrupt or termination + for cmd in "$@"; do + eval "$cmd" & + done + wait +} alias '~'='cd ~' alias '..'='cd ..' @@ -113,6 +128,9 @@ alias skhdrc="v ~/.config/skhd/skhdrc" alias dbreset="bundle exec rails db:drop db:create db:schema:load db:seed" # [d]ata[b]ase [reset] alias cpb="git branch | grep '*' | tr -d '*' | tr -d ' ' | pbcopy" # [c]o[p]y [b]ranch to clipboard alias tks="tmux kill-server" # [t]mux [k]ill [s]erver +alias crc="cargo r -r --bin client" +alias crs="cargo r -r --bin server" +function rkill() { "kill $(cat tmp/pids/server.pid)" } #alias glog="git log --oneline | grep -v -e '^\s*$' --color=always | less --use-color" # [g]it [log] alias glog="git log --oneline" @@ -139,6 +157,7 @@ alias be="bundle exec" alias qlf='qlmanage -p "$@"' alias mine='rubymine .' alias m='rubymine .' +alias bs="bin/setup" alias bc="bin/check" alias br="bin/run" alias bd="bin/dev" diff --git a/my-status-bar.tmux b/my-status-bar.tmux index cd77928..0f36ca7 100755 --- a/my-status-bar.tmux +++ b/my-status-bar.tmux @@ -13,7 +13,7 @@ tmux_set() { tmux set-option -gq "$1" "$2" } -color1="#2c2e34" +color1="#161616" color2="blue" color3="orange" diff --git a/scripts/get-pr-template.ts b/scripts/get-pr-template.ts index 9ffb13f..63d9b56 100755 --- a/scripts/get-pr-template.ts +++ b/scripts/get-pr-template.ts @@ -14,7 +14,7 @@ try { const redmineBaseUrl = 'https://redmine.renuo.ch/issues/' const branchPattern = /feature\/(\d+)/ -const openGitInBrowser = pipe( +const copyTicket = pipe( () => execSync('git branch --list | grep "*"'), (branch) => branchPattern.exec(branch.toString()), (matches) => { @@ -29,4 +29,4 @@ const openGitInBrowser = pipe( () => execSync('echo "The PR template has been copied to your clipboard\!"') ) -openGitInBrowser('') +copyTicket('') From 9e13e55daddcb008204118562793276208664970 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 1 Jul 2024 21:58:18 +0200 Subject: [PATCH 070/280] Update vimconfig --- .config/nvim/init.lua | 21 +++++++++++---------- .config/nvim/lazy-lock.json | 2 ++ .config/nvim/lua/plugins/coding.lua | 4 ++++ .config/nvim/lua/plugins/editor.lua | 12 +++++++++++- .config/nvim/lua/plugins/lsp.lua | 5 ++++- .zshrc | 1 - 6 files changed, 32 insertions(+), 13 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index e5a0419..a42a4e1 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -35,16 +35,16 @@ vim.keymap.set("n", "", "5kzz") vim.opt.wildmenu = true vim.opt.wildmode = "longest:full" vim.opt.wildignore = { - "*.docx", - "*.jpg", - "*.png", - "*.gif", - "*.pdf", - "*.pyc", - "*.exe", - "*.flv", - "*.img", - "*.xlsx", + "*.docx", + "*.jpg", + "*.png", + "*.gif", + "*.pdf", + "*.pyc", + "*.exe", + "*.flv", + "*.img", + "*.xlsx", } local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" @@ -63,6 +63,7 @@ vim.opt.rtp:prepend(lazypath) local plugins = { { "sainnhe/sonokai", priority = 9999 }, + { "iruzo/matrix-nvim", priority = 9999 }, { "catppuccin/nvim", priority = 9999, diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 8afb447..5af60ee 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -13,6 +13,7 @@ "commander.nvim": { "branch": "main", "commit": "84101e8eb1613a72bbdec655b734f891d8a00694" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, + "dashboard-nvim": { "branch": "master", "commit": "69a4c935cc43d3d725ed0600c6d00593bc23d132" }, "diffview.nvim": { "branch": "main", "commit": "9bdd5537575c2ea7925b71ae06585b934beea13d" }, "flash.nvim": { "branch": "main", "commit": "11a2e667d19d8f48c93c6ed2e2e525ac6b1b79be" }, "friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" }, @@ -27,6 +28,7 @@ "markdown.nvim": { "branch": "master", "commit": "951b7b567668608d60637d2c9e97f4baea5fdbbe" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, + "matrix-nvim": { "branch": "main", "commit": "5fafe6b440d08c1070e3c4c4cb9d648436d5d867" }, "mini.ai": { "branch": "main", "commit": "a7e90f110e6274262616311b93cef12cd2667a2d" }, "mini.indentscope": { "branch": "main", "commit": "f0d7faa064c892b96997810afcddfadc3f2a15b3" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" }, diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index 7b2fc8e..37d8847 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -30,6 +30,7 @@ return { { "++", "--" }, { "light", "dark" }, { "public", "private", "protected" }, + { "if", "unless" }, }, allow_caps_additions = { { "enable", "disable" }, @@ -102,6 +103,9 @@ return { { "machakann/vim-highlightedyank", lazy = false, + config = function() + vim.g.highlightedyank_highlight_duration = 100 + end }, { "tpope/vim-repeat", diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index fe18fb4..87748fb 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -1,6 +1,16 @@ return { { "christoomey/vim-system-copy", lazy = false }, { "folke/neoconf.nvim", cmd = "Neoconf" }, + { + 'nvimdev/dashboard-nvim', + event = 'VimEnter', + config = function() + require('dashboard').setup { + theme = 'hyper' + } + end, + dependencies = { { 'nvim-tree/nvim-web-devicons' } } + }, { "nyoom-engineering/oxocarbon.nvim", lazy = false, @@ -49,7 +59,7 @@ return { event = "VeryLazy", init = function() vim.o.timeout = true - vim.o.timeoutlen = 0 + vim.o.timeoutlen = 200 end, opts = {}, }, diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index f45ff5e..da808a1 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -79,7 +79,7 @@ return { local lspconfig = require("lspconfig") lspconfig.lua_ls.setup({ capabilities = capabilities }) lspconfig.tsserver.setup({ capabilities = capabilities }) - lspconfig.standardrb.setup({ capabilities = capabilities }) + -- lspconfig.standardrb.setup({ capabilities = capabilities }) -- lspconfig.rubocop.setup({ capabilities = capabilities }) -- lspconfig.rust_analyzer.setup({ capabilities = capabilities }) lspconfig.ltex.setup({ @@ -115,6 +115,9 @@ return { vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) + vim.cmd [[ + autocmd BufNewFile,BufRead *.prawn set filetype=ruby + ]] end, }, { diff --git a/.zshrc b/.zshrc index 0408b85..8e4a652 100644 --- a/.zshrc +++ b/.zshrc @@ -1,7 +1,6 @@ source ~/.import-secrets.sh set -o vi -# bindkey -v if [ "$TERM_PROGRAM" = "WarpTerminal" ] && [ "$TERMINAL_EMULATOR" != "JetBrains-JediTerm" ]; then printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "zsh"}}\x9c' From af98699c8b8df05cb7295c67ac1c64c78e12e338 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 3 Jul 2024 22:55:18 +0200 Subject: [PATCH 071/280] Update plugins, add fr --- .config/nvim/lazy-lock.json | 89 +++++++++++++------------- .config/nvim/lua/plugins/coding.lua | 1 + .config/nvim/lua/plugins/editor.lua | 64 ++++++++++++------ .config/nvim/lua/plugins/telescope.lua | 12 ++++ 4 files changed, 104 insertions(+), 62 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 5af60ee..259e9b7 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,81 +1,82 @@ { - "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "de1a287c9cb525ae52bc846e8f6207e5ef1da5ac" }, + "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, - "bufexplorer": { "branch": "master", "commit": "20f0440948653b5482d555a35a432135ba46a26d" }, + "bufexplorer": { "branch": "master", "commit": "2308e87960c05bd8da7bbf62c903e1f42d6cc9b9" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "commander.nvim": { "branch": "main", "commit": "84101e8eb1613a72bbdec655b734f891d8a00694" }, - "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, - "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, - "dashboard-nvim": { "branch": "master", "commit": "69a4c935cc43d3d725ed0600c6d00593bc23d132" }, - "diffview.nvim": { "branch": "main", "commit": "9bdd5537575c2ea7925b71ae06585b934beea13d" }, - "flash.nvim": { "branch": "main", "commit": "11a2e667d19d8f48c93c6ed2e2e525ac6b1b79be" }, - "friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" }, - "fzf-lua": { "branch": "main", "commit": "ac4900872cc6aa0c37a03fc6e7901ec59aa00378" }, + "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, + "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, + "dashboard-nvim": { "branch": "master", "commit": "e6e33b848f0e2fe5c13f6553c568764555c390a3" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "flash.nvim": { "branch": "main", "commit": "43f67935d388fbb540f8b40e8cbfd80de54f978a" }, + "friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" }, + "fzf-lua": { "branch": "main", "commit": "24a1616df5f27d1286e5113cf176693de4111d21" }, "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, - "gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" }, + "gitsigns.nvim": { "branch": "main", "commit": "6b1a14eabcebbcca1b9e9163a26b2f8371364cb7" }, "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, "inc-rename.nvim": { "branch": "main", "commit": "535b508c0cb14d00c1836ad901b3c531cb1152bb" }, - "lazy.nvim": { "branch": "main", "commit": "5d29ffeaa0f2d91f1dfbc21943d19a11e59a6fc6" }, + "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, + "lazy.nvim": { "branch": "main", "commit": "d0921f5b9b3d2c5e09618da55a018228edcc4d16" }, "lazygit.nvim": { "branch": "main", "commit": "ad3e1ea592f9d13e86e0d4e850224d9d78069508" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "markdown.nvim": { "branch": "master", "commit": "951b7b567668608d60637d2c9e97f4baea5fdbbe" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, - "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, + "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, + "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, "matrix-nvim": { "branch": "main", "commit": "5fafe6b440d08c1070e3c4c4cb9d648436d5d867" }, - "mini.ai": { "branch": "main", "commit": "a7e90f110e6274262616311b93cef12cd2667a2d" }, + "mini.ai": { "branch": "main", "commit": "45587078f323eaf41b9f701bbc04f8d1ab008979" }, "mini.indentscope": { "branch": "main", "commit": "f0d7faa064c892b96997810afcddfadc3f2a15b3" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" }, - "neoconf.nvim": { "branch": "main", "commit": "0065de89c834e1090a847a9aa126af5dce1db4dc" }, - "neogit": { "branch": "master", "commit": "e11bd464f3a3b4b3af8ea0a8e54ee1b70fee7371" }, - "neotest": { "branch": "master", "commit": "5caac5cc235d495a2382bc2980630ef36ac87032" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, + "neoconf.nvim": { "branch": "main", "commit": "94f1e5b81c440ec1fc7efde3c7f9448b7bab7776" }, + "neogit": { "branch": "master", "commit": "66b29453df7050543a51986620f8961a79a13fcc" }, + "neotest": { "branch": "master", "commit": "26ed90509c377d10dbdebd25b7094a886323b32b" }, "neotest-minitest": { "branch": "main", "commit": "0543bf4e997b2c970707cb297e2f74c438eb0653" }, "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, - "none-ls.nvim": { "branch": "main", "commit": "37671797d6e5f9bd0ee3ab965ab2e6de251e1930" }, - "nui.nvim": { "branch": "main", "commit": "b1b3dcd6ed8f355c78bad3d395ff645be5f8b6ae" }, - "nvim": { "branch": "main", "commit": "894efb557728e532aa98b98029d16907a214ec05" }, - "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, + "none-ls.nvim": { "branch": "main", "commit": "0d1b3fa2ad0b371b94cb4b9a27ba6e5a1a915c91" }, + "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, + "nvim": { "branch": "main", "commit": "31fcfb02c47952d5c75aec893b93b2878abe5fbb" }, + "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, "nvim-lspconfig": { "branch": "master", "commit": "ae0651d850f8f9313d4db3f96fe24dbf054edeb4" }, - "nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" }, - "nvim-spectre": { "branch": "master", "commit": "50e96602153f14c913e1969aaf9720e080394eb3" }, - "nvim-surround": { "branch": "main", "commit": "79aaa42da1f698ed31bcbe7f83081f69dca7ba17" }, - "nvim-treesitter": { "branch": "master", "commit": "ccfa76d4cb53224cb0ecefb12f79ecdbbf1fd62d" }, + "nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" }, + "nvim-spectre": { "branch": "master", "commit": "49fae98ef2bfa8342522b337892992e3495065d5" }, + "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, + "nvim-treesitter": { "branch": "master", "commit": "6cd4ce6cab184e8787f164a182954534221f2af2" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, - "nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" }, + "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, "nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }, - "oil.nvim": { "branch": "master", "commit": "06a19f77f1a1da37b675635e6f9c5b5d50bcaacd" }, + "oil.nvim": { "branch": "master", "commit": "b0a6cf98982cdcf82b19b0029b734bbbcd24bcc4" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, - "other.nvim": { "branch": "main", "commit": "2a82971d3763474df29d5d32d0699b5bb13c551f" }, + "other.nvim": { "branch": "main", "commit": "63f587dde62149bd2ed3e31edceb49d5c4097a26" }, "oxocarbon.nvim": { "branch": "main", "commit": "c5846d10cbe4131cc5e32c6d00beaf59cb60f6a2" }, - "persistence.nvim": { "branch": "main", "commit": "5fe077056c821aab41f87650bd6e1c48cd7dd047" }, + "persistence.nvim": { "branch": "main", "commit": "95d03ad5450389ad7dc2a0fab14ebb3d46bc2c96" }, "plantuml-previewer.vim": { "branch": "master", "commit": "1dd4d0f2b09cd80a217f76d82f93830dbbe689b3" }, - "plantuml-syntax": { "branch": "master", "commit": "44054d6d2cbcf01a064858faa3364cd30d38057d" }, - "plenary.nvim": { "branch": "master", "commit": "b5c8de02a44ffeabff678090edd6a132ff8ab77d" }, - "refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" }, - "rustaceanvim": { "branch": "master", "commit": "2fa45427c01ded4d3ecca72e357f8a60fd8e46d4" }, - "sonokai": { "branch": "master", "commit": "239c228a5ea2e141377b6727ee79731a289f123a" }, + "plantuml-syntax": { "branch": "master", "commit": "1592944444513c208ab5a087397ba987932af750" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "refactoring.nvim": { "branch": "master", "commit": "c9c1a0995b7d9a534f3b9a4df7fd55240127eeb4" }, + "rustaceanvim": { "branch": "master", "commit": "d6d7620b66d74b3b16defcf85cbef7b3582795b3" }, + "sonokai": { "branch": "master", "commit": "16fa31a410183ce945e58d834a74f161a2dce5aa" }, "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, "telescope-rails.nvim": { "branch": "master", "commit": "e0addf3751b0af1fc0bc4706ff25ba73949a98ae" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, "toast.vim": { "branch": "master", "commit": "6ef5cea8298e64a555cfaf7541bb94781d06dc69" }, - "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, + "todo-comments.nvim": { "branch": "main", "commit": "51e10f838e84b4756c16311d0b1ef0972c6482d2" }, "toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" }, - "trouble.nvim": { "branch": "main", "commit": "551105a339159841fe8d490330a65268ce931fe8" }, - "vim-fugitive": { "branch": "master", "commit": "09ffa8fc08c27b47790f954396adacfe6c450130" }, + "trouble.nvim": { "branch": "main", "commit": "e5d0e04121c662ce29190a57dd03655d43c59d44" }, + "vim-fugitive": { "branch": "master", "commit": "d0c1a437536778bcc8174b7cb2ffdf98f611e6fe" }, "vim-grammarous": { "branch": "master", "commit": "db46357465ce587d5325e816235b5e92415f8c05" }, "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, - "vim-rails": { "branch": "master", "commit": "8972461e64c7c4bf049f2f86ea1bc571e8077b55" }, + "vim-rails": { "branch": "master", "commit": "2fba7907f585819a8653f0bc7dd7f437a822d9c6" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-slim": { "branch": "master", "commit": "a0a57f75f20a03d5fa798484743e98f4af623926" }, "vim-system-copy": { "branch": "master", "commit": "8abd9ed21016bdc21b458c79da3b9ac0ee25c1ce" }, - "vim-tmux-navigator": { "branch": "master", "commit": "c600cf10db1bf933aab9e357158bf9b202ecf99b" }, - "vimtex": { "branch": "master", "commit": "9665df7f51ee24aa81dbd81782e0a22480209753" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } + "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }, + "vimtex": { "branch": "master", "commit": "2dc2a5435809c13f6f4aa07964be4ef19a7864f5" }, + "which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" } } \ No newline at end of file diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index 37d8847..e8bc0df 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -31,6 +31,7 @@ return { { "light", "dark" }, { "public", "private", "protected" }, { "if", "unless" }, + { "width", "height" }, }, allow_caps_additions = { { "enable", "disable" }, diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 87748fb..3410f68 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -2,14 +2,14 @@ return { { "christoomey/vim-system-copy", lazy = false }, { "folke/neoconf.nvim", cmd = "Neoconf" }, { - 'nvimdev/dashboard-nvim', - event = 'VimEnter', + "nvimdev/dashboard-nvim", + event = "VimEnter", config = function() - require('dashboard').setup { - theme = 'hyper' - } + require("dashboard").setup({ + theme = "hyper", + }) end, - dependencies = { { 'nvim-tree/nvim-web-devicons' } } + dependencies = { { "nvim-tree/nvim-web-devicons" } }, }, { "nyoom-engineering/oxocarbon.nvim", @@ -23,16 +23,14 @@ return { "max397574/better-escape.nvim", lazy = false, config = function() - require("better_escape").setup( - { - mapping = { "jk", "jj" }, - timeout = 100, - clear_empty_lines = false, - keys = function() - return vim.api.nvim_win_get_cursor(0)[2] > 1 and 'l' or '' - end, - } - ) + require("better_escape").setup({ + mapping = { "jk", "jj" }, + timeout = 100, + clear_empty_lines = false, + keys = function() + return vim.api.nvim_win_get_cursor(0)[2] > 1 and "l" or "" + end, + }) end, }, { @@ -163,7 +161,37 @@ return { }) end, }, - { "echasnovski/mini.indentscope", version = "*", lazy = false }, + { + "echasnovski/mini.indentscope", + version = "*", + lazy = false, + config = function() end, + }, + { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + lazy = true, + config = { + exclude = { + filetypes = { + "lspinfo", + "packer", + "checkhealth", + "help", + "man", + "gitcommit", + "TelescopePrompt", + "TelescopeResults", + "Dashboard" + } + } + }, + keys = { + { + "ibl", "IBLToggleScope" + } + } + }, { "jlanzarotta/bufexplorer", lazy = false, @@ -365,5 +393,5 @@ return { end, lazy = false, }, - { "echasnovski/mini.ai", version = false, lazy = false }, + { "echasnovski/mini.ai", version = false, lazy = false }, } diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 9fd3edc..d2b9b6a 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -9,6 +9,18 @@ return { { "fb", "Telescope buffers", desc = "Telescope Buffer" }, { "fs", "Telescope grep_string", desc = "Telescope Grep" }, { "fw", "Telescope live_grep", desc = "Telescope Grep" }, + { "fr", + function() + local word = vim.fn.expand("") + require("telescope.builtin").grep_string { + search = word, + only_sort_text = true, + layout_strategy = "vertical", + layout_config = {} + } + end, + desc = "Telescope current word" + }, { "fk", "Telescope keymaps", desc = "Telescope Keymap" }, { "", "Telescope commands", desc = "Telescope Command" }, } From e50f48e3407686bf707bcd3ddbfbf134cc462621 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Thu, 4 Jul 2024 00:16:43 +0200 Subject: [PATCH 072/280] Update config --- .config/nvim/lazy-lock.json | 13 +--- .config/nvim/lua/plugins/editor.lua | 100 +++++++++++++++++++++++----- .config/nvim/lua/plugins/git.lua | 3 + .config/nvim/lua/plugins/lsp.lua | 43 ++++++++++++ 4 files changed, 130 insertions(+), 29 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 259e9b7..1fde5c7 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,22 +1,17 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "CopilotChat.nvim": { "branch": "canary", "commit": "82923efe22b604cf9c0cad0bb2a74aa9247755ab" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "bufexplorer": { "branch": "master", "commit": "2308e87960c05bd8da7bbf62c903e1f42d6cc9b9" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "commander.nvim": { "branch": "main", "commit": "84101e8eb1613a72bbdec655b734f891d8a00694" }, "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, "dashboard-nvim": { "branch": "master", "commit": "e6e33b848f0e2fe5c13f6553c568764555c390a3" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "43f67935d388fbb540f8b40e8cbfd80de54f978a" }, - "friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" }, "fzf-lua": { "branch": "main", "commit": "24a1616df5f27d1286e5113cf176693de4111d21" }, "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, "gitsigns.nvim": { "branch": "main", "commit": "6b1a14eabcebbcca1b9e9163a26b2f8371364cb7" }, @@ -27,8 +22,6 @@ "lazygit.nvim": { "branch": "main", "commit": "ad3e1ea592f9d13e86e0d4e850224d9d78069508" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, - "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, "matrix-nvim": { "branch": "main", "commit": "5fafe6b440d08c1070e3c4c4cb9d648436d5d867" }, "mini.ai": { "branch": "main", "commit": "45587078f323eaf41b9f701bbc04f8d1ab008979" }, "mini.indentscope": { "branch": "main", "commit": "f0d7faa064c892b96997810afcddfadc3f2a15b3" }, @@ -38,11 +31,8 @@ "neotest": { "branch": "master", "commit": "26ed90509c377d10dbdebd25b7094a886323b32b" }, "neotest-minitest": { "branch": "main", "commit": "0543bf4e997b2c970707cb297e2f74c438eb0653" }, "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, - "none-ls.nvim": { "branch": "main", "commit": "0d1b3fa2ad0b371b94cb4b9a27ba6e5a1a915c91" }, "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, "nvim": { "branch": "main", "commit": "31fcfb02c47952d5c75aec893b93b2878abe5fbb" }, - "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, - "nvim-lspconfig": { "branch": "master", "commit": "ae0651d850f8f9313d4db3f96fe24dbf054edeb4" }, "nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" }, "nvim-spectre": { "branch": "master", "commit": "49fae98ef2bfa8342522b337892992e3495065d5" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, @@ -77,6 +67,7 @@ "vim-slim": { "branch": "master", "commit": "a0a57f75f20a03d5fa798484743e98f4af623926" }, "vim-system-copy": { "branch": "master", "commit": "8abd9ed21016bdc21b458c79da3b9ac0ee25c1ce" }, "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }, + "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" }, "vimtex": { "branch": "master", "commit": "2dc2a5435809c13f6f4aa07964be4ef19a7864f5" }, "which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" } } \ No newline at end of file diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 3410f68..41ac0c5 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -1,4 +1,5 @@ return { + { "tpope/vim-unimpaired", lazy = false }, { "christoomey/vim-system-copy", lazy = false }, { "folke/neoconf.nvim", cmd = "Neoconf" }, { @@ -7,9 +8,52 @@ return { config = function() require("dashboard").setup({ theme = "hyper", + config = { + header = { + [[ ]], + [[  ]], + [[ ████ ██████ █████ ██ ]], + [[ ███████████ █████  ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + }, + }, + shortcut = { + { desc = "󰊳 Update", group = "@property", action = "Lazy update", key = "u" }, + { + icon = " ", + icon_hl = "@variable", + desc = "Files", + group = "Label", + action = "Telescope find_files", + key = "f", + }, + { + desc = " Apps", + group = "DiagnosticHint", + action = "Telescope app", + key = "a", + }, + { + desc = " dotfiles", + group = "Number", + action = "Telescope dotfiles", + key = "d", + }, + { + desc = " Restore Session", + group = "Number", + action = "require('persistence').load()", + key = "r" + } + }, }) end, - dependencies = { { "nvim-tree/nvim-web-devicons" } }, + dependencies = { "nvim-tree/nvim-web-devicons" }, }, { "nyoom-engineering/oxocarbon.nvim", @@ -76,6 +120,13 @@ return { config = function() require("neo-tree").setup({ sources = { "filesystem", "document_symbols" }, + filesystem = { + filtered_items = { + visible = true, -- when true, they will just be displayed differently than normal items + hide_dotfiles = true, + hide_gitignored = true, + }, + }, window = { mappings = { [""] = "none", @@ -120,11 +171,23 @@ return { }, { "stevearc/oil.nvim", - opts = {}, + lazy = false, + opts = { + default_file_explorer = true, + columns = { + "icon", + }, + view_options = { + show_hidden = true, + }, + float = { + max_width = 142, + preview_split = "right", + }, + }, dependencies = { "nvim-tree/nvim-web-devicons" }, keys = { - { "-", "Oil", desc = "Oil" }, - -- { "-", function() require("oil").toggle_float() end, desc = "Oil" } + { "-", "Oil --float", desc = "Oil" }, }, }, { @@ -174,23 +237,24 @@ return { config = { exclude = { filetypes = { - "lspinfo", - "packer", - "checkhealth", - "help", - "man", - "gitcommit", - "TelescopePrompt", - "TelescopeResults", - "Dashboard" - } - } + "lspinfo", + "packer", + "checkhealth", + "help", + "man", + "gitcommit", + "TelescopePrompt", + "TelescopeResults", + "Dashboard", + }, + }, }, keys = { { - "ibl", "IBLToggleScope" - } - } + "ibl", + "IBLToggleScope", + }, + }, }, { "jlanzarotta/bufexplorer", diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index db9c542..912e330 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -98,6 +98,9 @@ return { "nvim-telescope/telescope.nvim", -- optional "ibhagwan/fzf-lua", -- optional }, + keys = { + {"ng", "Neogit", desc = "Neogit"}, + }, config = true, lazy = false }, diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index da808a1..35d9216 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -39,6 +39,49 @@ return { }) end }, + { + "CopilotC-Nvim/CopilotChat.nvim", + lazy = false, + branch = "canary", + dependencies = { + { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim + { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper + }, + opts = { + debug = true, -- Enable debugging + -- See Configuration section for rest + }, + -- See Commands section for default commands if you want to lazy load on them + keys = { + { + "ccq", + function() + local input = vim.fn.input("Quick Chat: ") + if input ~= "" then + require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) + end + end, + desc = "CopilotChat - Quick chat", + }, + { + "cch", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.help_actions()) + end, + desc = "CopilotChat - Help actions", + }, + -- Show prompts actions with telescope + { + "ccp", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) + end, + desc = "CopilotChat - Prompt actions", + }, + } + }, { "williamboman/mason.nvim", lazy = false, From 8bdaedaac815d1141d3a2a7ac3675ff0b93ff6bd Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Thu, 4 Jul 2024 13:57:36 +0200 Subject: [PATCH 073/280] Update deps, add live grep arg --- .config/nvim/lazy-lock.json | 12 +++ .config/nvim/lua/plugins/telescope.lua | 116 ++++++++++++++++--------- 2 files changed, 88 insertions(+), 40 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 1fde5c7..11ebf69 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -2,16 +2,22 @@ "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "CopilotChat.nvim": { "branch": "canary", "commit": "82923efe22b604cf9c0cad0bb2a74aa9247755ab" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, + "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "bufexplorer": { "branch": "master", "commit": "2308e87960c05bd8da7bbf62c903e1f42d6cc9b9" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "commander.nvim": { "branch": "main", "commit": "84101e8eb1613a72bbdec655b734f891d8a00694" }, "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, "dashboard-nvim": { "branch": "master", "commit": "e6e33b848f0e2fe5c13f6553c568764555c390a3" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "43f67935d388fbb540f8b40e8cbfd80de54f978a" }, + "friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" }, "fzf-lua": { "branch": "main", "commit": "24a1616df5f27d1286e5113cf176693de4111d21" }, "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, "gitsigns.nvim": { "branch": "main", "commit": "6b1a14eabcebbcca1b9e9163a26b2f8371364cb7" }, @@ -22,6 +28,8 @@ "lazygit.nvim": { "branch": "main", "commit": "ad3e1ea592f9d13e86e0d4e850224d9d78069508" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, + "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, "matrix-nvim": { "branch": "main", "commit": "5fafe6b440d08c1070e3c4c4cb9d648436d5d867" }, "mini.ai": { "branch": "main", "commit": "45587078f323eaf41b9f701bbc04f8d1ab008979" }, "mini.indentscope": { "branch": "main", "commit": "f0d7faa064c892b96997810afcddfadc3f2a15b3" }, @@ -31,8 +39,11 @@ "neotest": { "branch": "master", "commit": "26ed90509c377d10dbdebd25b7094a886323b32b" }, "neotest-minitest": { "branch": "main", "commit": "0543bf4e997b2c970707cb297e2f74c438eb0653" }, "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, + "none-ls.nvim": { "branch": "main", "commit": "0d1b3fa2ad0b371b94cb4b9a27ba6e5a1a915c91" }, "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, "nvim": { "branch": "main", "commit": "31fcfb02c47952d5c75aec893b93b2878abe5fbb" }, + "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, + "nvim-lspconfig": { "branch": "master", "commit": "ae0651d850f8f9313d4db3f96fe24dbf054edeb4" }, "nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" }, "nvim-spectre": { "branch": "master", "commit": "49fae98ef2bfa8342522b337892992e3495065d5" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, @@ -52,6 +63,7 @@ "rustaceanvim": { "branch": "master", "commit": "d6d7620b66d74b3b16defcf85cbef7b3582795b3" }, "sonokai": { "branch": "master", "commit": "16fa31a410183ce945e58d834a74f161a2dce5aa" }, "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, + "telescope-live-grep-args.nvim": { "branch": "master", "commit": "8ad632f793fd437865f99af5684f78300dac93fb" }, "telescope-rails.nvim": { "branch": "master", "commit": "e0addf3751b0af1fc0bc4706ff25ba73949a98ae" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index d2b9b6a..fdce254 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -1,42 +1,78 @@ return { - { - 'nvim-telescope/telescope.nvim', tag = '0.1.6', - dependencies = { 'nvim-lua/plenary.nvim' }, - keys = { - { "ff", "Telescope find_files", desc = "Telescope File" }, - { "fc", "Telescope find_files search_dirs={'~/.config/nvim/'}", desc = "Telescope Config" }, - { "fg", "Telescope git_files", desc = "Telescope Git File" }, - { "fb", "Telescope buffers", desc = "Telescope Buffer" }, - { "fs", "Telescope grep_string", desc = "Telescope Grep" }, - { "fw", "Telescope live_grep", desc = "Telescope Grep" }, - { "fr", - function() - local word = vim.fn.expand("") - require("telescope.builtin").grep_string { - search = word, - only_sort_text = true, - layout_strategy = "vertical", - layout_config = {} - } - end, - desc = "Telescope current word" - }, - { "fk", "Telescope keymaps", desc = "Telescope Keymap" }, - { "", "Telescope commands", desc = "Telescope Command" }, - } - }, - { - "nvim-telescope/telescope-ui-select.nvim", - lazy = false, - config = function() - require("telescope").setup({ - extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown {} - } - } - }) - require("telescope").load_extension("ui-select") - end - } + { + "nvim-telescope/telescope.nvim", + tag = "0.1.6", + dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-live-grep-args.nvim" }, + config = function() + local telescope = require("telescope") + telescope.setup({}) + telescope.load_extension("live_grep_args") + end, + keys = { + { + "ff", + "Telescope find_files", + desc = "Telescope File", + }, + { + "fc", + "Telescope find_files search_dirs={'~/.config/nvim/'}", + desc = "Telescope Config", + }, + { + "fg", + "Telescope git_files", + desc = "Telescope Git File", + }, + { + "fb", + "Telescope buffers", + desc = "Telescope Buffer", + }, + { + "fs", + "Telescope grep_string", + desc = "Telescope Grep", + }, + { + "fw", + "Telescope live_grep", + desc = "Telescope Grep", + }, + { + "fr", + function() + local word = vim.fn.expand("") + require("telescope.builtin").grep_string({ + search = word, + only_sort_text = true, + layout_strategy = "vertical", + layout_config = {}, + }) + end, + desc = "Telescope current word", + }, + { + "fg", + ":lua require('telescope').extensions.live_grep_args.live_grep_args()", + desc = "Telescope Grep Args", + }, + { "fk", "Telescope keymaps", desc = "Telescope Keymap" }, + { "", "Telescope commands", desc = "Telescope Command" }, + }, + }, + { + "nvim-telescope/telescope-ui-select.nvim", + lazy = false, + config = function() + require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + }, + }) + require("telescope").load_extension("ui-select") + end, + }, } From a9a334b89575881e14ede0ac26f795a3c5d48905 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 20 Jul 2024 00:16:25 +0200 Subject: [PATCH 074/280] Update dotfiles --- .config/alacritty/alacritty.toml | 5 ++ .config/nvim/.tool-versions | 1 + .config/nvim/copilot-chat | 2 + .config/nvim/lazy-lock.json | 7 ++ .config/nvim/lua/plugins/coding.lua | 1 + .config/nvim/lua/plugins/editor.lua | 9 +- .config/nvim/lua/plugins/fun.lua | 7 ++ .config/nvim/lua/plugins/git.lua | 22 ++++- .config/nvim/lua/plugins/lsp.lua | 117 ++++++++++++++++++++----- .config/nvim/lua/plugins/telescope.lua | 12 ++- .tmux.conf | 1 + .tool-versions | 1 + .zshrc | 41 ++++++++- 13 files changed, 197 insertions(+), 29 deletions(-) create mode 100644 .config/nvim/.tool-versions create mode 100644 .config/nvim/copilot-chat create mode 100644 .config/nvim/lua/plugins/fun.lua create mode 100644 .tool-versions diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 147c4a9..36bd626 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -596,6 +596,11 @@ chars = "\u0006L" key = "Right" mods = "Command" +[[keyboard.bindings]] +key = "T" +mods = "Command" +chars = "\u0013c" # This is CTRL + S + 'c' + [shell] args = ["-l", "-c", "session_name=$(tmux ls | grep -v \"(attached)\" | head -n 1 | cut -d: -f1); [ -n \"$session_name\" ] && tmux attach -t \"$session_name\" || tmux new-session"] program = "/bin/zsh" diff --git a/.config/nvim/.tool-versions b/.config/nvim/.tool-versions new file mode 100644 index 0000000..f2a971a --- /dev/null +++ b/.config/nvim/.tool-versions @@ -0,0 +1 @@ +ruby 3.2.2 diff --git a/.config/nvim/copilot-chat b/.config/nvim/copilot-chat new file mode 100644 index 0000000..76e579a --- /dev/null +++ b/.config/nvim/copilot-chat @@ -0,0 +1,2 @@ +test + diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 11ebf69..aeb7d50 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -19,13 +19,16 @@ "flash.nvim": { "branch": "main", "commit": "43f67935d388fbb540f8b40e8cbfd80de54f978a" }, "friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" }, "fzf-lua": { "branch": "main", "commit": "24a1616df5f27d1286e5113cf176693de4111d21" }, + "gh.nvim": { "branch": "main", "commit": "ebbaac254ef7dd6f85b439825fbce82d0dc84515" }, "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, "gitsigns.nvim": { "branch": "main", "commit": "6b1a14eabcebbcca1b9e9163a26b2f8371364cb7" }, "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, + "image_preview.nvim": { "branch": "main", "commit": "8de950078bdecf1916e8dbddfbee451e095b023c" }, "inc-rename.nvim": { "branch": "main", "commit": "535b508c0cb14d00c1836ad901b3c531cb1152bb" }, "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, "lazy.nvim": { "branch": "main", "commit": "d0921f5b9b3d2c5e09618da55a018228edcc4d16" }, "lazygit.nvim": { "branch": "main", "commit": "ad3e1ea592f9d13e86e0d4e850224d9d78069508" }, + "litee.nvim": { "branch": "main", "commit": "4efaf373322d9e71eaff31164abb393417cc6f6a" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, @@ -49,6 +52,7 @@ "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, "nvim-treesitter": { "branch": "master", "commit": "6cd4ce6cab184e8787f164a182954534221f2af2" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, + "nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" }, "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, "nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }, "oil.nvim": { "branch": "master", "commit": "b0a6cf98982cdcf82b19b0029b734bbbcd24bcc4" }, @@ -59,11 +63,14 @@ "plantuml-previewer.vim": { "branch": "master", "commit": "1dd4d0f2b09cd80a217f76d82f93830dbbe689b3" }, "plantuml-syntax": { "branch": "master", "commit": "1592944444513c208ab5a087397ba987932af750" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "refactoring.nvim": { "branch": "master", "commit": "c9c1a0995b7d9a534f3b9a4df7fd55240127eeb4" }, "rustaceanvim": { "branch": "master", "commit": "d6d7620b66d74b3b16defcf85cbef7b3582795b3" }, "sonokai": { "branch": "master", "commit": "16fa31a410183ce945e58d834a74f161a2dce5aa" }, + "speedtyper.nvim": { "branch": "main", "commit": "d73b3d2bdd574dd9c2e39e3558a4fe26f081d885" }, "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, "telescope-live-grep-args.nvim": { "branch": "master", "commit": "8ad632f793fd437865f99af5684f78300dac93fb" }, + "telescope-media-files.nvim": { "branch": "master", "commit": "0826c7a730bc4d36068f7c85cf4c5b3fd9fb570a" }, "telescope-rails.nvim": { "branch": "master", "commit": "e0addf3751b0af1fc0bc4706ff25ba73949a98ae" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index e8bc0df..466046b 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -32,6 +32,7 @@ return { { "public", "private", "protected" }, { "if", "unless" }, { "width", "height" }, + { "let", "const" }, }, allow_caps_additions = { { "enable", "disable" }, diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 41ac0c5..ee0fb15 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -55,6 +55,13 @@ return { end, dependencies = { "nvim-tree/nvim-web-devicons" }, }, + { + 'adelarsq/image_preview.nvim', + event = 'VeryLazy', + config = function() + require("image_preview").setup() + end + }, { "nyoom-engineering/oxocarbon.nvim", lazy = false, @@ -187,7 +194,7 @@ return { }, dependencies = { "nvim-tree/nvim-web-devicons" }, keys = { - { "-", "Oil --float", desc = "Oil" }, + { "-", "Oil", desc = "Oil" }, }, }, { diff --git a/.config/nvim/lua/plugins/fun.lua b/.config/nvim/lua/plugins/fun.lua new file mode 100644 index 0000000..99dbaa5 --- /dev/null +++ b/.config/nvim/lua/plugins/fun.lua @@ -0,0 +1,7 @@ +return { + "NStefan002/speedtyper.nvim", + cmd = "Speedtyper", + opts = { + -- your config + } +} diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index 912e330..ecc0bb1 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -91,15 +91,15 @@ return { { "NeogitOrg/neogit", dependencies = { - "nvim-lua/plenary.nvim", -- required + "nvim-lua/plenary.nvim", -- required "sindrets/diffview.nvim", -- optional - Diff integration -- Only one of these is needed, not both. "nvim-telescope/telescope.nvim", -- optional - "ibhagwan/fzf-lua", -- optional + "ibhagwan/fzf-lua", -- optional }, keys = { - {"ng", "Neogit", desc = "Neogit"}, + { "ng", "Neogit", desc = "Neogit" }, }, config = true, lazy = false @@ -107,5 +107,21 @@ return { { "junkblocker/git-time-lapse", lazy = false + }, + { + "ldelossa/gh.nvim", + lazy = false, + dependencies = { + { + "ldelossa/litee.nvim", + config = function() + require("litee.lib").setup() + end, + }, + }, + config = function() + require("litee.gh").setup() + end, } + } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 35d9216..029bb77 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -37,7 +37,7 @@ return { suggestion = { enabled = false }, panel = { enabled = false }, }) - end + end, }, { "CopilotC-Nvim/CopilotChat.nvim", @@ -48,10 +48,42 @@ return { { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper }, opts = { - debug = true, -- Enable debugging - -- See Configuration section for rest + temperature = 0.3, + mappings = { + reset = { + normal = '', + insert = '' + }, + complete = { + detail = 'Use @ or / for options.', + insert = '', + }, + close = { + normal = 'q', + insert = '' + }, + submit_prompt = { + normal = '', + insert = '' + }, + accept_diff = { + normal = '', + insert = '' + }, + yank_diff = { + normal = 'gy', + }, + show_diff = { + normal = 'gd' + }, + show_system_prompt = { + normal = 'gp' + }, + show_user_selection = { + normal = 'gs' + }, + }, }, - -- See Commands section for default commands if you want to lazy load on them keys = { { "ccq", @@ -80,7 +112,7 @@ return { end, desc = "CopilotChat - Prompt actions", }, - } + }, }, { "williamboman/mason.nvim", @@ -130,7 +162,7 @@ return { filetypes = { "markdown", "text", "cff", "tex" }, flags = { debounce_text_changes = 299 }, }) - + lspconfig.astro.setup({}) lspconfig.solargraph.setup({ capabilities = capabilities, @@ -148,9 +180,9 @@ return { folding = true, references = true, rename = true, - symbols = true - } - } + symbols = true, + }, + }, }) vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) @@ -158,9 +190,9 @@ return { vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) - vim.cmd [[ + vim.cmd([[ autocmd BufNewFile,BufRead *.prawn set filetype=ruby - ]] + ]]) end, }, { @@ -200,18 +232,30 @@ return { silent = true, mode = "i", }, - { "", function() require("luasnip").jump(1) end, mode = "s" }, - { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, - } + { + "", + function() + require("luasnip").jump(1) + end, + mode = "s", + }, + { + "", + function() + require("luasnip").jump(-1) + end, + mode = { "i", "s" }, + }, + }, }, { "hrsh7th/nvim-cmp", lazy = false, dependencies = { - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-cmdline', - 'rafamadriz/friendly-snippets', + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-cmdline", + "rafamadriz/friendly-snippets", }, config = function() local cmp = require("cmp") @@ -249,6 +293,39 @@ return { event = "InsertEnter", config = function() require("copilot_cmp").setup() - end - } + end, + }, + { + "nvim-treesitter/nvim-treesitter-refactor", + lazy = false, + config = function() + require("nvim-treesitter.configs").setup({ + refactor = { + highlight_definitions = { + enable = true, + clear_on_cursor_move = true, + }, + highlight_current_scope = { enable = false }, + smart_rename = { + enable = true, + -- Assign keymaps to false to disable them, e.g. `smart_rename = false`. + keymaps = { + smart_rename = "grr", + }, + }, + navigation = { + enable = true, + -- Assign keymaps to false to disable them, e.g. `goto_definition = false`. + keymaps = { + goto_definition = "gnd", + list_definitions = "gnD", + list_definitions_toc = "gO", + goto_next_usage = "", + goto_previous_usage = "", + }, + }, + }, + }) + end, + }, } diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index fdce254..c500f72 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -2,16 +2,22 @@ return { { "nvim-telescope/telescope.nvim", tag = "0.1.6", - dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-live-grep-args.nvim" }, + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-lua/popup.nvim", + "nvim-telescope/telescope-live-grep-args.nvim" , + "nvim-telescope/telescope-media-files.nvim", + "nvim-telescope/telescope.nvim", + }, config = function() local telescope = require("telescope") - telescope.setup({}) telescope.load_extension("live_grep_args") + telescope.load_extension("media_files") end, keys = { { "ff", - "Telescope find_files", + "Telescope find_files hidden=true", desc = "Telescope File", }, { diff --git a/.tmux.conf b/.tmux.conf index 1d4a13a..4c6ab13 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -18,6 +18,7 @@ bind-key l select-pane -R # set -g window-size latest # setw -g aggressive-resize on +bind-key -n C-t new-window bind r source-file ~/.tmux.conf; # set-hook -g after-kill-pane 'select-layout -E' diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..c1c77c3 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +ruby 3.2.3 diff --git a/.zshrc b/.zshrc index 8e4a652..49c9060 100644 --- a/.zshrc +++ b/.zshrc @@ -7,6 +7,8 @@ if [ "$TERM_PROGRAM" = "WarpTerminal" ] && [ "$TERMINAL_EMULATOR" != "JetBrains- fi PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH" +export PATH="$HOME/.asdf/installs/ruby/latest/bin:$PATH" +export PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH" export PATH="$HOME/.tmux/plugins/tmuxifier/bin:$PATH" export PATH="$HOME/.jenv/bin:$PATH" export PATH="~/renuo/personal/rails-generator/bin:$PATH" @@ -14,7 +16,7 @@ export PATH="~/.asdf/shims/:$PATH" export BUN_INSTALL="$HOME/.bun" export PATH="$BUN_INSTALL/bin:$PATH" export PATH=~/dev/flutter/bin:$PATH -# export PATH="/Users/dani/.gem/ruby/3.2.0/bin:$PATH" +export PATH="/Users/dani/.gem/:$PATH" export PATH="/opt/homebrew/opt/ruby/bin:$PATH" export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES # fix libcurl error export EDITOR="nvim" @@ -47,7 +49,12 @@ function openticket() { ~/scripts/open-ticket-in-browser.ts } function ot() { ~/scripts/open-ticket-in-browser.ts } function prt() { ~/scripts/get-pr-template.ts } function cpt() { ~/scripts/copy-ticket-number.ts } -function rsf() { bundle exec rspec $(find spec/**/*_spec.rb | fzf --preview 'bat --color "always" {}') } # [r]spec [s]earch [f]ile +function rsf() { + file=$(find spec/**/*_spec.rb | fzf --preview 'bat --color "always" {}') + echo "bundle exec rspec $file" + print -S "$file" + bundle exec rspec $file +} # [r]spec [s]earch [f]ile function vg() { nvim $(fzf) } # [v]im [g]rep function pkill() { port=$1 @@ -136,6 +143,7 @@ alias glog="git log --oneline" alias glag="glog_ --all --since='00:00' --until='NOW' | grep -v -e '^\s*$' --color=always" # [g]it [l]og [a]ll [g]rep alias gb="if ( git branch | grep '* develop' ); then; git checkout -b ; else; echo 'You can only start a new feature from the development branch' ;fi;" # [g]it [b]ranch alias gs="git status" # [g]it [s]tatus +alias gso="git show" # [g]it [s]how alias gp="git push" # [g]it [p]ush alias gpp="git pull && git push" # [g]it [p]ull and [p]ush alias gpl="git pull" # [g]it [p]u[l]l @@ -263,3 +271,32 @@ zinit ice pick"async.zsh" src"pure.zsh" # with zsh-async library that's bundled zinit light sindresorhus/pure PATH=~/.console-ninja/.bin:$PATH + +renuo-cli() { + initial_directory=$(pwd) + cd ~/renuo-cli + trap "cd $initial_directory" EXIT + ruby -Ilib ./bin/renuo "$@" +} + +renuo-cli-hack() { + local current_ruby_version=$(asdf current ruby | awk '{print $2}') + + local tool_versions_exists=false + [ -f .tool-versions ] && tool_versions_exists=true + + local ruby_in_tool_versions=false + grep -q "ruby" .tool-versions && ruby_in_tool_versions=true + + asdf local ruby 3.2.3 + renuo "$@" + + if ! $tool_versions_exists; then + rm .tool-versions + elif ! $ruby_in_tool_versions; then + sed -i '' '/ruby/d' .tool-versions + else + asdf local ruby $current_ruby_version + fi +} + From ac5f4962a20905a98788919787982ace85da5c1a Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 23 Jul 2024 07:22:28 +0200 Subject: [PATCH 075/280] Update nvim config, add telescope quickfix --- .config/nvim/init.lua | 10 ----- .config/nvim/lazy-lock.json | 6 +-- .config/nvim/lua/plugins/coding.lua | 62 +------------------------- .config/nvim/lua/plugins/git.lua | 22 +++------ .config/nvim/lua/plugins/lsp.lua | 8 ++++ .config/nvim/lua/plugins/telescope.lua | 5 +++ 6 files changed, 22 insertions(+), 91 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index a42a4e1..be36c51 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -14,17 +14,13 @@ vim.opt.tabstop = 2 vim.opt.softtabstop = 2 vim.opt.shiftwidth = 2 vim.opt.scrolloff = 10 -vim.opt.hlsearch = true vim.opt.winbar = "%f" vim.opt.laststatus = 3 -vim.opt.spelllang = "de_ch" - vim.keymap.set("n", "qq", "wqa") vim.keymap.set("n", "q!", "qa!") vim.keymap.set("n", "/", "noh") -vim.api.nvim_set_keymap("n", "gw", 'diw"apviwo"bpviwo', { noremap = true, silent = true }) vim.keymap.set("n", "n", "nzz") vim.keymap.set("n", "N", "Nzz") @@ -92,9 +88,3 @@ vim.keymap.set("n", "L", "Lazy") vim.g.sonokai_better_performance = 1 vim.g.sonokai_style = "andromeda" vim.cmd.colorscheme("catppuccin") - --- vim.api.nvim_command('highlight Normal guibg=NONE ctermbg=NONE') --- vim.api.nvim_command('highlight NonText guibg=NONE ctermbg=NONE') --- vim.api.nvim_command('highlight LineNr guibg=NONE ctermbg=NONE') --- vim.api.nvim_command('highlight SignColumn guibg=NONE ctermbg=NONE') --- vim.api.nvim_command('highlight VertSplit guibg=NONE ctermbg=NONE') diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index aeb7d50..738df7f 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -18,7 +18,6 @@ "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "43f67935d388fbb540f8b40e8cbfd80de54f978a" }, "friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" }, - "fzf-lua": { "branch": "main", "commit": "24a1616df5f27d1286e5113cf176693de4111d21" }, "gh.nvim": { "branch": "main", "commit": "ebbaac254ef7dd6f85b439825fbce82d0dc84515" }, "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, "gitsigns.nvim": { "branch": "main", "commit": "6b1a14eabcebbcca1b9e9163a26b2f8371364cb7" }, @@ -38,7 +37,7 @@ "mini.indentscope": { "branch": "main", "commit": "f0d7faa064c892b96997810afcddfadc3f2a15b3" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, "neoconf.nvim": { "branch": "main", "commit": "94f1e5b81c440ec1fc7efde3c7f9448b7bab7776" }, - "neogit": { "branch": "master", "commit": "66b29453df7050543a51986620f8961a79a13fcc" }, + "neogit": { "branch": "master", "commit": "a232e38512a09107b10ae3ac11a5803897fbdfef" }, "neotest": { "branch": "master", "commit": "26ed90509c377d10dbdebd25b7094a886323b32b" }, "neotest-minitest": { "branch": "main", "commit": "0543bf4e997b2c970707cb297e2f74c438eb0653" }, "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, @@ -88,5 +87,6 @@ "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }, "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" }, "vimtex": { "branch": "master", "commit": "2dc2a5435809c13f6f4aa07964be4ef19a7864f5" }, - "which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" } + "which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" }, + "yaml.nvim": { "branch": "main", "commit": "77aa8812e652acc44ae16fd1dbeb5a952db937e0" } } \ No newline at end of file diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index 466046b..10eb17a 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -40,63 +40,6 @@ return { }) end, }, - -- { - -- "monaqa/dial.nvim", - -- lazy = false, - -- config = function() - -- local augend = require("dial.augend") - -- - -- vim.keymap.set("n", "", function() - -- require("dial.map").manipulate("increment", "normal") - -- end) - -- vim.keymap.set("n", "", function() - -- require("dial.map").manipulate("decrement", "normal") - -- end) - -- vim.keymap.set("n", "g", function() - -- require("dial.map").manipulate("increment", "gnormal") - -- end) - -- vim.keymap.set("n", "g", function() - -- require("dial.map").manipulate("decrement", "gnormal") - -- end) - -- vim.keymap.set("v", "", function() - -- require("dial.map").manipulate("increment", "visual") - -- end) - -- vim.keymap.set("v", "", function() - -- require("dial.map").manipulate("decrement", "visual") - -- end) - -- vim.keymap.set("v", "g", function() - -- require("dial.map").manipulate("increment", "gvisual") - -- end) - -- vim.keymap.set("v", "g", function() - -- require("dial.map").manipulate("decrement", "gvisual") - -- end) - -- - -- require("dial.config").augends:register_group({ - -- default = { - -- augend.constant.new({ - -- elements = { "true", "false" }, - -- word = true, - -- cyclic = true, - -- }), - -- augend.constant.new({ - -- elements = { "->", "<--" }, - -- word = true, - -- cyclic = true, - -- }), - -- augend.constant.new({ - -- elements = { "++", "--" }, - -- word = true, - -- cyclic = true, - -- }), - -- augend.constant.new({ - -- elements = { "&&", "||" }, - -- word = false, - -- cyclic = true, - -- }), - -- }, - -- }) - -- end, - -- }, { "numToStr/Comment.nvim", opts = {}, @@ -109,8 +52,5 @@ return { vim.g.highlightedyank_highlight_duration = 100 end }, - { - "tpope/vim-repeat", - lazy = false, - }, + { "tpope/vim-repeat", lazy = false }, } diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index ecc0bb1..7658ab6 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -27,10 +27,6 @@ return { "tpope/vim-fugitive", cmd = { "Git" } }, - { - "sindrets/diffview.nvim", - lazy = false - }, { "lewis6991/gitsigns.nvim", lazy = false, @@ -91,23 +87,16 @@ return { { "NeogitOrg/neogit", dependencies = { - "nvim-lua/plenary.nvim", -- required - "sindrets/diffview.nvim", -- optional - Diff integration - - -- Only one of these is needed, not both. - "nvim-telescope/telescope.nvim", -- optional - "ibhagwan/fzf-lua", -- optional + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "nvim-telescope/telescope.nvim", }, + config = true, keys = { { "ng", "Neogit", desc = "Neogit" }, }, - config = true, - lazy = false - }, - { - "junkblocker/git-time-lapse", - lazy = false }, + { "junkblocker/git-time-lapse", commands = { "GitTimeLapse" } }, { "ldelossa/gh.nvim", lazy = false, @@ -123,5 +112,4 @@ return { require("litee.gh").setup() end, } - } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 029bb77..5f158ef 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -328,4 +328,12 @@ return { }) end, }, + { + "cuducos/yaml.nvim", + ft = { "yaml" }, -- optional + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-telescope/telescope.nvim", -- optional + }, + } } diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index c500f72..1294093 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -45,6 +45,11 @@ return { "Telescope live_grep", desc = "Telescope Grep", }, + { + "fq", + "Telescope quickfix", + desc = "Telescope Quickfix", + }, { "fr", function() From 26ad9c26a45f70a62e33bfa8f17bcc8c3ef24e12 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 26 Jul 2024 21:42:51 +0200 Subject: [PATCH 076/280] Update git shortcuts --- .config/nvim/lua/plugins/git.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index 7658ab6..5a30edc 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -12,7 +12,7 @@ return { "LazyGitFilterCurrentFile", }, keys = { - { "gg", "LazyGit", desc = "LazyGit" } + { "ng", "LazyGit", desc = "LazyGit" } }, config = function() require("telescope").load_extension("lazygit") @@ -93,10 +93,10 @@ return { }, config = true, keys = { - { "ng", "Neogit", desc = "Neogit" }, + { "gg", "Neogit", desc = "Neogit" }, }, }, - { "junkblocker/git-time-lapse", commands = { "GitTimeLapse" } }, + { "junkblocker/git-time-lapse", commands = { "GitTimeLapse" }, lazy = false}, { "ldelossa/gh.nvim", lazy = false, From aaad6f1e59f4aa6e39b5d554d47dac400d931486 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 26 Jul 2024 21:42:58 +0200 Subject: [PATCH 077/280] Add telescope resume --- .config/nvim/lua/plugins/telescope.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 1294093..faf9758 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -20,6 +20,11 @@ return { "Telescope find_files hidden=true", desc = "Telescope File", }, + { + "ft", + "Telescope resume", + desc = "Telescope Resume", + }, { "fc", "Telescope find_files search_dirs={'~/.config/nvim/'}", From 9b0baeeb4eb4340d5455a83bf8d0a6b1fe338807 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 3 Aug 2024 01:02:07 +0200 Subject: [PATCH 078/280] Update alacritty theme Color --- .config/alacritty/alacritty.toml | 566 ++----------------------------- my-status-bar.tmux | 15 +- 2 files changed, 38 insertions(+), 543 deletions(-) diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 36bd626..510178f 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,40 +1,36 @@ -[[colors.indexed_colors]] -color = "#ff9e64" -index = 16 - -[[colors.indexed_colors]] -color = "#db4b4b" -index = 17 - -[colors.bright] -black = "0x7f8490" -blue = "0x76cce0" -cyan = "0xf39660" -green = "0x9ed072" -magenta = "0xb39df3" -red = "0xfc5d7c" -white = "0xe2e2e3" -yellow = "0xe7c664" - -[colors.normal] -black = "0x181819" -blue = "0x76cce0" -cyan = "0xf39660" -green = "0x9ed072" -magenta = "0xb39df3" -red = "0xfc5d7c" -white = "0xe2e2e3" -yellow = "0xe7c664" - +# Default colors [colors.primary] -# background = "0x2c2e34" -# foreground = "0xe2e2e3" +background = '#fdf6e3' +foreground = '#586e75' +# Normal colors +[colors.normal] +black = '#073642' +red = '#dc322f' +green = '#859900' +yellow = '#b58900' +blue = '#268bd2' +magenta = '#d33682' +cyan = '#2aa198' +white = '#eee8d5' + +# Bright colors +[colors.bright] +black = '#002b36' +red = '#cb4b16' +green = '#586e75' +yellow = '#657b83' +blue = '#839496' +magenta = '#6c71c4' +cyan = '#93a1a1' +white = '#fdf6e3' [env] TERM = "xterm-256color" [font] -size = 20.0 +size = 17.0 +offset.x = 0 +offset.y = 0 [font.normal] family = "JetBrainsMono Nerd Font" @@ -60,55 +56,6 @@ key = "Slash" mode = "AppCursor" mods = "Command" -[[keyboard.bindings]] -chars = "\u001BOH" -key = "Home" -mode = "AppCursor" - -[[keyboard.bindings]] -chars = "\u001B[H" -key = "Home" -mode = "~AppCursor" - -[[keyboard.bindings]] -chars = "\u001BOF" -key = "End" -mode = "AppCursor" - -[[keyboard.bindings]] -chars = "\u001B[F" -key = "End" -mode = "~AppCursor" - -[[keyboard.bindings]] -chars = "\u001B[5;2~" -key = "PageUp" -mods = "Shift" - -[[keyboard.bindings]] -chars = "\u001B[5;5~" -key = "PageUp" -mods = "Control" - -[[keyboard.bindings]] -chars = "\u001B[5~" -key = "PageUp" - -[[keyboard.bindings]] -chars = "\u001B[6;2~" -key = "PageDown" -mods = "Shift" - -[[keyboard.bindings]] -chars = " " -key = "Space" -mods = "Alt" - -[[keyboard.bindings]] -chars = "\u001B\u007F" -key = "Back" -mods = "Alt" - [[keyboard.bindings]] chars = "\u001Bb" key = "Left" @@ -118,146 +65,10 @@ mods = "Alt" chars = "\u001Bf" key = "Right" mods = "Alt" - -[[keyboard.bindings]] -chars = "\u001Bb" -key = "Left" -mods = "Control" - -[[keyboard.bindings]] -chars = "\u001Bf" -key = "Right" -mods = "Control" - -[[keyboard.bindings]] -chars = "o" -key = "Delete" -mods = "Shift" - -[[keyboard.bindings]] -chars = "\u001Bo" -key = "Back" -mods = "Shift" - -[[keyboard.bindings]] -chars = "\u0018," -key = "R" -mods = "Alt" - -[[keyboard.bindings]] -chars = "\u0000" -key = "Return" -mods = "Shift" - -[[keyboard.bindings]] -chars = "\u0000" -key = "Space" -mods = "Control" - [[keyboard.bindings]] -chars = "\u0000" -key = "Space" -mods = "Alt" - -[[keyboard.bindings]] -chars = "\u0000" -key = "Space" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018(" -key = "N" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u0018)" -key = "N" -mods = "Shift|Alt" - -[[keyboard.bindings]] -chars = "\u0018'" -key = "P" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u0018(" -key = "P" -mods = "Shift|Alt" - -[[keyboard.bindings]] -chars = "\u0018B" key = "T" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u0018C" -key = "T" -mods = "Shift|Alt" - -[[keyboard.bindings]] -chars = "\u0018#" -key = "R" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u0018$" -key = "R" -mods = "Shift|Alt" - -[[keyboard.bindings]] -chars = "\u0018<" -key = "Comma" -mods = "Shift|Alt" - -[[keyboard.bindings]] -chars = "\u0017>" -key = "Period" -mods = "Shift|Alt" - -[[keyboard.bindings]] -chars = "\u000B," -key = "Comma" -mods = "Alt" - -[[keyboard.bindings]] -action = "Paste" -key = "V" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u001Ba" -key = "B" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u001Bc" -key = "D" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018m" -key = "J" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018a" -key = "K" -mods = "Command" - -[[keyboard.bindings]] -action = "Copy" -key = "C" -mods = "Command" - -[[keyboard.bindings]] -action = "Quit" -key = "Q" -mods = "Command" - -[[keyboard.bindings]] -action = "Quit" -key = "W" mods = "Command" +chars = "\u0013\u0003" [[keyboard.bindings]] action = "ResetFontSize" @@ -275,331 +86,14 @@ key = "Minus" mods = "Command" [[keyboard.bindings]] -chars = "\u0015" -key = "Back" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018d" -key = "D" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u0018v" -key = "V" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u0018s" -key = "A" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u0018V" -key = "S" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u0018\b" -key = "H" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = """ -\u0018 -""" -key = "J" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u0018\u000B" -key = "K" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u0018\f" -key = "L" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u00181" -key = "Key1" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00182" -key = "Key2" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00183" -key = "Key3" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00184" -key = "Key4" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00185" -key = "Key5" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00186" -key = "Key6" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00187" -key = "Key7" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00188" -key = "Key8" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00189" -key = "Key9" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018c" key = "T" mods = "Command" +command = { program = "/opt/homebrew/bin/tmux", args = ["new-window", "/bin/zsh"] } [[keyboard.bindings]] -chars = "\u0018x" -key = "X" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018w" -key = "S" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018/" -key = "Slash" -mods = "Control|Command" - -[[keyboard.bindings]] -chars = "\u0018," -key = "R" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018[" -key = "LBracket" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018=" -key = "A" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018o" -key = "O" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018z" -key = "O" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u0018z" -key = "Return" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018\u0001" -key = "Escape" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018\u0010" -key = "Comma" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018\u000E" -key = "Semicolon" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018\t" -key = "F" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u0018\t" -key = "E" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018n" -key = "N" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018p" -key = "P" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018/" -key = "Slash" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u001Bf" -key = "F" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018!" -key = "I" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0018$" -key = "I" -mods = "Shift|Command" - -[[keyboard.bindings]] -chars = "\u001Bj" -key = "J" -mods = "Alt" - -[[keyboard.bindings]] -chars = "\u001Bk" -key = "K" -mods = "Alt" - -[[keyboard.bindings]] -chars = "\u001Bh" -key = "H" -mods = "Alt" - -[[keyboard.bindings]] -chars = "\u001Bl" -key = "L" -mods = "Alt" - -[[keyboard.bindings]] -chars = "\u0006v" -key = "D" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0006s" -key = "D" -mods = "Command|Shift" - -[[keyboard.bindings]] -chars = "\u0006x" key = "W" mods = "Command" - -[[keyboard.bindings]] -chars = "\u0006h" -key = "H" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0006j" -key = "J" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0006k" -key = "K" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0006l" -key = "L" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0006c" -key = "T" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00061" -key = "Key1" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00062" -key = "Key2" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00063" -key = "Key3" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00064" -key = "Key4" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00065" -key = "Key5" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00066" -key = "Key6" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00067" -key = "Key7" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00068" -key = "Key8" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u00069" -key = "Key9" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0007Q" -key = "Left" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0006J" -key = "Down" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0006K" -key = "Up" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u0006L" -key = "Right" -mods = "Command" - -[[keyboard.bindings]] -key = "T" -mods = "Command" -chars = "\u0013c" # This is CTRL + S + 'c' +command = { program = "/opt/homebrew/bin/tmux", args = ["kill-pane"] } [shell] args = ["-l", "-c", "session_name=$(tmux ls | grep -v \"(attached)\" | head -n 1 | cut -d: -f1); [ -n \"$session_name\" ] && tmux attach -t \"$session_name\" || tmux new-session"] diff --git a/my-status-bar.tmux b/my-status-bar.tmux index 0f36ca7..3a07427 100755 --- a/my-status-bar.tmux +++ b/my-status-bar.tmux @@ -13,12 +13,13 @@ tmux_set() { tmux set-option -gq "$1" "$2" } -color1="#161616" -color2="blue" -color3="orange" +color1="#fdf6e3" +color2="" +color3="black" +color4="black" secondary="#[fg=$color2,bg=$color1]" -tertiary="#[fg=orange,bg=$color1]" +tertiary="#[fg=black,bg=$color1]" primary="#[fg=$color1,bg=$color2]" background="#[fg=$color2,bg=$color1]" @@ -26,13 +27,13 @@ title="#W:#I" # tmux_set status-fg "$colork" # tmux_set status-bg "$color1" tmux_set status-bg "$color1" -tmux_set status-fg "white" +tmux_set status-fg "$color4" # tmux_set window-status-current-format "#[underscore]$title" # tmux_set window-status-format "$title" # tmux_set window-status-separator " | " tmux_set window-status-format "#[bg=$color1] $title " -tmux_set window-status-current-format "#[bg=white,fg=$color1] $title " +tmux_set window-status-current-format "#[bg=$color4,fg=$color1] $title " tmux_set window-status-separator " " # tmux_set window-status-current-format "#[bg=$color1,fg=$color2]#[bg=$color2,fg=$color3] $title #[bg=$color1,fg=$color2]" @@ -40,7 +41,7 @@ tmux_set window-status-separator " " # tmux_set window-status-format "#[bg=$color1,fg=$color3]#[bg=$color3,fg=$color2] $title #[bg=$color1,fg=$color3]" #    -cmd="#[fg=orange]#{pane_current_command}" +cmd="#[fg=black]#{pane_current_command}" path="#(echo #{pane_current_path} | sed 's#$HOME#~#g')" ruby_version=$(ruby -v | awk '{print $2}') ruby="#[fg=red] $ruby_version" From 18545afe7e494bfe1e5c41295ea8d6f7def6836a Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 3 Aug 2024 01:02:23 +0200 Subject: [PATCH 079/280] Improve lazy loading --- .config/nvim/init.lua | 82 +-- .config/nvim/lazy-lock.json | 82 +-- .config/nvim/lua/languages/rails.lua | 18 +- .config/nvim/lua/plugins/coding.lua | 2 +- .config/nvim/lua/plugins/editor.lua | 245 ++++----- .config/nvim/lua/plugins/fun.lua | 16 +- .config/nvim/lua/plugins/git.lua | 29 +- .config/nvim/lua/plugins/lsp.lua | 679 +++++++++++++------------ .config/nvim/lua/plugins/telescope.lua | 54 +- 9 files changed, 632 insertions(+), 575 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index be36c51..e8f20f2 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -14,6 +14,7 @@ vim.opt.tabstop = 2 vim.opt.softtabstop = 2 vim.opt.shiftwidth = 2 vim.opt.scrolloff = 10 +vim.opt.cmdheight = 0 vim.opt.winbar = "%f" vim.opt.laststatus = 3 @@ -31,54 +32,57 @@ vim.keymap.set("n", "", "5kzz") vim.opt.wildmenu = true vim.opt.wildmode = "longest:full" vim.opt.wildignore = { - "*.docx", - "*.jpg", - "*.png", - "*.gif", - "*.pdf", - "*.pyc", - "*.exe", - "*.flv", - "*.img", - "*.xlsx", + "*.docx", + "*.jpg", + "*.png", + "*.gif", + "*.pdf", + "*.pyc", + "*.exe", + "*.flv", + "*.img", + "*.xlsx", } local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) end vim.opt.rtp:prepend(lazypath) local plugins = { - { "sainnhe/sonokai", priority = 9999 }, - { "iruzo/matrix-nvim", priority = 9999 }, - { - "catppuccin/nvim", - priority = 9999, - config = function() - require("catppuccin").setup({ - flavour = "mocha", - transparent_background = true, - show_end_of_buffer = true, - }) - end, - }, - { import = "plugins" }, - { import = "languages" }, + { "sainnhe/sonokai", priority = 1000 }, + { "iruzo/matrix-nvim", priority = 1000 }, + { "nyoom-engineering/nyoom.nvim", priority = 1000 }, + { "ray-x/aurora", priority = 1000 }, + { "shaunsingh/solarized.nvim", priority = 1000 }, + { + "catppuccin/nvim", + priority = 1000, + config = function() + require("catppuccin").setup({ + flavour = "mocha", + transparent_background = true, + show_end_of_buffer = true, + }) + end, + }, + { import = "plugins" }, + { import = "languages" }, } local opts = { - defaults = { - lazy = true, - }, + defaults = { + lazy = true, + }, } require("lazy").setup(plugins, opts) @@ -87,4 +91,8 @@ vim.keymap.set("n", "L", "Lazy") vim.g.sonokai_better_performance = 1 vim.g.sonokai_style = "andromeda" -vim.cmd.colorscheme("catppuccin") +vim.cmd.colorscheme("solarized") +vim.opt.background = "light" + + +-- vim.api.nvim_command('autocmd VimEnter * lua require("persistence").load()') diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 738df7f..6838f07 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,10 +1,10 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "CopilotChat.nvim": { "branch": "canary", "commit": "82923efe22b604cf9c0cad0bb2a74aa9247755ab" }, + "CopilotChat.nvim": { "branch": "canary", "commit": "f20a0425b33c1704133bdef5ec10c4e94f6efdc6" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, - "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, - "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" }, + "aurora": { "branch": "master", "commit": "af3e80a8ca4f9a6e3bd40e2ba12073c1d0041a81" }, + "autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "bufexplorer": { "branch": "master", "commit": "2308e87960c05bd8da7bbf62c903e1f42d6cc9b9" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, @@ -14,79 +14,79 @@ "commander.nvim": { "branch": "main", "commit": "84101e8eb1613a72bbdec655b734f891d8a00694" }, "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, - "dashboard-nvim": { "branch": "master", "commit": "e6e33b848f0e2fe5c13f6553c568764555c390a3" }, + "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "flash.nvim": { "branch": "main", "commit": "43f67935d388fbb540f8b40e8cbfd80de54f978a" }, - "friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" }, + "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, + "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, "gh.nvim": { "branch": "main", "commit": "ebbaac254ef7dd6f85b439825fbce82d0dc84515" }, "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, - "gitsigns.nvim": { "branch": "main", "commit": "6b1a14eabcebbcca1b9e9163a26b2f8371364cb7" }, + "gitsigns.nvim": { "branch": "main", "commit": "f074844b60f9e151970fbcdbeb8a2cd52b6ef25a" }, "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, "image_preview.nvim": { "branch": "main", "commit": "8de950078bdecf1916e8dbddfbee451e095b023c" }, - "inc-rename.nvim": { "branch": "main", "commit": "535b508c0cb14d00c1836ad901b3c531cb1152bb" }, + "inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" }, "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, - "lazy.nvim": { "branch": "main", "commit": "d0921f5b9b3d2c5e09618da55a018228edcc4d16" }, - "lazygit.nvim": { "branch": "main", "commit": "ad3e1ea592f9d13e86e0d4e850224d9d78069508" }, + "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "lazygit.nvim": { "branch": "main", "commit": "dc56df433bfbf107fee0139e187eb9750878fa84" }, "litee.nvim": { "branch": "main", "commit": "4efaf373322d9e71eaff31164abb393417cc6f6a" }, + "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, - "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "ba9c2f0b93deb48d0a99ae0e8d8dd36f7cc286d6" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "matrix-nvim": { "branch": "main", "commit": "5fafe6b440d08c1070e3c4c4cb9d648436d5d867" }, "mini.ai": { "branch": "main", "commit": "45587078f323eaf41b9f701bbc04f8d1ab008979" }, "mini.indentscope": { "branch": "main", "commit": "f0d7faa064c892b96997810afcddfadc3f2a15b3" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, - "neoconf.nvim": { "branch": "main", "commit": "94f1e5b81c440ec1fc7efde3c7f9448b7bab7776" }, - "neogit": { "branch": "master", "commit": "a232e38512a09107b10ae3ac11a5803897fbdfef" }, - "neotest": { "branch": "master", "commit": "26ed90509c377d10dbdebd25b7094a886323b32b" }, + "neoconf.nvim": { "branch": "main", "commit": "08ebe382a9db91e7f5d3991156b8fab7afbbe9b2" }, + "neogit": { "branch": "master", "commit": "2b74a777b963dfdeeabfabf84d5ba611666adab4" }, + "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, "neotest-minitest": { "branch": "main", "commit": "0543bf4e997b2c970707cb297e2f74c438eb0653" }, "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, - "none-ls.nvim": { "branch": "main", "commit": "0d1b3fa2ad0b371b94cb4b9a27ba6e5a1a915c91" }, + "none-ls.nvim": { "branch": "main", "commit": "a8594ef3dabb484adabc0ebbf5800be1b807c9e7" }, "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, - "nvim": { "branch": "main", "commit": "31fcfb02c47952d5c75aec893b93b2878abe5fbb" }, - "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, - "nvim-lspconfig": { "branch": "master", "commit": "ae0651d850f8f9313d4db3f96fe24dbf054edeb4" }, - "nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" }, - "nvim-spectre": { "branch": "master", "commit": "49fae98ef2bfa8342522b337892992e3495065d5" }, + "nvim": { "branch": "main", "commit": "10eda02ea4faa7d1f94e77a3410a4ae91c25c5f5" }, + "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, + "nvim-lspconfig": { "branch": "master", "commit": "f95d371c1a274f60392edfd8ea5121b42dca736e" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, + "nvim-spectre": { "branch": "master", "commit": "9a28f926d3371b7ef02243cbbb653a0478d06e31" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "6cd4ce6cab184e8787f164a182954534221f2af2" }, - "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, - "nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" }, - "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, + "nvim-treesitter": { "branch": "master", "commit": "e265fec94c7dc0c8c64cb86820ff5ad3ee135c7d" }, + "nvim-web-devicons": { "branch": "master", "commit": "e612de3d3a41a6b7be47f51e956dddabcbf419d9" }, "nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }, - "oil.nvim": { "branch": "master", "commit": "b0a6cf98982cdcf82b19b0029b734bbbcd24bcc4" }, + "nyoom.nvim": { "branch": "main", "commit": "f808500883ffc552b53a421139cc1915955759b7" }, + "oil.nvim": { "branch": "master", "commit": "71c972fbd218723a3c15afcb70421f67340f5a6d" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, "other.nvim": { "branch": "main", "commit": "63f587dde62149bd2ed3e31edceb49d5c4097a26" }, "oxocarbon.nvim": { "branch": "main", "commit": "c5846d10cbe4131cc5e32c6d00beaf59cb60f6a2" }, - "persistence.nvim": { "branch": "main", "commit": "95d03ad5450389ad7dc2a0fab14ebb3d46bc2c96" }, + "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plantuml-previewer.vim": { "branch": "master", "commit": "1dd4d0f2b09cd80a217f76d82f93830dbbe689b3" }, - "plantuml-syntax": { "branch": "master", "commit": "1592944444513c208ab5a087397ba987932af750" }, + "plantuml-syntax": { "branch": "master", "commit": "8fb95a3ae4354ca2322ef24803d8960fce519eb0" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "refactoring.nvim": { "branch": "master", "commit": "c9c1a0995b7d9a534f3b9a4df7fd55240127eeb4" }, - "rustaceanvim": { "branch": "master", "commit": "d6d7620b66d74b3b16defcf85cbef7b3582795b3" }, - "sonokai": { "branch": "master", "commit": "16fa31a410183ce945e58d834a74f161a2dce5aa" }, - "speedtyper.nvim": { "branch": "main", "commit": "d73b3d2bdd574dd9c2e39e3558a4fe26f081d885" }, + "refactoring.nvim": { "branch": "master", "commit": "ac70bb714f30886e79461869871174a1c1d52058" }, + "rustaceanvim": { "branch": "master", "commit": "047f9c9d8cd2861745eb9de6c1570ee0875aa795" }, + "solarized.nvim": { "branch": "master", "commit": "fe02ed49cc017cc93657bd6306a2624394611c69" }, + "sonokai": { "branch": "master", "commit": "598d29bef1cdea1eef4749c96824af0ae2f9350c" }, "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, "telescope-live-grep-args.nvim": { "branch": "master", "commit": "8ad632f793fd437865f99af5684f78300dac93fb" }, "telescope-media-files.nvim": { "branch": "master", "commit": "0826c7a730bc4d36068f7c85cf4c5b3fd9fb570a" }, + "telescope-rails-db-schema": { "branch": "master", "commit": "99b4a280aa69c69d40b1dc9c119c39a098a2b1a4" }, "telescope-rails.nvim": { "branch": "master", "commit": "e0addf3751b0af1fc0bc4706ff25ba73949a98ae" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, "toast.vim": { "branch": "master", "commit": "6ef5cea8298e64a555cfaf7541bb94781d06dc69" }, - "todo-comments.nvim": { "branch": "main", "commit": "51e10f838e84b4756c16311d0b1ef0972c6482d2" }, - "toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" }, - "trouble.nvim": { "branch": "main", "commit": "e5d0e04121c662ce29190a57dd03655d43c59d44" }, - "vim-fugitive": { "branch": "master", "commit": "d0c1a437536778bcc8174b7cb2ffdf98f611e6fe" }, + "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, + "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, + "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, + "vim-fugitive": { "branch": "master", "commit": "0444df68cd1cdabc7453d6bd84099458327e5513" }, "vim-grammarous": { "branch": "master", "commit": "db46357465ce587d5325e816235b5e92415f8c05" }, "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, "vim-rails": { "branch": "master", "commit": "2fba7907f585819a8653f0bc7dd7f437a822d9c6" }, - "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, + "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, "vim-slim": { "branch": "master", "commit": "a0a57f75f20a03d5fa798484743e98f4af623926" }, "vim-system-copy": { "branch": "master", "commit": "8abd9ed21016bdc21b458c79da3b9ac0ee25c1ce" }, "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }, "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" }, - "vimtex": { "branch": "master", "commit": "2dc2a5435809c13f6f4aa07964be4ef19a7864f5" }, - "which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" }, - "yaml.nvim": { "branch": "main", "commit": "77aa8812e652acc44ae16fd1dbeb5a952db937e0" } -} \ No newline at end of file + "vimtex": { "branch": "master", "commit": "5ac62e0315c6f54f53a7d6da7c485cf8e9cf7240" }, + "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" } +} diff --git a/.config/nvim/lua/languages/rails.lua b/.config/nvim/lua/languages/rails.lua index 3138a58..b1c3ee2 100644 --- a/.config/nvim/lua/languages/rails.lua +++ b/.config/nvim/lua/languages/rails.lua @@ -10,17 +10,17 @@ return { { "rv", "Telescope rails views", desc = "Telescope rails views" }, { "ri", "Telescope rails migrations", desc = "Telescope rails migrations" }, { "rl", "Telescope rails libs", desc = "Telescope rails libs" }, - } + }, }, { "rgroli/other.nvim", keys = { - { "ll", ":Other", desc = "Other" }, - { "leader>ltn", ":OtherTabNew", desc = "OtherTabNew" }, - { "leader>lp", ":OtherSplit", desc = "OtherSplit" }, - { "leader>lv", ":OtherVSplit", desc = "OtherVSplit" }, - { "leader>lc", ":OtherClear", desc = "OtherClear" }, - { "leader>lt", ":Other test", desc = "Other test" }, + { "ll", ":Other", desc = "Other" }, + { "ltn", ":OtherTabNew", desc = "OtherTabNew" }, + { "lp", ":OtherSplit", desc = "OtherSplit" }, + { "lv", ":OtherVSplit", desc = "OtherVSplit" }, + { "lc", ":OtherClear", desc = "OtherClear" }, + { "lt", ":Other test", desc = "Other test" }, }, config = function() require("other-nvim").setup({ @@ -32,10 +32,10 @@ return { "golang", }, }) - end + end, }, { "slim-template/vim-slim", ft = "slim", - } + }, } diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index 10eb17a..3a44618 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -43,7 +43,7 @@ return { { "numToStr/Comment.nvim", opts = {}, - lazy = false, + event = "VeryLazy" }, { "machakann/vim-highlightedyank", diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index ee0fb15..5e69e04 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -1,101 +1,101 @@ return { - { "tpope/vim-unimpaired", lazy = false }, - { "christoomey/vim-system-copy", lazy = false }, - { "folke/neoconf.nvim", cmd = "Neoconf" }, - { - "nvimdev/dashboard-nvim", - event = "VimEnter", - config = function() - require("dashboard").setup({ - theme = "hyper", - config = { - header = { - [[ ]], - [[  ]], - [[ ████ ██████ █████ ██ ]], - [[ ███████████ █████  ]], - [[ █████████ ███████████████████ ███ ███████████ ]], - [[ █████████ ███ █████████████ █████ ██████████████ ]], - [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], - [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], - [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], - [[ ]], - }, - }, - shortcut = { - { desc = "󰊳 Update", group = "@property", action = "Lazy update", key = "u" }, - { - icon = " ", - icon_hl = "@variable", - desc = "Files", - group = "Label", - action = "Telescope find_files", - key = "f", - }, - { - desc = " Apps", - group = "DiagnosticHint", - action = "Telescope app", - key = "a", - }, - { - desc = " dotfiles", - group = "Number", - action = "Telescope dotfiles", - key = "d", - }, - { - desc = " Restore Session", - group = "Number", - action = "require('persistence').load()", - key = "r" - } - }, - }) - end, - dependencies = { "nvim-tree/nvim-web-devicons" }, - }, - { - 'adelarsq/image_preview.nvim', - event = 'VeryLazy', - config = function() - require("image_preview").setup() - end - }, - { - "nyoom-engineering/oxocarbon.nvim", - lazy = false, - config = function() - -- vim.cmd.colorscheme("oxocarbon") - end, - }, - -- TODO: fix - { - "max397574/better-escape.nvim", - lazy = false, - config = function() - require("better_escape").setup({ - mapping = { "jk", "jj" }, - timeout = 100, - clear_empty_lines = false, - keys = function() - return vim.api.nvim_win_get_cursor(0)[2] > 1 and "l" or "" - end, - }) - end, - }, - { - "jsit/toast.vim", - lazy = false, - config = function() - -- vim.cmd "set background=light" - -- vim.cmd.colorscheme "toast" - end, - }, - { - "folke/persistence.nvim", - event = "BufReadPre", - opts = { options = vim.opt.sessionoptions:get() }, + { "tpope/vim-unimpaired", event = "VeryLazy" }, + { "christoomey/vim-system-copy", lazy = false }, + { "folke/neoconf.nvim", cmd = "Neoconf" }, + { + "nvimdev/dashboard-nvim", + event = "VimEnter", + config = function() + require("dashboard").setup({ + theme = "hyper", + config = { + header = { + [[ ]], + [[  ]], + [[ ████ ██████ █████ ██ ]], + [[ ███████████ █████  ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + }, + }, + shortcut = { + { desc = "󰊳 Update", group = "@property", action = "Lazy update", key = "u" }, + { + icon = " ", + icon_hl = "@variable", + desc = "Files", + group = "Label", + action = "Telescope find_files", + key = "f", + }, + { + desc = " Apps", + group = "DiagnosticHint", + action = "Telescope app", + key = "a", + }, + { + desc = " dotfiles", + group = "Number", + action = "Telescope dotfiles", + key = "d", + }, + { + desc = " Restore Session", + group = "Number", + action = "require('persistence').load()", + key = "r", + }, + }, + }) + end, + dependencies = { "nvim-tree/nvim-web-devicons" }, + }, + { + "adelarsq/image_preview.nvim", + event = "VeryLazy", + config = function() + require("image_preview").setup() + end, + }, + { + "nyoom-engineering/oxocarbon.nvim", + lazy = false, + config = function() + -- vim.cmd.colorscheme("oxocarbon") + end, + }, + -- TODO: fix + -- { + -- "max397574/better-escape.nvim", + -- lazy = false, + -- config = function() + -- require("better_escape").setup({ + -- mapping = { "jk", "jj" }, + -- timeout = 100, + -- clear_empty_lines = false, + -- keys = function() + -- return vim.api.nvim_win_get_cursor(0)[2] > 1 and "l" or "" + -- end, + -- }) + -- end, + -- }, + { + "jsit/toast.vim", + lazy = false, + config = function() + -- vim.cmd "set background=light" + -- vim.cmd.colorscheme "toast" + end, + }, + { + "folke/persistence.nvim", + event = "BufReadPre", + opts = { options = vim.opt.sessionoptions:get() }, -- stylua: ignore keys = { { "qs", function() require("persistence").load() end, desc = "Restore Session" }, @@ -156,29 +156,28 @@ return { }) end, }, - { - "nvim-treesitter/nvim-treesitter", - event = "VeryLazy", - dependencies = { - "RRethy/nvim-treesitter-endwise", - }, - config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = { "lua", "vim", "vimdoc", "vimdoc", "ruby", "bibtex", "yaml" }, - ignore_install = { "latex" }, -- highlighting by vimtex - auto_install = false, - endwise = { - enable = true, - }, - highlight = { - enable = true, - }, - }) - end, - }, + -- { + -- "nvim-treesitter/nvim-treesitter", + -- event = "VeryLazy", + -- dependencies = { + -- "RRethy/nvim-treesitter-endwise", + -- }, + -- config = function() + -- require("nvim-treesitter.configs").setup({ + -- ensure_installed = { "lua", "vim", "ruby", "bibtex", "yaml" }, + -- ignore_install = { "latex" }, + -- auto_install = true, + -- endwise = { + -- enable = true, + -- }, + -- highlight = { + -- enable = true, + -- }, + -- }) + -- end, + -- }, { "stevearc/oil.nvim", - lazy = false, opts = { default_file_explorer = true, columns = { @@ -203,7 +202,7 @@ return { "nvim-telescope/telescope.nvim", }, keys = { - { "f", "Telescope commander", mode = "n" }, + { "fp", "Telescope commander", mode = "n" }, { "fc", "Telescope commander", mode = "n" }, }, config = function() @@ -465,4 +464,12 @@ return { lazy = false, }, { "echasnovski/mini.ai", version = false, lazy = false }, + { + 'nvim-lualine/lualine.nvim', + lazy = false, + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require("lualine").setup() + end + } } diff --git a/.config/nvim/lua/plugins/fun.lua b/.config/nvim/lua/plugins/fun.lua index 99dbaa5..4d4835d 100644 --- a/.config/nvim/lua/plugins/fun.lua +++ b/.config/nvim/lua/plugins/fun.lua @@ -1,7 +1,13 @@ return { - "NStefan002/speedtyper.nvim", - cmd = "Speedtyper", - opts = { - -- your config - } + -- { + -- "NStefan002/speedtyper.nvim", + -- cmd = "Speedtyper", + -- opts = {}, + -- { + -- "m4xshen/hardtime.nvim", + -- lazy = false, + -- dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" }, + -- opts = {} + -- }, + -- } } diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index 5a30edc..dc7a1b9 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -97,19 +97,18 @@ return { }, }, { "junkblocker/git-time-lapse", commands = { "GitTimeLapse" }, lazy = false}, - { - "ldelossa/gh.nvim", - lazy = false, - dependencies = { - { - "ldelossa/litee.nvim", - config = function() - require("litee.lib").setup() - end, - }, - }, - config = function() - require("litee.gh").setup() - end, - } + -- { + -- "ldelossa/gh.nvim", + -- dependencies = { + -- { + -- "ldelossa/litee.nvim", + -- config = function() + -- require("litee.lib").setup() + -- end, + -- }, + -- }, + -- config = function() + -- require("litee.gh").setup() + -- end, + -- } } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 5f158ef..627baa0 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,339 +1,356 @@ return { - { - "ThePrimeagen/refactoring.nvim", - event = "VeryLazy", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - config = function() - require("refactoring").setup({}) - end, - keys = { - { - "rr", - function() - require("refactoring").select_refactor() - end, - desc = "Refactor", - }, - }, - }, - { - "zbirenbaum/copilot.lua", - cmd = "Copilot", - event = "InsertEnter", - config = function() - require("copilot").setup({}) - end, - }, - { - "zbirenbaum/copilot-cmp", - lazy = false, - event = "InsertEnter", - config = function() - require("copilot_cmp").setup() - require("copilot").setup({ - suggestion = { enabled = false }, - panel = { enabled = false }, - }) - end, - }, - { - "CopilotC-Nvim/CopilotChat.nvim", - lazy = false, - branch = "canary", - dependencies = { - { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim - { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper - }, - opts = { - temperature = 0.3, - mappings = { - reset = { - normal = '', - insert = '' - }, - complete = { - detail = 'Use @ or / for options.', - insert = '', - }, - close = { - normal = 'q', - insert = '' - }, - submit_prompt = { - normal = '', - insert = '' - }, - accept_diff = { - normal = '', - insert = '' - }, - yank_diff = { - normal = 'gy', - }, - show_diff = { - normal = 'gd' - }, - show_system_prompt = { - normal = 'gp' - }, - show_user_selection = { - normal = 'gs' - }, - }, - }, - keys = { - { - "ccq", - function() - local input = vim.fn.input("Quick Chat: ") - if input ~= "" then - require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) - end - end, - desc = "CopilotChat - Quick chat", - }, - { - "cch", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.help_actions()) - end, - desc = "CopilotChat - Help actions", - }, - -- Show prompts actions with telescope - { - "ccp", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) - end, - desc = "CopilotChat - Prompt actions", - }, - }, - }, - { - "williamboman/mason.nvim", - lazy = false, - keys = { - { "m", "Mason" }, - }, - config = function() - require("mason").setup() - end, - }, - { - "williamboman/mason-lspconfig.nvim", - lazy = false, - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "tsserver", "solargraph" }, - }) - end, - }, - { - "nvim-lspconfig", - lazy = false, - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() - -- https://www.mitchellhanberg.com/modern-format-on-save-in-neovim/ - -- vim.api.nvim_create_autocmd("LspAttach", { - -- group = vim.api.nvim_create_augroup("lsp", { clear = true }), - -- callback = function(args) - -- vim.api.nvim_create_autocmd("BufWritePre", { - -- buffer = args.buf, - -- callback = function() - -- vim.lsp.buf.format({ async = false, id = args.data.client_id }) - -- end, - -- }) - -- end, - -- }) + { + "ThePrimeagen/refactoring.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + opts = {}, + keys = { + { + "rr", + function() + require("refactoring").select_refactor() + end, + desc = "Refactor", + }, + }, + }, + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + config = function() + require("copilot").setup({}) + end, + }, + { + "zbirenbaum/copilot-cmp", + lazy = false, + event = "InsertEnter", + config = function() + require("copilot_cmp").setup() + require("copilot").setup({ + suggestion = { enabled = false }, + panel = { enabled = false }, + }) + end, + }, + { + "CopilotC-Nvim/CopilotChat.nvim", + dependencies = { + { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim + { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper + }, + commands = { + "CopilotChat", + "CopilotChat", + "CopilotChatOpen", + "CopilotChatClose", + "CopilotChatToggle", + "CopilotChatStop", + "CopilotChatReset", + "CopilotChatSave", + "CopilotChatLoad", + "CopilotChatDebugInfo", + "CopilotChatModels", + "CopilotChatExplain", + "CopilotChatReview", + "CopilotChatFix", + "CopilotChatOptimize", + "CopilotChatDocs", + "CopilotChatTests", + "CopilotChatFixDiagnostic", + "CopilotChatCommit", + "CopilotChatCommitStaged", + }, + opts = { + temperature = 0.3, + mappings = { + reset = { + normal = "", + insert = "", + }, + complete = { + detail = "Use @ or / for options.", + insert = "", + }, + close = { + normal = "q", + insert = "", + }, + submit_prompt = { + normal = "", + insert = "", + }, + accept_diff = { + normal = "", + insert = "", + }, + yank_diff = { + normal = "gy", + }, + show_diff = { + normal = "gd", + }, + show_system_prompt = { + normal = "gp", + }, + show_user_selection = { + normal = "gs", + }, + }, + }, + keys = { + { + "ccq", + function() + local input = vim.fn.input("Quick Chat: ") + if input ~= "" then + require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) + end + end, + desc = "CopilotChat - Quick chat", + }, + { + "cch", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.help_actions()) + end, + desc = "CopilotChat - Help actions", + }, + -- Show prompts actions with telescope + { + "ccp", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) + end, + desc = "CopilotChat - Prompt actions", + }, + }, + }, + { + "williamboman/mason.nvim", + lazy = false, + keys = { + { "m", "Mason" }, + }, + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + lazy = false, + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "tsserver", "solargraph" }, + }) + end, + }, + { + "nvim-lspconfig", + lazy = false, + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + -- https://www.mitchellhanberg.com/modern-format-on-save-in-neovim/ + -- vim.api.nvim_create_autocmd("LspAttach", { + -- group = vim.api.nvim_create_augroup("lsp", { clear = true }), + -- callback = function(args) + -- vim.api.nvim_create_autocmd("BufWritePre", { + -- buffer = args.buf, + -- callback = function() + -- vim.lsp.buf.format({ async = false, id = args.data.client_id }) + -- end, + -- }) + -- end, + -- }) - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup({ capabilities = capabilities }) - lspconfig.tsserver.setup({ capabilities = capabilities }) - -- lspconfig.standardrb.setup({ capabilities = capabilities }) - -- lspconfig.rubocop.setup({ capabilities = capabilities }) - -- lspconfig.rust_analyzer.setup({ capabilities = capabilities }) - lspconfig.ltex.setup({ - cmd = { "ltex-ls" }, - filetypes = { "markdown", "text", "cff", "tex" }, - flags = { debounce_text_changes = 299 }, - }) - lspconfig.astro.setup({}) + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup({ capabilities = capabilities }) + lspconfig.tsserver.setup({ capabilities = capabilities }) + -- lspconfig.standardrb.setup({ capabilities = capabilities }) + -- lspconfig.rubocop.setup({ capabilities = capabilities }) + -- lspconfig.rust_analyzer.setup({ capabilities = capabilities }) + lspconfig.ltex.setup({ + cmd = { "ltex-ls" }, + filetypes = { "markdown", "text", "cff", "tex" }, + flags = { debounce_text_changes = 299 }, + }) + lspconfig.astro.setup({}) - lspconfig.solargraph.setup({ - capabilities = capabilities, - cmd = { - "asdf", - "exec", - "solargraph", - "stdio", - }, - settings = { - solargraph = { - autoformat = false, - completion = true, - diagnostic = true, - folding = true, - references = true, - rename = true, - symbols = true, - }, - }, - }) + lspconfig.solargraph.setup({ + capabilities = capabilities, + cmd = { + "asdf", + "exec", + "solargraph", + "stdio", + }, + settings = { + solargraph = { + autoformat = false, + completion = true, + diagnostic = true, + folding = true, + references = true, + rename = true, + symbols = true, + }, + }, + }) - vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) - vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) - vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) - vim.cmd([[ + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) + vim.cmd([[ autocmd BufNewFile,BufRead *.prawn set filetype=ruby ]]) - end, - }, - { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.disable({ "rubocop" }) - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.diagnostics.erb_format, - null_ls.builtins.formatting.erb_lint, - }, - }) - end, - keys = { - { "gf", vim.lsp.buf.format }, - }, - }, - { - "hrsh7th/cmp-nvim-lsp", - lazy = false, - }, - { - "L3MON4D3/LuaSnip", - dependencies = { - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets", - }, - keys = { - { - "", - function() - return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" - end, - expr = true, - silent = true, - mode = "i", - }, - { - "", - function() - require("luasnip").jump(1) - end, - mode = "s", - }, - { - "", - function() - require("luasnip").jump(-1) - end, - mode = { "i", "s" }, - }, - }, - }, - { - "hrsh7th/nvim-cmp", - lazy = false, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-cmdline", - "rafamadriz/friendly-snippets", - }, - config = function() - local cmp = require("cmp") - require("luasnip.loaders.from_vscode").lazy_load() + end, + }, + { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.disable({ "rubocop" }) + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.diagnostics.erb_format, + null_ls.builtins.formatting.erb_lint, + }, + }) + end, + keys = { + { "gf", vim.lsp.buf.format }, + }, + }, + { + "hrsh7th/cmp-nvim-lsp", + lazy = false, + }, + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + keys = { + { + "", + function() + return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" + end, + expr = true, + silent = true, + mode = "i", + }, + { + "", + function() + require("luasnip").jump(1) + end, + mode = "s", + }, + { + "", + function() + require("luasnip").jump(-1) + end, + mode = { "i", "s" }, + }, + }, + }, + { + "hrsh7th/nvim-cmp", + lazy = false, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-cmdline", + "rafamadriz/friendly-snippets", + }, + config = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() - cmp.setup({ - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - { name = "copilot", group_index = 2 }, - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - }), - }) - end, - }, - { - "zbirenbaum/copilot-cmp", - event = "InsertEnter", - config = function() - require("copilot_cmp").setup() - end, - }, - { - "nvim-treesitter/nvim-treesitter-refactor", - lazy = false, - config = function() - require("nvim-treesitter.configs").setup({ - refactor = { - highlight_definitions = { - enable = true, - clear_on_cursor_move = true, - }, - highlight_current_scope = { enable = false }, - smart_rename = { - enable = true, - -- Assign keymaps to false to disable them, e.g. `smart_rename = false`. - keymaps = { - smart_rename = "grr", - }, - }, - navigation = { - enable = true, - -- Assign keymaps to false to disable them, e.g. `goto_definition = false`. - keymaps = { - goto_definition = "gnd", - list_definitions = "gnD", - list_definitions_toc = "gO", - goto_next_usage = "", - goto_previous_usage = "", - }, - }, - }, - }) - end, - }, - { - "cuducos/yaml.nvim", - ft = { "yaml" }, -- optional - dependencies = { - "nvim-treesitter/nvim-treesitter", - "nvim-telescope/telescope.nvim", -- optional - }, - } + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = "copilot", group_index = 2 }, + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), + }) + end, + }, + { + "zbirenbaum/copilot-cmp", + event = "InsertEnter", + config = function() + require("copilot_cmp").setup() + end, + }, + -- { + -- "nvim-treesitter/nvim-treesitter-refactor", + -- lazy = false, + -- config = function() + -- require("nvim-treesitter.configs").setup({ + -- refactor = { + -- highlight_definitions = { + -- enable = true, + -- clear_on_cursor_move = true, + -- }, + -- highlight_current_scope = { enable = false }, + -- smart_rename = { + -- enable = true, + -- -- Assign keymaps to false to disable them, e.g. `smart_rename = false`. + -- keymaps = { + -- smart_rename = "grr", + -- }, + -- }, + -- navigation = { + -- enable = true, + -- -- Assign keymaps to false to disable them, e.g. `goto_definition = false`. + -- keymaps = { + -- goto_definition = "gnd", + -- list_definitions = "gnD", + -- list_definitions_toc = "gO", + -- goto_next_usage = "", + -- goto_previous_usage = "", + -- }, + -- }, + -- }, + -- }) + -- end, + -- }, + -- { + -- "cuducos/yaml.nvim", + -- ft = { "yaml" }, -- optional + -- dependencies = { + -- "nvim-treesitter/nvim-treesitter", + -- "nvim-telescope/telescope.nvim", -- optional + -- }, + -- } } diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index faf9758..fc76fc9 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -2,17 +2,26 @@ return { { "nvim-telescope/telescope.nvim", tag = "0.1.6", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-lua/popup.nvim", - "nvim-telescope/telescope-live-grep-args.nvim" , - "nvim-telescope/telescope-media-files.nvim", - "nvim-telescope/telescope.nvim", - }, + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-lua/popup.nvim", + "nvim-telescope/telescope-live-grep-args.nvim", + "nvim-telescope/telescope-media-files.nvim", + "nvim-telescope/telescope.nvim", + "erlingur/telescope-rails-db-schema", + }, config = function() local telescope = require("telescope") telescope.load_extension("live_grep_args") - telescope.load_extension("media_files") + telescope.load_extension("media_files") + telescope.load_extension("rails_db_schema") + telescope.setup({ + pickers = { + colorscheme = { + enable_preview = true, + }, + }, + }) end, keys = { { @@ -20,13 +29,13 @@ return { "Telescope find_files hidden=true", desc = "Telescope File", }, - { + { "ft", "Telescope resume", desc = "Telescope Resume", }, { - "fc", + "fn", "Telescope find_files search_dirs={'~/.config/nvim/'}", desc = "Telescope Config", }, @@ -50,11 +59,11 @@ return { "Telescope live_grep", desc = "Telescope Grep", }, - { - "fq", - "Telescope quickfix", - desc = "Telescope Quickfix", - }, + { + "fq", + "Telescope quickfix", + desc = "Telescope Quickfix", + }, { "fr", function() @@ -66,15 +75,26 @@ return { layout_config = {}, }) end, - desc = "Telescope current word", + desc = "Telescope grep current word", + }, + { + "fc", + function() + local filename = vim.fn.expand("") + require("telescope.builtin").find_files({ + find_command = { "rg", "--files", "--hidden", "--ignore", "--glob", "!*.git/*", filename }, + }) + end, + desc = "Telescope find file under cursor", }, { "fg", ":lua require('telescope').extensions.live_grep_args.live_grep_args()", - desc = "Telescope Grep Args", + desc = "Telescope Grep Args", }, { "fk", "Telescope keymaps", desc = "Telescope Keymap" }, { "", "Telescope commands", desc = "Telescope Command" }, + { "fd", ":Telescope rails_db_schema", desc = "Telescope Rails db schema" }, }, }, { From 2a4502b24dd33021197bf947801dd14c9903ca44 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 24 Aug 2024 19:43:30 +0200 Subject: [PATCH 080/280] Add pubip --- .../alacritty.toml.1724191066835.bak | 107 ++++++++++++++++++ .config/nvim/init.lua | 1 + .zshrc | 1 + 3 files changed, 109 insertions(+) create mode 100644 .config/alacritty/alacritty.toml.1724191066835.bak diff --git a/.config/alacritty/alacritty.toml.1724191066835.bak b/.config/alacritty/alacritty.toml.1724191066835.bak new file mode 100644 index 0000000..0da6758 --- /dev/null +++ b/.config/alacritty/alacritty.toml.1724191066835.bak @@ -0,0 +1,107 @@ +# Default colors +[colors.primary] +background = "#fdf6e3" +foreground = "#586e75" + +[colors.normal] +black = "#073642" +red = "#dc322f" +green = "#859900" +yellow = "#b58900" +blue = "#268bd2" +magenta = "#d33682" +cyan = "#2aa198" +white = "#eee8d5" + +[colors.bright] +black = "#002b36" +red = "#cb4b16" +green = "#586e75" +yellow = "#657b83" +blue = "#839496" +magenta = "#6c71c4" +cyan = "#93a1a1" +white = "#fdf6e3" + +[font] +size = 17.0 +offset.x = 0 +offset.y = 0 + +[font.normal] +family = "JetBrainsMono Nerd Font" + +[[keyboard.bindings]] +action = "CreateNewWindow" +key = "N" +mods = "Command" + +[[keyboard.bindings]] +action = "SearchForward" +key = "F" +mods = "Command" + +[[keyboard.bindings]] +chars = "alacritty -e 'btop' & \r" +key = "P" +mods = "Command" + +[[keyboard.bindings]] +chars = "search_history \r" +key = "Slash" +mode = "AppCursor" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u001Bb" +key = "Left" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001Bf" +key = "Right" +mods = "Alt" +[[keyboard.bindings]] +key = "T" +mods = "Command" +chars = "\u0013\u0003" + +[[keyboard.bindings]] +action = "ResetFontSize" +key = "Key0" +mods = "Command" + +[[keyboard.bindings]] +action = "IncreaseFontSize" +key = "Equals" +mods = "Command" + +[[keyboard.bindings]] +action = "DecreaseFontSize" +key = "Minus" +mods = "Command" + +[[keyboard.bindings]] +key = "T" +mods = "Command" +command = { program = "/opt/homebrew/bin/tmux", args = ["new-window", "/bin/zsh"] } + +[[keyboard.bindings]] +key = "W" +mods = "Command" +command = { program = "/opt/homebrew/bin/tmux", args = ["kill-pane"] } + +[shell] +args = ["-l", "-c", "session_name=$(tmux ls | grep -v \"(attached)\" | head -n 1 | cut -d: -f1); [ -n \"$session_name\" ] && tmux attach -t \"$session_name\" || tmux new-session"] +program = "/bin/zsh" + +[window] +decorations = "buttonless" +decorations_theme_variant = "None" +dynamic_padding = false +dynamic_title = true +opacity = 1 + +[window.padding] +x = 10 +y = 10 diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index e8f20f2..b396f2d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -21,6 +21,7 @@ vim.opt.laststatus = 3 vim.keymap.set("n", "qq", "wqa") vim.keymap.set("n", "q!", "qa!") + vim.keymap.set("n", "/", "noh") vim.keymap.set("n", "n", "nzz") diff --git a/.zshrc b/.zshrc index 49c9060..efe937d 100644 --- a/.zshrc +++ b/.zshrc @@ -125,6 +125,7 @@ alias bo='tectonic -X build && open build/default/default.pdf' # [b]uild and [o] alias bno='tectonic -X build' # [b]uild and do[n]'t [o]pen alias g="grep" # [g]rep alias myip="ipconfig getifaddr en0" +alias pubip="dig +short myip.opendns.com @resolver1.opendns.com -4" # borrowed from raphi alias bra="bundle exec rubocop -A" # [b]undle exec [r]ubocop -[A] alias spec="be rspec" alias f="fork ." From c0df6dfe5fc4b2050199fc1c624284a5d122a147 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 24 Aug 2024 20:06:59 +0200 Subject: [PATCH 081/280] Added create_symlinks --- create_symlinks.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 create_symlinks.sh diff --git a/create_symlinks.sh b/create_symlinks.sh new file mode 100755 index 0000000..a1871b7 --- /dev/null +++ b/create_symlinks.sh @@ -0,0 +1,14 @@ +#!/bin/zsh + +function create_symlink() { + if [[ ! -e $2 ]]; then + ln -s $1 $2 + echo "Created symlink $2 -> $1" + elif [[ -L $2 && ! -e $2 ]]; then + echo "Symlink $2 is broken" + else + echo "Symlink $2 already exists" + fi +} + +create_symlink .zshrc ~/.zshrc From b0e6eff679b614c19c80b5a67a9c64f5103faab4 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 24 Aug 2024 20:10:12 +0200 Subject: [PATCH 082/280] Update symlink script --- create_symlinks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create_symlinks.sh b/create_symlinks.sh index a1871b7..57ddf3e 100755 --- a/create_symlinks.sh +++ b/create_symlinks.sh @@ -11,4 +11,4 @@ function create_symlink() { fi } -create_symlink .zshrc ~/.zshrc +create_symlink ~/dotfiles/.zshrc ~/.zshrc From d426474e5d70fd44968a7b65bb5fa48f77ec370c Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 24 Aug 2024 20:28:48 +0200 Subject: [PATCH 083/280] Improve symlink script --- create_symlinks.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/create_symlinks.sh b/create_symlinks.sh index 57ddf3e..0195423 100755 --- a/create_symlinks.sh +++ b/create_symlinks.sh @@ -1,7 +1,9 @@ #!/bin/zsh function create_symlink() { - if [[ ! -e $2 ]]; then + if [[ ! -e $1 ]]; then + echo "Source file $1 does not exist" + elif [[ ! -e $2 ]]; then ln -s $1 $2 echo "Created symlink $2 -> $1" elif [[ -L $2 && ! -e $2 ]]; then From 4f735129112b4ff5f86ac30ef40dc1b2e19755f2 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 25 Aug 2024 22:23:48 +0200 Subject: [PATCH 084/280] Add switch theme script --- change_theme.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 change_theme.sh diff --git a/change_theme.sh b/change_theme.sh new file mode 100755 index 0000000..0ccb76a --- /dev/null +++ b/change_theme.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +ALACRITTY_DARK_THEME="/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Campbell.toml" +ALACRITTY_LIGHT_THEME="/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Solarized-Light.toml" +ALACRITTY_CONFIG_FILE="$HOME/.config/alacritty/alacritty.toml" + +NVIM_CONFIG_FILE="$HOME/.config/nvim/init.lua" +NVIM_LIGHT_THEME='vim.cmd.colorscheme("solarized")' +NVIM_DARK_THEME='vim.cmd.colorscheme("elflord")' +NVIM_DARK_BACKGROUND='vim.opt.background = "dark"' +NVIM_LIGHT_BACKGROUND='vim.opt.background = "light"' + +# Check if ALACRITTY_CONFIG_FILE exists +if [ ! -f "$ALACRITTY_CONFIG_FILE" ]; then + echo "File not found: $ALACRITTY_CONFIG_FILE" + exit 1 +fi + +if grep -q "$ALACRITTY_LIGHT_THEME" "$ALACRITTY_CONFIG_FILE"; then + sed -i "s|$ALACRITTY_LIGHT_THEME|$ALACRITTY_DARK_THEME|g" "$ALACRITTY_CONFIG_FILE" + sed -i "s|$NVIM_LIGHT_THEME|$NVIM_DARK_THEME|g" "$NVIM_CONFIG_FILE" + sed -i "s|$NVIM_LIGHT_BACKGROUND|$NVIM_DARK_BACKGROUND|g" "$NVIM_CONFIG_FILE" + echo "Changed to dark theme" +else + sed -i "s|$ALACRITTY_DARK_THEME|$ALACRITTY_LIGHT_THEME|g" "$ALACRITTY_CONFIG_FILE" + sed -i "s|$NVIM_DARK_THEME|$NVIM_LIGHT_THEME|g" "$NVIM_CONFIG_FILE" + sed -i "s|$NVIM_DARK_BACKGROUND|$NVIM_LIGHT_BACKGROUND|g" "$NVIM_CONFIG_FILE" + echo "Changed to light theme" +fi From a29b653dc148532c172e1760f4371f9bcfe6c9b3 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 27 Aug 2024 18:02:51 +0200 Subject: [PATCH 085/280] Add nvim switching to change_theme.sh --- change_theme.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/change_theme.sh b/change_theme.sh index 0ccb76a..4d3b7f0 100755 --- a/change_theme.sh +++ b/change_theme.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash ALACRITTY_DARK_THEME="/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Campbell.toml" ALACRITTY_LIGHT_THEME="/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Solarized-Light.toml" @@ -9,6 +9,9 @@ NVIM_LIGHT_THEME='vim.cmd.colorscheme("solarized")' NVIM_DARK_THEME='vim.cmd.colorscheme("elflord")' NVIM_DARK_BACKGROUND='vim.opt.background = "dark"' NVIM_LIGHT_BACKGROUND='vim.opt.background = "light"' +NVIM_LIGHT_CMD=':colorscheme solarized | set background=light' +NVIM_DARK_CMD=':colorscheme blue | set background=dark' +NVIM_SERVERS=$(nvr --serverlist) # Check if ALACRITTY_CONFIG_FILE exists if [ ! -f "$ALACRITTY_CONFIG_FILE" ]; then @@ -20,10 +23,17 @@ if grep -q "$ALACRITTY_LIGHT_THEME" "$ALACRITTY_CONFIG_FILE"; then sed -i "s|$ALACRITTY_LIGHT_THEME|$ALACRITTY_DARK_THEME|g" "$ALACRITTY_CONFIG_FILE" sed -i "s|$NVIM_LIGHT_THEME|$NVIM_DARK_THEME|g" "$NVIM_CONFIG_FILE" sed -i "s|$NVIM_LIGHT_BACKGROUND|$NVIM_DARK_BACKGROUND|g" "$NVIM_CONFIG_FILE" + for server in $NVIM_SERVERS; do + nvr --servername $server --remote-send ":colorscheme elflord:set background=dark" + done + tmux list-panes -a -F '#{pane_id} #{pane_current_command}' | grep vim | cut -d ' ' -f 1 | xargs -I PANE tmux send-keys -t PANE ESCAPE "$NVIM_LIGHT_CMD" ENTER echo "Changed to dark theme" else sed -i "s|$ALACRITTY_DARK_THEME|$ALACRITTY_LIGHT_THEME|g" "$ALACRITTY_CONFIG_FILE" sed -i "s|$NVIM_DARK_THEME|$NVIM_LIGHT_THEME|g" "$NVIM_CONFIG_FILE" sed -i "s|$NVIM_DARK_BACKGROUND|$NVIM_LIGHT_BACKGROUND|g" "$NVIM_CONFIG_FILE" + for server in $NVIM_SERVERS; do + nvr --servername $server --remote-send ":colorscheme solarized:set background=light" + done echo "Changed to light theme" fi From d6ff870ff4bce71af74cf8ebcd874a3a5c30fb65 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 27 Aug 2024 18:18:34 +0200 Subject: [PATCH 086/280] Refactor change_theme script --- change_theme.sh | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/change_theme.sh b/change_theme.sh index 4d3b7f0..b6fa2ab 100755 --- a/change_theme.sh +++ b/change_theme.sh @@ -4,36 +4,39 @@ ALACRITTY_DARK_THEME="/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules ALACRITTY_LIGHT_THEME="/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Solarized-Light.toml" ALACRITTY_CONFIG_FILE="$HOME/.config/alacritty/alacritty.toml" -NVIM_CONFIG_FILE="$HOME/.config/nvim/init.lua" -NVIM_LIGHT_THEME='vim.cmd.colorscheme("solarized")' -NVIM_DARK_THEME='vim.cmd.colorscheme("elflord")' -NVIM_DARK_BACKGROUND='vim.opt.background = "dark"' -NVIM_LIGHT_BACKGROUND='vim.opt.background = "light"' -NVIM_LIGHT_CMD=':colorscheme solarized | set background=light' -NVIM_DARK_CMD=':colorscheme blue | set background=dark' -NVIM_SERVERS=$(nvr --serverlist) - # Check if ALACRITTY_CONFIG_FILE exists if [ ! -f "$ALACRITTY_CONFIG_FILE" ]; then echo "File not found: $ALACRITTY_CONFIG_FILE" exit 1 fi +NVIM_CONFIG_FILE="$HOME/.config/nvim/init.lua" +NVIM_LIGHT_THEME='solarized' +NVIM_DARK_THEME='elflord' + +NVIM_LIGHT_THEME_CONFIG="vim.cmd.colorscheme(\"$NVIM_LIGHT_THEME\")" +NVIM_DARK_THEME_CONFIG="vim.cmd.colorscheme(\"$NVIM_DARK_THEME\")" +NVIM_LIGHT_BACKGROUND_CONFIG='vim.opt.background = "light"' +NVIM_DARK_BACKGROUND_CONFIG='vim.opt.background = "dark"' + +NVIM_SERVERS=$(nvr --serverlist) + if grep -q "$ALACRITTY_LIGHT_THEME" "$ALACRITTY_CONFIG_FILE"; then + # switch to dark theme sed -i "s|$ALACRITTY_LIGHT_THEME|$ALACRITTY_DARK_THEME|g" "$ALACRITTY_CONFIG_FILE" - sed -i "s|$NVIM_LIGHT_THEME|$NVIM_DARK_THEME|g" "$NVIM_CONFIG_FILE" - sed -i "s|$NVIM_LIGHT_BACKGROUND|$NVIM_DARK_BACKGROUND|g" "$NVIM_CONFIG_FILE" + sed -i "s|$NVIM_LIGHT_BACKGROUND_CONFIG|$NVIM_DARK_BACKGROUND_CONFIG|g" "$NVIM_CONFIG_FILE" + sed -i "s|$NVIM_LIGHT_THEME_CONFIG|$NVIM_DARK_THEME_CONFIG|g" "$NVIM_CONFIG_FILE" for server in $NVIM_SERVERS; do - nvr --servername $server --remote-send ":colorscheme elflord:set background=dark" + nvr --servername $server --remote-send ":colorscheme $NVIM_DARK_THEME:set background=dark" done - tmux list-panes -a -F '#{pane_id} #{pane_current_command}' | grep vim | cut -d ' ' -f 1 | xargs -I PANE tmux send-keys -t PANE ESCAPE "$NVIM_LIGHT_CMD" ENTER echo "Changed to dark theme" else + # switch to light theme sed -i "s|$ALACRITTY_DARK_THEME|$ALACRITTY_LIGHT_THEME|g" "$ALACRITTY_CONFIG_FILE" - sed -i "s|$NVIM_DARK_THEME|$NVIM_LIGHT_THEME|g" "$NVIM_CONFIG_FILE" - sed -i "s|$NVIM_DARK_BACKGROUND|$NVIM_LIGHT_BACKGROUND|g" "$NVIM_CONFIG_FILE" + sed -i "s|$NVIM_DARK_THEME_CONFIG|$NVIM_LIGHT_THEME_CONFIG|g" "$NVIM_CONFIG_FILE" + sed -i "s|$NVIM_DARK_BACKGROUND_CONFIG|$NVIM_LIGHT_BACKGROUND_CONFIG|g" "$NVIM_CONFIG_FILE" for server in $NVIM_SERVERS; do - nvr --servername $server --remote-send ":colorscheme solarized:set background=light" + nvr --servername $server --remote-send ":colorscheme $NVIM_LIGHT_THEME:set background=light" done echo "Changed to light theme" fi From 6f668eb59a1917bc9ae5371ede2682082024206a Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 27 Aug 2024 21:24:00 +0200 Subject: [PATCH 087/280] Add change_theme cmd --- .zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index efe937d..8410157 100644 --- a/.zshrc +++ b/.zshrc @@ -56,7 +56,7 @@ function rsf() { bundle exec rspec $file } # [r]spec [s]earch [f]ile function vg() { nvim $(fzf) } # [v]im [g]rep -function pkill() { +function prokill() { port=$1 process=$(lsof -i :$port | fzf | awk '{print $2}') kill $process @@ -133,6 +133,7 @@ alias cnvim="cd ~/.config/nvim && nvim init.lua" # [c]onfigure [nvim] alias yabairc="v ~/.yabairc" alias skhdrc="v ~/.config/skhd/skhdrc" alias dbreset="bundle exec rails db:drop db:create db:schema:load db:seed" # [d]ata[b]ase [reset] +alias change_theme="~/.config/change_theme.sh > /dev/null" alias cpb="git branch | grep '*' | tr -d '*' | tr -d ' ' | pbcopy" # [c]o[p]y [b]ranch to clipboard alias tks="tmux kill-server" # [t]mux [k]ill [s]erver alias crc="cargo r -r --bin client" From 0c7f7b6b8208ff461a5daf5b25ebbcc260e382db Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 27 Aug 2024 21:29:41 +0200 Subject: [PATCH 088/280] Update alacritty theme --- .config/alacritty/alacritty.toml | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 510178f..c903929 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,29 +1,7 @@ -# Default colors -[colors.primary] -background = '#fdf6e3' -foreground = '#586e75' - -# Normal colors -[colors.normal] -black = '#073642' -red = '#dc322f' -green = '#859900' -yellow = '#b58900' -blue = '#268bd2' -magenta = '#d33682' -cyan = '#2aa198' -white = '#eee8d5' - -# Bright colors -[colors.bright] -black = '#002b36' -red = '#cb4b16' -green = '#586e75' -yellow = '#657b83' -blue = '#839496' -magenta = '#6c71c4' -cyan = '#93a1a1' -white = '#fdf6e3' +import = [ + "/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Solarized-Light.toml" +] + [env] TERM = "xterm-256color" From ff82d78ef1967972aa339780dedfd60932a1eb81 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 27 Aug 2024 21:52:22 +0200 Subject: [PATCH 089/280] Add hyprland config --- .config/hypr/hyprland.conf | 256 +++++++++++++++++++++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 .config/hypr/hyprland.conf diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf new file mode 100644 index 0000000..2852646 --- /dev/null +++ b/.config/hypr/hyprland.conf @@ -0,0 +1,256 @@ + +# ####################################################################################### +# AUTOGENERATED HYPR CONFIG. +# PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT, +# OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS. +# ####################################################################################### + + +# This is an example Hyprland config file. +# Refer to the wiki for more information. +# https://wiki.hyprland.org/Configuring/Configuring-Hyprland/ + +# Please note not all available settings / options are set here. +# For a full list, see the wiki + +# You can split this configuration into multiple files +# Create your files separately and then link them to this file like this: +# source = ~/.config/hypr/myColors.conf + + +################ +### MONITORS ### +################ + +# See https://wiki.hyprland.org/Configuring/Monitors/ +monitor=,preferred,auto,auto + + +################### +### MY PROGRAMS ### +################### + +# See https://wiki.hyprland.org/Configuring/Keywords/ + +# Set programs that you use +$terminal = alacritty +$browser = firefox +$fileManager = dolphin +$menu = wofi --show drun + + +################# +### AUTOSTART ### +################# + +# Autostart necessary processes (like notifications daemons, status bars, etc.) +# Or execute your favorite apps at launch like this: + +# exec-once = $terminal +# exec-once = nm-applet & +# exec-once = waybar & hyprpaper & firefox + + +############################# +### ENVIRONMENT VARIABLES ### +############################# + +# See https://wiki.hyprland.org/Configuring/Environment-variables/ + +env = XCURSOR_SIZE,24 +env = HYPRCURSOR_SIZE,24 + + +##################### +### LOOK AND FEEL ### +##################### + +# Refer to https://wiki.hyprland.org/Configuring/Variables/ + +# https://wiki.hyprland.org/Configuring/Variables/#general +general { + gaps_in = 5 + gaps_out = 20 + + border_size = 2 + + # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors + col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + col.inactive_border = rgba(595959aa) + + # Set to true enable resizing windows by clicking and dragging on borders and gaps + resize_on_border = false + + # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on + allow_tearing = false + + layout = dwindle +} + +# https://wiki.hyprland.org/Configuring/Variables/#decoration +decoration { + rounding = 10 + + # Change transparency of focused and unfocused windows + active_opacity = 1.0 + inactive_opacity = 1.0 + + drop_shadow = true + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) + + # https://wiki.hyprland.org/Configuring/Variables/#blur + blur { + enabled = true + size = 3 + passes = 1 + + vibrancy = 0.1696 + } +} + +# https://wiki.hyprland.org/Configuring/Variables/#animations +animations { + enabled = true + + # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + animation = windows, 0, 1, myBezier + animation = windowsOut, 0, 1, default, popin 80% + animation = border, 0, 10, default + animation = borderangle, 0, 8, default + animation = fade, 0, 7, default + animation = workspaces, 0, 0, default +} + +# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more +dwindle { + pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = true # You probably want this +} + +# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more +master { + new_status = master +} + +# https://wiki.hyprland.org/Configuring/Variables/#misc +misc { + force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers + disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :( +} + + +############# +### INPUT ### +############# + +# https://wiki.hyprland.org/Configuring/Variables/#input +input { + kb_layout = us + kb_variant = + kb_model = + kb_options = caps:swapescape + kb_rules = + follow_mouse = 1 + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. + + touchpad { + natural_scroll = false + } +} + +# https://wiki.hyprland.org/Configuring/Variables/#gestures +gestures { + workspace_swipe = false +} + +# Example per-device config +# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more +device { + name = epic-mouse-v1 + sensitivity = -0.5 +} + + +#################### +### KEYBINDINGSS ### +#################### + +# See https://wiki.hyprland.org/Configuring/Keywords/ +$mainMod = SUPER # Sets "Windows" key as main modifier + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mainMod, Q, exec, $terminal +bind = $mainMod, F, exec, $browser +bind = $mainMod, C, killactive, +bind = $mainMod, M, exit, +bind = $mainMod, E, exec, $fileManager +bind = $mainMod, V, togglefloating, +bind = $mainMod, R, exec, $menu +bind = $mainMod, Z, fullscreen +bind = $mainMod, P, pseudo, # dwindle +# bind = $mainMod, J, togglesplit, # dwindle + +# Move focus with mainMod + arrow keys +bind = $mainMod, H, movefocus, l +bind = $mainMod, L, movefocus, r +bind = $mainMod, K, movefocus, u +bind = $mainMod, J, movefocus, d + +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +$browser = firefox +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 +bind = $mainMod SHIFT, 0, movetoworkspace, 10 + +# Example special workspace (scratchpad) +bind = $mainMod, S, togglespecialworkspace, magic +bind = $mainMod SHIFT, S, movetoworkspace, special:magic + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + + +############################## +### WINDOWS AND WORKSPACES ### +############################## + +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more +# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ + +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ + +windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. From f7ee8c346c99d3eafea0aef4154f54207ca08187 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 27 Aug 2024 21:52:31 +0200 Subject: [PATCH 090/280] Fix nvim dependency --- .config/nvim/lazy-lock.json | 4 +--- .config/nvim/lua/plugins/lsp.lua | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 6838f07..2b1ee2b 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -18,7 +18,6 @@ "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "gh.nvim": { "branch": "main", "commit": "ebbaac254ef7dd6f85b439825fbce82d0dc84515" }, "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, "gitsigns.nvim": { "branch": "main", "commit": "f074844b60f9e151970fbcdbeb8a2cd52b6ef25a" }, "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, @@ -27,7 +26,6 @@ "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, "lazygit.nvim": { "branch": "main", "commit": "dc56df433bfbf107fee0139e187eb9750878fa84" }, - "litee.nvim": { "branch": "main", "commit": "4efaf373322d9e71eaff31164abb393417cc6f6a" }, "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, @@ -46,7 +44,7 @@ "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, "nvim": { "branch": "main", "commit": "10eda02ea4faa7d1f94e77a3410a4ae91c25c5f5" }, "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, - "nvim-lspconfig": { "branch": "master", "commit": "f95d371c1a274f60392edfd8ea5121b42dca736e" }, + "nvim-lspconfig": { "branch": "master", "commit": "911167921d49cd5c1c9b2436031d0da3945e787f" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-spectre": { "branch": "master", "commit": "9a28f926d3371b7ef02243cbbb653a0478d06e31" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 627baa0..fff51e6 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -151,7 +151,7 @@ return { end, }, { - "nvim-lspconfig", + "neovim/nvim-lspconfig", lazy = false, config = function() local capabilities = require("cmp_nvim_lsp").default_capabilities() From 4a71b84dd1b9aa9025aab66cf1aac3b0278bb931 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 27 Aug 2024 21:53:28 +0200 Subject: [PATCH 091/280] Add nixos config --- nixos/configuration.nix | 197 +++++++++++++++++++++++++++++++ nixos/hardware-configuration.nix | 40 +++++++ 2 files changed, 237 insertions(+) create mode 100644 nixos/configuration.nix create mode 100644 nixos/hardware-configuration.nix diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..e27b641 --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,197 @@ + # Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # console.font = "Lat2-Terminus16"; + + networking.hostName = "nixos"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Europe/Zurich"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.dani = { + isNormalUser = true; + description = "Dani"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; []; + }; + + fonts.packages = with pkgs; [ + hack-font + hackgen-nf-font + terminus-nerdfont + ]; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + fbterm + eza + + alacritty-themes + + vim + neovim + neovim-remote + mc + alacritty + lazygit + fzf + gh + tmux + lynx + hyprland + lynx + firefox + fastfetch + krusader + git + zsh + btop + wget + ripgrep + ]; + + # environment.systemPackages = [ + # pkgs.nodePackages."@squoosh/cli" + # ]; + + programs.hyprland.enable = true; + programs.zsh.enable = true; + # programs.fbterm.enable = true; + + programs.firefox = { + # enable = true; + # languagePacks = [ "de" "en-US" ]; + + # /* ---- POLICIES ---- */ + # # Check about:policies#documentation for options. + # policies = { + # DisableTelemetry = true; + # DisableFirefoxStudies = true; + # EnableTrackingProtection = { + # Value= true; + # Locked = true; + # Cryptomining = true; + # Fingerprinting = true; + # }; + # DisablePocket = true; + # DisableFirefoxAccounts = true; + # DisableAccounts = true; + # DisableFirefoxScreenshots = true; + # OverrideFirstRunPage = ""; + # OverridePostUpdatePage = ""; + # DontCheckDefaultBrowser = true; + # DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab" + # DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" + # SearchBar = "unified"; # alternative: "separate" + + # /* ---- EXTENSIONS ---- */ + # # Check about:support for extension/add-on ID strings. + # # Valid strings for installation_mode are "allowed", "blocked", + # # "force_installed" and "normal_installed". + # ExtensionSettings = { + # "*".installation_mode = "blocked"; # blocks all addons except the ones specified below + # # uBlock Origin: + # "uBlock0@raymondhill.net" = { + # install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + # installation_mode = "force_installed"; + # }; + # # Privacy Badger: + # "jid1-MnnxcxisBPnSXQ@jetpack" = { + # install_url = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi"; + # installation_mode = "force_installed"; + # }; + # # 1Password: + # "{d634138d-c276-4fc8-924b-40a0ea21d284}" = { + # install_url = "https://addons.mozilla.org/firefox/downloads/latest/1password-x-password-manager/latest.xpi"; + # installation_mode = "force_installed"; + # }; + # "addon@darkreader.org" = { + # install_url = "https://addons.mozilla.org/darkreader/downloads/latest/1password-x-password-manager/latest.xpi"; + # installation_mode = "force_installed"; + # }; + # }; + + # /* ---- PREFERENCES ---- */ + # # Check about:config for options. + # Preferences = { + # "browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; + # "extensions.pocket.enabled" = lock-false; + # "extensions.screenshots.disabled" = lock-true; + # "browser.topsites.contile.enabled" = lock-false; + # "browser.formfill.enable" = lock-false; + # "browser.search.suggest.enabled" = lock-false; + # "browser.search.suggest.enabled.private" = lock-false; + # "browser.urlbar.suggest.searches" = lock-false; + # "browser.urlbar.showSearchSuggestionsFirst" = lock-false; + # "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; + # "browser.newtabpage.activity-stream.feeds.snippets" = lock-false; + # "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; + # "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; + # "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; + # "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; + # "browser.newtabpage.activity-stream.showSponsored" = lock-false; + # "browser.newtabpage.activity-stream.system.showSponsored" = lock-false; + # "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; + # }; + # }; + }; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.05"; # Did you read the comment? +} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..5c8a7f8 --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,40 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/fd27be81-9590-4514-82d7-3312e66a2dce"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/4021-E963"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp6s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} From a34d977aa446ec0b1461b4a55a588a44b8cc5968 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 27 Aug 2024 21:54:12 +0200 Subject: [PATCH 092/280] Add aliases --- .zshrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.zshrc b/.zshrc index 8410157..b8e4031 100644 --- a/.zshrc +++ b/.zshrc @@ -116,6 +116,9 @@ alias calacritty='nvim ~/.config/alacritty/alacritty.toml' alias ctmux='nvim ~/.tmux.conf' alias clazygit='nvim ~/Library/Application\ Support/lazygit/config.yml' alias cneovide='nvim ~/.config/neovide/config.toml' +alias chypr='nvim ~/.config/hypr/hyprland.conf' +alias cnix="sudo nvim /etc/nixos/configuration.nix" +alias nxs="sudo nixos-rebuild switch" alias nv='neovide' alias cgit='nvim ~/.gitconfig' alias kts='tmux kill-server' # [k]ill [t]mux [s]erver From 025ca69fdef33e35153762cb495f385ea78bc4ac Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 27 Aug 2024 22:19:48 +0200 Subject: [PATCH 093/280] Update nixos config --- nixos/configuration.nix | 295 +++++++++++++++++++--------------------- 1 file changed, 141 insertions(+), 154 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index e27b641..30deae0 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,44 +1,36 @@ - # Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - { config, pkgs, ... }: { imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix + [ + ./hardware-configuration.nix ]; - # Bootloader. +# Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - # console.font = "Lat2-Terminus16"; +# console.font = "Lat2-Terminus16"; - networking.hostName = "nixos"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking.hostName = "nixos"; +# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; +# Configure network proxy if necessary +# networking.proxy.default = "http://user:password@proxy:port/"; +# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Enable networking networking.networkmanager.enable = true; - # Set your time zone. time.timeZone = "Europe/Zurich"; - # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; - # Configure keymap in X11 services.xserver.xkb = { layout = "us"; variant = ""; }; - # Define a user account. Don't forget to set a password with ‘passwd’. +# Define a user account. Don't forget to set a password with ‘passwd’. users.users.dani = { isNormalUser = true; description = "Dani"; @@ -48,150 +40,145 @@ fonts.packages = with pkgs; [ hack-font - hackgen-nf-font - terminus-nerdfont + hackgen-nf-font + terminus-nerdfont ]; - # List packages installed in system profile. To search, run: - # $ nix search wget +# $ nix search wget environment.systemPackages = with pkgs; [ fbterm - eza - - alacritty-themes - - vim - neovim - neovim-remote - mc - alacritty - lazygit - fzf - gh - tmux - lynx - hyprland - lynx - firefox - fastfetch - krusader - git - zsh - btop - wget - ripgrep - ]; - - # environment.systemPackages = [ - # pkgs.nodePackages."@squoosh/cli" - # ]; + eza + + vim + neovim + neovim-remote + mc + alacritty + lazygit + fzf + gh + tmux + lynx + hyprland + lynx + firefox + fastfetch + krusader + git + zsh + btop + wget + ripgrep + ]; programs.hyprland.enable = true; programs.zsh.enable = true; - # programs.fbterm.enable = true; - - programs.firefox = { - # enable = true; - # languagePacks = [ "de" "en-US" ]; - - # /* ---- POLICIES ---- */ - # # Check about:policies#documentation for options. - # policies = { - # DisableTelemetry = true; - # DisableFirefoxStudies = true; - # EnableTrackingProtection = { - # Value= true; - # Locked = true; - # Cryptomining = true; - # Fingerprinting = true; - # }; - # DisablePocket = true; - # DisableFirefoxAccounts = true; - # DisableAccounts = true; - # DisableFirefoxScreenshots = true; - # OverrideFirstRunPage = ""; - # OverridePostUpdatePage = ""; - # DontCheckDefaultBrowser = true; - # DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab" - # DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" - # SearchBar = "unified"; # alternative: "separate" - - # /* ---- EXTENSIONS ---- */ - # # Check about:support for extension/add-on ID strings. - # # Valid strings for installation_mode are "allowed", "blocked", - # # "force_installed" and "normal_installed". - # ExtensionSettings = { - # "*".installation_mode = "blocked"; # blocks all addons except the ones specified below - # # uBlock Origin: - # "uBlock0@raymondhill.net" = { - # install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; - # installation_mode = "force_installed"; - # }; - # # Privacy Badger: - # "jid1-MnnxcxisBPnSXQ@jetpack" = { - # install_url = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi"; - # installation_mode = "force_installed"; - # }; - # # 1Password: - # "{d634138d-c276-4fc8-924b-40a0ea21d284}" = { - # install_url = "https://addons.mozilla.org/firefox/downloads/latest/1password-x-password-manager/latest.xpi"; - # installation_mode = "force_installed"; - # }; - # "addon@darkreader.org" = { - # install_url = "https://addons.mozilla.org/darkreader/downloads/latest/1password-x-password-manager/latest.xpi"; - # installation_mode = "force_installed"; - # }; - # }; - - # /* ---- PREFERENCES ---- */ - # # Check about:config for options. - # Preferences = { - # "browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; - # "extensions.pocket.enabled" = lock-false; - # "extensions.screenshots.disabled" = lock-true; - # "browser.topsites.contile.enabled" = lock-false; - # "browser.formfill.enable" = lock-false; - # "browser.search.suggest.enabled" = lock-false; - # "browser.search.suggest.enabled.private" = lock-false; - # "browser.urlbar.suggest.searches" = lock-false; - # "browser.urlbar.showSearchSuggestionsFirst" = lock-false; - # "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; - # "browser.newtabpage.activity-stream.feeds.snippets" = lock-false; - # "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; - # "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; - # "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; - # "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; - # "browser.newtabpage.activity-stream.showSponsored" = lock-false; - # "browser.newtabpage.activity-stream.system.showSponsored" = lock-false; - # "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; - # }; - # }; +# programs.fbterm.enable = true; + + programs.firefox = { + enable = true; + languagePacks = [ "de" "en-US" ]; + + # profiles = { + # myProfile = { + # settings = { + # extensions.activeThemeID = "4ae94ae4-df44-487a-bb8d-cdf0cb324144"; + # }; + # }; + # }; + + /* ---- POLICIES ---- */ +# Check about:policies#documentation for options. + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + EnableTrackingProtection = { + Value= true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DisableFirefoxScreenshots = true; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + DontCheckDefaultBrowser = true; + DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab" + DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" + SearchBar = "unified"; # alternative: "separate" + + /* ---- EXTENSIONS ---- */ + ExtensionSettings = { + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + }; + "jid1-MnnxcxisBPnSXQ@jetpack" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi"; + installation_mode = "force_installed"; + }; + "{d634138d-c276-4fc8-924b-40a0ea21d284}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/1password-x-password-manager/latest.xpi"; + installation_mode = "force_installed"; + }; + "addon@darkreader.org" = { + install_url = "https://addons.mozilla.org/darkreader/downloads/latest/1password-x-password-manager/latest.xpi"; + installation_mode = "force_installed"; + }; + }; + + /* ---- PREFERENCES ---- */ +# Check about:config for options. + Preferences = { + extensions.activeThemeId = "4ae94ae4-df44-487a-bb8d-cdf0cb324144"; +# "browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; +# "extensions.pocket.enabled" = lock-false; +# "extensions.screenshots.disabled" = lock-true; +# "browser.topsites.contile.enabled" = lock-false; +# "browser.formfill.enable" = lock-false; +# "browser.search.suggest.enabled" = lock-false; +# "browser.search.suggest.enabled.private" = lock-false; +# "browser.urlbar.suggest.searches" = lock-false; +# "browser.urlbar.showSearchSuggestionsFirst" = lock-false; +# "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; +# "browser.newtabpage.activity-stream.feeds.snippets" = lock-false; +# "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; +# "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; +# "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; +# "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; +# "browser.newtabpage.activity-stream.showSponsored" = lock-false; +# "browser.newtabpage.activity-stream.system.showSponsored" = lock-false; +# "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; + }; + }; }; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). +# Some programs need SUID wrappers, can be configured further or are +# started in user sessions. +# programs.mtr.enable = true; +# programs.gnupg.agent = { +# enable = true; +# enableSSHSupport = true; +# }; + +# List services that you want to enable: + +# Enable the OpenSSH daemon. +# services.openssh.enable = true; + +# Open ports in the firewall. +# networking.firewall.allowedTCPPorts = [ ... ]; +# networking.firewall.allowedUDPPorts = [ ... ]; +# Or disable the firewall altogether. +# networking.firewall.enable = false; + +# This value determines the NixOS release from which the default +# settings for stateful data, like file locations and database versions +# on your system were taken. It‘s perfectly fine and recommended to leave +# this value at the release version of the first install of this system. +# Before changing this value read the documentation for this option +# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "24.05"; # Did you read the comment? } From ef1f121d9b65ada3daa7ec35483412c9784b710d Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 27 Aug 2024 22:48:09 +0200 Subject: [PATCH 094/280] Add hyprland window swapping --- .config/hypr/hyprland.conf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 2852646..ebc9c0e 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -196,12 +196,18 @@ bind = $mainMod, Z, fullscreen bind = $mainMod, P, pseudo, # dwindle # bind = $mainMod, J, togglesplit, # dwindle -# Move focus with mainMod + arrow keys +# Move focus with mainMod + hjkl bind = $mainMod, H, movefocus, l bind = $mainMod, L, movefocus, r bind = $mainMod, K, movefocus, u bind = $mainMod, J, movefocus, d +# Swap windows with mainMod + hjkl +bind = $mainMod SHIFT, H, swapwindow, l +bind = $mainMod SHIFT, L, swapwindow, r +bind = $mainMod SHIFT, K, swapwindow, u +bind = $mainMod SHIFT, J, swapwindow, d + # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 From 525f67e8ba85bf8514683afeeed30d8d860e9c92 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 27 Aug 2024 22:49:47 +0200 Subject: [PATCH 095/280] Update nixos config --- nixos/configuration.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 30deae0..f283508 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,10 +1,11 @@ { config, pkgs, ... }: { - imports = - [ + imports = [ ./hardware-configuration.nix - ]; + ]; + + nixpkgs.config.allowUnfree = true; # Bootloader. boot.loader.systemd-boot.enable = true; @@ -61,18 +62,22 @@ lynx hyprland lynx - firefox fastfetch - krusader git zsh btop wget ripgrep + + firefox + kdePackages.dolphin + discord + krusader ]; - programs.hyprland.enable = true; programs.zsh.enable = true; + programs.hyprland.enable = true; + # programs.dolphin.enable = true; # programs.fbterm.enable = true; programs.firefox = { @@ -105,7 +110,7 @@ OverrideFirstRunPage = ""; OverridePostUpdatePage = ""; DontCheckDefaultBrowser = true; - DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab" + DisplayBookmarksToolbar = "newtab"; # alternatives: "always" or "newtab" DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" SearchBar = "unified"; # alternative: "separate" From bb51c79627480047e52b016518a2ed5f6b53a817 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 27 Aug 2024 22:54:04 +0200 Subject: [PATCH 096/280] Update symlinks --- create_symlinks.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/create_symlinks.sh b/create_symlinks.sh index 0195423..d026da0 100755 --- a/create_symlinks.sh +++ b/create_symlinks.sh @@ -14,3 +14,9 @@ function create_symlink() { } create_symlink ~/dotfiles/.zshrc ~/.zshrc +create_symlink ~/dotfiles/.config/nvim ~/.config/nvim +create_symlink ~/dotfiles/.config/alacritty ~/.config/alacritty +create_symlink ~/dotfiles/.tmux.conf ~/.tmux.conf +create_symlink ~/dotfiles/my-status-bar.tmux ~/my-status-bar.tmux +create_symlink ~/dotfiles/.gitignore ~/.gitignore +create_symlink ~/dotfiles/scripts ~/scripts From 9dc027dd83a34fc891c7826e6d054a95013bff5b Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 27 Aug 2024 22:54:10 +0200 Subject: [PATCH 097/280] Add bun --- nixos/configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index f283508..37a3537 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -50,6 +50,8 @@ fbterm eza + bun + vim neovim neovim-remote From a9e804ae001d3e1e6886e8c34e1b2018ea7e1e63 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Fri, 30 Aug 2024 22:11:31 +0200 Subject: [PATCH 098/280] Update cfg --- .config/hypr/hyprland.conf | 4 ++++ nixos/configuration.nix | 27 ++++++++++++++++----------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index ebc9c0e..062a89c 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -196,6 +196,8 @@ bind = $mainMod, Z, fullscreen bind = $mainMod, P, pseudo, # dwindle # bind = $mainMod, J, togglesplit, # dwindle +bind = $mainMod, t, togglegroup + # Move focus with mainMod + hjkl bind = $mainMod, H, movefocus, l bind = $mainMod, L, movefocus, r @@ -245,6 +247,8 @@ bind = $mainMod, mouse_up, workspace, e-1 bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow +# Activate app switcher +bind = $mainMod, R, exec, bemenu-run ############################## ### WINDOWS AND WORKSPACES ### diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 37a3537..4713625 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -47,7 +47,13 @@ # $ nix search wget environment.systemPackages = with pkgs; [ - fbterm + krusader + bemenu + nnn + + lz4 + + fbterm eza bun @@ -74,25 +80,24 @@ firefox kdePackages.dolphin discord - krusader ]; programs.zsh.enable = true; programs.hyprland.enable = true; - # programs.dolphin.enable = true; +# programs.dolphin.enable = true; # programs.fbterm.enable = true; programs.firefox = { enable = true; languagePacks = [ "de" "en-US" ]; - # profiles = { - # myProfile = { - # settings = { - # extensions.activeThemeID = "4ae94ae4-df44-487a-bb8d-cdf0cb324144"; - # }; - # }; - # }; +# profiles = { +# myProfile = { +# settings = { +# extensions.activeThemeID = "4ae94ae4-df44-487a-bb8d-cdf0cb324144"; +# }; +# }; +# }; /* ---- POLICIES ---- */ # Check about:policies#documentation for options. @@ -139,7 +144,7 @@ /* ---- PREFERENCES ---- */ # Check about:config for options. Preferences = { - extensions.activeThemeId = "4ae94ae4-df44-487a-bb8d-cdf0cb324144"; + extensions.activeThemeId = "4ae94ae4-df44-487a-bb8d-cdf0cb324144"; # "browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; # "extensions.pocket.enabled" = lock-false; # "extensions.screenshots.disabled" = lock-true; From 15106f0ccdff1fd042ffed35df0263e87a05e8d1 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Fri, 30 Aug 2024 22:11:49 +0200 Subject: [PATCH 099/280] Update dotfiles for linux --- .config/alacritty/alacritty.toml | 28 ++++++++++++++-------------- .config/nvim/init.lua | 4 ++-- .zshrc | 22 +++++++++++----------- change_theme.sh | 4 ++-- create_linux_symlinx.sh | 2 ++ scripts/lynx-google.sh | 1 + 6 files changed, 32 insertions(+), 29 deletions(-) create mode 100644 create_linux_symlinx.sh create mode 100644 scripts/lynx-google.sh diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index c903929..3a1687b 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -11,7 +11,7 @@ offset.x = 0 offset.y = 0 [font.normal] -family = "JetBrainsMono Nerd Font" +family = "Monospace" [[keyboard.bindings]] action = "CreateNewWindow" @@ -63,20 +63,20 @@ action = "DecreaseFontSize" key = "Minus" mods = "Command" -[[keyboard.bindings]] -key = "T" -mods = "Command" -command = { program = "/opt/homebrew/bin/tmux", args = ["new-window", "/bin/zsh"] } - -[[keyboard.bindings]] -key = "W" -mods = "Command" -command = { program = "/opt/homebrew/bin/tmux", args = ["kill-pane"] } - +# [[keyboard.bindings]] +# key = "T" +# mods = "Command" +# command = { program = "/opt/homebrew/bin/tmux", args = ["new-window", "/bin/zsh"] } +# +# [[keyboard.bindings]] +# key = "W" +# mods = "Command" +# command = { program = "/opt/homebrew/bin/tmux", args = ["kill-pane"] } +# [shell] -args = ["-l", "-c", "session_name=$(tmux ls | grep -v \"(attached)\" | head -n 1 | cut -d: -f1); [ -n \"$session_name\" ] && tmux attach -t \"$session_name\" || tmux new-session"] -program = "/bin/zsh" - +# args = ["-l", "-c", "session_name=$(tmux ls | grep -v \"(attached)\" | head -n 1 | cut -d: -f1); [ -n \"$session_name\" ] && tmux attach -t \"$session_name\" || tmux new-session"] +program = "/run/current-system/sw/bin/zsh" +# [window] decorations = "buttonless" decorations_theme_variant = "None" diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index b396f2d..4c40de3 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -92,8 +92,8 @@ vim.keymap.set("n", "L", "Lazy") vim.g.sonokai_better_performance = 1 vim.g.sonokai_style = "andromeda" -vim.cmd.colorscheme("solarized") -vim.opt.background = "light" +vim.cmd.colorscheme("elflord") +vim.opt.background = "dark" -- vim.api.nvim_command('autocmd VimEnter * lua require("persistence").load()') diff --git a/.zshrc b/.zshrc index b8e4031..05c3b7c 100644 --- a/.zshrc +++ b/.zshrc @@ -7,9 +7,9 @@ if [ "$TERM_PROGRAM" = "WarpTerminal" ] && [ "$TERMINAL_EMULATOR" != "JetBrains- fi PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH" -export PATH="$HOME/.asdf/installs/ruby/latest/bin:$PATH" -export PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH" -export PATH="$HOME/.tmux/plugins/tmuxifier/bin:$PATH" +# export PATH="$HOME/.asdf/installs/ruby/latest/bin:$PATH" +# export PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH" +# export PATH="$HOME/.tmux/plugins/tmuxifier/bin:$PATH" export PATH="$HOME/.jenv/bin:$PATH" export PATH="~/renuo/personal/rails-generator/bin:$PATH" export PATH="~/.asdf/shims/:$PATH" @@ -23,19 +23,19 @@ export EDITOR="nvim" unset LIBRARY_PATH unset LDFLAGS -source $HOMEBREW_PREFIX/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh -source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc" -source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc" +# source $HOMEBREW_PREFIX/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh +# source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc" +# source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc" [ -s "/Users/dani/.bun/_bun" ] && source "/Users/dani/.bun/_bun" -source /opt/homebrew/opt/autojump/etc/autojump.sh -source "$HOME/.cargo/env" -source /opt/homebrew/opt/asdf/libexec/asdf.sh +# source /opt/homebrew/opt/autojump/etc/autojump.sh +# source "$HOME/.cargo/env" +# source /opt/homebrew/opt/asdf/libexec/asdf.sh eval "$(fzf --zsh)" bindkey -r "^t" # Unbind fzf keybinding -eval "$(tmuxifier init -)" +# eval "$(tmuxifier init -)" alias ls="eza" alias l="eza -lah" @@ -117,7 +117,7 @@ alias ctmux='nvim ~/.tmux.conf' alias clazygit='nvim ~/Library/Application\ Support/lazygit/config.yml' alias cneovide='nvim ~/.config/neovide/config.toml' alias chypr='nvim ~/.config/hypr/hyprland.conf' -alias cnix="sudo nvim /etc/nixos/configuration.nix" +alias cnix="nvim /etc/nixos/configuration.nix" alias nxs="sudo nixos-rebuild switch" alias nv='neovide' alias cgit='nvim ~/.gitconfig' diff --git a/change_theme.sh b/change_theme.sh index b6fa2ab..07326a6 100755 --- a/change_theme.sh +++ b/change_theme.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -ALACRITTY_DARK_THEME="/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Campbell.toml" -ALACRITTY_LIGHT_THEME="/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Solarized-Light.toml" +ALACRITTY_DARK_THEME="~/alacritty-theme/themes/campbell.toml" +ALACRITTY_LIGHT_THEME="~/alacritty-theme/themes/solarized_light.toml" ALACRITTY_CONFIG_FILE="$HOME/.config/alacritty/alacritty.toml" # Check if ALACRITTY_CONFIG_FILE exists diff --git a/create_linux_symlinx.sh b/create_linux_symlinx.sh new file mode 100644 index 0000000..371197d --- /dev/null +++ b/create_linux_symlinx.sh @@ -0,0 +1,2 @@ +#/bin/zsh + diff --git a/scripts/lynx-google.sh b/scripts/lynx-google.sh new file mode 100644 index 0000000..91418d5 --- /dev/null +++ b/scripts/lynx-google.sh @@ -0,0 +1 @@ +url="https://www.google.com/search?q=" From 1d25d02294cc3f8598beaecfddf1761bcfbac0ea Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 2 Sep 2024 17:19:22 +0200 Subject: [PATCH 100/280] Update some plugins (probably break a lot of stuff) --- .config/nvim/init.lua | 33 +- .config/nvim/lazy-lock.json | 14 +- .config/nvim/lua/languages/rails.lua | 33 +- .config/nvim/lua/plugins/coding.lua | 15 +- .config/nvim/lua/plugins/editor.lua | 2 +- .config/nvim/lua/plugins/git.lua | 301 +++++++---- .config/nvim/lua/plugins/lsp.lua | 721 ++++++++++++++------------- 7 files changed, 615 insertions(+), 504 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index b396f2d..907e75a 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -21,7 +21,6 @@ vim.opt.laststatus = 3 vim.keymap.set("n", "qq", "wqa") vim.keymap.set("n", "q!", "qa!") - vim.keymap.set("n", "/", "noh") vim.keymap.set("n", "n", "nzz") @@ -59,23 +58,16 @@ end vim.opt.rtp:prepend(lazypath) + local plugins = { - { "sainnhe/sonokai", priority = 1000 }, - { "iruzo/matrix-nvim", priority = 1000 }, - { "nyoom-engineering/nyoom.nvim", priority = 1000 }, - { "ray-x/aurora", priority = 1000 }, - { "shaunsingh/solarized.nvim", priority = 1000 }, - { - "catppuccin/nvim", - priority = 1000, - config = function() - require("catppuccin").setup({ - flavour = "mocha", - transparent_background = true, - show_end_of_buffer = true, - }) - end, - }, + -- { "sainnhe/sonokai", lazy = true, priority = 1000 }, + -- { "iruzo/matrix-nvim", lazy = true, priority = 1000 }, + -- { "nyoom-engineering/nyoom.nvim", lazy = true, priority = 1000 }, + -- { "folke/tokyonight.nvim", lazy = false, priority = 1000 }, + -- { "ray-x/aurora", lazy = true, priority = 1000 }, + -- { "shaunsingh/solarized.nvim", lazy = false, priority = 1000 }, + { "ishan9299/nvim-solarized-lua", name = "moonfly", lazy = false, priority = 1000 }, + { "bluz71/vim-moonfly-colors", lazy = false, priority = 1000 }, { import = "plugins" }, { import = "languages" }, } @@ -90,10 +82,7 @@ require("lazy").setup(plugins, opts) vim.keymap.set("n", "L", "Lazy") -vim.g.sonokai_better_performance = 1 -vim.g.sonokai_style = "andromeda" -vim.cmd.colorscheme("solarized") -vim.opt.background = "light" - +vim.cmd.colorscheme("moonfly") +vim.opt.background = "dark" -- vim.api.nvim_command('autocmd VimEnter * lua require("persistence").load()') diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 6838f07..15aedb1 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -3,7 +3,6 @@ "CopilotChat.nvim": { "branch": "canary", "commit": "f20a0425b33c1704133bdef5ec10c4e94f6efdc6" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, - "aurora": { "branch": "master", "commit": "af3e80a8ca4f9a6e3bd40e2ba12073c1d0041a81" }, "autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "bufexplorer": { "branch": "master", "commit": "2308e87960c05bd8da7bbf62c903e1f42d6cc9b9" }, @@ -18,7 +17,6 @@ "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "gh.nvim": { "branch": "main", "commit": "ebbaac254ef7dd6f85b439825fbce82d0dc84515" }, "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, "gitsigns.nvim": { "branch": "main", "commit": "f074844b60f9e151970fbcdbeb8a2cd52b6ef25a" }, "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, @@ -27,15 +25,14 @@ "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, "lazygit.nvim": { "branch": "main", "commit": "dc56df433bfbf107fee0139e187eb9750878fa84" }, - "litee.nvim": { "branch": "main", "commit": "4efaf373322d9e71eaff31164abb393417cc6f6a" }, "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "ba9c2f0b93deb48d0a99ae0e8d8dd36f7cc286d6" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "matrix-nvim": { "branch": "main", "commit": "5fafe6b440d08c1070e3c4c4cb9d648436d5d867" }, "mini.ai": { "branch": "main", "commit": "45587078f323eaf41b9f701bbc04f8d1ab008979" }, "mini.indentscope": { "branch": "main", "commit": "f0d7faa064c892b96997810afcddfadc3f2a15b3" }, + "moonfly": { "branch": "master", "commit": "d69a263c97cbc765ca442d682b3283aefd61d4ac" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, "neoconf.nvim": { "branch": "main", "commit": "08ebe382a9db91e7f5d3991156b8fab7afbbe9b2" }, "neogit": { "branch": "master", "commit": "2b74a777b963dfdeeabfabf84d5ba611666adab4" }, @@ -44,16 +41,15 @@ "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, "none-ls.nvim": { "branch": "main", "commit": "a8594ef3dabb484adabc0ebbf5800be1b807c9e7" }, "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, - "nvim": { "branch": "main", "commit": "10eda02ea4faa7d1f94e77a3410a4ae91c25c5f5" }, "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, "nvim-lspconfig": { "branch": "master", "commit": "f95d371c1a274f60392edfd8ea5121b42dca736e" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-spectre": { "branch": "master", "commit": "9a28f926d3371b7ef02243cbbb653a0478d06e31" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, "nvim-treesitter": { "branch": "master", "commit": "e265fec94c7dc0c8c64cb86820ff5ad3ee135c7d" }, + "nvim-ts-autotag": { "branch": "main", "commit": "0cb76eea80e9c73b88880f0ca78fbd04c5bdcac7" }, "nvim-web-devicons": { "branch": "master", "commit": "e612de3d3a41a6b7be47f51e956dddabcbf419d9" }, "nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }, - "nyoom.nvim": { "branch": "main", "commit": "f808500883ffc552b53a421139cc1915955759b7" }, "oil.nvim": { "branch": "master", "commit": "71c972fbd218723a3c15afcb70421f67340f5a6d" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, "other.nvim": { "branch": "main", "commit": "63f587dde62149bd2ed3e31edceb49d5c4097a26" }, @@ -65,8 +61,6 @@ "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "refactoring.nvim": { "branch": "master", "commit": "ac70bb714f30886e79461869871174a1c1d52058" }, "rustaceanvim": { "branch": "master", "commit": "047f9c9d8cd2861745eb9de6c1570ee0875aa795" }, - "solarized.nvim": { "branch": "master", "commit": "fe02ed49cc017cc93657bd6306a2624394611c69" }, - "sonokai": { "branch": "master", "commit": "598d29bef1cdea1eef4749c96824af0ae2f9350c" }, "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, "telescope-live-grep-args.nvim": { "branch": "master", "commit": "8ad632f793fd437865f99af5684f78300dac93fb" }, "telescope-media-files.nvim": { "branch": "master", "commit": "0826c7a730bc4d36068f7c85cf4c5b3fd9fb570a" }, @@ -81,6 +75,7 @@ "vim-fugitive": { "branch": "master", "commit": "0444df68cd1cdabc7453d6bd84099458327e5513" }, "vim-grammarous": { "branch": "master", "commit": "db46357465ce587d5325e816235b5e92415f8c05" }, "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, + "vim-moonfly-colors": { "branch": "master", "commit": "4f7d18cb471ede7407dd966c7563868cae7f4f99" }, "vim-rails": { "branch": "master", "commit": "2fba7907f585819a8653f0bc7dd7f437a822d9c6" }, "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, "vim-slim": { "branch": "master", "commit": "a0a57f75f20a03d5fa798484743e98f4af623926" }, @@ -88,5 +83,6 @@ "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }, "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" }, "vimtex": { "branch": "master", "commit": "5ac62e0315c6f54f53a7d6da7c485cf8e9cf7240" }, - "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" } + "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" }, + "yaml-revealer": { "branch": "master", "commit": "0476c6ead1111f8dbe993be76a75c867ef76ea6b" } } diff --git a/.config/nvim/lua/languages/rails.lua b/.config/nvim/lua/languages/rails.lua index b1c3ee2..b0e0ac2 100644 --- a/.config/nvim/lua/languages/rails.lua +++ b/.config/nvim/lua/languages/rails.lua @@ -1,5 +1,5 @@ return { - { "tpope/vim-rails", event = "VeryLazy" }, + { "tpope/vim-rails", lazy = false }, { "sato-s/telescope-rails.nvim", dependencies = { "nvim-telescope/telescope.nvim" }, @@ -12,8 +12,39 @@ return { { "rl", "Telescope rails libs", desc = "Telescope rails libs" }, }, }, + { + "Einenlum/yaml-revealer", + ft = "yaml" + }, + { + "windwp/nvim-ts-autotag", + lazy = false, + config = function() + + require('nvim-ts-autotag').setup({ + aliases = { + ["erb"] = "html" + }, + opts = { + -- Defaults + enable_close = true, -- Auto close tags + enable_rename = true, -- Auto rename pairs of tags + enable_close_on_slash = false -- Auto close on trailing ll", ":Other", desc = "Other" }, { "ltn", ":OtherTabNew", desc = "OtherTabNew" }, diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index 3a44618..eaa0706 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -2,23 +2,16 @@ return { { "kylechui/nvim-surround", version = "*", - event = "VeryLazy", - config = function() - require("nvim-surround").setup({}) - end, + lazy = false }, { "m4xshen/autoclose.nvim", event = "VeryLazy", - config = function() - require("autoclose").setup() - end, }, { "nat-418/boole.nvim", event = "VeryLazy", - config = function() - require("boole").setup({ + opts = { mappings = { increment = "", decrement = "", @@ -37,12 +30,10 @@ return { allow_caps_additions = { { "enable", "disable" }, }, - }) - end, + } }, { "numToStr/Comment.nvim", - opts = {}, event = "VeryLazy" }, { diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 5e69e04..8d3d827 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -4,7 +4,7 @@ return { { "folke/neoconf.nvim", cmd = "Neoconf" }, { "nvimdev/dashboard-nvim", - event = "VimEnter", + -- event = "VimEnter", config = function() require("dashboard").setup({ theme = "hyper", diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index dc7a1b9..62015bb 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -1,114 +1,197 @@ return { - { - "kdheepak/lazygit.nvim", - dependencies = { - "nvim-telescope/telescope.nvim", - }, - cmd = { - "LazyGit", - "LazyGitConfig", - "LazyGitCurrentFile", - "LazyGitFilter", - "LazyGitFilterCurrentFile", - }, - keys = { - { "ng", "LazyGit", desc = "LazyGit" } - }, - config = function() - require("telescope").load_extension("lazygit") - vim.g.lazygit_floating_window_winblend = 0 - vim.g.lazygit_floating_window_scaling_factor = 1 - vim.g.lazygit_floating_window_use_plenary = 0 - vim.g.lazygit_use_neovim_remote = 1 - vim.g.lazygit_config_file_path = '' - end - }, - { - "tpope/vim-fugitive", - cmd = { "Git" } - }, - { - "lewis6991/gitsigns.nvim", - lazy = false, - config = function() - require('gitsigns').setup({ - numhl = true, - current_line_blame_opts = { - virt_text_pos = "right_align", - delay = 0, - }, - show_deleted = false, - update_debounce = 100, - on_attach = function(bufnr) - local gitsigns = require('gitsigns') + { + "kdheepak/lazygit.nvim", + dependencies = { + "nvim-telescope/telescope.nvim", + }, + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, + keys = { + { "ng", "LazyGit", desc = "LazyGit" }, + }, + config = function() + require("telescope").load_extension("lazygit") + vim.g.lazygit_floating_window_winblend = 0 + vim.g.lazygit_floating_window_scaling_factor = 1 + vim.g.lazygit_floating_window_use_plenary = 0 + vim.g.lazygit_use_neovim_remote = 1 + vim.g.lazygit_config_file_path = "" + end, + }, + { + "tpope/vim-fugitive", + cmd = { "Git" }, + }, + { + "lewis6991/gitsigns.nvim", + lazy = false, + opts = { + numhl = true, + current_line_blame_opts = { + virt_text_pos = "right_align", + delay = 0, + }, + show_deleted = false, + update_debounce = 100, + on_attach = function(bufnr) + local gitsigns = require("gitsigns") - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end - -- Navigation - map('n', ']c', function() - if vim.wo.diff then - vim.cmd.normal({ ']c', bang = true }) - else - gitsigns.nav_hunk('next') - end - end, { desc = "Next Hunk" }) + -- Navigation + map("n", "]c", function() + if vim.wo.diff then + vim.cmd.normal({ "]c", bang = true }) + else + gitsigns.nav_hunk("next") + end + end, { desc = "Next Hunk" }) - map('n', '[c', function() - if vim.wo.diff then - vim.cmd.normal({ '[c', bang = true }) - else - gitsigns.nav_hunk('prev') - end - end, { desc = "Previous Hunk" }) - end - }) - end, - keys = { - { "hs", function() require("gitsigns").stage_hunk { vim.fn.line("."), vim.fn.line("v") } end, desc = "stage_hunk", mode = "v" }, - { "hr", function() require("gitsigns").reset_hunk { vim.fn.line("."), vim.fn.line("v") } end, desc = "reset_hunk", mode = "v" }, - { "ih", ":Gitsigns select_hunk", mode = { "o", "x" } }, - { "hb", function() require("gitsigns").blame_line { full = true } end, desc = "blame_line" }, - { "hD", function() require("gitsigns").diffthis("~") end, desc = "diffthis" }, - { "hs", function() require("gitsigns").stage_hunk() end, desc = "stage_hunk" }, - { "hr", function() require("gitsigns").reset_hunk() end, desc = "reset_hunk" }, - { "hS", function() require("gitsigns").stage_buffer() end, desc = "stage_buffer" }, - { "hu", function() require("gitsigns").undo_stage_hunk() end, desc = "undo_stage_hunk" }, - { "hR", function() require("gitsigns").reset_buffer() end, desc = "reset_buffer" }, - { "hp", function() require("gitsigns").preview_hunk() end, desc = "preview_hunk" }, - { "tb", function() require("gitsigns").toggle_current_line_blame() end, desc = "toggle_current_line_blame" }, - { "hd", function() require("gitsigns").diffthis() end, desc = "diffthis" }, - { "td", function() require("gitsigns").toggle_deleted() end, desc = "toggle_deleted" }, - } - }, - { - "NeogitOrg/neogit", - dependencies = { - "nvim-lua/plenary.nvim", - "sindrets/diffview.nvim", - "nvim-telescope/telescope.nvim", - }, - config = true, - keys = { - { "gg", "Neogit", desc = "Neogit" }, - }, - }, - { "junkblocker/git-time-lapse", commands = { "GitTimeLapse" }, lazy = false}, - -- { - -- "ldelossa/gh.nvim", - -- dependencies = { - -- { - -- "ldelossa/litee.nvim", - -- config = function() - -- require("litee.lib").setup() - -- end, - -- }, - -- }, - -- config = function() - -- require("litee.gh").setup() - -- end, - -- } + map("n", "[c", function() + if vim.wo.diff then + vim.cmd.normal({ "[c", bang = true }) + else + gitsigns.nav_hunk("prev") + end + end, { desc = "Previous Hunk" }) + end, + }, + keys = { + { + "hs", + function() + require("gitsigns").stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) + end, + desc = "stage_hunk", + mode = "v", + }, + { + "hr", + function() + require("gitsigns").reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) + end, + desc = "reset_hunk", + mode = "v", + }, + { + "ih", + ":Gitsigns select_hunk", + mode = { "o", "x" }, + }, + { + "hb", + function() + require("gitsigns").blame_line({ full = true }) + end, + desc = "blame_line", + }, + { + "hD", + function() + require("gitsigns").diffthis("~") + end, + desc = "diffthis", + }, + { + "hs", + function() + require("gitsigns").stage_hunk() + end, + desc = "stage_hunk", + }, + { + "hr", + function() + require("gitsigns").reset_hunk() + end, + desc = "reset_hunk", + }, + { + "hS", + function() + require("gitsigns").stage_buffer() + end, + desc = "stage_buffer", + }, + { + "hu", + function() + require("gitsigns").undo_stage_hunk() + end, + desc = "undo_stage_hunk", + }, + { + "hR", + function() + require("gitsigns").reset_buffer() + end, + desc = "reset_buffer", + }, + { + "hp", + function() + require("gitsigns").preview_hunk() + end, + desc = "preview_hunk", + }, + { + "tb", + function() + require("gitsigns").toggle_current_line_blame() + end, + desc = "toggle_current_line_blame", + }, + { + "hd", + function() + require("gitsigns").diffthis() + end, + desc = "diffthis", + }, + { + "td", + function() + require("gitsigns").toggle_deleted() + end, + desc = "toggle_deleted", + }, + }, + }, + { + "NeogitOrg/neogit", + lazy = false, + opts = { }, + dependencies = { + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "nvim-telescope/telescope.nvim", + }, + keys = { + { "gg", "Neogit", desc = "Neogit" }, + }, + }, + { "junkblocker/git-time-lapse", commands = { "GitTimeLapse" }, lazy = false }, + -- { + -- "ldelossa/gh.nvim", + -- dependencies = { + -- { + -- "ldelossa/litee.nvim", + -- config = function() + -- require("litee.lib").setup() + -- end, + -- }, + -- }, + -- config = function() + -- require("litee.gh").setup() + -- end, + -- } } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 627baa0..7ae8d28 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,356 +1,377 @@ return { - { - "ThePrimeagen/refactoring.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - opts = {}, - keys = { - { - "rr", - function() - require("refactoring").select_refactor() - end, - desc = "Refactor", - }, - }, - }, - { - "zbirenbaum/copilot.lua", - cmd = "Copilot", - event = "InsertEnter", - config = function() - require("copilot").setup({}) - end, - }, - { - "zbirenbaum/copilot-cmp", - lazy = false, - event = "InsertEnter", - config = function() - require("copilot_cmp").setup() - require("copilot").setup({ - suggestion = { enabled = false }, - panel = { enabled = false }, - }) - end, - }, - { - "CopilotC-Nvim/CopilotChat.nvim", - dependencies = { - { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim - { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper - }, - commands = { - "CopilotChat", - "CopilotChat", - "CopilotChatOpen", - "CopilotChatClose", - "CopilotChatToggle", - "CopilotChatStop", - "CopilotChatReset", - "CopilotChatSave", - "CopilotChatLoad", - "CopilotChatDebugInfo", - "CopilotChatModels", - "CopilotChatExplain", - "CopilotChatReview", - "CopilotChatFix", - "CopilotChatOptimize", - "CopilotChatDocs", - "CopilotChatTests", - "CopilotChatFixDiagnostic", - "CopilotChatCommit", - "CopilotChatCommitStaged", - }, - opts = { - temperature = 0.3, - mappings = { - reset = { - normal = "", - insert = "", - }, - complete = { - detail = "Use @ or / for options.", - insert = "", - }, - close = { - normal = "q", - insert = "", - }, - submit_prompt = { - normal = "", - insert = "", - }, - accept_diff = { - normal = "", - insert = "", - }, - yank_diff = { - normal = "gy", - }, - show_diff = { - normal = "gd", - }, - show_system_prompt = { - normal = "gp", - }, - show_user_selection = { - normal = "gs", - }, - }, - }, - keys = { - { - "ccq", - function() - local input = vim.fn.input("Quick Chat: ") - if input ~= "" then - require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) - end - end, - desc = "CopilotChat - Quick chat", - }, - { - "cch", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.help_actions()) - end, - desc = "CopilotChat - Help actions", - }, - -- Show prompts actions with telescope - { - "ccp", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) - end, - desc = "CopilotChat - Prompt actions", - }, - }, - }, - { - "williamboman/mason.nvim", - lazy = false, - keys = { - { "m", "Mason" }, - }, - config = function() - require("mason").setup() - end, - }, - { - "williamboman/mason-lspconfig.nvim", - lazy = false, - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "tsserver", "solargraph" }, - }) - end, - }, - { - "nvim-lspconfig", - lazy = false, - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() - -- https://www.mitchellhanberg.com/modern-format-on-save-in-neovim/ - -- vim.api.nvim_create_autocmd("LspAttach", { - -- group = vim.api.nvim_create_augroup("lsp", { clear = true }), - -- callback = function(args) - -- vim.api.nvim_create_autocmd("BufWritePre", { - -- buffer = args.buf, - -- callback = function() - -- vim.lsp.buf.format({ async = false, id = args.data.client_id }) - -- end, - -- }) - -- end, - -- }) + { + "ThePrimeagen/refactoring.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + keys = { + { + "rr", + function() + require("refactoring").select_refactor() + end, + desc = "Refactor", + }, + }, + }, + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + }, + { + "zbirenbaum/copilot-cmp", + lazy = false, + event = "InsertEnter", + config = function() + require("copilot_cmp").setup() + require("copilot").setup({ + suggestion = { enabled = false }, + panel = { enabled = false }, + }) + end, + }, + { + "CopilotC-Nvim/CopilotChat.nvim", + lazy = false, + dependencies = { + { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim + { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper + }, + commands = { + "CopilotChat", + "CopilotChat", + "CopilotChatOpen", + "CopilotChatClose", + "CopilotChatToggle", + "CopilotChatStop", + "CopilotChatReset", + "CopilotChatSave", + "CopilotChatLoad", + "CopilotChatDebugInfo", + "CopilotChatModels", + "CopilotChatExplain", + "CopilotChatReview", + "CopilotChatFix", + "CopilotChatOptimize", + "CopilotChatDocs", + "CopilotChatTests", + "CopilotChatFixDiagnostic", + "CopilotChatCommit", + "CopilotChatCommitStaged", + }, + opts = { + temperature = 0.3, + mappings = { + reset = { + normal = "", + insert = "", + }, + complete = { + detail = "Use @ or / for options.", + insert = "", + }, + close = { + normal = "q", + insert = "", + }, + submit_prompt = { + normal = "", + insert = "", + }, + accept_diff = { + normal = "", + insert = "", + }, + yank_diff = { + normal = "gy", + }, + show_diff = { + normal = "gd", + }, + show_system_prompt = { + normal = "gp", + }, + show_user_selection = { + normal = "gs", + }, + }, + }, + keys = { + { + "ccq", + function() + local input = vim.fn.input("Quick Chat: ") + if input ~= "" then + require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) + end + end, + desc = "CopilotChat - Quick chat", + }, + { + "cch", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.help_actions()) + end, + desc = "CopilotChat - Help actions", + }, + -- Show prompts actions with telescope + { + "ccp", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) + end, + desc = "CopilotChat - Prompt actions", + }, + }, + }, + { + "williamboman/mason.nvim", + lazy = false, + keys = { + { "m", "Mason" }, + }, + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + lazy = false, + opts = { + ensure_installed = { "lua_ls", "tsserver", "solargraph" }, + }, + }, + { + "nvim-lspconfig", + lazy = false, + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + -- https://www.mitchellhanberg.com/modern-format-on-save-in-neovim/ + -- vim.api.nvim_create_autocmd("LspAttach", { + -- group = vim.api.nvim_create_augroup("lsp", { clear = true }), + -- callback = function(args) + -- vim.api.nvim_create_autocmd("BufWritePre", { + -- buffer = args.buf, + -- callback = function() + -- vim.lsp.buf.format({ async = false, id = args.data.client_id }) + -- end, + -- }) + -- end, + -- }) - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup({ capabilities = capabilities }) - lspconfig.tsserver.setup({ capabilities = capabilities }) - -- lspconfig.standardrb.setup({ capabilities = capabilities }) - -- lspconfig.rubocop.setup({ capabilities = capabilities }) - -- lspconfig.rust_analyzer.setup({ capabilities = capabilities }) - lspconfig.ltex.setup({ - cmd = { "ltex-ls" }, - filetypes = { "markdown", "text", "cff", "tex" }, - flags = { debounce_text_changes = 299 }, - }) - lspconfig.astro.setup({}) + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup({ capabilities = capabilities }) + lspconfig.tsserver.setup({ capabilities = capabilities }) + -- lspconfig.standardrb.setup({ capabilities = capabilities }) + -- lspconfig.rubocop.setup({ capabilities = capabilities }) + -- lspconfig.rust_analyzer.setup({ capabilities = capabilities }) + lspconfig.ltex.setup({ + cmd = { "ltex-ls" }, + filetypes = { "markdown", "text", "cff", "tex" }, + flags = { debounce_text_changes = 299 }, + }) + lspconfig.astro.setup({}) - lspconfig.solargraph.setup({ - capabilities = capabilities, - cmd = { - "asdf", - "exec", - "solargraph", - "stdio", - }, - settings = { - solargraph = { - autoformat = false, - completion = true, - diagnostic = true, - folding = true, - references = true, - rename = true, - symbols = true, - }, - }, - }) + lspconfig.solargraph.setup({ + capabilities = capabilities, + cmd = { + "asdf", + "exec", + "solargraph", + "stdio", + }, + settings = { + solargraph = { + autoformat = false, + completion = true, + diagnostic = true, + folding = true, + references = true, + rename = true, + symbols = true, + }, + }, + }) - vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) - vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) - vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) - vim.cmd([[ - autocmd BufNewFile,BufRead *.prawn set filetype=ruby - ]]) - end, - }, - { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.disable({ "rubocop" }) - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.diagnostics.erb_format, - null_ls.builtins.formatting.erb_lint, - }, - }) - end, - keys = { - { "gf", vim.lsp.buf.format }, - }, - }, - { - "hrsh7th/cmp-nvim-lsp", - lazy = false, - }, - { - "L3MON4D3/LuaSnip", - dependencies = { - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets", - }, - keys = { - { - "", - function() - return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" - end, - expr = true, - silent = true, - mode = "i", - }, - { - "", - function() - require("luasnip").jump(1) - end, - mode = "s", - }, - { - "", - function() - require("luasnip").jump(-1) - end, - mode = { "i", "s" }, - }, - }, - }, - { - "hrsh7th/nvim-cmp", - lazy = false, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-cmdline", - "rafamadriz/friendly-snippets", - }, - config = function() - local cmp = require("cmp") - require("luasnip.loaders.from_vscode").lazy_load() + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) + vim.cmd([[ + autocmd BufNewFile,BufRead *.prawn set filetype=ruby + ]]) + end, + }, + { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.disable({ "rubocop" }) + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.diagnostics.erb_format, + null_ls.builtins.formatting.erb_lint, + }, + }) + end, + keys = { + { "gf", vim.lsp.buf.format }, + }, + }, + { + "hrsh7th/cmp-nvim-lsp", + lazy = false, + }, + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + keys = { + { + "", + function() + return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" + end, + expr = true, + silent = true, + mode = "i", + }, + { + "", + function() + require("luasnip").jump(1) + end, + mode = "s", + }, + { + "", + function() + require("luasnip").jump(-1) + end, + mode = { "i", "s" }, + }, + }, + }, + { + "hrsh7th/nvim-cmp", + lazy = false, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-cmdline", + "rafamadriz/friendly-snippets", + }, + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") -- TAB AUTO COMPLETE + require("luasnip.loaders.from_vscode").lazy_load() - cmp.setup({ - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - { name = "copilot", group_index = 2 }, - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - }), - }) - end, - }, - { - "zbirenbaum/copilot-cmp", - event = "InsertEnter", - config = function() - require("copilot_cmp").setup() - end, - }, - -- { - -- "nvim-treesitter/nvim-treesitter-refactor", - -- lazy = false, - -- config = function() - -- require("nvim-treesitter.configs").setup({ - -- refactor = { - -- highlight_definitions = { - -- enable = true, - -- clear_on_cursor_move = true, - -- }, - -- highlight_current_scope = { enable = false }, - -- smart_rename = { - -- enable = true, - -- -- Assign keymaps to false to disable them, e.g. `smart_rename = false`. - -- keymaps = { - -- smart_rename = "grr", - -- }, - -- }, - -- navigation = { - -- enable = true, - -- -- Assign keymaps to false to disable them, e.g. `goto_definition = false`. - -- keymaps = { - -- goto_definition = "gnd", - -- list_definitions = "gnD", - -- list_definitions_toc = "gO", - -- goto_next_usage = "", - -- goto_previous_usage = "", - -- }, - -- }, - -- }, - -- }) - -- end, - -- }, - -- { - -- "cuducos/yaml.nvim", - -- ft = { "yaml" }, -- optional - -- dependencies = { - -- "nvim-treesitter/nvim-treesitter", - -- "nvim-telescope/telescope.nvim", -- optional - -- }, - -- } + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end -- TAB AUTOCOMPLETE + + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- they way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }),-- TAB AUTO COMPLETE + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }),-- TAB AUTO COMPLETE + }), + sources = cmp.config.sources({ + { name = "copilot", group_index = 2 }, + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), + }) + end, + }, + { + "zbirenbaum/copilot-cmp", + event = "InsertEnter", + }, + -- { + -- "nvim-treesitter/nvim-treesitter-refactor", + -- lazy = false, + -- config = function() + -- require("nvim-treesitter.configs").setup({ + -- refactor = { + -- highlight_definitions = { + -- enable = true, + -- clear_on_cursor_move = true, + -- }, + -- highlight_current_scope = { enable = false }, + -- smart_rename = { + -- enable = true, + -- -- Assign keymaps to false to disable them, e.g. `smart_rename = false`. + -- keymaps = { + -- smart_rename = "grr", + -- }, + -- }, + -- navigation = { + -- enable = true, + -- -- Assign keymaps to false to disable them, e.g. `goto_definition = false`. + -- keymaps = { + -- goto_definition = "gnd", + -- list_definitions = "gnD", + -- list_definitions_toc = "gO", + -- goto_next_usage = "", + -- goto_previous_usage = "", + -- }, + -- }, + -- }, + -- }) + -- end, + -- }, + -- { + -- "cuducos/yaml.nvim", + -- ft = { "yaml" }, -- optional + -- dependencies = { + -- "nvim-treesitter/nvim-treesitter", + -- "nvim-telescope/telescope.nvim", -- optional + -- }, + -- } } From b954cb612076735ec0dd629fcd3ee3fca927114e Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 2 Sep 2024 17:19:31 +0200 Subject: [PATCH 101/280] Add bsf --- .zshrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.zshrc b/.zshrc index 8410157..a163008 100644 --- a/.zshrc +++ b/.zshrc @@ -133,6 +133,7 @@ alias cnvim="cd ~/.config/nvim && nvim init.lua" # [c]onfigure [nvim] alias yabairc="v ~/.yabairc" alias skhdrc="v ~/.config/skhd/skhdrc" alias dbreset="bundle exec rails db:drop db:create db:schema:load db:seed" # [d]ata[b]ase [reset] +alias bsf="bundle exec standardrb --fix" alias change_theme="~/.config/change_theme.sh > /dev/null" alias cpb="git branch | grep '*' | tr -d '*' | tr -d ' ' | pbcopy" # [c]o[p]y [b]ranch to clipboard alias tks="tmux kill-server" # [t]mux [k]ill [s]erver From 1b54db3e66a0d9dd30974c710f66d8cf2015d160 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 2 Sep 2024 17:19:39 +0200 Subject: [PATCH 102/280] Change theme --- change_theme.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/change_theme.sh b/change_theme.sh index b6fa2ab..170fcc8 100755 --- a/change_theme.sh +++ b/change_theme.sh @@ -12,7 +12,7 @@ fi NVIM_CONFIG_FILE="$HOME/.config/nvim/init.lua" NVIM_LIGHT_THEME='solarized' -NVIM_DARK_THEME='elflord' +NVIM_DARK_THEME='moonfly' NVIM_LIGHT_THEME_CONFIG="vim.cmd.colorscheme(\"$NVIM_LIGHT_THEME\")" NVIM_DARK_THEME_CONFIG="vim.cmd.colorscheme(\"$NVIM_DARK_THEME\")" From 2438026080f7453702d815de7ab3fd5677703da5 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 2 Sep 2024 17:19:44 +0200 Subject: [PATCH 103/280] Update statusbar --- my-status-bar.tmux | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/my-status-bar.tmux b/my-status-bar.tmux index 3a07427..dc9e63b 100755 --- a/my-status-bar.tmux +++ b/my-status-bar.tmux @@ -13,10 +13,12 @@ tmux_set() { tmux set-option -gq "$1" "$2" } -color1="#fdf6e3" -color2="" -color3="black" -color4="black" +color1="#000000" +# color1="#fdf6e3" +# color1="#000000" +color2="white" +color3="white" +color4="white" secondary="#[fg=$color2,bg=$color1]" tertiary="#[fg=black,bg=$color1]" From e949e0a22830fcadf03f79e0a8f9bbf8629df2c6 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Mon, 2 Sep 2024 18:40:57 +0200 Subject: [PATCH 104/280] Fix sound configuration --- nixos/hardware-configuration.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix index 5c8a7f8..8d18e8a 100644 --- a/nixos/hardware-configuration.nix +++ b/nixos/hardware-configuration.nix @@ -37,4 +37,13 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + sound.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; } From 9ffe95607858e06452aacb4efb7230a7427fc6d7 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Mon, 2 Sep 2024 18:41:05 +0200 Subject: [PATCH 105/280] Readd hyprland? --- nixos/configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 4713625..0cfe210 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -80,6 +80,8 @@ firefox kdePackages.dolphin discord + + hyprland ]; programs.zsh.enable = true; From 381e43ea9cf929f1667ba5837e964cf1dce884f0 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Mon, 2 Sep 2024 18:45:13 +0200 Subject: [PATCH 106/280] Update repeat delay --- .config/hypr/hyprland.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 062a89c..a89fba0 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -162,6 +162,9 @@ input { touchpad { natural_scroll = false } + + repeat_delay = 200 + repeat_rate = 60 } # https://wiki.hyprland.org/Configuring/Variables/#gestures From 4428f151e137b2c8ce9351848f813f3869812298 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 3 Sep 2024 23:17:13 +0200 Subject: [PATCH 107/280] Disable lualine --- .config/nvim/lua/plugins/editor.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 8d3d827..d30dbe0 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -464,12 +464,12 @@ return { lazy = false, }, { "echasnovski/mini.ai", version = false, lazy = false }, - { - 'nvim-lualine/lualine.nvim', - lazy = false, - dependencies = { 'nvim-tree/nvim-web-devicons' }, - config = function() - require("lualine").setup() - end - } + -- { + -- 'nvim-lualine/lualine.nvim', + -- lazy = false, + -- dependencies = { 'nvim-tree/nvim-web-devicons' }, + -- config = function() + -- require("lualine").setup() + -- end + -- } } From e68155e98abd4aa49667b775c8c80705d69d5518 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 3 Sep 2024 23:17:43 +0200 Subject: [PATCH 108/280] Fix vim surround --- .config/nvim/lua/plugins/coding.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index eaa0706..1bee56f 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -1,9 +1,4 @@ return { - { - "kylechui/nvim-surround", - version = "*", - lazy = false - }, { "m4xshen/autoclose.nvim", event = "VeryLazy", @@ -11,6 +6,16 @@ return { { "nat-418/boole.nvim", event = "VeryLazy", + { + "kylechui/nvim-surround", + version = "*", -- Use for stability; omit to use `main` branch for the latest features + event = "VeryLazy", + config = function() + require("nvim-surround").setup({ + -- Configuration here, or leave empty to use defaults + }) + end + }, opts = { mappings = { increment = "", From d0efbce46bbe7532be8a07aa13a09a070444c67b Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 3 Sep 2024 23:17:53 +0200 Subject: [PATCH 109/280] Fix linter --- .config/nvim/lua/plugins/coding.lua | 68 ++++++++++++++--------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua index 1bee56f..9c0471c 100644 --- a/.config/nvim/lua/plugins/coding.lua +++ b/.config/nvim/lua/plugins/coding.lua @@ -1,11 +1,4 @@ return { - { - "m4xshen/autoclose.nvim", - event = "VeryLazy", - }, - { - "nat-418/boole.nvim", - event = "VeryLazy", { "kylechui/nvim-surround", version = "*", -- Use for stability; omit to use `main` branch for the latest features @@ -16,37 +9,44 @@ return { }) end }, + { + "m4xshen/autoclose.nvim", + event = "VeryLazy", + }, + { + "nat-418/boole.nvim", + event = "VeryLazy", opts = { - mappings = { - increment = "", - decrement = "", - }, - additions = { - { "Foo", "Bar" }, - { "tic", "tac", "toe" }, - { "->", "<--" }, - { "++", "--" }, - { "light", "dark" }, - { "public", "private", "protected" }, - { "if", "unless" }, - { "width", "height" }, - { "let", "const" }, - }, - allow_caps_additions = { - { "enable", "disable" }, - }, + mappings = { + increment = "", + decrement = "", + }, + additions = { + { "Foo", "Bar" }, + { "tic", "tac", "toe" }, + { "->", "<--" }, + { "++", "--" }, + { "light", "dark" }, + { "public", "private", "protected" }, + { "if", "unless" }, + { "width", "height" }, + { "let", "const" }, + }, + allow_caps_additions = { + { "enable", "disable" }, + }, } - }, - { - "numToStr/Comment.nvim", + }, + { + "numToStr/Comment.nvim", event = "VeryLazy" - }, - { - "machakann/vim-highlightedyank", - lazy = false, + }, + { + "machakann/vim-highlightedyank", + lazy = false, config = function() vim.g.highlightedyank_highlight_duration = 100 end - }, - { "tpope/vim-repeat", lazy = false }, + }, + { "tpope/vim-repeat", lazy = false }, } From d9d0a5695be455cfe42455101cf7e5f42b4ee61c Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 3 Sep 2024 23:48:43 +0200 Subject: [PATCH 110/280] Shorten telescope keybinds --- .config/nvim/lua/plugins/telescope.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index fc76fc9..001b5f5 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -25,47 +25,47 @@ return { end, keys = { { - "ff", + "f", "Telescope find_files hidden=true", desc = "Telescope File", }, { - "ft", + "tr", "Telescope resume", desc = "Telescope Resume", }, { - "fn", + "n", "Telescope find_files search_dirs={'~/.config/nvim/'}", desc = "Telescope Config", }, { - "fg", + "tg", "Telescope git_files", desc = "Telescope Git File", }, { - "fb", + "tb", "Telescope buffers", desc = "Telescope Buffer", }, { - "fs", + "tw", "Telescope grep_string", desc = "Telescope Grep", }, { - "fw", + "w", "Telescope live_grep", desc = "Telescope Grep", }, { - "fq", + "tq", "Telescope quickfix", desc = "Telescope Quickfix", }, { - "fr", + "r", function() local word = vim.fn.expand("") require("telescope.builtin").grep_string({ @@ -78,7 +78,7 @@ return { desc = "Telescope grep current word", }, { - "fc", + "tc", function() local filename = vim.fn.expand("") require("telescope.builtin").find_files({ @@ -88,13 +88,13 @@ return { desc = "Telescope find file under cursor", }, { - "fg", + "tg", ":lua require('telescope').extensions.live_grep_args.live_grep_args()", desc = "Telescope Grep Args", }, - { "fk", "Telescope keymaps", desc = "Telescope Keymap" }, + { "tk", "Telescope keymaps", desc = "Telescope Keymap" }, { "", "Telescope commands", desc = "Telescope Command" }, - { "fd", ":Telescope rails_db_schema", desc = "Telescope Rails db schema" }, + { "td", ":Telescope rails_db_schema", desc = "Telescope Rails db schema" }, }, }, { From b4a4d620750f16d54c256ea08c60f5bccdc85ab7 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 17:18:36 +0200 Subject: [PATCH 111/280] Change nvim config --- .config/nvim/init.lua | 11 +- .config/nvim/lazy-lock.json | 2 +- .config/nvim/lua/plugins/editor.lua | 903 +++++++++++++------------ .config/nvim/lua/plugins/telescope.lua | 21 +- 4 files changed, 470 insertions(+), 467 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 907e75a..4a9d103 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,6 +1,6 @@ vim.opt.title = true vim.opt.titlelen = 0 -vim.opt.titlestring = 'nvim %{expand("%:p")}' +-- vim.opt.titlestring = 'nvim %{expand("%:p")}' vim.g.mapleader = " " vim.g.maplocalleader = "\\" vim.wo.number = true @@ -14,10 +14,9 @@ vim.opt.tabstop = 2 vim.opt.softtabstop = 2 vim.opt.shiftwidth = 2 vim.opt.scrolloff = 10 -vim.opt.cmdheight = 0 +vim.opt.cmdheight = 1 -vim.opt.winbar = "%f" -vim.opt.laststatus = 3 +vim.api.nvim_set_keymap('n', '@', '@q', {noremap = true}) vim.keymap.set("n", "qq", "wqa") vim.keymap.set("n", "q!", "qa!") @@ -82,7 +81,7 @@ require("lazy").setup(plugins, opts) vim.keymap.set("n", "L", "Lazy") -vim.cmd.colorscheme("moonfly") -vim.opt.background = "dark" +vim.cmd.colorscheme("solarized") +vim.opt.background = "light" -- vim.api.nvim_command('autocmd VimEnter * lua require("persistence").load()') diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 15aedb1..c0f164e 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -25,7 +25,6 @@ "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, "lazygit.nvim": { "branch": "main", "commit": "dc56df433bfbf107fee0139e187eb9750878fa84" }, - "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "ba9c2f0b93deb48d0a99ae0e8d8dd36f7cc286d6" }, @@ -60,6 +59,7 @@ "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "refactoring.nvim": { "branch": "master", "commit": "ac70bb714f30886e79461869871174a1c1d52058" }, + "remote-sshfs.nvim": { "branch": "main", "commit": "03f6c40c4032eeb1ab91368e06db9c3f3a97a75d" }, "rustaceanvim": { "branch": "master", "commit": "047f9c9d8cd2861745eb9de6c1570ee0875aa795" }, "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, "telescope-live-grep-args.nvim": { "branch": "master", "commit": "8ad632f793fd437865f99af5684f78300dac93fb" }, diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index d30dbe0..465064f 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -1,475 +1,476 @@ return { - { "tpope/vim-unimpaired", event = "VeryLazy" }, - { "christoomey/vim-system-copy", lazy = false }, - { "folke/neoconf.nvim", cmd = "Neoconf" }, - { - "nvimdev/dashboard-nvim", - -- event = "VimEnter", - config = function() - require("dashboard").setup({ - theme = "hyper", - config = { - header = { - [[ ]], - [[  ]], - [[ ████ ██████ █████ ██ ]], - [[ ███████████ █████  ]], - [[ █████████ ███████████████████ ███ ███████████ ]], - [[ █████████ ███ █████████████ █████ ██████████████ ]], - [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], - [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], - [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], - [[ ]], - }, - }, - shortcut = { - { desc = "󰊳 Update", group = "@property", action = "Lazy update", key = "u" }, - { - icon = " ", - icon_hl = "@variable", - desc = "Files", - group = "Label", - action = "Telescope find_files", - key = "f", - }, - { - desc = " Apps", - group = "DiagnosticHint", - action = "Telescope app", - key = "a", - }, - { - desc = " dotfiles", - group = "Number", - action = "Telescope dotfiles", - key = "d", - }, - { - desc = " Restore Session", - group = "Number", - action = "require('persistence').load()", - key = "r", - }, - }, - }) - end, - dependencies = { "nvim-tree/nvim-web-devicons" }, - }, - { - "adelarsq/image_preview.nvim", - event = "VeryLazy", - config = function() - require("image_preview").setup() - end, - }, - { - "nyoom-engineering/oxocarbon.nvim", - lazy = false, - config = function() - -- vim.cmd.colorscheme("oxocarbon") - end, - }, - -- TODO: fix - -- { - -- "max397574/better-escape.nvim", - -- lazy = false, - -- config = function() - -- require("better_escape").setup({ - -- mapping = { "jk", "jj" }, - -- timeout = 100, - -- clear_empty_lines = false, - -- keys = function() - -- return vim.api.nvim_win_get_cursor(0)[2] > 1 and "l" or "" - -- end, - -- }) - -- end, - -- }, - { - "jsit/toast.vim", - lazy = false, - config = function() - -- vim.cmd "set background=light" - -- vim.cmd.colorscheme "toast" - end, - }, - { - "folke/persistence.nvim", - event = "BufReadPre", - opts = { options = vim.opt.sessionoptions:get() }, - -- stylua: ignore - keys = { - { "qs", function() require("persistence").load() end, desc = "Restore Session" }, - { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, - { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, - }, - }, - { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 200 - end, - opts = {}, - }, - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - "s1n7ax/nvim-window-picker", - }, - keys = { - { "e", "Neotree position=float reveal toggle", desc = "Neotree" }, - }, - config = function() - require("neo-tree").setup({ - sources = { "filesystem", "document_symbols" }, - filesystem = { - filtered_items = { - visible = true, -- when true, they will just be displayed differently than normal items - hide_dotfiles = true, - hide_gitignored = true, - }, - }, - window = { - mappings = { - [""] = "none", - ["Y"] = { - function(state) - local node = state.tree:get_node() - local path = node:get_id() - vim.fn.setreg("+", path, "c") - end, - desc = "Copy Path to Clipboard", - }, - ["O"] = { - function(state) - require("lazy.util").open(state.tree:get_node().path, { system = true }) - end, - desc = "Open with System Application", - }, - }, - }, - }) - end, - }, - -- { - -- "nvim-treesitter/nvim-treesitter", - -- event = "VeryLazy", - -- dependencies = { - -- "RRethy/nvim-treesitter-endwise", - -- }, - -- config = function() - -- require("nvim-treesitter.configs").setup({ - -- ensure_installed = { "lua", "vim", "ruby", "bibtex", "yaml" }, - -- ignore_install = { "latex" }, - -- auto_install = true, - -- endwise = { - -- enable = true, - -- }, - -- highlight = { - -- enable = true, - -- }, - -- }) - -- end, - -- }, + { "tpope/vim-unimpaired", event = "VeryLazy" }, + { "christoomey/vim-system-copy", lazy = false }, + { "folke/neoconf.nvim", cmd = "Neoconf" }, { - "stevearc/oil.nvim", + "nosduco/remote-sshfs.nvim", + lazy = false, + dependencies = { "nvim-telescope/telescope.nvim" }, opts = { - default_file_explorer = true, - columns = { - "icon", - }, - view_options = { - show_hidden = true, - }, - float = { - max_width = 142, - preview_split = "right", - }, - }, - dependencies = { "nvim-tree/nvim-web-devicons" }, - keys = { - { "-", "Oil", desc = "Oil" }, + -- Refer to the configuration section below + -- or leave empty for defaults }, }, { - "FeiyouG/commander.nvim", - dependencies = { - "nvim-telescope/telescope.nvim", - }, - keys = { - { "fp", "Telescope commander", mode = "n" }, - { "fc", "Telescope commander", mode = "n" }, - }, + "nvimdev/dashboard-nvim", + -- event = "VimEnter", config = function() - require("commander").setup({ - components = { - "DESC", - "KEYS", - "CAT", - }, - sort_by = { - "DESC", - "KEYS", - "CAT", - "CMD", + require("dashboard").setup({ + theme = "hyper", + config = { + header = { + [[ ]], + [[  ]], + [[ ████ ██████ █████ ██ ]], + [[ ███████████ █████  ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + }, }, - integration = { - telescope = { - enable = true, + shortcut = { + { desc = "󰊳 Update", group = "@property", action = "Lazy update", key = "u" }, + { + icon = " ", + icon_hl = "@variable", + desc = "Files", + group = "Label", + action = "Telescope find_files", + key = "f", }, - lazy = { - enable = true, - set_plugin_name_as_cat = true, + { + desc = " Apps", + group = "DiagnosticHint", + action = "Telescope app", + key = "a", + }, + { + desc = " dotfiles", + group = "Number", + action = "Telescope dotfiles", + key = "d", + }, + { + desc = " Restore Session", + group = "Number", + action = "require('persistence').load()", + key = "r", }, }, }) end, + dependencies = { "nvim-tree/nvim-web-devicons" }, }, { - "echasnovski/mini.indentscope", - version = "*", - lazy = false, - config = function() end, - }, - { - "lukas-reineke/indent-blankline.nvim", - main = "ibl", - lazy = true, - config = { - exclude = { - filetypes = { - "lspinfo", - "packer", - "checkhealth", - "help", - "man", - "gitcommit", - "TelescopePrompt", - "TelescopeResults", - "Dashboard", - }, - }, - }, - keys = { - { - "ibl", - "IBLToggleScope", - }, - }, - }, - { - "jlanzarotta/bufexplorer", - lazy = false, - }, - { - "nvim-pack/nvim-spectre", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - }, - config = function() - require("spectre").setup() - end, - keys = { - { - mode = "n", - "S", - 'lua require("spectre").toggle()', - desc = "Toggle Spectre", - }, - { - mode = "n", - "sw", - 'lua require("spectre").open_visual({select_word=true})', - desc = "Search current word", - }, - { - mode = "v", - "sw", - 'lua require("spectre").open_visual()', - desc = "Search current word", - }, - { - mode = "n", - "sp", - 'lua require("spectre").open_file_search({select_word=true})', - desc = "Search on current file", - }, - }, - }, - { - "folke/trouble.nvim", - lazy = false, - keys = { - { - "j", - function() - require("trouble").next({ skip_groups = true, jump = true }) - end, - }, - { - "k", - function() - require("trouble").previous({ skip_groups = true, jump = true }) - end, - }, - }, - }, - { - "folke/todo-comments.nvim", - cmd = { "TodoTrouble", "TodoTelescope" }, - event = "VeryLazy", - config = true, - -- stylua: ignore - keys = { - { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" }, - { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" }, - { "xt", "TodoTrouble", desc = "Todo (Trouble)" }, - { "xT", "TodoTrouble keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme (Trouble)" }, - { "st", "TodoTelescope", desc = "Todo" }, - { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, - }, - }, - { - "akinsho/toggleterm.nvim", - version = "*", - opts = function() - require("toggleterm").setup({ - float_opts = { - border = "curved", - }, - }) - - opts = {} - vim.keymap.set("t", "", [[]], opts) - vim.keymap.set("t", "jk", [[]], opts) - end, - keys = { - { "!", "ToggleTerm direction=float", desc = "Toggle Terminal" }, - }, - }, - { - "simrat39/symbols-outline.nvim", - config = function() - require("symbols-outline").setup() - end, - keys = { - { "so", "SymbolsOutline", desc = "SymbolsOutline" }, - }, - }, - -- { - -- "brenoprata10/nvim-highlight-colors", - -- event = "VeryLazy", - -- config = function() - -- require('nvim-highlight-colors').setup({}) - -- end - -- }, - { - "ThePrimeagen/harpoon", + "adelarsq/image_preview.nvim", event = "VeryLazy", - dependencies = { "nvim-lua/plenary.nvim" }, config = function() - require("harpoon").setup({}) + require("image_preview").setup() end, - keys = { - { - "1", - function() - require("harpoon.ui").nav_file(1) - end, - desc = "Harpoon file 1", - }, - { - "2", - function() - require("harpoon.ui").nav_file(2) - end, - desc = "Harpoon file 2", - }, - { - "3", - function() - require("harpoon.ui").nav_file(3) - end, - desc = "Harpoon file 3", - }, - { - "4", - function() - require("harpoon.ui").nav_file(4) - end, - desc = "Harpoon file 4", - }, - { - "5", - function() - require("harpoon.ui").nav_file(5) - end, - desc = "Harpoon file 5", - }, - { - "6", - function() - require("harpoon.ui").nav_file(6) - end, - desc = "Harpoon file 6", - }, - { - "7", - function() - require("harpoon.ui").nav_file(7) - end, - desc = "Harpoon file 7", - }, - { - "8", - function() - require("harpoon.ui").nav_file(8) - end, - desc = "Harpoon file 8", - }, - { - "9", - function() - require("harpoon.ui").nav_file(9) - end, - desc = "Harpoon file 9", - }, - { - "hh", - function() - require("harpoon.ui").toggle_quick_menu() - end, - desc = "Harpoon toggle quick menu", - }, - { - "H", - function() - require("harpoon.mark").add_file() - end, - desc = "Harpoon add file", - }, - }, }, { - "smjonas/inc-rename.nvim", + "nyoom-engineering/oxocarbon.nvim", + lazy = false, config = function() - require("inc_rename").setup() + -- vim.cmd.colorscheme("oxocarbon") end, - lazy = false, }, - { "echasnovski/mini.ai", version = false, lazy = false }, + -- TODO: fix -- { - -- 'nvim-lualine/lualine.nvim', - -- lazy = false, - -- dependencies = { 'nvim-tree/nvim-web-devicons' }, - -- config = function() - -- require("lualine").setup() - -- end - -- } -} + -- "max397574/better-escape.nvim", + -- lazy = false, + -- config = function() + -- require("better_escape").setup({ + -- mapping = { "jk", "jj" }, + -- timeout = 100, + -- clear_empty_lines = false, + -- keys = function() + -- return vim.api.nvim_win_get_cursor(0)[2] > 1 and "l" or "" + -- end, + -- }) + -- end, + -- }, + { + "jsit/toast.vim", + lazy = false, + config = function() + -- vim.cmd "set background=light" + -- vim.cmd.colorscheme "toast" + end, + }, + { + "folke/persistence.nvim", + event = "BufReadPre", + opts = { options = vim.opt.sessionoptions:get() }, + -- stylua: ignore + keys = { + { "qs", function() require("persistence").load() end, desc = "Restore Session" }, + { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, + { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, + }, + }, + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 200 + end, + opts = {}, + }, + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + "s1n7ax/nvim-window-picker", + }, + keys = { + { "e", "Neotree position=float reveal toggle", desc = "Neotree" }, + }, + config = function() + require("neo-tree").setup({ + sources = { "filesystem", "document_symbols" }, + filesystem = { + filtered_items = { + visible = true, -- when true, they will just be displayed differently than normal items + hide_dotfiles = true, + hide_gitignored = true, + }, + }, + window = { + mappings = { + [""] = "none", + ["Y"] = { + function(state) + local node = state.tree:get_node() + local path = node:get_id() + vim.fn.setreg("+", path, "c") + end, + desc = "Copy Path to Clipboard", + }, + ["O"] = { + function(state) + require("lazy.util").open(state.tree:get_node().path, { system = true }) + end, + desc = "Open with System Application", + }, + }, + }, + }) + end, + }, + -- { + -- "nvim-treesitter/nvim-treesitter", + -- event = "VeryLazy", + -- dependencies = { + -- "RRethy/nvim-treesitter-endwise", + -- }, + -- config = function() + -- require("nvim-treesitter.configs").setup({ + -- ensure_installed = { "lua", "vim", "ruby", "bibtex", "yaml" }, + -- ignore_install = { "latex" }, + -- auto_install = true, + -- endwise = { + -- enable = true, + -- }, + -- highlight = { + -- enable = true, + -- }, + -- }) + -- end, + -- }, + { + "stevearc/oil.nvim", + opts = { + default_file_explorer = true, + columns = { + "icon", + }, + view_options = { + show_hidden = true, + }, + float = { + max_width = 142, + preview_split = "right", + }, + }, + dependencies = { "nvim-tree/nvim-web-devicons" }, + keys = { + { "-", "Oil", desc = "Oil" }, + }, + }, + { + "FeiyouG/commander.nvim", + dependencies = { + "nvim-telescope/telescope.nvim", + }, + keys = { + { "tp", "Telescope commander", mode = "n" }, + { "tc", "Telescope commander", mode = "n" }, + }, + config = function() + require("commander").setup({ + components = { + "DESC", + "KEYS", + "CAT", + }, + sort_by = { + "DESC", + "KEYS", + "CAT", + "CMD", + }, + integration = { + telescope = { + enable = true, + }, + lazy = { + enable = true, + set_plugin_name_as_cat = true, + }, + }, + }) + end, + }, + { + "echasnovski/mini.indentscope", + version = "*", + lazy = false, + config = function() end, + }, + { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + lazy = true, + config = { + exclude = { + filetypes = { + "lspinfo", + "packer", + "checkhealth", + "help", + "man", + "gitcommit", + "TelescopePrompt", + "TelescopeResults", + "Dashboard", + }, + }, + }, + keys = { + { + "ibl", + "IBLToggleScope", + }, + }, + }, + { + "jlanzarotta/bufexplorer", + lazy = false, + }, + { + "nvim-pack/nvim-spectre", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("spectre").setup() + end, + keys = { + { + mode = "n", + "S", + 'lua require("spectre").toggle()', + desc = "Toggle Spectre", + }, + { + mode = "n", + "sw", + 'lua require("spectre").open_visual({select_word=true})', + desc = "Search current word", + }, + { + mode = "v", + "sw", + 'lua require("spectre").open_visual()', + desc = "Search current word", + }, + { + mode = "n", + "sp", + 'lua require("spectre").open_file_search({select_word=true})', + desc = "Search on current file", + }, + }, + }, + { + "folke/trouble.nvim", + lazy = false, + keys = { + { + "j", + function() + require("trouble").next({ skip_groups = true, jump = true }) + end, + }, + { + "k", + function() + require("trouble").previous({ skip_groups = true, jump = true }) + end, + }, + }, + }, + { + "folke/todo-comments.nvim", + cmd = { "TodoTrouble", "TodoTelescope" }, + event = "VeryLazy", + config = true, + -- stylua: ignore + keys = { + { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" }, + { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" }, + { "xt", "TodoTrouble", desc = "Todo (Trouble)" }, + { "xT", "TodoTrouble keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme (Trouble)" }, + { "st", "TodoTelescope", desc = "Todo" }, + { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, + }, + }, + { + "akinsho/toggleterm.nvim", + version = "*", + opts = function() + require("toggleterm").setup({ + float_opts = { + border = "curved", + }, + }) + + opts = {} + vim.keymap.set("t", "", [[]], opts) + vim.keymap.set("t", "jk", [[]], opts) + end, + keys = { + { "!", "ToggleTerm direction=float", desc = "Toggle Terminal" }, + }, + }, + { + "simrat39/symbols-outline.nvim", + config = function() + require("symbols-outline").setup() + end, + keys = { + { "so", "SymbolsOutline", desc = "SymbolsOutline" }, + }, + }, + -- { + -- "brenoprata10/nvim-highlight-colors", + -- event = "VeryLazy", + -- config = function() + -- require('nvim-highlight-colors').setup({}) + -- end + -- }, + { + "ThePrimeagen/harpoon", + event = "VeryLazy", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("harpoon").setup({}) + end, + keys = { + { + "1", + function() + require("harpoon.ui").nav_file(1) + end, + desc = "Harpoon file 1", + }, + { + "2", + function() + require("harpoon.ui").nav_file(2) + end, + desc = "Harpoon file 2", + }, + { + "3", + function() + require("harpoon.ui").nav_file(3) + end, + desc = "Harpoon file 3", + }, + { + "4", + function() + require("harpoon.ui").nav_file(4) + end, + desc = "Harpoon file 4", + }, + { + "5", + function() + require("harpoon.ui").nav_file(5) + end, + desc = "Harpoon file 5", + }, + { + "6", + function() + require("harpoon.ui").nav_file(6) + end, + desc = "Harpoon file 6", + }, + { + "7", + function() + require("harpoon.ui").nav_file(7) + end, + desc = "Harpoon file 7", + }, + { + "8", + function() + require("harpoon.ui").nav_file(8) + end, + desc = "Harpoon file 8", + }, + { + "9", + function() + require("harpoon.ui").nav_file(9) + end, + desc = "Harpoon file 9", + }, + { + "hh", + function() + require("harpoon.ui").toggle_quick_menu() + end, + desc = "Harpoon toggle quick menu", + }, + { + "H", + function() + require("harpoon.mark").add_file() + end, + desc = "Harpoon add file", + }, + }, + }, + { + "smjonas/inc-rename.nvim", + config = function() + require("inc_rename").setup() + end, + lazy = false, + }, + { "echasnovski/mini.ai", version = false, lazy = false }, + } diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 001b5f5..36ddd2c 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -68,21 +68,24 @@ return { "r", function() local word = vim.fn.expand("") - require("telescope.builtin").grep_string({ - search = word, - only_sort_text = true, - layout_strategy = "vertical", - layout_config = {}, - }) + require("telescope.builtin").grep_string( + -- require('telescope.themes').get_cursor({}) + -- { + -- search = word, + -- only_sort_text = true, + -- layout_strategy = "vertical", + -- } + ) end, desc = "Telescope grep current word", }, { - "tc", + "R", function() - local filename = vim.fn.expand("") + local filename = vim.fn.expand("") require("telescope.builtin").find_files({ - find_command = { "rg", "--files", "--hidden", "--ignore", "--glob", "!*.git/*", filename }, + prompt_prefix = "🔍", + find_command = { "rg", "--files", "--hidden", "--ignore", "--glob", "!*.git/*" }, }) end, desc = "Telescope find file under cursor", From 7a629fa627f21e3d519bc8f2a581ec8aa4b8c6a0 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 17:18:45 +0200 Subject: [PATCH 112/280] Update zshrc --- .zshrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index a163008..b257544 100644 --- a/.zshrc +++ b/.zshrc @@ -23,7 +23,7 @@ export EDITOR="nvim" unset LIBRARY_PATH unset LDFLAGS -source $HOMEBREW_PREFIX/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh +# source $HOMEBREW_PREFIX/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc" source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc" @@ -52,7 +52,7 @@ function cpt() { ~/scripts/copy-ticket-number.ts } function rsf() { file=$(find spec/**/*_spec.rb | fzf --preview 'bat --color "always" {}') echo "bundle exec rspec $file" - print -S "$file" + print -S "bundle exec rspec $file" bundle exec rspec $file } # [r]spec [s]earch [f]ile function vg() { nvim $(fzf) } # [v]im [g]rep @@ -139,6 +139,7 @@ alias cpb="git branch | grep '*' | tr -d '*' | tr -d ' ' | pbcopy" # [c]o[p]y [b alias tks="tmux kill-server" # [t]mux [k]ill [s]erver alias crc="cargo r -r --bin client" alias crs="cargo r -r --bin server" +alias listfonts="fc-list | sed 's/.*:\s*\([^:]*\):.*/\1/' | tr ',' '\n' | sed 's/^[ \t]*//;s/[ \t]*$//' | sort | uniq" # https://stackoverflow.com/questions/57473124/how-to-find-all-available-fonts-on-osx-using-the-default-shell function rkill() { "kill $(cat tmp/pids/server.pid)" } #alias glog="git log --oneline | grep -v -e '^\s*$' --color=always | less --use-color" # [g]it [log] From 6571f7121dec544bf6d2546622b96a621cd7a9dc Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 17:24:14 +0200 Subject: [PATCH 113/280] Reset nvim config --- .config/nvim/copilot-chat | 2 - .config/nvim/init.lua | 72 +--- .config/nvim/lua/languages/latex.lua | 14 - .config/nvim/lua/languages/markdown.lua | 16 - .config/nvim/lua/languages/plantuml.lua | 10 - .config/nvim/lua/languages/rails.lua | 72 ---- .config/nvim/lua/languages/rust.lua | 14 - .config/nvim/lua/plugins/coding.lua | 52 --- .config/nvim/lua/plugins/editor.lua | 476 ------------------------ .config/nvim/lua/plugins/fun.lua | 13 - .config/nvim/lua/plugins/git.lua | 197 ---------- .config/nvim/lua/plugins/lsp.lua | 377 ------------------- .config/nvim/lua/plugins/navigation.lua | 17 - .config/nvim/lua/plugins/telescope.lua | 117 ------ .config/nvim/lua/plugins/testing.lua | 42 --- 15 files changed, 2 insertions(+), 1489 deletions(-) delete mode 100644 .config/nvim/copilot-chat delete mode 100644 .config/nvim/lua/languages/latex.lua delete mode 100644 .config/nvim/lua/languages/markdown.lua delete mode 100644 .config/nvim/lua/languages/plantuml.lua delete mode 100644 .config/nvim/lua/languages/rails.lua delete mode 100644 .config/nvim/lua/languages/rust.lua delete mode 100644 .config/nvim/lua/plugins/coding.lua delete mode 100644 .config/nvim/lua/plugins/editor.lua delete mode 100644 .config/nvim/lua/plugins/fun.lua delete mode 100644 .config/nvim/lua/plugins/git.lua delete mode 100644 .config/nvim/lua/plugins/lsp.lua delete mode 100644 .config/nvim/lua/plugins/navigation.lua delete mode 100644 .config/nvim/lua/plugins/telescope.lua delete mode 100644 .config/nvim/lua/plugins/testing.lua diff --git a/.config/nvim/copilot-chat b/.config/nvim/copilot-chat deleted file mode 100644 index 76e579a..0000000 --- a/.config/nvim/copilot-chat +++ /dev/null @@ -1,2 +0,0 @@ -test - diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 4a9d103..a1a284c 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,48 +1,3 @@ -vim.opt.title = true -vim.opt.titlelen = 0 --- vim.opt.titlestring = 'nvim %{expand("%:p")}' -vim.g.mapleader = " " -vim.g.maplocalleader = "\\" -vim.wo.number = true -vim.wo.relativenumber = true -vim.opt.termguicolors = true -vim.opt.cursorline = true -vim.opt.cursorcolumn = true - -vim.opt.expandtab = true -vim.opt.tabstop = 2 -vim.opt.softtabstop = 2 -vim.opt.shiftwidth = 2 -vim.opt.scrolloff = 10 -vim.opt.cmdheight = 1 - -vim.api.nvim_set_keymap('n', '@', '@q', {noremap = true}) - -vim.keymap.set("n", "qq", "wqa") -vim.keymap.set("n", "q!", "qa!") -vim.keymap.set("n", "/", "noh") - -vim.keymap.set("n", "n", "nzz") -vim.keymap.set("n", "N", "Nzz") - -vim.keymap.set("n", "", "5jzz") -vim.keymap.set("n", "", "5kzz") - -vim.opt.wildmenu = true -vim.opt.wildmode = "longest:full" -vim.opt.wildignore = { - "*.docx", - "*.jpg", - "*.png", - "*.gif", - "*.pdf", - "*.pyc", - "*.exe", - "*.flv", - "*.img", - "*.xlsx", -} - local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ @@ -57,31 +12,8 @@ end vim.opt.rtp:prepend(lazypath) +local plugins = { } -local plugins = { - -- { "sainnhe/sonokai", lazy = true, priority = 1000 }, - -- { "iruzo/matrix-nvim", lazy = true, priority = 1000 }, - -- { "nyoom-engineering/nyoom.nvim", lazy = true, priority = 1000 }, - -- { "folke/tokyonight.nvim", lazy = false, priority = 1000 }, - -- { "ray-x/aurora", lazy = true, priority = 1000 }, - -- { "shaunsingh/solarized.nvim", lazy = false, priority = 1000 }, - { "ishan9299/nvim-solarized-lua", name = "moonfly", lazy = false, priority = 1000 }, - { "bluz71/vim-moonfly-colors", lazy = false, priority = 1000 }, - { import = "plugins" }, - { import = "languages" }, -} - -local opts = { - defaults = { - lazy = true, - }, -} +local opts = { defaults = { lazy = true } } require("lazy").setup(plugins, opts) - -vim.keymap.set("n", "L", "Lazy") - -vim.cmd.colorscheme("solarized") -vim.opt.background = "light" - --- vim.api.nvim_command('autocmd VimEnter * lua require("persistence").load()') diff --git a/.config/nvim/lua/languages/latex.lua b/.config/nvim/lua/languages/latex.lua deleted file mode 100644 index 301d1e5..0000000 --- a/.config/nvim/lua/languages/latex.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - { - "lervag/vimtex", - ft = "tex", - -- tag = "v2.15", -- uncomment to pin to a specific release - init = function() - -- VimTeX configuration goes here - end - }, - { - "rhysd/vim-grammarous", - ft = "tex", - } -} diff --git a/.config/nvim/lua/languages/markdown.lua b/.config/nvim/lua/languages/markdown.lua deleted file mode 100644 index 4a068ca..0000000 --- a/.config/nvim/lua/languages/markdown.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - { - "tadmccorkle/markdown.nvim", - ft = "markdown", - event = "VeryLazy", - }, - { - "iamcco/markdown-preview.nvim", - cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, - build = "cd app && yarn install", - init = function() - vim.g.mkdp_filetypes = { "markdown" } - end, - ft = { "markdown" }, - }, -} diff --git a/.config/nvim/lua/languages/plantuml.lua b/.config/nvim/lua/languages/plantuml.lua deleted file mode 100644 index 2068bb3..0000000 --- a/.config/nvim/lua/languages/plantuml.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - { - "weirongxu/plantuml-previewer.vim", - dependencies = { "tyru/open-browser.vim", "aklt/plantuml-syntax" }, - lazy = false, - config = function() - vim.g.plantuml_previewer_plantuml_jar_path = '/opt/homebrew/bin/plantuml' - end - } -} diff --git a/.config/nvim/lua/languages/rails.lua b/.config/nvim/lua/languages/rails.lua deleted file mode 100644 index b0e0ac2..0000000 --- a/.config/nvim/lua/languages/rails.lua +++ /dev/null @@ -1,72 +0,0 @@ -return { - { "tpope/vim-rails", lazy = false }, - { - "sato-s/telescope-rails.nvim", - dependencies = { "nvim-telescope/telescope.nvim" }, - keys = { - { "rs", "Telescope rails specs", desc = "Telescope rails specs" }, - { "rc", "Telescope rails controllers", desc = "Telescope rails controllers" }, - { "rm", "Telescope rails models", desc = "Telescope rails models" }, - { "rv", "Telescope rails views", desc = "Telescope rails views" }, - { "ri", "Telescope rails migrations", desc = "Telescope rails migrations" }, - { "rl", "Telescope rails libs", desc = "Telescope rails libs" }, - }, - }, - { - "Einenlum/yaml-revealer", - ft = "yaml" - }, - { - "windwp/nvim-ts-autotag", - lazy = false, - config = function() - - require('nvim-ts-autotag').setup({ - aliases = { - ["erb"] = "html" - }, - opts = { - -- Defaults - enable_close = true, -- Auto close tags - enable_rename = true, -- Auto rename pairs of tags - enable_close_on_slash = false -- Auto close on trailing ll", ":Other", desc = "Other" }, - { "ltn", ":OtherTabNew", desc = "OtherTabNew" }, - { "lp", ":OtherSplit", desc = "OtherSplit" }, - { "lv", ":OtherVSplit", desc = "OtherVSplit" }, - { "lc", ":OtherClear", desc = "OtherClear" }, - { "lt", ":Other test", desc = "Other test" }, - }, - config = function() - require("other-nvim").setup({ - mappings = { - "livewire", - "angular", - "laravel", - "rails", - "golang", - }, - }) - end, - }, - { - "slim-template/vim-slim", - ft = "slim", - }, -} diff --git a/.config/nvim/lua/languages/rust.lua b/.config/nvim/lua/languages/rust.lua deleted file mode 100644 index 5d2ab79..0000000 --- a/.config/nvim/lua/languages/rust.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - { - "mrcjkb/rustaceanvim", - version = "^4", -- Recommended - lazy = false, -- This plugin is already lazy - config = function() - local bufnr = vim.api.nvim_get_current_buf() - vim.keymap.set("n", "ca", function() - vim.cmd.RustLsp("codeAction") -- supports rust-analyzer's grouping - -- or vim.lsp.buf.codeAction() if you don't want grouping. - end, { silent = true, buffer = bufnr }) - end, - }, -} diff --git a/.config/nvim/lua/plugins/coding.lua b/.config/nvim/lua/plugins/coding.lua deleted file mode 100644 index 9c0471c..0000000 --- a/.config/nvim/lua/plugins/coding.lua +++ /dev/null @@ -1,52 +0,0 @@ -return { - { - "kylechui/nvim-surround", - version = "*", -- Use for stability; omit to use `main` branch for the latest features - event = "VeryLazy", - config = function() - require("nvim-surround").setup({ - -- Configuration here, or leave empty to use defaults - }) - end - }, - { - "m4xshen/autoclose.nvim", - event = "VeryLazy", - }, - { - "nat-418/boole.nvim", - event = "VeryLazy", - opts = { - mappings = { - increment = "", - decrement = "", - }, - additions = { - { "Foo", "Bar" }, - { "tic", "tac", "toe" }, - { "->", "<--" }, - { "++", "--" }, - { "light", "dark" }, - { "public", "private", "protected" }, - { "if", "unless" }, - { "width", "height" }, - { "let", "const" }, - }, - allow_caps_additions = { - { "enable", "disable" }, - }, - } - }, - { - "numToStr/Comment.nvim", - event = "VeryLazy" - }, - { - "machakann/vim-highlightedyank", - lazy = false, - config = function() - vim.g.highlightedyank_highlight_duration = 100 - end - }, - { "tpope/vim-repeat", lazy = false }, -} diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua deleted file mode 100644 index 465064f..0000000 --- a/.config/nvim/lua/plugins/editor.lua +++ /dev/null @@ -1,476 +0,0 @@ -return { - { "tpope/vim-unimpaired", event = "VeryLazy" }, - { "christoomey/vim-system-copy", lazy = false }, - { "folke/neoconf.nvim", cmd = "Neoconf" }, - { - "nosduco/remote-sshfs.nvim", - lazy = false, - dependencies = { "nvim-telescope/telescope.nvim" }, - opts = { - -- Refer to the configuration section below - -- or leave empty for defaults - }, - }, - { - "nvimdev/dashboard-nvim", - -- event = "VimEnter", - config = function() - require("dashboard").setup({ - theme = "hyper", - config = { - header = { - [[ ]], - [[  ]], - [[ ████ ██████ █████ ██ ]], - [[ ███████████ █████  ]], - [[ █████████ ███████████████████ ███ ███████████ ]], - [[ █████████ ███ █████████████ █████ ██████████████ ]], - [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], - [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], - [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], - [[ ]], - }, - }, - shortcut = { - { desc = "󰊳 Update", group = "@property", action = "Lazy update", key = "u" }, - { - icon = " ", - icon_hl = "@variable", - desc = "Files", - group = "Label", - action = "Telescope find_files", - key = "f", - }, - { - desc = " Apps", - group = "DiagnosticHint", - action = "Telescope app", - key = "a", - }, - { - desc = " dotfiles", - group = "Number", - action = "Telescope dotfiles", - key = "d", - }, - { - desc = " Restore Session", - group = "Number", - action = "require('persistence').load()", - key = "r", - }, - }, - }) - end, - dependencies = { "nvim-tree/nvim-web-devicons" }, - }, - { - "adelarsq/image_preview.nvim", - event = "VeryLazy", - config = function() - require("image_preview").setup() - end, - }, - { - "nyoom-engineering/oxocarbon.nvim", - lazy = false, - config = function() - -- vim.cmd.colorscheme("oxocarbon") - end, - }, - -- TODO: fix - -- { - -- "max397574/better-escape.nvim", - -- lazy = false, - -- config = function() - -- require("better_escape").setup({ - -- mapping = { "jk", "jj" }, - -- timeout = 100, - -- clear_empty_lines = false, - -- keys = function() - -- return vim.api.nvim_win_get_cursor(0)[2] > 1 and "l" or "" - -- end, - -- }) - -- end, - -- }, - { - "jsit/toast.vim", - lazy = false, - config = function() - -- vim.cmd "set background=light" - -- vim.cmd.colorscheme "toast" - end, - }, - { - "folke/persistence.nvim", - event = "BufReadPre", - opts = { options = vim.opt.sessionoptions:get() }, - -- stylua: ignore - keys = { - { "qs", function() require("persistence").load() end, desc = "Restore Session" }, - { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, - { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, - }, - }, - { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 200 - end, - opts = {}, - }, - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - "s1n7ax/nvim-window-picker", - }, - keys = { - { "e", "Neotree position=float reveal toggle", desc = "Neotree" }, - }, - config = function() - require("neo-tree").setup({ - sources = { "filesystem", "document_symbols" }, - filesystem = { - filtered_items = { - visible = true, -- when true, they will just be displayed differently than normal items - hide_dotfiles = true, - hide_gitignored = true, - }, - }, - window = { - mappings = { - [""] = "none", - ["Y"] = { - function(state) - local node = state.tree:get_node() - local path = node:get_id() - vim.fn.setreg("+", path, "c") - end, - desc = "Copy Path to Clipboard", - }, - ["O"] = { - function(state) - require("lazy.util").open(state.tree:get_node().path, { system = true }) - end, - desc = "Open with System Application", - }, - }, - }, - }) - end, - }, - -- { - -- "nvim-treesitter/nvim-treesitter", - -- event = "VeryLazy", - -- dependencies = { - -- "RRethy/nvim-treesitter-endwise", - -- }, - -- config = function() - -- require("nvim-treesitter.configs").setup({ - -- ensure_installed = { "lua", "vim", "ruby", "bibtex", "yaml" }, - -- ignore_install = { "latex" }, - -- auto_install = true, - -- endwise = { - -- enable = true, - -- }, - -- highlight = { - -- enable = true, - -- }, - -- }) - -- end, - -- }, - { - "stevearc/oil.nvim", - opts = { - default_file_explorer = true, - columns = { - "icon", - }, - view_options = { - show_hidden = true, - }, - float = { - max_width = 142, - preview_split = "right", - }, - }, - dependencies = { "nvim-tree/nvim-web-devicons" }, - keys = { - { "-", "Oil", desc = "Oil" }, - }, - }, - { - "FeiyouG/commander.nvim", - dependencies = { - "nvim-telescope/telescope.nvim", - }, - keys = { - { "tp", "Telescope commander", mode = "n" }, - { "tc", "Telescope commander", mode = "n" }, - }, - config = function() - require("commander").setup({ - components = { - "DESC", - "KEYS", - "CAT", - }, - sort_by = { - "DESC", - "KEYS", - "CAT", - "CMD", - }, - integration = { - telescope = { - enable = true, - }, - lazy = { - enable = true, - set_plugin_name_as_cat = true, - }, - }, - }) - end, - }, - { - "echasnovski/mini.indentscope", - version = "*", - lazy = false, - config = function() end, - }, - { - "lukas-reineke/indent-blankline.nvim", - main = "ibl", - lazy = true, - config = { - exclude = { - filetypes = { - "lspinfo", - "packer", - "checkhealth", - "help", - "man", - "gitcommit", - "TelescopePrompt", - "TelescopeResults", - "Dashboard", - }, - }, - }, - keys = { - { - "ibl", - "IBLToggleScope", - }, - }, - }, - { - "jlanzarotta/bufexplorer", - lazy = false, - }, - { - "nvim-pack/nvim-spectre", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - }, - config = function() - require("spectre").setup() - end, - keys = { - { - mode = "n", - "S", - 'lua require("spectre").toggle()', - desc = "Toggle Spectre", - }, - { - mode = "n", - "sw", - 'lua require("spectre").open_visual({select_word=true})', - desc = "Search current word", - }, - { - mode = "v", - "sw", - 'lua require("spectre").open_visual()', - desc = "Search current word", - }, - { - mode = "n", - "sp", - 'lua require("spectre").open_file_search({select_word=true})', - desc = "Search on current file", - }, - }, - }, - { - "folke/trouble.nvim", - lazy = false, - keys = { - { - "j", - function() - require("trouble").next({ skip_groups = true, jump = true }) - end, - }, - { - "k", - function() - require("trouble").previous({ skip_groups = true, jump = true }) - end, - }, - }, - }, - { - "folke/todo-comments.nvim", - cmd = { "TodoTrouble", "TodoTelescope" }, - event = "VeryLazy", - config = true, - -- stylua: ignore - keys = { - { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" }, - { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" }, - { "xt", "TodoTrouble", desc = "Todo (Trouble)" }, - { "xT", "TodoTrouble keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme (Trouble)" }, - { "st", "TodoTelescope", desc = "Todo" }, - { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, - }, - }, - { - "akinsho/toggleterm.nvim", - version = "*", - opts = function() - require("toggleterm").setup({ - float_opts = { - border = "curved", - }, - }) - - opts = {} - vim.keymap.set("t", "", [[]], opts) - vim.keymap.set("t", "jk", [[]], opts) - end, - keys = { - { "!", "ToggleTerm direction=float", desc = "Toggle Terminal" }, - }, - }, - { - "simrat39/symbols-outline.nvim", - config = function() - require("symbols-outline").setup() - end, - keys = { - { "so", "SymbolsOutline", desc = "SymbolsOutline" }, - }, - }, - -- { - -- "brenoprata10/nvim-highlight-colors", - -- event = "VeryLazy", - -- config = function() - -- require('nvim-highlight-colors').setup({}) - -- end - -- }, - { - "ThePrimeagen/harpoon", - event = "VeryLazy", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - require("harpoon").setup({}) - end, - keys = { - { - "1", - function() - require("harpoon.ui").nav_file(1) - end, - desc = "Harpoon file 1", - }, - { - "2", - function() - require("harpoon.ui").nav_file(2) - end, - desc = "Harpoon file 2", - }, - { - "3", - function() - require("harpoon.ui").nav_file(3) - end, - desc = "Harpoon file 3", - }, - { - "4", - function() - require("harpoon.ui").nav_file(4) - end, - desc = "Harpoon file 4", - }, - { - "5", - function() - require("harpoon.ui").nav_file(5) - end, - desc = "Harpoon file 5", - }, - { - "6", - function() - require("harpoon.ui").nav_file(6) - end, - desc = "Harpoon file 6", - }, - { - "7", - function() - require("harpoon.ui").nav_file(7) - end, - desc = "Harpoon file 7", - }, - { - "8", - function() - require("harpoon.ui").nav_file(8) - end, - desc = "Harpoon file 8", - }, - { - "9", - function() - require("harpoon.ui").nav_file(9) - end, - desc = "Harpoon file 9", - }, - { - "hh", - function() - require("harpoon.ui").toggle_quick_menu() - end, - desc = "Harpoon toggle quick menu", - }, - { - "H", - function() - require("harpoon.mark").add_file() - end, - desc = "Harpoon add file", - }, - }, - }, - { - "smjonas/inc-rename.nvim", - config = function() - require("inc_rename").setup() - end, - lazy = false, - }, - { "echasnovski/mini.ai", version = false, lazy = false }, - } diff --git a/.config/nvim/lua/plugins/fun.lua b/.config/nvim/lua/plugins/fun.lua deleted file mode 100644 index 4d4835d..0000000 --- a/.config/nvim/lua/plugins/fun.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - -- { - -- "NStefan002/speedtyper.nvim", - -- cmd = "Speedtyper", - -- opts = {}, - -- { - -- "m4xshen/hardtime.nvim", - -- lazy = false, - -- dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" }, - -- opts = {} - -- }, - -- } -} diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua deleted file mode 100644 index 62015bb..0000000 --- a/.config/nvim/lua/plugins/git.lua +++ /dev/null @@ -1,197 +0,0 @@ -return { - { - "kdheepak/lazygit.nvim", - dependencies = { - "nvim-telescope/telescope.nvim", - }, - cmd = { - "LazyGit", - "LazyGitConfig", - "LazyGitCurrentFile", - "LazyGitFilter", - "LazyGitFilterCurrentFile", - }, - keys = { - { "ng", "LazyGit", desc = "LazyGit" }, - }, - config = function() - require("telescope").load_extension("lazygit") - vim.g.lazygit_floating_window_winblend = 0 - vim.g.lazygit_floating_window_scaling_factor = 1 - vim.g.lazygit_floating_window_use_plenary = 0 - vim.g.lazygit_use_neovim_remote = 1 - vim.g.lazygit_config_file_path = "" - end, - }, - { - "tpope/vim-fugitive", - cmd = { "Git" }, - }, - { - "lewis6991/gitsigns.nvim", - lazy = false, - opts = { - numhl = true, - current_line_blame_opts = { - virt_text_pos = "right_align", - delay = 0, - }, - show_deleted = false, - update_debounce = 100, - on_attach = function(bufnr) - local gitsigns = require("gitsigns") - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map("n", "]c", function() - if vim.wo.diff then - vim.cmd.normal({ "]c", bang = true }) - else - gitsigns.nav_hunk("next") - end - end, { desc = "Next Hunk" }) - - map("n", "[c", function() - if vim.wo.diff then - vim.cmd.normal({ "[c", bang = true }) - else - gitsigns.nav_hunk("prev") - end - end, { desc = "Previous Hunk" }) - end, - }, - keys = { - { - "hs", - function() - require("gitsigns").stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) - end, - desc = "stage_hunk", - mode = "v", - }, - { - "hr", - function() - require("gitsigns").reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) - end, - desc = "reset_hunk", - mode = "v", - }, - { - "ih", - ":Gitsigns select_hunk", - mode = { "o", "x" }, - }, - { - "hb", - function() - require("gitsigns").blame_line({ full = true }) - end, - desc = "blame_line", - }, - { - "hD", - function() - require("gitsigns").diffthis("~") - end, - desc = "diffthis", - }, - { - "hs", - function() - require("gitsigns").stage_hunk() - end, - desc = "stage_hunk", - }, - { - "hr", - function() - require("gitsigns").reset_hunk() - end, - desc = "reset_hunk", - }, - { - "hS", - function() - require("gitsigns").stage_buffer() - end, - desc = "stage_buffer", - }, - { - "hu", - function() - require("gitsigns").undo_stage_hunk() - end, - desc = "undo_stage_hunk", - }, - { - "hR", - function() - require("gitsigns").reset_buffer() - end, - desc = "reset_buffer", - }, - { - "hp", - function() - require("gitsigns").preview_hunk() - end, - desc = "preview_hunk", - }, - { - "tb", - function() - require("gitsigns").toggle_current_line_blame() - end, - desc = "toggle_current_line_blame", - }, - { - "hd", - function() - require("gitsigns").diffthis() - end, - desc = "diffthis", - }, - { - "td", - function() - require("gitsigns").toggle_deleted() - end, - desc = "toggle_deleted", - }, - }, - }, - { - "NeogitOrg/neogit", - lazy = false, - opts = { }, - dependencies = { - "nvim-lua/plenary.nvim", - "sindrets/diffview.nvim", - "nvim-telescope/telescope.nvim", - }, - keys = { - { "gg", "Neogit", desc = "Neogit" }, - }, - }, - { "junkblocker/git-time-lapse", commands = { "GitTimeLapse" }, lazy = false }, - -- { - -- "ldelossa/gh.nvim", - -- dependencies = { - -- { - -- "ldelossa/litee.nvim", - -- config = function() - -- require("litee.lib").setup() - -- end, - -- }, - -- }, - -- config = function() - -- require("litee.gh").setup() - -- end, - -- } -} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua deleted file mode 100644 index 7ae8d28..0000000 --- a/.config/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,377 +0,0 @@ -return { - { - "ThePrimeagen/refactoring.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - keys = { - { - "rr", - function() - require("refactoring").select_refactor() - end, - desc = "Refactor", - }, - }, - }, - { - "zbirenbaum/copilot.lua", - cmd = "Copilot", - event = "InsertEnter", - }, - { - "zbirenbaum/copilot-cmp", - lazy = false, - event = "InsertEnter", - config = function() - require("copilot_cmp").setup() - require("copilot").setup({ - suggestion = { enabled = false }, - panel = { enabled = false }, - }) - end, - }, - { - "CopilotC-Nvim/CopilotChat.nvim", - lazy = false, - dependencies = { - { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim - { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper - }, - commands = { - "CopilotChat", - "CopilotChat", - "CopilotChatOpen", - "CopilotChatClose", - "CopilotChatToggle", - "CopilotChatStop", - "CopilotChatReset", - "CopilotChatSave", - "CopilotChatLoad", - "CopilotChatDebugInfo", - "CopilotChatModels", - "CopilotChatExplain", - "CopilotChatReview", - "CopilotChatFix", - "CopilotChatOptimize", - "CopilotChatDocs", - "CopilotChatTests", - "CopilotChatFixDiagnostic", - "CopilotChatCommit", - "CopilotChatCommitStaged", - }, - opts = { - temperature = 0.3, - mappings = { - reset = { - normal = "", - insert = "", - }, - complete = { - detail = "Use @ or / for options.", - insert = "", - }, - close = { - normal = "q", - insert = "", - }, - submit_prompt = { - normal = "", - insert = "", - }, - accept_diff = { - normal = "", - insert = "", - }, - yank_diff = { - normal = "gy", - }, - show_diff = { - normal = "gd", - }, - show_system_prompt = { - normal = "gp", - }, - show_user_selection = { - normal = "gs", - }, - }, - }, - keys = { - { - "ccq", - function() - local input = vim.fn.input("Quick Chat: ") - if input ~= "" then - require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) - end - end, - desc = "CopilotChat - Quick chat", - }, - { - "cch", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.help_actions()) - end, - desc = "CopilotChat - Help actions", - }, - -- Show prompts actions with telescope - { - "ccp", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) - end, - desc = "CopilotChat - Prompt actions", - }, - }, - }, - { - "williamboman/mason.nvim", - lazy = false, - keys = { - { "m", "Mason" }, - }, - config = function() - require("mason").setup() - end, - }, - { - "williamboman/mason-lspconfig.nvim", - lazy = false, - opts = { - ensure_installed = { "lua_ls", "tsserver", "solargraph" }, - }, - }, - { - "nvim-lspconfig", - lazy = false, - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() - -- https://www.mitchellhanberg.com/modern-format-on-save-in-neovim/ - -- vim.api.nvim_create_autocmd("LspAttach", { - -- group = vim.api.nvim_create_augroup("lsp", { clear = true }), - -- callback = function(args) - -- vim.api.nvim_create_autocmd("BufWritePre", { - -- buffer = args.buf, - -- callback = function() - -- vim.lsp.buf.format({ async = false, id = args.data.client_id }) - -- end, - -- }) - -- end, - -- }) - - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup({ capabilities = capabilities }) - lspconfig.tsserver.setup({ capabilities = capabilities }) - -- lspconfig.standardrb.setup({ capabilities = capabilities }) - -- lspconfig.rubocop.setup({ capabilities = capabilities }) - -- lspconfig.rust_analyzer.setup({ capabilities = capabilities }) - lspconfig.ltex.setup({ - cmd = { "ltex-ls" }, - filetypes = { "markdown", "text", "cff", "tex" }, - flags = { debounce_text_changes = 299 }, - }) - lspconfig.astro.setup({}) - - lspconfig.solargraph.setup({ - capabilities = capabilities, - cmd = { - "asdf", - "exec", - "solargraph", - "stdio", - }, - settings = { - solargraph = { - autoformat = false, - completion = true, - diagnostic = true, - folding = true, - references = true, - rename = true, - symbols = true, - }, - }, - }) - - vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) - vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) - vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) - vim.cmd([[ - autocmd BufNewFile,BufRead *.prawn set filetype=ruby - ]]) - end, - }, - { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.disable({ "rubocop" }) - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.diagnostics.erb_format, - null_ls.builtins.formatting.erb_lint, - }, - }) - end, - keys = { - { "gf", vim.lsp.buf.format }, - }, - }, - { - "hrsh7th/cmp-nvim-lsp", - lazy = false, - }, - { - "L3MON4D3/LuaSnip", - dependencies = { - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets", - }, - keys = { - { - "", - function() - return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" - end, - expr = true, - silent = true, - mode = "i", - }, - { - "", - function() - require("luasnip").jump(1) - end, - mode = "s", - }, - { - "", - function() - require("luasnip").jump(-1) - end, - mode = { "i", "s" }, - }, - }, - }, - { - "hrsh7th/nvim-cmp", - lazy = false, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-cmdline", - "rafamadriz/friendly-snippets", - }, - config = function() - local cmp = require("cmp") - local luasnip = require("luasnip") -- TAB AUTO COMPLETE - require("luasnip.loaders.from_vscode").lazy_load() - - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end -- TAB AUTOCOMPLETE - - cmp.setup({ - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- they way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }),-- TAB AUTO COMPLETE - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }),-- TAB AUTO COMPLETE - }), - sources = cmp.config.sources({ - { name = "copilot", group_index = 2 }, - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - }), - }) - end, - }, - { - "zbirenbaum/copilot-cmp", - event = "InsertEnter", - }, - -- { - -- "nvim-treesitter/nvim-treesitter-refactor", - -- lazy = false, - -- config = function() - -- require("nvim-treesitter.configs").setup({ - -- refactor = { - -- highlight_definitions = { - -- enable = true, - -- clear_on_cursor_move = true, - -- }, - -- highlight_current_scope = { enable = false }, - -- smart_rename = { - -- enable = true, - -- -- Assign keymaps to false to disable them, e.g. `smart_rename = false`. - -- keymaps = { - -- smart_rename = "grr", - -- }, - -- }, - -- navigation = { - -- enable = true, - -- -- Assign keymaps to false to disable them, e.g. `goto_definition = false`. - -- keymaps = { - -- goto_definition = "gnd", - -- list_definitions = "gnD", - -- list_definitions_toc = "gO", - -- goto_next_usage = "", - -- goto_previous_usage = "", - -- }, - -- }, - -- }, - -- }) - -- end, - -- }, - -- { - -- "cuducos/yaml.nvim", - -- ft = { "yaml" }, -- optional - -- dependencies = { - -- "nvim-treesitter/nvim-treesitter", - -- "nvim-telescope/telescope.nvim", -- optional - -- }, - -- } -} diff --git a/.config/nvim/lua/plugins/navigation.lua b/.config/nvim/lua/plugins/navigation.lua deleted file mode 100644 index 6dbecc1..0000000 --- a/.config/nvim/lua/plugins/navigation.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - { "christoomey/vim-tmux-navigator", lazy = false }, - { - "folke/flash.nvim", - event = "VeryLazy", - ---@type Flash.Config - opts = {}, - -- stylua: ignore - keys = { - { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, - -- { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, - { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, - { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, - { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, - }, - } -} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua deleted file mode 100644 index 36ddd2c..0000000 --- a/.config/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,117 +0,0 @@ -return { - { - "nvim-telescope/telescope.nvim", - tag = "0.1.6", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-lua/popup.nvim", - "nvim-telescope/telescope-live-grep-args.nvim", - "nvim-telescope/telescope-media-files.nvim", - "nvim-telescope/telescope.nvim", - "erlingur/telescope-rails-db-schema", - }, - config = function() - local telescope = require("telescope") - telescope.load_extension("live_grep_args") - telescope.load_extension("media_files") - telescope.load_extension("rails_db_schema") - telescope.setup({ - pickers = { - colorscheme = { - enable_preview = true, - }, - }, - }) - end, - keys = { - { - "f", - "Telescope find_files hidden=true", - desc = "Telescope File", - }, - { - "tr", - "Telescope resume", - desc = "Telescope Resume", - }, - { - "n", - "Telescope find_files search_dirs={'~/.config/nvim/'}", - desc = "Telescope Config", - }, - { - "tg", - "Telescope git_files", - desc = "Telescope Git File", - }, - { - "tb", - "Telescope buffers", - desc = "Telescope Buffer", - }, - { - "tw", - "Telescope grep_string", - desc = "Telescope Grep", - }, - { - "w", - "Telescope live_grep", - desc = "Telescope Grep", - }, - { - "tq", - "Telescope quickfix", - desc = "Telescope Quickfix", - }, - { - "r", - function() - local word = vim.fn.expand("") - require("telescope.builtin").grep_string( - -- require('telescope.themes').get_cursor({}) - -- { - -- search = word, - -- only_sort_text = true, - -- layout_strategy = "vertical", - -- } - ) - end, - desc = "Telescope grep current word", - }, - { - "R", - function() - local filename = vim.fn.expand("") - require("telescope.builtin").find_files({ - prompt_prefix = "🔍", - find_command = { "rg", "--files", "--hidden", "--ignore", "--glob", "!*.git/*" }, - }) - end, - desc = "Telescope find file under cursor", - }, - { - "tg", - ":lua require('telescope').extensions.live_grep_args.live_grep_args()", - desc = "Telescope Grep Args", - }, - { "tk", "Telescope keymaps", desc = "Telescope Keymap" }, - { "", "Telescope commands", desc = "Telescope Command" }, - { "td", ":Telescope rails_db_schema", desc = "Telescope Rails db schema" }, - }, - }, - { - "nvim-telescope/telescope-ui-select.nvim", - lazy = false, - config = function() - require("telescope").setup({ - extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown({}), - }, - }, - }) - require("telescope").load_extension("ui-select") - end, - }, -} diff --git a/.config/nvim/lua/plugins/testing.lua b/.config/nvim/lua/plugins/testing.lua deleted file mode 100644 index 6bea093..0000000 --- a/.config/nvim/lua/plugins/testing.lua +++ /dev/null @@ -1,42 +0,0 @@ -return { - { - "nvim-neotest/neotest", - modules = { "neotest" }, - events = { "InsertEnter" }, - cmd = { "Neotest" }, - dependencies = { - "nvim-neotest/nvim-nio", - "nvim-lua/plenary.nvim", - "antoinemadec/FixCursorHold.nvim", - "nvim-treesitter/nvim-treesitter", - "olimorris/neotest-rspec", - "zidhuss/neotest-minitest" - }, - config = function() - require("neotest").setup({ - adapters = { - require("neotest-minitest"), - require("neotest-rspec")({ - rspec_cmd = function() - return vim.tbl_flatten({ - "bundle", - "exec", - "rspec", - }) - end, - }), - }, - }) - end, - keys = { - { "tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, - { "tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files" }, - { "tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, - { "tl", function() require("neotest").run.run_last() end, desc = "Run Last" }, - { "ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" }, - { "to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" }, - { "tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" }, - { "tS", function() require("neotest").run.stop() end, desc = "Stop" }, - }, - }, -} From 2a53202100ba655bbd2d23a3038afd48beb0ed24 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 19:21:03 +0200 Subject: [PATCH 114/280] Add theme, basic vim opts --- .config/nvim/init.lua | 22 +++++- .config/nvim/lazy-lock.json | 86 +----------------------- .config/nvim/lua/plugins/colorscheme.lua | 8 +++ 3 files changed, 29 insertions(+), 87 deletions(-) create mode 100644 .config/nvim/lua/plugins/colorscheme.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index a1a284c..f2c7a2c 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,3 +1,19 @@ +vim.g.mapleader = " " +vim.opt.cursorline = true +vim.opt.cursorcolumn = true +vim.opt.termguicolors = true +vim.wo.number = true +vim.wo.relativenumber = true +vim.opt.expandtab = true +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.scrolloff = 10 + +vim.keymap.set("n", "n", "nzz") +vim.keymap.set("n", "N", "Nzz") + +vim.api.nvim_set_keymap('n', '@', '@q', {noremap = true}) + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ @@ -5,14 +21,16 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release + "--branch=stable", lazypath, }) end vim.opt.rtp:prepend(lazypath) -local plugins = { } +local plugins = { + { import = "plugins" } +} local opts = { defaults = { lazy = true } } diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index c0f164e..b528434 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,88 +1,4 @@ { - "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "CopilotChat.nvim": { "branch": "canary", "commit": "f20a0425b33c1704133bdef5ec10c4e94f6efdc6" }, - "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, - "autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" }, - "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, - "bufexplorer": { "branch": "master", "commit": "2308e87960c05bd8da7bbf62c903e1f42d6cc9b9" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "commander.nvim": { "branch": "main", "commit": "84101e8eb1613a72bbdec655b734f891d8a00694" }, - "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, - "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, - "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" }, - "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, - "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "git-time-lapse": { "branch": "master", "commit": "3b6f38ec13af04a29e822efda15c36b69f6972ff" }, - "gitsigns.nvim": { "branch": "main", "commit": "f074844b60f9e151970fbcdbeb8a2cd52b6ef25a" }, - "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, - "image_preview.nvim": { "branch": "main", "commit": "8de950078bdecf1916e8dbddfbee451e095b023c" }, - "inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" }, - "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, - "lazygit.nvim": { "branch": "main", "commit": "dc56df433bfbf107fee0139e187eb9750878fa84" }, - "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "ba9c2f0b93deb48d0a99ae0e8d8dd36f7cc286d6" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "mini.ai": { "branch": "main", "commit": "45587078f323eaf41b9f701bbc04f8d1ab008979" }, - "mini.indentscope": { "branch": "main", "commit": "f0d7faa064c892b96997810afcddfadc3f2a15b3" }, - "moonfly": { "branch": "master", "commit": "d69a263c97cbc765ca442d682b3283aefd61d4ac" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, - "neoconf.nvim": { "branch": "main", "commit": "08ebe382a9db91e7f5d3991156b8fab7afbbe9b2" }, - "neogit": { "branch": "master", "commit": "2b74a777b963dfdeeabfabf84d5ba611666adab4" }, - "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, - "neotest-minitest": { "branch": "main", "commit": "0543bf4e997b2c970707cb297e2f74c438eb0653" }, - "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, - "none-ls.nvim": { "branch": "main", "commit": "a8594ef3dabb484adabc0ebbf5800be1b807c9e7" }, - "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, - "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, - "nvim-lspconfig": { "branch": "master", "commit": "f95d371c1a274f60392edfd8ea5121b42dca736e" }, - "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-spectre": { "branch": "master", "commit": "9a28f926d3371b7ef02243cbbb653a0478d06e31" }, - "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "e265fec94c7dc0c8c64cb86820ff5ad3ee135c7d" }, - "nvim-ts-autotag": { "branch": "main", "commit": "0cb76eea80e9c73b88880f0ca78fbd04c5bdcac7" }, - "nvim-web-devicons": { "branch": "master", "commit": "e612de3d3a41a6b7be47f51e956dddabcbf419d9" }, - "nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }, - "oil.nvim": { "branch": "master", "commit": "71c972fbd218723a3c15afcb70421f67340f5a6d" }, - "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, - "other.nvim": { "branch": "main", "commit": "63f587dde62149bd2ed3e31edceb49d5c4097a26" }, - "oxocarbon.nvim": { "branch": "main", "commit": "c5846d10cbe4131cc5e32c6d00beaf59cb60f6a2" }, - "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, - "plantuml-previewer.vim": { "branch": "master", "commit": "1dd4d0f2b09cd80a217f76d82f93830dbbe689b3" }, - "plantuml-syntax": { "branch": "master", "commit": "8fb95a3ae4354ca2322ef24803d8960fce519eb0" }, - "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, - "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "refactoring.nvim": { "branch": "master", "commit": "ac70bb714f30886e79461869871174a1c1d52058" }, - "remote-sshfs.nvim": { "branch": "main", "commit": "03f6c40c4032eeb1ab91368e06db9c3f3a97a75d" }, - "rustaceanvim": { "branch": "master", "commit": "047f9c9d8cd2861745eb9de6c1570ee0875aa795" }, - "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, - "telescope-live-grep-args.nvim": { "branch": "master", "commit": "8ad632f793fd437865f99af5684f78300dac93fb" }, - "telescope-media-files.nvim": { "branch": "master", "commit": "0826c7a730bc4d36068f7c85cf4c5b3fd9fb570a" }, - "telescope-rails-db-schema": { "branch": "master", "commit": "99b4a280aa69c69d40b1dc9c119c39a098a2b1a4" }, - "telescope-rails.nvim": { "branch": "master", "commit": "e0addf3751b0af1fc0bc4706ff25ba73949a98ae" }, - "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, - "toast.vim": { "branch": "master", "commit": "6ef5cea8298e64a555cfaf7541bb94781d06dc69" }, - "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, - "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, - "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, - "vim-fugitive": { "branch": "master", "commit": "0444df68cd1cdabc7453d6bd84099458327e5513" }, - "vim-grammarous": { "branch": "master", "commit": "db46357465ce587d5325e816235b5e92415f8c05" }, - "vim-highlightedyank": { "branch": "master", "commit": "afb0f262b490706c23e94012c2ab9fa67c0481ce" }, - "vim-moonfly-colors": { "branch": "master", "commit": "4f7d18cb471ede7407dd966c7563868cae7f4f99" }, - "vim-rails": { "branch": "master", "commit": "2fba7907f585819a8653f0bc7dd7f437a822d9c6" }, - "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, - "vim-slim": { "branch": "master", "commit": "a0a57f75f20a03d5fa798484743e98f4af623926" }, - "vim-system-copy": { "branch": "master", "commit": "8abd9ed21016bdc21b458c79da3b9ac0ee25c1ce" }, - "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }, - "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" }, - "vimtex": { "branch": "master", "commit": "5ac62e0315c6f54f53a7d6da7c485cf8e9cf7240" }, - "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" }, - "yaml-revealer": { "branch": "master", "commit": "0476c6ead1111f8dbe993be76a75c867ef76ea6b" } + "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" } } diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..6ef5fcb --- /dev/null +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -0,0 +1,8 @@ +return { + "tiagovla/tokyodark.nvim", + lazy = false, + priority = 1000, + config = function() + vim.cmd("colorscheme tokyodark") + end, +} From e32c67108293cf044c4f6164022ce7b52ef8ace6 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 19:35:06 +0200 Subject: [PATCH 115/280] Add sum plugins --- .config/nvim/lazy-lock.json | 4 ++++ .config/nvim/lua/plugins/gitsigns.lua | 7 +++++++ .config/nvim/lua/plugins/nvim-surround.lua | 8 ++++++++ .config/nvim/lua/plugins/telescope.lua | 5 +++++ 4 files changed, 24 insertions(+) create mode 100644 .config/nvim/lua/plugins/gitsigns.lua create mode 100644 .config/nvim/lua/plugins/nvim-surround.lua create mode 100644 .config/nvim/lua/plugins/telescope.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index b528434..c9dc9b6 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,4 +1,8 @@ { + "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, + "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" } } diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..cf49d8b --- /dev/null +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,7 @@ +return { + "lewis6991/gitsigns.nvim", + lazy = false, + config = function() + require('gitsigns').setup() + end +} diff --git a/.config/nvim/lua/plugins/nvim-surround.lua b/.config/nvim/lua/plugins/nvim-surround.lua new file mode 100644 index 0000000..d4078fd --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-surround.lua @@ -0,0 +1,8 @@ +return { + "kylechui/nvim-surround", + version = "*", + event = "VeryLazy", + config = function() + require("nvim-surround").setup() + end +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..335bcc6 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,5 @@ +return { + 'nvim-telescope/telescope.nvim', tag = '0.1.8', + dependencies = { 'nvim-lua/plenary.nvim' }, + lazy = false +} From 7e391c7630faea50942e06a518d10f9dd255659b Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 20:33:00 +0200 Subject: [PATCH 116/280] Add persistence --- .config/nvim/lazy-lock.json | 1 + .config/nvim/lua/plugins/persistence.lua | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 .config/nvim/lua/plugins/persistence.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index c9dc9b6..2a18aed 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -2,6 +2,7 @@ "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, + "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" } diff --git a/.config/nvim/lua/plugins/persistence.lua b/.config/nvim/lua/plugins/persistence.lua new file mode 100644 index 0000000..ba088d1 --- /dev/null +++ b/.config/nvim/lua/plugins/persistence.lua @@ -0,0 +1,8 @@ +return { + "folke/persistence.nvim", + event = "BufReadPre", + opts = {}, + keys = { + { "s", function() require("persistence").load() end } + } +} From db2b8958248e81993c94d12b6071fe29e770e1cd Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 20:33:08 +0200 Subject: [PATCH 117/280] Add gitsigns --- .config/nvim/lua/plugins/gitsigns.lua | 34 +++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua index cf49d8b..01db537 100644 --- a/.config/nvim/lua/plugins/gitsigns.lua +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -2,6 +2,36 @@ return { "lewis6991/gitsigns.nvim", lazy = false, config = function() - require('gitsigns').setup() - end + require("gitsigns").setup({ + numhl = true, + attach_to_untracked = true, + update_debounce = 10, + on_attach = function(bufnr) + local gitsigns = require("gitsigns") + end, + }) + end, + keys = { + -- Navigation + { "]c", function() if vim.wo.diff then vim.cmd("normal! ]c") else require("gitsigns").next_hunk() end end, mode = "n", desc = "Next Git hunk" }, + { "[c", function() if vim.wo.diff then vim.cmd("normal! [c") else require("gitsigns").prev_hunk() end end, mode = "n", desc = "Previous Git hunk" }, + + -- Actions + { "hs", ":Gitsigns stage_hunk", mode = "n", desc = "Stage Hunk" }, + { "hr", ":Gitsigns reset_hunk", mode = "n", desc = "Reset Hunk" }, + { "hs", function() require("gitsigns").stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end, mode = "v", desc = "Stage Hunk" }, + { "hr", function() require("gitsigns").reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) end, mode = "v", desc = "Reset Hunk" }, + { "hS", ":Gitsigns stage_buffer", mode = "n", desc = "Stage Buffer" }, + { "hu", ":Gitsigns undo_stage_hunk", mode = "n", desc = "Undo Stage Hunk" }, + { "hR", ":Gitsigns reset_buffer", mode = "n", desc = "Reset Buffer" }, + { "hp", ":Gitsigns preview_hunk", mode = "n", desc = "Preview Hunk" }, + { "hb", function() require("gitsigns").blame_line({ full = true }) end, mode = "n", desc = "Blame Line" }, + { "tb", ":Gitsigns toggle_current_line_blame", mode = "n", desc = "Toggle Blame" }, + { "hd", ":Gitsigns diffthis", mode = "n", desc = "Diff This" }, + { "hD", function() require("gitsigns").diffthis("~") end, mode = "n", desc = "Diff This ~" }, + { "td", ":Gitsigns toggle_deleted", mode = "n", desc = "Toggle Deleted" }, + + -- Text object + { "ih", ":Gitsigns select_hunk", mode = { "o", "x" }, desc = "Select Hunk" }, + }, } From 4f5d69ced28e65e89c6d3296bedc1014778807ca Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 20:33:13 +0200 Subject: [PATCH 118/280] Add telescope bindings Fix telescope --- .config/nvim/lua/plugins/telescope.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 335bcc6..b1acb23 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -1,5 +1,9 @@ return { 'nvim-telescope/telescope.nvim', tag = '0.1.8', dependencies = { 'nvim-lua/plenary.nvim' }, - lazy = false + keys = { + { "f", "Telescope find_files hidden=true" }, + { "w", "Telescope live_grep" }, + { "r", "Telescope resume" }, + } } From 799dd8609944487a878b65ffab7e6794e5c239a1 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 20:33:21 +0200 Subject: [PATCH 119/280] Improve init.lua --- .config/nvim/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index f2c7a2c..9261b3d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -11,6 +11,8 @@ vim.opt.scrolloff = 10 vim.keymap.set("n", "n", "nzz") vim.keymap.set("n", "N", "Nzz") +vim.keymap.set("n", "Q", ":quit") +vim.keymap.set("n", "/", "noh") vim.api.nvim_set_keymap('n', '@', '@q', {noremap = true}) @@ -32,6 +34,6 @@ local plugins = { { import = "plugins" } } -local opts = { defaults = { lazy = true } } +local opts = { defaults = { lazy = true }, change_detection = { notify = false } } require("lazy").setup(plugins, opts) From 56752a96ce3120473b58776be23f80c5d51d7b38 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 20:53:29 +0200 Subject: [PATCH 120/280] Add oil.nvim --- .config/nvim/init.lua | 2 +- .config/nvim/lazy-lock.json | 2 ++ .config/nvim/lua/plugins/oil.lua | 40 ++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .config/nvim/lua/plugins/oil.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 9261b3d..2dd8260 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -11,7 +11,7 @@ vim.opt.scrolloff = 10 vim.keymap.set("n", "n", "nzz") vim.keymap.set("n", "N", "Nzz") -vim.keymap.set("n", "Q", ":quit") +vim.keymap.set("n", "Q", ":quitall") vim.keymap.set("n", "/", "noh") vim.api.nvim_set_keymap('n', '@', '@q', {noremap = true}) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 2a18aed..9da8d5d 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,7 +1,9 @@ { "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, + "oil.nvim": { "branch": "master", "commit": "1fe476daf0b3c108cb8ee1fc1226cc282fa2c9c1" }, "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..bbb7c83 --- /dev/null +++ b/.config/nvim/lua/plugins/oil.lua @@ -0,0 +1,40 @@ +return { + 'stevearc/oil.nvim', + dependencies = { { "echasnovski/mini.icons", opts = {} } }, + lazy = false, + config = function() + require("oil").setup({ + columns = { + "icon", + "permissions", + "size", + "mtime", + }, + skip_confirm_for_simple_edits = true, + prompt_save_on_select_new_entry = true, + watch_for_changes = true, + keymaps = { + ["g?"] = "actions.show_help", + [""] = "actions.select", + [""] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" }, + [""] = { "actions.select", opts = { horizontal = true }, desc = "Open the entry in a horizontal split" }, + [""] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" }, + [""] = "actions.preview", + [""] = "actions.close", + [""] = "actions.refresh", + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + ["`"] = "actions.cd", + ["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory" }, + ["gs"] = "actions.change_sort", + }, + use_default_keymaps = false, + view_options = { + show_hidden = true, + }, + }) + end, + keys = { + { mode = "n", "-", "Oil" } + } +} From c91f998a56d6f864aa4cdb36bb5ed24b01a3424f Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 21:03:15 +0200 Subject: [PATCH 121/280] Add lazygit --- .config/nvim/lazy-lock.json | 1 + .config/nvim/lua/plugins/lazygit.lua | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .config/nvim/lua/plugins/lazygit.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 9da8d5d..4e6d2f7 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,6 +1,7 @@ { "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, "oil.nvim": { "branch": "master", "commit": "1fe476daf0b3c108cb8ee1fc1226cc282fa2c9c1" }, diff --git a/.config/nvim/lua/plugins/lazygit.lua b/.config/nvim/lua/plugins/lazygit.lua new file mode 100644 index 0000000..d1612fa --- /dev/null +++ b/.config/nvim/lua/plugins/lazygit.lua @@ -0,0 +1,19 @@ +return { + "kdheepak/lazygit.nvim", + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, + dependencies = { + "nvim-lua/plenary.nvim", + }, + keys = { + { "g", "LazyGit", desc = "LazyGit" } + }, + config = function() + vim.g.lazygit_floating_window_scaling_factor = 0.8 + end +} From 44993f06d04a0d0f859bd870380bc35c135fdee2 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 21:08:12 +0200 Subject: [PATCH 122/280] Add window keys --- .config/nvim/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 2dd8260..b7a3cc3 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -14,6 +14,11 @@ vim.keymap.set("n", "N", "Nzz") vim.keymap.set("n", "Q", ":quitall") vim.keymap.set("n", "/", "noh") +vim.api.nvim_set_keymap('n', '', ':wincmd k', { silent = true }) +vim.api.nvim_set_keymap('n', '', ':wincmd j', { silent = true }) +vim.api.nvim_set_keymap('n', '', ':wincmd h', { silent = true }) +vim.api.nvim_set_keymap('n', '', ':wincmd l', { silent = true }) + vim.api.nvim_set_keymap('n', '@', '@q', {noremap = true}) local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" From ecc5775ef718a2b82b4c5ae80e79087ec79e34a0 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 21:41:11 +0200 Subject: [PATCH 123/280] Update oil mappings --- .config/nvim/lua/plugins/oil.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index bbb7c83..9b92ee0 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -16,8 +16,8 @@ return { keymaps = { ["g?"] = "actions.show_help", [""] = "actions.select", - [""] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" }, - [""] = { "actions.select", opts = { horizontal = true }, desc = "Open the entry in a horizontal split" }, + [""] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" }, + [""] = { "actions.select", opts = { horizontal = true }, desc = "Open the entry in a horizontal split" }, [""] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" }, [""] = "actions.preview", [""] = "actions.close", From a8eeca77524fdc4dee0535d79ecfa58ca1ffb87d Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 21:41:21 +0200 Subject: [PATCH 124/280] Add maximize --- .config/nvim/lazy-lock.json | 1 + .config/nvim/lua/plugins/maximize.lua | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 .config/nvim/lua/plugins/maximize.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 4e6d2f7..29e2b95 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -2,6 +2,7 @@ "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, + "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, "oil.nvim": { "branch": "master", "commit": "1fe476daf0b3c108cb8ee1fc1226cc282fa2c9c1" }, diff --git a/.config/nvim/lua/plugins/maximize.lua b/.config/nvim/lua/plugins/maximize.lua new file mode 100644 index 0000000..040a92f --- /dev/null +++ b/.config/nvim/lua/plugins/maximize.lua @@ -0,0 +1,10 @@ +return { + 'declancm/maximize.nvim', + config = true, + cmd = { + 'Maximize' + }, + keys = { + { "", "Maximize" } + } +} From c63d03f3cf1c19e4b78b6907629dda1900ae8a7a Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 21:41:52 +0200 Subject: [PATCH 125/280] Add fugitive --- .config/nvim/lazy-lock.json | 1 + .config/nvim/lua/plugins/fugitive.lua | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 .config/nvim/lua/plugins/fugitive.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 29e2b95..7f481ec 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -10,4 +10,5 @@ "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" } + "vim-fugitive": { "branch": "master", "commit": "1d18c696c4284e9ce9467a5c04d3adf8af43f994" } } diff --git a/.config/nvim/lua/plugins/fugitive.lua b/.config/nvim/lua/plugins/fugitive.lua new file mode 100644 index 0000000..6e9b756 --- /dev/null +++ b/.config/nvim/lua/plugins/fugitive.lua @@ -0,0 +1,4 @@ +return { + "tpope/vim-fugitive", + lazy = false +} From 3cf389f7e92d37ad1763c7b39828e8b6b31500e2 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 21:41:59 +0200 Subject: [PATCH 126/280] Update windowbinds --- .config/nvim/init.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index b7a3cc3..99b9533 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -11,13 +11,17 @@ vim.opt.scrolloff = 10 vim.keymap.set("n", "n", "nzz") vim.keymap.set("n", "N", "Nzz") -vim.keymap.set("n", "Q", ":quitall") +vim.keymap.set("n", "Q", ":quit") +vim.keymap.set("n", "q", ":quitall") vim.keymap.set("n", "/", "noh") - -vim.api.nvim_set_keymap('n', '', ':wincmd k', { silent = true }) -vim.api.nvim_set_keymap('n', '', ':wincmd j', { silent = true }) -vim.api.nvim_set_keymap('n', '', ':wincmd h', { silent = true }) -vim.api.nvim_set_keymap('n', '', ':wincmd l', { silent = true }) +vim.api.nvim_set_keymap('n', '', '', { noremap = true, silent = true }) + +vim.opt.splitright = true +vim.opt.splitbelow = true +vim.keymap.set('n', '', ':wincmd k', { silent = true }) +vim.keymap.set('n', '', ':wincmd j', { silent = true }) +vim.keymap.set('n', '', ':wincmd h', { silent = true }) +vim.keymap.set('n', '', ':wincmd l', { silent = true }) vim.api.nvim_set_keymap('n', '@', '@q', {noremap = true}) From c222ca1b19ad3185df370482f2c2c11615546f42 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 21:42:04 +0200 Subject: [PATCH 127/280] Update tokyonight --- .config/nvim/lazy-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 7f481ec..7a2082d 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -9,6 +9,6 @@ "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" } + "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, "vim-fugitive": { "branch": "master", "commit": "1d18c696c4284e9ce9467a5c04d3adf8af43f994" } } From a84838c002682d76b8d2bf5733aa041ee4321215 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 23:17:45 +0200 Subject: [PATCH 128/280] Improve window movement --- .config/alacritty/alacritty.toml | 24 ++++++++++++++++++++++-- .config/nvim/init.lua | 3 +++ .config/nvim/lazy-lock.json | 1 + .config/nvim/lua/plugins/oil.lua | 4 ++-- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index c903929..7daade7 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,5 +1,5 @@ import = [ - "/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Solarized-Light.toml" + "/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Campbell.toml" ] [env] @@ -66,7 +66,27 @@ mods = "Command" [[keyboard.bindings]] key = "T" mods = "Command" -command = { program = "/opt/homebrew/bin/tmux", args = ["new-window", "/bin/zsh"] } +command = { program = "/opt/homebrew/bin/tmux", args = ["new-window"] } + +[[keyboard.bindings]] +key = "[" +mods = "Command" +command = { program = "/opt/homebrew/bin/tmux", args = ["previous-window"] } + +[[keyboard.bindings]] +key = "]" +mods = "Command" +command = { program = "/opt/homebrew/bin/tmux", args = ["next-window"] } + +[[keyboard.bindings]] +key = "d" +mods = "Command" +command = { program = "/opt/homebrew/bin/tmux", args = ["split", "-h"] } + +[[keyboard.bindings]] +key = "e" +mods = "Command" +command = { program = "/opt/homebrew/bin/tmux", args = ["split", "-v"] } [[keyboard.bindings]] key = "W" diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 99b9533..05e8566 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -22,6 +22,9 @@ vim.keymap.set('n', '', ':wincmd k', { silent = true }) vim.keymap.set('n', '', ':wincmd j', { silent = true }) vim.keymap.set('n', '', ':wincmd h', { silent = true }) vim.keymap.set('n', '', ':wincmd l', { silent = true }) +vim.keymap.set('n', '', ':wincmd =', { silent = true }) +vim.keymap.set('n', '', ':wincmd s', { silent = true }) +vim.keymap.set('n', '', ':wincmd v', { silent = true }) vim.api.nvim_set_keymap('n', '@', '@q', {noremap = true}) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 7a2082d..630785c 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -9,6 +9,7 @@ "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, "vim-fugitive": { "branch": "master", "commit": "1d18c696c4284e9ce9467a5c04d3adf8af43f994" } } diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index 9b92ee0..bc3697a 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -16,8 +16,8 @@ return { keymaps = { ["g?"] = "actions.show_help", [""] = "actions.select", - [""] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" }, - [""] = { "actions.select", opts = { horizontal = true }, desc = "Open the entry in a horizontal split" }, + [""] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" }, + [""] = { "actions.select", opts = { horizontal = true }, desc = "Open the entry in a horizontal split" }, [""] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" }, [""] = "actions.preview", [""] = "actions.close", From 13233802fbe0fc73f6c78286985e985e36eeb7fb Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 23:56:53 +0200 Subject: [PATCH 129/280] Update config --- .config/nvim/lazy-lock.json | 4 ++-- .config/nvim/lua/plugins/oil.lua | 1 + .config/nvim/lua/plugins/telescope.lua | 1 + .config/nvim/lua/plugins/vim-tmux-navigator.lua | 3 +++ 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .config/nvim/lua/plugins/vim-tmux-navigator.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 630785c..636ce7f 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -9,7 +9,7 @@ "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, - "vim-fugitive": { "branch": "master", "commit": "1d18c696c4284e9ce9467a5c04d3adf8af43f994" } + "vim-fugitive": { "branch": "master", "commit": "1d18c696c4284e9ce9467a5c04d3adf8af43f994" }, + "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" } } diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index bc3697a..5451f1c 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -10,6 +10,7 @@ return { "size", "mtime", }, + constrain_cursor = "name", skip_confirm_for_simple_edits = true, prompt_save_on_select_new_entry = true, watch_for_changes = true, diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index b1acb23..658f5af 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -5,5 +5,6 @@ return { { "f", "Telescope find_files hidden=true" }, { "w", "Telescope live_grep" }, { "r", "Telescope resume" }, + { "c", "Telescope git_commits" }, } } diff --git a/.config/nvim/lua/plugins/vim-tmux-navigator.lua b/.config/nvim/lua/plugins/vim-tmux-navigator.lua new file mode 100644 index 0000000..9afc21d --- /dev/null +++ b/.config/nvim/lua/plugins/vim-tmux-navigator.lua @@ -0,0 +1,3 @@ +return { + { "christoomey/vim-tmux-navigator", lazy = false }, +} From befc70cbfebb516ff7030c84828ea47ff5c885c3 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Sep 2024 23:57:14 +0200 Subject: [PATCH 130/280] Add delta toggleterm --- .config/nvim/lua/plugins/toggleterm.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .config/nvim/lua/plugins/toggleterm.lua diff --git a/.config/nvim/lua/plugins/toggleterm.lua b/.config/nvim/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..9420fec --- /dev/null +++ b/.config/nvim/lua/plugins/toggleterm.lua @@ -0,0 +1,17 @@ +return { + 'akinsho/toggleterm.nvim', version = "*", + lazy = false, + config = function() + local Terminal = require('toggleterm.terminal').Terminal + local command = "git diff $(git show-branch -a | grep '*' | grep -v $(git rev-parse --abbrev-ref HEAD) | head -n1 | sed 's/^.*\\[\\(.*\\)\\].*/\\1/') | sed 's/[\\^~].*//'" + + local lazygit = Terminal:new({ cmd = command, hidden = true, direction = "float", close_on_exit = true }) + + function _lazygit_toggle() + lazygit:toggle() + end + + vim.api.nvim_set_keymap("n", "d", "lua _lazygit_toggle()", {noremap = true, silent = true}) + end +} + From ea8e5fdf5d2e8644cbb082eaf3fcb5e7b5966527 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 7 Sep 2024 00:06:05 +0200 Subject: [PATCH 131/280] Fix swapfiles --- .config/nvim/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 05e8566..3055ce0 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -8,6 +8,8 @@ vim.opt.expandtab = true vim.opt.tabstop = 2 vim.opt.shiftwidth = 2 vim.opt.scrolloff = 10 +vim.opt.autowrite = true +vim.opt.shortmess:append("A") -- https://stackoverflow.com/questions/1098159/vim-stop-existing-swap-file-warnings vim.keymap.set("n", "n", "nzz") vim.keymap.set("n", "N", "Nzz") From c0fcd647880e26dbb7de80bc6a320538347fa491 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 7 Sep 2024 08:54:21 +0200 Subject: [PATCH 132/280] Update binds --- .config/nvim/init.lua | 5 ++--- .config/nvim/lua/plugins/maximize.lua | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 3055ce0..7da0e1f 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -16,7 +16,6 @@ vim.keymap.set("n", "N", "Nzz") vim.keymap.set("n", "Q", ":quit") vim.keymap.set("n", "q", ":quitall") vim.keymap.set("n", "/", "noh") -vim.api.nvim_set_keymap('n', '', '', { noremap = true, silent = true }) vim.opt.splitright = true vim.opt.splitbelow = true @@ -25,8 +24,8 @@ vim.keymap.set('n', '', ':wincmd j', { silent = true }) vim.keymap.set('n', '', ':wincmd h', { silent = true }) vim.keymap.set('n', '', ':wincmd l', { silent = true }) vim.keymap.set('n', '', ':wincmd =', { silent = true }) -vim.keymap.set('n', '', ':wincmd s', { silent = true }) -vim.keymap.set('n', '', ':wincmd v', { silent = true }) +vim.keymap.set('n', 'v', ':wincmd v', { silent = true}) +vim.keymap.set('n', 'V', ':wincmd s', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '@', '@q', {noremap = true}) diff --git a/.config/nvim/lua/plugins/maximize.lua b/.config/nvim/lua/plugins/maximize.lua index 040a92f..f0e8aec 100644 --- a/.config/nvim/lua/plugins/maximize.lua +++ b/.config/nvim/lua/plugins/maximize.lua @@ -5,6 +5,6 @@ return { 'Maximize' }, keys = { - { "", "Maximize" } + { "z", "Maximize" } } } From 9855e4648a4775e80e1fb7d122294bd88149aa0e Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 7 Sep 2024 08:59:09 +0200 Subject: [PATCH 133/280] Add flash --- .config/nvim/lazy-lock.json | 2 ++ .config/nvim/lua/plugins/flash.lua | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 .config/nvim/lua/plugins/flash.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 636ce7f..a2a507f 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,4 +1,5 @@ { + "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, @@ -9,6 +10,7 @@ "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, "vim-fugitive": { "branch": "master", "commit": "1d18c696c4284e9ce9467a5c04d3adf8af43f994" }, "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" } diff --git a/.config/nvim/lua/plugins/flash.lua b/.config/nvim/lua/plugins/flash.lua new file mode 100644 index 0000000..b123a5b --- /dev/null +++ b/.config/nvim/lua/plugins/flash.lua @@ -0,0 +1,12 @@ +return { + "folke/flash.nvim", + event = "VeryLazy", + opts = {}, + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, +} From 6d0302d0274549c9c9b6adc9d9899192ae1ca4bd Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 7 Sep 2024 09:11:04 +0200 Subject: [PATCH 134/280] Add multicursor --- .config/nvim/lazy-lock.json | 1 + .config/nvim/lua/plugins/multicursor.lua | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 .config/nvim/lua/plugins/multicursor.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index a2a507f..078ede1 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -5,6 +5,7 @@ "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, + "multiple-cursors.nvim": { "branch": "main", "commit": "2f5e786c43aa9c0fc34b295cfcc9bfbacef8e926" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, "oil.nvim": { "branch": "master", "commit": "1fe476daf0b3c108cb8ee1fc1226cc282fa2c9c1" }, "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, diff --git a/.config/nvim/lua/plugins/multicursor.lua b/.config/nvim/lua/plugins/multicursor.lua new file mode 100644 index 0000000..044d595 --- /dev/null +++ b/.config/nvim/lua/plugins/multicursor.lua @@ -0,0 +1,15 @@ +return { + "brenton-leighton/multiple-cursors.nvim", + version = "*", -- Use the latest tagged version + opts = {}, -- This causes the plugin setup function to be called + keys = { + {"gj", "MultipleCursorsAddDown", mode = {"n", "x"}, desc = "Add cursor and move down"}, + {"gk", "MultipleCursorsAddUp", mode = {"n", "x"}, desc = "Add cursor and move up"}, + {"", "MultipleCursorsMouseAddDelete", mode = {"n", "i"}, desc = "Add or remove cursor"}, + {"a", "MultipleCursorsAddMatches", mode = {"n", "x"}, desc = "Add cursors to cword"}, + {"A", "MultipleCursorsAddMatchesV", mode = {"n", "x"}, desc = "Add cursors to cword in previous area"}, + {"d", "MultipleCursorsAddJumpNextMatch", mode = {"n", "x"}, desc = "Add cursor and jump to next cword"}, + {"D", "MultipleCursorsJumpNextMatch", mode = {"n", "x"}, desc = "Jump to next cword"}, + {"l", "MultipleCursorsLock", mode = {"n", "x"}, desc = "Lock virtual cursors"}, + }, +} From 50c88d33fe7f4b09eafb4558eaf4aa7087b7174f Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 7 Sep 2024 09:13:00 +0200 Subject: [PATCH 135/280] Foo --- .config/nvim/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 7da0e1f..75109c4 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -43,6 +43,9 @@ end vim.opt.rtp:prepend(lazypath) +vim.keymap.set('n', 'L', ':Lazy') +vim.keymap.set('n', 'C', ':Git commit') + local plugins = { { import = "plugins" } } From 2c1fcc127da7614585aa016515bfc51c7c4956e4 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 8 Sep 2024 19:41:53 +0200 Subject: [PATCH 136/280] Add copilot chat --- .config/nvim/lazy-lock.json | 6 ++-- .config/nvim/lua/plugins/copilotchat.lua | 38 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .config/nvim/lua/plugins/copilotchat.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 078ede1..8842958 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,7 +1,9 @@ { + "CopilotChat.nvim": { "branch": "canary", "commit": "9e7010bd33808e31d3f729b5e18a772d8e84f704" }, + "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, - "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "lazy.nvim": { "branch": "main", "commit": "48b52b5cfcf8f88ed0aff8fde573a5cc20b1306d" }, "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, @@ -13,6 +15,6 @@ "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, - "vim-fugitive": { "branch": "master", "commit": "1d18c696c4284e9ce9467a5c04d3adf8af43f994" }, + "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" } } diff --git a/.config/nvim/lua/plugins/copilotchat.lua b/.config/nvim/lua/plugins/copilotchat.lua new file mode 100644 index 0000000..8afa071 --- /dev/null +++ b/.config/nvim/lua/plugins/copilotchat.lua @@ -0,0 +1,38 @@ +return { + "CopilotC-Nvim/CopilotChat.nvim", + branch = "canary", + dependencies = { + { "zbirenbaum/copilot.lua" }, + { "nvim-lua/plenary.nvim" }, + }, + build = "make tiktoken", + opts = { + auto_insert_mode = true, + }, + cmd = { + "CopilotChat", + "CopilotChatOpen", + "CopilotChatClose", + "CopilotChatToggle", + "CopilotChatStop", + "CopilotChatReset", + "CopilotChatSave", + "CopilotChatLoad", + "CopilotChatDebugInfo", + "CopilotChatModels", + "CopilotChatModel", + "CopilotChatExplain", + "CopilotChatReview", + "CopilotChatFix", + "CopilotChatOptimize", + "CopilotChatDocs", + "CopilotChatTests", + "CopilotChatFixDiagnostic", + "CopilotChatCommit", + "CopilotChatCommitStaged", + }, + keys = { + { "p", "CopilotChat" }, + { "P", "CopilotChatFix" }, + } +} From ddde413866c98e0e778ab091be4f59ea5f1b0baf Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 8 Sep 2024 20:02:56 +0200 Subject: [PATCH 137/280] Add fitten --- .config/nvim/lazy-lock.json | 1 + .config/nvim/lua/plugins/fitten.lua | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 .config/nvim/lua/plugins/fitten.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 8842958..f2c1cf5 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,6 +1,7 @@ { "CopilotChat.nvim": { "branch": "canary", "commit": "9e7010bd33808e31d3f729b5e18a772d8e84f704" }, "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, + "fittencode.nvim": { "branch": "master", "commit": "47b5bb3287b45c8638430ad8768ab7a3050f16aa" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "lazy.nvim": { "branch": "main", "commit": "48b52b5cfcf8f88ed0aff8fde573a5cc20b1306d" }, diff --git a/.config/nvim/lua/plugins/fitten.lua b/.config/nvim/lua/plugins/fitten.lua new file mode 100644 index 0000000..ebbdc4b --- /dev/null +++ b/.config/nvim/lua/plugins/fitten.lua @@ -0,0 +1,7 @@ +return { + 'luozhiya/fittencode.nvim', + lazy = false, + config = function() + require('fittencode').setup() + end, +} From be20112aacb38b6fa6d553bb1819cddf33301ef4 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 8 Sep 2024 20:03:02 +0200 Subject: [PATCH 138/280] Add nvim-treesitter --- .config/nvim/lazy-lock.json | 2 + .../plugins/nvim-treesitter-textobjects.lua | 64 +++++++++++++++++++ .config/nvim/lua/plugins/nvim-treesitter.lua | 19 ++++++ 3 files changed, 85 insertions(+) create mode 100644 .config/nvim/lua/plugins/nvim-treesitter-textobjects.lua create mode 100644 .config/nvim/lua/plugins/nvim-treesitter.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index f2c1cf5..6b079c9 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -10,6 +10,8 @@ "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, "multiple-cursors.nvim": { "branch": "main", "commit": "2f5e786c43aa9c0fc34b295cfcc9bfbacef8e926" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, + "nvim-treesitter": { "branch": "master", "commit": "4770d9a1a77b0cc2b723c646c3dbe43a9133e5db" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, "oil.nvim": { "branch": "master", "commit": "1fe476daf0b3c108cb8ee1fc1226cc282fa2c9c1" }, "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, diff --git a/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua b/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua new file mode 100644 index 0000000..1374167 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua @@ -0,0 +1,64 @@ +-- https://www.josean.com/posts/nvim-treesitter-and-textobjects +return { + "nvim-treesitter/nvim-treesitter-textobjects", + lazy = true, + config = function() require("nvim-treesitter.configs").setup({ + textobjects = { + select = { + enable = true, + + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, + + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" }, + ["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" }, + ["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" }, + ["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" }, + + -- works for javascript/typescript files (custom captures I created in after/queries/ecma/textobjects.scm) + ["a:"] = { query = "@property.outer", desc = "Select outer part of an object property" }, + ["i:"] = { query = "@property.inner", desc = "Select inner part of an object property" }, + ["l:"] = { query = "@property.lhs", desc = "Select left part of an object property" }, + ["r:"] = { query = "@property.rhs", desc = "Select right part of an object property" }, + + ["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" }, + ["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" }, + + ["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" }, + ["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" }, + + ["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" }, + ["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" }, + + ["af"] = { query = "@call.outer", desc = "Select outer part of a function call" }, + ["if"] = { query = "@call.inner", desc = "Select inner part of a function call" }, + + ["am"] = { query = "@function.outer", desc = "Select outer part of a method/function definition" }, + ["im"] = { query = "@function.inner", desc = "Select inner part of a method/function definition" }, + + ["ac"] = { query = "@class.outer", desc = "Select outer part of a class" }, + ["ic"] = { query = "@class.inner", desc = "Select inner part of a class" }, + + ["a/"] = { query = "@comment.outer", desc = "Select outer part of a comment" }, + ["i/"] = { query = "@comment.inner", desc = "Select inner part of a comment" }, + }, + }, + swap = { + enable = true, + swap_next = { + ["na"] = "@parameter.inner", -- swap parameters/argument with next + ["n:"] = "@property.outer", -- swap object property with next + ["nm"] = "@function.outer", -- swap function with next + }, + swap_previous = { + ["pa"] = "@parameter.inner", -- swap parameters/argument with prev + ["p:"] = "@property.outer", -- swap object property with prev + ["pm"] = "@function.outer", -- swap function with previous + }, + }, + }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/nvim-treesitter.lua b/.config/nvim/lua/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..32c5b49 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-treesitter.lua @@ -0,0 +1,19 @@ +return { + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "nvim-treesitter/nvim-treesitter-textobjects", + }, + config = function() + require("nvim-treesitter.configs").setup { + ensure_installed = { "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "ruby", "javascript", "rust", "html" }, + incremental_selection = { + enable = true, + keymaps = { + node_incremental = "v", + node_decremental = "V", + }, + }, + } + end, +} From daac6d5fea29bccbe436d575f79bde6ed347c8d7 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 8 Sep 2024 20:03:08 +0200 Subject: [PATCH 139/280] Remove flash keybinds --- .config/nvim/lua/plugins/flash.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.config/nvim/lua/plugins/flash.lua b/.config/nvim/lua/plugins/flash.lua index b123a5b..bc49495 100644 --- a/.config/nvim/lua/plugins/flash.lua +++ b/.config/nvim/lua/plugins/flash.lua @@ -1,12 +1,7 @@ return { "folke/flash.nvim", event = "VeryLazy", - opts = {}, keys = { { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, - { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, - { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, - { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, - { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, }, } From 39703faf107b6e134838d809904efaa0ff78a479 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 8 Sep 2024 20:31:50 +0200 Subject: [PATCH 140/280] Add some plugins --- .config/nvim/init.lua | 8 +++---- .config/nvim/lazy-lock.json | 3 +++ .../lua/plugins/nvim-treesitter-endwise.lua | 11 +++++++++ .config/nvim/lua/plugins/nvim-treesitter.lua | 2 +- .config/nvim/lua/plugins/nvim-ts-autotag.lua | 23 +++++++++++++++++++ .config/nvim/lua/plugins/vim-rails.lua | 4 ++++ 6 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 .config/nvim/lua/plugins/nvim-treesitter-endwise.lua create mode 100644 .config/nvim/lua/plugins/nvim-ts-autotag.lua create mode 100644 .config/nvim/lua/plugins/vim-rails.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 75109c4..496d712 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -4,7 +4,7 @@ vim.opt.cursorcolumn = true vim.opt.termguicolors = true vim.wo.number = true vim.wo.relativenumber = true -vim.opt.expandtab = true +vim.opt.expandtab = false vim.opt.tabstop = 2 vim.opt.shiftwidth = 2 vim.opt.scrolloff = 10 @@ -14,6 +14,7 @@ vim.opt.shortmess:append("A") -- https://stackoverflow.com/questions/1098159/vim vim.keymap.set("n", "n", "nzz") vim.keymap.set("n", "N", "Nzz") vim.keymap.set("n", "Q", ":quit") +vim.keymap.set("n", "W", ":wq") vim.keymap.set("n", "q", ":quitall") vim.keymap.set("n", "/", "noh") @@ -29,6 +30,8 @@ vim.keymap.set('n', 'V', ':wincmd s', { noremap = true, silent = tru vim.api.nvim_set_keymap('n', '@', '@q', {noremap = true}) +vim.keymap.set('n', 'L', ':Lazy') + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ @@ -43,9 +46,6 @@ end vim.opt.rtp:prepend(lazypath) -vim.keymap.set('n', 'L', ':Lazy') -vim.keymap.set('n', 'C', ':Git commit') - local plugins = { { import = "plugins" } } diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 6b079c9..5f7db51 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -11,7 +11,9 @@ "multiple-cursors.nvim": { "branch": "main", "commit": "2f5e786c43aa9c0fc34b295cfcc9bfbacef8e926" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, "nvim-treesitter": { "branch": "master", "commit": "4770d9a1a77b0cc2b723c646c3dbe43a9133e5db" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, + "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, "oil.nvim": { "branch": "master", "commit": "1fe476daf0b3c108cb8ee1fc1226cc282fa2c9c1" }, "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, @@ -19,5 +21,6 @@ "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, + "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" } } diff --git a/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua b/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua new file mode 100644 index 0000000..e523485 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua @@ -0,0 +1,11 @@ +return { + "RRethy/nvim-treesitter-endwise", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("nvim-treesitter.configs").setup { + endwise = { + enable = true, + }, + } + end, +} diff --git a/.config/nvim/lua/plugins/nvim-treesitter.lua b/.config/nvim/lua/plugins/nvim-treesitter.lua index 32c5b49..8e6b1fe 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter.lua @@ -6,7 +6,7 @@ return { }, config = function() require("nvim-treesitter.configs").setup { - ensure_installed = { "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "ruby", "javascript", "rust", "html" }, + ensure_installed = { "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "ruby", "javascript", "rust", "html", "embedded_template" }, incremental_selection = { enable = true, keymaps = { diff --git a/.config/nvim/lua/plugins/nvim-ts-autotag.lua b/.config/nvim/lua/plugins/nvim-ts-autotag.lua new file mode 100644 index 0000000..ec2944d --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-ts-autotag.lua @@ -0,0 +1,23 @@ +return { + "windwp/nvim-ts-autotag", + lazy = false, + -- event = { "BufReadPre", "BufNewFile" }, + config = function() + require('nvim-ts-autotag').setup({ + opts = { + -- Defaults + enable_close = true, -- Auto close tags + enable_rename = true, -- Auto rename pairs of tags + enable_close_on_slash = false -- Auto close on trailing Date: Sun, 8 Sep 2024 20:48:20 +0200 Subject: [PATCH 141/280] Add highlighted yank --- .config/nvim/init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 496d712..460dddf 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -53,3 +53,12 @@ local plugins = { local opts = { defaults = { lazy = true }, change_detection = { notify = false } } require("lazy").setup(plugins, opts) + +vim.api.nvim_create_autocmd('TextYankPost', { + group = vim.api.nvim_create_augroup('highlight_yank', {}), + desc = 'Hightlight selection on yank', + pattern = '*', + callback = function() + vim.highlight.on_yank { higroup = 'IncSearch', timeout = 69 } + end, +}) From 4d341b80f5415417d96766975a2106c7d804dca0 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 8 Sep 2024 20:48:24 +0200 Subject: [PATCH 142/280] Add boole nvim --- .config/nvim/lazy-lock.json | 1 + .config/nvim/lua/plugins/boole.lua | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 .config/nvim/lua/plugins/boole.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 5f7db51..9d583b5 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,5 +1,6 @@ { "CopilotChat.nvim": { "branch": "canary", "commit": "9e7010bd33808e31d3f729b5e18a772d8e84f704" }, + "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, "fittencode.nvim": { "branch": "master", "commit": "47b5bb3287b45c8638430ad8768ab7a3050f16aa" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, diff --git a/.config/nvim/lua/plugins/boole.lua b/.config/nvim/lua/plugins/boole.lua new file mode 100644 index 0000000..c166c09 --- /dev/null +++ b/.config/nvim/lua/plugins/boole.lua @@ -0,0 +1,16 @@ +return { + "nat-418/boole.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require('boole').setup({ + mappings = { + increment = '', + decrement = '' + }, + additions = { + {'Foo', 'Bar', 'Baz', 'Qux', 'Quux'}, + {'light', 'dark'} + }, + }) + end +} From 1005e2cf7f3b04d5ee5db4dce3863b463e3d97e0 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 9 Sep 2024 12:23:49 +0200 Subject: [PATCH 143/280] Add autosession --- .config/nvim/init.lua | 4 +++- .config/nvim/lazy-lock.json | 3 ++- .config/nvim/lua/plugins/autosession.lua | 8 ++++++++ .config/nvim/lua/plugins/persistence.lua | 8 -------- 4 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 .config/nvim/lua/plugins/autosession.lua delete mode 100644 .config/nvim/lua/plugins/persistence.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 460dddf..434458c 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -10,6 +10,8 @@ vim.opt.shiftwidth = 2 vim.opt.scrolloff = 10 vim.opt.autowrite = true vim.opt.shortmess:append("A") -- https://stackoverflow.com/questions/1098159/vim-stop-existing-swap-file-warnings +vim.opt.autowriteall = true +vim.opt.list = true vim.keymap.set("n", "n", "nzz") vim.keymap.set("n", "N", "Nzz") @@ -59,6 +61,6 @@ vim.api.nvim_create_autocmd('TextYankPost', { desc = 'Hightlight selection on yank', pattern = '*', callback = function() - vim.highlight.on_yank { higroup = 'IncSearch', timeout = 69 } + vim.highlight.on_yank { higroup = 'IncSearch', timeout = 100 } end, }) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 9d583b5..531950f 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,5 +1,7 @@ { "CopilotChat.nvim": { "branch": "canary", "commit": "9e7010bd33808e31d3f729b5e18a772d8e84f704" }, + "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, + "auto-session": { "branch": "main", "commit": "a90aa7730efa60fdcc7e00497a8f36d94a6da709" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, "fittencode.nvim": { "branch": "master", "commit": "47b5bb3287b45c8638430ad8768ab7a3050f16aa" }, @@ -16,7 +18,6 @@ "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, "oil.nvim": { "branch": "master", "commit": "1fe476daf0b3c108cb8ee1fc1226cc282fa2c9c1" }, - "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, diff --git a/.config/nvim/lua/plugins/autosession.lua b/.config/nvim/lua/plugins/autosession.lua new file mode 100644 index 0000000..c596b4f --- /dev/null +++ b/.config/nvim/lua/plugins/autosession.lua @@ -0,0 +1,8 @@ +return { + "rmagatti/auto-session", + lazy = false, + dependencies = { + "nvim-telescope/telescope.nvim", + }, + opts = { } +} diff --git a/.config/nvim/lua/plugins/persistence.lua b/.config/nvim/lua/plugins/persistence.lua deleted file mode 100644 index ba088d1..0000000 --- a/.config/nvim/lua/plugins/persistence.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "folke/persistence.nvim", - event = "BufReadPre", - opts = {}, - keys = { - { "s", function() require("persistence").load() end } - } -} From c907227664360fed82ecec14f3843fd0eae45f7e Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 13 Sep 2024 11:19:47 +0200 Subject: [PATCH 144/280] Add comments, hybrid line numbers --- .config/nvim/init.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 434458c..2875be3 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -19,6 +19,7 @@ vim.keymap.set("n", "Q", ":quit") vim.keymap.set("n", "W", ":wq") vim.keymap.set("n", "q", ":quitall") vim.keymap.set("n", "/", "noh") +vim.keymap.set("n", "s", ":w") vim.opt.splitright = true vim.opt.splitbelow = true @@ -56,6 +57,8 @@ local opts = { defaults = { lazy = true }, change_detection = { notify = false } require("lazy").setup(plugins, opts) +-- highlighted yank + vim.api.nvim_create_autocmd('TextYankPost', { group = vim.api.nvim_create_augroup('highlight_yank', {}), desc = 'Hightlight selection on yank', @@ -64,3 +67,33 @@ vim.api.nvim_create_autocmd('TextYankPost', { vim.highlight.on_yank { higroup = 'IncSearch', timeout = 100 } end, }) + +-- hybrid line numbers + +local numbertoggle_group = vim.api.nvim_create_augroup('numbertoggle', { clear = true }) + +vim.api.nvim_create_autocmd( + {'BufEnter', 'FocusGained', 'InsertLeave', 'WinEnter'}, + { + group = numbertoggle_group, + pattern = '*', + callback = function() + if vim.wo.number and vim.fn.mode() ~= 'i' then + vim.wo.relativenumber = true + end + end + } +) + +vim.api.nvim_create_autocmd( + {'BufLeave', 'FocusLost', 'InsertEnter', 'WinLeave'}, + { + group = numbertoggle_group, + pattern = '*', + callback = function() + if vim.wo.number then + vim.wo.relativenumber = false + end + end + } +) From e0d8401026c450373a952da6e11898eacab0ea37 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 17 Sep 2024 22:07:49 +0200 Subject: [PATCH 145/280] Add autosave --- .config/nvim/lazy-lock.json | 1 + .config/nvim/lua/plugins/autosave.lua | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 .config/nvim/lua/plugins/autosave.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 531950f..f98b1ec 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,6 +1,7 @@ { "CopilotChat.nvim": { "branch": "canary", "commit": "9e7010bd33808e31d3f729b5e18a772d8e84f704" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, + "auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" }, "auto-session": { "branch": "main", "commit": "a90aa7730efa60fdcc7e00497a8f36d94a6da709" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, diff --git a/.config/nvim/lua/plugins/autosave.lua b/.config/nvim/lua/plugins/autosave.lua new file mode 100644 index 0000000..ac9eb80 --- /dev/null +++ b/.config/nvim/lua/plugins/autosave.lua @@ -0,0 +1,9 @@ +return { + "Pocco81/auto-save.nvim", + lazy = false, + config = function() + require("auto-save").setup({ + debounce_delay = 50 + }) + end, +} From 1f9471f613de86c12a0274552879a626ef3e125f Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 18 Sep 2024 21:26:55 +0200 Subject: [PATCH 146/280] Update init lua --- .config/nvim/init.lua | 60 ++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 2875be3..5ae9c3d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -4,7 +4,7 @@ vim.opt.cursorcolumn = true vim.opt.termguicolors = true vim.wo.number = true vim.wo.relativenumber = true -vim.opt.expandtab = false +vim.opt.expandtab = true vim.opt.tabstop = 2 vim.opt.shiftwidth = 2 vim.opt.scrolloff = 10 @@ -16,10 +16,13 @@ vim.opt.list = true vim.keymap.set("n", "n", "nzz") vim.keymap.set("n", "N", "Nzz") vim.keymap.set("n", "Q", ":quit") +vim.keymap.set("n", "Q", ":q!") vim.keymap.set("n", "W", ":wq") vim.keymap.set("n", "q", ":quitall") vim.keymap.set("n", "/", "noh") vim.keymap.set("n", "s", ":w") +vim.keymap.set("n", "g=", "ggVG=") +vim.keymap.set("n", "zt", "%s/\t/ /g") vim.opt.splitright = true vim.opt.splitbelow = true @@ -30,8 +33,25 @@ vim.keymap.set('n', '', ':wincmd l', { silent = true }) vim.keymap.set('n', '', ':wincmd =', { silent = true }) vim.keymap.set('n', 'v', ':wincmd v', { silent = true}) vim.keymap.set('n', 'V', ':wincmd s', { noremap = true, silent = true }) +vim.keymap.set('n', 'o', function() + -- Get the current line content + local line = vim.api.nvim_get_current_line() -vim.api.nvim_set_keymap('n', '@', '@q', {noremap = true}) + -- Extract the string (either single-quoted or double-quoted) + local str = line:match("'(.-)'") or line:match('"(.-)"') + + if str then + -- Construct the GitHub URL + local url = "https://github.com/" .. str + + -- Use the open shell command to open the URL + os.execute("open " .. url) + else + print("No valid string found on the current line.") + end +end) + +-- vim.api.nvim_set_keymap('n', '@', '@q', {noremap = true}) vim.keymap.set('n', 'L', ':Lazy') @@ -73,27 +93,27 @@ vim.api.nvim_create_autocmd('TextYankPost', { local numbertoggle_group = vim.api.nvim_create_augroup('numbertoggle', { clear = true }) vim.api.nvim_create_autocmd( - {'BufEnter', 'FocusGained', 'InsertLeave', 'WinEnter'}, - { - group = numbertoggle_group, - pattern = '*', - callback = function() - if vim.wo.number and vim.fn.mode() ~= 'i' then - vim.wo.relativenumber = true - end +{'BufEnter', 'FocusGained', 'InsertLeave', 'WinEnter'}, +{ + group = numbertoggle_group, + pattern = '*', + callback = function() + if vim.wo.number and vim.fn.mode() ~= 'i' then + vim.wo.relativenumber = true end - } + end +} ) vim.api.nvim_create_autocmd( - {'BufLeave', 'FocusLost', 'InsertEnter', 'WinLeave'}, - { - group = numbertoggle_group, - pattern = '*', - callback = function() - if vim.wo.number then - vim.wo.relativenumber = false - end +{'BufLeave', 'FocusLost', 'InsertEnter', 'WinLeave'}, +{ + group = numbertoggle_group, + pattern = '*', + callback = function() + if vim.wo.number then + vim.wo.relativenumber = false end - } + end +} ) From d8eaec412553bef5e6ab7103694490af2eff7902 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 18 Sep 2024 21:27:15 +0200 Subject: [PATCH 147/280] Update boole --- .config/nvim/lua/plugins/boole.lua | 31 ++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.config/nvim/lua/plugins/boole.lua b/.config/nvim/lua/plugins/boole.lua index c166c09..af01d52 100644 --- a/.config/nvim/lua/plugins/boole.lua +++ b/.config/nvim/lua/plugins/boole.lua @@ -1,16 +1,19 @@ return { - "nat-418/boole.nvim", - event = { "BufReadPre", "BufNewFile" }, - config = function() - require('boole').setup({ - mappings = { - increment = '', - decrement = '' - }, - additions = { - {'Foo', 'Bar', 'Baz', 'Qux', 'Quux'}, - {'light', 'dark'} - }, - }) - end + "nat-418/boole.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require('boole').setup({ + mappings = { + increment = '', + decrement = '' + }, + additions = { + {'Foo', 'Bar', 'Baz', 'Qux', 'Quux'}, + {'light', 'dark'}, + {'if', 'unless'}, + {'true', 'false'}, + {'&&', '||'}, + }, + }) + end } From bf0e4b5bf68fd2777e13a8ae72b639e8c4e1af5a Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 18 Sep 2024 21:27:20 +0200 Subject: [PATCH 148/280] Add bufferexpliorer --- .config/nvim/lua/plugins/bufexplorer.lua | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .config/nvim/lua/plugins/bufexplorer.lua diff --git a/.config/nvim/lua/plugins/bufexplorer.lua b/.config/nvim/lua/plugins/bufexplorer.lua new file mode 100644 index 0000000..9154115 --- /dev/null +++ b/.config/nvim/lua/plugins/bufexplorer.lua @@ -0,0 +1,4 @@ + return { + "jlanzarotta/bufexplorer", + lazy = false, + } From 575824957ec7947667ff84a4068da6fb74e35f49 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 18 Sep 2024 21:27:29 +0200 Subject: [PATCH 149/280] Update lazygit --- .config/nvim/lua/plugins/lazygit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugins/lazygit.lua b/.config/nvim/lua/plugins/lazygit.lua index d1612fa..c451a2c 100644 --- a/.config/nvim/lua/plugins/lazygit.lua +++ b/.config/nvim/lua/plugins/lazygit.lua @@ -14,6 +14,6 @@ return { { "g", "LazyGit", desc = "LazyGit" } }, config = function() - vim.g.lazygit_floating_window_scaling_factor = 0.8 + vim.g.lazygit_floating_window_scaling_factor = 1 end } From 1e03af54f8b65b86c0d4a990ed0249e5b5d4db10 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 18 Sep 2024 21:27:35 +0200 Subject: [PATCH 150/280] Copy paste lsp config --- .config/nvim/lua/plugins/lsp.lua | 357 +++++++++++++++++++++++++++++++ 1 file changed, 357 insertions(+) create mode 100644 .config/nvim/lua/plugins/lsp.lua diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..5bebdb3 --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,357 @@ +return { + { + "ThePrimeagen/refactoring.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + opts = {}, + keys = { + { + "rr", + function() + require("refactoring").select_refactor() + end, + desc = "Refactor", + }, + }, + }, + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + config = function() + require("copilot").setup({}) + end, + }, + { + "zbirenbaum/copilot-cmp", + lazy = false, + event = "InsertEnter", + config = function() + require("copilot_cmp").setup() + require("copilot").setup({ + suggestion = { enabled = false }, + panel = { enabled = false }, + }) + end, + }, + { + "CopilotC-Nvim/CopilotChat.nvim", + dependencies = { + { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim + { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper + }, + commands = { + "CopilotChat", + "CopilotChat", + "CopilotChatOpen", + "CopilotChatClose", + "CopilotChatToggle", + "CopilotChatStop", + "CopilotChatReset", + "CopilotChatSave", + "CopilotChatLoad", + "CopilotChatDebugInfo", + "CopilotChatModels", + "CopilotChatExplain", + "CopilotChatReview", + "CopilotChatFix", + "CopilotChatOptimize", + "CopilotChatDocs", + "CopilotChatTests", + "CopilotChatFixDiagnostic", + "CopilotChatCommit", + "CopilotChatCommitStaged", + }, + opts = { + temperature = 0.3, + mappings = { + reset = { + normal = "", + insert = "", + }, + complete = { + detail = "Use @ or / for options.", + insert = "", + }, + close = { + normal = "q", + insert = "", + }, + submit_prompt = { + normal = "", + insert = "", + }, + accept_diff = { + normal = "", + insert = "", + }, + yank_diff = { + normal = "gy", + }, + show_diff = { + normal = "gd", + }, + show_system_prompt = { + normal = "gp", + }, + show_user_selection = { + normal = "gs", + }, + }, + }, + keys = { + { + "ccq", + function() + local input = vim.fn.input("Quick Chat: ") + if input ~= "" then + require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) + end + end, + desc = "CopilotChat - Quick chat", + }, + { + "cch", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.help_actions()) + end, + desc = "CopilotChat - Help actions", + }, + -- Show prompts actions with telescope + { + "ccp", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) + end, + desc = "CopilotChat - Prompt actions", + }, + }, + }, + { + "williamboman/mason.nvim", + lazy = false, + keys = { + { "m", "Mason" }, + }, + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + lazy = false, + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "ruby_lsp" }, + }) + end, + }, + { + "neovim/nvim-lspconfig", + lazy = false, + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + -- https://www.mitchellhanberg.com/modern-format-on-save-in-neovim/ + -- vim.api.nvim_create_autocmd("LspAttach", { + -- group = vim.api.nvim_create_augroup("lsp", { clear = true }), + -- callback = function(args) + -- vim.api.nvim_create_autocmd("BufWritePre", { + -- buffer = args.buf, + -- callback = function() + -- vim.lsp.buf.format({ async = false, id = args.data.client_id }) + -- end, + -- }) + -- end, + -- }) + + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup({ capabilities = capabilities }) + lspconfig.ruby_lsp.setup({ capabilities = capabilities }) + -- lspconfig.tsserver.setup({ capabilities = capabilities }) + -- lspconfig.standardrb.setup({ capabilities = capabilities }) + lspconfig.rubocop.setup({ capabilities = capabilities }) + -- lspconfig.rust_analyzer.setup({ capabilities = capabilities }) + lspconfig.ltex.setup({ + cmd = { "ltex-ls" }, + filetypes = { "markdown", "text", "cff", "tex" }, + flags = { debounce_text_changes = 299 }, + }) + lspconfig.astro.setup({}) + + lspconfig.solargraph.setup({ + capabilities = capabilities, + cmd = { + "asdf", + "exec", + "solargraph", + "stdio", + }, + settings = { + solargraph = { + autoformat = false, + completion = true, + diagnostic = true, + folding = true, + references = true, + rename = true, + symbols = true, + }, + }, + }) + + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) + vim.cmd([[ + autocmd BufNewFile,BufRead *.prawn set filetype=ruby + ]]) + end, + }, + { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.disable({ "rubocop" }) + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.diagnostics.erb_format, + null_ls.builtins.formatting.erb_lint, + }, + }) + end, + keys = { + { "lf", vim.lsp.buf.format }, + }, + }, + { + "hrsh7th/cmp-nvim-lsp", + lazy = false, + }, + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + keys = { + { + "", + function() + return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" + end, + expr = true, + silent = true, + mode = "i", + }, + { + "", + function() + require("luasnip").jump(1) + end, + mode = "s", + }, + { + "", + function() + require("luasnip").jump(-1) + end, + mode = { "i", "s" }, + }, + }, + }, + { + "hrsh7th/nvim-cmp", + lazy = false, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-cmdline", + "rafamadriz/friendly-snippets", + }, + config = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = "copilot", group_index = 2 }, + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), + }) + end, + }, + { + "zbirenbaum/copilot-cmp", + event = "InsertEnter", + config = function() + require("copilot_cmp").setup() + end, + }, + -- { + -- "nvim-treesitter/nvim-treesitter-refactor", + -- lazy = false, + -- config = function() + -- require("nvim-treesitter.configs").setup({ + -- refactor = { + -- highlight_definitions = { + -- enable = true, + -- clear_on_cursor_move = true, + -- }, + -- highlight_current_scope = { enable = false }, + -- smart_rename = { + -- enable = true, + -- -- Assign keymaps to false to disable them, e.g. `smart_rename = false`. + -- keymaps = { + -- smart_rename = "grr", + -- }, + -- }, + -- navigation = { + -- enable = true, + -- -- Assign keymaps to false to disable them, e.g. `goto_definition = false`. + -- keymaps = { + -- goto_definition = "gnd", + -- list_definitions = "gnD", + -- list_definitions_toc = "gO", + -- goto_next_usage = "", + -- goto_previous_usage = "", + -- }, + -- }, + -- }, + -- }) + -- end, + -- }, + -- { + -- "cuducos/yaml.nvim", + -- ft = { "yaml" }, -- optional + -- dependencies = { + -- "nvim-treesitter/nvim-treesitter", + -- "nvim-telescope/telescope.nvim", -- optional + -- }, + -- } +} From 27436a3622788b95575ac6d4d23c1bf59365ca96 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 18 Sep 2024 21:27:52 +0200 Subject: [PATCH 151/280] Remove toggleterm --- .config/nvim/lua/plugins/toggleterm.lua | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .config/nvim/lua/plugins/toggleterm.lua diff --git a/.config/nvim/lua/plugins/toggleterm.lua b/.config/nvim/lua/plugins/toggleterm.lua deleted file mode 100644 index 9420fec..0000000 --- a/.config/nvim/lua/plugins/toggleterm.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - 'akinsho/toggleterm.nvim', version = "*", - lazy = false, - config = function() - local Terminal = require('toggleterm.terminal').Terminal - local command = "git diff $(git show-branch -a | grep '*' | grep -v $(git rev-parse --abbrev-ref HEAD) | head -n1 | sed 's/^.*\\[\\(.*\\)\\].*/\\1/') | sed 's/[\\^~].*//'" - - local lazygit = Terminal:new({ cmd = command, hidden = true, direction = "float", close_on_exit = true }) - - function _lazygit_toggle() - lazygit:toggle() - end - - vim.api.nvim_set_keymap("n", "d", "lua _lazygit_toggle()", {noremap = true, silent = true}) - end -} - From 073db028ecb9ea52f26078f012249862e788e5bc Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 18 Sep 2024 21:27:56 +0200 Subject: [PATCH 152/280] update lazylock --- .config/nvim/lazy-lock.json | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index f98b1ec..1eb361f 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,28 +1,50 @@ { "CopilotChat.nvim": { "branch": "canary", "commit": "9e7010bd33808e31d3f729b5e18a772d8e84f704" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, + "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, "auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" }, "auto-session": { "branch": "main", "commit": "a90aa7730efa60fdcc7e00497a8f36d94a6da709" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, + "bufexplorer": { "branch": "master", "commit": "fcf3a65a69020f0f54be8fa925f841874a5f3a01" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, "fittencode.nvim": { "branch": "master", "commit": "47b5bb3287b45c8638430ad8768ab7a3050f16aa" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, + "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, + "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "lazy.nvim": { "branch": "main", "commit": "48b52b5cfcf8f88ed0aff8fde573a5cc20b1306d" }, "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, "multiple-cursors.nvim": { "branch": "main", "commit": "2f5e786c43aa9c0fc34b295cfcc9bfbacef8e926" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, + "neotest": { "branch": "master", "commit": "6d6ad113f56edc7c3f2a77a0836ea8c1b955ebea" }, + "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, + "none-ls.nvim": { "branch": "main", "commit": "9b98991e15dce8fc502993e23caac2528b8b667f" }, + "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-lspconfig": { "branch": "master", "commit": "73e0002b6f211376bbf36c31a2f812aedf6bd6b0" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, + "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, "nvim-treesitter": { "branch": "master", "commit": "4770d9a1a77b0cc2b723c646c3dbe43a9133e5db" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, + "nvim-web-devicons": { "branch": "master", "commit": "9793801f974bba70e4ac5d7eae6c4f5659993d8e" }, "oil.nvim": { "branch": "master", "commit": "1fe476daf0b3c108cb8ee1fc1226cc282fa2c9c1" }, "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, + "refactoring.nvim": { "branch": "master", "commit": "c406fc5fb4d7ba5fce7b668637075fad6e75e9f8" }, + "solarized.nvim": { "branch": "main", "commit": "50edf5a4eee481cf179685508a219fa683ea0949" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, - "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" } From 9b372ae506a10e2d8ab38c5a20c7937d305302f4 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 18 Sep 2024 21:28:09 +0200 Subject: [PATCH 153/280] Update zshrc hiostory setitngts --- .zshrc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.zshrc b/.zshrc index b257544..e16b232 100644 --- a/.zshrc +++ b/.zshrc @@ -107,6 +107,9 @@ parallel_exec() { alias '~'='cd ~' alias '..'='cd ..' alias '...'='cd ../../' +alias '....'='cd ../../../' +alias '.....'='cd ../../../../' +alias '......'='cd ../../../../../' function rr() { rustc "$@.rs" && ./"$@"} # [r]ust [r]un function rgs() { rg --json -C 2 "$@" | delta } # [r]ip[g]rep [s]earch @@ -139,6 +142,8 @@ alias cpb="git branch | grep '*' | tr -d '*' | tr -d ' ' | pbcopy" # [c]o[p]y [b alias tks="tmux kill-server" # [t]mux [k]ill [s]erver alias crc="cargo r -r --bin client" alias crs="cargo r -r --bin server" +alias fastfetch="cat ~/.config/fastfetch/logo.txt | fastfetch --file - --logo-color-1 magenta" +alias ff="fastfetch" alias listfonts="fc-list | sed 's/.*:\s*\([^:]*\):.*/\1/' | tr ',' '\n' | sed 's/^[ \t]*//;s/[ \t]*$//' | sort | uniq" # https://stackoverflow.com/questions/57473124/how-to-find-all-available-fonts-on-osx-using-the-default-shell function rkill() { "kill $(cat tmp/pids/server.pid)" } @@ -304,3 +309,11 @@ renuo-cli-hack() { fi } +# Update history +HISTSIZE=1000000 # Size of in-memory history (you can set this to a large number) +SAVEHIST=1000000 # Size of history saved to file (set to the same or a large number) +HISTFILE=~/.zsh_history # Location of history file +setopt APPEND_HISTORY # Append to history file instead of overwriting +setopt HIST_IGNORE_DUPS # Ignore duplicate commands in history +setopt HIST_IGNORE_ALL_DUPS # Remove all previous duplicate entries +setopt HIST_REDUCE_BLANKS # Remove superfluous blanks in command From 653fdeef1d7c07b3ac79348fa48a73b705e0f4f0 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 18 Sep 2024 21:51:54 +0200 Subject: [PATCH 154/280] Add select all mapping --- .config/nvim/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 5ae9c3d..7c92d5a 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -23,6 +23,7 @@ vim.keymap.set("n", "/", "noh") vim.keymap.set("n", "s", ":w") vim.keymap.set("n", "g=", "ggVG=") vim.keymap.set("n", "zt", "%s/\t/ /g") +vim.keymap.set("n", "vag", "ggVG") vim.opt.splitright = true vim.opt.splitbelow = true From 7b39710afc4be2b47a9d03135002aaa44fa27962 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 22 Sep 2024 18:46:08 +0200 Subject: [PATCH 155/280] Add keymaps --- .config/nvim/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 7c92d5a..3c4f21b 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -12,7 +12,6 @@ vim.opt.autowrite = true vim.opt.shortmess:append("A") -- https://stackoverflow.com/questions/1098159/vim-stop-existing-swap-file-warnings vim.opt.autowriteall = true vim.opt.list = true - vim.keymap.set("n", "n", "nzz") vim.keymap.set("n", "N", "Nzz") vim.keymap.set("n", "Q", ":quit") @@ -24,6 +23,10 @@ vim.keymap.set("n", "s", ":w") vim.keymap.set("n", "g=", "ggVG=") vim.keymap.set("n", "zt", "%s/\t/ /g") vim.keymap.set("n", "vag", "ggVG") +vim.keymap.set("n", "gJ", "Jx") +vim.api.nvim_set_keymap('n', '', 'qq', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '', 'q', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '', '@q', { noremap = true, silent = true }) vim.opt.splitright = true vim.opt.splitbelow = true From 1381be67aa01ec8f17eec00e3090f72e68f3074a Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 22 Sep 2024 18:47:14 +0200 Subject: [PATCH 156/280] Update plugins --- .config/nvim/lazy-lock.json | 31 +-- .config/nvim/lua/plugins/autoclose.lua | 4 + .config/nvim/lua/plugins/autosave.lua | 13 +- .config/nvim/lua/plugins/colorscheme.lua | 23 +- .config/nvim/lua/plugins/copilotchat.lua | 72 +++--- .config/nvim/lua/plugins/diffview.lua | 10 + .config/nvim/lua/plugins/gitsigns.lua | 2 +- .config/nvim/lua/plugins/harpoon.lua | 16 ++ .config/nvim/lua/plugins/java.lua | 3 + .config/nvim/lua/plugins/lsp.lua | 232 ++++++------------- .config/nvim/lua/plugins/markdown.lua | 7 + .config/nvim/lua/plugins/neo-tree.lua | 11 + .config/nvim/lua/plugins/neotest.lua | 11 + .config/nvim/lua/plugins/nvim-spectre.lua | 7 + .config/nvim/lua/plugins/nvim-treesitter.lua | 34 +-- .config/nvim/lua/plugins/nvim-ts-autotag.lua | 42 ++-- .config/nvim/lua/plugins/oil.lua | 9 +- .config/nvim/lua/plugins/plantuml.lua | 9 + .config/nvim/lua/plugins/telescope.lua | 5 +- .tmux.conf | 2 +- .zshrc | 105 ++++----- my-status-bar.tmux | 10 +- 22 files changed, 341 insertions(+), 317 deletions(-) create mode 100644 .config/nvim/lua/plugins/autoclose.lua create mode 100644 .config/nvim/lua/plugins/diffview.lua create mode 100644 .config/nvim/lua/plugins/harpoon.lua create mode 100644 .config/nvim/lua/plugins/java.lua create mode 100644 .config/nvim/lua/plugins/markdown.lua create mode 100644 .config/nvim/lua/plugins/neo-tree.lua create mode 100644 .config/nvim/lua/plugins/neotest.lua create mode 100644 .config/nvim/lua/plugins/nvim-spectre.lua create mode 100644 .config/nvim/lua/plugins/plantuml.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 1eb361f..b2ccd02 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,24 +1,26 @@ { - "CopilotChat.nvim": { "branch": "canary", "commit": "9e7010bd33808e31d3f729b5e18a772d8e84f704" }, + "CopilotChat.nvim": { "branch": "canary", "commit": "2352cd3e7e980cd73594be05f96b2dc4c0dd4a74" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, "auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" }, - "auto-session": { "branch": "main", "commit": "a90aa7730efa60fdcc7e00497a8f36d94a6da709" }, + "auto-session": { "branch": "main", "commit": "51e26935e3cc5c46b7dd93f3762a803540ff3581" }, + "autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "bufexplorer": { "branch": "master", "commit": "fcf3a65a69020f0f54be8fa925f841874a5f3a01" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, - "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, + "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "fittencode.nvim": { "branch": "master", "commit": "47b5bb3287b45c8638430ad8768ab7a3050f16aa" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, - "lazy.nvim": { "branch": "main", "commit": "48b52b5cfcf8f88ed0aff8fde573a5cc20b1306d" }, + "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, + "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, @@ -28,24 +30,25 @@ "neotest": { "branch": "master", "commit": "6d6ad113f56edc7c3f2a77a0836ea8c1b955ebea" }, "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, "none-ls.nvim": { "branch": "main", "commit": "9b98991e15dce8fc502993e23caac2528b8b667f" }, - "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, + "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, "nvim-lspconfig": { "branch": "master", "commit": "73e0002b6f211376bbf36c31a2f812aedf6bd6b0" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "4770d9a1a77b0cc2b723c646c3dbe43a9133e5db" }, + "nvim-treesitter": { "branch": "master", "commit": "2b2ac302324f4cd2194c5dcaa59332b65e1c6403" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "nvim-web-devicons": { "branch": "master", "commit": "9793801f974bba70e4ac5d7eae6c4f5659993d8e" }, - "oil.nvim": { "branch": "master", "commit": "1fe476daf0b3c108cb8ee1fc1226cc282fa2c9c1" }, - "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, - "refactoring.nvim": { "branch": "master", "commit": "c406fc5fb4d7ba5fce7b668637075fad6e75e9f8" }, - "solarized.nvim": { "branch": "main", "commit": "50edf5a4eee481cf179685508a219fa683ea0949" }, + "nvim-web-devicons": { "branch": "master", "commit": "9154484705968658e9aab2b894d1b2a64bf9f83d" }, + "oil.nvim": { "branch": "master", "commit": "1360be5fda9c67338331abfcd80de2afbb395bcd" }, + "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, + "plantuml-previewer.vim": { "branch": "master", "commit": "1dd4d0f2b09cd80a217f76d82f93830dbbe689b3" }, + "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, + "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, - "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" } + "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" } } diff --git a/.config/nvim/lua/plugins/autoclose.lua b/.config/nvim/lua/plugins/autoclose.lua new file mode 100644 index 0000000..bd3038f --- /dev/null +++ b/.config/nvim/lua/plugins/autoclose.lua @@ -0,0 +1,4 @@ +return { + "m4xshen/autoclose.nvim", + lazy = false, +} diff --git a/.config/nvim/lua/plugins/autosave.lua b/.config/nvim/lua/plugins/autosave.lua index ac9eb80..701ef84 100644 --- a/.config/nvim/lua/plugins/autosave.lua +++ b/.config/nvim/lua/plugins/autosave.lua @@ -3,7 +3,18 @@ return { lazy = false, config = function() require("auto-save").setup({ - debounce_delay = 50 + debounce_delay = 50, + -- condition = function(buf) + -- local fn = vim.fn + -- local utils = require("auto-save.utils.data") + -- + -- if + -- fn.getbufvar(buf, "&modifiable") == 1 and + -- utils.not_in(fn.getbufvar(buf, "&filetype"), {"oil"}) then + -- return true + -- end + -- return false + -- end, }) end, } diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index 6ef5fcb..0b6f5b4 100644 --- a/.config/nvim/lua/plugins/colorscheme.lua +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -1,8 +1,19 @@ return { - "tiagovla/tokyodark.nvim", - lazy = false, - priority = 1000, - config = function() - vim.cmd("colorscheme tokyodark") - end, + { + "tiagovla/tokyodark.nvim", + lazy = false, + priority = 1000, + config = function() + vim.cmd("colorscheme tokyodark") + end, + }, + -- { + -- "maxmx03/solarized.nvim", + -- lazy = false, + -- priority = 1000, + -- config = function() + -- vim.cmd("colorscheme solarized") + -- vim.cmd("set bg=light") + -- end, + -- }, } diff --git a/.config/nvim/lua/plugins/copilotchat.lua b/.config/nvim/lua/plugins/copilotchat.lua index 8afa071..0d452d2 100644 --- a/.config/nvim/lua/plugins/copilotchat.lua +++ b/.config/nvim/lua/plugins/copilotchat.lua @@ -1,38 +1,38 @@ return { - "CopilotC-Nvim/CopilotChat.nvim", - branch = "canary", - dependencies = { - { "zbirenbaum/copilot.lua" }, - { "nvim-lua/plenary.nvim" }, - }, - build = "make tiktoken", - opts = { - auto_insert_mode = true, - }, - cmd = { - "CopilotChat", - "CopilotChatOpen", - "CopilotChatClose", - "CopilotChatToggle", - "CopilotChatStop", - "CopilotChatReset", - "CopilotChatSave", - "CopilotChatLoad", - "CopilotChatDebugInfo", - "CopilotChatModels", - "CopilotChatModel", - "CopilotChatExplain", - "CopilotChatReview", - "CopilotChatFix", - "CopilotChatOptimize", - "CopilotChatDocs", - "CopilotChatTests", - "CopilotChatFixDiagnostic", - "CopilotChatCommit", - "CopilotChatCommitStaged", - }, - keys = { - { "p", "CopilotChat" }, - { "P", "CopilotChatFix" }, - } + "CopilotC-Nvim/CopilotChat.nvim", + branch = "canary", + dependencies = { + { "zbirenbaum/copilot.lua" }, + { "nvim-lua/plenary.nvim" }, + }, + build = "make tiktoken", + opts = { + auto_insert_mode = true, + }, + cmd = { + "CopilotChat", + "CopilotChatOpen", + "CopilotChatClose", + "CopilotChatToggle", + "CopilotChatStop", + "CopilotChatReset", + "CopilotChatSave", + "CopilotChatLoad", + "CopilotChatDebugInfo", + "CopilotChatModels", + "CopilotChatModel", + "CopilotChatExplain", + "CopilotChatReview", + "CopilotChatFix", + "CopilotChatOptimize", + "CopilotChatDocs", + "CopilotChatTests", + "CopilotChatFixDiagnostic", + "CopilotChatCommit", + "CopilotChatCommitStaged", + }, + keys = { + { "p", "CopilotChat" }, + { "P", "CopilotChatFix" }, + } } diff --git a/.config/nvim/lua/plugins/diffview.lua b/.config/nvim/lua/plugins/diffview.lua new file mode 100644 index 0000000..73418f6 --- /dev/null +++ b/.config/nvim/lua/plugins/diffview.lua @@ -0,0 +1,10 @@ +return { + "sindrets/diffview.nvim", + lazy = false, + -- cmd = { + -- "DiffViewOpen" + -- }, + keys = { + { "do", "DiffviewOpen" } + } +} diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua index 01db537..18e1c3e 100644 --- a/.config/nvim/lua/plugins/gitsigns.lua +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -5,7 +5,7 @@ return { require("gitsigns").setup({ numhl = true, attach_to_untracked = true, - update_debounce = 10, + update_debounce = 5, on_attach = function(bufnr) local gitsigns = require("gitsigns") end, diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua new file mode 100644 index 0000000..fd6fa50 --- /dev/null +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -0,0 +1,16 @@ +return { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + lazy = false, + keys = { + { "", function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end }, + { "", function() require("harpoon").list():add() end }, + { "", function() require("harpoon").list():select(1) end }, + { "", function() require("harpoon").list():select(2) end }, + { "", function() require("harpoon").list():select(3) end }, + { "", function() require("harpoon").list():select(4) end }, + { "", function() require("harpoon").list():select(5) end }, + { "", function() require("harpoon").list():select(6) end }, + } +} diff --git a/.config/nvim/lua/plugins/java.lua b/.config/nvim/lua/plugins/java.lua new file mode 100644 index 0000000..5fb5bb8 --- /dev/null +++ b/.config/nvim/lua/plugins/java.lua @@ -0,0 +1,3 @@ +return { + -- 'nvim-java/nvim-java', +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 5bebdb3..0649085 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,136 +1,41 @@ return { - { - "ThePrimeagen/refactoring.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - opts = {}, - keys = { - { - "rr", - function() - require("refactoring").select_refactor() - end, - desc = "Refactor", - }, - }, - }, - { - "zbirenbaum/copilot.lua", - cmd = "Copilot", - event = "InsertEnter", - config = function() - require("copilot").setup({}) - end, - }, - { - "zbirenbaum/copilot-cmp", - lazy = false, - event = "InsertEnter", - config = function() - require("copilot_cmp").setup() - require("copilot").setup({ - suggestion = { enabled = false }, - panel = { enabled = false }, - }) - end, - }, - { - "CopilotC-Nvim/CopilotChat.nvim", - dependencies = { - { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim - { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper - }, - commands = { - "CopilotChat", - "CopilotChat", - "CopilotChatOpen", - "CopilotChatClose", - "CopilotChatToggle", - "CopilotChatStop", - "CopilotChatReset", - "CopilotChatSave", - "CopilotChatLoad", - "CopilotChatDebugInfo", - "CopilotChatModels", - "CopilotChatExplain", - "CopilotChatReview", - "CopilotChatFix", - "CopilotChatOptimize", - "CopilotChatDocs", - "CopilotChatTests", - "CopilotChatFixDiagnostic", - "CopilotChatCommit", - "CopilotChatCommitStaged", - }, - opts = { - temperature = 0.3, - mappings = { - reset = { - normal = "", - insert = "", - }, - complete = { - detail = "Use @ or / for options.", - insert = "", - }, - close = { - normal = "q", - insert = "", - }, - submit_prompt = { - normal = "", - insert = "", - }, - accept_diff = { - normal = "", - insert = "", - }, - yank_diff = { - normal = "gy", - }, - show_diff = { - normal = "gd", - }, - show_system_prompt = { - normal = "gp", - }, - show_user_selection = { - normal = "gs", - }, - }, - }, - keys = { - { - "ccq", - function() - local input = vim.fn.input("Quick Chat: ") - if input ~= "" then - require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) - end - end, - desc = "CopilotChat - Quick chat", - }, - { - "cch", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.help_actions()) - end, - desc = "CopilotChat - Help actions", - }, - -- Show prompts actions with telescope - { - "ccp", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) - end, - desc = "CopilotChat - Prompt actions", - }, - }, - }, + -- { + -- "ThePrimeagen/refactoring.nvim", + -- dependencies = { + -- "nvim-lua/plenary.nvim", + -- "nvim-treesitter/nvim-treesitter", + -- }, + -- opts = {}, + -- keys = { + -- { + -- "rr", + -- function() + -- require("refactoring").select_refactor() + -- end, + -- desc = "Refactor", + -- }, + -- }, + -- }, + -- { + -- "zbirenbaum/copilot.lua", + -- cmd = "Copilot", + -- event = "InsertEnter", + -- config = function() + -- require("copilot").setup({}) + -- end, + -- }, + -- { + -- "zbirenbaum/copilot-cmp", + -- lazy = false, + -- event = "InsertEnter", + -- config = function() + -- require("copilot_cmp").setup() + -- require("copilot").setup({ + -- suggestion = { enabled = false }, + -- panel = { enabled = false }, + -- }) + -- end, + -- }, { "williamboman/mason.nvim", lazy = false, @@ -155,33 +60,39 @@ return { lazy = false, config = function() local capabilities = require("cmp_nvim_lsp").default_capabilities() - -- https://www.mitchellhanberg.com/modern-format-on-save-in-neovim/ - -- vim.api.nvim_create_autocmd("LspAttach", { - -- group = vim.api.nvim_create_augroup("lsp", { clear = true }), - -- callback = function(args) - -- vim.api.nvim_create_autocmd("BufWritePre", { - -- buffer = args.buf, - -- callback = function() - -- vim.lsp.buf.format({ async = false, id = args.data.client_id }) - -- end, - -- }) - -- end, - -- }) + -- require('java').setup() local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup({ capabilities = capabilities }) - lspconfig.ruby_lsp.setup({ capabilities = capabilities }) - -- lspconfig.tsserver.setup({ capabilities = capabilities }) - -- lspconfig.standardrb.setup({ capabilities = capabilities }) - lspconfig.rubocop.setup({ capabilities = capabilities }) - -- lspconfig.rust_analyzer.setup({ capabilities = capabilities }) + + -- Function to disable LSP for oil buffer + local function disable_lsp_for_oil_buffer(client, bufnr) + local bufname = vim.api.nvim_buf_get_name(bufnr) + if bufname:match("oil://") then + vim.lsp.stop_client(client.id) + end + end + + lspconfig.lua_ls.setup({ + capabilities = capabilities, + on_attach = disable_lsp_for_oil_buffer, + }) + lspconfig.ruby_lsp.setup({ + capabilities = capabilities, + on_attach = disable_lsp_for_oil_buffer, + }) + lspconfig.rubocop.setup({ + capabilities = capabilities, + on_attach = disable_lsp_for_oil_buffer, + }) lspconfig.ltex.setup({ cmd = { "ltex-ls" }, filetypes = { "markdown", "text", "cff", "tex" }, flags = { debounce_text_changes = 299 }, + on_attach = disable_lsp_for_oil_buffer, + }) + lspconfig.astro.setup({ + on_attach = disable_lsp_for_oil_buffer, }) - lspconfig.astro.setup({}) - lspconfig.solargraph.setup({ capabilities = capabilities, cmd = { @@ -201,6 +112,7 @@ return { symbols = true, }, }, + on_attach = disable_lsp_for_oil_buffer, }) vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) @@ -212,7 +124,7 @@ return { autocmd BufNewFile,BufRead *.prawn set filetype=ruby ]]) end, - }, +}, { "nvimtools/none-ls.nvim", config = function() @@ -306,13 +218,13 @@ return { }) end, }, - { - "zbirenbaum/copilot-cmp", - event = "InsertEnter", - config = function() - require("copilot_cmp").setup() - end, - }, + -- { + -- "zbirenbaum/copilot-cmp", + -- event = "InsertEnter", + -- config = function() + -- require("copilot_cmp").setup() + -- end, + -- }, -- { -- "nvim-treesitter/nvim-treesitter-refactor", -- lazy = false, diff --git a/.config/nvim/lua/plugins/markdown.lua b/.config/nvim/lua/plugins/markdown.lua new file mode 100644 index 0000000..0e6de23 --- /dev/null +++ b/.config/nvim/lua/plugins/markdown.lua @@ -0,0 +1,7 @@ +return { + "tadmccorkle/markdown.nvim", + ft = "markdown", -- or 'event = "VeryLazy"' + opts = { + -- configuration here or empty for defaults + }, +} diff --git a/.config/nvim/lua/plugins/neo-tree.lua b/.config/nvim/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..a15843f --- /dev/null +++ b/.config/nvim/lua/plugins/neo-tree.lua @@ -0,0 +1,11 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + lazy = false, + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information + } +} diff --git a/.config/nvim/lua/plugins/neotest.lua b/.config/nvim/lua/plugins/neotest.lua new file mode 100644 index 0000000..fe48b6c --- /dev/null +++ b/.config/nvim/lua/plugins/neotest.lua @@ -0,0 +1,11 @@ +return { + "nvim-neotest/neotest", + event = "VeryLazy", + dependencies = { + "nvim-neotest/nvim-nio", + "nvim-lua/plenary.nvim", + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter", + "olimorris/neotest-rspec" + } +} diff --git a/.config/nvim/lua/plugins/nvim-spectre.lua b/.config/nvim/lua/plugins/nvim-spectre.lua new file mode 100644 index 0000000..2334570 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-spectre.lua @@ -0,0 +1,7 @@ +return { + "nvim-pack/nvim-spectre", + dependencies = { + 'nvim-lua/plenary.nvim' + }, + lazy = false +} diff --git a/.config/nvim/lua/plugins/nvim-treesitter.lua b/.config/nvim/lua/plugins/nvim-treesitter.lua index 8e6b1fe..c10aaac 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter.lua @@ -1,19 +1,19 @@ return { - "nvim-treesitter/nvim-treesitter", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - "nvim-treesitter/nvim-treesitter-textobjects", - }, - config = function() - require("nvim-treesitter.configs").setup { - ensure_installed = { "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "ruby", "javascript", "rust", "html", "embedded_template" }, - incremental_selection = { - enable = true, - keymaps = { - node_incremental = "v", - node_decremental = "V", - }, - }, - } - end, + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "nvim-treesitter/nvim-treesitter-textobjects", + }, + config = function() + require("nvim-treesitter.configs").setup { + ensure_installed = { "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "ruby", "javascript", "rust", "html", "embedded_template" }, + incremental_selection = { + enable = true, + keymaps = { + node_incremental = "tab", + node_decremental = "", + }, + }, + } + end, } diff --git a/.config/nvim/lua/plugins/nvim-ts-autotag.lua b/.config/nvim/lua/plugins/nvim-ts-autotag.lua index ec2944d..9ce065e 100644 --- a/.config/nvim/lua/plugins/nvim-ts-autotag.lua +++ b/.config/nvim/lua/plugins/nvim-ts-autotag.lua @@ -1,23 +1,23 @@ return { - "windwp/nvim-ts-autotag", - lazy = false, - -- event = { "BufReadPre", "BufNewFile" }, - config = function() - require('nvim-ts-autotag').setup({ - opts = { - -- Defaults - enable_close = true, -- Auto close tags - enable_rename = true, -- Auto rename pairs of tags - enable_close_on_slash = false -- Auto close on trailing "] = { "actions.select", opts = { horizontal = true }, desc = "Open the entry in a horizontal split" }, [""] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" }, [""] = "actions.preview", - [""] = "actions.close", - [""] = "actions.refresh", ["-"] = "actions.parent", ["_"] = "actions.open_cwd", ["`"] = "actions.cd", ["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory" }, ["gs"] = "actions.change_sort", + [""] = { + "actions.open_cmdline", + opts = { + modify = ":! open", + }, + desc = "Open file", + }, }, use_default_keymaps = false, view_options = { diff --git a/.config/nvim/lua/plugins/plantuml.lua b/.config/nvim/lua/plugins/plantuml.lua new file mode 100644 index 0000000..5a88468 --- /dev/null +++ b/.config/nvim/lua/plugins/plantuml.lua @@ -0,0 +1,9 @@ +return { + "weirongxu/plantuml-previewer.vim", + dependencies = { "tyru/open-browser.vim", "aklt/plantuml-syntax" }, + lazy = false, + config = function() + vim.g.plantuml_previewer_plantuml_jar_path = '/opt/homebrew/bin/plantuml' + end +} + diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 658f5af..1055ff4 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -4,7 +4,10 @@ return { keys = { { "f", "Telescope find_files hidden=true" }, { "w", "Telescope live_grep" }, - { "r", "Telescope resume" }, + { "r", function() + local current_word = vim.fn.expand("") + require('telescope.builtin').grep_string({ search = current_word }) + end }, { "c", "Telescope git_commits" }, } } diff --git a/.tmux.conf b/.tmux.conf index 4c6ab13..a838708 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -2,7 +2,7 @@ unbind C-b set -g prefix C-s bind a send-prefix -bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." +# bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." bind - split-window -v -c "#{pane_current_path}" unbind '"' diff --git a/.zshrc b/.zshrc index e16b232..2a6201b 100644 --- a/.zshrc +++ b/.zshrc @@ -6,6 +6,7 @@ if [ "$TERM_PROGRAM" = "WarpTerminal" ] && [ "$TERMINAL_EMULATOR" != "JetBrains- printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "zsh"}}\x9c' fi +. ~/.asdf/plugins/java/set-java-home.zsh PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH" export PATH="$HOME/.asdf/installs/ruby/latest/bin:$PATH" export PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH" @@ -197,58 +198,58 @@ alias gcf="git checkout -b feature/" compinit -C # BEGIN zsh-sticky-prompt -ZLE_STICKY_PROMPT_LEFT="" -ZLE_STICKY_PROMPT_RIGHT="" - -sticky-prompt-zle-line-init() { - LBUFFER="$ZLE_STICKY_PROMPT_LEFT" - RBUFFER="$ZLE_STICKY_PROMPT_RIGHT" - zle _zle-line-init -} - -sticky-prompt-set() { - if [[ -z "$BUFFER" ]]; then - if [[ -z "$ZLE_STICKY_PROMPT_LEFT" ]]; then - zle -M "No sticky prompt set." - else - ZLE_STICKY_PROMPT_LEFT="" - ZLE_STICKY_PROMPT_RIGHT="" - zle -M "Removed sticky prompt." - fi - return - fi - - local ZLE_STICKY_PROMPT_PREV_LEFT="$ZLE_STICKY_PROMPT_LEFT" - local ZLE_STICKY_PROMPT_PREV_RIGHT="$ZLE_STICKY_PROMPT_RIGHT" - ZLE_STICKY_PROMPT_LEFT="$LBUFFER" - ZLE_STICKY_PROMPT_RIGHT="$RBUFFER" - - if { [[ -n "$ZLE_STICKY_PROMPT_LEFT" ]] && [[ "$ZLE_STICKY_PROMPT_PREV_LEFT" != "$ZLE_STICKY_PROMPT_LEFT" ]]; } || - { [[ -n "$ZLE_STICKY_PROMPT_RIGHT" ]] && [[ "$ZLE_STICKY_PROMPT_PREV_RIGHT" != "$ZLE_STICKY_PROMPT_RIGHT" ]]; }; then - zle -M "Sticky prompt $ZLE_STICKY_PROMPT_LEFT|$ZLE_STICKY_PROMPT_RIGHT" - else - ZLE_STICKY_PROMPT_LEFT="" - ZLE_STICKY_PROMPT_RIGHT="" - BUFFER="" - zle -M "Removed sticky prompt." - fi -} - -sticky-prompt-accept-line() { - if [[ -z "$BUFFER" ]] && [[ -n "$ZLE_STICKY_PROMPT_LEFT" ]]; then - ZLE_STICKY_PROMPT_LEFT="" - ZLE_STICKY_PROMPT_RIGHT="" - zle -M "Removed sticky prompt." - fi - zle .accept-line -} - -functions[_zle-line-init]="${functions[zle-line-init]}" -zle -N _zle-line-init -zle -N zle-line-init sticky-prompt-zle-line-init -zle -N sticky-prompt-set -zle -N accept-line sticky-prompt-accept-line -bindkey '^F' sticky-prompt-set +# ZLE_STICKY_PROMPT_LEFT="" +# ZLE_STICKY_PROMPT_RIGHT="" +# +# sticky-prompt-zle-line-init() { +# LBUFFER="$ZLE_STICKY_PROMPT_LEFT" +# RBUFFER="$ZLE_STICKY_PROMPT_RIGHT" +# zle _zle-line-init +# } +# +# sticky-prompt-set() { +# if [[ -z "$BUFFER" ]]; then +# if [[ -z "$ZLE_STICKY_PROMPT_LEFT" ]]; then +# zle -M "No sticky prompt set." +# else +# ZLE_STICKY_PROMPT_LEFT="" +# ZLE_STICKY_PROMPT_RIGHT="" +# zle -M "Removed sticky prompt." +# fi +# return +# fi +# +# local ZLE_STICKY_PROMPT_PREV_LEFT="$ZLE_STICKY_PROMPT_LEFT" +# local ZLE_STICKY_PROMPT_PREV_RIGHT="$ZLE_STICKY_PROMPT_RIGHT" +# ZLE_STICKY_PROMPT_LEFT="$LBUFFER" +# ZLE_STICKY_PROMPT_RIGHT="$RBUFFER" +# +# if { [[ -n "$ZLE_STICKY_PROMPT_LEFT" ]] && [[ "$ZLE_STICKY_PROMPT_PREV_LEFT" != "$ZLE_STICKY_PROMPT_LEFT" ]]; } || +# { [[ -n "$ZLE_STICKY_PROMPT_RIGHT" ]] && [[ "$ZLE_STICKY_PROMPT_PREV_RIGHT" != "$ZLE_STICKY_PROMPT_RIGHT" ]]; }; then +# zle -M "Sticky prompt $ZLE_STICKY_PROMPT_LEFT|$ZLE_STICKY_PROMPT_RIGHT" +# else +# ZLE_STICKY_PROMPT_LEFT="" +# ZLE_STICKY_PROMPT_RIGHT="" +# BUFFER="" +# zle -M "Removed sticky prompt." +# fi +# } +# +# sticky-prompt-accept-line() { +# if [[ -z "$BUFFER" ]] && [[ -n "$ZLE_STICKY_PROMPT_LEFT" ]]; then +# ZLE_STICKY_PROMPT_LEFT="" +# ZLE_STICKY_PROMPT_RIGHT="" +# zle -M "Removed sticky prompt." +# fi +# zle .accept-line +# } +# +# functions[_zle-line-init]="${functions[zle-line-init]}" +# zle -N _zle-line-init +# zle -N zle-line-init sticky-prompt-zle-line-init +# zle -N sticky-prompt-set +# zle -N accept-line sticky-prompt-accept-line +# bindkey '^F' sticky-prompt-set # END zsh-sticky-prompt diff --git a/my-status-bar.tmux b/my-status-bar.tmux index dc9e63b..d00a282 100755 --- a/my-status-bar.tmux +++ b/my-status-bar.tmux @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +!/usr/bin/env bash #=============================================================================== # Author: CuddlyBunion341 # Created: 2024-04-13 22:25 @@ -13,12 +13,12 @@ tmux_set() { tmux set-option -gq "$1" "$2" } -color1="#000000" +color1="#fcf6e5" # color1="#fdf6e3" # color1="#000000" -color2="white" -color3="white" -color4="white" +color2="black" +color3="black" +color4="black" secondary="#[fg=$color2,bg=$color1]" tertiary="#[fg=black,bg=$color1]" From b95c25da73064c901f2826f8730fd3f3024e3c04 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 22 Sep 2024 18:56:31 +0200 Subject: [PATCH 157/280] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 6c7a90c..f481379 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,12 @@ This is a collection of my dotfiles for my personal development setup. Other than the dotfiles, I also have a few scripts that I use to automate some tasks. + +## Configuration + +[Alacritty](./.config/alacritty/alacritty.toml) +[Nvim](./.config/nvim/init.lua) +[Lazygit](./lazygit/config.yml) +[Tmux](./.tmux.conf) +[Zsh](./.zshrc) +[Utility Scripts](./scripts/) From a792ad45263ba946ce47d6a56535669b157db325 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 22 Sep 2024 18:57:11 +0200 Subject: [PATCH 158/280] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f481379..b05e0eb 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ Other than the dotfiles, I also have a few scripts that I use to automate some t ## Configuration -[Alacritty](./.config/alacritty/alacritty.toml) -[Nvim](./.config/nvim/init.lua) -[Lazygit](./lazygit/config.yml) -[Tmux](./.tmux.conf) -[Zsh](./.zshrc) -[Utility Scripts](./scripts/) +* [Alacritty](./.config/alacritty/alacritty.toml) +* [Nvim](./.config/nvim/init.lua) +* [Lazygit](./lazygit/config.yml) +* [Tmux](./.tmux.conf) +* [Zsh](./.zshrc) +* [Utility Scripts](./scripts/) From 3b07a4222d10c4cc5cbfa3cc98ff344cb00ba736 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 22 Sep 2024 20:13:22 +0200 Subject: [PATCH 159/280] Add dag cag mappings --- .config/nvim/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 3c4f21b..2f3e330 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -23,6 +23,8 @@ vim.keymap.set("n", "s", ":w") vim.keymap.set("n", "g=", "ggVG=") vim.keymap.set("n", "zt", "%s/\t/ /g") vim.keymap.set("n", "vag", "ggVG") +vim.keymap.set("n", "dag", "ggVGd") +vim.keymap.set("n", "cag", "ggVGc") vim.keymap.set("n", "gJ", "Jx") vim.api.nvim_set_keymap('n', '', 'qq', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '', 'q', { noremap = true, silent = true }) From e876df8671aca271d8edd0f30759850016c473aa Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 25 Sep 2024 08:17:05 +0200 Subject: [PATCH 160/280] Add tab mapping --- .config/nvim/init.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 2f3e330..7e2b2e6 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -30,6 +30,37 @@ vim.api.nvim_set_keymap('n', '', 'qq', { noremap = true, silent = true } vim.api.nvim_set_keymap('n', '', 'q', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '', '@q', { noremap = true, silent = true }) +-- tabs +vim.keymap.set("n", "", ":tabnew", { noremap = true }) +vim.keymap.set("n", "", ":tabnext", { noremap = true }) +vim.keymap.set("n", "", ":tabprevious", { noremap = true }) + +-- terminal +vim.keymap.set("n", "", ":vert terminal", { noremap = true }) +vim.keymap.set("t", "", "", { noremap = true }) + +-- Function to toggle terminal on the right +function toggle_terminal() + local term_bufnr = nil + for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do + if vim.api.nvim_buf_get_option(bufnr, 'buftype') == 'terminal' then + term_bufnr = bufnr + break + end + end + + if term_bufnr then + -- If terminal is open, close it + vim.api.nvim_buf_delete(term_bufnr, { force = true }) + else + -- If terminal is not open, open it in a vertical split + vim.cmd('vsplit | terminal') + end +end + +-- Map Ctrl + . to toggle terminal +vim.keymap.set("n", "", toggle_terminal, { noremap = true, silent = true }) + vim.opt.splitright = true vim.opt.splitbelow = true vim.keymap.set('n', '', ':wincmd k', { silent = true }) From ed19f0da312943c2e1d746a316441922b5f02575 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 25 Sep 2024 21:27:27 +0200 Subject: [PATCH 161/280] remove lsp --- .config/nvim/lazy-lock.json | 35 ---------------------------- .config/nvim/lua/plugins/harpoon.lua | 16 ------------- 2 files changed, 51 deletions(-) delete mode 100644 .config/nvim/lua/plugins/harpoon.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 33a368c..2c63c08 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,37 +1,2 @@ { - "CopilotChat.nvim": { "branch": "canary", "commit": "2352cd3e7e980cd73594be05f96b2dc4c0dd4a74" }, - "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, - "auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" }, - "auto-session": { "branch": "main", "commit": "51e26935e3cc5c46b7dd93f3762a803540ff3581" }, - "autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" }, - "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, - "bufexplorer": { "branch": "master", "commit": "fcf3a65a69020f0f54be8fa925f841874a5f3a01" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, - "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "fittencode.nvim": { "branch": "master", "commit": "47b5bb3287b45c8638430ad8768ab7a3050f16aa" }, - "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, - "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, - "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "2b2ac302324f4cd2194c5dcaa59332b65e1c6403" }, - "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, - "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "nvim-web-devicons": { "branch": "master", "commit": "9154484705968658e9aab2b894d1b2a64bf9f83d" }, - "oil.nvim": { "branch": "master", "commit": "1360be5fda9c67338331abfcd80de2afbb395bcd" }, - "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, - "plantuml-previewer.vim": { "branch": "master", "commit": "1dd4d0f2b09cd80a217f76d82f93830dbbe689b3" }, - "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, - "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, - "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, - "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, - "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" } } diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua deleted file mode 100644 index fd6fa50..0000000 --- a/.config/nvim/lua/plugins/harpoon.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - "ThePrimeagen/harpoon", - branch = "harpoon2", - dependencies = { "nvim-lua/plenary.nvim" }, - lazy = false, - keys = { - { "", function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end }, - { "", function() require("harpoon").list():add() end }, - { "", function() require("harpoon").list():select(1) end }, - { "", function() require("harpoon").list():select(2) end }, - { "", function() require("harpoon").list():select(3) end }, - { "", function() require("harpoon").list():select(4) end }, - { "", function() require("harpoon").list():select(5) end }, - { "", function() require("harpoon").list():select(6) end }, - } -} From 44599a7203ba145ebce9fb871404e4a26a987828 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 25 Sep 2024 21:27:33 +0200 Subject: [PATCH 162/280] Implement lsp stop --- .config/nvim/lua/plugins/lsp.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 9b0679d..32f3090 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -227,6 +227,10 @@ return { autocmd BufNewFile,BufRead *.prawn set filetype=ruby ]]) end, + keys = { + {"ls", "LspStop"}, + {"lS", "LspStart"}, + } }, { "nvimtools/none-ls.nvim", From 73b3fa0c420316bd9947388a195643b59d99dd69 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 25 Sep 2024 21:27:43 +0200 Subject: [PATCH 163/280] change theme --- .config/alacritty/alacritty.toml | 2 +- .config/nvim/lua/plugins/colorscheme.lua | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 7daade7..5846782 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,5 +1,5 @@ import = [ - "/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Campbell.toml" + "/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Solarized-Light.toml" ] [env] diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index 0b6f5b4..dfa2684 100644 --- a/.config/nvim/lua/plugins/colorscheme.lua +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -1,19 +1,19 @@ return { - { - "tiagovla/tokyodark.nvim", - lazy = false, - priority = 1000, - config = function() - vim.cmd("colorscheme tokyodark") - end, - }, -- { - -- "maxmx03/solarized.nvim", + -- "tiagovla/tokyodark.nvim", -- lazy = false, -- priority = 1000, -- config = function() - -- vim.cmd("colorscheme solarized") - -- vim.cmd("set bg=light") + -- vim.cmd("colorscheme tokyodark") -- end, -- }, + { + "maxmx03/solarized.nvim", + lazy = false, + priority = 1000, + config = function() + vim.cmd("colorscheme solarized") + vim.cmd("set bg=light") + end, + }, } From c1fc76789721643d0404e3d9d77f548426714fa0 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 25 Sep 2024 21:27:47 +0200 Subject: [PATCH 164/280] update autocomplete --- .zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 3e81b20..fbabe38 100644 --- a/.zshrc +++ b/.zshrc @@ -24,7 +24,7 @@ export EDITOR="nvim" unset LIBRARY_PATH unset LDFLAGS -# source $HOMEBREW_PREFIX/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh +source $HOMEBREW_PREFIX/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc" source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc" From 457749a72a7fdb77454214175dd31ba412c06b30 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 25 Sep 2024 21:32:35 +0200 Subject: [PATCH 165/280] Fix merge conflicts --- .config/nvim/lazy-lock.json | 40 +++++ .config/nvim/lua/plugins/lsp.lua | 274 +++++++++++++++---------------- 2 files changed, 173 insertions(+), 141 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 2c63c08..55598e2 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,2 +1,42 @@ { + "CopilotChat.nvim": { "branch": "canary", "commit": "9333944fde3c65868818e245c73aa29eef826e9b" }, + "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, + "auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" }, + "auto-session": { "branch": "main", "commit": "21e33854fb3e561cb738dfefcd9d1d84fe6faaef" }, + "autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" }, + "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, + "bufexplorer": { "branch": "master", "commit": "fcf3a65a69020f0f54be8fa925f841874a5f3a01" }, + "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "fittencode.nvim": { "branch": "master", "commit": "47b5bb3287b45c8638430ad8768ab7a3050f16aa" }, + "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, + "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, + "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, + "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, + "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, + "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, + "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, + "multiple-cursors.nvim": { "branch": "main", "commit": "2f5e786c43aa9c0fc34b295cfcc9bfbacef8e926" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, + "neotest": { "branch": "master", "commit": "48f8b5fce704594eb0ff94338e080defca14f0dc" }, + "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, + "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, + "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, + "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, + "nvim-treesitter": { "branch": "master", "commit": "0c8a582e474e248f2a4406188e0c653f92a064cf" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, + "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, + "nvim-web-devicons": { "branch": "master", "commit": "26220156aafb198b2de6a4cf80c1b120a3768da0" }, + "oil.nvim": { "branch": "master", "commit": "1360be5fda9c67338331abfcd80de2afbb395bcd" }, + "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, + "plantuml-previewer.vim": { "branch": "master", "commit": "555347700382c97b347bace57b7a9f764ed556b1" }, + "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "solarized.nvim": { "branch": "main", "commit": "1293bec92289d9431fb0ede0b627de8ab60b895e" }, + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, + "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, + "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" } } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 32f3090..c472ac5 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -18,152 +18,144 @@ return { }) end, }, + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + config = function() + require("copilot").setup({}) + end, + }, + { + "zbirenbaum/copilot-cmp", + lazy = false, + event = "InsertEnter", + config = function() + require("copilot_cmp").setup() + require("copilot").setup({ + suggestion = { enabled = false }, + panel = { enabled = false }, + }) + end, + }, + { + "CopilotC-Nvim/CopilotChat.nvim", + dependencies = { + { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim + { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper + }, + commands = { + "CopilotChat", + "CopilotChatOpen", + "CopilotChatClose", + "CopilotChatToggle", + "CopilotChatStop", + "CopilotChatReset", + "CopilotChatSave", + "CopilotChatLoad", + "CopilotChatDebugInfo", + "CopilotChatModels", + "CopilotChatExplain", + "CopilotChatReview", + "CopilotChatFix", + "CopilotChatOptimize", + "CopilotChatDocs", + "CopilotChatTests", + "CopilotChatFixDiagnostic", + "CopilotChatCommit", + "CopilotChatCommitStaged", + }, + opts = { + temperature = 0.3, + mappings = { + reset = { + normal = "", + insert = "", + }, + complete = { + detail = "Use @ or / for options.", + insert = "", + }, + close = { + normal = "q", + insert = "", + }, + submit_prompt = { + normal = "", + insert = "", + }, + accept_diff = { + normal = "", + insert = "", + }, + yank_diff = { + normal = "gy", + }, + show_diff = { + normal = "gd", + }, + show_system_prompt = { + normal = "gp", + }, + show_user_selection = { + normal = "gs", + }, + }, + }, + keys = { + { + "ccq", + function() + local input = vim.fn.input("Quick Chat: ") + if input ~= "" then + require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) + end + end, + desc = "CopilotChat - Quick chat", + }, + { + "cch", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.help_actions()) + end, + desc = "CopilotChat - Help actions", + }, + -- Show prompts actions with telescope + { + "ccp", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) + end, + desc = "CopilotChat - Prompt actions", + }, + }, + }, + { + "williamboman/mason.nvim", + lazy = false, + keys = { + { "m", "Mason" }, + }, + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + lazy = false, + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "tsserver", "solargraph" }, + }) + end, + }, { "neovim/nvim-lspconfig", lazy = false, config = function() local capabilities = require("cmp_nvim_lsp").default_capabilities() - -- require('java').setup( - }, - { - "zbirenbaum/copilot.lua", - cmd = "Copilot", - event = "InsertEnter", - config = function() - require("copilot").setup({}) - end, - }, - { - "zbirenbaum/copilot-cmp", - lazy = false, - event = "InsertEnter", - config = function() - require("copilot_cmp").setup() - require("copilot").setup({ - suggestion = { enabled = false }, - panel = { enabled = false }, - }) - end, - }, - { - "CopilotC-Nvim/CopilotChat.nvim", - dependencies = { - { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim - { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper - }, - commands = { - "CopilotChat", - "CopilotChat", - "CopilotChatOpen", - "CopilotChatClose", - "CopilotChatToggle", - "CopilotChatStop", - "CopilotChatReset", - "CopilotChatSave", - "CopilotChatLoad", - "CopilotChatDebugInfo", - "CopilotChatModels", - "CopilotChatExplain", - "CopilotChatReview", - "CopilotChatFix", - "CopilotChatOptimize", - "CopilotChatDocs", - "CopilotChatTests", - "CopilotChatFixDiagnostic", - "CopilotChatCommit", - "CopilotChatCommitStaged", - }, - opts = { - temperature = 0.3, - mappings = { - reset = { - normal = "", - insert = "", - }, - complete = { - detail = "Use @ or / for options.", - insert = "", - }, - close = { - normal = "q", - insert = "", - }, - submit_prompt = { - normal = "", - insert = "", - }, - accept_diff = { - normal = "", - insert = "", - }, - yank_diff = { - normal = "gy", - }, - show_diff = { - normal = "gd", - }, - show_system_prompt = { - normal = "gp", - }, - show_user_selection = { - normal = "gs", - }, - }, - }, - keys = { - { - "ccq", - function() - local input = vim.fn.input("Quick Chat: ") - if input ~= "" then - require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) - end - end, - desc = "CopilotChat - Quick chat", - }, - { - "cch", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.help_actions()) - end, - desc = "CopilotChat - Help actions", - }, - -- Show prompts actions with telescope - { - "ccp", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) - end, - desc = "CopilotChat - Prompt actions", - }, - }, - }, - { - "williamboman/mason.nvim", - lazy = false, - keys = { - { "m", "Mason" }, - }, - config = function() - require("mason").setup() - end, - }, - { - "williamboman/mason-lspconfig.nvim", - lazy = false, - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "tsserver", "solargraph" }, - }) - end, - }, - { - "neovim/nvim-lspconfig", - lazy = false, - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() local lspconfig = require("lspconfig") From 97a791610557436329becbb270647ffd27ac4565 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 25 Sep 2024 21:36:36 +0200 Subject: [PATCH 166/280] Update deps --- .config/nvim/lazy-lock.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 55598e2..8f76b41 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,26 +1,38 @@ { "CopilotChat.nvim": { "branch": "canary", "commit": "9333944fde3c65868818e245c73aa29eef826e9b" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, + "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, "auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" }, "auto-session": { "branch": "main", "commit": "21e33854fb3e561cb738dfefcd9d1d84fe6faaef" }, "autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "bufexplorer": { "branch": "master", "commit": "fcf3a65a69020f0f54be8fa925f841874a5f3a01" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "fittencode.nvim": { "branch": "master", "commit": "47b5bb3287b45c8638430ad8768ab7a3050f16aa" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, + "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, "multiple-cursors.nvim": { "branch": "main", "commit": "2f5e786c43aa9c0fc34b295cfcc9bfbacef8e926" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, "neotest": { "branch": "master", "commit": "48f8b5fce704594eb0ff94338e080defca14f0dc" }, "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, + "none-ls.nvim": { "branch": "main", "commit": "9b98991e15dce8fc502993e23caac2528b8b667f" }, "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-lspconfig": { "branch": "master", "commit": "73e0002b6f211376bbf36c31a2f812aedf6bd6b0" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, From 6b73e3320a36c97251868537a772a85c5782594f Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 25 Sep 2024 21:36:40 +0200 Subject: [PATCH 167/280] Add kitty --- .config/kitty/kitty.conf | 2510 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 2510 insertions(+) create mode 100644 .config/kitty/kitty.conf diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf new file mode 100644 index 0000000..2d62426 --- /dev/null +++ b/.config/kitty/kitty.conf @@ -0,0 +1,2510 @@ +# vim:fileencoding=utf-8:foldmethod=marker + +macos_hide_titlebar true +hide_window_decorations true + +#: Fonts {{{ + +#: kitty has very powerful font management. You can configure +#: individual font faces and even specify special fonts for particular +#: characters. + +# font_family monospace +# bold_font auto +# italic_font auto +# bold_italic_font auto + +#: You can specify different fonts for the bold/italic/bold-italic +#: variants. To get a full list of supported fonts use the `kitty +#: +list-fonts` command. By default they are derived automatically, by +#: the OSes font system. When bold_font or bold_italic_font is set to +#: auto on macOS, the priority of bold fonts is semi-bold, bold, +#: heavy. Setting them manually is useful for font families that have +#: many weight variants like Book, Medium, Thick, etc. For example:: + +#: font_family Operator Mono Book +#: bold_font Operator Mono Medium +#: italic_font Operator Mono Book Italic +#: bold_italic_font Operator Mono Medium Italic + +# font_size 11.0 + +#: Font size (in pts). + +# force_ltr no + +#: kitty does not support BIDI (bidirectional text), however, for RTL +#: scripts, words are automatically displayed in RTL. That is to say, +#: in an RTL script, the words "HELLO WORLD" display in kitty as +#: "WORLD HELLO", and if you try to select a substring of an RTL- +#: shaped string, you will get the character that would be there had +#: the string been LTR. For example, assuming the Hebrew word ירושלים, +#: selecting the character that on the screen appears to be ם actually +#: writes into the selection buffer the character י. kitty's default +#: behavior is useful in conjunction with a filter to reverse the word +#: order, however, if you wish to manipulate RTL glyphs, it can be +#: very challenging to work with, so this option is provided to turn +#: it off. Furthermore, this option can be used with the command line +#: program GNU FriBidi +#: to get BIDI support, because it will force kitty to always treat +#: the text as LTR, which FriBidi expects for terminals. + +# symbol_map + +#: E.g. symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 PowerlineSymbols + +#: Map the specified Unicode codepoints to a particular font. Useful +#: if you need special rendering for some symbols, such as for +#: Powerline. Avoids the need for patched fonts. Each Unicode code +#: point is specified in the form `U+`. You +#: can specify multiple code points, separated by commas and ranges +#: separated by hyphens. This option can be specified multiple times. +#: The syntax is:: + +#: symbol_map codepoints Font Family Name + +# narrow_symbols + +#: E.g. narrow_symbols U+E0A0-U+E0A3,U+E0C0-U+E0C7 1 + +#: Usually, for Private Use Unicode characters and some symbol/dingbat +#: characters, if the character is followed by one or more spaces, +#: kitty will use those extra cells to render the character larger, if +#: the character in the font has a wide aspect ratio. Using this +#: option you can force kitty to restrict the specified code points to +#: render in the specified number of cells (defaulting to one cell). +#: This option can be specified multiple times. The syntax is:: + +#: narrow_symbols codepoints [optionally the number of cells] + +# disable_ligatures never + +#: Choose how you want to handle multi-character ligatures. The +#: default is to always render them. You can tell kitty to not render +#: them when the cursor is over them by using cursor to make editing +#: easier, or have kitty never render them at all by using always, if +#: you don't like them. The ligature strategy can be set per-window +#: either using the kitty remote control facility or by defining +#: shortcuts for it in kitty.conf, for example:: + +#: map alt+1 disable_ligatures_in active always +#: map alt+2 disable_ligatures_in all never +#: map alt+3 disable_ligatures_in tab cursor + +#: Note that this refers to programming ligatures, typically +#: implemented using the calt OpenType feature. For disabling general +#: ligatures, use the font_features option. + +# font_features + +#: E.g. font_features none + +#: Choose exactly which OpenType features to enable or disable. This +#: is useful as some fonts might have features worthwhile in a +#: terminal. For example, Fira Code includes a discretionary feature, +#: zero, which in that font changes the appearance of the zero (0), to +#: make it more easily distinguishable from Ø. Fira Code also includes +#: other discretionary features known as Stylistic Sets which have the +#: tags ss01 through ss20. + +#: For the exact syntax to use for individual features, see the +#: HarfBuzz documentation . + +#: Note that this code is indexed by PostScript name, and not the font +#: family. This allows you to define very precise feature settings; +#: e.g. you can disable a feature in the italic font but not in the +#: regular font. + +#: On Linux, font features are first read from the FontConfig database +#: and then this option is applied, so they can be configured in a +#: single, central place. + +#: To get the PostScript name for a font, use `kitty +list-fonts +#: --psnames`: + +#: .. code-block:: sh + +#: $ kitty +list-fonts --psnames | grep Fira +#: Fira Code +#: Fira Code Bold (FiraCode-Bold) +#: Fira Code Light (FiraCode-Light) +#: Fira Code Medium (FiraCode-Medium) +#: Fira Code Regular (FiraCode-Regular) +#: Fira Code Retina (FiraCode-Retina) + +#: The part in brackets is the PostScript name. + +#: Enable alternate zero and oldstyle numerals:: + +#: font_features FiraCode-Retina +zero +onum + +#: Enable only alternate zero in the bold font:: + +#: font_features FiraCode-Bold +zero + +#: Disable the normal ligatures, but keep the calt feature which (in +#: this font) breaks up monotony:: + +#: font_features TT2020StyleB-Regular -liga +calt + +#: In conjunction with force_ltr, you may want to disable Arabic +#: shaping entirely, and only look at their isolated forms if they +#: show up in a document. You can do this with e.g.:: + +#: font_features UnifontMedium +isol -medi -fina -init + +# modify_font + +#: Modify font characteristics such as the position or thickness of +#: the underline and strikethrough. The modifications can have the +#: suffix px for pixels or % for percentage of original value. No +#: suffix means use pts. For example:: + +#: modify_font underline_position -2 +#: modify_font underline_thickness 150% +#: modify_font strikethrough_position 2px + +#: Additionally, you can modify the size of the cell in which each +#: font glyph is rendered and the baseline at which the glyph is +#: placed in the cell. For example:: + +#: modify_font cell_width 80% +#: modify_font cell_height -2px +#: modify_font baseline 3 + +#: Note that modifying the baseline will automatically adjust the +#: underline and strikethrough positions by the same amount. +#: Increasing the baseline raises glyphs inside the cell and +#: decreasing it lowers them. Decreasing the cell size might cause +#: rendering artifacts, so use with care. + +# box_drawing_scale 0.001, 1, 1.5, 2 + +#: The sizes of the lines used for the box drawing Unicode characters. +#: These values are in pts. They will be scaled by the monitor DPI to +#: arrive at a pixel value. There must be four values corresponding to +#: thin, normal, thick, and very thick lines. + +# undercurl_style thin-sparse + +#: The style with which undercurls are rendered. This option takes the +#: form (thin|thick)-(sparse|dense). Thin and thick control the +#: thickness of the undercurl. Sparse and dense control how often the +#: curl oscillates. With sparse the curl will peak once per character, +#: with dense twice. + +# text_composition_strategy platform + +#: Control how kitty composites text glyphs onto the background color. +#: The default value of platform tries for text rendering as close to +#: "native" for the platform kitty is running on as possible. + +#: A value of legacy uses the old (pre kitty 0.28) strategy for how +#: glyphs are composited. This will make dark text on light +#: backgrounds look thicker and light text on dark backgrounds +#: thinner. It might also make some text appear like the strokes are +#: uneven. + +#: You can fine tune the actual contrast curve used for glyph +#: composition by specifying up to two space-separated numbers for +#: this setting. + +#: The first number is the gamma adjustment, which controls the +#: thickness of dark text on light backgrounds. Increasing the value +#: will make text appear thicker. The default value for this is 1.0 on +#: Linux and 1.7 on macOS. Valid values are 0.01 and above. The result +#: is scaled based on the luminance difference between the background +#: and the foreground. Dark text on light backgrounds receives the +#: full impact of the curve while light text on dark backgrounds is +#: affected very little. + +#: The second number is an additional multiplicative contrast. It is +#: percentage ranging from 0 to 100. The default value is 0 on Linux +#: and 30 on macOS. + +#: If you wish to achieve similar looking thickness in light and dark +#: themes, a good way to experiment is start by setting the value to +#: 1.0 0 and use a dark theme. Then adjust the second parameter until +#: it looks good. Then switch to a light theme and adjust the first +#: parameter until the perceived thickness matches the dark theme. + +# text_fg_override_threshold 0 + +#: The minimum accepted difference in luminance between the foreground +#: and background color, below which kitty will override the +#: foreground color. It is percentage ranging from 0 to 100. If the +#: difference in luminance of the foreground and background is below +#: this threshold, the foreground color will be set to white if the +#: background is dark or black if the background is light. The default +#: value is 0, which means no overriding is performed. Useful when +#: working with applications that use colors that do not contrast well +#: with your preferred color scheme. + +#: WARNING: Some programs use characters (such as block characters) +#: for graphics display and may expect to be able to set the +#: foreground and background to the same color (or similar colors). +#: If you see unexpected stripes, dots, lines, incorrect color, no +#: color where you expect color, or any kind of graphic display +#: problem try setting text_fg_override_threshold to 0 to see if this +#: is the cause of the problem. + +#: }}} + +#: Cursor customization {{{ + +# cursor #cccccc + +#: Default cursor color. If set to the special value none the cursor +#: will be rendered with a "reverse video" effect. It's color will be +#: the color of the text in the cell it is over and the text will be +#: rendered with the background color of the cell. Note that if the +#: program running in the terminal sets a cursor color, this takes +#: precedence. Also, the cursor colors are modified if the cell +#: background and foreground colors have very low contrast. Note that +#: some themes set this value, so if you want to override it, place +#: your value after the lines where the theme file is included. + +# cursor_text_color #111111 + +#: The color of text under the cursor. If you want it rendered with +#: the background color of the cell underneath instead, use the +#: special keyword: `background`. Note that if cursor is set to none +#: then this option is ignored. Note that some themes set this value, +#: so if you want to override it, place your value after the lines +#: where the theme file is included. + +# cursor_shape block + +#: The cursor shape can be one of block, beam, underline. Note that +#: when reloading the config this will be changed only if the cursor +#: shape has not been set by the program running in the terminal. This +#: sets the default cursor shape, applications running in the terminal +#: can override it. In particular, shell integration +#: in kitty sets +#: the cursor shape to beam at shell prompts. You can avoid this by +#: setting shell_integration to no-cursor. + +# cursor_beam_thickness 1.5 + +#: The thickness of the beam cursor (in pts). + +# cursor_underline_thickness 2.0 + +#: The thickness of the underline cursor (in pts). + +# cursor_blink_interval -1 + +#: The interval to blink the cursor (in seconds). Set to zero to +#: disable blinking. Negative values mean use system default. Note +#: that the minimum interval will be limited to repaint_delay. + +# cursor_stop_blinking_after 15.0 + +#: Stop blinking cursor after the specified number of seconds of +#: keyboard inactivity. Set to zero to never stop blinking. + +#: }}} + +#: Scrollback {{{ + +# scrollback_lines 2000 + +#: Number of lines of history to keep in memory for scrolling back. +#: Memory is allocated on demand. Negative numbers are (effectively) +#: infinite scrollback. Note that using very large scrollback is not +#: recommended as it can slow down performance of the terminal and +#: also use large amounts of RAM. Instead, consider using +#: scrollback_pager_history_size. Note that on config reload if this +#: is changed it will only affect newly created windows, not existing +#: ones. + +# scrollback_indicator_opacity 1.0 + +#: The opacity of the scrollback indicator which is a small colored +#: rectangle that moves along the right hand side of the window as you +#: scroll, indicating what fraction you have scrolled. The default is +#: one which means fully opaque, aka visible. Set to a value between +#: zero and one to make the indicator less visible. + +# scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER + +#: Program with which to view scrollback in a new window. The +#: scrollback buffer is passed as STDIN to this program. If you change +#: it, make sure the program you use can handle ANSI escape sequences +#: for colors and text formatting. INPUT_LINE_NUMBER in the command +#: line above will be replaced by an integer representing which line +#: should be at the top of the screen. Similarly CURSOR_LINE and +#: CURSOR_COLUMN will be replaced by the current cursor position or +#: set to 0 if there is no cursor, for example, when showing the last +#: command output. + +# scrollback_pager_history_size 0 + +#: Separate scrollback history size (in MB), used only for browsing +#: the scrollback buffer with pager. This separate buffer is not +#: available for interactive scrolling but will be piped to the pager +#: program when viewing scrollback buffer in a separate window. The +#: current implementation stores the data in UTF-8, so approximately +#: 10000 lines per megabyte at 100 chars per line, for pure ASCII, +#: unformatted text. A value of zero or less disables this feature. +#: The maximum allowed size is 4GB. Note that on config reload if this +#: is changed it will only affect newly created windows, not existing +#: ones. + +# scrollback_fill_enlarged_window no + +#: Fill new space with lines from the scrollback buffer after +#: enlarging a window. + +# wheel_scroll_multiplier 5.0 + +#: Multiplier for the number of lines scrolled by the mouse wheel. +#: Note that this is only used for low precision scrolling devices, +#: not for high precision scrolling devices on platforms such as macOS +#: and Wayland. Use negative numbers to change scroll direction. See +#: also wheel_scroll_min_lines. + +# wheel_scroll_min_lines 1 + +#: The minimum number of lines scrolled by the mouse wheel. The scroll +#: multiplier wheel_scroll_multiplier only takes effect after it +#: reaches this number. Note that this is only used for low precision +#: scrolling devices like wheel mice that scroll by very small amounts +#: when using the wheel. With a negative number, the minimum number of +#: lines will always be added. + +# touch_scroll_multiplier 1.0 + +#: Multiplier for the number of lines scrolled by a touchpad. Note +#: that this is only used for high precision scrolling devices on +#: platforms such as macOS and Wayland. Use negative numbers to change +#: scroll direction. + +#: }}} + +#: Mouse {{{ + +# mouse_hide_wait 3.0 + +#: Hide mouse cursor after the specified number of seconds of the +#: mouse not being used. Set to zero to disable mouse cursor hiding. +#: Set to a negative value to hide the mouse cursor immediately when +#: typing text. Disabled by default on macOS as getting it to work +#: robustly with the ever-changing sea of bugs that is Cocoa is too +#: much effort. + +# url_color #0087bd +# url_style curly + +#: The color and style for highlighting URLs on mouse-over. url_style +#: can be one of: none, straight, double, curly, dotted, dashed. + +# open_url_with default + +#: The program to open clicked URLs. The special value default will +#: first look for any URL handlers defined via the open_actions +#: facility and if non +#: are found, it will use the Operating System's default URL handler +#: (open on macOS and xdg-open on Linux). + +# url_prefixes file ftp ftps gemini git gopher http https irc ircs kitty mailto news sftp ssh + +#: The set of URL prefixes to look for when detecting a URL under the +#: mouse cursor. + +# detect_urls yes + +#: Detect URLs under the mouse. Detected URLs are highlighted with an +#: underline and the mouse cursor becomes a hand over them. Even if +#: this option is disabled, URLs are still clickable. See also the +#: underline_hyperlinks option to control how hyperlinks (as opposed +#: to plain text URLs) are displayed. + +# url_excluded_characters + +#: Additional characters to be disallowed from URLs, when detecting +#: URLs under the mouse cursor. By default, all characters that are +#: legal in URLs are allowed. Additionally, newlines are allowed (but +#: stripped). This is to accommodate programs such as mutt that add +#: hard line breaks even for continued lines. \n can be added to this +#: option to disable this behavior. Special characters can be +#: specified using backslash escapes, to specify a backslash use a +#: double backslash. + +# show_hyperlink_targets no + +#: When the mouse hovers over a terminal hyperlink, show the actual +#: URL that will be activated when the hyperlink is clicked. + +# underline_hyperlinks hover + +#: Control how hyperlinks are underlined. They can either be +#: underlined on mouse hover, always (i.e. permanently underlined) or +#: never which means that kitty will not apply any underline styling +#: to hyperlinks. Uses the url_style and url_color settings for the +#: underline style. Note that reloading the config and changing this +#: value to/from always will only affect text subsequently received by +#: kitty. + +# copy_on_select no + +#: Copy to clipboard or a private buffer on select. With this set to +#: clipboard, selecting text with the mouse will cause the text to be +#: copied to clipboard. Useful on platforms such as macOS that do not +#: have the concept of primary selection. You can instead specify a +#: name such as a1 to copy to a private kitty buffer. Map a shortcut +#: with the paste_from_buffer action to paste from this private +#: buffer. For example:: + +#: copy_on_select a1 +#: map shift+cmd+v paste_from_buffer a1 + +#: Note that copying to the clipboard is a security risk, as all +#: programs, including websites open in your browser can read the +#: contents of the system clipboard. + +# paste_actions quote-urls-at-prompt,confirm + +#: A comma separated list of actions to take when pasting text into +#: the terminal. The supported paste actions are: + +#: quote-urls-at-prompt: +#: If the text being pasted is a URL and the cursor is at a shell prompt, +#: automatically quote the URL (needs shell_integration). +#: replace-dangerous-control-codes +#: Replace dangerous control codes from pasted text, without confirmation. +#: replace-newline +#: Replace the newline character from pasted text, without confirmation. +#: confirm: +#: Confirm the paste if the text to be pasted contains any terminal control codes +#: as this can be dangerous, leading to code execution if the shell/program running +#: in the terminal does not properly handle these. +#: confirm-if-large +#: Confirm the paste if it is very large (larger than 16KB) as pasting +#: large amounts of text into shells can be very slow. +#: filter: +#: Run the filter_paste() function from the file paste-actions.py in +#: the kitty config directory on the pasted text. The text returned by the +#: function will be actually pasted. +#: no-op: +#: Has no effect. + +# strip_trailing_spaces never + +#: Remove spaces at the end of lines when copying to clipboard. A +#: value of smart will do it when using normal selections, but not +#: rectangle selections. A value of always will always do it. + +# select_by_word_characters @-./_~?&=%+# + +#: Characters considered part of a word when double clicking. In +#: addition to these characters any character that is marked as an +#: alphanumeric character in the Unicode database will be matched. + +# select_by_word_characters_forward + +#: Characters considered part of a word when extending the selection +#: forward on double clicking. In addition to these characters any +#: character that is marked as an alphanumeric character in the +#: Unicode database will be matched. + +#: If empty (default) select_by_word_characters will be used for both +#: directions. + +# click_interval -1.0 + +#: The interval between successive clicks to detect double/triple +#: clicks (in seconds). Negative numbers will use the system default +#: instead, if available, or fallback to 0.5. + +# focus_follows_mouse no + +#: Set the active window to the window under the mouse when moving the +#: mouse around. On macOS, this will also cause the OS Window under +#: the mouse to be focused automatically when the mouse enters it. + +# pointer_shape_when_grabbed arrow + +#: The shape of the mouse pointer when the program running in the +#: terminal grabs the mouse. + +# default_pointer_shape beam + +#: The default shape of the mouse pointer. + +# pointer_shape_when_dragging beam + +#: The default shape of the mouse pointer when dragging across text. + +#: Mouse actions {{{ + +#: Mouse buttons can be mapped to perform arbitrary actions. The +#: syntax is: + +#: .. code-block:: none + +#: mouse_map button-name event-type modes action + +#: Where button-name is one of left, middle, right, b1 ... b8 with +#: added keyboard modifiers. For example: ctrl+shift+left refers to +#: holding the Ctrl+Shift keys while clicking with the left mouse +#: button. The value b1 ... b8 can be used to refer to up to eight +#: buttons on a mouse. + +#: event-type is one of press, release, doublepress, triplepress, +#: click, doubleclick. modes indicates whether the action is performed +#: when the mouse is grabbed by the program running in the terminal, +#: or not. The values are grabbed or ungrabbed or a comma separated +#: combination of them. grabbed refers to when the program running in +#: the terminal has requested mouse events. Note that the click and +#: double click events have a delay of click_interval to disambiguate +#: from double and triple presses. + +#: You can run kitty with the kitty --debug-input command line option +#: to see mouse events. See the builtin actions below to get a sense +#: of what is possible. + +#: If you want to unmap a button, map it to nothing. For example, to +#: disable opening of URLs with a plain click:: + +#: mouse_map left click ungrabbed + +#: See all the mappable actions including mouse actions here +#: . + +#: .. note:: +#: Once a selection is started, releasing the button that started it will +#: automatically end it and no release event will be dispatched. + +# clear_all_mouse_actions no + +#: Remove all mouse action definitions up to this point. Useful, for +#: instance, to remove the default mouse actions. + +#: Click the link under the mouse or move the cursor + +# mouse_map left click ungrabbed mouse_handle_click selection link prompt + +#:: First check for a selection and if one exists do nothing. Then +#:: check for a link under the mouse cursor and if one exists, click +#:: it. Finally check if the click happened at the current shell +#:: prompt and if so, move the cursor to the click location. Note +#:: that this requires shell integration +#:: to work. + +#: Click the link under the mouse or move the cursor even when grabbed + +# mouse_map shift+left click grabbed,ungrabbed mouse_handle_click selection link prompt + +#:: Same as above, except that the action is performed even when the +#:: mouse is grabbed by the program running in the terminal. + +#: Click the link under the mouse cursor + +# mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_handle_click link + +#:: Variant with Ctrl+Shift is present because the simple click based +#:: version has an unavoidable delay of click_interval, to +#:: disambiguate clicks from double clicks. + +#: Discard press event for link click + +# mouse_map ctrl+shift+left press grabbed discard_event + +#:: Prevent this press event from being sent to the program that has +#:: grabbed the mouse, as the corresponding release event is used to +#:: open a URL. + +#: Paste from the primary selection + +# mouse_map middle release ungrabbed paste_from_selection + +#: Start selecting text + +# mouse_map left press ungrabbed mouse_selection normal + +#: Start selecting text in a rectangle + +# mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle + +#: Select a word + +# mouse_map left doublepress ungrabbed mouse_selection word + +#: Select a line + +# mouse_map left triplepress ungrabbed mouse_selection line + +#: Select line from point + +# mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point + +#:: Select from the clicked point to the end of the line. If you +#:: would like to select the word at the point and then extend to the +#:: rest of the line, change `line_from_point` to +#:: `word_and_line_from_point`. + +#: Extend the current selection + +# mouse_map right press ungrabbed mouse_selection extend + +#:: If you want only the end of the selection to be moved instead of +#:: the nearest boundary, use move-end instead of extend. + +#: Paste from the primary selection even when grabbed + +# mouse_map shift+middle release ungrabbed,grabbed paste_selection +# mouse_map shift+middle press grabbed discard_event + +#: Start selecting text even when grabbed + +# mouse_map shift+left press ungrabbed,grabbed mouse_selection normal + +#: Start selecting text in a rectangle even when grabbed + +# mouse_map ctrl+shift+alt+left press ungrabbed,grabbed mouse_selection rectangle + +#: Select a word even when grabbed + +# mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word + +#: Select a line even when grabbed + +# mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line + +#: Select line from point even when grabbed + +# mouse_map ctrl+shift+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point + +#:: Select from the clicked point to the end of the line even when +#:: grabbed. If you would like to select the word at the point and +#:: then extend to the rest of the line, change `line_from_point` to +#:: `word_and_line_from_point`. + +#: Extend the current selection even when grabbed + +# mouse_map shift+right press ungrabbed,grabbed mouse_selection extend + +#: Show clicked command output in pager + +# mouse_map ctrl+shift+right press ungrabbed mouse_show_command_output + +#:: Requires shell integration +#:: to work. + +#: }}} + +#: }}} + +#: Performance tuning {{{ + +# repaint_delay 10 + +#: Delay between screen updates (in milliseconds). Decreasing it, +#: increases frames-per-second (FPS) at the cost of more CPU usage. +#: The default value yields ~100 FPS which is more than sufficient for +#: most uses. Note that to actually achieve 100 FPS, you have to +#: either set sync_to_monitor to no or use a monitor with a high +#: refresh rate. Also, to minimize latency when there is pending input +#: to be processed, this option is ignored. + +# input_delay 3 + +#: Delay before input from the program running in the terminal is +#: processed (in milliseconds). Note that decreasing it will increase +#: responsiveness, but also increase CPU usage and might cause flicker +#: in full screen programs that redraw the entire screen on each loop, +#: because kitty is so fast that partial screen updates will be drawn. +#: This setting is ignored when the input buffer is almost full. + +# sync_to_monitor yes + +#: Sync screen updates to the refresh rate of the monitor. This +#: prevents screen tearing +#: when scrolling. +#: However, it limits the rendering speed to the refresh rate of your +#: monitor. With a very high speed mouse/high keyboard repeat rate, +#: you may notice some slight input latency. If so, set this to no. + +#: }}} + +#: Terminal bell {{{ + +# enable_audio_bell yes + +#: The audio bell. Useful to disable it in environments that require +#: silence. + +# visual_bell_duration 0.0 + +#: The visual bell duration (in seconds). Flash the screen when a bell +#: occurs for the specified number of seconds. Set to zero to disable. + +# visual_bell_color none + +#: The color used by visual bell. Set to none will fall back to +#: selection background color. If you feel that the visual bell is too +#: bright, you can set it to a darker color. + +# window_alert_on_bell yes + +#: Request window attention on bell. Makes the dock icon bounce on +#: macOS or the taskbar flash on Linux. + +# bell_on_tab "🔔 " + +#: Some text or a Unicode symbol to show on the tab if a window in the +#: tab that does not have focus has a bell. If you want to use leading +#: or trailing spaces, surround the text with quotes. See +#: tab_title_template for how this is rendered. + +#: For backwards compatibility, values of yes, y and true are +#: converted to the default bell symbol and no, n, false and none are +#: converted to the empty string. + +# command_on_bell none + +#: Program to run when a bell occurs. The environment variable +#: KITTY_CHILD_CMDLINE can be used to get the program running in the +#: window in which the bell occurred. + +# bell_path none + +#: Path to a sound file to play as the bell sound. If set to none, the +#: system default bell sound is used. Must be in a format supported by +#: the operating systems sound API, such as WAV or OGA on Linux +#: (libcanberra) or AIFF, MP3 or WAV on macOS (NSSound). + +# linux_bell_theme __custom + +#: The XDG Sound Theme kitty will use to play the bell sound. Defaults +#: to the custom theme name used by GNOME and Budgie, falling back to +#: the default freedesktop theme if it does not exist. This option may +#: be removed if Linux ever provides desktop-agnostic support for +#: setting system sound themes. + +#: }}} + +#: Window layout {{{ + +# remember_window_size yes +# initial_window_width 640 +# initial_window_height 400 + +#: If enabled, the OS Window size will be remembered so that new +#: instances of kitty will have the same size as the previous +#: instance. If disabled, the OS Window will initially have size +#: configured by initial_window_width/height, in pixels. You can use a +#: suffix of "c" on the width/height values to have them interpreted +#: as number of cells instead of pixels. + +# enabled_layouts * + +#: The enabled window layouts. A comma separated list of layout names. +#: The special value all means all layouts. The first listed layout +#: will be used as the startup layout. Default configuration is all +#: layouts in alphabetical order. For a list of available layouts, see +#: the layouts . + +# window_resize_step_cells 2 +# window_resize_step_lines 2 + +#: The step size (in units of cell width/cell height) to use when +#: resizing kitty windows in a layout with the shortcut +#: start_resizing_window. The cells value is used for horizontal +#: resizing, and the lines value is used for vertical resizing. + +# window_border_width 0.5pt + +#: The width of window borders. Can be either in pixels (px) or pts +#: (pt). Values in pts will be rounded to the nearest number of pixels +#: based on screen resolution. If not specified, the unit is assumed +#: to be pts. Note that borders are displayed only when more than one +#: window is visible. They are meant to separate multiple windows. + +# draw_minimal_borders yes + +#: Draw only the minimum borders needed. This means that only the +#: borders that separate the window from a neighbor are drawn. Note +#: that setting a non-zero window_margin_width overrides this and +#: causes all borders to be drawn. + +# window_margin_width 0 + +#: The window margin (in pts) (blank area outside the border). A +#: single value sets all four sides. Two values set the vertical and +#: horizontal sides. Three values set top, horizontal and bottom. Four +#: values set top, right, bottom and left. + +# single_window_margin_width -1 + +#: The window margin to use when only a single window is visible (in +#: pts). Negative values will cause the value of window_margin_width +#: to be used instead. A single value sets all four sides. Two values +#: set the vertical and horizontal sides. Three values set top, +#: horizontal and bottom. Four values set top, right, bottom and left. + +window_padding_width 5 + +#: The window padding (in pts) (blank area between the text and the +#: window border). A single value sets all four sides. Two values set +#: the vertical and horizontal sides. Three values set top, horizontal +#: and bottom. Four values set top, right, bottom and left. + +# single_window_padding_width -1 + +#: The window padding to use when only a single window is visible (in +#: pts). Negative values will cause the value of window_padding_width +#: to be used instead. A single value sets all four sides. Two values +#: set the vertical and horizontal sides. Three values set top, +#: horizontal and bottom. Four values set top, right, bottom and left. + +# placement_strategy center + +#: When the window size is not an exact multiple of the cell size, the +#: cell area of the terminal window will have some extra padding on +#: the sides. You can control how that padding is distributed with +#: this option. Using a value of center means the cell area will be +#: placed centrally. A value of top-left means the padding will be +#: only at the bottom and right edges. + +# active_border_color #00ff00 + +#: The color for the border of the active window. Set this to none to +#: not draw borders around the active window. + +# inactive_border_color #cccccc + +#: The color for the border of inactive windows. + +# bell_border_color #ff5a00 + +#: The color for the border of inactive windows in which a bell has +#: occurred. + +# inactive_text_alpha 1.0 + +#: Fade the text in inactive windows by the specified amount (a number +#: between zero and one, with zero being fully faded). + +# hide_window_decorations false + +#: Hide the window decorations (title-bar and window borders) with +#: yes. On macOS, titlebar-only and titlebar-and-corners can be used +#: to only hide the titlebar and the rounded corners. Whether this +#: works and exactly what effect it has depends on the window +#: manager/operating system. Note that the effects of changing this +#: option when reloading config are undefined. When using titlebar- +#: only, it is useful to also set window_margin_width and +#: placement_strategy to prevent the rounded corners from clipping +#: text. Or use titlebar-and-corners. + +# window_logo_path none + +#: Path to a logo image. Must be in PNG format. Relative paths are +#: interpreted relative to the kitty config directory. The logo is +#: displayed in a corner of every kitty window. The position is +#: controlled by window_logo_position. Individual windows can be +#: configured to have different logos either using the launch action +#: or the remote control facility. + +# window_logo_position bottom-right + +#: Where to position the window logo in the window. The value can be +#: one of: top-left, top, top-right, left, center, right, bottom-left, +#: bottom, bottom-right. + +# window_logo_alpha 0.5 + +#: The amount the logo should be faded into the background. With zero +#: being fully faded and one being fully opaque. + +# resize_debounce_time 0.1 0.5 + +#: The time to wait (in seconds) before asking the program running in +#: kitty to resize and redraw the screen during a live resize of the +#: OS window, when no new resize events have been received, i.e. when +#: resizing is either paused or finished. On platforms such as macOS, +#: where the operating system sends events corresponding to the start +#: and end of a live resize, the second number is used for redraw- +#: after-pause since kitty can distinguish between a pause and end of +#: resizing. On such systems the first number is ignored and redraw is +#: immediate after end of resize. On other systems only the first +#: number is used so that kitty is "ready" quickly after the end of +#: resizing, while not also continuously redrawing, to save energy. + +# resize_in_steps no + +#: Resize the OS window in steps as large as the cells, instead of +#: with the usual pixel accuracy. Combined with initial_window_width +#: and initial_window_height in number of cells, this option can be +#: used to keep the margins as small as possible when resizing the OS +#: window. Note that this does not currently work on Wayland. + +# visual_window_select_characters 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ + +#: The list of characters for visual window selection. For example, +#: for selecting a window to focus on with focus_visible_window. The +#: value should be a series of unique numbers or alphabets, case +#: insensitive, from the set 0-9A-Z\-=[];',./\\`. Specify your +#: preference as a string of characters. + +# confirm_os_window_close -1 + +#: Ask for confirmation when closing an OS window or a tab with at +#: least this number of kitty windows in it by window manager (e.g. +#: clicking the window close button or pressing the operating system +#: shortcut to close windows) or by the close_tab action. A value of +#: zero disables confirmation. This confirmation also applies to +#: requests to quit the entire application (all OS windows, via the +#: quit action). Negative values are converted to positive ones, +#: however, with shell_integration enabled, using negative values +#: means windows sitting at a shell prompt are not counted, only +#: windows where some command is currently running. Note that if you +#: want confirmation when closing individual windows, you can map the +#: close_window_with_confirmation action. + +#: }}} + +#: Tab bar {{{ + +# tab_bar_edge bottom + +#: The edge to show the tab bar on, top or bottom. + +# tab_bar_margin_width 0.0 + +#: The margin to the left and right of the tab bar (in pts). + +# tab_bar_margin_height 0.0 0.0 + +#: The margin above and below the tab bar (in pts). The first number +#: is the margin between the edge of the OS Window and the tab bar. +#: The second number is the margin between the tab bar and the +#: contents of the current tab. + +# tab_bar_style fade + +#: The tab bar style, can be one of: + +#: fade +#: Each tab's edges fade into the background color. (See also tab_fade) +#: slant +#: Tabs look like the tabs in a physical file. +#: separator +#: Tabs are separated by a configurable separator. (See also +#: tab_separator) +#: powerline +#: Tabs are shown as a continuous line with "fancy" separators. +#: (See also tab_powerline_style) +#: custom +#: A user-supplied Python function called draw_tab is loaded from the file +#: tab_bar.py in the kitty config directory. For examples of how to +#: write such a function, see the functions named draw_tab_with_* in +#: kitty's source code: kitty/tab_bar.py. See also +#: this discussion +#: for examples from kitty users. +#: hidden +#: The tab bar is hidden. If you use this, you might want to create +#: a mapping for the select_tab action which presents you with a list of +#: tabs and allows for easy switching to a tab. + +# tab_bar_align left + +#: The horizontal alignment of the tab bar, can be one of: left, +#: center, right. + +# tab_bar_min_tabs 2 + +#: The minimum number of tabs that must exist before the tab bar is +#: shown. + +# tab_switch_strategy previous + +#: The algorithm to use when switching to a tab when the current tab +#: is closed. The default of previous will switch to the last used +#: tab. A value of left will switch to the tab to the left of the +#: closed tab. A value of right will switch to the tab to the right of +#: the closed tab. A value of last will switch to the right-most tab. + +# tab_fade 0.25 0.5 0.75 1 + +#: Control how each tab fades into the background when using fade for +#: the tab_bar_style. Each number is an alpha (between zero and one) +#: that controls how much the corresponding cell fades into the +#: background, with zero being no fade and one being full fade. You +#: can change the number of cells used by adding/removing entries to +#: this list. + +# tab_separator " ┇" + +#: The separator between tabs in the tab bar when using separator as +#: the tab_bar_style. + +# tab_powerline_style angled + +#: The powerline separator style between tabs in the tab bar when +#: using powerline as the tab_bar_style, can be one of: angled, +#: slanted, round. + +# tab_activity_symbol none + +#: Some text or a Unicode symbol to show on the tab if a window in the +#: tab that does not have focus has some activity. If you want to use +#: leading or trailing spaces, surround the text with quotes. See +#: tab_title_template for how this is rendered. + +# tab_title_max_length 0 + +#: The maximum number of cells that can be used to render the text in +#: a tab. A value of zero means that no limit is applied. + +# tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}" + +#: A template to render the tab title. The default just renders the +#: title with optional symbols for bell and activity. If you wish to +#: include the tab-index as well, use something like: {index}:{title}. +#: Useful if you have shortcuts mapped for goto_tab N. If you prefer +#: to see the index as a superscript, use {sup.index}. All data +#: available is: + +#: title +#: The current tab title. +#: index +#: The tab index usable with goto_tab N goto_tab shortcuts. +#: layout_name +#: The current layout name. +#: num_windows +#: The number of windows in the tab. +#: num_window_groups +#: The number of window groups (a window group is a window and all of its overlay windows) in the tab. +#: tab.active_wd +#: The working directory of the currently active window in the tab +#: (expensive, requires syscall). Use active_oldest_wd to get +#: the directory of the oldest foreground process rather than the newest. +#: tab.active_exe +#: The name of the executable running in the foreground of the currently +#: active window in the tab (expensive, requires syscall). Use +#: active_oldest_exe for the oldest foreground process. +#: max_title_length +#: The maximum title length available. +#: keyboard_mode +#: The name of the current keyboard mode or the empty string if no keyboard mode is active. + +#: Note that formatting is done by Python's string formatting +#: machinery, so you can use, for instance, {layout_name[:2].upper()} +#: to show only the first two letters of the layout name, upper-cased. +#: If you want to style the text, you can use styling directives, for +#: example: +#: `{fmt.fg.red}red{fmt.fg.tab}normal{fmt.bg._00FF00}greenbg{fmt.bg.tab}`. +#: Similarly, for bold and italic: +#: `{fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}`. +#: Note that for backward compatibility, if {bell_symbol} or +#: {activity_symbol} are not present in the template, they are +#: prepended to it. + +# active_tab_title_template none + +#: Template to use for active tabs. If not specified falls back to +#: tab_title_template. + +# active_tab_foreground #000 +# active_tab_background #eee +# active_tab_font_style bold-italic +# inactive_tab_foreground #444 +# inactive_tab_background #999 +# inactive_tab_font_style normal + +#: Tab bar colors and styles. + +# tab_bar_background none + +#: Background color for the tab bar. Defaults to using the terminal +#: background color. + +# tab_bar_margin_color none + +#: Color for the tab bar margin area. Defaults to using the terminal +#: background color for margins above and below the tab bar. For side +#: margins the default color is chosen to match the background color +#: of the neighboring tab. + +#: }}} + +#: Color scheme {{{ + +# foreground #dddddd +# background #000000 + +#: The foreground and background colors. + +# background_opacity 1.0 + +#: The opacity of the background. A number between zero and one, where +#: one is opaque and zero is fully transparent. This will only work if +#: supported by the OS (for instance, when using a compositor under +#: X11). Note that it only sets the background color's opacity in +#: cells that have the same background color as the default terminal +#: background, so that things like the status bar in vim, powerline +#: prompts, etc. still look good. But it means that if you use a color +#: theme with a background color in your editor, it will not be +#: rendered as transparent. Instead you should change the default +#: background color in your kitty config and not use a background +#: color in the editor color scheme. Or use the escape codes to set +#: the terminals default colors in a shell script to launch your +#: editor. Be aware that using a value less than 1.0 is a (possibly +#: significant) performance hit. When using a low value for this +#: setting, it is desirable that you set the background color to a +#: color the matches the general color of the desktop background, for +#: best text rendering. If you want to dynamically change +#: transparency of windows, set dynamic_background_opacity to yes +#: (this is off by default as it has a performance cost). Changing +#: this option when reloading the config will only work if +#: dynamic_background_opacity was enabled in the original config. + +# background_blur 0 + +#: Set to a positive value to enable background blur (blurring of the +#: visuals behind a transparent window) on platforms that support it. +#: Only takes effect when background_opacity is less than one. On +#: macOS, this will also control the blur radius (amount of blurring). +#: Setting it to too high a value will cause severe performance issues +#: and/or rendering artifacts. Usually, values up to 64 work well. +#: Note that this might cause performance issues, depending on how the +#: platform implements it, so use with care. Currently supported on +#: macOS and KDE. + +# background_image none + +#: Path to a background image. Must be in PNG format. + +# background_image_layout tiled + +#: Whether to tile, scale or clamp the background image. The value can +#: be one of tiled, mirror-tiled, scaled, clamped, centered or +#: cscaled. The scaled and cscaled values scale the image to the +#: window size, with cscaled preserving the image aspect ratio. + +# background_image_linear no + +#: When background image is scaled, whether linear interpolation +#: should be used. + +# dynamic_background_opacity no + +#: Allow changing of the background_opacity dynamically, using either +#: keyboard shortcuts (increase_background_opacity and +#: decrease_background_opacity) or the remote control facility. +#: Changing this option by reloading the config is not supported. + +# background_tint 0.0 + +#: How much to tint the background image by the background color. This +#: option makes it easier to read the text. Tinting is done using the +#: current background color for each window. This option applies only +#: if background_opacity is set and transparent windows are supported +#: or background_image is set. + +# background_tint_gaps 1.0 + +#: How much to tint the background image at the window gaps by the +#: background color, after applying background_tint. Since this is +#: multiplicative with background_tint, it can be used to lighten the +#: tint over the window gaps for a *separated* look. + +# dim_opacity 0.4 + +#: How much to dim text that has the DIM/FAINT attribute set. One +#: means no dimming and zero means fully dimmed (i.e. invisible). + +# selection_foreground #000000 +# selection_background #fffacd + +#: The foreground and background colors for text selected with the +#: mouse. Setting both of these to none will cause a "reverse video" +#: effect for selections, where the selection will be the cell text +#: color and the text will become the cell background color. Setting +#: only selection_foreground to none will cause the foreground color +#: to be used unchanged. Note that these colors can be overridden by +#: the program running in the terminal. + +#: The color table {{{ + +#: The 256 terminal colors. There are 8 basic colors, each color has a +#: dull and bright version, for the first 16 colors. You can set the +#: remaining 240 colors as color16 to color255. + +# color0 #000000 +# color8 #767676 + +#: black + +# color1 #cc0403 +# color9 #f2201f + +#: red + +# color2 #19cb00 +# color10 #23fd00 + +#: green + +# color3 #cecb00 +# color11 #fffd00 + +#: yellow + +# color4 #0d73cc +# color12 #1a8fff + +#: blue + +# color5 #cb1ed1 +# color13 #fd28ff + +#: magenta + +# color6 #0dcdcd +# color14 #14ffff + +#: cyan + +# color7 #dddddd +# color15 #ffffff + +#: white + +# mark1_foreground black + +#: Color for marks of type 1 + +# mark1_background #98d3cb + +#: Color for marks of type 1 (light steel blue) + +# mark2_foreground black + +#: Color for marks of type 2 + +# mark2_background #f2dcd3 + +#: Color for marks of type 1 (beige) + +# mark3_foreground black + +#: Color for marks of type 3 + +# mark3_background #f274bc + +#: Color for marks of type 3 (violet) + +#: }}} + +#: }}} + +#: Advanced {{{ + +# shell . + +#: The shell program to execute. The default value of . means to use +#: whatever shell is set as the default shell for the current user. +#: Note that on macOS if you change this, you might need to add +#: --login and --interactive to ensure that the shell starts in +#: interactive mode and reads its startup rc files. Environment +#: variables are expanded in this setting. + +# editor . + +#: The terminal based text editor (such as vim or nano) to use when +#: editing the kitty config file or similar tasks. + +#: The default value of . means to use the environment variables +#: VISUAL and EDITOR in that order. If these variables aren't set, +#: kitty will run your shell ($SHELL -l -i -c env) to see if your +#: shell startup rc files set VISUAL or EDITOR. If that doesn't work, +#: kitty will cycle through various known editors (vim, emacs, etc.) +#: and take the first one that exists on your system. + +# close_on_child_death no + +#: Close the window when the child process (shell) exits. With the +#: default value no, the terminal will remain open when the child +#: exits as long as there are still processes outputting to the +#: terminal (for example disowned or backgrounded processes). When +#: enabled with yes, the window will close as soon as the child +#: process exits. Note that setting it to yes means that any +#: background processes still using the terminal can fail silently +#: because their stdout/stderr/stdin no longer work. + +# remote_control_password + +#: Allow other programs to control kitty using passwords. This option +#: can be specified multiple times to add multiple passwords. If no +#: passwords are present kitty will ask the user for permission if a +#: program tries to use remote control with a password. A password can +#: also *optionally* be associated with a set of allowed remote +#: control actions. For example:: + +#: remote_control_password "my passphrase" get-colors set-colors focus-window focus-tab + +#: Only the specified actions will be allowed when using this +#: password. Glob patterns can be used too, for example:: + +#: remote_control_password "my passphrase" set-tab-* resize-* + +#: To get a list of available actions, run:: + +#: kitten @ --help + +#: A set of actions to be allowed when no password is sent can be +#: specified by using an empty password. For example:: + +#: remote_control_password "" *-colors + +#: Finally, the path to a python module can be specified that provides +#: a function is_cmd_allowed that is used to check every remote +#: control command. For example:: + +#: remote_control_password "my passphrase" my_rc_command_checker.py + +#: Relative paths are resolved from the kitty configuration directory. +#: See rc_custom_auth for details. + +# allow_remote_control no + +#: Allow other programs to control kitty. If you turn this on, other +#: programs can control all aspects of kitty, including sending text +#: to kitty windows, opening new windows, closing windows, reading the +#: content of windows, etc. Note that this even works over SSH +#: connections. The default setting of no prevents any form of remote +#: control. The meaning of the various values are: + +#: password +#: Remote control requests received over both the TTY device and the socket +#: are confirmed based on passwords, see remote_control_password. + +#: socket-only +#: Remote control requests received over a socket are accepted +#: unconditionally. Requests received over the TTY are denied. +#: See listen_on. + +#: socket +#: Remote control requests received over a socket are accepted +#: unconditionally. Requests received over the TTY are confirmed based on +#: password. + +#: no +#: Remote control is completely disabled. + +#: yes +#: Remote control requests are always accepted. + +# listen_on none + +#: Listen to the specified socket for remote control connections. Note +#: that this will apply to all kitty instances. It can be overridden +#: by the kitty --listen-on command line option. For UNIX sockets, +#: such as unix:${TEMP}/mykitty or unix:@mykitty (on Linux). +#: Environment variables are expanded and relative paths are resolved +#: with respect to the temporary directory. If {kitty_pid} is present, +#: then it is replaced by the PID of the kitty process, otherwise the +#: PID of the kitty process is appended to the value, with a hyphen. +#: For TCP sockets such as tcp:localhost:0 a random port is always +#: used even if a non-zero port number is specified. See the help for +#: kitty --listen-on for more details. Note that this will be ignored +#: unless allow_remote_control is set to either: yes, socket or +#: socket-only. Changing this option by reloading the config is not +#: supported. + +# env + +#: Specify the environment variables to be set in all child processes. +#: Using the name with an equal sign (e.g. env VAR=) will set it to +#: the empty string. Specifying only the name (e.g. env VAR) will +#: remove the variable from the child process' environment. Note that +#: environment variables are expanded recursively, for example:: + +#: env VAR1=a +#: env VAR2=${HOME}/${VAR1}/b + +#: The value of VAR2 will be /a/b. + +# watcher + +#: Path to python file which will be loaded for watchers +#: . Can be +#: specified more than once to load multiple watchers. The watchers +#: will be added to every kitty window. Relative paths are resolved +#: relative to the kitty config directory. Note that reloading the +#: config will only affect windows created after the reload. + +# exe_search_path + +#: Control where kitty finds the programs to run. The default search +#: order is: First search the system wide PATH, then ~/.local/bin and +#: ~/bin. If still not found, the PATH defined in the login shell +#: after sourcing all its startup files is tried. Finally, if present, +#: the PATH specified by the env option is tried. + +#: This option allows you to prepend, append, or remove paths from +#: this search order. It can be specified multiple times for multiple +#: paths. A simple path will be prepended to the search order. A path +#: that starts with the + sign will be append to the search order, +#: after ~/bin above. A path that starts with the - sign will be +#: removed from the entire search order. For example:: + +#: exe_search_path /some/prepended/path +#: exe_search_path +/some/appended/path +#: exe_search_path -/some/excluded/path + +# update_check_interval 24 + +#: The interval to periodically check if an update to kitty is +#: available (in hours). If an update is found, a system notification +#: is displayed informing you of the available update. The default is +#: to check every 24 hours, set to zero to disable. Update checking is +#: only done by the official binary builds. Distro packages or source +#: builds do not do update checking. Changing this option by reloading +#: the config is not supported. + +# startup_session none + +#: Path to a session file to use for all kitty instances. Can be +#: overridden by using the kitty --session =none command line option +#: for individual instances. See sessions +#: in the kitty +#: documentation for details. Note that relative paths are interpreted +#: with respect to the kitty config directory. Environment variables +#: in the path are expanded. Changing this option by reloading the +#: config is not supported. Note that if kitty is invoked with command +#: line arguments specifying a command to run, this option is ignored. + +# clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask + +#: Allow programs running in kitty to read and write from the +#: clipboard. You can control exactly which actions are allowed. The +#: possible actions are: write-clipboard, read-clipboard, write- +#: primary, read-primary, read-clipboard-ask, read-primary-ask. The +#: default is to allow writing to the clipboard and primary selection +#: and to ask for permission when a program tries to read from the +#: clipboard. Note that disabling the read confirmation is a security +#: risk as it means that any program, even the ones running on a +#: remote server via SSH can read your clipboard. See also +#: clipboard_max_size. + +# clipboard_max_size 512 + +#: The maximum size (in MB) of data from programs running in kitty +#: that will be stored for writing to the system clipboard. A value of +#: zero means no size limit is applied. See also clipboard_control. + +# file_transfer_confirmation_bypass + +#: The password that can be supplied to the file transfer kitten +#: to skip the +#: transfer confirmation prompt. This should only be used when +#: initiating transfers from trusted computers, over trusted networks +#: or encrypted transports, as it allows any programs running on the +#: remote machine to read/write to the local filesystem, without +#: permission. + +# allow_hyperlinks yes + +#: Process hyperlink escape sequences (OSC 8). If disabled OSC 8 +#: escape sequences are ignored. Otherwise they become clickable +#: links, that you can click with the mouse or by using the hints +#: kitten . The +#: special value of ask means that kitty will ask before opening the +#: link when clicked. + +# shell_integration enabled + +#: Enable shell integration on supported shells. This enables features +#: such as jumping to previous prompts, browsing the output of the +#: previous command in a pager, etc. on supported shells. Set to +#: disabled to turn off shell integration, completely. It is also +#: possible to disable individual features, set to a space separated +#: list of these values: no-rc, no-cursor, no-title, no-cwd, no- +#: prompt-mark, no-complete, no-sudo. See Shell integration +#: for details. + +# allow_cloning ask + +#: Control whether programs running in the terminal can request new +#: windows to be created. The canonical example is clone-in-kitty +#: . +#: By default, kitty will ask for permission for each clone request. +#: Allowing cloning unconditionally gives programs running in the +#: terminal (including over SSH) permission to execute arbitrary code, +#: as the user who is running the terminal, on the computer that the +#: terminal is running on. + +# clone_source_strategies venv,conda,env_var,path + +#: Control what shell code is sourced when running clone-in-kitty in +#: the newly cloned window. The supported strategies are: + +#: venv +#: Source the file $VIRTUAL_ENV/bin/activate. This is used by the +#: Python stdlib venv module and allows cloning venvs automatically. +#: conda +#: Run conda activate $CONDA_DEFAULT_ENV. This supports the virtual +#: environments created by conda. +#: env_var +#: Execute the contents of the environment variable +#: KITTY_CLONE_SOURCE_CODE with eval. +#: path +#: Source the file pointed to by the environment variable +#: KITTY_CLONE_SOURCE_PATH. + +#: This option must be a comma separated list of the above values. +#: Only the first valid match, in the order specified, is sourced. + +# notify_on_cmd_finish never + +#: Show a desktop notification when a long-running command finishes +#: (needs shell_integration). The possible values are: + +#: never +#: Never send a notification. + +#: unfocused +#: Only send a notification when the window does not have keyboard focus. + +#: invisible +#: Only send a notification when the window both is unfocused and not visible +#: to the user, for example, because it is in an inactive tab or its OS window +#: is not currently active. + +#: always +#: Always send a notification, regardless of window state. + +#: There are two optional arguments: + +#: First, the minimum duration for what is considered a long running +#: command. The default is 5 seconds. Specify a second argument to set +#: the duration. For example: invisible 15. Do not set the value too +#: small, otherwise a command that launches a new OS Window and exits +#: will spam a notification. + +#: Second, the action to perform. The default is notify. The possible +#: values are: + +#: notify +#: Send a desktop notification. + +#: bell +#: Ring the terminal bell. + +#: command +#: Run a custom command. All subsequent arguments are the cmdline to run. + +#: Some more examples:: + +#: # Send a notification when a command takes more than 5 seconds in an unfocused window +#: notify_on_cmd_finish unfocused +#: # Send a notification when a command takes more than 10 seconds in a invisible window +#: notify_on_cmd_finish invisible 10.0 +#: # Ring a bell when a command takes more than 10 seconds in a invisible window +#: notify_on_cmd_finish invisible 10.0 bell +#: # Run 'notify-send' when a command takes more than 10 seconds in a invisible window +#: notify_on_cmd_finish invisible 10.0 command notify-send job finished + +# term xterm-kitty + +#: The value of the TERM environment variable to set. Changing this +#: can break many terminal programs, only change it if you know what +#: you are doing, not because you read some advice on "Stack Overflow" +#: to change it. The TERM variable is used by various programs to get +#: information about the capabilities and behavior of the terminal. If +#: you change it, depending on what programs you run, and how +#: different the terminal you are changing it to is, various things +#: from key-presses, to colors, to various advanced features may not +#: work. Changing this option by reloading the config will only affect +#: newly created windows. + +# terminfo_type path + +#: The value of the TERMINFO environment variable to set. This +#: variable is used by programs running in the terminal to search for +#: terminfo databases. The default value of path causes kitty to set +#: it to a filesystem location containing the kitty terminfo database. +#: A value of direct means put the entire database into the env var +#: directly. This can be useful when connecting to containers, for +#: example. But, note that not all software supports this. A value of +#: none means do not touch the variable. + +# forward_stdio no + +#: Forward STDOUT and STDERR of the kitty process to child processes +#: as file descriptors 3 and 4. This is useful for debugging as it +#: allows child processes to print to kitty's STDOUT directly. For +#: example, echo hello world >&3 in a shell will print to the parent +#: kitty's STDOUT. When enabled, this also sets the +#: KITTY_STDIO_FORWARDED=3 environment variable so child processes +#: know about the forwarding. + +# menu_map + +#: Specify entries for various menus in kitty. Currently only the +#: global menubar on macOS is supported. For example:: + +#: menu_map global "Actions::Launch something special" launch --hold --type=os-window sh -c "echo hello world" + +#: This will create a menu entry named "Launch something special" in +#: an "Actions" menu in the macOS global menubar. Sub-menus can be +#: created by adding more levels separated by the :: characters. + +#: }}} + +#: OS specific tweaks {{{ + +# wayland_titlebar_color system + +#: The color of the kitty window's titlebar on Wayland systems with +#: client side window decorations such as GNOME. A value of system +#: means to use the default system colors, a value of background means +#: to use the background color of the currently active kitty window +#: and finally you can use an arbitrary color, such as #12af59 or red. + +# macos_titlebar_color system + +#: The color of the kitty window's titlebar on macOS. A value of +#: system means to use the default system color, light or dark can +#: also be used to set it explicitly. A value of background means to +#: use the background color of the currently active window and finally +#: you can use an arbitrary color, such as #12af59 or red. WARNING: +#: This option works by using a hack when arbitrary color (or +#: background) is configured, as there is no proper Cocoa API for it. +#: It sets the background color of the entire window and makes the +#: titlebar transparent. As such it is incompatible with +#: background_opacity. If you want to use both, you are probably +#: better off just hiding the titlebar with hide_window_decorations. + +# macos_option_as_alt no + +#: Use the Option key as an Alt key on macOS. With this set to no, +#: kitty will use the macOS native Option+Key to enter Unicode +#: character behavior. This will break any Alt+Key keyboard shortcuts +#: in your terminal programs, but you can use the macOS Unicode input +#: technique. You can use the values: left, right or both to use only +#: the left, right or both Option keys as Alt, instead. Note that +#: kitty itself always treats Option the same as Alt. This means you +#: cannot use this option to configure different kitty shortcuts for +#: Option+Key vs. Alt+Key. Also, any kitty shortcuts using +#: Option/Alt+Key will take priority, so that any such key presses +#: will not be passed to terminal programs running inside kitty. +#: Changing this option by reloading the config is not supported. + +# macos_hide_from_tasks no + +#: Hide the kitty window from running tasks on macOS (⌘+Tab and the +#: Dock). Changing this option by reloading the config is not +#: supported. + +# macos_quit_when_last_window_closed no + +#: Have kitty quit when all the top-level windows are closed on macOS. +#: By default, kitty will stay running, even with no open windows, as +#: is the expected behavior on macOS. + +# macos_window_resizable yes + +#: Disable this if you want kitty top-level OS windows to not be +#: resizable on macOS. + +# macos_thicken_font 0 + +#: Draw an extra border around the font with the given width, to +#: increase legibility at small font sizes on macOS. For example, a +#: value of 0.75 will result in rendering that looks similar to sub- +#: pixel antialiasing at common font sizes. Note that in modern kitty, +#: this option is obsolete (although still supported). Consider using +#: text_composition_strategy instead. + +# macos_traditional_fullscreen no + +#: Use the macOS traditional full-screen transition, that is faster, +#: but less pretty. + +# macos_show_window_title_in all + +#: Control where the window title is displayed on macOS. A value of +#: window will show the title of the currently active window at the +#: top of the macOS window. A value of menubar will show the title of +#: the currently active window in the macOS global menu bar, making +#: use of otherwise wasted space. A value of all will show the title +#: in both places, and none hides the title. See +#: macos_menubar_title_max_length for how to control the length of the +#: title in the menu bar. + +# macos_menubar_title_max_length 0 + +#: The maximum number of characters from the window title to show in +#: the macOS global menu bar. Values less than one means that there is +#: no maximum limit. + +# macos_custom_beam_cursor no + +#: Use a custom mouse cursor for macOS that is easier to see on both +#: light and dark backgrounds. Nowadays, the default macOS cursor +#: already comes with a white border. WARNING: this might make your +#: mouse cursor invisible on dual GPU machines. Changing this option +#: by reloading the config is not supported. + +# macos_colorspace srgb + +#: The colorspace in which to interpret terminal colors. The default +#: of srgb will cause colors to match those seen in web browsers. The +#: value of default will use whatever the native colorspace of the +#: display is. The value of displayp3 will use Apple's special +#: snowflake display P3 color space, which will result in over +#: saturated (brighter) colors with some color shift. Reloading +#: configuration will change this value only for newly created OS +#: windows. + +# linux_display_server auto + +#: Choose between Wayland and X11 backends. By default, an appropriate +#: backend based on the system state is chosen automatically. Set it +#: to x11 or wayland to force the choice. Changing this option by +#: reloading the config is not supported. + +# wayland_enable_ime yes + +#: Enable Input Method Extension on Wayland. This is typically used +#: for inputting text in East Asian languages. However, its +#: implementation in Wayland is often buggy and introduces latency +#: into the input loop, so disable this if you know you dont need it. +#: Changing this option by reloading the config is not supported, it +#: will not have any effect. + +#: }}} + +#: Keyboard shortcuts {{{ + +#: Keys are identified simply by their lowercase Unicode characters. +#: For example: a for the A key, [ for the left square bracket key, +#: etc. For functional keys, such as Enter or Escape, the names are +#: present at Functional key definitions +#: . +#: For modifier keys, the names are ctrl (control, ⌃), shift (⇧), alt +#: (opt, option, ⌥), super (cmd, command, ⌘). + +#: Simple shortcut mapping is done with the map directive. For full +#: details on advanced mapping including modal and per application +#: maps, see mapping . Some +#: quick examples to illustrate common tasks:: + +#: # unmap a keyboard shortcut, passing it to the program running in kitty +#: map kitty_mod+space +#: # completely ignore a keyboard event +#: map ctrl+alt+f1 discard_event +#: # combine multiple actions +#: map kitty_mod+e combine : new_window : next_layout +#: # multi-key shortcuts +#: map ctrl+x>ctrl+y>z action + +#: The full list of actions that can be mapped to key presses is +#: available here . + +# kitty_mod ctrl+shift + +#: Special modifier key alias for default shortcuts. You can change +#: the value of this option to alter all default shortcuts that use +#: kitty_mod. + +# clear_all_shortcuts no + +#: Remove all shortcut definitions up to this point. Useful, for +#: instance, to remove the default shortcuts. + +# action_alias + +#: E.g. action_alias launch_tab launch --type=tab --cwd=current + +#: Define action aliases to avoid repeating the same options in +#: multiple mappings. Aliases can be defined for any action and will +#: be expanded recursively. For example, the above alias allows you to +#: create mappings to launch a new tab in the current working +#: directory without duplication:: + +#: map f1 launch_tab vim +#: map f2 launch_tab emacs + +#: Similarly, to alias kitten invocation:: + +#: action_alias hints kitten hints --hints-offset=0 + +# kitten_alias + +#: E.g. kitten_alias hints hints --hints-offset=0 + +#: Like action_alias above, but specifically for kittens. Generally, +#: prefer to use action_alias. This option is a legacy version, +#: present for backwards compatibility. It causes all invocations of +#: the aliased kitten to be substituted. So the example above will +#: cause all invocations of the hints kitten to have the --hints- +#: offset=0 option applied. + +#: Clipboard {{{ + +#: Copy to clipboard + +# map kitty_mod+c copy_to_clipboard +# map cmd+c copy_to_clipboard + +#:: There is also a copy_or_interrupt action that can be optionally +#:: mapped to Ctrl+C. It will copy only if there is a selection and +#:: send an interrupt otherwise. Similarly, +#:: copy_and_clear_or_interrupt will copy and clear the selection or +#:: send an interrupt if there is no selection. + +#: Paste from clipboard + +# map kitty_mod+v paste_from_clipboard +# map cmd+v paste_from_clipboard + +#: Paste from selection + +# map kitty_mod+s paste_from_selection +# map shift+insert paste_from_selection + +#: Pass selection to program + +# map kitty_mod+o pass_selection_to_program + +#:: You can also pass the contents of the current selection to any +#:: program with pass_selection_to_program. By default, the system's +#:: open program is used, but you can specify your own, the selection +#:: will be passed as a command line argument to the program. For +#:: example:: + +#:: map kitty_mod+o pass_selection_to_program firefox + +#:: You can pass the current selection to a terminal program running +#:: in a new kitty window, by using the @selection placeholder:: + +#:: map kitty_mod+y new_window less @selection + +#: }}} + +#: Scrolling {{{ + +#: Scroll line up + +# map kitty_mod+up scroll_line_up +# map kitty_mod+k scroll_line_up +# map opt+cmd+page_up scroll_line_up +# map cmd+up scroll_line_up + +#: Scroll line down + +# map kitty_mod+down scroll_line_down +# map kitty_mod+j scroll_line_down +# map opt+cmd+page_down scroll_line_down +# map cmd+down scroll_line_down + +#: Scroll page up + +# map kitty_mod+page_up scroll_page_up +# map cmd+page_up scroll_page_up + +#: Scroll page down + +# map kitty_mod+page_down scroll_page_down +# map cmd+page_down scroll_page_down + +#: Scroll to top + +# map kitty_mod+home scroll_home +# map cmd+home scroll_home + +#: Scroll to bottom + +# map kitty_mod+end scroll_end +# map cmd+end scroll_end + +#: Scroll to previous shell prompt + +# map kitty_mod+z scroll_to_prompt -1 + +#:: Use a parameter of 0 for scroll_to_prompt to scroll to the last +#:: jumped to or the last clicked position. Requires shell +#:: integration +#:: to work. + +#: Scroll to next shell prompt + +# map kitty_mod+x scroll_to_prompt 1 + +#: Browse scrollback buffer in pager + +# map kitty_mod+h show_scrollback + +#:: You can pipe the contents of the current screen and history +#:: buffer as STDIN to an arbitrary program using launch --stdin- +#:: source. For example, the following opens the scrollback buffer in +#:: less in an overlay window:: + +#:: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R + +#:: For more details on piping screen and buffer contents to external +#:: programs, see launch . + +#: Browse output of the last shell command in pager + +# map kitty_mod+g show_last_command_output + +#:: You can also define additional shortcuts to get the command +#:: output. For example, to get the first command output on screen:: + +#:: map f1 show_first_command_output_on_screen + +#:: To get the command output that was last accessed by a keyboard +#:: action or mouse action:: + +#:: map f1 show_last_visited_command_output + +#:: You can pipe the output of the last command run in the shell +#:: using the launch action. For example, the following opens the +#:: output in less in an overlay window:: + +#:: map f1 launch --stdin-source=@last_cmd_output --stdin-add-formatting --type=overlay less +G -R + +#:: To get the output of the first command on the screen, use +#:: @first_cmd_output_on_screen. To get the output of the last jumped +#:: to command, use @last_visited_cmd_output. + +#:: Requires shell integration +#:: to work. + +#: }}} + +#: Window management {{{ + +#: New window + +# map kitty_mod+enter new_window +# map cmd+enter new_window + +#:: You can open a new kitty window running an arbitrary program, for +#:: example:: + +#:: map kitty_mod+y launch mutt + +#:: You can open a new window with the current working directory set +#:: to the working directory of the current window using:: + +#:: map ctrl+alt+enter launch --cwd=current + +#:: You can open a new window that is allowed to control kitty via +#:: the kitty remote control facility with launch --allow-remote- +#:: control. Any programs running in that window will be allowed to +#:: control kitty. For example:: + +#:: map ctrl+enter launch --allow-remote-control some_program + +#:: You can open a new window next to the currently active window or +#:: as the first window, with:: + +#:: map ctrl+n launch --location=neighbor +#:: map ctrl+f launch --location=first + +#:: For more details, see launch +#:: . + +#: New OS window + +# map kitty_mod+n new_os_window +# map cmd+n new_os_window + +#:: Works like new_window above, except that it opens a top-level OS +#:: window. In particular you can use new_os_window_with_cwd to open +#:: a window with the current working directory. + +#: Close window + +# map kitty_mod+w close_window +# map shift+cmd+d close_window + +#: Next window + +# map kitty_mod+] next_window + +#: Previous window + +# map kitty_mod+[ previous_window + +#: Move window forward + +# map kitty_mod+f move_window_forward + +#: Move window backward + +# map kitty_mod+b move_window_backward + +#: Move window to top + +# map kitty_mod+` move_window_to_top + +#: Start resizing window + +# map kitty_mod+r start_resizing_window +# map cmd+r start_resizing_window + +#: First window + +# map kitty_mod+1 first_window +# map cmd+1 first_window + +#: Second window + +# map kitty_mod+2 second_window +# map cmd+2 second_window + +#: Third window + +# map kitty_mod+3 third_window +# map cmd+3 third_window + +#: Fourth window + +# map kitty_mod+4 fourth_window +# map cmd+4 fourth_window + +#: Fifth window + +# map kitty_mod+5 fifth_window +# map cmd+5 fifth_window + +#: Sixth window + +# map kitty_mod+6 sixth_window +# map cmd+6 sixth_window + +#: Seventh window + +# map kitty_mod+7 seventh_window +# map cmd+7 seventh_window + +#: Eighth window + +# map kitty_mod+8 eighth_window +# map cmd+8 eighth_window + +#: Ninth window + +# map kitty_mod+9 ninth_window +# map cmd+9 ninth_window + +#: Tenth window + +# map kitty_mod+0 tenth_window + +#: Visually select and focus window + +# map kitty_mod+f7 focus_visible_window + +#:: Display overlay numbers and alphabets on the window, and switch +#:: the focus to the window when you press the key. When there are +#:: only two windows, the focus will be switched directly without +#:: displaying the overlay. You can change the overlay characters and +#:: their order with option visual_window_select_characters. + +#: Visually swap window with another + +# map kitty_mod+f8 swap_with_window + +#:: Works like focus_visible_window above, but swaps the window. + +#: }}} + +#: Tab management {{{ + +#: Next tab + +# map kitty_mod+right next_tab +# map shift+cmd+] next_tab +# map ctrl+tab next_tab + +#: Previous tab + +# map kitty_mod+left previous_tab +# map shift+cmd+[ previous_tab +# map ctrl+shift+tab previous_tab + +#: New tab + +# map kitty_mod+t new_tab +# map cmd+t new_tab + +#: Close tab + +# map kitty_mod+q close_tab +# map cmd+w close_tab + +#: Close OS window + +# map shift+cmd+w close_os_window + +#: Move tab forward + +# map kitty_mod+. move_tab_forward + +#: Move tab backward + +# map kitty_mod+, move_tab_backward + +#: Set tab title + +# map kitty_mod+alt+t set_tab_title +# map shift+cmd+i set_tab_title + + +#: You can also create shortcuts to go to specific tabs, with 1 being +#: the first tab, 2 the second tab and -1 being the previously active +#: tab, and any number larger than the last tab being the last tab:: + +#: map ctrl+alt+1 goto_tab 1 +#: map ctrl+alt+2 goto_tab 2 + +#: Just as with new_window above, you can also pass the name of +#: arbitrary commands to run when using new_tab and new_tab_with_cwd. +#: Finally, if you want the new tab to open next to the current tab +#: rather than at the end of the tabs list, use:: + +#: map ctrl+t new_tab !neighbor [optional cmd to run] +#: }}} + +#: Layout management {{{ + +#: Next layout + +# map kitty_mod+l next_layout + + +#: You can also create shortcuts to switch to specific layouts:: + +#: map ctrl+alt+t goto_layout tall +#: map ctrl+alt+s goto_layout stack + +#: Similarly, to switch back to the previous layout:: + +#: map ctrl+alt+p last_used_layout + +#: There is also a toggle_layout action that switches to the named +#: layout or back to the previous layout if in the named layout. +#: Useful to temporarily "zoom" the active window by switching to the +#: stack layout:: + +#: map ctrl+alt+z toggle_layout stack +#: }}} + +#: Font sizes {{{ + +#: You can change the font size for all top-level kitty OS windows at +#: a time or only the current one. + +#: Increase font size + +# map kitty_mod+equal change_font_size all +2.0 +# map kitty_mod+plus change_font_size all +2.0 +# map kitty_mod+kp_add change_font_size all +2.0 +# map cmd+plus change_font_size all +2.0 +# map cmd+equal change_font_size all +2.0 +# map shift+cmd+equal change_font_size all +2.0 + +#: Decrease font size + +# map kitty_mod+minus change_font_size all -2.0 +# map kitty_mod+kp_subtract change_font_size all -2.0 +# map cmd+minus change_font_size all -2.0 +# map shift+cmd+minus change_font_size all -2.0 + +#: Reset font size + +# map kitty_mod+backspace change_font_size all 0 +# map cmd+0 change_font_size all 0 + + +#: To setup shortcuts for specific font sizes:: + +#: map kitty_mod+f6 change_font_size all 10.0 + +#: To setup shortcuts to change only the current OS window's font +#: size:: + +#: map kitty_mod+f6 change_font_size current 10.0 +#: }}} + +#: Select and act on visible text {{{ + +#: Use the hints kitten to select text and either pass it to an +#: external program or insert it into the terminal or copy it to the +#: clipboard. + +#: Open URL + +# map kitty_mod+e open_url_with_hints + +#:: Open a currently visible URL using the keyboard. The program used +#:: to open the URL is specified in open_url_with. + +#: Insert selected path + +# map kitty_mod+p>f kitten hints --type path --program - + +#:: Select a path/filename and insert it into the terminal. Useful, +#:: for instance to run git commands on a filename output from a +#:: previous git command. + +#: Open selected path + +# map kitty_mod+p>shift+f kitten hints --type path + +#:: Select a path/filename and open it with the default open program. + +#: Insert selected line + +# map kitty_mod+p>l kitten hints --type line --program - + +#:: Select a line of text and insert it into the terminal. Useful for +#:: the output of things like: `ls -1`. + +#: Insert selected word + +# map kitty_mod+p>w kitten hints --type word --program - + +#:: Select words and insert into terminal. + +#: Insert selected hash + +# map kitty_mod+p>h kitten hints --type hash --program - + +#:: Select something that looks like a hash and insert it into the +#:: terminal. Useful with git, which uses SHA1 hashes to identify +#:: commits. + +#: Open the selected file at the selected line + +# map kitty_mod+p>n kitten hints --type linenum + +#:: Select something that looks like filename:linenum and open it in +#:: your default editor at the specified line number. + +#: Open the selected hyperlink + +# map kitty_mod+p>y kitten hints --type hyperlink + +#:: Select a hyperlink (i.e. a URL that has been marked as such by +#:: the terminal program, for example, by `ls --hyperlink=auto`). + + +#: The hints kitten has many more modes of operation that you can map +#: to different shortcuts. For a full description see hints kitten +#: . +#: }}} + +#: Miscellaneous {{{ + +#: Show documentation + +# map kitty_mod+f1 show_kitty_doc overview + +#: Toggle fullscreen + +# map kitty_mod+f11 toggle_fullscreen +# map ctrl+cmd+f toggle_fullscreen + +#: Toggle maximized + +# map kitty_mod+f10 toggle_maximized + +#: Toggle macOS secure keyboard entry + +# map opt+cmd+s toggle_macos_secure_keyboard_entry + +#: Unicode input + +# map kitty_mod+u kitten unicode_input +# map ctrl+cmd+space kitten unicode_input + +#: Edit config file + +# map kitty_mod+f2 edit_config_file +# map cmd+, edit_config_file + +#: Open the kitty command shell + +# map kitty_mod+escape kitty_shell window + +#:: Open the kitty shell in a new window / tab / overlay / os_window +#:: to control kitty using commands. + +#: Increase background opacity + +# map kitty_mod+a>m set_background_opacity +0.1 + +#: Decrease background opacity + +# map kitty_mod+a>l set_background_opacity -0.1 + +#: Make background fully opaque + +# map kitty_mod+a>1 set_background_opacity 1 + +#: Reset background opacity + +# map kitty_mod+a>d set_background_opacity default + +#: Reset the terminal + +# map kitty_mod+delete clear_terminal reset active +# map opt+cmd+r clear_terminal reset active + +#:: You can create shortcuts to clear/reset the terminal. For +#:: example:: + +#:: # Reset the terminal +#:: map f1 clear_terminal reset active +#:: # Clear the terminal screen by erasing all contents +#:: map f1 clear_terminal clear active +#:: # Clear the terminal scrollback by erasing it +#:: map f1 clear_terminal scrollback active +#:: # Scroll the contents of the screen into the scrollback +#:: map f1 clear_terminal scroll active +#:: # Clear everything up to the line with the cursor or the start of the current prompt (needs shell integration) +#:: map f1 clear_terminal to_cursor active +#:: # Same as above except cleared lines are moved into scrollback +#:: map f1 clear_terminal to_cursor_scroll active + +#:: If you want to operate on all kitty windows instead of just the +#:: current one, use all instead of active. + +#:: Some useful functions that can be defined in the shell rc files +#:: to perform various kinds of clearing of the current window: + +#:: .. code-block:: sh + +#:: clear-only-screen() { +#:: printf "\e[H\e[2J" +#:: } + +#:: clear-screen-and-scrollback() { +#:: printf "\e[H\e[3J" +#:: } + +#:: clear-screen-saving-contents-in-scrollback() { +#:: printf "\e[H\e[22J" +#:: } + +#:: For instance, using these escape codes, it is possible to remap +#:: Ctrl+L to both scroll the current screen contents into the +#:: scrollback buffer and clear the screen, instead of just clearing +#:: the screen. For ZSH, in ~/.zshrc, add: + +#:: .. code-block:: zsh + +#:: ctrl_l() { +#:: builtin print -rn -- $'\r\e[0J\e[H\e[22J' >"$TTY" +#:: builtin zle .reset-prompt +#:: builtin zle -R +#:: } +#:: zle -N ctrl_l +#:: bindkey '^l' ctrl_l + +#:: Alternatively, you can just add map ctrl+l clear_terminal +#:: to_cursor_scroll active to kitty.conf which works with no changes +#:: to the shell rc files, but only clears up to the prompt, it does +#:: not clear anytext at the prompt itself. + +#: Clear up to cursor line + +# map cmd+k clear_terminal to_cursor active + +#: Reload kitty.conf + +# map kitty_mod+f5 load_config_file +# map ctrl+cmd+, load_config_file + +#:: Reload kitty.conf, applying any changes since the last time it +#:: was loaded. Note that a handful of options cannot be dynamically +#:: changed and require a full restart of kitty. Particularly, when +#:: changing shortcuts for actions located on the macOS global menu +#:: bar, a full restart is needed. You can also map a keybinding to +#:: load a different config file, for example:: + +#:: map f5 load_config /path/to/alternative/kitty.conf + +#:: Note that all options from the original kitty.conf are discarded, +#:: in other words the new configuration *replace* the old ones. + +#: Debug kitty configuration + +# map kitty_mod+f6 debug_config +# map opt+cmd+, debug_config + +#:: Show details about exactly what configuration kitty is running +#:: with and its host environment. Useful for debugging issues. + +#: Send arbitrary text on key presses + +#:: E.g. map ctrl+shift+alt+h send_text all Hello World + +#:: You can tell kitty to send arbitrary (UTF-8) encoded text to the +#:: client program when pressing specified shortcut keys. For +#:: example:: + +#:: map ctrl+alt+a send_text all Special text + +#:: This will send "Special text" when you press the Ctrl+Alt+A key +#:: combination. The text to be sent decodes ANSI C escapes +#:: so you can use escapes like \e to send control +#:: codes or \u21fb to send Unicode characters (or you can just input +#:: the Unicode characters directly as UTF-8 text). You can use +#:: `kitten show_key` to get the key escape codes you want to +#:: emulate. + +#:: The first argument to send_text is the keyboard modes in which to +#:: activate the shortcut. The possible values are normal, +#:: application, kitty or a comma separated combination of them. The +#:: modes normal and application refer to the DECCKM cursor key mode +#:: for terminals, and kitty refers to the kitty extended keyboard +#:: protocol. The special value all means all of them. + +#:: Some more examples:: + +#:: # Output a word and move the cursor to the start of the line (like typing and pressing Home) +#:: map ctrl+alt+a send_text normal Word\e[H +#:: map ctrl+alt+a send_text application Word\eOH +#:: # Run a command at a shell prompt (like typing the command and pressing Enter) +#:: map ctrl+alt+a send_text normal,application some command with arguments\r + +#: Open kitty Website + +# map shift+cmd+/ open_url https://sw.kovidgoyal.net/kitty/ + +#: Hide macOS kitty application + +# map cmd+h hide_macos_app + +#: Hide macOS other applications + +# map opt+cmd+h hide_macos_other_apps + +#: Minimize macOS window + +# map cmd+m minimize_macos_window + +#: Quit kitty + +# map cmd+q quit + +#: }}} + +#: }}} From ee46619e57b74cc3c24e10c50c1afc8926f55c1b Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 25 Sep 2024 21:37:46 +0200 Subject: [PATCH 168/280] Add kitty alias --- .zshrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.zshrc b/.zshrc index fbabe38..f587d26 100644 --- a/.zshrc +++ b/.zshrc @@ -117,6 +117,7 @@ function rgs() { rg --json -C 2 "$@" | delta } # [r]ip[g]rep [s]earch alias zshrc='nvim ~/.zshrc' # Idea from Chris alias calacritty='nvim ~/.config/alacritty/alacritty.toml' +alias ckitty='nvim ~/.config/kitty/kitty.yml' alias ctmux='nvim ~/.tmux.conf' alias clazygit='nvim ~/Library/Application\ Support/lazygit/config.yml' alias cneovide='nvim ~/.config/neovide/config.toml' From f623d0f0b0319aaf4da5536e9995ab5cef4e67e8 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 25 Sep 2024 22:01:19 +0200 Subject: [PATCH 169/280] Update alacritty config --- .config/kitty/Solarized_Light.conf | 21 +++++++++++++++++++++ .config/kitty/kitty.conf | 18 ++++++++++-------- .zshrc | 4 ++-- 3 files changed, 33 insertions(+), 10 deletions(-) create mode 100644 .config/kitty/Solarized_Light.conf diff --git a/.config/kitty/Solarized_Light.conf b/.config/kitty/Solarized_Light.conf new file mode 100644 index 0000000..36e101b --- /dev/null +++ b/.config/kitty/Solarized_Light.conf @@ -0,0 +1,21 @@ +background #fdf6e3 +foreground #52676f +cursor #52676f +selection_background #e9e2cb +color0 #e4e4e4 +color8 #ffffd7 +color1 #d70000 +color9 #d75f00 +color2 #5f8700 +color10 #585858 +color3 #af8700 +color11 #626262 +color4 #0087ff +color12 #808080 +color5 #af005f +color13 #5f5faf +color6 #00afaf +color14 #8a8a8a +color7 #262626 +color15 #1c1c1c +selection_foreground #fcf4dc diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 2d62426..edf213e 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -1,7 +1,9 @@ # vim:fileencoding=utf-8:foldmethod=marker macos_hide_titlebar true -hide_window_decorations true +hide_window_decorations titlebar-only + +include ./Solarized_Light.conf #: Fonts {{{ @@ -9,10 +11,10 @@ hide_window_decorations true #: individual font faces and even specify special fonts for particular #: characters. -# font_family monospace -# bold_font auto -# italic_font auto -# bold_italic_font auto +font_family jetbrains mono +bold_font auto +italic_font auto +bold_italic_font auto #: You can specify different fonts for the bold/italic/bold-italic #: variants. To get a full list of supported fonts use the `kitty @@ -27,7 +29,7 @@ hide_window_decorations true #: italic_font Operator Mono Book Italic #: bold_italic_font Operator Mono Medium Italic -# font_size 11.0 +font_size 23.0 #: Font size (in pts). @@ -845,7 +847,7 @@ hide_window_decorations true #: set the vertical and horizontal sides. Three values set top, #: horizontal and bottom. Four values set top, right, bottom and left. -window_padding_width 5 +window_padding_width 10 #: The window padding (in pts) (blank area between the text and the #: window border). A single value sets all four sides. Two values set @@ -869,7 +871,7 @@ window_padding_width 5 #: placed centrally. A value of top-left means the padding will be #: only at the bottom and right edges. -# active_border_color #00ff00 +active_border_color #FF0000 #: The color for the border of the active window. Set this to none to #: not draw borders around the active window. diff --git a/.zshrc b/.zshrc index f587d26..e66003c 100644 --- a/.zshrc +++ b/.zshrc @@ -117,7 +117,7 @@ function rgs() { rg --json -C 2 "$@" | delta } # [r]ip[g]rep [s]earch alias zshrc='nvim ~/.zshrc' # Idea from Chris alias calacritty='nvim ~/.config/alacritty/alacritty.toml' -alias ckitty='nvim ~/.config/kitty/kitty.yml' +alias ckitty='nvim ~/.config/kitty/kitty.conf' alias ctmux='nvim ~/.tmux.conf' alias clazygit='nvim ~/Library/Application\ Support/lazygit/config.yml' alias cneovide='nvim ~/.config/neovide/config.toml' @@ -315,7 +315,7 @@ renuo-cli-hack() { } # Update history -HISTSIZE=1000000 # Size of in-memory history (you can set this to a large number) +HISTSIZE=100000 # Size of in-memory history (you can set this to a large number) SAVEHIST=1000000 # Size of history saved to file (set to the same or a large number) HISTFILE=~/.zsh_history # Location of history file setopt APPEND_HISTORY # Append to history file instead of overwriting From 32cf87d17ed0c881b3e44b537e4fcae118b727b7 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 27 Sep 2024 09:17:58 +0200 Subject: [PATCH 170/280] Update nvim conf --- .config/nvim/.tool-versions | 1 + .config/nvim/init.lua | 39 ++++- .config/nvim/lazy-lock.json | 9 ++ .config/nvim/lua/plugins/autoclose.lua | 3 + .config/nvim/lua/plugins/copilotchat.lua | 77 ++++++++-- .config/nvim/lua/plugins/diffview.lua | 6 +- .config/nvim/lua/plugins/fitten.lua | 7 - .config/nvim/lua/plugins/java.lua | 10 +- .config/nvim/lua/plugins/lsp.lua | 145 ++++++------------ .config/nvim/lua/plugins/multicursor.lua | 9 +- .config/nvim/lua/plugins/neo-tree.lua | 11 -- .config/nvim/lua/plugins/nvim-spectre.lua | 10 +- .../lua/plugins/nvim-treesitter-endwise.lua | 18 +-- .config/nvim/lua/plugins/oil.lua | 6 +- 14 files changed, 198 insertions(+), 153 deletions(-) delete mode 100644 .config/nvim/lua/plugins/fitten.lua delete mode 100644 .config/nvim/lua/plugins/neo-tree.lua diff --git a/.config/nvim/.tool-versions b/.config/nvim/.tool-versions index f2a971a..d83fbce 100644 --- a/.config/nvim/.tool-versions +++ b/.config/nvim/.tool-versions @@ -1 +1,2 @@ ruby 3.2.2 +nodejs 22.9.0 diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 7e2b2e6..bb66ef3 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -30,10 +30,43 @@ vim.api.nvim_set_keymap('n', '', 'qq', { noremap = true, silent = true } vim.api.nvim_set_keymap('n', '', 'q', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '', '@q', { noremap = true, silent = true }) +-- Function to get the current line under the cursor +local function get_current_line() + return vim.api.nvim_get_current_line() +end + +-- Function to extract the attribute name from the current line +local function extract_attribute_name(line) + return line:match("%s*(%w+)%s*;") +end + +-- Function to define getter and setter macros +local function define_getter_setter_macros() + local line = get_current_line() + local attribute_name = extract_attribute_name(line) + if attribute_name then + local getter = string.format( + 'o// Getter method for %s^Mpublic String get%s() {^M return this.%s;^M}', + attribute_name, attribute_name:gsub("^%l", string.upper), attribute_name + ) + local setter = string.format( + 'o// Setter method for %s^Mpublic void set%s(String %s) {^M this.%s = %s;^M}', + attribute_name, attribute_name:gsub("^%l", string.upper), attribute_name, attribute_name, attribute_name + ) + vim.cmd(string.format("let @g = '%s'", getter)) + vim.cmd(string.format("let @s = '%s'", setter)) + else + print("No attribute name found on the current line.") + end +end + +-- Call the function to define the macros +define_getter_setter_macros() + -- tabs -vim.keymap.set("n", "", ":tabnew", { noremap = true }) -vim.keymap.set("n", "", ":tabnext", { noremap = true }) -vim.keymap.set("n", "", ":tabprevious", { noremap = true }) +-- vim.keymap.set("n", "", ":tabnew", { noremap = true }) +-- vim.keymap.set("n", "", ":tabnext", { noremap = true }) +-- vim.keymap.set("n", "", ":tabprevious", { noremap = true }) -- terminal vim.keymap.set("n", "", ":vert terminal", { noremap = true }) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 8f76b41..99e50c2 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -20,6 +20,7 @@ "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, + "lua-async-await": { "branch": "main", "commit": "652d94df34e97abe2d4a689edbc4270e7ead1a98" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, @@ -32,6 +33,12 @@ "none-ls.nvim": { "branch": "main", "commit": "9b98991e15dce8fc502993e23caac2528b8b667f" }, "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-dap": { "branch": "master", "commit": "90616ae6ae40053103dc66872886fc26b94c70c8" }, + "nvim-java": { "branch": "main", "commit": "b3174e41ab51867123d8663eced53b33f1548522" }, + "nvim-java-core": { "branch": "main", "commit": "5b03dca22fee76524a89e1c2dc1d73a9f0b1a3bb" }, + "nvim-java-dap": { "branch": "main", "commit": "55f239532f7a3789d21ea68d1e795abc77484974" }, + "nvim-java-refactor": { "branch": "main", "commit": "ea1420fed5463c9cc976c2b4175f434b3646f0f7" }, + "nvim-java-test": { "branch": "main", "commit": "7f0f40e9c5b7eab5096d8bec6ac04251c6e81468" }, "nvim-lspconfig": { "branch": "master", "commit": "73e0002b6f211376bbf36c31a2f812aedf6bd6b0" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, @@ -47,6 +54,8 @@ "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "solarized.nvim": { "branch": "main", "commit": "1293bec92289d9431fb0ede0b627de8ab60b895e" }, + "sonarlint.nvim": { "branch": "main", "commit": "8c13a7f294eaaed01b86be3113c608dc28bc5a27" }, + "spring-boot.nvim": { "branch": "main", "commit": "218c0c26c14d99feca778e4d13f5ec3e8b1b60f0" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, diff --git a/.config/nvim/lua/plugins/autoclose.lua b/.config/nvim/lua/plugins/autoclose.lua index bd3038f..21176b3 100644 --- a/.config/nvim/lua/plugins/autoclose.lua +++ b/.config/nvim/lua/plugins/autoclose.lua @@ -1,4 +1,7 @@ return { "m4xshen/autoclose.nvim", lazy = false, + config = function() + require("autoclose").setup() + end } diff --git a/.config/nvim/lua/plugins/copilotchat.lua b/.config/nvim/lua/plugins/copilotchat.lua index 0d452d2..d009231 100644 --- a/.config/nvim/lua/plugins/copilotchat.lua +++ b/.config/nvim/lua/plugins/copilotchat.lua @@ -1,15 +1,10 @@ return { "CopilotC-Nvim/CopilotChat.nvim", - branch = "canary", dependencies = { { "zbirenbaum/copilot.lua" }, { "nvim-lua/plenary.nvim" }, }, - build = "make tiktoken", - opts = { - auto_insert_mode = true, - }, - cmd = { + commands = { "CopilotChat", "CopilotChatOpen", "CopilotChatClose", @@ -20,7 +15,6 @@ return { "CopilotChatLoad", "CopilotChatDebugInfo", "CopilotChatModels", - "CopilotChatModel", "CopilotChatExplain", "CopilotChatReview", "CopilotChatFix", @@ -31,8 +25,71 @@ return { "CopilotChatCommit", "CopilotChatCommitStaged", }, + opts = { + temperature = 0.3, + mappings = { + reset = { + normal = "", + insert = "", + }, + complete = { + detail = "Use @ or / for options.", + insert = "", + }, + submit_prompt = { + normal = "", + insert = "", + }, + accept_diff = { + normal = "", + insert = "", + }, + yank_diff = { + normal = "gy", + }, + show_diff = { + normal = "gd", + }, + show_system_prompt = { + normal = "gp", + }, + show_user_selection = { + normal = "gs", + }, + }, + }, keys = { - { "p", "CopilotChat" }, - { "P", "CopilotChatFix" }, - } + { + "P", + "CopilotChat", + desc = "CopilotChat - Quick chat", + }, + { + "ccq", + function() + local input = vim.fn.input("Quick Chat: ") + if input ~= "" then + require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) + end + end, + desc = "CopilotChat - Quick chat", + }, + { + "cch", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.help_actions()) + end, + desc = "CopilotChat - Help actions", + }, + -- Show prompts actions with telescope + { + "ccp", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) + end, + desc = "CopilotChat - Prompt actions", + }, + }, } diff --git a/.config/nvim/lua/plugins/diffview.lua b/.config/nvim/lua/plugins/diffview.lua index 73418f6..9db2d10 100644 --- a/.config/nvim/lua/plugins/diffview.lua +++ b/.config/nvim/lua/plugins/diffview.lua @@ -1,9 +1,9 @@ return { "sindrets/diffview.nvim", lazy = false, - -- cmd = { - -- "DiffViewOpen" - -- }, + cmd = { + "DiffViewOpen" + }, keys = { { "do", "DiffviewOpen" } } diff --git a/.config/nvim/lua/plugins/fitten.lua b/.config/nvim/lua/plugins/fitten.lua deleted file mode 100644 index ebbdc4b..0000000 --- a/.config/nvim/lua/plugins/fitten.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - 'luozhiya/fittencode.nvim', - lazy = false, - config = function() - require('fittencode').setup() - end, -} diff --git a/.config/nvim/lua/plugins/java.lua b/.config/nvim/lua/plugins/java.lua index 5fb5bb8..1328329 100644 --- a/.config/nvim/lua/plugins/java.lua +++ b/.config/nvim/lua/plugins/java.lua @@ -1,3 +1,9 @@ -return { - -- 'nvim-java/nvim-java', +return { + 'nvim-java/nvim-java', + config = function() + require('jdtls').start_or_attach({ + cmd = {'/path/to/jdt-language-server/bin/jdtls'}, + root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]), + }) + end } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index c472ac5..eff4d92 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -38,100 +38,6 @@ return { }) end, }, - { - "CopilotC-Nvim/CopilotChat.nvim", - dependencies = { - { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim - { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper - }, - commands = { - "CopilotChat", - "CopilotChatOpen", - "CopilotChatClose", - "CopilotChatToggle", - "CopilotChatStop", - "CopilotChatReset", - "CopilotChatSave", - "CopilotChatLoad", - "CopilotChatDebugInfo", - "CopilotChatModels", - "CopilotChatExplain", - "CopilotChatReview", - "CopilotChatFix", - "CopilotChatOptimize", - "CopilotChatDocs", - "CopilotChatTests", - "CopilotChatFixDiagnostic", - "CopilotChatCommit", - "CopilotChatCommitStaged", - }, - opts = { - temperature = 0.3, - mappings = { - reset = { - normal = "", - insert = "", - }, - complete = { - detail = "Use @ or / for options.", - insert = "", - }, - close = { - normal = "q", - insert = "", - }, - submit_prompt = { - normal = "", - insert = "", - }, - accept_diff = { - normal = "", - insert = "", - }, - yank_diff = { - normal = "gy", - }, - show_diff = { - normal = "gd", - }, - show_system_prompt = { - normal = "gp", - }, - show_user_selection = { - normal = "gs", - }, - }, - }, - keys = { - { - "ccq", - function() - local input = vim.fn.input("Quick Chat: ") - if input ~= "" then - require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) - end - end, - desc = "CopilotChat - Quick chat", - }, - { - "cch", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.help_actions()) - end, - desc = "CopilotChat - Help actions", - }, - -- Show prompts actions with telescope - { - "ccp", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) - end, - desc = "CopilotChat - Prompt actions", - }, - }, - }, { "williamboman/mason.nvim", lazy = false, @@ -147,7 +53,7 @@ return { lazy = false, config = function() require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "tsserver", "solargraph" }, + ensure_installed = { "lua_ls", "ts_ls", "solargraph", "rust_analyzer" }, }) end, }, @@ -179,6 +85,10 @@ return { capabilities = capabilities, on_attach = disable_lsp_for_oil_buffer, }) + lspconfig.ts_ls.setup({ + capabilities = capabilities, + on_attach = disable_lsp_for_oil_buffer, + }) lspconfig.ltex.setup({ cmd = { "ltex-ls" }, filetypes = { "markdown", "text", "cff", "tex" }, @@ -188,6 +98,10 @@ return { lspconfig.astro.setup({ on_attach = disable_lsp_for_oil_buffer, }) + lspconfig.rust_analyzer.setup({ + capabilities = capabilities, + on_attach = disable_lsp_for_oil_buffer, + }) lspconfig.solargraph.setup({ capabilities = capabilities, cmd = { @@ -223,7 +137,46 @@ return { {"ls", "LspStop"}, {"lS", "LspStart"}, } -}, + }, + { + "danarth/sonarlint.nvim", + ft = "java", + config = function() + require('sonarlint').setup({ + server = { + cmd = { + 'sonarlint-language-server', + -- Ensure that sonarlint-language-server uses stdio channel + '-stdio', + '-analyzers', + -- paths to the analyzers you need, using those for python and java in this example + vim.fn.expand("$MASON/share/sonarlint-analyzers/sonarpython.jar"), + vim.fn.expand("$MASON/share/sonarlint-analyzers/sonarcfamily.jar"), + vim.fn.expand("$MASON/share/sonarlint-analyzers/sonarjava.jar"), + }, + -- All settings are optional + settings = { + -- The default for sonarlint is {}, this is just an example + sonarlint = { + rules = { + ['typescript:S101'] = { level = 'on', parameters = { format = '^[A-Z][a-zA-Z0-9]*$' } }, + ['typescript:S103'] = { level = 'on', parameters = { maximumLineLength = 180 } }, + ['typescript:S106'] = { level = 'on' }, + ['typescript:S107'] = { level = 'on', parameters = { maximumFunctionParameters = 7 } } + } + } + } + }, + filetypes = { + -- Tested and working + 'python', + 'cpp', + -- Requires nvim-jdtls, otherwise an error message will be printed + 'java', + } + }) + end + }, { "nvimtools/none-ls.nvim", config = function() diff --git a/.config/nvim/lua/plugins/multicursor.lua b/.config/nvim/lua/plugins/multicursor.lua index 044d595..f53ead1 100644 --- a/.config/nvim/lua/plugins/multicursor.lua +++ b/.config/nvim/lua/plugins/multicursor.lua @@ -1,15 +1,16 @@ return { "brenton-leighton/multiple-cursors.nvim", - version = "*", -- Use the latest tagged version - opts = {}, -- This causes the plugin setup function to be called + version = "*", + opts = {}, keys = { - {"gj", "MultipleCursorsAddDown", mode = {"n", "x"}, desc = "Add cursor and move down"}, - {"gk", "MultipleCursorsAddUp", mode = {"n", "x"}, desc = "Add cursor and move up"}, + {"j", "MultipleCursorsAddDown", mode = {"n", "x"}, desc = "Add cursor and move down"}, + {"k", "MultipleCursorsAddUp", mode = {"n", "x"}, desc = "Add cursor and move up"}, {"", "MultipleCursorsMouseAddDelete", mode = {"n", "i"}, desc = "Add or remove cursor"}, {"a", "MultipleCursorsAddMatches", mode = {"n", "x"}, desc = "Add cursors to cword"}, {"A", "MultipleCursorsAddMatchesV", mode = {"n", "x"}, desc = "Add cursors to cword in previous area"}, {"d", "MultipleCursorsAddJumpNextMatch", mode = {"n", "x"}, desc = "Add cursor and jump to next cword"}, {"D", "MultipleCursorsJumpNextMatch", mode = {"n", "x"}, desc = "Jump to next cword"}, {"l", "MultipleCursorsLock", mode = {"n", "x"}, desc = "Lock virtual cursors"}, + {"n", "|", function() require("multiple-cursors").align() end}, }, } diff --git a/.config/nvim/lua/plugins/neo-tree.lua b/.config/nvim/lua/plugins/neo-tree.lua deleted file mode 100644 index a15843f..0000000 --- a/.config/nvim/lua/plugins/neo-tree.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - "nvim-neo-tree/neo-tree.nvim", - lazy = false, - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information - } -} diff --git a/.config/nvim/lua/plugins/nvim-spectre.lua b/.config/nvim/lua/plugins/nvim-spectre.lua index 2334570..6f024cf 100644 --- a/.config/nvim/lua/plugins/nvim-spectre.lua +++ b/.config/nvim/lua/plugins/nvim-spectre.lua @@ -1,7 +1,7 @@ return { - "nvim-pack/nvim-spectre", - dependencies = { - 'nvim-lua/plenary.nvim' - }, - lazy = false + "nvim-pack/nvim-spectre", + dependencies = { + 'nvim-lua/plenary.nvim' + }, + lazy = false } diff --git a/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua b/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua index e523485..19f0a47 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua @@ -1,11 +1,11 @@ return { - "RRethy/nvim-treesitter-endwise", - event = { "BufReadPre", "BufNewFile" }, - config = function() - require("nvim-treesitter.configs").setup { - endwise = { - enable = true, - }, - } - end, + "RRethy/nvim-treesitter-endwise", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("nvim-treesitter.configs").setup { + endwise = { + enable = true, + }, + } + end, } diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index 4ae42ac..cb535fb 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -1,5 +1,5 @@ return { - 'stevearc/oil.nvim', + "stevearc/oil.nvim", dependencies = { { "echasnovski/mini.icons", opts = {} } }, lazy = false, config = function() @@ -23,8 +23,8 @@ return { [""] = "actions.preview", ["-"] = "actions.parent", ["_"] = "actions.open_cwd", - ["`"] = "actions.cd", - ["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory" }, + [""] = "actions.cd", + [""] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory" }, ["gs"] = "actions.change_sort", [""] = { "actions.open_cmdline", From 360cbcf3a2f3b1d2f93e89e84c1446d472126541 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 27 Sep 2024 09:18:12 +0200 Subject: [PATCH 171/280] Update kitty conf --- .config/kitty/kitty.conf | 2508 +------------------------------------- 1 file changed, 5 insertions(+), 2503 deletions(-) diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index edf213e..9b7fcb4 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -1,2512 +1,14 @@ # vim:fileencoding=utf-8:foldmethod=marker +include ./Solarized_Light.conf macos_hide_titlebar true hide_window_decorations titlebar-only +confirm_os_window_close 0 -include ./Solarized_Light.conf - -#: Fonts {{{ - -#: kitty has very powerful font management. You can configure -#: individual font faces and even specify special fonts for particular -#: characters. - -font_family jetbrains mono -bold_font auto -italic_font auto -bold_italic_font auto - -#: You can specify different fonts for the bold/italic/bold-italic -#: variants. To get a full list of supported fonts use the `kitty -#: +list-fonts` command. By default they are derived automatically, by -#: the OSes font system. When bold_font or bold_italic_font is set to -#: auto on macOS, the priority of bold fonts is semi-bold, bold, -#: heavy. Setting them manually is useful for font families that have -#: many weight variants like Book, Medium, Thick, etc. For example:: - -#: font_family Operator Mono Book -#: bold_font Operator Mono Medium -#: italic_font Operator Mono Book Italic -#: bold_italic_font Operator Mono Medium Italic - +font_family jetbrains mono font_size 23.0 -#: Font size (in pts). - -# force_ltr no - -#: kitty does not support BIDI (bidirectional text), however, for RTL -#: scripts, words are automatically displayed in RTL. That is to say, -#: in an RTL script, the words "HELLO WORLD" display in kitty as -#: "WORLD HELLO", and if you try to select a substring of an RTL- -#: shaped string, you will get the character that would be there had -#: the string been LTR. For example, assuming the Hebrew word ירושלים, -#: selecting the character that on the screen appears to be ם actually -#: writes into the selection buffer the character י. kitty's default -#: behavior is useful in conjunction with a filter to reverse the word -#: order, however, if you wish to manipulate RTL glyphs, it can be -#: very challenging to work with, so this option is provided to turn -#: it off. Furthermore, this option can be used with the command line -#: program GNU FriBidi -#: to get BIDI support, because it will force kitty to always treat -#: the text as LTR, which FriBidi expects for terminals. - -# symbol_map - -#: E.g. symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 PowerlineSymbols - -#: Map the specified Unicode codepoints to a particular font. Useful -#: if you need special rendering for some symbols, such as for -#: Powerline. Avoids the need for patched fonts. Each Unicode code -#: point is specified in the form `U+`. You -#: can specify multiple code points, separated by commas and ranges -#: separated by hyphens. This option can be specified multiple times. -#: The syntax is:: - -#: symbol_map codepoints Font Family Name - -# narrow_symbols - -#: E.g. narrow_symbols U+E0A0-U+E0A3,U+E0C0-U+E0C7 1 - -#: Usually, for Private Use Unicode characters and some symbol/dingbat -#: characters, if the character is followed by one or more spaces, -#: kitty will use those extra cells to render the character larger, if -#: the character in the font has a wide aspect ratio. Using this -#: option you can force kitty to restrict the specified code points to -#: render in the specified number of cells (defaulting to one cell). -#: This option can be specified multiple times. The syntax is:: - -#: narrow_symbols codepoints [optionally the number of cells] - -# disable_ligatures never - -#: Choose how you want to handle multi-character ligatures. The -#: default is to always render them. You can tell kitty to not render -#: them when the cursor is over them by using cursor to make editing -#: easier, or have kitty never render them at all by using always, if -#: you don't like them. The ligature strategy can be set per-window -#: either using the kitty remote control facility or by defining -#: shortcuts for it in kitty.conf, for example:: - -#: map alt+1 disable_ligatures_in active always -#: map alt+2 disable_ligatures_in all never -#: map alt+3 disable_ligatures_in tab cursor - -#: Note that this refers to programming ligatures, typically -#: implemented using the calt OpenType feature. For disabling general -#: ligatures, use the font_features option. - -# font_features - -#: E.g. font_features none - -#: Choose exactly which OpenType features to enable or disable. This -#: is useful as some fonts might have features worthwhile in a -#: terminal. For example, Fira Code includes a discretionary feature, -#: zero, which in that font changes the appearance of the zero (0), to -#: make it more easily distinguishable from Ø. Fira Code also includes -#: other discretionary features known as Stylistic Sets which have the -#: tags ss01 through ss20. - -#: For the exact syntax to use for individual features, see the -#: HarfBuzz documentation . - -#: Note that this code is indexed by PostScript name, and not the font -#: family. This allows you to define very precise feature settings; -#: e.g. you can disable a feature in the italic font but not in the -#: regular font. - -#: On Linux, font features are first read from the FontConfig database -#: and then this option is applied, so they can be configured in a -#: single, central place. - -#: To get the PostScript name for a font, use `kitty +list-fonts -#: --psnames`: - -#: .. code-block:: sh - -#: $ kitty +list-fonts --psnames | grep Fira -#: Fira Code -#: Fira Code Bold (FiraCode-Bold) -#: Fira Code Light (FiraCode-Light) -#: Fira Code Medium (FiraCode-Medium) -#: Fira Code Regular (FiraCode-Regular) -#: Fira Code Retina (FiraCode-Retina) - -#: The part in brackets is the PostScript name. - -#: Enable alternate zero and oldstyle numerals:: - -#: font_features FiraCode-Retina +zero +onum - -#: Enable only alternate zero in the bold font:: - -#: font_features FiraCode-Bold +zero - -#: Disable the normal ligatures, but keep the calt feature which (in -#: this font) breaks up monotony:: - -#: font_features TT2020StyleB-Regular -liga +calt - -#: In conjunction with force_ltr, you may want to disable Arabic -#: shaping entirely, and only look at their isolated forms if they -#: show up in a document. You can do this with e.g.:: - -#: font_features UnifontMedium +isol -medi -fina -init - -# modify_font - -#: Modify font characteristics such as the position or thickness of -#: the underline and strikethrough. The modifications can have the -#: suffix px for pixels or % for percentage of original value. No -#: suffix means use pts. For example:: - -#: modify_font underline_position -2 -#: modify_font underline_thickness 150% -#: modify_font strikethrough_position 2px - -#: Additionally, you can modify the size of the cell in which each -#: font glyph is rendered and the baseline at which the glyph is -#: placed in the cell. For example:: - -#: modify_font cell_width 80% -#: modify_font cell_height -2px -#: modify_font baseline 3 - -#: Note that modifying the baseline will automatically adjust the -#: underline and strikethrough positions by the same amount. -#: Increasing the baseline raises glyphs inside the cell and -#: decreasing it lowers them. Decreasing the cell size might cause -#: rendering artifacts, so use with care. - -# box_drawing_scale 0.001, 1, 1.5, 2 - -#: The sizes of the lines used for the box drawing Unicode characters. -#: These values are in pts. They will be scaled by the monitor DPI to -#: arrive at a pixel value. There must be four values corresponding to -#: thin, normal, thick, and very thick lines. - -# undercurl_style thin-sparse - -#: The style with which undercurls are rendered. This option takes the -#: form (thin|thick)-(sparse|dense). Thin and thick control the -#: thickness of the undercurl. Sparse and dense control how often the -#: curl oscillates. With sparse the curl will peak once per character, -#: with dense twice. - -# text_composition_strategy platform - -#: Control how kitty composites text glyphs onto the background color. -#: The default value of platform tries for text rendering as close to -#: "native" for the platform kitty is running on as possible. - -#: A value of legacy uses the old (pre kitty 0.28) strategy for how -#: glyphs are composited. This will make dark text on light -#: backgrounds look thicker and light text on dark backgrounds -#: thinner. It might also make some text appear like the strokes are -#: uneven. - -#: You can fine tune the actual contrast curve used for glyph -#: composition by specifying up to two space-separated numbers for -#: this setting. - -#: The first number is the gamma adjustment, which controls the -#: thickness of dark text on light backgrounds. Increasing the value -#: will make text appear thicker. The default value for this is 1.0 on -#: Linux and 1.7 on macOS. Valid values are 0.01 and above. The result -#: is scaled based on the luminance difference between the background -#: and the foreground. Dark text on light backgrounds receives the -#: full impact of the curve while light text on dark backgrounds is -#: affected very little. - -#: The second number is an additional multiplicative contrast. It is -#: percentage ranging from 0 to 100. The default value is 0 on Linux -#: and 30 on macOS. - -#: If you wish to achieve similar looking thickness in light and dark -#: themes, a good way to experiment is start by setting the value to -#: 1.0 0 and use a dark theme. Then adjust the second parameter until -#: it looks good. Then switch to a light theme and adjust the first -#: parameter until the perceived thickness matches the dark theme. - -# text_fg_override_threshold 0 - -#: The minimum accepted difference in luminance between the foreground -#: and background color, below which kitty will override the -#: foreground color. It is percentage ranging from 0 to 100. If the -#: difference in luminance of the foreground and background is below -#: this threshold, the foreground color will be set to white if the -#: background is dark or black if the background is light. The default -#: value is 0, which means no overriding is performed. Useful when -#: working with applications that use colors that do not contrast well -#: with your preferred color scheme. - -#: WARNING: Some programs use characters (such as block characters) -#: for graphics display and may expect to be able to set the -#: foreground and background to the same color (or similar colors). -#: If you see unexpected stripes, dots, lines, incorrect color, no -#: color where you expect color, or any kind of graphic display -#: problem try setting text_fg_override_threshold to 0 to see if this -#: is the cause of the problem. - -#: }}} - -#: Cursor customization {{{ - -# cursor #cccccc - -#: Default cursor color. If set to the special value none the cursor -#: will be rendered with a "reverse video" effect. It's color will be -#: the color of the text in the cell it is over and the text will be -#: rendered with the background color of the cell. Note that if the -#: program running in the terminal sets a cursor color, this takes -#: precedence. Also, the cursor colors are modified if the cell -#: background and foreground colors have very low contrast. Note that -#: some themes set this value, so if you want to override it, place -#: your value after the lines where the theme file is included. - -# cursor_text_color #111111 - -#: The color of text under the cursor. If you want it rendered with -#: the background color of the cell underneath instead, use the -#: special keyword: `background`. Note that if cursor is set to none -#: then this option is ignored. Note that some themes set this value, -#: so if you want to override it, place your value after the lines -#: where the theme file is included. - -# cursor_shape block - -#: The cursor shape can be one of block, beam, underline. Note that -#: when reloading the config this will be changed only if the cursor -#: shape has not been set by the program running in the terminal. This -#: sets the default cursor shape, applications running in the terminal -#: can override it. In particular, shell integration -#: in kitty sets -#: the cursor shape to beam at shell prompts. You can avoid this by -#: setting shell_integration to no-cursor. - -# cursor_beam_thickness 1.5 - -#: The thickness of the beam cursor (in pts). - -# cursor_underline_thickness 2.0 - -#: The thickness of the underline cursor (in pts). - -# cursor_blink_interval -1 - -#: The interval to blink the cursor (in seconds). Set to zero to -#: disable blinking. Negative values mean use system default. Note -#: that the minimum interval will be limited to repaint_delay. - -# cursor_stop_blinking_after 15.0 - -#: Stop blinking cursor after the specified number of seconds of -#: keyboard inactivity. Set to zero to never stop blinking. - -#: }}} - -#: Scrollback {{{ - -# scrollback_lines 2000 - -#: Number of lines of history to keep in memory for scrolling back. -#: Memory is allocated on demand. Negative numbers are (effectively) -#: infinite scrollback. Note that using very large scrollback is not -#: recommended as it can slow down performance of the terminal and -#: also use large amounts of RAM. Instead, consider using -#: scrollback_pager_history_size. Note that on config reload if this -#: is changed it will only affect newly created windows, not existing -#: ones. - -# scrollback_indicator_opacity 1.0 - -#: The opacity of the scrollback indicator which is a small colored -#: rectangle that moves along the right hand side of the window as you -#: scroll, indicating what fraction you have scrolled. The default is -#: one which means fully opaque, aka visible. Set to a value between -#: zero and one to make the indicator less visible. - -# scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER - -#: Program with which to view scrollback in a new window. The -#: scrollback buffer is passed as STDIN to this program. If you change -#: it, make sure the program you use can handle ANSI escape sequences -#: for colors and text formatting. INPUT_LINE_NUMBER in the command -#: line above will be replaced by an integer representing which line -#: should be at the top of the screen. Similarly CURSOR_LINE and -#: CURSOR_COLUMN will be replaced by the current cursor position or -#: set to 0 if there is no cursor, for example, when showing the last -#: command output. - -# scrollback_pager_history_size 0 - -#: Separate scrollback history size (in MB), used only for browsing -#: the scrollback buffer with pager. This separate buffer is not -#: available for interactive scrolling but will be piped to the pager -#: program when viewing scrollback buffer in a separate window. The -#: current implementation stores the data in UTF-8, so approximately -#: 10000 lines per megabyte at 100 chars per line, for pure ASCII, -#: unformatted text. A value of zero or less disables this feature. -#: The maximum allowed size is 4GB. Note that on config reload if this -#: is changed it will only affect newly created windows, not existing -#: ones. - -# scrollback_fill_enlarged_window no - -#: Fill new space with lines from the scrollback buffer after -#: enlarging a window. - -# wheel_scroll_multiplier 5.0 - -#: Multiplier for the number of lines scrolled by the mouse wheel. -#: Note that this is only used for low precision scrolling devices, -#: not for high precision scrolling devices on platforms such as macOS -#: and Wayland. Use negative numbers to change scroll direction. See -#: also wheel_scroll_min_lines. - -# wheel_scroll_min_lines 1 - -#: The minimum number of lines scrolled by the mouse wheel. The scroll -#: multiplier wheel_scroll_multiplier only takes effect after it -#: reaches this number. Note that this is only used for low precision -#: scrolling devices like wheel mice that scroll by very small amounts -#: when using the wheel. With a negative number, the minimum number of -#: lines will always be added. - -# touch_scroll_multiplier 1.0 - -#: Multiplier for the number of lines scrolled by a touchpad. Note -#: that this is only used for high precision scrolling devices on -#: platforms such as macOS and Wayland. Use negative numbers to change -#: scroll direction. - -#: }}} - -#: Mouse {{{ - -# mouse_hide_wait 3.0 - -#: Hide mouse cursor after the specified number of seconds of the -#: mouse not being used. Set to zero to disable mouse cursor hiding. -#: Set to a negative value to hide the mouse cursor immediately when -#: typing text. Disabled by default on macOS as getting it to work -#: robustly with the ever-changing sea of bugs that is Cocoa is too -#: much effort. - -# url_color #0087bd -# url_style curly - -#: The color and style for highlighting URLs on mouse-over. url_style -#: can be one of: none, straight, double, curly, dotted, dashed. - -# open_url_with default - -#: The program to open clicked URLs. The special value default will -#: first look for any URL handlers defined via the open_actions -#: facility and if non -#: are found, it will use the Operating System's default URL handler -#: (open on macOS and xdg-open on Linux). - -# url_prefixes file ftp ftps gemini git gopher http https irc ircs kitty mailto news sftp ssh - -#: The set of URL prefixes to look for when detecting a URL under the -#: mouse cursor. - -# detect_urls yes - -#: Detect URLs under the mouse. Detected URLs are highlighted with an -#: underline and the mouse cursor becomes a hand over them. Even if -#: this option is disabled, URLs are still clickable. See also the -#: underline_hyperlinks option to control how hyperlinks (as opposed -#: to plain text URLs) are displayed. - -# url_excluded_characters - -#: Additional characters to be disallowed from URLs, when detecting -#: URLs under the mouse cursor. By default, all characters that are -#: legal in URLs are allowed. Additionally, newlines are allowed (but -#: stripped). This is to accommodate programs such as mutt that add -#: hard line breaks even for continued lines. \n can be added to this -#: option to disable this behavior. Special characters can be -#: specified using backslash escapes, to specify a backslash use a -#: double backslash. - -# show_hyperlink_targets no - -#: When the mouse hovers over a terminal hyperlink, show the actual -#: URL that will be activated when the hyperlink is clicked. - -# underline_hyperlinks hover - -#: Control how hyperlinks are underlined. They can either be -#: underlined on mouse hover, always (i.e. permanently underlined) or -#: never which means that kitty will not apply any underline styling -#: to hyperlinks. Uses the url_style and url_color settings for the -#: underline style. Note that reloading the config and changing this -#: value to/from always will only affect text subsequently received by -#: kitty. - -# copy_on_select no - -#: Copy to clipboard or a private buffer on select. With this set to -#: clipboard, selecting text with the mouse will cause the text to be -#: copied to clipboard. Useful on platforms such as macOS that do not -#: have the concept of primary selection. You can instead specify a -#: name such as a1 to copy to a private kitty buffer. Map a shortcut -#: with the paste_from_buffer action to paste from this private -#: buffer. For example:: - -#: copy_on_select a1 -#: map shift+cmd+v paste_from_buffer a1 - -#: Note that copying to the clipboard is a security risk, as all -#: programs, including websites open in your browser can read the -#: contents of the system clipboard. - -# paste_actions quote-urls-at-prompt,confirm - -#: A comma separated list of actions to take when pasting text into -#: the terminal. The supported paste actions are: - -#: quote-urls-at-prompt: -#: If the text being pasted is a URL and the cursor is at a shell prompt, -#: automatically quote the URL (needs shell_integration). -#: replace-dangerous-control-codes -#: Replace dangerous control codes from pasted text, without confirmation. -#: replace-newline -#: Replace the newline character from pasted text, without confirmation. -#: confirm: -#: Confirm the paste if the text to be pasted contains any terminal control codes -#: as this can be dangerous, leading to code execution if the shell/program running -#: in the terminal does not properly handle these. -#: confirm-if-large -#: Confirm the paste if it is very large (larger than 16KB) as pasting -#: large amounts of text into shells can be very slow. -#: filter: -#: Run the filter_paste() function from the file paste-actions.py in -#: the kitty config directory on the pasted text. The text returned by the -#: function will be actually pasted. -#: no-op: -#: Has no effect. - -# strip_trailing_spaces never - -#: Remove spaces at the end of lines when copying to clipboard. A -#: value of smart will do it when using normal selections, but not -#: rectangle selections. A value of always will always do it. - -# select_by_word_characters @-./_~?&=%+# - -#: Characters considered part of a word when double clicking. In -#: addition to these characters any character that is marked as an -#: alphanumeric character in the Unicode database will be matched. - -# select_by_word_characters_forward - -#: Characters considered part of a word when extending the selection -#: forward on double clicking. In addition to these characters any -#: character that is marked as an alphanumeric character in the -#: Unicode database will be matched. - -#: If empty (default) select_by_word_characters will be used for both -#: directions. - -# click_interval -1.0 - -#: The interval between successive clicks to detect double/triple -#: clicks (in seconds). Negative numbers will use the system default -#: instead, if available, or fallback to 0.5. - -# focus_follows_mouse no - -#: Set the active window to the window under the mouse when moving the -#: mouse around. On macOS, this will also cause the OS Window under -#: the mouse to be focused automatically when the mouse enters it. - -# pointer_shape_when_grabbed arrow - -#: The shape of the mouse pointer when the program running in the -#: terminal grabs the mouse. - -# default_pointer_shape beam - -#: The default shape of the mouse pointer. - -# pointer_shape_when_dragging beam - -#: The default shape of the mouse pointer when dragging across text. - -#: Mouse actions {{{ - -#: Mouse buttons can be mapped to perform arbitrary actions. The -#: syntax is: - -#: .. code-block:: none - -#: mouse_map button-name event-type modes action - -#: Where button-name is one of left, middle, right, b1 ... b8 with -#: added keyboard modifiers. For example: ctrl+shift+left refers to -#: holding the Ctrl+Shift keys while clicking with the left mouse -#: button. The value b1 ... b8 can be used to refer to up to eight -#: buttons on a mouse. - -#: event-type is one of press, release, doublepress, triplepress, -#: click, doubleclick. modes indicates whether the action is performed -#: when the mouse is grabbed by the program running in the terminal, -#: or not. The values are grabbed or ungrabbed or a comma separated -#: combination of them. grabbed refers to when the program running in -#: the terminal has requested mouse events. Note that the click and -#: double click events have a delay of click_interval to disambiguate -#: from double and triple presses. - -#: You can run kitty with the kitty --debug-input command line option -#: to see mouse events. See the builtin actions below to get a sense -#: of what is possible. - -#: If you want to unmap a button, map it to nothing. For example, to -#: disable opening of URLs with a plain click:: - -#: mouse_map left click ungrabbed - -#: See all the mappable actions including mouse actions here -#: . - -#: .. note:: -#: Once a selection is started, releasing the button that started it will -#: automatically end it and no release event will be dispatched. - -# clear_all_mouse_actions no - -#: Remove all mouse action definitions up to this point. Useful, for -#: instance, to remove the default mouse actions. - -#: Click the link under the mouse or move the cursor - -# mouse_map left click ungrabbed mouse_handle_click selection link prompt - -#:: First check for a selection and if one exists do nothing. Then -#:: check for a link under the mouse cursor and if one exists, click -#:: it. Finally check if the click happened at the current shell -#:: prompt and if so, move the cursor to the click location. Note -#:: that this requires shell integration -#:: to work. - -#: Click the link under the mouse or move the cursor even when grabbed - -# mouse_map shift+left click grabbed,ungrabbed mouse_handle_click selection link prompt - -#:: Same as above, except that the action is performed even when the -#:: mouse is grabbed by the program running in the terminal. - -#: Click the link under the mouse cursor - -# mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_handle_click link - -#:: Variant with Ctrl+Shift is present because the simple click based -#:: version has an unavoidable delay of click_interval, to -#:: disambiguate clicks from double clicks. - -#: Discard press event for link click - -# mouse_map ctrl+shift+left press grabbed discard_event - -#:: Prevent this press event from being sent to the program that has -#:: grabbed the mouse, as the corresponding release event is used to -#:: open a URL. - -#: Paste from the primary selection - -# mouse_map middle release ungrabbed paste_from_selection - -#: Start selecting text - -# mouse_map left press ungrabbed mouse_selection normal - -#: Start selecting text in a rectangle - -# mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle - -#: Select a word - -# mouse_map left doublepress ungrabbed mouse_selection word - -#: Select a line - -# mouse_map left triplepress ungrabbed mouse_selection line - -#: Select line from point - -# mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point - -#:: Select from the clicked point to the end of the line. If you -#:: would like to select the word at the point and then extend to the -#:: rest of the line, change `line_from_point` to -#:: `word_and_line_from_point`. - -#: Extend the current selection - -# mouse_map right press ungrabbed mouse_selection extend - -#:: If you want only the end of the selection to be moved instead of -#:: the nearest boundary, use move-end instead of extend. - -#: Paste from the primary selection even when grabbed - -# mouse_map shift+middle release ungrabbed,grabbed paste_selection -# mouse_map shift+middle press grabbed discard_event - -#: Start selecting text even when grabbed - -# mouse_map shift+left press ungrabbed,grabbed mouse_selection normal - -#: Start selecting text in a rectangle even when grabbed - -# mouse_map ctrl+shift+alt+left press ungrabbed,grabbed mouse_selection rectangle - -#: Select a word even when grabbed - -# mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word - -#: Select a line even when grabbed - -# mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line - -#: Select line from point even when grabbed - -# mouse_map ctrl+shift+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point - -#:: Select from the clicked point to the end of the line even when -#:: grabbed. If you would like to select the word at the point and -#:: then extend to the rest of the line, change `line_from_point` to -#:: `word_and_line_from_point`. - -#: Extend the current selection even when grabbed - -# mouse_map shift+right press ungrabbed,grabbed mouse_selection extend - -#: Show clicked command output in pager - -# mouse_map ctrl+shift+right press ungrabbed mouse_show_command_output - -#:: Requires shell integration -#:: to work. - -#: }}} - -#: }}} - -#: Performance tuning {{{ - -# repaint_delay 10 - -#: Delay between screen updates (in milliseconds). Decreasing it, -#: increases frames-per-second (FPS) at the cost of more CPU usage. -#: The default value yields ~100 FPS which is more than sufficient for -#: most uses. Note that to actually achieve 100 FPS, you have to -#: either set sync_to_monitor to no or use a monitor with a high -#: refresh rate. Also, to minimize latency when there is pending input -#: to be processed, this option is ignored. - -# input_delay 3 - -#: Delay before input from the program running in the terminal is -#: processed (in milliseconds). Note that decreasing it will increase -#: responsiveness, but also increase CPU usage and might cause flicker -#: in full screen programs that redraw the entire screen on each loop, -#: because kitty is so fast that partial screen updates will be drawn. -#: This setting is ignored when the input buffer is almost full. - -# sync_to_monitor yes - -#: Sync screen updates to the refresh rate of the monitor. This -#: prevents screen tearing -#: when scrolling. -#: However, it limits the rendering speed to the refresh rate of your -#: monitor. With a very high speed mouse/high keyboard repeat rate, -#: you may notice some slight input latency. If so, set this to no. - -#: }}} - -#: Terminal bell {{{ - -# enable_audio_bell yes - -#: The audio bell. Useful to disable it in environments that require -#: silence. - -# visual_bell_duration 0.0 - -#: The visual bell duration (in seconds). Flash the screen when a bell -#: occurs for the specified number of seconds. Set to zero to disable. - -# visual_bell_color none - -#: The color used by visual bell. Set to none will fall back to -#: selection background color. If you feel that the visual bell is too -#: bright, you can set it to a darker color. - -# window_alert_on_bell yes - -#: Request window attention on bell. Makes the dock icon bounce on -#: macOS or the taskbar flash on Linux. - -# bell_on_tab "🔔 " - -#: Some text or a Unicode symbol to show on the tab if a window in the -#: tab that does not have focus has a bell. If you want to use leading -#: or trailing spaces, surround the text with quotes. See -#: tab_title_template for how this is rendered. - -#: For backwards compatibility, values of yes, y and true are -#: converted to the default bell symbol and no, n, false and none are -#: converted to the empty string. - -# command_on_bell none - -#: Program to run when a bell occurs. The environment variable -#: KITTY_CHILD_CMDLINE can be used to get the program running in the -#: window in which the bell occurred. - -# bell_path none - -#: Path to a sound file to play as the bell sound. If set to none, the -#: system default bell sound is used. Must be in a format supported by -#: the operating systems sound API, such as WAV or OGA on Linux -#: (libcanberra) or AIFF, MP3 or WAV on macOS (NSSound). - -# linux_bell_theme __custom - -#: The XDG Sound Theme kitty will use to play the bell sound. Defaults -#: to the custom theme name used by GNOME and Budgie, falling back to -#: the default freedesktop theme if it does not exist. This option may -#: be removed if Linux ever provides desktop-agnostic support for -#: setting system sound themes. - -#: }}} - -#: Window layout {{{ - -# remember_window_size yes -# initial_window_width 640 -# initial_window_height 400 - -#: If enabled, the OS Window size will be remembered so that new -#: instances of kitty will have the same size as the previous -#: instance. If disabled, the OS Window will initially have size -#: configured by initial_window_width/height, in pixels. You can use a -#: suffix of "c" on the width/height values to have them interpreted -#: as number of cells instead of pixels. - -# enabled_layouts * - -#: The enabled window layouts. A comma separated list of layout names. -#: The special value all means all layouts. The first listed layout -#: will be used as the startup layout. Default configuration is all -#: layouts in alphabetical order. For a list of available layouts, see -#: the layouts . - -# window_resize_step_cells 2 -# window_resize_step_lines 2 - -#: The step size (in units of cell width/cell height) to use when -#: resizing kitty windows in a layout with the shortcut -#: start_resizing_window. The cells value is used for horizontal -#: resizing, and the lines value is used for vertical resizing. - -# window_border_width 0.5pt - -#: The width of window borders. Can be either in pixels (px) or pts -#: (pt). Values in pts will be rounded to the nearest number of pixels -#: based on screen resolution. If not specified, the unit is assumed -#: to be pts. Note that borders are displayed only when more than one -#: window is visible. They are meant to separate multiple windows. - -# draw_minimal_borders yes - -#: Draw only the minimum borders needed. This means that only the -#: borders that separate the window from a neighbor are drawn. Note -#: that setting a non-zero window_margin_width overrides this and -#: causes all borders to be drawn. - -# window_margin_width 0 - -#: The window margin (in pts) (blank area outside the border). A -#: single value sets all four sides. Two values set the vertical and -#: horizontal sides. Three values set top, horizontal and bottom. Four -#: values set top, right, bottom and left. - -# single_window_margin_width -1 - -#: The window margin to use when only a single window is visible (in -#: pts). Negative values will cause the value of window_margin_width -#: to be used instead. A single value sets all four sides. Two values -#: set the vertical and horizontal sides. Three values set top, -#: horizontal and bottom. Four values set top, right, bottom and left. - window_padding_width 10 -#: The window padding (in pts) (blank area between the text and the -#: window border). A single value sets all four sides. Two values set -#: the vertical and horizontal sides. Three values set top, horizontal -#: and bottom. Four values set top, right, bottom and left. - -# single_window_padding_width -1 - -#: The window padding to use when only a single window is visible (in -#: pts). Negative values will cause the value of window_padding_width -#: to be used instead. A single value sets all four sides. Two values -#: set the vertical and horizontal sides. Three values set top, -#: horizontal and bottom. Four values set top, right, bottom and left. - -# placement_strategy center - -#: When the window size is not an exact multiple of the cell size, the -#: cell area of the terminal window will have some extra padding on -#: the sides. You can control how that padding is distributed with -#: this option. Using a value of center means the cell area will be -#: placed centrally. A value of top-left means the padding will be -#: only at the bottom and right edges. - -active_border_color #FF0000 - -#: The color for the border of the active window. Set this to none to -#: not draw borders around the active window. - -# inactive_border_color #cccccc - -#: The color for the border of inactive windows. - -# bell_border_color #ff5a00 - -#: The color for the border of inactive windows in which a bell has -#: occurred. - -# inactive_text_alpha 1.0 - -#: Fade the text in inactive windows by the specified amount (a number -#: between zero and one, with zero being fully faded). - -# hide_window_decorations false - -#: Hide the window decorations (title-bar and window borders) with -#: yes. On macOS, titlebar-only and titlebar-and-corners can be used -#: to only hide the titlebar and the rounded corners. Whether this -#: works and exactly what effect it has depends on the window -#: manager/operating system. Note that the effects of changing this -#: option when reloading config are undefined. When using titlebar- -#: only, it is useful to also set window_margin_width and -#: placement_strategy to prevent the rounded corners from clipping -#: text. Or use titlebar-and-corners. - -# window_logo_path none - -#: Path to a logo image. Must be in PNG format. Relative paths are -#: interpreted relative to the kitty config directory. The logo is -#: displayed in a corner of every kitty window. The position is -#: controlled by window_logo_position. Individual windows can be -#: configured to have different logos either using the launch action -#: or the remote control facility. - -# window_logo_position bottom-right - -#: Where to position the window logo in the window. The value can be -#: one of: top-left, top, top-right, left, center, right, bottom-left, -#: bottom, bottom-right. - -# window_logo_alpha 0.5 - -#: The amount the logo should be faded into the background. With zero -#: being fully faded and one being fully opaque. - -# resize_debounce_time 0.1 0.5 - -#: The time to wait (in seconds) before asking the program running in -#: kitty to resize and redraw the screen during a live resize of the -#: OS window, when no new resize events have been received, i.e. when -#: resizing is either paused or finished. On platforms such as macOS, -#: where the operating system sends events corresponding to the start -#: and end of a live resize, the second number is used for redraw- -#: after-pause since kitty can distinguish between a pause and end of -#: resizing. On such systems the first number is ignored and redraw is -#: immediate after end of resize. On other systems only the first -#: number is used so that kitty is "ready" quickly after the end of -#: resizing, while not also continuously redrawing, to save energy. - -# resize_in_steps no - -#: Resize the OS window in steps as large as the cells, instead of -#: with the usual pixel accuracy. Combined with initial_window_width -#: and initial_window_height in number of cells, this option can be -#: used to keep the margins as small as possible when resizing the OS -#: window. Note that this does not currently work on Wayland. - -# visual_window_select_characters 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ - -#: The list of characters for visual window selection. For example, -#: for selecting a window to focus on with focus_visible_window. The -#: value should be a series of unique numbers or alphabets, case -#: insensitive, from the set 0-9A-Z\-=[];',./\\`. Specify your -#: preference as a string of characters. - -# confirm_os_window_close -1 - -#: Ask for confirmation when closing an OS window or a tab with at -#: least this number of kitty windows in it by window manager (e.g. -#: clicking the window close button or pressing the operating system -#: shortcut to close windows) or by the close_tab action. A value of -#: zero disables confirmation. This confirmation also applies to -#: requests to quit the entire application (all OS windows, via the -#: quit action). Negative values are converted to positive ones, -#: however, with shell_integration enabled, using negative values -#: means windows sitting at a shell prompt are not counted, only -#: windows where some command is currently running. Note that if you -#: want confirmation when closing individual windows, you can map the -#: close_window_with_confirmation action. - -#: }}} - -#: Tab bar {{{ - -# tab_bar_edge bottom - -#: The edge to show the tab bar on, top or bottom. - -# tab_bar_margin_width 0.0 - -#: The margin to the left and right of the tab bar (in pts). - -# tab_bar_margin_height 0.0 0.0 - -#: The margin above and below the tab bar (in pts). The first number -#: is the margin between the edge of the OS Window and the tab bar. -#: The second number is the margin between the tab bar and the -#: contents of the current tab. - -# tab_bar_style fade - -#: The tab bar style, can be one of: - -#: fade -#: Each tab's edges fade into the background color. (See also tab_fade) -#: slant -#: Tabs look like the tabs in a physical file. -#: separator -#: Tabs are separated by a configurable separator. (See also -#: tab_separator) -#: powerline -#: Tabs are shown as a continuous line with "fancy" separators. -#: (See also tab_powerline_style) -#: custom -#: A user-supplied Python function called draw_tab is loaded from the file -#: tab_bar.py in the kitty config directory. For examples of how to -#: write such a function, see the functions named draw_tab_with_* in -#: kitty's source code: kitty/tab_bar.py. See also -#: this discussion -#: for examples from kitty users. -#: hidden -#: The tab bar is hidden. If you use this, you might want to create -#: a mapping for the select_tab action which presents you with a list of -#: tabs and allows for easy switching to a tab. - -# tab_bar_align left - -#: The horizontal alignment of the tab bar, can be one of: left, -#: center, right. - -# tab_bar_min_tabs 2 - -#: The minimum number of tabs that must exist before the tab bar is -#: shown. - -# tab_switch_strategy previous - -#: The algorithm to use when switching to a tab when the current tab -#: is closed. The default of previous will switch to the last used -#: tab. A value of left will switch to the tab to the left of the -#: closed tab. A value of right will switch to the tab to the right of -#: the closed tab. A value of last will switch to the right-most tab. - -# tab_fade 0.25 0.5 0.75 1 - -#: Control how each tab fades into the background when using fade for -#: the tab_bar_style. Each number is an alpha (between zero and one) -#: that controls how much the corresponding cell fades into the -#: background, with zero being no fade and one being full fade. You -#: can change the number of cells used by adding/removing entries to -#: this list. - -# tab_separator " ┇" - -#: The separator between tabs in the tab bar when using separator as -#: the tab_bar_style. - -# tab_powerline_style angled - -#: The powerline separator style between tabs in the tab bar when -#: using powerline as the tab_bar_style, can be one of: angled, -#: slanted, round. - -# tab_activity_symbol none - -#: Some text or a Unicode symbol to show on the tab if a window in the -#: tab that does not have focus has some activity. If you want to use -#: leading or trailing spaces, surround the text with quotes. See -#: tab_title_template for how this is rendered. - -# tab_title_max_length 0 - -#: The maximum number of cells that can be used to render the text in -#: a tab. A value of zero means that no limit is applied. - -# tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}" - -#: A template to render the tab title. The default just renders the -#: title with optional symbols for bell and activity. If you wish to -#: include the tab-index as well, use something like: {index}:{title}. -#: Useful if you have shortcuts mapped for goto_tab N. If you prefer -#: to see the index as a superscript, use {sup.index}. All data -#: available is: - -#: title -#: The current tab title. -#: index -#: The tab index usable with goto_tab N goto_tab shortcuts. -#: layout_name -#: The current layout name. -#: num_windows -#: The number of windows in the tab. -#: num_window_groups -#: The number of window groups (a window group is a window and all of its overlay windows) in the tab. -#: tab.active_wd -#: The working directory of the currently active window in the tab -#: (expensive, requires syscall). Use active_oldest_wd to get -#: the directory of the oldest foreground process rather than the newest. -#: tab.active_exe -#: The name of the executable running in the foreground of the currently -#: active window in the tab (expensive, requires syscall). Use -#: active_oldest_exe for the oldest foreground process. -#: max_title_length -#: The maximum title length available. -#: keyboard_mode -#: The name of the current keyboard mode or the empty string if no keyboard mode is active. - -#: Note that formatting is done by Python's string formatting -#: machinery, so you can use, for instance, {layout_name[:2].upper()} -#: to show only the first two letters of the layout name, upper-cased. -#: If you want to style the text, you can use styling directives, for -#: example: -#: `{fmt.fg.red}red{fmt.fg.tab}normal{fmt.bg._00FF00}greenbg{fmt.bg.tab}`. -#: Similarly, for bold and italic: -#: `{fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}`. -#: Note that for backward compatibility, if {bell_symbol} or -#: {activity_symbol} are not present in the template, they are -#: prepended to it. - -# active_tab_title_template none - -#: Template to use for active tabs. If not specified falls back to -#: tab_title_template. - -# active_tab_foreground #000 -# active_tab_background #eee -# active_tab_font_style bold-italic -# inactive_tab_foreground #444 -# inactive_tab_background #999 -# inactive_tab_font_style normal - -#: Tab bar colors and styles. - -# tab_bar_background none - -#: Background color for the tab bar. Defaults to using the terminal -#: background color. - -# tab_bar_margin_color none - -#: Color for the tab bar margin area. Defaults to using the terminal -#: background color for margins above and below the tab bar. For side -#: margins the default color is chosen to match the background color -#: of the neighboring tab. - -#: }}} - -#: Color scheme {{{ - -# foreground #dddddd -# background #000000 - -#: The foreground and background colors. - -# background_opacity 1.0 - -#: The opacity of the background. A number between zero and one, where -#: one is opaque and zero is fully transparent. This will only work if -#: supported by the OS (for instance, when using a compositor under -#: X11). Note that it only sets the background color's opacity in -#: cells that have the same background color as the default terminal -#: background, so that things like the status bar in vim, powerline -#: prompts, etc. still look good. But it means that if you use a color -#: theme with a background color in your editor, it will not be -#: rendered as transparent. Instead you should change the default -#: background color in your kitty config and not use a background -#: color in the editor color scheme. Or use the escape codes to set -#: the terminals default colors in a shell script to launch your -#: editor. Be aware that using a value less than 1.0 is a (possibly -#: significant) performance hit. When using a low value for this -#: setting, it is desirable that you set the background color to a -#: color the matches the general color of the desktop background, for -#: best text rendering. If you want to dynamically change -#: transparency of windows, set dynamic_background_opacity to yes -#: (this is off by default as it has a performance cost). Changing -#: this option when reloading the config will only work if -#: dynamic_background_opacity was enabled in the original config. - -# background_blur 0 - -#: Set to a positive value to enable background blur (blurring of the -#: visuals behind a transparent window) on platforms that support it. -#: Only takes effect when background_opacity is less than one. On -#: macOS, this will also control the blur radius (amount of blurring). -#: Setting it to too high a value will cause severe performance issues -#: and/or rendering artifacts. Usually, values up to 64 work well. -#: Note that this might cause performance issues, depending on how the -#: platform implements it, so use with care. Currently supported on -#: macOS and KDE. - -# background_image none - -#: Path to a background image. Must be in PNG format. - -# background_image_layout tiled - -#: Whether to tile, scale or clamp the background image. The value can -#: be one of tiled, mirror-tiled, scaled, clamped, centered or -#: cscaled. The scaled and cscaled values scale the image to the -#: window size, with cscaled preserving the image aspect ratio. - -# background_image_linear no - -#: When background image is scaled, whether linear interpolation -#: should be used. - -# dynamic_background_opacity no - -#: Allow changing of the background_opacity dynamically, using either -#: keyboard shortcuts (increase_background_opacity and -#: decrease_background_opacity) or the remote control facility. -#: Changing this option by reloading the config is not supported. - -# background_tint 0.0 - -#: How much to tint the background image by the background color. This -#: option makes it easier to read the text. Tinting is done using the -#: current background color for each window. This option applies only -#: if background_opacity is set and transparent windows are supported -#: or background_image is set. - -# background_tint_gaps 1.0 - -#: How much to tint the background image at the window gaps by the -#: background color, after applying background_tint. Since this is -#: multiplicative with background_tint, it can be used to lighten the -#: tint over the window gaps for a *separated* look. - -# dim_opacity 0.4 - -#: How much to dim text that has the DIM/FAINT attribute set. One -#: means no dimming and zero means fully dimmed (i.e. invisible). - -# selection_foreground #000000 -# selection_background #fffacd - -#: The foreground and background colors for text selected with the -#: mouse. Setting both of these to none will cause a "reverse video" -#: effect for selections, where the selection will be the cell text -#: color and the text will become the cell background color. Setting -#: only selection_foreground to none will cause the foreground color -#: to be used unchanged. Note that these colors can be overridden by -#: the program running in the terminal. - -#: The color table {{{ - -#: The 256 terminal colors. There are 8 basic colors, each color has a -#: dull and bright version, for the first 16 colors. You can set the -#: remaining 240 colors as color16 to color255. - -# color0 #000000 -# color8 #767676 - -#: black - -# color1 #cc0403 -# color9 #f2201f - -#: red - -# color2 #19cb00 -# color10 #23fd00 - -#: green - -# color3 #cecb00 -# color11 #fffd00 - -#: yellow - -# color4 #0d73cc -# color12 #1a8fff - -#: blue - -# color5 #cb1ed1 -# color13 #fd28ff - -#: magenta - -# color6 #0dcdcd -# color14 #14ffff - -#: cyan - -# color7 #dddddd -# color15 #ffffff - -#: white - -# mark1_foreground black - -#: Color for marks of type 1 - -# mark1_background #98d3cb - -#: Color for marks of type 1 (light steel blue) - -# mark2_foreground black - -#: Color for marks of type 2 - -# mark2_background #f2dcd3 - -#: Color for marks of type 1 (beige) - -# mark3_foreground black - -#: Color for marks of type 3 - -# mark3_background #f274bc - -#: Color for marks of type 3 (violet) - -#: }}} - -#: }}} - -#: Advanced {{{ - -# shell . - -#: The shell program to execute. The default value of . means to use -#: whatever shell is set as the default shell for the current user. -#: Note that on macOS if you change this, you might need to add -#: --login and --interactive to ensure that the shell starts in -#: interactive mode and reads its startup rc files. Environment -#: variables are expanded in this setting. - -# editor . - -#: The terminal based text editor (such as vim or nano) to use when -#: editing the kitty config file or similar tasks. - -#: The default value of . means to use the environment variables -#: VISUAL and EDITOR in that order. If these variables aren't set, -#: kitty will run your shell ($SHELL -l -i -c env) to see if your -#: shell startup rc files set VISUAL or EDITOR. If that doesn't work, -#: kitty will cycle through various known editors (vim, emacs, etc.) -#: and take the first one that exists on your system. - -# close_on_child_death no - -#: Close the window when the child process (shell) exits. With the -#: default value no, the terminal will remain open when the child -#: exits as long as there are still processes outputting to the -#: terminal (for example disowned or backgrounded processes). When -#: enabled with yes, the window will close as soon as the child -#: process exits. Note that setting it to yes means that any -#: background processes still using the terminal can fail silently -#: because their stdout/stderr/stdin no longer work. - -# remote_control_password - -#: Allow other programs to control kitty using passwords. This option -#: can be specified multiple times to add multiple passwords. If no -#: passwords are present kitty will ask the user for permission if a -#: program tries to use remote control with a password. A password can -#: also *optionally* be associated with a set of allowed remote -#: control actions. For example:: - -#: remote_control_password "my passphrase" get-colors set-colors focus-window focus-tab - -#: Only the specified actions will be allowed when using this -#: password. Glob patterns can be used too, for example:: - -#: remote_control_password "my passphrase" set-tab-* resize-* - -#: To get a list of available actions, run:: - -#: kitten @ --help - -#: A set of actions to be allowed when no password is sent can be -#: specified by using an empty password. For example:: - -#: remote_control_password "" *-colors - -#: Finally, the path to a python module can be specified that provides -#: a function is_cmd_allowed that is used to check every remote -#: control command. For example:: - -#: remote_control_password "my passphrase" my_rc_command_checker.py - -#: Relative paths are resolved from the kitty configuration directory. -#: See rc_custom_auth for details. - -# allow_remote_control no - -#: Allow other programs to control kitty. If you turn this on, other -#: programs can control all aspects of kitty, including sending text -#: to kitty windows, opening new windows, closing windows, reading the -#: content of windows, etc. Note that this even works over SSH -#: connections. The default setting of no prevents any form of remote -#: control. The meaning of the various values are: - -#: password -#: Remote control requests received over both the TTY device and the socket -#: are confirmed based on passwords, see remote_control_password. - -#: socket-only -#: Remote control requests received over a socket are accepted -#: unconditionally. Requests received over the TTY are denied. -#: See listen_on. - -#: socket -#: Remote control requests received over a socket are accepted -#: unconditionally. Requests received over the TTY are confirmed based on -#: password. - -#: no -#: Remote control is completely disabled. - -#: yes -#: Remote control requests are always accepted. - -# listen_on none - -#: Listen to the specified socket for remote control connections. Note -#: that this will apply to all kitty instances. It can be overridden -#: by the kitty --listen-on command line option. For UNIX sockets, -#: such as unix:${TEMP}/mykitty or unix:@mykitty (on Linux). -#: Environment variables are expanded and relative paths are resolved -#: with respect to the temporary directory. If {kitty_pid} is present, -#: then it is replaced by the PID of the kitty process, otherwise the -#: PID of the kitty process is appended to the value, with a hyphen. -#: For TCP sockets such as tcp:localhost:0 a random port is always -#: used even if a non-zero port number is specified. See the help for -#: kitty --listen-on for more details. Note that this will be ignored -#: unless allow_remote_control is set to either: yes, socket or -#: socket-only. Changing this option by reloading the config is not -#: supported. - -# env - -#: Specify the environment variables to be set in all child processes. -#: Using the name with an equal sign (e.g. env VAR=) will set it to -#: the empty string. Specifying only the name (e.g. env VAR) will -#: remove the variable from the child process' environment. Note that -#: environment variables are expanded recursively, for example:: - -#: env VAR1=a -#: env VAR2=${HOME}/${VAR1}/b - -#: The value of VAR2 will be /a/b. - -# watcher - -#: Path to python file which will be loaded for watchers -#: . Can be -#: specified more than once to load multiple watchers. The watchers -#: will be added to every kitty window. Relative paths are resolved -#: relative to the kitty config directory. Note that reloading the -#: config will only affect windows created after the reload. - -# exe_search_path - -#: Control where kitty finds the programs to run. The default search -#: order is: First search the system wide PATH, then ~/.local/bin and -#: ~/bin. If still not found, the PATH defined in the login shell -#: after sourcing all its startup files is tried. Finally, if present, -#: the PATH specified by the env option is tried. - -#: This option allows you to prepend, append, or remove paths from -#: this search order. It can be specified multiple times for multiple -#: paths. A simple path will be prepended to the search order. A path -#: that starts with the + sign will be append to the search order, -#: after ~/bin above. A path that starts with the - sign will be -#: removed from the entire search order. For example:: - -#: exe_search_path /some/prepended/path -#: exe_search_path +/some/appended/path -#: exe_search_path -/some/excluded/path - -# update_check_interval 24 - -#: The interval to periodically check if an update to kitty is -#: available (in hours). If an update is found, a system notification -#: is displayed informing you of the available update. The default is -#: to check every 24 hours, set to zero to disable. Update checking is -#: only done by the official binary builds. Distro packages or source -#: builds do not do update checking. Changing this option by reloading -#: the config is not supported. - -# startup_session none - -#: Path to a session file to use for all kitty instances. Can be -#: overridden by using the kitty --session =none command line option -#: for individual instances. See sessions -#: in the kitty -#: documentation for details. Note that relative paths are interpreted -#: with respect to the kitty config directory. Environment variables -#: in the path are expanded. Changing this option by reloading the -#: config is not supported. Note that if kitty is invoked with command -#: line arguments specifying a command to run, this option is ignored. - -# clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask - -#: Allow programs running in kitty to read and write from the -#: clipboard. You can control exactly which actions are allowed. The -#: possible actions are: write-clipboard, read-clipboard, write- -#: primary, read-primary, read-clipboard-ask, read-primary-ask. The -#: default is to allow writing to the clipboard and primary selection -#: and to ask for permission when a program tries to read from the -#: clipboard. Note that disabling the read confirmation is a security -#: risk as it means that any program, even the ones running on a -#: remote server via SSH can read your clipboard. See also -#: clipboard_max_size. - -# clipboard_max_size 512 - -#: The maximum size (in MB) of data from programs running in kitty -#: that will be stored for writing to the system clipboard. A value of -#: zero means no size limit is applied. See also clipboard_control. - -# file_transfer_confirmation_bypass - -#: The password that can be supplied to the file transfer kitten -#: to skip the -#: transfer confirmation prompt. This should only be used when -#: initiating transfers from trusted computers, over trusted networks -#: or encrypted transports, as it allows any programs running on the -#: remote machine to read/write to the local filesystem, without -#: permission. - -# allow_hyperlinks yes - -#: Process hyperlink escape sequences (OSC 8). If disabled OSC 8 -#: escape sequences are ignored. Otherwise they become clickable -#: links, that you can click with the mouse or by using the hints -#: kitten . The -#: special value of ask means that kitty will ask before opening the -#: link when clicked. - -# shell_integration enabled - -#: Enable shell integration on supported shells. This enables features -#: such as jumping to previous prompts, browsing the output of the -#: previous command in a pager, etc. on supported shells. Set to -#: disabled to turn off shell integration, completely. It is also -#: possible to disable individual features, set to a space separated -#: list of these values: no-rc, no-cursor, no-title, no-cwd, no- -#: prompt-mark, no-complete, no-sudo. See Shell integration -#: for details. - -# allow_cloning ask - -#: Control whether programs running in the terminal can request new -#: windows to be created. The canonical example is clone-in-kitty -#: . -#: By default, kitty will ask for permission for each clone request. -#: Allowing cloning unconditionally gives programs running in the -#: terminal (including over SSH) permission to execute arbitrary code, -#: as the user who is running the terminal, on the computer that the -#: terminal is running on. - -# clone_source_strategies venv,conda,env_var,path - -#: Control what shell code is sourced when running clone-in-kitty in -#: the newly cloned window. The supported strategies are: - -#: venv -#: Source the file $VIRTUAL_ENV/bin/activate. This is used by the -#: Python stdlib venv module and allows cloning venvs automatically. -#: conda -#: Run conda activate $CONDA_DEFAULT_ENV. This supports the virtual -#: environments created by conda. -#: env_var -#: Execute the contents of the environment variable -#: KITTY_CLONE_SOURCE_CODE with eval. -#: path -#: Source the file pointed to by the environment variable -#: KITTY_CLONE_SOURCE_PATH. - -#: This option must be a comma separated list of the above values. -#: Only the first valid match, in the order specified, is sourced. - -# notify_on_cmd_finish never - -#: Show a desktop notification when a long-running command finishes -#: (needs shell_integration). The possible values are: - -#: never -#: Never send a notification. - -#: unfocused -#: Only send a notification when the window does not have keyboard focus. - -#: invisible -#: Only send a notification when the window both is unfocused and not visible -#: to the user, for example, because it is in an inactive tab or its OS window -#: is not currently active. - -#: always -#: Always send a notification, regardless of window state. - -#: There are two optional arguments: - -#: First, the minimum duration for what is considered a long running -#: command. The default is 5 seconds. Specify a second argument to set -#: the duration. For example: invisible 15. Do not set the value too -#: small, otherwise a command that launches a new OS Window and exits -#: will spam a notification. - -#: Second, the action to perform. The default is notify. The possible -#: values are: - -#: notify -#: Send a desktop notification. - -#: bell -#: Ring the terminal bell. - -#: command -#: Run a custom command. All subsequent arguments are the cmdline to run. - -#: Some more examples:: - -#: # Send a notification when a command takes more than 5 seconds in an unfocused window -#: notify_on_cmd_finish unfocused -#: # Send a notification when a command takes more than 10 seconds in a invisible window -#: notify_on_cmd_finish invisible 10.0 -#: # Ring a bell when a command takes more than 10 seconds in a invisible window -#: notify_on_cmd_finish invisible 10.0 bell -#: # Run 'notify-send' when a command takes more than 10 seconds in a invisible window -#: notify_on_cmd_finish invisible 10.0 command notify-send job finished - -# term xterm-kitty - -#: The value of the TERM environment variable to set. Changing this -#: can break many terminal programs, only change it if you know what -#: you are doing, not because you read some advice on "Stack Overflow" -#: to change it. The TERM variable is used by various programs to get -#: information about the capabilities and behavior of the terminal. If -#: you change it, depending on what programs you run, and how -#: different the terminal you are changing it to is, various things -#: from key-presses, to colors, to various advanced features may not -#: work. Changing this option by reloading the config will only affect -#: newly created windows. - -# terminfo_type path - -#: The value of the TERMINFO environment variable to set. This -#: variable is used by programs running in the terminal to search for -#: terminfo databases. The default value of path causes kitty to set -#: it to a filesystem location containing the kitty terminfo database. -#: A value of direct means put the entire database into the env var -#: directly. This can be useful when connecting to containers, for -#: example. But, note that not all software supports this. A value of -#: none means do not touch the variable. - -# forward_stdio no - -#: Forward STDOUT and STDERR of the kitty process to child processes -#: as file descriptors 3 and 4. This is useful for debugging as it -#: allows child processes to print to kitty's STDOUT directly. For -#: example, echo hello world >&3 in a shell will print to the parent -#: kitty's STDOUT. When enabled, this also sets the -#: KITTY_STDIO_FORWARDED=3 environment variable so child processes -#: know about the forwarding. - -# menu_map - -#: Specify entries for various menus in kitty. Currently only the -#: global menubar on macOS is supported. For example:: - -#: menu_map global "Actions::Launch something special" launch --hold --type=os-window sh -c "echo hello world" - -#: This will create a menu entry named "Launch something special" in -#: an "Actions" menu in the macOS global menubar. Sub-menus can be -#: created by adding more levels separated by the :: characters. - -#: }}} - -#: OS specific tweaks {{{ - -# wayland_titlebar_color system - -#: The color of the kitty window's titlebar on Wayland systems with -#: client side window decorations such as GNOME. A value of system -#: means to use the default system colors, a value of background means -#: to use the background color of the currently active kitty window -#: and finally you can use an arbitrary color, such as #12af59 or red. - -# macos_titlebar_color system - -#: The color of the kitty window's titlebar on macOS. A value of -#: system means to use the default system color, light or dark can -#: also be used to set it explicitly. A value of background means to -#: use the background color of the currently active window and finally -#: you can use an arbitrary color, such as #12af59 or red. WARNING: -#: This option works by using a hack when arbitrary color (or -#: background) is configured, as there is no proper Cocoa API for it. -#: It sets the background color of the entire window and makes the -#: titlebar transparent. As such it is incompatible with -#: background_opacity. If you want to use both, you are probably -#: better off just hiding the titlebar with hide_window_decorations. - -# macos_option_as_alt no - -#: Use the Option key as an Alt key on macOS. With this set to no, -#: kitty will use the macOS native Option+Key to enter Unicode -#: character behavior. This will break any Alt+Key keyboard shortcuts -#: in your terminal programs, but you can use the macOS Unicode input -#: technique. You can use the values: left, right or both to use only -#: the left, right or both Option keys as Alt, instead. Note that -#: kitty itself always treats Option the same as Alt. This means you -#: cannot use this option to configure different kitty shortcuts for -#: Option+Key vs. Alt+Key. Also, any kitty shortcuts using -#: Option/Alt+Key will take priority, so that any such key presses -#: will not be passed to terminal programs running inside kitty. -#: Changing this option by reloading the config is not supported. - -# macos_hide_from_tasks no - -#: Hide the kitty window from running tasks on macOS (⌘+Tab and the -#: Dock). Changing this option by reloading the config is not -#: supported. - -# macos_quit_when_last_window_closed no - -#: Have kitty quit when all the top-level windows are closed on macOS. -#: By default, kitty will stay running, even with no open windows, as -#: is the expected behavior on macOS. - -# macos_window_resizable yes - -#: Disable this if you want kitty top-level OS windows to not be -#: resizable on macOS. - -# macos_thicken_font 0 - -#: Draw an extra border around the font with the given width, to -#: increase legibility at small font sizes on macOS. For example, a -#: value of 0.75 will result in rendering that looks similar to sub- -#: pixel antialiasing at common font sizes. Note that in modern kitty, -#: this option is obsolete (although still supported). Consider using -#: text_composition_strategy instead. - -# macos_traditional_fullscreen no - -#: Use the macOS traditional full-screen transition, that is faster, -#: but less pretty. - -# macos_show_window_title_in all - -#: Control where the window title is displayed on macOS. A value of -#: window will show the title of the currently active window at the -#: top of the macOS window. A value of menubar will show the title of -#: the currently active window in the macOS global menu bar, making -#: use of otherwise wasted space. A value of all will show the title -#: in both places, and none hides the title. See -#: macos_menubar_title_max_length for how to control the length of the -#: title in the menu bar. - -# macos_menubar_title_max_length 0 - -#: The maximum number of characters from the window title to show in -#: the macOS global menu bar. Values less than one means that there is -#: no maximum limit. - -# macos_custom_beam_cursor no - -#: Use a custom mouse cursor for macOS that is easier to see on both -#: light and dark backgrounds. Nowadays, the default macOS cursor -#: already comes with a white border. WARNING: this might make your -#: mouse cursor invisible on dual GPU machines. Changing this option -#: by reloading the config is not supported. - -# macos_colorspace srgb - -#: The colorspace in which to interpret terminal colors. The default -#: of srgb will cause colors to match those seen in web browsers. The -#: value of default will use whatever the native colorspace of the -#: display is. The value of displayp3 will use Apple's special -#: snowflake display P3 color space, which will result in over -#: saturated (brighter) colors with some color shift. Reloading -#: configuration will change this value only for newly created OS -#: windows. - -# linux_display_server auto - -#: Choose between Wayland and X11 backends. By default, an appropriate -#: backend based on the system state is chosen automatically. Set it -#: to x11 or wayland to force the choice. Changing this option by -#: reloading the config is not supported. - -# wayland_enable_ime yes - -#: Enable Input Method Extension on Wayland. This is typically used -#: for inputting text in East Asian languages. However, its -#: implementation in Wayland is often buggy and introduces latency -#: into the input loop, so disable this if you know you dont need it. -#: Changing this option by reloading the config is not supported, it -#: will not have any effect. - -#: }}} - -#: Keyboard shortcuts {{{ - -#: Keys are identified simply by their lowercase Unicode characters. -#: For example: a for the A key, [ for the left square bracket key, -#: etc. For functional keys, such as Enter or Escape, the names are -#: present at Functional key definitions -#: . -#: For modifier keys, the names are ctrl (control, ⌃), shift (⇧), alt -#: (opt, option, ⌥), super (cmd, command, ⌘). - -#: Simple shortcut mapping is done with the map directive. For full -#: details on advanced mapping including modal and per application -#: maps, see mapping . Some -#: quick examples to illustrate common tasks:: - -#: # unmap a keyboard shortcut, passing it to the program running in kitty -#: map kitty_mod+space -#: # completely ignore a keyboard event -#: map ctrl+alt+f1 discard_event -#: # combine multiple actions -#: map kitty_mod+e combine : new_window : next_layout -#: # multi-key shortcuts -#: map ctrl+x>ctrl+y>z action - -#: The full list of actions that can be mapped to key presses is -#: available here . - -# kitty_mod ctrl+shift - -#: Special modifier key alias for default shortcuts. You can change -#: the value of this option to alter all default shortcuts that use -#: kitty_mod. - -# clear_all_shortcuts no - -#: Remove all shortcut definitions up to this point. Useful, for -#: instance, to remove the default shortcuts. - -# action_alias - -#: E.g. action_alias launch_tab launch --type=tab --cwd=current - -#: Define action aliases to avoid repeating the same options in -#: multiple mappings. Aliases can be defined for any action and will -#: be expanded recursively. For example, the above alias allows you to -#: create mappings to launch a new tab in the current working -#: directory without duplication:: - -#: map f1 launch_tab vim -#: map f2 launch_tab emacs - -#: Similarly, to alias kitten invocation:: - -#: action_alias hints kitten hints --hints-offset=0 - -# kitten_alias - -#: E.g. kitten_alias hints hints --hints-offset=0 - -#: Like action_alias above, but specifically for kittens. Generally, -#: prefer to use action_alias. This option is a legacy version, -#: present for backwards compatibility. It causes all invocations of -#: the aliased kitten to be substituted. So the example above will -#: cause all invocations of the hints kitten to have the --hints- -#: offset=0 option applied. - -#: Clipboard {{{ - -#: Copy to clipboard - -# map kitty_mod+c copy_to_clipboard -# map cmd+c copy_to_clipboard - -#:: There is also a copy_or_interrupt action that can be optionally -#:: mapped to Ctrl+C. It will copy only if there is a selection and -#:: send an interrupt otherwise. Similarly, -#:: copy_and_clear_or_interrupt will copy and clear the selection or -#:: send an interrupt if there is no selection. - -#: Paste from clipboard - -# map kitty_mod+v paste_from_clipboard -# map cmd+v paste_from_clipboard - -#: Paste from selection - -# map kitty_mod+s paste_from_selection -# map shift+insert paste_from_selection - -#: Pass selection to program - -# map kitty_mod+o pass_selection_to_program - -#:: You can also pass the contents of the current selection to any -#:: program with pass_selection_to_program. By default, the system's -#:: open program is used, but you can specify your own, the selection -#:: will be passed as a command line argument to the program. For -#:: example:: - -#:: map kitty_mod+o pass_selection_to_program firefox - -#:: You can pass the current selection to a terminal program running -#:: in a new kitty window, by using the @selection placeholder:: - -#:: map kitty_mod+y new_window less @selection - -#: }}} - -#: Scrolling {{{ - -#: Scroll line up - -# map kitty_mod+up scroll_line_up -# map kitty_mod+k scroll_line_up -# map opt+cmd+page_up scroll_line_up -# map cmd+up scroll_line_up - -#: Scroll line down - -# map kitty_mod+down scroll_line_down -# map kitty_mod+j scroll_line_down -# map opt+cmd+page_down scroll_line_down -# map cmd+down scroll_line_down - -#: Scroll page up - -# map kitty_mod+page_up scroll_page_up -# map cmd+page_up scroll_page_up - -#: Scroll page down - -# map kitty_mod+page_down scroll_page_down -# map cmd+page_down scroll_page_down - -#: Scroll to top - -# map kitty_mod+home scroll_home -# map cmd+home scroll_home - -#: Scroll to bottom - -# map kitty_mod+end scroll_end -# map cmd+end scroll_end - -#: Scroll to previous shell prompt - -# map kitty_mod+z scroll_to_prompt -1 - -#:: Use a parameter of 0 for scroll_to_prompt to scroll to the last -#:: jumped to or the last clicked position. Requires shell -#:: integration -#:: to work. - -#: Scroll to next shell prompt - -# map kitty_mod+x scroll_to_prompt 1 - -#: Browse scrollback buffer in pager - -# map kitty_mod+h show_scrollback - -#:: You can pipe the contents of the current screen and history -#:: buffer as STDIN to an arbitrary program using launch --stdin- -#:: source. For example, the following opens the scrollback buffer in -#:: less in an overlay window:: - -#:: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R - -#:: For more details on piping screen and buffer contents to external -#:: programs, see launch . - -#: Browse output of the last shell command in pager - -# map kitty_mod+g show_last_command_output - -#:: You can also define additional shortcuts to get the command -#:: output. For example, to get the first command output on screen:: - -#:: map f1 show_first_command_output_on_screen - -#:: To get the command output that was last accessed by a keyboard -#:: action or mouse action:: - -#:: map f1 show_last_visited_command_output - -#:: You can pipe the output of the last command run in the shell -#:: using the launch action. For example, the following opens the -#:: output in less in an overlay window:: - -#:: map f1 launch --stdin-source=@last_cmd_output --stdin-add-formatting --type=overlay less +G -R - -#:: To get the output of the first command on the screen, use -#:: @first_cmd_output_on_screen. To get the output of the last jumped -#:: to command, use @last_visited_cmd_output. - -#:: Requires shell integration -#:: to work. - -#: }}} - -#: Window management {{{ - -#: New window - -# map kitty_mod+enter new_window -# map cmd+enter new_window - -#:: You can open a new kitty window running an arbitrary program, for -#:: example:: - -#:: map kitty_mod+y launch mutt - -#:: You can open a new window with the current working directory set -#:: to the working directory of the current window using:: - -#:: map ctrl+alt+enter launch --cwd=current - -#:: You can open a new window that is allowed to control kitty via -#:: the kitty remote control facility with launch --allow-remote- -#:: control. Any programs running in that window will be allowed to -#:: control kitty. For example:: - -#:: map ctrl+enter launch --allow-remote-control some_program - -#:: You can open a new window next to the currently active window or -#:: as the first window, with:: - -#:: map ctrl+n launch --location=neighbor -#:: map ctrl+f launch --location=first - -#:: For more details, see launch -#:: . - -#: New OS window - -# map kitty_mod+n new_os_window -# map cmd+n new_os_window - -#:: Works like new_window above, except that it opens a top-level OS -#:: window. In particular you can use new_os_window_with_cwd to open -#:: a window with the current working directory. - -#: Close window - -# map kitty_mod+w close_window -# map shift+cmd+d close_window - -#: Next window - -# map kitty_mod+] next_window - -#: Previous window - -# map kitty_mod+[ previous_window - -#: Move window forward - -# map kitty_mod+f move_window_forward - -#: Move window backward - -# map kitty_mod+b move_window_backward - -#: Move window to top - -# map kitty_mod+` move_window_to_top - -#: Start resizing window - -# map kitty_mod+r start_resizing_window -# map cmd+r start_resizing_window - -#: First window - -# map kitty_mod+1 first_window -# map cmd+1 first_window - -#: Second window - -# map kitty_mod+2 second_window -# map cmd+2 second_window - -#: Third window - -# map kitty_mod+3 third_window -# map cmd+3 third_window - -#: Fourth window - -# map kitty_mod+4 fourth_window -# map cmd+4 fourth_window - -#: Fifth window - -# map kitty_mod+5 fifth_window -# map cmd+5 fifth_window - -#: Sixth window - -# map kitty_mod+6 sixth_window -# map cmd+6 sixth_window - -#: Seventh window - -# map kitty_mod+7 seventh_window -# map cmd+7 seventh_window - -#: Eighth window - -# map kitty_mod+8 eighth_window -# map cmd+8 eighth_window - -#: Ninth window - -# map kitty_mod+9 ninth_window -# map cmd+9 ninth_window - -#: Tenth window - -# map kitty_mod+0 tenth_window - -#: Visually select and focus window - -# map kitty_mod+f7 focus_visible_window - -#:: Display overlay numbers and alphabets on the window, and switch -#:: the focus to the window when you press the key. When there are -#:: only two windows, the focus will be switched directly without -#:: displaying the overlay. You can change the overlay characters and -#:: their order with option visual_window_select_characters. - -#: Visually swap window with another - -# map kitty_mod+f8 swap_with_window - -#:: Works like focus_visible_window above, but swaps the window. - -#: }}} - -#: Tab management {{{ - -#: Next tab - -# map kitty_mod+right next_tab -# map shift+cmd+] next_tab -# map ctrl+tab next_tab - -#: Previous tab - -# map kitty_mod+left previous_tab -# map shift+cmd+[ previous_tab -# map ctrl+shift+tab previous_tab - -#: New tab - -# map kitty_mod+t new_tab -# map cmd+t new_tab - -#: Close tab - -# map kitty_mod+q close_tab -# map cmd+w close_tab - -#: Close OS window - -# map shift+cmd+w close_os_window - -#: Move tab forward - -# map kitty_mod+. move_tab_forward - -#: Move tab backward - -# map kitty_mod+, move_tab_backward - -#: Set tab title - -# map kitty_mod+alt+t set_tab_title -# map shift+cmd+i set_tab_title - - -#: You can also create shortcuts to go to specific tabs, with 1 being -#: the first tab, 2 the second tab and -1 being the previously active -#: tab, and any number larger than the last tab being the last tab:: - -#: map ctrl+alt+1 goto_tab 1 -#: map ctrl+alt+2 goto_tab 2 - -#: Just as with new_window above, you can also pass the name of -#: arbitrary commands to run when using new_tab and new_tab_with_cwd. -#: Finally, if you want the new tab to open next to the current tab -#: rather than at the end of the tabs list, use:: - -#: map ctrl+t new_tab !neighbor [optional cmd to run] -#: }}} - -#: Layout management {{{ - -#: Next layout - -# map kitty_mod+l next_layout - - -#: You can also create shortcuts to switch to specific layouts:: - -#: map ctrl+alt+t goto_layout tall -#: map ctrl+alt+s goto_layout stack - -#: Similarly, to switch back to the previous layout:: - -#: map ctrl+alt+p last_used_layout - -#: There is also a toggle_layout action that switches to the named -#: layout or back to the previous layout if in the named layout. -#: Useful to temporarily "zoom" the active window by switching to the -#: stack layout:: - -#: map ctrl+alt+z toggle_layout stack -#: }}} - -#: Font sizes {{{ - -#: You can change the font size for all top-level kitty OS windows at -#: a time or only the current one. - -#: Increase font size - -# map kitty_mod+equal change_font_size all +2.0 -# map kitty_mod+plus change_font_size all +2.0 -# map kitty_mod+kp_add change_font_size all +2.0 -# map cmd+plus change_font_size all +2.0 -# map cmd+equal change_font_size all +2.0 -# map shift+cmd+equal change_font_size all +2.0 - -#: Decrease font size - -# map kitty_mod+minus change_font_size all -2.0 -# map kitty_mod+kp_subtract change_font_size all -2.0 -# map cmd+minus change_font_size all -2.0 -# map shift+cmd+minus change_font_size all -2.0 - -#: Reset font size - -# map kitty_mod+backspace change_font_size all 0 -# map cmd+0 change_font_size all 0 - - -#: To setup shortcuts for specific font sizes:: - -#: map kitty_mod+f6 change_font_size all 10.0 - -#: To setup shortcuts to change only the current OS window's font -#: size:: - -#: map kitty_mod+f6 change_font_size current 10.0 -#: }}} - -#: Select and act on visible text {{{ - -#: Use the hints kitten to select text and either pass it to an -#: external program or insert it into the terminal or copy it to the -#: clipboard. - -#: Open URL - -# map kitty_mod+e open_url_with_hints - -#:: Open a currently visible URL using the keyboard. The program used -#:: to open the URL is specified in open_url_with. - -#: Insert selected path - -# map kitty_mod+p>f kitten hints --type path --program - - -#:: Select a path/filename and insert it into the terminal. Useful, -#:: for instance to run git commands on a filename output from a -#:: previous git command. - -#: Open selected path - -# map kitty_mod+p>shift+f kitten hints --type path - -#:: Select a path/filename and open it with the default open program. - -#: Insert selected line - -# map kitty_mod+p>l kitten hints --type line --program - - -#:: Select a line of text and insert it into the terminal. Useful for -#:: the output of things like: `ls -1`. - -#: Insert selected word - -# map kitty_mod+p>w kitten hints --type word --program - - -#:: Select words and insert into terminal. - -#: Insert selected hash - -# map kitty_mod+p>h kitten hints --type hash --program - - -#:: Select something that looks like a hash and insert it into the -#:: terminal. Useful with git, which uses SHA1 hashes to identify -#:: commits. - -#: Open the selected file at the selected line - -# map kitty_mod+p>n kitten hints --type linenum - -#:: Select something that looks like filename:linenum and open it in -#:: your default editor at the specified line number. - -#: Open the selected hyperlink - -# map kitty_mod+p>y kitten hints --type hyperlink - -#:: Select a hyperlink (i.e. a URL that has been marked as such by -#:: the terminal program, for example, by `ls --hyperlink=auto`). - - -#: The hints kitten has many more modes of operation that you can map -#: to different shortcuts. For a full description see hints kitten -#: . -#: }}} - -#: Miscellaneous {{{ - -#: Show documentation - -# map kitty_mod+f1 show_kitty_doc overview - -#: Toggle fullscreen - -# map kitty_mod+f11 toggle_fullscreen -# map ctrl+cmd+f toggle_fullscreen - -#: Toggle maximized - -# map kitty_mod+f10 toggle_maximized - -#: Toggle macOS secure keyboard entry - -# map opt+cmd+s toggle_macos_secure_keyboard_entry - -#: Unicode input - -# map kitty_mod+u kitten unicode_input -# map ctrl+cmd+space kitten unicode_input - -#: Edit config file - -# map kitty_mod+f2 edit_config_file -# map cmd+, edit_config_file - -#: Open the kitty command shell - -# map kitty_mod+escape kitty_shell window - -#:: Open the kitty shell in a new window / tab / overlay / os_window -#:: to control kitty using commands. - -#: Increase background opacity - -# map kitty_mod+a>m set_background_opacity +0.1 - -#: Decrease background opacity - -# map kitty_mod+a>l set_background_opacity -0.1 - -#: Make background fully opaque - -# map kitty_mod+a>1 set_background_opacity 1 - -#: Reset background opacity - -# map kitty_mod+a>d set_background_opacity default - -#: Reset the terminal - -# map kitty_mod+delete clear_terminal reset active -# map opt+cmd+r clear_terminal reset active - -#:: You can create shortcuts to clear/reset the terminal. For -#:: example:: - -#:: # Reset the terminal -#:: map f1 clear_terminal reset active -#:: # Clear the terminal screen by erasing all contents -#:: map f1 clear_terminal clear active -#:: # Clear the terminal scrollback by erasing it -#:: map f1 clear_terminal scrollback active -#:: # Scroll the contents of the screen into the scrollback -#:: map f1 clear_terminal scroll active -#:: # Clear everything up to the line with the cursor or the start of the current prompt (needs shell integration) -#:: map f1 clear_terminal to_cursor active -#:: # Same as above except cleared lines are moved into scrollback -#:: map f1 clear_terminal to_cursor_scroll active - -#:: If you want to operate on all kitty windows instead of just the -#:: current one, use all instead of active. - -#:: Some useful functions that can be defined in the shell rc files -#:: to perform various kinds of clearing of the current window: - -#:: .. code-block:: sh - -#:: clear-only-screen() { -#:: printf "\e[H\e[2J" -#:: } - -#:: clear-screen-and-scrollback() { -#:: printf "\e[H\e[3J" -#:: } - -#:: clear-screen-saving-contents-in-scrollback() { -#:: printf "\e[H\e[22J" -#:: } - -#:: For instance, using these escape codes, it is possible to remap -#:: Ctrl+L to both scroll the current screen contents into the -#:: scrollback buffer and clear the screen, instead of just clearing -#:: the screen. For ZSH, in ~/.zshrc, add: - -#:: .. code-block:: zsh - -#:: ctrl_l() { -#:: builtin print -rn -- $'\r\e[0J\e[H\e[22J' >"$TTY" -#:: builtin zle .reset-prompt -#:: builtin zle -R -#:: } -#:: zle -N ctrl_l -#:: bindkey '^l' ctrl_l - -#:: Alternatively, you can just add map ctrl+l clear_terminal -#:: to_cursor_scroll active to kitty.conf which works with no changes -#:: to the shell rc files, but only clears up to the prompt, it does -#:: not clear anytext at the prompt itself. - -#: Clear up to cursor line - -# map cmd+k clear_terminal to_cursor active - -#: Reload kitty.conf - -# map kitty_mod+f5 load_config_file -# map ctrl+cmd+, load_config_file - -#:: Reload kitty.conf, applying any changes since the last time it -#:: was loaded. Note that a handful of options cannot be dynamically -#:: changed and require a full restart of kitty. Particularly, when -#:: changing shortcuts for actions located on the macOS global menu -#:: bar, a full restart is needed. You can also map a keybinding to -#:: load a different config file, for example:: - -#:: map f5 load_config /path/to/alternative/kitty.conf - -#:: Note that all options from the original kitty.conf are discarded, -#:: in other words the new configuration *replace* the old ones. - -#: Debug kitty configuration - -# map kitty_mod+f6 debug_config -# map opt+cmd+, debug_config - -#:: Show details about exactly what configuration kitty is running -#:: with and its host environment. Useful for debugging issues. - -#: Send arbitrary text on key presses - -#:: E.g. map ctrl+shift+alt+h send_text all Hello World - -#:: You can tell kitty to send arbitrary (UTF-8) encoded text to the -#:: client program when pressing specified shortcut keys. For -#:: example:: - -#:: map ctrl+alt+a send_text all Special text - -#:: This will send "Special text" when you press the Ctrl+Alt+A key -#:: combination. The text to be sent decodes ANSI C escapes -#:: so you can use escapes like \e to send control -#:: codes or \u21fb to send Unicode characters (or you can just input -#:: the Unicode characters directly as UTF-8 text). You can use -#:: `kitten show_key` to get the key escape codes you want to -#:: emulate. - -#:: The first argument to send_text is the keyboard modes in which to -#:: activate the shortcut. The possible values are normal, -#:: application, kitty or a comma separated combination of them. The -#:: modes normal and application refer to the DECCKM cursor key mode -#:: for terminals, and kitty refers to the kitty extended keyboard -#:: protocol. The special value all means all of them. - -#:: Some more examples:: - -#:: # Output a word and move the cursor to the start of the line (like typing and pressing Home) -#:: map ctrl+alt+a send_text normal Word\e[H -#:: map ctrl+alt+a send_text application Word\eOH -#:: # Run a command at a shell prompt (like typing the command and pressing Enter) -#:: map ctrl+alt+a send_text normal,application some command with arguments\r - -#: Open kitty Website - -# map shift+cmd+/ open_url https://sw.kovidgoyal.net/kitty/ - -#: Hide macOS kitty application - -# map cmd+h hide_macos_app - -#: Hide macOS other applications - -# map opt+cmd+h hide_macos_other_apps - -#: Minimize macOS window - -# map cmd+m minimize_macos_window - -#: Quit kitty - -# map cmd+q quit - -#: }}} - -#: }}} +tab_bar_edge top +tab_bar_style fade From a4bad6daaf79055ec4c47149568a35e9dd0a751a Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 27 Sep 2024 09:43:33 +0200 Subject: [PATCH 172/280] Attempt update nvim lsp config --- .config/nvim/lazy-lock.json | 5 +- .config/nvim/lua/plugins/lsp.lua | 87 ++++++++------------------------ 2 files changed, 22 insertions(+), 70 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 99e50c2..26ad861 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -11,10 +11,8 @@ "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "fittencode.nvim": { "branch": "master", "commit": "47b5bb3287b45c8638430ad8768ab7a3050f16aa" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, @@ -27,7 +25,6 @@ "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, "multiple-cursors.nvim": { "branch": "main", "commit": "2f5e786c43aa9c0fc34b295cfcc9bfbacef8e926" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, "neotest": { "branch": "master", "commit": "48f8b5fce704594eb0ff94338e080defca14f0dc" }, "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, "none-ls.nvim": { "branch": "main", "commit": "9b98991e15dce8fc502993e23caac2528b8b667f" }, @@ -47,7 +44,6 @@ "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "nvim-web-devicons": { "branch": "master", "commit": "26220156aafb198b2de6a4cf80c1b120a3768da0" }, "oil.nvim": { "branch": "master", "commit": "1360be5fda9c67338331abfcd80de2afbb395bcd" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, "plantuml-previewer.vim": { "branch": "master", "commit": "555347700382c97b347bace57b7a9f764ed556b1" }, @@ -58,6 +54,7 @@ "spring-boot.nvim": { "branch": "main", "commit": "218c0c26c14d99feca778e4d13f5ec3e8b1b60f0" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, + "vim-polyglot": { "branch": "master", "commit": "bc8a81d3592dab86334f27d1d43c080ebf680d42" }, "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" } } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index eff4d92..eb7a827 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,41 +1,10 @@ return { - { - "williamboman/mason.nvim", - lazy = false, - keys = { - { "m", "Mason" }, - }, - config = function() - require("mason").setup() - end, - }, - { - "williamboman/mason-lspconfig.nvim", - lazy = false, - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "ruby_lsp" }, - }) - end, - }, { "zbirenbaum/copilot.lua", cmd = "Copilot", event = "InsertEnter", config = function() - require("copilot").setup({}) - end, - }, - { - "zbirenbaum/copilot-cmp", - lazy = false, - event = "InsertEnter", - config = function() - require("copilot_cmp").setup() - require("copilot").setup({ - suggestion = { enabled = false }, - panel = { enabled = false }, - }) + require("copilot").setup() end, }, { @@ -57,51 +26,39 @@ return { }) end, }, + { + "sheerun/vim-polyglot", + lazy = false, + }, { "neovim/nvim-lspconfig", lazy = false, config = function() local capabilities = require("cmp_nvim_lsp").default_capabilities() - local lspconfig = require("lspconfig") + local lspconfig = require('lspconfig') + + local common_options = { + capabilities = capabilities, + } - -- Function to disable LSP for oil buffer - local function disable_lsp_for_oil_buffer(client, bufnr) - local bufname = vim.api.nvim_buf_get_name(bufnr) - if bufname:match("oil://") then - vim.lsp.stop_client(client.id) - end + local function setup_lsp(server_name, options) + options = options or {} + lspconfig[server_name].setup(vim.tbl_extend('force', common_options, options)) end - lspconfig.lua_ls.setup({ - capabilities = capabilities, - on_attach = disable_lsp_for_oil_buffer, - }) - lspconfig.ruby_lsp.setup({ - capabilities = capabilities, - on_attach = disable_lsp_for_oil_buffer, - }) - lspconfig.rubocop.setup({ - capabilities = capabilities, - on_attach = disable_lsp_for_oil_buffer, - }) - lspconfig.ts_ls.setup({ - capabilities = capabilities, - on_attach = disable_lsp_for_oil_buffer, - }) - lspconfig.ltex.setup({ + setup_lsp('lua_ls') + setup_lsp('ruby_lsp') + setup_lsp('rubocop') + setup_lsp('ts_ls') + setup_lsp('ltex', { cmd = { "ltex-ls" }, filetypes = { "markdown", "text", "cff", "tex" }, flags = { debounce_text_changes = 299 }, - on_attach = disable_lsp_for_oil_buffer, - }) - lspconfig.astro.setup({ - on_attach = disable_lsp_for_oil_buffer, - }) - lspconfig.rust_analyzer.setup({ - capabilities = capabilities, - on_attach = disable_lsp_for_oil_buffer, }) + setup_lsp('astro') + setup_lsp('rust_analyzer') + lspconfig.solargraph.setup({ capabilities = capabilities, cmd = { @@ -121,7 +78,6 @@ return { symbols = true, }, }, - on_attach = disable_lsp_for_oil_buffer, }) vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) @@ -261,7 +217,6 @@ return { [""] = cmp.mapping.confirm({ select = true }), }), sources = cmp.config.sources({ - { name = "copilot", group_index = 2 }, { name = "nvim_lsp" }, { name = "luasnip" }, }, { From d0dcb9fc02267d9b3168c87f4db664fa401a97da Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Sun, 29 Sep 2024 19:44:06 +0200 Subject: [PATCH 173/280] Update nix config --- nixos/configuration.nix | 120 +++++++++---------------------- nixos/hardware-configuration.nix | 2 +- 2 files changed, 33 insertions(+), 89 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 0cfe210..c1c2480 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -7,18 +7,12 @@ nixpkgs.config.allowUnfree = true; -# Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; # console.font = "Lat2-Terminus16"; networking.hostName = "nixos"; -# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - -# Configure network proxy if necessary -# networking.proxy.default = "http://user:password@proxy:port/"; -# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; networking.networkmanager.enable = true; @@ -31,7 +25,6 @@ variant = ""; }; -# Define a user account. Don't forget to set a password with ‘passwd’. users.users.dani = { isNormalUser = true; description = "Dani"; @@ -53,6 +46,13 @@ lz4 + ruby_3_1 + bundix + gnumake + gcc + + nodejs_22 + fbterm eza @@ -74,35 +74,24 @@ git zsh btop + htop wget ripgrep firefox kdePackages.dolphin discord - + hyprland ]; programs.zsh.enable = true; programs.hyprland.enable = true; -# programs.dolphin.enable = true; -# programs.fbterm.enable = true; programs.firefox = { enable = true; languagePacks = [ "de" "en-US" ]; -# profiles = { -# myProfile = { -# settings = { -# extensions.activeThemeID = "4ae94ae4-df44-487a-bb8d-cdf0cb324144"; -# }; -# }; -# }; - - /* ---- POLICIES ---- */ -# Check about:policies#documentation for options. policies = { DisableTelemetry = true; DisableFirefoxStudies = true; @@ -119,80 +108,35 @@ OverrideFirstRunPage = ""; OverridePostUpdatePage = ""; DontCheckDefaultBrowser = true; - DisplayBookmarksToolbar = "newtab"; # alternatives: "always" or "newtab" - DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" - SearchBar = "unified"; # alternative: "separate" - - /* ---- EXTENSIONS ---- */ - ExtensionSettings = { - "uBlock0@raymondhill.net" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; - installation_mode = "force_installed"; - }; - "jid1-MnnxcxisBPnSXQ@jetpack" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi"; - installation_mode = "force_installed"; - }; - "{d634138d-c276-4fc8-924b-40a0ea21d284}" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/1password-x-password-manager/latest.xpi"; - installation_mode = "force_installed"; - }; - "addon@darkreader.org" = { - install_url = "https://addons.mozilla.org/darkreader/downloads/latest/1password-x-password-manager/latest.xpi"; - installation_mode = "force_installed"; - }; + DisplayBookmarksToolbar = "newtab"; + DisplayMenuBar = "default-off"; + SearchBar = "unified"; + + /* ---- EXTENSIONS ---- */ + ExtensionSettings = { + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; }; + "jid1-MnnxcxisBPnSXQ@jetpack" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi"; + installation_mode = "force_installed"; + }; + "{d634138d-c276-4fc8-924b-40a0ea21d284}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/1password-x-password-manager/latest.xpi"; + installation_mode = "force_installed"; + }; + "addon@darkreader.org" = { + install_url = "https://addons.mozilla.org/darkreader/downloads/latest/1password-x-password-manager/latest.xpi"; + installation_mode = "force_installed"; + }; + }; - /* ---- PREFERENCES ---- */ -# Check about:config for options. Preferences = { extensions.activeThemeId = "4ae94ae4-df44-487a-bb8d-cdf0cb324144"; -# "browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; -# "extensions.pocket.enabled" = lock-false; -# "extensions.screenshots.disabled" = lock-true; -# "browser.topsites.contile.enabled" = lock-false; -# "browser.formfill.enable" = lock-false; -# "browser.search.suggest.enabled" = lock-false; -# "browser.search.suggest.enabled.private" = lock-false; -# "browser.urlbar.suggest.searches" = lock-false; -# "browser.urlbar.showSearchSuggestionsFirst" = lock-false; -# "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; -# "browser.newtabpage.activity-stream.feeds.snippets" = lock-false; -# "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; -# "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; -# "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; -# "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; -# "browser.newtabpage.activity-stream.showSponsored" = lock-false; -# "browser.newtabpage.activity-stream.system.showSponsored" = lock-false; -# "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; }; }; }; -# Some programs need SUID wrappers, can be configured further or are -# started in user sessions. -# programs.mtr.enable = true; -# programs.gnupg.agent = { -# enable = true; -# enableSSHSupport = true; -# }; - -# List services that you want to enable: - -# Enable the OpenSSH daemon. -# services.openssh.enable = true; - -# Open ports in the firewall. -# networking.firewall.allowedTCPPorts = [ ... ]; -# networking.firewall.allowedUDPPorts = [ ... ]; -# Or disable the firewall altogether. -# networking.firewall.enable = false; - -# This value determines the NixOS release from which the default -# settings for stateful data, like file locations and database versions -# on your system were taken. It‘s perfectly fine and recommended to leave -# this value at the release version of the first install of this system. -# Before changing this value read the documentation for this option -# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "24.05"; # Did you read the comment? + system.stateVersion = "24.05"; } diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix index 8d18e8a..8dc066f 100644 --- a/nixos/hardware-configuration.nix +++ b/nixos/hardware-configuration.nix @@ -37,7 +37,7 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - sound.enable = false; + sound.enable = true; security.rtkit.enable = true; services.pipewire = { enable = true; From dd6cb20a777b1c02360171d11a9e222ebee4c846 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Sun, 29 Sep 2024 19:44:14 +0200 Subject: [PATCH 174/280] Attempt add media support --- .config/hypr/hyprland.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index a89fba0..883d7c3 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -253,6 +253,11 @@ bindm = $mainMod, mouse:273, resizewindow # Activate app switcher bind = $mainMod, R, exec, bemenu-run +# Media keys +bindel = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ +bindel = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- +bindl = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle + ############################## ### WINDOWS AND WORKSPACES ### ############################## From f7f29cbedf2eb454c5c614129b192154f3c841a5 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Sun, 29 Sep 2024 19:44:29 +0200 Subject: [PATCH 175/280] Update nvim config --- .config/nvim/copilot-chat | 2 -- .config/nvim/lua/plugins/editor.lua | 16 ++++++++-------- .config/nvim/lua/plugins/lsp.lua | 24 +++++++++--------------- 3 files changed, 17 insertions(+), 25 deletions(-) delete mode 100644 .config/nvim/copilot-chat diff --git a/.config/nvim/copilot-chat b/.config/nvim/copilot-chat deleted file mode 100644 index 76e579a..0000000 --- a/.config/nvim/copilot-chat +++ /dev/null @@ -1,2 +0,0 @@ -test - diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 5e69e04..9cbac0a 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -464,12 +464,12 @@ return { lazy = false, }, { "echasnovski/mini.ai", version = false, lazy = false }, - { - 'nvim-lualine/lualine.nvim', - lazy = false, - dependencies = { 'nvim-tree/nvim-web-devicons' }, - config = function() - require("lualine").setup() - end - } + -- { + -- 'nvim-lualine/lualine.nvim', + -- lazy = false, + -- dependencies = { 'nvim-tree/nvim-web-devicons' }, + -- config = function() + -- require("lualine").setup() + -- end + -- } } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index fff51e6..31eb00a 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -31,13 +31,14 @@ return { config = function() require("copilot_cmp").setup() require("copilot").setup({ - suggestion = { enabled = false }, + suggestion = { enabled = true }, panel = { enabled = false }, }) end, }, { "CopilotC-Nvim/CopilotChat.nvim", + lazy = false, dependencies = { { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper @@ -174,12 +175,12 @@ return { -- lspconfig.standardrb.setup({ capabilities = capabilities }) -- lspconfig.rubocop.setup({ capabilities = capabilities }) -- lspconfig.rust_analyzer.setup({ capabilities = capabilities }) - lspconfig.ltex.setup({ - cmd = { "ltex-ls" }, - filetypes = { "markdown", "text", "cff", "tex" }, - flags = { debounce_text_changes = 299 }, - }) - lspconfig.astro.setup({}) + -- lspconfig.ltex.setup({ + -- cmd = { "ltex-ls" }, + -- filetypes = { "markdown", "text", "cff", "tex" }, + -- flags = { debounce_text_changes = 299 }, + -- }) + -- lspconfig.astro.setup({}) lspconfig.solargraph.setup({ capabilities = capabilities, @@ -296,7 +297,7 @@ return { [""] = cmp.mapping.confirm({ select = true }), }), sources = cmp.config.sources({ - { name = "copilot", group_index = 2 }, + -- { name = "copilot", group_index = 2 }, { name = "nvim_lsp" }, { name = "luasnip" }, }, { @@ -305,13 +306,6 @@ return { }) end, }, - { - "zbirenbaum/copilot-cmp", - event = "InsertEnter", - config = function() - require("copilot_cmp").setup() - end, - }, -- { -- "nvim-treesitter/nvim-treesitter-refactor", -- lazy = false, From 9728846e2c4708d56f569958e3df8adc28d8386d Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Sun, 29 Sep 2024 21:16:02 +0200 Subject: [PATCH 176/280] Fix networking configuration --- nixos/configuration.nix | 17 +++++++++++++++-- nixos/hardware-configuration.nix | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index c1c2480..6ca74c3 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -12,9 +12,22 @@ # console.font = "Lat2-Terminus16"; - networking.hostName = "nixos"; + networking = { + hostName = "nixos"; + networkmanager = { + enable = true; + }; + wireless = { + enable = false; + networks = {}; + }; + }; - networking.networkmanager.enable = true; + # networking.hostName = "nixos"; + # + # networking.networkmanager.enable = true; + # networking.wireless.enable = false; + # networking.useDHCP = true; time.timeZone = "Europe/Zurich"; diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix index 8dc066f..f459541 100644 --- a/nixos/hardware-configuration.nix +++ b/nixos/hardware-configuration.nix @@ -30,7 +30,7 @@ # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; + # networking.useDHCP = lib.mkDefault true; # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; # networking.interfaces.enp6s0.useDHCP = lib.mkDefault true; # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; From e004679c62aae204c5632a006572418db78bf4ab Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Sun, 29 Sep 2024 22:18:37 +0200 Subject: [PATCH 177/280] Add spf --- .zshrc | 2 +- nixos/configuration.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 05c3b7c..57bcbc3 100644 --- a/.zshrc +++ b/.zshrc @@ -183,7 +183,7 @@ alias c="code" alias bat="bat --style plain --theme OneHalfDark" alias cat="bat" alias gdu="git diff @{upstream}" -alias spf="~/bin/spf" +alias spf="superfile" alias clines="find . -type f -name '*.txt' -exec wc -l {} +" alias gch="git checkout" diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 6ca74c3..d226a49 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -68,6 +68,7 @@ fbterm eza + superfile bun From 30d476baeeb75130b41b5139b2d38827f201f69c Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 17:23:14 +0200 Subject: [PATCH 178/280] Update nvim conf --- .config/nvim/.prettierrc | 4 + .config/nvim/init.lua | 188 +-------- .config/nvim/lazy-lock.json | 4 +- .config/nvim/lua/plugins/autoclose.lua | 10 +- .config/nvim/lua/plugins/autosave.lua | 36 +- .config/nvim/lua/plugins/conform.lua | 38 ++ .config/nvim/lua/plugins/lsp.lua | 395 +++++++++---------- .config/nvim/lua/plugins/markdown-render.lua | 8 + .config/nvim/lua/plugins/oil.lua | 96 ++--- .config/nvim/lua/settings.lua | 88 +++++ .config/nvim/lua/util.lua | 90 +++++ 11 files changed, 496 insertions(+), 461 deletions(-) create mode 100644 .config/nvim/.prettierrc create mode 100644 .config/nvim/lua/plugins/conform.lua create mode 100644 .config/nvim/lua/plugins/markdown-render.lua create mode 100644 .config/nvim/lua/settings.lua create mode 100644 .config/nvim/lua/util.lua diff --git a/.config/nvim/.prettierrc b/.config/nvim/.prettierrc new file mode 100644 index 0000000..8973894 --- /dev/null +++ b/.config/nvim/.prettierrc @@ -0,0 +1,4 @@ +{ + "useTabs": false, + "tabWidth": 2 +} diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index bb66ef3..824eb5e 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,189 +1,25 @@ -vim.g.mapleader = " " -vim.opt.cursorline = true -vim.opt.cursorcolumn = true -vim.opt.termguicolors = true -vim.wo.number = true -vim.wo.relativenumber = true -vim.opt.expandtab = true -vim.opt.tabstop = 2 -vim.opt.shiftwidth = 2 -vim.opt.scrolloff = 10 -vim.opt.autowrite = true -vim.opt.shortmess:append("A") -- https://stackoverflow.com/questions/1098159/vim-stop-existing-swap-file-warnings -vim.opt.autowriteall = true -vim.opt.list = true -vim.keymap.set("n", "n", "nzz") -vim.keymap.set("n", "N", "Nzz") -vim.keymap.set("n", "Q", ":quit") -vim.keymap.set("n", "Q", ":q!") -vim.keymap.set("n", "W", ":wq") -vim.keymap.set("n", "q", ":quitall") -vim.keymap.set("n", "/", "noh") -vim.keymap.set("n", "s", ":w") -vim.keymap.set("n", "g=", "ggVG=") -vim.keymap.set("n", "zt", "%s/\t/ /g") -vim.keymap.set("n", "vag", "ggVG") -vim.keymap.set("n", "dag", "ggVGd") -vim.keymap.set("n", "cag", "ggVGc") -vim.keymap.set("n", "gJ", "Jx") -vim.api.nvim_set_keymap('n', '', 'qq', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', 'q', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', '@q', { noremap = true, silent = true }) - --- Function to get the current line under the cursor -local function get_current_line() - return vim.api.nvim_get_current_line() -end - --- Function to extract the attribute name from the current line -local function extract_attribute_name(line) - return line:match("%s*(%w+)%s*;") -end - --- Function to define getter and setter macros -local function define_getter_setter_macros() - local line = get_current_line() - local attribute_name = extract_attribute_name(line) - if attribute_name then - local getter = string.format( - 'o// Getter method for %s^Mpublic String get%s() {^M return this.%s;^M}', - attribute_name, attribute_name:gsub("^%l", string.upper), attribute_name - ) - local setter = string.format( - 'o// Setter method for %s^Mpublic void set%s(String %s) {^M this.%s = %s;^M}', - attribute_name, attribute_name:gsub("^%l", string.upper), attribute_name, attribute_name, attribute_name - ) - vim.cmd(string.format("let @g = '%s'", getter)) - vim.cmd(string.format("let @s = '%s'", setter)) - else - print("No attribute name found on the current line.") - end -end - --- Call the function to define the macros -define_getter_setter_macros() - --- tabs --- vim.keymap.set("n", "", ":tabnew", { noremap = true }) --- vim.keymap.set("n", "", ":tabnext", { noremap = true }) --- vim.keymap.set("n", "", ":tabprevious", { noremap = true }) - --- terminal -vim.keymap.set("n", "", ":vert terminal", { noremap = true }) -vim.keymap.set("t", "", "", { noremap = true }) - --- Function to toggle terminal on the right -function toggle_terminal() - local term_bufnr = nil - for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do - if vim.api.nvim_buf_get_option(bufnr, 'buftype') == 'terminal' then - term_bufnr = bufnr - break - end - end - - if term_bufnr then - -- If terminal is open, close it - vim.api.nvim_buf_delete(term_bufnr, { force = true }) - else - -- If terminal is not open, open it in a vertical split - vim.cmd('vsplit | terminal') - end -end - --- Map Ctrl + . to toggle terminal -vim.keymap.set("n", "", toggle_terminal, { noremap = true, silent = true }) - -vim.opt.splitright = true -vim.opt.splitbelow = true -vim.keymap.set('n', '', ':wincmd k', { silent = true }) -vim.keymap.set('n', '', ':wincmd j', { silent = true }) -vim.keymap.set('n', '', ':wincmd h', { silent = true }) -vim.keymap.set('n', '', ':wincmd l', { silent = true }) -vim.keymap.set('n', '', ':wincmd =', { silent = true }) -vim.keymap.set('n', 'v', ':wincmd v', { silent = true}) -vim.keymap.set('n', 'V', ':wincmd s', { noremap = true, silent = true }) -vim.keymap.set('n', 'o', function() - -- Get the current line content - local line = vim.api.nvim_get_current_line() - - -- Extract the string (either single-quoted or double-quoted) - local str = line:match("'(.-)'") or line:match('"(.-)"') - - if str then - -- Construct the GitHub URL - local url = "https://github.com/" .. str - - -- Use the open shell command to open the URL - os.execute("open " .. url) - else - print("No valid string found on the current line.") - end -end) - --- vim.api.nvim_set_keymap('n', '@', '@q', {noremap = true}) - -vim.keymap.set('n', 'L', ':Lazy') +-- warnings +require("settings") +require("util") local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) end vim.opt.rtp:prepend(lazypath) local plugins = { - { import = "plugins" } + { import = "plugins" }, } local opts = { defaults = { lazy = true }, change_detection = { notify = false } } require("lazy").setup(plugins, opts) - --- highlighted yank - -vim.api.nvim_create_autocmd('TextYankPost', { - group = vim.api.nvim_create_augroup('highlight_yank', {}), - desc = 'Hightlight selection on yank', - pattern = '*', - callback = function() - vim.highlight.on_yank { higroup = 'IncSearch', timeout = 100 } - end, -}) - --- hybrid line numbers - -local numbertoggle_group = vim.api.nvim_create_augroup('numbertoggle', { clear = true }) - -vim.api.nvim_create_autocmd( -{'BufEnter', 'FocusGained', 'InsertLeave', 'WinEnter'}, -{ - group = numbertoggle_group, - pattern = '*', - callback = function() - if vim.wo.number and vim.fn.mode() ~= 'i' then - vim.wo.relativenumber = true - end - end -} -) - -vim.api.nvim_create_autocmd( -{'BufLeave', 'FocusLost', 'InsertEnter', 'WinLeave'}, -{ - group = numbertoggle_group, - pattern = '*', - callback = function() - if vim.wo.number then - vim.wo.relativenumber = false - end - end -} -) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 26ad861..5fc3075 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -11,6 +11,7 @@ "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conform.nvim": { "branch": "master", "commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c" }, "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, @@ -24,6 +25,7 @@ "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, + "mini.nvim": { "branch": "main", "commit": "848c5e8f428faf843051768e0d56104cd02aea1f" }, "multiple-cursors.nvim": { "branch": "main", "commit": "2f5e786c43aa9c0fc34b295cfcc9bfbacef8e926" }, "neotest": { "branch": "master", "commit": "48f8b5fce704594eb0ff94338e080defca14f0dc" }, "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, @@ -49,8 +51,8 @@ "plantuml-previewer.vim": { "branch": "master", "commit": "555347700382c97b347bace57b7a9f764ed556b1" }, "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "render-markdown.nvim": { "branch": "main", "commit": "cfb8bdddaf52785b80d0805ddb3bfca923256fd4" }, "solarized.nvim": { "branch": "main", "commit": "1293bec92289d9431fb0ede0b627de8ab60b895e" }, - "sonarlint.nvim": { "branch": "main", "commit": "8c13a7f294eaaed01b86be3113c608dc28bc5a27" }, "spring-boot.nvim": { "branch": "main", "commit": "218c0c26c14d99feca778e4d13f5ec3e8b1b60f0" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, diff --git a/.config/nvim/lua/plugins/autoclose.lua b/.config/nvim/lua/plugins/autoclose.lua index 21176b3..e9b9d33 100644 --- a/.config/nvim/lua/plugins/autoclose.lua +++ b/.config/nvim/lua/plugins/autoclose.lua @@ -1,7 +1,7 @@ return { - "m4xshen/autoclose.nvim", - lazy = false, - config = function() - require("autoclose").setup() - end + "m4xshen/autoclose.nvim", + lazy = false, + config = function() + require("autoclose").setup() + end, } diff --git a/.config/nvim/lua/plugins/autosave.lua b/.config/nvim/lua/plugins/autosave.lua index 701ef84..b89e5f8 100644 --- a/.config/nvim/lua/plugins/autosave.lua +++ b/.config/nvim/lua/plugins/autosave.lua @@ -1,20 +1,20 @@ return { - "Pocco81/auto-save.nvim", - lazy = false, - config = function() - require("auto-save").setup({ - debounce_delay = 50, - -- condition = function(buf) - -- local fn = vim.fn - -- local utils = require("auto-save.utils.data") - -- - -- if - -- fn.getbufvar(buf, "&modifiable") == 1 and - -- utils.not_in(fn.getbufvar(buf, "&filetype"), {"oil"}) then - -- return true - -- end - -- return false - -- end, - }) - end, + "Pocco81/auto-save.nvim", + lazy = true, + config = function() + require("auto-save").setup({ + debounce_delay = 50, + -- condition = function(buf) + -- local fn = vim.fn + -- local utils = require("auto-save.utils.data") + -- + -- if + -- fn.getbufvar(buf, "&modifiable") == 1 and + -- utils.not_in(fn.getbufvar(buf, "&filetype"), {"oil"}) then + -- return true + -- end + -- return false + -- end, + }) + end, } diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua new file mode 100644 index 0000000..2c67e12 --- /dev/null +++ b/.config/nvim/lua/plugins/conform.lua @@ -0,0 +1,38 @@ +return { + -- "stevearc/conform.nvim", + -- event = { "BufReadPre", "BufNewFile" }, + -- config = function() + -- local conform = require("conform") + -- + -- conform.setup({ + -- formatters_by_ft = { + -- javascript = { "prettier" }, + -- typescript = { "prettier" }, + -- javascriptreact = { "prettier" }, + -- typescriptreact = { "prettier" }, + -- svelte = { "prettier" }, + -- css = { "prettier" }, + -- html = { "prettier" }, + -- json = { "prettier" }, + -- java = { "prettier" }, + -- yaml = { "prettier" }, + -- markdown = { "prettier" }, + -- graphql = { "prettier" }, + -- lua = { "stylua" }, + -- }, + -- format_on_save = { + -- lsp_fallback = true, + -- async = false, + -- timeout_ms = 100, + -- }, + -- }) + -- + -- vim.keymap.set({ "n", "v" }, "mp", function() + -- conform.format({ + -- lsp_fallback = true, + -- async = false, + -- timeout_ms = 500, + -- }) + -- end, { desc = "Format file or range (in visual mode)" }) + -- end, +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index eb7a827..a8c1458 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,228 +1,189 @@ return { - { - "zbirenbaum/copilot.lua", - cmd = "Copilot", - event = "InsertEnter", - config = function() - require("copilot").setup() - end, - }, - { - "williamboman/mason.nvim", - lazy = false, - keys = { - { "m", "Mason" }, - }, - config = function() - require("mason").setup() - end, - }, - { - "williamboman/mason-lspconfig.nvim", - lazy = false, - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "ts_ls", "solargraph", "rust_analyzer" }, - }) - end, - }, - { - "sheerun/vim-polyglot", - lazy = false, - }, - { - "neovim/nvim-lspconfig", - lazy = false, - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + config = function() + require("copilot").setup() + end, + }, + { + "williamboman/mason.nvim", + lazy = false, + keys = { + { "m", "Mason" }, + }, + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + lazy = false, + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "ts_ls", "solargraph", "rust_analyzer" }, + }) + end, + }, + { + "sheerun/vim-polyglot", + lazy = false, + }, + { + "neovim/nvim-lspconfig", + lazy = false, + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() - local lspconfig = require('lspconfig') + local lspconfig = require("lspconfig") - local common_options = { - capabilities = capabilities, - } + local common_options = { + capabilities = capabilities, + } - local function setup_lsp(server_name, options) - options = options or {} - lspconfig[server_name].setup(vim.tbl_extend('force', common_options, options)) - end + local function setup_lsp(server_name, options) + options = options or {} + lspconfig[server_name].setup(vim.tbl_extend("force", common_options, options)) + end - setup_lsp('lua_ls') - setup_lsp('ruby_lsp') - setup_lsp('rubocop') - setup_lsp('ts_ls') - setup_lsp('ltex', { - cmd = { "ltex-ls" }, - filetypes = { "markdown", "text", "cff", "tex" }, - flags = { debounce_text_changes = 299 }, - }) - setup_lsp('astro') - setup_lsp('rust_analyzer') + setup_lsp("lua_ls") + setup_lsp("ruby_lsp") + setup_lsp("rubocop") + setup_lsp("ts_ls") + setup_lsp("ltex", { + cmd = { "ltex-ls" }, + filetypes = { "markdown", "text", "cff", "tex" }, + flags = { debounce_text_changes = 299 }, + }) + setup_lsp("astro") + setup_lsp("rust_analyzer") - lspconfig.solargraph.setup({ - capabilities = capabilities, - cmd = { - "asdf", - "exec", - "solargraph", - "stdio", - }, - settings = { - solargraph = { - autoformat = false, - completion = true, - diagnostic = true, - folding = true, - references = true, - rename = true, - symbols = true, - }, - }, - }) + lspconfig.solargraph.setup({ + capabilities = capabilities, + cmd = { + "asdf", + "exec", + "solargraph", + "stdio", + }, + settings = { + solargraph = { + autoformat = false, + completion = true, + diagnostic = true, + folding = true, + references = true, + rename = true, + symbols = true, + }, + }, + }) - vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) - vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) - vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) - vim.cmd([[ + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) + vim.cmd([[ autocmd BufNewFile,BufRead *.prawn set filetype=ruby ]]) - end, - keys = { - {"ls", "LspStop"}, - {"lS", "LspStart"}, - } - }, - { - "danarth/sonarlint.nvim", - ft = "java", - config = function() - require('sonarlint').setup({ - server = { - cmd = { - 'sonarlint-language-server', - -- Ensure that sonarlint-language-server uses stdio channel - '-stdio', - '-analyzers', - -- paths to the analyzers you need, using those for python and java in this example - vim.fn.expand("$MASON/share/sonarlint-analyzers/sonarpython.jar"), - vim.fn.expand("$MASON/share/sonarlint-analyzers/sonarcfamily.jar"), - vim.fn.expand("$MASON/share/sonarlint-analyzers/sonarjava.jar"), - }, - -- All settings are optional - settings = { - -- The default for sonarlint is {}, this is just an example - sonarlint = { - rules = { - ['typescript:S101'] = { level = 'on', parameters = { format = '^[A-Z][a-zA-Z0-9]*$' } }, - ['typescript:S103'] = { level = 'on', parameters = { maximumLineLength = 180 } }, - ['typescript:S106'] = { level = 'on' }, - ['typescript:S107'] = { level = 'on', parameters = { maximumFunctionParameters = 7 } } - } - } - } - }, - filetypes = { - -- Tested and working - 'python', - 'cpp', - -- Requires nvim-jdtls, otherwise an error message will be printed - 'java', - } - }) - end - }, - { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.disable({ "rubocop" }) - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.diagnostics.erb_format, - null_ls.builtins.formatting.erb_lint, - }, - }) - end, - keys = { - { "lf", vim.lsp.buf.format }, - }, - }, - { - "hrsh7th/cmp-nvim-lsp", - lazy = false, - }, - { - "L3MON4D3/LuaSnip", - dependencies = { - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets", - }, - keys = { - { - "", - function() - return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" - end, - expr = true, - silent = true, - mode = "i", - }, - { - "", - function() - require("luasnip").jump(1) - end, - mode = "s", - }, - { - "", - function() - require("luasnip").jump(-1) - end, - mode = { "i", "s" }, - }, - }, - }, - { - "hrsh7th/nvim-cmp", - lazy = false, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-cmdline", - "rafamadriz/friendly-snippets", - }, - config = function() - local cmp = require("cmp") - require("luasnip.loaders.from_vscode").lazy_load() + end, + keys = { + { "ls", "LspStop" }, + { "lS", "LspStart" }, + }, + }, + { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.disable({ "rubocop" }) + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.diagnostics.erb_format, + null_ls.builtins.formatting.erb_lint, + }, + }) + end, + keys = { + { "lf", vim.lsp.buf.format }, + }, + }, + { + "hrsh7th/cmp-nvim-lsp", + lazy = false, + }, + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + keys = { + { + "", + function() + return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" + end, + expr = true, + silent = true, + mode = "i", + }, + { + "", + function() + require("luasnip").jump(1) + end, + mode = "s", + }, + { + "", + function() + require("luasnip").jump(-1) + end, + mode = { "i", "s" }, + }, + }, + }, + { + "hrsh7th/nvim-cmp", + lazy = false, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-cmdline", + "rafamadriz/friendly-snippets", + }, + config = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() - cmp.setup({ - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - }), - }) - end, - }, + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), + }) + end, + }, } diff --git a/.config/nvim/lua/plugins/markdown-render.lua b/.config/nvim/lua/plugins/markdown-render.lua new file mode 100644 index 0000000..95b6ba3 --- /dev/null +++ b/.config/nvim/lua/plugins/markdown-render.lua @@ -0,0 +1,8 @@ +return { + -- "MeanderingProgrammer/render-markdown.nvim", + -- opts = {}, + -- ft = "markdown", + -- dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite + -- -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins + -- -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons +} diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index cb535fb..5089a60 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -1,46 +1,54 @@ return { - "stevearc/oil.nvim", - dependencies = { { "echasnovski/mini.icons", opts = {} } }, - lazy = false, - config = function() - require("oil").setup({ - columns = { - "icon", - "permissions", - "size", - "mtime", - }, - constrain_cursor = "name", - skip_confirm_for_simple_edits = true, - prompt_save_on_select_new_entry = true, - watch_for_changes = true, - keymaps = { - ["g?"] = "actions.show_help", - [""] = "actions.select", - [""] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" }, - [""] = { "actions.select", opts = { horizontal = true }, desc = "Open the entry in a horizontal split" }, - [""] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" }, - [""] = "actions.preview", - ["-"] = "actions.parent", - ["_"] = "actions.open_cwd", - [""] = "actions.cd", - [""] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory" }, - ["gs"] = "actions.change_sort", - [""] = { - "actions.open_cmdline", - opts = { - modify = ":! open", - }, - desc = "Open file", - }, - }, - use_default_keymaps = false, - view_options = { - show_hidden = true, - }, - }) - end, - keys = { - { mode = "n", "-", "Oil" } - } + "stevearc/oil.nvim", + dependencies = { { "echasnovski/mini.icons", opts = {} } }, + lazy = false, + config = function() + require("oil").setup({ + columns = { + "icon", + "permissions", + "size", + "mtime", + }, + constrain_cursor = "name", + skip_confirm_for_simple_edits = true, + prompt_save_on_select_new_entry = true, + watch_for_changes = true, + keymaps = { + ["g?"] = "actions.show_help", + [""] = "actions.select", + [""] = { + "actions.select", + opts = { vertical = true }, + desc = "Open the entry in a vertical split", + }, + [""] = { + "actions.select", + opts = { horizontal = true }, + desc = "Open the entry in a horizontal split", + }, + [""] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" }, + [""] = "actions.preview", + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + ["`"] = "actions.cd", + [""] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory" }, + ["gs"] = "actions.change_sort", + [""] = { + "actions.open_cmdline", + opts = { + modify = ":! open", + }, + desc = "Open file", + }, + }, + use_default_keymaps = false, + view_options = { + show_hidden = true, + }, + }) + end, + keys = { + { mode = "n", "-", "Oil" }, + }, } diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua new file mode 100644 index 0000000..cc0ec13 --- /dev/null +++ b/.config/nvim/lua/settings.lua @@ -0,0 +1,88 @@ +vim.g.mapleader = " " +vim.opt.cursorline = true +vim.opt.cursorcolumn = true +vim.opt.termguicolors = true +vim.wo.number = true +vim.wo.relativenumber = true +vim.opt.expandtab = true +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.scrolloff = 10 +vim.opt.autowrite = true +vim.opt.autowriteall = true +vim.opt.list = false -- whitespace + +-- nav + +-- vim.keymap.set("n", "n", "nzz") +-- vim.keymap.set("n", "N", "Nzz") +vim.keymap.set("n", "/", "noh") + +-- tabs +-- vim.keymap.set("n", "", ":tabnew", { noremap = true }) +-- vim.keymap.set("n", "", ":tabnext", { noremap = true }) +-- vim.keymap.set("n", "", ":tabprevious", { noremap = true }) + +-- terminal +vim.keymap.set("n", "", ":vert terminal", { noremap = true }) +vim.keymap.set("t", "", "", { noremap = true }) + +-- saving / quitting + +vim.keymap.set("n", "Q", ":quit") +vim.keymap.set("n", "Q", ":q!") +vim.keymap.set("n", "W", ":wq") +vim.keymap.set("n", "q", ":quitall") +vim.keymap.set("n", "s", ":w") + +-- formatting + +vim.keymap.set("n", "g=", "ggVG=") +vim.keymap.set("n", "zt", "%s/\t/ /g") +vim.keymap.set("n", "vag", "ggVG") +vim.keymap.set("n", "dag", "ggVGd") +vim.keymap.set("n", "cag", "ggVGc") +vim.keymap.set("n", "gJ", "Jx") + +-- macro + +vim.api.nvim_set_keymap("n", "", "qq", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "", "q", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "", "@q", { noremap = true, silent = true }) + +-- suppression + +vim.opt.shortmess:append("A") -- https://stackoverflow.com/questions/1098159/vim-stop-existing-swap-file-warnings + +-- commands + +vim.keymap.set("n", "L", ":Lazy") + +-- splits + +vim.opt.splitright = true +vim.opt.splitbelow = true +vim.keymap.set("n", "", ":wincmd k", { silent = true }) +vim.keymap.set("n", "", ":wincmd j", { silent = true }) +vim.keymap.set("n", "", ":wincmd h", { silent = true }) +vim.keymap.set("n", "", ":wincmd l", { silent = true }) +vim.keymap.set("n", "", ":wincmd =", { silent = true }) +vim.keymap.set("n", "v", ":wincmd v", { silent = true }) +vim.keymap.set("n", "V", ":wincmd s", { noremap = true, silent = true }) +vim.keymap.set("n", "o", function() + -- get the current line content + local line = vim.api.nvim_get_current_line() + + -- extract the string (either single-quoted or double-quoted) + local str = line:match("'(.-)'") or line:match('"(.-)"') + + if str then + -- Construct the GitHub URL + local url = "https://github.com/" .. str + + -- use the open shell command to open the URL + os.execute("open " .. url) + else + print("No valid string found on the current line.") + end +end) diff --git a/.config/nvim/lua/util.lua b/.config/nvim/lua/util.lua new file mode 100644 index 0000000..faa747d --- /dev/null +++ b/.config/nvim/lua/util.lua @@ -0,0 +1,90 @@ +local function get_current_line() + return vim.api.nvim_get_current_line() +end + +-- Function to extract the attribute name from the current line +local function extract_attribute_name(line) + return line:match("%s*(%w+)%s*;") +end + +local function define_getter_setter_macros() + local line = get_current_line() + local attribute_name = extract_attribute_name(line) + if attribute_name then + local getter = string.format( + "o// Getter method for %s^Mpublic String get%s() {^M return this.%s;^M}", + attribute_name, + attribute_name:gsub("^%l", string.upper), + attribute_name + ) + local setter = string.format( + "o// Setter method for %s^Mpublic void set%s(String %s) {^M this.%s = %s;^M}", + attribute_name, + attribute_name:gsub("^%l", string.upper), + attribute_name, + attribute_name, + attribute_name + ) + vim.cmd(string.format("let @g = '%s'", getter)) + vim.cmd(string.format("let @s = '%s'", setter)) + else + print("No attribute name found on the current line.") + end +end + +-- Call the function to define the macros +define_getter_setter_macros() + +-- highlighted yank +vim.api.nvim_create_autocmd("TextYankPost", { + group = vim.api.nvim_create_augroup("highlight_yank", {}), + desc = "Hightlight selection on yank", + pattern = "*", + callback = function() + vim.highlight.on_yank({ higroup = "IncSearch", timeout = 100 }) + end, +}) + +-- hybrid line numbers + +local numbertoggle_group = vim.api.nvim_create_augroup("numbertoggle", { clear = true }) + +vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" }, { + group = numbertoggle_group, + pattern = "*", + callback = function() + if vim.wo.number and vim.fn.mode() ~= "i" then + vim.wo.relativenumber = true + end + end, +}) + +vim.api.nvim_create_autocmd({ "BufLeave", "FocusLost", "InsertEnter", "WinLeave" }, { + group = numbertoggle_group, + pattern = "*", + callback = function() + if vim.wo.number then + vim.wo.relativenumber = false + end + end, +}) + +function toggle_terminal() + local term_bufnr = nil + for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do + if vim.api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then + term_bufnr = bufnr + break + end + end + + if term_bufnr then + -- If terminal is open, close it + vim.api.nvim_buf_delete(term_bufnr, { force = true }) + else + -- If terminal is not open, open it in a vertical split + vim.cmd("vsplit | terminal") + end +end + +vim.keymap.set("n", "", toggle_terminal, { noremap = true, silent = true }) From 357b71f713d5e514ae4ff9330d5f112e51781131 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 17:35:59 +0200 Subject: [PATCH 179/280] Cleanup, fix nivm --- .config/nvim/init.lua | 1 - .config/nvim/lazy-lock.json | 30 +- .config/nvim/lua/plugins/autosave.lua | 20 - .config/nvim/lua/plugins/diffview.lua | 1 - .config/nvim/lua/plugins/fugitive.lua | 4 - .config/nvim/lua/plugins/java.lua | 9 - .config/nvim/lua/plugins/lsp.lua | 374 +++++++++---------- .config/nvim/lua/plugins/markdown-render.lua | 8 - .config/nvim/lua/plugins/multicursor.lua | 28 +- .config/nvim/lua/plugins/visual-multi.lua | 4 + .config/nvim/lua/util.lua | 7 - 11 files changed, 207 insertions(+), 279 deletions(-) delete mode 100644 .config/nvim/lua/plugins/autosave.lua delete mode 100644 .config/nvim/lua/plugins/fugitive.lua delete mode 100644 .config/nvim/lua/plugins/java.lua delete mode 100644 .config/nvim/lua/plugins/markdown-render.lua create mode 100644 .config/nvim/lua/plugins/visual-multi.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 824eb5e..5072720 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,4 +1,3 @@ --- warnings require("settings") require("util") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 5fc3075..e31786e 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,44 +1,21 @@ { "CopilotChat.nvim": { "branch": "canary", "commit": "9333944fde3c65868818e245c73aa29eef826e9b" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, - "auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" }, "auto-session": { "branch": "main", "commit": "21e33854fb3e561cb738dfefcd9d1d84fe6faaef" }, "autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "bufexplorer": { "branch": "master", "commit": "fcf3a65a69020f0f54be8fa925f841874a5f3a01" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c" }, "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, - "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, - "lua-async-await": { "branch": "main", "commit": "652d94df34e97abe2d4a689edbc4270e7ead1a98" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, - "mini.nvim": { "branch": "main", "commit": "848c5e8f428faf843051768e0d56104cd02aea1f" }, - "multiple-cursors.nvim": { "branch": "main", "commit": "2f5e786c43aa9c0fc34b295cfcc9bfbacef8e926" }, "neotest": { "branch": "master", "commit": "48f8b5fce704594eb0ff94338e080defca14f0dc" }, "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, - "none-ls.nvim": { "branch": "main", "commit": "9b98991e15dce8fc502993e23caac2528b8b667f" }, - "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, - "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-dap": { "branch": "master", "commit": "90616ae6ae40053103dc66872886fc26b94c70c8" }, - "nvim-java": { "branch": "main", "commit": "b3174e41ab51867123d8663eced53b33f1548522" }, - "nvim-java-core": { "branch": "main", "commit": "5b03dca22fee76524a89e1c2dc1d73a9f0b1a3bb" }, - "nvim-java-dap": { "branch": "main", "commit": "55f239532f7a3789d21ea68d1e795abc77484974" }, - "nvim-java-refactor": { "branch": "main", "commit": "ea1420fed5463c9cc976c2b4175f434b3646f0f7" }, - "nvim-java-test": { "branch": "main", "commit": "7f0f40e9c5b7eab5096d8bec6ac04251c6e81468" }, - "nvim-lspconfig": { "branch": "master", "commit": "73e0002b6f211376bbf36c31a2f812aedf6bd6b0" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, @@ -51,12 +28,9 @@ "plantuml-previewer.vim": { "branch": "master", "commit": "555347700382c97b347bace57b7a9f764ed556b1" }, "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "render-markdown.nvim": { "branch": "main", "commit": "cfb8bdddaf52785b80d0805ddb3bfca923256fd4" }, "solarized.nvim": { "branch": "main", "commit": "1293bec92289d9431fb0ede0b627de8ab60b895e" }, - "spring-boot.nvim": { "branch": "main", "commit": "218c0c26c14d99feca778e4d13f5ec3e8b1b60f0" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, - "vim-polyglot": { "branch": "master", "commit": "bc8a81d3592dab86334f27d1d43c080ebf680d42" }, "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, - "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" } + "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" }, + "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" } } diff --git a/.config/nvim/lua/plugins/autosave.lua b/.config/nvim/lua/plugins/autosave.lua deleted file mode 100644 index b89e5f8..0000000 --- a/.config/nvim/lua/plugins/autosave.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - "Pocco81/auto-save.nvim", - lazy = true, - config = function() - require("auto-save").setup({ - debounce_delay = 50, - -- condition = function(buf) - -- local fn = vim.fn - -- local utils = require("auto-save.utils.data") - -- - -- if - -- fn.getbufvar(buf, "&modifiable") == 1 and - -- utils.not_in(fn.getbufvar(buf, "&filetype"), {"oil"}) then - -- return true - -- end - -- return false - -- end, - }) - end, -} diff --git a/.config/nvim/lua/plugins/diffview.lua b/.config/nvim/lua/plugins/diffview.lua index 9db2d10..9e7897a 100644 --- a/.config/nvim/lua/plugins/diffview.lua +++ b/.config/nvim/lua/plugins/diffview.lua @@ -1,6 +1,5 @@ return { "sindrets/diffview.nvim", - lazy = false, cmd = { "DiffViewOpen" }, diff --git a/.config/nvim/lua/plugins/fugitive.lua b/.config/nvim/lua/plugins/fugitive.lua deleted file mode 100644 index 6e9b756..0000000 --- a/.config/nvim/lua/plugins/fugitive.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "tpope/vim-fugitive", - lazy = false -} diff --git a/.config/nvim/lua/plugins/java.lua b/.config/nvim/lua/plugins/java.lua deleted file mode 100644 index 1328329..0000000 --- a/.config/nvim/lua/plugins/java.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - 'nvim-java/nvim-java', - config = function() - require('jdtls').start_or_attach({ - cmd = {'/path/to/jdt-language-server/bin/jdtls'}, - root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]), - }) - end -} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index a8c1458..27d3f56 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,189 +1,189 @@ return { - { - "zbirenbaum/copilot.lua", - cmd = "Copilot", - event = "InsertEnter", - config = function() - require("copilot").setup() - end, - }, - { - "williamboman/mason.nvim", - lazy = false, - keys = { - { "m", "Mason" }, - }, - config = function() - require("mason").setup() - end, - }, - { - "williamboman/mason-lspconfig.nvim", - lazy = false, - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "ts_ls", "solargraph", "rust_analyzer" }, - }) - end, - }, - { - "sheerun/vim-polyglot", - lazy = false, - }, - { - "neovim/nvim-lspconfig", - lazy = false, - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() - - local lspconfig = require("lspconfig") - - local common_options = { - capabilities = capabilities, - } - - local function setup_lsp(server_name, options) - options = options or {} - lspconfig[server_name].setup(vim.tbl_extend("force", common_options, options)) - end - - setup_lsp("lua_ls") - setup_lsp("ruby_lsp") - setup_lsp("rubocop") - setup_lsp("ts_ls") - setup_lsp("ltex", { - cmd = { "ltex-ls" }, - filetypes = { "markdown", "text", "cff", "tex" }, - flags = { debounce_text_changes = 299 }, - }) - setup_lsp("astro") - setup_lsp("rust_analyzer") - - lspconfig.solargraph.setup({ - capabilities = capabilities, - cmd = { - "asdf", - "exec", - "solargraph", - "stdio", - }, - settings = { - solargraph = { - autoformat = false, - completion = true, - diagnostic = true, - folding = true, - references = true, - rename = true, - symbols = true, - }, - }, - }) - - vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) - vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) - vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) - vim.cmd([[ - autocmd BufNewFile,BufRead *.prawn set filetype=ruby - ]]) - end, - keys = { - { "ls", "LspStop" }, - { "lS", "LspStart" }, - }, - }, - { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.disable({ "rubocop" }) - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.diagnostics.erb_format, - null_ls.builtins.formatting.erb_lint, - }, - }) - end, - keys = { - { "lf", vim.lsp.buf.format }, - }, - }, - { - "hrsh7th/cmp-nvim-lsp", - lazy = false, - }, - { - "L3MON4D3/LuaSnip", - dependencies = { - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets", - }, - keys = { - { - "", - function() - return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" - end, - expr = true, - silent = true, - mode = "i", - }, - { - "", - function() - require("luasnip").jump(1) - end, - mode = "s", - }, - { - "", - function() - require("luasnip").jump(-1) - end, - mode = { "i", "s" }, - }, - }, - }, - { - "hrsh7th/nvim-cmp", - lazy = false, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-cmdline", - "rafamadriz/friendly-snippets", - }, - config = function() - local cmp = require("cmp") - require("luasnip.loaders.from_vscode").lazy_load() - - cmp.setup({ - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - }), - }) - end, - }, + -- { + -- "zbirenbaum/copilot.lua", + -- cmd = "Copilot", + -- event = "InsertEnter", + -- config = function() + -- require("copilot").setup() + -- end, + -- }, + -- { + -- "williamboman/mason.nvim", + -- lazy = false, + -- keys = { + -- { "m", "Mason" }, + -- }, + -- config = function() + -- require("mason").setup() + -- end, + -- }, + -- { + -- "williamboman/mason-lspconfig.nvim", + -- lazy = false, + -- config = function() + -- require("mason-lspconfig").setup({ + -- ensure_installed = { "lua_ls", "ts_ls", "solargraph", "rust_analyzer" }, + -- }) + -- end, + -- }, + -- { + -- "sheerun/vim-polyglot", + -- lazy = false, + -- }, + -- { + -- "neovim/nvim-lspconfig", + -- lazy = false, + -- config = function() + -- local capabilities = require("cmp_nvim_lsp").default_capabilities() + -- + -- local lspconfig = require("lspconfig") + -- + -- local common_options = { + -- capabilities = capabilities, + -- } + -- + -- local function setup_lsp(server_name, options) + -- options = options or {} + -- lspconfig[server_name].setup(vim.tbl_extend("force", common_options, options)) + -- end + -- + -- setup_lsp("lua_ls") + -- setup_lsp("ruby_lsp") + -- setup_lsp("rubocop") + -- setup_lsp("ts_ls") + -- setup_lsp("ltex", { + -- cmd = { "ltex-ls" }, + -- filetypes = { "markdown", "text", "cff", "tex" }, + -- flags = { debounce_text_changes = 299 }, + -- }) + -- setup_lsp("astro") + -- setup_lsp("rust_analyzer") + -- + -- lspconfig.solargraph.setup({ + -- capabilities = capabilities, + -- cmd = { + -- "asdf", + -- "exec", + -- "solargraph", + -- "stdio", + -- }, + -- settings = { + -- solargraph = { + -- autoformat = false, + -- completion = true, + -- diagnostic = true, + -- folding = true, + -- references = true, + -- rename = true, + -- symbols = true, + -- }, + -- }, + -- }) + -- + -- vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + -- vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + -- vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) + -- vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + -- vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) + -- vim.cmd([[ + -- autocmd BufNewFile,BufRead *.prawn set filetype=ruby + -- ]]) + -- end, + -- keys = { + -- { "ls", "LspStop" }, + -- { "lS", "LspStart" }, + -- }, + -- }, + -- { + -- "nvimtools/none-ls.nvim", + -- config = function() + -- local null_ls = require("null-ls") + -- null_ls.disable({ "rubocop" }) + -- null_ls.setup({ + -- sources = { + -- null_ls.builtins.formatting.stylua, + -- null_ls.builtins.diagnostics.erb_format, + -- null_ls.builtins.formatting.erb_lint, + -- }, + -- }) + -- end, + -- keys = { + -- { "lf", vim.lsp.buf.format }, + -- }, + -- }, + -- { + -- "hrsh7th/cmp-nvim-lsp", + -- lazy = false, + -- }, + -- { + -- "L3MON4D3/LuaSnip", + -- dependencies = { + -- "saadparwaiz1/cmp_luasnip", + -- "rafamadriz/friendly-snippets", + -- }, + -- keys = { + -- { + -- "", + -- function() + -- return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" + -- end, + -- expr = true, + -- silent = true, + -- mode = "i", + -- }, + -- { + -- "", + -- function() + -- require("luasnip").jump(1) + -- end, + -- mode = "s", + -- }, + -- { + -- "", + -- function() + -- require("luasnip").jump(-1) + -- end, + -- mode = { "i", "s" }, + -- }, + -- }, + -- }, + -- { + -- "hrsh7th/nvim-cmp", + -- lazy = false, + -- dependencies = { + -- "hrsh7th/cmp-nvim-lsp", + -- "hrsh7th/cmp-buffer", + -- "hrsh7th/cmp-cmdline", + -- "rafamadriz/friendly-snippets", + -- }, + -- config = function() + -- local cmp = require("cmp") + -- require("luasnip.loaders.from_vscode").lazy_load() + -- + -- cmp.setup({ + -- snippet = { + -- expand = function(args) + -- require("luasnip").lsp_expand(args.body) + -- end, + -- }, + -- window = { + -- completion = cmp.config.window.bordered(), + -- documentation = cmp.config.window.bordered(), + -- }, + -- mapping = cmp.mapping.preset.insert({ + -- [""] = cmp.mapping.scroll_docs(-4), + -- [""] = cmp.mapping.scroll_docs(4), + -- [""] = cmp.mapping.complete(), + -- [""] = cmp.mapping.abort(), + -- [""] = cmp.mapping.confirm({ select = true }), + -- }), + -- sources = cmp.config.sources({ + -- { name = "nvim_lsp" }, + -- { name = "luasnip" }, + -- }, { + -- { name = "buffer" }, + -- }), + -- }) + -- end, + -- }, } diff --git a/.config/nvim/lua/plugins/markdown-render.lua b/.config/nvim/lua/plugins/markdown-render.lua deleted file mode 100644 index 95b6ba3..0000000 --- a/.config/nvim/lua/plugins/markdown-render.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - -- "MeanderingProgrammer/render-markdown.nvim", - -- opts = {}, - -- ft = "markdown", - -- dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite - -- -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins - -- -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons -} diff --git a/.config/nvim/lua/plugins/multicursor.lua b/.config/nvim/lua/plugins/multicursor.lua index f53ead1..717b854 100644 --- a/.config/nvim/lua/plugins/multicursor.lua +++ b/.config/nvim/lua/plugins/multicursor.lua @@ -1,16 +1,16 @@ return { - "brenton-leighton/multiple-cursors.nvim", - version = "*", - opts = {}, - keys = { - {"j", "MultipleCursorsAddDown", mode = {"n", "x"}, desc = "Add cursor and move down"}, - {"k", "MultipleCursorsAddUp", mode = {"n", "x"}, desc = "Add cursor and move up"}, - {"", "MultipleCursorsMouseAddDelete", mode = {"n", "i"}, desc = "Add or remove cursor"}, - {"a", "MultipleCursorsAddMatches", mode = {"n", "x"}, desc = "Add cursors to cword"}, - {"A", "MultipleCursorsAddMatchesV", mode = {"n", "x"}, desc = "Add cursors to cword in previous area"}, - {"d", "MultipleCursorsAddJumpNextMatch", mode = {"n", "x"}, desc = "Add cursor and jump to next cword"}, - {"D", "MultipleCursorsJumpNextMatch", mode = {"n", "x"}, desc = "Jump to next cword"}, - {"l", "MultipleCursorsLock", mode = {"n", "x"}, desc = "Lock virtual cursors"}, - {"n", "|", function() require("multiple-cursors").align() end}, - }, + -- "brenton-leighton/multiple-cursors.nvim", + -- version = "*", + -- opts = {}, + -- keys = { + -- {"j", "MultipleCursorsAddDown", mode = {"n", "x"}, desc = "Add cursor and move down"}, + -- {"k", "MultipleCursorsAddUp", mode = {"n", "x"}, desc = "Add cursor and move up"}, + -- {"", "MultipleCursorsMouseAddDelete", mode = {"n", "i"}, desc = "Add or remove cursor"}, + -- {"a", "MultipleCursorsAddMatches", mode = {"n", "x"}, desc = "Add cursors to cword"}, + -- {"A", "MultipleCursorsAddMatchesV", mode = {"n", "x"}, desc = "Add cursors to cword in previous area"}, + -- {"d", "MultipleCursorsAddJumpNextMatch", mode = {"n", "x"}, desc = "Add cursor and jump to next cword"}, + -- {"D", "MultipleCursorsJumpNextMatch", mode = {"n", "x"}, desc = "Jump to next cword"}, + -- {"l", "MultipleCursorsLock", mode = {"n", "x"}, desc = "Lock virtual cursors"}, + -- {"n", "|", function() require("multiple-cursors").align() end}, + -- }, } diff --git a/.config/nvim/lua/plugins/visual-multi.lua b/.config/nvim/lua/plugins/visual-multi.lua new file mode 100644 index 0000000..0980001 --- /dev/null +++ b/.config/nvim/lua/plugins/visual-multi.lua @@ -0,0 +1,4 @@ +return { + "mg979/vim-visual-multi", + lazy = false +} diff --git a/.config/nvim/lua/util.lua b/.config/nvim/lua/util.lua index faa747d..cb2ccb1 100644 --- a/.config/nvim/lua/util.lua +++ b/.config/nvim/lua/util.lua @@ -2,7 +2,6 @@ local function get_current_line() return vim.api.nvim_get_current_line() end --- Function to extract the attribute name from the current line local function extract_attribute_name(line) return line:match("%s*(%w+)%s*;") end @@ -32,10 +31,8 @@ local function define_getter_setter_macros() end end --- Call the function to define the macros define_getter_setter_macros() --- highlighted yank vim.api.nvim_create_autocmd("TextYankPost", { group = vim.api.nvim_create_augroup("highlight_yank", {}), desc = "Hightlight selection on yank", @@ -45,8 +42,6 @@ vim.api.nvim_create_autocmd("TextYankPost", { end, }) --- hybrid line numbers - local numbertoggle_group = vim.api.nvim_create_augroup("numbertoggle", { clear = true }) vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" }, { @@ -79,10 +74,8 @@ function toggle_terminal() end if term_bufnr then - -- If terminal is open, close it vim.api.nvim_buf_delete(term_bufnr, { force = true }) else - -- If terminal is not open, open it in a vertical split vim.cmd("vsplit | terminal") end end From 2b63eb0c67170c0d4d8dc4f819bce47b07189e5b Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 17:36:16 +0200 Subject: [PATCH 180/280] Update git smart log --- scripts/git-smart-log.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/git-smart-log.ts b/scripts/git-smart-log.ts index 482ad5b..64ca626 100755 --- a/scripts/git-smart-log.ts +++ b/scripts/git-smart-log.ts @@ -67,7 +67,7 @@ const formatedCommits = sortedCommits.map(commit => { const formatedDate = new Date(commit.date).toLocaleTimeString() return { - branch: textElipsis(commit.branch, 20), + branch: textElipsis(commit.branch, 40), author: textElipsis(commit.author_name, 10), hash: commit.hash.slice(0, 7), date: formatedDate, From 0648875062ff68a80659217ff07d774c88523d35 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 17:54:57 +0200 Subject: [PATCH 181/280] Update plugins --- .config/nvim/lazy-lock.json | 3 +++ .config/nvim/lua/plugins/colorscheme.lua | 16 ++++++++-------- .config/nvim/lua/plugins/grug.lua | 13 +++++++++++++ .config/nvim/lua/plugins/mini-cursorword.lua | 10 ++++++++++ .config/nvim/lua/plugins/oil.lua | 2 +- .config/nvim/lua/settings.lua | 1 + 6 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 .config/nvim/lua/plugins/grug.lua create mode 100644 .config/nvim/lua/plugins/mini-cursorword.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index e31786e..e4553e4 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -9,10 +9,12 @@ "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, + "grug-far.nvim": { "branch": "main", "commit": "b7c2b28e49d55ff71cd9bb3ad19a2021316510d8" }, "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, + "mini.cursorword": { "branch": "main", "commit": "7d1b38a17834acbbc4feff8e42aedc4ed0c6ff06" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, "neotest": { "branch": "master", "commit": "48f8b5fce704594eb0ff94338e080defca14f0dc" }, "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, @@ -30,6 +32,7 @@ "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "solarized.nvim": { "branch": "main", "commit": "1293bec92289d9431fb0ede0b627de8ab60b895e" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" }, "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" } diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index dfa2684..91ace03 100644 --- a/.config/nvim/lua/plugins/colorscheme.lua +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -1,12 +1,12 @@ return { - -- { - -- "tiagovla/tokyodark.nvim", - -- lazy = false, - -- priority = 1000, - -- config = function() - -- vim.cmd("colorscheme tokyodark") - -- end, - -- }, + { + "tiagovla/tokyodark.nvim", + lazy = false, + priority = 1000, + config = function() + -- vim.cmd("colorscheme tokyodark") + end, + }, { "maxmx03/solarized.nvim", lazy = false, diff --git a/.config/nvim/lua/plugins/grug.lua b/.config/nvim/lua/plugins/grug.lua new file mode 100644 index 0000000..f992a1a --- /dev/null +++ b/.config/nvim/lua/plugins/grug.lua @@ -0,0 +1,13 @@ +return { + 'MagicDuck/grug-far.nvim', + config = function() + require('grug-far').setup({}); + end, + keys = { + { "Rf",function() require("grug-far").open() end}, + { "Rw", function() + require('grug-far').open({ prefills = { search = vim.fn.expand("") } }) + end + } +} +} diff --git a/.config/nvim/lua/plugins/mini-cursorword.lua b/.config/nvim/lua/plugins/mini-cursorword.lua new file mode 100644 index 0000000..1591d08 --- /dev/null +++ b/.config/nvim/lua/plugins/mini-cursorword.lua @@ -0,0 +1,10 @@ +return { + "echasnovski/mini.cursorword", + version = false, + lazy = false, + config = function() + require('mini.cursorword').setup({ + delay = 10, + }) + end +} diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index 5089a60..405aff4 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -1,7 +1,7 @@ return { "stevearc/oil.nvim", dependencies = { { "echasnovski/mini.icons", opts = {} } }, - lazy = false, + lazy = false, -- nvim /dir/name does not work otherwise config = function() require("oil").setup({ columns = { diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index cc0ec13..96129e9 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -1,4 +1,5 @@ vim.g.mapleader = " " +vim.g.maplocalleader = ',' vim.opt.cursorline = true vim.opt.cursorcolumn = true vim.opt.termguicolors = true From bdacd2d66e04f33682d7e1a22f0a99b16c60ddfd Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 17:57:14 +0200 Subject: [PATCH 182/280] Do something very stupid with zshrc --- .zshrc | 454 ++++++++++++++++++--------------------------------------- 1 file changed, 138 insertions(+), 316 deletions(-) diff --git a/.zshrc b/.zshrc index e66003c..87d9f1b 100644 --- a/.zshrc +++ b/.zshrc @@ -1,324 +1,146 @@ source ~/.import-secrets.sh +export EDITOR=nvim +export BETTER_ERRORS_EDITOR=nvim +export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES set -o vi -if [ "$TERM_PROGRAM" = "WarpTerminal" ] && [ "$TERMINAL_EMULATOR" != "JetBrains-JediTerm" ]; then - printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "zsh"}}\x9c' -fi + . ~/.asdf/plugins/java/set-java-home.zsh -. ~/.asdf/plugins/java/set-java-home.zsh -PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH" -export PATH="$HOME/.asdf/installs/ruby/latest/bin:$PATH" -export PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH" -export PATH="$HOME/.tmux/plugins/tmuxifier/bin:$PATH" -export PATH="$HOME/.jenv/bin:$PATH" -export PATH="~/renuo/personal/rails-generator/bin:$PATH" -export PATH="~/.asdf/shims/:$PATH" -export BUN_INSTALL="$HOME/.bun" -export PATH="$BUN_INSTALL/bin:$PATH" -export PATH=~/dev/flutter/bin:$PATH -export PATH="/Users/dani/.gem/:$PATH" -export PATH="/opt/homebrew/opt/ruby/bin:$PATH" -export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES # fix libcurl error -export EDITOR="nvim" -unset LIBRARY_PATH -unset LDFLAGS + unset LIBRARY_PATH + unset LDFLAGS -source $HOMEBREW_PREFIX/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh -source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc" -source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc" +. /opt/homebrew/opt/asdf/libexec/asdf.sh -[ -s "/Users/dani/.bun/_bun" ] && source "/Users/dani/.bun/_bun" +source $HOMEBREW_PREFIX/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh +# source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc" +#source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc" + [ -s "/Users/dani/.bun/_bun" ] && source "/Users/dani/.bun/_bun" source /opt/homebrew/opt/autojump/etc/autojump.sh -source "$HOME/.cargo/env" -source /opt/homebrew/opt/asdf/libexec/asdf.sh - -eval "$(fzf --zsh)" -bindkey -r "^t" # Unbind fzf keybinding - -eval "$(tmuxifier init -)" - -alias ls="eza" -alias l="eza -lah" -alias lh="eza -lah | grep -E ' \.\w+$'" # [l]ist [h]idden -function go() { ~/scripts/open-repo-in-browser.ts } -function gtable() { ~/scripts/git-smart-log.ts $@ } -function gitcopy() { ~/scripts/copy_remote_to_clipboard.sh } -function cscript() { ~/scripts/create_executable_script.sh } -function timelog() { ~/scripts/index.ts } -function openticket() { ~/scripts/open-ticket-in-browser.ts } -function ot() { ~/scripts/open-ticket-in-browser.ts } -function prt() { ~/scripts/get-pr-template.ts } -function cpt() { ~/scripts/copy-ticket-number.ts } -function rsf() { - file=$(find spec/**/*_spec.rb | fzf --preview 'bat --color "always" {}') - echo "bundle exec rspec $file" - print -S "bundle exec rspec $file" - bundle exec rspec $file -} # [r]spec [s]earch [f]ile -function vg() { nvim $(fzf) } # [v]im [g]rep -function prokill() { - port=$1 - process=$(lsof -i :$port | fzf | awk '{print $2}') - kill $process -} # [k]ill [p]rocess - -function cached_routes() { - if ( [ ! -f config/routes.rb ]); then - echo "No routes file found" - return "Empty" - fi - - - if ( [ ! -f tmp/cache/routes-$(md5 -q config/routes.rb).txt ] ); then - bundle exec rails routes > tmp/cache/routes-$(md5 -q config/routes.rb).txt - fi - - cat tmp/cache/routes-$(md5 -q config/routes.rb).txt -} - -reimport_abbr() { - rm -rf $ABBR_TMPDIR - rm $ABBR_USER_ABBREVIATIONS_FILE - abbr import-aliases -} - -backup_directory() { - if [ -z "$1" ]; then - echo "Please provide a directory to backup" - return - fi - - directory_name_with_timestamp_suffix=$1-$(date +%Y-%m-%d:%H:%M:%S) - cp -r "$1" "$directory_name_with_timestamp_suffix" - printf "Backup created at $directory_name_with_timestamp_suffix" -} - -parallel_exec() { - # Example usage: - # parallel_exec "sleep 1" "echo 'Hello, World!'" "ls -l" - - trap 'kill $(jobs -p)' SIGINT SIGTERM # Kill child processes on interrupt or termination - for cmd in "$@"; do - eval "$cmd" & - done - wait -} - -alias '~'='cd ~' -alias '..'='cd ..' -alias '...'='cd ../../' -alias '....'='cd ../../../' -alias '.....'='cd ../../../../' -alias '......'='cd ../../../../../' - -function rr() { rustc "$@.rs" && ./"$@"} # [r]ust [r]un -function rgs() { rg --json -C 2 "$@" | delta } # [r]ip[g]rep [s]earch - -alias zshrc='nvim ~/.zshrc' # Idea from Chris -alias calacritty='nvim ~/.config/alacritty/alacritty.toml' -alias ckitty='nvim ~/.config/kitty/kitty.conf' -alias ctmux='nvim ~/.tmux.conf' -alias clazygit='nvim ~/Library/Application\ Support/lazygit/config.yml' -alias cneovide='nvim ~/.config/neovide/config.toml' -alias chypr='nvim ~/.config/hypr/hyprland.conf' -alias cnix="sudo nvim /etc/nixos/configuration.nix" -alias nxs="sudo nixos-rebuild switch" -alias nv='neovide' -alias cgit='nvim ~/.gitconfig' -alias kts='tmux kill-server' # [k]ill [t]mux [s]erver -alias v='nvim' -alias cpp='pbcopy' -alias bo='tectonic -X build && open build/default/default.pdf' # [b]uild and [o]pen -alias bno='tectonic -X build' # [b]uild and do[n]'t [o]pen -alias g="grep" # [g]rep -alias myip="ipconfig getifaddr en0" -alias pubip="dig +short myip.opendns.com @resolver1.opendns.com -4" # borrowed from raphi -alias bra="bundle exec rubocop -A" # [b]undle exec [r]ubocop -[A] -alias spec="be rspec" -alias f="fork ." -alias cnvim="cd ~/.config/nvim && nvim init.lua" # [c]onfigure [nvim] -alias yabairc="v ~/.yabairc" -alias skhdrc="v ~/.config/skhd/skhdrc" -alias dbreset="bundle exec rails db:drop db:create db:schema:load db:seed" # [d]ata[b]ase [reset] -alias bsf="bundle exec standardrb --fix" -alias change_theme="~/.config/change_theme.sh > /dev/null" -alias cpb="git branch | grep '*' | tr -d '*' | tr -d ' ' | pbcopy" # [c]o[p]y [b]ranch to clipboard -alias tks="tmux kill-server" # [t]mux [k]ill [s]erver -alias crc="cargo r -r --bin client" -alias crs="cargo r -r --bin server" -alias fastfetch="cat ~/.config/fastfetch/logo.txt | fastfetch --file - --logo-color-1 magenta" -alias ff="fastfetch" -alias listfonts="fc-list | sed 's/.*:\s*\([^:]*\):.*/\1/' | tr ',' '\n' | sed 's/^[ \t]*//;s/[ \t]*$//' | sort | uniq" # https://stackoverflow.com/questions/57473124/how-to-find-all-available-fonts-on-osx-using-the-default-shell -function rkill() { "kill $(cat tmp/pids/server.pid)" } - -#alias glog="git log --oneline | grep -v -e '^\s*$' --color=always | less --use-color" # [g]it [log] -alias glog="git log --oneline" -alias glag="glog_ --all --since='00:00' --until='NOW' | grep -v -e '^\s*$' --color=always" # [g]it [l]og [a]ll [g]rep -alias gb="if ( git branch | grep '* develop' ); then; git checkout -b ; else; echo 'You can only start a new feature from the development branch' ;fi;" # [g]it [b]ranch -alias gs="git status" # [g]it [s]tatus -alias gso="git show" # [g]it [s]how -alias gp="git push" # [g]it [p]ush -alias gpp="git pull && git push" # [g]it [p]ull and [p]ush -alias gpl="git pull" # [g]it [p]u[l]l -alias gc="git commit" # [g]it [c]ommit -alias ga="git add" # [g]it [a]dd -alias gac="git add . && git commit" # [g]it [a]dd and [c]ommit -alias lg="lazygit" # [l]azy[g]it -alias gcl="git clone" # [g]it [cl]one -alias gss="git stash" # [g]it [s]tash [s]ave -alias cl="clear" # [cl]ear -# IDEA: gsf TICKET NAME => git checkout -b feature/TICKET-NAME + check if user on develop -# IDEA: grd => git pull origin develop && fork . => rebase - -alias python="python3" -alias o="open" -alias q="exit" -alias be="bundle exec" -alias qlf='qlmanage -p "$@"' -alias mine='rubymine .' -alias m='rubymine .' -alias bs="bin/setup" -alias bc="bin/check" -alias br="bin/run" -alias bd="bin/dev" -alias yd="yarn dev" -alias yt="yarn test" -alias brc="be rspec --format doc" # [b]undle [e]xec run [c]hecks -alias nvimc="cd ~/.config/nvim && nvim ." -alias gcf="git checkout -b feature/" -alias rr="rails routes | rg" -alias c="code" -alias bat="bat --style plain --theme OneHalfDark" -alias cat="bat" -alias gdu="git diff @{upstream}" -alias spf="~/bin/spf" -alias clines="find . -type f -name '*.txt' -exec wc -l {} +" - -alias gch="git checkout" - -alias gcf="git checkout -b feature/" - -compinit -C - -# BEGIN zsh-sticky-prompt -# ZLE_STICKY_PROMPT_LEFT="" -# ZLE_STICKY_PROMPT_RIGHT="" -# -# sticky-prompt-zle-line-init() { -# LBUFFER="$ZLE_STICKY_PROMPT_LEFT" -# RBUFFER="$ZLE_STICKY_PROMPT_RIGHT" -# zle _zle-line-init -# } -# -# sticky-prompt-set() { -# if [[ -z "$BUFFER" ]]; then -# if [[ -z "$ZLE_STICKY_PROMPT_LEFT" ]]; then -# zle -M "No sticky prompt set." -# else -# ZLE_STICKY_PROMPT_LEFT="" -# ZLE_STICKY_PROMPT_RIGHT="" -# zle -M "Removed sticky prompt." -# fi -# return -# fi -# -# local ZLE_STICKY_PROMPT_PREV_LEFT="$ZLE_STICKY_PROMPT_LEFT" -# local ZLE_STICKY_PROMPT_PREV_RIGHT="$ZLE_STICKY_PROMPT_RIGHT" -# ZLE_STICKY_PROMPT_LEFT="$LBUFFER" -# ZLE_STICKY_PROMPT_RIGHT="$RBUFFER" -# -# if { [[ -n "$ZLE_STICKY_PROMPT_LEFT" ]] && [[ "$ZLE_STICKY_PROMPT_PREV_LEFT" != "$ZLE_STICKY_PROMPT_LEFT" ]]; } || -# { [[ -n "$ZLE_STICKY_PROMPT_RIGHT" ]] && [[ "$ZLE_STICKY_PROMPT_PREV_RIGHT" != "$ZLE_STICKY_PROMPT_RIGHT" ]]; }; then -# zle -M "Sticky prompt $ZLE_STICKY_PROMPT_LEFT|$ZLE_STICKY_PROMPT_RIGHT" -# else -# ZLE_STICKY_PROMPT_LEFT="" -# ZLE_STICKY_PROMPT_RIGHT="" -# BUFFER="" -# zle -M "Removed sticky prompt." -# fi -# } -# -# sticky-prompt-accept-line() { -# if [[ -z "$BUFFER" ]] && [[ -n "$ZLE_STICKY_PROMPT_LEFT" ]]; then -# ZLE_STICKY_PROMPT_LEFT="" -# ZLE_STICKY_PROMPT_RIGHT="" -# zle -M "Removed sticky prompt." -# fi -# zle .accept-line -# } -# -# functions[_zle-line-init]="${functions[zle-line-init]}" -# zle -N _zle-line-init -# zle -N zle-line-init sticky-prompt-zle-line-init -# zle -N sticky-prompt-set -# zle -N accept-line sticky-prompt-accept-line -# bindkey '^F' sticky-prompt-set - -# END zsh-sticky-prompt - -### Added by Zinit's installer -if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then - print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" - command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" - command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ - print -P "%F{33} %F{34}Installation successful.%f%b" || \ - print -P "%F{160} The clone has failed.%f%b" -fi - -source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" -autoload -Uz _zinit -(( ${+_comps} )) && _comps[zinit]=_zinit - -# Load a few important annexes, without Turbo -# (this is currently required for annexes) -zinit light-mode for \ - zdharma-continuum/zinit-annex-as-monitor \ - zdharma-continuum/zinit-annex-bin-gem-node \ - zdharma-continuum/zinit-annex-patch-dl \ - zdharma-continuum/zinit-annex-rust - -### End of Zinit's installer chunk - -# Load pure theme -zinit ice pick"async.zsh" src"pure.zsh" # with zsh-async library that's bundled with it. -zinit light sindresorhus/pure - -PATH=~/.console-ninja/.bin:$PATH - -renuo-cli() { - initial_directory=$(pwd) - cd ~/renuo-cli - trap "cd $initial_directory" EXIT - ruby -Ilib ./bin/renuo "$@" -} - -renuo-cli-hack() { - local current_ruby_version=$(asdf current ruby | awk '{print $2}') - - local tool_versions_exists=false - [ -f .tool-versions ] && tool_versions_exists=true - - local ruby_in_tool_versions=false - grep -q "ruby" .tool-versions && ruby_in_tool_versions=true - - asdf local ruby 3.2.3 - renuo "$@" - - if ! $tool_versions_exists; then - rm .tool-versions - elif ! $ruby_in_tool_versions; then - sed -i '' '/ruby/d' .tool-versions - else - asdf local ruby $current_ruby_version - fi -} - -# Update history -HISTSIZE=100000 # Size of in-memory history (you can set this to a large number) -SAVEHIST=1000000 # Size of history saved to file (set to the same or a large number) -HISTFILE=~/.zsh_history # Location of history file -setopt APPEND_HISTORY # Append to history file instead of overwriting -setopt HIST_IGNORE_DUPS # Ignore duplicate commands in history -setopt HIST_IGNORE_ALL_DUPS # Remove all previous duplicate entries -setopt HIST_REDUCE_BLANKS # Remove superfluous blanks in command +# source /opt/homebrew/opt/asdf/libexec/asdf.sh + #source "$HOME/.cargo/env" + + # eval "$(fzf --zsh)" + # bindkey -r "^t" # Unbind fzf keybinding + + function go() { ~/scripts/open-repo-in-browser.ts } + function gtable() { ~/scripts/git-smart-log.ts $@ } + function gitcopy() { ~/scripts/copy_remote_to_clipboard.sh } + function cscript() { ~/scripts/create_executable_script.sh } + function timelog() { ~/scripts/index.ts } + function openticket() { ~/scripts/open-ticket-in-browser.ts } + function ot() { ~/scripts/open-ticket-in-browser.ts } + function prt() { ~/scripts/get-pr-template.ts } + function cpt() { ~/scripts/copy-ticket-number.ts } + function rsf() { + file=$(find spec/**/*_spec.rb | fzf --preview 'bat --color "always" {}') + echo "bundle exec rspec $file" + print -S "bundle exec rspec $file" + bundle exec rspec $file + } # [r]spec [s]earch [f]ile + function jsf() { + file=$(find ./**/*.java | fzf --preview 'bat --color "always" {}') + echo "java $file" + print -S "java $file" + java $file + } # [r]spec [s]earch [f]ile + function vg() { nvim $(fzf) } # [v]im [g]rep + function prokill() { + port=$1 + process=$(lsof -i :$port | fzf | awk '{print $2}') + kill $process + } # [k]ill [p]rocess + + function cached_routes() { + if ( [ ! -f config/routes.rb ]); then + echo "No routes file found" + return "Empty" + fi + + + if ( [ ! -f tmp/cache/routes-$(md5 -q config/routes.rb).txt ] ); then + bundle exec rails routes > tmp/cache/routes-$(md5 -q config/routes.rb).txt + fi + + cat tmp/cache/routes-$(md5 -q config/routes.rb).txt + } + + reimport_abbr() { + rm -rf $ABBR_TMPDIR + rm $ABBR_USER_ABBREVIATIONS_FILE + abbr import-aliases + } + + backup_directory() { + if [ -z "$1" ]; then + echo "Please provide a directory to backup" + return + fi + + directory_name_with_timestamp_suffix=$1-$(date +%Y-%m-%d:%H:%M:%S) + cp -r "$1" "$directory_name_with_timestamp_suffix" + printf "Backup created at $directory_name_with_timestamp_suffix" + } + + parallel_exec() { + # Example usage: + # parallel_exec "sleep 1" "echo 'Hello, World!'" "ls -l" + + trap 'kill $(jobs -p)' SIGINT SIGTERM # Kill child processes on interrupt or termination + for cmd in "$@"; do + eval "$cmd" & + done + wait + } + + + function rr() { rustc "$@.rs" && ./"$@"} # [r]ust [r]un + function rgs() { rg --json -C 2 "$@" | delta } # [r]ip[g]rep [s]earch + + function rkill() { "kill $(cat tmp/pids/server.pid)" } + + # # IDEA: gsf TICKET NAME => git checkout -b feature/TICKET-NAME + check if user on develop + # IDEA: grd => git pull origin develop && fork . => rebase + + + # compinit -C + + # Update history + HISTSIZE=100000 # Size of in-memory history (you can set this to a large number) + SAVEHIST=1000000 # Size of history saved to file (set to the same or a large number) + HISTFILE=~/.zsh_history # Location of history file + setopt APPEND_HISTORY # Append to history file instead of overwriting + setopt HIST_IGNORE_DUPS # Ignore duplicate commands in history + setopt HIST_IGNORE_ALL_DUPS # Remove all previous duplicate entries + setopt HIST_REDUCE_BLANKS # Remove superfluous blanks in command + + # Added by Zinit's installer + if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then + print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" + command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" + command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ + print -P "%F{33} %F{34}Installation successful.%f%b" || \ + print -P "%F{160} The clone has failed.%f%b" + fi + + source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" + autoload -Uz _zinit + (( ${+_comps} )) && _comps[zinit]=_zinit + + # Load a few important annexes, without Turbo + # (this is currently required for annexes) + zinit light-mode for \ + zdharma-continuum/zinit-annex-as-monitor \ + zdharma-continuum/zinit-annex-bin-gem-node \ + zdharma-continuum/zinit-annex-patch-dl \ + zdharma-continuum/zinit-annex-rust + + ### End of Zinit's installer chunk + + # Load pure theme + zinit ice pick"async.zsh" src"pure.zsh" # with zsh-async library that's bundled with it. + zinit light sindresorhus/pure + +# bun +export BUN_INSTALL="$HOME/.bun" +export PATH="$BUN_INSTALL/bin:$PATH" From 3683ab85cbd4e1812e528f076dbdffd1778efefa Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 18:02:10 +0200 Subject: [PATCH 183/280] Split up zshrc --- .zsh/aliases.sh | 85 ++++++++++++++++++++++++++++++++++++++++ .zsh/exports.sh | 6 +++ .zsh/utils.sh | 74 +++++++++++++++++++++++++++++++++++ .zshrc | 102 ++---------------------------------------------- 4 files changed, 169 insertions(+), 98 deletions(-) create mode 100644 .zsh/aliases.sh create mode 100644 .zsh/exports.sh create mode 100644 .zsh/utils.sh diff --git a/.zsh/aliases.sh b/.zsh/aliases.sh new file mode 100644 index 0000000..d2b7a2e --- /dev/null +++ b/.zsh/aliases.sh @@ -0,0 +1,85 @@ +alias '~'='cd ~' +alias '..'='cd ..' +alias '...'='cd ../../' +alias '....'='cd ../../../' +alias '.....'='cd ../../../../' +alias '......'='cd ../../../../../' +alias ls="eza" +alias l="eza -lah" +alias lh="eza -lah | grep -E ' \.\w+$'" # [l]ist [h]idden +alias zshrc='nvim ~/.zshrc' # Idea from Chris +alias calacritty='nvim ~/.config/alacritty/alacritty.toml' +alias ckitty='nvim ~/.config/kitty/kitty.conf' +alias ctmux='nvim ~/.tmux.conf' +alias clazygit='nvim ~/Library/Application\ Support/lazygit/config.yml' +alias cneovide='nvim ~/.config/neovide/config.toml' +alias chypr='nvim ~/.config/hypr/hyprland.conf' +alias cnix="sudo nvim /etc/nixos/configuration.nix" +alias nxs="sudo nixos-rebuild switch" +alias nv='neovide' +alias cgit='nvim ~/.gitconfig' +alias kts='tmux kill-server' # [k]ill [t]mux [s]erver +alias v='nvim' +alias cpp='pbcopy' +alias bo='tectonic -X build && open build/default/default.pdf' # [b]uild and [o]pen +alias bno='tectonic -X build' # [b]uild and do[n]'t [o]pen +alias g="grep" # [g]rep +alias myip="ipconfig getifaddr en0" +alias pubip="dig +short myip.opendns.com @resolver1.opendns.com -4" # borrowed from raphi +alias bra="bundle exec rubocop -A" # [b]undle exec [r]ubocop -[A] +alias spec="be rspec" +alias f="fork ." +alias cnvim="cd ~/.config/nvim && nvim init.lua" # [c]onfigure [nvim] +alias yabairc="v ~/.yabairc" +alias skhdrc="v ~/.config/skhd/skhdrc" +alias dbreset="bundle exec rails db:drop db:create db:schema:load db:seed" # [d]ata[b]ase [reset] +alias bsf="bundle exec standardrb --fix" +alias change_theme="~/.config/change_theme.sh > /dev/null" +alias cpb="git branch | grep '*' | tr -d '*' | tr -d ' ' | pbcopy" # [c]o[p]y [b]ranch to clipboard +alias tks="tmux kill-server" # [t]mux [k]ill [s]erver +alias crc="cargo r -r --bin client" +alias crs="cargo r -r --bin server" +alias fastfetch="cat ~/.config/fastfetch/logo.txt | fastfetch --file - --logo-color-1 magenta" +alias ff="fastfetch" +alias listfonts="fc-list | sed 's/.*:\s*\([^:]*\):.*/\1/' | tr ',' '\n' | sed 's/^[ \t]*//;s/[ \t]*$//' | sort | uniq" # https://stackoverflow.com/questions/57473124/how-to-find-all-available-fonts-on-osx-using-the-default-shell +#alias glog="git log --oneline | grep -v -e '^\s*$' --color=always | less --use-color" # [g]it [log] +alias glog="git log --oneline" +alias glag="glog_ --all --since='00:00' --until='NOW' | grep -v -e '^\s*$' --color=always" # [g]it [l]og [a]ll [g]rep +alias gb="if ( git branch | grep '* develop' ); then; git checkout -b ; else; echo 'You can only start a new feature from the development branch' ;fi;" # [g]it [b]ranch +alias gs="git status" # [g]it [s]tatus +alias gso="git show" # [g]it [s]how +alias gp="git push" # [g]it [p]ush +alias gpp="git pull && git push" # [g]it [p]ull and [p]ush +alias gpl="git pull" # [g]it [p]u[l]l +alias gc="git commit" # [g]it [c]ommit +alias ga="git add" # [g]it [a]dd +alias gac="git add . && git commit" # [g]it [a]dd and [c]ommit +alias lg="lazygit" # [l]azy[g]it +alias gcl="git clone" # [g]it [cl]one +alias gss="git stash" # [g]it [s]tash [s]ave +alias cl="clear" # [cl]ear +alias python="python3" +alias o="open" +alias q="exit" +alias be="bundle exec" +alias qlf='qlmanage -p "$@"' +alias mine='rubymine .' +alias m='rubymine .' +alias bs="bin/setup" +alias bc="bin/check" +alias br="bin/run" +alias bd="bin/dev" +alias yd="yarn dev" +alias yt="yarn test" +alias brc="be rspec --format doc" # [b]undle [e]xec run [c]hecks +alias nvimc="cd ~/.config/nvim && nvim ." +alias gcf="git checkout -b feature/" +alias rr="rails routes | rg" +alias c="code" +alias bat="bat --style plain --theme OneHalfDark" +alias cat="bat" +alias gdu="git diff @{upstream}" +alias spf="~/bin/spf" +alias clines="find . -type f -name '*.txt' -exec wc -l {} +" +alias gch="git checkout" +alias gcf="git checkout -b feature/" diff --git a/.zsh/exports.sh b/.zsh/exports.sh new file mode 100644 index 0000000..8654300 --- /dev/null +++ b/.zsh/exports.sh @@ -0,0 +1,6 @@ +export EDITOR=nvim +export BETTER_ERRORS_EDITOR=nvim +export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES + +export BUN_INSTALL="$HOME/.bun" +export PATH="$BUN_INSTALL/bin:$PATH" diff --git a/.zsh/utils.sh b/.zsh/utils.sh new file mode 100644 index 0000000..2c41e14 --- /dev/null +++ b/.zsh/utils.sh @@ -0,0 +1,74 @@ + function go() { ~/scripts/open-repo-in-browser.ts } + function gtable() { ~/scripts/git-smart-log.ts $@ } + function gitcopy() { ~/scripts/copy_remote_to_clipboard.sh } + function cscript() { ~/scripts/create_executable_script.sh } + function timelog() { ~/scripts/index.ts } + function openticket() { ~/scripts/open-ticket-in-browser.ts } + function ot() { ~/scripts/open-ticket-in-browser.ts } + function prt() { ~/scripts/get-pr-template.ts } + function cpt() { ~/scripts/copy-ticket-number.ts } + function rsf() { + file=$(find spec/**/*_spec.rb | fzf --preview 'bat --color "always" {}') + echo "bundle exec rspec $file" + print -S "bundle exec rspec $file" + bundle exec rspec $file + } # [r]spec [s]earch [f]ile + function jsf() { + file=$(find ./**/*.java | fzf --preview 'bat --color "always" {}') + echo "java $file" + print -S "java $file" + java $file + } # [r]spec [s]earch [f]ile + function vg() { nvim $(fzf) } # [v]im [g]rep + function prokill() { + port=$1 + process=$(lsof -i :$port | fzf | awk '{print $2}') + kill $process + } # [k]ill [p]rocess + + function cached_routes() { + if ( [ ! -f config/routes.rb ]); then + echo "No routes file found" + return "Empty" + fi + + + if ( [ ! -f tmp/cache/routes-$(md5 -q config/routes.rb).txt ] ); then + bundle exec rails routes > tmp/cache/routes-$(md5 -q config/routes.rb).txt + fi + + cat tmp/cache/routes-$(md5 -q config/routes.rb).txt + } + + reimport_abbr() { + rm -rf $ABBR_TMPDIR + rm $ABBR_USER_ABBREVIATIONS_FILE + abbr import-aliases + } + + backup_directory() { + if [ -z "$1" ]; then + echo "Please provide a directory to backup" + return + fi + + directory_name_with_timestamp_suffix=$1-$(date +%Y-%m-%d:%H:%M:%S) + cp -r "$1" "$directory_name_with_timestamp_suffix" + printf "Backup created at $directory_name_with_timestamp_suffix" + } + + parallel_exec() { + # Example usage: + # parallel_exec "sleep 1" "echo 'Hello, World!'" "ls -l" + + trap 'kill $(jobs -p)' SIGINT SIGTERM # Kill child processes on interrupt or termination + for cmd in "$@"; do + eval "$cmd" & + done + wait + } + + + function rr() { rustc "$@.rs" && ./"$@"} # [r]ust [r]un + function rgs() { rg --json -C 2 "$@" | delta } # [r]ip[g]rep [s]earch + function rkill() { "kill $(cat tmp/pids/server.pid)" } diff --git a/.zshrc b/.zshrc index 87d9f1b..5a9a8e9 100644 --- a/.zshrc +++ b/.zshrc @@ -1,8 +1,5 @@ source ~/.import-secrets.sh -export EDITOR=nvim -export BETTER_ERRORS_EDITOR=nvim -export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES set -o vi . ~/.asdf/plugins/java/set-java-home.zsh @@ -20,90 +17,9 @@ source /opt/homebrew/opt/autojump/etc/autojump.sh # source /opt/homebrew/opt/asdf/libexec/asdf.sh #source "$HOME/.cargo/env" - # eval "$(fzf --zsh)" - # bindkey -r "^t" # Unbind fzf keybinding - - function go() { ~/scripts/open-repo-in-browser.ts } - function gtable() { ~/scripts/git-smart-log.ts $@ } - function gitcopy() { ~/scripts/copy_remote_to_clipboard.sh } - function cscript() { ~/scripts/create_executable_script.sh } - function timelog() { ~/scripts/index.ts } - function openticket() { ~/scripts/open-ticket-in-browser.ts } - function ot() { ~/scripts/open-ticket-in-browser.ts } - function prt() { ~/scripts/get-pr-template.ts } - function cpt() { ~/scripts/copy-ticket-number.ts } - function rsf() { - file=$(find spec/**/*_spec.rb | fzf --preview 'bat --color "always" {}') - echo "bundle exec rspec $file" - print -S "bundle exec rspec $file" - bundle exec rspec $file - } # [r]spec [s]earch [f]ile - function jsf() { - file=$(find ./**/*.java | fzf --preview 'bat --color "always" {}') - echo "java $file" - print -S "java $file" - java $file - } # [r]spec [s]earch [f]ile - function vg() { nvim $(fzf) } # [v]im [g]rep - function prokill() { - port=$1 - process=$(lsof -i :$port | fzf | awk '{print $2}') - kill $process - } # [k]ill [p]rocess - - function cached_routes() { - if ( [ ! -f config/routes.rb ]); then - echo "No routes file found" - return "Empty" - fi - - - if ( [ ! -f tmp/cache/routes-$(md5 -q config/routes.rb).txt ] ); then - bundle exec rails routes > tmp/cache/routes-$(md5 -q config/routes.rb).txt - fi - - cat tmp/cache/routes-$(md5 -q config/routes.rb).txt - } - - reimport_abbr() { - rm -rf $ABBR_TMPDIR - rm $ABBR_USER_ABBREVIATIONS_FILE - abbr import-aliases - } - - backup_directory() { - if [ -z "$1" ]; then - echo "Please provide a directory to backup" - return - fi - - directory_name_with_timestamp_suffix=$1-$(date +%Y-%m-%d:%H:%M:%S) - cp -r "$1" "$directory_name_with_timestamp_suffix" - printf "Backup created at $directory_name_with_timestamp_suffix" - } - - parallel_exec() { - # Example usage: - # parallel_exec "sleep 1" "echo 'Hello, World!'" "ls -l" - - trap 'kill $(jobs -p)' SIGINT SIGTERM # Kill child processes on interrupt or termination - for cmd in "$@"; do - eval "$cmd" & - done - wait - } - - - function rr() { rustc "$@.rs" && ./"$@"} # [r]ust [r]un - function rgs() { rg --json -C 2 "$@" | delta } # [r]ip[g]rep [s]earch - - function rkill() { "kill $(cat tmp/pids/server.pid)" } - - # # IDEA: gsf TICKET NAME => git checkout -b feature/TICKET-NAME + check if user on develop - # IDEA: grd => git pull origin develop && fork . => rebase - - - # compinit -C +eval "$(fzf --zsh)" +bindkey -r "^t" # Unbind fzf keybinding +compinit -C # Update history HISTSIZE=100000 # Size of in-memory history (you can set this to a large number) @@ -114,7 +30,6 @@ source /opt/homebrew/opt/autojump/etc/autojump.sh setopt HIST_IGNORE_ALL_DUPS # Remove all previous duplicate entries setopt HIST_REDUCE_BLANKS # Remove superfluous blanks in command - # Added by Zinit's installer if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" @@ -127,20 +42,11 @@ source /opt/homebrew/opt/autojump/etc/autojump.sh autoload -Uz _zinit (( ${+_comps} )) && _comps[zinit]=_zinit - # Load a few important annexes, without Turbo - # (this is currently required for annexes) zinit light-mode for \ zdharma-continuum/zinit-annex-as-monitor \ zdharma-continuum/zinit-annex-bin-gem-node \ zdharma-continuum/zinit-annex-patch-dl \ zdharma-continuum/zinit-annex-rust - ### End of Zinit's installer chunk - - # Load pure theme - zinit ice pick"async.zsh" src"pure.zsh" # with zsh-async library that's bundled with it. + zinit ice pick"async.zsh" src"pure.zsh" zinit light sindresorhus/pure - -# bun -export BUN_INSTALL="$HOME/.bun" -export PATH="$BUN_INSTALL/bin:$PATH" From d697fe67e2a31e7e2cdc6bbc867a2a4768614e29 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 18:09:15 +0200 Subject: [PATCH 184/280] Improve zshrc config --- .zsh/history.sh | 7 +++++++ .zsh/homebrew.sh | 11 +++++++++++ .zsh/zinit.sh | 20 +++++++++++++++++++ .zshrc | 50 ++++++------------------------------------------ 4 files changed, 44 insertions(+), 44 deletions(-) create mode 100644 .zsh/history.sh create mode 100644 .zsh/homebrew.sh create mode 100644 .zsh/zinit.sh diff --git a/.zsh/history.sh b/.zsh/history.sh new file mode 100644 index 0000000..318986a --- /dev/null +++ b/.zsh/history.sh @@ -0,0 +1,7 @@ +HISTSIZE=100000 +SAVEHIST=1000000 +HISTFILE=~/.zsh_history +setopt APPEND_HISTORY +setopt HIST_IGNORE_DUPS +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_REDUCE_BLANKS diff --git a/.zsh/homebrew.sh b/.zsh/homebrew.sh new file mode 100644 index 0000000..7cbff34 --- /dev/null +++ b/.zsh/homebrew.sh @@ -0,0 +1,11 @@ +. /opt/homebrew/opt/asdf/libexec/asdf.sh + +source $HOMEBREW_PREFIX/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh +# source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc" +#source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc" +source /opt/homebrew/opt/autojump/etc/autojump.sh +# source /opt/homebrew/opt/asdf/libexec/asdf.sh + +. ~/.asdf/plugins/java/set-java-home.zsh + +[ -s "/Users/dani/.bun/_bun" ] && source "/Users/dani/.bun/_bun" diff --git a/.zsh/zinit.sh b/.zsh/zinit.sh new file mode 100644 index 0000000..204e444 --- /dev/null +++ b/.zsh/zinit.sh @@ -0,0 +1,20 @@ + if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then + print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" + command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" + command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ + print -P "%F{33} %F{34}Installation successful.%f%b" || \ + print -P "%F{160} The clone has failed.%f%b" + fi + + source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" + autoload -Uz _zinit + (( ${+_comps} )) && _comps[zinit]=_zinit + + zinit light-mode for \ + zdharma-continuum/zinit-annex-as-monitor \ + zdharma-continuum/zinit-annex-bin-gem-node \ + zdharma-continuum/zinit-annex-patch-dl \ + zdharma-continuum/zinit-annex-rust + + zinit ice pick"async.zsh" src"pure.zsh" + zinit light sindresorhus/pure diff --git a/.zshrc b/.zshrc index 5a9a8e9..61bc409 100644 --- a/.zshrc +++ b/.zshrc @@ -1,52 +1,14 @@ source ~/.import-secrets.sh +source ~/.zsh/aliases.sh +source ~/.zsh/exports.sh +source ~/.zsh/history.sh +source ~/.zsh/homebrew.sh +source ~/.zsh/utils.sh +source ~/.zsh/zinit.sh set -o vi - . ~/.asdf/plugins/java/set-java-home.zsh - - unset LIBRARY_PATH - unset LDFLAGS - -. /opt/homebrew/opt/asdf/libexec/asdf.sh - -source $HOMEBREW_PREFIX/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh -# source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc" -#source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc" - [ -s "/Users/dani/.bun/_bun" ] && source "/Users/dani/.bun/_bun" -source /opt/homebrew/opt/autojump/etc/autojump.sh -# source /opt/homebrew/opt/asdf/libexec/asdf.sh - #source "$HOME/.cargo/env" - eval "$(fzf --zsh)" bindkey -r "^t" # Unbind fzf keybinding compinit -C - # Update history - HISTSIZE=100000 # Size of in-memory history (you can set this to a large number) - SAVEHIST=1000000 # Size of history saved to file (set to the same or a large number) - HISTFILE=~/.zsh_history # Location of history file - setopt APPEND_HISTORY # Append to history file instead of overwriting - setopt HIST_IGNORE_DUPS # Ignore duplicate commands in history - setopt HIST_IGNORE_ALL_DUPS # Remove all previous duplicate entries - setopt HIST_REDUCE_BLANKS # Remove superfluous blanks in command - - if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then - print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" - command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" - command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ - print -P "%F{33} %F{34}Installation successful.%f%b" || \ - print -P "%F{160} The clone has failed.%f%b" - fi - - source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" - autoload -Uz _zinit - (( ${+_comps} )) && _comps[zinit]=_zinit - - zinit light-mode for \ - zdharma-continuum/zinit-annex-as-monitor \ - zdharma-continuum/zinit-annex-bin-gem-node \ - zdharma-continuum/zinit-annex-patch-dl \ - zdharma-continuum/zinit-annex-rust - - zinit ice pick"async.zsh" src"pure.zsh" - zinit light sindresorhus/pure From d07fd38925ca97eac830ea8b9ef63b850fbca8f9 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 18:09:22 +0200 Subject: [PATCH 185/280] Add kitty bak conf --- .config/kitty/kitty.bak.conf | 2507 ++++++++++++++++++++++++++++++++++ 1 file changed, 2507 insertions(+) create mode 100644 .config/kitty/kitty.bak.conf diff --git a/.config/kitty/kitty.bak.conf b/.config/kitty/kitty.bak.conf new file mode 100644 index 0000000..2e38b8f --- /dev/null +++ b/.config/kitty/kitty.bak.conf @@ -0,0 +1,2507 @@ +# vim:fileencoding=utf-8:foldmethod=marker + +#: Fonts {{{ + +#: kitty has very powerful font management. You can configure +#: individual font faces and even specify special fonts for particular +#: characters. + +font_family jetbrains mono +bold_font auto +italic_font auto +bold_italic_font auto + +#: You can specify different fonts for the bold/italic/bold-italic +#: variants. To get a full list of supported fonts use the `kitty +#: +list-fonts` command. By default they are derived automatically, by +#: the OSes font system. When bold_font or bold_italic_font is set to +#: auto on macOS, the priority of bold fonts is semi-bold, bold, +#: heavy. Setting them manually is useful for font families that have +#: many weight variants like Book, Medium, Thick, etc. For example:: + +#: font_family Operator Mono Book +#: bold_font Operator Mono Medium +#: italic_font Operator Mono Book Italic +#: bold_italic_font Operator Mono Medium Italic + +font_size 23.0 + +#: Font size (in pts). + +# force_ltr no + +#: kitty does not support BIDI (bidirectional text), however, for RTL +#: scripts, words are automatically displayed in RTL. That is to say, +#: in an RTL script, the words "HELLO WORLD" display in kitty as +#: "WORLD HELLO", and if you try to select a substring of an RTL- +#: shaped string, you will get the character that would be there had +#: the string been LTR. For example, assuming the Hebrew word ירושלים, +#: selecting the character that on the screen appears to be ם actually +#: writes into the selection buffer the character י. kitty's default +#: behavior is useful in conjunction with a filter to reverse the word +#: order, however, if you wish to manipulate RTL glyphs, it can be +#: very challenging to work with, so this option is provided to turn +#: it off. Furthermore, this option can be used with the command line +#: program GNU FriBidi +#: to get BIDI support, because it will force kitty to always treat +#: the text as LTR, which FriBidi expects for terminals. + +# symbol_map + +#: E.g. symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 PowerlineSymbols + +#: Map the specified Unicode codepoints to a particular font. Useful +#: if you need special rendering for some symbols, such as for +#: Powerline. Avoids the need for patched fonts. Each Unicode code +#: point is specified in the form `U+`. You +#: can specify multiple code points, separated by commas and ranges +#: separated by hyphens. This option can be specified multiple times. +#: The syntax is:: + +#: symbol_map codepoints Font Family Name + +# narrow_symbols + +#: E.g. narrow_symbols U+E0A0-U+E0A3,U+E0C0-U+E0C7 1 + +#: Usually, for Private Use Unicode characters and some symbol/dingbat +#: characters, if the character is followed by one or more spaces, +#: kitty will use those extra cells to render the character larger, if +#: the character in the font has a wide aspect ratio. Using this +#: option you can force kitty to restrict the specified code points to +#: render in the specified number of cells (defaulting to one cell). +#: This option can be specified multiple times. The syntax is:: + +#: narrow_symbols codepoints [optionally the number of cells] + +# disable_ligatures never + +#: Choose how you want to handle multi-character ligatures. The +#: default is to always render them. You can tell kitty to not render +#: them when the cursor is over them by using cursor to make editing +#: easier, or have kitty never render them at all by using always, if +#: you don't like them. The ligature strategy can be set per-window +#: either using the kitty remote control facility or by defining +#: shortcuts for it in kitty.conf, for example:: + +#: map alt+1 disable_ligatures_in active always +#: map alt+2 disable_ligatures_in all never +#: map alt+3 disable_ligatures_in tab cursor + +#: Note that this refers to programming ligatures, typically +#: implemented using the calt OpenType feature. For disabling general +#: ligatures, use the font_features option. + +# font_features + +#: E.g. font_features none + +#: Choose exactly which OpenType features to enable or disable. This +#: is useful as some fonts might have features worthwhile in a +#: terminal. For example, Fira Code includes a discretionary feature, +#: zero, which in that font changes the appearance of the zero (0), to +#: make it more easily distinguishable from Ø. Fira Code also includes +#: other discretionary features known as Stylistic Sets which have the +#: tags ss01 through ss20. + +#: For the exact syntax to use for individual features, see the +#: HarfBuzz documentation . + +#: Note that this code is indexed by PostScript name, and not the font +#: family. This allows you to define very precise feature settings; +#: e.g. you can disable a feature in the italic font but not in the +#: regular font. + +#: On Linux, font features are first read from the FontConfig database +#: and then this option is applied, so they can be configured in a +#: single, central place. + +#: To get the PostScript name for a font, use `kitty +list-fonts +#: --psnames`: + +#: .. code-block:: sh + +#: $ kitty +list-fonts --psnames | grep Fira +#: Fira Code +#: Fira Code Bold (FiraCode-Bold) +#: Fira Code Light (FiraCode-Light) +#: Fira Code Medium (FiraCode-Medium) +#: Fira Code Regular (FiraCode-Regular) +#: Fira Code Retina (FiraCode-Retina) + +#: The part in brackets is the PostScript name. + +#: Enable alternate zero and oldstyle numerals:: + +#: font_features FiraCode-Retina +zero +onum + +#: Enable only alternate zero in the bold font:: + +#: font_features FiraCode-Bold +zero + +#: Disable the normal ligatures, but keep the calt feature which (in +#: this font) breaks up monotony:: + +#: font_features TT2020StyleB-Regular -liga +calt + +#: In conjunction with force_ltr, you may want to disable Arabic +#: shaping entirely, and only look at their isolated forms if they +#: show up in a document. You can do this with e.g.:: + +#: font_features UnifontMedium +isol -medi -fina -init + +# modify_font + +#: Modify font characteristics such as the position or thickness of +#: the underline and strikethrough. The modifications can have the +#: suffix px for pixels or % for percentage of original value. No +#: suffix means use pts. For example:: + +#: modify_font underline_position -2 +#: modify_font underline_thickness 150% +#: modify_font strikethrough_position 2px + +#: Additionally, you can modify the size of the cell in which each +#: font glyph is rendered and the baseline at which the glyph is +#: placed in the cell. For example:: + +#: modify_font cell_width 80% +#: modify_font cell_height -2px +#: modify_font baseline 3 + +#: Note that modifying the baseline will automatically adjust the +#: underline and strikethrough positions by the same amount. +#: Increasing the baseline raises glyphs inside the cell and +#: decreasing it lowers them. Decreasing the cell size might cause +#: rendering artifacts, so use with care. + +# box_drawing_scale 0.001, 1, 1.5, 2 + +#: The sizes of the lines used for the box drawing Unicode characters. +#: These values are in pts. They will be scaled by the monitor DPI to +#: arrive at a pixel value. There must be four values corresponding to +#: thin, normal, thick, and very thick lines. + +# undercurl_style thin-sparse + +#: The style with which undercurls are rendered. This option takes the +#: form (thin|thick)-(sparse|dense). Thin and thick control the +#: thickness of the undercurl. Sparse and dense control how often the +#: curl oscillates. With sparse the curl will peak once per character, +#: with dense twice. + +# text_composition_strategy platform + +#: Control how kitty composites text glyphs onto the background color. +#: The default value of platform tries for text rendering as close to +#: "native" for the platform kitty is running on as possible. + +#: A value of legacy uses the old (pre kitty 0.28) strategy for how +#: glyphs are composited. This will make dark text on light +#: backgrounds look thicker and light text on dark backgrounds +#: thinner. It might also make some text appear like the strokes are +#: uneven. + +#: You can fine tune the actual contrast curve used for glyph +#: composition by specifying up to two space-separated numbers for +#: this setting. + +#: The first number is the gamma adjustment, which controls the +#: thickness of dark text on light backgrounds. Increasing the value +#: will make text appear thicker. The default value for this is 1.0 on +#: Linux and 1.7 on macOS. Valid values are 0.01 and above. The result +#: is scaled based on the luminance difference between the background +#: and the foreground. Dark text on light backgrounds receives the +#: full impact of the curve while light text on dark backgrounds is +#: affected very little. + +#: The second number is an additional multiplicative contrast. It is +#: percentage ranging from 0 to 100. The default value is 0 on Linux +#: and 30 on macOS. + +#: If you wish to achieve similar looking thickness in light and dark +#: themes, a good way to experiment is start by setting the value to +#: 1.0 0 and use a dark theme. Then adjust the second parameter until +#: it looks good. Then switch to a light theme and adjust the first +#: parameter until the perceived thickness matches the dark theme. + +# text_fg_override_threshold 0 + +#: The minimum accepted difference in luminance between the foreground +#: and background color, below which kitty will override the +#: foreground color. It is percentage ranging from 0 to 100. If the +#: difference in luminance of the foreground and background is below +#: this threshold, the foreground color will be set to white if the +#: background is dark or black if the background is light. The default +#: value is 0, which means no overriding is performed. Useful when +#: working with applications that use colors that do not contrast well +#: with your preferred color scheme. + +#: WARNING: Some programs use characters (such as block characters) +#: for graphics display and may expect to be able to set the +#: foreground and background to the same color (or similar colors). +#: If you see unexpected stripes, dots, lines, incorrect color, no +#: color where you expect color, or any kind of graphic display +#: problem try setting text_fg_override_threshold to 0 to see if this +#: is the cause of the problem. + +#: }}} + +#: Cursor customization {{{ + +# cursor #cccccc + +#: Default cursor color. If set to the special value none the cursor +#: will be rendered with a "reverse video" effect. It's color will be +#: the color of the text in the cell it is over and the text will be +#: rendered with the background color of the cell. Note that if the +#: program running in the terminal sets a cursor color, this takes +#: precedence. Also, the cursor colors are modified if the cell +#: background and foreground colors have very low contrast. Note that +#: some themes set this value, so if you want to override it, place +#: your value after the lines where the theme file is included. + +# cursor_text_color #111111 + +#: The color of text under the cursor. If you want it rendered with +#: the background color of the cell underneath instead, use the +#: special keyword: `background`. Note that if cursor is set to none +#: then this option is ignored. Note that some themes set this value, +#: so if you want to override it, place your value after the lines +#: where the theme file is included. + +# cursor_shape block + +#: The cursor shape can be one of block, beam, underline. Note that +#: when reloading the config this will be changed only if the cursor +#: shape has not been set by the program running in the terminal. This +#: sets the default cursor shape, applications running in the terminal +#: can override it. In particular, shell integration +#: in kitty sets +#: the cursor shape to beam at shell prompts. You can avoid this by +#: setting shell_integration to no-cursor. + +# cursor_beam_thickness 1.5 + +#: The thickness of the beam cursor (in pts). + +# cursor_underline_thickness 2.0 + +#: The thickness of the underline cursor (in pts). + +# cursor_blink_interval -1 + +#: The interval to blink the cursor (in seconds). Set to zero to +#: disable blinking. Negative values mean use system default. Note +#: that the minimum interval will be limited to repaint_delay. + +# cursor_stop_blinking_after 15.0 + +#: Stop blinking cursor after the specified number of seconds of +#: keyboard inactivity. Set to zero to never stop blinking. + +#: }}} + +#: Scrollback {{{ + +# scrollback_lines 2000 + +#: Number of lines of history to keep in memory for scrolling back. +#: Memory is allocated on demand. Negative numbers are (effectively) +#: infinite scrollback. Note that using very large scrollback is not +#: recommended as it can slow down performance of the terminal and +#: also use large amounts of RAM. Instead, consider using +#: scrollback_pager_history_size. Note that on config reload if this +#: is changed it will only affect newly created windows, not existing +#: ones. + +# scrollback_indicator_opacity 1.0 + +#: The opacity of the scrollback indicator which is a small colored +#: rectangle that moves along the right hand side of the window as you +#: scroll, indicating what fraction you have scrolled. The default is +#: one which means fully opaque, aka visible. Set to a value between +#: zero and one to make the indicator less visible. + +# scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER + +#: Program with which to view scrollback in a new window. The +#: scrollback buffer is passed as STDIN to this program. If you change +#: it, make sure the program you use can handle ANSI escape sequences +#: for colors and text formatting. INPUT_LINE_NUMBER in the command +#: line above will be replaced by an integer representing which line +#: should be at the top of the screen. Similarly CURSOR_LINE and +#: CURSOR_COLUMN will be replaced by the current cursor position or +#: set to 0 if there is no cursor, for example, when showing the last +#: command output. + +# scrollback_pager_history_size 0 + +#: Separate scrollback history size (in MB), used only for browsing +#: the scrollback buffer with pager. This separate buffer is not +#: available for interactive scrolling but will be piped to the pager +#: program when viewing scrollback buffer in a separate window. The +#: current implementation stores the data in UTF-8, so approximately +#: 10000 lines per megabyte at 100 chars per line, for pure ASCII, +#: unformatted text. A value of zero or less disables this feature. +#: The maximum allowed size is 4GB. Note that on config reload if this +#: is changed it will only affect newly created windows, not existing +#: ones. + +# scrollback_fill_enlarged_window no + +#: Fill new space with lines from the scrollback buffer after +#: enlarging a window. + +# wheel_scroll_multiplier 5.0 + +#: Multiplier for the number of lines scrolled by the mouse wheel. +#: Note that this is only used for low precision scrolling devices, +#: not for high precision scrolling devices on platforms such as macOS +#: and Wayland. Use negative numbers to change scroll direction. See +#: also wheel_scroll_min_lines. + +# wheel_scroll_min_lines 1 + +#: The minimum number of lines scrolled by the mouse wheel. The scroll +#: multiplier wheel_scroll_multiplier only takes effect after it +#: reaches this number. Note that this is only used for low precision +#: scrolling devices like wheel mice that scroll by very small amounts +#: when using the wheel. With a negative number, the minimum number of +#: lines will always be added. + +# touch_scroll_multiplier 1.0 + +#: Multiplier for the number of lines scrolled by a touchpad. Note +#: that this is only used for high precision scrolling devices on +#: platforms such as macOS and Wayland. Use negative numbers to change +#: scroll direction. + +#: }}} + +#: Mouse {{{ + +# mouse_hide_wait 3.0 + +#: Hide mouse cursor after the specified number of seconds of the +#: mouse not being used. Set to zero to disable mouse cursor hiding. +#: Set to a negative value to hide the mouse cursor immediately when +#: typing text. Disabled by default on macOS as getting it to work +#: robustly with the ever-changing sea of bugs that is Cocoa is too +#: much effort. + +# url_color #0087bd +# url_style curly + +#: The color and style for highlighting URLs on mouse-over. url_style +#: can be one of: none, straight, double, curly, dotted, dashed. + +# open_url_with default + +#: The program to open clicked URLs. The special value default will +#: first look for any URL handlers defined via the open_actions +#: facility and if non +#: are found, it will use the Operating System's default URL handler +#: (open on macOS and xdg-open on Linux). + +# url_prefixes file ftp ftps gemini git gopher http https irc ircs kitty mailto news sftp ssh + +#: The set of URL prefixes to look for when detecting a URL under the +#: mouse cursor. + +# detect_urls yes + +#: Detect URLs under the mouse. Detected URLs are highlighted with an +#: underline and the mouse cursor becomes a hand over them. Even if +#: this option is disabled, URLs are still clickable. See also the +#: underline_hyperlinks option to control how hyperlinks (as opposed +#: to plain text URLs) are displayed. + +# url_excluded_characters + +#: Additional characters to be disallowed from URLs, when detecting +#: URLs under the mouse cursor. By default, all characters that are +#: legal in URLs are allowed. Additionally, newlines are allowed (but +#: stripped). This is to accommodate programs such as mutt that add +#: hard line breaks even for continued lines. \n can be added to this +#: option to disable this behavior. Special characters can be +#: specified using backslash escapes, to specify a backslash use a +#: double backslash. + +# show_hyperlink_targets no + +#: When the mouse hovers over a terminal hyperlink, show the actual +#: URL that will be activated when the hyperlink is clicked. + +# underline_hyperlinks hover + +#: Control how hyperlinks are underlined. They can either be +#: underlined on mouse hover, always (i.e. permanently underlined) or +#: never which means that kitty will not apply any underline styling +#: to hyperlinks. Uses the url_style and url_color settings for the +#: underline style. Note that reloading the config and changing this +#: value to/from always will only affect text subsequently received by +#: kitty. + +# copy_on_select no + +#: Copy to clipboard or a private buffer on select. With this set to +#: clipboard, selecting text with the mouse will cause the text to be +#: copied to clipboard. Useful on platforms such as macOS that do not +#: have the concept of primary selection. You can instead specify a +#: name such as a1 to copy to a private kitty buffer. Map a shortcut +#: with the paste_from_buffer action to paste from this private +#: buffer. For example:: + +#: copy_on_select a1 +#: map shift+cmd+v paste_from_buffer a1 + +#: Note that copying to the clipboard is a security risk, as all +#: programs, including websites open in your browser can read the +#: contents of the system clipboard. + +# paste_actions quote-urls-at-prompt,confirm + +#: A comma separated list of actions to take when pasting text into +#: the terminal. The supported paste actions are: + +#: quote-urls-at-prompt: +#: If the text being pasted is a URL and the cursor is at a shell prompt, +#: automatically quote the URL (needs shell_integration). +#: replace-dangerous-control-codes +#: Replace dangerous control codes from pasted text, without confirmation. +#: replace-newline +#: Replace the newline character from pasted text, without confirmation. +#: confirm: +#: Confirm the paste if the text to be pasted contains any terminal control codes +#: as this can be dangerous, leading to code execution if the shell/program running +#: in the terminal does not properly handle these. +#: confirm-if-large +#: Confirm the paste if it is very large (larger than 16KB) as pasting +#: large amounts of text into shells can be very slow. +#: filter: +#: Run the filter_paste() function from the file paste-actions.py in +#: the kitty config directory on the pasted text. The text returned by the +#: function will be actually pasted. +#: no-op: +#: Has no effect. + +# strip_trailing_spaces never + +#: Remove spaces at the end of lines when copying to clipboard. A +#: value of smart will do it when using normal selections, but not +#: rectangle selections. A value of always will always do it. + +# select_by_word_characters @-./_~?&=%+# + +#: Characters considered part of a word when double clicking. In +#: addition to these characters any character that is marked as an +#: alphanumeric character in the Unicode database will be matched. + +# select_by_word_characters_forward + +#: Characters considered part of a word when extending the selection +#: forward on double clicking. In addition to these characters any +#: character that is marked as an alphanumeric character in the +#: Unicode database will be matched. + +#: If empty (default) select_by_word_characters will be used for both +#: directions. + +# click_interval -1.0 + +#: The interval between successive clicks to detect double/triple +#: clicks (in seconds). Negative numbers will use the system default +#: instead, if available, or fallback to 0.5. + +# focus_follows_mouse no + +#: Set the active window to the window under the mouse when moving the +#: mouse around. On macOS, this will also cause the OS Window under +#: the mouse to be focused automatically when the mouse enters it. + +# pointer_shape_when_grabbed arrow + +#: The shape of the mouse pointer when the program running in the +#: terminal grabs the mouse. + +# default_pointer_shape beam + +#: The default shape of the mouse pointer. + +# pointer_shape_when_dragging beam + +#: The default shape of the mouse pointer when dragging across text. + +#: Mouse actions {{{ + +#: Mouse buttons can be mapped to perform arbitrary actions. The +#: syntax is: + +#: .. code-block:: none + +#: mouse_map button-name event-type modes action + +#: Where button-name is one of left, middle, right, b1 ... b8 with +#: added keyboard modifiers. For example: ctrl+shift+left refers to +#: holding the Ctrl+Shift keys while clicking with the left mouse +#: button. The value b1 ... b8 can be used to refer to up to eight +#: buttons on a mouse. + +#: event-type is one of press, release, doublepress, triplepress, +#: click, doubleclick. modes indicates whether the action is performed +#: when the mouse is grabbed by the program running in the terminal, +#: or not. The values are grabbed or ungrabbed or a comma separated +#: combination of them. grabbed refers to when the program running in +#: the terminal has requested mouse events. Note that the click and +#: double click events have a delay of click_interval to disambiguate +#: from double and triple presses. + +#: You can run kitty with the kitty --debug-input command line option +#: to see mouse events. See the builtin actions below to get a sense +#: of what is possible. + +#: If you want to unmap a button, map it to nothing. For example, to +#: disable opening of URLs with a plain click:: + +#: mouse_map left click ungrabbed + +#: See all the mappable actions including mouse actions here +#: . + +#: .. note:: +#: Once a selection is started, releasing the button that started it will +#: automatically end it and no release event will be dispatched. + +# clear_all_mouse_actions no + +#: Remove all mouse action definitions up to this point. Useful, for +#: instance, to remove the default mouse actions. + +#: Click the link under the mouse or move the cursor + +# mouse_map left click ungrabbed mouse_handle_click selection link prompt + +#:: First check for a selection and if one exists do nothing. Then +#:: check for a link under the mouse cursor and if one exists, click +#:: it. Finally check if the click happened at the current shell +#:: prompt and if so, move the cursor to the click location. Note +#:: that this requires shell integration +#:: to work. + +#: Click the link under the mouse or move the cursor even when grabbed + +# mouse_map shift+left click grabbed,ungrabbed mouse_handle_click selection link prompt + +#:: Same as above, except that the action is performed even when the +#:: mouse is grabbed by the program running in the terminal. + +#: Click the link under the mouse cursor + +# mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_handle_click link + +#:: Variant with Ctrl+Shift is present because the simple click based +#:: version has an unavoidable delay of click_interval, to +#:: disambiguate clicks from double clicks. + +#: Discard press event for link click + +# mouse_map ctrl+shift+left press grabbed discard_event + +#:: Prevent this press event from being sent to the program that has +#:: grabbed the mouse, as the corresponding release event is used to +#:: open a URL. + +#: Paste from the primary selection + +# mouse_map middle release ungrabbed paste_from_selection + +#: Start selecting text + +# mouse_map left press ungrabbed mouse_selection normal + +#: Start selecting text in a rectangle + +# mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle + +#: Select a word + +# mouse_map left doublepress ungrabbed mouse_selection word + +#: Select a line + +# mouse_map left triplepress ungrabbed mouse_selection line + +#: Select line from point + +# mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point + +#:: Select from the clicked point to the end of the line. If you +#:: would like to select the word at the point and then extend to the +#:: rest of the line, change `line_from_point` to +#:: `word_and_line_from_point`. + +#: Extend the current selection + +# mouse_map right press ungrabbed mouse_selection extend + +#:: If you want only the end of the selection to be moved instead of +#:: the nearest boundary, use move-end instead of extend. + +#: Paste from the primary selection even when grabbed + +# mouse_map shift+middle release ungrabbed,grabbed paste_selection +# mouse_map shift+middle press grabbed discard_event + +#: Start selecting text even when grabbed + +# mouse_map shift+left press ungrabbed,grabbed mouse_selection normal + +#: Start selecting text in a rectangle even when grabbed + +# mouse_map ctrl+shift+alt+left press ungrabbed,grabbed mouse_selection rectangle + +#: Select a word even when grabbed + +# mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word + +#: Select a line even when grabbed + +# mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line + +#: Select line from point even when grabbed + +# mouse_map ctrl+shift+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point + +#:: Select from the clicked point to the end of the line even when +#:: grabbed. If you would like to select the word at the point and +#:: then extend to the rest of the line, change `line_from_point` to +#:: `word_and_line_from_point`. + +#: Extend the current selection even when grabbed + +# mouse_map shift+right press ungrabbed,grabbed mouse_selection extend + +#: Show clicked command output in pager + +# mouse_map ctrl+shift+right press ungrabbed mouse_show_command_output + +#:: Requires shell integration +#:: to work. + +#: }}} + +#: }}} + +#: Performance tuning {{{ + +# repaint_delay 10 + +#: Delay between screen updates (in milliseconds). Decreasing it, +#: increases frames-per-second (FPS) at the cost of more CPU usage. +#: The default value yields ~100 FPS which is more than sufficient for +#: most uses. Note that to actually achieve 100 FPS, you have to +#: either set sync_to_monitor to no or use a monitor with a high +#: refresh rate. Also, to minimize latency when there is pending input +#: to be processed, this option is ignored. + +# input_delay 3 + +#: Delay before input from the program running in the terminal is +#: processed (in milliseconds). Note that decreasing it will increase +#: responsiveness, but also increase CPU usage and might cause flicker +#: in full screen programs that redraw the entire screen on each loop, +#: because kitty is so fast that partial screen updates will be drawn. +#: This setting is ignored when the input buffer is almost full. + +# sync_to_monitor yes + +#: Sync screen updates to the refresh rate of the monitor. This +#: prevents screen tearing +#: when scrolling. +#: However, it limits the rendering speed to the refresh rate of your +#: monitor. With a very high speed mouse/high keyboard repeat rate, +#: you may notice some slight input latency. If so, set this to no. + +#: }}} + +#: Terminal bell {{{ + +# enable_audio_bell yes + +#: The audio bell. Useful to disable it in environments that require +#: silence. + +# visual_bell_duration 0.0 + +#: The visual bell duration (in seconds). Flash the screen when a bell +#: occurs for the specified number of seconds. Set to zero to disable. + +# visual_bell_color none + +#: The color used by visual bell. Set to none will fall back to +#: selection background color. If you feel that the visual bell is too +#: bright, you can set it to a darker color. + +# window_alert_on_bell yes + +#: Request window attention on bell. Makes the dock icon bounce on +#: macOS or the taskbar flash on Linux. + +# bell_on_tab "🔔 " + +#: Some text or a Unicode symbol to show on the tab if a window in the +#: tab that does not have focus has a bell. If you want to use leading +#: or trailing spaces, surround the text with quotes. See +#: tab_title_template for how this is rendered. + +#: For backwards compatibility, values of yes, y and true are +#: converted to the default bell symbol and no, n, false and none are +#: converted to the empty string. + +# command_on_bell none + +#: Program to run when a bell occurs. The environment variable +#: KITTY_CHILD_CMDLINE can be used to get the program running in the +#: window in which the bell occurred. + +# bell_path none + +#: Path to a sound file to play as the bell sound. If set to none, the +#: system default bell sound is used. Must be in a format supported by +#: the operating systems sound API, such as WAV or OGA on Linux +#: (libcanberra) or AIFF, MP3 or WAV on macOS (NSSound). + +# linux_bell_theme __custom + +#: The XDG Sound Theme kitty will use to play the bell sound. Defaults +#: to the custom theme name used by GNOME and Budgie, falling back to +#: the default freedesktop theme if it does not exist. This option may +#: be removed if Linux ever provides desktop-agnostic support for +#: setting system sound themes. + +#: }}} + +#: Window layout {{{ + +# remember_window_size yes +# initial_window_width 640 +# initial_window_height 400 + +#: If enabled, the OS Window size will be remembered so that new +#: instances of kitty will have the same size as the previous +#: instance. If disabled, the OS Window will initially have size +#: configured by initial_window_width/height, in pixels. You can use a +#: suffix of "c" on the width/height values to have them interpreted +#: as number of cells instead of pixels. + +# enabled_layouts * + +#: The enabled window layouts. A comma separated list of layout names. +#: The special value all means all layouts. The first listed layout +#: will be used as the startup layout. Default configuration is all +#: layouts in alphabetical order. For a list of available layouts, see +#: the layouts . + +# window_resize_step_cells 2 +# window_resize_step_lines 2 + +#: The step size (in units of cell width/cell height) to use when +#: resizing kitty windows in a layout with the shortcut +#: start_resizing_window. The cells value is used for horizontal +#: resizing, and the lines value is used for vertical resizing. + +# window_border_width 0.5pt + +#: The width of window borders. Can be either in pixels (px) or pts +#: (pt). Values in pts will be rounded to the nearest number of pixels +#: based on screen resolution. If not specified, the unit is assumed +#: to be pts. Note that borders are displayed only when more than one +#: window is visible. They are meant to separate multiple windows. + +# draw_minimal_borders yes + +#: Draw only the minimum borders needed. This means that only the +#: borders that separate the window from a neighbor are drawn. Note +#: that setting a non-zero window_margin_width overrides this and +#: causes all borders to be drawn. + +# window_margin_width 0 + +#: The window margin (in pts) (blank area outside the border). A +#: single value sets all four sides. Two values set the vertical and +#: horizontal sides. Three values set top, horizontal and bottom. Four +#: values set top, right, bottom and left. + +# single_window_margin_width -1 + +#: The window margin to use when only a single window is visible (in +#: pts). Negative values will cause the value of window_margin_width +#: to be used instead. A single value sets all four sides. Two values +#: set the vertical and horizontal sides. Three values set top, +#: horizontal and bottom. Four values set top, right, bottom and left. + +window_padding_width 10 + +#: The window padding (in pts) (blank area between the text and the +#: window border). A single value sets all four sides. Two values set +#: the vertical and horizontal sides. Three values set top, horizontal +#: and bottom. Four values set top, right, bottom and left. + +# single_window_padding_width -1 + +#: The window padding to use when only a single window is visible (in +#: pts). Negative values will cause the value of window_padding_width +#: to be used instead. A single value sets all four sides. Two values +#: set the vertical and horizontal sides. Three values set top, +#: horizontal and bottom. Four values set top, right, bottom and left. + +# placement_strategy center + +#: When the window size is not an exact multiple of the cell size, the +#: cell area of the terminal window will have some extra padding on +#: the sides. You can control how that padding is distributed with +#: this option. Using a value of center means the cell area will be +#: placed centrally. A value of top-left means the padding will be +#: only at the bottom and right edges. + +active_border_color #FF0000 + +#: The color for the border of the active window. Set this to none to +#: not draw borders around the active window. + +# inactive_border_color #cccccc + +#: The color for the border of inactive windows. + +# bell_border_color #ff5a00 + +#: The color for the border of inactive windows in which a bell has +#: occurred. + +# inactive_text_alpha 1.0 + +#: Fade the text in inactive windows by the specified amount (a number +#: between zero and one, with zero being fully faded). + +# hide_window_decorations false + +#: Hide the window decorations (title-bar and window borders) with +#: yes. On macOS, titlebar-only and titlebar-and-corners can be used +#: to only hide the titlebar and the rounded corners. Whether this +#: works and exactly what effect it has depends on the window +#: manager/operating system. Note that the effects of changing this +#: option when reloading config are undefined. When using titlebar- +#: only, it is useful to also set window_margin_width and +#: placement_strategy to prevent the rounded corners from clipping +#: text. Or use titlebar-and-corners. + +# window_logo_path none + +#: Path to a logo image. Must be in PNG format. Relative paths are +#: interpreted relative to the kitty config directory. The logo is +#: displayed in a corner of every kitty window. The position is +#: controlled by window_logo_position. Individual windows can be +#: configured to have different logos either using the launch action +#: or the remote control facility. + +# window_logo_position bottom-right + +#: Where to position the window logo in the window. The value can be +#: one of: top-left, top, top-right, left, center, right, bottom-left, +#: bottom, bottom-right. + +# window_logo_alpha 0.5 + +#: The amount the logo should be faded into the background. With zero +#: being fully faded and one being fully opaque. + +# resize_debounce_time 0.1 0.5 + +#: The time to wait (in seconds) before asking the program running in +#: kitty to resize and redraw the screen during a live resize of the +#: OS window, when no new resize events have been received, i.e. when +#: resizing is either paused or finished. On platforms such as macOS, +#: where the operating system sends events corresponding to the start +#: and end of a live resize, the second number is used for redraw- +#: after-pause since kitty can distinguish between a pause and end of +#: resizing. On such systems the first number is ignored and redraw is +#: immediate after end of resize. On other systems only the first +#: number is used so that kitty is "ready" quickly after the end of +#: resizing, while not also continuously redrawing, to save energy. + +# resize_in_steps no + +#: Resize the OS window in steps as large as the cells, instead of +#: with the usual pixel accuracy. Combined with initial_window_width +#: and initial_window_height in number of cells, this option can be +#: used to keep the margins as small as possible when resizing the OS +#: window. Note that this does not currently work on Wayland. + +# visual_window_select_characters 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ + +#: The list of characters for visual window selection. For example, +#: for selecting a window to focus on with focus_visible_window. The +#: value should be a series of unique numbers or alphabets, case +#: insensitive, from the set 0-9A-Z\-=[];',./\\`. Specify your +#: preference as a string of characters. + +# confirm_os_window_close -1 + +#: Ask for confirmation when closing an OS window or a tab with at +#: least this number of kitty windows in it by window manager (e.g. +#: clicking the window close button or pressing the operating system +#: shortcut to close windows) or by the close_tab action. A value of +#: zero disables confirmation. This confirmation also applies to +#: requests to quit the entire application (all OS windows, via the +#: quit action). Negative values are converted to positive ones, +#: however, with shell_integration enabled, using negative values +#: means windows sitting at a shell prompt are not counted, only +#: windows where some command is currently running. Note that if you +#: want confirmation when closing individual windows, you can map the +#: close_window_with_confirmation action. + +#: }}} + +#: Tab bar {{{ + +# tab_bar_edge bottom + +#: The edge to show the tab bar on, top or bottom. + +# tab_bar_margin_width 0.0 + +#: The margin to the left and right of the tab bar (in pts). + +# tab_bar_margin_height 0.0 0.0 + +#: The margin above and below the tab bar (in pts). The first number +#: is the margin between the edge of the OS Window and the tab bar. +#: The second number is the margin between the tab bar and the +#: contents of the current tab. + +# tab_bar_style fade + +#: The tab bar style, can be one of: + +#: fade +#: Each tab's edges fade into the background color. (See also tab_fade) +#: slant +#: Tabs look like the tabs in a physical file. +#: separator +#: Tabs are separated by a configurable separator. (See also +#: tab_separator) +#: powerline +#: Tabs are shown as a continuous line with "fancy" separators. +#: (See also tab_powerline_style) +#: custom +#: A user-supplied Python function called draw_tab is loaded from the file +#: tab_bar.py in the kitty config directory. For examples of how to +#: write such a function, see the functions named draw_tab_with_* in +#: kitty's source code: kitty/tab_bar.py. See also +#: this discussion +#: for examples from kitty users. +#: hidden +#: The tab bar is hidden. If you use this, you might want to create +#: a mapping for the select_tab action which presents you with a list of +#: tabs and allows for easy switching to a tab. + +# tab_bar_align left + +#: The horizontal alignment of the tab bar, can be one of: left, +#: center, right. + +# tab_bar_min_tabs 2 + +#: The minimum number of tabs that must exist before the tab bar is +#: shown. + +# tab_switch_strategy previous + +#: The algorithm to use when switching to a tab when the current tab +#: is closed. The default of previous will switch to the last used +#: tab. A value of left will switch to the tab to the left of the +#: closed tab. A value of right will switch to the tab to the right of +#: the closed tab. A value of last will switch to the right-most tab. + +# tab_fade 0.25 0.5 0.75 1 + +#: Control how each tab fades into the background when using fade for +#: the tab_bar_style. Each number is an alpha (between zero and one) +#: that controls how much the corresponding cell fades into the +#: background, with zero being no fade and one being full fade. You +#: can change the number of cells used by adding/removing entries to +#: this list. + +# tab_separator " ┇" + +#: The separator between tabs in the tab bar when using separator as +#: the tab_bar_style. + +# tab_powerline_style angled + +#: The powerline separator style between tabs in the tab bar when +#: using powerline as the tab_bar_style, can be one of: angled, +#: slanted, round. + +# tab_activity_symbol none + +#: Some text or a Unicode symbol to show on the tab if a window in the +#: tab that does not have focus has some activity. If you want to use +#: leading or trailing spaces, surround the text with quotes. See +#: tab_title_template for how this is rendered. + +# tab_title_max_length 0 + +#: The maximum number of cells that can be used to render the text in +#: a tab. A value of zero means that no limit is applied. + +# tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}" + +#: A template to render the tab title. The default just renders the +#: title with optional symbols for bell and activity. If you wish to +#: include the tab-index as well, use something like: {index}:{title}. +#: Useful if you have shortcuts mapped for goto_tab N. If you prefer +#: to see the index as a superscript, use {sup.index}. All data +#: available is: + +#: title +#: The current tab title. +#: index +#: The tab index usable with goto_tab N goto_tab shortcuts. +#: layout_name +#: The current layout name. +#: num_windows +#: The number of windows in the tab. +#: num_window_groups +#: The number of window groups (a window group is a window and all of its overlay windows) in the tab. +#: tab.active_wd +#: The working directory of the currently active window in the tab +#: (expensive, requires syscall). Use active_oldest_wd to get +#: the directory of the oldest foreground process rather than the newest. +#: tab.active_exe +#: The name of the executable running in the foreground of the currently +#: active window in the tab (expensive, requires syscall). Use +#: active_oldest_exe for the oldest foreground process. +#: max_title_length +#: The maximum title length available. +#: keyboard_mode +#: The name of the current keyboard mode or the empty string if no keyboard mode is active. + +#: Note that formatting is done by Python's string formatting +#: machinery, so you can use, for instance, {layout_name[:2].upper()} +#: to show only the first two letters of the layout name, upper-cased. +#: If you want to style the text, you can use styling directives, for +#: example: +#: `{fmt.fg.red}red{fmt.fg.tab}normal{fmt.bg._00FF00}greenbg{fmt.bg.tab}`. +#: Similarly, for bold and italic: +#: `{fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}`. +#: Note that for backward compatibility, if {bell_symbol} or +#: {activity_symbol} are not present in the template, they are +#: prepended to it. + +# active_tab_title_template none + +#: Template to use for active tabs. If not specified falls back to +#: tab_title_template. + +# active_tab_foreground #000 +# active_tab_background #eee +# active_tab_font_style bold-italic +# inactive_tab_foreground #444 +# inactive_tab_background #999 +# inactive_tab_font_style normal + +#: Tab bar colors and styles. + +# tab_bar_background none + +#: Background color for the tab bar. Defaults to using the terminal +#: background color. + +# tab_bar_margin_color none + +#: Color for the tab bar margin area. Defaults to using the terminal +#: background color for margins above and below the tab bar. For side +#: margins the default color is chosen to match the background color +#: of the neighboring tab. + +#: }}} + +#: Color scheme {{{ + +# foreground #dddddd +# background #000000 + +#: The foreground and background colors. + +# background_opacity 1.0 + +#: The opacity of the background. A number between zero and one, where +#: one is opaque and zero is fully transparent. This will only work if +#: supported by the OS (for instance, when using a compositor under +#: X11). Note that it only sets the background color's opacity in +#: cells that have the same background color as the default terminal +#: background, so that things like the status bar in vim, powerline +#: prompts, etc. still look good. But it means that if you use a color +#: theme with a background color in your editor, it will not be +#: rendered as transparent. Instead you should change the default +#: background color in your kitty config and not use a background +#: color in the editor color scheme. Or use the escape codes to set +#: the terminals default colors in a shell script to launch your +#: editor. Be aware that using a value less than 1.0 is a (possibly +#: significant) performance hit. When using a low value for this +#: setting, it is desirable that you set the background color to a +#: color the matches the general color of the desktop background, for +#: best text rendering. If you want to dynamically change +#: transparency of windows, set dynamic_background_opacity to yes +#: (this is off by default as it has a performance cost). Changing +#: this option when reloading the config will only work if +#: dynamic_background_opacity was enabled in the original config. + +# background_blur 0 + +#: Set to a positive value to enable background blur (blurring of the +#: visuals behind a transparent window) on platforms that support it. +#: Only takes effect when background_opacity is less than one. On +#: macOS, this will also control the blur radius (amount of blurring). +#: Setting it to too high a value will cause severe performance issues +#: and/or rendering artifacts. Usually, values up to 64 work well. +#: Note that this might cause performance issues, depending on how the +#: platform implements it, so use with care. Currently supported on +#: macOS and KDE. + +# background_image none + +#: Path to a background image. Must be in PNG format. + +# background_image_layout tiled + +#: Whether to tile, scale or clamp the background image. The value can +#: be one of tiled, mirror-tiled, scaled, clamped, centered or +#: cscaled. The scaled and cscaled values scale the image to the +#: window size, with cscaled preserving the image aspect ratio. + +# background_image_linear no + +#: When background image is scaled, whether linear interpolation +#: should be used. + +# dynamic_background_opacity no + +#: Allow changing of the background_opacity dynamically, using either +#: keyboard shortcuts (increase_background_opacity and +#: decrease_background_opacity) or the remote control facility. +#: Changing this option by reloading the config is not supported. + +# background_tint 0.0 + +#: How much to tint the background image by the background color. This +#: option makes it easier to read the text. Tinting is done using the +#: current background color for each window. This option applies only +#: if background_opacity is set and transparent windows are supported +#: or background_image is set. + +# background_tint_gaps 1.0 + +#: How much to tint the background image at the window gaps by the +#: background color, after applying background_tint. Since this is +#: multiplicative with background_tint, it can be used to lighten the +#: tint over the window gaps for a *separated* look. + +# dim_opacity 0.4 + +#: How much to dim text that has the DIM/FAINT attribute set. One +#: means no dimming and zero means fully dimmed (i.e. invisible). + +# selection_foreground #000000 +# selection_background #fffacd + +#: The foreground and background colors for text selected with the +#: mouse. Setting both of these to none will cause a "reverse video" +#: effect for selections, where the selection will be the cell text +#: color and the text will become the cell background color. Setting +#: only selection_foreground to none will cause the foreground color +#: to be used unchanged. Note that these colors can be overridden by +#: the program running in the terminal. + +#: The color table {{{ + +#: The 256 terminal colors. There are 8 basic colors, each color has a +#: dull and bright version, for the first 16 colors. You can set the +#: remaining 240 colors as color16 to color255. + +# color0 #000000 +# color8 #767676 + +#: black + +# color1 #cc0403 +# color9 #f2201f + +#: red + +# color2 #19cb00 +# color10 #23fd00 + +#: green + +# color3 #cecb00 +# color11 #fffd00 + +#: yellow + +# color4 #0d73cc +# color12 #1a8fff + +#: blue + +# color5 #cb1ed1 +# color13 #fd28ff + +#: magenta + +# color6 #0dcdcd +# color14 #14ffff + +#: cyan + +# color7 #dddddd +# color15 #ffffff + +#: white + +# mark1_foreground black + +#: Color for marks of type 1 + +# mark1_background #98d3cb + +#: Color for marks of type 1 (light steel blue) + +# mark2_foreground black + +#: Color for marks of type 2 + +# mark2_background #f2dcd3 + +#: Color for marks of type 1 (beige) + +# mark3_foreground black + +#: Color for marks of type 3 + +# mark3_background #f274bc + +#: Color for marks of type 3 (violet) + +#: }}} + +#: }}} + +#: Advanced {{{ + +# shell . + +#: The shell program to execute. The default value of . means to use +#: whatever shell is set as the default shell for the current user. +#: Note that on macOS if you change this, you might need to add +#: --login and --interactive to ensure that the shell starts in +#: interactive mode and reads its startup rc files. Environment +#: variables are expanded in this setting. + +# editor . + +#: The terminal based text editor (such as vim or nano) to use when +#: editing the kitty config file or similar tasks. + +#: The default value of . means to use the environment variables +#: VISUAL and EDITOR in that order. If these variables aren't set, +#: kitty will run your shell ($SHELL -l -i -c env) to see if your +#: shell startup rc files set VISUAL or EDITOR. If that doesn't work, +#: kitty will cycle through various known editors (vim, emacs, etc.) +#: and take the first one that exists on your system. + +# close_on_child_death no + +#: Close the window when the child process (shell) exits. With the +#: default value no, the terminal will remain open when the child +#: exits as long as there are still processes outputting to the +#: terminal (for example disowned or backgrounded processes). When +#: enabled with yes, the window will close as soon as the child +#: process exits. Note that setting it to yes means that any +#: background processes still using the terminal can fail silently +#: because their stdout/stderr/stdin no longer work. + +# remote_control_password + +#: Allow other programs to control kitty using passwords. This option +#: can be specified multiple times to add multiple passwords. If no +#: passwords are present kitty will ask the user for permission if a +#: program tries to use remote control with a password. A password can +#: also *optionally* be associated with a set of allowed remote +#: control actions. For example:: + +#: remote_control_password "my passphrase" get-colors set-colors focus-window focus-tab + +#: Only the specified actions will be allowed when using this +#: password. Glob patterns can be used too, for example:: + +#: remote_control_password "my passphrase" set-tab-* resize-* + +#: To get a list of available actions, run:: + +#: kitten @ --help + +#: A set of actions to be allowed when no password is sent can be +#: specified by using an empty password. For example:: + +#: remote_control_password "" *-colors + +#: Finally, the path to a python module can be specified that provides +#: a function is_cmd_allowed that is used to check every remote +#: control command. For example:: + +#: remote_control_password "my passphrase" my_rc_command_checker.py + +#: Relative paths are resolved from the kitty configuration directory. +#: See rc_custom_auth for details. + +# allow_remote_control no + +#: Allow other programs to control kitty. If you turn this on, other +#: programs can control all aspects of kitty, including sending text +#: to kitty windows, opening new windows, closing windows, reading the +#: content of windows, etc. Note that this even works over SSH +#: connections. The default setting of no prevents any form of remote +#: control. The meaning of the various values are: + +#: password +#: Remote control requests received over both the TTY device and the socket +#: are confirmed based on passwords, see remote_control_password. + +#: socket-only +#: Remote control requests received over a socket are accepted +#: unconditionally. Requests received over the TTY are denied. +#: See listen_on. + +#: socket +#: Remote control requests received over a socket are accepted +#: unconditionally. Requests received over the TTY are confirmed based on +#: password. + +#: no +#: Remote control is completely disabled. + +#: yes +#: Remote control requests are always accepted. + +# listen_on none + +#: Listen to the specified socket for remote control connections. Note +#: that this will apply to all kitty instances. It can be overridden +#: by the kitty --listen-on command line option. For UNIX sockets, +#: such as unix:${TEMP}/mykitty or unix:@mykitty (on Linux). +#: Environment variables are expanded and relative paths are resolved +#: with respect to the temporary directory. If {kitty_pid} is present, +#: then it is replaced by the PID of the kitty process, otherwise the +#: PID of the kitty process is appended to the value, with a hyphen. +#: For TCP sockets such as tcp:localhost:0 a random port is always +#: used even if a non-zero port number is specified. See the help for +#: kitty --listen-on for more details. Note that this will be ignored +#: unless allow_remote_control is set to either: yes, socket or +#: socket-only. Changing this option by reloading the config is not +#: supported. + +# env + +#: Specify the environment variables to be set in all child processes. +#: Using the name with an equal sign (e.g. env VAR=) will set it to +#: the empty string. Specifying only the name (e.g. env VAR) will +#: remove the variable from the child process' environment. Note that +#: environment variables are expanded recursively, for example:: + +#: env VAR1=a +#: env VAR2=${HOME}/${VAR1}/b + +#: The value of VAR2 will be /a/b. + +# watcher + +#: Path to python file which will be loaded for watchers +#: . Can be +#: specified more than once to load multiple watchers. The watchers +#: will be added to every kitty window. Relative paths are resolved +#: relative to the kitty config directory. Note that reloading the +#: config will only affect windows created after the reload. + +# exe_search_path + +#: Control where kitty finds the programs to run. The default search +#: order is: First search the system wide PATH, then ~/.local/bin and +#: ~/bin. If still not found, the PATH defined in the login shell +#: after sourcing all its startup files is tried. Finally, if present, +#: the PATH specified by the env option is tried. + +#: This option allows you to prepend, append, or remove paths from +#: this search order. It can be specified multiple times for multiple +#: paths. A simple path will be prepended to the search order. A path +#: that starts with the + sign will be append to the search order, +#: after ~/bin above. A path that starts with the - sign will be +#: removed from the entire search order. For example:: + +#: exe_search_path /some/prepended/path +#: exe_search_path +/some/appended/path +#: exe_search_path -/some/excluded/path + +# update_check_interval 24 + +#: The interval to periodically check if an update to kitty is +#: available (in hours). If an update is found, a system notification +#: is displayed informing you of the available update. The default is +#: to check every 24 hours, set to zero to disable. Update checking is +#: only done by the official binary builds. Distro packages or source +#: builds do not do update checking. Changing this option by reloading +#: the config is not supported. + +# startup_session none + +#: Path to a session file to use for all kitty instances. Can be +#: overridden by using the kitty --session =none command line option +#: for individual instances. See sessions +#: in the kitty +#: documentation for details. Note that relative paths are interpreted +#: with respect to the kitty config directory. Environment variables +#: in the path are expanded. Changing this option by reloading the +#: config is not supported. Note that if kitty is invoked with command +#: line arguments specifying a command to run, this option is ignored. + +# clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask + +#: Allow programs running in kitty to read and write from the +#: clipboard. You can control exactly which actions are allowed. The +#: possible actions are: write-clipboard, read-clipboard, write- +#: primary, read-primary, read-clipboard-ask, read-primary-ask. The +#: default is to allow writing to the clipboard and primary selection +#: and to ask for permission when a program tries to read from the +#: clipboard. Note that disabling the read confirmation is a security +#: risk as it means that any program, even the ones running on a +#: remote server via SSH can read your clipboard. See also +#: clipboard_max_size. + +# clipboard_max_size 512 + +#: The maximum size (in MB) of data from programs running in kitty +#: that will be stored for writing to the system clipboard. A value of +#: zero means no size limit is applied. See also clipboard_control. + +# file_transfer_confirmation_bypass + +#: The password that can be supplied to the file transfer kitten +#: to skip the +#: transfer confirmation prompt. This should only be used when +#: initiating transfers from trusted computers, over trusted networks +#: or encrypted transports, as it allows any programs running on the +#: remote machine to read/write to the local filesystem, without +#: permission. + +# allow_hyperlinks yes + +#: Process hyperlink escape sequences (OSC 8). If disabled OSC 8 +#: escape sequences are ignored. Otherwise they become clickable +#: links, that you can click with the mouse or by using the hints +#: kitten . The +#: special value of ask means that kitty will ask before opening the +#: link when clicked. + +# shell_integration enabled + +#: Enable shell integration on supported shells. This enables features +#: such as jumping to previous prompts, browsing the output of the +#: previous command in a pager, etc. on supported shells. Set to +#: disabled to turn off shell integration, completely. It is also +#: possible to disable individual features, set to a space separated +#: list of these values: no-rc, no-cursor, no-title, no-cwd, no- +#: prompt-mark, no-complete, no-sudo. See Shell integration +#: for details. + +# allow_cloning ask + +#: Control whether programs running in the terminal can request new +#: windows to be created. The canonical example is clone-in-kitty +#: . +#: By default, kitty will ask for permission for each clone request. +#: Allowing cloning unconditionally gives programs running in the +#: terminal (including over SSH) permission to execute arbitrary code, +#: as the user who is running the terminal, on the computer that the +#: terminal is running on. + +# clone_source_strategies venv,conda,env_var,path + +#: Control what shell code is sourced when running clone-in-kitty in +#: the newly cloned window. The supported strategies are: + +#: venv +#: Source the file $VIRTUAL_ENV/bin/activate. This is used by the +#: Python stdlib venv module and allows cloning venvs automatically. +#: conda +#: Run conda activate $CONDA_DEFAULT_ENV. This supports the virtual +#: environments created by conda. +#: env_var +#: Execute the contents of the environment variable +#: KITTY_CLONE_SOURCE_CODE with eval. +#: path +#: Source the file pointed to by the environment variable +#: KITTY_CLONE_SOURCE_PATH. + +#: This option must be a comma separated list of the above values. +#: Only the first valid match, in the order specified, is sourced. + +# notify_on_cmd_finish never + +#: Show a desktop notification when a long-running command finishes +#: (needs shell_integration). The possible values are: + +#: never +#: Never send a notification. + +#: unfocused +#: Only send a notification when the window does not have keyboard focus. + +#: invisible +#: Only send a notification when the window both is unfocused and not visible +#: to the user, for example, because it is in an inactive tab or its OS window +#: is not currently active. + +#: always +#: Always send a notification, regardless of window state. + +#: There are two optional arguments: + +#: First, the minimum duration for what is considered a long running +#: command. The default is 5 seconds. Specify a second argument to set +#: the duration. For example: invisible 15. Do not set the value too +#: small, otherwise a command that launches a new OS Window and exits +#: will spam a notification. + +#: Second, the action to perform. The default is notify. The possible +#: values are: + +#: notify +#: Send a desktop notification. + +#: bell +#: Ring the terminal bell. + +#: command +#: Run a custom command. All subsequent arguments are the cmdline to run. + +#: Some more examples:: + +#: # Send a notification when a command takes more than 5 seconds in an unfocused window +#: notify_on_cmd_finish unfocused +#: # Send a notification when a command takes more than 10 seconds in a invisible window +#: notify_on_cmd_finish invisible 10.0 +#: # Ring a bell when a command takes more than 10 seconds in a invisible window +#: notify_on_cmd_finish invisible 10.0 bell +#: # Run 'notify-send' when a command takes more than 10 seconds in a invisible window +#: notify_on_cmd_finish invisible 10.0 command notify-send job finished + +# term xterm-kitty + +#: The value of the TERM environment variable to set. Changing this +#: can break many terminal programs, only change it if you know what +#: you are doing, not because you read some advice on "Stack Overflow" +#: to change it. The TERM variable is used by various programs to get +#: information about the capabilities and behavior of the terminal. If +#: you change it, depending on what programs you run, and how +#: different the terminal you are changing it to is, various things +#: from key-presses, to colors, to various advanced features may not +#: work. Changing this option by reloading the config will only affect +#: newly created windows. + +# terminfo_type path + +#: The value of the TERMINFO environment variable to set. This +#: variable is used by programs running in the terminal to search for +#: terminfo databases. The default value of path causes kitty to set +#: it to a filesystem location containing the kitty terminfo database. +#: A value of direct means put the entire database into the env var +#: directly. This can be useful when connecting to containers, for +#: example. But, note that not all software supports this. A value of +#: none means do not touch the variable. + +# forward_stdio no + +#: Forward STDOUT and STDERR of the kitty process to child processes +#: as file descriptors 3 and 4. This is useful for debugging as it +#: allows child processes to print to kitty's STDOUT directly. For +#: example, echo hello world >&3 in a shell will print to the parent +#: kitty's STDOUT. When enabled, this also sets the +#: KITTY_STDIO_FORWARDED=3 environment variable so child processes +#: know about the forwarding. + +# menu_map + +#: Specify entries for various menus in kitty. Currently only the +#: global menubar on macOS is supported. For example:: + +#: menu_map global "Actions::Launch something special" launch --hold --type=os-window sh -c "echo hello world" + +#: This will create a menu entry named "Launch something special" in +#: an "Actions" menu in the macOS global menubar. Sub-menus can be +#: created by adding more levels separated by the :: characters. + +#: }}} + +#: OS specific tweaks {{{ + +# wayland_titlebar_color system + +#: The color of the kitty window's titlebar on Wayland systems with +#: client side window decorations such as GNOME. A value of system +#: means to use the default system colors, a value of background means +#: to use the background color of the currently active kitty window +#: and finally you can use an arbitrary color, such as #12af59 or red. + +# macos_titlebar_color system + +#: The color of the kitty window's titlebar on macOS. A value of +#: system means to use the default system color, light or dark can +#: also be used to set it explicitly. A value of background means to +#: use the background color of the currently active window and finally +#: you can use an arbitrary color, such as #12af59 or red. WARNING: +#: This option works by using a hack when arbitrary color (or +#: background) is configured, as there is no proper Cocoa API for it. +#: It sets the background color of the entire window and makes the +#: titlebar transparent. As such it is incompatible with +#: background_opacity. If you want to use both, you are probably +#: better off just hiding the titlebar with hide_window_decorations. + +# macos_option_as_alt no + +#: Use the Option key as an Alt key on macOS. With this set to no, +#: kitty will use the macOS native Option+Key to enter Unicode +#: character behavior. This will break any Alt+Key keyboard shortcuts +#: in your terminal programs, but you can use the macOS Unicode input +#: technique. You can use the values: left, right or both to use only +#: the left, right or both Option keys as Alt, instead. Note that +#: kitty itself always treats Option the same as Alt. This means you +#: cannot use this option to configure different kitty shortcuts for +#: Option+Key vs. Alt+Key. Also, any kitty shortcuts using +#: Option/Alt+Key will take priority, so that any such key presses +#: will not be passed to terminal programs running inside kitty. +#: Changing this option by reloading the config is not supported. + +# macos_hide_from_tasks no + +#: Hide the kitty window from running tasks on macOS (⌘+Tab and the +#: Dock). Changing this option by reloading the config is not +#: supported. + +# macos_quit_when_last_window_closed no + +#: Have kitty quit when all the top-level windows are closed on macOS. +#: By default, kitty will stay running, even with no open windows, as +#: is the expected behavior on macOS. + +# macos_window_resizable yes + +#: Disable this if you want kitty top-level OS windows to not be +#: resizable on macOS. + +# macos_thicken_font 0 + +#: Draw an extra border around the font with the given width, to +#: increase legibility at small font sizes on macOS. For example, a +#: value of 0.75 will result in rendering that looks similar to sub- +#: pixel antialiasing at common font sizes. Note that in modern kitty, +#: this option is obsolete (although still supported). Consider using +#: text_composition_strategy instead. + +# macos_traditional_fullscreen no + +#: Use the macOS traditional full-screen transition, that is faster, +#: but less pretty. + +# macos_show_window_title_in all + +#: Control where the window title is displayed on macOS. A value of +#: window will show the title of the currently active window at the +#: top of the macOS window. A value of menubar will show the title of +#: the currently active window in the macOS global menu bar, making +#: use of otherwise wasted space. A value of all will show the title +#: in both places, and none hides the title. See +#: macos_menubar_title_max_length for how to control the length of the +#: title in the menu bar. + +# macos_menubar_title_max_length 0 + +#: The maximum number of characters from the window title to show in +#: the macOS global menu bar. Values less than one means that there is +#: no maximum limit. + +# macos_custom_beam_cursor no + +#: Use a custom mouse cursor for macOS that is easier to see on both +#: light and dark backgrounds. Nowadays, the default macOS cursor +#: already comes with a white border. WARNING: this might make your +#: mouse cursor invisible on dual GPU machines. Changing this option +#: by reloading the config is not supported. + +# macos_colorspace srgb + +#: The colorspace in which to interpret terminal colors. The default +#: of srgb will cause colors to match those seen in web browsers. The +#: value of default will use whatever the native colorspace of the +#: display is. The value of displayp3 will use Apple's special +#: snowflake display P3 color space, which will result in over +#: saturated (brighter) colors with some color shift. Reloading +#: configuration will change this value only for newly created OS +#: windows. + +# linux_display_server auto + +#: Choose between Wayland and X11 backends. By default, an appropriate +#: backend based on the system state is chosen automatically. Set it +#: to x11 or wayland to force the choice. Changing this option by +#: reloading the config is not supported. + +# wayland_enable_ime yes + +#: Enable Input Method Extension on Wayland. This is typically used +#: for inputting text in East Asian languages. However, its +#: implementation in Wayland is often buggy and introduces latency +#: into the input loop, so disable this if you know you dont need it. +#: Changing this option by reloading the config is not supported, it +#: will not have any effect. + +#: }}} + +#: Keyboard shortcuts {{{ + +#: Keys are identified simply by their lowercase Unicode characters. +#: For example: a for the A key, [ for the left square bracket key, +#: etc. For functional keys, such as Enter or Escape, the names are +#: present at Functional key definitions +#: . +#: For modifier keys, the names are ctrl (control, ⌃), shift (⇧), alt +#: (opt, option, ⌥), super (cmd, command, ⌘). + +#: Simple shortcut mapping is done with the map directive. For full +#: details on advanced mapping including modal and per application +#: maps, see mapping . Some +#: quick examples to illustrate common tasks:: + +#: # unmap a keyboard shortcut, passing it to the program running in kitty +#: map kitty_mod+space +#: # completely ignore a keyboard event +#: map ctrl+alt+f1 discard_event +#: # combine multiple actions +#: map kitty_mod+e combine : new_window : next_layout +#: # multi-key shortcuts +#: map ctrl+x>ctrl+y>z action + +#: The full list of actions that can be mapped to key presses is +#: available here . + +# kitty_mod ctrl+shift + +#: Special modifier key alias for default shortcuts. You can change +#: the value of this option to alter all default shortcuts that use +#: kitty_mod. + +# clear_all_shortcuts no + +#: Remove all shortcut definitions up to this point. Useful, for +#: instance, to remove the default shortcuts. + +# action_alias + +#: E.g. action_alias launch_tab launch --type=tab --cwd=current + +#: Define action aliases to avoid repeating the same options in +#: multiple mappings. Aliases can be defined for any action and will +#: be expanded recursively. For example, the above alias allows you to +#: create mappings to launch a new tab in the current working +#: directory without duplication:: + +#: map f1 launch_tab vim +#: map f2 launch_tab emacs + +#: Similarly, to alias kitten invocation:: + +#: action_alias hints kitten hints --hints-offset=0 + +# kitten_alias + +#: E.g. kitten_alias hints hints --hints-offset=0 + +#: Like action_alias above, but specifically for kittens. Generally, +#: prefer to use action_alias. This option is a legacy version, +#: present for backwards compatibility. It causes all invocations of +#: the aliased kitten to be substituted. So the example above will +#: cause all invocations of the hints kitten to have the --hints- +#: offset=0 option applied. + +#: Clipboard {{{ + +#: Copy to clipboard + +# map kitty_mod+c copy_to_clipboard +# map cmd+c copy_to_clipboard + +#:: There is also a copy_or_interrupt action that can be optionally +#:: mapped to Ctrl+C. It will copy only if there is a selection and +#:: send an interrupt otherwise. Similarly, +#:: copy_and_clear_or_interrupt will copy and clear the selection or +#:: send an interrupt if there is no selection. + +#: Paste from clipboard + +# map kitty_mod+v paste_from_clipboard +# map cmd+v paste_from_clipboard + +#: Paste from selection + +# map kitty_mod+s paste_from_selection +# map shift+insert paste_from_selection + +#: Pass selection to program + +# map kitty_mod+o pass_selection_to_program + +#:: You can also pass the contents of the current selection to any +#:: program with pass_selection_to_program. By default, the system's +#:: open program is used, but you can specify your own, the selection +#:: will be passed as a command line argument to the program. For +#:: example:: + +#:: map kitty_mod+o pass_selection_to_program firefox + +#:: You can pass the current selection to a terminal program running +#:: in a new kitty window, by using the @selection placeholder:: + +#:: map kitty_mod+y new_window less @selection + +#: }}} + +#: Scrolling {{{ + +#: Scroll line up + +# map kitty_mod+up scroll_line_up +# map kitty_mod+k scroll_line_up +# map opt+cmd+page_up scroll_line_up +# map cmd+up scroll_line_up + +#: Scroll line down + +# map kitty_mod+down scroll_line_down +# map kitty_mod+j scroll_line_down +# map opt+cmd+page_down scroll_line_down +# map cmd+down scroll_line_down + +#: Scroll page up + +# map kitty_mod+page_up scroll_page_up +# map cmd+page_up scroll_page_up + +#: Scroll page down + +# map kitty_mod+page_down scroll_page_down +# map cmd+page_down scroll_page_down + +#: Scroll to top + +# map kitty_mod+home scroll_home +# map cmd+home scroll_home + +#: Scroll to bottom + +# map kitty_mod+end scroll_end +# map cmd+end scroll_end + +#: Scroll to previous shell prompt + +# map kitty_mod+z scroll_to_prompt -1 + +#:: Use a parameter of 0 for scroll_to_prompt to scroll to the last +#:: jumped to or the last clicked position. Requires shell +#:: integration +#:: to work. + +#: Scroll to next shell prompt + +# map kitty_mod+x scroll_to_prompt 1 + +#: Browse scrollback buffer in pager + +# map kitty_mod+h show_scrollback + +#:: You can pipe the contents of the current screen and history +#:: buffer as STDIN to an arbitrary program using launch --stdin- +#:: source. For example, the following opens the scrollback buffer in +#:: less in an overlay window:: + +#:: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R + +#:: For more details on piping screen and buffer contents to external +#:: programs, see launch . + +#: Browse output of the last shell command in pager + +# map kitty_mod+g show_last_command_output + +#:: You can also define additional shortcuts to get the command +#:: output. For example, to get the first command output on screen:: + +#:: map f1 show_first_command_output_on_screen + +#:: To get the command output that was last accessed by a keyboard +#:: action or mouse action:: + +#:: map f1 show_last_visited_command_output + +#:: You can pipe the output of the last command run in the shell +#:: using the launch action. For example, the following opens the +#:: output in less in an overlay window:: + +#:: map f1 launch --stdin-source=@last_cmd_output --stdin-add-formatting --type=overlay less +G -R + +#:: To get the output of the first command on the screen, use +#:: @first_cmd_output_on_screen. To get the output of the last jumped +#:: to command, use @last_visited_cmd_output. + +#:: Requires shell integration +#:: to work. + +#: }}} + +#: Window management {{{ + +#: New window + +# map kitty_mod+enter new_window +# map cmd+enter new_window + +#:: You can open a new kitty window running an arbitrary program, for +#:: example:: + +#:: map kitty_mod+y launch mutt + +#:: You can open a new window with the current working directory set +#:: to the working directory of the current window using:: + +#:: map ctrl+alt+enter launch --cwd=current + +#:: You can open a new window that is allowed to control kitty via +#:: the kitty remote control facility with launch --allow-remote- +#:: control. Any programs running in that window will be allowed to +#:: control kitty. For example:: + +#:: map ctrl+enter launch --allow-remote-control some_program + +#:: You can open a new window next to the currently active window or +#:: as the first window, with:: + +#:: map ctrl+n launch --location=neighbor +#:: map ctrl+f launch --location=first + +#:: For more details, see launch +#:: . + +#: New OS window + +# map kitty_mod+n new_os_window +# map cmd+n new_os_window + +#:: Works like new_window above, except that it opens a top-level OS +#:: window. In particular you can use new_os_window_with_cwd to open +#:: a window with the current working directory. + +#: Close window + +# map kitty_mod+w close_window +# map shift+cmd+d close_window + +#: Next window + +# map kitty_mod+] next_window + +#: Previous window + +# map kitty_mod+[ previous_window + +#: Move window forward + +# map kitty_mod+f move_window_forward + +#: Move window backward + +# map kitty_mod+b move_window_backward + +#: Move window to top + +# map kitty_mod+` move_window_to_top + +#: Start resizing window + +# map kitty_mod+r start_resizing_window +# map cmd+r start_resizing_window + +#: First window + +# map kitty_mod+1 first_window +# map cmd+1 first_window + +#: Second window + +# map kitty_mod+2 second_window +# map cmd+2 second_window + +#: Third window + +# map kitty_mod+3 third_window +# map cmd+3 third_window + +#: Fourth window + +# map kitty_mod+4 fourth_window +# map cmd+4 fourth_window + +#: Fifth window + +# map kitty_mod+5 fifth_window +# map cmd+5 fifth_window + +#: Sixth window + +# map kitty_mod+6 sixth_window +# map cmd+6 sixth_window + +#: Seventh window + +# map kitty_mod+7 seventh_window +# map cmd+7 seventh_window + +#: Eighth window + +# map kitty_mod+8 eighth_window +# map cmd+8 eighth_window + +#: Ninth window + +# map kitty_mod+9 ninth_window +# map cmd+9 ninth_window + +#: Tenth window + +# map kitty_mod+0 tenth_window + +#: Visually select and focus window + +# map kitty_mod+f7 focus_visible_window + +#:: Display overlay numbers and alphabets on the window, and switch +#:: the focus to the window when you press the key. When there are +#:: only two windows, the focus will be switched directly without +#:: displaying the overlay. You can change the overlay characters and +#:: their order with option visual_window_select_characters. + +#: Visually swap window with another + +# map kitty_mod+f8 swap_with_window + +#:: Works like focus_visible_window above, but swaps the window. + +#: }}} + +#: Tab management {{{ + +#: Next tab + +# map kitty_mod+right next_tab +# map shift+cmd+] next_tab +# map ctrl+tab next_tab + +#: Previous tab + +# map kitty_mod+left previous_tab +# map shift+cmd+[ previous_tab +# map ctrl+shift+tab previous_tab + +#: New tab + +# map kitty_mod+t new_tab +# map cmd+t new_tab + +#: Close tab + +# map kitty_mod+q close_tab +# map cmd+w close_tab + +#: Close OS window + +# map shift+cmd+w close_os_window + +#: Move tab forward + +# map kitty_mod+. move_tab_forward + +#: Move tab backward + +# map kitty_mod+, move_tab_backward + +#: Set tab title + +# map kitty_mod+alt+t set_tab_title +# map shift+cmd+i set_tab_title + + +#: You can also create shortcuts to go to specific tabs, with 1 being +#: the first tab, 2 the second tab and -1 being the previously active +#: tab, and any number larger than the last tab being the last tab:: + +#: map ctrl+alt+1 goto_tab 1 +#: map ctrl+alt+2 goto_tab 2 + +#: Just as with new_window above, you can also pass the name of +#: arbitrary commands to run when using new_tab and new_tab_with_cwd. +#: Finally, if you want the new tab to open next to the current tab +#: rather than at the end of the tabs list, use:: + +#: map ctrl+t new_tab !neighbor [optional cmd to run] +#: }}} + +#: Layout management {{{ + +#: Next layout + +# map kitty_mod+l next_layout + + +#: You can also create shortcuts to switch to specific layouts:: + +#: map ctrl+alt+t goto_layout tall +#: map ctrl+alt+s goto_layout stack + +#: Similarly, to switch back to the previous layout:: + +#: map ctrl+alt+p last_used_layout + +#: There is also a toggle_layout action that switches to the named +#: layout or back to the previous layout if in the named layout. +#: Useful to temporarily "zoom" the active window by switching to the +#: stack layout:: + +#: map ctrl+alt+z toggle_layout stack +#: }}} + +#: Font sizes {{{ + +#: You can change the font size for all top-level kitty OS windows at +#: a time or only the current one. + +#: Increase font size + +# map kitty_mod+equal change_font_size all +2.0 +# map kitty_mod+plus change_font_size all +2.0 +# map kitty_mod+kp_add change_font_size all +2.0 +# map cmd+plus change_font_size all +2.0 +# map cmd+equal change_font_size all +2.0 +# map shift+cmd+equal change_font_size all +2.0 + +#: Decrease font size + +# map kitty_mod+minus change_font_size all -2.0 +# map kitty_mod+kp_subtract change_font_size all -2.0 +# map cmd+minus change_font_size all -2.0 +# map shift+cmd+minus change_font_size all -2.0 + +#: Reset font size + +# map kitty_mod+backspace change_font_size all 0 +# map cmd+0 change_font_size all 0 + + +#: To setup shortcuts for specific font sizes:: + +#: map kitty_mod+f6 change_font_size all 10.0 + +#: To setup shortcuts to change only the current OS window's font +#: size:: + +#: map kitty_mod+f6 change_font_size current 10.0 +#: }}} + +#: Select and act on visible text {{{ + +#: Use the hints kitten to select text and either pass it to an +#: external program or insert it into the terminal or copy it to the +#: clipboard. + +#: Open URL + +# map kitty_mod+e open_url_with_hints + +#:: Open a currently visible URL using the keyboard. The program used +#:: to open the URL is specified in open_url_with. + +#: Insert selected path + +# map kitty_mod+p>f kitten hints --type path --program - + +#:: Select a path/filename and insert it into the terminal. Useful, +#:: for instance to run git commands on a filename output from a +#:: previous git command. + +#: Open selected path + +# map kitty_mod+p>shift+f kitten hints --type path + +#:: Select a path/filename and open it with the default open program. + +#: Insert selected line + +# map kitty_mod+p>l kitten hints --type line --program - + +#:: Select a line of text and insert it into the terminal. Useful for +#:: the output of things like: `ls -1`. + +#: Insert selected word + +# map kitty_mod+p>w kitten hints --type word --program - + +#:: Select words and insert into terminal. + +#: Insert selected hash + +# map kitty_mod+p>h kitten hints --type hash --program - + +#:: Select something that looks like a hash and insert it into the +#:: terminal. Useful with git, which uses SHA1 hashes to identify +#:: commits. + +#: Open the selected file at the selected line + +# map kitty_mod+p>n kitten hints --type linenum + +#:: Select something that looks like filename:linenum and open it in +#:: your default editor at the specified line number. + +#: Open the selected hyperlink + +# map kitty_mod+p>y kitten hints --type hyperlink + +#:: Select a hyperlink (i.e. a URL that has been marked as such by +#:: the terminal program, for example, by `ls --hyperlink=auto`). + + +#: The hints kitten has many more modes of operation that you can map +#: to different shortcuts. For a full description see hints kitten +#: . +#: }}} + +#: Miscellaneous {{{ + +#: Show documentation + +# map kitty_mod+f1 show_kitty_doc overview + +#: Toggle fullscreen + +# map kitty_mod+f11 toggle_fullscreen +# map ctrl+cmd+f toggle_fullscreen + +#: Toggle maximized + +# map kitty_mod+f10 toggle_maximized + +#: Toggle macOS secure keyboard entry + +# map opt+cmd+s toggle_macos_secure_keyboard_entry + +#: Unicode input + +# map kitty_mod+u kitten unicode_input +# map ctrl+cmd+space kitten unicode_input + +#: Edit config file + +# map kitty_mod+f2 edit_config_file +# map cmd+, edit_config_file + +#: Open the kitty command shell + +# map kitty_mod+escape kitty_shell window + +#:: Open the kitty shell in a new window / tab / overlay / os_window +#:: to control kitty using commands. + +#: Increase background opacity + +# map kitty_mod+a>m set_background_opacity +0.1 + +#: Decrease background opacity + +# map kitty_mod+a>l set_background_opacity -0.1 + +#: Make background fully opaque + +# map kitty_mod+a>1 set_background_opacity 1 + +#: Reset background opacity + +# map kitty_mod+a>d set_background_opacity default + +#: Reset the terminal + +# map kitty_mod+delete clear_terminal reset active +# map opt+cmd+r clear_terminal reset active + +#:: You can create shortcuts to clear/reset the terminal. For +#:: example:: + +#:: # Reset the terminal +#:: map f1 clear_terminal reset active +#:: # Clear the terminal screen by erasing all contents +#:: map f1 clear_terminal clear active +#:: # Clear the terminal scrollback by erasing it +#:: map f1 clear_terminal scrollback active +#:: # Scroll the contents of the screen into the scrollback +#:: map f1 clear_terminal scroll active +#:: # Clear everything up to the line with the cursor or the start of the current prompt (needs shell integration) +#:: map f1 clear_terminal to_cursor active +#:: # Same as above except cleared lines are moved into scrollback +#:: map f1 clear_terminal to_cursor_scroll active + +#:: If you want to operate on all kitty windows instead of just the +#:: current one, use all instead of active. + +#:: Some useful functions that can be defined in the shell rc files +#:: to perform various kinds of clearing of the current window: + +#:: .. code-block:: sh + +#:: clear-only-screen() { +#:: printf "\e[H\e[2J" +#:: } + +#:: clear-screen-and-scrollback() { +#:: printf "\e[H\e[3J" +#:: } + +#:: clear-screen-saving-contents-in-scrollback() { +#:: printf "\e[H\e[22J" +#:: } + +#:: For instance, using these escape codes, it is possible to remap +#:: Ctrl+L to both scroll the current screen contents into the +#:: scrollback buffer and clear the screen, instead of just clearing +#:: the screen. For ZSH, in ~/.zshrc, add: + +#:: .. code-block:: zsh + +#:: ctrl_l() { +#:: builtin print -rn -- $'\r\e[0J\e[H\e[22J' >"$TTY" +#:: builtin zle .reset-prompt +#:: builtin zle -R +#:: } +#:: zle -N ctrl_l +#:: bindkey '^l' ctrl_l + +#:: Alternatively, you can just add map ctrl+l clear_terminal +#:: to_cursor_scroll active to kitty.conf which works with no changes +#:: to the shell rc files, but only clears up to the prompt, it does +#:: not clear anytext at the prompt itself. + +#: Clear up to cursor line + +# map cmd+k clear_terminal to_cursor active + +#: Reload kitty.conf + +# map kitty_mod+f5 load_config_file +# map ctrl+cmd+, load_config_file + +#:: Reload kitty.conf, applying any changes since the last time it +#:: was loaded. Note that a handful of options cannot be dynamically +#:: changed and require a full restart of kitty. Particularly, when +#:: changing shortcuts for actions located on the macOS global menu +#:: bar, a full restart is needed. You can also map a keybinding to +#:: load a different config file, for example:: + +#:: map f5 load_config /path/to/alternative/kitty.conf + +#:: Note that all options from the original kitty.conf are discarded, +#:: in other words the new configuration *replace* the old ones. + +#: Debug kitty configuration + +# map kitty_mod+f6 debug_config +# map opt+cmd+, debug_config + +#:: Show details about exactly what configuration kitty is running +#:: with and its host environment. Useful for debugging issues. + +#: Send arbitrary text on key presses + +#:: E.g. map ctrl+shift+alt+h send_text all Hello World + +#:: You can tell kitty to send arbitrary (UTF-8) encoded text to the +#:: client program when pressing specified shortcut keys. For +#:: example:: + +#:: map ctrl+alt+a send_text all Special text + +#:: This will send "Special text" when you press the Ctrl+Alt+A key +#:: combination. The text to be sent decodes ANSI C escapes +#:: so you can use escapes like \e to send control +#:: codes or \u21fb to send Unicode characters (or you can just input +#:: the Unicode characters directly as UTF-8 text). You can use +#:: `kitten show_key` to get the key escape codes you want to +#:: emulate. + +#:: The first argument to send_text is the keyboard modes in which to +#:: activate the shortcut. The possible values are normal, +#:: application, kitty or a comma separated combination of them. The +#:: modes normal and application refer to the DECCKM cursor key mode +#:: for terminals, and kitty refers to the kitty extended keyboard +#:: protocol. The special value all means all of them. + +#:: Some more examples:: + +#:: # Output a word and move the cursor to the start of the line (like typing and pressing Home) +#:: map ctrl+alt+a send_text normal Word\e[H +#:: map ctrl+alt+a send_text application Word\eOH +#:: # Run a command at a shell prompt (like typing the command and pressing Enter) +#:: map ctrl+alt+a send_text normal,application some command with arguments\r + +#: Open kitty Website + +# map shift+cmd+/ open_url https://sw.kovidgoyal.net/kitty/ + +#: Hide macOS kitty application + +# map cmd+h hide_macos_app + +#: Hide macOS other applications + +# map opt+cmd+h hide_macos_other_apps + +#: Minimize macOS window + +# map cmd+m minimize_macos_window + +#: Quit kitty + +# map cmd+q quit + +#: }}} + +#: }}} From de6172ca6b00b624c7c00f73b5bae22f6ba43e28 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 18:10:54 +0200 Subject: [PATCH 186/280] Update zshrc --- .zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index 61bc409..5d8570b 100644 --- a/.zshrc +++ b/.zshrc @@ -9,6 +9,6 @@ source ~/.zsh/zinit.sh set -o vi eval "$(fzf --zsh)" -bindkey -r "^t" # Unbind fzf keybinding -compinit -C +bindkey -r "^t" +compinit -C From d7eccf6ef1f5d340766aecf40d6c4eeb0301d590 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 18:26:31 +0200 Subject: [PATCH 187/280] Add nvim cmp --- .config/nvim/lazy-lock.json | 10 ++ .config/nvim/lua/plugins/lsp.lua | 189 -------------------------- .config/nvim/lua/plugins/nvim-cmp.lua | 82 +++++++++++ .config/nvim/lua/settings.lua | 4 +- 4 files changed, 94 insertions(+), 191 deletions(-) delete mode 100644 .config/nvim/lua/plugins/lsp.lua create mode 100644 .config/nvim/lua/plugins/nvim-cmp.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index e4553e4..09c9dd8 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,13 +1,21 @@ { "CopilotChat.nvim": { "branch": "canary", "commit": "9333944fde3c65868818e245c73aa29eef826e9b" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, + "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, "auto-session": { "branch": "main", "commit": "21e33854fb3e561cb738dfefcd9d1d84fe6faaef" }, "autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "bufexplorer": { "branch": "master", "commit": "fcf3a65a69020f0f54be8fa925f841874a5f3a01" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-git": { "branch": "main", "commit": "50d526dff0f6bc441b51fc269d9fdc99a50c76af" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, + "friendly-snippets": { "branch": "main", "commit": "00ba9dd3df89509f95437b8d595553707c46d5ea" }, "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "grug-far.nvim": { "branch": "main", "commit": "b7c2b28e49d55ff71cd9bb3ad19a2021316510d8" }, "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, @@ -18,6 +26,8 @@ "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, "neotest": { "branch": "master", "commit": "48f8b5fce704594eb0ff94338e080defca14f0dc" }, "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-lspconfig": { "branch": "master", "commit": "0678aa439b82965daf03679cd146e84f10e299c3" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua deleted file mode 100644 index 27d3f56..0000000 --- a/.config/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,189 +0,0 @@ -return { - -- { - -- "zbirenbaum/copilot.lua", - -- cmd = "Copilot", - -- event = "InsertEnter", - -- config = function() - -- require("copilot").setup() - -- end, - -- }, - -- { - -- "williamboman/mason.nvim", - -- lazy = false, - -- keys = { - -- { "m", "Mason" }, - -- }, - -- config = function() - -- require("mason").setup() - -- end, - -- }, - -- { - -- "williamboman/mason-lspconfig.nvim", - -- lazy = false, - -- config = function() - -- require("mason-lspconfig").setup({ - -- ensure_installed = { "lua_ls", "ts_ls", "solargraph", "rust_analyzer" }, - -- }) - -- end, - -- }, - -- { - -- "sheerun/vim-polyglot", - -- lazy = false, - -- }, - -- { - -- "neovim/nvim-lspconfig", - -- lazy = false, - -- config = function() - -- local capabilities = require("cmp_nvim_lsp").default_capabilities() - -- - -- local lspconfig = require("lspconfig") - -- - -- local common_options = { - -- capabilities = capabilities, - -- } - -- - -- local function setup_lsp(server_name, options) - -- options = options or {} - -- lspconfig[server_name].setup(vim.tbl_extend("force", common_options, options)) - -- end - -- - -- setup_lsp("lua_ls") - -- setup_lsp("ruby_lsp") - -- setup_lsp("rubocop") - -- setup_lsp("ts_ls") - -- setup_lsp("ltex", { - -- cmd = { "ltex-ls" }, - -- filetypes = { "markdown", "text", "cff", "tex" }, - -- flags = { debounce_text_changes = 299 }, - -- }) - -- setup_lsp("astro") - -- setup_lsp("rust_analyzer") - -- - -- lspconfig.solargraph.setup({ - -- capabilities = capabilities, - -- cmd = { - -- "asdf", - -- "exec", - -- "solargraph", - -- "stdio", - -- }, - -- settings = { - -- solargraph = { - -- autoformat = false, - -- completion = true, - -- diagnostic = true, - -- folding = true, - -- references = true, - -- rename = true, - -- symbols = true, - -- }, - -- }, - -- }) - -- - -- vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) - -- vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) - -- vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) - -- vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) - -- vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) - -- vim.cmd([[ - -- autocmd BufNewFile,BufRead *.prawn set filetype=ruby - -- ]]) - -- end, - -- keys = { - -- { "ls", "LspStop" }, - -- { "lS", "LspStart" }, - -- }, - -- }, - -- { - -- "nvimtools/none-ls.nvim", - -- config = function() - -- local null_ls = require("null-ls") - -- null_ls.disable({ "rubocop" }) - -- null_ls.setup({ - -- sources = { - -- null_ls.builtins.formatting.stylua, - -- null_ls.builtins.diagnostics.erb_format, - -- null_ls.builtins.formatting.erb_lint, - -- }, - -- }) - -- end, - -- keys = { - -- { "lf", vim.lsp.buf.format }, - -- }, - -- }, - -- { - -- "hrsh7th/cmp-nvim-lsp", - -- lazy = false, - -- }, - -- { - -- "L3MON4D3/LuaSnip", - -- dependencies = { - -- "saadparwaiz1/cmp_luasnip", - -- "rafamadriz/friendly-snippets", - -- }, - -- keys = { - -- { - -- "", - -- function() - -- return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" - -- end, - -- expr = true, - -- silent = true, - -- mode = "i", - -- }, - -- { - -- "", - -- function() - -- require("luasnip").jump(1) - -- end, - -- mode = "s", - -- }, - -- { - -- "", - -- function() - -- require("luasnip").jump(-1) - -- end, - -- mode = { "i", "s" }, - -- }, - -- }, - -- }, - -- { - -- "hrsh7th/nvim-cmp", - -- lazy = false, - -- dependencies = { - -- "hrsh7th/cmp-nvim-lsp", - -- "hrsh7th/cmp-buffer", - -- "hrsh7th/cmp-cmdline", - -- "rafamadriz/friendly-snippets", - -- }, - -- config = function() - -- local cmp = require("cmp") - -- require("luasnip.loaders.from_vscode").lazy_load() - -- - -- cmp.setup({ - -- snippet = { - -- expand = function(args) - -- require("luasnip").lsp_expand(args.body) - -- end, - -- }, - -- window = { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), - -- }, - -- mapping = cmp.mapping.preset.insert({ - -- [""] = cmp.mapping.scroll_docs(-4), - -- [""] = cmp.mapping.scroll_docs(4), - -- [""] = cmp.mapping.complete(), - -- [""] = cmp.mapping.abort(), - -- [""] = cmp.mapping.confirm({ select = true }), - -- }), - -- sources = cmp.config.sources({ - -- { name = "nvim_lsp" }, - -- { name = "luasnip" }, - -- }, { - -- { name = "buffer" }, - -- }), - -- }) - -- end, - -- }, -} diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..25b3e6f --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -0,0 +1,82 @@ +return { + "hrsh7th/nvim-cmp", + lazy = false, + dependencies = { + "neovim/nvim-lspconfig", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "rafamadriz/friendly-snippets", + "hrsh7th/nvim-cmp", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + }, + config = function() + -- Set up nvim-cmp. + local cmp = require'cmp' + + cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end, + }, + window = { + -- completion = cmp.config.window.bordered(), + -- documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + -- { name = 'nvim_lsp' }, + { name = 'luasnip' }, + }, { + { name = 'buffer' }, + { name = 'path' }, + }) + }) + + -- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below + -- Set configuration for specific filetype. + --[[ cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'git' }, + }, { + { name = 'buffer' }, + }) + }) + require("cmp_git").setup() ]]-- + + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }), + matching = { disallow_symbol_nonprefix_matching = false } + }) + + -- Set up lspconfig. + -- local capabilities = require('cmp_nvim_lsp').default_capabilities() + -- Replace with each lsp server you've enabled. + -- require('lspconfig')[''].setup { + -- capabilities = capabilities + -- } + end +} diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index 96129e9..14d56a8 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -15,8 +15,8 @@ vim.opt.list = false -- whitespace -- nav --- vim.keymap.set("n", "n", "nzz") --- vim.keymap.set("n", "N", "Nzz") +vim.keymap.set("n", "n", "nzz") +vim.keymap.set("n", "N", "Nzz") vim.keymap.set("n", "/", "noh") -- tabs From f23aeb9044030cfe7be6a325247589327571c6ea Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 18:30:00 +0200 Subject: [PATCH 188/280] Update tmux navigator --- .config/nvim/lua/plugins/vim-tmux-navigator.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugins/vim-tmux-navigator.lua b/.config/nvim/lua/plugins/vim-tmux-navigator.lua index 9afc21d..6efe1fe 100644 --- a/.config/nvim/lua/plugins/vim-tmux-navigator.lua +++ b/.config/nvim/lua/plugins/vim-tmux-navigator.lua @@ -1,3 +1,4 @@ return { - { "christoomey/vim-tmux-navigator", lazy = false }, + "christoomey/vim-tmux-navigator", + lazy = false, } From 1ee0e15169bd0ec4d1245ab6be1e790fcfeccfd5 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 18:31:10 +0200 Subject: [PATCH 189/280] Add copilot --- .config/nvim/lazy-lock.json | 2 +- .config/nvim/lua/plugins/copilot.lua | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .config/nvim/lua/plugins/copilot.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 09c9dd8..d9ee46d 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -8,11 +8,11 @@ "bufexplorer": { "branch": "master", "commit": "fcf3a65a69020f0f54be8fa925f841874a5f3a01" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-git": { "branch": "main", "commit": "50d526dff0f6bc441b51fc269d9fdc99a50c76af" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, + "copilot.vim": { "branch": "release", "commit": "782461159655b259cff10ecff05efa761e3d4764" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "00ba9dd3df89509f95437b8d595553707c46d5ea" }, diff --git a/.config/nvim/lua/plugins/copilot.lua b/.config/nvim/lua/plugins/copilot.lua new file mode 100644 index 0000000..f99191d --- /dev/null +++ b/.config/nvim/lua/plugins/copilot.lua @@ -0,0 +1,7 @@ +return { + "github/copilot.vim", + event = "BufRead", + commands = { + "Copilot" + } +} From ddc403777a28ff679859435a4c1ddaa8bd94235c Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 18:34:07 +0200 Subject: [PATCH 190/280] Update nvim conf --- .config/nvim/lua/plugins/nvim-cmp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua index 25b3e6f..b73aedb 100644 --- a/.config/nvim/lua/plugins/nvim-cmp.lua +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -14,7 +14,7 @@ return { }, config = function() -- Set up nvim-cmp. - local cmp = require'cmp' + local cmp = require('cmp') cmp.setup({ snippet = { From c4731567be89ae21dafc04c3924c2baec7104051 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 18:37:40 +0200 Subject: [PATCH 191/280] Add telescope rails mappings --- .config/nvim/lua/plugins/telescope.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 1055ff4..45ad809 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -1,13 +1,17 @@ return { - 'nvim-telescope/telescope.nvim', tag = '0.1.8', - dependencies = { 'nvim-lua/plenary.nvim' }, + "nvim-telescope/telescope.nvim", tag = "0.1.8", + dependencies = { "nvim-lua/plenary.nvim" }, keys = { { "f", "Telescope find_files hidden=true" }, { "w", "Telescope live_grep" }, { "r", function() local current_word = vim.fn.expand("") - require('telescope.builtin').grep_string({ search = current_word }) + require("telescope.builtin").grep_string({ search = current_word }) end }, { "c", "Telescope git_commits" }, + { "ac", "Telescope find_files cwd=app/controllers/ hidden=true" }, + { "am", "Telescope find_files cwd=app/models/ hidden=true" }, + { "as", "Telescope find_files cwd=app/services/ hidden=true" }, + { "at", "Telescope find_files cwd=spec/ hidden=true" }, } } From 6dca8b663246ae5473d0070080b523c6d41c7f01 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 18:43:54 +0200 Subject: [PATCH 192/280] Update names --- .config/nvim/lua/plugins/telescope.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 45ad809..796ed2b 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -9,9 +9,9 @@ return { require("telescope.builtin").grep_string({ search = current_word }) end }, { "c", "Telescope git_commits" }, - { "ac", "Telescope find_files cwd=app/controllers/ hidden=true" }, - { "am", "Telescope find_files cwd=app/models/ hidden=true" }, - { "as", "Telescope find_files cwd=app/services/ hidden=true" }, - { "at", "Telescope find_files cwd=spec/ hidden=true" }, + { "ac", "Telescope find_files prompt_title=Controllers cwd=app/controllers/ hidden=true" }, + { "am", "Telescope find_files prompt_title=Models cwd=app/models/ hidden=true" }, + { "at", "Telescope find_files prompt_title=Specs cwd=spec/ hidden=true" }, + { "av", "Telescope find_files prompt_title=Views cwd=app/views hidden=true" }, } } From f54ad20c363288f488e003abc2b39982e43bc5c7 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 18:44:21 +0200 Subject: [PATCH 193/280] Switcheroo --- .config/nvim/lua/plugins/copilotchat.lua | 2 +- .config/nvim/lua/plugins/nvim-treesitter-textobjects.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/nvim/lua/plugins/copilotchat.lua b/.config/nvim/lua/plugins/copilotchat.lua index d009231..d09be67 100644 --- a/.config/nvim/lua/plugins/copilotchat.lua +++ b/.config/nvim/lua/plugins/copilotchat.lua @@ -60,7 +60,7 @@ return { }, keys = { { - "P", + "p", "CopilotChat", desc = "CopilotChat - Quick chat", }, diff --git a/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua b/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua index 1374167..3f73d61 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua @@ -53,9 +53,9 @@ return { ["nm"] = "@function.outer", -- swap function with next }, swap_previous = { - ["pa"] = "@parameter.inner", -- swap parameters/argument with prev - ["p:"] = "@property.outer", -- swap object property with prev - ["pm"] = "@function.outer", -- swap function with previous + ["Pa"] = "@parameter.inner", -- swap parameters/argument with prev + ["P:"] = "@property.outer", -- swap object property with prev + ["Pm"] = "@function.outer", -- swap function with previous }, }, }, From df0e162fedf1482801d8b129c3077b577bd296c2 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 19:14:34 +0200 Subject: [PATCH 194/280] Update deps --- .config/nvim/lua/plugins/copilotchat.lua | 1 + .config/nvim/lua/plugins/neotest.lua | 13 ++++++++++++- .config/nvim/lua/plugins/telescope.lua | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugins/copilotchat.lua b/.config/nvim/lua/plugins/copilotchat.lua index d09be67..fdeb75f 100644 --- a/.config/nvim/lua/plugins/copilotchat.lua +++ b/.config/nvim/lua/plugins/copilotchat.lua @@ -27,6 +27,7 @@ return { }, opts = { temperature = 0.3, + auto_insert_mode = true, mappings = { reset = { normal = "", diff --git a/.config/nvim/lua/plugins/neotest.lua b/.config/nvim/lua/plugins/neotest.lua index fe48b6c..f05f8e6 100644 --- a/.config/nvim/lua/plugins/neotest.lua +++ b/.config/nvim/lua/plugins/neotest.lua @@ -4,8 +4,19 @@ return { dependencies = { "nvim-neotest/nvim-nio", "nvim-lua/plenary.nvim", - "antoinemadec/FixCursorHold.nvim", "nvim-treesitter/nvim-treesitter", "olimorris/neotest-rspec" + }, + config = function() + require("neotest").setup({ + adapters = { + require("neotest-rspec") + } + }) + end, + keys = { + { "tr", "Neotest run" }, + { "to", "Neotest output" }, + { "ts", "Neotest stop" }, } } diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 796ed2b..44c5855 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -12,6 +12,7 @@ return { { "ac", "Telescope find_files prompt_title=Controllers cwd=app/controllers/ hidden=true" }, { "am", "Telescope find_files prompt_title=Models cwd=app/models/ hidden=true" }, { "at", "Telescope find_files prompt_title=Specs cwd=spec/ hidden=true" }, + { "af", "Telescope find_files prompt_title=Specs cwd=spec/factories hidden=true" }, { "av", "Telescope find_files prompt_title=Views cwd=app/views hidden=true" }, } } From 35b9ef4d9ed74a9faf8426780e19558473872256 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 19:16:35 +0200 Subject: [PATCH 195/280] Update neotest --- .config/nvim/lua/plugins/neotest.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/nvim/lua/plugins/neotest.lua b/.config/nvim/lua/plugins/neotest.lua index f05f8e6..8011ebc 100644 --- a/.config/nvim/lua/plugins/neotest.lua +++ b/.config/nvim/lua/plugins/neotest.lua @@ -15,8 +15,10 @@ return { }) end, keys = { + { "tt", "Neotest run file" }, { "tr", "Neotest run" }, { "to", "Neotest output" }, + { "tO", "Neotest output-panel" }, { "ts", "Neotest stop" }, } } From 1ce2aa41bf3aaceb4f25cd69440e798028fc7a7e Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 19:26:40 +0200 Subject: [PATCH 196/280] Update colorscheme switching --- .config/alacritty/alacritty.toml | 2 +- .config/nvim/init.lua | 1 + .config/nvim/lua/.gitignore | 2 ++ .config/nvim/lua/plugins/colorscheme.lua | 7 ------- change_theme.sh | 23 +++++++++++------------ 5 files changed, 15 insertions(+), 20 deletions(-) create mode 100644 .config/nvim/lua/.gitignore diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 5846782..7daade7 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,5 +1,5 @@ import = [ - "/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Solarized-Light.toml" + "/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Campbell.toml" ] [env] diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 5072720..90e02ca 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -22,3 +22,4 @@ local plugins = { local opts = { defaults = { lazy = true }, change_detection = { notify = false } } require("lazy").setup(plugins, opts) +require("theme") diff --git a/.config/nvim/lua/.gitignore b/.config/nvim/lua/.gitignore new file mode 100644 index 0000000..a9bdaf5 --- /dev/null +++ b/.config/nvim/lua/.gitignore @@ -0,0 +1,2 @@ +# ignore theme because it changes frequently and is managed via change_theme scirpt +theme.lua diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index 91ace03..cfcb35d 100644 --- a/.config/nvim/lua/plugins/colorscheme.lua +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -3,17 +3,10 @@ return { "tiagovla/tokyodark.nvim", lazy = false, priority = 1000, - config = function() - -- vim.cmd("colorscheme tokyodark") - end, }, { "maxmx03/solarized.nvim", lazy = false, priority = 1000, - config = function() - vim.cmd("colorscheme solarized") - vim.cmd("set bg=light") - end, }, } diff --git a/change_theme.sh b/change_theme.sh index 170fcc8..48c28e1 100755 --- a/change_theme.sh +++ b/change_theme.sh @@ -10,31 +10,30 @@ if [ ! -f "$ALACRITTY_CONFIG_FILE" ]; then exit 1 fi -NVIM_CONFIG_FILE="$HOME/.config/nvim/init.lua" +NVIM_THEME_FILE="$HOME/.config/nvim/lua/theme.lua" NVIM_LIGHT_THEME='solarized' -NVIM_DARK_THEME='moonfly' +NVIM_DARK_THEME='tokyodark' -NVIM_LIGHT_THEME_CONFIG="vim.cmd.colorscheme(\"$NVIM_LIGHT_THEME\")" -NVIM_DARK_THEME_CONFIG="vim.cmd.colorscheme(\"$NVIM_DARK_THEME\")" -NVIM_LIGHT_BACKGROUND_CONFIG='vim.opt.background = "light"' -NVIM_DARK_BACKGROUND_CONFIG='vim.opt.background = "dark"' +# Check if NVIM_THEME_FILE exists +if [ ! -f "$NVIM_THEME_FILE" ]; then + echo "File not found: $NVIM_THEME_FILE" + exit 1 +fi NVIM_SERVERS=$(nvr --serverlist) if grep -q "$ALACRITTY_LIGHT_THEME" "$ALACRITTY_CONFIG_FILE"; then # switch to dark theme - sed -i "s|$ALACRITTY_LIGHT_THEME|$ALACRITTY_DARK_THEME|g" "$ALACRITTY_CONFIG_FILE" - sed -i "s|$NVIM_LIGHT_BACKGROUND_CONFIG|$NVIM_DARK_BACKGROUND_CONFIG|g" "$NVIM_CONFIG_FILE" - sed -i "s|$NVIM_LIGHT_THEME_CONFIG|$NVIM_DARK_THEME_CONFIG|g" "$NVIM_CONFIG_FILE" + sed -i '' "s|$ALACRITTY_LIGHT_THEME|$ALACRITTY_DARK_THEME|g" "$ALACRITTY_CONFIG_FILE" + sed -i '' "s|local USE_DARKMODE = false|local USE_DARKMODE = true|g" "$NVIM_THEME_FILE" for server in $NVIM_SERVERS; do nvr --servername $server --remote-send ":colorscheme $NVIM_DARK_THEME:set background=dark" done echo "Changed to dark theme" else # switch to light theme - sed -i "s|$ALACRITTY_DARK_THEME|$ALACRITTY_LIGHT_THEME|g" "$ALACRITTY_CONFIG_FILE" - sed -i "s|$NVIM_DARK_THEME_CONFIG|$NVIM_LIGHT_THEME_CONFIG|g" "$NVIM_CONFIG_FILE" - sed -i "s|$NVIM_DARK_BACKGROUND_CONFIG|$NVIM_LIGHT_BACKGROUND_CONFIG|g" "$NVIM_CONFIG_FILE" + sed -i '' "s|$ALACRITTY_DARK_THEME|$ALACRITTY_LIGHT_THEME|g" "$ALACRITTY_CONFIG_FILE" + sed -i '' "s|local USE_DARKMODE = true|local USE_DARKMODE = false|g" "$NVIM_THEME_FILE" for server in $NVIM_SERVERS; do nvr --servername $server --remote-send ":colorscheme $NVIM_LIGHT_THEME:set background=light" done From 65621b774a75b496340e30c3f1c76839dc84685e Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 19:38:06 +0200 Subject: [PATCH 197/280] Update theme switching --- .config/alacritty/alacritty.toml | 4 +- .../alacritty.toml.1724191066835.bak | 107 ------------------ .config/alacritty/current-theme.toml | 1 + .config/alacritty/themes/solarized_light.toml | 28 +++++ .config/alacritty/themes/tokyonight.toml | 29 +++++ change_theme.sh | 6 +- 6 files changed, 62 insertions(+), 113 deletions(-) delete mode 100644 .config/alacritty/alacritty.toml.1724191066835.bak create mode 100644 .config/alacritty/current-theme.toml create mode 100644 .config/alacritty/themes/solarized_light.toml create mode 100644 .config/alacritty/themes/tokyonight.toml diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 7daade7..a7de2ee 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,6 +1,4 @@ -import = [ - "/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Campbell.toml" -] +import = [ "/Users/dani/.config/alacritty/current-theme.toml" ] [env] TERM = "xterm-256color" diff --git a/.config/alacritty/alacritty.toml.1724191066835.bak b/.config/alacritty/alacritty.toml.1724191066835.bak deleted file mode 100644 index 0da6758..0000000 --- a/.config/alacritty/alacritty.toml.1724191066835.bak +++ /dev/null @@ -1,107 +0,0 @@ -# Default colors -[colors.primary] -background = "#fdf6e3" -foreground = "#586e75" - -[colors.normal] -black = "#073642" -red = "#dc322f" -green = "#859900" -yellow = "#b58900" -blue = "#268bd2" -magenta = "#d33682" -cyan = "#2aa198" -white = "#eee8d5" - -[colors.bright] -black = "#002b36" -red = "#cb4b16" -green = "#586e75" -yellow = "#657b83" -blue = "#839496" -magenta = "#6c71c4" -cyan = "#93a1a1" -white = "#fdf6e3" - -[font] -size = 17.0 -offset.x = 0 -offset.y = 0 - -[font.normal] -family = "JetBrainsMono Nerd Font" - -[[keyboard.bindings]] -action = "CreateNewWindow" -key = "N" -mods = "Command" - -[[keyboard.bindings]] -action = "SearchForward" -key = "F" -mods = "Command" - -[[keyboard.bindings]] -chars = "alacritty -e 'btop' & \r" -key = "P" -mods = "Command" - -[[keyboard.bindings]] -chars = "search_history \r" -key = "Slash" -mode = "AppCursor" -mods = "Command" - -[[keyboard.bindings]] -chars = "\u001Bb" -key = "Left" -mods = "Alt" - -[[keyboard.bindings]] -chars = "\u001Bf" -key = "Right" -mods = "Alt" -[[keyboard.bindings]] -key = "T" -mods = "Command" -chars = "\u0013\u0003" - -[[keyboard.bindings]] -action = "ResetFontSize" -key = "Key0" -mods = "Command" - -[[keyboard.bindings]] -action = "IncreaseFontSize" -key = "Equals" -mods = "Command" - -[[keyboard.bindings]] -action = "DecreaseFontSize" -key = "Minus" -mods = "Command" - -[[keyboard.bindings]] -key = "T" -mods = "Command" -command = { program = "/opt/homebrew/bin/tmux", args = ["new-window", "/bin/zsh"] } - -[[keyboard.bindings]] -key = "W" -mods = "Command" -command = { program = "/opt/homebrew/bin/tmux", args = ["kill-pane"] } - -[shell] -args = ["-l", "-c", "session_name=$(tmux ls | grep -v \"(attached)\" | head -n 1 | cut -d: -f1); [ -n \"$session_name\" ] && tmux attach -t \"$session_name\" || tmux new-session"] -program = "/bin/zsh" - -[window] -decorations = "buttonless" -decorations_theme_variant = "None" -dynamic_padding = false -dynamic_title = true -opacity = 1 - -[window.padding] -x = 10 -y = 10 diff --git a/.config/alacritty/current-theme.toml b/.config/alacritty/current-theme.toml new file mode 100644 index 0000000..2b7f569 --- /dev/null +++ b/.config/alacritty/current-theme.toml @@ -0,0 +1 @@ +import = [ "/Users/dani/.config/alacritty/themes/solarized_light.toml" ] diff --git a/.config/alacritty/themes/solarized_light.toml b/.config/alacritty/themes/solarized_light.toml new file mode 100644 index 0000000..3f7eb25 --- /dev/null +++ b/.config/alacritty/themes/solarized_light.toml @@ -0,0 +1,28 @@ +# Colors (Solarized Light) + +# Default colors +[colors.primary] +background = '#fdf6e3' +foreground = '#586e75' + +# Normal colors +[colors.normal] +black = '#073642' +red = '#dc322f' +green = '#859900' +yellow = '#b58900' +blue = '#268bd2' +magenta = '#d33682' +cyan = '#2aa198' +white = '#eee8d5' + +# Bright colors +[colors.bright] +black = '#002b36' +red = '#cb4b16' +green = '#586e75' +yellow = '#657b83' +blue = '#839496' +magenta = '#6c71c4' +cyan = '#93a1a1' +white = '#fdf6e3' diff --git a/.config/alacritty/themes/tokyonight.toml b/.config/alacritty/themes/tokyonight.toml new file mode 100644 index 0000000..0642a90 --- /dev/null +++ b/.config/alacritty/themes/tokyonight.toml @@ -0,0 +1,29 @@ +# Colors (Tokyo Night) +# Source https//github.com/zatchheems/tokyo-night-alacritty-theme + +# Default colors +[colors.primary] +background = '#1a1b26' +foreground = '#a9b1d6' + +# Normal colors +[colors.normal] +black = '#32344a' +red = '#f7768e' +green = '#9ece6a' +yellow = '#e0af68' +blue = '#7aa2f7' +magenta = '#ad8ee6' +cyan = '#449dab' +white = '#787c99' + +# Bright colors +[colors.bright] +black = '#444b6a' +red = '#ff7a93' +green = '#b9f27c' +yellow = '#ff9e64' +blue = '#7da6ff' +magenta = '#bb9af7' +cyan = '#0db9d7' +white = '#acb0d0' diff --git a/change_theme.sh b/change_theme.sh index 48c28e1..8a1a334 100755 --- a/change_theme.sh +++ b/change_theme.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -ALACRITTY_DARK_THEME="/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Campbell.toml" -ALACRITTY_LIGHT_THEME="/Users/dani/.asdf/installs/nodejs/18.14.2/lib/node_modules/alacritty-themes/themes/Solarized-Light.toml" -ALACRITTY_CONFIG_FILE="$HOME/.config/alacritty/alacritty.toml" +ALACRITTY_LIGHT_THEME="solarized_light" +ALACRITTY_DARK_THEME="tokyonight" +ALACRITTY_CONFIG_FILE="$HOME/.config/alacritty/current-theme.toml" # Check if ALACRITTY_CONFIG_FILE exists if [ ! -f "$ALACRITTY_CONFIG_FILE" ]; then From 6a2419f82156f175890ec9570d5be505626e5870 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Mon, 30 Sep 2024 19:38:55 +0200 Subject: [PATCH 198/280] Add bak files for theme switching --- .config/alacritty/.gitignore | 1 + .config/alacritty/current-theme.toml.bak | 1 + .config/nvim/lua/theme.lua.bak | 9 +++++++++ 3 files changed, 11 insertions(+) create mode 100644 .config/alacritty/.gitignore create mode 100644 .config/alacritty/current-theme.toml.bak create mode 100644 .config/nvim/lua/theme.lua.bak diff --git a/.config/alacritty/.gitignore b/.config/alacritty/.gitignore new file mode 100644 index 0000000..6dcc9e8 --- /dev/null +++ b/.config/alacritty/.gitignore @@ -0,0 +1 @@ +./current-theme.toml diff --git a/.config/alacritty/current-theme.toml.bak b/.config/alacritty/current-theme.toml.bak new file mode 100644 index 0000000..2b7f569 --- /dev/null +++ b/.config/alacritty/current-theme.toml.bak @@ -0,0 +1 @@ +import = [ "/Users/dani/.config/alacritty/themes/solarized_light.toml" ] diff --git a/.config/nvim/lua/theme.lua.bak b/.config/nvim/lua/theme.lua.bak new file mode 100644 index 0000000..5926fff --- /dev/null +++ b/.config/nvim/lua/theme.lua.bak @@ -0,0 +1,9 @@ +local USE_DARKMODE = false + +if USE_DARKMODE then + vim.cmd("colorscheme tokyodark") + vim.cmd("set bg=dark") +else + vim.cmd("colorscheme solarized") + vim.cmd("set bg=light") +end From 03a05102a633daa416232513fef36a9f963cb456 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Mon, 30 Sep 2024 20:54:46 +0200 Subject: [PATCH 199/280] Update plugins, make scripts os agnositic --- .config/alacritty/.gitignore | 2 +- .config/alacritty/alacritty.toml | 2 +- .config/alacritty/current-theme.toml | 2 +- .config/nvim/lazy-lock.json | 75 ++++-- .config/nvim/lua/plugins/lsp.lua | 350 --------------------------- .config/nvim/lua/theme.lua.bak | 9 - .zshrc | 6 +- change_theme.sh | 20 +- 8 files changed, 73 insertions(+), 393 deletions(-) delete mode 100644 .config/nvim/lua/plugins/lsp.lua delete mode 100644 .config/nvim/lua/theme.lua.bak diff --git a/.config/alacritty/.gitignore b/.config/alacritty/.gitignore index 6dcc9e8..9847ade 100644 --- a/.config/alacritty/.gitignore +++ b/.config/alacritty/.gitignore @@ -1 +1 @@ -./current-theme.toml +**/current-theme.toml diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index ad63d6c..c6adaff 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,4 +1,4 @@ -import = [ "/Users/dani/.config/alacritty/current-theme.toml" ] +import = [ "/home/dani/.config/alacritty/current-theme.toml" ] [env] TERM = "xterm-256color" diff --git a/.config/alacritty/current-theme.toml b/.config/alacritty/current-theme.toml index 2b7f569..08c2d0f 100644 --- a/.config/alacritty/current-theme.toml +++ b/.config/alacritty/current-theme.toml @@ -1 +1 @@ -import = [ "/Users/dani/.config/alacritty/themes/solarized_light.toml" ] +import = [ "/home/dani/.config/alacritty/themes/tokyonight.toml" ] diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index d9ee46d..f549ce5 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,49 +1,76 @@ { - "CopilotChat.nvim": { "branch": "canary", "commit": "9333944fde3c65868818e245c73aa29eef826e9b" }, - "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, + "CopilotChat.nvim": { "branch": "canary", "commit": "f20a0425b33c1704133bdef5ec10c4e94f6efdc6" }, + "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, "auto-session": { "branch": "main", "commit": "21e33854fb3e561cb738dfefcd9d1d84fe6faaef" }, "autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, - "bufexplorer": { "branch": "master", "commit": "fcf3a65a69020f0f54be8fa925f841874a5f3a01" }, + "bufexplorer": { "branch": "master", "commit": "2308e87960c05bd8da7bbf62c903e1f42d6cc9b9" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, + "commander.nvim": { "branch": "main", "commit": "84101e8eb1613a72bbdec655b734f891d8a00694" }, + "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, + "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, "copilot.vim": { "branch": "release", "commit": "782461159655b259cff10ecff05efa761e3d4764" }, + "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, - "friendly-snippets": { "branch": "main", "commit": "00ba9dd3df89509f95437b8d595553707c46d5ea" }, - "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, + "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, + "gitsigns.nvim": { "branch": "main", "commit": "f074844b60f9e151970fbcdbeb8a2cd52b6ef25a" }, "grug-far.nvim": { "branch": "main", "commit": "b7c2b28e49d55ff71cd9bb3ad19a2021316510d8" }, - "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, - "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, + "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, + "image_preview.nvim": { "branch": "main", "commit": "8de950078bdecf1916e8dbddfbee451e095b023c" }, + "inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" }, + "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, + "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "lazygit.nvim": { "branch": "main", "commit": "dc56df433bfbf107fee0139e187eb9750878fa84" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "ba9c2f0b93deb48d0a99ae0e8d8dd36f7cc286d6" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, + "mini.ai": { "branch": "main", "commit": "45587078f323eaf41b9f701bbc04f8d1ab008979" }, "mini.cursorword": { "branch": "main", "commit": "7d1b38a17834acbbc4feff8e42aedc4ed0c6ff06" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, - "neotest": { "branch": "master", "commit": "48f8b5fce704594eb0ff94338e080defca14f0dc" }, - "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, - "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-lspconfig": { "branch": "master", "commit": "0678aa439b82965daf03679cd146e84f10e299c3" }, + "mini.indentscope": { "branch": "main", "commit": "f0d7faa064c892b96997810afcddfadc3f2a15b3" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, + "neoconf.nvim": { "branch": "main", "commit": "08ebe382a9db91e7f5d3991156b8fab7afbbe9b2" }, + "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, + "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, + "none-ls.nvim": { "branch": "main", "commit": "a8594ef3dabb484adabc0ebbf5800be1b807c9e7" }, + "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, + "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, + "nvim-lspconfig": { "branch": "master", "commit": "911167921d49cd5c1c9b2436031d0da3945e787f" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, + "nvim-spectre": { "branch": "master", "commit": "9a28f926d3371b7ef02243cbbb653a0478d06e31" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "0c8a582e474e248f2a4406188e0c653f92a064cf" }, + "nvim-treesitter": { "branch": "master", "commit": "e265fec94c7dc0c8c64cb86820ff5ad3ee135c7d" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "oil.nvim": { "branch": "master", "commit": "1360be5fda9c67338331abfcd80de2afbb395bcd" }, + "nvim-web-devicons": { "branch": "master", "commit": "e612de3d3a41a6b7be47f51e956dddabcbf419d9" }, + "nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }, + "oil.nvim": { "branch": "master", "commit": "71c972fbd218723a3c15afcb70421f67340f5a6d" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, - "plantuml-previewer.vim": { "branch": "master", "commit": "555347700382c97b347bace57b7a9f764ed556b1" }, - "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, - "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "solarized.nvim": { "branch": "main", "commit": "1293bec92289d9431fb0ede0b627de8ab60b895e" }, - "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "oxocarbon.nvim": { "branch": "main", "commit": "c5846d10cbe4131cc5e32c6d00beaf59cb60f6a2" }, + "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, + "plantuml-previewer.vim": { "branch": "master", "commit": "1dd4d0f2b09cd80a217f76d82f93830dbbe689b3" }, + "plantuml-syntax": { "branch": "master", "commit": "8fb95a3ae4354ca2322ef24803d8960fce519eb0" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "refactoring.nvim": { "branch": "master", "commit": "ac70bb714f30886e79461869871174a1c1d52058" }, + "solarized.nvim": { "branch": "master", "commit": "fe02ed49cc017cc93657bd6306a2624394611c69" }, + "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, + "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, + "toast.vim": { "branch": "master", "commit": "6ef5cea8298e64a555cfaf7541bb94781d06dc69" }, + "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, + "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, - "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, - "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" }, - "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" } + "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, + "vim-rails": { "branch": "master", "commit": "2fba7907f585819a8653f0bc7dd7f437a822d9c6" }, + "vim-system-copy": { "branch": "master", "commit": "8abd9ed21016bdc21b458c79da3b9ac0ee25c1ce" }, + "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }, + "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" }, + "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, + "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" } } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua deleted file mode 100644 index 31eb00a..0000000 --- a/.config/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,350 +0,0 @@ -return { - { - "ThePrimeagen/refactoring.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - opts = {}, - keys = { - { - "rr", - function() - require("refactoring").select_refactor() - end, - desc = "Refactor", - }, - }, - }, - { - "zbirenbaum/copilot.lua", - cmd = "Copilot", - event = "InsertEnter", - config = function() - require("copilot").setup({}) - end, - }, - { - "zbirenbaum/copilot-cmp", - lazy = false, - event = "InsertEnter", - config = function() - require("copilot_cmp").setup() - require("copilot").setup({ - suggestion = { enabled = true }, - panel = { enabled = false }, - }) - end, - }, - { - "CopilotC-Nvim/CopilotChat.nvim", - lazy = false, - dependencies = { - { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim - { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper - }, - commands = { - "CopilotChat", - "CopilotChat", - "CopilotChatOpen", - "CopilotChatClose", - "CopilotChatToggle", - "CopilotChatStop", - "CopilotChatReset", - "CopilotChatSave", - "CopilotChatLoad", - "CopilotChatDebugInfo", - "CopilotChatModels", - "CopilotChatExplain", - "CopilotChatReview", - "CopilotChatFix", - "CopilotChatOptimize", - "CopilotChatDocs", - "CopilotChatTests", - "CopilotChatFixDiagnostic", - "CopilotChatCommit", - "CopilotChatCommitStaged", - }, - opts = { - temperature = 0.3, - mappings = { - reset = { - normal = "", - insert = "", - }, - complete = { - detail = "Use @ or / for options.", - insert = "", - }, - close = { - normal = "q", - insert = "", - }, - submit_prompt = { - normal = "", - insert = "", - }, - accept_diff = { - normal = "", - insert = "", - }, - yank_diff = { - normal = "gy", - }, - show_diff = { - normal = "gd", - }, - show_system_prompt = { - normal = "gp", - }, - show_user_selection = { - normal = "gs", - }, - }, - }, - keys = { - { - "ccq", - function() - local input = vim.fn.input("Quick Chat: ") - if input ~= "" then - require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) - end - end, - desc = "CopilotChat - Quick chat", - }, - { - "cch", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.help_actions()) - end, - desc = "CopilotChat - Help actions", - }, - -- Show prompts actions with telescope - { - "ccp", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) - end, - desc = "CopilotChat - Prompt actions", - }, - }, - }, - { - "williamboman/mason.nvim", - lazy = false, - keys = { - { "m", "Mason" }, - }, - config = function() - require("mason").setup() - end, - }, - { - "williamboman/mason-lspconfig.nvim", - lazy = false, - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "tsserver", "solargraph" }, - }) - end, - }, - { - "neovim/nvim-lspconfig", - lazy = false, - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() - -- https://www.mitchellhanberg.com/modern-format-on-save-in-neovim/ - -- vim.api.nvim_create_autocmd("LspAttach", { - -- group = vim.api.nvim_create_augroup("lsp", { clear = true }), - -- callback = function(args) - -- vim.api.nvim_create_autocmd("BufWritePre", { - -- buffer = args.buf, - -- callback = function() - -- vim.lsp.buf.format({ async = false, id = args.data.client_id }) - -- end, - -- }) - -- end, - -- }) - - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup({ capabilities = capabilities }) - lspconfig.tsserver.setup({ capabilities = capabilities }) - -- lspconfig.standardrb.setup({ capabilities = capabilities }) - -- lspconfig.rubocop.setup({ capabilities = capabilities }) - -- lspconfig.rust_analyzer.setup({ capabilities = capabilities }) - -- lspconfig.ltex.setup({ - -- cmd = { "ltex-ls" }, - -- filetypes = { "markdown", "text", "cff", "tex" }, - -- flags = { debounce_text_changes = 299 }, - -- }) - -- lspconfig.astro.setup({}) - - lspconfig.solargraph.setup({ - capabilities = capabilities, - cmd = { - "asdf", - "exec", - "solargraph", - "stdio", - }, - settings = { - solargraph = { - autoformat = false, - completion = true, - diagnostic = true, - folding = true, - references = true, - rename = true, - symbols = true, - }, - }, - }) - - vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) - vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) - vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) - vim.cmd([[ - autocmd BufNewFile,BufRead *.prawn set filetype=ruby - ]]) - end, - }, - { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.disable({ "rubocop" }) - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.diagnostics.erb_format, - null_ls.builtins.formatting.erb_lint, - }, - }) - end, - keys = { - { "gf", vim.lsp.buf.format }, - }, - }, - { - "hrsh7th/cmp-nvim-lsp", - lazy = false, - }, - { - "L3MON4D3/LuaSnip", - dependencies = { - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets", - }, - keys = { - { - "", - function() - return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" - end, - expr = true, - silent = true, - mode = "i", - }, - { - "", - function() - require("luasnip").jump(1) - end, - mode = "s", - }, - { - "", - function() - require("luasnip").jump(-1) - end, - mode = { "i", "s" }, - }, - }, - }, - { - "hrsh7th/nvim-cmp", - lazy = false, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-cmdline", - "rafamadriz/friendly-snippets", - }, - config = function() - local cmp = require("cmp") - require("luasnip.loaders.from_vscode").lazy_load() - - cmp.setup({ - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - -- { name = "copilot", group_index = 2 }, - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - }), - }) - end, - }, - -- { - -- "nvim-treesitter/nvim-treesitter-refactor", - -- lazy = false, - -- config = function() - -- require("nvim-treesitter.configs").setup({ - -- refactor = { - -- highlight_definitions = { - -- enable = true, - -- clear_on_cursor_move = true, - -- }, - -- highlight_current_scope = { enable = false }, - -- smart_rename = { - -- enable = true, - -- -- Assign keymaps to false to disable them, e.g. `smart_rename = false`. - -- keymaps = { - -- smart_rename = "grr", - -- }, - -- }, - -- navigation = { - -- enable = true, - -- -- Assign keymaps to false to disable them, e.g. `goto_definition = false`. - -- keymaps = { - -- goto_definition = "gnd", - -- list_definitions = "gnD", - -- list_definitions_toc = "gO", - -- goto_next_usage = "", - -- goto_previous_usage = "", - -- }, - -- }, - -- }, - -- }) - -- end, - -- }, - -- { - -- "cuducos/yaml.nvim", - -- ft = { "yaml" }, -- optional - -- dependencies = { - -- "nvim-treesitter/nvim-treesitter", - -- "nvim-telescope/telescope.nvim", -- optional - -- }, - -- } -} diff --git a/.config/nvim/lua/theme.lua.bak b/.config/nvim/lua/theme.lua.bak deleted file mode 100644 index 5926fff..0000000 --- a/.config/nvim/lua/theme.lua.bak +++ /dev/null @@ -1,9 +0,0 @@ -local USE_DARKMODE = false - -if USE_DARKMODE then - vim.cmd("colorscheme tokyodark") - vim.cmd("set bg=dark") -else - vim.cmd("colorscheme solarized") - vim.cmd("set bg=light") -end diff --git a/.zshrc b/.zshrc index 5d8570b..95d21e8 100644 --- a/.zshrc +++ b/.zshrc @@ -2,7 +2,11 @@ source ~/.import-secrets.sh source ~/.zsh/aliases.sh source ~/.zsh/exports.sh source ~/.zsh/history.sh -source ~/.zsh/homebrew.sh + +if [[ "$OSTYPE" == "darwin"* ]]; then + source ~/.zsh/homebrew.sh +fi + source ~/.zsh/utils.sh source ~/.zsh/zinit.sh diff --git a/change_theme.sh b/change_theme.sh index 8a1a334..857229e 100755 --- a/change_theme.sh +++ b/change_theme.sh @@ -1,10 +1,19 @@ #!/usr/bin/env bash +if [[ "$OSTYPE" == "darwin"* ]]; then + SED_COMMAND='sed -i ""' +else + SED_COMMAND='sed -i' +fi + +replace() { + $SED_COMMAND "s|$1|$2|g" "$3" +} + ALACRITTY_LIGHT_THEME="solarized_light" ALACRITTY_DARK_THEME="tokyonight" ALACRITTY_CONFIG_FILE="$HOME/.config/alacritty/current-theme.toml" -# Check if ALACRITTY_CONFIG_FILE exists if [ ! -f "$ALACRITTY_CONFIG_FILE" ]; then echo "File not found: $ALACRITTY_CONFIG_FILE" exit 1 @@ -14,7 +23,6 @@ NVIM_THEME_FILE="$HOME/.config/nvim/lua/theme.lua" NVIM_LIGHT_THEME='solarized' NVIM_DARK_THEME='tokyodark' -# Check if NVIM_THEME_FILE exists if [ ! -f "$NVIM_THEME_FILE" ]; then echo "File not found: $NVIM_THEME_FILE" exit 1 @@ -24,16 +32,16 @@ NVIM_SERVERS=$(nvr --serverlist) if grep -q "$ALACRITTY_LIGHT_THEME" "$ALACRITTY_CONFIG_FILE"; then # switch to dark theme - sed -i '' "s|$ALACRITTY_LIGHT_THEME|$ALACRITTY_DARK_THEME|g" "$ALACRITTY_CONFIG_FILE" - sed -i '' "s|local USE_DARKMODE = false|local USE_DARKMODE = true|g" "$NVIM_THEME_FILE" + replace "$ALACRITTY_LIGHT_THEME" "$ALACRITTY_DARK_THEME" "$ALACRITTY_CONFIG_FILE" + replace "local USE_DARKMODE = false" "local USE_DARKMODE = true" "$NVIM_THEME_FILE" for server in $NVIM_SERVERS; do nvr --servername $server --remote-send ":colorscheme $NVIM_DARK_THEME:set background=dark" done echo "Changed to dark theme" else # switch to light theme - sed -i '' "s|$ALACRITTY_DARK_THEME|$ALACRITTY_LIGHT_THEME|g" "$ALACRITTY_CONFIG_FILE" - sed -i '' "s|local USE_DARKMODE = true|local USE_DARKMODE = false|g" "$NVIM_THEME_FILE" + replace "$ALACRITTY_DARK_THEME" "$ALACRITTY_LIGHT_THEME" "$ALACRITTY_CONFIG_FILE" + replace "local USE_DARKMODE = true" "local USE_DARKMODE = false" "$NVIM_THEME_FILE" for server in $NVIM_SERVERS; do nvr --servername $server --remote-send ":colorscheme $NVIM_LIGHT_THEME:set background=light" done From 8c5d9c2d939bc81d08165bdbd32c6a59fab59d6f Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Mon, 30 Sep 2024 21:01:11 +0200 Subject: [PATCH 200/280] Update deps --- .config/nvim/lazy-lock.json | 30 +- .config/nvim/lua/plugins/editor.lua | 475 ---------------------------- 2 files changed, 1 insertion(+), 504 deletions(-) delete mode 100644 .config/nvim/lua/plugins/editor.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index f549ce5..daa38a8 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -10,36 +10,21 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "commander.nvim": { "branch": "main", "commit": "84101e8eb1613a72bbdec655b734f891d8a00694" }, - "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, "copilot.vim": { "branch": "release", "commit": "782461159655b259cff10ecff05efa761e3d4764" }, - "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, "gitsigns.nvim": { "branch": "main", "commit": "f074844b60f9e151970fbcdbeb8a2cd52b6ef25a" }, "grug-far.nvim": { "branch": "main", "commit": "b7c2b28e49d55ff71cd9bb3ad19a2021316510d8" }, - "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, - "image_preview.nvim": { "branch": "main", "commit": "8de950078bdecf1916e8dbddfbee451e095b023c" }, - "inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" }, - "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, "lazygit.nvim": { "branch": "main", "commit": "dc56df433bfbf107fee0139e187eb9750878fa84" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "ba9c2f0b93deb48d0a99ae0e8d8dd36f7cc286d6" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, - "mini.ai": { "branch": "main", "commit": "45587078f323eaf41b9f701bbc04f8d1ab008979" }, "mini.cursorword": { "branch": "main", "commit": "7d1b38a17834acbbc4feff8e42aedc4ed0c6ff06" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, - "mini.indentscope": { "branch": "main", "commit": "f0d7faa064c892b96997810afcddfadc3f2a15b3" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, - "neoconf.nvim": { "branch": "main", "commit": "08ebe382a9db91e7f5d3991156b8fab7afbbe9b2" }, "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, - "none-ls.nvim": { "branch": "main", "commit": "a8594ef3dabb484adabc0ebbf5800be1b807c9e7" }, - "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, "nvim-lspconfig": { "branch": "master", "commit": "911167921d49cd5c1c9b2436031d0da3945e787f" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, @@ -49,28 +34,15 @@ "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "nvim-web-devicons": { "branch": "master", "commit": "e612de3d3a41a6b7be47f51e956dddabcbf419d9" }, - "nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }, "oil.nvim": { "branch": "master", "commit": "71c972fbd218723a3c15afcb70421f67340f5a6d" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, - "oxocarbon.nvim": { "branch": "main", "commit": "c5846d10cbe4131cc5e32c6d00beaf59cb60f6a2" }, - "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plantuml-previewer.vim": { "branch": "master", "commit": "1dd4d0f2b09cd80a217f76d82f93830dbbe689b3" }, "plantuml-syntax": { "branch": "master", "commit": "8fb95a3ae4354ca2322ef24803d8960fce519eb0" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, - "refactoring.nvim": { "branch": "master", "commit": "ac70bb714f30886e79461869871174a1c1d52058" }, "solarized.nvim": { "branch": "master", "commit": "fe02ed49cc017cc93657bd6306a2624394611c69" }, - "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, - "toast.vim": { "branch": "master", "commit": "6ef5cea8298e64a555cfaf7541bb94781d06dc69" }, - "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, - "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, - "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, "vim-rails": { "branch": "master", "commit": "2fba7907f585819a8653f0bc7dd7f437a822d9c6" }, - "vim-system-copy": { "branch": "master", "commit": "8abd9ed21016bdc21b458c79da3b9ac0ee25c1ce" }, "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }, - "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" }, - "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, - "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" } + "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" } } diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua deleted file mode 100644 index 9cbac0a..0000000 --- a/.config/nvim/lua/plugins/editor.lua +++ /dev/null @@ -1,475 +0,0 @@ -return { - { "tpope/vim-unimpaired", event = "VeryLazy" }, - { "christoomey/vim-system-copy", lazy = false }, - { "folke/neoconf.nvim", cmd = "Neoconf" }, - { - "nvimdev/dashboard-nvim", - event = "VimEnter", - config = function() - require("dashboard").setup({ - theme = "hyper", - config = { - header = { - [[ ]], - [[  ]], - [[ ████ ██████ █████ ██ ]], - [[ ███████████ █████  ]], - [[ █████████ ███████████████████ ███ ███████████ ]], - [[ █████████ ███ █████████████ █████ ██████████████ ]], - [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], - [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], - [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], - [[ ]], - }, - }, - shortcut = { - { desc = "󰊳 Update", group = "@property", action = "Lazy update", key = "u" }, - { - icon = " ", - icon_hl = "@variable", - desc = "Files", - group = "Label", - action = "Telescope find_files", - key = "f", - }, - { - desc = " Apps", - group = "DiagnosticHint", - action = "Telescope app", - key = "a", - }, - { - desc = " dotfiles", - group = "Number", - action = "Telescope dotfiles", - key = "d", - }, - { - desc = " Restore Session", - group = "Number", - action = "require('persistence').load()", - key = "r", - }, - }, - }) - end, - dependencies = { "nvim-tree/nvim-web-devicons" }, - }, - { - "adelarsq/image_preview.nvim", - event = "VeryLazy", - config = function() - require("image_preview").setup() - end, - }, - { - "nyoom-engineering/oxocarbon.nvim", - lazy = false, - config = function() - -- vim.cmd.colorscheme("oxocarbon") - end, - }, - -- TODO: fix - -- { - -- "max397574/better-escape.nvim", - -- lazy = false, - -- config = function() - -- require("better_escape").setup({ - -- mapping = { "jk", "jj" }, - -- timeout = 100, - -- clear_empty_lines = false, - -- keys = function() - -- return vim.api.nvim_win_get_cursor(0)[2] > 1 and "l" or "" - -- end, - -- }) - -- end, - -- }, - { - "jsit/toast.vim", - lazy = false, - config = function() - -- vim.cmd "set background=light" - -- vim.cmd.colorscheme "toast" - end, - }, - { - "folke/persistence.nvim", - event = "BufReadPre", - opts = { options = vim.opt.sessionoptions:get() }, - -- stylua: ignore - keys = { - { "qs", function() require("persistence").load() end, desc = "Restore Session" }, - { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, - { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, - }, - }, - { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 200 - end, - opts = {}, - }, - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - "s1n7ax/nvim-window-picker", - }, - keys = { - { "e", "Neotree position=float reveal toggle", desc = "Neotree" }, - }, - config = function() - require("neo-tree").setup({ - sources = { "filesystem", "document_symbols" }, - filesystem = { - filtered_items = { - visible = true, -- when true, they will just be displayed differently than normal items - hide_dotfiles = true, - hide_gitignored = true, - }, - }, - window = { - mappings = { - [""] = "none", - ["Y"] = { - function(state) - local node = state.tree:get_node() - local path = node:get_id() - vim.fn.setreg("+", path, "c") - end, - desc = "Copy Path to Clipboard", - }, - ["O"] = { - function(state) - require("lazy.util").open(state.tree:get_node().path, { system = true }) - end, - desc = "Open with System Application", - }, - }, - }, - }) - end, - }, - -- { - -- "nvim-treesitter/nvim-treesitter", - -- event = "VeryLazy", - -- dependencies = { - -- "RRethy/nvim-treesitter-endwise", - -- }, - -- config = function() - -- require("nvim-treesitter.configs").setup({ - -- ensure_installed = { "lua", "vim", "ruby", "bibtex", "yaml" }, - -- ignore_install = { "latex" }, - -- auto_install = true, - -- endwise = { - -- enable = true, - -- }, - -- highlight = { - -- enable = true, - -- }, - -- }) - -- end, - -- }, - { - "stevearc/oil.nvim", - opts = { - default_file_explorer = true, - columns = { - "icon", - }, - view_options = { - show_hidden = true, - }, - float = { - max_width = 142, - preview_split = "right", - }, - }, - dependencies = { "nvim-tree/nvim-web-devicons" }, - keys = { - { "-", "Oil", desc = "Oil" }, - }, - }, - { - "FeiyouG/commander.nvim", - dependencies = { - "nvim-telescope/telescope.nvim", - }, - keys = { - { "fp", "Telescope commander", mode = "n" }, - { "fc", "Telescope commander", mode = "n" }, - }, - config = function() - require("commander").setup({ - components = { - "DESC", - "KEYS", - "CAT", - }, - sort_by = { - "DESC", - "KEYS", - "CAT", - "CMD", - }, - integration = { - telescope = { - enable = true, - }, - lazy = { - enable = true, - set_plugin_name_as_cat = true, - }, - }, - }) - end, - }, - { - "echasnovski/mini.indentscope", - version = "*", - lazy = false, - config = function() end, - }, - { - "lukas-reineke/indent-blankline.nvim", - main = "ibl", - lazy = true, - config = { - exclude = { - filetypes = { - "lspinfo", - "packer", - "checkhealth", - "help", - "man", - "gitcommit", - "TelescopePrompt", - "TelescopeResults", - "Dashboard", - }, - }, - }, - keys = { - { - "ibl", - "IBLToggleScope", - }, - }, - }, - { - "jlanzarotta/bufexplorer", - lazy = false, - }, - { - "nvim-pack/nvim-spectre", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - }, - config = function() - require("spectre").setup() - end, - keys = { - { - mode = "n", - "S", - 'lua require("spectre").toggle()', - desc = "Toggle Spectre", - }, - { - mode = "n", - "sw", - 'lua require("spectre").open_visual({select_word=true})', - desc = "Search current word", - }, - { - mode = "v", - "sw", - 'lua require("spectre").open_visual()', - desc = "Search current word", - }, - { - mode = "n", - "sp", - 'lua require("spectre").open_file_search({select_word=true})', - desc = "Search on current file", - }, - }, - }, - { - "folke/trouble.nvim", - lazy = false, - keys = { - { - "j", - function() - require("trouble").next({ skip_groups = true, jump = true }) - end, - }, - { - "k", - function() - require("trouble").previous({ skip_groups = true, jump = true }) - end, - }, - }, - }, - { - "folke/todo-comments.nvim", - cmd = { "TodoTrouble", "TodoTelescope" }, - event = "VeryLazy", - config = true, - -- stylua: ignore - keys = { - { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" }, - { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" }, - { "xt", "TodoTrouble", desc = "Todo (Trouble)" }, - { "xT", "TodoTrouble keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme (Trouble)" }, - { "st", "TodoTelescope", desc = "Todo" }, - { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, - }, - }, - { - "akinsho/toggleterm.nvim", - version = "*", - opts = function() - require("toggleterm").setup({ - float_opts = { - border = "curved", - }, - }) - - opts = {} - vim.keymap.set("t", "", [[]], opts) - vim.keymap.set("t", "jk", [[]], opts) - end, - keys = { - { "!", "ToggleTerm direction=float", desc = "Toggle Terminal" }, - }, - }, - { - "simrat39/symbols-outline.nvim", - config = function() - require("symbols-outline").setup() - end, - keys = { - { "so", "SymbolsOutline", desc = "SymbolsOutline" }, - }, - }, - -- { - -- "brenoprata10/nvim-highlight-colors", - -- event = "VeryLazy", - -- config = function() - -- require('nvim-highlight-colors').setup({}) - -- end - -- }, - { - "ThePrimeagen/harpoon", - event = "VeryLazy", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - require("harpoon").setup({}) - end, - keys = { - { - "1", - function() - require("harpoon.ui").nav_file(1) - end, - desc = "Harpoon file 1", - }, - { - "2", - function() - require("harpoon.ui").nav_file(2) - end, - desc = "Harpoon file 2", - }, - { - "3", - function() - require("harpoon.ui").nav_file(3) - end, - desc = "Harpoon file 3", - }, - { - "4", - function() - require("harpoon.ui").nav_file(4) - end, - desc = "Harpoon file 4", - }, - { - "5", - function() - require("harpoon.ui").nav_file(5) - end, - desc = "Harpoon file 5", - }, - { - "6", - function() - require("harpoon.ui").nav_file(6) - end, - desc = "Harpoon file 6", - }, - { - "7", - function() - require("harpoon.ui").nav_file(7) - end, - desc = "Harpoon file 7", - }, - { - "8", - function() - require("harpoon.ui").nav_file(8) - end, - desc = "Harpoon file 8", - }, - { - "9", - function() - require("harpoon.ui").nav_file(9) - end, - desc = "Harpoon file 9", - }, - { - "hh", - function() - require("harpoon.ui").toggle_quick_menu() - end, - desc = "Harpoon toggle quick menu", - }, - { - "H", - function() - require("harpoon.mark").add_file() - end, - desc = "Harpoon add file", - }, - }, - }, - { - "smjonas/inc-rename.nvim", - config = function() - require("inc_rename").setup() - end, - lazy = false, - }, - { "echasnovski/mini.ai", version = false, lazy = false }, - -- { - -- 'nvim-lualine/lualine.nvim', - -- lazy = false, - -- dependencies = { 'nvim-tree/nvim-web-devicons' }, - -- config = function() - -- require("lualine").setup() - -- end - -- } -} From 0e9a6358a28cda3831db6d29e0a001b4d1ca7d86 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Mon, 30 Sep 2024 21:01:14 +0200 Subject: [PATCH 201/280] Add readme --- .config/nvim/README.md | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .config/nvim/README.md diff --git a/.config/nvim/README.md b/.config/nvim/README.md new file mode 100644 index 0000000..6b7be53 --- /dev/null +++ b/.config/nvim/README.md @@ -0,0 +1,52 @@ +# Nvim Config + +This is my own nvim config. + +It is strongly opinionated and tailored to my own needs. + +## Overview + +This is a rough overview of the plugins I have configured for nvim + +### File Exploring +- **bufexplorer**: Buffer explorer / picker. +- **Nvim-tree**: A file explorer tree. + +### Autocompletion +- **nvim-cmp**: Autocompletion framework. +- **LuaSnip**: Snippet engine. +- **cmp-buffer**: Buffer source for nvim-cmp. +- **cmp-cmdline**: Cmdline source for nvim-cmp. +- **cmp-nvim-lsp**: LSP source for nvim-cmp. +- **cmp-path**: Filepath source for nvim-cmp. +- **cmp_luasnip**: LuaSnip source for nvim-cmp. +- **friendly-snippets**: Preconfigured snippets for nvim-cmp. + +### Navigation +- **vim-tmux-navigator**: Seamless navigation between tmux panes and vim splits. +- **vim-visual-multi**: Multiple cursors plugin. +- **nvim-surround**: Surroundings operations (add, change, delete). +- **nvim-treesitter-textobjects**: Advanced textobjects based on treesitter. +- **nvim-treesitter-endwise**: Endwise motion based on treesitter. + +### FZF (Fuzzy Finder) +- **telescope.nvim**: Highly extendable fuzzy finder over lists. + +### Git +- **gitsigns.nvim**: Git signs (add, change, delete) in the sign column. +- **lazygit.nvim**: Terminal UI for git commands. +- **diffview.nvim**: Side-by-side diff viewer for git in Neovim. + +### Other +- **copilot.vim**: AI pair programming assistant. +- **neotest-rspec**: RSpec test runner. +- **nvim-lspconfig**: Quickstart configurations for the Nvim LSP client. +- **nvim-treesitter**: Parser generator tool and an incremental parsing library. +- **nvim-spectre**: Search and replace tool. +- **auto-session**: Automatic session save and restore. +- **autoclose.nvim**: Auto close pairs of brackets and quotes. +- **markdown.nvim**: Markdown support. +- **plantuml-previewer.vim**: PlantUML previewer. +- **solarized.nvim**: Solarized color scheme. +- **tokyodark.nvim**: Tokyo Night color scheme. + From da31a1fe7f854d9baf97c003597badaebda2dcfc Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Mon, 30 Sep 2024 21:08:05 +0200 Subject: [PATCH 202/280] Update README --- .config/nvim/README.md | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.config/nvim/README.md b/.config/nvim/README.md index 6b7be53..458aee1 100644 --- a/.config/nvim/README.md +++ b/.config/nvim/README.md @@ -6,13 +6,28 @@ It is strongly opinionated and tailored to my own needs. ## Overview -This is a rough overview of the plugins I have configured for nvim +I have been using Neovim as my primary editor for a while now and I have been customizing it to my own needs, adding and removing plugins, and tweaking settings to make it more efficient and productive. +The entry point for the configuration is `init.lua`, which loads the rest of the configuration. The configuration is split into some files under the `lua` directory. Lazy plugins can also be found there. -### File Exploring +### Repository Files + +Here are some of the key files in the repository: + +- `./lua/util.lua`: Contains utility functions used across the configuration. +- `./lua/theme.lua`: Contains theme settings and customizations. +- `./lua/settings.lua`: Contains general settings for Neovim. + +### Plugins + +I am using the lazyvim plugin manager to manage plugins. +[Lazyvim](https://github.com/folke/lazy.nvim) is a plugin manager that loads plugins lazily, only when they are needed. + + +#### File Exploring - **bufexplorer**: Buffer explorer / picker. - **Nvim-tree**: A file explorer tree. -### Autocompletion +#### Autocompletion - **nvim-cmp**: Autocompletion framework. - **LuaSnip**: Snippet engine. - **cmp-buffer**: Buffer source for nvim-cmp. @@ -22,22 +37,22 @@ This is a rough overview of the plugins I have configured for nvim - **cmp_luasnip**: LuaSnip source for nvim-cmp. - **friendly-snippets**: Preconfigured snippets for nvim-cmp. -### Navigation +#### Navigation - **vim-tmux-navigator**: Seamless navigation between tmux panes and vim splits. - **vim-visual-multi**: Multiple cursors plugin. - **nvim-surround**: Surroundings operations (add, change, delete). - **nvim-treesitter-textobjects**: Advanced textobjects based on treesitter. - **nvim-treesitter-endwise**: Endwise motion based on treesitter. -### FZF (Fuzzy Finder) +#### FZF (Fuzzy Finder) - **telescope.nvim**: Highly extendable fuzzy finder over lists. -### Git +#### Git - **gitsigns.nvim**: Git signs (add, change, delete) in the sign column. - **lazygit.nvim**: Terminal UI for git commands. - **diffview.nvim**: Side-by-side diff viewer for git in Neovim. -### Other +#### Other - **copilot.vim**: AI pair programming assistant. - **neotest-rspec**: RSpec test runner. - **nvim-lspconfig**: Quickstart configurations for the Nvim LSP client. From 621ba01b9ad7171efcc6549d0e00f4cbbdeb1989 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Mon, 30 Sep 2024 21:13:12 +0200 Subject: [PATCH 203/280] Update readme --- .config/nvim/README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.config/nvim/README.md b/.config/nvim/README.md index 458aee1..5e910c9 100644 --- a/.config/nvim/README.md +++ b/.config/nvim/README.md @@ -1,9 +1,15 @@ # Nvim Config -This is my own nvim config. - -It is strongly opinionated and tailored to my own needs. +This is my own nvim config. It is strongly opinionated and tailored to my own needs. +## Philosophy + +This configuration is a no-nonsense, bare-knuckle beast that prioritizes raw performance and simplicity above all else. It doesn't have time for fancy status lines like `lualine` or bloated file explorers like `Neotree`. No sir, there are no animations or other frivolous distractions that could bog down the editor. + +Yes, there are plugins like `gitsigns` that might add a bit of overhead, but nothing that would significantly impact performance. And there's absolutely no room for fancy markdown rendering or over-engineered find and replace tools. It's all about keeping it simple and efficient. + +The goal here is pure, unadulterated SPEED. Every plugin and setting has been chosen and tweaked with this in mind. If it doesn't make the editing experience faster and more efficient, it doesn't make the cut. + ## Overview I have been using Neovim as my primary editor for a while now and I have been customizing it to my own needs, adding and removing plugins, and tweaking settings to make it more efficient and productive. From eebbe5624226e199ba78567d795fd3fa2405afc8 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Mon, 30 Sep 2024 21:14:48 +0200 Subject: [PATCH 204/280] Update readme --- .config/nvim/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/nvim/README.md b/.config/nvim/README.md index 5e910c9..ff68f68 100644 --- a/.config/nvim/README.md +++ b/.config/nvim/README.md @@ -1,13 +1,15 @@ # Nvim Config This is my own nvim config. It is strongly opinionated and tailored to my own needs. - + ## Philosophy This configuration is a no-nonsense, bare-knuckle beast that prioritizes raw performance and simplicity above all else. It doesn't have time for fancy status lines like `lualine` or bloated file explorers like `Neotree`. No sir, there are no animations or other frivolous distractions that could bog down the editor. Yes, there are plugins like `gitsigns` that might add a bit of overhead, but nothing that would significantly impact performance. And there's absolutely no room for fancy markdown rendering or over-engineered find and replace tools. It's all about keeping it simple and efficient. +Additionally, the key mappings are kept short and simple. Instead of convoluted mappings like `cff`, the aim is to limit mappings to one or two keys. This is part of the commitment to efficiency and speed. + The goal here is pure, unadulterated SPEED. Every plugin and setting has been chosen and tweaked with this in mind. If it doesn't make the editing experience faster and more efficient, it doesn't make the cut. ## Overview From 5ae31995d2a69f7f14d2702f8f9f2b4e445a91b1 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Mon, 30 Sep 2024 21:17:39 +0200 Subject: [PATCH 205/280] Update dotfiles README --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b05e0eb..ee37a60 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,11 @@ Other than the dotfiles, I also have a few scripts that I use to automate some t ## Configuration * [Alacritty](./.config/alacritty/alacritty.toml) -* [Nvim](./.config/nvim/init.lua) +* [Nvim](./.config/nvim/README.md) * [Lazygit](./lazygit/config.yml) * [Tmux](./.tmux.conf) -* [Zsh](./.zshrc) +* [Zsh profile](./.zshrc) * [Utility Scripts](./scripts/) +* [NixOS Configuration](./nixos/configuration.nix) +* [NixOS Hardware Configuration](./nixos/hardware-configuration.nix) +* [Hyprland Configuration](./.config/hypr/hyprland.conf) From 2912ceb90047344071eadc26c9e3d0f08c11c19a Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Mon, 30 Sep 2024 21:20:04 +0200 Subject: [PATCH 206/280] Add license --- LICENSE | 20 ++++++++++++++++++++ README.md | 4 ++++ 2 files changed, 24 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..527697e --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2024 Daniel Bengl + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index ee37a60..581c906 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,7 @@ Other than the dotfiles, I also have a few scripts that I use to automate some t * [NixOS Configuration](./nixos/configuration.nix) * [NixOS Hardware Configuration](./nixos/hardware-configuration.nix) * [Hyprland Configuration](./.config/hypr/hyprland.conf) + +## License + +The code in this repository is licensed under the MIT license. See [LICENSE](./LICENSE) for more information. From 08df0dba45f47c67500527d1f6b410219734ef69 Mon Sep 17 00:00:00 2001 From: Daniel Bengl <53896675+CuddlyBunion341@users.noreply.github.com> Date: Mon, 30 Sep 2024 23:05:32 +0200 Subject: [PATCH 207/280] Update README.md --- .config/nvim/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/README.md b/.config/nvim/README.md index ff68f68..83934fb 100644 --- a/.config/nvim/README.md +++ b/.config/nvim/README.md @@ -33,7 +33,7 @@ I am using the lazyvim plugin manager to manage plugins. #### File Exploring - **bufexplorer**: Buffer explorer / picker. -- **Nvim-tree**: A file explorer tree. +- **Oil**: A text buffer based file explorer. #### Autocompletion - **nvim-cmp**: Autocompletion framework. From 9dff2feafdad2bc527c8942bf874bd8363505af6 Mon Sep 17 00:00:00 2001 From: Daniel Bengl <53896675+CuddlyBunion341@users.noreply.github.com> Date: Tue, 1 Oct 2024 06:46:16 +0200 Subject: [PATCH 208/280] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 581c906..a0e0ccf 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Other than the dotfiles, I also have a few scripts that I use to automate some t ## Configuration * [Alacritty](./.config/alacritty/alacritty.toml) -* [Nvim](./.config/nvim/README.md) +* [Nvim](./.config/nvim/) * [Lazygit](./lazygit/config.yml) * [Tmux](./.tmux.conf) * [Zsh profile](./.zshrc) From c49bcce7fe6bdcedc8ab247555b8739d324ef089 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 1 Oct 2024 18:06:48 +0200 Subject: [PATCH 209/280] Add fastfetch alias --- .zsh/aliases.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.zsh/aliases.sh b/.zsh/aliases.sh index d2b7a2e..d0b1f7b 100644 --- a/.zsh/aliases.sh +++ b/.zsh/aliases.sh @@ -14,6 +14,7 @@ alias ctmux='nvim ~/.tmux.conf' alias clazygit='nvim ~/Library/Application\ Support/lazygit/config.yml' alias cneovide='nvim ~/.config/neovide/config.toml' alias chypr='nvim ~/.config/hypr/hyprland.conf' +alias ff="fastfetch" alias cnix="sudo nvim /etc/nixos/configuration.nix" alias nxs="sudo nixos-rebuild switch" alias nv='neovide' From 8b3f1ca193fac71efab4f7041864fa6bb3d5fb47 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 1 Oct 2024 18:35:19 +0200 Subject: [PATCH 210/280] Update nvim cmp config --- .config/nvim/lua/plugins/nvim-cmp.lua | 32 ++++++--------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua index b73aedb..663c6b4 100644 --- a/.config/nvim/lua/plugins/nvim-cmp.lua +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -7,13 +7,13 @@ return { "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", "hrsh7th/cmp-cmdline", + "ray-x/cmp-treesitter", "rafamadriz/friendly-snippets", "hrsh7th/nvim-cmp", "L3MON4D3/LuaSnip", "saadparwaiz1/cmp_luasnip", }, config = function() - -- Set up nvim-cmp. local cmp = require('cmp') cmp.setup({ @@ -22,10 +22,6 @@ return { require('luasnip').lsp_expand(args.body) end, }, - window = { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), - }, mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), @@ -34,7 +30,8 @@ return { [''] = cmp.mapping.confirm({ select = true }), }), sources = cmp.config.sources({ - -- { name = 'nvim_lsp' }, + { name = 'nvim_lsp' }, + { name = 'treesitter' }, { name = 'luasnip' }, }, { { name = 'buffer' }, @@ -42,18 +39,6 @@ return { }) }) - -- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below - -- Set configuration for specific filetype. - --[[ cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'git' }, - }, { - { name = 'buffer' }, - }) - }) - require("cmp_git").setup() ]]-- - - -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline({ '/', '?' }, { mapping = cmp.mapping.preset.cmdline(), sources = { @@ -61,7 +46,6 @@ return { } }) - -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline(':', { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ @@ -72,11 +56,9 @@ return { matching = { disallow_symbol_nonprefix_matching = false } }) - -- Set up lspconfig. - -- local capabilities = require('cmp_nvim_lsp').default_capabilities() - -- Replace with each lsp server you've enabled. - -- require('lspconfig')[''].setup { - -- capabilities = capabilities - -- } + local capabilities = require('cmp_nvim_lsp').default_capabilities() + require('lspconfig')['lua_ls'].setup { + capabilities = capabilities + } end } From 95e0f752f76b1fe8f893d8b6434dab797f4c4b36 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 1 Oct 2024 19:57:49 +0200 Subject: [PATCH 211/280] Update lsp config --- .config/nvim/lazy-lock.json | 5 ++ .config/nvim/lua/plugins/nvim-cmp.lua | 18 +++---- .config/nvim/lua/plugins/nvim-lspconfig.lua | 54 +++++++++++++++++++++ nixos/configuration.nix | 1 + 4 files changed, 67 insertions(+), 11 deletions(-) create mode 100644 .config/nvim/lua/plugins/nvim-lspconfig.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index daa38a8..80b2354 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -9,7 +9,9 @@ "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, "copilot.vim": { "branch": "release", "commit": "782461159655b259cff10ecff05efa761e3d4764" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, @@ -20,11 +22,14 @@ "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, "lazygit.nvim": { "branch": "main", "commit": "dc56df433bfbf107fee0139e187eb9750878fa84" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.cursorword": { "branch": "main", "commit": "7d1b38a17834acbbc4feff8e42aedc4ed0c6ff06" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, + "none-ls.nvim": { "branch": "main", "commit": "0e0a940477cc08fa7b1799384a1d668058ed4e61" }, "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, "nvim-lspconfig": { "branch": "master", "commit": "911167921d49cd5c1c9b2436031d0da3945e787f" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua index 663c6b4..d8771f2 100644 --- a/.config/nvim/lua/plugins/nvim-cmp.lua +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -2,19 +2,20 @@ return { "hrsh7th/nvim-cmp", lazy = false, dependencies = { - "neovim/nvim-lspconfig", + "hrsh7th/nvim-cmp", "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", "hrsh7th/cmp-cmdline", "ray-x/cmp-treesitter", + "neovim/nvim-lspconfig", + "saadparwaiz1/cmp_luasnip", "rafamadriz/friendly-snippets", - "hrsh7th/nvim-cmp", "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", }, - config = function() + config = function() local cmp = require('cmp') + require("luasnip.loaders.from_vscode").lazy_load() cmp.setup({ snippet = { @@ -31,10 +32,10 @@ return { }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, - { name = 'treesitter' }, + -- { name = 'treesitter' }, { name = 'luasnip' }, }, { - { name = 'buffer' }, + -- { name = 'buffer' }, { name = 'path' }, }) }) @@ -55,10 +56,5 @@ return { }), matching = { disallow_symbol_nonprefix_matching = false } }) - - local capabilities = require('cmp_nvim_lsp').default_capabilities() - require('lspconfig')['lua_ls'].setup { - capabilities = capabilities - } end } diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..e77702a --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -0,0 +1,54 @@ +local lsp_servers = { + "ts_ls", + "lua_ls", + "ruby_lsp" +} + +return { + "neovim/nvim-lspconfig", + lazy = false, + dependencies = { + -- "hrsh7th/cmp-nvim-lsp", + { + "williamboman/mason.nvim", + commands = { "Mason" }, + config = function() + require("mason").setup() + end + }, + { + "williamboman/mason-lspconfig.nvim", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = lsp_servers + }) + end + } + }, + config = function() + local lspconfig = require("lspconfig") + + local capabilities = require("cmp_nvim_lsp").default_capabilities() + -- print(vim.inspect(capabilities)) -- Debug the capabilities + lspconfig.lua_ls.setup({ capabilities = capabilities }) + require("lspconfig")["lua_ls"].setup({ + capabilities = capabilities, + cmd = { "/run/current-system/sw/bin/lua-language-server" }, + on_attach = function() + end, + settings = { + Lua = { + diagnostics = { + globals = { "vim" } + } + } + } + }) + + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) + end, +} diff --git a/nixos/configuration.nix b/nixos/configuration.nix index d226a49..8872cec 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -97,6 +97,7 @@ discord hyprland + lua-language-server ]; programs.zsh.enable = true; From eabd29387f8638a5731414936828aab892de3586 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 1 Oct 2024 20:10:34 +0200 Subject: [PATCH 212/280] Improve lua lsp --- .config/nvim/lua/plugins/nvim-lspconfig.lua | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index e77702a..e1d6c78 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -29,19 +29,27 @@ return { local lspconfig = require("lspconfig") local capabilities = require("cmp_nvim_lsp").default_capabilities() - -- print(vim.inspect(capabilities)) -- Debug the capabilities + lspconfig.lua_ls.setup({ capabilities = capabilities }) require("lspconfig")["lua_ls"].setup({ capabilities = capabilities, cmd = { "/run/current-system/sw/bin/lua-language-server" }, - on_attach = function() - end, settings = { Lua = { + runtime = { + version = 'LuaJIT', + path = vim.split(package.path, ';'), + }, diagnostics = { - globals = { "vim" } - } - } + globals = { 'vim' }, + }, + workspace = { + library = { + [vim.fn.expand('$VIMRUNTIME/lua')] = true, + [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, + }, + }, + }, } }) From 1896b3b0d66f3ed2280be79a9f14ce3b94fd34e6 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 1 Oct 2024 20:11:28 +0200 Subject: [PATCH 213/280] Update nvim lspconfig --- .config/nvim/lua/plugins/nvim-lspconfig.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index e1d6c78..c6eea74 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -8,7 +8,7 @@ return { "neovim/nvim-lspconfig", lazy = false, dependencies = { - -- "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-nvim-lsp", { "williamboman/mason.nvim", commands = { "Mason" }, @@ -18,7 +18,7 @@ return { }, { "williamboman/mason-lspconfig.nvim", - config = function() + config = function() require("mason-lspconfig").setup({ ensure_installed = lsp_servers }) @@ -30,8 +30,7 @@ return { local capabilities = require("cmp_nvim_lsp").default_capabilities() - lspconfig.lua_ls.setup({ capabilities = capabilities }) - require("lspconfig")["lua_ls"].setup({ + lspconfig["lua_ls"].setup({ capabilities = capabilities, cmd = { "/run/current-system/sw/bin/lua-language-server" }, settings = { From 8487f7ba639bfa7a133e93d175c6b4807c9698fb Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 1 Oct 2024 20:50:43 +0200 Subject: [PATCH 214/280] Add comment.nvim --- .config/nvim/lazy-lock.json | 3 +-- .config/nvim/lua/plugins/comment.lua | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .config/nvim/lua/plugins/comment.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 80b2354..9a2d90f 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,4 +1,5 @@ { + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "CopilotChat.nvim": { "branch": "canary", "commit": "f20a0425b33c1704133bdef5ec10c4e94f6efdc6" }, "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, "auto-session": { "branch": "main", "commit": "21e33854fb3e561cb738dfefcd9d1d84fe6faaef" }, @@ -11,7 +12,6 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, "copilot.vim": { "branch": "release", "commit": "782461159655b259cff10ecff05efa761e3d4764" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, @@ -29,7 +29,6 @@ "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, - "none-ls.nvim": { "branch": "main", "commit": "0e0a940477cc08fa7b1799384a1d668058ed4e61" }, "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, "nvim-lspconfig": { "branch": "master", "commit": "911167921d49cd5c1c9b2436031d0da3945e787f" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, diff --git a/.config/nvim/lua/plugins/comment.lua b/.config/nvim/lua/plugins/comment.lua new file mode 100644 index 0000000..b6807ff --- /dev/null +++ b/.config/nvim/lua/plugins/comment.lua @@ -0,0 +1,6 @@ +return { + "numToStr/Comment.nvim", + lazy = false, + opts = { } +} + From fdd51a865581a58eca3ad6c08a38d2eba6844e33 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 1 Oct 2024 21:10:11 +0200 Subject: [PATCH 215/280] Add rust analyzer --- .config/nvim/lua/plugins/nvim-lspconfig.lua | 11 +++++++++++ nixos/configuration.nix | 3 +++ 2 files changed, 14 insertions(+) diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index c6eea74..d99f5e6 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -52,6 +52,17 @@ return { } }) + lspconfig["rust_analyzer"].setup({ + capabilities = capabilities, + settings = { + ["rust-analyzer"] = { + cachePriming = { + enable = false + } + } + } + }) + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 8872cec..e481899 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -97,7 +97,10 @@ discord hyprland + lua-language-server + rust-analyzer + cargo ]; programs.zsh.enable = true; From e8b41579a8dfc0ccb7869ba8a0acbca9c9ee2467 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 1 Oct 2024 21:10:17 +0200 Subject: [PATCH 216/280] Add pkgserach alias --- .zsh/aliases.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.zsh/aliases.sh b/.zsh/aliases.sh index d0b1f7b..0ec19c5 100644 --- a/.zsh/aliases.sh +++ b/.zsh/aliases.sh @@ -16,6 +16,7 @@ alias cneovide='nvim ~/.config/neovide/config.toml' alias chypr='nvim ~/.config/hypr/hyprland.conf' alias ff="fastfetch" alias cnix="sudo nvim /etc/nixos/configuration.nix" +alias pkgsearch="nix search nixpkgs" alias nxs="sudo nixos-rebuild switch" alias nv='neovide' alias cgit='nvim ~/.gitconfig' From 0773de7a6fe74669f16c346e0613712ddbc81c89 Mon Sep 17 00:00:00 2001 From: CuddlyBunion341 Date: Tue, 1 Oct 2024 21:38:32 +0200 Subject: [PATCH 217/280] Attempt add ruby bundle --- nixos/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index e481899..471d176 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -100,6 +100,7 @@ lua-language-server rust-analyzer + bundix cargo ]; From e7442ce6a71cb3666133c2b5b26a9400183dbba4 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 2 Oct 2024 07:42:28 +0200 Subject: [PATCH 218/280] Update gitignore --- .config/alacritty/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/alacritty/.gitignore b/.config/alacritty/.gitignore index 6dcc9e8..c4b5e85 100644 --- a/.config/alacritty/.gitignore +++ b/.config/alacritty/.gitignore @@ -1 +1 @@ -./current-theme.toml +current-theme.toml From 3b3be3fdad2224d4eb61cc5540d59eb06fe391da Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 2 Oct 2024 07:43:23 +0200 Subject: [PATCH 219/280] Update theme --- .config/alacritty/current-theme.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/alacritty/current-theme.toml b/.config/alacritty/current-theme.toml index 2b7f569..1acb99c 100644 --- a/.config/alacritty/current-theme.toml +++ b/.config/alacritty/current-theme.toml @@ -1 +1 @@ -import = [ "/Users/dani/.config/alacritty/themes/solarized_light.toml" ] +import = [ "/Users/dani/.config/alacritty/themes/tokyonight.toml" ] From e77afd230590ccdb987386ecb658a8b18439099e Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 2 Oct 2024 07:48:00 +0200 Subject: [PATCH 220/280] Update plugins --- .config/nvim/lazy-lock.json | 44 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 9a2d90f..74f37a1 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,52 +1,52 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "CopilotChat.nvim": { "branch": "canary", "commit": "f20a0425b33c1704133bdef5ec10c4e94f6efdc6" }, - "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, + "CopilotChat.nvim": { "branch": "canary", "commit": "9333944fde3c65868818e245c73aa29eef826e9b" }, + "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, "auto-session": { "branch": "main", "commit": "21e33854fb3e561cb738dfefcd9d1d84fe6faaef" }, "autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, - "bufexplorer": { "branch": "master", "commit": "2308e87960c05bd8da7bbf62c903e1f42d6cc9b9" }, + "bufexplorer": { "branch": "master", "commit": "fcf3a65a69020f0f54be8fa925f841874a5f3a01" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, + "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, "copilot.vim": { "branch": "release", "commit": "782461159655b259cff10ecff05efa761e3d4764" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, - "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "gitsigns.nvim": { "branch": "main", "commit": "f074844b60f9e151970fbcdbeb8a2cd52b6ef25a" }, + "friendly-snippets": { "branch": "main", "commit": "00ba9dd3df89509f95437b8d595553707c46d5ea" }, + "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "grug-far.nvim": { "branch": "main", "commit": "b7c2b28e49d55ff71cd9bb3ad19a2021316510d8" }, - "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, - "lazygit.nvim": { "branch": "main", "commit": "dc56df433bfbf107fee0139e187eb9750878fa84" }, + "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, + "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.cursorword": { "branch": "main", "commit": "7d1b38a17834acbbc4feff8e42aedc4ed0c6ff06" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, - "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, - "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, - "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, - "nvim-lspconfig": { "branch": "master", "commit": "911167921d49cd5c1c9b2436031d0da3945e787f" }, + "neotest": { "branch": "master", "commit": "48f8b5fce704594eb0ff94338e080defca14f0dc" }, + "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-lspconfig": { "branch": "master", "commit": "0678aa439b82965daf03679cd146e84f10e299c3" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-spectre": { "branch": "master", "commit": "9a28f926d3371b7ef02243cbbb653a0478d06e31" }, + "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "e265fec94c7dc0c8c64cb86820ff5ad3ee135c7d" }, + "nvim-treesitter": { "branch": "master", "commit": "0c8a582e474e248f2a4406188e0c653f92a064cf" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "oil.nvim": { "branch": "master", "commit": "71c972fbd218723a3c15afcb70421f67340f5a6d" }, + "oil.nvim": { "branch": "master", "commit": "1360be5fda9c67338331abfcd80de2afbb395bcd" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, - "plantuml-previewer.vim": { "branch": "master", "commit": "1dd4d0f2b09cd80a217f76d82f93830dbbe689b3" }, - "plantuml-syntax": { "branch": "master", "commit": "8fb95a3ae4354ca2322ef24803d8960fce519eb0" }, - "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, - "solarized.nvim": { "branch": "master", "commit": "fe02ed49cc017cc93657bd6306a2624394611c69" }, - "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, + "plantuml-previewer.vim": { "branch": "master", "commit": "555347700382c97b347bace57b7a9f764ed556b1" }, + "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "solarized.nvim": { "branch": "main", "commit": "1293bec92289d9431fb0ede0b627de8ab60b895e" }, + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, - "vim-rails": { "branch": "master", "commit": "2fba7907f585819a8653f0bc7dd7f437a822d9c6" }, - "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }, + "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, + "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" }, "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" } } From a8db10156c107342f44f334a2d121bd3c3f284dc Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 2 Oct 2024 07:50:19 +0200 Subject: [PATCH 221/280] Update font --- .config/alacritty/alacritty.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index c6adaff..db501dc 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -9,7 +9,7 @@ offset.x = 0 offset.y = 0 [font.normal] -family = "Monospace" +family = "JetBrainsMono NF" [[keyboard.bindings]] action = "CreateNewWindow" From 9fce42c8bfee3fe908093b8fdc87d46e241883b2 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 2 Oct 2024 07:51:11 +0200 Subject: [PATCH 222/280] Update alacritty cmd --- .config/alacritty/alacritty.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index db501dc..902c8ae 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -93,8 +93,8 @@ command = { program = "/opt/homebrew/bin/tmux", args = ["kill-pane"] } [shell] # args = ["-l", "-c", "session_name=$(tmux ls | grep -v \"(attached)\" | head -n 1 | cut -d: -f1); [ -n \"$session_name\" ] && tmux attach -t \"$session_name\" || tmux new-session"] -program = "/run/current-system/sw/bin/zsh" -# +program = "/opt/homebrew/bin/zsh" + [window] decorations = "buttonless" decorations_theme_variant = "None" From cc0ba3891b7890bff5251268f1b58030a84a21eb Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 5 Oct 2024 07:47:58 +0200 Subject: [PATCH 223/280] Add lsp --- .config/nvim/lua/plugins/nvim-lspconfig.lua | 26 ++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index d99f5e6..89fde54 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -1,7 +1,8 @@ local lsp_servers = { "ts_ls", "lua_ls", - "ruby_lsp" + "ruby_lsp", + "standardrb" } return { @@ -22,7 +23,11 @@ return { require("mason-lspconfig").setup({ ensure_installed = lsp_servers }) - end + end, + keys = { + { "li", "LspInfo" }, + { "ll", "LspLog" }, + } } }, config = function() @@ -32,7 +37,7 @@ return { lspconfig["lua_ls"].setup({ capabilities = capabilities, - cmd = { "/run/current-system/sw/bin/lua-language-server" }, + -- cmd = { "/run/current-system/sw/bin/lua-language-server" }, settings = { Lua = { runtime = { @@ -52,6 +57,15 @@ return { } }) + lspconfig["ruby_lsp"].setup({ + cmd = { "/Users/dani/.asdf/shims/ruby-lsp"}, + capabilities = capabilities + }) + + lspconfig["standardrb"].setup({ + capabilities = capabilities + }) + lspconfig["rust_analyzer"].setup({ capabilities = capabilities, settings = { @@ -63,6 +77,12 @@ return { } }) + lspconfig["jdtls"].setup({ + capabilities = capabilities, + cmd = { "/opt/homebrew/bin/jdtls" }, + root_dir = lspconfig.util.root_pattern("pom.xml", "gradle.build", ".git"), + }) + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) From a517214ebe0908e20af80a9a665b248e7f0b79ab Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 9 Oct 2024 07:05:00 +0200 Subject: [PATCH 224/280] Replace autoclose with autopairs --- .config/nvim/lua/plugins/autoclose.lua | 7 ------- .config/nvim/lua/plugins/autopairs.lua | 5 +++++ 2 files changed, 5 insertions(+), 7 deletions(-) delete mode 100644 .config/nvim/lua/plugins/autoclose.lua create mode 100644 .config/nvim/lua/plugins/autopairs.lua diff --git a/.config/nvim/lua/plugins/autoclose.lua b/.config/nvim/lua/plugins/autoclose.lua deleted file mode 100644 index e9b9d33..0000000 --- a/.config/nvim/lua/plugins/autoclose.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "m4xshen/autoclose.nvim", - lazy = false, - config = function() - require("autoclose").setup() - end, -} diff --git a/.config/nvim/lua/plugins/autopairs.lua b/.config/nvim/lua/plugins/autopairs.lua new file mode 100644 index 0000000..5698563 --- /dev/null +++ b/.config/nvim/lua/plugins/autopairs.lua @@ -0,0 +1,5 @@ +return { + 'windwp/nvim-autopairs', + event = "InsertEnter", + config = true +} From c48c104ce41b0d6cc06a251887630fd650e76a50 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 9 Oct 2024 07:05:34 +0200 Subject: [PATCH 225/280] Update oil keybinds --- .config/nvim/lua/plugins/oil.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index 405aff4..578ab9b 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -32,7 +32,6 @@ return { ["-"] = "actions.parent", ["_"] = "actions.open_cwd", ["`"] = "actions.cd", - [""] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory" }, ["gs"] = "actions.change_sort", [""] = { "actions.open_cmdline", @@ -41,6 +40,8 @@ return { }, desc = "Open file", }, + ["K"] = "actions.preview_scroll_up", + ["J"] = "actions.preview_scroll_down", }, use_default_keymaps = false, view_options = { From 87465033e391347b3d62a97c68202c50193eaaa6 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 9 Oct 2024 07:05:41 +0200 Subject: [PATCH 226/280] Fix oil lsp --- .config/nvim/lua/plugins/oil.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index 578ab9b..d1f42fb 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -1,5 +1,7 @@ return { - "stevearc/oil.nvim", + -- "stevearc/oil.nvim", -- revert to original repository once https://github.com/stevearc/oil.nvim/issues/435 is resolved + "jelmansouri/oil.nvim", -- revert to original repository once https://github.com/stevearc/oil.nvim/issues/435 is resolved + branch = "feat/scratch-preview", -- revert to original repository once https://github.com/stevearc/oil.nvim/issues/435 is resolved dependencies = { { "echasnovski/mini.icons", opts = {} } }, lazy = false, -- nvim /dir/name does not work otherwise config = function() @@ -13,7 +15,7 @@ return { constrain_cursor = "name", skip_confirm_for_simple_edits = true, prompt_save_on_select_new_entry = true, - watch_for_changes = true, + watch_for_changes = false, keymaps = { ["g?"] = "actions.show_help", [""] = "actions.select", @@ -47,6 +49,9 @@ return { view_options = { show_hidden = true, }, + lsp_file_methods = { + enabled = false, + } }) end, keys = { From acae798b5aacd47dd0bae16bb283b9d6f960cc88 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 9 Oct 2024 07:05:56 +0200 Subject: [PATCH 227/280] Readd vim-fugitive --- .config/nvim/lua/plugins/vim-fugitive.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .config/nvim/lua/plugins/vim-fugitive.lua diff --git a/.config/nvim/lua/plugins/vim-fugitive.lua b/.config/nvim/lua/plugins/vim-fugitive.lua new file mode 100644 index 0000000..c38fbcf --- /dev/null +++ b/.config/nvim/lua/plugins/vim-fugitive.lua @@ -0,0 +1,13 @@ +return { + "tpope/vim-fugitive", + config = function() + require("vim-fugitive").setup() + end, + commands = { + { "G", "Git" }, + { "Gblame", "Git blame" }, + { "Gdiff", "Git diff" }, + { "Glog", "Git log" }, + { "Gstatus", "Git status" }, + }, +} From 37382d2f7721fb330e0daeda02d93df541e787c2 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Thu, 10 Oct 2024 19:33:56 +0200 Subject: [PATCH 228/280] Update colorscheme --- .config/alacritty/alacritty.toml | 4 ++-- .config/alacritty/current-theme.toml | 2 +- .config/nvim/lua/plugins/colorscheme.lua | 2 +- my-status-bar.tmux | 9 +++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 902c8ae..66eebdc 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,4 +1,4 @@ -import = [ "/home/dani/.config/alacritty/current-theme.toml" ] +import = [ "~/.config/alacritty/current-theme.toml" ] [env] TERM = "xterm-256color" @@ -92,7 +92,7 @@ mods = "Command" command = { program = "/opt/homebrew/bin/tmux", args = ["kill-pane"] } [shell] -# args = ["-l", "-c", "session_name=$(tmux ls | grep -v \"(attached)\" | head -n 1 | cut -d: -f1); [ -n \"$session_name\" ] && tmux attach -t \"$session_name\" || tmux new-session"] +args = ["-l", "-c", "session_name=$(tmux ls | grep -v \"(attached)\" | head -n 1 | cut -d: -f1); [ -n \"$session_name\" ] && tmux attach -t \"$session_name\" || tmux new-session"] program = "/opt/homebrew/bin/zsh" [window] diff --git a/.config/alacritty/current-theme.toml b/.config/alacritty/current-theme.toml index 1acb99c..33b75f9 100644 --- a/.config/alacritty/current-theme.toml +++ b/.config/alacritty/current-theme.toml @@ -1 +1 @@ -import = [ "/Users/dani/.config/alacritty/themes/tokyonight.toml" ] +import = [ "~/.config/alacritty/themes/tokyonight.toml" ] diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index cfcb35d..8491eec 100644 --- a/.config/nvim/lua/plugins/colorscheme.lua +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -1,6 +1,6 @@ return { { - "tiagovla/tokyodark.nvim", + "ghifarit53/tokyonight-vim", lazy = false, priority = 1000, }, diff --git a/my-status-bar.tmux b/my-status-bar.tmux index d00a282..c10f0b4 100755 --- a/my-status-bar.tmux +++ b/my-status-bar.tmux @@ -13,12 +13,13 @@ tmux_set() { tmux set-option -gq "$1" "$2" } -color1="#fcf6e5" +#color1="#fcf6e5" +color1="black" # color1="#fdf6e3" # color1="#000000" -color2="black" -color3="black" -color4="black" +color2="white" +color3="white" +color4="white" secondary="#[fg=$color2,bg=$color1]" tertiary="#[fg=black,bg=$color1]" From 06c3429b792969e8956e8859bd686809724345d0 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Thu, 10 Oct 2024 19:34:26 +0200 Subject: [PATCH 229/280] Add clone-praktikum cmd --- scripts/clone_praktikum.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 scripts/clone_praktikum.sh diff --git a/scripts/clone_praktikum.sh b/scripts/clone_praktikum.sh new file mode 100755 index 0000000..1a7bfb3 --- /dev/null +++ b/scripts/clone_praktikum.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +ORG_NAME="prog1-kurs" +GH_USER="bengldan" +GH_HOST="github.zhaw.ch" + +for cmd in gh jq fzf; do + if ! command -v $cmd &> /dev/null; then + echo "Error: $cmd is not installed." >&2 + exit 1 + fi +done + +list_repos() { + GH_HOST=$GH_HOST gh repo list $ORG_NAME --json name | jq -r '.[].name' | fzf +} + +fork_and_clone_repo() { + local repo_name=$1 + GH_HOST=$GH_HOST gh repo fork "$ORG_NAME/$repo_name" --clone +} + +REPO_LIST=$(list_repos) +if [ -n "$REPO_LIST" ]; then + fork_and_clone_repo "$REPO_LIST" +else + echo "No repository selected." +fi From b16742cc2de32001ba609905138ff654a53f2bb9 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Thu, 10 Oct 2024 19:34:46 +0200 Subject: [PATCH 230/280] Update plugins --- .config/nvim/lazy-lock.json | 34 +++---- .config/nvim/lua/plugins/boole.lua | 1 + .config/nvim/lua/plugins/neotest.lua | 8 +- .config/nvim/lua/plugins/nvim-cmp.lua | 2 +- .config/nvim/lua/plugins/nvim-lspconfig.lua | 99 +++++++++++---------- .config/nvim/lua/plugins/telescope.lua | 1 + .config/nvim/lua/settings.lua | 7 +- ".config/nvim/lua/theme.lua\"\"" | 9 ++ 8 files changed, 93 insertions(+), 68 deletions(-) create mode 100644 ".config/nvim/lua/theme.lua\"\"" diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 74f37a1..11a782e 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -2,8 +2,7 @@ "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "CopilotChat.nvim": { "branch": "canary", "commit": "9333944fde3c65868818e245c73aa29eef826e9b" }, "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, - "auto-session": { "branch": "main", "commit": "21e33854fb3e561cb738dfefcd9d1d84fe6faaef" }, - "autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" }, + "auto-session": { "branch": "main", "commit": "9d02776ed42874d37869dc683396234e3724b52d" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "bufexplorer": { "branch": "master", "commit": "fcf3a65a69020f0f54be8fa925f841874a5f3a01" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, @@ -13,39 +12,42 @@ "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, - "copilot.vim": { "branch": "release", "commit": "782461159655b259cff10ecff05efa761e3d4764" }, + "copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, - "friendly-snippets": { "branch": "main", "commit": "00ba9dd3df89509f95437b8d595553707c46d5ea" }, - "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, - "grug-far.nvim": { "branch": "main", "commit": "b7c2b28e49d55ff71cd9bb3ad19a2021316510d8" }, - "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, - "lazygit.nvim": { "branch": "main", "commit": "2432b447483f42ff2e18b2d392cb2bb27e495c08" }, + "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, + "gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" }, + "grug-far.nvim": { "branch": "main", "commit": "75aad2698d428bdc94ff15f487f7165aee8ccbfb" }, + "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, + "lazygit.nvim": { "branch": "main", "commit": "56760339a81cd1540d5a72fd9d93010a2677b55d" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.cursorword": { "branch": "main", "commit": "7d1b38a17834acbbc4feff8e42aedc4ed0c6ff06" }, - "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, - "neotest": { "branch": "master", "commit": "48f8b5fce704594eb0ff94338e080defca14f0dc" }, + "mini.icons": { "branch": "main", "commit": "a2742459f0ee32806c2438ca06b4d8b331f3f4d4" }, + "neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" }, + "neotest-java": { "branch": "main", "commit": "4fe7a53d659ae2fd4f1aa3a0084bf3afde554acc" }, "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, + "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-lspconfig": { "branch": "master", "commit": "0678aa439b82965daf03679cd146e84f10e299c3" }, + "nvim-lspconfig": { "branch": "master", "commit": "04680101ff79e99b4e33a4386ec27cbd0d360c75" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "0c8a582e474e248f2a4406188e0c653f92a064cf" }, + "nvim-treesitter": { "branch": "master", "commit": "86c10df7ef77daf45a0e4a918934bb59083db1e1" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "b91c98afa6c42819aea6cbc1ba38272f5456a5cf" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "oil.nvim": { "branch": "master", "commit": "1360be5fda9c67338331abfcd80de2afbb395bcd" }, + "oil.nvim": { "branch": "feat/scratch-preview", "commit": "60fe23050f5b93550262f5c96ab00b5c51b60830" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, "plantuml-previewer.vim": { "branch": "master", "commit": "555347700382c97b347bace57b7a9f764ed556b1" }, "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "solarized.nvim": { "branch": "main", "commit": "1293bec92289d9431fb0ede0b627de8ab60b895e" }, + "solarized.nvim": { "branch": "main", "commit": "f85f000c3e46714fee52cee3adf9f9661a048e40" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, + "tokyonight-vim": { "branch": "master", "commit": "4e82e0f0452a6ce8f387828ec71013015515035a" }, + "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" }, "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" } diff --git a/.config/nvim/lua/plugins/boole.lua b/.config/nvim/lua/plugins/boole.lua index af01d52..bc16e1f 100644 --- a/.config/nvim/lua/plugins/boole.lua +++ b/.config/nvim/lua/plugins/boole.lua @@ -13,6 +13,7 @@ return { {'if', 'unless'}, {'true', 'false'}, {'&&', '||'}, + {'private', 'public', 'protected'}, }, }) end diff --git a/.config/nvim/lua/plugins/neotest.lua b/.config/nvim/lua/plugins/neotest.lua index 8011ebc..c646bfd 100644 --- a/.config/nvim/lua/plugins/neotest.lua +++ b/.config/nvim/lua/plugins/neotest.lua @@ -5,12 +5,16 @@ return { "nvim-neotest/nvim-nio", "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", - "olimorris/neotest-rspec" + "olimorris/neotest-rspec", + "rcasia/neotest-java", }, config = function() require("neotest").setup({ adapters = { - require("neotest-rspec") + require("neotest-rspec"), + ["neotest-java"] = { + ignore_wrapper = true + } } }) end, diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua index d8771f2..d62168f 100644 --- a/.config/nvim/lua/plugins/nvim-cmp.lua +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -35,7 +35,7 @@ return { -- { name = 'treesitter' }, { name = 'luasnip' }, }, { - -- { name = 'buffer' }, + { name = 'buffer' }, { name = 'path' }, }) }) diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index 89fde54..39ec42c 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -31,62 +31,67 @@ return { } }, config = function() - local lspconfig = require("lspconfig") + local status, err = pcall(function() + local lspconfig = require("lspconfig") - local capabilities = require("cmp_nvim_lsp").default_capabilities() + local capabilities = require("cmp_nvim_lsp").default_capabilities() - lspconfig["lua_ls"].setup({ - capabilities = capabilities, - -- cmd = { "/run/current-system/sw/bin/lua-language-server" }, - settings = { - Lua = { - runtime = { - version = 'LuaJIT', - path = vim.split(package.path, ';'), - }, - diagnostics = { - globals = { 'vim' }, - }, - workspace = { - library = { - [vim.fn.expand('$VIMRUNTIME/lua')] = true, - [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, + lspconfig["lua_ls"].setup({ + capabilities = capabilities, + settings = { + Lua = { + runtime = { + version = 'LuaJIT', + path = vim.split(package.path, ';'), + }, + diagnostics = { + globals = { 'vim' }, + }, + workspace = { + library = { + [vim.fn.expand('$VIMRUNTIME/lua')] = true, + [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, + }, }, }, - }, - } - }) + } + }) - lspconfig["ruby_lsp"].setup({ - cmd = { "/Users/dani/.asdf/shims/ruby-lsp"}, - capabilities = capabilities - }) + lspconfig["ruby_lsp"].setup({ + cmd = { "/Users/dani/.asdf/shims/ruby-lsp"}, + capabilities = capabilities + }) - lspconfig["standardrb"].setup({ - capabilities = capabilities - }) + lspconfig["standardrb"].setup({ + capabilities = capabilities + }) - lspconfig["rust_analyzer"].setup({ - capabilities = capabilities, - settings = { - ["rust-analyzer"] = { - cachePriming = { - enable = false + lspconfig["rust_analyzer"].setup({ + capabilities = capabilities, + settings = { + ["rust-analyzer"] = { + cachePriming = { + enable = false + } } } - } - }) + }) + + lspconfig["jdtls"].setup({ + capabilities = capabilities, + cmd = { "/opt/homebrew/bin/jdtls" }, + root_dir = lspconfig.util.root_pattern("pom.xml", "gradle.build", ".git"), + }) - lspconfig["jdtls"].setup({ - capabilities = capabilities, - cmd = { "/opt/homebrew/bin/jdtls" }, - root_dir = lspconfig.util.root_pattern("pom.xml", "gradle.build", ".git"), - }) + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) + end) - vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) - vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) - vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) - end, + if not status then + print("Error in LSP config: " .. err) + end + end } diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 44c5855..dd8986a 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -3,6 +3,7 @@ return { dependencies = { "nvim-lua/plenary.nvim" }, keys = { { "f", "Telescope find_files hidden=true" }, + { "e", "Telescope find_files hidden=false" }, { "w", "Telescope live_grep" }, { "r", function() local current_word = vim.fn.expand("") diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index 14d56a8..d08d834 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -12,8 +12,11 @@ vim.opt.scrolloff = 10 vim.opt.autowrite = true vim.opt.autowriteall = true vim.opt.list = false -- whitespace +vim.o.clipboard = "unnamedplus" +vim.o.timeoutlen = 200 --- nav +-- keyap to toggle line numbers (set nonumber and set norelativenumber) +vim.keymap.set("n", "", ":set invnumber:set invrelativenumber") vim.keymap.set("n", "n", "nzz") vim.keymap.set("n", "N", "Nzz") @@ -57,7 +60,7 @@ vim.opt.shortmess:append("A") -- https://stackoverflow.com/questions/1098159/vim -- commands -vim.keymap.set("n", "L", ":Lazy") +vim.keymap.set("n", "L", ":Lazy") -- splits diff --git "a/.config/nvim/lua/theme.lua\"\"" "b/.config/nvim/lua/theme.lua\"\"" new file mode 100644 index 0000000..5926fff --- /dev/null +++ "b/.config/nvim/lua/theme.lua\"\"" @@ -0,0 +1,9 @@ +local USE_DARKMODE = false + +if USE_DARKMODE then + vim.cmd("colorscheme tokyodark") + vim.cmd("set bg=dark") +else + vim.cmd("colorscheme solarized") + vim.cmd("set bg=light") +end From 7eba6ac21bb46889a4a52d8856d7a8c956647ee7 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 11 Oct 2024 08:11:32 +0200 Subject: [PATCH 231/280] Add telescope ui select --- .config/nvim/lua/plugins/telescope.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index dd8986a..aa83a26 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -1,6 +1,20 @@ return { "nvim-telescope/telescope.nvim", tag = "0.1.8", - dependencies = { "nvim-lua/plenary.nvim" }, + dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-ui-select.nvim", }, + config = function() + -- This is your opts table + require("telescope").setup { + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown { + -- even more opts + } + } + } + } + + require("telescope").load_extension("ui-select") + end, keys = { { "f", "Telescope find_files hidden=true" }, { "e", "Telescope find_files hidden=false" }, From d1e374cf7301788f2a59ea940dac6be862bc1c1a Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 11 Oct 2024 08:17:34 +0200 Subject: [PATCH 232/280] Add textcase nvim --- .config/nvim/lua/plugins/text-case.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .config/nvim/lua/plugins/text-case.lua diff --git a/.config/nvim/lua/plugins/text-case.lua b/.config/nvim/lua/plugins/text-case.lua new file mode 100644 index 0000000..92c92fe --- /dev/null +++ b/.config/nvim/lua/plugins/text-case.lua @@ -0,0 +1,20 @@ +return { + "johmsalas/text-case.nvim", + dependencies = { "nvim-telescope/telescope.nvim" }, + config = function() + require("textcase").setup({}) + require("telescope").load_extension("textcase") + end, + keys = { + "ga", + { "ga.", "TextCaseOpenTelescope", mode = { "n", "x" }, desc = "Telescope" }, + }, + cmd = { + "Subs", + "TextCaseOpenTelescope", + "TextCaseOpenTelescopeQuickChange", + "TextCaseOpenTelescopeLSPChange", + "TextCaseStartReplacingCommand", + }, + lazy = false, +} From e32f725aff3b4b9cf5d6cf844703b4c3554ca015 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 12 Oct 2024 09:44:06 +0200 Subject: [PATCH 233/280] Update telescope config --- .config/nvim/lua/plugins/telescope.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index aa83a26..de25ce4 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -2,12 +2,10 @@ return { "nvim-telescope/telescope.nvim", tag = "0.1.8", dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-ui-select.nvim", }, config = function() - -- This is your opts table require("telescope").setup { extensions = { ["ui-select"] = { require("telescope.themes").get_dropdown { - -- even more opts } } } @@ -29,5 +27,6 @@ return { { "at", "Telescope find_files prompt_title=Specs cwd=spec/ hidden=true" }, { "af", "Telescope find_files prompt_title=Specs cwd=spec/factories hidden=true" }, { "av", "Telescope find_files prompt_title=Views cwd=app/views hidden=true" }, + { "l", "Telescope lsp_document_symbols"} } } From ab3c60f6fcbfa360de704125d5b317edee8e18aa Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 12 Oct 2024 09:44:15 +0200 Subject: [PATCH 234/280] Update relative numbers --- .config/nvim/lua/settings.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index d08d834..6ccf795 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -3,8 +3,8 @@ vim.g.maplocalleader = ',' vim.opt.cursorline = true vim.opt.cursorcolumn = true vim.opt.termguicolors = true -vim.wo.number = true -vim.wo.relativenumber = true +vim.wo.number = false +vim.wo.relativenumber = false vim.opt.expandtab = true vim.opt.tabstop = 2 vim.opt.shiftwidth = 2 @@ -14,6 +14,7 @@ vim.opt.autowriteall = true vim.opt.list = false -- whitespace vim.o.clipboard = "unnamedplus" vim.o.timeoutlen = 200 +vim.o.laststatus = 0 -- keyap to toggle line numbers (set nonumber and set norelativenumber) vim.keymap.set("n", "", ":set invnumber:set invrelativenumber") @@ -45,6 +46,7 @@ vim.keymap.set("n", "g=", "ggVG=") vim.keymap.set("n", "zt", "%s/\t/ /g") vim.keymap.set("n", "vag", "ggVG") vim.keymap.set("n", "dag", "ggVGd") +vim.keymap.set("n", "yag", "ggVGy") vim.keymap.set("n", "cag", "ggVGc") vim.keymap.set("n", "gJ", "Jx") From f79139c06be3fb8917fbeb21cfbd782b1539f646 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 12 Oct 2024 09:44:33 +0200 Subject: [PATCH 235/280] Add aliases --- .zsh/aliases.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.zsh/aliases.sh b/.zsh/aliases.sh index 0ec19c5..50ff452 100644 --- a/.zsh/aliases.sh +++ b/.zsh/aliases.sh @@ -8,6 +8,7 @@ alias ls="eza" alias l="eza -lah" alias lh="eza -lah | grep -E ' \.\w+$'" # [l]ist [h]idden alias zshrc='nvim ~/.zshrc' # Idea from Chris +alias czsh='cd ~/.zsh && nvim .' alias calacritty='nvim ~/.config/alacritty/alacritty.toml' alias ckitty='nvim ~/.config/kitty/kitty.conf' alias ctmux='nvim ~/.tmux.conf' @@ -28,6 +29,7 @@ alias bno='tectonic -X build' # [b]uild and do[n]'t [o]pen alias g="grep" # [g]rep alias myip="ipconfig getifaddr en0" alias pubip="dig +short myip.opendns.com @resolver1.opendns.com -4" # borrowed from raphi +alias pubip="curl ifconfig.me" alias bra="bundle exec rubocop -A" # [b]undle exec [r]ubocop -[A] alias spec="be rspec" alias f="fork ." @@ -70,6 +72,7 @@ alias m='rubymine .' alias bs="bin/setup" alias bc="bin/check" alias br="bin/run" +alias bt="bin/test" alias bd="bin/dev" alias yd="yarn dev" alias yt="yarn test" From a8038f48174ff486f80724b8178817e3d708e3d9 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 12 Oct 2024 09:44:45 +0200 Subject: [PATCH 236/280] Add gnupg --- .zsh/exports.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.zsh/exports.sh b/.zsh/exports.sh index 8654300..dac4584 100644 --- a/.zsh/exports.sh +++ b/.zsh/exports.sh @@ -4,3 +4,4 @@ export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES export BUN_INSTALL="$HOME/.bun" export PATH="$BUN_INSTALL/bin:$PATH" +export PATH="/opt/homebrew/opt/gnupg@2.2/bin:$PATH" From 1c07374f5e6f37288549d6ef88db9cd1bdaeb2cc Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 12 Oct 2024 09:44:59 +0200 Subject: [PATCH 237/280] Update tmux conf (hide statusbar) --- .tmux.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index a838708..2c24cea 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -29,7 +29,8 @@ bind r source-file ~/.tmux.conf; set -g mouse on set -g default-terminal "screen-256color" set -ag terminal-overrides ",xterm-256color:RGB" -set-option -g status-position top +set-option -g status-position bottom +set-option -g status off set-option -g renumber-windows on set -g pane-border-lines "single" set -s escape-time 1 From 7e5d8458a4171d92b98336c5a4fd1bfaeba2faf3 Mon Sep 17 00:00:00 2001 From: Daniel Bengl <53896675+CuddlyBunion341@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:43:35 +0100 Subject: [PATCH 238/280] Gstow (#5) * Fix diffview * Add harpoon * Update dotfiles * Minimalize dotfiles (#4) * Simplify zsh config * Simplify language server configuration * Update lsp config * Update telescope cfg * Update find / replace config * Remove multicursor nvim * Update .config/nvim/.prettierrc * Delete .config/nvim/lua/plugins/lazygit.lua --- ".config/alacritty/current-theme.toml\"\"" | 1 + .config/kitty/kitty.conf | 7 +- .config/nvim/lazy-lock.json | 9 +- .config/nvim/lua/plugins/autosession.lua | 5 +- .config/nvim/lua/plugins/copilot.lua | 10 +- .config/nvim/lua/plugins/copilotchat.lua | 1 + .config/nvim/lua/plugins/diffview.lua | 2 +- .config/nvim/lua/plugins/grug.lua | 4 +- .config/nvim/lua/plugins/harpoon.lua | 23 ++++ .config/nvim/lua/plugins/lazygit.lua | 19 --- .config/nvim/lua/plugins/multicursor.lua | 16 --- .config/nvim/lua/plugins/neogit.lua | 17 +++ .config/nvim/lua/plugins/neotest.lua | 2 + .config/nvim/lua/plugins/nvim-cmp.lua | 109 ++++++++++++------ .config/nvim/lua/plugins/nvim-lspconfig.lua | 106 ++++++----------- .config/nvim/lua/plugins/nvim-spectre.lua | 7 -- .../plugins/nvim-treesitter-textobjects.lua | 3 + .config/nvim/lua/plugins/nvim-treesitter.lua | 4 + .config/nvim/lua/plugins/oil.lua | 8 +- .config/nvim/lua/plugins/telescope.lua | 40 ++++++- .config/nvim/lua/plugins/trouble.lua | 37 ++++++ .config/nvim/lua/settings.lua | 8 +- ".config/nvim/lua/theme.lua\"\"" | 9 -- .tmux.conf | 3 +- .zsh/aliases.sh | 90 --------------- .zsh/exports.sh | 7 -- .zsh/history.sh | 7 -- .zsh/homebrew.sh | 11 -- .zsh/utils.sh | 74 ------------ .zsh/zinit.sh | 20 ---- .zshrc | 18 --- 31 files changed, 270 insertions(+), 407 deletions(-) create mode 100644 ".config/alacritty/current-theme.toml\"\"" create mode 100644 .config/nvim/lua/plugins/harpoon.lua delete mode 100644 .config/nvim/lua/plugins/lazygit.lua delete mode 100644 .config/nvim/lua/plugins/multicursor.lua create mode 100644 .config/nvim/lua/plugins/neogit.lua delete mode 100644 .config/nvim/lua/plugins/nvim-spectre.lua create mode 100644 .config/nvim/lua/plugins/trouble.lua delete mode 100644 ".config/nvim/lua/theme.lua\"\"" delete mode 100644 .zsh/aliases.sh delete mode 100644 .zsh/exports.sh delete mode 100644 .zsh/history.sh delete mode 100644 .zsh/homebrew.sh delete mode 100644 .zsh/utils.sh delete mode 100644 .zsh/zinit.sh diff --git "a/.config/alacritty/current-theme.toml\"\"" "b/.config/alacritty/current-theme.toml\"\"" new file mode 100644 index 0000000..d6e2bdf --- /dev/null +++ "b/.config/alacritty/current-theme.toml\"\"" @@ -0,0 +1 @@ +import = [ "~/.config/alacritty/themes/solarized_light.toml" ] diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 9b7fcb4..d143822 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -5,8 +5,13 @@ macos_hide_titlebar true hide_window_decorations titlebar-only confirm_os_window_close 0 -font_family jetbrains mono +font_family SauceCodePro NF +bold_font auto +italic_font auto +bold_italic_font auto + font_size 23.0 +# -> foo bar >= ==> === == /> window_padding_width 10 diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 11a782e..9c704db 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -18,16 +18,19 @@ "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, "gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" }, "grug-far.nvim": { "branch": "main", "commit": "75aad2698d428bdc94ff15f487f7165aee8ccbfb" }, + "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, - "lazygit.nvim": { "branch": "main", "commit": "56760339a81cd1540d5a72fd9d93010a2677b55d" }, + "lsp-zero.nvim": { "branch": "v4.x", "commit": "19a8b90340c6c522219c84f7befe784d657ab28e" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.cursorword": { "branch": "main", "commit": "7d1b38a17834acbbc4feff8e42aedc4ed0c6ff06" }, "mini.icons": { "branch": "main", "commit": "a2742459f0ee32806c2438ca06b4d8b331f3f4d4" }, + "neogit": { "branch": "master", "commit": "570c39181784f7a2e1bc9cedbfb11846022eea54" }, "neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" }, "neotest-java": { "branch": "main", "commit": "4fe7a53d659ae2fd4f1aa3a0084bf3afde554acc" }, + "neotest-minitest": { "branch": "main", "commit": "5623b9a7b2b27314e5c336b385315d2ab7d4ccba" }, "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, @@ -36,6 +39,7 @@ "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, "nvim-treesitter": { "branch": "master", "commit": "86c10df7ef77daf45a0e4a918934bb59083db1e1" }, + "nvim-treesitter-context": { "branch": "master", "commit": "1147c42cf9477701581d1eb31e1735969e21dd06" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "b91c98afa6c42819aea6cbc1ba38272f5456a5cf" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, @@ -45,8 +49,11 @@ "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "solarized.nvim": { "branch": "main", "commit": "f85f000c3e46714fee52cee3adf9f9661a048e40" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "text-case.nvim": { "branch": "main", "commit": "e898cfd46fa6cde0e83abb624a16e67d2ffc6457" }, "tokyonight-vim": { "branch": "master", "commit": "4e82e0f0452a6ce8f387828ec71013015515035a" }, + "trouble.nvim": { "branch": "main", "commit": "3dc00c0447c016cd43e03054c3d49436a1f2076d" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" }, diff --git a/.config/nvim/lua/plugins/autosession.lua b/.config/nvim/lua/plugins/autosession.lua index c596b4f..978a221 100644 --- a/.config/nvim/lua/plugins/autosession.lua +++ b/.config/nvim/lua/plugins/autosession.lua @@ -4,5 +4,8 @@ return { dependencies = { "nvim-telescope/telescope.nvim", }, - opts = { } + opts = { }, + keys = { + { "", "SessionDelete" } + } } diff --git a/.config/nvim/lua/plugins/copilot.lua b/.config/nvim/lua/plugins/copilot.lua index f99191d..14e55eb 100644 --- a/.config/nvim/lua/plugins/copilot.lua +++ b/.config/nvim/lua/plugins/copilot.lua @@ -1,7 +1,7 @@ return { - "github/copilot.vim", - event = "BufRead", - commands = { - "Copilot" - } + -- "github/copilot.vim", + -- event = "BufRead", + -- commands = { + -- "Copilot" + -- } } diff --git a/.config/nvim/lua/plugins/copilotchat.lua b/.config/nvim/lua/plugins/copilotchat.lua index fdeb75f..6ca2f23 100644 --- a/.config/nvim/lua/plugins/copilotchat.lua +++ b/.config/nvim/lua/plugins/copilotchat.lua @@ -28,6 +28,7 @@ return { opts = { temperature = 0.3, auto_insert_mode = true, + system_prompt = "You are a AI (femboy) assistant for developers. Make sure that you reply the same way a cute femboy would do. UwU. Don't forget that you are an expert in the field and attempt to repond in a concise way.", mappings = { reset = { normal = "", diff --git a/.config/nvim/lua/plugins/diffview.lua b/.config/nvim/lua/plugins/diffview.lua index 9e7897a..9c3bcec 100644 --- a/.config/nvim/lua/plugins/diffview.lua +++ b/.config/nvim/lua/plugins/diffview.lua @@ -1,7 +1,7 @@ return { "sindrets/diffview.nvim", cmd = { - "DiffViewOpen" + "DiffviewOpen" }, keys = { { "do", "DiffviewOpen" } diff --git a/.config/nvim/lua/plugins/grug.lua b/.config/nvim/lua/plugins/grug.lua index f992a1a..173b3c8 100644 --- a/.config/nvim/lua/plugins/grug.lua +++ b/.config/nvim/lua/plugins/grug.lua @@ -4,8 +4,8 @@ return { require('grug-far').setup({}); end, keys = { - { "Rf",function() require("grug-far").open() end}, - { "Rw", function() + { "sp",function() require("grug-far").open() end}, + { "sw", function() require('grug-far').open({ prefills = { search = vim.fn.expand("") } }) end } diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua new file mode 100644 index 0000000..ecc228a --- /dev/null +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -0,0 +1,23 @@ +return { + "ThePrimeagen/harpoon", + lazy = false, + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function () + local harpoon = require("harpoon") + + harpoon:setup() + + vim.keymap.set("n", "a", function() harpoon:list():add() end) + vim.keymap.set("n", "x", function() harpoon:list():remove() end) + -- vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + + vim.keymap.set("n", "", function() harpoon:list():select(1) end) + vim.keymap.set("n", "", function() harpoon:list():select(2) end) + vim.keymap.set("n", "", function() harpoon:list():select(3) end) + vim.keymap.set("n", "", function() harpoon:list():select(4) end) + + -- vim.keymap.set("n", "", function() harpoon:list():next() end) + -- vim.keymap.set("n", "", function() harpoon:list():prev() end) + end +} diff --git a/.config/nvim/lua/plugins/lazygit.lua b/.config/nvim/lua/plugins/lazygit.lua deleted file mode 100644 index c451a2c..0000000 --- a/.config/nvim/lua/plugins/lazygit.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - "kdheepak/lazygit.nvim", - cmd = { - "LazyGit", - "LazyGitConfig", - "LazyGitCurrentFile", - "LazyGitFilter", - "LazyGitFilterCurrentFile", - }, - dependencies = { - "nvim-lua/plenary.nvim", - }, - keys = { - { "g", "LazyGit", desc = "LazyGit" } - }, - config = function() - vim.g.lazygit_floating_window_scaling_factor = 1 - end -} diff --git a/.config/nvim/lua/plugins/multicursor.lua b/.config/nvim/lua/plugins/multicursor.lua deleted file mode 100644 index 717b854..0000000 --- a/.config/nvim/lua/plugins/multicursor.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - -- "brenton-leighton/multiple-cursors.nvim", - -- version = "*", - -- opts = {}, - -- keys = { - -- {"j", "MultipleCursorsAddDown", mode = {"n", "x"}, desc = "Add cursor and move down"}, - -- {"k", "MultipleCursorsAddUp", mode = {"n", "x"}, desc = "Add cursor and move up"}, - -- {"", "MultipleCursorsMouseAddDelete", mode = {"n", "i"}, desc = "Add or remove cursor"}, - -- {"a", "MultipleCursorsAddMatches", mode = {"n", "x"}, desc = "Add cursors to cword"}, - -- {"A", "MultipleCursorsAddMatchesV", mode = {"n", "x"}, desc = "Add cursors to cword in previous area"}, - -- {"d", "MultipleCursorsAddJumpNextMatch", mode = {"n", "x"}, desc = "Add cursor and jump to next cword"}, - -- {"D", "MultipleCursorsJumpNextMatch", mode = {"n", "x"}, desc = "Jump to next cword"}, - -- {"l", "MultipleCursorsLock", mode = {"n", "x"}, desc = "Lock virtual cursors"}, - -- {"n", "|", function() require("multiple-cursors").align() end}, - -- }, -} diff --git a/.config/nvim/lua/plugins/neogit.lua b/.config/nvim/lua/plugins/neogit.lua new file mode 100644 index 0000000..12dd93b --- /dev/null +++ b/.config/nvim/lua/plugins/neogit.lua @@ -0,0 +1,17 @@ +return { + "NeogitOrg/neogit", + lazy = false, + dependencies = { + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "nvim-telescope/telescope.nvim", + }, + keys = { + { "g", "Neogit", desc = "Neogit" }, + }, + config = function() + require("neogit").setup({ + graph_style = "unicode", + }) + end, +} diff --git a/.config/nvim/lua/plugins/neotest.lua b/.config/nvim/lua/plugins/neotest.lua index c646bfd..5b2d3c4 100644 --- a/.config/nvim/lua/plugins/neotest.lua +++ b/.config/nvim/lua/plugins/neotest.lua @@ -6,11 +6,13 @@ return { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", "olimorris/neotest-rspec", + "zidhuss/neotest-minitest", "rcasia/neotest-java", }, config = function() require("neotest").setup({ adapters = { + require("neotest-minitest"), require("neotest-rspec"), ["neotest-java"] = { ignore_wrapper = true diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua index d62168f..a6a1e3d 100644 --- a/.config/nvim/lua/plugins/nvim-cmp.lua +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -17,44 +17,81 @@ return { local cmp = require('cmp') require("luasnip.loaders.from_vscode").lazy_load() + local luasnip = require('luasnip') + cmp.setup({ snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - -- { name = 'treesitter' }, - { name = 'luasnip' }, - }, { - { name = 'buffer' }, - { name = 'path' }, + -- expand = function(args) + -- require('luasnip').lsp_expand(args.body) + -- end, + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + -- [''] = cmp.mapping.confirm({ select = true }), + -- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#luasnip + + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + if luasnip.expandable() then + luasnip.expand() + else + cmp.confirm({ + select = true, + }) + end + else + fallback() + end + end), + + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.locally_jumpable(1) then + luasnip.jump(1) + else + fallback() + end + end, { "i", "s" }), + + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + -- { name = 'treesitter' }, + { name = 'luasnip' }, + }, { + -- { name = 'buffer' }, + { name = 'path' }, + }) }) - }) - cmp.setup.cmdline({ '/', '?' }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } - }) + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } + }) - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }), - matching = { disallow_symbol_nonprefix_matching = false } - }) - end -} + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }), + matching = { disallow_symbol_nonprefix_matching = false } + }) + end + } diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index 39ec42c..7700188 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -1,15 +1,9 @@ -local lsp_servers = { - "ts_ls", - "lua_ls", - "ruby_lsp", - "standardrb" -} - return { "neovim/nvim-lspconfig", lazy = false, dependencies = { "hrsh7th/cmp-nvim-lsp", + "VonHeikemen/lsp-zero.nvim", { "williamboman/mason.nvim", commands = { "Mason" }, @@ -21,7 +15,7 @@ return { "williamboman/mason-lspconfig.nvim", config = function() require("mason-lspconfig").setup({ - ensure_installed = lsp_servers + ensure_installed = { 'lua_ls', 'rust_analyzer' }, }) end, keys = { @@ -31,67 +25,39 @@ return { } }, config = function() - local status, err = pcall(function() - local lspconfig = require("lspconfig") - - local capabilities = require("cmp_nvim_lsp").default_capabilities() - - lspconfig["lua_ls"].setup({ - capabilities = capabilities, - settings = { - Lua = { - runtime = { - version = 'LuaJIT', - path = vim.split(package.path, ';'), - }, - diagnostics = { - globals = { 'vim' }, - }, - workspace = { - library = { - [vim.fn.expand('$VIMRUNTIME/lua')] = true, - [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, - }, - }, - }, - } - }) - - lspconfig["ruby_lsp"].setup({ - cmd = { "/Users/dani/.asdf/shims/ruby-lsp"}, - capabilities = capabilities - }) - - lspconfig["standardrb"].setup({ - capabilities = capabilities - }) - - lspconfig["rust_analyzer"].setup({ - capabilities = capabilities, - settings = { - ["rust-analyzer"] = { - cachePriming = { - enable = false - } - } - } - }) - - lspconfig["jdtls"].setup({ - capabilities = capabilities, - cmd = { "/opt/homebrew/bin/jdtls" }, - root_dir = lspconfig.util.root_pattern("pom.xml", "gradle.build", ".git"), - }) - - vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) - vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) - vim.keymap.set("n", "cn", vim.lsp.buf.rename, {}) - end) - - if not status then - print("Error in LSP config: " .. err) - end + local lspconfig = require('lspconfig') + + local lspconfig_defaults = lspconfig.util.default_config + lspconfig_defaults.capabilities = vim.tbl_deep_extend( + 'force', + lspconfig_defaults.capabilities, + require('cmp_nvim_lsp').default_capabilities() + ) + + require('mason-lspconfig').setup_handlers({ + function(server) + lspconfig[server].setup({}) + end, + }) + + vim.api.nvim_create_autocmd('LspAttach', { + desc = 'LSP actions', + callback = function(event) + local opts = { buffer = event.buf } + vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) + vim.keymap.set('n', 'go', vim.lsp.buf.type_definition, opts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) + vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, opts) + vim.keymap.set('n', 'cn', vim.lsp.buf.rename, opts) + vim.keymap.set({ 'n', 'x' }, 'F', function() + vim.lsp.buf.format({ async = true }) + end, opts) + vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, opts) + end, + }) end } + diff --git a/.config/nvim/lua/plugins/nvim-spectre.lua b/.config/nvim/lua/plugins/nvim-spectre.lua deleted file mode 100644 index 6f024cf..0000000 --- a/.config/nvim/lua/plugins/nvim-spectre.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "nvim-pack/nvim-spectre", - dependencies = { - 'nvim-lua/plenary.nvim' - }, - lazy = false -} diff --git a/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua b/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua index 3f73d61..ee8f0fd 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua @@ -38,6 +38,9 @@ return { ["am"] = { query = "@function.outer", desc = "Select outer part of a method/function definition" }, ["im"] = { query = "@function.inner", desc = "Select inner part of a method/function definition" }, + ["ab"] = { query = "@block.outer", desc = "Select outer part of a block definition" }, + ["ib"] = { query = "@block.inner", desc = "Select inner part of a block definition" }, + ["ac"] = { query = "@class.outer", desc = "Select outer part of a class" }, ["ic"] = { query = "@class.inner", desc = "Select inner part of a class" }, diff --git a/.config/nvim/lua/plugins/nvim-treesitter.lua b/.config/nvim/lua/plugins/nvim-treesitter.lua index c10aaac..f000e7a 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter.lua @@ -2,6 +2,7 @@ return { "nvim-treesitter/nvim-treesitter", event = { "BufReadPre", "BufNewFile" }, dependencies = { + "nvim-treesitter/nvim-treesitter-context", "nvim-treesitter/nvim-treesitter-textobjects", }, config = function() @@ -14,6 +15,9 @@ return { node_decremental = "", }, }, + highlight = { + enable = true + } } end, } diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index d1f42fb..39c3f5e 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -7,10 +7,10 @@ return { config = function() require("oil").setup({ columns = { - "icon", - "permissions", - "size", - "mtime", + -- "icon", + -- "permissions", + -- "size", + -- "mtime", }, constrain_cursor = "name", skip_confirm_for_simple_edits = true, diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index de25ce4..6d7dd92 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -8,12 +8,47 @@ return { require("telescope.themes").get_dropdown { } } - } + }, + previewers = { + qflist = { + updatetime = 25, + layout_config = { + width = 0.75, + height = 0.75, + } + } + }, } require("telescope").load_extension("ui-select") + local harpoon = require('harpoon') + harpoon:setup({}) + + -- basic telescope configuration + local conf = require("telescope.config").values + local function toggle_telescope(harpoon_files) + local file_paths = {} + for _, item in ipairs(harpoon_files.items) do + table.insert(file_paths, item.value) + end + + require("telescope.pickers").new({}, { + prompt_title = "Harpoon", + finder = require("telescope.finders").new_table({ + results = file_paths, + }), + layout_strategy = "center", + previewer = conf.file_previewer({}), + sorter = conf.generic_sorter({}), + }):find() + end + + vim.keymap.set("n", "", function() toggle_telescope(harpoon:list()) end, + { desc = "Open harpoon window" }) end, keys = { + { "", "Telescope commands" }, + { "", "Telescope lsp_document_symbols" }, { "f", "Telescope find_files hidden=true" }, { "e", "Telescope find_files hidden=false" }, { "w", "Telescope live_grep" }, @@ -21,8 +56,9 @@ return { local current_word = vim.fn.expand("") require("telescope.builtin").grep_string({ search = current_word }) end }, - { "c", "Telescope git_commits" }, + { "cc", "Telescope git_commits" }, { "ac", "Telescope find_files prompt_title=Controllers cwd=app/controllers/ hidden=true" }, + { "ah", "Telescope find_files prompt_title=Controllers cwd=app/helpers/ hidden=true" }, { "am", "Telescope find_files prompt_title=Models cwd=app/models/ hidden=true" }, { "at", "Telescope find_files prompt_title=Specs cwd=spec/ hidden=true" }, { "af", "Telescope find_files prompt_title=Specs cwd=spec/factories hidden=true" }, diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..3741f30 --- /dev/null +++ b/.config/nvim/lua/plugins/trouble.lua @@ -0,0 +1,37 @@ +return { + "folke/trouble.nvim", + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = "Trouble", + keys = { + { + "xx", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "xX", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "cs", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "cl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "xL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "xQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, +} diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index 6ccf795..a4f0f7e 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -3,8 +3,8 @@ vim.g.maplocalleader = ',' vim.opt.cursorline = true vim.opt.cursorcolumn = true vim.opt.termguicolors = true -vim.wo.number = false -vim.wo.relativenumber = false +vim.wo.number = true +vim.wo.relativenumber = true vim.opt.expandtab = true vim.opt.tabstop = 2 vim.opt.shiftwidth = 2 @@ -14,10 +14,10 @@ vim.opt.autowriteall = true vim.opt.list = false -- whitespace vim.o.clipboard = "unnamedplus" vim.o.timeoutlen = 200 -vim.o.laststatus = 0 +vim.o.laststatus = 1 -- keyap to toggle line numbers (set nonumber and set norelativenumber) -vim.keymap.set("n", "", ":set invnumber:set invrelativenumber") +-- vim.keymap.set("n", "", ":set invnumber:set invrelativenumber") vim.keymap.set("n", "n", "nzz") vim.keymap.set("n", "N", "Nzz") diff --git "a/.config/nvim/lua/theme.lua\"\"" "b/.config/nvim/lua/theme.lua\"\"" deleted file mode 100644 index 5926fff..0000000 --- "a/.config/nvim/lua/theme.lua\"\"" +++ /dev/null @@ -1,9 +0,0 @@ -local USE_DARKMODE = false - -if USE_DARKMODE then - vim.cmd("colorscheme tokyodark") - vim.cmd("set bg=dark") -else - vim.cmd("colorscheme solarized") - vim.cmd("set bg=light") -end diff --git a/.tmux.conf b/.tmux.conf index 2c24cea..66e9728 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -18,7 +18,6 @@ bind-key l select-pane -R # set -g window-size latest # setw -g aggressive-resize on -bind-key -n C-t new-window bind r source-file ~/.tmux.conf; # set-hook -g after-kill-pane 'select-layout -E' @@ -30,7 +29,7 @@ set -g mouse on set -g default-terminal "screen-256color" set -ag terminal-overrides ",xterm-256color:RGB" set-option -g status-position bottom -set-option -g status off +set-option -g status on set-option -g renumber-windows on set -g pane-border-lines "single" set -s escape-time 1 diff --git a/.zsh/aliases.sh b/.zsh/aliases.sh deleted file mode 100644 index 50ff452..0000000 --- a/.zsh/aliases.sh +++ /dev/null @@ -1,90 +0,0 @@ -alias '~'='cd ~' -alias '..'='cd ..' -alias '...'='cd ../../' -alias '....'='cd ../../../' -alias '.....'='cd ../../../../' -alias '......'='cd ../../../../../' -alias ls="eza" -alias l="eza -lah" -alias lh="eza -lah | grep -E ' \.\w+$'" # [l]ist [h]idden -alias zshrc='nvim ~/.zshrc' # Idea from Chris -alias czsh='cd ~/.zsh && nvim .' -alias calacritty='nvim ~/.config/alacritty/alacritty.toml' -alias ckitty='nvim ~/.config/kitty/kitty.conf' -alias ctmux='nvim ~/.tmux.conf' -alias clazygit='nvim ~/Library/Application\ Support/lazygit/config.yml' -alias cneovide='nvim ~/.config/neovide/config.toml' -alias chypr='nvim ~/.config/hypr/hyprland.conf' -alias ff="fastfetch" -alias cnix="sudo nvim /etc/nixos/configuration.nix" -alias pkgsearch="nix search nixpkgs" -alias nxs="sudo nixos-rebuild switch" -alias nv='neovide' -alias cgit='nvim ~/.gitconfig' -alias kts='tmux kill-server' # [k]ill [t]mux [s]erver -alias v='nvim' -alias cpp='pbcopy' -alias bo='tectonic -X build && open build/default/default.pdf' # [b]uild and [o]pen -alias bno='tectonic -X build' # [b]uild and do[n]'t [o]pen -alias g="grep" # [g]rep -alias myip="ipconfig getifaddr en0" -alias pubip="dig +short myip.opendns.com @resolver1.opendns.com -4" # borrowed from raphi -alias pubip="curl ifconfig.me" -alias bra="bundle exec rubocop -A" # [b]undle exec [r]ubocop -[A] -alias spec="be rspec" -alias f="fork ." -alias cnvim="cd ~/.config/nvim && nvim init.lua" # [c]onfigure [nvim] -alias yabairc="v ~/.yabairc" -alias skhdrc="v ~/.config/skhd/skhdrc" -alias dbreset="bundle exec rails db:drop db:create db:schema:load db:seed" # [d]ata[b]ase [reset] -alias bsf="bundle exec standardrb --fix" -alias change_theme="~/.config/change_theme.sh > /dev/null" -alias cpb="git branch | grep '*' | tr -d '*' | tr -d ' ' | pbcopy" # [c]o[p]y [b]ranch to clipboard -alias tks="tmux kill-server" # [t]mux [k]ill [s]erver -alias crc="cargo r -r --bin client" -alias crs="cargo r -r --bin server" -alias fastfetch="cat ~/.config/fastfetch/logo.txt | fastfetch --file - --logo-color-1 magenta" -alias ff="fastfetch" -alias listfonts="fc-list | sed 's/.*:\s*\([^:]*\):.*/\1/' | tr ',' '\n' | sed 's/^[ \t]*//;s/[ \t]*$//' | sort | uniq" # https://stackoverflow.com/questions/57473124/how-to-find-all-available-fonts-on-osx-using-the-default-shell -#alias glog="git log --oneline | grep -v -e '^\s*$' --color=always | less --use-color" # [g]it [log] -alias glog="git log --oneline" -alias glag="glog_ --all --since='00:00' --until='NOW' | grep -v -e '^\s*$' --color=always" # [g]it [l]og [a]ll [g]rep -alias gb="if ( git branch | grep '* develop' ); then; git checkout -b ; else; echo 'You can only start a new feature from the development branch' ;fi;" # [g]it [b]ranch -alias gs="git status" # [g]it [s]tatus -alias gso="git show" # [g]it [s]how -alias gp="git push" # [g]it [p]ush -alias gpp="git pull && git push" # [g]it [p]ull and [p]ush -alias gpl="git pull" # [g]it [p]u[l]l -alias gc="git commit" # [g]it [c]ommit -alias ga="git add" # [g]it [a]dd -alias gac="git add . && git commit" # [g]it [a]dd and [c]ommit -alias lg="lazygit" # [l]azy[g]it -alias gcl="git clone" # [g]it [cl]one -alias gss="git stash" # [g]it [s]tash [s]ave -alias cl="clear" # [cl]ear -alias python="python3" -alias o="open" -alias q="exit" -alias be="bundle exec" -alias qlf='qlmanage -p "$@"' -alias mine='rubymine .' -alias m='rubymine .' -alias bs="bin/setup" -alias bc="bin/check" -alias br="bin/run" -alias bt="bin/test" -alias bd="bin/dev" -alias yd="yarn dev" -alias yt="yarn test" -alias brc="be rspec --format doc" # [b]undle [e]xec run [c]hecks -alias nvimc="cd ~/.config/nvim && nvim ." -alias gcf="git checkout -b feature/" -alias rr="rails routes | rg" -alias c="code" -alias bat="bat --style plain --theme OneHalfDark" -alias cat="bat" -alias gdu="git diff @{upstream}" -alias spf="~/bin/spf" -alias clines="find . -type f -name '*.txt' -exec wc -l {} +" -alias gch="git checkout" -alias gcf="git checkout -b feature/" diff --git a/.zsh/exports.sh b/.zsh/exports.sh deleted file mode 100644 index dac4584..0000000 --- a/.zsh/exports.sh +++ /dev/null @@ -1,7 +0,0 @@ -export EDITOR=nvim -export BETTER_ERRORS_EDITOR=nvim -export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES - -export BUN_INSTALL="$HOME/.bun" -export PATH="$BUN_INSTALL/bin:$PATH" -export PATH="/opt/homebrew/opt/gnupg@2.2/bin:$PATH" diff --git a/.zsh/history.sh b/.zsh/history.sh deleted file mode 100644 index 318986a..0000000 --- a/.zsh/history.sh +++ /dev/null @@ -1,7 +0,0 @@ -HISTSIZE=100000 -SAVEHIST=1000000 -HISTFILE=~/.zsh_history -setopt APPEND_HISTORY -setopt HIST_IGNORE_DUPS -setopt HIST_IGNORE_ALL_DUPS -setopt HIST_REDUCE_BLANKS diff --git a/.zsh/homebrew.sh b/.zsh/homebrew.sh deleted file mode 100644 index 7cbff34..0000000 --- a/.zsh/homebrew.sh +++ /dev/null @@ -1,11 +0,0 @@ -. /opt/homebrew/opt/asdf/libexec/asdf.sh - -source $HOMEBREW_PREFIX/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh -# source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc" -#source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc" -source /opt/homebrew/opt/autojump/etc/autojump.sh -# source /opt/homebrew/opt/asdf/libexec/asdf.sh - -. ~/.asdf/plugins/java/set-java-home.zsh - -[ -s "/Users/dani/.bun/_bun" ] && source "/Users/dani/.bun/_bun" diff --git a/.zsh/utils.sh b/.zsh/utils.sh deleted file mode 100644 index 2c41e14..0000000 --- a/.zsh/utils.sh +++ /dev/null @@ -1,74 +0,0 @@ - function go() { ~/scripts/open-repo-in-browser.ts } - function gtable() { ~/scripts/git-smart-log.ts $@ } - function gitcopy() { ~/scripts/copy_remote_to_clipboard.sh } - function cscript() { ~/scripts/create_executable_script.sh } - function timelog() { ~/scripts/index.ts } - function openticket() { ~/scripts/open-ticket-in-browser.ts } - function ot() { ~/scripts/open-ticket-in-browser.ts } - function prt() { ~/scripts/get-pr-template.ts } - function cpt() { ~/scripts/copy-ticket-number.ts } - function rsf() { - file=$(find spec/**/*_spec.rb | fzf --preview 'bat --color "always" {}') - echo "bundle exec rspec $file" - print -S "bundle exec rspec $file" - bundle exec rspec $file - } # [r]spec [s]earch [f]ile - function jsf() { - file=$(find ./**/*.java | fzf --preview 'bat --color "always" {}') - echo "java $file" - print -S "java $file" - java $file - } # [r]spec [s]earch [f]ile - function vg() { nvim $(fzf) } # [v]im [g]rep - function prokill() { - port=$1 - process=$(lsof -i :$port | fzf | awk '{print $2}') - kill $process - } # [k]ill [p]rocess - - function cached_routes() { - if ( [ ! -f config/routes.rb ]); then - echo "No routes file found" - return "Empty" - fi - - - if ( [ ! -f tmp/cache/routes-$(md5 -q config/routes.rb).txt ] ); then - bundle exec rails routes > tmp/cache/routes-$(md5 -q config/routes.rb).txt - fi - - cat tmp/cache/routes-$(md5 -q config/routes.rb).txt - } - - reimport_abbr() { - rm -rf $ABBR_TMPDIR - rm $ABBR_USER_ABBREVIATIONS_FILE - abbr import-aliases - } - - backup_directory() { - if [ -z "$1" ]; then - echo "Please provide a directory to backup" - return - fi - - directory_name_with_timestamp_suffix=$1-$(date +%Y-%m-%d:%H:%M:%S) - cp -r "$1" "$directory_name_with_timestamp_suffix" - printf "Backup created at $directory_name_with_timestamp_suffix" - } - - parallel_exec() { - # Example usage: - # parallel_exec "sleep 1" "echo 'Hello, World!'" "ls -l" - - trap 'kill $(jobs -p)' SIGINT SIGTERM # Kill child processes on interrupt or termination - for cmd in "$@"; do - eval "$cmd" & - done - wait - } - - - function rr() { rustc "$@.rs" && ./"$@"} # [r]ust [r]un - function rgs() { rg --json -C 2 "$@" | delta } # [r]ip[g]rep [s]earch - function rkill() { "kill $(cat tmp/pids/server.pid)" } diff --git a/.zsh/zinit.sh b/.zsh/zinit.sh deleted file mode 100644 index 204e444..0000000 --- a/.zsh/zinit.sh +++ /dev/null @@ -1,20 +0,0 @@ - if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then - print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" - command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" - command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ - print -P "%F{33} %F{34}Installation successful.%f%b" || \ - print -P "%F{160} The clone has failed.%f%b" - fi - - source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" - autoload -Uz _zinit - (( ${+_comps} )) && _comps[zinit]=_zinit - - zinit light-mode for \ - zdharma-continuum/zinit-annex-as-monitor \ - zdharma-continuum/zinit-annex-bin-gem-node \ - zdharma-continuum/zinit-annex-patch-dl \ - zdharma-continuum/zinit-annex-rust - - zinit ice pick"async.zsh" src"pure.zsh" - zinit light sindresorhus/pure diff --git a/.zshrc b/.zshrc index 95d21e8..e69de29 100644 --- a/.zshrc +++ b/.zshrc @@ -1,18 +0,0 @@ -source ~/.import-secrets.sh -source ~/.zsh/aliases.sh -source ~/.zsh/exports.sh -source ~/.zsh/history.sh - -if [[ "$OSTYPE" == "darwin"* ]]; then - source ~/.zsh/homebrew.sh -fi - -source ~/.zsh/utils.sh -source ~/.zsh/zinit.sh - -set -o vi - -eval "$(fzf --zsh)" -bindkey -r "^t" - -compinit -C From 1738ca6ac25abed4169115223a7c42b5a449e079 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 22 Dec 2024 19:04:28 +0100 Subject: [PATCH 239/280] Update plugin config --- .config/nvim/lazy-lock.json | 5 +-- .config/nvim/lua/plugins/boole.lua | 1 + .config/nvim/lua/plugins/harpoon.lua | 2 +- .config/nvim/lua/plugins/lualine.lua | 48 +++++++++++++++++++++++++++ .config/nvim/lua/plugins/undotree.lua | 30 +++++++++++++++++ .config/nvim/lua/settings.lua | 26 +++++++-------- .config/nvim/lua/util.lua | 2 +- 7 files changed, 97 insertions(+), 17 deletions(-) create mode 100644 .config/nvim/lua/plugins/lualine.lua create mode 100644 .config/nvim/lua/plugins/undotree.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 9c704db..32f4fc0 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -12,7 +12,6 @@ "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, - "copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, @@ -21,6 +20,7 @@ "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, "lsp-zero.nvim": { "branch": "v4.x", "commit": "19a8b90340c6c522219c84f7befe784d657ab28e" }, + "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, @@ -36,13 +36,13 @@ "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, "nvim-lspconfig": { "branch": "master", "commit": "04680101ff79e99b4e33a4386ec27cbd0d360c75" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, "nvim-treesitter": { "branch": "master", "commit": "86c10df7ef77daf45a0e4a918934bb59083db1e1" }, "nvim-treesitter-context": { "branch": "master", "commit": "1147c42cf9477701581d1eb31e1735969e21dd06" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "b91c98afa6c42819aea6cbc1ba38272f5456a5cf" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, + "nvim-web-devicons": { "branch": "master", "commit": "6317aca1fd86cc8e8c5ad30029ae7640d566cec6" }, "oil.nvim": { "branch": "feat/scratch-preview", "commit": "60fe23050f5b93550262f5c96ab00b5c51b60830" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, "plantuml-previewer.vim": { "branch": "master", "commit": "555347700382c97b347bace57b7a9f764ed556b1" }, @@ -54,6 +54,7 @@ "text-case.nvim": { "branch": "main", "commit": "e898cfd46fa6cde0e83abb624a16e67d2ffc6457" }, "tokyonight-vim": { "branch": "master", "commit": "4e82e0f0452a6ce8f387828ec71013015515035a" }, "trouble.nvim": { "branch": "main", "commit": "3dc00c0447c016cd43e03054c3d49436a1f2076d" }, + "undotree": { "branch": "main", "commit": "eab459ab87dd249617b5f7187bb69e614a083047" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" }, diff --git a/.config/nvim/lua/plugins/boole.lua b/.config/nvim/lua/plugins/boole.lua index bc16e1f..c712bbe 100644 --- a/.config/nvim/lua/plugins/boole.lua +++ b/.config/nvim/lua/plugins/boole.lua @@ -14,6 +14,7 @@ return { {'true', 'false'}, {'&&', '||'}, {'private', 'public', 'protected'}, + {'const', 'let'}, }, }) end diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua index ecc228a..574c003 100644 --- a/.config/nvim/lua/plugins/harpoon.lua +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -12,7 +12,7 @@ return { vim.keymap.set("n", "x", function() harpoon:list():remove() end) -- vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) - vim.keymap.set("n", "", function() harpoon:list():select(1) end) + -- vim.keymap.set("n", "", function() harpoon:list():select(1) end) vim.keymap.set("n", "", function() harpoon:list():select(2) end) vim.keymap.set("n", "", function() harpoon:list():select(3) end) vim.keymap.set("n", "", function() harpoon:list():select(4) end) diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..9fb8c8d --- /dev/null +++ b/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,48 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + lazy = false, + config = function() + require('lualine').setup { + options = { + icons_enabled = true, + theme = 'auto', + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = false, + refresh = { + statusline = 10, + tabline = 100, + winbar = 100, + } + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff', 'diagnostics' }, + lualine_c = { 'filename' }, + lualine_x = { 'encoding', 'fileformat', 'filetype' }, + lualine_y = { 'progress' }, + lualine_z = { 'location' } + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { 'filename' }, + lualine_x = { 'location' }, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} + } + end +} diff --git a/.config/nvim/lua/plugins/undotree.lua b/.config/nvim/lua/plugins/undotree.lua new file mode 100644 index 0000000..92e400a --- /dev/null +++ b/.config/nvim/lua/plugins/undotree.lua @@ -0,0 +1,30 @@ +return { + "jiaoshijie/undotree", + dependencies = "nvim-lua/plenary.nvim", + keys = { -- load the plugin only when using it's keybinding: + { "u", "lua require('undotree').toggle()" }, + }, + config = function() + local undotree = require('undotree') + + undotree.setup({ + float_diff = true, -- using float window previews diff, set this `true` will disable layout option + layout = "left_bottom", -- "left_bottom", "left_left_bottom" + position = "left", -- "right", "bottom" + ignore_filetype = { 'undotree', 'undotreeDiff', 'qf', 'TelescopePrompt', 'spectre_panel', 'tsplayground' }, + window = { + winblend = 30, + }, + keymaps = { + ['j'] = "move_next", + ['k'] = "move_prev", + ['gj'] = "move2parent", + ['J'] = "move_change_next", + ['K'] = "move_change_prev", + [''] = "action_enter", + ['p'] = "enter_diffbuf", + ['q'] = "quit", + }, + }) + end +} diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index a4f0f7e..5d52a4c 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -14,7 +14,7 @@ vim.opt.autowriteall = true vim.opt.list = false -- whitespace vim.o.clipboard = "unnamedplus" vim.o.timeoutlen = 200 -vim.o.laststatus = 1 +vim.opt.cmdheight = 0 -- keyap to toggle line numbers (set nonumber and set norelativenumber) -- vim.keymap.set("n", "", ":set invnumber:set invrelativenumber") @@ -76,19 +76,19 @@ vim.keymap.set("n", "", ":wincmd =", { silent = true }) vim.keymap.set("n", "v", ":wincmd v", { silent = true }) vim.keymap.set("n", "V", ":wincmd s", { noremap = true, silent = true }) vim.keymap.set("n", "o", function() - -- get the current line content - local line = vim.api.nvim_get_current_line() + -- get the current line content + local line = vim.api.nvim_get_current_line() - -- extract the string (either single-quoted or double-quoted) - local str = line:match("'(.-)'") or line:match('"(.-)"') + -- extract the string (either single-quoted or double-quoted) + local str = line:match("'(.-)'") or line:match('"(.-)"') - if str then - -- Construct the GitHub URL - local url = "https://github.com/" .. str + if str then + -- Construct the GitHub URL + local url = "https://github.com/" .. str - -- use the open shell command to open the URL - os.execute("open " .. url) - else - print("No valid string found on the current line.") - end + -- use the open shell command to open the URL + os.execute("open " .. url) + else + print("No valid string found on the current line.") + end end) diff --git a/.config/nvim/lua/util.lua b/.config/nvim/lua/util.lua index cb2ccb1..ea89151 100644 --- a/.config/nvim/lua/util.lua +++ b/.config/nvim/lua/util.lua @@ -31,7 +31,7 @@ local function define_getter_setter_macros() end end -define_getter_setter_macros() +-- define_getter_setter_macros() vim.api.nvim_create_autocmd("TextYankPost", { group = vim.api.nvim_create_augroup("highlight_yank", {}), From 8105a73dedb85268c68b823679399db4c2f3b009 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 22 Dec 2024 19:05:44 +0100 Subject: [PATCH 240/280] Remove unused macros --- .config/nvim/lua/util.lua | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/.config/nvim/lua/util.lua b/.config/nvim/lua/util.lua index ea89151..3f41d32 100644 --- a/.config/nvim/lua/util.lua +++ b/.config/nvim/lua/util.lua @@ -6,33 +6,6 @@ local function extract_attribute_name(line) return line:match("%s*(%w+)%s*;") end -local function define_getter_setter_macros() - local line = get_current_line() - local attribute_name = extract_attribute_name(line) - if attribute_name then - local getter = string.format( - "o// Getter method for %s^Mpublic String get%s() {^M return this.%s;^M}", - attribute_name, - attribute_name:gsub("^%l", string.upper), - attribute_name - ) - local setter = string.format( - "o// Setter method for %s^Mpublic void set%s(String %s) {^M this.%s = %s;^M}", - attribute_name, - attribute_name:gsub("^%l", string.upper), - attribute_name, - attribute_name, - attribute_name - ) - vim.cmd(string.format("let @g = '%s'", getter)) - vim.cmd(string.format("let @s = '%s'", setter)) - else - print("No attribute name found on the current line.") - end -end - --- define_getter_setter_macros() - vim.api.nvim_create_autocmd("TextYankPost", { group = vim.api.nvim_create_augroup("highlight_yank", {}), desc = "Hightlight selection on yank", From ffd8bfb7074a97b686bd965a28017197f6ea52c0 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 25 Dec 2024 12:27:45 +0100 Subject: [PATCH 241/280] Update nvim --- .config/nvim/lazy-lock.json | 4 +- .config/nvim/lua/plugins/lualine.lua | 92 +++++++++++++------------- .config/nvim/lua/plugins/markdown.lua | 10 +++ .config/nvim/lua/plugins/telescope.lua | 14 ++-- .config/nvim/lua/settings.lua | 2 +- 5 files changed, 68 insertions(+), 54 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 32f4fc0..23121c6 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -20,13 +20,13 @@ "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, "lsp-zero.nvim": { "branch": "v4.x", "commit": "19a8b90340c6c522219c84f7befe784d657ab28e" }, - "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.cursorword": { "branch": "main", "commit": "7d1b38a17834acbbc4feff8e42aedc4ed0c6ff06" }, "mini.icons": { "branch": "main", "commit": "a2742459f0ee32806c2438ca06b4d8b331f3f4d4" }, + "mini.nvim": { "branch": "main", "commit": "2011aff270bcd3e1f3ad088253ace2d574967bed" }, "neogit": { "branch": "master", "commit": "570c39181784f7a2e1bc9cedbfb11846022eea54" }, "neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" }, "neotest-java": { "branch": "main", "commit": "4fe7a53d659ae2fd4f1aa3a0084bf3afde554acc" }, @@ -42,12 +42,12 @@ "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "b91c98afa6c42819aea6cbc1ba38272f5456a5cf" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "nvim-web-devicons": { "branch": "master", "commit": "6317aca1fd86cc8e8c5ad30029ae7640d566cec6" }, "oil.nvim": { "branch": "feat/scratch-preview", "commit": "60fe23050f5b93550262f5c96ab00b5c51b60830" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, "plantuml-previewer.vim": { "branch": "master", "commit": "555347700382c97b347bace57b7a9f764ed556b1" }, "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "render-markdown.nvim": { "branch": "main", "commit": "0022a579ac7355966be5ade77699b88c76b6a549" }, "solarized.nvim": { "branch": "main", "commit": "f85f000c3e46714fee52cee3adf9f9661a048e40" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index 9fb8c8d..879420b 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -1,48 +1,48 @@ return { - 'nvim-lualine/lualine.nvim', - dependencies = { 'nvim-tree/nvim-web-devicons' }, - lazy = false, - config = function() - require('lualine').setup { - options = { - icons_enabled = true, - theme = 'auto', - component_separators = { left = '', right = '' }, - section_separators = { left = '', right = '' }, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - always_show_tabline = true, - globalstatus = false, - refresh = { - statusline = 10, - tabline = 100, - winbar = 100, - } - }, - sections = { - lualine_a = { 'mode' }, - lualine_b = { 'branch', 'diff', 'diagnostics' }, - lualine_c = { 'filename' }, - lualine_x = { 'encoding', 'fileformat', 'filetype' }, - lualine_y = { 'progress' }, - lualine_z = { 'location' } - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { 'filename' }, - lualine_x = { 'location' }, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {} - } - end + -- 'nvim-lualine/lualine.nvim', + -- dependencies = { 'nvim-tree/nvim-web-devicons' }, + -- lazy = false, + -- config = function() + -- require('lualine').setup { + -- options = { + -- icons_enabled = true, + -- theme = 'auto', + -- component_separators = { left = '', right = '' }, + -- section_separators = { left = '', right = '' }, + -- disabled_filetypes = { + -- statusline = {}, + -- winbar = {}, + -- }, + -- ignore_focus = {}, + -- always_divide_middle = true, + -- always_show_tabline = true, + -- globalstatus = false, + -- refresh = { + -- statusline = 10, + -- tabline = 100, + -- winbar = 100, + -- } + -- }, + -- sections = { + -- lualine_a = { 'mode' }, + -- lualine_b = { 'branch', 'diff', 'diagnostics' }, + -- lualine_c = { 'filename' }, + -- lualine_x = { 'encoding', 'fileformat', 'filetype' }, + -- lualine_y = { 'progress' }, + -- lualine_z = { 'location' } + -- }, + -- inactive_sections = { + -- lualine_a = {}, + -- lualine_b = {}, + -- lualine_c = { 'filename' }, + -- lualine_x = { 'location' }, + -- lualine_y = {}, + -- lualine_z = {} + -- }, + -- tabline = {}, + -- winbar = {}, + -- inactive_winbar = {}, + -- extensions = {} + -- } + -- end } diff --git a/.config/nvim/lua/plugins/markdown.lua b/.config/nvim/lua/plugins/markdown.lua index 0e6de23..9f46c84 100644 --- a/.config/nvim/lua/plugins/markdown.lua +++ b/.config/nvim/lua/plugins/markdown.lua @@ -4,4 +4,14 @@ return { opts = { -- configuration here or empty for defaults }, + { + 'MeanderingProgrammer/render-markdown.nvim', + dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons + ---@module 'render-markdown' + ---@type render.md.UserConfig + opts = {}, + ft = "markdown" + } } diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 6d7dd92..7cf782c 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -1,5 +1,6 @@ return { - "nvim-telescope/telescope.nvim", tag = "0.1.8", + "nvim-telescope/telescope.nvim", + tag = "0.1.8", dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-ui-select.nvim", }, config = function() require("telescope").setup { @@ -18,6 +19,9 @@ return { } } }, + defaults = { + file_ignore_patterns = { ".git/" }, -- Ignore the .git directory + } } require("telescope").load_extension("ui-select") @@ -44,11 +48,11 @@ return { end vim.keymap.set("n", "", function() toggle_telescope(harpoon:list()) end, - { desc = "Open harpoon window" }) + { desc = "Open harpoon window" }) end, keys = { - { "", "Telescope commands" }, - { "", "Telescope lsp_document_symbols" }, + { "", "Telescope commands" }, + { "", "Telescope lsp_document_symbols" }, { "f", "Telescope find_files hidden=true" }, { "e", "Telescope find_files hidden=false" }, { "w", "Telescope live_grep" }, @@ -63,6 +67,6 @@ return { { "at", "Telescope find_files prompt_title=Specs cwd=spec/ hidden=true" }, { "af", "Telescope find_files prompt_title=Specs cwd=spec/factories hidden=true" }, { "av", "Telescope find_files prompt_title=Views cwd=app/views hidden=true" }, - { "l", "Telescope lsp_document_symbols"} + { "l", "Telescope lsp_document_symbols" } } } diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index 5d52a4c..d1329e9 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -14,7 +14,7 @@ vim.opt.autowriteall = true vim.opt.list = false -- whitespace vim.o.clipboard = "unnamedplus" vim.o.timeoutlen = 200 -vim.opt.cmdheight = 0 +-- vim.opt.cmdheight = 0 -- keyap to toggle line numbers (set nonumber and set norelativenumber) -- vim.keymap.set("n", "", ":set invnumber:set invrelativenumber") From 003fbbb714e63ff39e361266cbd28042833c2ad8 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 3 Jan 2025 12:14:43 +0100 Subject: [PATCH 242/280] Add move mapping --- .config/nvim/lua/settings.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index d1329e9..1cf7ebe 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -32,6 +32,12 @@ vim.keymap.set("n", "/", "noh") vim.keymap.set("n", "", ":vert terminal", { noremap = true }) vim.keymap.set("t", "", "", { noremap = true }) +-- move +vim.api.nvim_set_keymap('x', '', ':move \'>+gv=gv', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '', ':move -2==', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '', ':move +==', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('x', '', ':move -2gv=gv', { noremap = true, silent = true }) + -- saving / quitting vim.keymap.set("n", "Q", ":quit") From b5476a4ff5d615c708c50aa1248ca89fe8f85830 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 7 Jan 2025 08:31:37 +0100 Subject: [PATCH 243/280] Format url script --- scripts/format_url.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 scripts/format_url.sh diff --git a/scripts/format_url.sh b/scripts/format_url.sh new file mode 100755 index 0000000..8fe7a60 --- /dev/null +++ b/scripts/format_url.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Get the URL of the current page from the clipboard +URL=$(pbpaste) + +# Provide debug output of the captured URL +echo "Formatting: '$URL'" + +# Initialize the FORMAT variable +FORMAT="" + +# Extract necessary parts based on the URL structure +if [[ $URL =~ https?://[^/]+\.atlassian\.net/browse/([^ ]+) ]]; then + TICKET="${BASH_REMATCH[1]}" + FORMAT="[$TICKET]($URL)" +elif [[ $URL =~ https?://[^/]+\.bitbucket\.org/[^/]+/pull-requests/([0-9]+) ]]; then + PR_NUMBER="${BASH_REMATCH[1]}" + FORMAT="[#${PR_NUMBER}]($URL)" +elif [[ $URL =~ https?://[^/]+\.bitbucket\.org/[^/]+/commits/([0-9a-f]+) ]]; then + COMMIT_HASH="${BASH_REMATCH[1]}" + FORMAT="[${COMMIT_HASH:0:7}]($URL)" +else + echo "Unsupported URL structure." + exit 1 +fi + +# Copy the formatted string to the clipboard +echo -n "$FORMAT" | pbcopy + +# Optional: Feedback on successful copy +echo "Copied to clipboard: $FORMAT" From 6ef3b09486fe93f9f526667b1e9f78c4b13a361f Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 7 Jan 2025 08:37:20 +0100 Subject: [PATCH 244/280] Update url to anchor --- scripts/format_url.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/format_url.sh b/scripts/format_url.sh index 8fe7a60..0d02b4d 100755 --- a/scripts/format_url.sh +++ b/scripts/format_url.sh @@ -12,13 +12,13 @@ FORMAT="" # Extract necessary parts based on the URL structure if [[ $URL =~ https?://[^/]+\.atlassian\.net/browse/([^ ]+) ]]; then TICKET="${BASH_REMATCH[1]}" - FORMAT="[$TICKET]($URL)" + FORMAT="$TICKET" elif [[ $URL =~ https?://[^/]+\.bitbucket\.org/[^/]+/pull-requests/([0-9]+) ]]; then PR_NUMBER="${BASH_REMATCH[1]}" - FORMAT="[#${PR_NUMBER}]($URL)" + FORMAT="#$PR_NUMBER" elif [[ $URL =~ https?://[^/]+\.bitbucket\.org/[^/]+/commits/([0-9a-f]+) ]]; then COMMIT_HASH="${BASH_REMATCH[1]}" - FORMAT="[${COMMIT_HASH:0:7}]($URL)" + FORMAT="${COMMIT_HASH:0:7}" else echo "Unsupported URL structure." exit 1 From 6a8c08b8e3b1ecbb79fff80989a4565de876abf8 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 14 Feb 2025 09:49:32 +0100 Subject: [PATCH 245/280] Add mapping for text case --- .config/nvim/lua/plugins/text-case.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/text-case.lua b/.config/nvim/lua/plugins/text-case.lua index 92c92fe..952796d 100644 --- a/.config/nvim/lua/plugins/text-case.lua +++ b/.config/nvim/lua/plugins/text-case.lua @@ -6,8 +6,7 @@ return { require("telescope").load_extension("textcase") end, keys = { - "ga", - { "ga.", "TextCaseOpenTelescope", mode = { "n", "x" }, desc = "Telescope" }, + { "co", "TextCaseOpenTelescope", mode = { "n", "x" }, desc = "Telescope" }, }, cmd = { "Subs", From 1b923394871e304810715524cab03bbb172297b7 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 14 Feb 2025 17:13:57 +0100 Subject: [PATCH 246/280] Fix nvim telescope quickfix, add clist mappings --- .config/nvim/lua/plugins/telescope.lua | 5 +++++ .config/nvim/lua/settings.lua | 3 +++ 2 files changed, 8 insertions(+) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 7cf782c..4257f1b 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -21,6 +21,11 @@ return { }, defaults = { file_ignore_patterns = { ".git/" }, -- Ignore the .git directory + mappings = { + n = { + [""] = require("telescope.actions").send_selected_to_qflist + require("telescope.actions").open_qflist, + } + } } } diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index 1cf7ebe..6da375e 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -69,6 +69,9 @@ vim.opt.shortmess:append("A") -- https://stackoverflow.com/questions/1098159/vim -- commands vim.keymap.set("n", "L", ":Lazy") +vim.keymap.set("n", "cp", "cp :let @+=expand('%:p')") +vim.keymap.set("n", "cm", ":cnext") +vim.keymap.set("n", "cl", ":cprev") -- splits From e304049b1a1d3a39e87fa3099045011132110a2c Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Thu, 20 Feb 2025 13:59:50 +0100 Subject: [PATCH 247/280] Update plugins --- .config/nvim/lazy-lock.json | 9 +- .config/nvim/lua/plugins/gitlinker.lua | 32 +++++++ .config/nvim/lua/plugins/gradlew.lua | 16 ++++ .config/nvim/lua/plugins/harpoon.lua | 27 +++--- .config/nvim/lua/plugins/lualine.lua | 92 +++++++++---------- .config/nvim/lua/plugins/nvim-lspconfig.lua | 6 +- .config/nvim/lua/plugins/nvim-treesitter.lua | 2 +- .config/nvim/lua/plugins/super-maven.lua | 13 +++ .config/nvim/lua/plugins/telescope.lua | 4 +- .config/nvim/lua/plugins/vim-case-convert.lua | 4 + .config/nvim/lua/plugins/whichkey.lua | 19 ++++ 11 files changed, 160 insertions(+), 64 deletions(-) create mode 100644 .config/nvim/lua/plugins/gitlinker.lua create mode 100644 .config/nvim/lua/plugins/gradlew.lua create mode 100644 .config/nvim/lua/plugins/super-maven.lua create mode 100644 .config/nvim/lua/plugins/vim-case-convert.lua create mode 100644 .config/nvim/lua/plugins/whichkey.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 23121c6..48a2bab 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -15,7 +15,9 @@ "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, + "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, "gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" }, + "gradle.nvim": { "branch": "main", "commit": "aef2a780457bdc1a7a52d9b03c41aa2b0906bb64" }, "grug-far.nvim": { "branch": "main", "commit": "75aad2698d428bdc94ff15f487f7165aee8ccbfb" }, "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, @@ -32,13 +34,13 @@ "neotest-java": { "branch": "main", "commit": "4fe7a53d659ae2fd4f1aa3a0084bf3afde554acc" }, "neotest-minitest": { "branch": "main", "commit": "5623b9a7b2b27314e5c336b385315d2ab7d4ccba" }, "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, + "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, "nvim-lspconfig": { "branch": "master", "commit": "04680101ff79e99b4e33a4386ec27cbd0d360c75" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, "nvim-treesitter": { "branch": "master", "commit": "86c10df7ef77daf45a0e4a918934bb59083db1e1" }, - "nvim-treesitter-context": { "branch": "master", "commit": "1147c42cf9477701581d1eb31e1735969e21dd06" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "b91c98afa6c42819aea6cbc1ba38272f5456a5cf" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, @@ -49,14 +51,17 @@ "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "render-markdown.nvim": { "branch": "main", "commit": "0022a579ac7355966be5ade77699b88c76b6a549" }, "solarized.nvim": { "branch": "main", "commit": "f85f000c3e46714fee52cee3adf9f9661a048e40" }, + "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "text-case.nvim": { "branch": "main", "commit": "e898cfd46fa6cde0e83abb624a16e67d2ffc6457" }, "tokyonight-vim": { "branch": "master", "commit": "4e82e0f0452a6ce8f387828ec71013015515035a" }, "trouble.nvim": { "branch": "main", "commit": "3dc00c0447c016cd43e03054c3d49436a1f2076d" }, "undotree": { "branch": "main", "commit": "eab459ab87dd249617b5f7187bb69e614a083047" }, + "vim-case-convert": { "branch": "master", "commit": "0a75eb4cf77976c1cdecaa6155c752b1f0c693d8" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" }, - "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" } + "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, + "which-key.nvim": { "branch": "main", "commit": "5bf7a73fe851896d5ac26d313db849bf00f45b78" } } diff --git a/.config/nvim/lua/plugins/gitlinker.lua b/.config/nvim/lua/plugins/gitlinker.lua new file mode 100644 index 0000000..9cb21db --- /dev/null +++ b/.config/nvim/lua/plugins/gitlinker.lua @@ -0,0 +1,32 @@ +return { + "ruifm/gitlinker.nvim", + lazy = false, + config = function() + require "gitlinker".setup({ + opts = { + remote = nil, -- force the use of a specific remote + -- adds current line nr in the url for normal mode + add_current_line_on_normal_mode = true, + -- callback for what to do with the url + action_callback = require "gitlinker.actions".copy_to_clipboard, + -- print the url after performing the action + print_url = true, + }, + callbacks = { + ["github.com"] = require "gitlinker.hosts".get_github_type_url, + ["gitlab.com"] = require "gitlinker.hosts".get_gitlab_type_url, + ["try.gitea.io"] = require "gitlinker.hosts".get_gitea_type_url, + ["codeberg.org"] = require "gitlinker.hosts".get_gitea_type_url, + ["bitbucket.org"] = require "gitlinker.hosts".get_bitbucket_type_url, + ["try.gogs.io"] = require "gitlinker.hosts".get_gogs_type_url, + ["git.sr.ht"] = require "gitlinker.hosts".get_srht_type_url, + ["git.launchpad.net"] = require "gitlinker.hosts".get_launchpad_type_url, + ["repo.or.cz"] = require "gitlinker.hosts".get_repoorcz_type_url, + ["git.kernel.org"] = require "gitlinker.hosts".get_cgit_type_url, + ["git.savannah.gnu.org"] = require "gitlinker.hosts".get_cgit_type_url + }, + -- default mapping to call url generation with action_callback + mappings = "oy" + }) + end +} diff --git a/.config/nvim/lua/plugins/gradlew.lua b/.config/nvim/lua/plugins/gradlew.lua new file mode 100644 index 0000000..77de623 --- /dev/null +++ b/.config/nvim/lua/plugins/gradlew.lua @@ -0,0 +1,16 @@ +return { + "oclay1st/gradle.nvim", + cmd = { "Gradle", "GradleExec", "GradleInit" }, + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + }, + opts = {}, -- options, see default configuration + keys = { { "G", "Gradle", desc = "Gradle" } }, + ft = { "java" }, + config = function() + require("gradle").setup({ + gradle_executable = "./gradlew", -- Example: gradle, ./gradlew or a path to Gradle executable + }) + end +} diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua index 574c003..0743e51 100644 --- a/.config/nvim/lua/plugins/harpoon.lua +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -3,21 +3,24 @@ return { lazy = false, branch = "harpoon2", dependencies = { "nvim-lua/plenary.nvim" }, - config = function () + config = function() local harpoon = require("harpoon") harpoon:setup() - vim.keymap.set("n", "a", function() harpoon:list():add() end) - vim.keymap.set("n", "x", function() harpoon:list():remove() end) - -- vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) - - -- vim.keymap.set("n", "", function() harpoon:list():select(1) end) - vim.keymap.set("n", "", function() harpoon:list():select(2) end) - vim.keymap.set("n", "", function() harpoon:list():select(3) end) - vim.keymap.set("n", "", function() harpoon:list():select(4) end) - - -- vim.keymap.set("n", "", function() harpoon:list():next() end) - -- vim.keymap.set("n", "", function() harpoon:list():prev() end) + vim.keymap.set("n", "a", function() harpoon:list():add() end, { noremap = true, silent = true }) + vim.keymap.set("n", "e", function() harpoon:list():remove() end, { noremap = true, silent = true }) + -- vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu() end, { noremap = true, silent = true }) + vim.keymap.set("n", "1", function() harpoon:list():select(1) end, { noremap = true, silent = true }) + vim.keymap.set("n", "2", function() harpoon:list():select(2) end, { noremap = true, silent = true }) + vim.keymap.set("n", "3", function() harpoon:list():select(3) end, { noremap = true, silent = true }) + vim.keymap.set("n", "4", function() harpoon:list():select(4) end, { noremap = true, silent = true }) + vim.keymap.set("n", "5", function() harpoon:list():select(5) end, { noremap = true, silent = true }) + vim.keymap.set("n", "6", function() harpoon:list():select(6) end, { noremap = true, silent = true }) + vim.keymap.set("n", "7", function() harpoon:list():select(7) end, { noremap = true, silent = true }) + vim.keymap.set("n", "8", function() harpoon:list():select(8) end, { noremap = true, silent = true }) + vim.keymap.set("n", "9", function() harpoon:list():select(9) end, { noremap = true, silent = true }) + vim.keymap.set("n", "", function() harpoon:list():next() end) + vim.keymap.set("n", "", function() harpoon:list():prev() end) end } diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index 879420b..8223abb 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -1,48 +1,48 @@ return { - -- 'nvim-lualine/lualine.nvim', - -- dependencies = { 'nvim-tree/nvim-web-devicons' }, - -- lazy = false, - -- config = function() - -- require('lualine').setup { - -- options = { - -- icons_enabled = true, - -- theme = 'auto', - -- component_separators = { left = '', right = '' }, - -- section_separators = { left = '', right = '' }, - -- disabled_filetypes = { - -- statusline = {}, - -- winbar = {}, - -- }, - -- ignore_focus = {}, - -- always_divide_middle = true, - -- always_show_tabline = true, - -- globalstatus = false, - -- refresh = { - -- statusline = 10, - -- tabline = 100, - -- winbar = 100, - -- } - -- }, - -- sections = { - -- lualine_a = { 'mode' }, - -- lualine_b = { 'branch', 'diff', 'diagnostics' }, - -- lualine_c = { 'filename' }, - -- lualine_x = { 'encoding', 'fileformat', 'filetype' }, - -- lualine_y = { 'progress' }, - -- lualine_z = { 'location' } - -- }, - -- inactive_sections = { - -- lualine_a = {}, - -- lualine_b = {}, - -- lualine_c = { 'filename' }, - -- lualine_x = { 'location' }, - -- lualine_y = {}, - -- lualine_z = {} - -- }, - -- tabline = {}, - -- winbar = {}, - -- inactive_winbar = {}, - -- extensions = {} - -- } - -- end + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + lazy = false, + config = function() + require('lualine').setup { + options = { + icons_enabled = true, + theme = 'ayu_light', + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = false, + refresh = { + statusline = 100, + tabline = 100, + winbar = 100, + } + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff', 'diagnostics' }, + lualine_c = { 'filename' }, + lualine_x = { 'fileformat', 'filetype' }, + lualine_y = { 'progress' }, + lualine_z = { 'location' } + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { 'filename' }, + lualine_x = { 'location' }, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} + } + end } diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index 7700188..210365a 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -16,6 +16,11 @@ return { config = function() require("mason-lspconfig").setup({ ensure_installed = { 'lua_ls', 'rust_analyzer' }, + defaults = { + rust_analyzer = { + cargo = { features = "*" } + }, + } }) end, keys = { @@ -60,4 +65,3 @@ return { }) end } - diff --git a/.config/nvim/lua/plugins/nvim-treesitter.lua b/.config/nvim/lua/plugins/nvim-treesitter.lua index f000e7a..1b87b97 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter.lua @@ -2,7 +2,7 @@ return { "nvim-treesitter/nvim-treesitter", event = { "BufReadPre", "BufNewFile" }, dependencies = { - "nvim-treesitter/nvim-treesitter-context", + -- "nvim-treesitter/nvim-treesitter-context", "nvim-treesitter/nvim-treesitter-textobjects", }, config = function() diff --git a/.config/nvim/lua/plugins/super-maven.lua b/.config/nvim/lua/plugins/super-maven.lua new file mode 100644 index 0000000..b698d3b --- /dev/null +++ b/.config/nvim/lua/plugins/super-maven.lua @@ -0,0 +1,13 @@ +return { + "supermaven-inc/supermaven-nvim", + lazy = false, + config = function() + require("supermaven-nvim").setup({ + keymaps = { + accept_suggestion = "", + clear_suggestion = "", + accept_word = "", + }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 4257f1b..81ed276 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -59,7 +59,7 @@ return { { "", "Telescope commands" }, { "", "Telescope lsp_document_symbols" }, { "f", "Telescope find_files hidden=true" }, - { "e", "Telescope find_files hidden=false" }, + -- { "e", "Telescope find_files hidden=false" }, { "w", "Telescope live_grep" }, { "r", function() local current_word = vim.fn.expand("") @@ -72,6 +72,6 @@ return { { "at", "Telescope find_files prompt_title=Specs cwd=spec/ hidden=true" }, { "af", "Telescope find_files prompt_title=Specs cwd=spec/factories hidden=true" }, { "av", "Telescope find_files prompt_title=Views cwd=app/views hidden=true" }, - { "l", "Telescope lsp_document_symbols" } + { "l", "Telescope lsp_document_symbols" } } } diff --git a/.config/nvim/lua/plugins/vim-case-convert.lua b/.config/nvim/lua/plugins/vim-case-convert.lua new file mode 100644 index 0000000..5335a6c --- /dev/null +++ b/.config/nvim/lua/plugins/vim-case-convert.lua @@ -0,0 +1,4 @@ +return { + "chiedo/vim-case-convert", + lazy = false, +} diff --git a/.config/nvim/lua/plugins/whichkey.lua b/.config/nvim/lua/plugins/whichkey.lua new file mode 100644 index 0000000..a43043c --- /dev/null +++ b/.config/nvim/lua/plugins/whichkey.lua @@ -0,0 +1,19 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + delay = 0 + }, + keys = { + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)", + }, + }, +} From 27e64fa1f61400dfa0ce0ea7a9cc2e0f4f025a8c Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 28 Feb 2025 12:09:35 +0100 Subject: [PATCH 248/280] Update telescope keymap --- .config/nvim/lua/plugins/telescope.lua | 28 ++++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 81ed276..fca8d00 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -56,22 +56,24 @@ return { { desc = "Open harpoon window" }) end, keys = { - { "", "Telescope commands" }, - { "", "Telescope lsp_document_symbols" }, - { "f", "Telescope find_files hidden=true" }, - -- { "e", "Telescope find_files hidden=false" }, - { "w", "Telescope live_grep" }, + { "", "Telescope find_files", desc = "Find files" }, + { "", "Telescope buffers", desc = "Find buffer" }, + { "C", "Telescope commands", desc = "Find commands" }, + { "", "Telescope lsp_document_symbols", desc = "Find symbols" }, + { "f", "Telescope find_files hidden=true", desc = "Find files" }, + -- { "e", "Telescope find_files hidden=false", desc = "Find all files" }, + { "w", "Telescope live_grep", desc = "Find substring" }, { "r", function() local current_word = vim.fn.expand("") require("telescope.builtin").grep_string({ search = current_word }) end }, - { "cc", "Telescope git_commits" }, - { "ac", "Telescope find_files prompt_title=Controllers cwd=app/controllers/ hidden=true" }, - { "ah", "Telescope find_files prompt_title=Controllers cwd=app/helpers/ hidden=true" }, - { "am", "Telescope find_files prompt_title=Models cwd=app/models/ hidden=true" }, - { "at", "Telescope find_files prompt_title=Specs cwd=spec/ hidden=true" }, - { "af", "Telescope find_files prompt_title=Specs cwd=spec/factories hidden=true" }, - { "av", "Telescope find_files prompt_title=Views cwd=app/views hidden=true" }, - { "l", "Telescope lsp_document_symbols" } + { "cc", "Telescope git_commits", desc = "Find git commits" }, + { "ac", "Telescope find_files prompt_title=Controllers cwd=app/controllers/ hidden=true", desc = "Find Rails controllers" }, + { "ah", "Telescope find_files prompt_title=Controllers cwd=app/helpers/ hidden=true", desc = "Find Rails helpers" }, + { "am", "Telescope find_files prompt_title=Models cwd=app/models/ hidden=true", desc = "Find Rails models" }, + { "at", "Telescope find_files prompt_title=Specs cwd=spec/ hidden=true", desc = "Find Rails specs" }, + { "af", "Telescope find_files prompt_title=Specs cwd=spec/factories hidden=true", desc = "Find Rails factories" }, + { "av", "Telescope find_files prompt_title=Views cwd=app/views hidden=true", desc = "Find Rails views" }, + { "l", "Telescope lsp_document_symbols", desc = "Find symbols" }, } } From ffab1ebfb6610f3671a436af577b6a215bfc0439 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 28 Feb 2025 12:10:13 +0100 Subject: [PATCH 249/280] Update general keymaps --- .config/nvim/lazy-lock.json | 87 +++++++++++---------- .config/nvim/lua/plugins/autosession.lua | 2 +- .config/nvim/lua/plugins/colorscheme.lua | 5 ++ .config/nvim/lua/plugins/diffview.lua | 2 +- .config/nvim/lua/plugins/grug.lua | 6 +- .config/nvim/lua/plugins/harpoon.lua | 37 ++++++--- .config/nvim/lua/plugins/lualine.lua | 2 +- .config/nvim/lua/plugins/maximize.lua | 2 +- .config/nvim/lua/plugins/neotest.lua | 10 +-- .config/nvim/lua/plugins/nvim-lspconfig.lua | 22 +++--- .config/nvim/lua/plugins/text-case.lua | 2 +- .config/nvim/lua/plugins/undotree.lua | 2 +- .config/nvim/lua/settings.lua | 30 +++---- 13 files changed, 115 insertions(+), 94 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 48a2bab..198c274 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,67 +1,70 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "CopilotChat.nvim": { "branch": "canary", "commit": "9333944fde3c65868818e245c73aa29eef826e9b" }, - "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, - "auto-session": { "branch": "main", "commit": "9d02776ed42874d37869dc683396234e3724b52d" }, + "CopilotChat.nvim": { "branch": "canary", "commit": "451d365928a994cda3505a84905303f790e28df8" }, + "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, + "auto-session": { "branch": "main", "commit": "9c3f977aafb56bd73ba0d082c4dcbdba5666faf3" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, - "bufexplorer": { "branch": "master", "commit": "fcf3a65a69020f0f54be8fa925f841874a5f3a01" }, + "bufexplorer": { "branch": "master", "commit": "93ad8af26ddf2a1c97b0566f9954a23320144663" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot.lua": { "branch": "master", "commit": "1a237cf50372830a61d92b0adf00d3b23882e0e1" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "copilot.lua": { "branch": "master", "commit": "30321e33b03cb924fdcd6a806a0dc6fa0b0eafb9" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, - "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, + "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, - "gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" }, + "gitsigns.nvim": { "branch": "main", "commit": "4c40357994f386e72be92a46f41fc1664c84c87d" }, "gradle.nvim": { "branch": "main", "commit": "aef2a780457bdc1a7a52d9b03c41aa2b0906bb64" }, - "grug-far.nvim": { "branch": "main", "commit": "75aad2698d428bdc94ff15f487f7165aee8ccbfb" }, - "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, - "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, - "lsp-zero.nvim": { "branch": "v4.x", "commit": "19a8b90340c6c522219c84f7befe784d657ab28e" }, + "grug-far.nvim": { "branch": "main", "commit": "309ecac6e6240d37c0be3c567d9f7cc95f63d255" }, + "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lsp-zero.nvim": { "branch": "v4.x", "commit": "baff1ca10ecad7efe04f02f06d2647dd2ae90074" }, + "lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" }, "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, - "mini.cursorword": { "branch": "main", "commit": "7d1b38a17834acbbc4feff8e42aedc4ed0c6ff06" }, - "mini.icons": { "branch": "main", "commit": "a2742459f0ee32806c2438ca06b4d8b331f3f4d4" }, - "mini.nvim": { "branch": "main", "commit": "2011aff270bcd3e1f3ad088253ace2d574967bed" }, - "neogit": { "branch": "master", "commit": "570c39181784f7a2e1bc9cedbfb11846022eea54" }, - "neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" }, - "neotest-java": { "branch": "main", "commit": "4fe7a53d659ae2fd4f1aa3a0084bf3afde554acc" }, - "neotest-minitest": { "branch": "main", "commit": "5623b9a7b2b27314e5c336b385315d2ab7d4ccba" }, - "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, + "mini.cursorword": { "branch": "main", "commit": "939ffcc8c57694608ac0896418d4b9a7c5273909" }, + "mini.icons": { "branch": "main", "commit": "ec61af6e606fc89ee3b1d8f2f20166a3ca917a36" }, + "mini.nvim": { "branch": "main", "commit": "3a354c754656538ad76d1add93ca21e75b7f3181" }, + "neogit": { "branch": "master", "commit": "12f78aaabb37b4946254dd5e47cf7b552904937a" }, + "neotest": { "branch": "master", "commit": "dddbe8fe358b05b2b7e54fe4faab50563171a76d" }, + "neotest-java": { "branch": "main", "commit": "bbbad04bda7af216a8c24509d47d1f51356b37ce" }, + "neotest-minitest": { "branch": "main", "commit": "7ff057de8ab2c27491ff27c7be9826b8f3bb5ec1" }, + "neotest-rspec": { "branch": "main", "commit": "f8c91edc5dd87ca467a624652f365ac217d7cc1c" }, "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, - "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, - "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-lspconfig": { "branch": "master", "commit": "04680101ff79e99b4e33a4386ec27cbd0d360c75" }, - "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "86c10df7ef77daf45a0e4a918934bb59083db1e1" }, - "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, + "nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" }, + "nvim-cmp": { "branch": "main", "commit": "5a11682453ac6b13dbf32cd403da4ee9c07ef1c3" }, + "nvim-lspconfig": { "branch": "master", "commit": "d793c5cb0206d976a38e70e62479a60ba87722ca" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-surround": { "branch": "main", "commit": "ae298105122c87bbe0a36b1ad20b06d417c0433e" }, + "nvim-treesitter": { "branch": "master", "commit": "99487eb34a397befce8182ff63347a21c5f4b881" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "cb718aab7fa66e43187674e875713097492a6618" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "b91c98afa6c42819aea6cbc1ba38272f5456a5cf" }, - "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "oil.nvim": { "branch": "feat/scratch-preview", "commit": "60fe23050f5b93550262f5c96ab00b5c51b60830" }, + "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, + "nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" }, + "oil.nvim": { "branch": "feat/scratch-preview", "commit": "15a17fdff4866394bdf1f7bf081b818ec3de44f5" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, - "plantuml-previewer.vim": { "branch": "master", "commit": "555347700382c97b347bace57b7a9f764ed556b1" }, + "plantuml-previewer.vim": { "branch": "master", "commit": "368a1f331c1ff29f6a3ee76facfca39a7f374b13" }, "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, - "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "render-markdown.nvim": { "branch": "main", "commit": "0022a579ac7355966be5ade77699b88c76b6a549" }, - "solarized.nvim": { "branch": "main", "commit": "f85f000c3e46714fee52cee3adf9f9661a048e40" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "render-markdown.nvim": { "branch": "main", "commit": "b57d51d760f5e4f520414dbeb6dee3ec1ae07a83" }, + "solarized.nvim": { "branch": "main", "commit": "c0dfe1cbfabd93b546baf5f1408f5df7e02e2050" }, "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "text-case.nvim": { "branch": "main", "commit": "e898cfd46fa6cde0e83abb624a16e67d2ffc6457" }, "tokyonight-vim": { "branch": "master", "commit": "4e82e0f0452a6ce8f387828ec71013015515035a" }, - "trouble.nvim": { "branch": "main", "commit": "3dc00c0447c016cd43e03054c3d49436a1f2076d" }, + "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, "undotree": { "branch": "main", "commit": "eab459ab87dd249617b5f7187bb69e614a083047" }, "vim-case-convert": { "branch": "master", "commit": "0a75eb4cf77976c1cdecaa6155c752b1f0c693d8" }, - "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, - "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, - "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" }, + "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }, + "vim-polar": { "branch": "master", "commit": "dc7723d0a8ee8b00a3d15ef19c6720403654c23b" }, + "vim-rails": { "branch": "master", "commit": "b0a5c76f86ea214ade36ab0b811e730c3f0add67" }, + "vim-tmux-navigator": { "branch": "master", "commit": "791dacfcfc8ccb7f6eb1c853050883b03e5a22fe" }, "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, - "which-key.nvim": { "branch": "main", "commit": "5bf7a73fe851896d5ac26d313db849bf00f45b78" } + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/.config/nvim/lua/plugins/autosession.lua b/.config/nvim/lua/plugins/autosession.lua index 978a221..668daac 100644 --- a/.config/nvim/lua/plugins/autosession.lua +++ b/.config/nvim/lua/plugins/autosession.lua @@ -6,6 +6,6 @@ return { }, opts = { }, keys = { - { "", "SessionDelete" } + { "", "SessionDelete", desc = "Delete session" }, } } diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index 8491eec..854f1e3 100644 --- a/.config/nvim/lua/plugins/colorscheme.lua +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -9,4 +9,9 @@ return { lazy = false, priority = 1000, }, + { + "habamax/vim-polar", + lazy = false, + priority = 1000, + } } diff --git a/.config/nvim/lua/plugins/diffview.lua b/.config/nvim/lua/plugins/diffview.lua index 9c3bcec..fbd54fa 100644 --- a/.config/nvim/lua/plugins/diffview.lua +++ b/.config/nvim/lua/plugins/diffview.lua @@ -4,6 +4,6 @@ return { "DiffviewOpen" }, keys = { - { "do", "DiffviewOpen" } + { "do", "DiffviewOpen", desc = "Open diffview" }, } } diff --git a/.config/nvim/lua/plugins/grug.lua b/.config/nvim/lua/plugins/grug.lua index 173b3c8..8bcea58 100644 --- a/.config/nvim/lua/plugins/grug.lua +++ b/.config/nvim/lua/plugins/grug.lua @@ -4,10 +4,12 @@ return { require('grug-far').setup({}); end, keys = { - { "sp",function() require("grug-far").open() end}, + { "",function() require("grug-far").open() end, desc = "Find and replace" }, + { "sp",function() require("grug-far").open() end, desc = "Find and replace" }, { "sw", function() require('grug-far').open({ prefills = { search = vim.fn.expand("") } }) - end + end, + desc = "Find and replace word under cursor" } } } diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua index 0743e51..648034c 100644 --- a/.config/nvim/lua/plugins/harpoon.lua +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -8,19 +8,30 @@ return { harpoon:setup() - vim.keymap.set("n", "a", function() harpoon:list():add() end, { noremap = true, silent = true }) - vim.keymap.set("n", "e", function() harpoon:list():remove() end, { noremap = true, silent = true }) + vim.keymap.set("n", "a", function() harpoon:list():add() end, + { noremap = true, silent = true, desc = "Add file to Harpoon" }) + vim.keymap.set("n", "e", function() harpoon:list():remove() end, + { noremap = true, silent = true, desc = "Remove file from Harpoon" }) -- vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu() end, { noremap = true, silent = true }) - vim.keymap.set("n", "1", function() harpoon:list():select(1) end, { noremap = true, silent = true }) - vim.keymap.set("n", "2", function() harpoon:list():select(2) end, { noremap = true, silent = true }) - vim.keymap.set("n", "3", function() harpoon:list():select(3) end, { noremap = true, silent = true }) - vim.keymap.set("n", "4", function() harpoon:list():select(4) end, { noremap = true, silent = true }) - vim.keymap.set("n", "5", function() harpoon:list():select(5) end, { noremap = true, silent = true }) - vim.keymap.set("n", "6", function() harpoon:list():select(6) end, { noremap = true, silent = true }) - vim.keymap.set("n", "7", function() harpoon:list():select(7) end, { noremap = true, silent = true }) - vim.keymap.set("n", "8", function() harpoon:list():select(8) end, { noremap = true, silent = true }) - vim.keymap.set("n", "9", function() harpoon:list():select(9) end, { noremap = true, silent = true }) - vim.keymap.set("n", "", function() harpoon:list():next() end) - vim.keymap.set("n", "", function() harpoon:list():prev() end) + vim.keymap.set("n", "1", function() harpoon:list():select(1) end, + { noremap = true, silent = true, desc = "Select Harpoon file 1" }) + vim.keymap.set("n", "2", function() harpoon:list():select(2) end, + { noremap = true, silent = true, desc = "Select Harpoon file 2" }) + vim.keymap.set("n", "3", function() harpoon:list():select(3) end, + { noremap = true, silent = true, desc = "Select Harpoon file 3" }) + vim.keymap.set("n", "4", function() harpoon:list():select(4) end, + { noremap = true, silent = true, desc = "Select Harpoon file 4" }) + vim.keymap.set("n", "5", function() harpoon:list():select(5) end, + { noremap = true, silent = true, desc = "Select Harpoon file 5" }) + vim.keymap.set("n", "6", function() harpoon:list():select(6) end, + { noremap = true, silent = true, desc = "Select Harpoon file 6" }) + vim.keymap.set("n", "7", function() harpoon:list():select(7) end, + { noremap = true, silent = true, desc = "Select Harpoon file 7" }) + vim.keymap.set("n", "8", function() harpoon:list():select(8) end, + { noremap = true, silent = true, desc = "Select Harpoon file 8" }) + vim.keymap.set("n", "9", function() harpoon:list():select(9) end, + { noremap = true, silent = true, desc = "Select Harpoon file 9" }) + vim.keymap.set("n", "", function() harpoon:list():next() end, { desc = "Next Harpoon file" }) + vim.keymap.set("n", "", function() harpoon:list():prev() end, { desc = "Previous Harpoon file" }) end } diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index 8223abb..c6eb698 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -6,7 +6,7 @@ return { require('lualine').setup { options = { icons_enabled = true, - theme = 'ayu_light', + -- theme = 'ayu_light', component_separators = { left = '', right = '' }, section_separators = { left = '', right = '' }, disabled_filetypes = { diff --git a/.config/nvim/lua/plugins/maximize.lua b/.config/nvim/lua/plugins/maximize.lua index f0e8aec..6b29f01 100644 --- a/.config/nvim/lua/plugins/maximize.lua +++ b/.config/nvim/lua/plugins/maximize.lua @@ -5,6 +5,6 @@ return { 'Maximize' }, keys = { - { "z", "Maximize" } + { "z", "Maximize", desc = "Maximize" } } } diff --git a/.config/nvim/lua/plugins/neotest.lua b/.config/nvim/lua/plugins/neotest.lua index 5b2d3c4..d474ca2 100644 --- a/.config/nvim/lua/plugins/neotest.lua +++ b/.config/nvim/lua/plugins/neotest.lua @@ -21,10 +21,10 @@ return { }) end, keys = { - { "tt", "Neotest run file" }, - { "tr", "Neotest run" }, - { "to", "Neotest output" }, - { "tO", "Neotest output-panel" }, - { "ts", "Neotest stop" }, + { "tt", "Neotest run file", desc = "Test file" }, + { "tr", "Neotest run", desc = "Run closest test" }, + { "to", "Neotest output", desc = "Test output" }, + { "tO", "Neotest output-panel", desc = "Test output panel" }, + { "ts", "Neotest stop", desc = "Stop test" }, } } diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index 210365a..49ac891 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -24,8 +24,8 @@ return { }) end, keys = { - { "li", "LspInfo" }, - { "ll", "LspLog" }, + { "li", "LspInfo", desc = "Lsp info" }, + { "ll", "LspLog", desc = "Lsp log" }, } } }, @@ -49,16 +49,16 @@ return { desc = 'LSP actions', callback = function(event) local opts = { buffer = event.buf } - vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) - vim.keymap.set('n', 'go', vim.lsp.buf.type_definition, opts) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) - vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, opts) - vim.keymap.set('n', 'cn', vim.lsp.buf.rename, opts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, { desc = "Show hover information" }) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { desc = "Go to definition" }) + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, { desc = "Go to declaration" }) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, { desc = "Go to implementation" }) + vim.keymap.set('n', 'go', vim.lsp.buf.type_definition, { desc = "Go to type definition" }) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, { desc = "Show references" }) + vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, { desc = "Show signature help" }) + vim.keymap.set('n', 'cn', vim.lsp.buf.rename, { desc = "Rename symbol" }) vim.keymap.set({ 'n', 'x' }, 'F', function() - vim.lsp.buf.format({ async = true }) + vim.lsp.buf.format({ async = true }) -- TODO: add desc end, opts) vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, opts) end, diff --git a/.config/nvim/lua/plugins/text-case.lua b/.config/nvim/lua/plugins/text-case.lua index 952796d..9512abc 100644 --- a/.config/nvim/lua/plugins/text-case.lua +++ b/.config/nvim/lua/plugins/text-case.lua @@ -6,7 +6,7 @@ return { require("telescope").load_extension("textcase") end, keys = { - { "co", "TextCaseOpenTelescope", mode = { "n", "x" }, desc = "Telescope" }, + { "co", "TextCaseOpenTelescope", mode = { "n", "x" }, desc = "Open TextCase Telescope" }, }, cmd = { "Subs", diff --git a/.config/nvim/lua/plugins/undotree.lua b/.config/nvim/lua/plugins/undotree.lua index 92e400a..054e87f 100644 --- a/.config/nvim/lua/plugins/undotree.lua +++ b/.config/nvim/lua/plugins/undotree.lua @@ -2,7 +2,7 @@ return { "jiaoshijie/undotree", dependencies = "nvim-lua/plenary.nvim", keys = { -- load the plugin only when using it's keybinding: - { "u", "lua require('undotree').toggle()" }, + { "u", "lua require('undotree').toggle()", desc = "Undotree" }, }, config = function() local undotree = require('undotree') diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index 6da375e..c1899a8 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -33,27 +33,27 @@ vim.keymap.set("n", "", ":vert terminal", { noremap = true }) vim.keymap.set("t", "", "", { noremap = true }) -- move -vim.api.nvim_set_keymap('x', '', ':move \'>+gv=gv', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', ':move -2==', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', ':move +==', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('x', '', ':move -2gv=gv', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('x', '', ':move \'>+gv=gv', { noremap = true, silent = true, desc = "Move line down" }) +vim.api.nvim_set_keymap('n', '', ':move -2==', { noremap = true, silent = true, desc = "Move line up" }) +vim.api.nvim_set_keymap('n', '', ':move +==', { noremap = true, silent = true, desc = "Move line down" }) +vim.api.nvim_set_keymap('x', '', ':move -2gv=gv', { noremap = true, silent = true, desc = "Move line up" }) -- saving / quitting -vim.keymap.set("n", "Q", ":quit") -vim.keymap.set("n", "Q", ":q!") -vim.keymap.set("n", "W", ":wq") -vim.keymap.set("n", "q", ":quitall") -vim.keymap.set("n", "s", ":w") +vim.keymap.set("n", "Q", ":quit", { desc = "Quit" }) +vim.keymap.set("n", "Q", ":q!", { desc = "Quit without saving" }) +vim.keymap.set("n", "W", ":wq", { desc = "Save and quit" }) +vim.keymap.set("n", "q", ":quitall", { desc = "Quit all" }) +vim.keymap.set("n", "s", ":w", { desc = "Save" }) -- formatting -vim.keymap.set("n", "g=", "ggVG=") -vim.keymap.set("n", "zt", "%s/\t/ /g") -vim.keymap.set("n", "vag", "ggVG") -vim.keymap.set("n", "dag", "ggVGd") -vim.keymap.set("n", "yag", "ggVGy") -vim.keymap.set("n", "cag", "ggVGc") +vim.keymap.set("n", "g=", "ggVG=", { desc = "Fix indentation in file" }) +vim.keymap.set("n", "zt", "%s/\t/ /g", { desc = "Replace tabs with spaces" }) +vim.keymap.set("n", "vag", "ggVG", { desc = "Visual select file contents" }) +vim.keymap.set("n", "dag", "ggVGd", { desc = "Delete file contents" }) +vim.keymap.set("n", "yag", "ggVGy", { desc = "Format paragraph" }) +vim.keymap.set("n", "cag", "ggVGc", { desc = "Format paragraph" }) vim.keymap.set("n", "gJ", "Jx") -- macro From 811a46cfcd9213d26f48d33cef81729d94334860 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 28 Feb 2025 12:12:29 +0100 Subject: [PATCH 250/280] Reformat code --- .config/nvim/lua/plugins/autopairs.lua | 6 +- .config/nvim/lua/plugins/autosession.lua | 18 +- .config/nvim/lua/plugins/boole.lua | 38 ++-- .config/nvim/lua/plugins/bufexplorer.lua | 8 +- .config/nvim/lua/plugins/colorscheme.lua | 10 +- .config/nvim/lua/plugins/comment.lua | 7 +- .config/nvim/lua/plugins/copilot.lua | 10 +- .config/nvim/lua/plugins/copilotchat.lua | 190 +++++++++--------- .config/nvim/lua/plugins/diffview.lua | 14 +- .config/nvim/lua/plugins/flash.lua | 17 +- .config/nvim/lua/plugins/gitlinker.lua | 60 +++--- .config/nvim/lua/plugins/gitsigns.lua | 116 ++++++++--- .config/nvim/lua/plugins/gradlew.lua | 28 +-- .config/nvim/lua/plugins/grug.lua | 42 ++-- .config/nvim/lua/plugins/harpoon.lua | 81 +++++--- .config/nvim/lua/plugins/lualine.lua | 92 ++++----- .config/nvim/lua/plugins/markdown.lua | 30 +-- .config/nvim/lua/plugins/maximize.lua | 16 +- .config/nvim/lua/plugins/mini-cursorword.lua | 16 +- .config/nvim/lua/plugins/neogit.lua | 30 +-- .config/nvim/lua/plugins/neotest.lua | 56 +++--- .config/nvim/lua/plugins/nvim-cmp.lua | 178 ++++++++-------- .config/nvim/lua/plugins/nvim-lspconfig.lua | 124 ++++++------ .config/nvim/lua/plugins/nvim-surround.lua | 12 +- .../lua/plugins/nvim-treesitter-endwise.lua | 18 +- .../plugins/nvim-treesitter-textobjects.lua | 113 ++++++----- .config/nvim/lua/plugins/nvim-treesitter.lua | 54 +++-- .config/nvim/lua/plugins/nvim-ts-autotag.lua | 42 ++-- .config/nvim/lua/plugins/oil.lua | 12 +- .config/nvim/lua/plugins/plantuml.lua | 13 +- .config/nvim/lua/plugins/super-maven.lua | 22 +- .config/nvim/lua/plugins/telescope.lua | 176 +++++++++------- .config/nvim/lua/plugins/text-case.lua | 34 ++-- .config/nvim/lua/plugins/trouble.lua | 70 +++---- .config/nvim/lua/plugins/undotree.lua | 54 ++--- .config/nvim/lua/plugins/vim-case-convert.lua | 4 +- .config/nvim/lua/plugins/vim-fugitive.lua | 22 +- .config/nvim/lua/plugins/vim-rails.lua | 2 +- .../nvim/lua/plugins/vim-tmux-navigator.lua | 4 +- .config/nvim/lua/plugins/visual-multi.lua | 4 +- .config/nvim/lua/plugins/whichkey.lua | 34 ++-- .config/nvim/lua/settings.lua | 34 ++-- 42 files changed, 1022 insertions(+), 889 deletions(-) diff --git a/.config/nvim/lua/plugins/autopairs.lua b/.config/nvim/lua/plugins/autopairs.lua index 5698563..6378d47 100644 --- a/.config/nvim/lua/plugins/autopairs.lua +++ b/.config/nvim/lua/plugins/autopairs.lua @@ -1,5 +1,5 @@ return { - 'windwp/nvim-autopairs', - event = "InsertEnter", - config = true + "windwp/nvim-autopairs", + event = "InsertEnter", + config = true, } diff --git a/.config/nvim/lua/plugins/autosession.lua b/.config/nvim/lua/plugins/autosession.lua index 668daac..7f6fe80 100644 --- a/.config/nvim/lua/plugins/autosession.lua +++ b/.config/nvim/lua/plugins/autosession.lua @@ -1,11 +1,11 @@ return { - "rmagatti/auto-session", - lazy = false, - dependencies = { - "nvim-telescope/telescope.nvim", - }, - opts = { }, - keys = { - { "", "SessionDelete", desc = "Delete session" }, - } + "rmagatti/auto-session", + lazy = false, + dependencies = { + "nvim-telescope/telescope.nvim", + }, + opts = {}, + keys = { + { "", "SessionDelete", desc = "Delete session" }, + }, } diff --git a/.config/nvim/lua/plugins/boole.lua b/.config/nvim/lua/plugins/boole.lua index c712bbe..7d37e72 100644 --- a/.config/nvim/lua/plugins/boole.lua +++ b/.config/nvim/lua/plugins/boole.lua @@ -1,21 +1,21 @@ return { - "nat-418/boole.nvim", - event = { "BufReadPre", "BufNewFile" }, - config = function() - require('boole').setup({ - mappings = { - increment = '', - decrement = '' - }, - additions = { - {'Foo', 'Bar', 'Baz', 'Qux', 'Quux'}, - {'light', 'dark'}, - {'if', 'unless'}, - {'true', 'false'}, - {'&&', '||'}, - {'private', 'public', 'protected'}, - {'const', 'let'}, - }, - }) - end + "nat-418/boole.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("boole").setup({ + mappings = { + increment = "", + decrement = "", + }, + additions = { + { "Foo", "Bar", "Baz", "Qux", "Quux" }, + { "light", "dark" }, + { "if", "unless" }, + { "true", "false" }, + { "&&", "||" }, + { "private", "public", "protected" }, + { "const", "let" }, + }, + }) + end, } diff --git a/.config/nvim/lua/plugins/bufexplorer.lua b/.config/nvim/lua/plugins/bufexplorer.lua index 9154115..9653a92 100644 --- a/.config/nvim/lua/plugins/bufexplorer.lua +++ b/.config/nvim/lua/plugins/bufexplorer.lua @@ -1,4 +1,4 @@ - return { - "jlanzarotta/bufexplorer", - lazy = false, - } +return { + "jlanzarotta/bufexplorer", + lazy = false, +} diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index 854f1e3..24b87d1 100644 --- a/.config/nvim/lua/plugins/colorscheme.lua +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -9,9 +9,9 @@ return { lazy = false, priority = 1000, }, - { - "habamax/vim-polar", - lazy = false, - priority = 1000, - } + { + "habamax/vim-polar", + lazy = false, + priority = 1000, + }, } diff --git a/.config/nvim/lua/plugins/comment.lua b/.config/nvim/lua/plugins/comment.lua index b6807ff..ef7af71 100644 --- a/.config/nvim/lua/plugins/comment.lua +++ b/.config/nvim/lua/plugins/comment.lua @@ -1,6 +1,5 @@ return { - "numToStr/Comment.nvim", - lazy = false, - opts = { } + "numToStr/Comment.nvim", + lazy = false, + opts = {}, } - diff --git a/.config/nvim/lua/plugins/copilot.lua b/.config/nvim/lua/plugins/copilot.lua index 14e55eb..5c8d139 100644 --- a/.config/nvim/lua/plugins/copilot.lua +++ b/.config/nvim/lua/plugins/copilot.lua @@ -1,7 +1,7 @@ return { - -- "github/copilot.vim", - -- event = "BufRead", - -- commands = { - -- "Copilot" - -- } + -- "github/copilot.vim", + -- event = "BufRead", + -- commands = { + -- "Copilot" + -- } } diff --git a/.config/nvim/lua/plugins/copilotchat.lua b/.config/nvim/lua/plugins/copilotchat.lua index 6ca2f23..bfb77d5 100644 --- a/.config/nvim/lua/plugins/copilotchat.lua +++ b/.config/nvim/lua/plugins/copilotchat.lua @@ -1,97 +1,97 @@ return { - "CopilotC-Nvim/CopilotChat.nvim", - dependencies = { - { "zbirenbaum/copilot.lua" }, - { "nvim-lua/plenary.nvim" }, - }, - commands = { - "CopilotChat", - "CopilotChatOpen", - "CopilotChatClose", - "CopilotChatToggle", - "CopilotChatStop", - "CopilotChatReset", - "CopilotChatSave", - "CopilotChatLoad", - "CopilotChatDebugInfo", - "CopilotChatModels", - "CopilotChatExplain", - "CopilotChatReview", - "CopilotChatFix", - "CopilotChatOptimize", - "CopilotChatDocs", - "CopilotChatTests", - "CopilotChatFixDiagnostic", - "CopilotChatCommit", - "CopilotChatCommitStaged", - }, - opts = { - temperature = 0.3, - auto_insert_mode = true, - system_prompt = "You are a AI (femboy) assistant for developers. Make sure that you reply the same way a cute femboy would do. UwU. Don't forget that you are an expert in the field and attempt to repond in a concise way.", - mappings = { - reset = { - normal = "", - insert = "", - }, - complete = { - detail = "Use @ or / for options.", - insert = "", - }, - submit_prompt = { - normal = "", - insert = "", - }, - accept_diff = { - normal = "", - insert = "", - }, - yank_diff = { - normal = "gy", - }, - show_diff = { - normal = "gd", - }, - show_system_prompt = { - normal = "gp", - }, - show_user_selection = { - normal = "gs", - }, - }, - }, - keys = { - { - "p", - "CopilotChat", - desc = "CopilotChat - Quick chat", - }, - { - "ccq", - function() - local input = vim.fn.input("Quick Chat: ") - if input ~= "" then - require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) - end - end, - desc = "CopilotChat - Quick chat", - }, - { - "cch", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.help_actions()) - end, - desc = "CopilotChat - Help actions", - }, - -- Show prompts actions with telescope - { - "ccp", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) - end, - desc = "CopilotChat - Prompt actions", - }, - }, + "CopilotC-Nvim/CopilotChat.nvim", + dependencies = { + { "zbirenbaum/copilot.lua" }, + { "nvim-lua/plenary.nvim" }, + }, + commands = { + "CopilotChat", + "CopilotChatOpen", + "CopilotChatClose", + "CopilotChatToggle", + "CopilotChatStop", + "CopilotChatReset", + "CopilotChatSave", + "CopilotChatLoad", + "CopilotChatDebugInfo", + "CopilotChatModels", + "CopilotChatExplain", + "CopilotChatReview", + "CopilotChatFix", + "CopilotChatOptimize", + "CopilotChatDocs", + "CopilotChatTests", + "CopilotChatFixDiagnostic", + "CopilotChatCommit", + "CopilotChatCommitStaged", + }, + opts = { + temperature = 0.3, + auto_insert_mode = true, + system_prompt = "You are a AI (femboy) assistant for developers. Make sure that you reply the same way a cute femboy would do. UwU. Don't forget that you are an expert in the field and attempt to repond in a concise way.", + mappings = { + reset = { + normal = "", + insert = "", + }, + complete = { + detail = "Use @ or / for options.", + insert = "", + }, + submit_prompt = { + normal = "", + insert = "", + }, + accept_diff = { + normal = "", + insert = "", + }, + yank_diff = { + normal = "gy", + }, + show_diff = { + normal = "gd", + }, + show_system_prompt = { + normal = "gp", + }, + show_user_selection = { + normal = "gs", + }, + }, + }, + keys = { + { + "p", + "CopilotChat", + desc = "CopilotChat - Quick chat", + }, + { + "ccq", + function() + local input = vim.fn.input("Quick Chat: ") + if input ~= "" then + require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) + end + end, + desc = "CopilotChat - Quick chat", + }, + { + "cch", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.help_actions()) + end, + desc = "CopilotChat - Help actions", + }, + -- Show prompts actions with telescope + { + "ccp", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) + end, + desc = "CopilotChat - Prompt actions", + }, + }, } diff --git a/.config/nvim/lua/plugins/diffview.lua b/.config/nvim/lua/plugins/diffview.lua index fbd54fa..b74a05a 100644 --- a/.config/nvim/lua/plugins/diffview.lua +++ b/.config/nvim/lua/plugins/diffview.lua @@ -1,9 +1,9 @@ return { - "sindrets/diffview.nvim", - cmd = { - "DiffviewOpen" - }, - keys = { - { "do", "DiffviewOpen", desc = "Open diffview" }, - } + "sindrets/diffview.nvim", + cmd = { + "DiffviewOpen", + }, + keys = { + { "do", "DiffviewOpen", desc = "Open diffview" }, + }, } diff --git a/.config/nvim/lua/plugins/flash.lua b/.config/nvim/lua/plugins/flash.lua index bc49495..e7b2f08 100644 --- a/.config/nvim/lua/plugins/flash.lua +++ b/.config/nvim/lua/plugins/flash.lua @@ -1,7 +1,14 @@ return { - "folke/flash.nvim", - event = "VeryLazy", - keys = { - { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, - }, + "folke/flash.nvim", + event = "VeryLazy", + keys = { + { + "s", + mode = { "n", "x", "o" }, + function() + require("flash").jump() + end, + desc = "Flash", + }, + }, } diff --git a/.config/nvim/lua/plugins/gitlinker.lua b/.config/nvim/lua/plugins/gitlinker.lua index 9cb21db..98b5c09 100644 --- a/.config/nvim/lua/plugins/gitlinker.lua +++ b/.config/nvim/lua/plugins/gitlinker.lua @@ -1,32 +1,32 @@ return { - "ruifm/gitlinker.nvim", - lazy = false, - config = function() - require "gitlinker".setup({ - opts = { - remote = nil, -- force the use of a specific remote - -- adds current line nr in the url for normal mode - add_current_line_on_normal_mode = true, - -- callback for what to do with the url - action_callback = require "gitlinker.actions".copy_to_clipboard, - -- print the url after performing the action - print_url = true, - }, - callbacks = { - ["github.com"] = require "gitlinker.hosts".get_github_type_url, - ["gitlab.com"] = require "gitlinker.hosts".get_gitlab_type_url, - ["try.gitea.io"] = require "gitlinker.hosts".get_gitea_type_url, - ["codeberg.org"] = require "gitlinker.hosts".get_gitea_type_url, - ["bitbucket.org"] = require "gitlinker.hosts".get_bitbucket_type_url, - ["try.gogs.io"] = require "gitlinker.hosts".get_gogs_type_url, - ["git.sr.ht"] = require "gitlinker.hosts".get_srht_type_url, - ["git.launchpad.net"] = require "gitlinker.hosts".get_launchpad_type_url, - ["repo.or.cz"] = require "gitlinker.hosts".get_repoorcz_type_url, - ["git.kernel.org"] = require "gitlinker.hosts".get_cgit_type_url, - ["git.savannah.gnu.org"] = require "gitlinker.hosts".get_cgit_type_url - }, - -- default mapping to call url generation with action_callback - mappings = "oy" - }) - end + "ruifm/gitlinker.nvim", + lazy = false, + config = function() + require("gitlinker").setup({ + opts = { + remote = nil, -- force the use of a specific remote + -- adds current line nr in the url for normal mode + add_current_line_on_normal_mode = true, + -- callback for what to do with the url + action_callback = require("gitlinker.actions").copy_to_clipboard, + -- print the url after performing the action + print_url = true, + }, + callbacks = { + ["github.com"] = require("gitlinker.hosts").get_github_type_url, + ["gitlab.com"] = require("gitlinker.hosts").get_gitlab_type_url, + ["try.gitea.io"] = require("gitlinker.hosts").get_gitea_type_url, + ["codeberg.org"] = require("gitlinker.hosts").get_gitea_type_url, + ["bitbucket.org"] = require("gitlinker.hosts").get_bitbucket_type_url, + ["try.gogs.io"] = require("gitlinker.hosts").get_gogs_type_url, + ["git.sr.ht"] = require("gitlinker.hosts").get_srht_type_url, + ["git.launchpad.net"] = require("gitlinker.hosts").get_launchpad_type_url, + ["repo.or.cz"] = require("gitlinker.hosts").get_repoorcz_type_url, + ["git.kernel.org"] = require("gitlinker.hosts").get_cgit_type_url, + ["git.savannah.gnu.org"] = require("gitlinker.hosts").get_cgit_type_url, + }, + -- default mapping to call url generation with action_callback + mappings = "oy", + }) + end, } diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua index 18e1c3e..66d452d 100644 --- a/.config/nvim/lua/plugins/gitsigns.lua +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -1,37 +1,87 @@ return { - "lewis6991/gitsigns.nvim", - lazy = false, - config = function() - require("gitsigns").setup({ - numhl = true, - attach_to_untracked = true, - update_debounce = 5, - on_attach = function(bufnr) - local gitsigns = require("gitsigns") - end, - }) - end, - keys = { - -- Navigation - { "]c", function() if vim.wo.diff then vim.cmd("normal! ]c") else require("gitsigns").next_hunk() end end, mode = "n", desc = "Next Git hunk" }, - { "[c", function() if vim.wo.diff then vim.cmd("normal! [c") else require("gitsigns").prev_hunk() end end, mode = "n", desc = "Previous Git hunk" }, + "lewis6991/gitsigns.nvim", + lazy = false, + config = function() + require("gitsigns").setup({ + numhl = true, + attach_to_untracked = true, + update_debounce = 5, + on_attach = function(bufnr) + local gitsigns = require("gitsigns") + end, + }) + end, + keys = { + -- Navigation + { + "]c", + function() + if vim.wo.diff then + vim.cmd("normal! ]c") + else + require("gitsigns").next_hunk() + end + end, + mode = "n", + desc = "Next Git hunk", + }, + { + "[c", + function() + if vim.wo.diff then + vim.cmd("normal! [c") + else + require("gitsigns").prev_hunk() + end + end, + mode = "n", + desc = "Previous Git hunk", + }, - -- Actions - { "hs", ":Gitsigns stage_hunk", mode = "n", desc = "Stage Hunk" }, - { "hr", ":Gitsigns reset_hunk", mode = "n", desc = "Reset Hunk" }, - { "hs", function() require("gitsigns").stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end, mode = "v", desc = "Stage Hunk" }, - { "hr", function() require("gitsigns").reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) end, mode = "v", desc = "Reset Hunk" }, - { "hS", ":Gitsigns stage_buffer", mode = "n", desc = "Stage Buffer" }, - { "hu", ":Gitsigns undo_stage_hunk", mode = "n", desc = "Undo Stage Hunk" }, - { "hR", ":Gitsigns reset_buffer", mode = "n", desc = "Reset Buffer" }, - { "hp", ":Gitsigns preview_hunk", mode = "n", desc = "Preview Hunk" }, - { "hb", function() require("gitsigns").blame_line({ full = true }) end, mode = "n", desc = "Blame Line" }, - { "tb", ":Gitsigns toggle_current_line_blame", mode = "n", desc = "Toggle Blame" }, - { "hd", ":Gitsigns diffthis", mode = "n", desc = "Diff This" }, - { "hD", function() require("gitsigns").diffthis("~") end, mode = "n", desc = "Diff This ~" }, - { "td", ":Gitsigns toggle_deleted", mode = "n", desc = "Toggle Deleted" }, + -- Actions + { "hs", ":Gitsigns stage_hunk", mode = "n", desc = "Stage Hunk" }, + { "hr", ":Gitsigns reset_hunk", mode = "n", desc = "Reset Hunk" }, + { + "hs", + function() + require("gitsigns").stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) + end, + mode = "v", + desc = "Stage Hunk", + }, + { + "hr", + function() + require("gitsigns").reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) + end, + mode = "v", + desc = "Reset Hunk", + }, + { "hS", ":Gitsigns stage_buffer", mode = "n", desc = "Stage Buffer" }, + { "hu", ":Gitsigns undo_stage_hunk", mode = "n", desc = "Undo Stage Hunk" }, + { "hR", ":Gitsigns reset_buffer", mode = "n", desc = "Reset Buffer" }, + { "hp", ":Gitsigns preview_hunk", mode = "n", desc = "Preview Hunk" }, + { + "hb", + function() + require("gitsigns").blame_line({ full = true }) + end, + mode = "n", + desc = "Blame Line", + }, + { "tb", ":Gitsigns toggle_current_line_blame", mode = "n", desc = "Toggle Blame" }, + { "hd", ":Gitsigns diffthis", mode = "n", desc = "Diff This" }, + { + "hD", + function() + require("gitsigns").diffthis("~") + end, + mode = "n", + desc = "Diff This ~", + }, + { "td", ":Gitsigns toggle_deleted", mode = "n", desc = "Toggle Deleted" }, - -- Text object - { "ih", ":Gitsigns select_hunk", mode = { "o", "x" }, desc = "Select Hunk" }, - }, + -- Text object + { "ih", ":Gitsigns select_hunk", mode = { "o", "x" }, desc = "Select Hunk" }, + }, } diff --git a/.config/nvim/lua/plugins/gradlew.lua b/.config/nvim/lua/plugins/gradlew.lua index 77de623..bdc3630 100644 --- a/.config/nvim/lua/plugins/gradlew.lua +++ b/.config/nvim/lua/plugins/gradlew.lua @@ -1,16 +1,16 @@ return { - "oclay1st/gradle.nvim", - cmd = { "Gradle", "GradleExec", "GradleInit" }, - dependencies = { - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - }, - opts = {}, -- options, see default configuration - keys = { { "G", "Gradle", desc = "Gradle" } }, - ft = { "java" }, - config = function() - require("gradle").setup({ - gradle_executable = "./gradlew", -- Example: gradle, ./gradlew or a path to Gradle executable - }) - end + "oclay1st/gradle.nvim", + cmd = { "Gradle", "GradleExec", "GradleInit" }, + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + }, + opts = {}, -- options, see default configuration + keys = { { "G", "Gradle", desc = "Gradle" } }, + ft = { "java" }, + config = function() + require("gradle").setup({ + gradle_executable = "./gradlew", -- Example: gradle, ./gradlew or a path to Gradle executable + }) + end, } diff --git a/.config/nvim/lua/plugins/grug.lua b/.config/nvim/lua/plugins/grug.lua index 8bcea58..e90295d 100644 --- a/.config/nvim/lua/plugins/grug.lua +++ b/.config/nvim/lua/plugins/grug.lua @@ -1,15 +1,29 @@ -return { - 'MagicDuck/grug-far.nvim', - config = function() - require('grug-far').setup({}); - end, - keys = { - { "",function() require("grug-far").open() end, desc = "Find and replace" }, - { "sp",function() require("grug-far").open() end, desc = "Find and replace" }, - { "sw", function() - require('grug-far').open({ prefills = { search = vim.fn.expand("") } }) - end, - desc = "Find and replace word under cursor" - } -} +return { + "MagicDuck/grug-far.nvim", + config = function() + require("grug-far").setup({}) + end, + keys = { + { + "", + function() + require("grug-far").open() + end, + desc = "Find and replace", + }, + { + "sp", + function() + require("grug-far").open() + end, + desc = "Find and replace", + }, + { + "sw", + function() + require("grug-far").open({ prefills = { search = vim.fn.expand("") } }) + end, + desc = "Find and replace word under cursor", + }, + }, } diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua index 648034c..e0395a2 100644 --- a/.config/nvim/lua/plugins/harpoon.lua +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -1,37 +1,52 @@ return { - "ThePrimeagen/harpoon", - lazy = false, - branch = "harpoon2", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - local harpoon = require("harpoon") + "ThePrimeagen/harpoon", + lazy = false, + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local harpoon = require("harpoon") - harpoon:setup() + harpoon:setup() - vim.keymap.set("n", "a", function() harpoon:list():add() end, - { noremap = true, silent = true, desc = "Add file to Harpoon" }) - vim.keymap.set("n", "e", function() harpoon:list():remove() end, - { noremap = true, silent = true, desc = "Remove file from Harpoon" }) - -- vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu() end, { noremap = true, silent = true }) - vim.keymap.set("n", "1", function() harpoon:list():select(1) end, - { noremap = true, silent = true, desc = "Select Harpoon file 1" }) - vim.keymap.set("n", "2", function() harpoon:list():select(2) end, - { noremap = true, silent = true, desc = "Select Harpoon file 2" }) - vim.keymap.set("n", "3", function() harpoon:list():select(3) end, - { noremap = true, silent = true, desc = "Select Harpoon file 3" }) - vim.keymap.set("n", "4", function() harpoon:list():select(4) end, - { noremap = true, silent = true, desc = "Select Harpoon file 4" }) - vim.keymap.set("n", "5", function() harpoon:list():select(5) end, - { noremap = true, silent = true, desc = "Select Harpoon file 5" }) - vim.keymap.set("n", "6", function() harpoon:list():select(6) end, - { noremap = true, silent = true, desc = "Select Harpoon file 6" }) - vim.keymap.set("n", "7", function() harpoon:list():select(7) end, - { noremap = true, silent = true, desc = "Select Harpoon file 7" }) - vim.keymap.set("n", "8", function() harpoon:list():select(8) end, - { noremap = true, silent = true, desc = "Select Harpoon file 8" }) - vim.keymap.set("n", "9", function() harpoon:list():select(9) end, - { noremap = true, silent = true, desc = "Select Harpoon file 9" }) - vim.keymap.set("n", "", function() harpoon:list():next() end, { desc = "Next Harpoon file" }) - vim.keymap.set("n", "", function() harpoon:list():prev() end, { desc = "Previous Harpoon file" }) - end + vim.keymap.set("n", "a", function() + harpoon:list():add() + end, { noremap = true, silent = true, desc = "Add file to Harpoon" }) + vim.keymap.set("n", "e", function() + harpoon:list():remove() + end, { noremap = true, silent = true, desc = "Remove file from Harpoon" }) + -- vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu() end, { noremap = true, silent = true }) + vim.keymap.set("n", "1", function() + harpoon:list():select(1) + end, { noremap = true, silent = true, desc = "Select Harpoon file 1" }) + vim.keymap.set("n", "2", function() + harpoon:list():select(2) + end, { noremap = true, silent = true, desc = "Select Harpoon file 2" }) + vim.keymap.set("n", "3", function() + harpoon:list():select(3) + end, { noremap = true, silent = true, desc = "Select Harpoon file 3" }) + vim.keymap.set("n", "4", function() + harpoon:list():select(4) + end, { noremap = true, silent = true, desc = "Select Harpoon file 4" }) + vim.keymap.set("n", "5", function() + harpoon:list():select(5) + end, { noremap = true, silent = true, desc = "Select Harpoon file 5" }) + vim.keymap.set("n", "6", function() + harpoon:list():select(6) + end, { noremap = true, silent = true, desc = "Select Harpoon file 6" }) + vim.keymap.set("n", "7", function() + harpoon:list():select(7) + end, { noremap = true, silent = true, desc = "Select Harpoon file 7" }) + vim.keymap.set("n", "8", function() + harpoon:list():select(8) + end, { noremap = true, silent = true, desc = "Select Harpoon file 8" }) + vim.keymap.set("n", "9", function() + harpoon:list():select(9) + end, { noremap = true, silent = true, desc = "Select Harpoon file 9" }) + vim.keymap.set("n", "", function() + harpoon:list():next() + end, { desc = "Next Harpoon file" }) + vim.keymap.set("n", "", function() + harpoon:list():prev() + end, { desc = "Previous Harpoon file" }) + end, } diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index c6eb698..1df7df5 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -1,48 +1,48 @@ return { - 'nvim-lualine/lualine.nvim', - dependencies = { 'nvim-tree/nvim-web-devicons' }, - lazy = false, - config = function() - require('lualine').setup { - options = { - icons_enabled = true, - -- theme = 'ayu_light', - component_separators = { left = '', right = '' }, - section_separators = { left = '', right = '' }, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - always_show_tabline = true, - globalstatus = false, - refresh = { - statusline = 100, - tabline = 100, - winbar = 100, - } - }, - sections = { - lualine_a = { 'mode' }, - lualine_b = { 'branch', 'diff', 'diagnostics' }, - lualine_c = { 'filename' }, - lualine_x = { 'fileformat', 'filetype' }, - lualine_y = { 'progress' }, - lualine_z = { 'location' } - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { 'filename' }, - lualine_x = { 'location' }, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {} - } - end + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + lazy = false, + config = function() + require("lualine").setup({ + options = { + icons_enabled = true, + -- theme = 'ayu_light', + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = false, + refresh = { + statusline = 100, + tabline = 100, + winbar = 100, + }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { "filename" }, + lualine_x = { "fileformat", "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, + }) + end, } diff --git a/.config/nvim/lua/plugins/markdown.lua b/.config/nvim/lua/plugins/markdown.lua index 9f46c84..fe257bd 100644 --- a/.config/nvim/lua/plugins/markdown.lua +++ b/.config/nvim/lua/plugins/markdown.lua @@ -1,17 +1,17 @@ return { - "tadmccorkle/markdown.nvim", - ft = "markdown", -- or 'event = "VeryLazy"' - opts = { - -- configuration here or empty for defaults - }, - { - 'MeanderingProgrammer/render-markdown.nvim', - dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite - -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins - -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons - ---@module 'render-markdown' - ---@type render.md.UserConfig - opts = {}, - ft = "markdown" - } + "tadmccorkle/markdown.nvim", + ft = "markdown", -- or 'event = "VeryLazy"' + opts = { + -- configuration here or empty for defaults + }, + { + "MeanderingProgrammer/render-markdown.nvim", + dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons + ---@module 'render-markdown' + ---@type render.md.UserConfig + opts = {}, + ft = "markdown", + }, } diff --git a/.config/nvim/lua/plugins/maximize.lua b/.config/nvim/lua/plugins/maximize.lua index 6b29f01..00b58ca 100644 --- a/.config/nvim/lua/plugins/maximize.lua +++ b/.config/nvim/lua/plugins/maximize.lua @@ -1,10 +1,10 @@ return { - 'declancm/maximize.nvim', - config = true, - cmd = { - 'Maximize' - }, - keys = { - { "z", "Maximize", desc = "Maximize" } - } + "declancm/maximize.nvim", + config = true, + cmd = { + "Maximize", + }, + keys = { + { "z", "Maximize", desc = "Maximize" }, + }, } diff --git a/.config/nvim/lua/plugins/mini-cursorword.lua b/.config/nvim/lua/plugins/mini-cursorword.lua index 1591d08..8f5f2f1 100644 --- a/.config/nvim/lua/plugins/mini-cursorword.lua +++ b/.config/nvim/lua/plugins/mini-cursorword.lua @@ -1,10 +1,10 @@ return { - "echasnovski/mini.cursorword", - version = false, - lazy = false, - config = function() - require('mini.cursorword').setup({ - delay = 10, - }) - end + "echasnovski/mini.cursorword", + version = false, + lazy = false, + config = function() + require("mini.cursorword").setup({ + delay = 10, + }) + end, } diff --git a/.config/nvim/lua/plugins/neogit.lua b/.config/nvim/lua/plugins/neogit.lua index 12dd93b..aa29f8c 100644 --- a/.config/nvim/lua/plugins/neogit.lua +++ b/.config/nvim/lua/plugins/neogit.lua @@ -1,17 +1,17 @@ return { - "NeogitOrg/neogit", - lazy = false, - dependencies = { - "nvim-lua/plenary.nvim", - "sindrets/diffview.nvim", - "nvim-telescope/telescope.nvim", - }, - keys = { - { "g", "Neogit", desc = "Neogit" }, - }, - config = function() - require("neogit").setup({ - graph_style = "unicode", - }) - end, + "NeogitOrg/neogit", + lazy = false, + dependencies = { + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "nvim-telescope/telescope.nvim", + }, + keys = { + { "g", "Neogit", desc = "Neogit" }, + }, + config = function() + require("neogit").setup({ + graph_style = "unicode", + }) + end, } diff --git a/.config/nvim/lua/plugins/neotest.lua b/.config/nvim/lua/plugins/neotest.lua index d474ca2..1a82555 100644 --- a/.config/nvim/lua/plugins/neotest.lua +++ b/.config/nvim/lua/plugins/neotest.lua @@ -1,30 +1,30 @@ return { - "nvim-neotest/neotest", - event = "VeryLazy", - dependencies = { - "nvim-neotest/nvim-nio", - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - "olimorris/neotest-rspec", - "zidhuss/neotest-minitest", - "rcasia/neotest-java", - }, - config = function() - require("neotest").setup({ - adapters = { - require("neotest-minitest"), - require("neotest-rspec"), - ["neotest-java"] = { - ignore_wrapper = true - } - } - }) - end, - keys = { - { "tt", "Neotest run file", desc = "Test file" }, - { "tr", "Neotest run", desc = "Run closest test" }, - { "to", "Neotest output", desc = "Test output" }, - { "tO", "Neotest output-panel", desc = "Test output panel" }, - { "ts", "Neotest stop", desc = "Stop test" }, - } + "nvim-neotest/neotest", + event = "VeryLazy", + dependencies = { + "nvim-neotest/nvim-nio", + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "olimorris/neotest-rspec", + "zidhuss/neotest-minitest", + "rcasia/neotest-java", + }, + config = function() + require("neotest").setup({ + adapters = { + require("neotest-minitest"), + require("neotest-rspec"), + ["neotest-java"] = { + ignore_wrapper = true, + }, + }, + }) + end, + keys = { + { "tt", "Neotest run file", desc = "Test file" }, + { "tr", "Neotest run", desc = "Run closest test" }, + { "to", "Neotest output", desc = "Test output" }, + { "tO", "Neotest output-panel", desc = "Test output panel" }, + { "ts", "Neotest stop", desc = "Stop test" }, + }, } diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua index a6a1e3d..238ae19 100644 --- a/.config/nvim/lua/plugins/nvim-cmp.lua +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -1,97 +1,97 @@ return { - "hrsh7th/nvim-cmp", - lazy = false, - dependencies = { - "hrsh7th/nvim-cmp", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "ray-x/cmp-treesitter", - "neovim/nvim-lspconfig", - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets", - "L3MON4D3/LuaSnip", - }, - config = function() - local cmp = require('cmp') - require("luasnip.loaders.from_vscode").lazy_load() + "hrsh7th/nvim-cmp", + lazy = false, + dependencies = { + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "ray-x/cmp-treesitter", + "neovim/nvim-lspconfig", + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + "L3MON4D3/LuaSnip", + }, + config = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() - local luasnip = require('luasnip') + local luasnip = require("luasnip") - cmp.setup({ - snippet = { - -- expand = function(args) - -- require('luasnip').lsp_expand(args.body) - -- end, - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - -- [''] = cmp.mapping.confirm({ select = true }), - -- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#luasnip + cmp.setup({ + snippet = { + -- expand = function(args) + -- require('luasnip').lsp_expand(args.body) + -- end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + -- [''] = cmp.mapping.confirm({ select = true }), + -- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#luasnip - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - if luasnip.expandable() then - luasnip.expand() - else - cmp.confirm({ - select = true, - }) - end - else - fallback() - end - end), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + if luasnip.expandable() then + luasnip.expand() + else + cmp.confirm({ + select = true, + }) + end + else + fallback() + end + end), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.locally_jumpable(1) then - luasnip.jump(1) - else - fallback() - end - end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.locally_jumpable(1) then + luasnip.jump(1) + else + fallback() + end + end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - -- { name = 'treesitter' }, - { name = 'luasnip' }, - }, { - -- { name = 'buffer' }, - { name = 'path' }, - }) - }) + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + -- { name = 'treesitter' }, + { name = "luasnip" }, + }, { + -- { name = 'buffer' }, + { name = "path" }, + }), + }) - cmp.setup.cmdline({ '/', '?' }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } - }) + cmp.setup.cmdline({ "/", "?" }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "buffer" }, + }, + }) - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }), - matching = { disallow_symbol_nonprefix_matching = false } - }) - end - } + cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + }, { + { name = "cmdline" }, + }), + matching = { disallow_symbol_nonprefix_matching = false }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index 49ac891..208d9c7 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -1,67 +1,67 @@ return { - "neovim/nvim-lspconfig", - lazy = false, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "VonHeikemen/lsp-zero.nvim", - { - "williamboman/mason.nvim", - commands = { "Mason" }, - config = function() - require("mason").setup() - end - }, - { - "williamboman/mason-lspconfig.nvim", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { 'lua_ls', 'rust_analyzer' }, - defaults = { - rust_analyzer = { - cargo = { features = "*" } - }, - } - }) - end, - keys = { - { "li", "LspInfo", desc = "Lsp info" }, - { "ll", "LspLog", desc = "Lsp log" }, - } - } - }, - config = function() - local lspconfig = require('lspconfig') + "neovim/nvim-lspconfig", + lazy = false, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "VonHeikemen/lsp-zero.nvim", + { + "williamboman/mason.nvim", + commands = { "Mason" }, + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "rust_analyzer" }, + defaults = { + rust_analyzer = { + cargo = { features = "*" }, + }, + }, + }) + end, + keys = { + { "li", "LspInfo", desc = "Lsp info" }, + { "ll", "LspLog", desc = "Lsp log" }, + }, + }, + }, + config = function() + local lspconfig = require("lspconfig") - local lspconfig_defaults = lspconfig.util.default_config - lspconfig_defaults.capabilities = vim.tbl_deep_extend( - 'force', - lspconfig_defaults.capabilities, - require('cmp_nvim_lsp').default_capabilities() - ) + local lspconfig_defaults = lspconfig.util.default_config + lspconfig_defaults.capabilities = vim.tbl_deep_extend( + "force", + lspconfig_defaults.capabilities, + require("cmp_nvim_lsp").default_capabilities() + ) - require('mason-lspconfig').setup_handlers({ - function(server) - lspconfig[server].setup({}) - end, - }) + require("mason-lspconfig").setup_handlers({ + function(server) + lspconfig[server].setup({}) + end, + }) - vim.api.nvim_create_autocmd('LspAttach', { - desc = 'LSP actions', - callback = function(event) - local opts = { buffer = event.buf } - vim.keymap.set('n', 'K', vim.lsp.buf.hover, { desc = "Show hover information" }) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { desc = "Go to definition" }) - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, { desc = "Go to declaration" }) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, { desc = "Go to implementation" }) - vim.keymap.set('n', 'go', vim.lsp.buf.type_definition, { desc = "Go to type definition" }) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, { desc = "Show references" }) - vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, { desc = "Show signature help" }) - vim.keymap.set('n', 'cn', vim.lsp.buf.rename, { desc = "Rename symbol" }) - vim.keymap.set({ 'n', 'x' }, 'F', function() - vim.lsp.buf.format({ async = true }) -- TODO: add desc - end, opts) - vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, opts) - end, - }) - end + vim.api.nvim_create_autocmd("LspAttach", { + desc = "LSP actions", + callback = function(event) + local opts = { buffer = event.buf } + vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Show hover information" }) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { desc = "Go to declaration" }) + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" }) + vim.keymap.set("n", "go", vim.lsp.buf.type_definition, { desc = "Go to type definition" }) + vim.keymap.set("n", "gr", vim.lsp.buf.references, { desc = "Show references" }) + vim.keymap.set("n", "gs", vim.lsp.buf.signature_help, { desc = "Show signature help" }) + vim.keymap.set("n", "cn", vim.lsp.buf.rename, { desc = "Rename symbol" }) + vim.keymap.set({ "n", "x" }, "F", function() + vim.lsp.buf.format({ async = true }) -- TODO: add desc + end, opts) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts) + end, + }) + end, } diff --git a/.config/nvim/lua/plugins/nvim-surround.lua b/.config/nvim/lua/plugins/nvim-surround.lua index d4078fd..08ac0f2 100644 --- a/.config/nvim/lua/plugins/nvim-surround.lua +++ b/.config/nvim/lua/plugins/nvim-surround.lua @@ -1,8 +1,8 @@ return { - "kylechui/nvim-surround", - version = "*", - event = "VeryLazy", - config = function() - require("nvim-surround").setup() - end + "kylechui/nvim-surround", + version = "*", + event = "VeryLazy", + config = function() + require("nvim-surround").setup() + end, } diff --git a/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua b/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua index 19f0a47..64b8e4a 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua @@ -1,11 +1,11 @@ return { - "RRethy/nvim-treesitter-endwise", - event = { "BufReadPre", "BufNewFile" }, - config = function() - require("nvim-treesitter.configs").setup { - endwise = { - enable = true, - }, - } - end, + "RRethy/nvim-treesitter-endwise", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("nvim-treesitter.configs").setup({ + endwise = { + enable = true, + }, + }) + end, } diff --git a/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua b/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua index ee8f0fd..b8dadeb 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua @@ -1,67 +1,74 @@ -- https://www.josean.com/posts/nvim-treesitter-and-textobjects return { - "nvim-treesitter/nvim-treesitter-textobjects", - lazy = true, - config = function() require("nvim-treesitter.configs").setup({ - textobjects = { - select = { - enable = true, + "nvim-treesitter/nvim-treesitter-textobjects", + lazy = true, + config = function() + require("nvim-treesitter.configs").setup({ + textobjects = { + select = { + enable = true, - -- Automatically jump forward to textobj, similar to targets.vim - lookahead = true, + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" }, - ["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" }, - ["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" }, - ["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" }, + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" }, + ["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" }, + ["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" }, + ["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" }, - -- works for javascript/typescript files (custom captures I created in after/queries/ecma/textobjects.scm) - ["a:"] = { query = "@property.outer", desc = "Select outer part of an object property" }, - ["i:"] = { query = "@property.inner", desc = "Select inner part of an object property" }, - ["l:"] = { query = "@property.lhs", desc = "Select left part of an object property" }, - ["r:"] = { query = "@property.rhs", desc = "Select right part of an object property" }, + -- works for javascript/typescript files (custom captures I created in after/queries/ecma/textobjects.scm) + ["a:"] = { query = "@property.outer", desc = "Select outer part of an object property" }, + ["i:"] = { query = "@property.inner", desc = "Select inner part of an object property" }, + ["l:"] = { query = "@property.lhs", desc = "Select left part of an object property" }, + ["r:"] = { query = "@property.rhs", desc = "Select right part of an object property" }, - ["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" }, - ["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" }, + ["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" }, + ["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" }, - ["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" }, - ["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" }, + ["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" }, + ["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" }, - ["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" }, - ["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" }, + ["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" }, + ["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" }, - ["af"] = { query = "@call.outer", desc = "Select outer part of a function call" }, - ["if"] = { query = "@call.inner", desc = "Select inner part of a function call" }, + ["af"] = { query = "@call.outer", desc = "Select outer part of a function call" }, + ["if"] = { query = "@call.inner", desc = "Select inner part of a function call" }, - ["am"] = { query = "@function.outer", desc = "Select outer part of a method/function definition" }, - ["im"] = { query = "@function.inner", desc = "Select inner part of a method/function definition" }, + ["am"] = { + query = "@function.outer", + desc = "Select outer part of a method/function definition", + }, + ["im"] = { + query = "@function.inner", + desc = "Select inner part of a method/function definition", + }, - ["ab"] = { query = "@block.outer", desc = "Select outer part of a block definition" }, - ["ib"] = { query = "@block.inner", desc = "Select inner part of a block definition" }, + ["ab"] = { query = "@block.outer", desc = "Select outer part of a block definition" }, + ["ib"] = { query = "@block.inner", desc = "Select inner part of a block definition" }, - ["ac"] = { query = "@class.outer", desc = "Select outer part of a class" }, - ["ic"] = { query = "@class.inner", desc = "Select inner part of a class" }, + ["ac"] = { query = "@class.outer", desc = "Select outer part of a class" }, + ["ic"] = { query = "@class.inner", desc = "Select inner part of a class" }, - ["a/"] = { query = "@comment.outer", desc = "Select outer part of a comment" }, - ["i/"] = { query = "@comment.inner", desc = "Select inner part of a comment" }, - }, - }, - swap = { - enable = true, - swap_next = { - ["na"] = "@parameter.inner", -- swap parameters/argument with next - ["n:"] = "@property.outer", -- swap object property with next - ["nm"] = "@function.outer", -- swap function with next - }, - swap_previous = { - ["Pa"] = "@parameter.inner", -- swap parameters/argument with prev - ["P:"] = "@property.outer", -- swap object property with prev - ["Pm"] = "@function.outer", -- swap function with previous - }, - }, - }, - }) - end, + ["a/"] = { query = "@comment.outer", desc = "Select outer part of a comment" }, + ["i/"] = { query = "@comment.inner", desc = "Select inner part of a comment" }, + }, + }, + swap = { + enable = true, + swap_next = { + ["na"] = "@parameter.inner", -- swap parameters/argument with next + ["n:"] = "@property.outer", -- swap object property with next + ["nm"] = "@function.outer", -- swap function with next + }, + swap_previous = { + ["Pa"] = "@parameter.inner", -- swap parameters/argument with prev + ["P:"] = "@property.outer", -- swap object property with prev + ["Pm"] = "@function.outer", -- swap function with previous + }, + }, + }, + }) + end, } diff --git a/.config/nvim/lua/plugins/nvim-treesitter.lua b/.config/nvim/lua/plugins/nvim-treesitter.lua index 1b87b97..7a0b898 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter.lua @@ -1,23 +1,35 @@ return { - "nvim-treesitter/nvim-treesitter", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - -- "nvim-treesitter/nvim-treesitter-context", - "nvim-treesitter/nvim-treesitter-textobjects", - }, - config = function() - require("nvim-treesitter.configs").setup { - ensure_installed = { "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "ruby", "javascript", "rust", "html", "embedded_template" }, - incremental_selection = { - enable = true, - keymaps = { - node_incremental = "tab", - node_decremental = "", - }, - }, - highlight = { - enable = true - } - } - end, + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + -- "nvim-treesitter/nvim-treesitter-context", + "nvim-treesitter/nvim-treesitter-textobjects", + }, + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "lua", + "vim", + "vimdoc", + "query", + "markdown", + "markdown_inline", + "ruby", + "javascript", + "rust", + "html", + "embedded_template", + }, + incremental_selection = { + enable = true, + keymaps = { + node_incremental = "tab", + node_decremental = "", + }, + }, + highlight = { + enable = true, + }, + }) + end, } diff --git a/.config/nvim/lua/plugins/nvim-ts-autotag.lua b/.config/nvim/lua/plugins/nvim-ts-autotag.lua index 9ce065e..2354857 100644 --- a/.config/nvim/lua/plugins/nvim-ts-autotag.lua +++ b/.config/nvim/lua/plugins/nvim-ts-autotag.lua @@ -1,23 +1,23 @@ return { - "windwp/nvim-ts-autotag", - lazy = false, - -- event = { "BufReadPre", "BufNewFile" }, - config = function() - require('nvim-ts-autotag').setup({ - opts = { - -- Defaults - enable_close = true, -- Auto close tags - enable_rename = true, -- Auto rename pairs of tags - enable_close_on_slash = false -- Auto close on trailing ", - clear_suggestion = "", - accept_word = "", - }, - }) - end, + "supermaven-inc/supermaven-nvim", + lazy = false, + config = function() + require("supermaven-nvim").setup({ + keymaps = { + accept_suggestion = "", + clear_suggestion = "", + accept_word = "", + }, + }) + end, } diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index fca8d00..e18732e 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -1,79 +1,109 @@ return { - "nvim-telescope/telescope.nvim", - tag = "0.1.8", - dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-ui-select.nvim", }, - config = function() - require("telescope").setup { - extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown { - } - } - }, - previewers = { - qflist = { - updatetime = 25, - layout_config = { - width = 0.75, - height = 0.75, - } - } - }, - defaults = { - file_ignore_patterns = { ".git/" }, -- Ignore the .git directory - mappings = { - n = { - [""] = require("telescope.actions").send_selected_to_qflist + require("telescope.actions").open_qflist, - } - } - } - } + "nvim-telescope/telescope.nvim", + tag = "0.1.8", + dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-ui-select.nvim" }, + config = function() + require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + }, + previewers = { + qflist = { + updatetime = 25, + layout_config = { + width = 0.75, + height = 0.75, + }, + }, + }, + defaults = { + file_ignore_patterns = { ".git/" }, -- Ignore the .git directory + mappings = { + n = { + [""] = require("telescope.actions").send_selected_to_qflist + + require("telescope.actions").open_qflist, + }, + }, + }, + }) - require("telescope").load_extension("ui-select") - local harpoon = require('harpoon') - harpoon:setup({}) + require("telescope").load_extension("ui-select") + local harpoon = require("harpoon") + harpoon:setup({}) - -- basic telescope configuration - local conf = require("telescope.config").values - local function toggle_telescope(harpoon_files) - local file_paths = {} - for _, item in ipairs(harpoon_files.items) do - table.insert(file_paths, item.value) - end + -- basic telescope configuration + local conf = require("telescope.config").values + local function toggle_telescope(harpoon_files) + local file_paths = {} + for _, item in ipairs(harpoon_files.items) do + table.insert(file_paths, item.value) + end - require("telescope.pickers").new({}, { - prompt_title = "Harpoon", - finder = require("telescope.finders").new_table({ - results = file_paths, - }), - layout_strategy = "center", - previewer = conf.file_previewer({}), - sorter = conf.generic_sorter({}), - }):find() - end + require("telescope.pickers") + .new({}, { + prompt_title = "Harpoon", + finder = require("telescope.finders").new_table({ + results = file_paths, + }), + layout_strategy = "center", + previewer = conf.file_previewer({}), + sorter = conf.generic_sorter({}), + }) + :find() + end - vim.keymap.set("n", "", function() toggle_telescope(harpoon:list()) end, - { desc = "Open harpoon window" }) - end, - keys = { - { "", "Telescope find_files", desc = "Find files" }, - { "", "Telescope buffers", desc = "Find buffer" }, - { "C", "Telescope commands", desc = "Find commands" }, - { "", "Telescope lsp_document_symbols", desc = "Find symbols" }, - { "f", "Telescope find_files hidden=true", desc = "Find files" }, - -- { "e", "Telescope find_files hidden=false", desc = "Find all files" }, - { "w", "Telescope live_grep", desc = "Find substring" }, - { "r", function() - local current_word = vim.fn.expand("") - require("telescope.builtin").grep_string({ search = current_word }) - end }, - { "cc", "Telescope git_commits", desc = "Find git commits" }, - { "ac", "Telescope find_files prompt_title=Controllers cwd=app/controllers/ hidden=true", desc = "Find Rails controllers" }, - { "ah", "Telescope find_files prompt_title=Controllers cwd=app/helpers/ hidden=true", desc = "Find Rails helpers" }, - { "am", "Telescope find_files prompt_title=Models cwd=app/models/ hidden=true", desc = "Find Rails models" }, - { "at", "Telescope find_files prompt_title=Specs cwd=spec/ hidden=true", desc = "Find Rails specs" }, - { "af", "Telescope find_files prompt_title=Specs cwd=spec/factories hidden=true", desc = "Find Rails factories" }, - { "av", "Telescope find_files prompt_title=Views cwd=app/views hidden=true", desc = "Find Rails views" }, - { "l", "Telescope lsp_document_symbols", desc = "Find symbols" }, - } + vim.keymap.set("n", "", function() + toggle_telescope(harpoon:list()) + end, { desc = "Open harpoon window" }) + end, + keys = { + { "", "Telescope find_files", desc = "Find files" }, + { "", "Telescope buffers", desc = "Find buffer" }, + { "C", "Telescope commands", desc = "Find commands" }, + { "", "Telescope lsp_document_symbols", desc = "Find symbols" }, + { "f", "Telescope find_files hidden=true", desc = "Find files" }, + -- { "e", "Telescope find_files hidden=false", desc = "Find all files" }, + { "w", "Telescope live_grep", desc = "Find substring" }, + { + "r", + function() + local current_word = vim.fn.expand("") + require("telescope.builtin").grep_string({ search = current_word }) + end, + }, + { "cc", "Telescope git_commits", desc = "Find git commits" }, + { + "ac", + "Telescope find_files prompt_title=Controllers cwd=app/controllers/ hidden=true", + desc = "Find Rails controllers", + }, + { + "ah", + "Telescope find_files prompt_title=Controllers cwd=app/helpers/ hidden=true", + desc = "Find Rails helpers", + }, + { + "am", + "Telescope find_files prompt_title=Models cwd=app/models/ hidden=true", + desc = "Find Rails models", + }, + { + "at", + "Telescope find_files prompt_title=Specs cwd=spec/ hidden=true", + desc = "Find Rails specs", + }, + { + "af", + "Telescope find_files prompt_title=Specs cwd=spec/factories hidden=true", + desc = "Find Rails factories", + }, + { + "av", + "Telescope find_files prompt_title=Views cwd=app/views hidden=true", + desc = "Find Rails views", + }, + { "l", "Telescope lsp_document_symbols", desc = "Find symbols" }, + }, } diff --git a/.config/nvim/lua/plugins/text-case.lua b/.config/nvim/lua/plugins/text-case.lua index 9512abc..32a7a21 100644 --- a/.config/nvim/lua/plugins/text-case.lua +++ b/.config/nvim/lua/plugins/text-case.lua @@ -1,19 +1,19 @@ return { - "johmsalas/text-case.nvim", - dependencies = { "nvim-telescope/telescope.nvim" }, - config = function() - require("textcase").setup({}) - require("telescope").load_extension("textcase") - end, - keys = { - { "co", "TextCaseOpenTelescope", mode = { "n", "x" }, desc = "Open TextCase Telescope" }, - }, - cmd = { - "Subs", - "TextCaseOpenTelescope", - "TextCaseOpenTelescopeQuickChange", - "TextCaseOpenTelescopeLSPChange", - "TextCaseStartReplacingCommand", - }, - lazy = false, + "johmsalas/text-case.nvim", + dependencies = { "nvim-telescope/telescope.nvim" }, + config = function() + require("textcase").setup({}) + require("telescope").load_extension("textcase") + end, + keys = { + { "co", "TextCaseOpenTelescope", mode = { "n", "x" }, desc = "Open TextCase Telescope" }, + }, + cmd = { + "Subs", + "TextCaseOpenTelescope", + "TextCaseOpenTelescopeQuickChange", + "TextCaseOpenTelescopeLSPChange", + "TextCaseStartReplacingCommand", + }, + lazy = false, } diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua index 3741f30..fc29597 100644 --- a/.config/nvim/lua/plugins/trouble.lua +++ b/.config/nvim/lua/plugins/trouble.lua @@ -1,37 +1,37 @@ return { - "folke/trouble.nvim", - opts = {}, -- for default options, refer to the configuration section for custom setup. - cmd = "Trouble", - keys = { - { - "xx", - "Trouble diagnostics toggle", - desc = "Diagnostics (Trouble)", - }, - { - "xX", - "Trouble diagnostics toggle filter.buf=0", - desc = "Buffer Diagnostics (Trouble)", - }, - { - "cs", - "Trouble symbols toggle focus=false", - desc = "Symbols (Trouble)", - }, - { - "cl", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP Definitions / references / ... (Trouble)", - }, - { - "xL", - "Trouble loclist toggle", - desc = "Location List (Trouble)", - }, - { - "xQ", - "Trouble qflist toggle", - desc = "Quickfix List (Trouble)", - }, - }, + "folke/trouble.nvim", + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = "Trouble", + keys = { + { + "xx", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "xX", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "cs", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "cl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "xL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "xQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, } diff --git a/.config/nvim/lua/plugins/undotree.lua b/.config/nvim/lua/plugins/undotree.lua index 054e87f..30b83e9 100644 --- a/.config/nvim/lua/plugins/undotree.lua +++ b/.config/nvim/lua/plugins/undotree.lua @@ -1,30 +1,30 @@ return { - "jiaoshijie/undotree", - dependencies = "nvim-lua/plenary.nvim", - keys = { -- load the plugin only when using it's keybinding: - { "u", "lua require('undotree').toggle()", desc = "Undotree" }, - }, - config = function() - local undotree = require('undotree') + "jiaoshijie/undotree", + dependencies = "nvim-lua/plenary.nvim", + keys = { -- load the plugin only when using it's keybinding: + { "u", "lua require('undotree').toggle()", desc = "Undotree" }, + }, + config = function() + local undotree = require("undotree") - undotree.setup({ - float_diff = true, -- using float window previews diff, set this `true` will disable layout option - layout = "left_bottom", -- "left_bottom", "left_left_bottom" - position = "left", -- "right", "bottom" - ignore_filetype = { 'undotree', 'undotreeDiff', 'qf', 'TelescopePrompt', 'spectre_panel', 'tsplayground' }, - window = { - winblend = 30, - }, - keymaps = { - ['j'] = "move_next", - ['k'] = "move_prev", - ['gj'] = "move2parent", - ['J'] = "move_change_next", - ['K'] = "move_change_prev", - [''] = "action_enter", - ['p'] = "enter_diffbuf", - ['q'] = "quit", - }, - }) - end + undotree.setup({ + float_diff = true, -- using float window previews diff, set this `true` will disable layout option + layout = "left_bottom", -- "left_bottom", "left_left_bottom" + position = "left", -- "right", "bottom" + ignore_filetype = { "undotree", "undotreeDiff", "qf", "TelescopePrompt", "spectre_panel", "tsplayground" }, + window = { + winblend = 30, + }, + keymaps = { + ["j"] = "move_next", + ["k"] = "move_prev", + ["gj"] = "move2parent", + ["J"] = "move_change_next", + ["K"] = "move_change_prev", + [""] = "action_enter", + ["p"] = "enter_diffbuf", + ["q"] = "quit", + }, + }) + end, } diff --git a/.config/nvim/lua/plugins/vim-case-convert.lua b/.config/nvim/lua/plugins/vim-case-convert.lua index 5335a6c..41b5f38 100644 --- a/.config/nvim/lua/plugins/vim-case-convert.lua +++ b/.config/nvim/lua/plugins/vim-case-convert.lua @@ -1,4 +1,4 @@ return { - "chiedo/vim-case-convert", - lazy = false, + "chiedo/vim-case-convert", + lazy = false, } diff --git a/.config/nvim/lua/plugins/vim-fugitive.lua b/.config/nvim/lua/plugins/vim-fugitive.lua index c38fbcf..1099ca1 100644 --- a/.config/nvim/lua/plugins/vim-fugitive.lua +++ b/.config/nvim/lua/plugins/vim-fugitive.lua @@ -1,13 +1,13 @@ return { - "tpope/vim-fugitive", - config = function() - require("vim-fugitive").setup() - end, - commands = { - { "G", "Git" }, - { "Gblame", "Git blame" }, - { "Gdiff", "Git diff" }, - { "Glog", "Git log" }, - { "Gstatus", "Git status" }, - }, + "tpope/vim-fugitive", + config = function() + require("vim-fugitive").setup() + end, + commands = { + { "G", "Git" }, + { "Gblame", "Git blame" }, + { "Gdiff", "Git diff" }, + { "Glog", "Git log" }, + { "Gstatus", "Git status" }, + }, } diff --git a/.config/nvim/lua/plugins/vim-rails.lua b/.config/nvim/lua/plugins/vim-rails.lua index b789524..6624b4f 100644 --- a/.config/nvim/lua/plugins/vim-rails.lua +++ b/.config/nvim/lua/plugins/vim-rails.lua @@ -1,4 +1,4 @@ return { "tpope/vim-rails", - ft = { "ruby" } + ft = { "ruby" }, } diff --git a/.config/nvim/lua/plugins/vim-tmux-navigator.lua b/.config/nvim/lua/plugins/vim-tmux-navigator.lua index 6efe1fe..767eafb 100644 --- a/.config/nvim/lua/plugins/vim-tmux-navigator.lua +++ b/.config/nvim/lua/plugins/vim-tmux-navigator.lua @@ -1,4 +1,4 @@ return { - "christoomey/vim-tmux-navigator", - lazy = false, + "christoomey/vim-tmux-navigator", + lazy = false, } diff --git a/.config/nvim/lua/plugins/visual-multi.lua b/.config/nvim/lua/plugins/visual-multi.lua index 0980001..7948c42 100644 --- a/.config/nvim/lua/plugins/visual-multi.lua +++ b/.config/nvim/lua/plugins/visual-multi.lua @@ -1,4 +1,4 @@ return { - "mg979/vim-visual-multi", - lazy = false + "mg979/vim-visual-multi", + lazy = false, } diff --git a/.config/nvim/lua/plugins/whichkey.lua b/.config/nvim/lua/plugins/whichkey.lua index a43043c..bf03ff3 100644 --- a/.config/nvim/lua/plugins/whichkey.lua +++ b/.config/nvim/lua/plugins/whichkey.lua @@ -1,19 +1,19 @@ return { - "folke/which-key.nvim", - event = "VeryLazy", - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - delay = 0 - }, - keys = { - { - "?", - function() - require("which-key").show({ global = false }) - end, - desc = "Buffer Local Keymaps (which-key)", - }, - }, + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + delay = 0, + }, + keys = { + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)", + }, + }, } diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index c1899a8..cef2373 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -1,5 +1,5 @@ vim.g.mapleader = " " -vim.g.maplocalleader = ',' +vim.g.maplocalleader = "," vim.opt.cursorline = true vim.opt.cursorcolumn = true vim.opt.termguicolors = true @@ -33,10 +33,10 @@ vim.keymap.set("n", "", ":vert terminal", { noremap = true }) vim.keymap.set("t", "", "", { noremap = true }) -- move -vim.api.nvim_set_keymap('x', '', ':move \'>+gv=gv', { noremap = true, silent = true, desc = "Move line down" }) -vim.api.nvim_set_keymap('n', '', ':move -2==', { noremap = true, silent = true, desc = "Move line up" }) -vim.api.nvim_set_keymap('n', '', ':move +==', { noremap = true, silent = true, desc = "Move line down" }) -vim.api.nvim_set_keymap('x', '', ':move -2gv=gv', { noremap = true, silent = true, desc = "Move line up" }) +vim.api.nvim_set_keymap("x", "", ":move '>+gv=gv", { noremap = true, silent = true, desc = "Move line down" }) +vim.api.nvim_set_keymap("n", "", ":move -2==", { noremap = true, silent = true, desc = "Move line up" }) +vim.api.nvim_set_keymap("n", "", ":move +==", { noremap = true, silent = true, desc = "Move line down" }) +vim.api.nvim_set_keymap("x", "", ":move -2gv=gv", { noremap = true, silent = true, desc = "Move line up" }) -- saving / quitting @@ -85,19 +85,19 @@ vim.keymap.set("n", "", ":wincmd =", { silent = true }) vim.keymap.set("n", "v", ":wincmd v", { silent = true }) vim.keymap.set("n", "V", ":wincmd s", { noremap = true, silent = true }) vim.keymap.set("n", "o", function() - -- get the current line content - local line = vim.api.nvim_get_current_line() + -- get the current line content + local line = vim.api.nvim_get_current_line() - -- extract the string (either single-quoted or double-quoted) - local str = line:match("'(.-)'") or line:match('"(.-)"') + -- extract the string (either single-quoted or double-quoted) + local str = line:match("'(.-)'") or line:match('"(.-)"') - if str then - -- Construct the GitHub URL - local url = "https://github.com/" .. str + if str then + -- Construct the GitHub URL + local url = "https://github.com/" .. str - -- use the open shell command to open the URL - os.execute("open " .. url) - else - print("No valid string found on the current line.") - end + -- use the open shell command to open the URL + os.execute("open " .. url) + else + print("No valid string found on the current line.") + end end) From 53d0c8c79a593532c3ea6231cdfba7bb7e314a03 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 28 Feb 2025 12:15:45 +0100 Subject: [PATCH 251/280] Add checker / linter scripts --- .config/nvim/bin/check | 3 +++ .config/nvim/bin/lint | 3 +++ 2 files changed, 6 insertions(+) create mode 100755 .config/nvim/bin/check create mode 100755 .config/nvim/bin/lint diff --git a/.config/nvim/bin/check b/.config/nvim/bin/check new file mode 100755 index 0000000..1d34d8b --- /dev/null +++ b/.config/nvim/bin/check @@ -0,0 +1,3 @@ +#!/bin/bash + +stylua --check . diff --git a/.config/nvim/bin/lint b/.config/nvim/bin/lint new file mode 100755 index 0000000..4f5d306 --- /dev/null +++ b/.config/nvim/bin/lint @@ -0,0 +1,3 @@ +#!/bin/bash + +stylua . From ddb48054e759153b6a779dca5c5ff85a9de6047d Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Thu, 6 Mar 2025 22:01:11 +0100 Subject: [PATCH 252/280] Improve plugins --- .config/nvim/lua/plugins/codeium.lua | 2 ++ .config/nvim/lua/plugins/comment.lua | 4 ++- .config/nvim/lua/plugins/markdown.lua | 30 +++++++++---------- .config/nvim/lua/plugins/neogit.lua | 1 - .config/nvim/lua/plugins/super-maven.lua | 13 -------- .config/nvim/lua/plugins/telescope.lua | 2 +- .../nvim/lua/plugins/vim-tmux-navigator.lua | 16 +++++++++- 7 files changed, 36 insertions(+), 32 deletions(-) create mode 100644 .config/nvim/lua/plugins/codeium.lua delete mode 100644 .config/nvim/lua/plugins/super-maven.lua diff --git a/.config/nvim/lua/plugins/codeium.lua b/.config/nvim/lua/plugins/codeium.lua new file mode 100644 index 0000000..b063736 --- /dev/null +++ b/.config/nvim/lua/plugins/codeium.lua @@ -0,0 +1,2 @@ +return {'Exafunction/codeium.vim', lazy=false} + -- Call :Codeium Auth after installation to get Token ID diff --git a/.config/nvim/lua/plugins/comment.lua b/.config/nvim/lua/plugins/comment.lua index ef7af71..c833f67 100644 --- a/.config/nvim/lua/plugins/comment.lua +++ b/.config/nvim/lua/plugins/comment.lua @@ -1,5 +1,7 @@ return { "numToStr/Comment.nvim", - lazy = false, opts = {}, + keys = { + { "gcc", "CommentToggle", desc = "Comment" }, + }, } diff --git a/.config/nvim/lua/plugins/markdown.lua b/.config/nvim/lua/plugins/markdown.lua index fe257bd..8323a21 100644 --- a/.config/nvim/lua/plugins/markdown.lua +++ b/.config/nvim/lua/plugins/markdown.lua @@ -1,17 +1,17 @@ return { - "tadmccorkle/markdown.nvim", - ft = "markdown", -- or 'event = "VeryLazy"' - opts = { - -- configuration here or empty for defaults - }, - { - "MeanderingProgrammer/render-markdown.nvim", - dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite - -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins - -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons - ---@module 'render-markdown' - ---@type render.md.UserConfig - opts = {}, - ft = "markdown", - }, + -- "tadmccorkle/markdown.nvim", + -- ft = "markdown", -- or 'event = "VeryLazy"' + -- opts = { + -- -- configuration here or empty for defaults + -- }, + -- { + -- "MeanderingProgrammer/render-markdown.nvim", + -- dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite + -- -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins + -- -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons + -- ---@module 'render-markdown' + -- ---@type render.md.UserConfig + -- opts = {}, + -- ft = "markdown", + -- }, } diff --git a/.config/nvim/lua/plugins/neogit.lua b/.config/nvim/lua/plugins/neogit.lua index aa29f8c..4420659 100644 --- a/.config/nvim/lua/plugins/neogit.lua +++ b/.config/nvim/lua/plugins/neogit.lua @@ -1,6 +1,5 @@ return { "NeogitOrg/neogit", - lazy = false, dependencies = { "nvim-lua/plenary.nvim", "sindrets/diffview.nvim", diff --git a/.config/nvim/lua/plugins/super-maven.lua b/.config/nvim/lua/plugins/super-maven.lua deleted file mode 100644 index adefed7..0000000 --- a/.config/nvim/lua/plugins/super-maven.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - "supermaven-inc/supermaven-nvim", - lazy = false, - config = function() - require("supermaven-nvim").setup({ - keymaps = { - accept_suggestion = "", - clear_suggestion = "", - accept_word = "", - }, - }) - end, -} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index e18732e..5945fd5 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -59,7 +59,7 @@ return { end, { desc = "Open harpoon window" }) end, keys = { - { "", "Telescope find_files", desc = "Find files" }, + { "", 'Telescope find_files path_display={"smart"}', desc = "Find files" }, { "", "Telescope buffers", desc = "Find buffer" }, { "C", "Telescope commands", desc = "Find commands" }, { "", "Telescope lsp_document_symbols", desc = "Find symbols" }, diff --git a/.config/nvim/lua/plugins/vim-tmux-navigator.lua b/.config/nvim/lua/plugins/vim-tmux-navigator.lua index 767eafb..31321a6 100644 --- a/.config/nvim/lua/plugins/vim-tmux-navigator.lua +++ b/.config/nvim/lua/plugins/vim-tmux-navigator.lua @@ -1,4 +1,18 @@ return { "christoomey/vim-tmux-navigator", - lazy = false, + cmd = { + "TmuxNavigateLeft", + "TmuxNavigateDown", + "TmuxNavigateUp", + "TmuxNavigateRight", + "TmuxNavigatePrevious", + "TmuxNavigatorProcessList", + }, + keys = { + { "", "TmuxNavigateLeft" }, + { "", "TmuxNavigateDown" }, + { "", "TmuxNavigateUp" }, + { "", "TmuxNavigateRight" }, + { "", "TmuxNavigatePrevious" }, + }, } From a3a52b3ffed92d4d7bf50056a5655847836c41aa Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 14 Mar 2025 16:53:10 +0100 Subject: [PATCH 253/280] Add check script --- .config/nvim/bin/check | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/nvim/bin/check b/.config/nvim/bin/check index 1d34d8b..206b4c0 100755 --- a/.config/nvim/bin/check +++ b/.config/nvim/bin/check @@ -1,3 +1,4 @@ #!/bin/bash stylua --check . +nvim --headless -c "checkhealth" -c "qa" From 84def069a9f2326a7ca9d7b3079963a27da3dd9c Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 14 Mar 2025 16:55:32 +0100 Subject: [PATCH 254/280] Add workflow --- .github/workflows/check.yml | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..bde3ffe --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,47 @@ +name: Neovim Checks + +on: + push: + branches: [ main ] + paths: + - '.config/nvim/**' + pull_request: + branches: [ main ] + paths: + - '.config/nvim/**' + workflow_dispatch: + +jobs: + nvim-checks: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Neovim + uses: rhysd/action-setup-vim@v1 + with: + neovim: true + version: stable + + - uses: asdf-vm/actions/setup@v3 + + - name: Install asdf plugins + run: | + asdf plugin add nodejs || true + asdf plugin add ruby || true + + - name: Install versions from .tool-versions + working-directory: .config/nvim + run: asdf install + + - name: Install StyLua + run: cargo install stylua + + - name: Run fast checks (linting) + working-directory: .config/nvim + run: ./bin/lint + + - name: Run health checks + working-directory: .config/nvim + run: ./bin/check \ No newline at end of file From 9e9f92e0d9948d08a155a0757685a5652a6fdbf9 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 14 Mar 2025 18:01:12 +0100 Subject: [PATCH 255/280] Update healthcheck --- .github/workflows/check.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index bde3ffe..2fa7b93 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -41,7 +41,10 @@ jobs: - name: Run fast checks (linting) working-directory: .config/nvim run: ./bin/lint + + - name: Sync Lazy + run: nvim --headless "+Lazy sync" +qall - name: Run health checks working-directory: .config/nvim - run: ./bin/check \ No newline at end of file + run: ./bin/check From 0474983927bef124eede9f910ec1f0ace7ce6f5a Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 14 Mar 2025 18:02:38 +0100 Subject: [PATCH 256/280] Temporarily remove paths --- .github/workflows/check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2fa7b93..841678d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -7,8 +7,8 @@ on: - '.config/nvim/**' pull_request: branches: [ main ] - paths: - - '.config/nvim/**' + # paths: + # - '.config/nvim/**' workflow_dispatch: jobs: From 6023d7550d7319c68e912d4a6769c7a10d729c76 Mon Sep 17 00:00:00 2001 From: Daniel Bengl <53896675+CuddlyBunion341@users.noreply.github.com> Date: Sat, 15 Mar 2025 14:57:36 +0100 Subject: [PATCH 257/280] Update .github/workflows/check.yml --- .github/workflows/check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 841678d..71e9f7f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -3,8 +3,8 @@ name: Neovim Checks on: push: branches: [ main ] - paths: - - '.config/nvim/**' + #paths: + # - '.config/nvim/**' pull_request: branches: [ main ] # paths: From 19f3488de5df85cd728f6576ec922f7e09039b94 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 25 Mar 2025 20:54:41 +0100 Subject: [PATCH 258/280] Update plugins --- .config/nvim/lazy-lock.json | 39 +++++++++++++--------------- .config/nvim/lua/plugins/codeium.lua | 4 +-- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 198c274..4c2b175 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -2,58 +2,55 @@ "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "CopilotChat.nvim": { "branch": "canary", "commit": "451d365928a994cda3505a84905303f790e28df8" }, "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, - "auto-session": { "branch": "main", "commit": "9c3f977aafb56bd73ba0d082c4dcbdba5666faf3" }, + "auto-session": { "branch": "main", "commit": "79ef41274354a486cf4f100a7adf4a7575802ccf" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, - "bufexplorer": { "branch": "master", "commit": "93ad8af26ddf2a1c97b0566f9954a23320144663" }, + "bufexplorer": { "branch": "master", "commit": "0ea8aece81c3373578cf72cdcdd34a7bd64171c0" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "codeium.vim": { "branch": "main", "commit": "000de972de76f357c03da14f4f8dd9a969d4fe8c" }, "copilot.lua": { "branch": "master", "commit": "30321e33b03cb924fdcd6a806a0dc6fa0b0eafb9" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, - "gitsigns.nvim": { "branch": "main", "commit": "4c40357994f386e72be92a46f41fc1664c84c87d" }, - "gradle.nvim": { "branch": "main", "commit": "aef2a780457bdc1a7a52d9b03c41aa2b0906bb64" }, - "grug-far.nvim": { "branch": "main", "commit": "309ecac6e6240d37c0be3c567d9f7cc95f63d255" }, + "gitsigns.nvim": { "branch": "main", "commit": "011dc6718bcebdf92a5336bb0da79189c3afe621" }, + "gradle.nvim": { "branch": "main", "commit": "1d44d64c1dc157ab11c9d8669c108ab02f789662" }, + "grug-far.nvim": { "branch": "main", "commit": "0ec6c3a9ef63703975e800d7386b6114863e1f9d" }, "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lsp-zero.nvim": { "branch": "v4.x", "commit": "baff1ca10ecad7efe04f02f06d2647dd2ae90074" }, - "lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" }, - "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, + "lualine.nvim": { "branch": "master", "commit": "edf4b24861fa5d586058ff2c9e8982bb971f7098" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.cursorword": { "branch": "main", "commit": "939ffcc8c57694608ac0896418d4b9a7c5273909" }, "mini.icons": { "branch": "main", "commit": "ec61af6e606fc89ee3b1d8f2f20166a3ca917a36" }, - "mini.nvim": { "branch": "main", "commit": "3a354c754656538ad76d1add93ca21e75b7f3181" }, - "neogit": { "branch": "master", "commit": "12f78aaabb37b4946254dd5e47cf7b552904937a" }, + "neogit": { "branch": "master", "commit": "0b756dd80c82da28fd7ed500eac642710ab21909" }, "neotest": { "branch": "master", "commit": "dddbe8fe358b05b2b7e54fe4faab50563171a76d" }, - "neotest-java": { "branch": "main", "commit": "bbbad04bda7af216a8c24509d47d1f51356b37ce" }, + "neotest-java": { "branch": "main", "commit": "1404de796b1afbbc20cf84db991c901270b901c9" }, "neotest-minitest": { "branch": "main", "commit": "7ff057de8ab2c27491ff27c7be9826b8f3bb5ec1" }, - "neotest-rspec": { "branch": "main", "commit": "f8c91edc5dd87ca467a624652f365ac217d7cc1c" }, - "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, + "neotest-rspec": { "branch": "main", "commit": "281c0ed0e55d623e8028796e1c4dc27b7e421fd0" }, + "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, "nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" }, - "nvim-cmp": { "branch": "main", "commit": "5a11682453ac6b13dbf32cd403da4ee9c07ef1c3" }, - "nvim-lspconfig": { "branch": "master", "commit": "d793c5cb0206d976a38e70e62479a60ba87722ca" }, + "nvim-cmp": { "branch": "main", "commit": "1e1900b0769324a9675ef85b38f99cca29e203b3" }, + "nvim-lspconfig": { "branch": "master", "commit": "8a1529e46eef5efc86c34c8d9bdd313abc2ecba0" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-surround": { "branch": "main", "commit": "ae298105122c87bbe0a36b1ad20b06d417c0433e" }, - "nvim-treesitter": { "branch": "master", "commit": "99487eb34a397befce8182ff63347a21c5f4b881" }, - "nvim-treesitter-endwise": { "branch": "master", "commit": "cb718aab7fa66e43187674e875713097492a6618" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "b91c98afa6c42819aea6cbc1ba38272f5456a5cf" }, + "nvim-surround": { "branch": "main", "commit": "f70d56275710e202af59148f52100d34b786aecb" }, + "nvim-treesitter": { "branch": "master", "commit": "8b79cddc708cb8549562f0101f7f509ad7cebf97" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "57d52841a966be6ff9a998a6d3dc1ac9cc9d95fc" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "143856b1cee509a190cc8c17ddb0638002171235" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, - "nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" }, + "nvim-web-devicons": { "branch": "master", "commit": "ab4cfee554e501f497bce0856788d43cf2eb93d7" }, "oil.nvim": { "branch": "feat/scratch-preview", "commit": "15a17fdff4866394bdf1f7bf081b818ec3de44f5" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, "plantuml-previewer.vim": { "branch": "master", "commit": "368a1f331c1ff29f6a3ee76facfca39a7f374b13" }, "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "render-markdown.nvim": { "branch": "main", "commit": "b57d51d760f5e4f520414dbeb6dee3ec1ae07a83" }, "solarized.nvim": { "branch": "main", "commit": "c0dfe1cbfabd93b546baf5f1408f5df7e02e2050" }, - "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "text-case.nvim": { "branch": "main", "commit": "e898cfd46fa6cde0e83abb624a16e67d2ffc6457" }, diff --git a/.config/nvim/lua/plugins/codeium.lua b/.config/nvim/lua/plugins/codeium.lua index b063736..803c538 100644 --- a/.config/nvim/lua/plugins/codeium.lua +++ b/.config/nvim/lua/plugins/codeium.lua @@ -1,2 +1,2 @@ -return {'Exafunction/codeium.vim', lazy=false} - -- Call :Codeium Auth after installation to get Token ID +return { "Exafunction/codeium.vim", lazy = false } +-- sall :Codeium Auth after installation to get Token ID From 601eb9f1c3cbb9d0d016eec928446d64441361ec Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 25 Mar 2025 20:56:24 +0100 Subject: [PATCH 259/280] Update stuff --- .../{current-theme.toml.bak => current-theme.example.toml} | 0 ".config/alacritty/current-theme.toml\"\"" | 1 - .config/nvim/.tool-versions | 4 ++-- .tool-versions | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) rename .config/alacritty/{current-theme.toml.bak => current-theme.example.toml} (100%) delete mode 100644 ".config/alacritty/current-theme.toml\"\"" diff --git a/.config/alacritty/current-theme.toml.bak b/.config/alacritty/current-theme.example.toml similarity index 100% rename from .config/alacritty/current-theme.toml.bak rename to .config/alacritty/current-theme.example.toml diff --git "a/.config/alacritty/current-theme.toml\"\"" "b/.config/alacritty/current-theme.toml\"\"" deleted file mode 100644 index d6e2bdf..0000000 --- "a/.config/alacritty/current-theme.toml\"\"" +++ /dev/null @@ -1 +0,0 @@ -import = [ "~/.config/alacritty/themes/solarized_light.toml" ] diff --git a/.config/nvim/.tool-versions b/.config/nvim/.tool-versions index d83fbce..07557c4 100644 --- a/.config/nvim/.tool-versions +++ b/.config/nvim/.tool-versions @@ -1,2 +1,2 @@ -ruby 3.2.2 -nodejs 22.9.0 +ruby 3.4.1 +nodejs 20.11.0 diff --git a/.tool-versions b/.tool-versions index c1c77c3..03d5f01 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1,2 @@ ruby 3.2.3 +nodejs 20.11.0 From 37a525f9631397e6b96a475570a45e16406c73be Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 19 Apr 2025 10:57:05 +0200 Subject: [PATCH 260/280] Add zj plugins --- .config/nvim/lazy-lock.json | 56 ++++++++++--------- .config/nvim/lua/plugins/zj-navigator.lua | 12 ++++ .../lua/plugins/zj-vim-zellij-navigator.lua | 7 +++ .config/nvim/lua/plugins/zj-zellij-nav.lua | 12 ++++ 4 files changed, 61 insertions(+), 26 deletions(-) create mode 100644 .config/nvim/lua/plugins/zj-navigator.lua create mode 100644 .config/nvim/lua/plugins/zj-vim-zellij-navigator.lua create mode 100644 .config/nvim/lua/plugins/zj-zellij-nav.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 4c2b175..02a4570 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -2,54 +2,56 @@ "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "CopilotChat.nvim": { "branch": "canary", "commit": "451d365928a994cda3505a84905303f790e28df8" }, "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, - "auto-session": { "branch": "main", "commit": "79ef41274354a486cf4f100a7adf4a7575802ccf" }, + "Navigator.nvim": { "branch": "master", "commit": "d43816089689ccffd23543bc02331e9a68f3ec2f" }, + "auto-session": { "branch": "main", "commit": "095b0b54d40c8cc7fe37f2ae4d948ec3069bb1c2" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, - "bufexplorer": { "branch": "master", "commit": "0ea8aece81c3373578cf72cdcdd34a7bd64171c0" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "bufexplorer": { "branch": "master", "commit": "3bfc3885bdc0982840c1f0c95545f390c06c8074" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, + "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "codeium.vim": { "branch": "main", "commit": "000de972de76f357c03da14f4f8dd9a969d4fe8c" }, - "copilot.lua": { "branch": "master", "commit": "30321e33b03cb924fdcd6a806a0dc6fa0b0eafb9" }, + "codeium.vim": { "branch": "main", "commit": "272c6e2755e8faa90e26bcdcd9fde6b9e61751ea" }, + "copilot.lua": { "branch": "master", "commit": "b3988bb51e87a057fee79192c3cc0932a0360bf6" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, - "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, + "friendly-snippets": { "branch": "main", "commit": "31f2a2657b6261724313281fe0d8ba6f43f4a4fa" }, "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, - "gitsigns.nvim": { "branch": "main", "commit": "011dc6718bcebdf92a5336bb0da79189c3afe621" }, + "gitsigns.nvim": { "branch": "main", "commit": "02eafb1273afec94447f66d1a43fc5e477c2ab8a" }, "gradle.nvim": { "branch": "main", "commit": "1d44d64c1dc157ab11c9d8669c108ab02f789662" }, - "grug-far.nvim": { "branch": "main", "commit": "0ec6c3a9ef63703975e800d7386b6114863e1f9d" }, + "grug-far.nvim": { "branch": "main", "commit": "1c9325f6ab18fc8ac4d4c57e765aa845af148277" }, "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lsp-zero.nvim": { "branch": "v4.x", "commit": "baff1ca10ecad7efe04f02f06d2647dd2ae90074" }, - "lualine.nvim": { "branch": "master", "commit": "edf4b24861fa5d586058ff2c9e8982bb971f7098" }, + "lsp-zero.nvim": { "branch": "v4.x", "commit": "2afa32e732d7b36e80cd5241fbdc4a38e123c4e0" }, + "lualine.nvim": { "branch": "master", "commit": "86fe39534b7da729a1ac56c0466e76f2c663dc42" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, - "mini.cursorword": { "branch": "main", "commit": "939ffcc8c57694608ac0896418d4b9a7c5273909" }, - "mini.icons": { "branch": "main", "commit": "ec61af6e606fc89ee3b1d8f2f20166a3ca917a36" }, - "neogit": { "branch": "master", "commit": "0b756dd80c82da28fd7ed500eac642710ab21909" }, - "neotest": { "branch": "master", "commit": "dddbe8fe358b05b2b7e54fe4faab50563171a76d" }, - "neotest-java": { "branch": "main", "commit": "1404de796b1afbbc20cf84db991c901270b901c9" }, + "mini.cursorword": { "branch": "main", "commit": "ab63cc74975f4e107dbb490f6d3040eacfc1c023" }, + "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, + "neogit": { "branch": "master", "commit": "9bb1e73c534f767607e0a888f3de4c942825c501" }, + "neotest": { "branch": "master", "commit": "c3b5930d1512054c313a5ce76dd15f7301c973e8" }, + "neotest-java": { "branch": "main", "commit": "0ca4f0ffaf23464e0d8940ab485d129298a335ac" }, "neotest-minitest": { "branch": "main", "commit": "7ff057de8ab2c27491ff27c7be9826b8f3bb5ec1" }, "neotest-rspec": { "branch": "main", "commit": "281c0ed0e55d623e8028796e1c4dc27b7e421fd0" }, "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, - "nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" }, - "nvim-cmp": { "branch": "main", "commit": "1e1900b0769324a9675ef85b38f99cca29e203b3" }, - "nvim-lspconfig": { "branch": "master", "commit": "8a1529e46eef5efc86c34c8d9bdd313abc2ecba0" }, + "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-lspconfig": { "branch": "master", "commit": "b70b900fba6e3255a5a8113c76f213102564cb0d" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-surround": { "branch": "main", "commit": "f70d56275710e202af59148f52100d34b786aecb" }, - "nvim-treesitter": { "branch": "master", "commit": "8b79cddc708cb8549562f0101f7f509ad7cebf97" }, - "nvim-treesitter-endwise": { "branch": "master", "commit": "57d52841a966be6ff9a998a6d3dc1ac9cc9d95fc" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "143856b1cee509a190cc8c17ddb0638002171235" }, + "nvim-surround": { "branch": "main", "commit": "caf6f633d4d77a29b6e265b560c5a035d171a913" }, + "nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "8b6436303dda9ce6ed4b3733fd15703eb3589c36" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "205e3369bc83d8cb83f7409c36120e24611f8c5c" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, - "nvim-web-devicons": { "branch": "master", "commit": "ab4cfee554e501f497bce0856788d43cf2eb93d7" }, + "nvim-web-devicons": { "branch": "master", "commit": "c90dee4e930ab9f49fa6d77f289bff335b49e972" }, "oil.nvim": { "branch": "feat/scratch-preview", "commit": "15a17fdff4866394bdf1f7bf081b818ec3de44f5" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, "plantuml-previewer.vim": { "branch": "master", "commit": "368a1f331c1ff29f6a3ee76facfca39a7f374b13" }, "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "refactoring.nvim": { "branch": "master", "commit": "2be7ea3f10b7e59658f5abf6dffc50b5d61964d6" }, "solarized.nvim": { "branch": "main", "commit": "c0dfe1cbfabd93b546baf5f1408f5df7e02e2050" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, @@ -63,5 +65,7 @@ "vim-rails": { "branch": "master", "commit": "b0a5c76f86ea214ade36ab0b811e730c3f0add67" }, "vim-tmux-navigator": { "branch": "master", "commit": "791dacfcfc8ccb7f6eb1c853050883b03e5a22fe" }, "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, - "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } + "vim-zellij-navigator.nvim": { "branch": "main", "commit": "380d6d55d13fe60f91ac0c8303749c2c12fdc85a" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, + "zellij-nav.nvim": { "branch": "main", "commit": "91cc2a642d8927ebde50ced5bf71ba470a0fc116" } } diff --git a/.config/nvim/lua/plugins/zj-navigator.lua b/.config/nvim/lua/plugins/zj-navigator.lua new file mode 100644 index 0000000..9beff38 --- /dev/null +++ b/.config/nvim/lua/plugins/zj-navigator.lua @@ -0,0 +1,12 @@ +return { + 'dynamotn/Navigator.nvim', + lazy = false, + config = function() + require('Navigator').setup() + vim.keymap.set({'n', 't'}, '', 'NavigatorLeft') + vim.keymap.set({'n', 't'}, '', 'NavigatorRight') + vim.keymap.set({'n', 't'}, '', 'NavigatorUp') + vim.keymap.set({'n', 't'}, '', 'NavigatorDown') + vim.keymap.set({'n', 't'}, '', 'NavigatorPrevious') + end +} diff --git a/.config/nvim/lua/plugins/zj-vim-zellij-navigator.lua b/.config/nvim/lua/plugins/zj-vim-zellij-navigator.lua new file mode 100644 index 0000000..2c66ecb --- /dev/null +++ b/.config/nvim/lua/plugins/zj-vim-zellij-navigator.lua @@ -0,0 +1,7 @@ +return { + "hiasr/vim-zellij-navigator.nvim", + lazy = false, + config = function() + require('vim-zellij-navigator').setup() + end +} diff --git a/.config/nvim/lua/plugins/zj-zellij-nav.lua b/.config/nvim/lua/plugins/zj-zellij-nav.lua new file mode 100644 index 0000000..66bd254 --- /dev/null +++ b/.config/nvim/lua/plugins/zj-zellij-nav.lua @@ -0,0 +1,12 @@ +return { + "swaits/zellij-nav.nvim", + lazy = true, + event = "VeryLazy", + keys = { + { "", "ZellijNavigateLeftTab", { silent = true, desc = "navigate left or tab" } }, + { "", "ZellijNavigateDown", { silent = true, desc = "navigate down" } }, + { "", "ZellijNavigateUp", { silent = true, desc = "navigate up" } }, + { "", "ZellijNavigateRightTab", { silent = true, desc = "navigate right or tab" } }, + }, + opts = {}, +} From f9300705b323089dabec525ac0b1743c84f83156 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 3 Jun 2025 22:29:23 +0200 Subject: [PATCH 261/280] Update plugins, stuff --- .config/nvim/lazy-lock.json | 46 ++- .config/nvim/lua/plugins/csvview.lua | 22 ++ .config/nvim/lua/plugins/lualine.lua | 320 +++++++++++++++--- .config/nvim/lua/plugins/nvim-cmp.lua | 2 +- .config/nvim/lua/plugins/nvim-lspconfig.lua | 40 +-- .config/nvim/lua/plugins/refactoring.lua | 11 + .config/nvim/lua/plugins/vim-rails.lua | 1 + .config/nvim/lua/plugins/zj-navigator.lua | 20 +- .../lua/plugins/zj-vim-zellij-navigator.lua | 10 +- .config/nvim/lua/plugins/zj-zellij-nav.lua | 20 +- .config/nvim/vscode.lua | 80 +++++ .github/workflows/setup.yml | 15 + .tmux.conf | 4 +- scripts/zip_split.sh | 109 ++++++ 14 files changed, 582 insertions(+), 118 deletions(-) create mode 100644 .config/nvim/lua/plugins/csvview.lua create mode 100644 .config/nvim/lua/plugins/refactoring.lua create mode 100644 .config/nvim/vscode.lua create mode 100644 .github/workflows/setup.yml create mode 100755 scripts/zip_split.sh diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 02a4570..f282705 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,9 +1,8 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "CopilotChat.nvim": { "branch": "canary", "commit": "451d365928a994cda3505a84905303f790e28df8" }, - "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, - "Navigator.nvim": { "branch": "master", "commit": "d43816089689ccffd23543bc02331e9a68f3ec2f" }, - "auto-session": { "branch": "main", "commit": "095b0b54d40c8cc7fe37f2ae4d948ec3069bb1c2" }, + "LuaSnip": { "branch": "master", "commit": "c1851d5c519611dfc451b6582961b2602e0af89b" }, + "auto-session": { "branch": "main", "commit": "00334ee24b9a05001ad50221c8daffbeedaa0842" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, "bufexplorer": { "branch": "master", "commit": "3bfc3885bdc0982840c1f0c95545f390c06c8074" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, @@ -13,39 +12,40 @@ "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "codeium.vim": { "branch": "main", "commit": "272c6e2755e8faa90e26bcdcd9fde6b9e61751ea" }, - "copilot.lua": { "branch": "master", "commit": "b3988bb51e87a057fee79192c3cc0932a0360bf6" }, + "copilot.lua": { "branch": "master", "commit": "0929c92097a49b6ae3565aab157fa2bce398d953" }, + "csvview.nvim": { "branch": "main", "commit": "6eb9c7293d35c40a71ec1eb9c653d80e8de5a2e9" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, - "friendly-snippets": { "branch": "main", "commit": "31f2a2657b6261724313281fe0d8ba6f43f4a4fa" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, - "gitsigns.nvim": { "branch": "main", "commit": "02eafb1273afec94447f66d1a43fc5e477c2ab8a" }, + "gitsigns.nvim": { "branch": "main", "commit": "e399f9748d7cfd8859747c8d6c4e9c8b4d50a1bd" }, "gradle.nvim": { "branch": "main", "commit": "1d44d64c1dc157ab11c9d8669c108ab02f789662" }, - "grug-far.nvim": { "branch": "main", "commit": "1c9325f6ab18fc8ac4d4c57e765aa845af148277" }, + "grug-far.nvim": { "branch": "main", "commit": "176ba4c42924f4d84ee7d19c9f0081c538f84a88" }, "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lsp-zero.nvim": { "branch": "v4.x", "commit": "2afa32e732d7b36e80cd5241fbdc4a38e123c4e0" }, - "lualine.nvim": { "branch": "master", "commit": "86fe39534b7da729a1ac56c0466e76f2c663dc42" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, - "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, + "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" }, + "mason.nvim": { "branch": "main", "commit": "888d6ee499d8089a3a4be4309d239d6be1c1e6c0" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, "mini.cursorword": { "branch": "main", "commit": "ab63cc74975f4e107dbb490f6d3040eacfc1c023" }, "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, - "neogit": { "branch": "master", "commit": "9bb1e73c534f767607e0a888f3de4c942825c501" }, - "neotest": { "branch": "master", "commit": "c3b5930d1512054c313a5ce76dd15f7301c973e8" }, - "neotest-java": { "branch": "main", "commit": "0ca4f0ffaf23464e0d8940ab485d129298a335ac" }, + "neogit": { "branch": "master", "commit": "6de4b9f9a92917f9aea3a0dbdc3dbbedc11d26be" }, + "neotest": { "branch": "master", "commit": "862afb2a2219d9ca565f67416fb7003cc0f22c4f" }, + "neotest-java": { "branch": "main", "commit": "3cc0bceb0b0957e918939ba95434197e6b3775e7" }, "neotest-minitest": { "branch": "main", "commit": "7ff057de8ab2c27491ff27c7be9826b8f3bb5ec1" }, "neotest-rspec": { "branch": "main", "commit": "281c0ed0e55d623e8028796e1c4dc27b7e421fd0" }, - "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, + "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, - "nvim-lspconfig": { "branch": "master", "commit": "b70b900fba6e3255a5a8113c76f213102564cb0d" }, + "nvim-lspconfig": { "branch": "master", "commit": "ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-surround": { "branch": "main", "commit": "caf6f633d4d77a29b6e265b560c5a035d171a913" }, - "nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" }, - "nvim-treesitter-endwise": { "branch": "master", "commit": "8b6436303dda9ce6ed4b3733fd15703eb3589c36" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "205e3369bc83d8cb83f7409c36120e24611f8c5c" }, + "nvim-surround": { "branch": "main", "commit": "0e62500b98f4513feaaf7425c135472457ea5b7d" }, + "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "d6cbb83307d516ec076d17c9a33d704ef626ee8c" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "b0debd5c424969b4baeabdc8f54db3036c691732" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, - "nvim-web-devicons": { "branch": "master", "commit": "c90dee4e930ab9f49fa6d77f289bff335b49e972" }, + "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, "oil.nvim": { "branch": "feat/scratch-preview", "commit": "15a17fdff4866394bdf1f7bf081b818ec3de44f5" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, "plantuml-previewer.vim": { "branch": "master", "commit": "368a1f331c1ff29f6a3ee76facfca39a7f374b13" }, @@ -63,9 +63,7 @@ "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }, "vim-polar": { "branch": "master", "commit": "dc7723d0a8ee8b00a3d15ef19c6720403654c23b" }, "vim-rails": { "branch": "master", "commit": "b0a5c76f86ea214ade36ab0b811e730c3f0add67" }, - "vim-tmux-navigator": { "branch": "master", "commit": "791dacfcfc8ccb7f6eb1c853050883b03e5a22fe" }, + "vim-tmux-navigator": { "branch": "master", "commit": "33afa80db65113561dc53fa732b7f5e53d5ecfd0" }, "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, - "vim-zellij-navigator.nvim": { "branch": "main", "commit": "380d6d55d13fe60f91ac0c8303749c2c12fdc85a" }, - "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, - "zellij-nav.nvim": { "branch": "main", "commit": "91cc2a642d8927ebde50ced5bf71ba470a0fc116" } + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/.config/nvim/lua/plugins/csvview.lua b/.config/nvim/lua/plugins/csvview.lua new file mode 100644 index 0000000..51f1bbe --- /dev/null +++ b/.config/nvim/lua/plugins/csvview.lua @@ -0,0 +1,22 @@ +return { + "hat0uma/csvview.nvim", + ---@module "csvview" + ---@type CsvView.Options + opts = { + parser = { comments = { "#", "//" } }, + keymaps = { + -- Text objects for selecting fields + textobject_field_inner = { "if", mode = { "o", "x" } }, + textobject_field_outer = { "af", mode = { "o", "x" } }, + -- Excel-like navigation: + -- Use and to move horizontally between fields. + -- Use and to move vertically between rows and place the cursor at the end of the field. + -- Note: In terminals, you may need to enable CSI-u mode to use and . + jump_next_field_end = { "", mode = { "n", "v" } }, + jump_prev_field_end = { "", mode = { "n", "v" } }, + jump_next_row = { "", mode = { "n", "v" } }, + jump_prev_row = { "", mode = { "n", "v" } }, + }, + }, + cmd = { "CsvViewEnable", "CsvViewDisable", "CsvViewToggle" }, +} diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index 1df7df5..46af7fa 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -1,48 +1,274 @@ return { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - lazy = false, - config = function() - require("lualine").setup({ - options = { - icons_enabled = true, - -- theme = 'ayu_light', - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - always_show_tabline = true, - globalstatus = false, - refresh = { - statusline = 100, - tabline = 100, - winbar = 100, - }, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch", "diff", "diagnostics" }, - lualine_c = { "filename" }, - lualine_x = { "fileformat", "filetype" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = { "location" }, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {}, - }) - end, -} + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + lazy = false, + config = function() + + -- Eviline config for lualine + -- Author: shadmansaleh + -- Credit: glepnir + local lualine = require('lualine') + + -- Color table for highlights + -- stylua: ignore + local colors = { + bg = '#202328', + fg = '#bbc2cf', + yellow = '#ECBE7B', + cyan = '#008080', + darkblue = '#081633', + green = '#98be65', + orange = '#FF8800', + violet = '#a9a1e1', + magenta = '#c678dd', + blue = '#51afef', + red = '#ec5f67', + } + + local conditions = { + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > 80 + end, + check_git_workspace = function() + local filepath = vim.fn.expand('%:p:h') + local gitdir = vim.fn.finddir('.git', filepath .. ';') + return gitdir and #gitdir > 0 and #gitdir < #filepath + end, + } + + -- Config + local config = { + options = { + -- Disable sections and component separators + component_separators = '', + section_separators = '', + theme = { + -- We are going to use lualine_c an lualine_x as left and + -- right section. Both are highlighted by c theme . So we + -- are just setting default looks o statusline + normal = { c = { fg = colors.fg, bg = colors.bg } }, + inactive = { c = { fg = colors.fg, bg = colors.bg } }, + }, + }, + sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + -- These will be filled later + lualine_c = {}, + lualine_x = {}, + }, + inactive_sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + lualine_c = {}, + lualine_x = {}, + }, + } + + -- Inserts a component in lualine_c at left section + local function ins_left(component) + table.insert(config.sections.lualine_c, component) + end + + -- Inserts a component in lualine_x at right section + local function ins_right(component) + table.insert(config.sections.lualine_x, component) + end + + ins_left { + function() + return '▊' + end, + color = { fg = colors.blue }, -- Sets highlighting of component + padding = { left = 0, right = 1 }, -- We don't need space before this + } + + ins_left { + -- mode component + function() + return '' + end, + color = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.red, + i = colors.green, + v = colors.blue, + [''] = colors.blue, + V = colors.blue, + c = colors.magenta, + no = colors.red, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.violet, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { right = 1 }, + } + + ins_left { + -- filesize component + 'filesize', + cond = conditions.buffer_not_empty, + } + + ins_left { + 'filename', + cond = conditions.buffer_not_empty, + color = { fg = colors.magenta, gui = 'bold' }, + } + + ins_left { 'location' } + + ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } } + + ins_left { + 'diagnostics', + sources = { 'nvim_diagnostic' }, + symbols = { error = ' ', warn = ' ', info = ' ' }, + diagnostics_color = { + error = { fg = colors.red }, + warn = { fg = colors.yellow }, + info = { fg = colors.cyan }, + }, + } + + -- Insert mid section. You can make any number of sections in neovim :) + -- for lualine it's any number greater then 2 + ins_left { + function() + return '%=' + end, + } + + ins_left { + -- Lsp server name . + function() + local msg = 'No Active Lsp' + local buf_ft = vim.api.nvim_get_option_value('filetype', { buf = 0 }) + local clients = vim.lsp.get_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end, + icon = ' LSP:', + color = { fg = '#ffffff', gui = 'bold' }, + } + + -- Add components to right sections + ins_right { + 'o:encoding', -- option component same as &encoding in viml + fmt = string.upper, -- I'm not sure why it's upper case either ;) + cond = conditions.hide_in_width, + color = { fg = colors.green, gui = 'bold' }, + } + + ins_right { + 'fileformat', + fmt = string.upper, + icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh + color = { fg = colors.green, gui = 'bold' }, + } + + ins_right { + 'branch', + icon = '', + color = { fg = colors.violet, gui = 'bold' }, + } + + ins_right { + 'diff', + -- Is it me or the symbol for modified us really weird + symbols = { added = ' ', modified = '󰝤 ', removed = ' ' }, + diff_color = { + added = { fg = colors.green }, + modified = { fg = colors.orange }, + removed = { fg = colors.red }, + }, + cond = conditions.hide_in_width, + } + + ins_right { + function() + return '▊' + end, + color = { fg = colors.blue }, + padding = { left = 1 }, + } + + -- Now don't forget to initialize lualine + lualine.setup(config) + + + + + -- require("lualine").setup({ + -- options = { + -- icons_enabled = true, + -- -- theme = 'ayu_light', + -- component_separators = { left = "", right = "" }, + -- section_separators = { left = "", right = "" }, + -- disabled_filetypes = { + -- statusline = {}, + -- winbar = {}, + -- }, + -- ignore_focus = {}, + -- always_divide_middle = true, + -- always_show_tabline = true, + -- globalstatus = false, + -- refresh = { + -- statusline = 100, + -- tabline = 100, + -- winbar = 100, + -- }, + -- }, + -- sections = { + -- lualine_a = { "mode" }, + -- lualine_b = { "branch", "diff", "diagnostics" }, + -- lualine_c = { "filename" }, + -- lualine_x = { "fileformat", "filetype" }, + -- lualine_y = { "progress" }, + -- lualine_z = { "location" }, + -- }, + -- inactive_sections = { + -- lualine_a = {}, + -- lualine_b = {}, + -- lualine_c = { "filename" }, + -- lualine_x = { "location" }, + -- lualine_y = {}, + -- lualine_z = {}, + -- }, + -- tabline = {}, + -- winbar = {}, + -- inactive_winbar = {}, + -- extensions = {}, + -- }) + end, + } diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua index 238ae19..637ebf7 100644 --- a/.config/nvim/lua/plugins/nvim-cmp.lua +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -72,7 +72,7 @@ return { -- { name = 'treesitter' }, { name = "luasnip" }, }, { - -- { name = 'buffer' }, + { name = 'buffer' }, { name = "path" }, }), }) diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index 208d9c7..bf7e528 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -6,32 +6,28 @@ return { "VonHeikemen/lsp-zero.nvim", { "williamboman/mason.nvim", - commands = { "Mason" }, config = function() require("mason").setup() end, }, { "williamboman/mason-lspconfig.nvim", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "rust_analyzer" }, - defaults = { - rust_analyzer = { - cargo = { features = "*" }, - }, - }, - }) - end, - keys = { - { "li", "LspInfo", desc = "Lsp info" }, - { "ll", "LspLog", desc = "Lsp log" }, - }, + dependencies = { "williamboman/mason.nvim" }, }, }, + keys = { + { "li", "LspInfo", desc = "Lsp info" }, + { "ll", "LspLog", desc = "Lsp log" }, + }, config = function() - local lspconfig = require("lspconfig") + -- Setup mason-lspconfig with v2.0 API + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "rust_analyzer" }, + automatic_enable = true, -- This automatically enables installed servers + }) + -- Setup LSP capabilities for autocompletion + local lspconfig = require("lspconfig") local lspconfig_defaults = lspconfig.util.default_config lspconfig_defaults.capabilities = vim.tbl_deep_extend( "force", @@ -39,12 +35,16 @@ return { require("cmp_nvim_lsp").default_capabilities() ) - require("mason-lspconfig").setup_handlers({ - function(server) - lspconfig[server].setup({}) - end, + -- Configure ruby-lsp using the new vim.lsp.config API + vim.lsp.config('ruby-lsp', { + init_options = { + settings = { + -- Server settings should go here + } + } }) + -- LSP keymaps and autocmds vim.api.nvim_create_autocmd("LspAttach", { desc = "LSP actions", callback = function(event) diff --git a/.config/nvim/lua/plugins/refactoring.lua b/.config/nvim/lua/plugins/refactoring.lua new file mode 100644 index 0000000..08477ba --- /dev/null +++ b/.config/nvim/lua/plugins/refactoring.lua @@ -0,0 +1,11 @@ + return { + "ThePrimeagen/refactoring.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + lazy = false, + config = function() + require("refactoring").setup() + end, + } diff --git a/.config/nvim/lua/plugins/vim-rails.lua b/.config/nvim/lua/plugins/vim-rails.lua index 6624b4f..4b85a73 100644 --- a/.config/nvim/lua/plugins/vim-rails.lua +++ b/.config/nvim/lua/plugins/vim-rails.lua @@ -1,4 +1,5 @@ return { "tpope/vim-rails", + lazy = false, ft = { "ruby" }, } diff --git a/.config/nvim/lua/plugins/zj-navigator.lua b/.config/nvim/lua/plugins/zj-navigator.lua index 9beff38..32e0bfc 100644 --- a/.config/nvim/lua/plugins/zj-navigator.lua +++ b/.config/nvim/lua/plugins/zj-navigator.lua @@ -1,12 +1,12 @@ return { - 'dynamotn/Navigator.nvim', - lazy = false, - config = function() - require('Navigator').setup() - vim.keymap.set({'n', 't'}, '', 'NavigatorLeft') - vim.keymap.set({'n', 't'}, '', 'NavigatorRight') - vim.keymap.set({'n', 't'}, '', 'NavigatorUp') - vim.keymap.set({'n', 't'}, '', 'NavigatorDown') - vim.keymap.set({'n', 't'}, '', 'NavigatorPrevious') - end + -- 'dynamotn/Navigator.nvim', + -- lazy = false, + -- config = function() + -- require('Navigator').setup() + -- vim.keymap.set({'n', 't'}, '', 'NavigatorLeft') + -- vim.keymap.set({'n', 't'}, '', 'NavigatorRight') + -- vim.keymap.set({'n', 't'}, '', 'NavigatorUp') + -- vim.keymap.set({'n', 't'}, '', 'NavigatorDown') + -- vim.keymap.set({'n', 't'}, '', 'NavigatorPrevious') + -- end } diff --git a/.config/nvim/lua/plugins/zj-vim-zellij-navigator.lua b/.config/nvim/lua/plugins/zj-vim-zellij-navigator.lua index 2c66ecb..d3c2ad2 100644 --- a/.config/nvim/lua/plugins/zj-vim-zellij-navigator.lua +++ b/.config/nvim/lua/plugins/zj-vim-zellij-navigator.lua @@ -1,7 +1,7 @@ return { - "hiasr/vim-zellij-navigator.nvim", - lazy = false, - config = function() - require('vim-zellij-navigator').setup() - end + -- "hiasr/vim-zellij-navigator.nvim", + -- lazy = false, + -- config = function() + -- require('vim-zellij-navigator').setup() + -- end } diff --git a/.config/nvim/lua/plugins/zj-zellij-nav.lua b/.config/nvim/lua/plugins/zj-zellij-nav.lua index 66bd254..2cd919f 100644 --- a/.config/nvim/lua/plugins/zj-zellij-nav.lua +++ b/.config/nvim/lua/plugins/zj-zellij-nav.lua @@ -1,12 +1,12 @@ return { - "swaits/zellij-nav.nvim", - lazy = true, - event = "VeryLazy", - keys = { - { "", "ZellijNavigateLeftTab", { silent = true, desc = "navigate left or tab" } }, - { "", "ZellijNavigateDown", { silent = true, desc = "navigate down" } }, - { "", "ZellijNavigateUp", { silent = true, desc = "navigate up" } }, - { "", "ZellijNavigateRightTab", { silent = true, desc = "navigate right or tab" } }, - }, - opts = {}, + -- "swaits/zellij-nav.nvim", + -- lazy = true, + -- event = "VeryLazy", + -- keys = { + -- { "", "ZellijNavigateLeftTab", { silent = true, desc = "navigate left or tab" } }, + -- { "", "ZellijNavigateDown", { silent = true, desc = "navigate down" } }, + -- { "", "ZellijNavigateUp", { silent = true, desc = "navigate up" } }, + -- { "", "ZellijNavigateRightTab", { silent = true, desc = "navigate right or tab" } }, + -- }, + -- opts = {}, } diff --git a/.config/nvim/vscode.lua b/.config/nvim/vscode.lua new file mode 100644 index 0000000..5ae03b3 --- /dev/null +++ b/.config/nvim/vscode.lua @@ -0,0 +1,80 @@ +-- Options +vim.o.clipboard = "unnamedplus" +vim.g.mapleader = " " +vim.g.maplocalleader = "," + +-- Plugins + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) +end + +vim.opt.rtp:prepend(lazypath) + +local plugins = { + { + { + "tpope/vim-rails", + lazy = false, + ft = { "ruby" }, + }, + }, +} + +local opts = { defaults = { lazy = true }, change_detection = { notify = false } } + +require("lazy").setup(plugins, opts) + +-- Other +-- Borrowed from: https://github.com/milanglacier/nvim/blob/f54b7356dc97cbf9b07a77d5db1ad199c2ff3f2e/lua/conf/vscode.lua#L29 + +local M = {} + +local augroup = vim.api.nvim_create_augroup +local keymap = vim.api.nvim_set_keymap + +M.my_vscode = augroup("MyVSCode", {}) + +vim.filetype.add({ + pattern = { + [".*%.ipynb.*"] = "python", + }, +}) +local function notify(cmd) + return string.format("call VSCodeNotify('%s')", cmd) +end + +local function v_notify(cmd) + return string.format("call VSCodeNotifyVisual('%s', 1)", cmd) +end + +keymap("n", "xr", notify("references-view.findReferences"), { silent = true }) -- language references +keymap("n", "xd", notify("workbench.actions.view.problems"), { silent = true }) -- language diagnostics +keymap("n", "gr", notify("editor.action.goToReferences"), { silent = true }) +keymap("n", "rn", notify("editor.action.rename"), { silent = true }) +keymap("n", "fm", notify("editor.action.formatDocument"), { silent = true }) +keymap("n", "ca", notify("editor.action.refactor"), { silent = true }) -- language code actions + +keymap("n", "rg", notify("workbench.action.findInFiles"), { silent = true }) -- use ripgrep to search files +keymap("n", "ts", notify("workbench.action.toggleSidebarVisibility"), { silent = true }) +keymap("n", "th", notify("workbench.action.toggleAuxiliaryBar"), { silent = true }) -- toggle docview (help page) +keymap("n", "tp", notify("workbench.action.togglePanel"), { silent = true }) +keymap("n", "fc", notify("workbench.action.showCommands"), { silent = true }) -- find commands +keymap("n", "ff", notify("workbench.action.quickOpen"), { silent = true }) -- find files +keymap("n", "tw", notify("workbench.action.terminal.toggleTerminal"), { silent = true }) -- terminal window + +keymap("v", "fm", v_notify("editor.action.formatSelection"), { silent = true }) +keymap("v", "ca", v_notify("editor.action.refactor"), { silent = true }) +keymap("v", "fc", v_notify("workbench.action.showCommands"), { silent = true }) + +keymap("n", "r", notify("command.railsFastNavigation"), { silent = false }) + +return M diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml new file mode 100644 index 0000000..5d3b6f4 --- /dev/null +++ b/.github/workflows/setup.yml @@ -0,0 +1,15 @@ +name: Macos Install + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + build: + runs-on: macOS-latest + + steps: + - uses: actions/checkout@v1 + - name: Execute full install + run: ./setup.sh diff --git a/.tmux.conf b/.tmux.conf index 66e9728..098c21a 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -10,6 +10,8 @@ unbind % bind | split-window -h -c "#{pane_current_path}" bind c new-window -c "#{pane_current_path}" +bind g + setw -g mode-keys vi bind-key h select-pane -L bind-key j select-pane -D @@ -28,7 +30,7 @@ bind r source-file ~/.tmux.conf; set -g mouse on set -g default-terminal "screen-256color" set -ag terminal-overrides ",xterm-256color:RGB" -set-option -g status-position bottom +set-option -g status-position top set-option -g status on set-option -g renumber-windows on set -g pane-border-lines "single" diff --git a/scripts/zip_split.sh b/scripts/zip_split.sh new file mode 100755 index 0000000..2195771 --- /dev/null +++ b/scripts/zip_split.sh @@ -0,0 +1,109 @@ +#!/bin/bash + +set -euo pipefail + +# --- Config --- +DEFAULT_MAX_SIZE_MB=500 +ZIP_PREFIX="archive_part" +OUTPUT_DIR="zipped_parts" + +# --- Help --- +print_help() { + cat < [max_size_mb] + +Splits files from a directory into zip archives, each under a max size. +Useful for platforms like Discord with upload size limits. + +Arguments: + directory Path to directory containing files to archive + max_size_mb Maximum size per zip file in MB (default: $DEFAULT_MAX_SIZE_MB) + +Options: + -h, --help Show this help message + +Example: + $(basename "$0") ./my_folder 500 +EOF +} + +# --- Platform-aware file size function --- +file_size() { + if [[ "$(uname)" == "Darwin" ]]; then + stat -f%z "$1" # macOS + else + stat --printf="%s" "$1" # Linux + fi +} + +# --- Parse args --- +if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then + print_help + exit 0 +fi + +if [[ $# -lt 1 ]]; then + echo "❌ Error: Missing directory argument." + print_help + exit 1 +fi + +SOURCE_DIR="$1" +MAX_SIZE_MB="${2:-$DEFAULT_MAX_SIZE_MB}" + +# Validate that MAX_SIZE_MB is a number +if ! [[ "$MAX_SIZE_MB" =~ ^[0-9]+$ ]]; then + echo "❌ Error: max_size_mb must be a number." + print_help + exit 1 +fi + +MAX_SIZE_BYTES=$((MAX_SIZE_MB * 1024 * 1024)) + +if [[ ! -d "$SOURCE_DIR" ]]; then + echo "❌ Error: Directory '$SOURCE_DIR' does not exist." + exit 1 +fi + +mkdir -p "$OUTPUT_DIR" + +# --- Main --- +CURRENT_BATCH=() +CURRENT_SIZE=0 +PART_INDEX=1 + +echo "📂 Scanning files in: $SOURCE_DIR" +echo "📦 Max size per archive: $MAX_SIZE_MB MB" +echo "📁 Output directory: $OUTPUT_DIR" + +shopt -s nullglob +for FILE in "$SOURCE_DIR"/*; do + [[ -f "$FILE" ]] || continue + SIZE=$(file_size "$FILE") + + if (( SIZE > MAX_SIZE_BYTES )); then + echo "⚠️ Skipping large file: $(basename "$FILE") (${SIZE} bytes)" + continue + fi + + if (( CURRENT_SIZE + SIZE > MAX_SIZE_BYTES && CURRENT_SIZE > 0 )); then + ZIP_NAME="$OUTPUT_DIR/${ZIP_PREFIX}${PART_INDEX}.zip" + echo "📦 Creating $ZIP_NAME..." + zip -j -q "$ZIP_NAME" "${CURRENT_BATCH[@]}" + ((PART_INDEX++)) + CURRENT_BATCH=() + CURRENT_SIZE=0 + fi + + CURRENT_BATCH+=("$FILE") + CURRENT_SIZE=$((CURRENT_SIZE + SIZE)) +done + +if (( ${#CURRENT_BATCH[@]} > 0 )); then + ZIP_NAME="$OUTPUT_DIR/${ZIP_PREFIX}${PART_INDEX}.zip" + echo "📦 Creating $ZIP_NAME..." + zip -j -q "$ZIP_NAME" "${CURRENT_BATCH[@]}" +fi + +echo "✅ Done! Created zip files in '$OUTPUT_DIR'." + From 2e1eeefc21e3f69b6c19150f9a60be4f31e8c3cf Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 3 Jun 2025 22:35:25 +0200 Subject: [PATCH 262/280] Add zj config --- .config/zellij/config.kdl | 502 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 502 insertions(+) create mode 100644 .config/zellij/config.kdl diff --git a/.config/zellij/config.kdl b/.config/zellij/config.kdl new file mode 100644 index 0000000..d8b0e78 --- /dev/null +++ b/.config/zellij/config.kdl @@ -0,0 +1,502 @@ +// +// THIS FILE WAS AUTOGENERATED BY ZELLIJ, THE PREVIOUS FILE AT THIS LOCATION WAS COPIED TO: /Users/dani/.config/zellij/config.kdl.bak.2 +// + +pane_frames false +keybinds clear-defaults=true { + locked { + bind "Alt g" { SwitchToMode "normal"; } + } + pane { + bind "left" { MoveFocus "left"; } + bind "down" { MoveFocus "down"; } + bind "up" { MoveFocus "up"; } + bind "right" { MoveFocus "right"; } + bind "c" { SwitchToMode "renamepane"; PaneNameInput 0; } + bind "d" { NewPane "down"; SwitchToMode "normal"; } + bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "normal"; } + bind "f" { ToggleFocusFullscreen; SwitchToMode "normal"; } + bind "h" { MoveFocus "left"; } + bind "i" { TogglePanePinned; SwitchToMode "normal"; } + bind "j" { MoveFocus "down"; } + bind "k" { MoveFocus "up"; } + bind "l" { MoveFocus "right"; } + bind "n" { NewPane; SwitchToMode "normal"; } + bind "p" { SwitchFocus; } + bind "Alt p" { SwitchToMode "normal"; } + bind "r" { NewPane "right"; SwitchToMode "normal"; } + bind "w" { ToggleFloatingPanes; SwitchToMode "normal"; } + bind "z" { TogglePaneFrames; SwitchToMode "normal"; } + } + tab { + bind "left" { GoToPreviousTab; } + bind "down" { GoToNextTab; } + bind "up" { GoToPreviousTab; } + bind "right" { GoToNextTab; } + bind "1" { GoToTab 1; SwitchToMode "normal"; } + bind "2" { GoToTab 2; SwitchToMode "normal"; } + bind "3" { GoToTab 3; SwitchToMode "normal"; } + bind "4" { GoToTab 4; SwitchToMode "normal"; } + bind "5" { GoToTab 5; SwitchToMode "normal"; } + bind "6" { GoToTab 6; SwitchToMode "normal"; } + bind "7" { GoToTab 7; SwitchToMode "normal"; } + bind "8" { GoToTab 8; SwitchToMode "normal"; } + bind "9" { GoToTab 9; SwitchToMode "normal"; } + bind "[" { BreakPaneLeft; SwitchToMode "normal"; } + bind "]" { BreakPaneRight; SwitchToMode "normal"; } + bind "b" { BreakPane; SwitchToMode "normal"; } + bind "h" { GoToPreviousTab; } + bind "j" { GoToNextTab; } + bind "k" { GoToPreviousTab; } + bind "l" { GoToNextTab; } + bind "n" { NewTab; SwitchToMode "normal"; } + bind "r" { SwitchToMode "renametab"; TabNameInput 0; } + bind "s" { ToggleActiveSyncTab; SwitchToMode "normal"; } + bind "Alt t" { SwitchToMode "normal"; } + bind "x" { CloseTab; SwitchToMode "normal"; } + bind "tab" { ToggleTab; } + } + resize { + bind "left" { Resize "Increase left"; } + bind "down" { Resize "Increase down"; } + bind "up" { Resize "Increase up"; } + bind "right" { Resize "Increase right"; } + bind "+" { Resize "Increase"; } + bind "-" { Resize "Decrease"; } + bind "=" { Resize "Increase"; } + bind "H" { Resize "Decrease left"; } + bind "J" { Resize "Decrease down"; } + bind "K" { Resize "Decrease up"; } + bind "L" { Resize "Decrease right"; } + bind "h" { Resize "Increase left"; } + bind "j" { Resize "Increase down"; } + bind "k" { Resize "Increase up"; } + bind "l" { Resize "Increase right"; } + bind "Alt n" { SwitchToMode "normal"; } + } + move { + bind "left" { MovePane "left"; } + bind "down" { MovePane "down"; } + bind "up" { MovePane "up"; } + bind "right" { MovePane "right"; } + bind "h" { MovePane "left"; } + bind "Alt h" { SwitchToMode "normal"; } + bind "j" { MovePane "down"; } + bind "k" { MovePane "up"; } + bind "l" { MovePane "right"; } + bind "n" { MovePane; } + bind "p" { MovePaneBackwards; } + bind "tab" { MovePane; } + } + scroll { + bind "Alt left" { MoveFocusOrTab "left"; SwitchToMode "normal"; } + bind "Alt down" { MoveFocus "down"; SwitchToMode "normal"; } + bind "Alt up" { MoveFocus "up"; SwitchToMode "normal"; } + bind "Alt right" { MoveFocusOrTab "right"; SwitchToMode "normal"; } + bind "e" { EditScrollback; SwitchToMode "normal"; } + bind "Alt j" { MoveFocus "down"; SwitchToMode "normal"; } + bind "Alt k" { MoveFocus "up"; SwitchToMode "normal"; } + bind "Alt l" { MoveFocusOrTab "right"; SwitchToMode "normal"; } + bind "s" { SwitchToMode "entersearch"; SearchInput 0; } + bind "Alt s" { SwitchToMode "normal"; } + } + search { + bind "c" { SearchToggleOption "CaseSensitivity"; } + bind "n" { Search "down"; } + bind "o" { SearchToggleOption "WholeWord"; } + bind "p" { Search "up"; } + bind "Ctrl s" { SwitchToMode "normal"; } + bind "w" { SearchToggleOption "Wrap"; } + } + session { + bind "a" { + LaunchOrFocusPlugin "zellij:about" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + bind "c" { + LaunchOrFocusPlugin "configuration" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + bind "Alt o" { SwitchToMode "normal"; } + bind "p" { + LaunchOrFocusPlugin "plugin-manager" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + bind "w" { + LaunchOrFocusPlugin "session-manager" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + } + shared_among "normal" "locked" { + bind "Alt Shift left" { MoveFocusOrTab "left"; } + bind "Alt Shift down" { MoveFocus "down"; } + bind "Alt Shift up" { MoveFocus "up"; } + bind "Alt Shift right" { MoveFocusOrTab "right"; } + bind "Alt Shift +" { Resize "Increase"; } + bind "Alt Shift -" { Resize "Decrease"; } + bind "Alt Shift =" { Resize "Increase"; } + bind "Alt Shift [" { PreviousSwapLayout; } + bind "Alt Shift ]" { NextSwapLayout; } + bind "Alt Shift f" { ToggleFloatingPanes; } + bind "Alt Shift h" { MoveFocusOrTab "left"; } + bind "Alt Shift i" { MoveTab "left"; } + bind "Alt Shift j" { MoveFocus "down"; } + bind "Alt Shift k" { MoveFocus "up"; } + bind "Alt Shift l" { MoveFocusOrTab "right"; } + bind "Alt Shift n" { NewPane; } + bind "Alt Shift o" { MoveTab "right"; } + } + shared_except "locked" "entersearch" "renametab" "renamepane" "move" "prompt" "tmux" { + bind "Alt h" { SwitchToMode "move"; } + } + shared_except "locked" "entersearch" "renametab" "renamepane" "prompt" "tmux" { + bind "Alt g" { SwitchToMode "locked"; } + bind "Alt q" { Quit; } + } + shared_except "locked" "entersearch" "renametab" "renamepane" "session" "prompt" "tmux" { + bind "Alt o" { SwitchToMode "session"; } + } + shared_except "locked" "scroll" "search" "tmux" { + bind "Ctrl b" { SwitchToMode "tmux"; } + } + shared_except "locked" "scroll" "entersearch" "renametab" "renamepane" "prompt" "tmux" { + bind "Alt s" { SwitchToMode "scroll"; } + } + shared_except "locked" "tab" "entersearch" "renametab" "renamepane" "prompt" "tmux" { + bind "Alt t" { SwitchToMode "tab"; } + } + shared_except "locked" "pane" "entersearch" "renametab" "renamepane" "prompt" "tmux" { + bind "Alt p" { SwitchToMode "pane"; } + } + shared_except "locked" "resize" "entersearch" "renametab" "renamepane" "prompt" "tmux" { + bind "Alt n" { SwitchToMode "resize"; } + } + shared_except "normal" "locked" { + bind "Alt +" { Resize "Increase"; } + bind "Alt -" { Resize "Decrease"; } + bind "Alt =" { Resize "Increase"; } + bind "Alt [" { PreviousSwapLayout; } + bind "Alt ]" { NextSwapLayout; } + bind "Alt f" { ToggleFloatingPanes; } + bind "Alt i" { MoveTab "left"; } + } + shared_except "normal" "locked" "entersearch" { + bind "enter" { SwitchToMode "normal"; } + } + shared_except "normal" "locked" "entersearch" "renametab" "renamepane" { + bind "esc" { SwitchToMode "normal"; } + } + shared_except "normal" "locked" "scroll" { + bind "Alt left" { MoveFocusOrTab "left"; } + bind "Alt down" { MoveFocus "down"; } + bind "Alt up" { MoveFocus "up"; } + bind "Alt right" { MoveFocusOrTab "right"; } + bind "Alt j" { MoveFocus "down"; } + bind "Alt k" { MoveFocus "up"; } + bind "Alt l" { MoveFocusOrTab "right"; } + } + shared_among "pane" "tmux" { + bind "x" { CloseFocus; SwitchToMode "normal"; } + } + shared_among "scroll" "search" { + bind "PageDown" { PageScrollDown; } + bind "PageUp" { PageScrollUp; } + bind "left" { PageScrollUp; } + bind "down" { ScrollDown; } + bind "up" { ScrollUp; } + bind "right" { PageScrollDown; } + bind "Ctrl b" { PageScrollUp; } + bind "Ctrl c" { ScrollToBottom; SwitchToMode "normal"; } + bind "d" { HalfPageScrollDown; } + bind "Ctrl f" { PageScrollDown; } + bind "h" { PageScrollUp; } + bind "j" { ScrollDown; } + bind "k" { ScrollUp; } + bind "l" { PageScrollDown; } + bind "u" { HalfPageScrollUp; } + } + entersearch { + bind "Ctrl c" { SwitchToMode "scroll"; } + bind "esc" { SwitchToMode "scroll"; } + bind "enter" { SwitchToMode "search"; } + } + shared_among "entersearch" "renametab" "renamepane" "prompt" "tmux" { + bind "Ctrl g" { SwitchToMode "locked"; } + bind "Ctrl h" { SwitchToMode "move"; } + bind "Alt h" { MoveFocusOrTab "left"; } + bind "Ctrl n" { SwitchToMode "resize"; } + bind "Alt n" { NewPane; } + bind "Ctrl o" { SwitchToMode "session"; } + bind "Alt o" { MoveTab "right"; } + bind "Ctrl p" { SwitchToMode "pane"; } + bind "Ctrl q" { Quit; } + bind "Ctrl s" { SwitchToMode "scroll"; } + bind "Ctrl t" { SwitchToMode "tab"; } + } + renametab { + bind "esc" { UndoRenameTab; SwitchToMode "tab"; } + } + shared_among "renametab" "renamepane" { + bind "Ctrl c" { SwitchToMode "normal"; } + } + renamepane { + bind "esc" { UndoRenamePane; SwitchToMode "pane"; } + } + shared_among "session" "tmux" { + bind "d" { Detach; } + } + tmux { + bind "left" { MoveFocus "left"; SwitchToMode "normal"; } + bind "down" { MoveFocus "down"; SwitchToMode "normal"; } + bind "up" { MoveFocus "up"; SwitchToMode "normal"; } + bind "right" { MoveFocus "right"; SwitchToMode "normal"; } + bind "space" { NextSwapLayout; } + bind "\"" { NewPane "down"; SwitchToMode "normal"; } + bind "%" { NewPane "right"; SwitchToMode "normal"; } + bind "," { SwitchToMode "renametab"; } + bind "[" { SwitchToMode "scroll"; } + bind "Ctrl b" { Write 2; SwitchToMode "normal"; } + bind "c" { NewTab; SwitchToMode "normal"; } + bind "h" { MoveFocus "left"; SwitchToMode "normal"; } + bind "j" { MoveFocus "down"; SwitchToMode "normal"; } + bind "k" { MoveFocus "up"; SwitchToMode "normal"; } + bind "l" { MoveFocus "right"; SwitchToMode "normal"; } + bind "n" { GoToNextTab; SwitchToMode "normal"; } + bind "o" { FocusNextPane; } + bind "p" { GoToPreviousTab; SwitchToMode "normal"; } + bind "z" { ToggleFocusFullscreen; SwitchToMode "normal"; } + } +} + +// Plugin aliases - can be used to change the implementation of Zellij +// changing these requires a restart to take effect +plugins { + about location="zellij:about" + compact-bar location="zellij:compact-bar" + configuration location="zellij:configuration" + filepicker location="zellij:strider" { + cwd "/" + } + plugin-manager location="zellij:plugin-manager" + session-manager location="zellij:session-manager" + status-bar location="zellij:status-bar" + strider location="zellij:strider" + tab-bar location="zellij:tab-bar" + welcome-screen location="zellij:session-manager" { + welcome_screen true + } +} + +// Plugins to load in the background when a new session starts +// eg. "file:/path/to/my-plugin.wasm" +// eg. "https://example.com/my-plugin.wasm" +// load_plugins { +// "https://github.com/dj95/zjstatus/releases/download/latest/zjstatus.wasm" +// } + +// Use a simplified UI without special fonts (arrow glyphs) +// Options: +// - true +// - false (Default) +// +// simplified_ui true + +// Choose the theme that is specified in the themes section. +// Default: default +// +theme "tokyo-night-dark" + +// Choose the base input mode of zellij. +// Default: normal +// +// default_mode "normal" + +// Choose the path to the default shell that zellij will use for opening new panes +// Default: $SHELL +// +// default_shell "fish" + +// Choose the path to override cwd that zellij will use for opening new panes +// +// default_cwd "/tmp" + +// The name of the default layout to load on startup +// Default: "default" +// +// default_layout "my_layout" + +// The folder in which Zellij will look for layouts +// (Requires restart) +// +// layout_dir "/tmp" + +// The folder in which Zellij will look for themes +// (Requires restart) +// +// theme_dir "/tmp" + +// Toggle enabling the mouse mode. +// On certain configurations, or terminals this could +// potentially interfere with copying text. +// Options: +// - true (default) +// - false +// +// mouse_mode false + +// Toggle having pane frames around the panes +// Options: +// - true (default, enabled) +// - false +// + +// When attaching to an existing session with other users, +// should the session be mirrored (true) +// or should each user have their own cursor (false) +// (Requires restart) +// Default: false +// +// mirror_session true + +// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP +// eg. when terminal window with an active zellij session is closed +// (Requires restart) +// Options: +// - detach (Default) +// - quit +// +// on_force_close "quit" + +// Configure the scroll back buffer size +// This is the number of lines zellij stores for each pane in the scroll back +// buffer. Excess number of lines are discarded in a FIFO fashion. +// (Requires restart) +// Valid values: positive integers +// Default value: 10000 +// +// scroll_buffer_size 10000 + +// Provide a command to execute when copying text. The text will be piped to +// the stdin of the program to perform the copy. This can be used with +// terminal emulators which do not support the OSC 52 ANSI control sequence +// that will be used by default if this option is not set. +// Examples: +// +// copy_command "xclip -selection clipboard" // x11 +// copy_command "wl-copy" // wayland +// copy_command "pbcopy" // osx +// +// copy_command "pbcopy" + +// Choose the destination for copied text +// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard. +// Does not apply when using copy_command. +// Options: +// - system (default) +// - primary +// +// copy_clipboard "primary" + +// Enable automatic copying (and clearing) of selection when releasing mouse +// Default: true +// +// copy_on_select true + +// Path to the default editor to use to edit pane scrollbuffer +// Default: $EDITOR or $VISUAL +// scrollback_editor "/usr/bin/vim" + +// A fixed name to always give the Zellij session. +// Consider also setting `attach_to_session true,` +// otherwise this will error if such a session exists. +// Default: +// +// session_name "My singleton session" + +// When `session_name` is provided, attaches to that session +// if it is already running or creates it otherwise. +// Default: false +// +// attach_to_session true + +// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible +// Options: +// - true (default) +// - false +// +// auto_layout false + +// Whether sessions should be serialized to the cache folder (including their tabs/panes, cwds and running commands) so that they can later be resurrected +// Options: +// - true (default) +// - false +// +// session_serialization false + +// Whether pane viewports are serialized along with the session, default is false +// Options: +// - true +// - false (default) +// +// serialize_pane_viewport false + +// Scrollback lines to serialize along with the pane viewport when serializing sessions, 0 +// defaults to the scrollback size. If this number is higher than the scrollback size, it will +// also default to the scrollback size. This does nothing if `serialize_pane_viewport` is not true. +// +// scrollback_lines_to_serialize 10000 + +// Enable or disable the rendering of styled and colored underlines (undercurl). +// May need to be disabled for certain unsupported terminals +// (Requires restart) +// Default: true +// +// styled_underlines false + +// How often in seconds sessions are serialized +// +// serialization_interval 10000 + +// Enable or disable writing of session metadata to disk (if disabled, other sessions might not know +// metadata info on this session) +// (Requires restart) +// Default: false +// +// disable_session_metadata false + +// Enable or disable support for the enhanced Kitty Keyboard Protocol (the host terminal must also support it) +// (Requires restart) +// Default: true (if the host terminal supports it) +// +// support_kitty_keyboard_protocol false + +// Whether to stack panes when resizing beyond a certain size +// Default: true +// +// stacked_resize false + +show_startup_tips false +show_release_notes false + normal { + bind "Super c" { Copy; } + bind "Super [" { GoToPreviousTab; } + bind "Super ]" { GoToNextTab; } + bind "Super w" { CloseFocus; } + bind "Super n" { NewTab; } + bind "Super t" { NewTab; } + bind "Super d" { NewPane "right"; } + bind "Super D" { NewPane "down"; } + bind "Super k" { Clear; } + } From 5d319d9e5e8fc12660f2c62e992c2b0f4fd20ccd Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 3 Jun 2025 22:57:56 +0200 Subject: [PATCH 263/280] Add macos bindings --- .config/zellij/config.kdl | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/.config/zellij/config.kdl b/.config/zellij/config.kdl index d8b0e78..9da575c 100644 --- a/.config/zellij/config.kdl +++ b/.config/zellij/config.kdl @@ -4,6 +4,21 @@ pane_frames false keybinds clear-defaults=true { + normal { + bind "Super [" { GoToPreviousTab; } + bind "Super ]" { GoToNextTab; } + bind "Super w" { CloseFocus; } + bind "Super n" { NewTab; } + bind "Super t" { NewTab; } + bind "Super z" { ToggleFocusFullscreen; } + bind "Super d" { NewPane "right"; } + bind "Super D" { NewPane "down"; } + bind "Super k" { Clear; } + bind "Ctrl h" { MoveFocusOrTab "left"; } + bind "Ctrl j" { MoveFocus "down"; } + bind "Ctrl k" { MoveFocus "up"; } + bind "Ctrl l" { MoveFocusOrTab "right"; } + } locked { bind "Alt g" { SwitchToMode "normal"; } } @@ -489,14 +504,14 @@ theme "tokyo-night-dark" show_startup_tips false show_release_notes false - normal { - bind "Super c" { Copy; } - bind "Super [" { GoToPreviousTab; } - bind "Super ]" { GoToNextTab; } - bind "Super w" { CloseFocus; } - bind "Super n" { NewTab; } - bind "Super t" { NewTab; } - bind "Super d" { NewPane "right"; } - bind "Super D" { NewPane "down"; } - bind "Super k" { Clear; } - } +// keybinds { +// bind "Super c" { Copy; } +// bind "Super [" { GoToPreviousTab; } +// bind "Super ]" { GoToNextTab; } +// bind "Super w" { CloseFocus; } +// bind "Super n" { NewTab; } +// bind "Super t" { NewTab; } +// bind "Super d" { NewPane "right"; } +// bind "Super D" { NewPane "down"; } +// bind "Super k" { Clear; } +// } From 57316fbf898bfb98baf5a243d05416f2fa5c62ae Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 4 Jun 2025 09:05:39 +0200 Subject: [PATCH 264/280] Add rails kdl layout, neotest mise config --- .config/nvim/lua/plugins/neotest.lua | 6 +- .config/zellij/config.kdl | 640 +++++++++++++-------------- .config/zellij/layouts/rails.kdl | 26 ++ 3 files changed, 349 insertions(+), 323 deletions(-) create mode 100644 .config/zellij/layouts/rails.kdl diff --git a/.config/nvim/lua/plugins/neotest.lua b/.config/nvim/lua/plugins/neotest.lua index 1a82555..ffb0746 100644 --- a/.config/nvim/lua/plugins/neotest.lua +++ b/.config/nvim/lua/plugins/neotest.lua @@ -13,7 +13,11 @@ return { require("neotest").setup({ adapters = { require("neotest-minitest"), - require("neotest-rspec"), + require("neotest-rspec")({ + rspec_cmd = function() + return { "mise", "exec", "--", "bundle", "exec", "rspec" } + end + }), ["neotest-java"] = { ignore_wrapper = true, }, diff --git a/.config/zellij/config.kdl b/.config/zellij/config.kdl index 9da575c..0cfbafa 100644 --- a/.config/zellij/config.kdl +++ b/.config/zellij/config.kdl @@ -14,304 +14,300 @@ keybinds clear-defaults=true { bind "Super d" { NewPane "right"; } bind "Super D" { NewPane "down"; } bind "Super k" { Clear; } - bind "Ctrl h" { MoveFocusOrTab "left"; } - bind "Ctrl j" { MoveFocus "down"; } - bind "Ctrl k" { MoveFocus "up"; } - bind "Ctrl l" { MoveFocusOrTab "right"; } } - locked { - bind "Alt g" { SwitchToMode "normal"; } - } - pane { - bind "left" { MoveFocus "left"; } - bind "down" { MoveFocus "down"; } - bind "up" { MoveFocus "up"; } - bind "right" { MoveFocus "right"; } - bind "c" { SwitchToMode "renamepane"; PaneNameInput 0; } - bind "d" { NewPane "down"; SwitchToMode "normal"; } - bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "normal"; } - bind "f" { ToggleFocusFullscreen; SwitchToMode "normal"; } - bind "h" { MoveFocus "left"; } - bind "i" { TogglePanePinned; SwitchToMode "normal"; } - bind "j" { MoveFocus "down"; } - bind "k" { MoveFocus "up"; } - bind "l" { MoveFocus "right"; } - bind "n" { NewPane; SwitchToMode "normal"; } - bind "p" { SwitchFocus; } - bind "Alt p" { SwitchToMode "normal"; } - bind "r" { NewPane "right"; SwitchToMode "normal"; } - bind "w" { ToggleFloatingPanes; SwitchToMode "normal"; } - bind "z" { TogglePaneFrames; SwitchToMode "normal"; } - } - tab { - bind "left" { GoToPreviousTab; } - bind "down" { GoToNextTab; } - bind "up" { GoToPreviousTab; } - bind "right" { GoToNextTab; } - bind "1" { GoToTab 1; SwitchToMode "normal"; } - bind "2" { GoToTab 2; SwitchToMode "normal"; } - bind "3" { GoToTab 3; SwitchToMode "normal"; } - bind "4" { GoToTab 4; SwitchToMode "normal"; } - bind "5" { GoToTab 5; SwitchToMode "normal"; } - bind "6" { GoToTab 6; SwitchToMode "normal"; } - bind "7" { GoToTab 7; SwitchToMode "normal"; } - bind "8" { GoToTab 8; SwitchToMode "normal"; } - bind "9" { GoToTab 9; SwitchToMode "normal"; } - bind "[" { BreakPaneLeft; SwitchToMode "normal"; } - bind "]" { BreakPaneRight; SwitchToMode "normal"; } - bind "b" { BreakPane; SwitchToMode "normal"; } - bind "h" { GoToPreviousTab; } - bind "j" { GoToNextTab; } - bind "k" { GoToPreviousTab; } - bind "l" { GoToNextTab; } - bind "n" { NewTab; SwitchToMode "normal"; } - bind "r" { SwitchToMode "renametab"; TabNameInput 0; } - bind "s" { ToggleActiveSyncTab; SwitchToMode "normal"; } - bind "Alt t" { SwitchToMode "normal"; } - bind "x" { CloseTab; SwitchToMode "normal"; } - bind "tab" { ToggleTab; } - } - resize { - bind "left" { Resize "Increase left"; } - bind "down" { Resize "Increase down"; } - bind "up" { Resize "Increase up"; } - bind "right" { Resize "Increase right"; } - bind "+" { Resize "Increase"; } - bind "-" { Resize "Decrease"; } - bind "=" { Resize "Increase"; } - bind "H" { Resize "Decrease left"; } - bind "J" { Resize "Decrease down"; } - bind "K" { Resize "Decrease up"; } - bind "L" { Resize "Decrease right"; } - bind "h" { Resize "Increase left"; } - bind "j" { Resize "Increase down"; } - bind "k" { Resize "Increase up"; } - bind "l" { Resize "Increase right"; } - bind "Alt n" { SwitchToMode "normal"; } - } - move { - bind "left" { MovePane "left"; } - bind "down" { MovePane "down"; } - bind "up" { MovePane "up"; } - bind "right" { MovePane "right"; } - bind "h" { MovePane "left"; } - bind "Alt h" { SwitchToMode "normal"; } - bind "j" { MovePane "down"; } - bind "k" { MovePane "up"; } - bind "l" { MovePane "right"; } - bind "n" { MovePane; } - bind "p" { MovePaneBackwards; } - bind "tab" { MovePane; } - } - scroll { - bind "Alt left" { MoveFocusOrTab "left"; SwitchToMode "normal"; } - bind "Alt down" { MoveFocus "down"; SwitchToMode "normal"; } - bind "Alt up" { MoveFocus "up"; SwitchToMode "normal"; } - bind "Alt right" { MoveFocusOrTab "right"; SwitchToMode "normal"; } - bind "e" { EditScrollback; SwitchToMode "normal"; } - bind "Alt j" { MoveFocus "down"; SwitchToMode "normal"; } - bind "Alt k" { MoveFocus "up"; SwitchToMode "normal"; } - bind "Alt l" { MoveFocusOrTab "right"; SwitchToMode "normal"; } - bind "s" { SwitchToMode "entersearch"; SearchInput 0; } - bind "Alt s" { SwitchToMode "normal"; } - } - search { - bind "c" { SearchToggleOption "CaseSensitivity"; } - bind "n" { Search "down"; } - bind "o" { SearchToggleOption "WholeWord"; } - bind "p" { Search "up"; } - bind "Ctrl s" { SwitchToMode "normal"; } - bind "w" { SearchToggleOption "Wrap"; } - } - session { - bind "a" { - LaunchOrFocusPlugin "zellij:about" { - floating true - move_to_focused_tab true - } - SwitchToMode "normal" - } - bind "c" { - LaunchOrFocusPlugin "configuration" { - floating true - move_to_focused_tab true - } - SwitchToMode "normal" - } - bind "Alt o" { SwitchToMode "normal"; } - bind "p" { - LaunchOrFocusPlugin "plugin-manager" { - floating true - move_to_focused_tab true - } - SwitchToMode "normal" - } - bind "w" { - LaunchOrFocusPlugin "session-manager" { - floating true - move_to_focused_tab true - } - SwitchToMode "normal" - } - } - shared_among "normal" "locked" { - bind "Alt Shift left" { MoveFocusOrTab "left"; } - bind "Alt Shift down" { MoveFocus "down"; } - bind "Alt Shift up" { MoveFocus "up"; } - bind "Alt Shift right" { MoveFocusOrTab "right"; } - bind "Alt Shift +" { Resize "Increase"; } - bind "Alt Shift -" { Resize "Decrease"; } - bind "Alt Shift =" { Resize "Increase"; } - bind "Alt Shift [" { PreviousSwapLayout; } - bind "Alt Shift ]" { NextSwapLayout; } - bind "Alt Shift f" { ToggleFloatingPanes; } - bind "Alt Shift h" { MoveFocusOrTab "left"; } - bind "Alt Shift i" { MoveTab "left"; } - bind "Alt Shift j" { MoveFocus "down"; } - bind "Alt Shift k" { MoveFocus "up"; } - bind "Alt Shift l" { MoveFocusOrTab "right"; } - bind "Alt Shift n" { NewPane; } - bind "Alt Shift o" { MoveTab "right"; } - } - shared_except "locked" "entersearch" "renametab" "renamepane" "move" "prompt" "tmux" { - bind "Alt h" { SwitchToMode "move"; } - } - shared_except "locked" "entersearch" "renametab" "renamepane" "prompt" "tmux" { - bind "Alt g" { SwitchToMode "locked"; } - bind "Alt q" { Quit; } - } - shared_except "locked" "entersearch" "renametab" "renamepane" "session" "prompt" "tmux" { - bind "Alt o" { SwitchToMode "session"; } - } - shared_except "locked" "scroll" "search" "tmux" { - bind "Ctrl b" { SwitchToMode "tmux"; } - } - shared_except "locked" "scroll" "entersearch" "renametab" "renamepane" "prompt" "tmux" { - bind "Alt s" { SwitchToMode "scroll"; } - } - shared_except "locked" "tab" "entersearch" "renametab" "renamepane" "prompt" "tmux" { - bind "Alt t" { SwitchToMode "tab"; } - } - shared_except "locked" "pane" "entersearch" "renametab" "renamepane" "prompt" "tmux" { - bind "Alt p" { SwitchToMode "pane"; } - } - shared_except "locked" "resize" "entersearch" "renametab" "renamepane" "prompt" "tmux" { - bind "Alt n" { SwitchToMode "resize"; } - } - shared_except "normal" "locked" { - bind "Alt +" { Resize "Increase"; } - bind "Alt -" { Resize "Decrease"; } - bind "Alt =" { Resize "Increase"; } - bind "Alt [" { PreviousSwapLayout; } - bind "Alt ]" { NextSwapLayout; } - bind "Alt f" { ToggleFloatingPanes; } - bind "Alt i" { MoveTab "left"; } - } - shared_except "normal" "locked" "entersearch" { - bind "enter" { SwitchToMode "normal"; } - } - shared_except "normal" "locked" "entersearch" "renametab" "renamepane" { - bind "esc" { SwitchToMode "normal"; } - } - shared_except "normal" "locked" "scroll" { - bind "Alt left" { MoveFocusOrTab "left"; } - bind "Alt down" { MoveFocus "down"; } - bind "Alt up" { MoveFocus "up"; } - bind "Alt right" { MoveFocusOrTab "right"; } - bind "Alt j" { MoveFocus "down"; } - bind "Alt k" { MoveFocus "up"; } - bind "Alt l" { MoveFocusOrTab "right"; } - } - shared_among "pane" "tmux" { - bind "x" { CloseFocus; SwitchToMode "normal"; } - } - shared_among "scroll" "search" { - bind "PageDown" { PageScrollDown; } - bind "PageUp" { PageScrollUp; } - bind "left" { PageScrollUp; } - bind "down" { ScrollDown; } - bind "up" { ScrollUp; } - bind "right" { PageScrollDown; } - bind "Ctrl b" { PageScrollUp; } - bind "Ctrl c" { ScrollToBottom; SwitchToMode "normal"; } - bind "d" { HalfPageScrollDown; } - bind "Ctrl f" { PageScrollDown; } - bind "h" { PageScrollUp; } - bind "j" { ScrollDown; } - bind "k" { ScrollUp; } - bind "l" { PageScrollDown; } - bind "u" { HalfPageScrollUp; } - } - entersearch { - bind "Ctrl c" { SwitchToMode "scroll"; } - bind "esc" { SwitchToMode "scroll"; } - bind "enter" { SwitchToMode "search"; } - } - shared_among "entersearch" "renametab" "renamepane" "prompt" "tmux" { - bind "Ctrl g" { SwitchToMode "locked"; } - bind "Ctrl h" { SwitchToMode "move"; } - bind "Alt h" { MoveFocusOrTab "left"; } - bind "Ctrl n" { SwitchToMode "resize"; } - bind "Alt n" { NewPane; } - bind "Ctrl o" { SwitchToMode "session"; } - bind "Alt o" { MoveTab "right"; } - bind "Ctrl p" { SwitchToMode "pane"; } - bind "Ctrl q" { Quit; } - bind "Ctrl s" { SwitchToMode "scroll"; } - bind "Ctrl t" { SwitchToMode "tab"; } - } - renametab { - bind "esc" { UndoRenameTab; SwitchToMode "tab"; } - } - shared_among "renametab" "renamepane" { - bind "Ctrl c" { SwitchToMode "normal"; } - } - renamepane { - bind "esc" { UndoRenamePane; SwitchToMode "pane"; } - } - shared_among "session" "tmux" { - bind "d" { Detach; } - } - tmux { - bind "left" { MoveFocus "left"; SwitchToMode "normal"; } - bind "down" { MoveFocus "down"; SwitchToMode "normal"; } - bind "up" { MoveFocus "up"; SwitchToMode "normal"; } - bind "right" { MoveFocus "right"; SwitchToMode "normal"; } - bind "space" { NextSwapLayout; } - bind "\"" { NewPane "down"; SwitchToMode "normal"; } - bind "%" { NewPane "right"; SwitchToMode "normal"; } - bind "," { SwitchToMode "renametab"; } - bind "[" { SwitchToMode "scroll"; } - bind "Ctrl b" { Write 2; SwitchToMode "normal"; } - bind "c" { NewTab; SwitchToMode "normal"; } - bind "h" { MoveFocus "left"; SwitchToMode "normal"; } - bind "j" { MoveFocus "down"; SwitchToMode "normal"; } - bind "k" { MoveFocus "up"; SwitchToMode "normal"; } - bind "l" { MoveFocus "right"; SwitchToMode "normal"; } - bind "n" { GoToNextTab; SwitchToMode "normal"; } - bind "o" { FocusNextPane; } - bind "p" { GoToPreviousTab; SwitchToMode "normal"; } - bind "z" { ToggleFocusFullscreen; SwitchToMode "normal"; } + locked { + bind "Alt g" { SwitchToMode "normal"; } + } + pane { + bind "left" { MoveFocus "left"; } + bind "down" { MoveFocus "down"; } + bind "up" { MoveFocus "up"; } + bind "right" { MoveFocus "right"; } + bind "c" { SwitchToMode "renamepane"; PaneNameInput 0; } + bind "d" { NewPane "down"; SwitchToMode "normal"; } + bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "normal"; } + bind "f" { ToggleFocusFullscreen; SwitchToMode "normal"; } + bind "h" { MoveFocus "left"; } + bind "i" { TogglePanePinned; SwitchToMode "normal"; } + bind "j" { MoveFocus "down"; } + bind "k" { MoveFocus "up"; } + bind "l" { MoveFocus "right"; } + bind "n" { NewPane; SwitchToMode "normal"; } + bind "p" { SwitchFocus; } + bind "Alt p" { SwitchToMode "normal"; } + bind "r" { NewPane "right"; SwitchToMode "normal"; } + bind "w" { ToggleFloatingPanes; SwitchToMode "normal"; } + bind "z" { TogglePaneFrames; SwitchToMode "normal"; } + } + tab { + bind "left" { GoToPreviousTab; } + bind "down" { GoToNextTab; } + bind "up" { GoToPreviousTab; } + bind "right" { GoToNextTab; } + bind "1" { GoToTab 1; SwitchToMode "normal"; } + bind "2" { GoToTab 2; SwitchToMode "normal"; } + bind "3" { GoToTab 3; SwitchToMode "normal"; } + bind "4" { GoToTab 4; SwitchToMode "normal"; } + bind "5" { GoToTab 5; SwitchToMode "normal"; } + bind "6" { GoToTab 6; SwitchToMode "normal"; } + bind "7" { GoToTab 7; SwitchToMode "normal"; } + bind "8" { GoToTab 8; SwitchToMode "normal"; } + bind "9" { GoToTab 9; SwitchToMode "normal"; } + bind "[" { BreakPaneLeft; SwitchToMode "normal"; } + bind "]" { BreakPaneRight; SwitchToMode "normal"; } + bind "b" { BreakPane; SwitchToMode "normal"; } + bind "h" { GoToPreviousTab; } + bind "j" { GoToNextTab; } + bind "k" { GoToPreviousTab; } + bind "l" { GoToNextTab; } + bind "n" { NewTab; SwitchToMode "normal"; } + bind "r" { SwitchToMode "renametab"; TabNameInput 0; } + bind "s" { ToggleActiveSyncTab; SwitchToMode "normal"; } + bind "Alt t" { SwitchToMode "normal"; } + bind "x" { CloseTab; SwitchToMode "normal"; } + bind "tab" { ToggleTab; } + } + resize { + bind "left" { Resize "Increase left"; } + bind "down" { Resize "Increase down"; } + bind "up" { Resize "Increase up"; } + bind "right" { Resize "Increase right"; } + bind "+" { Resize "Increase"; } + bind "-" { Resize "Decrease"; } + bind "=" { Resize "Increase"; } + bind "H" { Resize "Decrease left"; } + bind "J" { Resize "Decrease down"; } + bind "K" { Resize "Decrease up"; } + bind "L" { Resize "Decrease right"; } + bind "h" { Resize "Increase left"; } + bind "j" { Resize "Increase down"; } + bind "k" { Resize "Increase up"; } + bind "l" { Resize "Increase right"; } + bind "Alt n" { SwitchToMode "normal"; } + } + move { + bind "left" { MovePane "left"; } + bind "down" { MovePane "down"; } + bind "up" { MovePane "up"; } + bind "right" { MovePane "right"; } + bind "h" { MovePane "left"; } + bind "Alt h" { SwitchToMode "normal"; } + bind "j" { MovePane "down"; } + bind "k" { MovePane "up"; } + bind "l" { MovePane "right"; } + bind "n" { MovePane; } + bind "p" { MovePaneBackwards; } + bind "tab" { MovePane; } + } + scroll { + bind "Alt left" { MoveFocusOrTab "left"; SwitchToMode "normal"; } + bind "Alt down" { MoveFocus "down"; SwitchToMode "normal"; } + bind "Alt up" { MoveFocus "up"; SwitchToMode "normal"; } + bind "Alt right" { MoveFocusOrTab "right"; SwitchToMode "normal"; } + bind "e" { EditScrollback; SwitchToMode "normal"; } + bind "Alt j" { MoveFocus "down"; SwitchToMode "normal"; } + bind "Alt k" { MoveFocus "up"; SwitchToMode "normal"; } + bind "Alt l" { MoveFocusOrTab "right"; SwitchToMode "normal"; } + bind "s" { SwitchToMode "entersearch"; SearchInput 0; } + bind "Alt s" { SwitchToMode "normal"; } + } + search { + bind "c" { SearchToggleOption "CaseSensitivity"; } + bind "n" { Search "down"; } + bind "o" { SearchToggleOption "WholeWord"; } + bind "p" { Search "up"; } + bind "Ctrl s" { SwitchToMode "normal"; } + bind "w" { SearchToggleOption "Wrap"; } + } + session { + bind "a" { + LaunchOrFocusPlugin "zellij:about" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + bind "c" { + LaunchOrFocusPlugin "configuration" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + bind "Alt o" { SwitchToMode "normal"; } + bind "p" { + LaunchOrFocusPlugin "plugin-manager" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + bind "w" { + LaunchOrFocusPlugin "session-manager" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" } + } + shared_among "normal" "locked" { + bind "Alt Shift left" { MoveFocusOrTab "left"; } + bind "Alt Shift down" { MoveFocus "down"; } + bind "Alt Shift up" { MoveFocus "up"; } + bind "Alt Shift right" { MoveFocusOrTab "right"; } + bind "Alt Shift +" { Resize "Increase"; } + bind "Alt Shift -" { Resize "Decrease"; } + bind "Alt Shift =" { Resize "Increase"; } + bind "Alt Shift [" { PreviousSwapLayout; } + bind "Alt Shift ]" { NextSwapLayout; } + bind "Alt Shift f" { ToggleFloatingPanes; } + bind "Alt Shift h" { MoveFocusOrTab "left"; } + bind "Alt Shift i" { MoveTab "left"; } + bind "Alt Shift j" { MoveFocus "down"; } + bind "Alt Shift k" { MoveFocus "up"; } + bind "Alt Shift l" { MoveFocusOrTab "right"; } + bind "Alt Shift n" { NewPane; } + bind "Alt Shift o" { MoveTab "right"; } + } + shared_except "locked" "entersearch" "renametab" "renamepane" "move" "prompt" "tmux" { + bind "Alt h" { SwitchToMode "move"; } + } + shared_except "locked" "entersearch" "renametab" "renamepane" "prompt" "tmux" { + bind "Alt g" { SwitchToMode "locked"; } + bind "Alt q" { Quit; } + } + shared_except "locked" "entersearch" "renametab" "renamepane" "session" "prompt" "tmux" { + bind "Alt o" { SwitchToMode "session"; } + } + shared_except "locked" "scroll" "search" "tmux" { + bind "Ctrl b" { SwitchToMode "tmux"; } + } + shared_except "locked" "scroll" "entersearch" "renametab" "renamepane" "prompt" "tmux" { + bind "Alt s" { SwitchToMode "scroll"; } + } + shared_except "locked" "tab" "entersearch" "renametab" "renamepane" "prompt" "tmux" { + bind "Alt t" { SwitchToMode "tab"; } + } + shared_except "locked" "pane" "entersearch" "renametab" "renamepane" "prompt" "tmux" { + bind "Alt p" { SwitchToMode "pane"; } + } + shared_except "locked" "resize" "entersearch" "renametab" "renamepane" "prompt" "tmux" { + bind "Alt n" { SwitchToMode "resize"; } + } + shared_except "normal" "locked" { + bind "Alt +" { Resize "Increase"; } + bind "Alt -" { Resize "Decrease"; } + bind "Alt =" { Resize "Increase"; } + bind "Alt [" { PreviousSwapLayout; } + bind "Alt ]" { NextSwapLayout; } + bind "Alt f" { ToggleFloatingPanes; } + bind "Alt i" { MoveTab "left"; } + } + shared_except "normal" "locked" "entersearch" { + bind "enter" { SwitchToMode "normal"; } + } + shared_except "normal" "locked" "entersearch" "renametab" "renamepane" { + bind "esc" { SwitchToMode "normal"; } + } + shared_except "normal" "locked" "scroll" { + bind "Alt left" { MoveFocusOrTab "left"; } + bind "Alt down" { MoveFocus "down"; } + bind "Alt up" { MoveFocus "up"; } + bind "Alt right" { MoveFocusOrTab "right"; } + bind "Alt j" { MoveFocus "down"; } + bind "Alt k" { MoveFocus "up"; } + bind "Alt l" { MoveFocusOrTab "right"; } + } + shared_among "pane" "tmux" { + bind "x" { CloseFocus; SwitchToMode "normal"; } + } + shared_among "scroll" "search" { + bind "PageDown" { PageScrollDown; } + bind "PageUp" { PageScrollUp; } + bind "left" { PageScrollUp; } + bind "down" { ScrollDown; } + bind "up" { ScrollUp; } + bind "right" { PageScrollDown; } + bind "Ctrl b" { PageScrollUp; } + bind "Ctrl c" { ScrollToBottom; SwitchToMode "normal"; } + bind "d" { HalfPageScrollDown; } + bind "Ctrl f" { PageScrollDown; } + bind "h" { PageScrollUp; } + bind "j" { ScrollDown; } + bind "k" { ScrollUp; } + bind "l" { PageScrollDown; } + bind "u" { HalfPageScrollUp; } + } + entersearch { + bind "Ctrl c" { SwitchToMode "scroll"; } + bind "esc" { SwitchToMode "scroll"; } + bind "enter" { SwitchToMode "search"; } + } + shared_among "entersearch" "renametab" "renamepane" "prompt" "tmux" { + bind "Ctrl g" { SwitchToMode "locked"; } + bind "Ctrl h" { SwitchToMode "move"; } + bind "Alt h" { MoveFocusOrTab "left"; } + bind "Ctrl n" { SwitchToMode "resize"; } + bind "Alt n" { NewPane; } + bind "Ctrl o" { SwitchToMode "session"; } + bind "Alt o" { MoveTab "right"; } + bind "Ctrl p" { SwitchToMode "pane"; } + bind "Ctrl q" { Quit; } + bind "Ctrl s" { SwitchToMode "scroll"; } + bind "Ctrl t" { SwitchToMode "tab"; } + } + renametab { + bind "esc" { UndoRenameTab; SwitchToMode "tab"; } + } + shared_among "renametab" "renamepane" { + bind "Ctrl c" { SwitchToMode "normal"; } + } + renamepane { + bind "esc" { UndoRenamePane; SwitchToMode "pane"; } + } + shared_among "session" "tmux" { + bind "d" { Detach; } + } + tmux { + bind "left" { MoveFocus "left"; SwitchToMode "normal"; } + bind "down" { MoveFocus "down"; SwitchToMode "normal"; } + bind "up" { MoveFocus "up"; SwitchToMode "normal"; } + bind "right" { MoveFocus "right"; SwitchToMode "normal"; } + bind "space" { NextSwapLayout; } + bind "\"" { NewPane "down"; SwitchToMode "normal"; } + bind "%" { NewPane "right"; SwitchToMode "normal"; } + bind "," { SwitchToMode "renametab"; } + bind "[" { SwitchToMode "scroll"; } + bind "Ctrl b" { Write 2; SwitchToMode "normal"; } + bind "c" { NewTab; SwitchToMode "normal"; } + bind "h" { MoveFocus "left"; SwitchToMode "normal"; } + bind "j" { MoveFocus "down"; SwitchToMode "normal"; } + bind "k" { MoveFocus "up"; SwitchToMode "normal"; } + bind "l" { MoveFocus "right"; SwitchToMode "normal"; } + bind "n" { GoToNextTab; SwitchToMode "normal"; } + bind "o" { FocusNextPane; } + bind "p" { GoToPreviousTab; SwitchToMode "normal"; } + bind "z" { ToggleFocusFullscreen; SwitchToMode "normal"; } + } } // Plugin aliases - can be used to change the implementation of Zellij // changing these requires a restart to take effect plugins { - about location="zellij:about" - compact-bar location="zellij:compact-bar" - configuration location="zellij:configuration" - filepicker location="zellij:strider" { - cwd "/" - } - plugin-manager location="zellij:plugin-manager" - session-manager location="zellij:session-manager" - status-bar location="zellij:status-bar" - strider location="zellij:strider" - tab-bar location="zellij:tab-bar" - welcome-screen location="zellij:session-manager" { - welcome_screen true - } + about location="zellij:about" + compact-bar location="zellij:compact-bar" + configuration location="zellij:configuration" + filepicker location="zellij:strider" { + cwd "/" + } + plugin-manager location="zellij:plugin-manager" + session-manager location="zellij:session-manager" + status-bar location="zellij:status-bar" + strider location="zellij:strider" + tab-bar location="zellij:tab-bar" + welcome-screen location="zellij:session-manager" { + welcome_screen true + } } // Plugins to load in the background when a new session starts @@ -320,48 +316,48 @@ plugins { // load_plugins { // "https://github.com/dj95/zjstatus/releases/download/latest/zjstatus.wasm" // } - + // Use a simplified UI without special fonts (arrow glyphs) // Options: // - true // - false (Default) // -// simplified_ui true - +simplified_ui true + // Choose the theme that is specified in the themes section. // Default: default // theme "tokyo-night-dark" - + // Choose the base input mode of zellij. // Default: normal // // default_mode "normal" - + // Choose the path to the default shell that zellij will use for opening new panes // Default: $SHELL // // default_shell "fish" - + // Choose the path to override cwd that zellij will use for opening new panes // // default_cwd "/tmp" - + // The name of the default layout to load on startup // Default: "default" // -// default_layout "my_layout" - +default_layout "compact" + // The folder in which Zellij will look for layouts // (Requires restart) // // layout_dir "/tmp" - + // The folder in which Zellij will look for themes // (Requires restart) // // theme_dir "/tmp" - + // Toggle enabling the mouse mode. // On certain configurations, or terminals this could // potentially interfere with copying text. @@ -370,13 +366,13 @@ theme "tokyo-night-dark" // - false // // mouse_mode false - + // Toggle having pane frames around the panes // Options: // - true (default, enabled) // - false // - + // When attaching to an existing session with other users, // should the session be mirrored (true) // or should each user have their own cursor (false) @@ -384,7 +380,7 @@ theme "tokyo-night-dark" // Default: false // // mirror_session true - + // Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP // eg. when terminal window with an active zellij session is closed // (Requires restart) @@ -393,7 +389,7 @@ theme "tokyo-night-dark" // - quit // // on_force_close "quit" - + // Configure the scroll back buffer size // This is the number of lines zellij stores for each pane in the scroll back // buffer. Excess number of lines are discarded in a FIFO fashion. @@ -402,7 +398,7 @@ theme "tokyo-night-dark" // Default value: 10000 // // scroll_buffer_size 10000 - + // Provide a command to execute when copying text. The text will be piped to // the stdin of the program to perform the copy. This can be used with // terminal emulators which do not support the OSC 52 ANSI control sequence @@ -414,7 +410,7 @@ theme "tokyo-night-dark" // copy_command "pbcopy" // osx // // copy_command "pbcopy" - + // Choose the destination for copied text // Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard. // Does not apply when using copy_command. @@ -423,85 +419,85 @@ theme "tokyo-night-dark" // - primary // // copy_clipboard "primary" - + // Enable automatic copying (and clearing) of selection when releasing mouse // Default: true // // copy_on_select true - + // Path to the default editor to use to edit pane scrollbuffer // Default: $EDITOR or $VISUAL // scrollback_editor "/usr/bin/vim" - + // A fixed name to always give the Zellij session. // Consider also setting `attach_to_session true,` // otherwise this will error if such a session exists. // Default: // // session_name "My singleton session" - + // When `session_name` is provided, attaches to that session // if it is already running or creates it otherwise. // Default: false // // attach_to_session true - + // Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible // Options: // - true (default) // - false // // auto_layout false - + // Whether sessions should be serialized to the cache folder (including their tabs/panes, cwds and running commands) so that they can later be resurrected // Options: // - true (default) // - false // // session_serialization false - + // Whether pane viewports are serialized along with the session, default is false // Options: // - true // - false (default) // // serialize_pane_viewport false - + // Scrollback lines to serialize along with the pane viewport when serializing sessions, 0 // defaults to the scrollback size. If this number is higher than the scrollback size, it will // also default to the scrollback size. This does nothing if `serialize_pane_viewport` is not true. // // scrollback_lines_to_serialize 10000 - + // Enable or disable the rendering of styled and colored underlines (undercurl). // May need to be disabled for certain unsupported terminals // (Requires restart) // Default: true // // styled_underlines false - + // How often in seconds sessions are serialized // // serialization_interval 10000 - + // Enable or disable writing of session metadata to disk (if disabled, other sessions might not know // metadata info on this session) // (Requires restart) // Default: false // // disable_session_metadata false - + // Enable or disable support for the enhanced Kitty Keyboard Protocol (the host terminal must also support it) // (Requires restart) // Default: true (if the host terminal supports it) // // support_kitty_keyboard_protocol false - + // Whether to stack panes when resizing beyond a certain size // Default: true // // stacked_resize false - + show_startup_tips false show_release_notes false // keybinds { diff --git a/.config/zellij/layouts/rails.kdl b/.config/zellij/layouts/rails.kdl new file mode 100644 index 0000000..b719868 --- /dev/null +++ b/.config/zellij/layouts/rails.kdl @@ -0,0 +1,26 @@ +layout { + default_tab_template { + children + pane size=1 borderless=true { + plugin location="compact-bar" + } + } + tab name="Editor" { + pane command="/opt/homebrew/bin/nvim" + } + tab name="run" focus=true { + pane command="tail" { + args "-f" "./log/development.log" + } + pane command="/Users/dani/.local/bin/mise" { + args "exec" "-c" "bundle exec rails console" + } + pane + } + tab name="srv" { + pane command="/Users/dani/.local/bin/mise" { + args "exec" "-c" "bundle exec rails server" + } + } +} + From a47bc3a1169bc01aeedc422eb1be9389c2ae510c Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 4 Jun 2025 21:52:30 +0200 Subject: [PATCH 265/280] Configiure rails ruby lsp --- .config/nvim/lua/plugins/nvim-lspconfig.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index bf7e528..41b36a3 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -38,7 +38,13 @@ return { -- Configure ruby-lsp using the new vim.lsp.config API vim.lsp.config('ruby-lsp', { init_options = { + addonSettings = { + ["Ruby LSP Rails"] = { + enablePendingMigrationsPrompt = false, + }, + }, settings = { + -- Server settings should go here } } From 49f2718e8d666dda3901c416783034495aea1157 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Jun 2025 19:27:49 +0200 Subject: [PATCH 266/280] Add preview plugins --- .config/nvim/lua/plugins/markdown.lua | 10 ++++++++++ .config/nvim/lua/plugins/nvim-asciidoc-preview.lua | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 .config/nvim/lua/plugins/nvim-asciidoc-preview.lua diff --git a/.config/nvim/lua/plugins/markdown.lua b/.config/nvim/lua/plugins/markdown.lua index 8323a21..fdcdc44 100644 --- a/.config/nvim/lua/plugins/markdown.lua +++ b/.config/nvim/lua/plugins/markdown.lua @@ -1,4 +1,14 @@ return { + { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = "cd app && yarn install", + init = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + ft = { "markdown" }, + }, + -- "tadmccorkle/markdown.nvim", -- ft = "markdown", -- or 'event = "VeryLazy"' -- opts = { diff --git a/.config/nvim/lua/plugins/nvim-asciidoc-preview.lua b/.config/nvim/lua/plugins/nvim-asciidoc-preview.lua new file mode 100644 index 0000000..c8d1c2b --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-asciidoc-preview.lua @@ -0,0 +1,8 @@ +return { + 'tigion/nvim-asciidoc-preview', + ft = { 'asciidoc' }, + build = 'cd server && npm install --omit=dev', + opts = { + -- Add user configuration here + }, +} From 093f2657e70ae84599d43d938660eca7e6c3f826 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Jun 2025 19:28:00 +0200 Subject: [PATCH 267/280] Update light/darkmode --- .config/nvim/init.lua | 1 + .config/nvim/lazy-lock.json | 2 ++ .config/nvim/lua/.gitignore | 2 +- .config/nvim/lua/plugins/lualine.lua | 17 +++++++++++++++++ .config/nvim/lua/theme.lua | 13 +++++++++++++ .config/zellij/config.kdl | 4 +++- 6 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 .config/nvim/lua/theme.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 90e02ca..ae30fde 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -21,5 +21,6 @@ local plugins = { local opts = { defaults = { lazy = true }, change_detection = { notify = false } } +require("theme-flag") require("lazy").setup(plugins, opts) require("theme") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index f282705..9ffc6aa 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -25,6 +25,7 @@ "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lsp-zero.nvim": { "branch": "v4.x", "commit": "2afa32e732d7b36e80cd5241fbdc4a38e123c4e0" }, "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" }, "mason.nvim": { "branch": "main", "commit": "888d6ee499d8089a3a4be4309d239d6be1c1e6c0" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, @@ -36,6 +37,7 @@ "neotest-minitest": { "branch": "main", "commit": "7ff057de8ab2c27491ff27c7be9826b8f3bb5ec1" }, "neotest-rspec": { "branch": "main", "commit": "281c0ed0e55d623e8028796e1c4dc27b7e421fd0" }, "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, + "nvim-asciidoc-preview": { "branch": "main", "commit": "b12e113b5f7e7522b4e412213d5498cc529f2628" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, "nvim-lspconfig": { "branch": "master", "commit": "ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57" }, diff --git a/.config/nvim/lua/.gitignore b/.config/nvim/lua/.gitignore index a9bdaf5..d4b4a91 100644 --- a/.config/nvim/lua/.gitignore +++ b/.config/nvim/lua/.gitignore @@ -1,2 +1,2 @@ # ignore theme because it changes frequently and is managed via change_theme scirpt -theme.lua +theme-flag.lua diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index 46af7fa..76ae8bb 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -11,6 +11,7 @@ return { -- Color table for highlights -- stylua: ignore + -- dark local colors = { bg = '#202328', fg = '#bbc2cf', @@ -25,6 +26,22 @@ return { red = '#ec5f67', } + if vim.o.background == "light" then + colors = { + bg = '#FFFFFF', -- Light background + fg = '#2E2E2E', -- Darker foreground for contrast + yellow = '#7F6D3A', -- Softer yellow + cyan = '#009B9F', -- Softer cyan + darkblue = '#2C3E50', -- Softer dark blue + green = '#5C9E3E', -- Softer green + orange = '#E76E27', -- Softer orange + violet = '#8E9DCC', -- Softer violet + magenta = '#D25D91', -- Softer magenta + blue = '#6BB6E8', -- Softer blue + red = '#E53A35', -- Softer red + } + end + local conditions = { buffer_not_empty = function() return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 diff --git a/.config/nvim/lua/theme.lua b/.config/nvim/lua/theme.lua new file mode 100644 index 0000000..4280f3c --- /dev/null +++ b/.config/nvim/lua/theme.lua @@ -0,0 +1,13 @@ +if vim.o.background == "dark" then + vim.g.tokyonight_style = "night" + vim.g.tokyonight_transparent_background = 1 + vim.g.tokyonight_enable_italic = 1 + vim.cmd("colorscheme tokyonight") + vim.cmd("set bg=dark") +else + vim.o.background = "light" + -- vim.cmd("colorscheme solarized") + -- vim.cmd("colorscheme wildcharm") + vim.cmd("colorscheme polar") + vim.cmd("set bg=light") +end diff --git a/.config/zellij/config.kdl b/.config/zellij/config.kdl index 0cfbafa..80d5180 100644 --- a/.config/zellij/config.kdl +++ b/.config/zellij/config.kdl @@ -327,7 +327,9 @@ simplified_ui true // Choose the theme that is specified in the themes section. // Default: default // -theme "tokyo-night-dark" +// theme "tokyo-night-dark" +// theme "ayu-light" +theme "iceberg-light" // Choose the base input mode of zellij. // Default: normal From ddaea3f87cd33fdc12ff01b8f2d47f7186c79a3a Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 6 Jun 2025 19:28:11 +0200 Subject: [PATCH 268/280] format? --- .config/zellij/layouts/rails.kdl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.config/zellij/layouts/rails.kdl b/.config/zellij/layouts/rails.kdl index b719868..2712fca 100644 --- a/.config/zellij/layouts/rails.kdl +++ b/.config/zellij/layouts/rails.kdl @@ -9,11 +9,13 @@ layout { pane command="/opt/homebrew/bin/nvim" } tab name="run" focus=true { - pane command="tail" { - args "-f" "./log/development.log" - } - pane command="/Users/dani/.local/bin/mise" { - args "exec" "-c" "bundle exec rails console" + pane split_direction="vertical" { + pane command="tail" { + args "-f" "./log/development.log" + } + pane command="/Users/dani/.local/bin/mise" { + args "exec" "-c" "bundle exec rails console" + } } pane } From 4b3cef68e6cf5674b3edd0d9614306f292ea57a4 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Tue, 5 Aug 2025 16:20:51 +0200 Subject: [PATCH 269/280] Configure yaml --- .config/nvim/lua/plugins/yaml.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .config/nvim/lua/plugins/yaml.lua diff --git a/.config/nvim/lua/plugins/yaml.lua b/.config/nvim/lua/plugins/yaml.lua new file mode 100644 index 0000000..16fdd32 --- /dev/null +++ b/.config/nvim/lua/plugins/yaml.lua @@ -0,0 +1,10 @@ +return { + "cuducos/yaml.nvim", + ft = { "yaml" }, -- optional + dependencies = { + "nvim-treesitter/nvim-treesitter", + "folke/snacks.nvim", -- optional + "nvim-telescope/telescope.nvim", -- optional + "ibhagwan/fzf-lua" -- optional + }, +} From fafd7da6cbea8a2359f493f5dc50cc4c117fe411 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 9 Aug 2025 00:13:30 +0200 Subject: [PATCH 270/280] Add kms command --- .config/nvim/lua/settings.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index cef2373..ee051cf 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -73,6 +73,8 @@ vim.keymap.set("n", "cp", "cp :let @+=expand('%:p')") vim.keymap.set("n", "cm", ":cnext") vim.keymap.set("n", "cl", ":cprev") +vim.api.nvim_create_user_command('Kms', 'execute "SessionDelete" | quit', {}) + -- splits vim.opt.splitright = true From e8d4d5767eb1a401f671c0700f2130aca4f067b4 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sat, 9 Aug 2025 00:22:42 +0200 Subject: [PATCH 271/280] Add vim-fetch to fetch the line numbers ^^ --- .config/nvim/lua/plugins/vim-fetch.lua | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .config/nvim/lua/plugins/vim-fetch.lua diff --git a/.config/nvim/lua/plugins/vim-fetch.lua b/.config/nvim/lua/plugins/vim-fetch.lua new file mode 100644 index 0000000..eb53d3b --- /dev/null +++ b/.config/nvim/lua/plugins/vim-fetch.lua @@ -0,0 +1,4 @@ +return { + "wsdjeg/vim-fetch", + lazy=false +} From f7dbe695fd29aa98e708bed32d54006db1d8c17c Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Fri, 5 Sep 2025 10:51:46 +0200 Subject: [PATCH 272/280] Improve cockpit setup --- .config/nvim/lua/plugins/gitlinker.lua | 1 + .config/nvim/lua/settings.lua | 4 ++++ scripts/pretty-pulls.ts | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.config/nvim/lua/plugins/gitlinker.lua b/.config/nvim/lua/plugins/gitlinker.lua index 98b5c09..6a0bb22 100644 --- a/.config/nvim/lua/plugins/gitlinker.lua +++ b/.config/nvim/lua/plugins/gitlinker.lua @@ -15,6 +15,7 @@ return { callbacks = { ["github.com"] = require("gitlinker.hosts").get_github_type_url, ["gitlab.com"] = require("gitlinker.hosts").get_gitlab_type_url, + ["gitlab.nine.ch"] = require("gitlinker.hosts").get_gitlab_type_url, ["try.gitea.io"] = require("gitlinker.hosts").get_gitea_type_url, ["codeberg.org"] = require("gitlinker.hosts").get_gitea_type_url, ["bitbucket.org"] = require("gitlinker.hosts").get_bitbucket_type_url, diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index ee051cf..b8046df 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -103,3 +103,7 @@ vim.keymap.set("n", "o", function() print("No valid string found on the current line.") end end) + +vim.keymap.set('n', '', ':let @+ = "rspec " . substitute(expand("%:p"), getcwd() . "/", "", "") . ":" . line(".")') +vim.keymap.set('n', '', ':let @+ = "rspec " . substitute(expand("%:p"), getcwd() . "/", "", "")') +vim.keymap.set('n', '', ':let @+ = "rubocop " . substitute(expand("%:p"), getcwd() . "/", "", "")') diff --git a/scripts/pretty-pulls.ts b/scripts/pretty-pulls.ts index f941ee4..42772cb 100755 --- a/scripts/pretty-pulls.ts +++ b/scripts/pretty-pulls.ts @@ -12,9 +12,6 @@ curl -L \ let data = ''; -process.stdin.resume(); -process.stdin.setEncoding('utf8'); - process.stdin.on('data', (chunk) => { data += chunk; }); From 964f2cbd722414680be81ec4bcf44b57c6935425 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Sun, 21 Sep 2025 11:43:34 +0200 Subject: [PATCH 273/280] updates --- .config/bat/bat | 1 + .config/bat/config | 2 + .config/nvim/lazy-lock.json | 85 ++-- .../nvim/lua/plugins/cellular_automaton.lua | 4 + .config/nvim/lua/plugins/codecompanion.lua | 9 + .config/nvim/lua/plugins/codeium.lua | 3 +- .config/nvim/lua/plugins/colorscheme.lua | 33 +- .config/nvim/lua/plugins/copilotchat.lua | 195 +++++----- .config/nvim/lua/plugins/endpoint.lua | 77 ++++ .config/nvim/lua/plugins/jsonpath.lua | 5 + .config/nvim/lua/plugins/jupynium.lua | 13 + .config/nvim/lua/plugins/lualine.lua | 71 ++-- .config/nvim/lua/plugins/neotest.lua | 83 ++-- .config/nvim/lua/plugins/nvim-lspconfig.lua | 11 +- .config/nvim/lua/plugins/nvim-treesitter.lua | 1 + .config/nvim/lua/plugins/telescope.lua | 211 +++++----- .config/nvim/lua/plugins/whichkey.lua | 34 +- .config/nvim/lua/settings.lua | 8 +- .config/nvim/lua/theme.lua | 3 +- .config/zellij/config.kdl | 10 +- scripts/pretty-pulls.ts | 3 + scripts/simplecov_parser.rb | 367 ++++++++++++++++++ 22 files changed, 894 insertions(+), 335 deletions(-) create mode 120000 .config/bat/bat create mode 100644 .config/bat/config create mode 100644 .config/nvim/lua/plugins/cellular_automaton.lua create mode 100644 .config/nvim/lua/plugins/codecompanion.lua create mode 100644 .config/nvim/lua/plugins/endpoint.lua create mode 100644 .config/nvim/lua/plugins/jsonpath.lua create mode 100644 .config/nvim/lua/plugins/jupynium.lua create mode 100755 scripts/simplecov_parser.rb diff --git a/.config/bat/bat b/.config/bat/bat new file mode 120000 index 0000000..65fcef6 --- /dev/null +++ b/.config/bat/bat @@ -0,0 +1 @@ +/Users/dani/.config/bat \ No newline at end of file diff --git a/.config/bat/config b/.config/bat/config new file mode 100644 index 0000000..305dfdd --- /dev/null +++ b/.config/bat/config @@ -0,0 +1,2 @@ +--style plain +--theme gruvbox-dark diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 9ffc6aa..5dc977c 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,71 +1,80 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "CopilotChat.nvim": { "branch": "canary", "commit": "451d365928a994cda3505a84905303f790e28df8" }, - "LuaSnip": { "branch": "master", "commit": "c1851d5c519611dfc451b6582961b2602e0af89b" }, - "auto-session": { "branch": "main", "commit": "00334ee24b9a05001ad50221c8daffbeedaa0842" }, + "LuaSnip": { "branch": "master", "commit": "21f74f7ba8c49f95f9d7c8293b147c2901dd2d3a" }, + "auto-session": { "branch": "main", "commit": "5a269bb5bec50b8b60564aa00f6454d9e82fbe8d" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, - "bufexplorer": { "branch": "master", "commit": "3bfc3885bdc0982840c1f0c95545f390c06c8074" }, + "bufexplorer": { "branch": "master", "commit": "b96d275811b92e86ee52be3112e1de735ba08fb9" }, + "cellular-automaton.nvim": { "branch": "main", "commit": "1606e9d5d04ff254023c3f3c62842d065708d6d3" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, - "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, - "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, + "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "codeium.vim": { "branch": "main", "commit": "272c6e2755e8faa90e26bcdcd9fde6b9e61751ea" }, - "copilot.lua": { "branch": "master", "commit": "0929c92097a49b6ae3565aab157fa2bce398d953" }, - "csvview.nvim": { "branch": "main", "commit": "6eb9c7293d35c40a71ec1eb9c653d80e8de5a2e9" }, + "copilot.lua": { "branch": "master", "commit": "8aebaa3a102125fedf08c98773a0a8def92fff37" }, + "csvview.nvim": { "branch": "main", "commit": "bbab4c2f808fd8e11ec8dfdd128251aadba566a1" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "endpoint.nvim": { "branch": "master", "commit": "33108d5f96690b585bfcc1e3a6093d689835a74b" }, "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "fzf-lua": { "branch": "main", "commit": "d39620ba79d3685bae28e76b9a9a8dbc1cf2cd34" }, "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, - "gitsigns.nvim": { "branch": "main", "commit": "e399f9748d7cfd8859747c8d6c4e9c8b4d50a1bd" }, - "gradle.nvim": { "branch": "main", "commit": "1d44d64c1dc157ab11c9d8669c108ab02f789662" }, + "gitsigns.nvim": { "branch": "main", "commit": "f780609807eca1f783a36a8a31c30a48fbe150c5" }, + "gradle.nvim": { "branch": "main", "commit": "81c39ac1b1782061421bdc9295a4213894495a6d" }, "grug-far.nvim": { "branch": "main", "commit": "176ba4c42924f4d84ee7d19c9f0081c538f84a88" }, + "gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" }, "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, + "jsonpath.nvim": { "branch": "main", "commit": "0ea5bd5441189a0496630a14e7433bdc1b943cf2" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lsp-zero.nvim": { "branch": "v4.x", "commit": "2afa32e732d7b36e80cd5241fbdc4a38e123c4e0" }, - "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, + "lsp-zero.nvim": { "branch": "v4.x", "commit": "d388e2b71834c826e61a3eba48caec53d7602510" }, + "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" }, - "mason.nvim": { "branch": "main", "commit": "888d6ee499d8089a3a4be4309d239d6be1c1e6c0" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "7f9a39fcd2ac6e979001f857727d606888f5909c" }, + "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, "maximize.nvim": { "branch": "master", "commit": "d688b66344b03ee6e5a32a0a40af85d174490af8" }, - "mini.cursorword": { "branch": "main", "commit": "ab63cc74975f4e107dbb490f6d3040eacfc1c023" }, - "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, - "neogit": { "branch": "master", "commit": "6de4b9f9a92917f9aea3a0dbdc3dbbedc11d26be" }, - "neotest": { "branch": "master", "commit": "862afb2a2219d9ca565f67416fb7003cc0f22c4f" }, - "neotest-java": { "branch": "main", "commit": "3cc0bceb0b0957e918939ba95434197e6b3775e7" }, - "neotest-minitest": { "branch": "main", "commit": "7ff057de8ab2c27491ff27c7be9826b8f3bb5ec1" }, - "neotest-rspec": { "branch": "main", "commit": "281c0ed0e55d623e8028796e1c4dc27b7e421fd0" }, - "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, - "nvim-asciidoc-preview": { "branch": "main", "commit": "b12e113b5f7e7522b4e412213d5498cc529f2628" }, - "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, + "mini.cursorword": { "branch": "main", "commit": "84c82f8040a75445f1f39a0d36f4d0d0fe0bee92" }, + "mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" }, + "neogit": { "branch": "master", "commit": "df08cb97f126c546a5ec265bafab2d78cc7399fa" }, + "neotest": { "branch": "master", "commit": "2cf3544fb55cdd428a9a1b7154aea9c9823426e8" }, + "neotest-java": { "branch": "main", "commit": "0f31785a9cffa98c71eaeb80bf9f55d0d80fcb4d" }, + "neotest-minitest": { "branch": "main", "commit": "4d1c19f80be0efff7656dea76a589c02bf418b68" }, + "neotest-mocha": { "branch": "main", "commit": "342664d54d2177cd0b21742ddf8c447ff278df46" }, + "neotest-rspec": { "branch": "main", "commit": "e7dc67c1167a9e593c804a6be6808ba9a5920d43" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-asciidoc-preview": { "branch": "main", "commit": "b2bd92c9f39c2203c0a91085705aeac5fb7d2903" }, + "nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, - "nvim-lspconfig": { "branch": "master", "commit": "ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57" }, + "nvim-jdtls": { "branch": "master", "commit": "c23f200fee469a415c77265ca55b496feb646992" }, + "nvim-lspconfig": { "branch": "master", "commit": "d9879110d0422a566fa01d732556f4d5515e1738" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-surround": { "branch": "main", "commit": "0e62500b98f4513feaaf7425c135472457ea5b7d" }, - "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, - "nvim-treesitter-endwise": { "branch": "master", "commit": "d6cbb83307d516ec076d17c9a33d704ef626ee8c" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "b0debd5c424969b4baeabdc8f54db3036c691732" }, - "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, - "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, + "nvim-surround": { "branch": "main", "commit": "a868c256c861044beb9794b4dd126480dcdfbdad" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "a61a9de7965324d4019fb1637b66bfacdcb01f51" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" }, + "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, + "nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" }, "oil.nvim": { "branch": "feat/scratch-preview", "commit": "15a17fdff4866394bdf1f7bf081b818ec3de44f5" }, "open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" }, "plantuml-previewer.vim": { "branch": "master", "commit": "368a1f331c1ff29f6a3ee76facfca39a7f374b13" }, "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "refactoring.nvim": { "branch": "master", "commit": "2be7ea3f10b7e59658f5abf6dffc50b5d61964d6" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "refactoring.nvim": { "branch": "master", "commit": "74b608dfee827c2372250519d433cc21cb083407" }, + "snacks.nvim": { "branch": "main", "commit": "da230e3ca8146da4b73752daaf0a1d07d343c12d" }, "solarized.nvim": { "branch": "main", "commit": "c0dfe1cbfabd93b546baf5f1408f5df7e02e2050" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "text-case.nvim": { "branch": "main", "commit": "e898cfd46fa6cde0e83abb624a16e67d2ffc6457" }, "tokyonight-vim": { "branch": "master", "commit": "4e82e0f0452a6ce8f387828ec71013015515035a" }, "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, - "undotree": { "branch": "main", "commit": "eab459ab87dd249617b5f7187bb69e614a083047" }, + "undotree": { "branch": "main", "commit": "68fb733769fed365cca72d7c97c5cc2fd3d31055" }, "vim-case-convert": { "branch": "master", "commit": "0a75eb4cf77976c1cdecaa6155c752b1f0c693d8" }, - "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }, + "vim-fetch": { "branch": "master", "commit": "db3fd95eb0cf7e7e9effa1338b286db33e4a36c1" }, + "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, "vim-polar": { "branch": "master", "commit": "dc7723d0a8ee8b00a3d15ef19c6720403654c23b" }, "vim-rails": { "branch": "master", "commit": "b0a5c76f86ea214ade36ab0b811e730c3f0add67" }, - "vim-tmux-navigator": { "branch": "master", "commit": "33afa80db65113561dc53fa732b7f5e53d5ecfd0" }, + "vim-tmux-navigator": { "branch": "master", "commit": "c45243dc1f32ac6bcf6068e5300f3b2b237e576a" }, "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, - "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, + "yaml.nvim": { "branch": "main", "commit": "c6c7bac834c3f48e1afdb78a7a1d23996a2f89d9" } } diff --git a/.config/nvim/lua/plugins/cellular_automaton.lua b/.config/nvim/lua/plugins/cellular_automaton.lua new file mode 100644 index 0000000..1e21b5b --- /dev/null +++ b/.config/nvim/lua/plugins/cellular_automaton.lua @@ -0,0 +1,4 @@ +return { + "Eandrju/cellular-automaton.nvim", + lazy = false +} diff --git a/.config/nvim/lua/plugins/codecompanion.lua b/.config/nvim/lua/plugins/codecompanion.lua new file mode 100644 index 0000000..2c99bc8 --- /dev/null +++ b/.config/nvim/lua/plugins/codecompanion.lua @@ -0,0 +1,9 @@ +return { + -- "olimorris/codecompanion.nvim", + -- lazy = false, + -- opts = {}, + -- dependencies = { + -- "nvim-lua/plenary.nvim", + -- "nvim-treesitter/nvim-treesitter", + -- }, +} diff --git a/.config/nvim/lua/plugins/codeium.lua b/.config/nvim/lua/plugins/codeium.lua index 803c538..4b37ae5 100644 --- a/.config/nvim/lua/plugins/codeium.lua +++ b/.config/nvim/lua/plugins/codeium.lua @@ -1,2 +1,3 @@ -return { "Exafunction/codeium.vim", lazy = false } +return {} +-- return { "Exafunction/codeium.vim", lazy = false } -- sall :Codeium Auth after installation to get Token ID diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index 24b87d1..39a41ef 100644 --- a/.config/nvim/lua/plugins/colorscheme.lua +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -1,17 +1,20 @@ return { - { - "ghifarit53/tokyonight-vim", - lazy = false, - priority = 1000, - }, - { - "maxmx03/solarized.nvim", - lazy = false, - priority = 1000, - }, - { - "habamax/vim-polar", - lazy = false, - priority = 1000, - }, + { + "ghifarit53/tokyonight-vim", + lazy = false, + priority = 1000, + }, + { + "maxmx03/solarized.nvim", + lazy = false, + priority = 1000, + }, + { + "habamax/vim-polar", + lazy = false, + priority = 1000, + }, + { "ellisonleao/gruvbox.nvim", priority = 1000, config = { + transparent_mode = true, + } } } diff --git a/.config/nvim/lua/plugins/copilotchat.lua b/.config/nvim/lua/plugins/copilotchat.lua index bfb77d5..1d42900 100644 --- a/.config/nvim/lua/plugins/copilotchat.lua +++ b/.config/nvim/lua/plugins/copilotchat.lua @@ -1,97 +1,98 @@ -return { - "CopilotC-Nvim/CopilotChat.nvim", - dependencies = { - { "zbirenbaum/copilot.lua" }, - { "nvim-lua/plenary.nvim" }, - }, - commands = { - "CopilotChat", - "CopilotChatOpen", - "CopilotChatClose", - "CopilotChatToggle", - "CopilotChatStop", - "CopilotChatReset", - "CopilotChatSave", - "CopilotChatLoad", - "CopilotChatDebugInfo", - "CopilotChatModels", - "CopilotChatExplain", - "CopilotChatReview", - "CopilotChatFix", - "CopilotChatOptimize", - "CopilotChatDocs", - "CopilotChatTests", - "CopilotChatFixDiagnostic", - "CopilotChatCommit", - "CopilotChatCommitStaged", - }, - opts = { - temperature = 0.3, - auto_insert_mode = true, - system_prompt = "You are a AI (femboy) assistant for developers. Make sure that you reply the same way a cute femboy would do. UwU. Don't forget that you are an expert in the field and attempt to repond in a concise way.", - mappings = { - reset = { - normal = "", - insert = "", - }, - complete = { - detail = "Use @ or / for options.", - insert = "", - }, - submit_prompt = { - normal = "", - insert = "", - }, - accept_diff = { - normal = "", - insert = "", - }, - yank_diff = { - normal = "gy", - }, - show_diff = { - normal = "gd", - }, - show_system_prompt = { - normal = "gp", - }, - show_user_selection = { - normal = "gs", - }, - }, - }, - keys = { - { - "p", - "CopilotChat", - desc = "CopilotChat - Quick chat", - }, - { - "ccq", - function() - local input = vim.fn.input("Quick Chat: ") - if input ~= "" then - require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) - end - end, - desc = "CopilotChat - Quick chat", - }, - { - "cch", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.help_actions()) - end, - desc = "CopilotChat - Help actions", - }, - -- Show prompts actions with telescope - { - "ccp", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) - end, - desc = "CopilotChat - Prompt actions", - }, - }, -} +return {} +-- return { +-- "CopilotC-Nvim/CopilotChat.nvim", +-- dependencies = { +-- { "zbirenbaum/copilot.lua" }, +-- { "nvim-lua/plenary.nvim" }, +-- }, +-- commands = { +-- "CopilotChat", +-- "CopilotChatOpen", +-- "CopilotChatClose", +-- "CopilotChatToggle", +-- "CopilotChatStop", +-- "CopilotChatReset", +-- "CopilotChatSave", +-- "CopilotChatLoad", +-- "CopilotChatDebugInfo", +-- "CopilotChatModels", +-- "CopilotChatExplain", +-- "CopilotChatReview", +-- "CopilotChatFix", +-- "CopilotChatOptimize", +-- "CopilotChatDocs", +-- "CopilotChatTests", +-- "CopilotChatFixDiagnostic", +-- "CopilotChatCommit", +-- "CopilotChatCommitStaged", +-- }, +-- opts = { +-- temperature = 0.3, +-- auto_insert_mode = true, +-- system_prompt = "You are a AI (femboy) assistant for developers. Make sure that you reply the same way a cute femboy would do. UwU. Don't forget that you are an expert in the field and attempt to repond in a concise way.", +-- mappings = { +-- reset = { +-- normal = "", +-- insert = "", +-- }, +-- complete = { +-- detail = "Use @ or / for options.", +-- insert = "", +-- }, +-- submit_prompt = { +-- normal = "", +-- insert = "", +-- }, +-- accept_diff = { +-- normal = "", +-- insert = "", +-- }, +-- yank_diff = { +-- normal = "gy", +-- }, +-- show_diff = { +-- normal = "gd", +-- }, +-- show_system_prompt = { +-- normal = "gp", +-- }, +-- show_user_selection = { +-- normal = "gs", +-- }, +-- }, +-- }, +-- keys = { +-- { +-- "p", +-- "CopilotChat", +-- desc = "CopilotChat - Quick chat", +-- }, +-- { +-- "ccq", +-- function() +-- local input = vim.fn.input("Quick Chat: ") +-- if input ~= "" then +-- require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) +-- end +-- end, +-- desc = "CopilotChat - Quick chat", +-- }, +-- { +-- "cch", +-- function() +-- local actions = require("CopilotChat.actions") +-- require("CopilotChat.integrations.telescope").pick(actions.help_actions()) +-- end, +-- desc = "CopilotChat - Help actions", +-- }, +-- -- Show prompts actions with telescope +-- { +-- "ccp", +-- function() +-- local actions = require("CopilotChat.actions") +-- require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) +-- end, +-- desc = "CopilotChat - Prompt actions", +-- }, +-- }, +-- } diff --git a/.config/nvim/lua/plugins/endpoint.lua b/.config/nvim/lua/plugins/endpoint.lua new file mode 100644 index 0000000..cbcd4a8 --- /dev/null +++ b/.config/nvim/lua/plugins/endpoint.lua @@ -0,0 +1,77 @@ +return { + "zerochae/endpoint.nvim", + dependencies = { "nvim-telescope/telescope.nvim" }, + cmd = { + "Endpoint", + }, + config = function() + require("endpoint").setup({ + -- Framework configuration + framework = "auto", -- "auto", "spring", "nestjs", "django", "rails", "express" + + -- Optional: Path-based framework overrides + framework_paths = { + ["/path/to/spring/project"] = "spring", + ["/path/to/nestjs/project"] = "nestjs", + }, + + -- Cache configuration + cache_mode = "persistent", -- Cache mode: "session" or "persistent" + debug = false, -- Enable debug logging + + ui = { + show_icons = true, -- Show method icons + show_method = true, -- Show method text (GET, POST, etc.) + use_nerd_font = false, -- Use nerd font glyphs instead of emojis + + -- Customize icons (requires show_icons = true) + method_icons = { + emoji = { + GET = "📥", + POST = "📤", + PUT = "✏️", + DELETE = "🗑️", + PATCH = "🔧", + }, + nerd_font = { + GET = "", -- download icon + POST = "", -- upload icon + PUT = "", -- edit icon + DELETE = "", -- trash icon + PATCH = "", -- wrench icon + }, + }, + + -- Customize colors + method_colors = { + GET = "DiagnosticOk", -- Green + POST = "DiagnosticInfo", -- Blue + PUT = "DiagnosticWarn", -- Yellow + DELETE = "DiagnosticError", -- Red + PATCH = "DiagnosticHint", -- Purple + }, + + -- Cache status UI customization + cache_status_icons = { + emoji = { + title = "🚀", success = "✅", error = "❌", + tree = "🌳", directory = "📁", file = "📄" + }, + nerd_font = { + title = "", success = "", error = "", + tree = "", directory = "", file = "" + }, + }, + + -- Cache status syntax highlighting + cache_status_highlight = { + title = "Special", + success = "DiagnosticOk", + error = "DiagnosticError", + key = "Keyword", + tree_method = "Function", + }, + }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/jsonpath.lua b/.config/nvim/lua/plugins/jsonpath.lua new file mode 100644 index 0000000..45bc16a --- /dev/null +++ b/.config/nvim/lua/plugins/jsonpath.lua @@ -0,0 +1,5 @@ +return { + "phelipetls/jsonpath.nvim", + cmd = "JsonPathCopy", + opts = { show_on_winbar = true, reg = "+" }, +} diff --git a/.config/nvim/lua/plugins/jupynium.lua b/.config/nvim/lua/plugins/jupynium.lua new file mode 100644 index 0000000..62b94af --- /dev/null +++ b/.config/nvim/lua/plugins/jupynium.lua @@ -0,0 +1,13 @@ +return {} + +-- return { +-- "kiyoon/jupynium.nvim", +-- lazy = false, +-- build = "pip3 install --user .", +-- deps = { +-- "rcarriga/nvim-notify", -- optional +-- "stevearc/dressing.nvim", -- optional, UI for :JupyniumKernelSelect +-- } +-- -- build = "uv pip install . --python=$HOME/.virtualenvs/jupynium/bin/python", +-- -- build = "conda run --no-capture-output -n jupynium pip install .", +-- } diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index 76ae8bb..45ed268 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -12,36 +12,49 @@ return { -- Color table for highlights -- stylua: ignore -- dark + -- local colors = { + -- bg = '#202328', + -- fg = '#bbc2cf', + -- yellow = '#ECBE7B', + -- cyan = '#008080', + -- darkblue = '#081633', + -- green = '#98be65', + -- orange = '#FF8800', + -- violet = '#a9a1e1', + -- magenta = '#c678dd', + -- blue = '#51afef', + -- red = '#ec5f67', + -- } + -- + -- if vim.o.background == "light" then + -- colors = { + -- bg = '#FFFFFF', -- Light background + -- fg = '#2E2E2E', -- Darker foreground for contrast + -- yellow = '#7F6D3A', -- Softer yellow + -- cyan = '#009B9F', -- Softer cyan + -- darkblue = '#2C3E50', -- Softer dark blue + -- green = '#5C9E3E', -- Softer green + -- orange = '#E76E27', -- Softer orange + -- violet = '#8E9DCC', -- Softer violet + -- magenta = '#D25D91', -- Softer magenta + -- blue = '#6BB6E8', -- Softer blue + -- red = '#E53A35', -- Softer red + -- } + -- end + local colors = { - bg = '#202328', - fg = '#bbc2cf', - yellow = '#ECBE7B', - cyan = '#008080', - darkblue = '#081633', - green = '#98be65', - orange = '#FF8800', - violet = '#a9a1e1', - magenta = '#c678dd', - blue = '#51afef', - red = '#ec5f67', + black = '#282828', + white = '#ebdbb2', + red = '#fb4934', + green = '#b8bb26', + blue = '#83a598', + yellow = '#fe8019', + gray = '#a89984', + darkgray = '#3c3836', + lightgray = '#504945', + inactivegray = '#7c6f64', } - if vim.o.background == "light" then - colors = { - bg = '#FFFFFF', -- Light background - fg = '#2E2E2E', -- Darker foreground for contrast - yellow = '#7F6D3A', -- Softer yellow - cyan = '#009B9F', -- Softer cyan - darkblue = '#2C3E50', -- Softer dark blue - green = '#5C9E3E', -- Softer green - orange = '#E76E27', -- Softer orange - violet = '#8E9DCC', -- Softer violet - magenta = '#D25D91', -- Softer magenta - blue = '#6BB6E8', -- Softer blue - red = '#E53A35', -- Softer red - } - end - local conditions = { buffer_not_empty = function() return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 @@ -78,6 +91,7 @@ return { lualine_z = {}, -- These will be filled later lualine_c = {}, + -- lualine_x = { require("yaml_nvim").get_yaml_key }, lualine_x = {}, }, inactive_sections = { @@ -87,6 +101,7 @@ return { lualine_y = {}, lualine_z = {}, lualine_c = {}, + -- lualine_x = { require("yaml_nvim").get_yaml_key }, lualine_x = {}, }, } @@ -112,7 +127,7 @@ return { ins_left { -- mode component function() - return '' + return '󰊠' end, color = function() -- auto change color according to neovims mode diff --git a/.config/nvim/lua/plugins/neotest.lua b/.config/nvim/lua/plugins/neotest.lua index ffb0746..4830205 100644 --- a/.config/nvim/lua/plugins/neotest.lua +++ b/.config/nvim/lua/plugins/neotest.lua @@ -1,34 +1,61 @@ return { - "nvim-neotest/neotest", - event = "VeryLazy", - dependencies = { - "nvim-neotest/nvim-nio", - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - "olimorris/neotest-rspec", - "zidhuss/neotest-minitest", - "rcasia/neotest-java", - }, - config = function() - require("neotest").setup({ - adapters = { - require("neotest-minitest"), - require("neotest-rspec")({ + "nvim-neotest/neotest", + event = "VeryLazy", + dependencies = { + "nvim-neotest/nvim-nio", + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "olimorris/neotest-rspec", + "zidhuss/neotest-minitest", + "rcasia/neotest-java", + 'mfussenegger/nvim-jdtls', + "adrigzr/neotest-mocha", + }, + config = function() + require("neotest").setup({ + adapters = { + require("neotest-minitest"), + require("neotest-mocha")({ + command = "bunx mocha --", + command_args = function(context) + -- The context contains: + -- results_path: The file that json results are written to + -- test_name_pattern: The generated pattern for the test + -- path: The path to the test file + -- + -- It should return a string array of arguments + -- + -- Not specifying 'command_args' will use the defaults below + local relative_path = vim.fn.fnamemodify(context.path, ":.") + return { + "--full-trace", + "--reporter=json", + "--reporter-options=output=" .. context.results_path, + "--grep=" .. context.test_name_pattern, + relative_path, + } + end, + env = { CI = true }, + cwd = function() + return vim.fn.getcwd() + end, + }), + require("neotest-rspec")({ rspec_cmd = function() return { "mise", "exec", "--", "bundle", "exec", "rspec" } end }), - ["neotest-java"] = { - ignore_wrapper = true, - }, - }, - }) - end, - keys = { - { "tt", "Neotest run file", desc = "Test file" }, - { "tr", "Neotest run", desc = "Run closest test" }, - { "to", "Neotest output", desc = "Test output" }, - { "tO", "Neotest output-panel", desc = "Test output panel" }, - { "ts", "Neotest stop", desc = "Stop test" }, - }, + require("neotest-java") { + ignore_wrapper = true, + } + }, + }) + end, + keys = { + { "tt", "Neotest run file", desc = "Test file" }, + { "tr", "Neotest run", desc = "Run closest test" }, + { "to", "Neotest output", desc = "Test output" }, + { "tO", "Neotest output-panel", desc = "Test output panel" }, + { "ts", "Neotest stop", desc = "Stop test" }, + }, } diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index 41b36a3..8850131 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -44,12 +44,19 @@ return { }, }, settings = { - - -- Server settings should go here + formatter = { + enabled = true + } } } }) + -- herb? + vim.lsp.config('herb_ls', { + cmd = { "herb-language-server", "--stdio" }, + filetypes = { 'erb'}, + }) + -- LSP keymaps and autocmds vim.api.nvim_create_autocmd("LspAttach", { desc = "LSP actions", diff --git a/.config/nvim/lua/plugins/nvim-treesitter.lua b/.config/nvim/lua/plugins/nvim-treesitter.lua index 7a0b898..42d8abd 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter.lua @@ -9,6 +9,7 @@ return { require("nvim-treesitter.configs").setup({ ensure_installed = { "lua", + "yaml", "vim", "vimdoc", "query", diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 5945fd5..fd8bc1b 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -1,109 +1,114 @@ return { - "nvim-telescope/telescope.nvim", - tag = "0.1.8", - dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-ui-select.nvim" }, - config = function() - require("telescope").setup({ - extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown({}), - }, - }, - previewers = { - qflist = { - updatetime = 25, - layout_config = { - width = 0.75, - height = 0.75, - }, - }, - }, - defaults = { - file_ignore_patterns = { ".git/" }, -- Ignore the .git directory - mappings = { - n = { - [""] = require("telescope.actions").send_selected_to_qflist - + require("telescope.actions").open_qflist, - }, - }, - }, - }) + "nvim-telescope/telescope.nvim", + tag = "0.1.8", + dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-ui-select.nvim" }, + config = function() + require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + }, + previewers = { + qflist = { + updatetime = 25, + layout_config = { + width = 0.75, + height = 0.75, + }, + }, + }, + defaults = { + file_ignore_patterns = { ".git/" }, -- Ignore the .git directory + mappings = { + n = { + [""] = require("telescope.actions").send_selected_to_qflist + + require("telescope.actions").open_qflist, + }, + }, + }, + }) - require("telescope").load_extension("ui-select") - local harpoon = require("harpoon") - harpoon:setup({}) + require("telescope").load_extension("ui-select") + local harpoon = require("harpoon") + harpoon:setup({}) - -- basic telescope configuration - local conf = require("telescope.config").values - local function toggle_telescope(harpoon_files) - local file_paths = {} - for _, item in ipairs(harpoon_files.items) do - table.insert(file_paths, item.value) - end + -- basic telescope configuration + local conf = require("telescope.config").values + local function toggle_telescope(harpoon_files) + local file_paths = {} + for _, item in ipairs(harpoon_files.items) do + table.insert(file_paths, item.value) + end - require("telescope.pickers") - .new({}, { - prompt_title = "Harpoon", - finder = require("telescope.finders").new_table({ - results = file_paths, - }), - layout_strategy = "center", - previewer = conf.file_previewer({}), - sorter = conf.generic_sorter({}), - }) - :find() - end + require("telescope.pickers") + .new({}, { + prompt_title = "Harpoon", + finder = require("telescope.finders").new_table({ + results = file_paths, + }), + layout_strategy = "center", + previewer = conf.file_previewer({}), + sorter = conf.generic_sorter({}), + }) + :find() + end - vim.keymap.set("n", "", function() - toggle_telescope(harpoon:list()) - end, { desc = "Open harpoon window" }) - end, - keys = { - { "", 'Telescope find_files path_display={"smart"}', desc = "Find files" }, - { "", "Telescope buffers", desc = "Find buffer" }, - { "C", "Telescope commands", desc = "Find commands" }, - { "", "Telescope lsp_document_symbols", desc = "Find symbols" }, - { "f", "Telescope find_files hidden=true", desc = "Find files" }, - -- { "e", "Telescope find_files hidden=false", desc = "Find all files" }, - { "w", "Telescope live_grep", desc = "Find substring" }, - { - "r", - function() - local current_word = vim.fn.expand("") - require("telescope.builtin").grep_string({ search = current_word }) - end, - }, - { "cc", "Telescope git_commits", desc = "Find git commits" }, - { - "ac", - "Telescope find_files prompt_title=Controllers cwd=app/controllers/ hidden=true", - desc = "Find Rails controllers", - }, - { - "ah", - "Telescope find_files prompt_title=Controllers cwd=app/helpers/ hidden=true", - desc = "Find Rails helpers", - }, - { - "am", - "Telescope find_files prompt_title=Models cwd=app/models/ hidden=true", - desc = "Find Rails models", - }, - { - "at", - "Telescope find_files prompt_title=Specs cwd=spec/ hidden=true", - desc = "Find Rails specs", - }, - { - "af", - "Telescope find_files prompt_title=Specs cwd=spec/factories hidden=true", - desc = "Find Rails factories", - }, - { - "av", - "Telescope find_files prompt_title=Views cwd=app/views hidden=true", - desc = "Find Rails views", - }, - { "l", "Telescope lsp_document_symbols", desc = "Find symbols" }, - }, + vim.keymap.set("n", "", function() + toggle_telescope(harpoon:list()) + end, { desc = "Open harpoon window" }) + end, + keys = { + { "", 'Telescope find_files path_display={"smart"}', desc = "Find files" }, + { "", "Telescope buffers", desc = "Find buffer" }, + { "C", "Telescope commands", desc = "Find commands" }, + { "", "Telescope lsp_document_symbols", desc = "Find symbols" }, + { "f", "Telescope find_files hidden=true", desc = "Find files" }, + -- { "e", "Telescope find_files hidden=false", desc = "Find all files" }, + { "w", "Telescope live_grep", desc = "Find substring" }, + { + "r", + function() + local current_word = vim.fn.expand("") + require("telescope.builtin").grep_string({ search = current_word }) + end, + }, + { "cc", "Telescope git_commits", desc = "Find git commits" }, + { + "ac", + "Telescope find_files prompt_title=Controllers cwd=app/controllers/ hidden=true", + desc = "Find Rails controllers", + }, + { + "as", + "Telescope find_files prompt_title=Services cwd=app/services/ hidden=true", + desc = "Find Rails services", + }, + { + "ah", + "Telescope find_files prompt_title=Helpers cwd=app/helpers/ hidden=true", + desc = "Find Rails helpers", + }, + { + "am", + "Telescope find_files prompt_title=Models cwd=app/models/ hidden=true", + desc = "Find Rails models", + }, + { + "at", + "Telescope find_files prompt_title=Specs cwd=spec/ hidden=true", + desc = "Find Rails specs", + }, + { + "af", + "Telescope find_files prompt_title=Specs cwd=spec/factories hidden=true", + desc = "Find Rails factories", + }, + { + "av", + "Telescope find_files prompt_title=Views cwd=app/views hidden=true", + desc = "Find Rails views", + }, + { "l", "Telescope lsp_document_symbols", desc = "Find symbols" }, + }, } diff --git a/.config/nvim/lua/plugins/whichkey.lua b/.config/nvim/lua/plugins/whichkey.lua index bf03ff3..f8feb59 100644 --- a/.config/nvim/lua/plugins/whichkey.lua +++ b/.config/nvim/lua/plugins/whichkey.lua @@ -1,19 +1,19 @@ return { - "folke/which-key.nvim", - event = "VeryLazy", - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - delay = 0, - }, - keys = { - { - "?", - function() - require("which-key").show({ global = false }) - end, - desc = "Buffer Local Keymaps (which-key)", - }, - }, + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + delay = 0, + }, + keys = { + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)", + }, + }, } diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index b8046df..ba78712 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -1,3 +1,4 @@ +vim.opt.swapfile = false vim.g.mapleader = " " vim.g.maplocalleader = "," vim.opt.cursorline = true @@ -104,6 +105,11 @@ vim.keymap.set("n", "o", function() end end) -vim.keymap.set('n', '', ':let @+ = "rspec " . substitute(expand("%:p"), getcwd() . "/", "", "") . ":" . line(".")') +-- vim.keymap.set('n', '', ':let @+ = "rspec " . substitute(expand("%:p"), getcwd() . "/", "", "") . ":" . line(".")') vim.keymap.set('n', '', ':let @+ = "rspec " . substitute(expand("%:p"), getcwd() . "/", "", "")') vim.keymap.set('n', '', ':let @+ = "rubocop " . substitute(expand("%:p"), getcwd() . "/", "", "")') + +vim.keymap.set('n', '', ':let @+ = substitute(expand("%:p"), getcwd() . "/", "", "")') +-- vim.keymap.set('n', '', ':let @+ = expand("%:p")') + +vim.api.nvim_create_user_command('Trim', ':%s/\\s\\+$//e', {}) diff --git a/.config/nvim/lua/theme.lua b/.config/nvim/lua/theme.lua index 4280f3c..2652fd3 100644 --- a/.config/nvim/lua/theme.lua +++ b/.config/nvim/lua/theme.lua @@ -2,7 +2,8 @@ if vim.o.background == "dark" then vim.g.tokyonight_style = "night" vim.g.tokyonight_transparent_background = 1 vim.g.tokyonight_enable_italic = 1 - vim.cmd("colorscheme tokyonight") + vim.cmd("colorscheme gruvbox") + -- vim.cmd("colorscheme vim") vim.cmd("set bg=dark") else vim.o.background = "light" diff --git a/.config/zellij/config.kdl b/.config/zellij/config.kdl index 80d5180..6313e23 100644 --- a/.config/zellij/config.kdl +++ b/.config/zellij/config.kdl @@ -313,9 +313,9 @@ plugins { // Plugins to load in the background when a new session starts // eg. "file:/path/to/my-plugin.wasm" // eg. "https://example.com/my-plugin.wasm" -// load_plugins { -// "https://github.com/dj95/zjstatus/releases/download/latest/zjstatus.wasm" -// } +load_plugins { + "https://github.com/dj95/zjstatus/releases/download/latest/zjstatus.wasm" +} // Use a simplified UI without special fonts (arrow glyphs) // Options: @@ -328,8 +328,9 @@ simplified_ui true // Default: default // // theme "tokyo-night-dark" +theme "gruvbox-dark" // theme "ayu-light" -theme "iceberg-light" +// theme "iceberg-light" // Choose the base input mode of zellij. // Default: normal @@ -513,3 +514,4 @@ show_release_notes false // bind "Super D" { NewPane "down"; } // bind "Super k" { Clear; } // } + diff --git a/scripts/pretty-pulls.ts b/scripts/pretty-pulls.ts index 42772cb..f941ee4 100755 --- a/scripts/pretty-pulls.ts +++ b/scripts/pretty-pulls.ts @@ -12,6 +12,9 @@ curl -L \ let data = ''; +process.stdin.resume(); +process.stdin.setEncoding('utf8'); + process.stdin.on('data', (chunk) => { data += chunk; }); diff --git a/scripts/simplecov_parser.rb b/scripts/simplecov_parser.rb new file mode 100755 index 0000000..13d4b40 --- /dev/null +++ b/scripts/simplecov_parser.rb @@ -0,0 +1,367 @@ +#!/usr/bin/env ruby + +# SimpleCov Coverage Parser +# ========================= +# +# Command-line tool to parse SimpleCov HTML coverage reports into text format. +# +# Features: +# - Parse SimpleCov HTML files into structured text output +# - Display overall coverage statistics with file counts and percentages +# - Group analysis by Rails conventions (Controllers, Models, Helpers, etc.) +# - File-level details with line and branch coverage metrics +# - Identify uncovered and partially covered lines with specific line numbers +# - Branch coverage analysis when available +# - Focused mode to show only files with coverage issues +# - Smart file discovery with common path fallbacks +# +# Requirements: +# - Ruby (any recent version) +# - nokogiri gem: gem install nokogiri +# +# Usage Examples: +# ./simplecov_parser.rb # Parse ./coverage/index.html +# ./simplecov_parser.rb coverage/index.html # Parse specific file +# ./simplecov_parser.rb -u # Show only uncovered files +# ./simplecov_parser.rb -d reports/coverage # Use different directory +# ./simplecov_parser.rb -f custom_coverage.html # Use different HTML file +# +# Use cases: +# - CI/CD pipelines to identify testing gaps +# - Code reviews focusing on coverage issues +# - Development workflow to track testing progress +# - Converting HTML reports for text-based tools and contexts + +require 'nokogiri' +require 'optparse' + +class SimpleCovParser + def initialize(html_file) + @html_file = html_file + @doc = nil + @options = {} + end + + def parse(options = {}) + @options = options + + File.open(@html_file, 'r') do |file| + @doc = Nokogiri::HTML(file) + end + + if @options[:uncovered_only] + puts "SimpleCov Coverage Report - Uncovered Issues Only" + puts "=" * 55 + parse_uncovered_only + else + puts "SimpleCov Coverage Report" + puts "=" * 50 + parse_summary + parse_groups + end + rescue => e + puts "Error parsing coverage file: #{e.message}" + exit 1 + end + + private + + def parse_summary + timestamp = @doc.css('.timestamp abbr').first&.attribute('title')&.value + puts "Generated: #{timestamp}" if timestamp + + all_files_section = @doc.css('#AllFiles').first + return unless all_files_section + + coverage_percent = all_files_section.css('.covered_percent .green').first&.text&.strip + hits_per_line = all_files_section.css('.covered_strength .green').first&.text&.strip + total_files = all_files_section.css('div').find { |div| div.text.match(/\d+ files in total/) }&.text&.match(/(\d+)/)[1] + + line_summary = all_files_section.css('.t-line-summary').first + if line_summary + relevant_lines = line_summary.css('b').first&.text + covered_lines = line_summary.css('.green b').first&.text + missed_lines = line_summary.css('.red b').first&.text + end + + branch_summary = all_files_section.css('.t-branch-summary').first + if branch_summary + total_branches = branch_summary.css('b').first&.text + covered_branches = branch_summary.css('.green b').first&.text + missed_branches = branch_summary.css('.red b').first&.text + end + + puts "\nOverall Coverage:" + puts " Files: #{total_files}" + puts " Line Coverage: #{coverage_percent} (#{covered_lines}/#{relevant_lines} lines)" + puts " Branch Coverage: #{branch_summary ? calculate_branch_percentage(covered_branches, total_branches) : 'N/A'} (#{covered_branches}/#{total_branches} branches)" if branch_summary + puts " Average Hits/Line: #{hits_per_line}" + puts + end + + def parse_groups + group_sections = @doc.css('.file_list_container').select do |section| + group_name = section.css('.group_name').first&.text + group_name && group_name != 'All Files' + end + + group_sections.each do |section| + parse_group(section) + end + end + + def parse_group(section) + group_name = section.css('.group_name').first&.text + + # In uncovered-only mode, check if group has any issues before showing + if @options[:uncovered_only] + files = section.css('.file_list tbody .t-file') + has_issues = files.any? do |file_row| + missed_lines = file_row.css('.cell--number')[4]&.text&.strip + missed_branches = file_row.css('.cell--number')[9]&.text&.strip + missed_lines.to_i > 0 || missed_branches.to_i > 0 + end + return unless has_issues + end + + puts "Group: #{group_name}" + puts "-" * (group_name.length + 7) + + unless @options[:uncovered_only] + coverage_percent = section.css('.covered_percent .green').first&.text&.strip + hits_per_line = section.css('.covered_strength .green').first&.text&.strip + + line_summary = section.css('.t-line-summary').first + if line_summary + relevant_lines = line_summary.css('b').first&.text + covered_lines = line_summary.css('.green b').first&.text + missed_lines = line_summary.css('.red b').first&.text + end + + branch_summary = section.css('.t-branch-summary').first + if branch_summary + total_branches = branch_summary.css('b').first&.text + covered_branches = branch_summary.css('.green b').first&.text + missed_branches = branch_summary.css('.red b').first&.text + end + + puts " Summary: #{coverage_percent} line coverage, #{hits_per_line} hits/line" + puts " Lines: #{covered_lines}/#{relevant_lines} covered" + puts " Branches: #{covered_branches}/#{total_branches} covered" if branch_summary + puts + end + + files = section.css('.file_list tbody .t-file') + files.each do |file_row| + parse_file_summary(file_row) + end + + puts + end + + def parse_file_summary(file_row) + file_link = file_row.css('.t-file__name a').first + file_path = file_link&.attribute('title')&.value + file_id = file_link&.attribute('href')&.value&.gsub('#', '') + + coverage_percent = file_row.css('.t-file__coverage').first&.text&.strip + line_count = file_row.css('.cell--number')[1]&.text&.strip + relevant_lines = file_row.css('.cell--number')[2]&.text&.strip + covered_lines = file_row.css('.cell--number')[3]&.text&.strip + missed_lines = file_row.css('.cell--number')[4]&.text&.strip + avg_hits = file_row.css('.cell--number')[5]&.text&.strip + + branch_coverage = file_row.css('.t-file__branch-coverage').first&.text&.strip + total_branches = file_row.css('.cell--number')[7]&.text&.strip + covered_branches = file_row.css('.cell--number')[8]&.text&.strip + missed_branches = file_row.css('.cell--number')[9]&.text&.strip + + # Skip files with perfect coverage in uncovered-only mode + if @options[:uncovered_only] + has_uncovered_lines = missed_lines.to_i > 0 + has_uncovered_branches = missed_branches.to_i > 0 + return unless has_uncovered_lines || has_uncovered_branches + end + + puts " #{file_path}" + puts " Line Coverage: #{coverage_percent} (#{covered_lines}/#{relevant_lines})" + puts " Branch Coverage: #{branch_coverage} (#{covered_branches}/#{total_branches})" if total_branches.to_i > 0 + puts " Average Hits: #{avg_hits}" + + if file_id + parse_file_details(file_id, file_path) + end + end + + def parse_file_details(file_id, file_path) + source_table = @doc.css("##{file_id}").first + return unless source_table + + lines = source_table.css('li') + uncovered_lines = [] + partial_lines = [] + + lines.each do |line| + line_number = line.attribute('data-linenumber')&.value + line_class = line.attribute('class')&.value + + next unless line_number + + case line_class + when 'missed' + uncovered_lines << line_number + when 'partial' + partial_lines << line_number + end + end + + if !uncovered_lines.empty? || !partial_lines.empty? + puts " Issues:" + puts " Uncovered lines: #{uncovered_lines.join(', ')}" unless uncovered_lines.empty? + puts " Partially covered lines: #{partial_lines.join(', ')}" unless partial_lines.empty? + end + end + + def parse_uncovered_only + timestamp = @doc.css('.timestamp abbr').first&.attribute('title')&.value + puts "Generated: #{timestamp}" if timestamp + + all_files_section = @doc.css('#AllFiles').first + if all_files_section + line_summary = all_files_section.css('.t-line-summary').first + branch_summary = all_files_section.css('.t-branch-summary').first + + missed_lines = line_summary&.css('.red b')&.first&.text || "0" + missed_branches = branch_summary&.css('.red b')&.first&.text || "0" + + total_issues = missed_lines.to_i + missed_branches.to_i + + if total_issues == 0 + puts "\nPerfect coverage! No uncovered lines or branches found." + return + else + puts "\nFound #{missed_lines} uncovered lines and #{missed_branches} uncovered branches:" + puts + end + end + + parse_groups + end + + def calculate_branch_percentage(covered, total) + return "0.0%" if total.to_i == 0 + percentage = (covered.to_f / total.to_f * 100).round(1) + "#{percentage}%" + end +end + +def show_help + puts <<~HELP + SimpleCov Coverage Parser + + USAGE: + #{$0} [OPTIONS] [COVERAGE_FILE] + + DESCRIPTION: + Parses SimpleCov HTML coverage files into digestible text format. + Includes file paths, line coverage, branch coverage, groups, and detailed line information. + + OPTIONS: + -d, --directory DIR Coverage directory (default: ./coverage) + -f, --file FILE Coverage HTML file (default: index.html) + -u, --uncovered-only Show only files with uncovered lines/branches + -h, --help Show this help message + -v, --verbose Show verbose output (currently same as default) + + EXAMPLES: + #{$0} # Parse ./coverage/index.html + #{$0} coverage/index.html # Parse specific file + #{$0} -d reports/coverage # Use different coverage directory + #{$0} -u # Show only uncovered files + #{$0} -f custom.html # Use different HTML file + + REQUIREMENTS: + - Ruby (any recent version) + - nokogiri gem (gem install nokogiri) + HELP +end + +def find_coverage_file(directory, filename) + path = File.join(directory, filename) + return path if File.exist?(path) + + # Try some common variations + variations = [ + File.join(directory, 'index.html'), + File.join('.', 'coverage', 'index.html'), + File.join('.', 'coverage_reports', 'index.html') + ] + + variations.find { |variation| File.exist?(variation) } +end + +# Main execution +options = { verbose: false, uncovered_only: false } +coverage_dir = 'coverage' +coverage_file = 'index.html' +target_file = nil + +OptionParser.new do |opts| + opts.banner = "Usage: #{$0} [options] coverage_file.html" + + opts.on("-d", "--directory DIR", "Coverage directory") do |dir| + coverage_dir = dir + end + + opts.on("-f", "--file FILE", "Coverage HTML file") do |file| + coverage_file = file + end + + opts.on("-v", "--verbose", "Show verbose output") do + options[:verbose] = true + end + + opts.on("-u", "--uncovered-only", "Show only files with uncovered lines/branches") do + options[:uncovered_only] = true + end + + opts.on("-h", "--help", "Show this help message") do + show_help + exit + end +end.parse! + +# Determine the coverage file to parse +if ARGV.length > 0 + target_file = ARGV[0] + unless File.exist?(target_file) + puts "Error: File '#{target_file}' not found" + exit 1 + end +else + target_file = find_coverage_file(coverage_dir, coverage_file) + unless target_file + puts "Error: Coverage file not found" + puts "Tried looking for:" + puts " #{File.join(coverage_dir, coverage_file)}" + puts " ./coverage/index.html" + puts " ./coverage_reports/index.html" + puts + puts "Make sure you have run your test suite with SimpleCov enabled." + exit 1 + end +end + +# Check dependencies +begin + require 'nokogiri' +rescue LoadError + puts "Error: nokogiri gem not found. Please install it with: gem install nokogiri" + exit 1 +end + +puts "Parsing coverage file: #{target_file}" +puts + +parser = SimpleCovParser.new(target_file) +parser.parse(options) From 688e39f404278a40fa5ec2b1b77d34a067455406 Mon Sep 17 00:00:00 2001 From: Daniel Bengl <53896675+CuddlyBunion341@users.noreply.github.com> Date: Wed, 24 Sep 2025 15:36:36 +0200 Subject: [PATCH 274/280] Implement dockerfile (#11) --- Brewfile | 38 +++++++++++++++++++++++ DOCKER_README.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 70 +++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 18 +++++++++++ 4 files changed, 203 insertions(+) create mode 100644 Brewfile create mode 100644 DOCKER_README.md create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000..95c61b7 --- /dev/null +++ b/Brewfile @@ -0,0 +1,38 @@ +# Core tools +brew "git" +brew "neovim" +brew "curl" +brew "wget" + +# Language version managers +brew "mise" + +# Development tools +brew "ruby-build" # Needed for mise to install Ruby +brew "openssl@3" # Dependency for ruby-build +brew "libyaml" # Dependency for ruby-build +brew "libffi" # Dependency for ruby-build + +# Search and file tools (commonly used with nvim) +brew "ripgrep" # rg - fast grep alternative +brew "fd" # fd - fast find alternative +brew "fzf" # fuzzy finder +brew "bat" # cat with syntax highlighting +brew "tree" # directory tree viewer + +# Git tools +brew "lazygit" # Git TUI + +# Terminal multiplexer +brew "tmux" # Terminal multiplexer +brew "zellij" # Modern terminal workspace + +# LSP and formatters that might be needed +brew "lua-language-server" +brew "stylua" # Lua formatter + +# Additional utilities +brew "jq" # JSON processor +brew "yq" # YAML processor +brew "htop" # Process viewer +brew "watch" # Execute command repeatedly \ No newline at end of file diff --git a/DOCKER_README.md b/DOCKER_README.md new file mode 100644 index 0000000..c7c9f25 --- /dev/null +++ b/DOCKER_README.md @@ -0,0 +1,77 @@ +# Neovim Docker Setup + +## Quick Start + +### Build and Run + +```bash +# Build the image +docker build -t nvim-dotfiles . + +# Run interactively +docker run -it --rm -v $(pwd):/workspace nvim-dotfiles + +# Or use docker-compose +docker-compose up -d +docker-compose exec nvim bash +``` + +### Usage Examples + +```bash +# Start Neovim +nvim + +# Check health +nvim --headless +checkhealth +qall + +# Use Ruby/Node with mise +eval "$(mise activate bash)" +ruby --version +node --version + +# Run project commands +bundle install # Ruby projects +npm install # Node projects +``` + +## Development Workflow + +1. **Start the container:** + ```bash + docker-compose up -d + docker-compose exec nvim bash + ``` + +2. **Your dotfiles are available** at `/home/developer/.dotfiles` + +3. **Work on projects** by mounting them: + ```bash + docker run -it --rm -v /path/to/project:/workspace nvim-dotfiles + ``` + +4. **Persistent data** is kept in Docker volumes for nvim and mise + +## Customization + +- Modify `Brewfile` to add/remove tools +- Update `.tool-versions` to change language versions +- Plugin configuration is automatically loaded from `.config/nvim/` + +## Troubleshooting + +- **Plugin issues**: Run `nvim --headless "+Lazy! sync" +qa` +- **Language issues**: Run `mise install` to reinstall languages +- **LSP issues**: Check `:LspInfo` and `:Mason` in neovim + +## Tools Available + +| Tool | Purpose | +|------|---------| +| `nvim` | Neovim editor | +| `rg`, `fd`, `fzf` | Fast searching and file finding | +| `bat`, `tree` | Enhanced file viewing | +| `lazygit` | Git TUI | +| `tmux`, `zellij` | Terminal multiplexing | +| `mise` | Runtime version management | +| `jq`, `yq` | JSON/YAML processing | diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f9127b1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,70 @@ +# Use Ubuntu as base image +FROM ubuntu:22.04 + +# Set environment variables +ENV DEBIAN_FRONTEND=noninteractive +ENV HOMEBREW_NO_ANALYTICS=1 +ENV HOMEBREW_NO_INSECURE_REDIRECT=1 +ENV HOMEBREW_CASK_OPTS="--require-sha" + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + build-essential \ + curl \ + file \ + git \ + procps \ + sudo \ + wget \ + ca-certificates \ + locales \ + && rm -rf /var/lib/apt/lists/* + +# Generate locale +RUN locale-gen en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 + +# Create a non-root user +RUN useradd -m -s /bin/bash developer && \ + echo 'developer ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# Switch to the developer user +USER developer +WORKDIR /home/developer + +# Install Homebrew +RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + +# Add Homebrew to PATH +ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}" + +# Copy Brewfile and install dependencies +COPY --chown=developer:developer Brewfile /home/developer/ +RUN brew bundle install --file=/home/developer/Brewfile + +# Copy dotfiles +COPY --chown=developer:developer . /home/developer/.dotfiles + +# Create symlinks for neovim config +RUN mkdir -p /home/developer/.config && \ + ln -sf /home/developer/.dotfiles/.config/nvim /home/developer/.config/nvim + +# Copy tool-versions for mise +RUN ln -sf /home/developer/.dotfiles/.tool-versions /home/developer/.tool-versions + +# Install languages using mise +RUN /bin/bash -c "eval \"\$(mise activate bash)\" && mise install" + +# Initialize neovim and install plugins +RUN nvim --headless "+Lazy! sync" +qa + +# Note: Treesitter parsers will be installed on first use +# You can manually install them with: :TSInstall + +# Set the working directory to dotfiles +WORKDIR /home/developer/.dotfiles + +# Default command +CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7bc0696 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: '3.8' +services: + nvim: + build: . + image: nvim-dotfiles + container_name: neovim-dev + volumes: + - .:/workspace + - nvim_data:/home/developer/.local/share/nvim + - mise_data:/home/developer/.local/share/mise + working_dir: /workspace + stdin_open: true + tty: true + command: /bin/bash + +volumes: + nvim_data: + mise_data: From 1775130ab87a93484c0aafd3f5c3a48b21b84ec8 Mon Sep 17 00:00:00 2001 From: Daniel Bengl <53896675+CuddlyBunion341@users.noreply.github.com> Date: Wed, 24 Sep 2025 16:10:23 +0200 Subject: [PATCH 275/280] Dockerize (#12) * Add zshrc * Update docker stuff * Update docker setup --- .zshrc | 184 +++++++++++++++++++++++++++++++++++++++++++++ DOCKER_README.md | 77 ------------------- Dockerfile | 30 +++++++- README.md | 9 +++ docker-compose.yml | 10 ++- 5 files changed, 225 insertions(+), 85 deletions(-) delete mode 100644 DOCKER_README.md diff --git a/.zshrc b/.zshrc index e69de29..b189275 100644 --- a/.zshrc +++ b/.zshrc @@ -0,0 +1,184 @@ +export ZSH="$HOME/.oh-my-zsh" + +set -o vi + + # https://github.com/ohmyzsh/ohmyzsh/wiki/Themes + ZSH_THEME="robbyrussell" + + plugins=( + bundler + fzf + git + brew + bun + you-should-use + zsh-vi-mode + fast-syntax-highlighting + rust + zsh-autocomplete + ) + + source $HOME/.import-secrets.sh + source $ZSH/oh-my-zsh.sh + source $HOME/.cargo/env + source "$HOME/.cargo/env" + + [[ -f local_zsh ]] && source local_zsh + + # unalias sd + + DISABLE_AUTO_TITLE="true" + + export LANG=en_US.UTF-8 + export EDITOR=nvim + export THOR_MERGE="nvim -d $2 $1" + export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES + + [ -f /opt/homebrew/etc/profile.d/autojump.sh ] && . /opt/homebrew/etc/profile.d/autojump.sh + + export BUN_INSTALL="$HOME/.bun" + export PATH="$BUN_INSTALL/bin:$PATH" + export PATH="$HOME/bin:$PATH" + export PATH="/opt/homebrew/opt/mysql@8.4/bin:$PATH" + export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin:$PATH" + export PATH=$HOME/development/flutter/bin:$PATH + export PATH=$HOME/cmdline-tools/bin:$PATH + # export LDFLAGS="-L/opt/homebrew/opt/mysql@8.4/lib" + # export CPPFLAGS="-I/opt/homebrew/opt/mysql@8.4/include" + export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql@8.4/lib/pkgconfig" + + # mysql stuff +export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib" +export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include" +export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/ + + alias l='ls -1A' + alias v="nvim" + alias go='~/scripts/open-repo-in-browser.ts' + + alias myip="ipconfig getifaddr en0" + alias pubip="curl ifconfig.me" + alias gg="lazygit" + alias bra="bundle exec rubocop -A" + alias bsf="bundle exec standardrb --fix" + alias ctags="`brew --prefix`/bin/ctags" + alias o="open" + # alias c="cursor" + alias c="code" + alias grr='gradle run' + + # config + alias cnvim="cd ~/.config/nvim && $EDITOR init.lua" + alias vimrc="$EDITOR ~/.vimrc" + alias zshrc="$EDITOR ~/.zshrc" + alias bashrc="$EDITOR ~/.bashrc" + alias ohmyzsh="$EDITOR ~/.oh-my-zsh" + alias clg="$EDITOR ~/Library/Application\ Support/lazygit/config.yml" + alias cgit="$EDITOR ~/.gitconfig" + alias zj="zellij" + alias zjc="v ~/.config/zellij/config.kdl" + alias zjlc="v ~/.config/zellij/layouts/my_layout.kdl" + alias gac="git add . && git commit --verbose" + alias prc="v /Users/dani/prompts/README.md" + alias fr='find . | rg ' + alias ff='hyfetch' + alias cvu='~/scripts/simplecov_parser.rb -u' + alias vo='v $(fzf)' + + # Created by `pipx` on 2024-12-12 09:25:29 + export PATH="$PATH:/Users/dani/.local/bin" + + set_terminal_title() { + git_branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') + repo_name=$(basename "$(git rev-parse --show-toplevel 2> /dev/null)") + echo -ne "\e]1;${repo_name} - ${git_branch}\a" + } + export PROMPT_COMMAND="$PROMPT_COMMAND; set_terminal_title" + precmd() { set_terminal_title } + + + alias y='yazi' + + alias jr='javac -d bin src/**/*.java; java -cp bin ch.zhaw.prog1.farm.Farm' + alias gs='git status --porcelain=v1' + alias gsm='git status --porcelain | awk '\''{ print $2 }'\''' + jsf() { + find . -name "*.java" | fzf --preview 'echo {}' | xargs java + } + + alias fg='ls -1 | rg' + alias bc='bin/check' + alias br='bin/run' + alias bcu='bin/check_unit_tests' + alias bd='bin/dev' + alias rails_tree="tree -I 'storage|log|tmp|node_modules|.git|public/system|public/uploads' -L 5 | bat" + alias rails_tree_minimal=" tree -I 'db|bin|assets|config|views|storage|log|tmp|node_modules|public|.git|public/system|public/uploads' -L 5 | bat" + + export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock + +# The next line updates PATH for the Google Cloud SDK. +if [ -f '/Users/dani/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/dani/google-cloud-sdk/path.zsh.inc'; fi + +# The next line enables shell command completion for gcloud. +if [ -f '/Users/dani/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/dani/google-cloud-sdk/completion.zsh.inc'; fi + +# Zellij + +zellij_tab_name_update() { + if [[ -n $ZELLIJ ]]; then + local current_dir=$PWD + if [[ $current_dir == $HOME ]]; then + current_dir="~" + else + current_dir=${current_dir##*/} + fi + command nohup zellij action rename-tab $current_dir >/dev/null 2>&1 + fi +} + +zellij_tab_name_update +chpwd_functions+=(zellij_tab_name_update) + +eval "$(~/.local/bin/mise activate zsh)" + +## [Completion] +## Completion scripts setup. Remove the following line to uninstall +[[ -f /Users/dani/.dart-cli-completion/zsh-config.zsh ]] && . /Users/dani/.dart-cli-completion/zsh-config.zsh || true +## [/Completion] + +export PATH="/opt/homebrew/opt/mysql-client@8.4/bin:$PATH" +export PATH="$HOME/.local/bin:$PATH" + +alias parallel='/opt/homebrew/Cellar/parallel/20250722/bin/parallel' + +# deploio completion +fpath=(~/.local/share/zsh/site-functions $fpath) +autoload -Uz compinit && compinit +autoload -U _deploio 2>/dev/null +compdef _deploio deploio depl 2>/dev/null + +fpath=(~/.config/zsh/completions $fpath) +autoload -U compinit && compinit + +alias bat='bat --theme="gruvbox-dark"' +nvimfuzzysearch() { + local sel + sel=$( + fzf --ansi --disabled \ + --prompt='rg> ' \ + --header='Type to search. Enter opens in nvim' \ + --bind "change:reload:rg --line-number --no-heading --color=always --smart-case --hidden -g '!.git' {q} || true" \ + --delimiter=':' \ + --preview 'bat --style=plain --color=always {1} --highlight-line {2}' \ + --preview-window='up:60%' + ) || return + + [ -n "$sel" ] || return + nvim "+$(cut -d: -f2 <<<"$sel")" "$(cut -d: -f1 <<<"$sel")" +} +alias vf='nvimfuzzysearch' +alias docker-compose='docker compose' +fpath+=/Users/dani/.zfunc + +# Load Angular CLI autocompletion. +source <(ng completion script) diff --git a/DOCKER_README.md b/DOCKER_README.md deleted file mode 100644 index c7c9f25..0000000 --- a/DOCKER_README.md +++ /dev/null @@ -1,77 +0,0 @@ -# Neovim Docker Setup - -## Quick Start - -### Build and Run - -```bash -# Build the image -docker build -t nvim-dotfiles . - -# Run interactively -docker run -it --rm -v $(pwd):/workspace nvim-dotfiles - -# Or use docker-compose -docker-compose up -d -docker-compose exec nvim bash -``` - -### Usage Examples - -```bash -# Start Neovim -nvim - -# Check health -nvim --headless +checkhealth +qall - -# Use Ruby/Node with mise -eval "$(mise activate bash)" -ruby --version -node --version - -# Run project commands -bundle install # Ruby projects -npm install # Node projects -``` - -## Development Workflow - -1. **Start the container:** - ```bash - docker-compose up -d - docker-compose exec nvim bash - ``` - -2. **Your dotfiles are available** at `/home/developer/.dotfiles` - -3. **Work on projects** by mounting them: - ```bash - docker run -it --rm -v /path/to/project:/workspace nvim-dotfiles - ``` - -4. **Persistent data** is kept in Docker volumes for nvim and mise - -## Customization - -- Modify `Brewfile` to add/remove tools -- Update `.tool-versions` to change language versions -- Plugin configuration is automatically loaded from `.config/nvim/` - -## Troubleshooting - -- **Plugin issues**: Run `nvim --headless "+Lazy! sync" +qa` -- **Language issues**: Run `mise install` to reinstall languages -- **LSP issues**: Check `:LspInfo` and `:Mason` in neovim - -## Tools Available - -| Tool | Purpose | -|------|---------| -| `nvim` | Neovim editor | -| `rg`, `fd`, `fzf` | Fast searching and file finding | -| `bat`, `tree` | Enhanced file viewing | -| `lazygit` | Git TUI | -| `tmux`, `zellij` | Terminal multiplexing | -| `mise` | Runtime version management | -| `jq`, `yq` | JSON/YAML processing | diff --git a/Dockerfile b/Dockerfile index f9127b1..da48d9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,7 @@ RUN apt-get update && apt-get install -y \ wget \ ca-certificates \ locales \ + zsh \ && rm -rf /var/lib/apt/lists/* # Generate locale @@ -26,8 +27,8 @@ ENV LANG=en_US.UTF-8 ENV LANGUAGE=en_US:en ENV LC_ALL=en_US.UTF-8 -# Create a non-root user -RUN useradd -m -s /bin/bash developer && \ +# Create a non-root user with zsh as default shell +RUN useradd -m -s /usr/bin/zsh developer && \ echo 'developer ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers # Switch to the developer user @@ -54,8 +55,29 @@ RUN mkdir -p /home/developer/.config && \ # Copy tool-versions for mise RUN ln -sf /home/developer/.dotfiles/.tool-versions /home/developer/.tool-versions +# Install oh-my-zsh +RUN sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended + +# Install zsh plugins +RUN git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && \ + git clone https://github.com/MichaelAquilina/zsh-you-should-use.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/you-should-use && \ + git clone https://github.com/jeffreytse/zsh-vi-mode ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-vi-mode && \ + git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting && \ + git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autocomplete + +# Set up zsh configuration +RUN ln -sf /home/developer/.dotfiles/.zshrc /home/developer/.zshrc + +# Create dummy files/directories for macOS-specific paths to avoid errors +RUN sudo mkdir -p /opt/homebrew/etc/profile.d && \ + sudo touch /opt/homebrew/etc/profile.d/autojump.sh && \ + sudo mkdir -p /Users/dani/.dart-cli-completion && \ + sudo touch /Users/dani/.dart-cli-completion/zsh-config.zsh && \ + touch /home/developer/.import-secrets.sh && \ + echo "# Docker placeholder" > /home/developer/.import-secrets.sh + # Install languages using mise -RUN /bin/bash -c "eval \"\$(mise activate bash)\" && mise install" +RUN /bin/zsh -c "eval \"\$(mise activate zsh)\" && mise install" # Initialize neovim and install plugins RUN nvim --headless "+Lazy! sync" +qa @@ -67,4 +89,4 @@ RUN nvim --headless "+Lazy! sync" +qa WORKDIR /home/developer/.dotfiles # Default command -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/usr/bin/zsh"] \ No newline at end of file diff --git a/README.md b/README.md index 223e153..4d2b100 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,15 @@ This is a collection of my dotfiles for my personal development setup. Other than the dotfiles, I also have a few scripts that I use to automate some tasks. +## Docker Setup + +Run the complete development environment in a container: + +```bash +docker compose up -d +docker compose exec dotfiles zsh +``` + ## Configuration * [Alacritty](./.config/alacritty/alacritty.toml) diff --git a/docker-compose.yml b/docker-compose.yml index 7bc0696..ae44758 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,20 @@ version: '3.8' services: - nvim: + dotfiles: build: . - image: nvim-dotfiles - container_name: neovim-dev + image: dotfiles-zsh + container_name: dotfiles-dev volumes: - .:/workspace - nvim_data:/home/developer/.local/share/nvim - mise_data:/home/developer/.local/share/mise + - zsh_data:/home/developer/.oh-my-zsh working_dir: /workspace stdin_open: true tty: true - command: /bin/bash + command: /usr/bin/zsh volumes: nvim_data: mise_data: + zsh_data: From f388395e23ee0fe08365374dda92a852da9a84e0 Mon Sep 17 00:00:00 2001 From: Daniel Bengl <53896675+CuddlyBunion341@users.noreply.github.com> Date: Wed, 24 Sep 2025 17:48:49 +0200 Subject: [PATCH 276/280] Linting plus checks (#13) * Linting changes * Remove unused setup yml * Delete .config/nvim/lua/plugins/conform.lua --- .config/nvim/init.lua | 18 +- .config/nvim/lua/plugins/autopairs.lua | 6 +- .config/nvim/lua/plugins/autosession.lua | 18 +- .config/nvim/lua/plugins/boole.lua | 38 ++-- .config/nvim/lua/plugins/bufexplorer.lua | 4 +- .../nvim/lua/plugins/cellular_automaton.lua | 2 +- .config/nvim/lua/plugins/colorscheme.lua | 4 +- .config/nvim/lua/plugins/comment.lua | 10 +- .config/nvim/lua/plugins/conform.lua | 38 ---- .config/nvim/lua/plugins/copilot.lua | 10 +- .config/nvim/lua/plugins/diffview.lua | 14 +- .config/nvim/lua/plugins/endpoint.lua | 62 +++--- .config/nvim/lua/plugins/flash.lua | 24 +- .config/nvim/lua/plugins/gitlinker.lua | 62 +++--- .config/nvim/lua/plugins/gitsigns.lua | 166 +++++++------- .config/nvim/lua/plugins/gradlew.lua | 28 +-- .config/nvim/lua/plugins/grug.lua | 54 ++--- .config/nvim/lua/plugins/harpoon.lua | 96 ++++---- .config/nvim/lua/plugins/lualine.lua | 206 +++++++++--------- .config/nvim/lua/plugins/markdown.lua | 30 +-- .config/nvim/lua/plugins/maximize.lua | 16 +- .config/nvim/lua/plugins/mini-cursorword.lua | 16 +- .config/nvim/lua/plugins/neogit.lua | 28 +-- .config/nvim/lua/plugins/neotest.lua | 16 +- .../lua/plugins/nvim-asciidoc-preview.lua | 6 +- .config/nvim/lua/plugins/nvim-cmp.lua | 176 +++++++-------- .config/nvim/lua/plugins/nvim-lspconfig.lua | 129 ++++++----- .config/nvim/lua/plugins/nvim-surround.lua | 12 +- .../lua/plugins/nvim-treesitter-endwise.lua | 18 +- .../plugins/nvim-treesitter-textobjects.lua | 120 +++++----- .config/nvim/lua/plugins/nvim-treesitter.lua | 68 +++--- .config/nvim/lua/plugins/nvim-ts-autotag.lua | 42 ++-- .config/nvim/lua/plugins/oil.lua | 116 +++++----- .config/nvim/lua/plugins/plantuml.lua | 12 +- .config/nvim/lua/plugins/refactoring.lua | 22 +- .config/nvim/lua/plugins/telescope.lua | 39 ++-- .config/nvim/lua/plugins/text-case.lua | 34 +-- .config/nvim/lua/plugins/trouble.lua | 70 +++--- .config/nvim/lua/plugins/undotree.lua | 54 ++--- .config/nvim/lua/plugins/vim-case-convert.lua | 4 +- .config/nvim/lua/plugins/vim-fetch.lua | 2 +- .config/nvim/lua/plugins/vim-fugitive.lua | 22 +- .config/nvim/lua/plugins/vim-rails.lua | 4 +- .../nvim/lua/plugins/vim-tmux-navigator.lua | 32 +-- .config/nvim/lua/plugins/visual-multi.lua | 4 +- .config/nvim/lua/plugins/yaml.lua | 2 +- .config/nvim/lua/plugins/zj-navigator.lua | 20 +- .config/nvim/lua/settings.lua | 34 +-- .config/nvim/lua/theme.lua | 22 +- .config/nvim/lua/util.lua | 70 +++--- .config/nvim/stylua.toml | 6 + .config/nvim/vscode.lua | 40 ++-- .github/workflows/format.yml | 69 ++++++ .github/workflows/setup.yml | 15 -- bin/fastcheck | 44 ++++ change_theme.sh | 42 ++-- create_linux_symlinx.sh | 1 - neovim/fastcheck | 19 ++ scripts/branch-checkout.ts | 12 +- scripts/clone_praktikum.sh | 2 +- scripts/copy-ticket-number.ts | 25 ++- scripts/create_executable_script.sh | 10 +- scripts/fastcheck | 39 ++++ scripts/format_url.sh | 16 +- scripts/get-pr-template.ts | 29 +-- scripts/git-smart-log.ts | 76 +++---- scripts/index.ts | 16 +- scripts/open-repo-in-browser.ts | 27 ++- scripts/open-ticket-in-browser.ts | 28 +-- scripts/pretty-pulls.ts | 66 +++--- scripts/simplecov_parser.rb | 90 ++++---- scripts/startup-communications.sh | 1 - scripts/zip_split.sh | 11 +- 73 files changed, 1474 insertions(+), 1310 deletions(-) delete mode 100644 .config/nvim/lua/plugins/conform.lua create mode 100644 .config/nvim/stylua.toml create mode 100644 .github/workflows/format.yml delete mode 100644 .github/workflows/setup.yml create mode 100755 bin/fastcheck create mode 100755 neovim/fastcheck create mode 100755 scripts/fastcheck diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index ae30fde..4943379 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -3,20 +3,20 @@ require("util") local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) end vim.opt.rtp:prepend(lazypath) local plugins = { - { import = "plugins" }, + { import = "plugins" }, } local opts = { defaults = { lazy = true }, change_detection = { notify = false } } diff --git a/.config/nvim/lua/plugins/autopairs.lua b/.config/nvim/lua/plugins/autopairs.lua index 6378d47..b83282d 100644 --- a/.config/nvim/lua/plugins/autopairs.lua +++ b/.config/nvim/lua/plugins/autopairs.lua @@ -1,5 +1,5 @@ return { - "windwp/nvim-autopairs", - event = "InsertEnter", - config = true, + "windwp/nvim-autopairs", + event = "InsertEnter", + config = true, } diff --git a/.config/nvim/lua/plugins/autosession.lua b/.config/nvim/lua/plugins/autosession.lua index 7f6fe80..a7dc9b6 100644 --- a/.config/nvim/lua/plugins/autosession.lua +++ b/.config/nvim/lua/plugins/autosession.lua @@ -1,11 +1,11 @@ return { - "rmagatti/auto-session", - lazy = false, - dependencies = { - "nvim-telescope/telescope.nvim", - }, - opts = {}, - keys = { - { "", "SessionDelete", desc = "Delete session" }, - }, + "rmagatti/auto-session", + lazy = false, + dependencies = { + "nvim-telescope/telescope.nvim", + }, + opts = {}, + keys = { + { "", "SessionDelete", desc = "Delete session" }, + }, } diff --git a/.config/nvim/lua/plugins/boole.lua b/.config/nvim/lua/plugins/boole.lua index 7d37e72..919e18e 100644 --- a/.config/nvim/lua/plugins/boole.lua +++ b/.config/nvim/lua/plugins/boole.lua @@ -1,21 +1,21 @@ return { - "nat-418/boole.nvim", - event = { "BufReadPre", "BufNewFile" }, - config = function() - require("boole").setup({ - mappings = { - increment = "", - decrement = "", - }, - additions = { - { "Foo", "Bar", "Baz", "Qux", "Quux" }, - { "light", "dark" }, - { "if", "unless" }, - { "true", "false" }, - { "&&", "||" }, - { "private", "public", "protected" }, - { "const", "let" }, - }, - }) - end, + "nat-418/boole.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("boole").setup({ + mappings = { + increment = "", + decrement = "", + }, + additions = { + { "Foo", "Bar", "Baz", "Qux", "Quux" }, + { "light", "dark" }, + { "if", "unless" }, + { "true", "false" }, + { "&&", "||" }, + { "private", "public", "protected" }, + { "const", "let" }, + }, + }) + end, } diff --git a/.config/nvim/lua/plugins/bufexplorer.lua b/.config/nvim/lua/plugins/bufexplorer.lua index 9653a92..fe14cfa 100644 --- a/.config/nvim/lua/plugins/bufexplorer.lua +++ b/.config/nvim/lua/plugins/bufexplorer.lua @@ -1,4 +1,4 @@ return { - "jlanzarotta/bufexplorer", - lazy = false, + "jlanzarotta/bufexplorer", + lazy = false, } diff --git a/.config/nvim/lua/plugins/cellular_automaton.lua b/.config/nvim/lua/plugins/cellular_automaton.lua index 1e21b5b..cf86bc2 100644 --- a/.config/nvim/lua/plugins/cellular_automaton.lua +++ b/.config/nvim/lua/plugins/cellular_automaton.lua @@ -1,4 +1,4 @@ return { "Eandrju/cellular-automaton.nvim", - lazy = false + lazy = false, } diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index 39a41ef..677dfeb 100644 --- a/.config/nvim/lua/plugins/colorscheme.lua +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -15,6 +15,6 @@ return { priority = 1000, }, { "ellisonleao/gruvbox.nvim", priority = 1000, config = { - transparent_mode = true, - } } + transparent_mode = true, + } }, } diff --git a/.config/nvim/lua/plugins/comment.lua b/.config/nvim/lua/plugins/comment.lua index c833f67..2254763 100644 --- a/.config/nvim/lua/plugins/comment.lua +++ b/.config/nvim/lua/plugins/comment.lua @@ -1,7 +1,7 @@ return { - "numToStr/Comment.nvim", - opts = {}, - keys = { - { "gcc", "CommentToggle", desc = "Comment" }, - }, + "numToStr/Comment.nvim", + opts = {}, + keys = { + { "gcc", "CommentToggle", desc = "Comment" }, + }, } diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua deleted file mode 100644 index 2c67e12..0000000 --- a/.config/nvim/lua/plugins/conform.lua +++ /dev/null @@ -1,38 +0,0 @@ -return { - -- "stevearc/conform.nvim", - -- event = { "BufReadPre", "BufNewFile" }, - -- config = function() - -- local conform = require("conform") - -- - -- conform.setup({ - -- formatters_by_ft = { - -- javascript = { "prettier" }, - -- typescript = { "prettier" }, - -- javascriptreact = { "prettier" }, - -- typescriptreact = { "prettier" }, - -- svelte = { "prettier" }, - -- css = { "prettier" }, - -- html = { "prettier" }, - -- json = { "prettier" }, - -- java = { "prettier" }, - -- yaml = { "prettier" }, - -- markdown = { "prettier" }, - -- graphql = { "prettier" }, - -- lua = { "stylua" }, - -- }, - -- format_on_save = { - -- lsp_fallback = true, - -- async = false, - -- timeout_ms = 100, - -- }, - -- }) - -- - -- vim.keymap.set({ "n", "v" }, "mp", function() - -- conform.format({ - -- lsp_fallback = true, - -- async = false, - -- timeout_ms = 500, - -- }) - -- end, { desc = "Format file or range (in visual mode)" }) - -- end, -} diff --git a/.config/nvim/lua/plugins/copilot.lua b/.config/nvim/lua/plugins/copilot.lua index 5c8d139..14e55eb 100644 --- a/.config/nvim/lua/plugins/copilot.lua +++ b/.config/nvim/lua/plugins/copilot.lua @@ -1,7 +1,7 @@ return { - -- "github/copilot.vim", - -- event = "BufRead", - -- commands = { - -- "Copilot" - -- } + -- "github/copilot.vim", + -- event = "BufRead", + -- commands = { + -- "Copilot" + -- } } diff --git a/.config/nvim/lua/plugins/diffview.lua b/.config/nvim/lua/plugins/diffview.lua index b74a05a..8bf3783 100644 --- a/.config/nvim/lua/plugins/diffview.lua +++ b/.config/nvim/lua/plugins/diffview.lua @@ -1,9 +1,9 @@ return { - "sindrets/diffview.nvim", - cmd = { - "DiffviewOpen", - }, - keys = { - { "do", "DiffviewOpen", desc = "Open diffview" }, - }, + "sindrets/diffview.nvim", + cmd = { + "DiffviewOpen", + }, + keys = { + { "do", "DiffviewOpen", desc = "Open diffview" }, + }, } diff --git a/.config/nvim/lua/plugins/endpoint.lua b/.config/nvim/lua/plugins/endpoint.lua index cbcd4a8..be02f46 100644 --- a/.config/nvim/lua/plugins/endpoint.lua +++ b/.config/nvim/lua/plugins/endpoint.lua @@ -8,65 +8,73 @@ return { require("endpoint").setup({ -- Framework configuration framework = "auto", -- "auto", "spring", "nestjs", "django", "rails", "express" - + -- Optional: Path-based framework overrides framework_paths = { ["/path/to/spring/project"] = "spring", ["/path/to/nestjs/project"] = "nestjs", }, - + -- Cache configuration cache_mode = "persistent", -- Cache mode: "session" or "persistent" debug = false, -- Enable debug logging - + ui = { - show_icons = true, -- Show method icons - show_method = true, -- Show method text (GET, POST, etc.) + show_icons = true, -- Show method icons + show_method = true, -- Show method text (GET, POST, etc.) use_nerd_font = false, -- Use nerd font glyphs instead of emojis - + -- Customize icons (requires show_icons = true) method_icons = { emoji = { - GET = "📥", - POST = "📤", - PUT = "✏️", + GET = "📥", + POST = "📤", + PUT = "✏️", DELETE = "🗑️", - PATCH = "🔧", + PATCH = "🔧", }, nerd_font = { - GET = "", -- download icon - POST = "", -- upload icon - PUT = "", -- edit icon + GET = "", -- download icon + POST = "", -- upload icon + PUT = "", -- edit icon DELETE = "", -- trash icon - PATCH = "", -- wrench icon + PATCH = "", -- wrench icon }, }, - + -- Customize colors method_colors = { - GET = "DiagnosticOk", -- Green - POST = "DiagnosticInfo", -- Blue - PUT = "DiagnosticWarn", -- Yellow - DELETE = "DiagnosticError", -- Red - PATCH = "DiagnosticHint", -- Purple + GET = "DiagnosticOk", -- Green + POST = "DiagnosticInfo", -- Blue + PUT = "DiagnosticWarn", -- Yellow + DELETE = "DiagnosticError", -- Red + PATCH = "DiagnosticHint", -- Purple }, - + -- Cache status UI customization cache_status_icons = { emoji = { - title = "🚀", success = "✅", error = "❌", - tree = "🌳", directory = "📁", file = "📄" + title = "🚀", + success = "✅", + error = "❌", + tree = "🌳", + directory = "📁", + file = "📄", }, nerd_font = { - title = "", success = "", error = "", - tree = "", directory = "", file = "" + title = "", + success = "", + error = "", + tree = "", + directory = "", + file = "", }, }, - + -- Cache status syntax highlighting cache_status_highlight = { title = "Special", - success = "DiagnosticOk", + success = "DiagnosticOk", error = "DiagnosticError", key = "Keyword", tree_method = "Function", diff --git a/.config/nvim/lua/plugins/flash.lua b/.config/nvim/lua/plugins/flash.lua index e7b2f08..4e7ab2a 100644 --- a/.config/nvim/lua/plugins/flash.lua +++ b/.config/nvim/lua/plugins/flash.lua @@ -1,14 +1,14 @@ return { - "folke/flash.nvim", - event = "VeryLazy", - keys = { - { - "s", - mode = { "n", "x", "o" }, - function() - require("flash").jump() - end, - desc = "Flash", - }, - }, + "folke/flash.nvim", + event = "VeryLazy", + keys = { + { + "s", + mode = { "n", "x", "o" }, + function() + require("flash").jump() + end, + desc = "Flash", + }, + }, } diff --git a/.config/nvim/lua/plugins/gitlinker.lua b/.config/nvim/lua/plugins/gitlinker.lua index 6a0bb22..6e8cb3c 100644 --- a/.config/nvim/lua/plugins/gitlinker.lua +++ b/.config/nvim/lua/plugins/gitlinker.lua @@ -1,33 +1,33 @@ return { - "ruifm/gitlinker.nvim", - lazy = false, - config = function() - require("gitlinker").setup({ - opts = { - remote = nil, -- force the use of a specific remote - -- adds current line nr in the url for normal mode - add_current_line_on_normal_mode = true, - -- callback for what to do with the url - action_callback = require("gitlinker.actions").copy_to_clipboard, - -- print the url after performing the action - print_url = true, - }, - callbacks = { - ["github.com"] = require("gitlinker.hosts").get_github_type_url, - ["gitlab.com"] = require("gitlinker.hosts").get_gitlab_type_url, - ["gitlab.nine.ch"] = require("gitlinker.hosts").get_gitlab_type_url, - ["try.gitea.io"] = require("gitlinker.hosts").get_gitea_type_url, - ["codeberg.org"] = require("gitlinker.hosts").get_gitea_type_url, - ["bitbucket.org"] = require("gitlinker.hosts").get_bitbucket_type_url, - ["try.gogs.io"] = require("gitlinker.hosts").get_gogs_type_url, - ["git.sr.ht"] = require("gitlinker.hosts").get_srht_type_url, - ["git.launchpad.net"] = require("gitlinker.hosts").get_launchpad_type_url, - ["repo.or.cz"] = require("gitlinker.hosts").get_repoorcz_type_url, - ["git.kernel.org"] = require("gitlinker.hosts").get_cgit_type_url, - ["git.savannah.gnu.org"] = require("gitlinker.hosts").get_cgit_type_url, - }, - -- default mapping to call url generation with action_callback - mappings = "oy", - }) - end, + "ruifm/gitlinker.nvim", + lazy = false, + config = function() + require("gitlinker").setup({ + opts = { + remote = nil, -- force the use of a specific remote + -- adds current line nr in the url for normal mode + add_current_line_on_normal_mode = true, + -- callback for what to do with the url + action_callback = require("gitlinker.actions").copy_to_clipboard, + -- print the url after performing the action + print_url = true, + }, + callbacks = { + ["github.com"] = require("gitlinker.hosts").get_github_type_url, + ["gitlab.com"] = require("gitlinker.hosts").get_gitlab_type_url, + ["gitlab.nine.ch"] = require("gitlinker.hosts").get_gitlab_type_url, + ["try.gitea.io"] = require("gitlinker.hosts").get_gitea_type_url, + ["codeberg.org"] = require("gitlinker.hosts").get_gitea_type_url, + ["bitbucket.org"] = require("gitlinker.hosts").get_bitbucket_type_url, + ["try.gogs.io"] = require("gitlinker.hosts").get_gogs_type_url, + ["git.sr.ht"] = require("gitlinker.hosts").get_srht_type_url, + ["git.launchpad.net"] = require("gitlinker.hosts").get_launchpad_type_url, + ["repo.or.cz"] = require("gitlinker.hosts").get_repoorcz_type_url, + ["git.kernel.org"] = require("gitlinker.hosts").get_cgit_type_url, + ["git.savannah.gnu.org"] = require("gitlinker.hosts").get_cgit_type_url, + }, + -- default mapping to call url generation with action_callback + mappings = "oy", + }) + end, } diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua index 66d452d..5fb77dd 100644 --- a/.config/nvim/lua/plugins/gitsigns.lua +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -1,87 +1,87 @@ return { - "lewis6991/gitsigns.nvim", - lazy = false, - config = function() - require("gitsigns").setup({ - numhl = true, - attach_to_untracked = true, - update_debounce = 5, - on_attach = function(bufnr) - local gitsigns = require("gitsigns") - end, - }) - end, - keys = { - -- Navigation - { - "]c", - function() - if vim.wo.diff then - vim.cmd("normal! ]c") - else - require("gitsigns").next_hunk() - end - end, - mode = "n", - desc = "Next Git hunk", - }, - { - "[c", - function() - if vim.wo.diff then - vim.cmd("normal! [c") - else - require("gitsigns").prev_hunk() - end - end, - mode = "n", - desc = "Previous Git hunk", - }, + "lewis6991/gitsigns.nvim", + lazy = false, + config = function() + require("gitsigns").setup({ + numhl = true, + attach_to_untracked = true, + update_debounce = 5, + on_attach = function(bufnr) + local gitsigns = require("gitsigns") + end, + }) + end, + keys = { + -- Navigation + { + "]c", + function() + if vim.wo.diff then + vim.cmd("normal! ]c") + else + require("gitsigns").next_hunk() + end + end, + mode = "n", + desc = "Next Git hunk", + }, + { + "[c", + function() + if vim.wo.diff then + vim.cmd("normal! [c") + else + require("gitsigns").prev_hunk() + end + end, + mode = "n", + desc = "Previous Git hunk", + }, - -- Actions - { "hs", ":Gitsigns stage_hunk", mode = "n", desc = "Stage Hunk" }, - { "hr", ":Gitsigns reset_hunk", mode = "n", desc = "Reset Hunk" }, - { - "hs", - function() - require("gitsigns").stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) - end, - mode = "v", - desc = "Stage Hunk", - }, - { - "hr", - function() - require("gitsigns").reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) - end, - mode = "v", - desc = "Reset Hunk", - }, - { "hS", ":Gitsigns stage_buffer", mode = "n", desc = "Stage Buffer" }, - { "hu", ":Gitsigns undo_stage_hunk", mode = "n", desc = "Undo Stage Hunk" }, - { "hR", ":Gitsigns reset_buffer", mode = "n", desc = "Reset Buffer" }, - { "hp", ":Gitsigns preview_hunk", mode = "n", desc = "Preview Hunk" }, - { - "hb", - function() - require("gitsigns").blame_line({ full = true }) - end, - mode = "n", - desc = "Blame Line", - }, - { "tb", ":Gitsigns toggle_current_line_blame", mode = "n", desc = "Toggle Blame" }, - { "hd", ":Gitsigns diffthis", mode = "n", desc = "Diff This" }, - { - "hD", - function() - require("gitsigns").diffthis("~") - end, - mode = "n", - desc = "Diff This ~", - }, - { "td", ":Gitsigns toggle_deleted", mode = "n", desc = "Toggle Deleted" }, + -- Actions + { "hs", ":Gitsigns stage_hunk", mode = "n", desc = "Stage Hunk" }, + { "hr", ":Gitsigns reset_hunk", mode = "n", desc = "Reset Hunk" }, + { + "hs", + function() + require("gitsigns").stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) + end, + mode = "v", + desc = "Stage Hunk", + }, + { + "hr", + function() + require("gitsigns").reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) + end, + mode = "v", + desc = "Reset Hunk", + }, + { "hS", ":Gitsigns stage_buffer", mode = "n", desc = "Stage Buffer" }, + { "hu", ":Gitsigns undo_stage_hunk", mode = "n", desc = "Undo Stage Hunk" }, + { "hR", ":Gitsigns reset_buffer", mode = "n", desc = "Reset Buffer" }, + { "hp", ":Gitsigns preview_hunk", mode = "n", desc = "Preview Hunk" }, + { + "hb", + function() + require("gitsigns").blame_line({ full = true }) + end, + mode = "n", + desc = "Blame Line", + }, + { "tb", ":Gitsigns toggle_current_line_blame", mode = "n", desc = "Toggle Blame" }, + { "hd", ":Gitsigns diffthis", mode = "n", desc = "Diff This" }, + { + "hD", + function() + require("gitsigns").diffthis("~") + end, + mode = "n", + desc = "Diff This ~", + }, + { "td", ":Gitsigns toggle_deleted", mode = "n", desc = "Toggle Deleted" }, - -- Text object - { "ih", ":Gitsigns select_hunk", mode = { "o", "x" }, desc = "Select Hunk" }, - }, + -- Text object + { "ih", ":Gitsigns select_hunk", mode = { "o", "x" }, desc = "Select Hunk" }, + }, } diff --git a/.config/nvim/lua/plugins/gradlew.lua b/.config/nvim/lua/plugins/gradlew.lua index bdc3630..0f6f041 100644 --- a/.config/nvim/lua/plugins/gradlew.lua +++ b/.config/nvim/lua/plugins/gradlew.lua @@ -1,16 +1,16 @@ return { - "oclay1st/gradle.nvim", - cmd = { "Gradle", "GradleExec", "GradleInit" }, - dependencies = { - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - }, - opts = {}, -- options, see default configuration - keys = { { "G", "Gradle", desc = "Gradle" } }, - ft = { "java" }, - config = function() - require("gradle").setup({ - gradle_executable = "./gradlew", -- Example: gradle, ./gradlew or a path to Gradle executable - }) - end, + "oclay1st/gradle.nvim", + cmd = { "Gradle", "GradleExec", "GradleInit" }, + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + }, + opts = {}, -- options, see default configuration + keys = { { "G", "Gradle", desc = "Gradle" } }, + ft = { "java" }, + config = function() + require("gradle").setup({ + gradle_executable = "./gradlew", -- Example: gradle, ./gradlew or a path to Gradle executable + }) + end, } diff --git a/.config/nvim/lua/plugins/grug.lua b/.config/nvim/lua/plugins/grug.lua index e90295d..52f68a4 100644 --- a/.config/nvim/lua/plugins/grug.lua +++ b/.config/nvim/lua/plugins/grug.lua @@ -1,29 +1,29 @@ return { - "MagicDuck/grug-far.nvim", - config = function() - require("grug-far").setup({}) - end, - keys = { - { - "", - function() - require("grug-far").open() - end, - desc = "Find and replace", - }, - { - "sp", - function() - require("grug-far").open() - end, - desc = "Find and replace", - }, - { - "sw", - function() - require("grug-far").open({ prefills = { search = vim.fn.expand("") } }) - end, - desc = "Find and replace word under cursor", - }, - }, + "MagicDuck/grug-far.nvim", + config = function() + require("grug-far").setup({}) + end, + keys = { + { + "", + function() + require("grug-far").open() + end, + desc = "Find and replace", + }, + { + "sp", + function() + require("grug-far").open() + end, + desc = "Find and replace", + }, + { + "sw", + function() + require("grug-far").open({ prefills = { search = vim.fn.expand("") } }) + end, + desc = "Find and replace word under cursor", + }, + }, } diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua index e0395a2..05a3b47 100644 --- a/.config/nvim/lua/plugins/harpoon.lua +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -1,52 +1,52 @@ return { - "ThePrimeagen/harpoon", - lazy = false, - branch = "harpoon2", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - local harpoon = require("harpoon") + "ThePrimeagen/harpoon", + lazy = false, + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local harpoon = require("harpoon") - harpoon:setup() + harpoon:setup() - vim.keymap.set("n", "a", function() - harpoon:list():add() - end, { noremap = true, silent = true, desc = "Add file to Harpoon" }) - vim.keymap.set("n", "e", function() - harpoon:list():remove() - end, { noremap = true, silent = true, desc = "Remove file from Harpoon" }) - -- vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu() end, { noremap = true, silent = true }) - vim.keymap.set("n", "1", function() - harpoon:list():select(1) - end, { noremap = true, silent = true, desc = "Select Harpoon file 1" }) - vim.keymap.set("n", "2", function() - harpoon:list():select(2) - end, { noremap = true, silent = true, desc = "Select Harpoon file 2" }) - vim.keymap.set("n", "3", function() - harpoon:list():select(3) - end, { noremap = true, silent = true, desc = "Select Harpoon file 3" }) - vim.keymap.set("n", "4", function() - harpoon:list():select(4) - end, { noremap = true, silent = true, desc = "Select Harpoon file 4" }) - vim.keymap.set("n", "5", function() - harpoon:list():select(5) - end, { noremap = true, silent = true, desc = "Select Harpoon file 5" }) - vim.keymap.set("n", "6", function() - harpoon:list():select(6) - end, { noremap = true, silent = true, desc = "Select Harpoon file 6" }) - vim.keymap.set("n", "7", function() - harpoon:list():select(7) - end, { noremap = true, silent = true, desc = "Select Harpoon file 7" }) - vim.keymap.set("n", "8", function() - harpoon:list():select(8) - end, { noremap = true, silent = true, desc = "Select Harpoon file 8" }) - vim.keymap.set("n", "9", function() - harpoon:list():select(9) - end, { noremap = true, silent = true, desc = "Select Harpoon file 9" }) - vim.keymap.set("n", "", function() - harpoon:list():next() - end, { desc = "Next Harpoon file" }) - vim.keymap.set("n", "", function() - harpoon:list():prev() - end, { desc = "Previous Harpoon file" }) - end, + vim.keymap.set("n", "a", function() + harpoon:list():add() + end, { noremap = true, silent = true, desc = "Add file to Harpoon" }) + vim.keymap.set("n", "e", function() + harpoon:list():remove() + end, { noremap = true, silent = true, desc = "Remove file from Harpoon" }) + -- vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu() end, { noremap = true, silent = true }) + vim.keymap.set("n", "1", function() + harpoon:list():select(1) + end, { noremap = true, silent = true, desc = "Select Harpoon file 1" }) + vim.keymap.set("n", "2", function() + harpoon:list():select(2) + end, { noremap = true, silent = true, desc = "Select Harpoon file 2" }) + vim.keymap.set("n", "3", function() + harpoon:list():select(3) + end, { noremap = true, silent = true, desc = "Select Harpoon file 3" }) + vim.keymap.set("n", "4", function() + harpoon:list():select(4) + end, { noremap = true, silent = true, desc = "Select Harpoon file 4" }) + vim.keymap.set("n", "5", function() + harpoon:list():select(5) + end, { noremap = true, silent = true, desc = "Select Harpoon file 5" }) + vim.keymap.set("n", "6", function() + harpoon:list():select(6) + end, { noremap = true, silent = true, desc = "Select Harpoon file 6" }) + vim.keymap.set("n", "7", function() + harpoon:list():select(7) + end, { noremap = true, silent = true, desc = "Select Harpoon file 7" }) + vim.keymap.set("n", "8", function() + harpoon:list():select(8) + end, { noremap = true, silent = true, desc = "Select Harpoon file 8" }) + vim.keymap.set("n", "9", function() + harpoon:list():select(9) + end, { noremap = true, silent = true, desc = "Select Harpoon file 9" }) + vim.keymap.set("n", "", function() + harpoon:list():next() + end, { desc = "Next Harpoon file" }) + vim.keymap.set("n", "", function() + harpoon:list():prev() + end, { desc = "Previous Harpoon file" }) + end, } diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index 45ed268..9c7fe0c 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -3,11 +3,10 @@ return { dependencies = { "nvim-tree/nvim-web-devicons" }, lazy = false, config = function() - -- Eviline config for lualine -- Author: shadmansaleh -- Credit: glepnir - local lualine = require('lualine') + local lualine = require("lualine") -- Color table for highlights -- stylua: ignore @@ -57,14 +56,14 @@ return { local conditions = { buffer_not_empty = function() - return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 + return vim.fn.empty(vim.fn.expand("%:t")) ~= 1 end, hide_in_width = function() return vim.fn.winwidth(0) > 80 end, check_git_workspace = function() - local filepath = vim.fn.expand('%:p:h') - local gitdir = vim.fn.finddir('.git', filepath .. ';') + local filepath = vim.fn.expand("%:p:h") + local gitdir = vim.fn.finddir(".git", filepath .. ";") return gitdir and #gitdir > 0 and #gitdir < #filepath end, } @@ -73,8 +72,8 @@ return { local config = { options = { -- Disable sections and component separators - component_separators = '', - section_separators = '', + component_separators = "", + section_separators = "", theme = { -- We are going to use lualine_c an lualine_x as left and -- right section. Both are highlighted by c theme . So we @@ -116,18 +115,18 @@ return { table.insert(config.sections.lualine_x, component) end - ins_left { + ins_left({ function() - return '▊' + return "▊" end, color = { fg = colors.blue }, -- Sets highlighting of component padding = { left = 0, right = 1 }, -- We don't need space before this - } + }) - ins_left { + ins_left({ -- mode component function() - return '󰊠' + return "󰊠" end, color = function() -- auto change color according to neovims mode @@ -135,13 +134,13 @@ return { n = colors.red, i = colors.green, v = colors.blue, - [''] = colors.blue, + [""] = colors.blue, V = colors.blue, c = colors.magenta, no = colors.red, s = colors.orange, S = colors.orange, - [''] = colors.orange, + [""] = colors.orange, ic = colors.yellow, R = colors.violet, Rv = colors.violet, @@ -149,55 +148,55 @@ return { ce = colors.red, r = colors.cyan, rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, + ["r?"] = colors.cyan, + ["!"] = colors.red, t = colors.red, } return { fg = mode_color[vim.fn.mode()] } end, padding = { right = 1 }, - } + }) - ins_left { + ins_left({ -- filesize component - 'filesize', + "filesize", cond = conditions.buffer_not_empty, - } + }) - ins_left { - 'filename', + ins_left({ + "filename", cond = conditions.buffer_not_empty, - color = { fg = colors.magenta, gui = 'bold' }, - } + color = { fg = colors.magenta, gui = "bold" }, + }) - ins_left { 'location' } + ins_left({ "location" }) - ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } } + ins_left({ "progress", color = { fg = colors.fg, gui = "bold" } }) - ins_left { - 'diagnostics', - sources = { 'nvim_diagnostic' }, - symbols = { error = ' ', warn = ' ', info = ' ' }, + ins_left({ + "diagnostics", + sources = { "nvim_diagnostic" }, + symbols = { error = " ", warn = " ", info = " " }, diagnostics_color = { error = { fg = colors.red }, warn = { fg = colors.yellow }, info = { fg = colors.cyan }, }, - } + }) -- Insert mid section. You can make any number of sections in neovim :) -- for lualine it's any number greater then 2 - ins_left { + ins_left({ function() - return '%=' + return "%=" end, - } + }) - ins_left { + ins_left({ -- Lsp server name . function() - local msg = 'No Active Lsp' - local buf_ft = vim.api.nvim_get_option_value('filetype', { buf = 0 }) + local msg = "No Active Lsp" + local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = 0 }) local clients = vim.lsp.get_clients() if next(clients) == nil then return msg @@ -210,97 +209,94 @@ return { end return msg end, - icon = ' LSP:', - color = { fg = '#ffffff', gui = 'bold' }, - } + icon = " LSP:", + color = { fg = "#ffffff", gui = "bold" }, + }) -- Add components to right sections - ins_right { - 'o:encoding', -- option component same as &encoding in viml + ins_right({ + "o:encoding", -- option component same as &encoding in viml fmt = string.upper, -- I'm not sure why it's upper case either ;) cond = conditions.hide_in_width, - color = { fg = colors.green, gui = 'bold' }, - } + color = { fg = colors.green, gui = "bold" }, + }) - ins_right { - 'fileformat', + ins_right({ + "fileformat", fmt = string.upper, icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh - color = { fg = colors.green, gui = 'bold' }, - } + color = { fg = colors.green, gui = "bold" }, + }) - ins_right { - 'branch', - icon = '', - color = { fg = colors.violet, gui = 'bold' }, - } + ins_right({ + "branch", + icon = "", + color = { fg = colors.violet, gui = "bold" }, + }) - ins_right { - 'diff', + ins_right({ + "diff", -- Is it me or the symbol for modified us really weird - symbols = { added = ' ', modified = '󰝤 ', removed = ' ' }, + symbols = { added = " ", modified = "󰝤 ", removed = " " }, diff_color = { added = { fg = colors.green }, modified = { fg = colors.orange }, removed = { fg = colors.red }, }, cond = conditions.hide_in_width, - } + }) - ins_right { + ins_right({ function() - return '▊' + return "▊" end, color = { fg = colors.blue }, padding = { left = 1 }, - } + }) -- Now don't forget to initialize lualine lualine.setup(config) - - - -- require("lualine").setup({ - -- options = { - -- icons_enabled = true, - -- -- theme = 'ayu_light', - -- component_separators = { left = "", right = "" }, - -- section_separators = { left = "", right = "" }, - -- disabled_filetypes = { - -- statusline = {}, - -- winbar = {}, - -- }, - -- ignore_focus = {}, - -- always_divide_middle = true, - -- always_show_tabline = true, - -- globalstatus = false, - -- refresh = { - -- statusline = 100, - -- tabline = 100, - -- winbar = 100, - -- }, - -- }, - -- sections = { - -- lualine_a = { "mode" }, - -- lualine_b = { "branch", "diff", "diagnostics" }, - -- lualine_c = { "filename" }, - -- lualine_x = { "fileformat", "filetype" }, - -- lualine_y = { "progress" }, - -- lualine_z = { "location" }, - -- }, - -- inactive_sections = { - -- lualine_a = {}, - -- lualine_b = {}, - -- lualine_c = { "filename" }, - -- lualine_x = { "location" }, - -- lualine_y = {}, - -- lualine_z = {}, - -- }, - -- tabline = {}, - -- winbar = {}, - -- inactive_winbar = {}, - -- extensions = {}, - -- }) - end, - } + -- options = { + -- icons_enabled = true, + -- -- theme = 'ayu_light', + -- component_separators = { left = "", right = "" }, + -- section_separators = { left = "", right = "" }, + -- disabled_filetypes = { + -- statusline = {}, + -- winbar = {}, + -- }, + -- ignore_focus = {}, + -- always_divide_middle = true, + -- always_show_tabline = true, + -- globalstatus = false, + -- refresh = { + -- statusline = 100, + -- tabline = 100, + -- winbar = 100, + -- }, + -- }, + -- sections = { + -- lualine_a = { "mode" }, + -- lualine_b = { "branch", "diff", "diagnostics" }, + -- lualine_c = { "filename" }, + -- lualine_x = { "fileformat", "filetype" }, + -- lualine_y = { "progress" }, + -- lualine_z = { "location" }, + -- }, + -- inactive_sections = { + -- lualine_a = {}, + -- lualine_b = {}, + -- lualine_c = { "filename" }, + -- lualine_x = { "location" }, + -- lualine_y = {}, + -- lualine_z = {}, + -- }, + -- tabline = {}, + -- winbar = {}, + -- inactive_winbar = {}, + -- extensions = {}, + -- }) + end, +} diff --git a/.config/nvim/lua/plugins/markdown.lua b/.config/nvim/lua/plugins/markdown.lua index fdcdc44..9b105d8 100644 --- a/.config/nvim/lua/plugins/markdown.lua +++ b/.config/nvim/lua/plugins/markdown.lua @@ -9,19 +9,19 @@ return { ft = { "markdown" }, }, - -- "tadmccorkle/markdown.nvim", - -- ft = "markdown", -- or 'event = "VeryLazy"' - -- opts = { - -- -- configuration here or empty for defaults - -- }, - -- { - -- "MeanderingProgrammer/render-markdown.nvim", - -- dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite - -- -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins - -- -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons - -- ---@module 'render-markdown' - -- ---@type render.md.UserConfig - -- opts = {}, - -- ft = "markdown", - -- }, + -- "tadmccorkle/markdown.nvim", + -- ft = "markdown", -- or 'event = "VeryLazy"' + -- opts = { + -- -- configuration here or empty for defaults + -- }, + -- { + -- "MeanderingProgrammer/render-markdown.nvim", + -- dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite + -- -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins + -- -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons + -- ---@module 'render-markdown' + -- ---@type render.md.UserConfig + -- opts = {}, + -- ft = "markdown", + -- }, } diff --git a/.config/nvim/lua/plugins/maximize.lua b/.config/nvim/lua/plugins/maximize.lua index 00b58ca..30183df 100644 --- a/.config/nvim/lua/plugins/maximize.lua +++ b/.config/nvim/lua/plugins/maximize.lua @@ -1,10 +1,10 @@ return { - "declancm/maximize.nvim", - config = true, - cmd = { - "Maximize", - }, - keys = { - { "z", "Maximize", desc = "Maximize" }, - }, + "declancm/maximize.nvim", + config = true, + cmd = { + "Maximize", + }, + keys = { + { "z", "Maximize", desc = "Maximize" }, + }, } diff --git a/.config/nvim/lua/plugins/mini-cursorword.lua b/.config/nvim/lua/plugins/mini-cursorword.lua index 8f5f2f1..8c598ec 100644 --- a/.config/nvim/lua/plugins/mini-cursorword.lua +++ b/.config/nvim/lua/plugins/mini-cursorword.lua @@ -1,10 +1,10 @@ return { - "echasnovski/mini.cursorword", - version = false, - lazy = false, - config = function() - require("mini.cursorword").setup({ - delay = 10, - }) - end, + "echasnovski/mini.cursorword", + version = false, + lazy = false, + config = function() + require("mini.cursorword").setup({ + delay = 10, + }) + end, } diff --git a/.config/nvim/lua/plugins/neogit.lua b/.config/nvim/lua/plugins/neogit.lua index 4420659..843d8f8 100644 --- a/.config/nvim/lua/plugins/neogit.lua +++ b/.config/nvim/lua/plugins/neogit.lua @@ -1,16 +1,16 @@ return { - "NeogitOrg/neogit", - dependencies = { - "nvim-lua/plenary.nvim", - "sindrets/diffview.nvim", - "nvim-telescope/telescope.nvim", - }, - keys = { - { "g", "Neogit", desc = "Neogit" }, - }, - config = function() - require("neogit").setup({ - graph_style = "unicode", - }) - end, + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "nvim-telescope/telescope.nvim", + }, + keys = { + { "g", "Neogit", desc = "Neogit" }, + }, + config = function() + require("neogit").setup({ + graph_style = "unicode", + }) + end, } diff --git a/.config/nvim/lua/plugins/neotest.lua b/.config/nvim/lua/plugins/neotest.lua index 4830205..3694f31 100644 --- a/.config/nvim/lua/plugins/neotest.lua +++ b/.config/nvim/lua/plugins/neotest.lua @@ -8,7 +8,7 @@ return { "olimorris/neotest-rspec", "zidhuss/neotest-minitest", "rcasia/neotest-java", - 'mfussenegger/nvim-jdtls', + "mfussenegger/nvim-jdtls", "adrigzr/neotest-mocha", }, config = function() @@ -43,19 +43,19 @@ return { require("neotest-rspec")({ rspec_cmd = function() return { "mise", "exec", "--", "bundle", "exec", "rspec" } - end + end, }), - require("neotest-java") { + require("neotest-java")({ ignore_wrapper = true, - } + }), }, }) end, keys = { - { "tt", "Neotest run file", desc = "Test file" }, - { "tr", "Neotest run", desc = "Run closest test" }, - { "to", "Neotest output", desc = "Test output" }, + { "tt", "Neotest run file", desc = "Test file" }, + { "tr", "Neotest run", desc = "Run closest test" }, + { "to", "Neotest output", desc = "Test output" }, { "tO", "Neotest output-panel", desc = "Test output panel" }, - { "ts", "Neotest stop", desc = "Stop test" }, + { "ts", "Neotest stop", desc = "Stop test" }, }, } diff --git a/.config/nvim/lua/plugins/nvim-asciidoc-preview.lua b/.config/nvim/lua/plugins/nvim-asciidoc-preview.lua index c8d1c2b..52e843f 100644 --- a/.config/nvim/lua/plugins/nvim-asciidoc-preview.lua +++ b/.config/nvim/lua/plugins/nvim-asciidoc-preview.lua @@ -1,7 +1,7 @@ return { - 'tigion/nvim-asciidoc-preview', - ft = { 'asciidoc' }, - build = 'cd server && npm install --omit=dev', + "tigion/nvim-asciidoc-preview", + ft = { "asciidoc" }, + build = "cd server && npm install --omit=dev", opts = { -- Add user configuration here }, diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua index 637ebf7..170ce71 100644 --- a/.config/nvim/lua/plugins/nvim-cmp.lua +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -1,97 +1,97 @@ return { - "hrsh7th/nvim-cmp", - lazy = false, - dependencies = { - "hrsh7th/nvim-cmp", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "ray-x/cmp-treesitter", - "neovim/nvim-lspconfig", - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets", - "L3MON4D3/LuaSnip", - }, - config = function() - local cmp = require("cmp") - require("luasnip.loaders.from_vscode").lazy_load() + "hrsh7th/nvim-cmp", + lazy = false, + dependencies = { + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "ray-x/cmp-treesitter", + "neovim/nvim-lspconfig", + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + "L3MON4D3/LuaSnip", + }, + config = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() - local luasnip = require("luasnip") + local luasnip = require("luasnip") - cmp.setup({ - snippet = { - -- expand = function(args) - -- require('luasnip').lsp_expand(args.body) - -- end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - -- [''] = cmp.mapping.confirm({ select = true }), - -- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#luasnip + cmp.setup({ + snippet = { + -- expand = function(args) + -- require('luasnip').lsp_expand(args.body) + -- end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + -- [''] = cmp.mapping.confirm({ select = true }), + -- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#luasnip - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - if luasnip.expandable() then - luasnip.expand() - else - cmp.confirm({ - select = true, - }) - end - else - fallback() - end - end), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + if luasnip.expandable() then + luasnip.expand() + else + cmp.confirm({ + select = true, + }) + end + else + fallback() + end + end), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.locally_jumpable(1) then - luasnip.jump(1) - else - fallback() - end - end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.locally_jumpable(1) then + luasnip.jump(1) + else + fallback() + end + end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - -- { name = 'treesitter' }, - { name = "luasnip" }, - }, { - { name = 'buffer' }, - { name = "path" }, - }), - }) + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + -- { name = 'treesitter' }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + { name = "path" }, + }), + }) - cmp.setup.cmdline({ "/", "?" }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = "buffer" }, - }, - }) + cmp.setup.cmdline({ "/", "?" }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "buffer" }, + }, + }) - cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), - matching = { disallow_symbol_nonprefix_matching = false }, - }) - end, + cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + }, { + { name = "cmdline" }, + }), + matching = { disallow_symbol_nonprefix_matching = false }, + }) + end, } diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index 8850131..1e694d5 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -1,80 +1,77 @@ return { - "neovim/nvim-lspconfig", - lazy = false, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "VonHeikemen/lsp-zero.nvim", - { - "williamboman/mason.nvim", - config = function() - require("mason").setup() - end, - }, - { - "williamboman/mason-lspconfig.nvim", - dependencies = { "williamboman/mason.nvim" }, - }, - }, - keys = { - { "li", "LspInfo", desc = "Lsp info" }, - { "ll", "LspLog", desc = "Lsp log" }, - }, - config = function() - -- Setup mason-lspconfig with v2.0 API - require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "rust_analyzer" }, - automatic_enable = true, -- This automatically enables installed servers - }) + "neovim/nvim-lspconfig", + lazy = false, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "VonHeikemen/lsp-zero.nvim", + { + "williamboman/mason.nvim", + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + dependencies = { "williamboman/mason.nvim" }, + }, + }, + keys = { + { "li", "LspInfo", desc = "Lsp info" }, + { "ll", "LspLog", desc = "Lsp log" }, + }, + config = function() + -- Setup mason-lspconfig with v2.0 API + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "rust_analyzer" }, + automatic_enable = true, -- This automatically enables installed servers + }) - -- Setup LSP capabilities for autocompletion - local lspconfig = require("lspconfig") - local lspconfig_defaults = lspconfig.util.default_config - lspconfig_defaults.capabilities = vim.tbl_deep_extend( - "force", - lspconfig_defaults.capabilities, - require("cmp_nvim_lsp").default_capabilities() - ) + -- Setup LSP capabilities for autocompletion + local lspconfig = require("lspconfig") + local lspconfig_defaults = lspconfig.util.default_config + lspconfig_defaults.capabilities = + vim.tbl_deep_extend("force", lspconfig_defaults.capabilities, require("cmp_nvim_lsp").default_capabilities()) - -- Configure ruby-lsp using the new vim.lsp.config API - vim.lsp.config('ruby-lsp', { - init_options = { + -- Configure ruby-lsp using the new vim.lsp.config API + vim.lsp.config("ruby-lsp", { + init_options = { addonSettings = { ["Ruby LSP Rails"] = { enablePendingMigrationsPrompt = false, }, }, - settings = { + settings = { formatter = { - enabled = true - } - } - } - }) + enabled = true, + }, + }, + }, + }) -- herb? - vim.lsp.config('herb_ls', { + vim.lsp.config("herb_ls", { cmd = { "herb-language-server", "--stdio" }, - filetypes = { 'erb'}, - }) + filetypes = { "erb" }, + }) - -- LSP keymaps and autocmds - vim.api.nvim_create_autocmd("LspAttach", { - desc = "LSP actions", - callback = function(event) - local opts = { buffer = event.buf } - vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Show hover information" }) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) - vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { desc = "Go to declaration" }) - vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" }) - vim.keymap.set("n", "go", vim.lsp.buf.type_definition, { desc = "Go to type definition" }) - vim.keymap.set("n", "gr", vim.lsp.buf.references, { desc = "Show references" }) - vim.keymap.set("n", "gs", vim.lsp.buf.signature_help, { desc = "Show signature help" }) - vim.keymap.set("n", "cn", vim.lsp.buf.rename, { desc = "Rename symbol" }) - vim.keymap.set({ "n", "x" }, "F", function() - vim.lsp.buf.format({ async = true }) -- TODO: add desc - end, opts) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts) - end, - }) - end, + -- LSP keymaps and autocmds + vim.api.nvim_create_autocmd("LspAttach", { + desc = "LSP actions", + callback = function(event) + local opts = { buffer = event.buf } + vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Show hover information" }) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { desc = "Go to declaration" }) + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" }) + vim.keymap.set("n", "go", vim.lsp.buf.type_definition, { desc = "Go to type definition" }) + vim.keymap.set("n", "gr", vim.lsp.buf.references, { desc = "Show references" }) + vim.keymap.set("n", "gs", vim.lsp.buf.signature_help, { desc = "Show signature help" }) + vim.keymap.set("n", "cn", vim.lsp.buf.rename, { desc = "Rename symbol" }) + vim.keymap.set({ "n", "x" }, "F", function() + vim.lsp.buf.format({ async = true }) -- TODO: add desc + end, opts) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts) + end, + }) + end, } diff --git a/.config/nvim/lua/plugins/nvim-surround.lua b/.config/nvim/lua/plugins/nvim-surround.lua index 08ac0f2..e859c19 100644 --- a/.config/nvim/lua/plugins/nvim-surround.lua +++ b/.config/nvim/lua/plugins/nvim-surround.lua @@ -1,8 +1,8 @@ return { - "kylechui/nvim-surround", - version = "*", - event = "VeryLazy", - config = function() - require("nvim-surround").setup() - end, + "kylechui/nvim-surround", + version = "*", + event = "VeryLazy", + config = function() + require("nvim-surround").setup() + end, } diff --git a/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua b/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua index 64b8e4a..00de681 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter-endwise.lua @@ -1,11 +1,11 @@ return { - "RRethy/nvim-treesitter-endwise", - event = { "BufReadPre", "BufNewFile" }, - config = function() - require("nvim-treesitter.configs").setup({ - endwise = { - enable = true, - }, - }) - end, + "RRethy/nvim-treesitter-endwise", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("nvim-treesitter.configs").setup({ + endwise = { + enable = true, + }, + }) + end, } diff --git a/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua b/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua index b8dadeb..8aad996 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter-textobjects.lua @@ -1,74 +1,74 @@ -- https://www.josean.com/posts/nvim-treesitter-and-textobjects return { - "nvim-treesitter/nvim-treesitter-textobjects", - lazy = true, - config = function() - require("nvim-treesitter.configs").setup({ - textobjects = { - select = { - enable = true, + "nvim-treesitter/nvim-treesitter-textobjects", + lazy = true, + config = function() + require("nvim-treesitter.configs").setup({ + textobjects = { + select = { + enable = true, - -- Automatically jump forward to textobj, similar to targets.vim - lookahead = true, + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" }, - ["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" }, - ["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" }, - ["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" }, + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" }, + ["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" }, + ["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" }, + ["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" }, - -- works for javascript/typescript files (custom captures I created in after/queries/ecma/textobjects.scm) - ["a:"] = { query = "@property.outer", desc = "Select outer part of an object property" }, - ["i:"] = { query = "@property.inner", desc = "Select inner part of an object property" }, - ["l:"] = { query = "@property.lhs", desc = "Select left part of an object property" }, - ["r:"] = { query = "@property.rhs", desc = "Select right part of an object property" }, + -- works for javascript/typescript files (custom captures I created in after/queries/ecma/textobjects.scm) + ["a:"] = { query = "@property.outer", desc = "Select outer part of an object property" }, + ["i:"] = { query = "@property.inner", desc = "Select inner part of an object property" }, + ["l:"] = { query = "@property.lhs", desc = "Select left part of an object property" }, + ["r:"] = { query = "@property.rhs", desc = "Select right part of an object property" }, - ["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" }, - ["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" }, + ["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" }, + ["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" }, - ["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" }, - ["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" }, + ["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" }, + ["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" }, - ["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" }, - ["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" }, + ["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" }, + ["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" }, - ["af"] = { query = "@call.outer", desc = "Select outer part of a function call" }, - ["if"] = { query = "@call.inner", desc = "Select inner part of a function call" }, + ["af"] = { query = "@call.outer", desc = "Select outer part of a function call" }, + ["if"] = { query = "@call.inner", desc = "Select inner part of a function call" }, - ["am"] = { - query = "@function.outer", - desc = "Select outer part of a method/function definition", - }, - ["im"] = { - query = "@function.inner", - desc = "Select inner part of a method/function definition", - }, + ["am"] = { + query = "@function.outer", + desc = "Select outer part of a method/function definition", + }, + ["im"] = { + query = "@function.inner", + desc = "Select inner part of a method/function definition", + }, - ["ab"] = { query = "@block.outer", desc = "Select outer part of a block definition" }, - ["ib"] = { query = "@block.inner", desc = "Select inner part of a block definition" }, + ["ab"] = { query = "@block.outer", desc = "Select outer part of a block definition" }, + ["ib"] = { query = "@block.inner", desc = "Select inner part of a block definition" }, - ["ac"] = { query = "@class.outer", desc = "Select outer part of a class" }, - ["ic"] = { query = "@class.inner", desc = "Select inner part of a class" }, + ["ac"] = { query = "@class.outer", desc = "Select outer part of a class" }, + ["ic"] = { query = "@class.inner", desc = "Select inner part of a class" }, - ["a/"] = { query = "@comment.outer", desc = "Select outer part of a comment" }, - ["i/"] = { query = "@comment.inner", desc = "Select inner part of a comment" }, - }, - }, - swap = { - enable = true, - swap_next = { - ["na"] = "@parameter.inner", -- swap parameters/argument with next - ["n:"] = "@property.outer", -- swap object property with next - ["nm"] = "@function.outer", -- swap function with next - }, - swap_previous = { - ["Pa"] = "@parameter.inner", -- swap parameters/argument with prev - ["P:"] = "@property.outer", -- swap object property with prev - ["Pm"] = "@function.outer", -- swap function with previous - }, - }, - }, - }) - end, + ["a/"] = { query = "@comment.outer", desc = "Select outer part of a comment" }, + ["i/"] = { query = "@comment.inner", desc = "Select inner part of a comment" }, + }, + }, + swap = { + enable = true, + swap_next = { + ["na"] = "@parameter.inner", -- swap parameters/argument with next + ["n:"] = "@property.outer", -- swap object property with next + ["nm"] = "@function.outer", -- swap function with next + }, + swap_previous = { + ["Pa"] = "@parameter.inner", -- swap parameters/argument with prev + ["P:"] = "@property.outer", -- swap object property with prev + ["Pm"] = "@function.outer", -- swap function with previous + }, + }, + }, + }) + end, } diff --git a/.config/nvim/lua/plugins/nvim-treesitter.lua b/.config/nvim/lua/plugins/nvim-treesitter.lua index 42d8abd..0c99b7b 100644 --- a/.config/nvim/lua/plugins/nvim-treesitter.lua +++ b/.config/nvim/lua/plugins/nvim-treesitter.lua @@ -1,36 +1,36 @@ return { - "nvim-treesitter/nvim-treesitter", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - -- "nvim-treesitter/nvim-treesitter-context", - "nvim-treesitter/nvim-treesitter-textobjects", - }, - config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = { - "lua", - "yaml", - "vim", - "vimdoc", - "query", - "markdown", - "markdown_inline", - "ruby", - "javascript", - "rust", - "html", - "embedded_template", - }, - incremental_selection = { - enable = true, - keymaps = { - node_incremental = "tab", - node_decremental = "", - }, - }, - highlight = { - enable = true, - }, - }) - end, + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + -- "nvim-treesitter/nvim-treesitter-context", + "nvim-treesitter/nvim-treesitter-textobjects", + }, + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "lua", + "yaml", + "vim", + "vimdoc", + "query", + "markdown", + "markdown_inline", + "ruby", + "javascript", + "rust", + "html", + "embedded_template", + }, + incremental_selection = { + enable = true, + keymaps = { + node_incremental = "tab", + node_decremental = "", + }, + }, + highlight = { + enable = true, + }, + }) + end, } diff --git a/.config/nvim/lua/plugins/nvim-ts-autotag.lua b/.config/nvim/lua/plugins/nvim-ts-autotag.lua index 2354857..cfe911d 100644 --- a/.config/nvim/lua/plugins/nvim-ts-autotag.lua +++ b/.config/nvim/lua/plugins/nvim-ts-autotag.lua @@ -1,23 +1,23 @@ return { - "windwp/nvim-ts-autotag", - lazy = false, - -- event = { "BufReadPre", "BufNewFile" }, - config = function() - require("nvim-ts-autotag").setup({ - opts = { - -- Defaults - enable_close = true, -- Auto close tags - enable_rename = true, -- Auto rename pairs of tags - enable_close_on_slash = false, -- Auto close on trailing "] = "actions.select", - [""] = { - "actions.select", - opts = { vertical = true }, - desc = "Open the entry in a vertical split", - }, - [""] = { - "actions.select", - opts = { horizontal = true }, - desc = "Open the entry in a horizontal split", - }, - [""] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" }, - [""] = "actions.preview", - ["-"] = "actions.parent", - ["_"] = "actions.open_cwd", - ["`"] = "actions.cd", - ["gs"] = "actions.change_sort", - [""] = { - "actions.open_cmdline", - opts = { - modify = ":! open", - }, - desc = "Open file", - }, - ["K"] = "actions.preview_scroll_up", - ["J"] = "actions.preview_scroll_down", - }, - use_default_keymaps = false, - view_options = { - show_hidden = true, - }, - lsp_file_methods = { - enabled = false, - }, - }) - end, - keys = { - { mode = "n", "-", "Oil" }, - }, + -- "stevearc/oil.nvim", -- revert to original repository once https://github.com/stevearc/oil.nvim/issues/435 is resolved + "jelmansouri/oil.nvim", -- revert to original repository once https://github.com/stevearc/oil.nvim/issues/435 is resolved + branch = "feat/scratch-preview", -- revert to original repository once https://github.com/stevearc/oil.nvim/issues/435 is resolved + dependencies = { { "echasnovski/mini.icons", opts = {} } }, + lazy = false, -- nvim /dir/name does not work otherwise + config = function() + require("oil").setup({ + columns = { + -- "icon", + -- "permissions", + -- "size", + -- "mtime", + }, + constrain_cursor = "name", + skip_confirm_for_simple_edits = true, + prompt_save_on_select_new_entry = true, + watch_for_changes = false, + keymaps = { + ["g?"] = "actions.show_help", + [""] = "actions.select", + [""] = { + "actions.select", + opts = { vertical = true }, + desc = "Open the entry in a vertical split", + }, + [""] = { + "actions.select", + opts = { horizontal = true }, + desc = "Open the entry in a horizontal split", + }, + [""] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" }, + [""] = "actions.preview", + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + ["`"] = "actions.cd", + ["gs"] = "actions.change_sort", + [""] = { + "actions.open_cmdline", + opts = { + modify = ":! open", + }, + desc = "Open file", + }, + ["K"] = "actions.preview_scroll_up", + ["J"] = "actions.preview_scroll_down", + }, + use_default_keymaps = false, + view_options = { + show_hidden = true, + }, + lsp_file_methods = { + enabled = false, + }, + }) + end, + keys = { + { mode = "n", "-", "Oil" }, + }, } diff --git a/.config/nvim/lua/plugins/plantuml.lua b/.config/nvim/lua/plugins/plantuml.lua index 511b024..dfb4e9b 100644 --- a/.config/nvim/lua/plugins/plantuml.lua +++ b/.config/nvim/lua/plugins/plantuml.lua @@ -1,8 +1,8 @@ return { - "weirongxu/plantuml-previewer.vim", - dependencies = { "tyru/open-browser.vim", "aklt/plantuml-syntax" }, - lazy = false, - config = function() - vim.g.plantuml_previewer_plantuml_jar_path = "/opt/homebrew/bin/plantuml" - end, + "weirongxu/plantuml-previewer.vim", + dependencies = { "tyru/open-browser.vim", "aklt/plantuml-syntax" }, + lazy = false, + config = function() + vim.g.plantuml_previewer_plantuml_jar_path = "/opt/homebrew/bin/plantuml" + end, } diff --git a/.config/nvim/lua/plugins/refactoring.lua b/.config/nvim/lua/plugins/refactoring.lua index 08477ba..7c3e917 100644 --- a/.config/nvim/lua/plugins/refactoring.lua +++ b/.config/nvim/lua/plugins/refactoring.lua @@ -1,11 +1,11 @@ - return { - "ThePrimeagen/refactoring.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - lazy = false, - config = function() - require("refactoring").setup() - end, - } +return { + "ThePrimeagen/refactoring.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + lazy = false, + config = function() + require("refactoring").setup() + end, +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index fd8bc1b..3a8fff6 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -22,8 +22,7 @@ return { file_ignore_patterns = { ".git/" }, -- Ignore the .git directory mappings = { n = { - [""] = require("telescope.actions").send_selected_to_qflist - + require("telescope.actions").open_qflist, + [""] = require("telescope.actions").send_selected_to_qflist + require("telescope.actions").open_qflist, }, }, }, @@ -42,16 +41,16 @@ return { end require("telescope.pickers") - .new({}, { - prompt_title = "Harpoon", - finder = require("telescope.finders").new_table({ - results = file_paths, - }), - layout_strategy = "center", - previewer = conf.file_previewer({}), - sorter = conf.generic_sorter({}), - }) - :find() + .new({}, { + prompt_title = "Harpoon", + finder = require("telescope.finders").new_table({ + results = file_paths, + }), + layout_strategy = "center", + previewer = conf.file_previewer({}), + sorter = conf.generic_sorter({}), + }) + :find() end vim.keymap.set("n", "", function() @@ -59,13 +58,13 @@ return { end, { desc = "Open harpoon window" }) end, keys = { - { "", 'Telescope find_files path_display={"smart"}', desc = "Find files" }, - { "", "Telescope buffers", desc = "Find buffer" }, - { "C", "Telescope commands", desc = "Find commands" }, - { "", "Telescope lsp_document_symbols", desc = "Find symbols" }, - { "f", "Telescope find_files hidden=true", desc = "Find files" }, + { "", 'Telescope find_files path_display={"smart"}', desc = "Find files" }, + { "", "Telescope buffers", desc = "Find buffer" }, + { "C", "Telescope commands", desc = "Find commands" }, + { "", "Telescope lsp_document_symbols", desc = "Find symbols" }, + { "f", "Telescope find_files hidden=true", desc = "Find files" }, -- { "e", "Telescope find_files hidden=false", desc = "Find all files" }, - { "w", "Telescope live_grep", desc = "Find substring" }, + { "w", "Telescope live_grep", desc = "Find substring" }, { "r", function() @@ -73,7 +72,7 @@ return { require("telescope.builtin").grep_string({ search = current_word }) end, }, - { "cc", "Telescope git_commits", desc = "Find git commits" }, + { "cc", "Telescope git_commits", desc = "Find git commits" }, { "ac", "Telescope find_files prompt_title=Controllers cwd=app/controllers/ hidden=true", @@ -109,6 +108,6 @@ return { "Telescope find_files prompt_title=Views cwd=app/views hidden=true", desc = "Find Rails views", }, - { "l", "Telescope lsp_document_symbols", desc = "Find symbols" }, + { "l", "Telescope lsp_document_symbols", desc = "Find symbols" }, }, } diff --git a/.config/nvim/lua/plugins/text-case.lua b/.config/nvim/lua/plugins/text-case.lua index 32a7a21..9512abc 100644 --- a/.config/nvim/lua/plugins/text-case.lua +++ b/.config/nvim/lua/plugins/text-case.lua @@ -1,19 +1,19 @@ return { - "johmsalas/text-case.nvim", - dependencies = { "nvim-telescope/telescope.nvim" }, - config = function() - require("textcase").setup({}) - require("telescope").load_extension("textcase") - end, - keys = { - { "co", "TextCaseOpenTelescope", mode = { "n", "x" }, desc = "Open TextCase Telescope" }, - }, - cmd = { - "Subs", - "TextCaseOpenTelescope", - "TextCaseOpenTelescopeQuickChange", - "TextCaseOpenTelescopeLSPChange", - "TextCaseStartReplacingCommand", - }, - lazy = false, + "johmsalas/text-case.nvim", + dependencies = { "nvim-telescope/telescope.nvim" }, + config = function() + require("textcase").setup({}) + require("telescope").load_extension("textcase") + end, + keys = { + { "co", "TextCaseOpenTelescope", mode = { "n", "x" }, desc = "Open TextCase Telescope" }, + }, + cmd = { + "Subs", + "TextCaseOpenTelescope", + "TextCaseOpenTelescopeQuickChange", + "TextCaseOpenTelescopeLSPChange", + "TextCaseStartReplacingCommand", + }, + lazy = false, } diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua index fc29597..3741f30 100644 --- a/.config/nvim/lua/plugins/trouble.lua +++ b/.config/nvim/lua/plugins/trouble.lua @@ -1,37 +1,37 @@ return { - "folke/trouble.nvim", - opts = {}, -- for default options, refer to the configuration section for custom setup. - cmd = "Trouble", - keys = { - { - "xx", - "Trouble diagnostics toggle", - desc = "Diagnostics (Trouble)", - }, - { - "xX", - "Trouble diagnostics toggle filter.buf=0", - desc = "Buffer Diagnostics (Trouble)", - }, - { - "cs", - "Trouble symbols toggle focus=false", - desc = "Symbols (Trouble)", - }, - { - "cl", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP Definitions / references / ... (Trouble)", - }, - { - "xL", - "Trouble loclist toggle", - desc = "Location List (Trouble)", - }, - { - "xQ", - "Trouble qflist toggle", - desc = "Quickfix List (Trouble)", - }, - }, + "folke/trouble.nvim", + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = "Trouble", + keys = { + { + "xx", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "xX", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "cs", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "cl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "xL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "xQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, } diff --git a/.config/nvim/lua/plugins/undotree.lua b/.config/nvim/lua/plugins/undotree.lua index 30b83e9..fb491a7 100644 --- a/.config/nvim/lua/plugins/undotree.lua +++ b/.config/nvim/lua/plugins/undotree.lua @@ -1,30 +1,30 @@ return { - "jiaoshijie/undotree", - dependencies = "nvim-lua/plenary.nvim", - keys = { -- load the plugin only when using it's keybinding: - { "u", "lua require('undotree').toggle()", desc = "Undotree" }, - }, - config = function() - local undotree = require("undotree") + "jiaoshijie/undotree", + dependencies = "nvim-lua/plenary.nvim", + keys = { -- load the plugin only when using it's keybinding: + { "u", "lua require('undotree').toggle()", desc = "Undotree" }, + }, + config = function() + local undotree = require("undotree") - undotree.setup({ - float_diff = true, -- using float window previews diff, set this `true` will disable layout option - layout = "left_bottom", -- "left_bottom", "left_left_bottom" - position = "left", -- "right", "bottom" - ignore_filetype = { "undotree", "undotreeDiff", "qf", "TelescopePrompt", "spectre_panel", "tsplayground" }, - window = { - winblend = 30, - }, - keymaps = { - ["j"] = "move_next", - ["k"] = "move_prev", - ["gj"] = "move2parent", - ["J"] = "move_change_next", - ["K"] = "move_change_prev", - [""] = "action_enter", - ["p"] = "enter_diffbuf", - ["q"] = "quit", - }, - }) - end, + undotree.setup({ + float_diff = true, -- using float window previews diff, set this `true` will disable layout option + layout = "left_bottom", -- "left_bottom", "left_left_bottom" + position = "left", -- "right", "bottom" + ignore_filetype = { "undotree", "undotreeDiff", "qf", "TelescopePrompt", "spectre_panel", "tsplayground" }, + window = { + winblend = 30, + }, + keymaps = { + ["j"] = "move_next", + ["k"] = "move_prev", + ["gj"] = "move2parent", + ["J"] = "move_change_next", + ["K"] = "move_change_prev", + [""] = "action_enter", + ["p"] = "enter_diffbuf", + ["q"] = "quit", + }, + }) + end, } diff --git a/.config/nvim/lua/plugins/vim-case-convert.lua b/.config/nvim/lua/plugins/vim-case-convert.lua index 41b5f38..5335a6c 100644 --- a/.config/nvim/lua/plugins/vim-case-convert.lua +++ b/.config/nvim/lua/plugins/vim-case-convert.lua @@ -1,4 +1,4 @@ return { - "chiedo/vim-case-convert", - lazy = false, + "chiedo/vim-case-convert", + lazy = false, } diff --git a/.config/nvim/lua/plugins/vim-fetch.lua b/.config/nvim/lua/plugins/vim-fetch.lua index eb53d3b..64e76e5 100644 --- a/.config/nvim/lua/plugins/vim-fetch.lua +++ b/.config/nvim/lua/plugins/vim-fetch.lua @@ -1,4 +1,4 @@ return { "wsdjeg/vim-fetch", - lazy=false + lazy = false, } diff --git a/.config/nvim/lua/plugins/vim-fugitive.lua b/.config/nvim/lua/plugins/vim-fugitive.lua index 1099ca1..c38fbcf 100644 --- a/.config/nvim/lua/plugins/vim-fugitive.lua +++ b/.config/nvim/lua/plugins/vim-fugitive.lua @@ -1,13 +1,13 @@ return { - "tpope/vim-fugitive", - config = function() - require("vim-fugitive").setup() - end, - commands = { - { "G", "Git" }, - { "Gblame", "Git blame" }, - { "Gdiff", "Git diff" }, - { "Glog", "Git log" }, - { "Gstatus", "Git status" }, - }, + "tpope/vim-fugitive", + config = function() + require("vim-fugitive").setup() + end, + commands = { + { "G", "Git" }, + { "Gblame", "Git blame" }, + { "Gdiff", "Git diff" }, + { "Glog", "Git log" }, + { "Gstatus", "Git status" }, + }, } diff --git a/.config/nvim/lua/plugins/vim-rails.lua b/.config/nvim/lua/plugins/vim-rails.lua index 4b85a73..1586b7a 100644 --- a/.config/nvim/lua/plugins/vim-rails.lua +++ b/.config/nvim/lua/plugins/vim-rails.lua @@ -1,5 +1,5 @@ return { - "tpope/vim-rails", + "tpope/vim-rails", lazy = false, - ft = { "ruby" }, + ft = { "ruby" }, } diff --git a/.config/nvim/lua/plugins/vim-tmux-navigator.lua b/.config/nvim/lua/plugins/vim-tmux-navigator.lua index 31321a6..11c99cd 100644 --- a/.config/nvim/lua/plugins/vim-tmux-navigator.lua +++ b/.config/nvim/lua/plugins/vim-tmux-navigator.lua @@ -1,18 +1,18 @@ return { - "christoomey/vim-tmux-navigator", - cmd = { - "TmuxNavigateLeft", - "TmuxNavigateDown", - "TmuxNavigateUp", - "TmuxNavigateRight", - "TmuxNavigatePrevious", - "TmuxNavigatorProcessList", - }, - keys = { - { "", "TmuxNavigateLeft" }, - { "", "TmuxNavigateDown" }, - { "", "TmuxNavigateUp" }, - { "", "TmuxNavigateRight" }, - { "", "TmuxNavigatePrevious" }, - }, + "christoomey/vim-tmux-navigator", + cmd = { + "TmuxNavigateLeft", + "TmuxNavigateDown", + "TmuxNavigateUp", + "TmuxNavigateRight", + "TmuxNavigatePrevious", + "TmuxNavigatorProcessList", + }, + keys = { + { "", "TmuxNavigateLeft" }, + { "", "TmuxNavigateDown" }, + { "", "TmuxNavigateUp" }, + { "", "TmuxNavigateRight" }, + { "", "TmuxNavigatePrevious" }, + }, } diff --git a/.config/nvim/lua/plugins/visual-multi.lua b/.config/nvim/lua/plugins/visual-multi.lua index 7948c42..01d1d04 100644 --- a/.config/nvim/lua/plugins/visual-multi.lua +++ b/.config/nvim/lua/plugins/visual-multi.lua @@ -1,4 +1,4 @@ return { - "mg979/vim-visual-multi", - lazy = false, + "mg979/vim-visual-multi", + lazy = false, } diff --git a/.config/nvim/lua/plugins/yaml.lua b/.config/nvim/lua/plugins/yaml.lua index 16fdd32..68c982c 100644 --- a/.config/nvim/lua/plugins/yaml.lua +++ b/.config/nvim/lua/plugins/yaml.lua @@ -5,6 +5,6 @@ return { "nvim-treesitter/nvim-treesitter", "folke/snacks.nvim", -- optional "nvim-telescope/telescope.nvim", -- optional - "ibhagwan/fzf-lua" -- optional + "ibhagwan/fzf-lua", -- optional }, } diff --git a/.config/nvim/lua/plugins/zj-navigator.lua b/.config/nvim/lua/plugins/zj-navigator.lua index 32e0bfc..6ddf0ad 100644 --- a/.config/nvim/lua/plugins/zj-navigator.lua +++ b/.config/nvim/lua/plugins/zj-navigator.lua @@ -1,12 +1,12 @@ return { - -- 'dynamotn/Navigator.nvim', - -- lazy = false, - -- config = function() - -- require('Navigator').setup() - -- vim.keymap.set({'n', 't'}, '', 'NavigatorLeft') - -- vim.keymap.set({'n', 't'}, '', 'NavigatorRight') - -- vim.keymap.set({'n', 't'}, '', 'NavigatorUp') - -- vim.keymap.set({'n', 't'}, '', 'NavigatorDown') - -- vim.keymap.set({'n', 't'}, '', 'NavigatorPrevious') - -- end + -- 'dynamotn/Navigator.nvim', + -- lazy = false, + -- config = function() + -- require('Navigator').setup() + -- vim.keymap.set({'n', 't'}, '', 'NavigatorLeft') + -- vim.keymap.set({'n', 't'}, '', 'NavigatorRight') + -- vim.keymap.set({'n', 't'}, '', 'NavigatorUp') + -- vim.keymap.set({'n', 't'}, '', 'NavigatorDown') + -- vim.keymap.set({'n', 't'}, '', 'NavigatorPrevious') + -- end } diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index ba78712..2ddf614 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -74,7 +74,7 @@ vim.keymap.set("n", "cp", "cp :let @+=expand('%:p')") vim.keymap.set("n", "cm", ":cnext") vim.keymap.set("n", "cl", ":cprev") -vim.api.nvim_create_user_command('Kms', 'execute "SessionDelete" | quit', {}) +vim.api.nvim_create_user_command("Kms", 'execute "SessionDelete" | quit', {}) -- splits @@ -88,28 +88,28 @@ vim.keymap.set("n", "", ":wincmd =", { silent = true }) vim.keymap.set("n", "v", ":wincmd v", { silent = true }) vim.keymap.set("n", "V", ":wincmd s", { noremap = true, silent = true }) vim.keymap.set("n", "o", function() - -- get the current line content - local line = vim.api.nvim_get_current_line() + -- get the current line content + local line = vim.api.nvim_get_current_line() - -- extract the string (either single-quoted or double-quoted) - local str = line:match("'(.-)'") or line:match('"(.-)"') + -- extract the string (either single-quoted or double-quoted) + local str = line:match("'(.-)'") or line:match('"(.-)"') - if str then - -- Construct the GitHub URL - local url = "https://github.com/" .. str + if str then + -- Construct the GitHub URL + local url = "https://github.com/" .. str - -- use the open shell command to open the URL - os.execute("open " .. url) - else - print("No valid string found on the current line.") - end + -- use the open shell command to open the URL + os.execute("open " .. url) + else + print("No valid string found on the current line.") + end end) -- vim.keymap.set('n', '', ':let @+ = "rspec " . substitute(expand("%:p"), getcwd() . "/", "", "") . ":" . line(".")') -vim.keymap.set('n', '', ':let @+ = "rspec " . substitute(expand("%:p"), getcwd() . "/", "", "")') -vim.keymap.set('n', '', ':let @+ = "rubocop " . substitute(expand("%:p"), getcwd() . "/", "", "")') +vim.keymap.set("n", "", ':let @+ = "rspec " . substitute(expand("%:p"), getcwd() . "/", "", "")') +vim.keymap.set("n", "", ':let @+ = "rubocop " . substitute(expand("%:p"), getcwd() . "/", "", "")') -vim.keymap.set('n', '', ':let @+ = substitute(expand("%:p"), getcwd() . "/", "", "")') +vim.keymap.set("n", "", ':let @+ = substitute(expand("%:p"), getcwd() . "/", "", "")') -- vim.keymap.set('n', '', ':let @+ = expand("%:p")') -vim.api.nvim_create_user_command('Trim', ':%s/\\s\\+$//e', {}) +vim.api.nvim_create_user_command("Trim", ":%s/\\s\\+$//e", {}) diff --git a/.config/nvim/lua/theme.lua b/.config/nvim/lua/theme.lua index 2652fd3..2b007a2 100644 --- a/.config/nvim/lua/theme.lua +++ b/.config/nvim/lua/theme.lua @@ -1,14 +1,14 @@ if vim.o.background == "dark" then - vim.g.tokyonight_style = "night" - vim.g.tokyonight_transparent_background = 1 - vim.g.tokyonight_enable_italic = 1 - vim.cmd("colorscheme gruvbox") - -- vim.cmd("colorscheme vim") - vim.cmd("set bg=dark") + vim.g.tokyonight_style = "night" + vim.g.tokyonight_transparent_background = 1 + vim.g.tokyonight_enable_italic = 1 + vim.cmd("colorscheme gruvbox") + -- vim.cmd("colorscheme vim") + vim.cmd("set bg=dark") else - vim.o.background = "light" - -- vim.cmd("colorscheme solarized") - -- vim.cmd("colorscheme wildcharm") - vim.cmd("colorscheme polar") - vim.cmd("set bg=light") + vim.o.background = "light" + -- vim.cmd("colorscheme solarized") + -- vim.cmd("colorscheme wildcharm") + vim.cmd("colorscheme polar") + vim.cmd("set bg=light") end diff --git a/.config/nvim/lua/util.lua b/.config/nvim/lua/util.lua index 3f41d32..f98b06a 100644 --- a/.config/nvim/lua/util.lua +++ b/.config/nvim/lua/util.lua @@ -1,56 +1,56 @@ local function get_current_line() - return vim.api.nvim_get_current_line() + return vim.api.nvim_get_current_line() end local function extract_attribute_name(line) - return line:match("%s*(%w+)%s*;") + return line:match("%s*(%w+)%s*;") end vim.api.nvim_create_autocmd("TextYankPost", { - group = vim.api.nvim_create_augroup("highlight_yank", {}), - desc = "Hightlight selection on yank", - pattern = "*", - callback = function() - vim.highlight.on_yank({ higroup = "IncSearch", timeout = 100 }) - end, + group = vim.api.nvim_create_augroup("highlight_yank", {}), + desc = "Hightlight selection on yank", + pattern = "*", + callback = function() + vim.highlight.on_yank({ higroup = "IncSearch", timeout = 100 }) + end, }) local numbertoggle_group = vim.api.nvim_create_augroup("numbertoggle", { clear = true }) vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" }, { - group = numbertoggle_group, - pattern = "*", - callback = function() - if vim.wo.number and vim.fn.mode() ~= "i" then - vim.wo.relativenumber = true - end - end, + group = numbertoggle_group, + pattern = "*", + callback = function() + if vim.wo.number and vim.fn.mode() ~= "i" then + vim.wo.relativenumber = true + end + end, }) vim.api.nvim_create_autocmd({ "BufLeave", "FocusLost", "InsertEnter", "WinLeave" }, { - group = numbertoggle_group, - pattern = "*", - callback = function() - if vim.wo.number then - vim.wo.relativenumber = false - end - end, + group = numbertoggle_group, + pattern = "*", + callback = function() + if vim.wo.number then + vim.wo.relativenumber = false + end + end, }) function toggle_terminal() - local term_bufnr = nil - for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do - if vim.api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then - term_bufnr = bufnr - break - end - end - - if term_bufnr then - vim.api.nvim_buf_delete(term_bufnr, { force = true }) - else - vim.cmd("vsplit | terminal") - end + local term_bufnr = nil + for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do + if vim.api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then + term_bufnr = bufnr + break + end + end + + if term_bufnr then + vim.api.nvim_buf_delete(term_bufnr, { force = true }) + else + vim.cmd("vsplit | terminal") + end end vim.keymap.set("n", "", toggle_terminal, { noremap = true, silent = true }) diff --git a/.config/nvim/stylua.toml b/.config/nvim/stylua.toml new file mode 100644 index 0000000..6090f42 --- /dev/null +++ b/.config/nvim/stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +call_parentheses = "Always" diff --git a/.config/nvim/vscode.lua b/.config/nvim/vscode.lua index 5ae03b3..b40ec9c 100644 --- a/.config/nvim/vscode.lua +++ b/.config/nvim/vscode.lua @@ -7,26 +7,26 @@ vim.g.maplocalleader = "," local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) end vim.opt.rtp:prepend(lazypath) local plugins = { - { - { - "tpope/vim-rails", - lazy = false, - ft = { "ruby" }, - }, - }, + { + { + "tpope/vim-rails", + lazy = false, + ft = { "ruby" }, + }, + }, } local opts = { defaults = { lazy = true }, change_detection = { notify = false } } @@ -44,16 +44,16 @@ local keymap = vim.api.nvim_set_keymap M.my_vscode = augroup("MyVSCode", {}) vim.filetype.add({ - pattern = { - [".*%.ipynb.*"] = "python", - }, + pattern = { + [".*%.ipynb.*"] = "python", + }, }) local function notify(cmd) - return string.format("call VSCodeNotify('%s')", cmd) + return string.format("call VSCodeNotify('%s')", cmd) end local function v_notify(cmd) - return string.format("call VSCodeNotifyVisual('%s', 1)", cmd) + return string.format("call VSCodeNotifyVisual('%s', 1)", cmd) end keymap("n", "xr", notify("references-view.findReferences"), { silent = true }) -- language references diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..e6fd4dd --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,69 @@ +name: Format Check + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + format-check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + + - name: Install formatters + run: | + # Install StyLua for Lua formatting + cargo install stylua + + # Install shfmt for shell formatting + go install mvdan.cc/sh/v3/cmd/shfmt@latest + + # Install prettier for TypeScript/JavaScript + npm install -g prettier + + # Add Go bin to PATH + echo "$HOME/go/bin" >> $GITHUB_PATH + + - name: Create directories for fastcheck scripts + run: | + mkdir -p bin + mkdir -p neovim + mkdir -p scripts + + - name: Run bin/fastcheck + run: ./bin/fastcheck + + - name: Run neovim/fastcheck + run: ./neovim/fastcheck + + - name: Run scripts/fastcheck + run: ./scripts/fastcheck + + - name: Check if files were modified + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "Files were modified by formatting. Please run the fastcheck scripts locally and commit the changes." + git diff + exit 1 + else + echo "All files are properly formatted!" + fi \ No newline at end of file diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml deleted file mode 100644 index 5d3b6f4..0000000 --- a/.github/workflows/setup.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Macos Install - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] -jobs: - build: - runs-on: macOS-latest - - steps: - - uses: actions/checkout@v1 - - name: Execute full install - run: ./setup.sh diff --git a/bin/fastcheck b/bin/fastcheck new file mode 100755 index 0000000..9f49b1b --- /dev/null +++ b/bin/fastcheck @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "🔍 Running format checks for shell files..." + +# Find and format shell scripts +find . -type f \( -name "*.sh" -o -name "*.bash" -o -name "*.zsh" \) -not -path "./.git/*" -not -path "./node_modules/*" | while read -r file; do + echo "Formatting: $file" + + # Use shfmt for shell script formatting + if command -v shfmt >/dev/null 2>&1; then + shfmt -i 2 -ci -w "$file" + else + echo "Warning: shfmt not found, skipping shell formatting" + fi +done + +# Format .zshrc specifically (skip if it has syntax issues) +if [[ -f ".zshrc" ]]; then + echo "Checking .zshrc..." + if command -v shfmt >/dev/null 2>&1; then + if shfmt -d .zshrc >/dev/null 2>&1; then + shfmt -i 2 -ci -w .zshrc + echo "Formatted .zshrc" + else + echo "Warning: .zshrc has syntax issues, skipping formatting" + fi + fi +fi + +echo "✅ Shell file formatting complete!" + +# Run other fastcheck scripts +echo "" +echo "🔄 Running neovim/fastcheck..." +./neovim/fastcheck + +echo "" +echo "🔄 Running scripts/fastcheck..." +./scripts/fastcheck + +echo "" +echo "🎉 All fastcheck scripts completed!" diff --git a/change_theme.sh b/change_theme.sh index 857229e..bb9902a 100755 --- a/change_theme.sh +++ b/change_theme.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash if [[ "$OSTYPE" == "darwin"* ]]; then - SED_COMMAND='sed -i ""' + SED_COMMAND='sed -i ""' else - SED_COMMAND='sed -i' + SED_COMMAND='sed -i' fi replace() { - $SED_COMMAND "s|$1|$2|g" "$3" + $SED_COMMAND "s|$1|$2|g" "$3" } ALACRITTY_LIGHT_THEME="solarized_light" @@ -15,8 +15,8 @@ ALACRITTY_DARK_THEME="tokyonight" ALACRITTY_CONFIG_FILE="$HOME/.config/alacritty/current-theme.toml" if [ ! -f "$ALACRITTY_CONFIG_FILE" ]; then - echo "File not found: $ALACRITTY_CONFIG_FILE" - exit 1 + echo "File not found: $ALACRITTY_CONFIG_FILE" + exit 1 fi NVIM_THEME_FILE="$HOME/.config/nvim/lua/theme.lua" @@ -24,26 +24,26 @@ NVIM_LIGHT_THEME='solarized' NVIM_DARK_THEME='tokyodark' if [ ! -f "$NVIM_THEME_FILE" ]; then - echo "File not found: $NVIM_THEME_FILE" - exit 1 + echo "File not found: $NVIM_THEME_FILE" + exit 1 fi NVIM_SERVERS=$(nvr --serverlist) if grep -q "$ALACRITTY_LIGHT_THEME" "$ALACRITTY_CONFIG_FILE"; then - # switch to dark theme - replace "$ALACRITTY_LIGHT_THEME" "$ALACRITTY_DARK_THEME" "$ALACRITTY_CONFIG_FILE" - replace "local USE_DARKMODE = false" "local USE_DARKMODE = true" "$NVIM_THEME_FILE" - for server in $NVIM_SERVERS; do - nvr --servername $server --remote-send ":colorscheme $NVIM_DARK_THEME:set background=dark" - done - echo "Changed to dark theme" + # switch to dark theme + replace "$ALACRITTY_LIGHT_THEME" "$ALACRITTY_DARK_THEME" "$ALACRITTY_CONFIG_FILE" + replace "local USE_DARKMODE = false" "local USE_DARKMODE = true" "$NVIM_THEME_FILE" + for server in $NVIM_SERVERS; do + nvr --servername $server --remote-send ":colorscheme $NVIM_DARK_THEME:set background=dark" + done + echo "Changed to dark theme" else - # switch to light theme - replace "$ALACRITTY_DARK_THEME" "$ALACRITTY_LIGHT_THEME" "$ALACRITTY_CONFIG_FILE" - replace "local USE_DARKMODE = true" "local USE_DARKMODE = false" "$NVIM_THEME_FILE" - for server in $NVIM_SERVERS; do - nvr --servername $server --remote-send ":colorscheme $NVIM_LIGHT_THEME:set background=light" - done - echo "Changed to light theme" + # switch to light theme + replace "$ALACRITTY_DARK_THEME" "$ALACRITTY_LIGHT_THEME" "$ALACRITTY_CONFIG_FILE" + replace "local USE_DARKMODE = true" "local USE_DARKMODE = false" "$NVIM_THEME_FILE" + for server in $NVIM_SERVERS; do + nvr --servername $server --remote-send ":colorscheme $NVIM_LIGHT_THEME:set background=light" + done + echo "Changed to light theme" fi diff --git a/create_linux_symlinx.sh b/create_linux_symlinx.sh index 371197d..39ab6e7 100644 --- a/create_linux_symlinx.sh +++ b/create_linux_symlinx.sh @@ -1,2 +1 @@ #/bin/zsh - diff --git a/neovim/fastcheck b/neovim/fastcheck new file mode 100755 index 0000000..6f0d03f --- /dev/null +++ b/neovim/fastcheck @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "🔍 Running format checks for Neovim Lua files..." + +# Find and format Lua files in .config/nvim +find .config/nvim -type f -name "*.lua" | while read -r file; do + echo "Formatting: $file" + + # Use stylua for Lua formatting + if command -v stylua >/dev/null 2>&1; then + stylua --config-path .config/nvim/stylua.toml "$file" 2>/dev/null || stylua "$file" + else + echo "Warning: stylua not found, skipping Lua formatting" + fi +done + +echo "✅ Neovim Lua file formatting complete!" \ No newline at end of file diff --git a/scripts/branch-checkout.ts b/scripts/branch-checkout.ts index d81211d..deee886 100755 --- a/scripts/branch-checkout.ts +++ b/scripts/branch-checkout.ts @@ -1,6 +1,6 @@ #!/usr/bin/env node -import { execSync } from 'child_process'; +import { execSync } from "child_process"; // copilot prompt: // this script gets a branch name from the command line @@ -12,12 +12,15 @@ const branchName = process.argv[2]; if (!branchName) { // get branches console.log("Please provide a branch name"); - const branches = execSync('git branch').toString().split('\n'); + const branches = execSync("git branch").toString().split("\n"); console.log(branches); process.exit(1); } -const branches = execSync(`git branch | grep ${branchName}`).toString().split('\n').filter(b => b.length > 0); +const branches = execSync(`git branch | grep ${branchName}`) + .toString() + .split("\n") + .filter((b) => b.length > 0); if (branches.length === 0) { console.log(`No branch found containing ${branchName}`); @@ -26,11 +29,10 @@ if (branches.length === 0) { if (branches.length > 1) { console.log(`Found ${branches.length} branches containing ${branchName}`); - console.log(branches) + console.log(branches); } else { const branch = branches[0].trim(); console.log(`Found branch ${branch}`); console.log(`Checking out ${branch}`); execSync(`git checkout ${branch}`); } - diff --git a/scripts/clone_praktikum.sh b/scripts/clone_praktikum.sh index 1a7bfb3..dd2ce34 100755 --- a/scripts/clone_praktikum.sh +++ b/scripts/clone_praktikum.sh @@ -5,7 +5,7 @@ GH_USER="bengldan" GH_HOST="github.zhaw.ch" for cmd in gh jq fzf; do - if ! command -v $cmd &> /dev/null; then + if ! command -v $cmd &>/dev/null; then echo "Error: $cmd is not installed." >&2 exit 1 fi diff --git a/scripts/copy-ticket-number.ts b/scripts/copy-ticket-number.ts index ada34fd..cc3fd17 100755 --- a/scripts/copy-ticket-number.ts +++ b/scripts/copy-ticket-number.ts @@ -1,28 +1,31 @@ #!/usr/bin/env bun -import { execSync } from 'child_process'; +import { execSync } from "child_process"; -const pipe = (...fns: Array<(arg: T) => T>) => (value: T) => fns.reduce((acc, fn) => fn(acc), value); +const pipe = + (...fns: Array<(arg: T) => T>) => + (value: T) => + fns.reduce((acc, fn) => fn(acc), value); try { - execSync('git status') + execSync("git status"); } catch (e) { - console.log('Not a git repository') - process.exit(1) + console.log("Not a git repository"); + process.exit(1); } -const branchPattern = /feature\/(\d+)/ +const branchPattern = /feature\/(\d+)/; const openGitInBrowser = pipe( () => execSync('git branch --list | grep "*"'), (branch) => branchPattern.exec(branch.toString()), (matches) => { - if (!matches?.[1]) throw new Error('Current branch invalid') - return matches[1] + if (!matches?.[1]) throw new Error("Current branch invalid"); + return matches[1]; }, (ticketNumber) => `echo ${ticketNumber} | pbcopy`, (command: string) => execSync(command), - () => execSync('echo "The PR template has been copied to your clipboard\!"') -) + () => execSync('echo "The PR template has been copied to your clipboard\!"'), +); -openGitInBrowser('') +openGitInBrowser(""); diff --git a/scripts/create_executable_script.sh b/scripts/create_executable_script.sh index a7dd75f..e3bfcd3 100755 --- a/scripts/create_executable_script.sh +++ b/scripts/create_executable_script.sh @@ -3,8 +3,8 @@ # Check if both the directory and script name are provided as arguments if [ $# -lt 2 ]; then - echo "Usage: create_executable_script.sh directory_name script_name" - exit 1 + echo "Usage: create_executable_script.sh directory_name script_name" + exit 1 fi # Extract directory name and script name from input arguments @@ -13,7 +13,7 @@ script_name="$2" # Create the directory if it doesn't exist if [ ! -d "$directory_name" ]; then - mkdir -p "$directory_name" + mkdir -p "$directory_name" fi # Change to the specified directory @@ -21,8 +21,8 @@ cd "$directory_name" || exit # Check if the script name already exists if [ -f "$script_name" ]; then - echo "A script with the name $script_name already exists in the directory $directory_name." - exit 1 + echo "A script with the name $script_name already exists in the directory $directory_name." + exit 1 fi # Create the new script file diff --git a/scripts/fastcheck b/scripts/fastcheck new file mode 100755 index 0000000..8fc313c --- /dev/null +++ b/scripts/fastcheck @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "🔍 Running format checks for scripts directory..." + +# Find and format shell scripts in scripts/ +find scripts -type f \( -name "*.sh" -o -name "*.bash" \) | while read -r file; do + echo "Formatting: $file" + + # Use shfmt for shell script formatting + if command -v shfmt >/dev/null 2>&1; then + shfmt -i 2 -ci -w "$file" + else + echo "Warning: shfmt not found, skipping shell formatting" + fi +done + +# Check TypeScript files for basic formatting (if prettier is available) +if command -v prettier >/dev/null 2>&1; then + find scripts -type f -name "*.ts" -not -path "*/node_modules/*" | while read -r file; do + echo "Formatting TypeScript: $file" + prettier --write "$file" + done +else + echo "Note: prettier not found, skipping TypeScript formatting" +fi + +# Check Ruby files for basic formatting (use standardrb for autofix) +if command -v standardrb >/dev/null 2>&1; then + find scripts -type f -name "*.rb" | while read -r file; do + echo "Formatting Ruby: $file" + standardrb --fix "$file" || echo "Warning: standardrb failed on $file" + done +else + echo "Note: standardrb not found, skipping Ruby formatting" +fi + +echo "✅ Scripts directory formatting complete!" \ No newline at end of file diff --git a/scripts/format_url.sh b/scripts/format_url.sh index 0d02b4d..770c7c4 100755 --- a/scripts/format_url.sh +++ b/scripts/format_url.sh @@ -11,17 +11,17 @@ FORMAT="" # Extract necessary parts based on the URL structure if [[ $URL =~ https?://[^/]+\.atlassian\.net/browse/([^ ]+) ]]; then - TICKET="${BASH_REMATCH[1]}" - FORMAT="$TICKET" + TICKET="${BASH_REMATCH[1]}" + FORMAT="$TICKET" elif [[ $URL =~ https?://[^/]+\.bitbucket\.org/[^/]+/pull-requests/([0-9]+) ]]; then - PR_NUMBER="${BASH_REMATCH[1]}" - FORMAT="#$PR_NUMBER" + PR_NUMBER="${BASH_REMATCH[1]}" + FORMAT="#$PR_NUMBER" elif [[ $URL =~ https?://[^/]+\.bitbucket\.org/[^/]+/commits/([0-9a-f]+) ]]; then - COMMIT_HASH="${BASH_REMATCH[1]}" - FORMAT="${COMMIT_HASH:0:7}" + COMMIT_HASH="${BASH_REMATCH[1]}" + FORMAT="${COMMIT_HASH:0:7}" else - echo "Unsupported URL structure." - exit 1 + echo "Unsupported URL structure." + exit 1 fi # Copy the formatted string to the clipboard diff --git a/scripts/get-pr-template.ts b/scripts/get-pr-template.ts index 63d9b56..772e02b 100755 --- a/scripts/get-pr-template.ts +++ b/scripts/get-pr-template.ts @@ -1,32 +1,35 @@ #!/usr/bin/env bun -import { execSync } from 'child_process'; +import { execSync } from "child_process"; -const pipe = (...fns: Array<(arg: T) => T>) => (value: T) => fns.reduce((acc, fn) => fn(acc), value); +const pipe = + (...fns: Array<(arg: T) => T>) => + (value: T) => + fns.reduce((acc, fn) => fn(acc), value); try { - execSync('git status') + execSync("git status"); } catch (e) { - console.log('Not a git repository') - process.exit(1) + console.log("Not a git repository"); + process.exit(1); } -const redmineBaseUrl = 'https://redmine.renuo.ch/issues/' -const branchPattern = /feature\/(\d+)/ +const redmineBaseUrl = "https://redmine.renuo.ch/issues/"; +const branchPattern = /feature\/(\d+)/; const copyTicket = pipe( () => execSync('git branch --list | grep "*"'), (branch) => branchPattern.exec(branch.toString()), (matches) => { - if (!matches?.[1]) throw new Error('Current branch invalid') - return matches[1] + if (!matches?.[1]) throw new Error("Current branch invalid"); + return matches[1]; }, (ticketNumber) => { - return `TICKET-${ticketNumber}` + return `TICKET-${ticketNumber}`; }, (prTemplate) => `echo ${JSON.stringify(prTemplate)} | pbcopy`, (command) => execSync(command), - () => execSync('echo "The PR template has been copied to your clipboard\!"') -) + () => execSync('echo "The PR template has been copied to your clipboard\!"'), +); -copyTicket('') +copyTicket(""); diff --git a/scripts/git-smart-log.ts b/scripts/git-smart-log.ts index 64ca626..4ea7db6 100755 --- a/scripts/git-smart-log.ts +++ b/scripts/git-smart-log.ts @@ -1,80 +1,82 @@ #!/usr/bin/env bun import { execSync } from "child_process"; -import { printTable } from 'console-table-printer'; -import simpleGit from 'simple-git'; +import { printTable } from "console-table-printer"; +import simpleGit from "simple-git"; -const params = process.argv.slice(2) -let filterDate = new Date() +const params = process.argv.slice(2); +let filterDate = new Date(); -if (params[0] === '--help' || params[0] === '-h') { +if (params[0] === "--help" || params[0] === "-h") { console.log(` Usage: git-smart-log [date] date: Date in format dd.mm.yyyy - `) - process.exit(0) + `); + process.exit(0); } if (params.length) { - const [day, month, year] = params[0].split('.').map(Number) + const [day, month, year] = params[0].split(".").map(Number); filterDate = new Date( year ?? new Date().getFullYear(), month ? month - 1 : new Date().getMonth(), - day ?? new Date().getDate() - ) + day ?? new Date().getDate(), + ); if (isNaN(filterDate.getTime())) { - throw new Error('Invalid date') + throw new Error("Invalid date"); } } const cwd = process.cwd(); -const { all } = await simpleGit().cwd(cwd).log(['--all']) +const { all } = await simpleGit().cwd(cwd).log(["--all"]); -const filteredCommits = all.filter(commit => { - const date = new Date(commit.date) - return date.toDateString() === filterDate.toDateString() -}) +const filteredCommits = all.filter((commit) => { + const date = new Date(commit.date); + return date.toDateString() === filterDate.toDateString(); +}); -const commits = filteredCommits.map(commit => { +const commits = filteredCommits.map((commit) => { const branch = execSync(`git branch --contains ${commit.hash}`, { cwd }) .toString() - .split('\n')[0] + .split("\n")[0] .trim() - .replace('* ', '') - .replace(/^\s+/, '') + .replace("* ", "") + .replace(/^\s+/, ""); return { ...commit, - branch - } -}) + branch, + }; +}); const sortedCommits = commits.sort((a, b) => { - const dateA = new Date(a.date) - const dateB = new Date(b.date) - return dateA.getTime() - dateB.getTime() -}) + const dateA = new Date(a.date); + const dateB = new Date(b.date); + return dateA.getTime() - dateB.getTime(); +}); const textElipsis = (str: string, maxLength: number) => { - if (str.length < maxLength) return str + if (str.length < maxLength) return str; - return str.substring(0, maxLength) + '...' -} + return str.substring(0, maxLength) + "..."; +}; -const formatedCommits = sortedCommits.map(commit => { - const formatedDate = new Date(commit.date).toLocaleTimeString() +const formatedCommits = sortedCommits.map((commit) => { + const formatedDate = new Date(commit.date).toLocaleTimeString(); return { branch: textElipsis(commit.branch, 40), author: textElipsis(commit.author_name, 10), hash: commit.hash.slice(0, 7), date: formatedDate, - message: textElipsis(commit.message, 80) - } -}) + message: textElipsis(commit.message, 80), + }; +}); -console.log(`${formatedCommits.length} commits found for ${filterDate.toDateString()}`) +console.log( + `${formatedCommits.length} commits found for ${filterDate.toDateString()}`, +); -printTable(formatedCommits) +printTable(formatedCommits); diff --git a/scripts/index.ts b/scripts/index.ts index 498795f..6933ff8 100755 --- a/scripts/index.ts +++ b/scripts/index.ts @@ -7,10 +7,10 @@ import chalk from "chalk"; const { log } = console; const filename = process.argv[2]; -const pretendDayEnd = process.argv[3] === 'y'; +const pretendDayEnd = process.argv[3] === "y"; -const columns = ['Project', 'Date', 'Hours', 'Issue']; -const indicies: Record = {}; +const columns = ["Project", "Date", "Hours", "Issue"]; +const indicies: Record<(typeof columns)[number], number> = {}; const dateDict: Record = {}; // use a dict to aggregate hours by date @@ -43,7 +43,7 @@ createReadStream(filename) dateList.forEach(([date, hours], index) => { if (index === 0 && hours < 8.4 && pretendDayEnd) { totalHours += 8.4; - log(chalk.magenta(`${date}: ${format(hours)}, counted as 8.4`)) + log(chalk.magenta(`${date}: ${format(hours)}, counted as 8.4`)); } else { totalHours += hours; @@ -56,11 +56,13 @@ createReadStream(filename) }); log(`\nTotal hours: ${format(totalHours)}`); - log(`Expected hours: ${format(8.4 * dateList.length)}`) - log(`\nOvertime in this period: ${format(totalHours - 8.4 * dateList.length)}`) + log(`Expected hours: ${format(8.4 * dateList.length)}`); + log( + `\nOvertime in this period: ${format(totalHours - 8.4 * dateList.length)}`, + ); log(`Average hours: ${format(totalHours / dateList.length)}`); - log(`Total days: ${dateList.length}`) + log(`Total days: ${dateList.length}`); }); // helpers diff --git a/scripts/open-repo-in-browser.ts b/scripts/open-repo-in-browser.ts index 8120425..456b16f 100755 --- a/scripts/open-repo-in-browser.ts +++ b/scripts/open-repo-in-browser.ts @@ -1,24 +1,27 @@ #!/usr/bin/env bun -import { execSync } from 'child_process'; +import { execSync } from "child_process"; -const pipe = (...fns: Array<(arg: T) => T>) => (value: T) => fns.reduce((acc, fn) => fn(acc), value); +const pipe = + (...fns: Array<(arg: T) => T>) => + (value: T) => + fns.reduce((acc, fn) => fn(acc), value); try { - execSync('git status') + execSync("git status"); } catch (e) { - console.log('Not a git repository') - process.exit(1) + console.log("Not a git repository"); + process.exit(1); } -const branch = execSync('git rev-parse --abbrev-ref HEAD').toString() +const branch = execSync("git rev-parse --abbrev-ref HEAD").toString(); const openGitInBrowser = pipe( - () => execSync('git remote get-url origin').toString().trim(), - (output) => output.split('@')[1].replace(':', '/'), - (path) => `https://${path.replace('.git', '')}`, + () => execSync("git remote get-url origin").toString().trim(), + (output) => output.split("@")[1].replace(":", "/"), + (path) => `https://${path.replace(".git", "")}`, (url) => `open ${url}/tree/${branch}`, - (command) => execSync(command).toString() -) + (command) => execSync(command).toString(), +); -openGitInBrowser('') +openGitInBrowser(""); diff --git a/scripts/open-ticket-in-browser.ts b/scripts/open-ticket-in-browser.ts index 49efaee..13b5fc8 100755 --- a/scripts/open-ticket-in-browser.ts +++ b/scripts/open-ticket-in-browser.ts @@ -1,29 +1,31 @@ #!/usr/bin/env bun -import { exec, execSync } from 'child_process'; +import { exec, execSync } from "child_process"; -const pipe = (...fns: Array<(arg: T) => T>) => (value: T) => fns.reduce((acc, fn) => fn(acc), value); +const pipe = + (...fns: Array<(arg: T) => T>) => + (value: T) => + fns.reduce((acc, fn) => fn(acc), value); try { - execSync('git status') + execSync("git status"); } catch (e) { - console.log('Not a git repository') - process.exit(1) + console.log("Not a git repository"); + process.exit(1); } -const redmineBaseUrl = 'https://redmine.renuo.ch/issues/' -const branchPattern = /feature\/(\d+)/ +const redmineBaseUrl = "https://redmine.renuo.ch/issues/"; +const branchPattern = /feature\/(\d+)/; const openGitInBrowser = pipe( () => execSync('git branch --list | grep "*"'), (branch) => branchPattern.exec(branch), (matches) => { - if (!matches?.[1]) throw new Error('Current branch invalid') - return matches[1] + if (!matches?.[1]) throw new Error("Current branch invalid"); + return matches[1]; }, (ticketNumber) => `open ${redmineBaseUrl}${ticketNumber}`, - (command) => execSync(command) -) - -openGitInBrowser('') + (command) => execSync(command), +); +openGitInBrowser(""); diff --git a/scripts/pretty-pulls.ts b/scripts/pretty-pulls.ts index f941ee4..c2e839c 100755 --- a/scripts/pretty-pulls.ts +++ b/scripts/pretty-pulls.ts @@ -10,32 +10,44 @@ curl -L \ https://api.github.com/repos/renuo/khw2/pulls\?state=all | ./pretty-pulls.ts > file.html && open file.html */ -let data = ''; +let data = ""; process.stdin.resume(); -process.stdin.setEncoding('utf8'); +process.stdin.setEncoding("utf8"); -process.stdin.on('data', (chunk) => { +process.stdin.on("data", (chunk) => { data += chunk; }); type PullRequest = { - html_url: string - number: number - title: string - merged_at: string | null - user: { login: string } -} + html_url: string; + number: number; + title: string; + merged_at: string | null; + user: { login: string }; +}; -const prs: { username: string, url: string, number: number, title: string, mergedAt: string | null }[] = [] +const prs: { + username: string; + url: string; + number: number; + title: string; + mergedAt: string | null; +}[] = []; -process.stdin.on('end', () => { +process.stdin.on("end", () => { try { - const pulls = JSON.parse(data) as PullRequest[] - pulls.forEach(pull => { - const { title, number, html_url, user, merged_at } = pull - prs.push({ title, number, url: html_url, username: user.login, mergedAt: merged_at }) - }) + const pulls = JSON.parse(data) as PullRequest[]; + pulls.forEach((pull) => { + const { title, number, html_url, user, merged_at } = pull; + prs.push({ + title, + number, + url: html_url, + username: user.login, + mergedAt: merged_at, + }); + }); console.log(` @@ -63,25 +75,29 @@ elements.forEach((element) => element.classList.toggle("hidden")); -${prs.map(pr => { - return ` +${prs + .map((pr) => { + return ` ${pr.title} ${pr.title}#${pr.number} ${pr.username} ${pr.mergedAt} #${pr.number} -`}).join('')} +`; + }) + .join("")} -`) +`); } catch (e) { console.error(e); } -}) - +}); diff --git a/scripts/simplecov_parser.rb b/scripts/simplecov_parser.rb index 13d4b40..ea1139e 100755 --- a/scripts/simplecov_parser.rb +++ b/scripts/simplecov_parser.rb @@ -44,22 +44,22 @@ def initialize(html_file) def parse(options = {}) @options = options - + File.open(@html_file, 'r') do |file| @doc = Nokogiri::HTML(file) end if @options[:uncovered_only] - puts "SimpleCov Coverage Report - Uncovered Issues Only" - puts "=" * 55 + puts 'SimpleCov Coverage Report - Uncovered Issues Only' + puts '=' * 55 parse_uncovered_only else - puts "SimpleCov Coverage Report" - puts "=" * 50 + puts 'SimpleCov Coverage Report' + puts '=' * 50 parse_summary parse_groups end - rescue => e + rescue StandardError => e puts "Error parsing coverage file: #{e.message}" exit 1 end @@ -75,7 +75,9 @@ def parse_summary coverage_percent = all_files_section.css('.covered_percent .green').first&.text&.strip hits_per_line = all_files_section.css('.covered_strength .green').first&.text&.strip - total_files = all_files_section.css('div').find { |div| div.text.match(/\d+ files in total/) }&.text&.match(/(\d+)/)[1] + total_files = all_files_section.css('div').find do |div| + div.text.match(/\d+ files in total/) + end&.text&.match(/(\d+)/)&.[](1) line_summary = all_files_section.css('.t-line-summary').first if line_summary @@ -94,7 +96,14 @@ def parse_summary puts "\nOverall Coverage:" puts " Files: #{total_files}" puts " Line Coverage: #{coverage_percent} (#{covered_lines}/#{relevant_lines} lines)" - puts " Branch Coverage: #{branch_summary ? calculate_branch_percentage(covered_branches, total_branches) : 'N/A'} (#{covered_branches}/#{total_branches} branches)" if branch_summary + if branch_summary + puts " Branch Coverage: #{if branch_summary + calculate_branch_percentage(covered_branches, + total_branches) + else + 'N/A' + end} (#{covered_branches}/#{total_branches} branches)" + end puts " Average Hits/Line: #{hits_per_line}" puts end @@ -112,7 +121,7 @@ def parse_groups def parse_group(section) group_name = section.css('.group_name').first&.text - + # In uncovered-only mode, check if group has any issues before showing if @options[:uncovered_only] files = section.css('.file_list tbody .t-file') @@ -125,7 +134,7 @@ def parse_group(section) end puts "Group: #{group_name}" - puts "-" * (group_name.length + 7) + puts '-' * (group_name.length + 7) unless @options[:uncovered_only] coverage_percent = section.css('.covered_percent .green').first&.text&.strip @@ -188,12 +197,12 @@ def parse_file_summary(file_row) puts " Branch Coverage: #{branch_coverage} (#{covered_branches}/#{total_branches})" if total_branches.to_i > 0 puts " Average Hits: #{avg_hits}" - if file_id + return unless file_id + parse_file_details(file_id, file_path) - end end - def parse_file_details(file_id, file_path) + def parse_file_details(file_id, _file_path) source_table = @doc.css("##{file_id}").first return unless source_table @@ -215,11 +224,11 @@ def parse_file_details(file_id, file_path) end end - if !uncovered_lines.empty? || !partial_lines.empty? - puts " Issues:" + return unless !uncovered_lines.empty? || !partial_lines.empty? + + puts ' Issues:' puts " Uncovered lines: #{uncovered_lines.join(', ')}" unless uncovered_lines.empty? puts " Partially covered lines: #{partial_lines.join(', ')}" unless partial_lines.empty? - end end def parse_uncovered_only @@ -230,12 +239,12 @@ def parse_uncovered_only if all_files_section line_summary = all_files_section.css('.t-line-summary').first branch_summary = all_files_section.css('.t-branch-summary').first - - missed_lines = line_summary&.css('.red b')&.first&.text || "0" - missed_branches = branch_summary&.css('.red b')&.first&.text || "0" + + missed_lines = line_summary&.css('.red b')&.first&.text || '0' + missed_branches = branch_summary&.css('.red b')&.first&.text || '0' total_issues = missed_lines.to_i + missed_branches.to_i - + if total_issues == 0 puts "\nPerfect coverage! No uncovered lines or branches found." return @@ -249,7 +258,8 @@ def parse_uncovered_only end def calculate_branch_percentage(covered, total) - return "0.0%" if total.to_i == 0 + return '0.0%' if total.to_i == 0 + percentage = (covered.to_f / total.to_f * 100).round(1) "#{percentage}%" end @@ -289,14 +299,14 @@ def show_help def find_coverage_file(directory, filename) path = File.join(directory, filename) return path if File.exist?(path) - + # Try some common variations variations = [ File.join(directory, 'index.html'), File.join('.', 'coverage', 'index.html'), File.join('.', 'coverage_reports', 'index.html') ] - + variations.find { |variation| File.exist?(variation) } end @@ -308,24 +318,24 @@ def find_coverage_file(directory, filename) OptionParser.new do |opts| opts.banner = "Usage: #{$0} [options] coverage_file.html" - - opts.on("-d", "--directory DIR", "Coverage directory") do |dir| + + opts.on('-d', '--directory DIR', 'Coverage directory') do |dir| coverage_dir = dir end - - opts.on("-f", "--file FILE", "Coverage HTML file") do |file| + + opts.on('-f', '--file FILE', 'Coverage HTML file') do |file| coverage_file = file end - - opts.on("-v", "--verbose", "Show verbose output") do + + opts.on('-v', '--verbose', 'Show verbose output') do options[:verbose] = true end - - opts.on("-u", "--uncovered-only", "Show only files with uncovered lines/branches") do + + opts.on('-u', '--uncovered-only', 'Show only files with uncovered lines/branches') do options[:uncovered_only] = true end - - opts.on("-h", "--help", "Show this help message") do + + opts.on('-h', '--help', 'Show this help message') do show_help exit end @@ -341,13 +351,13 @@ def find_coverage_file(directory, filename) else target_file = find_coverage_file(coverage_dir, coverage_file) unless target_file - puts "Error: Coverage file not found" - puts "Tried looking for:" + puts 'Error: Coverage file not found' + puts 'Tried looking for:' puts " #{File.join(coverage_dir, coverage_file)}" - puts " ./coverage/index.html" - puts " ./coverage_reports/index.html" + puts ' ./coverage/index.html' + puts ' ./coverage_reports/index.html' puts - puts "Make sure you have run your test suite with SimpleCov enabled." + puts 'Make sure you have run your test suite with SimpleCov enabled.' exit 1 end end @@ -356,7 +366,7 @@ def find_coverage_file(directory, filename) begin require 'nokogiri' rescue LoadError - puts "Error: nokogiri gem not found. Please install it with: gem install nokogiri" + puts 'Error: nokogiri gem not found. Please install it with: gem install nokogiri' exit 1 end @@ -364,4 +374,4 @@ def find_coverage_file(directory, filename) puts parser = SimpleCovParser.new(target_file) -parser.parse(options) +parser.parse(options) diff --git a/scripts/startup-communications.sh b/scripts/startup-communications.sh index 720df10..07ad50c 100755 --- a/scripts/startup-communications.sh +++ b/scripts/startup-communications.sh @@ -13,4 +13,3 @@ open -a "Slack" open -a "Spark Mail" - diff --git a/scripts/zip_split.sh b/scripts/zip_split.sh index 2195771..a054520 100755 --- a/scripts/zip_split.sh +++ b/scripts/zip_split.sh @@ -30,9 +30,9 @@ EOF # --- Platform-aware file size function --- file_size() { if [[ "$(uname)" == "Darwin" ]]; then - stat -f%z "$1" # macOS + stat -f%z "$1" # macOS else - stat --printf="%s" "$1" # Linux + stat --printf="%s" "$1" # Linux fi } @@ -81,12 +81,12 @@ for FILE in "$SOURCE_DIR"/*; do [[ -f "$FILE" ]] || continue SIZE=$(file_size "$FILE") - if (( SIZE > MAX_SIZE_BYTES )); then + if ((SIZE > MAX_SIZE_BYTES)); then echo "⚠️ Skipping large file: $(basename "$FILE") (${SIZE} bytes)" continue fi - if (( CURRENT_SIZE + SIZE > MAX_SIZE_BYTES && CURRENT_SIZE > 0 )); then + if ((CURRENT_SIZE + SIZE > MAX_SIZE_BYTES && CURRENT_SIZE > 0)); then ZIP_NAME="$OUTPUT_DIR/${ZIP_PREFIX}${PART_INDEX}.zip" echo "📦 Creating $ZIP_NAME..." zip -j -q "$ZIP_NAME" "${CURRENT_BATCH[@]}" @@ -99,11 +99,10 @@ for FILE in "$SOURCE_DIR"/*; do CURRENT_SIZE=$((CURRENT_SIZE + SIZE)) done -if (( ${#CURRENT_BATCH[@]} > 0 )); then +if ((${#CURRENT_BATCH[@]} > 0)); then ZIP_NAME="$OUTPUT_DIR/${ZIP_PREFIX}${PART_INDEX}.zip" echo "📦 Creating $ZIP_NAME..." zip -j -q "$ZIP_NAME" "${CURRENT_BATCH[@]}" fi echo "✅ Done! Created zip files in '$OUTPUT_DIR'." - From 076918c07986e114ea7d129ccdd15096090cc177 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 24 Sep 2025 18:41:25 +0200 Subject: [PATCH 277/280] Add more dotfiles --- .config/bat/config | 14 ++- .config/btop/btop.conf | 218 +++++++++++++++++++++++++++++++++++++++++ .config/ghostty/config | 92 +++++++++++++++++ .config/hyfetch.json | 16 +++ .gitignore | 1 + create_symlinks.sh | 4 + 6 files changed, 343 insertions(+), 2 deletions(-) create mode 100644 .config/btop/btop.conf create mode 100644 .config/ghostty/config create mode 100644 .config/hyfetch.json diff --git a/.config/bat/config b/.config/bat/config index 305dfdd..c897934 100644 --- a/.config/bat/config +++ b/.config/bat/config @@ -1,2 +1,12 @@ ---style plain ---theme gruvbox-dark +# Bat configuration file +# Syntax highlighting theme +--theme="TwoDark" + +# Style components to display +--style="numbers,changes,header" + +# Always show decorations +--decorations=always + +# Use less as pager with useful options +--pager="less -RF" \ No newline at end of file diff --git a/.config/btop/btop.conf b/.config/btop/btop.conf new file mode 100644 index 0000000..c8f4358 --- /dev/null +++ b/.config/btop/btop.conf @@ -0,0 +1,218 @@ +#? Config file for btop v. 1.4.0 + +#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. +#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" +color_theme = "/opt/homebrew/Cellar/btop/1.4.0/share/btop/themes/flat-remix-light.theme" + +#* If the theme set background should be shown, set to False if you want terminal background transparency. +theme_background = False + +#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false. +truecolor = True + +#* Set to true to force tty mode regardless if a real tty has been detected or not. +#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols. +force_tty = False + +#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets. +#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box. +#* Use whitespace " " as separator between different presets. +#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty" +presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty" + +#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. +#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. +vim_keys = True + +#* Rounded corners on boxes, is ignored if TTY mode is ON. +rounded_corners = True + +#* Default symbols to use for graph creation, "braille", "block" or "tty". +#* "braille" offers the highest resolution but might not be included in all fonts. +#* "block" has half the resolution of braille but uses more common characters. +#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY. +#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view. +graph_symbol = "braille" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_cpu = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_mem = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_net = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_proc = "default" + +#* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace. +shown_boxes = "proc" + +#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs. +update_ms = 29000 + +#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", +#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. +proc_sorting = "name" + +#* Reverse sorting order, True or False. +proc_reversed = False + +#* Show processes as a tree. +proc_tree = False + +#* Use the cpu graph colors in the process list. +proc_colors = True + +#* Use a darkening gradient in the process list. +proc_gradient = True + +#* If process cpu usage should be of the core it's running on or usage of the total available cpu power. +proc_per_core = True + +#* Show process memory as bytes instead of percent. +proc_mem_bytes = True + +#* Show cpu graph for each process. +proc_cpu_graphs = True + +#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate) +proc_info_smaps = False + +#* Show proc box on left side of screen instead of right. +proc_left = False + +#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop). +proc_filter_kernel = False + +#* In tree-view, always accumulate child process resources in the parent process. +proc_aggregate = False + +#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available. +#* Select from a list of detected attributes from the options menu. +cpu_graph_upper = "Auto" + +#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available. +#* Select from a list of detected attributes from the options menu. +cpu_graph_lower = "Auto" + +#* Toggles if the lower CPU graph should be inverted. +cpu_invert_lower = True + +#* Set to True to completely disable the lower CPU graph. +cpu_single_graph = False + +#* Show cpu box at bottom of screen instead of top. +cpu_bottom = False + +#* Shows the system uptime in the CPU box. +show_uptime = True + +#* Show cpu temperature. +check_temp = True + +#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors. +cpu_sensor = "Auto" + +#* Show temperatures for cpu cores also if check_temp is True and sensors has been found. +show_coretemp = True + +#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core. +#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine. +#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries. +#* Example: "4:0 5:1 6:3" +cpu_core_map = "" + +#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine". +temp_scale = "celsius" + +#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024. +base_10_sizes = True + +#* Show CPU frequency. +show_cpu_freq = True + +#* Draw a clock at top of screen, formatting according to strftime, empty string to disable. +#* Special formatting: /host = hostname | /user = username | /uptime = system uptime +clock_format = "%X" + +#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort. +background_update = True + +#* Custom cpu model name, empty string to disable. +custom_cpu_name = "" + +#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ". +#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user". +disks_filter = "" + +#* Show graphs instead of meters for memory values. +mem_graphs = True + +#* Show mem box below net box instead of above. +mem_below_net = False + +#* Count ZFS ARC in cached and available memory. +zfs_arc_cached = True + +#* If swap memory should be shown in memory box. +show_swap = True + +#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk. +swap_disk = True + +#* If mem box should be split to also show disks info. +show_disks = False + +#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar. +only_physical = True + +#* Read disks list from /etc/fstab. This also disables only_physical. +use_fstab = True + +#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool) +zfs_hide_datasets = False + +#* Set to true to show available disk space for privileged users. +disk_free_priv = False + +#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view. +show_io_stat = True + +#* Toggles io mode for disks, showing big graphs for disk read/write speeds. +io_mode = False + +#* Set to True to show combined read/write io graphs in io mode. +io_graph_combined = False + +#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ". +#* Example: "/mnt/media:100 /:20 /boot:1". +io_graph_speeds = "" + +#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False. +net_download = 100 + +net_upload = 100 + +#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest. +net_auto = False + +#* Sync the auto scaling for download and upload to whichever currently has the highest scale. +net_sync = False + +#* Starts with the Network Interface specified here. +net_iface = "" + +#* Show battery stats in top right if battery is present. +show_battery = True + +#* Which battery to use if multiple are present. "Auto" for auto detection. +selected_battery = "Auto" + +#* Show power stats of battery next to charge indicator. +show_battery_watts = True + +#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". +#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info. +log_level = "WARNING" diff --git a/.config/ghostty/config b/.config/ghostty/config new file mode 100644 index 0000000..b125bca --- /dev/null +++ b/.config/ghostty/config @@ -0,0 +1,92 @@ +font-family = Jetbrains Mono NF +font-family-bold = Jetbrains Mono NF +font-family-italic = Jetbrains Mono NF +font-family-bold-italic = Jetbrains Mono NF +font-size = 16 +background = #000000 +command = zsh -c "/opt/homebrew/bin/zellij" +keybind = super+enter=toggle_fullscreen +keybind = super+alt+shift+j=write_screen_file:open +keybind = super+2=goto_tab:2 +keybind = super+digit_6=goto_tab:6 +keybind = super+k=clear_screen +keybind = super+page_down=scroll_page_down +keybind = super+4=goto_tab:4 +keybind = super+shift+z=redo +keybind = super+shift+v=paste_from_selection +keybind = shift+page_down=adjust_selection:page_down +keybind = super+7=goto_tab:7 +keybind = shift+arrow_down=adjust_selection:down +keybind = super+5=goto_tab:5 +keybind = super+3=goto_tab:3 +keybind = super+a=select_all +keybind = super+arrow_left=text:\x01 +keybind = shift+page_up=adjust_selection:page_up +keybind = super+0=reset_font_size +keybind = super+digit_2=goto_tab:2 +keybind = super+shift+bracket_left=previous_tab +keybind = super+shift+,=reload_config +keybind = super+,=open_config +keybind = super+ctrl+shift+j=write_screen_file:copy +keybind = paste=paste_from_clipboard +keybind = super+alt+arrow_up=goto_split:up +keybind = super+ctrl+arrow_right=resize_split:right,10 +keybind = alt+arrow_left=esc:b +keybind = shift+enter=text:\x1b\r +keybind = super+equal=increase_font_size:1 +keybind = ctrl+tab=next_tab +keybind = super+digit_4=goto_tab:4 +keybind = super+q=quit +keybind = super+shift+arrow_up=jump_to_prompt:-1 +keybind = super+ctrl+equal=equalize_splits +keybind = super+digit_7=goto_tab:7 +keybind = super+ctrl+f=toggle_fullscreen +keybind = super+backspace=text:\x15 +keybind = super+6=goto_tab:6 +keybind = super+page_up=scroll_page_up +keybind = super+1=goto_tab:1 +keybind = super+alt+w=close_tab:this +keybind = super+end=scroll_to_bottom +keybind = super+-=decrease_font_size:1 +keybind = super+arrow_up=jump_to_prompt:-1 +keybind = super+shift+t=undo +keybind = super+z=undo +keybind = super+digit_8=goto_tab:8 +keybind = super+9=last_tab +keybind = shift+arrow_up=adjust_selection:up +keybind = super+home=scroll_to_top +keybind = super+digit_1=goto_tab:1 +keybind = super+shift+w=close_window +keybind = super+alt+shift+w=close_all_windows +keybind = super+ctrl+arrow_down=resize_split:down,10 +keybind = shift+end=adjust_selection:end +keybind = super+v=paste_from_clipboard +keybind = shift+arrow_right=adjust_selection:right +keybind = super+ctrl+arrow_left=resize_split:left,10 +keybind = super+shift+enter=toggle_split_zoom +keybind = super+arrow_right=text:\x05 +keybind = super++=increase_font_size:1 +keybind = super+shift+p=toggle_command_palette +keybind = super+8=goto_tab:8 +keybind = shift+arrow_left=adjust_selection:left +keybind = super+shift+arrow_down=jump_to_prompt:1 +keybind = super+alt+arrow_down=goto_split:down +keybind = copy=copy_to_clipboard +keybind = super+shift+j=write_screen_file:paste +keybind = super+shift+bracket_right=next_tab +keybind = super+arrow_down=jump_to_prompt:1 +keybind = ctrl+shift+tab=previous_tab +keybind = alt+arrow_right=esc:f +keybind = super+n=new_window +keybind = shift+home=adjust_selection:home +keybind = super+alt+i=inspector:toggle +keybind = super+digit_5=goto_tab:5 +keybind = super+digit_3=goto_tab:3 +keybind = super+ctrl+arrow_up=resize_split:up,10 +window-padding-x = 10 +window-padding-y = 10 +click-repeat-interval = 200 +macos-titlebar-style = hidden +macos-option-as-alt = true +bold-color = bright +auto-update-channel = stable diff --git a/.config/hyfetch.json b/.config/hyfetch.json new file mode 100644 index 0000000..bcda78c --- /dev/null +++ b/.config/hyfetch.json @@ -0,0 +1,16 @@ +{ + "preset": "nonbinary", + "mode": "rgb", + "light_dark": "dark", + "lightness": 0.5, + "color_align": { + "mode": "horizontal", + "custom_colors": [], + "fore_back": null + }, + "backend": "neofetch", + "args": null, + "distro": null, + "pride_month_shown": [], + "pride_month_disable": false +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 974e04c..ef89d67 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ **/node_modules/** **/.DS_Store/** **/.ignore/** +**/*.log diff --git a/create_symlinks.sh b/create_symlinks.sh index d026da0..253598b 100755 --- a/create_symlinks.sh +++ b/create_symlinks.sh @@ -20,3 +20,7 @@ create_symlink ~/dotfiles/.tmux.conf ~/.tmux.conf create_symlink ~/dotfiles/my-status-bar.tmux ~/my-status-bar.tmux create_symlink ~/dotfiles/.gitignore ~/.gitignore create_symlink ~/dotfiles/scripts ~/scripts +create_symlink ~/dotfiles/.config/ghostty ~/.config/ghostty +create_symlink ~/dotfiles/.config/btop ~/.config/btop +create_symlink ~/dotfiles/.config/hyfetch.json ~/.config/hyfetch.json +create_symlink ~/dotfiles/.config/bat ~/.config/bat From 2a7e6ec6a02c8e6894d006127cc08a7df609343b Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 24 Sep 2025 18:43:03 +0200 Subject: [PATCH 278/280] Update bat --- .config/bat/config | 4 ++-- .zshrc | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.config/bat/config b/.config/bat/config index c897934..a5f01fc 100644 --- a/.config/bat/config +++ b/.config/bat/config @@ -6,7 +6,7 @@ --style="numbers,changes,header" # Always show decorations ---decorations=always +--decorations=never # Use less as pager with useful options ---pager="less -RF" \ No newline at end of file +--pager="less -RF" diff --git a/.zshrc b/.zshrc index b189275..78e9f82 100644 --- a/.zshrc +++ b/.zshrc @@ -160,7 +160,6 @@ compdef _deploio deploio depl 2>/dev/null fpath=(~/.config/zsh/completions $fpath) autoload -U compinit && compinit -alias bat='bat --theme="gruvbox-dark"' nvimfuzzysearch() { local sel sel=$( From 83c0ff22c30ea8439d01c20bb478bc591d8dbc5e Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 24 Sep 2025 18:50:18 +0200 Subject: [PATCH 279/280] Update hyfetch --- .config/{ => hyfetch}/hyfetch.json | 2 +- create_symlinks.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename .config/{ => hyfetch}/hyfetch.json (99%) diff --git a/.config/hyfetch.json b/.config/hyfetch/hyfetch.json similarity index 99% rename from .config/hyfetch.json rename to .config/hyfetch/hyfetch.json index bcda78c..ea3b7b2 100644 --- a/.config/hyfetch.json +++ b/.config/hyfetch/hyfetch.json @@ -13,4 +13,4 @@ "distro": null, "pride_month_shown": [], "pride_month_disable": false -} \ No newline at end of file +} diff --git a/create_symlinks.sh b/create_symlinks.sh index 253598b..086c457 100755 --- a/create_symlinks.sh +++ b/create_symlinks.sh @@ -22,5 +22,5 @@ create_symlink ~/dotfiles/.gitignore ~/.gitignore create_symlink ~/dotfiles/scripts ~/scripts create_symlink ~/dotfiles/.config/ghostty ~/.config/ghostty create_symlink ~/dotfiles/.config/btop ~/.config/btop -create_symlink ~/dotfiles/.config/hyfetch.json ~/.config/hyfetch.json +create_symlink ~/dotfiles/.config/hyfetch/hyfetch.json "/Users/dani/Library/Application Support/hyfetch.json" create_symlink ~/dotfiles/.config/bat ~/.config/bat From b1b237ef1970a20857ca1a81405d8df9a11bf984 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 24 Sep 2025 19:01:17 +0200 Subject: [PATCH 280/280] Improve flag setup --- .zshrc | 2 +- create_symlinks.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index 78e9f82..cbb0633 100644 --- a/.zshrc +++ b/.zshrc @@ -81,7 +81,7 @@ export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/ alias gac="git add . && git commit --verbose" alias prc="v /Users/dani/prompts/README.md" alias fr='find . | rg ' - alias ff='hyfetch' + alias ff='hyfetch -C ~/.config/hyfetch/hyfetch.json' alias cvu='~/scripts/simplecov_parser.rb -u' alias vo='v $(fzf)' diff --git a/create_symlinks.sh b/create_symlinks.sh index 086c457..9f89f6d 100755 --- a/create_symlinks.sh +++ b/create_symlinks.sh @@ -22,5 +22,5 @@ create_symlink ~/dotfiles/.gitignore ~/.gitignore create_symlink ~/dotfiles/scripts ~/scripts create_symlink ~/dotfiles/.config/ghostty ~/.config/ghostty create_symlink ~/dotfiles/.config/btop ~/.config/btop -create_symlink ~/dotfiles/.config/hyfetch/hyfetch.json "/Users/dani/Library/Application Support/hyfetch.json" +create_symlink ~/dotfiles/.config/hyfetch ~/.config/hyfetch create_symlink ~/dotfiles/.config/bat ~/.config/bat