├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ └── feature_request.md └── workflows │ ├── format.yml │ ├── lint.yml │ └── superLinter.yml ├── .gitignore ├── .luacheckrc ├── .stylua.toml ├── LICENSE ├── README.md ├── bin ├── install-latest-neovim ├── installer ├── starplug.example.lua ├── starvim.png └── sv-config.example.lua ├── init.lua └── lua ├── core ├── README.md ├── autocmds │ └── init.lua ├── config │ ├── init.lua │ ├── settings.lua │ └── starrc.lua ├── functions │ └── init.lua ├── init.lua ├── keybindings │ └── init.lua └── logging │ └── init.lua ├── modules ├── configs │ ├── autopairs.lua │ ├── blankline.lua │ ├── bufferline.lua │ ├── compe.lua │ ├── dashboard.lua │ ├── formatter.lua │ ├── gitsigns.lua │ ├── icons.lua │ ├── linter.lua │ ├── lsp_config.lua │ ├── lsp_sign.lua │ ├── lualine.lua │ ├── luasnip.lua │ ├── nvimtree.lua │ ├── orgmode.lua │ ├── packer.lua │ ├── symbols.lua │ ├── telescope.lua │ ├── toggleterm.lua │ ├── treesitter.lua │ ├── whichkey.lua │ └── zenmode.lua ├── init.lua └── runner │ └── init.lua └── utils └── init.lua /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - Operating System 28 | - Terminal 29 | - Version of Neovim 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem was. 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | 22 | **Screenshot** 23 | Maybe a screenshot of the feature 24 | -------------------------------------------------------------------------------- /.github/workflows/format.yml: -------------------------------------------------------------------------------- 1 | name: format 2 | 3 | on: 4 | push: 5 | branches: [main, dev] 6 | 7 | jobs: 8 | stylua: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: Setup and run stylua 13 | uses: JohnnyMorganz/stylua-action@1.0.0 14 | with: 15 | token: ${{ secrets.GITHUB_TOKEN }} 16 | args: --config-path=./.stylua.toml -g *.lua -g !lua/core/**/*.lua -g !lua/modules/**/*.lua -g !lua/utils/*.lua -- . 17 | - name: Commit files 18 | run: | 19 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 20 | git config --local user.name "github-actions[bot]" 21 | if [[ ! -z $(git status -s) ]]; then 22 | git add . 23 | git commit -m "chore: format source code" 24 | fi 25 | - name: Push formatted files 26 | uses: ad-m/github-push-action@master 27 | with: 28 | github_token: ${{ secrets.GITHUB_TOKEN }} 29 | branch: ${{ github.ref }} 30 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: lint 2 | on: 3 | push: 4 | branches: '**' 5 | pull_request: 6 | branches: 7 | - 'main' 8 | - 'develop' 9 | 10 | jobs: 11 | lua-linter: 12 | name: 'Linting with luacheck' 13 | runs-on: ubuntu-20.04 14 | steps: 15 | - uses: actions/checkout@v2 16 | 17 | - uses: leafo/gh-actions-lua@v8 18 | - uses: leafo/gh-actions-luarocks@v4 19 | 20 | - name: Use luacheck 21 | run: luarocks install luacheck 22 | 23 | - name: Run luacheck 24 | run: luacheck *.lua lua/ 25 | -------------------------------------------------------------------------------- /.github/workflows/superLinter.yml: -------------------------------------------------------------------------------- 1 | name: Super-Linter 2 | 3 | # Run this workflow every time a new commit pushed to your repository 4 | on: push 5 | 6 | jobs: 7 | # Set the job key. The key is displayed as the job name 8 | # when a job name is not provided 9 | super-lint: 10 | # Name the Job 11 | name: Lint code base 12 | # Set the type of machine to run on 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | # Checks out a copy of your repository on the ubuntu-latest machine 17 | - name: Checkout code 18 | uses: actions/checkout@v2 19 | 20 | # Runs the Super-Linter action 21 | - name: Run Super-Linter 22 | uses: github/super-linter@v3 23 | env: 24 | VALIDATE_YAML: true 25 | VALIDATE_BASH_EXEC: true 26 | OUTPUT_FOLDER: super-linter.report 27 | OUTPUT_DETAILS: detailed 28 | DEFAULT_BRANCH: main 29 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 30 | 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | sv-config.lua 2 | plugin 3 | starplug.lua 4 | -------------------------------------------------------------------------------- /.luacheckrc: -------------------------------------------------------------------------------- 1 | -- vim: ft=lua tw=80 2 | 3 | stds.nvim = { 4 | globals = { 5 | "Sv", 6 | vim = { fields = { "g", "opt" } }, 7 | "CONFIG_PATH", 8 | "CACHE_PATH", 9 | "DATA_PATH", 10 | "TERMINAL", 11 | "USER", 12 | os = { fields = { "capture" } }, 13 | "Config", 14 | "packer", 15 | "packer_plugins", 16 | }, 17 | read_globals = { 18 | "jit", 19 | "os", 20 | "vim", 21 | -- vim = { fields = { "cmd", "api", "fn", "o" } }, 22 | }, 23 | } 24 | std = "lua51+nvim" 25 | 26 | -- Don't report unused self arguments of methods. 27 | self = false 28 | 29 | -- Rerun tests only if their modification time changed. 30 | cache = true 31 | 32 | ignore = { 33 | "631", -- max_line_length 34 | "212/_.*", -- unused argument, for vars with "_" prefix 35 | } 36 | -------------------------------------------------------------------------------- /.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | line_endings = "Unix" 3 | indent_type = "Spaces" 4 | indent_width = 3 5 | quote_style = "AutoPreferDouble" 6 | no_call_parentheses = true 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

StarVim

2 | 3 |
4 | 5 | [Install](#installation) • [Why StarVim?](#why-starvim-) • [Screenshots](https://github.com/ashincoder/StarVim/tree/screenshots) • [Contribute](#contributions) 6 | 7 |
8 | 9 |
A IDE wrapper which is beyond the moon 🌚 and above the stars ⭐ :O!
10 | 11 |
12 | 13 | [![Super Linter](https://img.shields.io/github/workflow/status/ashincoder/StarVim/Super-Linter/main?style=flat-square&logo=github&label=Build&color=green)]() 14 | GitHub repository size 19 | License 24 | [![Gitter](https://img.shields.io/gitter/room/ashincoder/StarVim?style=flat-square&logo=gitter&logoColor=white&label=Chat&color=eb34a4)](https://gitter.im/starvim-conf/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) 25 | [![Neovim Minimum Version](https://img.shields.io/badge/Neovim-0.5+-blueviolet.svg?style=flat-square&logo=Neovim&logoColor=white)](https://github.com/neovim/neovim) 26 | [![GitHub Issues](https://img.shields.io/github/issues/ashincoder/StarVim.svg?style=flat-square&label=Issues&color=fc0330)](https://github.com/siduck76/StarVim/issues) 27 | [![Last Commit](https://img.shields.io/github/last-commit/ashincoder/StarVim.svg?style=flat-square&label=Last%20Commit&color=58eb34)](https://github.com/siduck76/StarVim/pulse) 28 | 29 | ![StarVim](https://github.com/ashincoder/StarVim/blob/dev/bin/starvim.png) 30 | 31 |
32 | 33 | ## Logo 34 | 35 | - Thank you all for trying to work on the creation of the logo. 36 | - The logo was made by [im-yuria](https://github.com/im-yuria) 37 | - Thank you [Thomashighbaugh](https://github.com/Thomashighbaugh) for creating a such a beautiful creation [Logo here](https://github.com/ashincoder/StarVim/issues/25) 38 | 39 | # Installation 40 | 41 | Dependencies : 42 | - neovim (+0.5) 43 | - pip3 44 | - nodejs (for lsp) 45 | - npm (for lsp) 46 | - yarn (for lsp) 47 | 48 | `bash <(curl -s https://raw.githubusercontent.com/ashincoder/StarVim/main/bin/installer)` 49 | 50 | ## Update Config 51 | 52 | To keep the config up to date : 53 | 54 | ``` 55 | git pull 56 | nvim +PackerCompile 57 | ``` 58 | 59 | > ! This will not affect your 'sv-config.lua'. So don't worry. 60 | 61 | # Why StarVim ? 62 | 63 | The answer everyone is waiting for. 64 | 65 | Here you go : 66 | 67 | ## Lazy loading 68 | StarVim is lazy loaded so hard that your machine does'nt feel the force of the arrival of StarVim. 69 | - Almost 25+ plugins are installed. All of them are lazyloaded. 70 | 71 | ## Colors 72 | StarVim will have more colorschemes with colorfulness. 73 | - When colorschemes are loaded normally it takes a lot of time. But StarVim has also lazied the colorschemes 74 | 75 | ## Extensibility 76 | StarVim can be configured within 1 file. Which makes everything simple for the user. 77 | 78 | - While doing a git pull it does'nt affect the user config file. 'sv-config.lua' 79 | 80 | + If you still aren't convinced read the [Features](https://github.com/ashincoder/StarVim#features) 81 | 82 | # Features 83 | 84 | - Autosave functionality. 85 | - Gitsigns for colors git signs 86 | - Minimal status line (lualine) 87 | - File navigation with Nvimtree 88 | - Nvim-compe for autocompletion 89 | - Packer.nvim as package manager 90 | - Smooth scrolling with Neoscroll 91 | - Indent-blankline.Nvim for indentlines 92 | - Managing tabs, buffers with Bufferline 93 | - Nvim-treesitter for syntax highlighting 94 | - Nvim-lspconfig for nvim-lps configuration 95 | - LspInstall for installing lsp servers easily. 96 | - Telescope for file finding, picking, previewing 97 | - Nvim-autopairs, for autolosing braces and stuffs 98 | - Formatter.nvim for prettifying / formatting code 99 | - Lspkind to show pictograms on autocompletion items 100 | - Using Nvim-lsp for language perfection and intellisense 101 | - Using plugins that are mouse friendly (Keyboard is better!) 102 | - Icons on nvimtree, telescope, bufferline/statusline and almost everywhere! with nvim-web-devicons 103 | - Snip support from VSCode through vsnip supporting custom and predefined snips (friendly-snippets) 104 | 105 | - And the Killer Feature ! [![Lua](https://img.shields.io/badge/Made%20with%20Lua-blueviolet.svg?style=for-the-badge&logo=lua)]() 106 | - Lua makes it faster and smoother. More extensible 107 | 108 | ## Screenshots 109 | 110 | ![DashBoard](https://github.com/ashincoder/StarVim/blob/screenshots/dashboard.png) 111 | Other screenshots are displayed [here](https://github.com/ashincoder/StarVim/tree/screenshots) 112 | 113 | ## Contributions 114 | - PR's are always welcome , no matter what **So start today** . [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) 115 | - While making a PR, try to be more descriptive. :) 116 | 117 | ## Error Handling 118 | Check star.log located in `~/.local/share/nvim/star.log` for any errors 119 | More will be added in the wiki 120 | 121 | ## Questions 122 | If you have any doubts you can freely ask on these following sites: 123 | - [Gitter](https://gitter.im/starvim-conf/community) 124 | - [Reddit](https://www.reddit.com/r/StarVim/) 125 | - [Discord](https://discord.gg/7jVFbwnY) 126 | - [Youtube](https://www.youtube.com/channel/UCZqKL3vIdyHUiLuR1vYwVgw) 127 | 128 | ## Contributions 129 | - PR's are always welcome , no matter what **So start today** . [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) 130 | - While making a PR, try to be more descriptive. :) 131 | 132 | ## Credits 133 | 134 | The following repositories helped me in improving StarVim 135 | - ChristianChiarulli's [LunarVim](https://github.com/ChristianChiarulli/LunarVim) 136 | - Siduck's [NvChad](https://github.com/siduck76/NvChad) 137 | 138 | ## TODO 139 | 140 | - [ ] Logo 141 | - [X] Readme 142 | - [X] Clean code [![CodeFactor](https://www.codefactor.io/repository/github/ashincoder/starvim/badge)](https://www.codefactor.io/repository/github/ashincoder/starvim) 143 | - [X] More Custom Colorschemes 144 | - [X] Easily Installable plugins 145 | - [ ] Documentation, Wiki and stuff 146 | -------------------------------------------------------------------------------- /bin/install-latest-neovim: -------------------------------------------------------------------------------- 1 | !#/bin/bash 2 | git clone --branch master --depth 1 https://github.com/neovim/neovim 3 | cd neovim 4 | sudo make CMAKE_BUILD_TYPE=Release install 5 | cd ~ 6 | sudo rm -r neovim 7 | -------------------------------------------------------------------------------- /bin/installer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -o nounset # error when referencing undefined variable 4 | set -o errexit # exit when command fails 5 | 6 | moveoldnvim() { 7 | echo "Moving your ~/.config/nvim folder to ~/.config/nvim.bak" 8 | mv "$HOME/.config/nvim" "$HOME/.config/nvim.bak" 9 | } 10 | 11 | installpacker() { 12 | git clone https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/opt/packer.nvim 13 | } 14 | 15 | cloneconfig() { 16 | echo "Cloning StarVim configuration" 17 | git clone --branch main https://github.com/ashincoder/StarVim.git ~/.config/nvim 18 | cp "$HOME"/.config/nvim/bin/sv-config.example.lua "$HOME"/.config/nvim/sv-config.lua 19 | cp "$HOME"/.config/nvim/bin/starplug.example.lua "$HOME"/.config/nvim/starplug.lua 20 | cd "$HOME"/.config/nvim/ 21 | 22 | nvim +PackerInstall 23 | nvim +PackerCompile 24 | 25 | echo -e "\nCompile Complete" 26 | } 27 | 28 | # Welcome 29 | echo 'Installing StarVim' 30 | 31 | # move old nvim directory if it exists 32 | [ -d "$HOME/.config/nvim" ] && moveoldnvim 33 | 34 | if [ -e "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" ]; then 35 | echo 'packer already installed' 36 | else 37 | rm -rf ~/.local/share/nvim/site/pack/packer 38 | installpacker 39 | fi 40 | 41 | if [ -e "$HOME/.config/nvim/init.lua" ]; then 42 | echo 'StarVim already installed' 43 | else 44 | # clone config down 45 | cloneconfig 46 | fi 47 | 48 | echo "I recommend you also install and activate a font from here: https://github.com/ryanoasis/nerd-fonts" 49 | -------------------------------------------------------------------------------- /bin/starplug.example.lua: -------------------------------------------------------------------------------- 1 | local star = { 2 | ui = { 3 | "dashboard", -- Start screen 4 | "statusline", -- Statusline 5 | "tabline", -- Tabline, shows your buffers list at top 6 | "which-key", -- Keybindings popup menu like Emacs' guide-key 7 | -- 'zen', -- Distraction free environment 8 | -- 'indentlines', -- Show indent lines 9 | }, 10 | star = { 11 | -- 'orgmode', -- Life Organization Tool 12 | -- 'runner', -- Code runner for your language 13 | }, 14 | colors = { 15 | "stardark", -- The shiny theme 16 | -- "gruvbox", -- The almighty 17 | -- "icy", -- Shiver to death! 18 | -- "neon", -- Welcome to the light 19 | }, 20 | editor = { 21 | "lsp", -- Language Server Protocols 22 | "lint", -- A beauty teacher for your language 23 | "completion", -- The ultimate completion 24 | "nvim-tree", -- Tree explorer 25 | "symbols", -- LSP symbols and tags 26 | "gitsigns", -- Git signs 27 | "telescope", -- Highly extendable fuzzy finder over lists 28 | "formatter", -- File formatting 29 | "autopairs", -- Autopairs 30 | "commentary", -- Commentary plugin 31 | -- "terminal", -- Terminal for Neovim (NOTE: needed for runner and compiler) 32 | -- 'minimap', -- Code minimap, requires github.com/wfxr/code-minimap 33 | }, 34 | utilities = { 35 | "colorizer", -- Fastets colorizer for Neovim 36 | -- 'lazygit', -- LazyGit integration for Neovim, requires LazyGit 37 | -- 'suda', -- Write and read files without sudo permissions 38 | -- 'range-highlight', -- hightlights ranges you have entered in commandline 39 | }, 40 | } 41 | 42 | return star 43 | -------------------------------------------------------------------------------- /bin/starvim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashincoder/StarVim/24d1f2077885415b2c4dd816d997834af1b3b884/bin/starvim.png -------------------------------------------------------------------------------- /bin/sv-config.example.lua: -------------------------------------------------------------------------------- 1 | -- This is a example config. 2 | -- 'Sv' is the global options object 3 | -- General Settings 4 | Sv.pumheight = 20 5 | Sv.timeoutlen = 100 6 | 7 | Sv.shell = "zsh" 8 | 9 | Sv.undofile = true 10 | 11 | Sv.leader_key = "space" 12 | Sv.colorscheme = "stardark" 13 | 14 | Sv.format_on_save = true 15 | 16 | -- TreeSitter parsers config 17 | Sv.treesitter.ensure_installed = { 18 | "lua", 19 | -- "bash", 20 | -- "json", 21 | -- "python", 22 | -- "c", 23 | -- "c_sharp", 24 | -- "clojure", 25 | -- "comment", 26 | -- "cpp", 27 | -- "commonlisp", 28 | -- "cuda", 29 | -- "dart", 30 | -- "devicetree", 31 | -- "dockerfile", 32 | -- "elixir", 33 | -- "erlang", 34 | -- "go", 35 | -- "fish", 36 | -- "haskell", 37 | -- "java", 38 | -- "jsdoc", 39 | -- "graphql", 40 | -- "julia", 41 | -- "kotlin", 42 | -- "ledger", 43 | -- "latex", 44 | -- "php", 45 | -- "nix", 46 | -- "ocamel", 47 | -- "ql", 48 | -- "regex", 49 | -- "ruby", 50 | -- "rust", 51 | -- "rst", 52 | -- "scss", 53 | -- "sparql", 54 | -- "teal", 55 | -- "toml", 56 | -- "typescript", 57 | -- "vue", 58 | -- "yaml", 59 | -- "zig" 60 | } 61 | Sv.treesitter.ignore_install = { "haskell" } 62 | Sv.treesitter.highlight.enabled = true 63 | 64 | -- lua 65 | -- Sv.lang.lua.formatter.exe = "stylua" 66 | 67 | -- python 68 | -- Sv.lang.python.isort = true 69 | -- Sv.lang.python.diagnostics.virtual_text = true 70 | -- Sv.lang.python.analysis.use_library_code_types = true 71 | -- to change default formatter from yapf to black 72 | -- Sv.lang.python.formatter.exe = "black" 73 | -- Sv.lang.python.formatter.args = {"-"} 74 | 75 | -- go 76 | -- to change default formatter from gofmt to goimports 77 | -- Sv.lang.go.formatter.exe = "goimports" 78 | 79 | -- javascript formatter is prettier 80 | 81 | -- rust 82 | -- Sv.lang.rust.formatter = { 83 | -- exe = "rustfmt", 84 | -- args = { "--emit=stdout" }, 85 | -- } 86 | 87 | -- Additional Plugins 88 | -- Sv.user_plugins = { 89 | -- {"kyazdani42/blue-moon"}, 90 | -- } 91 | 92 | -- Additional Leader bindings for WhichKey 93 | -- Sv.user_which_key = { 94 | 95 | -- A = { 96 | -- name = "+Custom Leader Keys", 97 | -- a = { "'Command for a key'", "Description for a" }, 98 | -- b = { "'Command for b key'", "Description for b" }, 99 | -- }, 100 | 101 | -- } 102 | 103 | -- Additional Autocommands 104 | -- Sv.user_autocommands = { } 105 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | -- Store startup time in seconds 2 | vim.g.start_time = vim.fn.reltime() 3 | 4 | -- Temporarily disable shada file to improve performance 5 | vim.opt.shadafile = "NONE" 6 | 7 | -- Disable some unused built-in Neovim plugins 8 | local disabled_built_ins = { 9 | "netrw", 10 | "gzip", 11 | "zip", 12 | "netrwPlugin", 13 | "netrwSettings", 14 | "tar", 15 | "tarPlugin", 16 | "netrwFileHandlers", 17 | "zipPlugin", 18 | "getscript", 19 | "getscriptPlugin", 20 | "vimball", 21 | "vimballPlugin", 22 | "2html_plugin", 23 | "logipat", 24 | "spellfile_plugin", 25 | "matchit", 26 | } 27 | 28 | for _, plugin in pairs(disabled_built_ins) do 29 | vim.g["loaded_" .. plugin] = 1 30 | end 31 | 32 | -- Disable these for very fast startup time 33 | vim.cmd [[ 34 | filetype off 35 | filetype plugin indent off 36 | ]] 37 | 38 | require "core" 39 | 40 | local async 41 | async = vim.loop.new_async(vim.schedule_wrap(function() 42 | local status_ok, _ = pcall(vim.cmd, "luafile " .. CONFIG_PATH .. "/sv-config.lua") 43 | if not status_ok then 44 | print "Error in sv-config" 45 | end 46 | local compiled_plugins_path = vim.fn.expand "$HOME/.config/nvim/plugin/packer_compiled.lua" 47 | if vim.fn.filereadable(compiled_plugins_path) > 0 then 48 | -- If the current buffer name is empty then trigger Dashboard 49 | if vim.api.nvim_buf_get_name(0):len() == 0 then 50 | vim.cmd "Dashboard" 51 | end 52 | end 53 | vim.opt.shadafile = "" 54 | vim.defer_fn(function() 55 | vim.cmd [[ 56 | rshada! 57 | doautocmd BufRead 58 | filetype on 59 | filetype plugin indent on 60 | silent! bufdo e 61 | ]] 62 | end, 15) 63 | async:close() 64 | end)) 65 | async:send() 66 | -------------------------------------------------------------------------------- /lua/core/README.md: -------------------------------------------------------------------------------- 1 | # The Core of StarVim 2 | 3 | Here lies the hot core of StarVim. 4 | 5 | - Keybindings - The keys to control the Star ship 6 | - Configs - The control center of Star Ship 7 | - Functions - Where all the functions of Ship are defined 8 | - Autocmds - Commands to trigger during specific situations 9 | -------------------------------------------------------------------------------- /lua/core/autocmds/init.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | function M.define_augroups(definitions) -- {{{1 4 | for group_name, definition in pairs(definitions) do 5 | vim.cmd("augroup " .. group_name) 6 | vim.cmd("autocmd!") 7 | 8 | for _, def in pairs(definition) do 9 | local command = table.concat(vim.tbl_flatten({ "autocmd", def }), " ") 10 | vim.cmd(command) 11 | end 12 | 13 | vim.cmd("augroup END") 14 | end 15 | end 16 | 17 | M.define_augroups({ 18 | 19 | _user_autocommands = Sv.user_autocommands, 20 | _general_settings = { 21 | { 22 | "TextYankPost", 23 | "*", 24 | "lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200})", 25 | }, 26 | { 27 | "BufWinEnter", 28 | "*", 29 | "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", 30 | }, 31 | { 32 | "BufRead", 33 | "*", 34 | "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", 35 | }, 36 | { 37 | "BufNewFile", 38 | "*", 39 | "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", 40 | }, 41 | { 42 | "BufWritePost", 43 | "sv-config.lua", 44 | "lua require('core.functions').reload_config()", 45 | }, 46 | { 47 | "BufWritePost", 48 | "starplug.lua", 49 | "lua require('core.functions').reload_config()", 50 | }, 51 | { 52 | "TextChanged,InsertLeave", 53 | "", 54 | "silent! write", 55 | }, 56 | }, 57 | _autolint = { 58 | { 59 | "BufWritePost", 60 | "", 61 | ":silent lua require('lint').try_lint()", 62 | }, 63 | { 64 | "BufEnter", 65 | "", 66 | ":silent lua require('lint').try_lint()", 67 | }, 68 | }, 69 | }) 70 | 71 | return M 72 | -------------------------------------------------------------------------------- /lua/core/config/init.lua: -------------------------------------------------------------------------------- 1 | CONFIG_PATH = vim.fn.stdpath("config") 2 | DATA_PATH = vim.fn.stdpath("data") 3 | CACHE_PATH = vim.fn.stdpath("cache") 4 | TERMINAL = vim.fn.expand("$TERMINAL") 5 | USER = vim.fn.expand("$USER") 6 | 7 | Sv = { 8 | number = true, 9 | relative_number = false, 10 | number_width = 4, 11 | spell = false, 12 | spelllang = "en", 13 | 14 | shiftwidth = 2, 15 | tab_stop = 4, 16 | expandtab = true, 17 | smartindent = true, 18 | 19 | termguicolors = true, 20 | background = "dark", 21 | colorscheme = "stardark", 22 | guifont = "JetBrains Mono:11", 23 | 24 | shell = "zsh", 25 | cmdheight = 1, 26 | 27 | undofile = true, 28 | swapfile = false, 29 | 30 | pumheight = 20, 31 | timeoutlen = 200, 32 | scrolloff = 5, 33 | 34 | ignorecase = true, 35 | hl_search = true, 36 | 37 | leader_key = " ", 38 | format_on_save = true, 39 | lint_on_save = true, 40 | 41 | terminal_width = 70, 42 | terminal_height = 20, 43 | terminal_direction = "horizontal", 44 | 45 | treesitter = { 46 | ensure_installed = "lua", 47 | ignore_install = { "haskell" }, 48 | highlight = { 49 | enabled = true, 50 | use_languagetree = true, 51 | }, 52 | }, 53 | 54 | user_which_key = {}, 55 | user_plugins = { 56 | -- Put plugins in sv-config.lua 57 | }, 58 | user_autocommands = { 59 | { "FileType", "qf", "set nobuflisted" }, 60 | }, 61 | 62 | lang = { 63 | cmake = { 64 | formatter = { 65 | exe = "clang-format", 66 | args = {}, 67 | }, 68 | }, 69 | clang = { 70 | diagnostics = { 71 | virtual_text = { spacing = 0, prefix = "" }, 72 | signs = true, 73 | underline = true, 74 | }, 75 | cross_file_rename = true, 76 | header_insertion = "never", 77 | filetypes = { "c", "cpp", "objc" }, 78 | formatter = { 79 | exe = "clang-format", 80 | args = {}, 81 | }, 82 | }, 83 | css = { 84 | virtual_text = true, 85 | }, 86 | dart = { 87 | sdk_path = "/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot", 88 | formatter = { 89 | exe = "dart", 90 | args = { "format" }, 91 | }, 92 | }, 93 | docker = {}, 94 | efm = {}, 95 | elm = {}, 96 | emmet = { active = true }, 97 | elixir = {}, 98 | graphql = {}, 99 | go = { 100 | formatter = { 101 | exe = "gofmt", 102 | args = {}, 103 | }, 104 | }, 105 | html = {}, 106 | java = { 107 | java_tools = { 108 | active = false, 109 | }, 110 | }, 111 | json = { 112 | diagnostics = { 113 | virtual_text = { spacing = 0, prefix = "" }, 114 | signs = true, 115 | underline = true, 116 | }, 117 | formatter = { 118 | exe = "python", 119 | args = { "-m", "json.tool" }, 120 | }, 121 | }, 122 | kotlin = {}, 123 | latex = { 124 | auto_save = false, 125 | ignore_errors = {}, 126 | }, 127 | lua = { 128 | diagnostics = { 129 | virtual_text = { spacing = 0, prefix = "" }, 130 | signs = true, 131 | underline = true, 132 | }, 133 | formatter = { 134 | exe = "stylua", 135 | args = {}, 136 | stdin = false, 137 | }, 138 | }, 139 | php = { 140 | format = { 141 | format = { 142 | default = "psr12", 143 | }, 144 | }, 145 | environment = { 146 | php_version = "7.4", 147 | }, 148 | diagnostics = { 149 | virtual_text = { spacing = 0, prefix = "" }, 150 | signs = true, 151 | underline = true, 152 | }, 153 | filetypes = { "php", "phtml" }, 154 | formatter = { 155 | exe = "phpcbf", 156 | args = { "--standard=PSR12", vim.api.nvim_buf_get_name(0) }, 157 | stdin = false, 158 | }, 159 | }, 160 | python = { 161 | -- @usage can be flake8 or yapf 162 | isort = false, 163 | diagnostics = { 164 | virtual_text = { spacing = 0, prefix = "" }, 165 | signs = true, 166 | underline = true, 167 | }, 168 | analysis = { 169 | type_checking = "basic", 170 | auto_search_paths = true, 171 | use_library_code_types = true, 172 | }, 173 | formatter = { 174 | exe = "yapf", 175 | args = {}, 176 | }, 177 | }, 178 | ruby = { 179 | diagnostics = { 180 | virtualtext = { spacing = 0, prefix = "" }, 181 | signs = true, 182 | underline = true, 183 | }, 184 | filetypes = { "rb", "erb", "rakefile", "ruby" }, 185 | formatter = { 186 | exe = "rufo", 187 | args = { "-x" }, 188 | }, 189 | }, 190 | rust = { 191 | rust_tools = { 192 | active = false, 193 | parameter_hints_prefix = "<-", 194 | other_hints_prefix = "=>", -- prefix for all the other hints (type, chaining) 195 | }, 196 | -- @usage can be clippy 197 | formatter = { 198 | exe = "rustfmt", 199 | args = { "--emit=stdout", "--edition=2018" }, 200 | }, 201 | diagnostics = { 202 | virtual_text = { spacing = 0, prefix = "" }, 203 | signs = true, 204 | underline = true, 205 | }, 206 | }, 207 | sh = { 208 | -- @usage can be 'shellcheck' 209 | -- @usage can be 'shfmt' 210 | diagnostics = { 211 | virtual_text = { spacing = 0, prefix = "" }, 212 | signs = true, 213 | underline = true, 214 | }, 215 | formatter = { 216 | exe = "shfmt", 217 | args = { "-w" }, 218 | stdin = false, 219 | }, 220 | }, 221 | svelte = {}, 222 | tailwindcss = { 223 | active = false, 224 | filetypes = { 225 | "html", 226 | "css", 227 | "scss", 228 | "javascript", 229 | "javascriptreact", 230 | "typescript", 231 | "typescriptreact", 232 | }, 233 | formatter = { 234 | exe = "prettier", 235 | args = { "--write", "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" }, 236 | stdin = false, 237 | }, 238 | }, 239 | terraform = {}, 240 | tsserver = { 241 | -- @usage can be 'eslint' or 'eslint_d' 242 | diagnostics = { 243 | virtual_text = { spacing = 0, prefix = "" }, 244 | signs = true, 245 | underline = true, 246 | }, 247 | formatter = { 248 | exe = "prettier", 249 | args = { "--write", "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" }, 250 | stdin = false, 251 | }, 252 | }, 253 | vim = {}, 254 | yaml = { 255 | formatter = { 256 | exe = "prettier", 257 | args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" }, 258 | }, 259 | }, 260 | }, 261 | } 262 | 263 | require("core.config.settings") 264 | -------------------------------------------------------------------------------- /lua/core/config/settings.lua: -------------------------------------------------------------------------------- 1 | local opt = vim.opt 2 | 3 | opt.number = Sv.number 4 | opt.numberwidth = Sv.number_width 5 | opt.relativenumber = Sv.relative_number 6 | opt.hlsearch = Sv.hl_search 7 | opt.ignorecase = Sv.ignorecase 8 | opt.termguicolors = Sv.termguicolors -- set term gui colors (most terminals support this) 9 | opt.scrolloff = Sv.scrolloff 10 | opt.timeoutlen = Sv.timeoutlen -- set time out intervel 11 | opt.cmdheight = Sv.cmdheight 12 | opt.guifont = Sv.guifont -- the font used in graphical neovim applications 13 | opt.spell = Sv.spell 14 | opt.spelllang = Sv.spelllang 15 | opt.pumheight = Sv.pumheight -- pop up menu height 16 | opt.undofile = Sv.undofile -- enable persisten undo 17 | opt.swapfile = Sv.swapfile -- creates a swapfile 18 | opt.ruler = false 19 | opt.hidden = true 20 | opt.splitbelow = true 21 | opt.splitright = true 22 | opt.cul = true 23 | opt.updatetime = 250 -- update interval for gitsigns 24 | opt.mouse = "a" -- enable mouse in neovim 25 | opt.signcolumn = "yes" 26 | opt.clipboard = "unnamedplus" 27 | opt.background = Sv.background 28 | 29 | opt.undodir = CACHE_PATH .. "/undo" -- set an undo directory 30 | opt.shortmess:append("sI") -- Disable nvim intro 31 | vim.cmd("let &fcs='eob: '") 32 | 33 | opt.whichwrap:append("<>hl") -- Able to move through a setence with 'h' and 'l' 34 | 35 | -- for indentline 36 | opt.expandtab = Sv.expandtab 37 | opt.shiftwidth = Sv.shiftwidth 38 | opt.smartindent = Sv.smartindent 39 | opt.tabstop = Sv.tab_stop -- insert 4 spaces for a tab 40 | 41 | if Sv.leader_key == " " or Sv.leader_key == "space" then 42 | vim.g.mapleader = " " 43 | else 44 | vim.g.mapleader = Sv.leader_key 45 | end 46 | -------------------------------------------------------------------------------- /lua/core/config/starrc.lua: -------------------------------------------------------------------------------- 1 | local utils = require("utils") 2 | local log = require("core.logging") 3 | 4 | local M = {} 5 | 6 | log.debug("Loading starplug module ...") 7 | 8 | -- default_starrc_values loads the default starrc values 9 | -- @return table 10 | local function default_starrc_values() 11 | return { 12 | ui = { 13 | "dashboard", -- Start screen 14 | "statusline", -- Statusline 15 | "tabline", -- Tabline, shows your buffers list at top 16 | "which-key", -- Keybindings popup menu like Emacs' guide-key 17 | -- 'zen', -- Distraction free environment 18 | -- 'indentlines', -- Show indent lines 19 | }, 20 | star = { 21 | -- 'orgmode', -- Life Organization Tool 22 | -- 'runner', -- Code runner for your language 23 | }, 24 | colors = { 25 | "stardark", -- The shiny theme 26 | -- "gruvbox", -- The almighty 27 | -- "icy", -- Shiver to death! 28 | -- "neon", -- Welcome to the light 29 | }, 30 | editor = { 31 | -- 'terminal', -- Terminal for Neovim (NOTE: needed for runner and compiler) 32 | "nvim-tree", -- Tree explorer 33 | "symbols", -- LSP symbols and tags 34 | -- 'minimap', -- Code minimap, requires github.com/wfxr/code-minimap 35 | "gitsigns", -- Git signs 36 | "telescope", -- Highly extendable fuzzy finder over lists 37 | "formatter", -- File formatting 38 | "autopairs", -- Autopairs 39 | "commentary", -- Comments plugin 40 | "lsp", -- Language Server Protocols 41 | "lint", -- A beauty teacher for your language 42 | }, 43 | utilities = { 44 | -- 'suda', -- Write and read files without sudo permissions 45 | -- 'lazygit', -- LazyGit integration for Neovim, requires LazyGit 46 | -- 'colorizer', -- Fastets colorizer for Neovim 47 | }, 48 | } 49 | end 50 | 51 | -- load_starrc Loads the doomrc if it exists, otherwise it'll fallback to doom 52 | -- default configs. 53 | M.load_starrc = function() 54 | local config 55 | 56 | -- /home/user/.config/doom-nvim/starrc 57 | if vim.fn.filereadable(utils.star_root .. "/starplug.lua") == 1 then 58 | local loaded_starrc, err = pcall(function() 59 | log.debug("Loading the starplug file ...") 60 | config = dofile(utils.star_root .. "/starplug.lua") 61 | end) 62 | 63 | if not loaded_starrc then 64 | log.debug("Error while loading the starplug. Traceback:\n" .. err) 65 | end 66 | else 67 | log.debug("No starplug.lua file found, falling to defaults") 68 | config = default_starrc_values() 69 | end 70 | 71 | return config 72 | end 73 | 74 | return M 75 | -------------------------------------------------------------------------------- /lua/core/functions/init.lua: -------------------------------------------------------------------------------- 1 | local utils = require("utils") 2 | 3 | local M = {} 4 | 5 | function M.reload_config() 6 | vim.cmd("source ~/.config/nvim/lua/core/config/init.lua") 7 | vim.cmd("source ~/.config/nvim/sv-config.lua") 8 | vim.cmd("source ~/.config/nvim/starplug.lua") 9 | vim.cmd("source ~/.config/nvim/lua/modules/init.lua") 10 | vim.cmd(":PackerInstall") 11 | vim.cmd(":PackerCompile") 12 | end 13 | 14 | function M.search_dotfiles() 15 | require("telescope.builtin").find_files({ 16 | prompt_title = "< Neovim Dotfiles >", 17 | cwd = "~/.config/nvim", 18 | }) 19 | end 20 | 21 | -- check_plugin checks if the given plugin exists 22 | -- @tparam string plugin_name The plugin name, e.g. nvim-tree.lua 23 | -- @tparam string path Where should be searched the plugin in packer's path, defaults to `start` 24 | -- @return bool 25 | M.check_plugin = function(plugin_name, path) 26 | if not path then 27 | path = "start" 28 | end 29 | 30 | return vim.fn.isdirectory(vim.fn.stdpath("data") .. "/site/pack/packer/" .. path .. "/" .. plugin_name) == 1 31 | end 32 | 33 | -- is_plugin_disabled checks if the given plugin is disabled in doomrc 34 | -- @tparam string plugin The plugin identifier, e.g. statusline 35 | -- @return bool 36 | M.is_plugin_disabled = function(plugin) 37 | local starrc = require("core.config.starrc").load_starrc() 38 | 39 | -- Iterate over all starrc sections (e.g. ui) and their plugins 40 | for _, section in pairs(starrc) do 41 | if utils.has_value(section, plugin) then 42 | return false 43 | end 44 | end 45 | 46 | return true 47 | end 48 | 49 | -- hide line numbers , statusline in specific buffers! 50 | function M.hideStuff() 51 | vim.api.nvim_exec( 52 | false, 53 | [[ 54 | au TermOpen term://* setlocal nonumber 55 | au TermClose term://* bd! 56 | au BufEnter,BufWinEnter,WinEnter,CmdwinEnter * if bufname('%') == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif 57 | ]] 58 | ) 59 | end 60 | 61 | return M 62 | -------------------------------------------------------------------------------- /lua/core/init.lua: -------------------------------------------------------------------------------- 1 | require("core.config") 2 | require("core.config.settings") 3 | require("modules") 4 | require("core.keybindings") 5 | require("core.autocmds") 6 | require("core.functions") 7 | -------------------------------------------------------------------------------- /lua/core/keybindings/init.lua: -------------------------------------------------------------------------------- 1 | local utils = require("utils") 2 | 3 | local opts = { silent = true, noremap = true } 4 | 5 | -- compe mappings 6 | utils.map("i", "", "v:lua.tab_complete()", { expr = true }) 7 | utils.map("s", "", "v:lua.tab_complete()", { expr = true }) 8 | utils.map("i", "", "v:lua.s_tab_complete()", { expr = true }) 9 | utils.map("s", "", "v:lua.s_tab_complete()", { expr = true }) 10 | utils.map("i", "", "v:lua.completions()", { expr = true }) 11 | 12 | -- dont copy any deleted text , this is disabled by default so uncomment the below mappings if you want them 13 | --[[ remove this line 14 | 15 | utils.map("n", "dd", [=[ "_dd ]=], opt) 16 | utils.map("v", "dd", [=[ "_dd ]=], opt) 17 | utils.map("v", "x", [=[ "_x ]=], opt) 18 | 19 | this line too ]] 20 | 21 | -- Disable accidentally pressing ctrl-z and suspending 22 | utils.map("n", "", "", opts) 23 | 24 | -- Copy whole file content with Ctrl-a 25 | utils.map("n", "", "%y+", opts) 26 | 27 | -- Save with Ctrl-s 28 | utils.map("n", "", "w ", opts) 29 | 30 | -- better indenting 31 | utils.map("v", "<", "", ">gv", opts) 33 | 34 | -- use ESC to turn off search highlighting 35 | utils.map("n", "", "noh", opts) 36 | 37 | -- use ESC to turn off search highlighting 38 | utils.map("t", "", "", opts) 39 | 40 | -- Move selected line / block of text in visual mode 41 | utils.map("x", "K", ":move '<-2gv-gv", opts) 42 | utils.map("x", "J", ":move '>+1gv-gv", opts) 43 | 44 | -- Don't copy the replaced text after pasting in visual mode 45 | utils.map("v", "p", '"_dP', opts) 46 | 47 | -- Commentary 48 | utils.map("n", "/", ":CommentToggle", opts) 49 | utils.map("v", "/", ":CommentToggle", opts) 50 | 51 | -- better window movement 52 | utils.map("n", "", "h", opts) 53 | utils.map("n", "", "j", opts) 54 | utils.map("n", "", "k", opts) 55 | utils.map("n", "", "l", opts) 56 | 57 | -- Windows and Splits 58 | utils.map("n", "wc", "c", opts) -- Close Split 59 | utils.map("n", "ws", "s", opts) -- Horizontal Split 60 | utils.map("n", "wv", "v", opts) -- Vertical Split 61 | utils.map("n", "wl", "5>", opts) -- Expand Split Right 62 | utils.map("n", "wh", "5<", opts) -- Expand Split left 63 | utils.map("n", "wb", "=", opts) -- Balance Splits 64 | utils.map("n", "wj", "resize -5", opts) -- Expand Split above 65 | utils.map("n", "wk", "resize +5", opts) -- Expand Split below 66 | 67 | -- Buffers or Tabs 68 | utils.map("n", "bn", "enew", opts) -- New tab 69 | utils.map("n", "bd", "bd!", opts) -- Close tab 70 | utils.map("n", "bp", "BufferLinePick", opts) -- Pick a buffer or tab 71 | utils.map("n", "", "BufferLineCycleNext", opts) -- Next Tab 72 | utils.map("n", "", "BufferLineCyclePrev", opts) -- Prev Tab 73 | 74 | -- Git 75 | utils.map("n", "gg", "LazyGit", opts) -- Open LazyGit 76 | utils.map("n", "gc", "Telescope git_commits", opts) -- Commits List 77 | utils.map("n", "gC", "Telescope git_bcommits", opts) -- Commits List for current file 78 | utils.map("n", "gb", "Telescope git_branches", opts) -- Branches List 79 | utils.map("n", "gt", "Telescope git_status", opts) -- Git status 80 | 81 | -- Help Telescope 82 | utils.map("n", "hh", "Telescope help_tags", opts) -- help_tags 83 | utils.map("n", "ht", "Telescope builitn", opts) -- builtins 84 | utils.map("n", "hc", "Telescope commands", opts) -- commands 85 | utils.map("n", "hk", "Telescope keymaps", opts) -- keymaps 86 | utils.map("n", "ho", "Telescope vim_options", opts) -- vim options 87 | utils.map("n", "ha", "Telescope autocommands", opts) -- autocommands 88 | 89 | -- Code and LSP -- 90 | -- Lsp Saga 91 | utils.map("n", "cr", "Lspsaga rename", opts) -- Rename function 92 | utils.map("n", "cf", "Lspsaga lsp_finder", opts) -- Find references 93 | utils.map("n", "ca", "Lspsaga code_action", opts) -- Code actions 94 | utils.map("n", "cgn", "Lspsaga diagnostic_jump_next", opts) 95 | utils.map("n", "cgp", "Lspsaga diagnostic_jump_prev", opts) 96 | -- Code 97 | utils.map("n", "cs", "SymbolsOutline", opts) -- Code tree with symbols 98 | utils.map("n", "cd", "Lspsaga preview_definition", opts) -- Preview definition 99 | utils.map("n", "cF", "Format", opts) -- Format buffer 100 | 101 | utils.map("n", "K", "lua vim.lsp.buf.hover()", opts) 102 | utils.map("n", "", "lnext", opts) -- error navigation list 103 | utils.map("n", "", "lprev", opts) -- error navigation list 104 | utils.map("n", "cl", "lua vim.lsp.diagnostic.set_loclist()", opts) -- error list 105 | utils.map("n", "cgD", "lua vim.lsp.buf.definition()", opts) -- jump to definition 106 | utils.map("n", "cgr", "lua vim.lsp.buf.references()", opts) -- go to reference 107 | utils.map("n", "cgi", "lua vim.lsp.buf.implementation()", opts) -- buf implementation 108 | 109 | -- Runner 110 | utils.map("n", "ci", 'lua require("modules.runner").start_repl()', opts) 111 | 112 | -- Plugins 113 | utils.map("n", "pi", "PackerInstall", opts) 114 | utils.map("n", "ps", "PackerSync", opts) 115 | utils.map("n", "pc", "PackerClean", opts) 116 | utils.map("n", "pC", "PackerCompile", opts) 117 | utils.map("n", "pt", "PackerStatus", opts) 118 | utils.map("n", "pr", "lua require('core.functions').reload_config()", opts) 119 | 120 | -- Search 121 | utils.map("n", "sg", "Telescope live_grep", opts) 122 | utils.map("n", "sb", "Telescope current_buffer_fuzzy_find", opts) 123 | utils.map("n", "ss", "Telescope lsp_document_symbols", opts) 124 | utils.map("n", "sh", "Telescope command_history", opts) 125 | utils.map("n", "sm", "Telescope marks", opts) 126 | utils.map("n", "sc", "lua require('telescope.builtin.internal').colorscheme({enable_preview = true})") 127 | 128 | -- Files 129 | utils.map("n", "ff", "Telescope find_files", opts) 130 | utils.map("n", "fm", "Telescope media_files", opts) 131 | utils.map("n", "fc", "lua require('core.functions').search_dotfiles()", opts) 132 | utils.map("n", "fr", "Telescope oldfiles", opts) 133 | utils.map("n", "fb", "Telescope file_browser", opts) 134 | utils.map("n", "fn", "enew", opts) 135 | utils.map("n", "ft", "Format", opts) 136 | utils.map("n", ":", "Telescope command_history", opts) 137 | 138 | -- Sessions 139 | utils.map("n", "qq", "wqa", opts) 140 | utils.map("n", "q!", "qa!", opts) 141 | utils.map("n", "qs", "SessionSave", opts) 142 | utils.map("n", "ql", "SessionLoad", opts) 143 | 144 | -- Terminal 145 | utils.map("n", "tt", "ToggleTerm", opts) 146 | utils.map("n", "ts", "10new +terminal | setlocal nobuflisted ", opts) 147 | utils.map("n", "tv", "vnew +terminal | setlocal nobuflisted", opts) 148 | 149 | -- Nvim Tree 150 | utils.map("n", "e", "NvimTreeToggle", opts) 151 | 152 | -- Zen Mode 153 | utils.map("n", "zz", "TZAtaraxis", opts) 154 | utils.map("n", "zm", "TZMinimalist", opts) 155 | utils.map("n", "zf", "TZFocus", opts) 156 | -------------------------------------------------------------------------------- /lua/core/logging/init.lua: -------------------------------------------------------------------------------- 1 | -- log.lua 2 | -- 3 | -- Inspired by rxi/log.lua 4 | -- Modified by tjdevries and can be found at github.com/tjdevries/vlog.nvim 5 | -- 6 | -- This library is free software; you can redistribute it and/or modify it 7 | -- under the terms of the MIT license. See LICENSE for details. 8 | 9 | ----- CUSTOM SECTION -------------------------------------- 10 | ----------------------------------------------------------- 11 | local utils = require("utils") 12 | local star_config = dofile(utils.star_root .. "/sv-config.lua") 13 | 14 | ----------------------------------------------------------- 15 | ----------------------------------------------------------- 16 | 17 | -- User configuration section 18 | local default_config = { 19 | -- Name of the plugin. Prepended to log messages 20 | plugin = "star", 21 | 22 | -- Should print the output to neovim while running 23 | use_console = true, 24 | 25 | -- Should highlighting be used in console (using echohl) 26 | highlights = true, 27 | 28 | -- Should write to a file 29 | use_file = true, 30 | 31 | -- Any messages above this level will be logged. 32 | -- defaults to info 33 | level = (star_config == nil and "info" or star_config.Sv.shell), 34 | 35 | -- Level configuration 36 | modes = { 37 | { name = "trace", hl = "Comment" }, 38 | { name = "debug", hl = "Comment" }, 39 | { name = "info", hl = "None" }, 40 | { name = "warn", hl = "WarningMsg" }, 41 | { name = "error", hl = "ErrorMsg" }, 42 | { name = "fatal", hl = "ErrorMsg" }, 43 | }, 44 | 45 | -- Can limit the number of decimals displayed for floats 46 | float_precision = 0.01, 47 | } 48 | 49 | -- {{{ NO NEED TO CHANGE 50 | local log = {} 51 | 52 | -- luacheck: ignore 53 | local unpack = unpack or table.unpack 54 | 55 | log.new = function(config, standalone) 56 | config = vim.tbl_deep_extend("force", default_config, config) 57 | 58 | local outfile = string.format("%s/%s.log", vim.api.nvim_call_function("stdpath", { "data" }), config.plugin) 59 | 60 | -- luacheck: ignore 61 | local obj 62 | if standalone then 63 | obj = log 64 | else 65 | obj = {} 66 | end 67 | 68 | local levels = {} 69 | for i, v in ipairs(config.modes) do 70 | levels[v.name] = i 71 | end 72 | 73 | local round = function(x, increment) 74 | increment = increment or 1 75 | x = x / increment 76 | return (x > 0 and math.floor(x + 0.5) or math.ceil(x - 0.5)) * increment 77 | end 78 | 79 | local make_string = function(...) 80 | local t = {} 81 | for i = 1, select("#", ...) do 82 | local x = select(i, ...) 83 | 84 | if type(x) == "number" and config.float_precision then 85 | x = tostring(round(x, config.float_precision)) 86 | elseif type(x) == "table" then 87 | x = vim.inspect(x) 88 | else 89 | x = tostring(x) 90 | end 91 | 92 | t[#t + 1] = x 93 | end 94 | return table.concat(t, " ") 95 | end 96 | 97 | local console_output = vim.schedule_wrap(function(level_config, info, nameupper, msg) 98 | local console_lineinfo = vim.fn.fnamemodify(info.short_src, ":t") .. ":" .. info.currentline 99 | local console_string = string.format("[%-6s%s] %s: %s", nameupper, os.date("%H:%M:%S"), console_lineinfo, msg) 100 | 101 | if config.highlights and level_config.hl then 102 | vim.cmd(string.format("echohl %s", level_config.hl)) 103 | end 104 | 105 | local split_console = vim.split(console_string, "\n") 106 | for _, v in ipairs(split_console) do 107 | vim.cmd(string.format([[echom "[%s] %s"]], config.plugin, vim.fn.escape(v, '"'))) 108 | end 109 | 110 | if config.highlights and level_config.hl then 111 | vim.cmd("echohl NONE") 112 | end 113 | end) 114 | 115 | local log_at_level = function(level, level_config, message_maker, ...) 116 | -- Return early if we're below the config.level 117 | if level < levels[config.level] then 118 | return 119 | end 120 | local nameupper = level_config.name:upper() 121 | 122 | local msg = message_maker(...) 123 | local info = debug.getinfo(2, "Sl") 124 | local lineinfo = info.short_src .. ":" .. info.currentline 125 | 126 | -- Output to console 127 | if config.use_console then 128 | console_output(level_config, info, nameupper, msg) 129 | end 130 | 131 | -- Output to log file 132 | if config.use_file then 133 | local fp = io.open(outfile, "a") 134 | local str = string.format("[%-6s%s] %s: %s\n", nameupper, os.date(), lineinfo, msg) 135 | fp:write(str) 136 | fp:close() 137 | end 138 | end 139 | 140 | for i, x in ipairs(config.modes) do 141 | obj[x.name] = function(...) 142 | return log_at_level(i, x, make_string, ...) 143 | end 144 | 145 | obj[("fmt_%s"):format(x.name)] = function() 146 | return log_at_level(i, x, function(...) 147 | local passed = { ... } 148 | local fmt = table.remove(passed, 1) 149 | local inspected = {} 150 | for _, v in ipairs(passed) do 151 | table.insert(inspected, vim.inspect(v)) 152 | end 153 | return string.format(fmt, unpack(inspected)) 154 | end) 155 | end 156 | end 157 | end 158 | 159 | log.new(default_config, true) 160 | -- }}} 161 | 162 | return log 163 | -------------------------------------------------------------------------------- /lua/modules/configs/autopairs.lua: -------------------------------------------------------------------------------- 1 | local autopairs, autopairs_completion 2 | if 3 | not pcall(function() 4 | autopairs = require("nvim-autopairs") 5 | autopairs_completion = require("nvim-autopairs.completion.compe") 6 | end) 7 | then 8 | return 9 | end 10 | 11 | autopairs.setup() 12 | autopairs_completion.setup({ 13 | map_cr = true, 14 | map_complete = true, -- insert () func completion 15 | }) 16 | -------------------------------------------------------------------------------- /lua/modules/configs/blankline.lua: -------------------------------------------------------------------------------- 1 | -- blankline config 2 | vim.g.indentLine_enabled = 1 3 | vim.g.indent_blankline_char = "▏" 4 | 5 | vim.g.indent_blankline_filetype_exclude = { "help", "terminal", "dashboard" } 6 | vim.g.indent_blankline_buftype_exclude = { "terminal" } 7 | 8 | vim.g.indent_blankline_show_trailing_blankline_indent = false 9 | vim.g.indent_blankline_show_first_indent_level = false 10 | -------------------------------------------------------------------------------- /lua/modules/configs/bufferline.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | local colors = { 4 | white = "#abb2bf", 5 | black = "#1e222a", -- nvim bg 6 | black2 = "#252931", 7 | grey_fg = "#565c64", 8 | light_grey = "#6f737b", 9 | red = "#d47d85", 10 | green = "#A3BE8C", 11 | lightbg = "#2d3139", 12 | lightbg2 = "#262a32", 13 | } 14 | 15 | local bufferline 16 | if not pcall(function() 17 | bufferline = require("bufferline") 18 | end) then 19 | return 20 | end 21 | 22 | M.config = function() 23 | bufferline.setup({ 24 | options = { 25 | offsets = { { filetype = "NvimTree", text = "", padding = 1 } }, 26 | buffer_close_icon = "", 27 | modified_icon = "", 28 | close_icon = "", 29 | left_trunc_marker = "", 30 | right_trunc_marker = "", 31 | diagnostics = "nvim_lsp", 32 | max_name_length = 14, 33 | max_prefix_length = 13, 34 | tab_size = 20, 35 | show_tab_indicators = true, 36 | enforce_regular_tabs = false, 37 | view = "multiwindow", 38 | show_buffer_close_icons = true, 39 | separator_style = "thin", 40 | mappings = true, 41 | always_show_bufferline = true, 42 | }, 43 | highlights = { 44 | fill = { 45 | guifg = colors.grey_fg, 46 | }, 47 | -- buffers 48 | buffer_visible = { 49 | guifg = colors.light_grey, 50 | }, 51 | buffer_selected = { 52 | guifg = colors.white, 53 | gui = "bold", 54 | }, 55 | -- tabs 56 | tab = { 57 | guifg = colors.light_grey, 58 | }, 59 | tab_selected = { 60 | guifg = colors.black2, 61 | }, 62 | tab_close = { 63 | guifg = colors.red, 64 | }, 65 | indicator_selected = { 66 | guifg = colors.black, 67 | }, 68 | -- separators 69 | separator = { 70 | guifg = colors.black2, 71 | }, 72 | separator_visible = { 73 | guifg = colors.black2, 74 | }, 75 | separator_selected = { 76 | guifg = colors.black2, 77 | }, 78 | -- modified 79 | modified = { 80 | guifg = colors.red, 81 | }, 82 | modified_visible = { 83 | guifg = colors.red, 84 | }, 85 | modified_selected = { 86 | guifg = colors.green, 87 | }, 88 | -- close buttons 89 | 90 | close_button = { 91 | guifg = colors.light_grey, 92 | }, 93 | close_button_visible = { 94 | guifg = colors.light_grey, 95 | }, 96 | close_button_selected = { 97 | guifg = colors.red, 98 | }, 99 | }, 100 | }) 101 | end 102 | 103 | return M 104 | -------------------------------------------------------------------------------- /lua/modules/configs/compe.lua: -------------------------------------------------------------------------------- 1 | local compe 2 | if not pcall(function() 3 | compe = require("compe") 4 | end) then 5 | return 6 | end 7 | 8 | compe.setup({ 9 | enabled = true, 10 | autocomplete = true, 11 | debug = false, 12 | min_length = 1, 13 | preselect = "enable", 14 | throttle_time = 80, 15 | source_timeout = 200, 16 | incomplete_delay = 400, 17 | max_abbr_width = 100, 18 | max_kind_width = 100, 19 | max_menu_width = 100, 20 | documentation = true, 21 | source = { 22 | zsh = true, 23 | orgmode = true, 24 | nvim_lsp = true, 25 | nvim_lua = true, 26 | buffer = { kind = "﬘", true }, 27 | luasnip = { kind = "﬌", true }, 28 | }, 29 | }) 30 | 31 | local t = function(str) 32 | return vim.api.nvim_replace_termcodes(str, true, true, true) 33 | end 34 | 35 | local check_back_space = function() 36 | local col = vim.fn.col(".") - 1 37 | if col == 0 or vim.fn.getline("."):sub(col, col):match("%s") then 38 | return true 39 | else 40 | return false 41 | end 42 | end 43 | 44 | _G.tab_complete = function() 45 | if vim.fn.pumvisible() == 1 then 46 | return t("") 47 | elseif check_back_space() then 48 | return t("") 49 | else 50 | return vim.fn["compe#complete"]() 51 | end 52 | end 53 | 54 | _G.s_tab_complete = function() 55 | if vim.fn.pumvisible() == 1 then 56 | return t("") 57 | elseif vim.fn.call("vsnip#jumpable", { -1 }) == 1 then 58 | return t("(vsnip-jump-prev)") 59 | else 60 | return t("") 61 | end 62 | end 63 | 64 | function _G.completions() 65 | local npairs 66 | if not pcall(function() 67 | npairs = require("nvim-autopairs") 68 | end) then 69 | return 70 | end 71 | 72 | if vim.fn.pumvisible() == 1 then 73 | if vim.fn.complete_info()["selected"] ~= -1 then 74 | return vim.fn["compe#confirm"]("") 75 | end 76 | end 77 | return npairs.check_break_line_char() 78 | end 79 | 80 | -- Luasnip 81 | local ls = require("luasnip") 82 | 83 | ls.config.set_config({ 84 | history = true, 85 | updateevents = "TextChanged,TextChangedI", 86 | }) 87 | require("luasnip/loaders/from_vscode").load() 88 | -------------------------------------------------------------------------------- /lua/modules/configs/dashboard.lua: -------------------------------------------------------------------------------- 1 | local g = vim.g 2 | 3 | g.dashboard_disable_at_vimenter = 1 4 | g.dashboard_disable_statusline = 0 5 | 6 | g.dashboard_default_executive = "telescope" 7 | 8 | g.dashboard_custom_header = { 9 | 10 | "███████╗████████╗ █████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", 11 | "██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██║ ██║██║████╗ ████║ ", 12 | "███████╗ ██║ ███████║██████╔╝██║ ██║██║██╔████╔██║ ", 13 | "╚════██║ ██║ ██╔══██║██╔══██╗╚██╗ ██╔╝██║██║╚██╔╝██║ ", 14 | "███████║ ██║ ██║ ██║██║ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║ ", 15 | "╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ", 16 | } 17 | 18 | g.dashboard_custom_section = { 19 | a = { 20 | description = { " Find File SPC f f" }, 21 | command = "Telescope find_files", 22 | }, 23 | b = { 24 | description = { " Recents SPC f o" }, 25 | command = "Telescope oldfiles", 26 | }, 27 | c = { 28 | description = { " Find Word SPC f w" }, 29 | command = "Telescope live_grep", 30 | }, 31 | d = { 32 | description = { "洛 New File SPC f n" }, 33 | command = "enew", 34 | }, 35 | e = { 36 | description = { " Bookmarks SPC b m" }, 37 | command = "Telescope marks", 38 | }, 39 | f = { 40 | description = { " Load Last Session SPC q l" }, 41 | command = "SessionLoad", 42 | }, 43 | } 44 | 45 | g.dashboard_custom_footer = { 46 | "StarVim loaded in " .. vim.fn.printf("%.3f", vim.fn.reltimefloat(vim.fn.reltime(vim.g.start_time))) .. " seconds.", 47 | } 48 | -------------------------------------------------------------------------------- /lua/modules/configs/formatter.lua: -------------------------------------------------------------------------------- 1 | -- autoformat 2 | if Sv.format_on_save then 3 | require("core.autocmds").define_augroups({ 4 | autoformat = { 5 | { 6 | "BufWritePost", 7 | "*", 8 | ":silent FormatWrite", 9 | }, 10 | }, 11 | }) 12 | end 13 | 14 | -- check if formatter has been defined for the language or not 15 | local function formatter_exists(lang_formatter) 16 | if lang_formatter == nil then 17 | return false 18 | end 19 | if lang_formatter.exe == nil or lang_formatter.args == nil then 20 | return false 21 | end 22 | return true 23 | end 24 | 25 | -- returns default formatter for given language 26 | local function formatter_return(lang_formatter) 27 | return { 28 | exe = lang_formatter.exe, 29 | args = lang_formatter.args, 30 | stdin = not (lang_formatter.stdin ~= nil), 31 | } 32 | end 33 | 34 | -- fill a table like this -> {rust: {exe:"sth",args:{"a","b"},stdin=true},go: {}...} 35 | local formatter_filetypes = {} 36 | for k, v in pairs(Sv.lang) do 37 | if formatter_exists(v.formatter) then 38 | local keys = v.filetypes 39 | if keys == nil then 40 | keys = { k } 41 | end 42 | for _, l in pairs(keys) do 43 | formatter_filetypes[l] = { 44 | function() 45 | return formatter_return(v.formatter) 46 | end, 47 | } 48 | end 49 | end 50 | end 51 | 52 | require("formatter").setup({ 53 | logging = false, 54 | filetype = formatter_filetypes, 55 | }) 56 | 57 | if not Sv.format_on_save then 58 | vim.cmd([[if exists('#autoformat#BufWritePost') 59 | :autocmd! autoformat 60 | endif]]) 61 | end 62 | -------------------------------------------------------------------------------- /lua/modules/configs/gitsigns.lua: -------------------------------------------------------------------------------- 1 | require("gitsigns").setup({ 2 | signs = { 3 | add = { hl = "DiffAdd", text = "│", numhl = "GitSignsAddNr" }, 4 | change = { hl = "DiffChange", text = "│", numhl = "GitSignsChangeNr" }, 5 | delete = { hl = "DiffDelete", text = "_", numhl = "GitSignsDeleteNr" }, 6 | topdelete = { hl = "DiffDelete", text = "‾", numhl = "GitSignsDeleteNr" }, 7 | changedelete = { hl = "DiffChange", text = "~", numhl = "GitSignsChangeNr" }, 8 | }, 9 | numhl = false, 10 | keymaps = { 11 | -- Default keymap options 12 | noremap = true, 13 | 14 | ["n ]c"] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns.actions\".next_hunk()'" }, 15 | ["n [c"] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns.actions\".prev_hunk()'" }, 16 | 17 | ["n gs"] = 'lua require"gitsigns".stage_hunk()', 18 | ["v gs"] = 'lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})', 19 | ["n gu"] = 'lua require"gitsigns".undo_stage_hunk()', 20 | ["n gr"] = 'lua require"gitsigns".reset_hunk()', 21 | ["v gr"] = 'lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})', 22 | ["n gR"] = 'lua require"gitsigns".reset_buffer()', 23 | ["n gp"] = 'lua require"gitsigns".preview_hunk()', 24 | ["n gb"] = 'lua require"gitsigns".blame_line(true)', 25 | 26 | -- Text objects 27 | ["o ih"] = ':lua require"gitsigns.actions".select_hunk()', 28 | ["x ih"] = ':lua require"gitsigns.actions".select_hunk()', 29 | }, 30 | watch_index = { 31 | interval = 100, 32 | }, 33 | sign_priority = 5, 34 | status_formatter = nil, -- Use default 35 | }) 36 | -------------------------------------------------------------------------------- /lua/modules/configs/icons.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | local colors = { 4 | white = "#abb2bf", 5 | red = "#d47d85", 6 | baby_pink = "#DE8C92", 7 | pink = "#ff75a0", 8 | vibrant_green = "#7eca9c", 9 | blue = "#61afef", 10 | yellow = "#e7c787", 11 | sun = "#EBCB8B", 12 | dark_purple = "#c882e7", 13 | teal = "#519ABA", 14 | orange = "#fca2aa", 15 | cyan = "#a3b8ef", 16 | } 17 | 18 | M.config = function() 19 | require("nvim-web-devicons").setup({ 20 | override = { 21 | html = { 22 | icon = " ", 23 | color = colors.baby_pink, 24 | name = "html", 25 | }, 26 | css = { 27 | icon = " ", 28 | color = colors.blue, 29 | name = "css", 30 | }, 31 | js = { 32 | icon = " ", 33 | color = colors.sun, 34 | name = "js", 35 | }, 36 | ts = { 37 | icon = "ﯤ ", 38 | color = colors.teal, 39 | name = "ts", 40 | }, 41 | kt = { 42 | icon = "󱈙 ", 43 | color = colors.orange, 44 | name = "kt", 45 | }, 46 | png = { 47 | icon = " ", 48 | color = colors.dark_purple, 49 | name = "png", 50 | }, 51 | jpg = { 52 | icon = " ", 53 | color = colors.dark_purple, 54 | name = "jpg", 55 | }, 56 | jpeg = { 57 | icon = " ", 58 | color = colors.dark_purple, 59 | name = "jpeg", 60 | }, 61 | mp3 = { 62 | icon = " ", 63 | color = colors.white, 64 | name = "mp3", 65 | }, 66 | mp4 = { 67 | icon = " ", 68 | color = colors.white, 69 | name = "mp4", 70 | }, 71 | out = { 72 | icon = " ", 73 | color = colors.white, 74 | name = "out", 75 | }, 76 | Dockerfile = { 77 | icon = " ", 78 | color = colors.cyan, 79 | name = "Dockerfile", 80 | }, 81 | rb = { 82 | icon = " ", 83 | color = colors.pink, 84 | name = "rb", 85 | }, 86 | vue = { 87 | icon = "﵂ ", 88 | color = colors.vibrant_green, 89 | name = "vue", 90 | }, 91 | py = { 92 | icon = " ", 93 | color = colors.cyan, 94 | name = "py", 95 | }, 96 | toml = { 97 | icon = " ", 98 | color = colors.blue, 99 | name = "toml", 100 | }, 101 | lock = { 102 | icon = " ", 103 | color = colors.red, 104 | name = "lock", 105 | }, 106 | zip = { 107 | icon = " ", 108 | color = colors.sun, 109 | name = "zip", 110 | }, 111 | xz = { 112 | icon = " ", 113 | color = colors.sun, 114 | name = "xz", 115 | }, 116 | deb = { 117 | icon = " ", 118 | color = colors.cyan, 119 | name = "deb", 120 | }, 121 | rpm = { 122 | icon = " ", 123 | color = colors.orange, 124 | name = "rpm", 125 | }, 126 | lua = { 127 | icon = " ", 128 | color = colors.blue, 129 | name = "lua", 130 | }, 131 | }, 132 | }) 133 | end 134 | 135 | return M 136 | -------------------------------------------------------------------------------- /lua/modules/configs/linter.lua: -------------------------------------------------------------------------------- 1 | local status_ok, _ = pcall(require, "lint") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | if not Sv.lint_on_save then 7 | vim.cmd([[if exists('#autolint#BufWritePost') 8 | :autocmd! autolint 9 | endif]]) 10 | end 11 | -------------------------------------------------------------------------------- /lua/modules/configs/lsp_config.lua: -------------------------------------------------------------------------------- 1 | local lspconf = require("lspconfig") 2 | 3 | local function on_attach(client, bufnr) 4 | vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") 5 | 6 | local opts = { noremap = true, silent = true } 7 | 8 | local function buf_set_keymap(...) 9 | vim.api.nvim_buf_set_keymap(bufnr, ...) 10 | end 11 | 12 | if client.resolved_capabilities.document_formatting then 13 | buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) 14 | elseif client.resolved_capabilities.document_range_formatting then 15 | buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts) 16 | end 17 | end 18 | 19 | local capabilities = vim.lsp.protocol.make_client_capabilities() 20 | capabilities.textDocument.completion.completionItem.snippetSupport = true 21 | capabilities.textDocument.completion.completionItem.resolveSupport = { 22 | properties = { 23 | "documentation", 24 | "detail", 25 | "additionalTextEdits", 26 | }, 27 | } 28 | 29 | -- lspInstall + lspconfig stuff 30 | 31 | local function setup_servers() 32 | require("lspinstall").setup() 33 | local servers = require("lspinstall").installed_servers() 34 | 35 | for _, lang in pairs(servers) do 36 | if lang ~= "lua" then 37 | lspconf[lang].setup({ 38 | on_attach = on_attach, 39 | capabilities = capabilities, 40 | root_dir = vim.loop.cwd, 41 | }) 42 | elseif lang == "lua" then 43 | lspconf[lang].setup({ 44 | root_dir = vim.loop.cwd, 45 | settings = { 46 | Lua = { 47 | diagnostics = { 48 | globals = { "vim", "Sv" }, 49 | }, 50 | workspace = { 51 | library = { 52 | [vim.fn.expand("$VIMRUNTIME/lua")] = true, 53 | [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true, 54 | }, 55 | maxPreload = 100000, 56 | preloadFileSize = 10000, 57 | }, 58 | telemetry = { 59 | enable = false, 60 | }, 61 | }, 62 | }, 63 | }) 64 | end 65 | end 66 | end 67 | 68 | setup_servers() 69 | 70 | -- replace the default lsp diagnostic letters with prettier symbols 71 | 72 | -- Automatically reload after `:LspInstall ` so we don't have to restart neovim 73 | lspconf.post_install_hook = function() 74 | setup_servers() -- reload installed servers 75 | vim.cmd("bufdo e") -- triggers FileType autocmd that starts the server 76 | end 77 | 78 | vim.fn.sign_define("LspDiagnosticsSignError", { text = "", numhl = "LspDiagnosticsDefaultError" }) 79 | vim.fn.sign_define("LspDiagnosticsSignWarning", { text = "", numhl = "LspDiagnosticsDefaultWarning" }) 80 | vim.fn.sign_define("LspDiagnosticsSignInformation", { text = "", numhl = "LspDiagnosticsDefaultInformation" }) 81 | vim.fn.sign_define("LspDiagnosticsSignHint", { text = "", numhl = "LspDiagnosticsDefaultHint" }) 82 | 83 | vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { 84 | virtual_text = { 85 | prefix = "", 86 | spacing = 0, 87 | }, 88 | signs = true, 89 | underline = true, 90 | 91 | -- set this to true if you want diagnostics to show in insert mode 92 | update_in_insert = false, 93 | }) 94 | 95 | vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { 96 | border = "single", 97 | }) 98 | vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { 99 | border = "single", 100 | }) 101 | 102 | -- suppress error messages from lang servers 103 | vim.notify = function(msg, log_level, _opts) 104 | if msg:match("exit code") then 105 | return 106 | end 107 | if log_level == vim.log.levels.ERROR then 108 | vim.api.nvim_err_writeln(msg) 109 | else 110 | vim.api.nvim_echo({ { msg } }, true, {}) 111 | end 112 | end 113 | -------------------------------------------------------------------------------- /lua/modules/configs/lsp_sign.lua: -------------------------------------------------------------------------------- 1 | require("lsp_signature").on_attach({ 2 | bind = true, 3 | doc_lines = 2, 4 | floating_window = true, 5 | fix_pos = false, 6 | hint_enable = true, 7 | hint_prefix = " ", 8 | hint_scheme = "String", 9 | use_lspsaga = false, 10 | hi_parameter = "Search", 11 | max_height = 12, 12 | max_width = 120, 13 | handler_opts = { 14 | border = "shadow", 15 | }, 16 | extra_trigger_chars = {}, 17 | }) 18 | -------------------------------------------------------------------------------- /lua/modules/configs/lualine.lua: -------------------------------------------------------------------------------- 1 | local function lsp_progress() 2 | local messages = vim.lsp.util.get_progress_messages() 3 | if #messages == 0 then 4 | return 5 | end 6 | local status = {} 7 | for _, msg in pairs(messages) do 8 | table.insert(status, (msg.percentage or 0) .. "%% " .. (msg.title or "")) 9 | end 10 | local spinners = { 11 | "⠋", 12 | "⠙", 13 | "⠹", 14 | "⠸", 15 | "⠼", 16 | "⠴", 17 | "⠦", 18 | "⠧", 19 | "⠇", 20 | "⠏", 21 | } 22 | local ms = vim.loop.hrtime() / 1000000 23 | local frame = math.floor(ms / 120) % #spinners 24 | return table.concat(status, " | ") .. " " .. spinners[frame + 1] 25 | end 26 | 27 | vim.cmd("autocmd User LspProgressUpdate let &ro = &ro") 28 | 29 | local M = {} 30 | 31 | M.config = function() 32 | local status_ok, lualine = pcall(require, "lualine") 33 | if not status_ok then 34 | return 35 | end 36 | 37 | lualine.setup({ 38 | options = { 39 | theme = Sv.colorscheme, 40 | icons_enabled = true, 41 | -- section_separators = { "", "" }, 42 | component_separators = { "", "" }, 43 | }, 44 | sections = { 45 | lualine_a = { "mode" }, 46 | lualine_b = { "branch" }, 47 | lualine_c = { { "diagnostics", sources = { "nvim_lsp" } }, "filename" }, 48 | lualine_x = { "filetype", lsp_progress }, 49 | lualine_y = { "progress" }, 50 | }, 51 | inactive_sections = { 52 | lualine_a = {}, 53 | lualine_b = {}, 54 | lualine_c = {}, 55 | lualine_x = {}, 56 | lualine_y = {}, 57 | lualine_z = {}, 58 | }, 59 | extensions = { "nvim-tree" }, 60 | }) 61 | end 62 | 63 | return M 64 | -------------------------------------------------------------------------------- /lua/modules/configs/luasnip.lua: -------------------------------------------------------------------------------- 1 | local luasnip 2 | if not pcall(function() 3 | luasnip = require("luasnip") 4 | end) then 5 | return 6 | end 7 | 8 | luasnip.config.set_config({ 9 | history = true, 10 | updateevents = "TextChanged,TextChangedI", 11 | }) 12 | require("luasnip/loaders/from_vscode").load() 13 | -------------------------------------------------------------------------------- /lua/modules/configs/nvimtree.lua: -------------------------------------------------------------------------------- 1 | local tree_cb = require("nvim-tree.config").nvim_tree_callback 2 | local g = vim.g 3 | 4 | g.nvim_tree_side = "left" 5 | g.nvim_tree_width = 25 6 | g.nvim_tree_ignore = { ".git", "node_modules", ".cache" } 7 | g.nvim_tree_gitignore = 1 8 | g.nvim_tree_auto_ignore_ft = { "dashboard" } -- don't open tree on specific fiypes. 9 | g.nvim_tree_auto_open = 0 10 | g.nvim_tree_auto_close = 0 -- closes tree when it's the last window 11 | g.nvim_tree_quit_on_open = 0 -- closes tree when file's opened 12 | g.nvim_tree_follow = 1 13 | g.nvim_tree_indent_markers = 1 14 | g.nvim_tree_hide_dotfiles = 1 15 | g.nvim_tree_git_hl = 1 16 | g.nvim_tree_highlight_opened_files = 0 17 | g.nvim_tree_root_folder_modifier = ":t" 18 | g.nvim_tree_tab_open = 0 19 | g.nvim_tree_allow_resize = 1 20 | g.nvim_tree_add_trailing = 0 -- append a trailing slash to folder names 21 | g.nvim_tree_disable_netrw = 1 22 | g.nvim_tree_hijack_netrw = 0 23 | g.nvim_tree_update_cwd = 1 24 | 25 | g.nvim_tree_show_icons = { 26 | git = 1, 27 | folders = 1, 28 | files = 1, 29 | -- folder_arrows= 1 30 | } 31 | g.nvim_tree_icons = { 32 | default = "", 33 | symlink = "", 34 | git = { 35 | unstaged = "✗", 36 | staged = "✓", 37 | unmerged = "", 38 | renamed = "➜", 39 | untracked = "★", 40 | deleted = "", 41 | ignored = "◌", 42 | }, 43 | folder = { 44 | -- disable indent_markers option to get arrows working or if you want both arrows and indent then just add the arrow icons in front ofthe default and opened folders below! 45 | -- arrow_open = "", 46 | -- arrow_closed = "", 47 | default = "", 48 | open = "", 49 | empty = "", --  50 | empty_open = "", 51 | symlink = "", 52 | symlink_open = "", 53 | }, 54 | } 55 | 56 | g.nvim_tree_bindings = { 57 | { key = { "", "o", "<2-LeftMouse>" }, cb = tree_cb("edit") }, 58 | { key = { "<2-RightMouse>", "" }, cb = tree_cb("cd") }, 59 | { key = "", cb = tree_cb("vsplit") }, 60 | { key = "", cb = tree_cb("split") }, 61 | { key = "", cb = tree_cb("tabnew") }, 62 | { key = "<", cb = tree_cb("prev_sibling") }, 63 | { key = ">", cb = tree_cb("next_sibling") }, 64 | { key = "P", cb = tree_cb("parent_node") }, 65 | { key = "", cb = tree_cb("close_node") }, 66 | { key = "", cb = tree_cb("close_node") }, 67 | { key = "", cb = tree_cb("preview") }, 68 | { key = "K", cb = tree_cb("first_sibling") }, 69 | { key = "J", cb = tree_cb("last_sibling") }, 70 | { key = "I", cb = tree_cb("toggle_ignored") }, 71 | { key = "H", cb = tree_cb("toggle_dotfiles") }, 72 | { key = "R", cb = tree_cb("refresh") }, 73 | { key = "a", cb = tree_cb("create") }, 74 | { key = "d", cb = tree_cb("remove") }, 75 | { key = "r", cb = tree_cb("rename") }, 76 | { key = "", cb = tree_cb("full_rename") }, 77 | { key = "x", cb = tree_cb("cut") }, 78 | { key = "c", cb = tree_cb("copy") }, 79 | { key = "p", cb = tree_cb("paste") }, 80 | { key = "y", cb = tree_cb("copy_name") }, 81 | { key = "Y", cb = tree_cb("copy_path") }, 82 | { key = "gy", cb = tree_cb("copy_absolute_path") }, 83 | { key = "[c", cb = tree_cb("prev_git_item") }, 84 | { key = "}c", cb = tree_cb("next_git_item") }, 85 | { key = "-", cb = tree_cb("dir_up") }, 86 | { key = "q", cb = tree_cb("close") }, 87 | { key = "g?", cb = tree_cb("toggle_help") }, 88 | } 89 | -------------------------------------------------------------------------------- /lua/modules/configs/orgmode.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, orgmode = pcall(require, "orgmode") 5 | if not status_ok then 6 | return 7 | end 8 | orgmode.setup({ 9 | org_agenda_files = { "~/Org/*" }, 10 | }) 11 | end 12 | 13 | M.bullets = function() 14 | local status_ok, bullets = pcall(require, "org-bullets") 15 | if not status_ok then 16 | return 17 | end 18 | bullets.setup({ 19 | symbols = { "◉", "○", "✸", "✿" }, 20 | }) 21 | end 22 | 23 | return M 24 | -------------------------------------------------------------------------------- /lua/modules/configs/packer.lua: -------------------------------------------------------------------------------- 1 | local present, packer = pcall(require, "packer") 2 | 3 | if not present then 4 | local packer_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" 5 | 6 | print("Cloning packer..") 7 | -- remove the dir before cloning 8 | vim.fn.delete(packer_path, "rf") 9 | vim.fn.system( 10 | { 11 | "git", 12 | "clone", 13 | "https://github.com/wbthomason/packer.nvim", 14 | "--depth", 15 | "20", 16 | packer_path 17 | } 18 | ) 19 | 20 | present, packer = pcall(require, "packer") 21 | 22 | if present then 23 | print("Packer cloned successfully.") 24 | else 25 | error("Couldn't clone packer !\nPacker path: " .. packer_path) 26 | end 27 | end 28 | 29 | return packer.init { 30 | display = { 31 | open_fn = function() 32 | return require("packer.util").float {border = "single"} 33 | end 34 | }, 35 | git = { 36 | clone_timeout = 600 -- Timeout, in seconds, for git clones 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lua/modules/configs/symbols.lua: -------------------------------------------------------------------------------- 1 | vim.g.symbols_outline = { 2 | highlight_hovered_item = true, 3 | show_guides = true, 4 | position = "right", 5 | keymaps = { 6 | close = "", 7 | goto_location = "", 8 | focus_location = "o", 9 | hover_symbol = "", 10 | rename_symbol = "r", 11 | code_actions = "a", 12 | }, 13 | lsp_blacklist = {}, 14 | } 15 | -------------------------------------------------------------------------------- /lua/modules/configs/telescope.lua: -------------------------------------------------------------------------------- 1 | local present, telescope = pcall(require, "telescope") 2 | if not present then 3 | return 4 | end 5 | 6 | telescope.setup({ 7 | defaults = { 8 | vimgrep_arguments = { 9 | "rg", 10 | "--color=never", 11 | "--no-heading", 12 | "--with-filename", 13 | "--line-number", 14 | "--column", 15 | "--smart-case", 16 | }, 17 | prompt_prefix = " ", 18 | selection_caret = " ", 19 | entry_prefix = " ", 20 | initial_mode = "insert", 21 | selection_strategy = "reset", 22 | sorting_strategy = "descending", 23 | layout_strategy = "horizontal", 24 | layout_config = { 25 | horizontal = { 26 | prompt_position = "top", 27 | preview_width = 0.55, 28 | results_width = 0.8, 29 | }, 30 | vertical = { 31 | mirror = false, 32 | }, 33 | width = 0.87, 34 | height = 0.80, 35 | preview_cutoff = 120, 36 | }, 37 | file_sorter = require("telescope.sorters").get_fzy_sorter, 38 | file_ignore_patterns = {}, 39 | generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, 40 | winblend = 0, 41 | border = {}, 42 | borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, 43 | color_devicons = true, 44 | use_less = true, 45 | set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, 46 | file_previewer = require("telescope.previewers").vim_buffer_cat.new, 47 | grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, 48 | qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, 49 | -- Developer configurations: Not meant for general override 50 | buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker, 51 | }, 52 | extensions = { 53 | fzy_native = { 54 | override_generic_sorter = false, 55 | override_file_sorter = true, 56 | }, 57 | }, 58 | }) 59 | -------------------------------------------------------------------------------- /lua/modules/configs/toggleterm.lua: -------------------------------------------------------------------------------- 1 | require("toggleterm").setup({ 2 | size = Sv.terminal_height, 3 | hide_numbers = true, 4 | shade_filetypes = {}, 5 | shade_terminals = true, 6 | start_in_insert = true, 7 | persist_size = true, 8 | direction = Sv.terminal_direction, 9 | close_on_exit = true, 10 | float_opts = { 11 | border = "curved", 12 | width = Sv.terminal_width, 13 | height = Sv.terminal_height, 14 | winblend = 0, 15 | highlights = { 16 | border = "Special", 17 | background = "Normal", 18 | }, 19 | }, 20 | }) 21 | -------------------------------------------------------------------------------- /lua/modules/configs/treesitter.lua: -------------------------------------------------------------------------------- 1 | local ts_config = require("nvim-treesitter.configs") 2 | 3 | ts_config.setup({ 4 | ensure_installed = Sv.treesitter.ensure_installed, 5 | ignore_installed = Sv.treesitter.ignore_install, 6 | highlight = Sv.treesitter.highlight, 7 | indent = { 8 | enable = true, 9 | }, 10 | }) 11 | -------------------------------------------------------------------------------- /lua/modules/configs/whichkey.lua: -------------------------------------------------------------------------------- 1 | require("which-key").setup({ 2 | plugins = { 3 | marks = true, -- shows a list of your marks on ' and ` 4 | registers = true, -- shows your registers on " in NORMAL or in INSERT mode 5 | spelling = { 6 | enabled = false, -- enabling this will show WhichKey when pressing z= to select spelling suggestions 7 | suggestions = 20, -- how many suggestions should be shown in the list? 8 | }, 9 | presets = { 10 | operators = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion 11 | motions = true, -- adds help for motions 12 | text_objects = true, -- help for text objects triggered after entering an operator 13 | windows = true, -- default bindings on 14 | nav = true, -- misc bindings to work with windows 15 | }, 16 | }, 17 | operators = { 18 | d = "Delete", 19 | c = "Change", 20 | y = "Yank (copy)", 21 | ["g~"] = "Toggle case", 22 | ["gu"] = "Lowercase", 23 | ["gU"] = "Uppercase", 24 | [">"] = "Indent right", 25 | [""] = "Indent left", 26 | ["zf"] = "Create fold", 27 | ["v"] = "Visual Character Mode", 28 | gc = "Comments", 29 | }, 30 | icons = { 31 | breadcrumb = "»", -- symbol used in the command line area that shows your active key combo 32 | separator = "➜ ", -- symbol used between a key and it's label 33 | group = "+", -- symbol prepended to a group 34 | }, 35 | window = { 36 | border = "none", -- none, single, double, shadow 37 | position = "bottom", -- bottom, top 38 | margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] 39 | padding = { 2, 2, 2, 1 }, -- extra window padding [top, right, bottom, left] 40 | }, 41 | layout = { 42 | height = { min = 4, max = 25 }, -- min and max height of the columns 43 | width = { min = 20, max = 50 }, -- min and max width of the columns 44 | spacing = 4, -- spacing between columns 45 | }, 46 | ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label 47 | hidden = { 48 | "", 49 | "", 50 | "", 51 | "", 52 | "call", 53 | "lua", 54 | "^:", 55 | "^ ", 56 | }, -- hide mapping boilerplate 57 | show_help = true, -- show help message on the command line when the popup is visible 58 | triggers = { "" }, -- or specifiy a list manually 59 | }) 60 | 61 | local mappings = { 62 | 63 | ["/"] = "Comment Toggle", 64 | ["w"] = { 65 | name = "+Windows", 66 | ["c"] = { "Close Split" }, 67 | ["h"] = { "Expand Split right" }, 68 | ["l"] = { "Expand Split left" }, 69 | ["j"] = { "Expand Split above" }, 70 | ["k"] = { "Expand Split below" }, 71 | ["b"] = { "Balance Splits" }, 72 | ["s"] = { "Split Horizontal" }, 73 | ["v"] = { "Split Vertical" }, 74 | }, 75 | b = { 76 | name = "+Buffer", 77 | ["Tab"] = { "Next Buffer" }, 78 | ["Shift Tab"] = { "Previous Buffer" }, 79 | ["n"] = { "New Buffer" }, 80 | ["d"] = { "Close Buffer" }, 81 | ["p"] = { "Pick a Buffer" }, 82 | }, 83 | g = { 84 | name = "+Git", 85 | g = { "Open LazyGit" }, 86 | c = { "Checkout Commits" }, 87 | C = { "Checkout commit(for current file)" }, 88 | b = { "Checkout Branch" }, 89 | t = { "Open changed file" }, 90 | j = { "Next Hunk" }, 91 | k = { "Prev Hunk" }, 92 | l = { "Blame" }, 93 | p = { "Preview Hunk" }, 94 | r = { "Reset Hunk" }, 95 | R = { "Reset Buffer" }, 96 | s = { "Stage Hunk" }, 97 | u = { "Undo Stage Hunk" }, 98 | }, 99 | h = { 100 | name = "+Help", 101 | t = { "Builtins" }, 102 | c = { "Commands" }, 103 | h = { "Help Pages" }, 104 | k = { "Key Maps" }, 105 | o = { "Options" }, 106 | a = { "Auto Commands" }, 107 | }, 108 | c = { 109 | name = "+Code", 110 | i = { "Repl" }, 111 | r = { "Rename Function" }, 112 | a = { "Code Actions" }, 113 | f = { "Find Reference" }, 114 | s = { "Toggle Symbols Tree" }, 115 | d = { "Declarations" }, 116 | n = { "Diagnostic next" }, 117 | p = { "Diagnostic prev" }, 118 | l = { "Error List" }, 119 | g = { 120 | name = "+Goto", 121 | D = { "Jump to Definition" }, 122 | r = { "Jump to Reference" }, 123 | i = { " Buf implementation " }, 124 | }, 125 | }, 126 | p = { 127 | name = "+Plugins", 128 | i = { "Install" }, 129 | s = { "Sync" }, 130 | c = { "Clean" }, 131 | C = { "Compile" }, 132 | t = { "Status" }, 133 | r = { "Reload StarVim" }, 134 | }, 135 | s = { 136 | name = "+Search", 137 | g = { "Word Grep" }, 138 | b = { "Search in Buffer" }, 139 | h = { "Command History" }, 140 | m = { "Jump to Marks" }, 141 | c = { "Colorschemes with previwer" }, 142 | }, 143 | f = { 144 | name = "+Files", 145 | f = { "Find Files" }, 146 | c = { "Nvim Config Files" }, 147 | o = { "Open Recent Files" }, 148 | n = { "New File" }, 149 | m = { "Media Files" }, 150 | t = { "Format File" }, 151 | r = { "Format File" }, 152 | b = { "Telescope Browse Files" }, 153 | }, 154 | [":"] = { "Command History" }, 155 | q = { 156 | name = "+Quit/Session", 157 | ["!"] = { "Quit without saving" }, 158 | q = { "Save Quit" }, 159 | s = { "Save Session" }, 160 | l = { "Session Load" }, 161 | }, 162 | t = { 163 | name = "+Terminal", 164 | t = { "Open Terminal" }, 165 | v = { "Vert Split Terminal" }, 166 | s = { "Vert Split Terminal" }, 167 | }, 168 | z = { 169 | name = "+Zen", 170 | z = { "Atraxis Mode" }, 171 | m = { "Minimalist Mode" }, 172 | f = { "Focus Mode" }, 173 | }, 174 | e = { "Nvim Tree" }, 175 | } 176 | 177 | for i = 0, 10 do 178 | mappings[tostring(i)] = "which_key_ignore" 179 | end 180 | 181 | for k, v in pairs(Sv.user_which_key) do 182 | mappings[k] = v 183 | end 184 | 185 | local wk = require("which-key") 186 | 187 | wk.register(mappings, { prefix = "" }) 188 | -------------------------------------------------------------------------------- /lua/modules/configs/zenmode.lua: -------------------------------------------------------------------------------- 1 | -- plugins made by @Pocco81 =) 2 | 3 | local true_zen = require("true-zen") 4 | 5 | true_zen.setup({ 6 | misc = { 7 | on_off_commands = false, 8 | ui_elements_commands = false, 9 | cursor_by_mode = false, 10 | before_minimalist_mode_shown = true, 11 | before_minimalist_mode_hidden = true, 12 | after_minimalist_mode_shown = true, 13 | after_minimalist_mode_hidden = true, 14 | }, 15 | ui = { 16 | bottom = { 17 | laststatus = 0, 18 | ruler = false, 19 | showmode = false, 20 | showcmd = false, 21 | cmdheight = 1, 22 | }, 23 | top = { 24 | showtabline = 0, 25 | }, 26 | left = { 27 | number = false, 28 | relativenumber = false, 29 | signcolumn = "no", 30 | }, 31 | }, 32 | modes = { 33 | ataraxis = { 34 | left_padding = 37, 35 | right_padding = 37, 36 | top_padding = 2, 37 | bottom_padding = 2, 38 | just_do_it_for_me = false, 39 | ideal_writing_area_width = 0, 40 | keep_default_fold_fillchars = true, 41 | custome_bg = "#1e222a", 42 | }, 43 | focus = { 44 | margin_of_error = 5, 45 | focus_method = "experimental", 46 | }, 47 | }, 48 | integrations = { 49 | galaxyline = true, 50 | nvim_bufferline = true, 51 | }, 52 | }) 53 | -------------------------------------------------------------------------------- /lua/modules/init.lua: -------------------------------------------------------------------------------- 1 | local functions = require("core.functions") 2 | 3 | vim.cmd([[packadd packer.nvim]]) 4 | 5 | local present, _ = pcall(require, "modules.configs.packer") 6 | 7 | if present then 8 | packer = require("packer") 9 | else 10 | return false 11 | end 12 | 13 | local use = packer.use 14 | 15 | return packer.startup(function() 16 | use({ "wbthomason/packer.nvim", event = "VimEnter" }) 17 | 18 | ------------------------ UI --------------------------- 19 | 20 | -- Bufferline 21 | local disabled_tabline = functions.is_plugin_disabled("tabline") 22 | use({ 23 | "akinsho/nvim-bufferline.lua", 24 | config = function() 25 | require("modules.configs.bufferline").config() 26 | end, 27 | event = "BufWinEnter", 28 | disable = disabled_tabline, 29 | }) 30 | 31 | -- Statusline 32 | local disabled_statusline = functions.is_plugin_disabled("statusline") 33 | use({ 34 | "ashincoder/lualine.nvim", 35 | config = function() 36 | require("modules.configs.lualine").config() 37 | end, 38 | event = "BufWinEnter", 39 | disable = disabled_statusline, 40 | }) 41 | 42 | -- Colors -- TODO add more colors 43 | local disabled_stardark = functions.is_plugin_disabled("stardark") 44 | use({ "ashincoder/stardark", disable = disabled_stardark }) 45 | 46 | local disabled_neon = functions.is_plugin_disabled("neon") 47 | use({ "ashincoder/neon", disable = disabled_neon }) 48 | 49 | local disabled_gruvbox = functions.is_plugin_disabled("gruvbox") 50 | use({ "ashincoder/gruvbox.nvim", disable = disabled_gruvbox }) 51 | 52 | local disabled_icy = functions.is_plugin_disabled("icy") 53 | use({ "ashincoder/icy.nvim", disable = disabled_icy }) 54 | 55 | use({ 56 | "rktjmp/lush.nvim", 57 | event = "VimEnter", 58 | config = function() 59 | require("lush")(require(Sv.colorscheme)) 60 | end, 61 | }) 62 | 63 | -- Colorizer 64 | local disabled_colorizer = functions.is_plugin_disabled("colorizer") 65 | use({ 66 | "norcalli/nvim-colorizer.lua", 67 | event = "BufRead", 68 | config = function() 69 | require("colorizer").setup() 70 | vim.cmd("ColorizerReloadAllBuffers") 71 | end, 72 | disable = disabled_colorizer, 73 | }) 74 | 75 | ------------------------ Language specific --------------------------- 76 | 77 | -- Completion 78 | local disabled_completion = functions.is_plugin_disabled("completion") 79 | use({ 80 | "hrsh7th/nvim-compe", 81 | event = "InsertEnter", 82 | config = function() 83 | require("modules.configs.compe") 84 | end, 85 | wants = { "LuaSnip" }, 86 | requires = { 87 | { 88 | "tamago324/compe-zsh", 89 | after = "nvim-compe", 90 | }, 91 | { 92 | "L3MON4D3/LuaSnip", 93 | wants = "friendly-snippets", 94 | event = "InsertCharPre", 95 | config = function() 96 | require("modules.configs.luasnip") 97 | end, 98 | }, 99 | { 100 | "rafamadriz/friendly-snippets", 101 | event = "InsertCharPre", 102 | }, 103 | }, 104 | disable = disabled_completion, 105 | }) 106 | 107 | -- Treesitter 108 | use({ 109 | "nvim-treesitter/nvim-treesitter", 110 | run = "TSUpdate", 111 | event = "BufRead", 112 | config = function() 113 | require("modules.configs.treesitter") 114 | end, 115 | }) 116 | 117 | -- LSP 118 | local disabled_lsp = functions.is_plugin_disabled("lsp") 119 | use({ 120 | "kabouzeid/nvim-lspinstall", 121 | module = "lspinstall", 122 | disable = disabled_lsp, 123 | }) 124 | 125 | use({ 126 | "neovim/nvim-lspconfig", 127 | module = "lspconfig", 128 | event = "BufRead", 129 | config = function() 130 | require("modules.configs.lsp_config") 131 | end, 132 | disable = disabled_lsp, 133 | }) 134 | 135 | use({ 136 | "glepnir/lspsaga.nvim", 137 | cmd = "Lspsaga", 138 | module = "lspsaga", 139 | disable = disabled_lsp, 140 | }) 141 | 142 | use({ 143 | "ray-x/lsp_signature.nvim", 144 | event = "InsertEnter", 145 | config = function() 146 | require("modules.configs.lsp_sign") 147 | end, 148 | disable = disabled_lsp, 149 | }) 150 | 151 | -- Linter 152 | local disabled_lint = functions.is_plugin_disabled("lint") 153 | use({ 154 | "mfussenegger/nvim-lint", 155 | config = function() 156 | require("modules.configs.linter") 157 | end, 158 | -- module = "lint", 159 | disable = disabled_lint, 160 | }) 161 | 162 | local disabled_runner = functions.is_plugin_disabled("runner") 163 | use({ 164 | "michaelb/sniprun", 165 | run = "bash install.sh", 166 | disable = disabled_runner, 167 | cmd = { 168 | "SnipRun", 169 | "SnipClose", 170 | "SnipTerminate", 171 | "SnipReset", 172 | "SnipReplMemoryClean", 173 | }, 174 | }) 175 | 176 | -- Viewer & finder for LSP symbols and tags 177 | local disabled_outline = functions.is_plugin_disabled("symbols") 178 | use({ 179 | "simrat39/symbols-outline.nvim", 180 | config = function() 181 | require("modules.configs.symbols") 182 | end, 183 | disable = disabled_outline, 184 | cmd = { 185 | "SymbolsOutline", 186 | "SymbolsOutlineOpen", 187 | "SymbolsOutlineClose", 188 | }, 189 | }) 190 | 191 | use({ 192 | "onsails/lspkind-nvim", 193 | event = "BufRead", 194 | config = function() 195 | require("lspkind").init() 196 | end, 197 | disable = disabled_lsp, 198 | }) 199 | 200 | -- Formatter 201 | local disabled_formatter = functions.is_plugin_disabled("formatter") 202 | use({ 203 | "mhartington/formatter.nvim", 204 | config = function() 205 | require("modules.configs.formatter") 206 | end, 207 | event = "BufRead", 208 | disable = disabled_formatter, 209 | }) 210 | 211 | ------------------------ File manager, Picker, Fuzzy finder --------------------------- 212 | 213 | -- Icons 214 | use({ 215 | "kyazdani42/nvim-web-devicons", 216 | after = "lush.nvim", 217 | config = function() 218 | require("modules.configs.icons").config() 219 | end, 220 | }) 221 | 222 | local disabled_tree = functions.is_plugin_disabled("nvim-tree") 223 | use({ 224 | "kyazdani42/nvim-tree.lua", 225 | cmd = "NvimTreeToggle", 226 | config = function() 227 | require("modules.configs.nvimtree") 228 | end, 229 | disable = disabled_tree, 230 | }) 231 | 232 | -- Lua Libraries 233 | use({ "nvim-lua/popup.nvim", module = "popup" }) 234 | use({ "nvim-lua/plenary.nvim", module = "plenary" }) 235 | 236 | -- Telescope 237 | local disabled_telescope = functions.is_plugin_disabled("telescope") 238 | use({ 239 | "nvim-telescope/telescope.nvim", 240 | cmd = "Telescope", 241 | module = "telescope", 242 | config = function() 243 | require("modules.configs.telescope") 244 | end, 245 | disable = disabled_telescope, 246 | }) 247 | 248 | -- Git stuff 249 | local disabled_lazygit = functions.is_plugin_disabled("lazygit") 250 | use({ 251 | "kdheepak/lazygit.nvim", 252 | disable = disabled_lazygit, 253 | cmd = { "LazyGit", "LazyGitConfig" }, 254 | keys = "gg", 255 | }) 256 | 257 | local disabled_gitsigns = functions.is_plugin_disabled("gitsigns") 258 | use({ 259 | "lewis6991/gitsigns.nvim", 260 | config = function() 261 | require("modules.configs.gitsigns") 262 | end, 263 | module = "gitsigns", 264 | keys = "g", 265 | disable = disabled_gitsigns, 266 | }) 267 | 268 | ------------------------ Misc Plugins ------------------------- 269 | 270 | local disabled_range_highlight = functions.is_plugin_disabled("range-highlight") 271 | use({ 272 | "winston0410/range-highlight.nvim", 273 | requires = { 274 | { "winston0410/cmd-parser.nvim", opt = true, module = "cmd-parser" }, 275 | }, 276 | config = function() 277 | require("range-highlight").setup() 278 | end, 279 | disable = disabled_range_highlight, 280 | event = "BufRead", 281 | }) 282 | 283 | -- Write / Read files without permissions (e.vim.g. /etc files) without having 284 | -- to use `sudo nvim /path/to/file` 285 | local disabled_suda = functions.is_plugin_disabled("suda") 286 | use({ 287 | "lambdalisue/suda.vim", 288 | disable = disabled_suda, 289 | cmd = { "SudaRead", "SudaWrite" }, 290 | }) 291 | 292 | local disabled_minimap = functions.is_plugin_disabled("minimap") 293 | use({ 294 | "rinx/nvim-minimap", 295 | cmd = { 296 | "Minimap", 297 | "MinimapClose", 298 | "MinimapToggle", 299 | "MinimapRefresh", 300 | "MinimapUpdateHighlight", 301 | }, 302 | disable = disabled_minimap, 303 | }) 304 | 305 | local disabled_orgmode = functions.is_plugin_disabled("orgmode") 306 | use({ 307 | "kristijanhusak/orgmode.nvim", 308 | ft = { "org" }, 309 | config = function() 310 | require("modules.configs.orgmode").config() 311 | end, 312 | disable = disabled_orgmode, 313 | }) 314 | 315 | use({ 316 | "akinsho/org-bullets.nvim", 317 | after = "orgmode.nvim", 318 | config = function() 319 | require("modules.configs.orgmode").bullets() 320 | end, 321 | disable = disabled_orgmode, 322 | }) 323 | 324 | -- Terminal 325 | local disabled_terminal = functions.is_plugin_disabled("terminal") 326 | use({ 327 | "akinsho/nvim-toggleterm.lua", 328 | config = function() 329 | require("modules.configs.toggleterm") 330 | end, 331 | disable = disabled_terminal, 332 | module = { "toggleterm", "toggleterm.terminal" }, 333 | cmd = { "ToggleTerm", "TermExec" }, 334 | keys = { "n", "t" }, 335 | }) 336 | 337 | -- WhichKey 338 | local disabled_whichkey = functions.is_plugin_disabled("which-key") 339 | use({ 340 | "folke/which-key.nvim", 341 | keys = "", 342 | config = function() 343 | require("modules.configs.whichkey") 344 | end, 345 | disable = disabled_whichkey, 346 | }) 347 | 348 | -- AutoPairs 349 | local disabled_autopairs = functions.is_plugin_disabled("autopairs") 350 | use({ 351 | "windwp/nvim-autopairs", 352 | after = "nvim-compe", 353 | config = function() 354 | require("modules.configs.autopairs") 355 | end, 356 | disable = disabled_autopairs, 357 | }) 358 | 359 | -- Matching parens 360 | use({ "andymass/vim-matchup", event = "CursorMoved" }) 361 | 362 | -- Commentary 363 | local disabled_commentary = functions.is_plugin_disabled("commentary") 364 | use({ 365 | "terrortylor/nvim-comment", 366 | cmd = "CommentToggle", 367 | config = function() 368 | require("nvim_comment").setup() 369 | end, 370 | disable = disabled_commentary, 371 | }) 372 | 373 | -- Dashboard 374 | local disabled_dashboard = functions.is_plugin_disabled("dashboard") 375 | use({ 376 | "glepnir/dashboard-nvim", 377 | config = function() 378 | require("modules.configs.dashboard") 379 | end, 380 | event = "BufWinEnter", 381 | disable = disabled_dashboard, 382 | }) 383 | 384 | use({ 385 | "jdhao/better-escape.vim", 386 | event = "InsertEnter", 387 | config = function() 388 | vim.g.better_escape_interval = 300 389 | vim.g.better_escape_shortcut = { "jk" } 390 | end, 391 | }) 392 | 393 | -- Smooth Scroll 394 | local disabled_neoscroll = functions.is_plugin_disabled("neoscroll") 395 | use({ 396 | "karb94/neoscroll.nvim", 397 | event = "WinScrolled", 398 | config = function() 399 | require("neoscroll").setup() 400 | end, 401 | disable = disabled_neoscroll, 402 | }) 403 | 404 | -- Zen Mode 405 | local disabled_zen = functions.is_plugin_disabled("zen") 406 | use({ 407 | "Pocco81/TrueZen.nvim", 408 | cmd = { "TZAtaraxis", "TZMinimalist", "TZFocus" }, 409 | config = function() 410 | require("modules.configs.zenmode") 411 | end, 412 | disable = disabled_zen, 413 | }) 414 | 415 | -- Indent lines 416 | local disabled_indent_lines = functions.is_plugin_disabled("indentlines") 417 | use({ 418 | "lukas-reineke/indent-blankline.nvim", 419 | event = "BufRead", 420 | setup = function() 421 | require("modules.configs.blankline") 422 | end, 423 | disable = disabled_indent_lines, 424 | }) 425 | 426 | for _, plugin in pairs(Sv.user_plugins) do 427 | packer.use(plugin) 428 | end 429 | end) 430 | -------------------------------------------------------------------------------- /lua/modules/runner/init.lua: -------------------------------------------------------------------------------- 1 | local log = require("core.logging") 2 | local term 3 | 4 | -- selene: allow(undefined_variable) 5 | if packer_plugins and packer_plugins["nvim-toggleterm.lua"] then 6 | term = require("toggleterm.terminal").Terminal 7 | else 8 | log.error("runner needs toggleterm plugin, please uncomment the 'terminal' entry in your starplug") 9 | end 10 | 11 | local M = {} 12 | 13 | -- Currently supported languages, 14 | -- filetype → binary to execute 15 | local languages = { 16 | vlang = "v", 17 | lua = "lua", 18 | ruby = "ruby", 19 | python = "python3", 20 | javascript = "node", 21 | typescript = "ts-node", 22 | } 23 | 24 | -- start_repl starts a REPL for the current filetype, e.g. a Python file 25 | -- will open a Python3 REPL 26 | M.start_repl = function() 27 | local filetype = vim.bo.filetype 28 | local repl_cmd = languages[filetype] 29 | 30 | local opened_repl, err = pcall(function() 31 | if repl_cmd then 32 | local repl = term:new({ cmd = repl_cmd, hidden = true }) 33 | repl:open() 34 | else 35 | log.error("There is no REPL for " .. filetype .. ". Maybe it is not yet supported in the runner plugin?") 36 | end 37 | end) 38 | 39 | if not opened_repl then 40 | log.error("Error while trying to opening a repl for " .. filetype .. ". Traceback:\n" .. err) 41 | end 42 | end 43 | 44 | return M 45 | -------------------------------------------------------------------------------- /lua/utils/init.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.star_root = vim.fn.expand("$HOME/.config/nvim") 4 | M.star_logs = DATA_PATH .. "/star.log" 5 | 6 | -- mappings wrapper, extracted from 7 | M.map = function(mode, lhs, rhs, opts) 8 | local options = { noremap = true } 9 | if opts then 10 | options = vim.tbl_extend("force", options, opts) 11 | end 12 | vim.api.nvim_set_keymap(mode, lhs, rhs, options) 13 | end 14 | 15 | -- Check if string is empty or if it's nil 16 | -- @return bool 17 | M.is_empty = function(str) 18 | return str == "" or str == nil 19 | end 20 | 21 | -- Search if a table have the value we are looking for, 22 | -- useful for plugins management 23 | M.has_value = function(tabl, val) 24 | for _, value in ipairs(tabl) do 25 | if value == val then 26 | return true 27 | end 28 | end 29 | 30 | return false 31 | end 32 | 33 | return M 34 | --------------------------------------------------------------------------------