diff --git a/kitty/kitty.conf b/kitty/kitty.conf index 6c02c4f..711883b 100644 --- a/kitty/kitty.conf +++ b/kitty/kitty.conf @@ -3,7 +3,7 @@ window_alert_on_bell no background_opacity 0.8 cursor_blink_interval 0 -background #1a1b26 +background #1a1b25 foreground #c5c8c6 selection_background #b2ceee @@ -13,7 +13,7 @@ selection_background #33467c selection_foreground #c0caf5 url_color #73daca cursor #c0caf5 -cursor_text_color #1a1b26 +cursor_text_color #1a1b25 # Tabs active_tab_background #7aa2f7 diff --git a/nvim/.gitignore b/nvim/.gitignore new file mode 100644 index 0000000..cc5457a --- /dev/null +++ b/nvim/.gitignore @@ -0,0 +1,8 @@ +tt.* +.tests +doc/tags +debug +.repro +foo.* +*.log +data diff --git a/nvim/.luarc.json b/nvim/.luarc.json deleted file mode 100644 index c609932..0000000 --- a/nvim/.luarc.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", - "Lua.diagnostics.globals": [ - "termid", - "global" - ], - "Lua.workspace.library": [ - "${3rd}/luassert/library", - "${3rd}/luv/library" - ] -} \ No newline at end of file diff --git a/nvim/.neoconf.json b/nvim/.neoconf.json new file mode 100644 index 0000000..aa1b504 --- /dev/null +++ b/nvim/.neoconf.json @@ -0,0 +1,15 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "sumneko_lua": { + "enabled": true + } + } + } +} diff --git a/nvim/LICENSE b/nvim/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/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/nvim/README.md b/nvim/README.md index 5580008..185280b 100644 --- a/nvim/README.md +++ b/nvim/README.md @@ -1,141 +1,4 @@ -# List of keymaps +# 💤 LazyVim -## Space as leader - -## Debugging -| key | Description | -| --- | ------------------------- | -| F5 | toggle breakpoint | -| F6 | step over breakpoint | -| F7 | step into breakpoint | -| F8 | start debugging | -| F9 | continue from breakpoint | -| F10 | close debug UI | - -## Nerd Tree -| key | Description | -| --- | ------------------------- | -| f |toggle open | -| a |create new file | -| d |remove file | -| r |rename file | -| y |copy name | -| Y |copy path | -| x |cut file | -| c |copy file | -| p |paste file | -| f |filter (inside nvim tree) | -| E |expand all folders | -| W |collapse all folders | - -## buffer switching -| key | Description | -| --- | ------------------------- | -| F1 | next buffer (cycles) | -| F2 | previous buffer (cycles) | - -## formatting -| key | Description | -| --- | ------------------------- | -| F4 | format this file | - -## telescope -| key | Description | -| --- | ------------------------- | -| ff | find files | -| fg | live ripgrep | -| fb | find buffers | -| fh | help for functions etc | -| fp | find projects | -| fb | file browser | - -### telescope git -| key | Description | -| ---------- | ------------------------- | -| gq | show commits | -| gw | show commits with diff | -| ge | show branches | -| gr | show git status | -| ga | show git stash | - -### project telescope - -
normal mode insert mode
- -| key | Description | -| --- | --------------------------------- | -| d | delete project | -| r | rename project | -| c | create project | -| s | search files in project | -| b | browse files in project | -| w | change directory to project | -| R | recently opened files in project | -| f | find file within project | - - -| key | Description | -| -------- | --------------------------------- | -| Ctrl + d | delete project | -| Ctrl + v | rename project | -| Ctrl + a | create project | -| Ctrl + s | search files in project | -| Ctrl + b | browse files in project | -| Ctrl + l | change directory to project | -| Ctrl + r | recently opened files in project | -| Ctrl + f | find file within project | - -
- - -## toggletrouble -| key | Description | -| -------- | ------------------------- | -| Ctrl + f | show errors and warnings | - -## cmp -Note, these require the cmp list view to be open to do anything! -| key | Description | -| ----------- | --------------------------------------------------------- | -| Ctrl + b | scroll docs up | -| Ctrl + f | scroll docs down | -| Ctrl + e | cancel cmp | -| Enter | write selected suggestion (does nothing if not selected) | -| Tab |scroll down through suggestion list | -| Shift + Tab | scroll up through suggestion list | - -## LSP -| key | Description | -| ----------- | ---------------------- | -| Leader + a | go to declaration | -| Leader + s | go to definition | -| Leader + d | go to type definitions | -| Leader + f | go to references | -| Leader + q | execute code actions | -| Leader + w | signature help | -| Leader + e | hover | -| Leader + r | rename | - -## snippets -These require you to be inside a snippet! -| key | Description | -| -------- | ------------------------- | -| Ctrl + j | jump to next entry | -| Ctrl + k | jump to previous entry | - -## Leap -| key | Description | -| -------- | ------------------------------------------------------ | -| s | followed by 2 other characters and the marker to jump | - -## Dashboard -only available on dashboard -| key | Description | -| --- | ------------------------- | -| f | file | -| e | new file | -| p | find project | -| r | recently used files | -| t | find text | -| c | open config | -| q | quit | +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/nvim/init.lua b/nvim/init.lua index 55ccf34..2514f9e 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,36 +1,2 @@ -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 --- -require("settings.plugins") -require("settings.options") -require("settings.cmp") -require("settings.lsp") -require("settings.devicons") -require("settings.treesitter") -require("settings.nvim-tree") -require("settings.pairs") -require("settings.indentline") -require("settings.project") -require("settings.dashboard") -require("settings.rainbow") -require("settings.dap") -require("settings.autocommands") -require("settings.telescope") -require("settings.vimtex") -require("settings.keymaps") -require("settings.barbar") --- --- -- simple plugins that don't make sense to put in a seperate file, would clutter too much -require("gitsigns").setup() -require("feline").setup() -require("impatient").enable_profile() -require('Comment').setup() -require("toggleterm").setup({ - autochdir = true, -}) -require('leap').add_default_mappings() -require("nvim-highlight-colors").setup { - render = 'background', -- or 'foreground' or 'first_column' - enable_named_colors = true, - enable_tailwind = true, -} +-- bootstrap lazy.nvim, LazyVim and your plugins +require("config.lazy") diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..b685fe4 --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,64 @@ +{ + "LazyVim": { "branch": "main", "commit": "befa6c67a4387b0db4f8421d463f5d03f91dc829" }, + "LuaSnip": { "branch": "master", "commit": "d33cf7de14eea209b8ed4a7edaed72f0b8cedb30" }, + "alpha-nvim": { "branch": "main", "commit": "c46c0c82d528835949edbf08dc1c6f69c0091dd9" }, + "bufferline.nvim": { "branch": "main", "commit": "cbb798dd2db7841550cd2c6c6dde12dfda055928" }, + "catppuccin": { "branch": "main", "commit": "4175759297350557315987d479fb687a9f0b781f" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, + "dressing.nvim": { "branch": "master", "commit": "db716a0f1279f79a886c0e0b6ab3c3d5ffdb42fe" }, + "editorconfig.nvim": { "branch": "master", "commit": "5b9e303e1d6f7abfe616ce4cc8d3fffc554790bf" }, + "flit.nvim": { "branch": "main", "commit": "980e80e8fe44caaeb9de501c8e97a559b17db2f4" }, + "friendly-snippets": { "branch": "main", "commit": "6fa50a94ba5378bb73013a6e163376d8e69bd8a5" }, + "gitsigns.nvim": { "branch": "main", "commit": "f388995990aba04cfdc7c3ab870c33e280601109" }, + "harpoon": { "branch": "master", "commit": "fa3d8f725ab658dd2a9d4ab66f245c874431662c" }, + "indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" }, + "lazy.nvim": { "branch": "main", "commit": "8077428e63feb0f3bf795d53b23ba1695b28ab0e" }, + "leap.nvim": { "branch": "main", "commit": "9a69febb2e5a4f5f5a55dd2d7173098fde917bc5" }, + "lsp-inlayhints.nvim": { "branch": "main", "commit": "84ca3abe8aaecbb5b30ad89e4701d4a9c821b72c" }, + "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, + "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "93e58e100f37ef4fb0f897deeed20599dae9d128" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "6b5b5fc42176e0ca1d3634a516cc9b4e5fcc8117" }, + "mason.nvim": { "branch": "main", "commit": "5b9fd3822d686092c7ee08adfcbd2c764def22c5" }, + "mini.ai": { "branch": "main", "commit": "d50b4d87e38d21ca2c5facee9f8a205ddb768358" }, + "mini.bufremove": { "branch": "main", "commit": "351d18d596f7eac4589b67b4b87ed1708c545dd3" }, + "mini.comment": { "branch": "main", "commit": "9fc3fe43129e8c2611bd21b8f50af8c0d0742533" }, + "mini.indentscope": { "branch": "main", "commit": "d3e907b13298b0fc60db289fb804be7e9c561922" }, + "mini.pairs": { "branch": "main", "commit": "4ebc1ff8d77fe75e8f219432302800ca29e17614" }, + "mini.surround": { "branch": "main", "commit": "6a4f31e2a380439315729f561d7e7898bde1fd52" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "74040b34278910d9b467fd914862e2a9a1ebacaa" }, + "neoconf.nvim": { "branch": "main", "commit": "e29ccd3064837e4b20e318c25d8f3c146663ffbc" }, + "neodev.nvim": { "branch": "main", "commit": "6d362921d772963e5a5e5ed0fcf82153defaf206" }, + "noice.nvim": { "branch": "main", "commit": "d8a1f3056ad713b5d471048f8d029264828e22c0" }, + "nui.nvim": { "branch": "main", "commit": "d147222a1300901656f3ebd5b95f91732785a329" }, + "null-ls.nvim": { "branch": "main", "commit": "689cdd78f70af20a37b5309ebc287ac645ae4f76" }, + "nvim-cmp": { "branch": "main", "commit": "ba7a53478d0726683d1597ad1e814695033dcb4b" }, + "nvim-dap": { "branch": "master", "commit": "fd291e970aa7c46ba2c49448f7d2c94cc7828f4e" }, + "nvim-dap-ui": { "branch": "master", "commit": "bf9f0c4768ce8cb99ac0b99cf06ae6f91c906a1a" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "8db23ea51203b5f00ad107a0cef7e0b2d7a0476c" }, + "nvim-highlight-colors": { "branch": "main", "commit": "af051bfe2971fc888d21cdfc59f5444904353b43" }, + "nvim-lspconfig": { "branch": "master", "commit": "91998cef4b1ae3a624901d0f9c894409db24e760" }, + "nvim-navic": { "branch": "master", "commit": "7e9d2b2b601149fecdccd11b516acb721e571fe6" }, + "nvim-notify": { "branch": "master", "commit": "bdd647f61a05c9b8a57c83b78341a0690e9c29d7" }, + "nvim-spectre": { "branch": "master", "commit": "ce73d505fdc45f16c1a04f6a98c1c1e114841708" }, + "nvim-treesitter": { "branch": "master", "commit": "ba35d094c1dfffa652e9c20971c51bd5271c1d25" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "2f3583001e2bf793480f38cf0d055571787b0259" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "a0f89563ba36b3bacd62cf967b46beb4c2c29e52" }, + "nvim-web-devicons": { "branch": "master", "commit": "4709a504d2cd2680fb511675e64ef2790d491d36" }, + "persistence.nvim": { "branch": "main", "commit": "d8a3eda0e19b4d5f3180fc832c25baab1709f2a1" }, + "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" }, + "telescope-project.nvim": { "branch": "master", "commit": "8e8ee37b7210761502cdf2c3a82b5ba8fb5b2972" }, + "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" }, + "telescope.nvim": { "branch": "master", "commit": "a486ac3e8fb2198f3636da1927ed57a28836fbd8" }, + "todo-comments.nvim": { "branch": "main", "commit": "74c7d28cb50b0713c881ef69bcb6cdd77d8907d1" }, + "toggleterm.nvim": { "branch": "main", "commit": "1f47ea9cda973af3f1742a71841f3914f5b1469f" }, + "tokyonight.nvim": { "branch": "main", "commit": "a0abe53df53616d13da327636cb0bcac3ea7f5af" }, + "trouble.nvim": { "branch": "main", "commit": "3b754285635a66a93aeb15fa71a23417d8997217" }, + "vim-illuminate": { "branch": "master", "commit": "49062ab1dd8fec91833a69f0a1344223dd59d643" }, + "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, + "vim-startuptime": { "branch": "master", "commit": "6580cf539c33a212f4f5542068a3b4dd2b3ad834" }, + "which-key.nvim": { "branch": "main", "commit": "5224c261825263f46f6771f1b644cae33cd06995" } +} \ No newline at end of file diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua new file mode 100644 index 0000000..27e9e06 --- /dev/null +++ b/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/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..3457fe7 --- /dev/null +++ b/nvim/lua/config/keymaps.lua @@ -0,0 +1,92 @@ +-- maps are automatically loaded on the VeryLazy event +-- Default maps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/maps.lua +-- Add any additional maps here + +local Util = require("lazyvim.util") + +local function map(mode, lhs, rhs, opts) + local keys = require("lazy.core.handler").handlers.keys + ---@cast keys LazyKeysHandler + -- do not create the map if a lazy keys handler exists + if not keys.active[keys.parse({ lhs, mode = mode }).id] then + opts = opts or {} + opts.silent = opts.silent ~= false + vim.keymap.set(mode, lhs, rhs, opts) + end +end +local opts = { noremap = true, silent = true } +local term_opts = { silent = true } + +-- debug +map("n", "", ':lua require("dap").toggle_breakpoint()', opts) +map("n", "", ':lua require("dap").step_over()', opts) +map("n", "", ':lua require("dap").step_into()', opts) +map("n", "", ':lua require("dapui").toggle() :lua require("dap").continue() ', opts) +map("n", "", ':lua require("dap").continue()', opts) +map("n", "", ':lua require("dap").close() :lua require("dapui").toggle()', opts) + +-- file tree +map("n", "f", ":Neotree action=focus toggle=true", opts) + +-- toggle terminal +map("n", "", ":lua require('toggleterm').toggle(1)", opts) + +-- tab switching +map("n", "", ":BufferPrev", opts) +map("n", "", ":BufferNext", opts) + +-- formatting +map("n", "", ":lua vim.lsp.buf.format { async = true }", opts) +map("n", "a", ":Telescope lsp_definitions", opts) +map("n", "s", ":Telescope lsp_references", opts) +map("n", "d", ":Telescope lsp_type_definitions", opts) +map("n", "f", ":Telescope lsp_implementations", opts) +map("n", "q", ":lua vim.lsp.buf.code_action()", opts) +map("n", "w", ":lua vim.lsp.buf.signature_help()", opts) +map("n", "e", ":lua vim.lsp.buf.hover()", opts) +map("n", "r", ":lua vim.lsp.buf.rename()", opts) +map("n", "gq", ":lua require('telescope.builtin').git_commits()", opts) +map("n", "gw", ":lua require('telescope.builtin').git_bcommits()", opts) +map("n", "ge", ":lua require('telescope.builtin').git_branches()", opts) +map("n", "gr", ":lua require('telescope.builtin').git_status()", opts) +map("n", "ga", ":lua require('telescope.builtin').git_stash()", opts) + +-- window switching +function _G.set_terminal_maps() + local opts = { buffer = 0 } + vim.keymap.set("t", "", [[]], opts) + vim.keymap.set("t", "jk", [[]], opts) + vim.keymap.set("t", "", [[wincmd h]], opts) + vim.keymap.set("t", "", [[wincmd j]], opts) + vim.keymap.set("t", "", [[wincmd k]], opts) + vim.keymap.set("t", "", [[wincmd l]], opts) +end + +-- if you only want these mappings for toggle term use term://*toggleterm#* instead +vim.cmd("autocmd! TermOpen term://* lua set_terminal_maps()") +map("n", "", ":wincmd h", opts) +map("n", "", ":wincmd j", opts) +map("n", "", ":wincmd k", opts) +map("n", "", ":wincmd l", opts) + +-- harpoon man + +map("n", "", ":lua require('harpoon.ui').nav_file(1)", opts) +map("n", "", ":lua require('harpoon.ui').nav_file(2)", opts) +map("n", "", ":lua require('harpoon.ui').nav_file(3)", opts) +map("n", "fma", ":lua require('harpoon.mark').add_file()", opts) +map("n", "fmd", ":lua require('harpoon.mark').remove_file()", opts) + +-- telescope +map("n", "fb", ":Telescope file_browser", {}) +map("n", "fc", ":Cheatsheet", {}) +map("n", "ff", ":lua require('telescope.builtin').find_files()", {}) +map("n", "fg", ":lua require('telescope.builtin').live_grep()", {}) +map("n", "fh", ":lua require('telescope.builtin').help_tags()", {}) +map("n", "fp", ":lua require'telescope'.extensions.project.project{}", { noremap = true, silent = true }) +map("n", "fm", ":Telescope harpoon marks", { noremap = true, silent = true }) + +vim.keymap.set("n", "z", ":lua require('telescope').extensions.zoxide.list{}") + +-- trouble +map("n", "", "TroubleToggle", term_opts) diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..891b190 --- /dev/null +++ b/nvim/lua/config/lazy.lua @@ -0,0 +1,46 @@ +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/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/nvim/lua/config/options.lua b/nvim/lua/config/options.lua new file mode 100644 index 0000000..089baa5 --- /dev/null +++ b/nvim/lua/config/options.lua @@ -0,0 +1,20 @@ +-- 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 +local options = { + clipboard = "unnamedplus", + mouse = "n", + fileencoding = "utf-8", + number = true, + showmode = true, + termguicolors = true, + spelllang = "en_us", + shell = "/usr/bin/zsh", + autochdir = true, +} + +vim.g.mkdp_browser = "/usr/bin/firefox" +vim.g.mkdp_auto_start = 1 +for k, v in pairs(options) do + vim.opt[k] = v +end diff --git a/nvim/lua/plugins/dap.lua b/nvim/lua/plugins/dap.lua new file mode 100644 index 0000000..1ca2b55 --- /dev/null +++ b/nvim/lua/plugins/dap.lua @@ -0,0 +1,137 @@ +return { + { + "mfussenegger/nvim-dap", + dependencies = { + "rcarriga/nvim-dap-ui", + "theHamsta/nvim-dap-virtual-text", + "jayp0521/mason-nvim-dap.nvim", + }, + config = function() + local dap = require("dap") + dap.adapters.lldb = { + type = "executable", + command = "/usr/bin/lldb-vscode", + name = "lldb", + } + + local rust_dap = vim.fn.getcwd() + local filename = "" + for w in rust_dap:gmatch("([^/]+)") do + filename = w + end + + dap.configurations.rust = { + { + type = "lldb", + request = "launch", + program = function() + return rust_dap .. "/target/debug/" .. filename + end, + --program = '${fileDirname}/${fileBasenameNoExtension}', + cwd = "${workspaceFolder}", + stopOnEntry = true, + terminal = "integrated", + }, + } + + dap.configurations.cpp = { + { + name = "debug cpp", + type = "lldb", + request = "launch", + program = function() + return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/build/", "file") + end, + cwd = "${workspaceFolder}", + stopOnEntry = true, + terminal = "integrated", + }, + } + dap.configurations.c = dap.configurations.cpp + + require("dapui").setup({ + icons = { expanded = "▾", collapsed = "▸", current_frame = "▸" }, + mappings = { + -- Use a table to apply multiple mappings + expand = { "", "<2-LeftMouse>" }, + open = "o", + remove = "d", + edit = "e", + repl = "r", + toggle = "t", + }, + -- Expand lines larger than the window + -- Requires >= 0.7 + expand_lines = vim.fn.has("nvim-0.7") == 1, + -- Layouts define sections of the screen to place windows. + -- The position can be "left", "right", "top" or "bottom". + -- The size specifies the height/width depending on position. It can be an Int + -- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while + -- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns) + -- Elements are the elements shown in the layout (in order). + -- Layouts are opened in order so that earlier layouts take priority in window sizing. + layouts = { + { + elements = { + -- Elements can be strings or table with id and size keys. + { id = "scopes", size = 0.25 }, + "breakpoints", + "stacks", + "watches", + }, + size = 40, -- 40 columns + position = "left", + }, + { + elements = { + "repl", + "console", + }, + size = 0.25, -- 25% of total lines + position = "bottom", + }, + }, + controls = { + -- Requires Neovim nightly (or 0.8 when released) + enabled = true, + -- Display controls in this element + element = "repl", + icons = { + pause = "", + play = "", + step_into = "", + step_over = "", + step_out = "", + step_back = "", + run_last = "↻", + terminate = "□", + }, + }, + floating = { + max_height = nil, -- These can be integers or a float between 0 and 1. + max_width = nil, -- Floats will be treated as percentage of your screen. + border = "single", -- Border style. Can be "single", "double" or "rounded" + mappings = { + close = { "q", "" }, + }, + }, + windows = { indent = 1 }, + render = { + max_type_length = nil, -- Can be integer or nil. + max_value_lines = 100, -- Can be integer or nil. + }, + }) + + require("mason-nvim-dap").setup({ + ensure_installed = { + "bash-debug-adapter", + "firefox-debug-adapter", + "js-debug-adapter", + "node-debug2-adapter", + }, + }) + + require("nvim-dap-virtual-text").setup() + end, + }, +} diff --git a/nvim/lua/plugins/dashboard.lua b/nvim/lua/plugins/dashboard.lua new file mode 100644 index 0000000..98bd50d --- /dev/null +++ b/nvim/lua/plugins/dashboard.lua @@ -0,0 +1,73 @@ +return { + { + "goolord/alpha-nvim", + event = "VimEnter", + opts = function() + local status_ok, alpha = pcall(require, "alpha") + if not status_ok then + return + end + + local dashboard = require("alpha.themes.dashboard") + dashboard.section.header.val = { + [[ _______ ___ _______. __ __ __ _______ ]], + [[| \ / \ / || | | | | | | ____|]], + [[| .--. | / ^ \ | (----`| |__| | | | | |__ ]], + [[| | | | / /_\ \ \ \ | __ | | | | __| ]], + [[| '--' | / _____ \ .----) | | | | | | | | |____ ]], + [[|_______/ /__/ \__\ |_______/ |__| |__| |__| |_______|]], + } + dashboard.section.buttons.val = { + dashboard.button("f", " Find file", ":lua require('telescope.builtin').find_files()"), + dashboard.button( + "b", + " Open File Browser", + ":lua require('telescope').extensions.file_browser.file_browser{}" + ), + dashboard.button("e", " New file", ":ene startinsert "), + dashboard.button("p", " Find project", ":lua require('telescope').extensions.project.project{}"), + dashboard.button("r", " Recently used files", ":lua require('telescope.builtin').oldfiles() "), + dashboard.button("t", " Zoxide", ":lua require('telescope').extensions.zoxide.list{}"), + dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua "), + dashboard.button("q", " Quit Neovim", ":qa"), + } + + local function footer() + return "dashie@dashie.org" + end + + dashboard.section.footer.val = footer() + + dashboard.section.footer.opts.hl = "Type" + dashboard.section.header.opts.hl = "Include" + dashboard.section.buttons.opts.hl = "Keyword" + + dashboard.opts.opts.noautocmd = true + alpha.setup(dashboard.opts) + end, + config = function(_, dashboard) + -- close Lazy and re-open when the dashboard is ready + if vim.o.filetype == "lazy" then + vim.cmd.close() + vim.api.nvim_create_autocmd("User", { + pattern = "AlphaReady", + callback = function() + require("lazy").show() + end, + }) + end + + require("alpha").setup(dashboard.opts) + + 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) + dashboard.section.footer.val = "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" + pcall(vim.cmd.AlphaRedraw) + end, + }) + end, + }, +} diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..64b754b --- /dev/null +++ b/nvim/lua/plugins/lsp.lua @@ -0,0 +1,145 @@ +return { + { + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + { "folke/neoconf.nvim", cmd = "Neoconf", config = true }, + { "folke/neodev.nvim", opts = { experimental = { pathStrict = true } } }, + "mason.nvim", + "williamboman/mason-lspconfig.nvim", + "lvimuser/lsp-inlayhints.nvim", + { + "hrsh7th/cmp-nvim-lsp", + cond = function() + return require("lazyvim.util").has("nvim-cmp") + end, + }, + }, + ---@class PluginLspOpts + opts = { + -- options for vim.diagnostic.config() + diagnostics = { + underline = true, + update_in_insert = false, + virtual_text = { spacing = 4, prefix = "●" }, + severity_sort = true, + }, + -- Automatically format on save + autoformat = true, + -- 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 = { + jsonls = {}, + lua_ls = { + -- mason = false, -- set to false if you don't want this server to be installed with mason + settings = { + Lua = { + workspace = { + checkThirdParty = false, + }, + 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(plugin, opts) + -- setup autoformat + require("lazyvim.plugins.lsp.format").autoformat = opts.autoformat + -- setup formatting and keymaps + require("lazyvim.util").on_attach(function(client, buffer) + require("lazyvim.plugins.lsp.format").on_attach(client, buffer) + require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) + end) + + -- diagnostics + for name, icon in pairs(require("lazyvim.config").icons.diagnostics) do + name = "DiagnosticSign" .. name + vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) + end + vim.diagnostic.config(opts.diagnostics) + + require("lsp-inlayhints").setup({}) + local servers = opts.servers + local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) + local on_attach = function(client, bufnr) + vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") + local optslsp = { noremap = false, silent = true, buffer = bufnr } + require("lsp-inlayhints").on_attach(client, bufnr) + end + + local function setup(server) + local server_opts = vim.tbl_deep_extend("force", { + capabilities = vim.deepcopy(capabilities), + on_attach = on_attach, + vim.lsp.diagnostic.on_publish_diagnostics, + { + -- Disable virtual_text + virtual_text = true, + }, + }, 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 + + -- temp fix for lspconfig rename + -- https://github.com/neovim/nvim-lspconfig/pull/2439 + local mappings = require("mason-lspconfig.mappings.server") + if not mappings.lspconfig_to_package.lua_ls then + mappings.lspconfig_to_package.lua_ls = "lua-language-server" + mappings.package_to_lspconfig["lua-language-server"] = "lua_ls" + end + + local mlsp = require("mason-lspconfig") + local available = mlsp.get_available_servers() + + 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(available, server) then + setup(server) + else + ensure_installed[#ensure_installed + 1] = server + end + end + end + + require("mason-lspconfig").setup({ ensure_installed = ensure_installed }) + require("mason-lspconfig").setup_handlers({ setup }) + vim.cmd([[highlight LspInlayHint guibg=#192330]]) + end, + }, +} diff --git a/nvim/lua/plugins/plugins.lua b/nvim/lua/plugins/plugins.lua new file mode 100644 index 0000000..6c379eb --- /dev/null +++ b/nvim/lua/plugins/plugins.lua @@ -0,0 +1,78 @@ +return { + { + "LazyVim/LazyVim", + opts = { + colorscheme = "tokyonight-night", + }, + }, + { + "akinsho/toggleterm.nvim", + }, + { + "brenoprata10/nvim-highlight-colors", + config = function(_, _) + require("nvim-highlight-colors").setup() + vim.cmd(":hi clear CursorLine") + vim.cmd(":hi clear CursorLineFold") + vim.cmd(":hi clear CursorLineSign") + end, + }, + { + "gpanders/editorconfig.nvim", + }, + { + "lvimuser/lsp-inlayhints.nvim", + }, + { + "ThePrimeagen/harpoon", + config = function() + require("telescope").load_extension("harpoon") + end, + }, + { + "iamcco/markdown-preview.nvim", + }, + { + "nvim-telescope/telescope-project.nvim", + }, + { + "nvim-telescope/telescope-file-browser.nvim", + config = function() + require("telescope").load_extension("file_browser") + end, + }, + { + "jvgrootveld/telescope-zoxide", + config = function() + local z_utils = require("telescope._extensions.zoxide.utils") + local t = require("telescope") + -- Configure the extension + t.setup({ + extensions = { + zoxide = { + prompt_title = "[ Queries ]", + mappings = { + default = { + after_action = function(selection) + print("Update to (" .. selection.z_score .. ") " .. selection.path) + end, + }, + [""] = { + before_action = function(selection) + print("before C-s") + end, + action = function(selection) + vim.cmd("edit " .. selection.path) + end, + }, + [""] = { action = z_utils.create_basic_command("split") }, + }, + }, + }, + }) + + -- Load the extension + t.load_extension("zoxide") + end, + }, +} diff --git a/nvim/lua/settings/.prettierrc b/nvim/lua/settings/.prettierrc deleted file mode 100644 index e524ddd..0000000 --- a/nvim/lua/settings/.prettierrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "trailingComma": "all", - "tabWidth": 4, - "semi": true, - "singleQuote": true -} diff --git a/nvim/lua/settings/autocommands.lua b/nvim/lua/settings/autocommands.lua deleted file mode 100644 index 23e4c35..0000000 --- a/nvim/lua/settings/autocommands.lua +++ /dev/null @@ -1,34 +0,0 @@ -vim.cmd('let g:vimtex_view_general_viewer = "evince"') -vim.cmd('let g:vimtex_compiler_method = "latexmk"') - --- colorscheme -local options = { - transparent = false, -} -local palettes = { - nightfox = { - bg1 = "#1A1B27", - }, -} -require("nightfox").setup({ - palettes = palettes, - options = options, -}) -vim.cmd("colorscheme nightfox") - -vim.cmd([[highlight TabLineSel guifg=#192330 guibg=#192330]]) -vim.cmd([[highlight BufferCurrent guifg=#FFFFFF guibg=#192330]]) -vim.cmd([[highlight BufferCurrentIndex guifg=#FFFFFF guibg=#192330]]) -vim.cmd([[highlight BufferCurrentMod guifg=#dbc074 guibg=#192330]]) -vim.cmd([[highlight BufferCurrentSign guifg=#719cd6 guibg=#192330]]) -vim.cmd([[highlight BufferCurrentTarget guifg=#c94f6d guibg=#192330]]) -vim.cmd([[highlight BufferInactive guifg=#888888 guibg=#131a24]]) -vim.cmd([[highlight BufferInactiveMod guifg=#dbc074 guibg=#131a24]]) -vim.cmd([[highlight BufferInactiveSign guifg=#719cd6 guibg=#131a24]]) - -vim.cmd([[highlight LspInlayHint guibg=#192330]]) -vim.cmd(":syntax off") -vim.cmd([[highlight CursorLine guibg=#1A1B27]]) -vim.cmd([[highlight CursorLineSign guibg=#1A1B27]]) -vim.cmd([[highlight CursorLineFold guibg=#1A1B27]]) - diff --git a/nvim/lua/settings/barbar.lua b/nvim/lua/settings/barbar.lua deleted file mode 100644 index ae9db9c..0000000 --- a/nvim/lua/settings/barbar.lua +++ /dev/null @@ -1,42 +0,0 @@ --- Set barbar's options -require("bufferline").setup({ - animation = true, - auto_hide = false, - tabpages = true, - closable = true, - clickable = true, - exclude_name = { "package.json" }, - icons = true, - icon_custom_colors = false, - icon_separator_active = "", - icon_separator_inactive = "", - icon_close_tab = "", - icon_close_tab_modified = "●", - icon_pinned = "車", - insert_at_end = false, - maximum_padding = 1, - minimum_padding = 1, - maximum_length = 30, - semantic_letters = true, - letters = "asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP", - no_name_title = nil, -}) - -local nvim_tree_events = require("nvim-tree.events") -local bufferline_api = require("bufferline.api") - -local function get_tree_size() - return require("nvim-tree.view").View.width -end - -nvim_tree_events.subscribe("TreeOpen", function() - bufferline_api.set_offset(0) -end) - -nvim_tree_events.subscribe("Resize", function() - bufferline_api.set_offset(0) -end) - -nvim_tree_events.subscribe("TreeClose", function() - bufferline_api.set_offset(0) -end) diff --git a/nvim/lua/settings/cmp.lua b/nvim/lua/settings/cmp.lua deleted file mode 100644 index 2c4a430..0000000 --- a/nvim/lua/settings/cmp.lua +++ /dev/null @@ -1,151 +0,0 @@ -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end - -local snip_status_ok, luasnip = pcall(require, "luasnip") -if not snip_status_ok then - return -end - -require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets" }) - -luasnip.config.set_config({ - history = true, - delete_check_events = "TextChanged", - updateevents = "TextChanged,TextChangedI", - enable_autosnippets = true, - ext_opts = { - [require("luasnip.util.types").choiceNode] = { - active = { - virt_text = { { - Snippet = "", - "Snippet", - } }, - }, - }, - }, -}) - -require("luasnip/loaders/from_vscode").lazy_load() - -local check_backspace = function() - local col = vim.fn.col(".") - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") -end - ---   פּ ﯟ   some other good icons -local kind_icons = { - Text = "", - Method = "m", - Function = "", - Constructor = "", - Field = "", - Variable = "", - Class = "", - Interface = "", - Module = "", - Property = "", - Unit = "", - Value = "", - Enum = "", - Keyword = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "", - Event = "", - Operator = "", - TypeParameter = "", -} --- find more here: https://www.nerdfonts.com/cheat-sheet - -cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = { - [""] = cmp.mapping.scroll_docs(-1), - [""] = cmp.mapping.scroll_docs(1), - [""] = cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }), - [""] = cmp.mapping.confirm({ select = false }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if luasnip.expand_or_jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { - "i", - "s", - }), - }, - view = { - { entries = "native" }, - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) - vim_item.menu = ({ - nvim_lsp = "[LSP]", - luasnip = "[Snippet]", - buffer = "[Buffer]", - path = "[Path]", - })[entry.source.name] - return vim_item - end, - }, - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "path" }, - { name = "buffer" }, - }, - window = { - documentation = { - border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, - }, - }, - experimental = { - ghost_text = true, - }, -}) diff --git a/nvim/lua/settings/dap.lua b/nvim/lua/settings/dap.lua deleted file mode 100644 index 5dc6292..0000000 --- a/nvim/lua/settings/dap.lua +++ /dev/null @@ -1,123 +0,0 @@ -local dap = require("dap") -dap.adapters.lldb = { - type = 'executable', - command = '/usr/bin/lldb-vscode', - name = "lldb" -} - -local rust_dap = vim.fn.getcwd() -local filename = "" -for w in rust_dap:gmatch("([^/]+)") do filename = w end - -dap.configurations.rust = { - { - type = "lldb", - request = "launch", - program = function() - return rust_dap .. "/target/debug/" .. filename - end, - --program = '${fileDirname}/${fileBasenameNoExtension}', - cwd = "${workspaceFolder}", - stopOnEntry = true, - terminal = "integrated", - }, -} - -dap.configurations.cpp = { - { - name = "debug cpp", - type = "lldb", - request = "launch", - program = function() - return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/build/", "file") - end, - cwd = "${workspaceFolder}", - stopOnEntry = true, - terminal = "integrated", - }, -} -dap.configurations.c = dap.configurations.cpp - -require("dapui").setup({ - icons = { expanded = "▾", collapsed = "▸", current_frame = "▸" }, - mappings = { - -- Use a table to apply multiple mappings - expand = { "", "<2-LeftMouse>" }, - open = "o", - remove = "d", - edit = "e", - repl = "r", - toggle = "t", - }, - -- Expand lines larger than the window - -- Requires >= 0.7 - expand_lines = vim.fn.has("nvim-0.7") == 1, - -- Layouts define sections of the screen to place windows. - -- The position can be "left", "right", "top" or "bottom". - -- The size specifies the height/width depending on position. It can be an Int - -- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while - -- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns) - -- Elements are the elements shown in the layout (in order). - -- Layouts are opened in order so that earlier layouts take priority in window sizing. - layouts = { - { - elements = { - -- Elements can be strings or table with id and size keys. - { id = "scopes", size = 0.25 }, - "breakpoints", - "stacks", - "watches", - }, - size = 40, -- 40 columns - position = "left", - }, - { - elements = { - "repl", - "console", - }, - size = 0.25, -- 25% of total lines - position = "bottom", - }, - }, - controls = { - -- Requires Neovim nightly (or 0.8 when released) - enabled = true, - -- Display controls in this element - element = "repl", - icons = { - pause = "", - play = "", - step_into = "", - step_over = "", - step_out = "", - step_back = "", - run_last = "↻", - terminate = "□", - }, - }, - floating = { - max_height = nil, -- These can be integers or a float between 0 and 1. - max_width = nil, -- Floats will be treated as percentage of your screen. - border = "single", -- Border style. Can be "single", "double" or "rounded" - mappings = { - close = { "q", "" }, - }, - }, - windows = { indent = 1 }, - render = { - max_type_length = nil, -- Can be integer or nil. - max_value_lines = 100, -- Can be integer or nil. - }, -}) - -require("mason-nvim-dap").setup({ - ensure_installed = { - "bash-debug-adapter", - "firefox-debug-adapter", - "js-debug-adapter", - "node-debug2-adapter", - }, -}) - -require("nvim-dap-virtual-text").setup() diff --git a/nvim/lua/settings/dashboard.lua b/nvim/lua/settings/dashboard.lua deleted file mode 100644 index d08da71..0000000 --- a/nvim/lua/settings/dashboard.lua +++ /dev/null @@ -1,37 +0,0 @@ -local status_ok, alpha = pcall(require, "alpha") -if not status_ok then - return -end - -local dashboard = require("alpha.themes.dashboard") -dashboard.section.header.val = { - [[ _______ ___ _______. __ __ __ _______ ]], - [[| \ / \ / || | | | | | | ____|]], - [[| .--. | / ^ \ | (----`| |__| | | | | |__ ]], - [[| | | | / /_\ \ \ \ | __ | | | | __| ]], - [[| '--' | / _____ \ .----) | | | | | | | | |____ ]], - [[|_______/ /__/ \__\ |_______/ |__| |__| |__| |_______|]] -} -dashboard.section.buttons.val = { - dashboard.button("f", " Find file", ":Telescope find_files "), - dashboard.button("b", " Open File Browser", ":Telescope file_browser"), - dashboard.button("e", " New file", ":ene startinsert "), - dashboard.button("p", " Find project", ":Telescope project "), - dashboard.button("r", " Recently used files", ":Telescope oldfiles "), - dashboard.button("t", " Zoxide", ":Telescope zoxide list "), - dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua "), - dashboard.button("q", " Quit Neovim", ":qa"), -} - -local function footer() - return "dashie@dashie.org" -end - -dashboard.section.footer.val = footer() - -dashboard.section.footer.opts.hl = "Type" -dashboard.section.header.opts.hl = "Include" -dashboard.section.buttons.opts.hl = "Keyword" - -dashboard.opts.opts.noautocmd = true -alpha.setup(dashboard.opts) diff --git a/nvim/lua/settings/devicons.lua b/nvim/lua/settings/devicons.lua deleted file mode 100644 index 25b8c1c..0000000 --- a/nvim/lua/settings/devicons.lua +++ /dev/null @@ -1,22 +0,0 @@ -local status_ok, _ = pcall(require, "nvim-web-devicons") -if not status_ok then - return -end - -require 'nvim-web-devicons'.setup { - -- your personnal icons can go here (to override) - -- you can specify color or cterm_color instead of specifying both of them - -- DevIcon will be appended to `name` - override = { - zsh = { - icon = "", - color = "#428850", - cterm_color = "65", - name = "Zsh" - } - }; - - default = true; -} - -require 'nvim-web-devicons'.get_icons() diff --git a/nvim/lua/settings/indentline.lua b/nvim/lua/settings/indentline.lua deleted file mode 100644 index a85ff6e..0000000 --- a/nvim/lua/settings/indentline.lua +++ /dev/null @@ -1,11 +0,0 @@ -local status_ok, indent_blankline = pcall(require, "indent_blankline") -if not status_ok then - return -end - -vim.opt.list = true -require("indent_blankline").setup { - space_char_blankline = " ", - show_current_context = true, - show_current_context_start = true, -} diff --git a/nvim/lua/settings/keymaps.lua b/nvim/lua/settings/keymaps.lua deleted file mode 100644 index 0649f49..0000000 --- a/nvim/lua/settings/keymaps.lua +++ /dev/null @@ -1,85 +0,0 @@ -local opts = { noremap = true, silent = true } -local term_opts = { silent = true } -local keymap = vim.api.nvim_set_keymap - --- debug -keymap("n", "", ':lua require("dap").toggle_breakpoint()', opts) -keymap("n", "", ':lua require("dap").step_over()', opts) -keymap("n", "", ':lua require("dap").step_into()', opts) -keymap("n", "", ':lua require("dapui").toggle() :lua require("dap").continue() ', opts) -keymap("n", "", ':lua require("dap").continue()', opts) -keymap("n", "", ':lua require("dap").close() :lua require("dapui").toggle()', opts) - --- file tree -keymap("n", "f", ':lua require("nvim-tree").toggle()', opts) - --- toggle terminal -keymap('n', '', ':ToggleTerm ZSH', opts) - --- tab switching -keymap("n", "", ":BufferPrev", opts) -keymap("n", "", ":BufferNext", opts) - --- formatting -keymap("n", "", ":lua vim.lsp.buf.format { async = true }", opts) -keymap("n", "a", ":Telescope lsp_definitions", opts) -keymap("n", "s", ":Telescope lsp_references", opts) -keymap("n", "d", ":Telescope lsp_type_definitions", opts) -keymap("n", "f", ":Telescope lsp_implementations", opts) -keymap("n", "q", ":lua vim.lsp.buf.code_action()", opts) -keymap("n", "w", ":lua vim.lsp.buf.signature_help()", opts) -keymap("n", "e", ":lua vim.lsp.buf.hover()", opts) -keymap("n", "r", ":lua vim.lsp.buf.rename()", opts) -keymap("n", "gq", ":lua require('telescope.builtin').git_commits()", opts) -keymap("n", "gw", ":lua require('telescope.builtin').git_bcommits()", opts) -keymap("n", "ge", ":lua require('telescope.builtin').git_branches()", opts) -keymap("n", "gr", ":lua require('telescope.builtin').git_status()", opts) -keymap("n", "ga", ":lua require('telescope.builtin').git_stash()", opts) - --- window switching -function _G.set_terminal_keymaps() - local opts = { buffer = 0 } - vim.keymap.set('t', '', [[]], opts) - vim.keymap.set('t', 'jk', [[]], opts) - vim.keymap.set('t', '', [[wincmd h]], opts) - vim.keymap.set('t', '', [[wincmd j]], opts) - vim.keymap.set('t', '', [[wincmd k]], opts) - vim.keymap.set('t', '', [[wincmd l]], opts) -end - --- if you only want these mappings for toggle term use term://*toggleterm#* instead -vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()') -keymap("n", "", ":wincmd h", opts) -keymap("n", "", ":wincmd j", opts) -keymap("n", "", ":wincmd k", opts) -keymap("n", "", ":wincmd l", opts) - - --- harpoon man - -keymap("n", "", ":lua require('harpoon.ui').nav_file(1)", opts) -keymap("n", "", ":lua require('harpoon.ui').nav_file(2)", opts) -keymap("n", "", ":lua require('harpoon.ui').nav_file(3)", opts) -keymap("n", "fma", ":lua require('harpoon.mark').add_file()", opts) -keymap("n", "fmd", ":lua require('harpoon.mark').remove_file()", opts) - - --- telescope -keymap("n", "fb", ":Telescope file_browser", {}) -keymap("n", "fc", ":Cheatsheet", {}) -keymap("n", "ff", ":lua require('telescope.builtin').find_files()", {}) -keymap("n", "fg", ":lua require('telescope.builtin').live_grep()", {}) -keymap("n", "fh", ":lua require('telescope.builtin').help_tags()", {}) -keymap("n", "fp", ":lua require'telescope'.extensions.project.project{}", { noremap = true, silent = true }) -keymap("n", "fm", ":Telescope harpoon marks", { noremap = true, silent = true }) - -vim.keymap.set("n", "z", ":lua require('telescope').extensions.zoxide.list{}") - --- trouble -keymap("n", "", "TroubleToggle", term_opts) -require("trouble").setup({ - action_keys = { - --remove the fucking stupid keymap amk - open_tab = {}, - }, -}) diff --git a/nvim/lua/settings/lsp.lua b/nvim/lua/settings/lsp.lua deleted file mode 100644 index 03243a7..0000000 --- a/nvim/lua/settings/lsp.lua +++ /dev/null @@ -1,110 +0,0 @@ -local status_ok, _ = pcall(require, "lspconfig") -if not status_ok then - return -end - -require("mason").setup({ - ui = { - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗", - }, - }, -}) - -require("mason-lspconfig").setup({ - ensure_installed = { - "cssls", -- css - "html", -- html - "clangd", -- cpp / c - "lua_ls", -- lua - "pyright", -- python - "cmake", -- cmake - "bashls", -- shell - "ansiblels", -- ansible - "marksman", -- markdown - "asm_lsp", -- assembly - "tsserver", -- js and ts - "ltex", -- latex - "jdtls", -- jafuck - "gopls", -- yet another gargabe collector - "sqls", -- sql - "taplo", -- toml - "lemminx", -- xml - "yamlls", -- yaml - "bashls", -- shell - }, - automatic_installation = true, -}) - -local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) -capabilities.textDocument.completion.completionItem.snippetSupport = true - --- LSP -require("lsp-inlayhints").setup {} -local on_attach = function(client, bufnr) - vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") - local optslsp = { noremap = false, silent = true, buffer = bufnr } - -- require("lsp-format").on_attach(client) - require("lsp-inlayhints").on_attach(client, bufnr) -end - -require("rust-tools").setup({ - server = { - root_dir = require('lspconfig').util.find_git_ancestor, - }, -}) - -require("mason-lspconfig").setup_handlers({ - function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup({ - capabilities = capabilities, - on_attach = on_attach, - vim.lsp.diagnostic.on_publish_diagnostics, { - -- Disable virtual_text - virtual_text = true, - } - - }) - end, - ['tsserver'] = function() - require('lspconfig').tsserver.setup { - settings = { - typescript = { - inlayHints = { - includeInlayParameterNameHints = 'all', - includeInlayParameterNameHintsWhenArgumentMatchesName = true, - includeInlayFunctionParameterTypeHints = true, - includeInlayVariableTypeHints = true, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - includeInlayEnumMemberValueHints = true, - } - }, - javascript = { - inlayHints = { - includeInlayParameterNameHints = 'all', - includeInlayParameterNameHintsWhenArgumentMatchesName = true, - includeInlayFunctionParameterTypeHints = true, - includeInlayVariableTypeHints = true, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - includeInlayEnumMemberValueHints = true, - } - } - }, - capabilities = capabilities, - on_attach = on_attach, - vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = true, - } - } - end, -}) - - --- special server setups -require("clangd_extensions").setup( --- brudi no troll plox -) diff --git a/nvim/lua/settings/nvim-tree.lua b/nvim/lua/settings/nvim-tree.lua deleted file mode 100644 index 6542978..0000000 --- a/nvim/lua/settings/nvim-tree.lua +++ /dev/null @@ -1,262 +0,0 @@ --- following options are the default --- each of these are documented in `:help nvim-tree.OPTION_NAME` - -local status_ok, nvim_tree = pcall(require, "nvim-tree") -if not status_ok then - return -end - -local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") -if not config_status_ok then - return -end - - -nvim_tree.setup { -- BEGIN_DEFAULT_OPTS - auto_reload_on_write = true, - create_in_closed_folder = false, - disable_netrw = false, - hijack_cursor = false, - hijack_netrw = true, - hijack_unnamed_buffer_when_opening = false, - open_on_setup = false, - open_on_setup_file = false, - open_on_tab = false, - sort_by = "name", - root_dirs = {}, - prefer_startup_root = false, - sync_root_with_cwd = true, - reload_on_bufenter = false, - respect_buf_cwd = true, - on_attach = "disable", -- function(bufnr). If nil, will use the deprecated mapping strategy - remove_keymaps = false, -- boolean (disable totally or not) or list of key (lhs) - view = { - adaptive_size = false, - centralize_selection = false, - width = 30, - hide_root_folder = false, - side = "right", - preserve_window_proportions = false, - number = false, - relativenumber = false, - signcolumn = "yes", - -- @deprecated - mappings = { - custom_only = false, - list = { - -- user mappings go here - }, - }, - float = { - enable = false, - open_win_config = { - relative = "editor", - border = "rounded", - width = 30, - height = 30, - row = 1, - col = 1, - }, - }, - }, - renderer = { - add_trailing = false, - group_empty = true, - highlight_git = false, - full_name = false, - highlight_opened_files = "none", - root_folder_modifier = ":~", - indent_width = 2, - indent_markers = { - enable = false, - inline_arrows = true, - icons = { - corner = "└", - edge = "│", - item = "│", - bottom = "─", - none = " ", - }, - }, - icons = { - webdev_colors = true, - git_placement = "before", - padding = " ", - symlink_arrow = " ➛ ", - show = { - file = true, - folder = true, - folder_arrow = true, - git = true, - }, - glyphs = { - default = "", - symlink = "", - bookmark = "", - folder = { - arrow_closed = "", - arrow_open = "", - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - symlink_open = "", - }, - git = { - unstaged = "✗", - staged = "✓", - unmerged = "", - renamed = "➜", - untracked = "★", - deleted = "", - ignored = "◌", - }, - }, - }, - special_files = { "cargo.toml", "makefile", "readme.md", "readme.md" }, - symlink_destination = true, - }, - hijack_directories = { - enable = true, - auto_open = true, - }, - update_focused_file = { - enable = true, - -- update_cwd = true, - update_root = false, - ignore_list = {}, - }, - ignore_ft_on_setup = {}, - system_open = { - cmd = "", - args = {}, - }, - diagnostics = { - enable = false, - show_on_dirs = false, - debounce_delay = 50, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - filters = { - dotfiles = false, - custom = {}, - exclude = {}, - }, - filesystem_watchers = { - enable = true, - debounce_delay = 50, - }, - git = { - enable = true, - ignore = true, - show_on_dirs = true, - timeout = 400, - }, - actions = { - use_system_clipboard = true, - change_dir = { - enable = true, - global = false, - restrict_above_cwd = false, - }, - expand_all = { - max_folder_discovery = 300, - exclude = {}, - }, - file_popup = { - open_win_config = { - col = 1, - row = 1, - relative = "cursor", - border = "shadow", - style = "minimal", - }, - }, - open_file = { - quit_on_open = false, - resize_window = true, - window_picker = { - enable = true, - chars = "abcdefghijklmnopqrstuvwxyz1234567890", - exclude = { - filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, - buftype = { "nofile", "terminal", "help" }, - }, - }, - }, - remove_file = { - close_window = true, - }, - }, - trash = { - cmd = "gio trash", - require_confirm = true, - }, - live_filter = { - prefix = "[FILTER]: ", - always_show_folders = true, - }, - log = { - enable = false, - truncate = false, - types = { - all = false, - config = false, - copy_paste = false, - dev = false, - diagnostics = false, - git = false, - profile = false, - watcher = false, - }, - }, -} - --- nvim-tree is also there in modified buffers so this function filter it out -local modifiedBufs = function(bufs) - local t = 0 - for k, v in pairs(bufs) do - if v.name:match("NvimTree_") == nil then - t = t + 1 - end - end - return t -end - -vim.api.nvim_create_autocmd("BufEnter", { - nested = true, - callback = function() - if #vim.api.nvim_list_wins() == 1 and - vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil and - modifiedBufs(vim.fn.getbufinfo({ bufmodified = 1 })) == 0 then - vim.cmd "quit" - end - end -}) - -local function open_nvim_tree(data) - - -- buffer is a directory - local directory = vim.fn.isdirectory(data.file) == 1 - - if not directory then - return - end - - -- change to the directory - if directory then - vim.cmd.cd(data.file) - end - - -- open the tree - require("nvim-tree.api").tree.open() -end - -vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) - diff --git a/nvim/lua/settings/options.lua b/nvim/lua/settings/options.lua deleted file mode 100644 index 87c91c4..0000000 --- a/nvim/lua/settings/options.lua +++ /dev/null @@ -1,23 +0,0 @@ -local options = { - clipboard = "unnamedplus", - mouse = "n", - fileencoding = "utf-8", - number = true, - showmode = true, - termguicolors = true, - spelllang = "en_us", - shell = "/usr/bin/zsh", - autochdir = true, - cursorline = true, -} - -vim.g.mkdp_browser = '/usr/bin/firefox' -vim.g.mkdp_auto_start = 1 - --- space leader -vim.g.mapleader = " " -vim.keymap.set("n", "", "", { silent = true, noremap = false }) - -for k, v in pairs(options) do - vim.opt[k] = v -end diff --git a/nvim/lua/settings/pairs.lua b/nvim/lua/settings/pairs.lua deleted file mode 100644 index 502be27..0000000 --- a/nvim/lua/settings/pairs.lua +++ /dev/null @@ -1,36 +0,0 @@ --- Setup nvim-cmp. -local status_ok, npairs = pcall(require, "nvim-autopairs") -if not status_ok then - return -end -local Rule = require('nvim-autopairs.rule') - -npairs.setup({ - check_ts = true, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - java = false, - }, - disable_filetype = { "TelescopePrompt", "spectre_panel" }, - fast_wrap = { - map = "", - chars = { "{", "[", "(", "<", '"', "'" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, -- Offset from pattern match - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "PmenuSel", - highlight_grey = "LineNr", - }, -}) - -npairs.add_rule(Rule("<", ">")) - -local cmp_autopairs = require("nvim-autopairs.completion.cmp") -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end -cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } })) diff --git a/nvim/lua/settings/plugins.lua b/nvim/lua/settings/plugins.lua deleted file mode 100644 index ddafc1a..0000000 --- a/nvim/lua/settings/plugins.lua +++ /dev/null @@ -1,60 +0,0 @@ -local Plug = vim.fn["plug#"] -vim.call("plug#begin", "~/.config/nvim/plugged") -Plug("nvim-lua/popup.nvim") -- An implementation of the Popup API from vim in Neovim -Plug("nvim-lua/plenary.nvim") -- Useful lua functions used ny lots of plugins -Plug("EdenEast/nightfox.nvim") -- dark theme -Plug("kyazdani42/nvim-web-devicons") -- icons -Plug("feline-nvim/feline.nvim") -- bottom bar -Plug("lewis6991/gitsigns.nvim") -- git signs on the bar and on the left -Plug("nvim-lua/plenary.nvim") -- library, don't delete -Plug("williamboman/mason.nvim") -- lsp and dap -Plug("williamboman/mason-lspconfig.nvim") -- lsp to mason bridge -Plug("neovim/nvim-lspconfig") -- nvim lsp -Plug("mfussenegger/nvim-dap") -- debugging capabilities -Plug("rcarriga/nvim-dap-ui") -- debug ui -Plug("theHamsta/nvim-dap-virtual-text") -- more debug ui -Plug("jayp0521/mason-nvim-dap.nvim") -- debug mason bridge -Plug("nvim-treesitter/nvim-treesitter", -{ ["do"] = vim.fn[":TSUpdate"] }) -- syntax colors -Plug("hrsh7th/nvim-cmp") -- completions -Plug("hrsh7th/cmp-nvim-lsp") -- lsp integration with completions -Plug("hrsh7th/cmp-path") -- path completion -Plug("hrsh7th/cmp-cmdline") -- command completion -Plug("saadparwaiz1/cmp_luasnip") -- snip completion -Plug("L3MON4D3/LuaSnip") -- snippet plugin -Plug("kyazdani42/nvim-tree.lua") -- file viewer on the right -Plug("windwp/nvim-autopairs") -- autopairs -Plug("romgrk/barbar.nvim") -- bar on the top -Plug("numToStr/Comment.nvim") -- fast comments -Plug("lukas-reineke/indent-blankline.nvim") -- indicators for indentation (needs config) -Plug("lewis6991/impatient.nvim") -- speedup startup -Plug("goolord/alpha-nvim") -- dashboard -Plug("lervag/vimtex") -- latex plugin -Plug("weilbith/nvim-code-action-menu") -- code action menu -Plug("rafamadriz/friendly-snippets") -- some provided snippets -Plug("p00f/nvim-ts-rainbow") -- colors brackets -Plug("nvim-telescope/telescope.nvim") -- file/text search -Plug("nvim-telescope/telescope-ui-select.nvim") -- telescope ui -Plug("nvim-telescope/telescope-file-browser.nvim") -- telescope file browser -Plug("nvim-telescope/telescope-fzy-native.nvim") -- telescope fuzzy search -Plug('nvim-telescope/telescope-project.nvim') -- telescope projects -Plug('nvim-telescope/telescope-symbols.nvim') -- symbol picker -Plug('nvim-telescope/telescope-file-browser.nvim') -- telescope file browser -Plug('nvim-telescope/telescope-dap.nvim') -- dap UI for telescope -Plug('benfowler/telescope-luasnip.nvim') -- telescope luasnip integration -Plug('jvgrootveld/telescope-zoxide') -- zoxide integration -Plug('sudormrfbin/cheatsheet.nvim') -- cheatsheet for keymaps -Plug('ThePrimeagen/harpoon') -- harpoonman -Plug 'folke/trouble.nvim' -- provides warning/error explanation tab -Plug('akinsho/toggleterm.nvim',{ ["tag"] = "*" }) -- better terminal integration -Plug("iamcco/markdown-preview.nvim", -- markdown preview -{ ["do"] = "cd app && yarn install" }) -Plug('p00f/clangd_extensions.nvim') -- clangd_extensions --- Plug('kdarkhan/rust-tools.nvim') -- rust extensions -Plug('simrat39/rust-tools.nvim') -Plug('lvimuser/lsp-inlayhints.nvim') -- inlay hints -Plug('preservim/tagbar') -- tags on the right -Plug('ggandor/leap.nvim') -- special movement -Plug('brenoprata10/nvim-highlight-colors') -- colors -vim.call("plug#end") - diff --git a/nvim/lua/settings/project.lua b/nvim/lua/settings/project.lua deleted file mode 100644 index 88ec927..0000000 --- a/nvim/lua/settings/project.lua +++ /dev/null @@ -1,25 +0,0 @@ -local tele_status_ok, telescope = pcall(require, "telescope") -if not tele_status_ok then - return -end - -telescope.load_extension("project") - -require('telescope').setup { - extensions = { - project = { - base_dirs = { - '~/dev/src', - { '~/dev/src2' }, - { '~/dev/src3', max_depth = 4 }, - { path = '~/dev/src4' }, - { path = '~/dev/src5', max_depth = 2 }, - }, - hidden_files = true, -- default: false - theme = "dropdown", - order_by = "asc", - search_by = "title", - sync_with_nvim_tree = true, -- default false - } - } -} diff --git a/nvim/lua/settings/rainbow.lua b/nvim/lua/settings/rainbow.lua deleted file mode 100644 index f875b69..0000000 --- a/nvim/lua/settings/rainbow.lua +++ /dev/null @@ -1,9 +0,0 @@ -require("nvim-treesitter.configs").setup { - highlight = { - }, - rainbow = { - enable = true, - extended_mode = true, - max_file_lines = nil, - } -} diff --git a/nvim/lua/settings/telescope.lua b/nvim/lua/settings/telescope.lua deleted file mode 100644 index 92a8492..0000000 --- a/nvim/lua/settings/telescope.lua +++ /dev/null @@ -1,34 +0,0 @@ -local t = require("telescope") -local z_utils = require("telescope._extensions.zoxide.utils") - --- Configure the extension -t.setup({ - extensions = { - zoxide = { - prompt_title = "[ Queries ]", - mappings = { - default = { - after_action = function(selection) - print("Update to (" .. selection.z_score .. ") " .. selection.path) - end - }, - [""] = { - before_action = function(selection) print("before C-s") end, - action = function(selection) - vim.cmd("edit " .. selection.path) - end - }, - [""] = { action = z_utils.create_basic_command("split") }, - }, - }, - }, -}) - --- Load the extension -t.load_extension('zoxide') - --- Add a mapping -require("telescope").load_extension("fzy_native") -require("telescope").load_extension "file_browser" -require('telescope').load_extension('dap') -require("telescope").load_extension('harpoon') diff --git a/nvim/lua/settings/treesitter.lua b/nvim/lua/settings/treesitter.lua deleted file mode 100644 index 260b608..0000000 --- a/nvim/lua/settings/treesitter.lua +++ /dev/null @@ -1,13 +0,0 @@ -local status_ok, _ = pcall(require, "nvim-treesitter.configs") -if not status_ok then - return -end - -require("nvim-treesitter.configs").setup({ - ensure_installed = "all", - ignore_install = { "markdown_inline" }, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, -}) diff --git a/nvim/lua/settings/vimtex.lua b/nvim/lua/settings/vimtex.lua deleted file mode 100644 index e9b4628..0000000 --- a/nvim/lua/settings/vimtex.lua +++ /dev/null @@ -1,4 +0,0 @@ -vim.cmd("let g:vimtex_quickfix_mode=0") -vim.cmd("let g:vimtex_view_general_viewer = 'evince'") -vim.cmd("let g:vimtex_compiler_method = 'latexmk'") -vim.cmd("let g:vimtex_compiler_latexmk = {'options': ['-pdf', '-shell-escape', '-file-line-error', '--extra-mem-bot=10000000', '-synctex=1', '-interaction=nonstopmode',],}") diff --git a/nvim/snippets/.texsnippetsold b/nvim/snippets/.texsnippetsold deleted file mode 100644 index 6a23f7e..0000000 --- a/nvim/snippets/.texsnippetsold +++ /dev/null @@ -1,55 +0,0 @@ - -snippet mini \minipg{}{}[] - \\minipg{ - $1 - } - {${2}}[${3}] - -snippet graphics \includegraphics[]{} - \\includegraphics[scale=$1]{${2}} - -snippet code "code" - \\begin{lstlisting} - $1 - \\end{lstlisting} - -snippet list "list" - \\begin{itemize} - \\item \\textcolor{${1}}{${2}} - \\item \\textcolor{${1}}{${3}} - \\item \\textcolor{${1}}{${4}} - \\item \\textcolor{${1}}{${5}} - \\vspace{-3mm} - \\end{itemize} - -snippet enum "enumerate" - \\begin{enumerate} - \\item \textcolor{${1}}{${2}} - \\item \textcolor{${1}}{${3}} - \\item \textcolor{${1}}{${4}} - \\item \textcolor{${1}}{${5}} - \\vspace{-3mm} - \\end{enumerate} - -snippet table "table" - \\begin{table}[ht!] - \\section{${1}} - \\begin{tabular}{|m{0.2\linewidth}|m{0.755\linewidth}|} - \hline - $2 - \hline - \\end{tabular} - \\end{table} - -snippet tabular "tabular" - \\begin{tabular}{|m{0.2\linewidth}|m{0.755\linewidth}|} - \hline - $1 - \hline - \\end{tabular} - -snippet tx "textcolor" - \\textcolor{${1}}{${2}} - -snippet bm "vectormatrix" - \\begin{bmatrix} $1 \\ $2 \\ $3 \end{bmatrix} diff --git a/nvim/snippets/tex.lua b/nvim/snippets/tex.lua deleted file mode 100644 index 38317b9..0000000 --- a/nvim/snippets/tex.lua +++ /dev/null @@ -1,210 +0,0 @@ -local ls = require("luasnip") --- some shorthands... -local s = ls.s -local i = ls.i -local t = ls.t -local d = ls.dynamic_node -local c = ls.choice_node -local f = ls.function_node -local sn = ls.snippet_node - -local fmt = require("luasnip.extras.fmt").fmt -local rep = require("luasnip.extras").rep - -local snippets, autosnippets = {}, {} -local group = vim.api.nvim_create_augroup("Tex Snippets", { clear = true }) -local file_pattern = "*.tex" -------------------------------------------------- boilerplate end --- snippers go here: - -local formSnippet = s( - "form-", - fmt( - [[ -\, \newline -\large \textcolor{{purple}}{{\( {1} \)}}\newline -\, \newline -\normalsize Legend: \newline -\begin{{itemize}} -\item {2} -\item {3} -\item {4} -\item {5} -\end{{itemize}} - ]], - { - i(1, "formula"), - i(2, "item 1"), - i(3, "item 2"), - i(4, "item 3"), - i(5, "item 4"), - } - ) -) -table.insert(snippets, formSnippet) - -local listSnippet = s( - "list-", - fmt( - [[ -\begin{{itemize}} -\item \textcolor{{{1}}}{{{5}}} -\item \textcolor{{{2}}}{{{6}}} -\item \textcolor{{{3}}}{{{7}}} -\item \textcolor{{{4}}}{{{8}}} -\end{{itemize}} - ]], - { - i(1, "color"), - rep(1), - rep(1), - rep(1), - i(2, "item 1"), - i(3, "item 2"), - i(4, "item 3"), - i(5, "item 4"), - } - ) -) -table.insert(snippets, listSnippet) - -local enumerateSnippet = s( - "enum-", - fmt( - [[ -\begin{{enumerate}} -\item \textcolor{{{1}}}{{{5}}} -\item \textcolor{{{2}}}{{{6}}} -\item \textcolor{{{3}}}{{{7}}} -\item \textcolor{{{4}}}{{{8}}} -\end{{enumerate}} - ]], - { - i(1, "color"), - rep(1), - rep(1), - rep(1), - i(2, "item 1"), - i(3, "item 2"), - i(4, "item 3"), - i(5, "item 4"), - } - ) -) -table.insert(snippets, enumerateSnippet) - -local tableSnippet = s( - "table-", - fmt( - [[ -\begin{{table}}[ht!] -\section{{{}}} -\begin{{tabular}}{{|m{{0.2\linewidth}}|m{{0.755\linewidth}}|}} -\hline -{} -\hline -\end{{tabular}} -\end{{table}} - ]], - { - i(1, "Section Name"), - i(2, "data....."), - } - ) -) -table.insert(snippets, tableSnippet) - -local tabularSnippet = s( - "tabular-", - fmt( - [[ -\begin{{tabular}}{{|m{{0.2\linewidth}}|m{{0.755\linewidth}}|}} -\hline -{} -\hline -\end{{tabular}} - ]], - { - i(1, "data....."), - } - ) -) -table.insert(snippets, tabularSnippet) - -local textcolorSnippet = s( - "tx-", - fmt( - [[ -\textcolor{{{1}}}{{{2}}} - ]], - { - i(1, "color"), - i(2, "text..."), - } - ) -) -table.insert(snippets, textcolorSnippet) - -local boldSnippet = s( - "bold-", - fmt( - [[ -\textbf{{{1}}} - ]], - { - i(1, "text..."), - } - ) -) -table.insert(snippets, boldSnippet) - -local minipgSnippet = s( - "mini-", - fmt( - [[ -\minipg{{ -{1} -}}{{ -{2} -}}[{3}] - ]], - { - i(1, "data..."), - i(2, "data..."), - i(3, "0.25,0.25"), - } - ) -) -table.insert(snippets, minipgSnippet) - -local graphicSnippet = s( - "graph-", - fmt( - [[ -\includegraphics[scale={1}]{{{2}}} - ]], - { - i(1, "0.4"), - i(2, "something.png"), - } - ) -) -table.insert(snippets, graphicSnippet) - -local lstSnippet = s( - "code-", - fmt( - [[ -\begin{{lstlisting}} -{} -\end{{lstlisting}} - ]], - { - i(1, "data"), - } - ) -) -table.insert(snippets, lstSnippet) - -------------------------------------------------- snippets end -return snippets, autosnippets diff --git a/nvim/stylua.toml b/nvim/stylua.toml new file mode 100644 index 0000000..5d6c50d --- /dev/null +++ b/nvim/stylua.toml @@ -0,0 +1,3 @@ +indent_type = "Spaces" +indent_width = 2 +column_width = 120 \ No newline at end of file