From db49982dc3c16ee7214bb612551643365f2ee536 Mon Sep 17 00:00:00 2001 From: Miszo Radomski Date: Fri, 27 Oct 2023 17:02:23 +0200 Subject: [PATCH] Add Neovim config based on LazyVim --- home/dot_config/brew/Brewfile.tmpl | 6 + home/dot_config/kitty/current-theme.conf | 36 +++ home/dot_config/kitty/executable_kitty.conf | 64 ++++- .../dot_config/kitty/themes/vim-nightfly.conf | 36 +++ home/dot_config/nvim/LICENSE | 201 +++++++++++++ home/dot_config/nvim/README.md | 4 + home/dot_config/nvim/dot_gitignore | 8 + home/dot_config/nvim/dot_neoconf.json | 15 + home/dot_config/nvim/init.lua | 2 + home/dot_config/nvim/lazy-lock.json | 90 ++++++ home/dot_config/nvim/lazyvim.json | 9 + home/dot_config/nvim/lua/config/autocmds.lua | 3 + home/dot_config/nvim/lua/config/keymaps.lua | 7 + home/dot_config/nvim/lua/config/lazy.lua | 63 +++++ home/dot_config/nvim/lua/config/options.lua | 15 + .../nvim/lua/plugins/colorscheme.lua | 10 + home/dot_config/nvim/lua/plugins/diffview.lua | 22 ++ home/dot_config/nvim/lua/plugins/example.lua | 265 ++++++++++++++++++ home/dot_config/nvim/lua/plugins/icons.lua | 13 + home/dot_config/nvim/lua/plugins/lsp.lua | 40 +++ home/dot_config/nvim/lua/plugins/neotree.lua | 58 ++++ home/dot_config/nvim/lua/plugins/noice.lua | 16 ++ home/dot_config/nvim/lua/plugins/none-ls.lua | 14 + home/dot_config/nvim/lua/plugins/notify.lua | 11 + .../dot_config/nvim/lua/plugins/statuscol.lua | 7 + .../dot_config/nvim/lua/plugins/super-tab.lua | 51 ++++ .../dot_config/nvim/lua/plugins/telescope.lua | 29 ++ home/dot_config/nvim/lua/plugins/test.lua | 45 +++ .../nvim/lua/plugins/treesitter.lua | 31 ++ .../nvim/lua/plugins/typescript.lua | 47 ++++ home/dot_config/nvim/stylua.toml | 4 + home/dot_config/zsh/dot_zsh_aliases.zsh | 16 +- home/dot_config/zsh/dot_zshrc | 2 +- 33 files changed, 1224 insertions(+), 16 deletions(-) create mode 100644 home/dot_config/kitty/current-theme.conf create mode 100644 home/dot_config/kitty/themes/vim-nightfly.conf create mode 100644 home/dot_config/nvim/LICENSE create mode 100644 home/dot_config/nvim/README.md create mode 100644 home/dot_config/nvim/dot_gitignore create mode 100644 home/dot_config/nvim/dot_neoconf.json create mode 100644 home/dot_config/nvim/init.lua create mode 100644 home/dot_config/nvim/lazy-lock.json create mode 100644 home/dot_config/nvim/lazyvim.json create mode 100644 home/dot_config/nvim/lua/config/autocmds.lua create mode 100644 home/dot_config/nvim/lua/config/keymaps.lua create mode 100644 home/dot_config/nvim/lua/config/lazy.lua create mode 100644 home/dot_config/nvim/lua/config/options.lua create mode 100644 home/dot_config/nvim/lua/plugins/colorscheme.lua create mode 100644 home/dot_config/nvim/lua/plugins/diffview.lua create mode 100644 home/dot_config/nvim/lua/plugins/example.lua create mode 100644 home/dot_config/nvim/lua/plugins/icons.lua create mode 100644 home/dot_config/nvim/lua/plugins/lsp.lua create mode 100644 home/dot_config/nvim/lua/plugins/neotree.lua create mode 100644 home/dot_config/nvim/lua/plugins/noice.lua create mode 100644 home/dot_config/nvim/lua/plugins/none-ls.lua create mode 100644 home/dot_config/nvim/lua/plugins/notify.lua create mode 100644 home/dot_config/nvim/lua/plugins/statuscol.lua create mode 100644 home/dot_config/nvim/lua/plugins/super-tab.lua create mode 100644 home/dot_config/nvim/lua/plugins/telescope.lua create mode 100644 home/dot_config/nvim/lua/plugins/test.lua create mode 100644 home/dot_config/nvim/lua/plugins/treesitter.lua create mode 100644 home/dot_config/nvim/lua/plugins/typescript.lua create mode 100644 home/dot_config/nvim/stylua.toml diff --git a/home/dot_config/brew/Brewfile.tmpl b/home/dot_config/brew/Brewfile.tmpl index cf4a771..d69cac0 100644 --- a/home/dot_config/brew/Brewfile.tmpl +++ b/home/dot_config/brew/Brewfile.tmpl @@ -24,19 +24,25 @@ brew 'glab' brew 'gnupg' brew 'graphviz' brew 'imagemagick' +brew 'jesseduffield/lazydocker/lazydocker' +brew 'jesseduffield/lazygit/lazygit' brew 'jq' brew 'libpq' brew 'mysql@5.7', restart_service: true brew 'neofetch' +brew 'neovim' brew 'postgresql@14', restart_service: true brew 'pre-commit' brew 'redis', restart_service: true brew 'ripgrep' brew 'thefuck' +brew 'trash' brew 'z' brew 'zlib' cask '1password-cli' cask 'calibre' cask 'docker' +cask 'font-symbols-only-nerd-font' +cask 'keycastr' cask 'orbstack' diff --git a/home/dot_config/kitty/current-theme.conf b/home/dot_config/kitty/current-theme.conf new file mode 100644 index 0000000..2ff6b63 --- /dev/null +++ b/home/dot_config/kitty/current-theme.conf @@ -0,0 +1,36 @@ +# vim:ft=kitty +## name: Vim Nightfly - Miszo +## author: Miszo Radomski +## license: MIT + +term xterm-256color +macos_window_resizable yes +macos_titlebar_color background + +#: Cursor colors +cursor #9ca1aa +cursor_text_color background + +background #011627 +background_opacity 0.90 +background_blur 32 + +foreground #bdc1c6 +color0 #1d3b53 +color1 #fc514e +color2 #a1cd5e +color3 #e3d18a +color4 #82aaff +color5 #c792ea +color6 #7fdbca +color7 #a1aab8 +color8 #7c8f8f +color9 #ff5874 +color10 #21c7a8 +color11 #ecc48d +color12 #82aaff +color13 #ae81ff +color14 #7fdbca +color15 #d6deeb +selection_background #b2ceee +selection_foreground #080808 diff --git a/home/dot_config/kitty/executable_kitty.conf b/home/dot_config/kitty/executable_kitty.conf index b33fd36..92358e9 100644 --- a/home/dot_config/kitty/executable_kitty.conf +++ b/home/dot_config/kitty/executable_kitty.conf @@ -21,7 +21,7 @@ #: font_family Operator Mono Book #: bold_font Operator Mono Medium -#: italic_font Operator Mono Book Italic +#: italic_font Opzerator Mono Book Italic #: bold_italic_font Operator Mono Medium Italic # font_size 11.0 @@ -82,7 +82,6 @@ #: symbol_map codepoints Font Family Name # Nerd Fonts v2.2.2 -symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0C8,U+E0CA,U+E0CC-U+E0D2,U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E634,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF Symbols Nerd Font Mono # narrow_symbols @@ -646,7 +645,6 @@ symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0 #: 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 @@ -2064,13 +2062,61 @@ symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0 shell_integration enabled term xterm-kitty +allow_remote_control yes +listen_on unix:/tmp/mykitty +export KITTY_LISTEN_ON=unix:/tmp/mykitty-$PPID # Font settings font_size 14.0 adjust_line_height 3 font_family MonoLisa Variable -italic_font MonoLisa Variable Italic + +########################################################### +# Symbols Nerd Font complete symbol_map +# easily troubleshoot missing/incorrect characters with: +# kitty --debug-font-fallback +########################################################### + +# "Nerd Fonts - Pomicons" +symbol_map U+E000-U+E00D Symbols Nerd Font + +# "Nerd Fonts - Powerline" +symbol_map U+e0a0-U+e0a2,U+e0b0-U+e0b3 Symbols Nerd Font + +# "Nerd Fonts - Powerline Extra" +symbol_map U+e0a3-U+e0a3,U+e0b4-U+e0c8,U+e0cc-U+e0d2,U+e0d4-U+e0d4 Symbols Nerd Font + +# "Nerd Fonts - Symbols original" +symbol_map U+e5fa-U+e62b Symbols Nerd Font + +# "Nerd Fonts - Devicons" +symbol_map U+e700-U+e7c5 Symbols Nerd Font + +# "Nerd Fonts - Font awesome" +symbol_map U+f000-U+f2e0 Symbols Nerd Font + +# "Nerd Fonts - Font awesome extension" +symbol_map U+e200-U+e2a9 Symbols Nerd Font + +# "Nerd Fonts - Octicons" +symbol_map U+f400-U+f4a8,U+2665-U+2665,U+26A1-U+26A1,U+f27c-U+f27c Symbols Nerd Font + +# "Nerd Fonts - Font Linux" +symbol_map U+F300-U+F313 Symbols Nerd Font + +# Nerd Fonts - Font Power Symbols" +symbol_map U+23fb-U+23fe,U+2b58-U+2b58 Symbols Nerd Font + +# "Nerd Fonts - Material Design Icons" +symbol_map U+f500-U+fd46 Symbols Nerd Font + +# "Nerd Fonts - Weather Icons" +symbol_map U+e300-U+e3eb Symbols Nerd Font + +# Misc Code Point Fixes +symbol_map U+21B5,U+25B8,U+2605,U+2630,U+2632,U+2714,U+E0A3,U+E615,U+E62B Symbols Nerd Font + # Window config @@ -2092,6 +2138,8 @@ tab_bar_style powerline scrollback_lines 4000 +# enabled_layouts * +# enabled_layouts horizontal # NightOwl theme # color0 #011627 @@ -2126,9 +2174,9 @@ map cmd+v paste_from_clipboard map cmd+t new_tab_with_cwd # open new split (window) with cmd+d retaining the cwd map cmd+w close_window -map cmd+shif+n new_os_window +map shift+cmd+n new_os_window map cmd+d launch --location=hsplit --cwd=current -map cmd+shift+d launch --location=vsplit --cwd=current +map shift+cmd+d launch --location=vsplit --cwd=current # jump to beginning and end of word map alt+left send_text all \x1b\x62 map alt+right send_text all \x1b\x66 @@ -2143,6 +2191,6 @@ map alt+backspace send_text all \x17 map cmd+backspace send_text all \x15 # BEGIN_KITTY_THEME -# Night Owl +# Vim Nightfly - Miszo include current-theme.conf -# END_KITTY_THEME \ No newline at end of file +# END_KITTY_THEME diff --git a/home/dot_config/kitty/themes/vim-nightfly.conf b/home/dot_config/kitty/themes/vim-nightfly.conf new file mode 100644 index 0000000..2ff6b63 --- /dev/null +++ b/home/dot_config/kitty/themes/vim-nightfly.conf @@ -0,0 +1,36 @@ +# vim:ft=kitty +## name: Vim Nightfly - Miszo +## author: Miszo Radomski +## license: MIT + +term xterm-256color +macos_window_resizable yes +macos_titlebar_color background + +#: Cursor colors +cursor #9ca1aa +cursor_text_color background + +background #011627 +background_opacity 0.90 +background_blur 32 + +foreground #bdc1c6 +color0 #1d3b53 +color1 #fc514e +color2 #a1cd5e +color3 #e3d18a +color4 #82aaff +color5 #c792ea +color6 #7fdbca +color7 #a1aab8 +color8 #7c8f8f +color9 #ff5874 +color10 #21c7a8 +color11 #ecc48d +color12 #82aaff +color13 #ae81ff +color14 #7fdbca +color15 #d6deeb +selection_background #b2ceee +selection_foreground #080808 diff --git a/home/dot_config/nvim/LICENSE b/home/dot_config/nvim/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/home/dot_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/home/dot_config/nvim/README.md b/home/dot_config/nvim/README.md new file mode 100644 index 0000000..185280b --- /dev/null +++ b/home/dot_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/home/dot_config/nvim/dot_gitignore b/home/dot_config/nvim/dot_gitignore new file mode 100644 index 0000000..cc5457a --- /dev/null +++ b/home/dot_config/nvim/dot_gitignore @@ -0,0 +1,8 @@ +tt.* +.tests +doc/tags +debug +.repro +foo.* +*.log +data diff --git a/home/dot_config/nvim/dot_neoconf.json b/home/dot_config/nvim/dot_neoconf.json new file mode 100644 index 0000000..7c48087 --- /dev/null +++ b/home/dot_config/nvim/dot_neoconf.json @@ -0,0 +1,15 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + } +} diff --git a/home/dot_config/nvim/init.lua b/home/dot_config/nvim/init.lua new file mode 100644 index 0000000..2514f9e --- /dev/null +++ b/home/dot_config/nvim/init.lua @@ -0,0 +1,2 @@ +-- bootstrap lazy.nvim, LazyVim and your plugins +require("config.lazy") diff --git a/home/dot_config/nvim/lazy-lock.json b/home/dot_config/nvim/lazy-lock.json new file mode 100644 index 0000000..c02d114 --- /dev/null +++ b/home/dot_config/nvim/lazy-lock.json @@ -0,0 +1,90 @@ +{ + "LazyVim": { "branch": "main", "commit": "9a6b0f8928ad2e802cae36c6b05b94cd9a73451f" }, + "LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" }, + "SchemaStore.nvim": { "branch": "main", "commit": "976e7e3e9c400b99f1cb337b2ce804a9652571ec" }, + "bufferline.nvim": { "branch": "main", "commit": "357cc8f8eeb64702e6fcf2995e3b9becee99a5d3" }, + "catppuccin": { "branch": "main", "commit": "b359f3eec32dcc6b7c9a26901dc235bbb6cd8a0b" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conform.nvim": { "branch": "master", "commit": "4653408d5c270168e31ffd0585d1cf2de27fc827" }, + "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, + "copilot.lua": { "branch": "master", "commit": "688762a3999eeee54b78f447719854f52672ec02" }, + "crates.nvim": { "branch": "main", "commit": "aac57ef84cf4fecf7907114b22e875f84a6128ee" }, + "dashboard-nvim": { "branch": "master", "commit": "c71cab740e2add248c54c458b5ca9d6e77c30fa6" }, + "diffview.nvim": { "branch": "main", "commit": "d38c1b5266850f77f75e006bcc26213684e1e141" }, + "dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" }, + "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, + "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" }, + "gitsigns.nvim": { "branch": "main", "commit": "af0f583cd35286dd6f0e3ed52622728703237e50" }, + "headlines.nvim": { "branch": "master", "commit": "74a083a3c32a08be24f7dfcc6f448ecf47857f46" }, + "indent-blankline.nvim": { "branch": "master", "commit": "046e2cf04e08ece927bacbfb87c5b35c0b636546" }, + "lazy.nvim": { "branch": "main", "commit": "16603c6917435d8446f7357cb61095138a417085" }, + "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "40301e1c74bc0946eece13edf2b1c561cc497491" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "f0cd12f7a8a310c58cecebddb6b219ffad1cfd0f" }, + "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" }, + "mini.ai": { "branch": "main", "commit": "fc9ce93eb8d58ce1a39101928fb5ea8f8b97844c" }, + "mini.animate": { "branch": "main", "commit": "6e6f2ee99fec91985d3817bfc74fbb4a0aff1c44" }, + "mini.bufremove": { "branch": "main", "commit": "f53c7f27e36009fe61563c11cde154b94a0e5b94" }, + "mini.comment": { "branch": "main", "commit": "e4320af992cd053a7da2f33d9f63a86c2ab6ce59" }, + "mini.hipatterns": { "branch": "main", "commit": "00c9466b6bdfd556e0138fb28bf4906b0fd00dc9" }, + "mini.indentscope": { "branch": "main", "commit": "cbc07203ca8faae952ca373c1f6cc5881ce97af0" }, + "mini.pairs": { "branch": "main", "commit": "6f6bd7ed5757b40bc29c73dac0d743e4e6978124" }, + "mini.surround": { "branch": "main", "commit": "862cfaef72d789d320625ec34e2488a5cc8fd423" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "1236db954ce502eb5b340bcdb69aa057cc372e8d" }, + "neoconf.nvim": { "branch": "main", "commit": "00dcf2b81c45de1768b4171faa16729f0888cfb8" }, + "neodev.nvim": { "branch": "main", "commit": "7b46fd0f81c9c9ef5d5898879e86ae271152c79f" }, + "neotest": { "branch": "master", "commit": "901891484db3d46ce43d56871273dc7d40621356" }, + "neotest-jest": { "branch": "main", "commit": "65ab61c77aa1c245f16982ffe1a4d31589e18023" }, + "neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" }, + "neotest-rspec": { "branch": "main", "commit": "51a3b866d85733d2df2c6b5a16d75ce6ed2fbade" }, + "neotest-rust": { "branch": "main", "commit": "03e036a310379f132d4e39387e9076396132ce3f" }, + "neotest-vim-test": { "branch": "master", "commit": "75c4228882ae4883b11bfce9b8383e637eb44192" }, + "neotest-vitest": { "branch": "main", "commit": "41bf2f6b743f2ac5c5e9bd0949cee77ca7f2372c" }, + "noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" }, + "none-ls.nvim": { "branch": "main", "commit": "dc9b7e28f5573a1a2225ffb33893d23d3e052ed6" }, + "nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" }, + "nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, + "nvim-dap": { "branch": "master", "commit": "3eb26a63a3674e3722182a92f21d04c4e5ce0f43" }, + "nvim-dap-ruby": { "branch": "main", "commit": "fc15c7d50e557379e13f3a825bc58adcc7323cc3" }, + "nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "57f1dbd0458dd84a286b27768c142e1567f3ce3b" }, + "nvim-lint": { "branch": "master", "commit": "962a76877a4479a535b935bd7ef35ad41ba308b2" }, + "nvim-lspconfig": { "branch": "master", "commit": "cb49a4cd622d7ed775c31561bb8aa6a50712d6b9" }, + "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" }, + "nvim-spectre": { "branch": "master", "commit": "696cff781a4a7ecc91549736835e2acbd00fe859" }, + "nvim-treesitter": { "branch": "master", "commit": "3954741f2652fbcef9d6877d0e3a4d91d44b1632" }, + "nvim-treesitter-context": { "branch": "master", "commit": "8aa32aa6b84dda357849dbc0f775e69f2e04c041" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "e69a504baf2951d52e1f1fbb05145d43f236cbf1" }, + "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "92e688f013c69f90c9bbd596019ec10235bc51de" }, + "nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" }, + "persistence.nvim": { "branch": "main", "commit": "ad538bfd5336f1335cdb6fd4e0b0eebfa6e12f32" }, + "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, + "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, + "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, + "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, + "sqlite.lua": { "branch": "master", "commit": "b7e28c8463254c46a8e61c52d27d6a2040492fc3" }, + "statuscol.nvim": { "branch": "main", "commit": "98d02fc90ebd7c4674ec935074d1d09443d49318" }, + "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "6e51d0cd6447cf2525412220ff0a2885eef9039c" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, + "telescope-undo.nvim": { "branch": "main", "commit": "3dec002ea3e7952071d26fbb5d01e2038a58a554" }, + "telescope.nvim": { "branch": "master", "commit": "4522d7e3ea75ffddabdc39957168a8a7060b5df0" }, + "todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" }, + "toggleterm.nvim": { "branch": "main", "commit": "c80844fd52ba76f48fabf83e2b9f9b93273f418d" }, + "tokyonight.nvim": { "branch": "main", "commit": "f247ee700b569ed43f39320413a13ba9b0aef0db" }, + "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, + "tsc.nvim": { "branch": "main", "commit": "26d3c9010f3ef78fbecdfc69d901ab8ed89cff6c" }, + "typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" }, + "vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" }, + "vim-nightfly-guicolors": { "branch": "master", "commit": "9053e99131731f268258ab4d35d4841c3126ff9a" }, + "vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, + "yanky.nvim": { "branch": "main", "commit": "c1211c6c6d983a72c74dde44df8575a64d50562f" } +} \ No newline at end of file diff --git a/home/dot_config/nvim/lazyvim.json b/home/dot_config/nvim/lazyvim.json new file mode 100644 index 0000000..ff6a139 --- /dev/null +++ b/home/dot_config/nvim/lazyvim.json @@ -0,0 +1,9 @@ +{ + "extras": [ + + ], + "news": { + "NEWS.md": "2123" + }, + "version": 2 +} \ No newline at end of file diff --git a/home/dot_config/nvim/lua/config/autocmds.lua b/home/dot_config/nvim/lua/config/autocmds.lua new file mode 100644 index 0000000..27e9e06 --- /dev/null +++ b/home/dot_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/home/dot_config/nvim/lua/config/keymaps.lua b/home/dot_config/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..04a49e5 --- /dev/null +++ b/home/dot_config/nvim/lua/config/keymaps.lua @@ -0,0 +1,7 @@ +-- 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 +local Util = require('lazyvim.util') +vim.keymap.set('n', 'dd', function() + Util.terminal({ 'lazydocker' }, { cwd = Util.root() }) +end, { desc = 'Lazydocker' }) diff --git a/home/dot_config/nvim/lua/config/lazy.lua b/home/dot_config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..94b097e --- /dev/null +++ b/home/dot_config/nvim/lua/config/lazy.lua @@ -0,0 +1,63 @@ +local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' +if not 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 any extras modules here + { import = 'lazyvim.plugins.extras.lang.typescript' }, + { import = 'lazyvim.plugins.extras.lang.json' }, + { import = 'lazyvim.plugins.extras.ui.mini-animate' }, + { import = 'lazyvim.plugins.extras.linting.eslint' }, + { import = 'lazyvim.plugins.extras.test.core' }, + { import = 'lazyvim.plugins.extras.dap.core' }, + { import = 'lazyvim.plugins.extras.util.project' }, + { import = 'lazyvim.plugins.extras.formatting.prettier' }, + { import = 'lazyvim.plugins.extras.coding.copilot' }, + { import = 'lazyvim.plugins.extras.lang.tailwind' }, + { import = 'lazyvim.plugins.extras.lang.markdown' }, + { import = 'lazyvim.plugins.extras.lang.rust' }, + { import = 'lazyvim.plugins.extras.lang.ruby' }, + { import = 'lazyvim.plugins.extras.lang.yaml' }, + { import = 'lazyvim.plugins.extras.lang.docker' }, + { import = 'lazyvim.plugins.extras.lsp.none-ls' }, + { import = 'lazyvim.plugins.extras.util.mini-hipatterns' }, + { import = 'lazyvim.plugins.extras.util.dot' }, + { import = 'lazyvim.plugins.extras.coding.yanky' }, + { import = 'lazyvim.plugins.extras.lsp.none-ls' }, + -- 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 = { 'nightfly', '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/home/dot_config/nvim/lua/config/options.lua b/home/dot_config/nvim/lua/config/options.lua new file mode 100644 index 0000000..b4e77c5 --- /dev/null +++ b/home/dot_config/nvim/lua/config/options.lua @@ -0,0 +1,15 @@ +-- 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 +-- +vim.opt.listchars = { + space = '.', + eol = '↲', + nbsp = '␣', + trail = '·', + precedes = '←', + extends = '→', + tab = '¬ ', + conceal = '※', +} +vim.opt.list = true diff --git a/home/dot_config/nvim/lua/plugins/colorscheme.lua b/home/dot_config/nvim/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..9a37b34 --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/colorscheme.lua @@ -0,0 +1,10 @@ +return { + { 'bluz71/vim-nightfly-guicolors' }, + { + 'LazyVim/LazyVim', + opts = { + colorscheme = 'nightfly', + }, + }, + { 'norcalli/nvim-colorizer.lua', config = true }, +} diff --git a/home/dot_config/nvim/lua/plugins/diffview.lua b/home/dot_config/nvim/lua/plugins/diffview.lua new file mode 100644 index 0000000..5da9293 --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/diffview.lua @@ -0,0 +1,22 @@ +return { + + 'sindrets/diffview.nvim', + cmd = { 'DiffviewOpen', 'DiffviewFileHistory', 'DiffviewClose' }, + keys = { + { + 'gd', + function() + local lib = require('diffview.lib') + local view = lib.get_current_view() + if view then + -- Current tabpage is a Diffview; close it + vim.cmd(':DiffviewClose') + else + -- No open Diffview exists: open a new one + vim.cmd(':DiffviewOpen') + end + end, + desc = 'Diff view toggle', + }, + }, +} diff --git a/home/dot_config/nvim/lua/plugins/example.lua b/home/dot_config/nvim/lua/plugins/example.lua new file mode 100644 index 0000000..5290a9f --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/example.lua @@ -0,0 +1,265 @@ +-- 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 }, + + -- add symbols-outline + { + 'simrat39/symbols-outline.nvim', + cmd = 'SymbolsOutline', + keys = { { 'cs', 'SymbolsOutline', desc = 'Symbols Outline' } }, + config = true, + }, + + -- 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 telescope-fzf-native + { + 'telescope.nvim', + dependencies = { + 'nvim-telescope/telescope-fzf-native.nvim', + build = 'make', + config = function() + require('telescope').load_extension('fzf') + end, + }, + }, + + -- 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').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/home/dot_config/nvim/lua/plugins/icons.lua b/home/dot_config/nvim/lua/plugins/icons.lua new file mode 100644 index 0000000..8a6a908 --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/icons.lua @@ -0,0 +1,13 @@ +return { + 'nvim-tree/nvim-web-devicons', + config = function() + require('nvim-web-devicons').set_icon({ + gql = { + icon = '', + color = '#e535ab', + cterm_color = '199', + name = 'GraphQL', + }, + }) + end, +} diff --git a/home/dot_config/nvim/lua/plugins/lsp.lua b/home/dot_config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..2051303 --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,40 @@ +local get_root_dir = function(fname) + local util = require('lspconfig.util') + return util.root_pattern('.git')(fname) or util.root_pattern('package.json', 'tsconfig.json')(fname) +end + +return { + { + 'neovim/nvim-lspconfig', + dependencies = { + 'simrat39/rust-tools.nvim', + }, + opts = { + servers = { + rust_analyzer = {}, + eslint = { + root_dir = get_root_dir, + }, + tsserver = { + root_dir = get_root_dir, + }, + setup = { + rust_analyzer = function(_, opts) + require('rust-tools').setup({ server = opts }) + return true + end, + + eslint = function() + require('lazyvim.util').on_attach(function(client) + if client.name == 'eslint' then + client.server_capabilities.documentFormattingProvider = true + elseif client.name == 'tsserver' then + client.server_capabilities.documentFormattingProvider = false + end + end) + end, + }, + }, + }, + }, +} diff --git a/home/dot_config/nvim/lua/plugins/neotree.lua b/home/dot_config/nvim/lua/plugins/neotree.lua new file mode 100644 index 0000000..59b0709 --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/neotree.lua @@ -0,0 +1,58 @@ +return { + { + 'nvim-neo-tree/neo-tree.nvim', + branch = 'v3.x', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended + 'MunifTanjim/nui.nvim', + }, + config = function() + require('neo-tree').setup({ + filesystem = { + commands = { + -- Override delete to use trash instead of rm + delete = function(state) + local inputs = require('neo-tree.ui.inputs') + local path = state.tree:get_node().path + local msg = 'Are you sure you want to trash ' .. path + inputs.confirm(msg, function(confirmed) + if not confirmed then + return + end + + vim.fn.system({ 'trash', vim.fn.fnameescape(path) }) + require('neo-tree.sources.manager').refresh(state.name) + end) + end, + -- over write default 'delete_visual' command to 'trash' x n. + delete_visual = function(state, selected_nodes) + local inputs = require('neo-tree.ui.inputs') + + -- get table items count + function GetTableLen(tbl) + local len = 0 + for n in pairs(tbl) do + len = len + 1 + end + return len + end + + local count = GetTableLen(selected_nodes) + local msg = 'Are you sure you want to trash ' .. count .. ' files ?' + inputs.confirm(msg, function(confirmed) + if not confirmed then + return + end + for _, node in ipairs(selected_nodes) do + vim.fn.system({ 'trash', vim.fn.fnameescape(node.path) }) + end + require('neo-tree.sources.manager').refresh(state.name) + end) + end, + }, + }, + }) + end, + }, +} diff --git a/home/dot_config/nvim/lua/plugins/noice.lua b/home/dot_config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..667c65f --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/noice.lua @@ -0,0 +1,16 @@ +return { + 'folke/noice.nvim', + opts = { + presets = { + lsp_doc_border = true, + }, + lsp = { + progress = { + enabled = true, + }, + }, + messages = { + enabled = false, + }, + }, +} diff --git a/home/dot_config/nvim/lua/plugins/none-ls.lua b/home/dot_config/nvim/lua/plugins/none-ls.lua new file mode 100644 index 0000000..6b7bab0 --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/none-ls.lua @@ -0,0 +1,14 @@ +return { + 'nvimtools/none-ls.nvim', + opts = function(_, opts) + if type(opts.sources) == 'table' then + local nls = require('null-ls') + vim.list_extend(opts.sources, { + nls.builtins.code_actions.gomodifytags, + nls.builtins.code_actions.impl, + nls.builtins.formatting.gofumpt, + nls.builtins.formatting.goimports_reviser, + }) + end + end, +} diff --git a/home/dot_config/nvim/lua/plugins/notify.lua b/home/dot_config/nvim/lua/plugins/notify.lua new file mode 100644 index 0000000..8481c3a --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/notify.lua @@ -0,0 +1,11 @@ +return { + { + 'rcarriga/nvim-notify', + opts = { + -- background_colour = '#000000', + level = vim.log.levels.ERROR, -- help vim.log.levels + render = 'default', + stages = 'fade_in_slide_out', + }, + }, +} diff --git a/home/dot_config/nvim/lua/plugins/statuscol.lua b/home/dot_config/nvim/lua/plugins/statuscol.lua new file mode 100644 index 0000000..43c7509 --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/statuscol.lua @@ -0,0 +1,7 @@ +return { + -- https://github.com/luukvbaal/statuscol.nvim + { + 'luukvbaal/statuscol.nvim', + config = true, + }, +} diff --git a/home/dot_config/nvim/lua/plugins/super-tab.lua b/home/dot_config/nvim/lua/plugins/super-tab.lua new file mode 100644 index 0000000..c504de9 --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/super-tab.lua @@ -0,0 +1,51 @@ +return { + { + 'L3MON4D3/LuaSnip', + keys = function() + return {} + end, + }, + { + '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 + -- You could replace select_next_item() with confirm({ select = true }) to get VS Code autocompletion behavior + 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/home/dot_config/nvim/lua/plugins/telescope.lua b/home/dot_config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..8f92f57 --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,29 @@ +local Util = require('lazyvim.util') + +return { + { + 'nvim-telescope/telescope.nvim', + cmd = 'Telescope', + dependencies = { + 'nvim-lua/plenary.nvim', + 'debugloop/telescope-undo.nvim', + 'nvim-telescope/telescope-file-browser.nvim', + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, + }, + keys = { + { 'fR', Util.telescope('resume'), desc = 'Resume' }, + { + 'sB', + ':Telescope file_browser file_browser path=%:p:h=%:p:h', + desc = 'Browse Files', + }, + }, + config = function(_, opts) + local telescope = require('telescope') + telescope.setup(opts) + telescope.load_extension('undo') + telescope.load_extension('file_browser') + telescope.load_extension('fzf') + end, + }, +} diff --git a/home/dot_config/nvim/lua/plugins/test.lua b/home/dot_config/nvim/lua/plugins/test.lua new file mode 100644 index 0000000..3b00bf5 --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/test.lua @@ -0,0 +1,45 @@ +return { + { + 'nvim-neotest/neotest', + dependencies = { + 'haydenmeade/neotest-jest', + 'marilari88/neotest-vitest', + 'nvim-neotest/neotest-plenary', + 'nvim-neotest/neotest-vim-test', + 'rouge8/neotest-rust', + }, + 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-vitest')) + table.insert(opts.adapters, require('neotest-plenary')) + table.insert(opts.adapters, require('neotest-rust')) + table.insert(opts.adapters, require('neotest-jest')) + table.insert( + opts.adapters, + require('neotest-vim-test')({ + ignore_file_types = { 'python', 'vim', 'lua' }, + }) + ) + end, + }, +} diff --git a/home/dot_config/nvim/lua/plugins/treesitter.lua b/home/dot_config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..a4451f7 --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,31 @@ +vim.treesitter.language.register('markdown', 'mdx') +return { + { + 'nvim-treesitter/nvim-treesitter', + opts = function(_, opts) + vim.list_extend(opts.ensure_installed, { + 'bash', + 'css', + 'dockerfile', + 'graphql', + 'html', + 'javascript', + 'json', + 'lua', + 'luadoc', + 'markdown', + 'markdown_inline', + 'regex', + 'ruby', + 'rust', + 'scss', + 'toml', + 'tsx', + 'typescript', + 'yaml', + 'vimdoc', + }) + end, + }, + { 'nvim-treesitter/playground' }, +} diff --git a/home/dot_config/nvim/lua/plugins/typescript.lua b/home/dot_config/nvim/lua/plugins/typescript.lua new file mode 100644 index 0000000..63743a1 --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/typescript.lua @@ -0,0 +1,47 @@ +return { + { + 'neovim/nvim-lspconfig', + dependencies = { 'jose-elias-alvarez/typescript.nvim' }, + opts = { + servers = { + tsserver = { + settings = { + typescript = { + inlayHints = { + -- taken from https://github.com/typescript-language-server/typescript-language-server#workspacedidchangeconfiguration + includeInlayEnumMemberValueHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayFunctionParameterTypeHints = true, + includeInlayParameterNameHints = 'all', + includeInlayParameterNameHintsWhenArgumentMatchesName = true, -- false + includeInlayPropertyDeclarationTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayVariableTypeHintsWhenTypeMatchesName = true, -- false + }, + }, + javascript = { + inlayHints = { + includeInlayEnumMemberValueHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayFunctionParameterTypeHints = true, + includeInlayParameterNameHints = 'all', + includeInlayParameterNameHintsWhenArgumentMatchesName = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayVariableTypeHintsWhenTypeMatchesName = true, + }, + }, + }, + }, + }, + }, + }, + { + 'dmmulroy/tsc.nvim', + config = true, + cmd = 'TSC', + keys = { + { 'tc', 'TSC', desc = 'Type-check' }, + }, + }, +} diff --git a/home/dot_config/nvim/stylua.toml b/home/dot_config/nvim/stylua.toml new file mode 100644 index 0000000..a14776f --- /dev/null +++ b/home/dot_config/nvim/stylua.toml @@ -0,0 +1,4 @@ +indent_type = "Spaces" +indent_width = 2 +column_width = 120 +quote_style = "AutoPreferSingle" diff --git a/home/dot_config/zsh/dot_zsh_aliases.zsh b/home/dot_config/zsh/dot_zsh_aliases.zsh index a61ea29..b9317a7 100644 --- a/home/dot_config/zsh/dot_zsh_aliases.zsh +++ b/home/dot_config/zsh/dot_zsh_aliases.zsh @@ -1,13 +1,15 @@ +alias vim="nvim" alias npmplease="rm -rf node_modules/ && rm -f package-lock.json && npm install" alias pnpmplease="rm -rf node_modules/ && rm -f pnpm-lock.yaml && pnpm install" alias yarnplease="rm -rf node_modules/ && rm -f yarn.lock && yarn install" -alias npmconfig="subl -n -w ~/.npmrc" -alias yarnconfig="subl -n -w ~/.yarnrc" -alias zshconfig="subl -n -w $ZDOTDIR/.zshrc" +alias npmconfig="vim ~/.npmrc" +alias yarnconfig="vim ~/.yarnrc" +alias zshconfig="vim $ZDOTDIR/.zshrc" alias zshreset="source $ZDOTDIR/.zshrc" -alias bashconfig="subl -n -w ~/.bashrc" -alias gitconfig="subl -n -w ~/.gitconfig" -alias hostsconfig="sudo subl -n -w /private/etc/hosts" +alias bashconfig="vim ~/.bashrc" +alias gitconfig="vim ~/.config/git/config" +alias gitconfig-work="vim ~/.config/git/config-work" +alias hostsconfig="sudo vim /private/etc/hosts" alias python="python3" alias g="git" alias dcu="docker compose up -d" @@ -48,4 +50,4 @@ if [ "$(command -v exa)" ]; then unalias -m 'ls' alias ls='exa -G --color auto -a -s type' alias ll='exa -l --color always -a -s type' -fi \ No newline at end of file +fi diff --git a/home/dot_config/zsh/dot_zshrc b/home/dot_config/zsh/dot_zshrc index abd9ec4..51dad65 100644 --- a/home/dot_config/zsh/dot_zshrc +++ b/home/dot_config/zsh/dot_zshrc @@ -124,7 +124,7 @@ source $ZSH/oh-my-zsh.sh # else # export EDITOR='mvim' # fi -export EDITOR='subl -n -w' +export EDITOR='vim' # Compilation flags # export ARCHFLAGS="-arch x86_64"