Re-order buffer to next
-| | Re-order buffer to previous
+| pen
+| | Start screen
+| | Tree explorer
+| | Minimap
+| | LSP Symbols
+| | Terminal
| lugin
| | Clean unused plugins
+| | Compile your plugins changes
| | Install missing plugins
| | Profile the time taken loading your plugins
| | Sync plugins (Clean and Update)
-| | Update plugins
-| unner
-| | Run restclient in the current cursor line
-| ession
-| | Session switcher/selector
-| | Save current session
+| | Plugins status
+| uit /
+| sessions
+| | Session switcher
+| | Quit
| | Restore previously saved session
-| oggler
-| | Change colorscheme
-| | Toggle Tree Explorer
-| | Toggle Minimap
-| | Toggle Symbols view
-| | Toggle Start Screen
-| | Toggle Terminal
+| | Save current session
+| | Save and quit
+| earch
+| | Buffer
+| | Grep
+| | Command history
+| | Jump to mark
+| | Goto symbol
| indow
-| | Close current window
-| | Close all other windows
-| | Split horizontally
-| | Split vertically
+| | <-> Split window below
+| | <2> Layout double columns
+| | <=> Balance window
+| | <|> Split window right
+| | Delete window
+| | Expand window left
+| | Window left
+| | Expand window below
+| | Window below
+| | Expand window up
+| | Window up
+| | Expand window right
+| | Window right
+| | Split window below
+| | Split window right
+| | Other window
But there is still more, Doom Nvim knows that you love to use the keyboard but
you do not like to be typing so much so it has more keybindings that will make
@@ -552,21 +417,30 @@ your life easier!
| | Cycle buffers (next buffer)
| | Cycle buffers (prev buffer)
| | Search highlighting off
-| | Toggle Tagbar
+| | Toggle Symbols-Outline
| | Toggle Tree Explorer
| | Toggle Terminal
| | Toggle Minimap
-| | ToggleZen mode
-| | Run restclient
-| | Fast exit from Doom Nvim (also dumps `:messages` to logs)
+| | Toggle Zen mode
+| | Run rest client
+| | Fast exit from Doom Nvim
+| | Fast exit from `INSERT` mode
+| | Comment current line (`NORMAL` mode)
| | Comment selected block (`VISUAL` mode)
+| | Select window left
+| | Select window below
+| | Select window up
+| | Select window right
+| | Resize window up
+| | Resize window below
+| | Resize window left
+| | Resize window right
You can modify the default keybindings by modifying the following files:
- - `config/keybindings.vim` - general keybindings
- - `config/plugins/leader-mapper.vim` - SPC keybindings
- - `lua/configs` - lua plugins keybindings
+ - `lua/doom/core/keybindings/init.lua` - General keybindings
+ - `lua/doom/modules/config` - Lua plugins keybindings
-You can also make your own keybindings by editing your `doomrc` file.
+You can also make your own keybindings by editing your `doom_config.lua` file.
==============================================================================
@@ -577,8 +451,8 @@ preferred Neovim GUI.
By default, if no files were opened, Doom Nvim will show the start menu
`dashboard-nvim` where you can select files to edit or if you have a saved
-session in the current workspace, Doom will load it automatically
-if you want to.
+session in the current workspace, Doom will load it automatically if you
+want to.
==============================================================================
@@ -588,19 +462,18 @@ Doom Nvim uses the default Vim keybindings to move around: `h` `j` `k` `l`
and the cursor keys.
Use `h` go to left, `j` to go down, `k` to go up, `l` to go right.
- ^
- k
+ ^
+ k
- < h ยท l >
+
- j
- v
+ j
+ v
See `Tutor` to know how to use Vim and its keybindings.
To move around buffers execute b to select the `buffers` section
-and then press the key corresponding to the buffer you want to select (`1-9`)
-or press `` to cycle buffers.
+and then press the key to select a buffer or press `` to cycle buffers.
==============================================================================
@@ -615,19 +488,17 @@ KNOWN ISSUES *doom_nvim_issues*
FAQ *doom_nvim_faq*
- General
- - What type of vimmer is Doom Nvim intended for?
+ - Who is Doom Nvim intended for?
-Doom Nvim is intended for all types of Vimmer who want a stable and efficient
+Doom Nvim is intended for anyone who wants a stable and efficient
development environment without spending a lot of time setting everything up.
- - Why does Doom Nvim only support Neovim nightly?
-
-Doom Nvim doesn't support Neovim versions lower than Nightly (0.5) due to:
-- some features would be lost
-- Not all Lua plugins have good alternatives in Vimscript, so the experience
- would not be the same
-- performance would not be the same as Lua cannot be used
+ - Why does Doom Nvim only support Neovim 0.5.0 (and beyond)?
+Doom Nvim relies on lua for the configuration and use of many plugins. Since
+lua is not available in neovim 0.4.4 and below, it is not possible to use Doom
+Nvim with a neovim version lower than 0.5.0. However, the Doom Nvim installer
+automatically installs Neovim 0.5.0 for you!
==============================================================================
HACKING DOOM NVIM *doom_nvim_hacking*
@@ -636,41 +507,40 @@ Doom Nvim aims to be hackable to suit everyone's needs. Therefore
This is the structure of Doom Nvim:
-๏ . # Doom Nvim root
-โโโ ๏ autoload # Files loaded at launch
-โ โโโ ๎ซ color.vim # Color utilities, required by `doom-one.vim`
-โ โโโ ๏ health # Doom Nvim health add-ons for `:checkhealth`
-โโโ ๏ colors # Pre-installed colorschemes directory
-โ โโโ ๎ซ doom-one.vim # `romgrk` doom colorscheme ported to Nvim (`default`)
-โโโ ๏ doc # Doom Nvim documentation to be used inside Nvim
-โ โโโ ๏
doom_nvim.txt # Doom Nvim help file
-โโโ ๏ docs # Doom Nvim docs meant to be readed on GitHub
-โโโ ๏ doomrc # Doom Nvim user configurations file
-โโโ ๎ init.lua # init.lua file
-โโโ ๏ install.sh # Doom Nvim installer
-โโโ ๏ LICENSE # Doom Nvim License
-โโโ ๏ logs # Location of Doom Nvim logs
-โ โโโ ๏ doom.log # Doom Nvim logs
-โ โโโ ๏ report.md # Doom Nvim crash reports, does not exists by default
-โโโ ๏ lua # Location of Doom Nvim Lua files
-โ โโโ ๏ doom # Doom Nvim Lua core
-โ โ โโโ ๏ autocmds # Doom Nvim autocommands
-โ โ โโโ ๏ config # Doom Nvim configuration files
-โ โ โโโ ๏ default # Doom Nvim default Neovim settings
-โ โ โโโ ๏ functions # Doom Nvim functions
-โ โ โโโ ๏ health # Doom Nvim health checking
-โ โ โโโ ๏ keybindings # Doom Nvim keybindings
-โ โ โโโ ๏ logging # Doom Nvim logging system
-โ โ โโโ ๏ system # Doom Nvim system utilities (early stage)
-โ โ โโโ ๏ utils # Doom Nvim Lua utilities
-โ โโโ ๏ plugins # Location of Doom Nvim plugins
-โ โโโ ๏ configs # Plugins configurations
-โ โโโ ๎ init.lua # packer.nvim setup
-โโโ ๏ sessions # Location of Neovim workspaces
-
-Doom Nvim also creates the `BFC`, which serves as the user configuration file
+. # Doom Nvim root
+โโโ autoload # Files loaded at launch
+โ โโโ health # Doom Nvim health add-ons for `:checkhealth`
+โโโ colors # Pre-installed colorschemes directory
+โ โโโ doom-one.vim # doom-one colorscheme ported to Nvim (`default one`)
+โโโ doc # Doom Nvim documentation to be used inside Nvim
+โ โโโ doom_nvim.txt # Doom Nvim help file
+โโโ docs # Doom Nvim docs meant to be readed on GitHub
+โโโ doomrc # Doom Nvim user configurations file
+โโโ init.lua # init.lua file
+โโโ install.sh # Doom Nvim installer
+โโโ LICENSE # Doom Nvim License
+โโโ lua # Location of Doom Nvim Lua files
+โ โโโ doom # Doom Nvim Lua core
+โ โ โโโ core # Doom Nvim core functionality
+โ โ โ โโโ autocmds # Doom Nvim autocommands
+โ โ โ โโโ config # Doom Nvim configuration files
+โ โ โ โโโ default # Doom Nvim default Neovim settings
+โ โ โ โโโ functions # Doom Nvim functions
+โ โ โ โโโ health # Doom Nvim health checking
+โ โ โ โโโ keybindings # Doom Nvim keybindings
+โ โ โ โโโ logging # Doom Nvim logging system
+โ โ โ โโโ system # Doom Nvim system utilities (early stage)
+โ โ โโโ utils # Doom Nvim utilities
+โ โโโ modules # Location of Doom Nvim plugins
+โ โโโ configs # Plugins configurations
+โ โโโ built-in # Doom Nvim built-in plugins
+โ โโโ init.lua # packer.nvim setup
+โโโ sessions # Location of Neovim workspaces
+
+Doom Nvim also sets default configurations for the `doomrc.lua` and the
+`doom_config.lua` files, which serves as the user configuration file
if it is not present on the system. It allows a fine control over the core
-functions of Doom Nvim. It is a copy of the doom.vim file.
+functions of Doom Nvim.
==============================================================================
@@ -698,34 +568,16 @@ ACKNOWLEDGEMENTS *doom_nvim_acknowledgements*
Doom Nvim would not have been possible had it not been for
- - hlissner : Creator of Doom Emacs
- - romgrk : Ported doom-one colorscheme from Doom Emacs to Vim
+ - hlissner : Creator of Doom Emacs
+ - romgrk : Ported doom-one colorscheme from Doom Emacs to Vim
+ - All our contributors
==============================================================================
LICENSE *doom_nvim_license*
-Doom Nvim is distributed under MIT License.
-
-Copyright (c) 2021 NTBBloodbath
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
+Doom Nvim is distributed under GPLv2 license.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
==============================================================================
CONTRIBUTING *doom_nvim_contributing*
@@ -733,151 +585,11 @@ CONTRIBUTING *doom_nvim_contributing*
- I really love pull requests and bug reports
(please see the Contributing Guidelines on GitHub before contributing)
-- Don't hesitate to tell me my Lua coding style sucks, but please tell me why
- (I am new to Lua, I may have some bad practices that can be fixed in code).
+- Don't hesitate to tell me my Lua coding style sucks, but please tell me why.
==============================================================================
CHANGELOG *doom_nvim_changelog*
-The format is based on Keep a Changelog (https://keepachangelog.com/en/1.0.0/),
-and this project adheres to Semantic Versioning
-(https://semver.org/spec/v2.0.0.html).
-
-- 2.1.5
- - Changed
- - Installation script will not install packer anymore, it'll be installed by Doom
- when started for the first time
- - Fixed
- - Now core plugins will be installed at first start
-- 2.1.4
- - Fixed
- - TreeSitter syntax highlighting and indentation
-- 2.1.3
- - Removed
- - Unused code in packer setup
- - Fixed
- - Some bugs in packer setup
-- 2.1.2
- - Removed
- - `Is_directory` function in `utils/`
- - Fixed
- - Squashed bugs in `Check_plugin` function
- - Installation script will install packer.nvim in `start/` and not in `opt/`
-- 2.1.1
- - Fixed
- - Squashed a bug in packer setup
- - Stop referencing autoload in docs
-- 2.1.0
- - Added
- - Now the `:messages` are logged automatically on exit, should provide
- a better debugging experience
- - Plugins
- - Configurations
- - `devicons` configurations, set proper icons for certain filetypes
- (most of them related to web development)
- - Changed
- - Configurations
- - Better defaults
- - Breaking changes
- - doomrc is not using Vimscript anymore, please see
- the new doomrc format
- - Plugins
- - Replaced
- - `indentLine` in favour of `indent-blankline.lua`
- - Updated
- - New `galaxyline` appearance, should look better now :)
- - `WhichKey` configurations, some improvements
- - `nvim-toggleterm` configurations, some improvements
- - Moved `dashboard` configurations to
- `lua/plugins/configs/nvim-dashboard.lua`
- - Misc
- - Refact Doom Nvim README
- - Deleted
- - Doom autoload files
- (we are already _almost_ completely free from Vimscript!)
- - Fixed
- - Some typos
- - Squashed some bugs
- - Lua style (global things to Capitalize), no more warns about that
-- 2.0.0
- - Added
- - Configurations
- - `g:doom_autoload_last_session` variable, see |doom_nvim_options|
- - `g:doom_terminal_direction` variable, see |doom_nvim_options|
- - `g:doom_terminal_width` variable, see |doom_nvim_options|
- - `g:doom_terminal_height` variable, see |doom_nvim_options|
- - Plugins
- - `auto-session`
- - Changed
- - Installation script
- - Now you can select the branch to use (main, develop)
- - Lua migration
- - init
- - configs
- - plugins
- - Implemented better custom plugins system,
- see |doom_nvim_configuration_custom_plugins|
- - Start using TreeSitter based indentation
- - Plugins
- - Replaced
- - `Goyo` in favour of `TrueZen`
- - `leader-mapper` in favour of `WhichKey`
- - `Vista.vim` in favour of `SymbolsOutline`
- - `Neoformat` in favour of `format.nvim`
- - `nvim-autopairs` in favour of `pears.nvim`
- - Updated
- - `nvim-toggleterm` configurations
- - Other changes
- - `telescope.nvim` cannot be disabled anymore
- - Keybindings
- - Refact some `` bindings
- - Use `:TZAtaraxis` as F6 key bind
- - New `:dr` map, easily create crash reports
- - Misc
- - Cleaned some code hunk
- - Formatted all files
- - Refact changelog
- - Deleted
- - Old Vimscript configs codebase
- - Plugins
- - Deleted `vim-polyglot` in favour of TreeSitter based
- syntax highlighting
- - Fixed
- - Some bugs that I don't really remember
- - Squashed bugs on autoload functions
-- 1.2.1
- - Added
- - New branch `develop`
- - Changed
- - Improved installation script
-- 1.2.0
- - Added
- - Configurations
- - `g:doom_ts_parsers`, see |doom_nvim_options|
- - New key binding for toggle terminal,
- see |doom_nvim_commands_keybindings|
- - `doomrc` template with the default options values
- - Basic implementation for `:checkhealth` command
- - Plugins
- - `gitsigns`
- - `indentLine`
- - `nvim-lspinstall`
- - Some new colorschemes, see |doom_colorscheme|
- - Changed
- - Improved `:DoomUpdate` command
- - Some minor changes more under the hood
- - Plugins
- - `signify` in favor of `gitsigns`
- - Fixed
- - Squashed some bugs
-- 1.1.0
- - Added
- - `Doom` section to `vim-leader-guide` plugin,
- see |doom_nvim_commands_keybindings|
- - `:DoomUpdate` command,
- see |doom_nvim_commands|
- - `g:doom_autosave_sessions`,
- see |doom_nvim_options|
-- 1.0.0
- - Initial stable release
+Please see `$HOME/.config/doom-nvim/CHANGELOG.md` for a full and detailed
+changelog.
diff --git a/doc/tags b/doc/tags
index 591e97f62..eb61b32c5 100644
--- a/doc/tags
+++ b/doc/tags
@@ -10,7 +10,7 @@ doom_nvim_configuration_layout doom_nvim.txt /*doom_nvim_configuration_layout*
doom_nvim_configuration_layout_explorer doom_nvim.txt /*doom_nvim_configuration_layout_explorer*
doom_nvim_configuration_layout_mainbuffer doom_nvim.txt /*doom_nvim_configuration_layout_mainbuffer*
doom_nvim_configuration_layout_minimap doom_nvim.txt /*doom_nvim_configuration_layout_minimap*
-doom_nvim_configuration_layout_tagbar doom_nvim.txt /*doom_nvim_configuration_layout_tagbar*
+doom_nvim_configuration_layout_outline doom_nvim.txt /*doom_nvim_configuration_layout_outline*
doom_nvim_configuration_layout_terminal doom_nvim.txt /*doom_nvim_configuration_layout_terminal*
doom_nvim_configuration_lsp doom_nvim.txt /*doom_nvim_configuration_lsp*
doom_nvim_configuration_modules doom_nvim.txt /*doom_nvim_configuration_modules*
diff --git a/docs/README.md b/docs/README.md
index 3f39a6669..a30c3373b 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -4,8 +4,8 @@ Doom Nvim is a port to Neovim of the [Doom Emacs](https://github.com/hlissner/do
configuration framework for [GNU Emacs](https://www.gnu.org/software/emacs/) adapted
for all vimmer who want less framework in their framework and the performance of
a handmade configuration (or better). It can be a base for your own setup or a
-resource for Vim enthusiasts to learn more about our favorite editor and how to
-do X things on it by using Vimscript/Lua.
+resource for Neovim enthusiasts to learn more about our favorite editor and how to
+do X things on it by using Lua.
Doom Nvim is an opinionated collection of reasonable (and optional) defaults with
a focus on performance (both runtime and startup) and on abstraction-light, readable
@@ -14,42 +14,32 @@ code design, so that there is less between you and Neovim.
> The documentation is designed to be viewed within Doom Nvim. Access it by pressing
> `:h doom_nvim`.
-# Table of Contents
-- [Documentation](#documentation)
- - [Getting Started](#getting-started)
- - [Modules](#modules)
- - [Contributing](#contributing)
-- [Community Resources](#community-resources)
- - [Asking for help](#asking-for-help)
- - [Projects](#projects)
+## Documentation
-# Documentation
-
-## Getting Started
+### Getting Started
- [Install](./getting_started.md#install)
- [Update & Rollback](./getting_started.md#update--rollback)
- [Configuration](./getting_started.md#configuration)
-## Modules
+### Modules
- [Introduction](./modules.md#introduction)
- [Tweaking Doom Nvim Modules](./modules.md#tweaking-doom-nvim-modules)
-## Contributing
+### Contributing
- [Where can I help?](./contributing.md#where-can-i-help)
- [Reporting issues](./contributing.md#reporting-issues)
- [Suggesting features, keybinds and enhancements](./contributing.md#suggesting-features-keybinds-and-enhancements)
- [Contributing code](./contributing.md#contributing-code)
+## Community Resources
-# Community Resources
-
-## Asking for help
+### Asking for help
- [Our issues tracker](https://github.com/NTBBloodbath/doom-nvim/issues)
-## Projects
+### Projects
- [Projects](https://github.com/NTBBloodbath/doom-nvim/projects)
diff --git a/docs/contributing.md b/docs/contributing.md
index 245aee5f2..1c0dce524 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -11,22 +11,7 @@ and which code style you should use :heart:
> **Working on your first Pull Request?** You can learn how from this _free_ series
> [How to Contribute to an Open Source Project on GitHub](https://kcd.im/pull-request).
-# Table of Contents
-
-- [Where can I help?](#where-can-i-help)
-- [Reporting issues](#reporting-issues)
- - [Acquire a backtrace from errors](#acquire-a-backtrace-from-errors)
- - [Create a step-by-setp reproduction guide](#create-a-ste-by-step-reproduction-guide)
- - [Include information about your Doom Nvim install](include-information-about-your-doom-nvim-install)
-- [Suggesting features, keybinds and enhancements](#suggesting-features-keybinds-and-enhancements)
-- [Contributing code](#contributing-code)
- - [Conventions](#conventions)
- - [Code style](#code-style)
- - [Commits & PRs](#commits--prs)
- - [Keybind conventions](#keybind-conventions)
- - [Submitting pull requests](#submitting-pull-requests)
-
-# Where can I help
+## Where can I help
- If youโve encountered a bug, [file a bug report](https://github.com/NTBBloodbath/doom-nvim/issues/new/choose).
- Check out our [issue tracker](https://github.com/NTBBloodbath/doom-nvim/issues)
@@ -38,56 +23,49 @@ and which code style you should use :heart:
so that it works correctly on your environment, you can do it freely since I
currently do not have that system to do tests.
-# Reporting issues
+## Reporting issues
-## Acquire a backtrace from errors
+### Acquire a backtrace from errors
-All the errors ocurred in Doom Nvim are saved into a `doom.log` file inside a `logs/`
-directory inside your Doom Nvim root dir (`$HOME/.config/doom-nvim` by default).
-If the logs are very long, please paste it using a [gist].
+All the errors ocurred in Doom Nvim are saved into a `doom.log` file inside the
+`~/.local/share/nvim/` directory. If the logs are very long, please paste it
+using a [gist].
-> **NOTE:** Alternatively you can paste the most recent lines starting with the
-> following if the logs are extremely long.
->
-> [!] - Errors
->
-> [!!!] - Critical errors
-
-## Create a step-by-step reproduction guide
+### Create a step-by-step reproduction guide
A step-by-step guide can help considerably to debug the error that occurs and
thus reach a solution more quickly.
-## Include information about your Doom Nvim install
+### Include information about your Doom Nvim install
Some important data would be:
-- Your Neovim version
-- Your custom configuration if you have one (`$HOME/.config/doom-nvim/doomrc`)
+- Your custom configuration if you have one
+ (`doomrc.lua`, `doom_config.lua` and `plugins.lua`)
- Which branch of Doom Nvim are you using
- Which plugins are you using
-# Suggest features, keybinds and enhancements
+## Suggest features, keybinds and enhancements
-- To request a new feature, please use the prefix `[Feature Request]` in your issue.
-- To request a keybind, please use the prefix `[Keybind Request]` in your issue.
-- To request an enhancement, please use the prefix `[Enhancement]` in your issue.
+- To request a new feature, please use the prefix `Feature request:` in your issue.
+- To request a keybind, please use the prefix `Keybind request:` in your issue.
+- To request an enhancement, please use the prefix `Enhancement:` in your issue.
In this way, it is much easier and more organized to identify the
type of issue and handle the requests.
-# Contributing code
+## Contributing code
-## Conventions
+### Conventions
-### Code style
+#### Code style
Doom Nvim follows some code style rules like ones the mentioned below:
-- Single quotes instead of double quotes.
+- Single quotes over double quotes.
+- Tabs over spaces.
- Variable names in `snake_case`, except in the BASH installation script.
-- Function names in `snake_case`, the only exception are the Vimscript functions
- which does not are from doom itself, e.g. `function ToggleTerm() ... endfunction`.
+- Function names in `snake_case`.
- [stylua] is used to format lua files with the following configuration:
```toml
@@ -99,20 +77,31 @@ quote_style = "AutoPreferSingle"
```
-### Commits & PRs
+> **NOTE:** use `--config-path /path/to/doom/nvim/stylua.toml` to use doom's
+> stylua configuration.
+
+- [selene] is a blazing-fast modern Lua linter written in Rust which is used for
+ linting doom's source code. We make use of some custom rules so we can be sure
+ that selene will not raise false errors.
+
+> **NOTE:** use `selene .` in doom's root dir and selene will automatically
+> detect the `selene.toml` and `doom.toml` files.
+
+#### Commits & PRs
- Target `develop` instead of `main`.
- the only exception are hotfixes!
+ The only exception are hotfixes!
-### Keybind conventions
+#### Keybind conventions
-- The keybindings should be declared in [config/keybindings](../lua/doom/keybindings.lua),
- except when they are keybindings of [Lua plugins](../lua/plugins/configs).
+- The keybindings should be declared in [core/keybindings](../lua/doom/core/keybindings/init.lua),
+ except when they are keybindings of [Lua plugins](../lua/doom/modules/config).
-## Submitting pull requests
+### Submitting pull requests
-After having made all your changes and having tested them locally to certify that
-they work and do not break any of the current code, you can proceed to upload
+After having made all your changes **and having tested them locally to certify that**
+**they work and do not break any of the current code**, you can proceed to upload
your pull request :)
[stylua]: https://github.com/JohnnyMorganz/StyLua
+[selene]: https://github.com/Kampfkarren/selene
diff --git a/docs/faq.md b/docs/faq.md
index f74b3966c..3aa43aa24 100644
--- a/docs/faq.md
+++ b/docs/faq.md
@@ -1,20 +1,16 @@
# Frequently Asked Questions
-# Table of Contents
-- [General](#general)
- - [What type of vimmer is Doom Nvim intended for?](#what-type-of-vimmer-is-doom-nvim-intended-for)
- - [Why does Doom Nvim only support Neovim nightly?](#why-does-doom-nvim-only-support-neovim-nightly)
+## General
-# General
-
-## What type of vimmer is Doom Nvim intended for?
+### What type of vimmer is Doom Nvim intended for?
Doom Nvim is intended for all types of Vimmer who want a stable and efficient
development environment without spending a lot of time setting everything up.
-## Why does Doom Nvim only support Neovim nightly?
+### Why does Doom Nvim only support Neovim 0.5+?
+
+Doom Nvim doesn't support Neovim versions lower than the current stable (0.5) due to:
-Doom Nvim doesn't support Neovim versions lower than Nightly (0.5) due to:
- some features would be lost
- Not all Lua plugins have good alternatives in Vimscript, so the experience
would not be the same
diff --git a/docs/getting_started.md b/docs/getting_started.md
index 730f2943c..3707fa72e 100644
--- a/docs/getting_started.md
+++ b/docs/getting_started.md
@@ -1,64 +1,36 @@
# Getting Started
-# Table of Contents
-
-- [Install](#install)
- - [Neovim & dependencies](#neovim--dependencies)
- - [On Linux](#on-linux)
- - [Ubuntu](#ubuntu)
- - [Arch Linux](#arch)
- - [On MacOS](#on-macos)
- - [On Windows](#on-windows)
- - [External dependencies](#external-dependencies)
- - [On Linux](#on-linux)
- - [Ubuntu](#ubuntu)
- - [Fedora](#fedora)
- - [Arch Linux](#arch)
- - [On MacOS](#on-macos)
- - [On Windows](#on-windows)
- - [Doom Nvim](#doom-nvim)
-- [Update & Rollback](#update--rollback)
- - [Update Doom Nvim](#update-doom-nvim)
- - [Rollback](#rollback)
-- [Configuration](#configuration)
- - [Modules](#modules)
- - [Package Management](#package-management)
- - [Installing plugins](#installing-plugins)
- - [Disabling plugins](#disabling-plugins)
- - [Configuring Doom](#configuring-doom)
- - [Configuring settings](#configuring-settings)
- - [Configuring plugins](#configuring-plugins)
- - [Configuring LSP](#configuring-lsp)
- - [Binding keys](#binding-keys)
-
-# Install
+## Install
This is what you will have installed by the end of this section:
- Git 2.23+
-- Neovim 0.5.0 (Neovim 0.4 not supported, see [faq](https://github.com/NTBBloodbath/doom-nvim/blob/main/docs/faq.md#why-does-doom-nvim-only-support-neovim-nightly) to know why)
-- ripgrep 11.0+
+- Neovim 0.5.0+ (Neovim 0.4.x not supported, see [faq](./faq.md#why-does-doom-nvim-only-support-neovim-05) to know why)
- GNU Find
-- (Optional) fd 7.3.0+ (known as `fd-find` on Debian, Ubuntu & derivates),
+- **Optional**: ripgrep 11.0+
+- **Optional**: fd 7.3.0+ (known as `fd-find` on Debian, Ubuntu & derivates),
improves performance for many file indexing commands
-- (Optional) node & npm, required to use LanguageServerProtocols (LSP).
+- **Optional**: node & npm, required to use LanguageServerProtocols (LSP) and the plugins using LSP, like the symbols-outline plugin.
These packages ought to be available through the package managers of your OS;
i.e. pacman/aptitude/rpm/etc on the various Linux distributions.
-## Neovim & dependencies
+### Neovim & dependencies
-### On Linux
+#### On Linux
-Since Neovim 0.5 is a night version, it does not come packaged in the repositories
-of your distribution, so you have several options to install it.
+Neovim 0.5.0 was recently released as a stable version.
+You can check what version your repository has by looking at [this site.](https://repology.org/project/neovim/versions)
+If Neovim 0.5.0 is still not available in your repository, you can install it by doing one of the following:
1. Using the Doom Nvim install script to download a Neovim Nightly AppImage from releases
(see how by executing the installer with bash -s -- -h).
2. Using extra repositories according to your distribution (PPA/COPR/AUR/etc).
-#### Ubuntu
+3. Using a Neovim version manager like [nvenv](https://github.com/NTBBloodbath/nvenv).
+
+##### Ubuntu
You can get nightly builds of git master from the
[Neovim Unstable PPA](https://launchpad.net/~neovim-ppa/+archive/ubuntu/unstable).
@@ -68,19 +40,30 @@ add-apt-repository ppa:neovim-ppa/unstable
apt-get update
```
-#### Arch
+##### Fedora
+
+Nightly builds can be installed by using the
+[agriffis/neovim-nightly](https://copr.fedorainfracloud.org/coprs/agriffis/neovim-nightly/)
+COPR repository.
+
+```sh
+dnf copr enable agriffis/neovim-nightly
+dnf update
+```
+
+##### Arch
Neovim Nightly builds can be installed using the PKGBUILD
[`neovim-nightly-bin`](https://aur.archlinux.org/packages/neovim-nightly-bin),
available on the [AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository).
-### On MacOS
+#### On MacOS
-You can download a prebuilt binary from the [Neovim](https://github.com/neovim/neovim/releases/tag/nightly) nightly releases page.
+You can download a prebuilt binary from the [Neovim](https://github.com/neovim/neovim/releases/tag/nightly) releases page.
-1. Download: ``` curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz```
-2. Extract: ``` tar xzvf nvim-macos.tar.gz```
-3. Run: ```./nvim-osx64/bin/nvim```
+1. Download: `curl -LO https://github.com/neovim/neovim/releases/download/v0.5.0/nvim-macos.tar.gz`
+2. Extract: `tar xzvf nvim-macos.tar.gz`
+3. Run: `./nvim-osx64/bin/nvim`
You may wish to add it to your PATH using something like:
`export PATH="$HOME/nvim-osx64/bin:$PATH"`
@@ -89,7 +72,7 @@ Neovim nightly can also be downloaded with [homebrew](https://brew.sh/):
`brew install --HEAD neovim` will download the source and build it locally on your machine.
-If you already have Neovim v4 installed you may need to unlink it.
+If you already have Neovim v0.4 installed you may need to unlink it.
```
brew unlink neovim
@@ -97,52 +80,73 @@ brew install neovim --HEAD
nvim --version
```
-MacPorts currently only has Neovim v4.4
+MacPorts currently only has Neovim v0.4.4
+
+
+
+#### On Windows
+
+##### [Chocolatey](https://community.chocolatey.org/)
+
+```
+choco install neovim --pre
+```
+##### [Scoop](https://scoop.sh/)
+```
+scoop bucket add versions
+scoop install neovim-nightly
+```
-### On Windows
+##### Manual
-If you use Windows, please put the steps to install Neovim Nightly here!
+You can also download a prebuilt binary from the [Neovim](https://github.com/neovim/neovim/releases) releases page.
-## External dependencies
+### External dependencies
-### On Linux
+#### On Linux
-#### Ubuntu
+##### Ubuntu
```sh
# Required dependencies
apt-get install git ripgrep
+
# (Optional) Improves performance for many file indexing commands
apt-get install fd-find
-# (Optional) Required by Language Server Protocols
+
+# (Optional) Required by some Language Server Protocols
apt-get install nodejs npm
```
-#### Fedora
+##### Fedora
```sh
# Required dependencies
dnf install git ripgrep
+
# (Optional) Improves performance for many file indexing commands
dnf install fd-find # is 'fd' in Fedora <28
-# (Optional) Required by Language Server Protocols
+
+# (Optional) Required by some Language Server Protocols
dnf install nodejs
```
-#### Arch
+##### Arch
```sh
# Required dependencies
pacman -S git ripgrep
+
# (Optional) Improves performance for many file indexing commands
pacman -S fd
-# (Optional) Required by Language Server Protocols
+
+# (Optional) Required by some Language Server Protocols
pacman -S nodejs npm
```
-### On MacOS
+#### On MacOS
Dependencies can be installed using [homebrew](https://brew.sh/)
@@ -156,22 +160,22 @@ brew install node
```
-### On Windows
+#### On Windows
If you use Windows, please help by posting the steps to install the external
dependencies here!
-## Doom Nvim
+### Doom Nvim
-With Neovim Nightly and Doom's dependencies installed, next is to install
+With Neovim v0.5.0 and Doom's dependencies installed, next is to install
Doom Nvim itself:
> **NOTES:**
-
-1. If you have not installed Neovim Nightly yet, please run the following command
- before installing Doom Nvim, it will install Neovim nightly and Doom Nvim.
-2. If you want to know all the commands of the installer, run the installer with
- bash -s -- -h instead of just bash.
+>
+> 1. If you have not installed Neovim 0.5.0 yet, please run the following command
+> before installing Doom Nvim, it will install Neovim 0.5.0 and Doom Nvim.
+> 2. If you want to know all the commands of the installer, run the installer with
+> bash -s -- -h instead of just bash.
```sh
# Check if you have all the dependencies listed above
@@ -179,135 +183,383 @@ curl -sLf https://raw.githubusercontent.com/NTBBloodbath/doom-nvim/main/install.
```
```sh
-# If you do not have Neovim nightly but you have all the dependencies listed above
+# If you do not have Neovim 0.5.0 but you have all the dependencies listed above
curl -sLf https://raw.githubusercontent.com/NTBBloodbath/doom-nvim/main/install.sh | bash -s -- -n
```
```sh
-# If you already have Neovim nightly and all the dependencies listed above
+# If you already have Neovim 0.5.0 and all the dependencies listed above
curl -sLf https://raw.githubusercontent.com/NTBBloodbath/doom-nvim/main/install.sh | bash
```
The installation script will set up everything for you and will work you through
the first-time setup of Doom Nvim.
-# Update & Rollback
+#### Using cheovim
-## Update Doom Nvim
+If you're using cheovim as your Neovim configurations manager you can use the
+recipe listed in cheovim documentation:
+
+```lua
+doom_nvim = { "~/.config/doom-nvim", {
+ plugins = "packer",
+ preconfigure = "doom-nvim"
+ }
+}
+```
+
+## Update & Rollback
+
+### Update Doom Nvim
To update Doom Nvim, you have two options, run `:DoomUpdate` inside Neovim or
run the installation script with bash -s -- -u.
-## Rollback
+### Rollback
+
+#### Previous Configurations
To uninstall Doom Nvim and go back to your previous setup, simply run the
installation script with bash -s -- -x. It will uninstall Doom Nvim
and restore the backup of your previous setup.
-# Configuration
+#### Rolling Back Doom
-You can configure Doom Nvim by tweaking the file `doomrc` in your Doom Nvim root
-dir (`$HOME/.config/doom-nvim/` by default), please see
-:h doom_nvim for more information.
+Did the update screwed up your setup because of a bug or a breaking change and you want to rollback?
+Then you're lucky. Just run `:DoomRollback` in Neovim and Doom will rollback itself to
+a previous release (for main branch) or a previous commit (for development branch).
-## Modules
+> **IMPORTANT**: remember to report the issues before just rolling back. In that
+> way we can work on fixing them and make doom better!
-Doom Nvim consists of around 7 modules and growing. A Doom Nvim Module is a bundle of plugins,
-configuration and commands, organized into a unit that can be toggled easily by
-tweaking your doomrc (found in `$HOME/.config/doom-nvim`).
+## Configuration
-Please see [Package Management](#package-management) for more information.
+You can configure Doom Nvim by tweaking the `doomrc.lua`, `doom_config.lua` and
+the `plugins.lua` files located in your Doom Nvim root directory
+(`$HOME/.config/doom-nvim/` by default).
-> **IMPORTANT:** any changes to your Doom Nvim Modules won't take effect until
-> you run `:PackerSync` inside Neovim.
+### doomrc.lua
-## Package Management
+This file handles all the Doom Nvim modules, its structure is really simple and
+easy to understand.
-Doom Nvim does not use Vim-Plug in the Neovim Nightly version. Instead, it uses
-a declarative and use-package inspired package manager called
-[packer.nvim](https://github.com/wbthomason/packer.nvim).
+This one will look like that:
+
+```lua
+local doom = {
+ ui = {
+ 'dashboard', -- Start screen
+ -- 'doom-themes', -- Additional doom emacs' colorschemes
+ 'statusline', -- Statusline
+ 'tabline', -- Tabline, shows your buffers list at top
+ -- 'zen', -- Distraction free environment
+ 'which-key', -- Keybindings popup menu like Emacs' guide-key
+ -- 'indentlines', -- Show indent lines
+ },
+ doom = {
+ -- 'neorg', -- Life Organization Tool
+ -- 'runner', -- Open a REPL for the current language or run the current file
+ -- 'compiler', -- Compile (and run) your code with just pressing three keys!
+ },
+ editor = {
+ 'auto-session', -- A small automated session manager for Neovim
+ -- 'terminal', -- Terminal for Neovim (NOTE: needed for runner and compiler)
+ 'explorer', -- Tree explorer
+ 'symbols', -- LSP symbols and tags
+ -- 'minimap', -- Code minimap, requires github.com/wfxr/code-minimap
+ 'gitsigns', -- Git signs
+ 'telescope', -- Highly extendable fuzzy finderover lists
+ -- 'restclient', -- A fast Neovim http client
+ 'formatter', -- File formatting
+ 'autopairs', -- Autopairs
+ -- 'editorconfig', -- EditorConfig support for Neovim
+ 'kommentary', -- Comments plugin
+ 'lsp', -- Language Server Protocols
+ 'snippets', -- LSP snippets
+ },
+ langs = {
+ -- To enable the language server for a language justadd the +lsp flag
+ -- at the end, e.g. 'rust +lsp'. This will install the rust TreeSitter
+ -- parser and rust-analyzer
+ --
+ -- 'html', -- HTML support
+ -- 'css', -- CSS support
+ -- 'javascript', -- JavaScript support
+ -- 'typescript', -- TypeScript support
+ -- 'bash', -- The terminal gods language
+ -- 'python +lsp', -- Python support + lsp
+ -- 'ruby', -- Look ma, I love the gems!
+ 'lua', -- Support for our gods language
+ -- 'elixir', -- Build scalable and maintainablesoftware
+ -- 'haskell', -- Because Functional programming is fun, isn't it?
+
+ -- 'rust +lsp', -- Let's get rusty!
+ -- 'go', -- Hello, gopher
+ -- 'cpp', -- C++ support
+ -- 'java', -- Java support
+
+ -- 'config', -- Configuration files (JSON, YAML, TOML)
+ -- 'dockerfile', -- Do you like containers, right?
+ },
+ utilities = {
+ -- 'suda', -- Write and read files without sudo permissions
+ -- 'lazygit', -- LazyGit integration for Neovim, requires LazyGit
+ -- 'neogit', -- Magit for Neovim
+ -- 'colorizer', -- Fastets colorizer for Neovim
+ 'range-highlight', -- hightlights ranges you haveentered in commandline
+ },
+}
-Modules and plugins are declared in `lua/plugins/init.lua` file, located in your Doom Nvim root dir.
-Read on to learn how to use this system to install your own plugins.
+return doom
+```
-> **WARNING:** Do not install plugins directly in `lua/plugins/init.lua`. Instead,
-> use your `doomrc` to modify them.
+And as the `doomrc.lua` file self-documentation says, you will only need to uncomment
+or comment the plugins names in order to enable or disable them. e.g. to enable the `terminal`
+plugin you will only need to uncomment the `-- 'terminal',` line and restart Neovim.
+Doom will automatically handle your changes and install the `terminal` plugin for you.
-### Installing plugins
+> **NOTE**: for more information please refer to [modules].
-To install a custom plugin, add it to `custom_plugins` field into the `Doom` table
-in your `doomrc`.
+### doom_config.lua
+
+This file handles all the Doom Nvim configurations, including the ability to easily
+create new custom mappings and global Neovim variables.
+
+All the options are self-documented on it so you can easily modify them and know
+exactly what you are doing.
+
+This is its structure:
```lua
--- @default = {}
-custom_plugins = { 'plugin_author/plugin_repo' }
+local doom = {
+ -- Here lies all the Doom Nvim configurations
+}
+
+local nvim = {
+ -- Here lies all the custom Neovim configurations
+}
+
+return {
+ doom = doom,
+ nvim = nvim,
+}
```
-You can also use other method if the plugin depends on other plugins.
+### plugins.lua
+
+This file handles your custom plugins, in other words, it handles all the extra
+plugins you need that are not covered by Doom Nvim.
+
+If you are familiar with [packer.nvim] then you can see this file as a wrapper
+for its `use` function.
+
+This one just contains a `return {}` statement. Your plugins should be declared
+inside the returned table, e.g. if you want to install `markdown-preview.nvim`:
```lua
-custom_plugins = {
- 'plugin_author/plugin_repo',
+return {
{
- 'repo': 'plugin_author/second_plugin_repo',
- 'enabled': true, -- not required, true by default
- 'requires': { 'foo', 'bar' } -- not required if the plugin does not have dependencies
+ 'iamcco/markdown-preview.nvim',
+ run = 'cd app && yarn install',
+ event = 'BufRead',
},
}
```
-> **NOTES:**
->
-> 1. Do not forget to run `:PackerInstall` to install your new plugins.
+And as with the `doomrc.lua` file, Doom Nvim will automatically handle your changes
+and install or uninstall the plugins declared on here.
+
+> **NOTE**: all the valid options for declaring plugins can be found in
+> [specifying plugins](https://github.com/wbthomason/packer.nvim#specifying-plugins).
+
+### Modules
+
+Doom Nvim consists of around 5 modules. A Doom Nvim Module is a bundle of plugins,
+configuration and commands, organized into a unit that can be toggled easily by
+tweaking your `doomrc.lua` (found in `$HOME/.config/doom-nvim`).
+
+Please see [Plugin Management](#plugin-management) for more information.
+
+### Plugin Management
+
+Doom Nvim uses a declarative and use-package inspired package manager called
+[packer.nvim](https://github.com/wbthomason/packer.nvim).
+
+Modules and plugins are declared in `lua/doom/modules/init.lua` file, located
+in your Doom Nvim root directory. Read on to learn how to use this system to install
+your own plugins.
+
+> **WARNING:** Do not install plugins directly in `lua/doom/modules/init.lua`. Instead,
+> use your `doomrc.lua` and `plugins.lua` files to modify them.
+
+### Configuring Doom
+
+#### Configuring settings
+
+You can change Doom's default settings by tweaking your `doom_config.lua` file,
+please see :h doom_nvim_options to know how to.
+
+#### Configuring plugins
-### Disabling plugins
+Do you want to change some configurations of some modules?
+
+Go to `lua/doom/modules/config` directory and you will find the configurations
+for the plugins.
-To disable plugins from Doom Nvim Modules or disable a module itself, just use the
-`disabled_plugins` and/or `disabled_modules` fields.
+Otherwise if you want to configure a plugin declared in your `plugins.lua` you
+can use the packer's `config` field, e.g.
```lua
--- @default = {}
-disabled_plugins = { 'terminal', 'treesitter' }
+{
+ 'TimUntersberger/neogit',
+ config = function()
+ require('neogit').setup()
+ end,
+}
+```
+
+##### Configuring LSP
+
+[Language Server Protocols](https://microsoft.github.io/language-server-protocol/) is installed as a plugin.
--- @default = { 'git', 'lsp', 'web' }
-let g:doom_disabled_modules = { 'web' }
+To easily install language servers and without having to do it system-wide or having to
+manually configure servers, Doom Nvim makes use of [kabouzeid/nvim-lspinstall](https://github.com/kabouzeid/nvim-lspinstall).
+
+To enable the language server for a certain programming language and automatically
+install it, just append a `+lsp` flag at the end of the language field in your `doomrc.lua`,
+e.g. for enabling Rust support in Doom and install `rust-analyzer`:
+
+```lua
+local doom = {
+ langs = {
+ 'rust +lsp', -- Let's get rusty!
+ }
+}
```
-> **NOTES:**
->
-> 1. Do not forget to run `:PackerSync` or your changes won't take effect.
+> **NOTE**: You can see a list of currently supported languages at [bundled installers](https://github.com/kabouzeid/nvim-lspinstall#bundled-installers).
+
+### Binding keys
+
+You can modify the default keybindings by modifying the following files:
+
+- `lua/doom/core/keybindings/init.lua` - General and SPC keybindings
+- `lua/doom/modules/config` - lua plugins keybindings
+
+You can also define your own keybindings in your `doom_config.lua` with the `nvim.mappings` field.
+
+## Migrating to 3.0.0
+
+As this is a major version, there are many improvements and breaking changes.
+This section is made to help you migrate to this version without dying in the
+attempt.
+
+But first let's see what's new:
+
+### Changes for end users
+
+- Raw speed, never go slow again.
+ Reduced average startuptime from 400ms to 40ms (tested with old hardware),
+ special thanks to [vhyrro]!
+- New and better doom-one colorscheme written in pure Lua. Because the
+ colorscheme matters.
+- Fragmented configuration file (`doomrc`) so it will be more easy to customize
+ Doom. See [New configurations](#new-configurations).
+- Easily add new Neovim settings by using your `doom_config.lua` file.
+ Extensibility is a feature that you cannot miss, and what better than being
+ able to extend Doom as much as you want?
+- New logging system powered by [vlog]. A faster and smaller logging system
+ because complexity is not always the best choice.
+- Easily enable and disable plugins. Now toggling the doom default plugins is easier
+ than before, just comment or uncomment it in your `doomrc.lua`!
+- Better custom plugins management. Now the custom plugins are being directly
+ handled by packer as it should be, no more nonsense wrappers around it.
+- Better updating mechanism. Forget these annoying merging issues and save the
+ current state of your Doom Nvim installation in case that you need to rollback
+ your Doom Nvim version because of the demons!
+- Added a `DoomRollback` command. Something went wrong after updating? No worries,
+ just rollback to a previous version (stable branch) or a previous commit
+ (development branch) and be piece of mind!
+- Built-in plugins. Because we should have some utilities to make our lives
+ easier, isn't this how it should be? See [modules/doom] for more information.
+- A lot of bug fixes.
+
+### Changes for contributors
+
+- Better documentation. Added docs for each doom lua module because
+ documentation is the core of all projects.
+- Restructured source code. Now the doom nvim source code is much cleaner and
+ easier to understand.
+- Added selene linter CI for incoming pull requests and stylua CI for pushes.
+ Let's get a consistent way to maintain Doom Nvim source!
+
+Now that we know what's new we will surely want to update, isn't it?
+
+Due to the new raw speed we highly recommend that you do a fresh installation so
+everything will be work as it should. **Make sure to backup your doomrc changes
+so you can apply your changes to the new `doom_config.lua` configuration file**.
+
+We don't recommend using the `:DoomUpdate` command for this task because of the
+huge changes that doom nvim gotten. This command will only end in a really
+bad status for this release due to git merging issues.
+
+With that being said, you can run the following command snippet:
+
+> **IMPORTANT:**
>
-> 2. You can see a list of the plugins that you can disable on [Modules](./modules.md#list-of-modules).
+> 1. Make sure to read everything it does before executing it.
>
-> 3. You can also see how to enable/disable plugins modules on [Modules](./modules.md).
+> 2. If you are using cheovim just remove and clone the doom-nvim repository again.
-## Configuring Doom
+```sh
+cp $HOME/.config/doom-nvim/doomrc $HOME/.config/doomrc.bak \
+ && rm -rf $HOME/.config/doom-nvim $HOME/.local/share/nvim/site/pack/packer \
+ && unlink $HOME/.config/nvim \
+ && curl -sLf https://raw.githubusercontent.com/NTBBloodbath/doom-nvim/main/install.sh | bash -s -- -d
+```
-### Configuring settings
+This snippet will do the following tasks for you:
-You can change Doom's default settings by tweaking your `doomrc`, please see
-:h doom_nvim to know how to.
+1. Create a copy of your doomrc so you can use a diff tool later with the
+ actual breaking changes to doomrc structure.
+2. Remove the doom-nvim configuration directory and all plugins (including packer).
+3. Remove the residual symlink that doom-nvim have created before during the
+ installation (**omit that step if you're using cheovim**).
+4. Clone doom-nvim source to where it belongs again by using the installer
+ (installing the development branch because this version is not released yet).
-### Configuring plugins
+Then you'll only need to start Neovim and start using it as usual!
-Do you want to change some configurations of some modules?
+#### New configurations
-Go to `lua/plugins/configs` dir and you will find the configurations for the plugins.
+Since version 3.0.0 the doomrc has been fragmented into some files, but why?
-### Configuring LSP
+This was done to benefit both contributors and end users as follows:
-To easily install LSPs and without having to do it system-wide or having to
-manually configure servers, Doom Nvim makes use of [kabouzeid/nvim-lspinstall](https://github.com/kabouzeid/nvim-lspinstall).
-You can see a list of currently supported languages at [bundled installers](https://github.com/kabouzeid/nvim-lspinstall#bundled-installers).
+- Improve understanding. One file that handles everything doesn't seem like a
+ good thing on a large scale.
+- Easier to maintain. Divided by function, the new files make the code more
+ readable and easy to modify.
-> Usage example:
+And now, how can I start using the new configuration files?
-- `:LspInstall python` to install Python LSP
-- `:LspUninstall python` to uninstall Python LSP
+I'm going to explain you in a short way because the new configuration files has
+a rich documentation inside them.
-## Binding keys
+- `doomrc.lua`, this file handles the Doom Nvim modules, in other words, which
+ plugins are being installed and loaded and which plugins are not.
+- `doom_config.lua`, this file handles the user configurations for doom nvim,
+ e.g. if mouse is enabled or not. This one also handles user-defined Neovim
+ configurations like global variables and mappings.
+- `plugins.lua`, this file handles the user-defined plugins, it is the
+ replacement for the `custom_plugins` field in the old doomrc.
-You can modify the default keybindings by modifying the following files:
+> Are you having issues with the 3.0.0 version? Don't hesitate to [report them]
+> so we can fix them and make doom more stable because that's the way to improve software.
-- `lua/doom/keybindings/init.lua` - General and SPC keybindings
-- `lua/plugins/configs` - lua plugins keybindings
+[vlog]: https://github.com/tjdevries/vlog.nvim
+[packer.nvim]: https://github.com/wbthomason/packer.nvim
+[vhyrro]: https://github.com/vhyrro
+[modules]: ./modules.md
+[modules/doom]: https://github.com/NTBBloodbath/doom-nvim/tree/develop/lua/doom/modules/doom
+[report them]: https://github.com/NTBBloodbath/doom-nvim/issues/new
diff --git a/docs/modules.md b/docs/modules.md
index 915e27a8e..1b7b5003e 100644
--- a/docs/modules.md
+++ b/docs/modules.md
@@ -1,222 +1,254 @@
# Doom Nvim Modules
-# Table of Contents
-
-- [Introduction](#introduction)
-- [Tweaking Doom Nvim Modules](#tweaking-doom-nvim-modules)
- - [List of modules](#list-of-modules)
- - [Essentials](#essentials)
- - [UI](#ui)
- - [Fuzzy](#fuzzy)
- - [Git](#git)
- - [LSP](#lsp)
- - [Files](#files)
- - [Web](#web)
- - [Managing modules](#managing-modules)
- - [Enabling modules](#enabling-modules)
- - [Enabling module plugins](#enabling-module-plugins)
- - [Disabling modules](#disabling-modules)
- - [Disabling module plugins](#disabling-module-plugins)
-
-# Introduction
-
-Doom Nvim consists of around 7 modules and growing. A Doom Nvim Module is a bundle of plugins,
-configuration and commands, organized into a unit that can be toggled easily.
-
-# Tweaking Doom Nvim Modules
-
-You can easily tweak Doom Nvim Modules by tweaking your doomrc
-(found in `$HOME/.config/doom-nvim`).
+## Introduction
-## List of modules
-
-First of all, we must know which modules we can enable and disable,
-including their plugins individually.
+Doom Nvim consists of around 5 modules with ~40 plugins and growing.
+A Doom Nvim module is a bundle of plugins, configurations and commands,
+organized into a unit that can be toggled easily.
-### Essentials
+> **NOTE**: Doom Nvim uses [packer.nvim] as its plugins manager.
-- [x] Enabled by default
-- [ ] Can be disabled
-- Plugins inside
- - [ ] [packer.nvim] - A use-package inspired plugin manager for Neovim.
- - [ ] [vimpeccable] - Helpers for Lua configs.
- - [x] [treesitter] - Nvim Treesitter configurations and abstraction layer.
- - Use `treesitter` to disable it
+## Tweaking Doom Nvim Modules
-### UI
+You can easily tweak Doom Nvim Modules by tweaking your `doomrc.lua` file
+(found in `~/.config/doom-nvim`).
-- [x] Enabled by default
-- [ ] Can be disabled
-- Plugins inside
- - [ ] [dashboard-nvim] - Vim dashboard.
- - [x] colorschemes - Obviously, colorschemes.
- - Use `colorschemes` to disable it
- - [x] [nvim-tree.lua] - A file explorer tree for neovim written in lua.
- - Use `tree` to disable it
- - [x] [galaxyline.nvim] - galaxyline is a light-weight and Super Fast statusline plugin.
- - Use `statusline` to disable it
- - [x] [barbar.nvim] - Tabs, as understood by any other editor.
- - Use `tabline` to disable it
- - [x] [nvim-toggleterm.lua] - A neovim plugin to persist and toggle multiple terminals during an editing session
- - Use `terminal` to disable it
- - [x] [symbols-outline.nvim] - A tree like view for symbols in Neovim using the Language Server Protocol.
- - Use `tagbar` to disable it
- - [x] [minimap.vim] - Blazing fast minimap / scrollbar for vim, powered by code-minimap written in Rust.
- - Use `minimap` to disable it
- - **Depends on** [wfxr/code-minimap](htps://github.com/wfxr/code-minimap) **to work!**
- - [ ] [which-key.nvim] - WhichKey is a lua plugin for Neovim 0.5 that displays a popup with possible keybindings of the command you started typing.
- - [x] [TrueZen.nvim] - Clean and elegant distraction-free writing for NeoVim.
- - Use `zen` to disable it
-
-### Fuzzy
-
-- [x] Enabled by default
-- [ ] Can be disabled
-- Plugins inside
- - [ ] [telescope.nvim] - Find, Filter, Preview, Pick. All lua, all the time.
-
-### Git
-
-- [ ] Enabled by default
-- [x] Can be disabled
- - Use `git` to disable the entire module
-- Plugins inside
- - [x] [gitsigns.nvim] - Git signs written in pure lua
- - Use `gitsigns` to disable it
- - [x] [lazygit.nvim] - Plugin for calling lazygit from within neovim.
- - Use `lazygit` to disable it
- - **Depends on** [jesseduffield/lazygit](https://github.com/jesseduffield/lazygit) **to work!**
-
-### LSP
-
-- [ ] Enabled by default
-- [x] Can be disabled
- - Use `lsp` to disable the entire module
-- Plugins inside
- - [x] [nvim-lspconfig] - Quickstart configurations for the Nvim LSP client
- - Use `lspconfig` to disable it
- - **NOTE:** do not disable it if you are going to use LSP!
- - [x] [nvim-compe] - Auto completion plugin for nvim that written in Lua.
- - Use `compe` to disable it
-
-### Files
-
-- [x] Enabled by default
-- [x] Can be disabled
- - Use `files` to disable the entire module
-- Plugins inside
- - [x] [suda.vim] - suda is a plugin to read or write files with sudo command.
- - Use `suda` to disable it
- - [x] [format.nvim] - Neovim lua plugin to format the current buffer with external executables.
- - Use `formatter` to disable it
- - [x] [pears.nvim] - Auto pair plugin for neovim
- - Use `autopairs` to disable it
- - [x] [indentLine] - A vim plugin to display the indention levels with thin vertical lines
- - Use `indentlines` to disable it
- - [x] [editorconfig-vim] - EditorConfig support
- - Use `editorconfig` to disable it
- - [x] [kommentary] - Neovim commenting plugin, written in lua.
- - Use `kommentary` to disable it
-
-### Web
-
-- [ ] Enabled by default
-- [x] Can be disabled
- - Use `web` to disable the entire module
-- Plugins inside
- - [x] [nvim-colorizer.lua] - A high-performance color highlighter for Neovim which has no external dependencies written in performant Luajit.
- - Use `colorizer` to disable it
- - [x] [vim-dot-http] - Rest HTTP Client
- - Use `restclient` to disable it
- - **Depends on** [bayne/dot-http](https://github/bayne/dot-http) **to work!**
- - [x] [emmet-vim] - Emmet for Vim
- - Use `emmet` to disable it
+## List of modules
-## Managing modules
+First of all, we must know which modules are there and their plugins.
-### Enabling modules
+> **NOTE:** all plugins can be disabled, including the UI ones.
-To enable a module, you can use the `disabled_modules` field in the `Doom` table
-on your `doomrc`.
+### Essentials
-```lua
--- To enable all modules except web, just put only 'web' in the disabled modules
--- array and then, reboot Neovim and do :PackerSync
---
--- @default = { 'git', 'lsp', 'web' }
-disabled_modules = { 'web' }
-```
+This ones are implicit plugins so the end user cannot disable them. But why?
-### Enabling module plugins
+That is because these plugins are the core of Doom so in fact, things can break
+without them. These plugins are the following:
-All the module plugins will be enabled by default unless the entire module is disabled.
+- [packer.nvim]
+ - A use-package inspired plugin manager for Neovim.
+- [treesitter]
+ - An incremental parsing system for programming tools.
-> If you want to use custom plugins, please refer to
-> [Installing plugins](./getting_started.md#installing-plugins).
+### UI
-### Disabling modules
+- [dashboard]
+ - Vim dashboard (start screen).
+- [doom-themes]
+ - Additional doom emacs' colorschemes.
+- [statusline]
+ - Neovim statusline.
+- [tabline]
+ - Tabline, shows your buffers list at top.
+- [zen]
+ - Distraction free environment.
+- [which-key]
+ - Keybindings popup like Emacs' guide-key.
+- [indentlines]
+ - Show indent lines.
+
+### Doom
+
+- [neorg]
+ - Life Organization Tool.
+- [runner] (built-in)
+ - A code runner for your interpreted code.
+- [compiler] (built-in)
+ - Compile _and run_ your projects with only a few keystrokes.
+
+### Editor
+
+- [auto-session]
+ - A small automated session manager for Neovim.
+- [terminal]
+ - Terminal for Neovim.
+- [explorer]
+ - Tree explorer.
+- [symbols]
+ - LSP symbols and tags.
+- [minimap]
+ - Code minimap, requires [wfxr/code-minimap](https://github.com/wfxr/code-minimap).
+- [gitsigns]
+ - Git signs.
+- [telescope]
+ - Highly extendable fuzzy finder over lists.
+- [restclient]
+ - A fast Neovim http client.
+- [formatter]
+ - File formatting.
+- [autopairs]
+ - Autopairs.
+- [editorconfig]
+ - EditorConfig support for Neovim, let other argue about tabs vs spaces.
+- [kommentary]
+ - Comments plugin.
+- [lsp]
+ - Language Server Protocols ([compe] + [lspsaga] + [lspinstall]).
+- snippets
+ - Code snippets ([LuaSnip] + [friendly-snippets]).
+
+### Langs
+
+The languages module entries has some flags that improves their experience and
+makes your life easier.
+
+The currently available flags are the following:
+
+- `+lsp` - enables and installs the Language Server Protocol for the language.
+ e.g. `rust +lsp` will automatically install TreeSitter parser for getting
+ syntax highlighting for Rust and will also install `rust-analyzer`.
+
+#### Web development
+
+- **html**
+ - HTML support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+- **css**
+ - CSS support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+- **javascript**
+ - JavaScript support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes, by using TSServer.
+- **typescript**
+ - TypeScript support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+
+#### Scripting
+
+- **bash**
+ - BASH support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+- **python**
+ - Python support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+- **ruby**
+ - Ruby support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+- **lua**
+ - Lua support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+- **elixir**
+ - Elixir support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+
+#### Compiled
+
+- **haskell**
+ - Haskell support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+- **rust**
+ - Rust support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+- **go**
+ - Golang support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+- **cpp**
+ - CPP support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+- **java**
+ - Java support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+
+#### Configs & DevOps
+
+- **config**
+ - Configuration languages support (JSON, YAML, TOML).
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: not yet.
+- **dockerfile**
+ - Docker support.
+ - TreeSitter based syntax highlighting: yes.
+ - LSP: yes.
+
+> **NOTE**: this group requires the `lsp` installed for the `+lsp` flags.
+
+### Utilities
+
+- [suda]
+ - Write and read files without sudo permissions.
+- [lazygit]
+ - LazyGit integration for neovim, requires LazyGit.
+- [neogit]
+ - Magit for Neovim.
+- [colorizer]
+ - Fastest colorizer for Neovim.
+- [range-highlight]
+ - Highlights ranges you have entered in commandline
-To disable a module, you can use the `disabled_modules` field in the `Doom` table
-on your `doomrc`.
+## Managing modules
-```lua
--- To disable only the web module, just put only 'web' in the disabled modules
--- array and then, reboot Neovim and do :PackerSync
---
--- @default = { 'git', 'lsp', 'web' }
-disabled_modules = { 'web' }
-```
+Since version 3.0.0 managing the modules plugins is really easy because you
+don't need to learn nothing anymore. Just comment the plugins that you don't
+want to use and uncomment the ones that you are going to use!
-### Disabling module plugins
+So by example, if you want to disable the tree explorer you can simply comment it.
-To disable a module plugin, you can use the `disabled_plugins` field in the `Doom` table
-on your `doomrc`.
+```lua
+-- Before, the plugin is enabled
+'explorer', -- Tree explorer
-```vim
--- @default = {}
-disabled_plugins = { 'emmet' }
+-- After, the plugin is disabled
+-- 'explorer', -- Tree explorer
```
-
+After doing the changes, just restart Neovim and Doom Nvim will handle the plugins
+changes for you!
+
+
[packer.nvim]: https://github.com/wbthomason/packer.nvim
-[vimpeccable]: https://github.com/svermeulen/vimpeccable
[treesitter]: https://github.com/nvim-treesitter/nvim-treesitter
-
-
-[dashboard-nvim]: https://github.com/glepnir/dashboard-nvim
-[nvim-tree.lua]: https://github.com/kyazdani42/nvim-tree.lua
-[galaxyline.nvim]: https://github.com/glepnir/galaxyline.nvim
-[barbar.nvim]: https://github.com/romgrk/barbar.nvim
-[nvim-toggleterm.lua]: https://github.com/akinsho/nvim-toggleterm.lua
-[symbols-outline.nvim]: https://github.com/simrat39/symbols-outline.nvim
-[minimap.vim]: https://github.com/wfxr/minimap.vim
-[which-key.nvim]: https://github.com/folke/which-key.nvim
-[truezen.nvim]: https://github.com/kdav5758/TrueZen.nvim
-
-
-
-[telescope.nvim]: https://github.com/nvim-telescope/telescope.nvim
-
-
-
-[gitsigns.nvim]: https://github.com/lewis6991/gitsigns.nvim
-[lazygit.nvim]: https://github.com/kdheepak/lazygit.nvim
-
-
-
-[nvim-lspconfig]: https://github.com/neovim/nvim-lspconfig
-[nvim-compe]:
-[suda.vim]: https://github.com/lambdalisue/suda.vim
-[format.nvim]: https://github.com/lukas-reineke/format.nvim
-[pears.nvim]: https://github.com/steelsojka/pears.nvim
-[indentline]: https://github.com/Yggdroot/indentLine
-[editorconfig-vim]: https://github.com/editorconfig/editorconfig-vim
+[auto-session]: https://github.com/rmagatti/auto-session
+[dashboard]: https://github.com/glepnir/dashboard-nvim
+[explorer]: https://github.com/kyazdani42/nvim-tree.lua
+[statusline]: https://github.com/glepnir/galaxyline.nvim
+[tabline]: https://github.com/akinsho/nvim-bufferline.lua
+[terminal]: https://github.com/akinsho/nvim-toggleterm.lua
+[symbols]: https://github.com/simrat39/symbols-outline.nvim
+[minimap]: https://github.com/wfxr/minimap.vim
+[which-key]: https://github.com/folke/which-key.nvim
+[zen]: https://github.com/kdav5758/TrueZen.nvim
+[telescope]: https://github.com/nvim-telescope/telescope.nvim
+[doom-themes]: https://github.com/GustavoPrietoP/doom-themes.nvim
+
+[gitsigns]: https://github.com/lewis6991/gitsigns.nvim
+[lazygit]: https://github.com/kdheepak/lazygit.nvim
+[neogit]: https://github.com/TimUntersberger/neogit
+[neorg]: https://github.com/vhyrro/neorg
+
+[lsp]: https://github.com/neovim/nvim-lspconfig
+[compe]: https://github.com/hrsh7th/nvim-compe
+[lspsaga]: https://github.com/glepnir/lspsaga.nvim
+[lspinstall]: https://github.com/kabouzeid/nvim-lspinstall
+[LuaSnip]: https://github.com/L3MON4D3/LuaSnip
+[friendly-snippets]: https://github.com/rafamadriz/friendly-snippets
+
+[suda]: https://github.com/lambdalisue/suda.vim
+[formatter]: https://github.com/lukas-reineke/format.nvim
+[autopairs]: https://github.com/windwp/nvim-autopairs
+[indentlines]: https://github.com/lukas-reineke/indent-blankline.nvim
+[editorconfig]: https://github.com/editorconfig/editorconfig-vim
[kommentary]: https://github.com/b3nj5m1n/kommentary
-
+[restclient]: https://github.com/NTBBloodbath/rest.nvim
+[colorizer]: https://github.com/norcalli/nvim-colorizer.lua
+[range-highlight]: https://github.com/winston0410/range-highlight.nvim
-[nvim-colorizer.lua]: https://github.com/norcalli/nvim-colorizer.lua
-[vim-dot-http]: https://github.com/bayne/vim-dot-http
-[emmet-vim]: https://github.com/mattn/emmet-vim
+[runner]: ../lua/doom/modules/built-in/runner/README.md
+[compiler]: ../lua/doom/modules/built-in/compiler/README.md
diff --git a/doom.toml b/doom.toml
new file mode 100644
index 000000000..51799f4a3
--- /dev/null
+++ b/doom.toml
@@ -0,0 +1,11 @@
+[selene]
+base = 'lua51'
+name = 'doom'
+
+# for Neovim development
+[vim]
+any = true
+
+# for LuaJIT
+[jit]
+any = true
diff --git a/doom_config.lua b/doom_config.lua
new file mode 100644
index 000000000..c5c7277b9
--- /dev/null
+++ b/doom_config.lua
@@ -0,0 +1,363 @@
+-- doom_config - Doom Nvim user configurations file
+--
+-- This file contains the user-defined configurations for Doom nvim and consists
+-- in two Lua tables:
+-- 1. Doom, this one defines all the Doom nvim configurations that you can
+-- tweak to fit your needs or tastes.
+--
+-- 2. Nvim, this one defines all the custom configurations that you want to
+-- use in Neovim, e.g. a colorscheme italic_comments global variable
+
+-- {{{ Doom
+local doom = {
+ -- Autosave
+ -- false : Disable autosave
+ -- true : Enable autosave
+ -- @default = false
+ autosave = false,
+
+ -- Format on save
+ -- false : Disable format on save
+ -- true : Enable format on save
+ -- @default = false
+ fmt_on_save = false,
+
+ -- Disable Vim macros
+ -- false : Enable Vim macros
+ -- true : Disable Vim macros
+ -- @default = false
+ disable_macros = false,
+
+ -- Autosave sessions
+ -- false : Disable session autosave
+ -- true : Enable session autosave
+ -- @default = false
+ autosave_sessions = false,
+
+ -- Autoload sessions
+ -- false : Disable session autoload
+ -- true : Enable session autoload
+ -- @default = false
+ autoload_last_session = false,
+
+ -- Enable Swap files
+ -- false : no swap files
+ -- true : enables swap files
+ -- @default = false
+ swap_files = false,
+
+ -- Undo Directories
+ -- the backup variable enables backup related settings (undofile, undodir)
+ -- false : ignores undo Directories (this code block will be ignored)
+ -- true : enable undo files/undo dirs.
+ -- @default = false
+ backup = false, -- WARNING: if you change this to false and you have an undo dir already, it will REMOVE the undodir (loss of data might take place)
+
+ -- Enable Line wrapping
+ -- false : disables line wrapping
+ -- true : enables line wrapping
+ -- @default = false
+ line_wrap = false,
+
+ -- Enable Show mode ( -- INSERT --, -- NORMAL --, -- VISUAL -- )
+ -- false : disables show mode
+ -- true : enables show mode
+ -- @default = false
+ show_mode = false,
+
+ -- Enable scroll off
+ -- false : disables scroll off
+ -- true : enables scroll off
+ -- @default = true, @default scrolloff_amount = 4,
+ scrolloff = true,
+ scrolloff_amount = 4,
+
+ -- Enable mouse
+ -- false : disables mouse
+ -- true : enables mouse
+ -- @default = true
+ mouse = true,
+
+ -- Preserve last editing position
+ -- false : Disable preservation of last editing position
+ -- true : Enable preservation of last editing position
+ -- @default = false
+ preserve_edit_pos = false,
+
+ -- horizontal split on creating a new file (fn)
+ -- false : doesn't split the window when creating a new file
+ -- true : horizontal split on creating a new file
+ -- @default = true
+ new_file_split = true,
+
+ -- enable current line highlight
+ -- false : disables current line highlight
+ -- true : enables current line highlight
+ -- @default = true
+ line_highlight = true,
+
+ -- Automatically split right
+ -- false : splits right (vertically)
+ -- true : splits left (vertically)
+ -- @default = true
+ split_right = true,
+
+ -- Automatically split above
+ -- false : splits above (horizontally)
+ -- true : splits below (horizontally)
+ -- @default = true
+ split_below = true,
+
+ -- Use clipboard outside of vim
+ -- false : won't use third party clipboard
+ -- true : enables third part clipboard
+ -- @default = true
+ clipboard = true,
+
+ -- Enable auto comment (current line must be commented)
+ -- false : disables auto comment
+ -- true : enables auto comment
+ -- @default = false
+ auto_comment = false,
+
+ -- Show indent lines
+ -- @default = true
+ show_indent = true,
+
+ -- Expand tabs
+ -- Specifies if spaces or tabs must be used
+ -- false : spaces
+ -- true : tabs
+ -- @default = true
+ expand_tabs = true,
+
+ -- Set numbering
+ -- false : Shows absolute number lines
+ -- true : Shows relative number lines
+ -- @default = true
+ relative_num = true,
+
+ -- Enable Highlight on yank
+ -- false : disables highligh on yank
+ -- true : enables highlight on yank
+ -- @default = true
+ highlight_yank = true,
+
+ -- Enable guicolors
+ -- Enables gui colors on GUI versions of Neovim
+ -- @default = true
+ enable_guicolors = true,
+
+ -- Tree explorer on the right
+ -- Places the Tree explorer buffer to the right when enabled
+ -- @default = false
+ explorer_right = false,
+
+ -- Show hidden files
+ -- @default = true
+ show_hidden = true,
+
+ -- Checkupdates on start
+ -- @default = false
+ check_updates = false,
+
+ -- Auto install plugins on launch, useful if you don't want to run
+ -- PackerInstall every time you add a new plugin
+ -- @default = true
+ auto_install_plugins = true,
+
+ -- Disable dashboard status line (does not work perfectly)
+ -- false : disables dashboard status line
+ -- true : enables dashboard status line
+ -- @default = true
+ dashboard_statline = true,
+
+ -- Default indent size
+ -- @default = 4
+ indent = 4,
+
+ -- Set max cols
+ -- Defines the column to show a vertical marker
+ -- @default = 80
+ max_columns = 80,
+
+ -- Completion box height
+ -- @default = 10
+ complete_size = 10,
+
+ -- Completion box transparency
+ -- 0 = no transparency
+ -- 100 = fully transparent
+ -- @default = 25
+ complete_transparency = 25,
+
+ -- Sidebar sizing
+ -- Specifies the default width of Tree Explorer and Tagbar
+ -- @default = 25
+ sidebar_width = 25,
+
+ -- Set the Terminal width
+ -- Applies only to float direction
+ -- @default = 70
+ terminal_width = 70,
+
+ -- Set the Terminal height
+ -- Applies to all directions except window
+ -- @default = 20
+ terminal_height = 20,
+
+ -- Conceal level
+ -- Set Neovim conceal level
+ -- 0 : Disable indentline and show all
+ -- 1 : Conceal some functions and show indentlines
+ -- 2 : Concealed text is completely hidden unless it has a custom replacement
+ -- character defined
+ -- 3 : Concealed text is completely hidden
+ conceallevel = 0,
+
+ -- Logging level
+ -- Set Doom logging level
+ -- Available levels:
+ -- ยท trace
+ -- ยท debug
+ -- ยท info
+ -- ยท warn
+ -- ยท error
+ -- ยท fatal
+ -- @default = 'info'
+ logging = 'info',
+
+ -- Set the Terminal direction
+ -- Available directions:
+ -- - vertical
+ -- - horizontal
+ -- - window
+ -- - float
+ -- @default = 'horizontal'
+ terminal_direction = 'horizontal',
+
+ -- NOTE: This will only be activated if 'backup' is true.
+ -- We don'recommend you put this outside of neovim so we've restricted to the path: ~/.config/nvim
+ -- WARNING: only put the folder name that you want. (eg: undo_dir = '/undodir')
+ -- @default_directory = '~/.config/nvim/undodir'
+ undo_dir = '/undodir',
+
+ -- Default colorscheme
+ -- @default = doom-one
+ colorscheme = 'doom-one',
+
+ -- Background color
+ -- @default = dark
+ colorscheme_bg = 'dark',
+
+ -- Doom One colorscheme settings
+ doom_one = {
+ -- If the cursor color should be blue
+ -- @default = false
+ cursor_coloring = false,
+ -- If TreeSitter highlighting should be enabled
+ -- @default = true
+ enable_treesitter = true,
+ -- If the comments should be italic
+ -- @default = false
+ italic_comments = false,
+ -- If the telescope plugin window should be colored
+ -- @default = true
+ telescope_highlights = true,
+ -- If the built-in Neovim terminal should use the doom-one
+ -- colorscheme palette
+ -- @default = false
+ terminal_colors = true,
+ -- If the Neovim instance should be transparent
+ -- @default = false
+ transparent_background = false,
+ },
+
+ -- Set gui fonts here
+ -- @default = "FiraCode Nerd Font", @default font size = 15,
+ -- WARNING: Font sizes must be in string format!
+ guifont = 'FiraCode Nerd Font',
+ guifont_size = '15',
+
+ -- change Which Key background color
+ -- can use hex, or normal color names (eg: Red, Gree, Blue)
+ -- @default = #202328
+ whichkey_bg = '#202328',
+
+ -- set your custom lsp diagnostic symbols below
+ lsp_error = '๏',
+ lsp_warning = '๏ฑ',
+ lsp_hint = '๏ช',
+ lsp_information = '๏',
+ lsp_virtual_text = '๏ ',
+
+ -- Set your dashboard custom colors below
+ -- @default = doom emacs' default dashboard colors
+ dashboard_custom_colors = {
+ header_color = '#586268',
+ center_color = '#51afef',
+ shortcut_color = '#a9a1e1',
+ footer_color = '#586268',
+ },
+
+ -- Set your custom dashboard header below
+ -- @default = doom emacs' default dashboard header
+ dashboard_custom_header = {},
+}
+-- }}}
+
+-- {{{ Nvim
+local nvim = {
+ -- Set custom Neovim global variables
+ -- @default = {}
+ -- example:
+ -- { ['sonokai_style'] = 'andromeda' }
+ global_variables = {},
+
+ -- Set custom autocommands
+ -- @default = {}
+ -- example:
+ -- augroup_name = {
+ -- { 'BufNewFile,BufRead', 'doomrc', 'set ft=lua'}
+ -- }
+ autocmds = {},
+
+ -- Set custom key bindings
+ -- @default = {}
+ -- example:
+ -- {
+ -- {'n', 'ca', ':Lspsaga code_action'}
+ -- }
+ --
+ -- where
+ -- 'n' is the map scope
+ -- 'ca' is the map activator
+ -- ':Lspsaga ...' is the command to be executed
+ mappings = {},
+
+ -- Set custom commands
+ -- @default = {}
+ -- example:
+ -- {
+ -- 'echo "Hello, custom commands!"'
+ -- }
+ commands = {},
+
+ -- Set custom functions
+ -- @default = {}
+ -- example:
+ -- {
+ -- hello_custom_func = function()
+ -- print("Hello, custom functions!")
+ -- end
+ -- }
+ functions = {},
+}
+-- }}}
+
+return {
+ doom = doom,
+ nvim = nvim,
+}
+
+-- vim: fdm=marker
diff --git a/doomrc b/doomrc
deleted file mode 100644
index 235a4cd9a..000000000
--- a/doomrc
+++ /dev/null
@@ -1,332 +0,0 @@
----[[--------------------------------------------------]]---
--- doomrc - Doom Nvim configurations --
--- For more information, see `:h doom_nvim_options` --
----[[--------------------------------------------------]]---
-
-Doom = {
- ---[[--------------------------------------------------]]---
- -- Boolean Options --
- ---[[--------------------------------------------------]]---
-
- -- Autosave
- -- false : Disable autosave
- -- true : Enable autosave
- -- @default = false
- autosave = false,
-
- -- Format on save
- -- false : Disable format on save
- -- true : Enable format on save
- -- @default = false
- fmt_on_save = false,
-
- -- Autosave sessions
- -- false : Disable session autosave
- -- true : Enable session autosave
- -- @default = false
- autosave_sessions = false,
-
- -- Autoload sessions
- -- false : Disable session autoload
- -- true : Enable session autoload
- -- @default = false
- autoload_last_session = false,
-
- -- Enable Swap files
- -- false : no swap files
- -- true : enables swap files
- -- @default = false
- swap_files = false,
-
- -- Undo Directories
- -- the backup variable enables backup related settings (undofile, undodir)
- -- false : ignores undo Directories (this code block will be ignored)
- -- true : enable undo files/undo dirs.
- -- @default = false
- backup = false, -- WARNING: if you change this to false and you have an undo dir already, it will REMOVE the undodir (loss of data might take place)
-
- -- Enable Line wrapping
- -- false : disables line wrapping
- -- true : enables line wrapping
- -- @default = false
- line_wrap = false,
-
- -- Enable Show mode ( -- INSERT --, -- NORMAL --, -- VISUAL -- )
- -- false : disables show mode
- -- true : enables show mode
- -- @default = false
- show_mode = false,
-
- -- Enable scroll off
- -- false : disables scroll off
- -- true : enables scroll off
- -- @default = true, @default scrolloff_amount = 4,
- scrolloff = true,
- scrolloff_amount = 4,
-
- -- Enable mouse
- -- false : disables mouse
- -- true : enables mouse
- -- @default = true
- mouse = true,
-
- -- Preserve last editing position
- -- false : Disable preservation of last editing position
- -- true : Enable preservation of last editing position
- -- @default = false
- preserve_edit_pos = false,
-
- -- horizontal split on creating a new file (fn)
- -- false : doesn't split the window when creating a new file
- -- true : horizontal split on creating a new file
- -- @default = true
- new_file_split = true,
-
- -- enable current line highlight
- -- false : disables current line highlight
- -- true : enables current line highlight
- -- @default = true
- line_highlight = true,
-
- -- Automatically split right
- -- false : splits right (vertically)
- -- true : splits left (vertically)
- -- @default = true
- split_right = true,
-
- -- Automatically split above
- -- false : splits above (horizontally)
- -- true : splits below (horizontally)
- -- @default = true
- split_below = true,
-
- -- Use clipboard outside of vim
- -- false : won't use third party clipboard
- -- true : enables third part clipboard
- -- @default = true
- clipboard = true,
-
- -- Enable auto comment (current line must be commented)
- -- false : disables auto comment
- -- true : enables auto comment
- -- @default = false
- auto_comment = false,
-
- -- Show indent lines
- -- @default = true
- show_indent = true,
-
- -- Expand tabs
- -- Specifies if spaces or tabs must be used
- -- false : spaces
- -- true : tabs
- -- @default = true
- expand_tabs = true,
-
- -- Set numbering
- -- false : Shows absolute number lines
- -- true : Shows relative number lines
- -- @default = true
- relative_num = true,
-
- -- Enable Highlight on yank
- -- false : disables highligh on yank
- -- true : enables highlight on yank
- -- @default = true
- highlight_yank = true,
-
- -- Enable guicolors
- -- Enables gui colors on GUI versions of Neovim
- -- @default = true
- enable_guicolors = true,
-
- -- Tagbar left
- -- Sets Tagbar buffer to the left when enabled
- -- @default = false
- tagbar_left = false,
-
- -- Show hidden files
- -- @default = true
- show_hidden = true,
-
- -- Checkupdates on start
- -- @default = false
- check_updates = false,
-
- -- Auto install plugins on launch, useful if you don't want to run
- -- PackerInstall every time you add a new plugin
- -- @default = true
- auto_install_plugins = true,
-
- -- Disable dashboard status line (does not work perfectly)
- -- false : disables dashboard status line
- -- true : enables dashboard status line
- -- @default = true
- dashboard_statline = true,
-
- ---[[--------------------------------------------------]]---
- -- Number Options --
- ---[[--------------------------------------------------]]---
-
- -- Default indent size
- -- @default = 4
- indent = 4,
-
- -- Set max cols
- -- Defines the column to show a vertical marker
- -- @default = 80
- max_columns = 80,
-
- -- Completion box height
- -- @default = 10
- complete_size = 10,
-
- -- Completion box transparency
- -- 0 = no transparency
- -- 100 = fully transparent
- -- @default = 25
- complete_transparency = 25,
-
- -- Sidebar sizing
- -- Specifies the default width of Tree Explorer and Tagbar
- -- @default = 25
- sidebar_width = 25,
-
- -- Logging level
- -- 0 : No logging
- -- 1 : All errors, no echo (default)
- -- 2 : All errors and messages, no echo
- -- 3 : All errors and messages, echo
- -- @default = 1
- logging = 1,
-
- -- Set the Terminal width
- -- Applies only to float direction
- -- @default = 70
- terminal_width = 70,
-
- -- Set the Terminal height
- -- Applies to all directions except window
- -- @default = 20
- terminal_height = 20,
-
- -- Conceal level
- -- Set Neovim conceal level
- -- 0 : Disable indentline and show all
- -- 1 : Conceal some functions and show indentlines
- -- 2 : Concealed text is completely hidden unless it has a custom replacement
- -- character defined
- -- 3 : Concealed text is completely hidden
- conceallevel = 0,
-
- ---[[--------------------------------------------------]]---
- -- String Options --
- ---[[--------------------------------------------------]]---
-
- -- Set the Terminal direction
- -- Available directions:
- -- - vertical
- -- - horizontal
- -- - window
- -- - float
- -- @default = 'horizontal'
- terminal_direction = 'horizontal',
-
- -- NOTE: This will only be activated if 'backup' is true.
- -- We don'recommend you put this outside of neovim so we've restricted to the path: ~/.config/nvim
- -- WARNING: only put the folder name that you want. (eg: undo_dir = '/undodir')
- -- @default_directory = '~/.config/nvim/undodir'
- undo_dir = '/undodir',
-
- -- Default colorscheme
- -- @default = doom-one
- colorscheme = 'doom-one',
-
- -- Background color
- -- @default = dark
- colorscheme_bg = 'dark',
-
- -- Set gui fonts here
- -- @default = "FiraCode Nerd Font", @default font size = 15,
- -- WARNING: Font sizes must be in string format!
- guifont = 'FiraCode Nerd Font',
- guifont_size = '15',
-
- -- change Which Key background color
- -- can use hex, or normal color names (eg: Red, Gree, Blue)
- -- @default = #202328
- whichkey_bg = "#202328",
-
- -- set your custom lsp diagnostic symbols below
- lsp_error = '๏',
- lsp_warning = '๏ฑ',
- lsp_hint = '๏ช',
- lsp_information = '๏',
- lsp_virtual_text = '๏ ',
-
- -- Set your dashboard custom colors below
- -- @default = doom emacs' default dashboard colors
- dashboard_custom_colors = {
- header_color = '#586268',
- center_color = '#51afef',
- shortcut_color = '#9788b9',
- footer_color = '#586268',
- },
-
- -- Disabled plugins
- -- @default = {'lazygit', 'minimap', 'restclient', 'doom-themes'}
- -- example:
- -- disabled_plugins = {'emmet-vim'}
- disabled_plugins = { 'lazygit', 'minimap', 'restclient', 'doom-themes'},
-
- -- Disabled plugins modules
- -- @default = {'git', 'lsp', 'web'}
- -- example:
- -- disabled_modules = {'web'}
- disabled_modules = { 'git', 'lsp', 'web' },
-
- -- Install custom plugins
- -- @default = {}
- -- examples:
- -- plugins without options:
- -- custom_plugins = {'andweeb/presence.nvim'}
- -- plugins with options:
- -- custom_plugins = {
- -- {
- -- ['repo'] = 'andweeb/presence.nvim',
- -- ['enabled'] = true,
- -- }
- -- }
- custom_plugins = {},
-
- -- Set the parsers for TreeSitter
- -- @default = {}
- -- example:
- -- ts_parsers = {'python', 'javascript'}
- ts_parsers = {},
-
- -- Set your custom dashboard header below
- -- @default = doom emacs' default dashboard header
- dashboard_custom_header = {
- '================= =============== =============== ======== ========',
- '\\\\ . . . . . . .\\\\ //. . . . . . .\\\\ //. . . . . . .\\\\ \\\\. . .\\\\// . . //',
- '||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\\/ . . .||',
- '|| . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . ||',
- '||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .||',
- '|| . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\\ . . . . ||',
- "||. . || ||-' || || `-|| || . .|| ||. . || ||-' || || `|\\_ . .|. .||",
- '|| . _|| || || || || ||_ . || || . _|| || || || |\\ `-_/| . ||',
- "||_-' || .|/ || || \\|. || `-_|| ||_-' || .|/ || || | \\ / |-_.||",
- "|| ||_-' || || `-_|| || || ||_-' || || | \\ / | `||",
- "|| `' || || `' || || `' || || | \\ / | ||",
- "|| .===' `===. .==='.`===. .===' /==. | \\/ | ||",
- "|| .==' \\_|-_ `===. .===' _|_ `===. .===' _-|/ `== \\/ | ||",
- "|| .==' _-' `-_ `=' _-' `-_ `=' _-' `-_ /| \\/ | ||",
- "|| .==' _-' `-__\\._-' `-_./__-' `' |. /| | ||",
- "||.==' _-' `' | /==.||",
- "==' _-' N E O V I M \\/ `==",
- "\\ _-' `-_ /",
- " `'' ``' ",
- ' ',
- },
-}
diff --git a/doomrc.lua b/doomrc.lua
new file mode 100644
index 000000000..b9351ae04
--- /dev/null
+++ b/doomrc.lua
@@ -0,0 +1,78 @@
+-- doomrc - Doom nvim configurations file
+--
+-- The doomrc controls what Doom nvim plugins modules are enabled and what
+-- features are being used.
+--
+-- Comment out a plugin to enable it and comment a non-commented one to
+-- disable and uninstall it.
+--
+-- NOTE: you can open the Doom nvim documentation by pressing `SPC d h`. You
+-- will find a table of content where you will see a "Doomrc" section under the
+-- "Configuration" one. In that section you will find a comprehensive list of
+-- the available modules and all their supported flags.
+
+local doom = {
+ ui = {
+ 'dashboard', -- Start screen
+ -- 'doom-themes', -- Additional doom emacs' colorschemes
+ 'statusline', -- Statusline
+ 'tabline', -- Tabline, shows your buffers list at top
+ -- 'zen', -- Distraction free environment
+ 'which-key', -- Keybindings popup menu like Emacs' guide-key
+ -- 'indentlines', -- Show indent lines
+ },
+ doom = {
+ -- 'neorg', -- Life Organization Tool
+ -- 'runner', -- Open a REPL for the current language or run the current file
+ -- 'compiler', -- Compile (and run) your code with just pressing three keys!
+ },
+ editor = {
+ 'auto-session', -- A small automated session manager for Neovim
+ -- 'terminal', -- Terminal for Neovim (NOTE: needed for runner and compiler)
+ 'explorer', -- Tree explorer
+ 'symbols', -- LSP symbols and tags
+ -- 'minimap', -- Code minimap, requires github.com/wfxr/code-minimap
+ 'gitsigns', -- Git signs
+ 'telescope', -- Highly extendable fuzzy finder over lists
+ -- 'restclient', -- A fast Neovim http client
+ 'formatter', -- File formatting
+ 'autopairs', -- Autopairs
+ -- 'editorconfig', -- EditorConfig support for Neovim
+ 'kommentary', -- Comments plugin
+ 'lsp', -- Language Server Protocols
+ 'snippets', -- LSP snippets
+ },
+ langs = {
+ -- To enable the language server for a language just add the +lsp flag
+ -- at the end, e.g. 'rust +lsp'. This will install the rust TreeSitter
+ -- parser and rust-analyzer
+ --
+ -- 'html', -- HTML support
+ -- 'css', -- CSS support
+ -- 'javascript', -- JavaScript support
+ -- 'typescript', -- TypeScript support
+ -- 'bash', -- The terminal gods language
+ -- 'python +lsp', -- Python support + lsp
+ -- 'ruby', -- Look ma, I love the gems!
+ 'lua', -- Support for our gods language
+ -- 'elixir', -- Build scalable and maintainable software
+ -- 'haskell', -- Because Functional programming is fun, isn't it?
+
+ -- 'rust +lsp', -- Let's get rusty!
+ -- 'go', -- Hello, gopher
+ -- 'cpp', -- C++ support
+ -- 'java', -- Java support
+
+ -- 'config', -- Configuration files (JSON, YAML, TOML)
+ -- 'dockerfile', -- Do you like containers, right?
+ },
+ utilities = {
+ -- 'suda', -- Write and read files without sudo permissions
+ -- 'lazygit', -- LazyGit integration for Neovim, requires LazyGit
+ -- 'neogit', -- Magit for Neovim
+ -- 'colorizer', -- Fastets colorizer for Neovim
+ 'range-highlight', -- hightlights ranges you have entered in commandline
+ },
+}
+
+return doom
diff --git a/init.lua b/init.lua
index 9e9371f59..51214ce11 100644
--- a/init.lua
+++ b/init.lua
@@ -4,25 +4,65 @@
-- License: GPLv2 --
---[[---------------------------------------]]---
--- Utility functions
-require('doom.utils')
+---- Doom Utilities -----------------------------
+-------------------------------------------------
+-- Store startup time in seconds
+vim.g.start_time = vim.fn.reltime()
--- Load default settings
-require('doom.default')
+-- Disable these for very fast startup time
+vim.cmd([[
+ syntax off
+ filetype off
+ filetype plugin indent off
+]])
--- Logging
-require('doom.logging')
+-- Temporarily disable shada file to improve performance
+vim.opt.shadafile = 'NONE'
+-- Disable some unused built-in Neovim plugins
+vim.g.loaded_man = false
+vim.g.loaded_gzip = false
+vim.g.loaded_netrwPlugin = false
+vim.g.loaded_tarPlugin = false
+vim.g.loaded_zipPlugin = false
+vim.g.loaded_2html_plugin = false
+vim.g.loaded_remote_plugins = false
--- Load configurations
-require('doom.config.doomrc')
+local async
--- Core modules
-require('doom.system')
-require('doom.functions')
-require('doom.config.doomrc')
+async = vim.loop.new_async(vim.schedule_wrap(function()
+ ---- Doom Configurations ------------------------
+ -------------------------------------------------
+ vim.defer_fn(function()
+ -- Load Doom core
+ require('doom.core')
--- Main configurations
-require('doom.config')
-require('doom.config.ui')
-require('doom.autocmds')
-require('doom.keybindings')
+ -- If the dashboard plugin is already installed and the packer_compiled.lua
+ -- file exists so we can make sure that the dashboard have been loaded
+ local compiled_plugins_path = vim.fn.expand(
+ '$HOME/.config/doom-nvim/plugin/packer_compiled.lua'
+ )
+ if vim.fn.filereadable(compiled_plugins_path) > 0 then
+ -- If the current buffer name is empty then trigger Dashboard
+ if vim.api.nvim_buf_get_name(0):len() == 0 then
+ vim.cmd('Dashboard')
+ end
+ end
+
+ vim.opt.shadafile = ''
+ vim.defer_fn(function()
+ vim.cmd([[
+ rshada!
+ doautocmd BufRead
+ syntax on
+ filetype on
+ filetype plugin indent on
+ PackerLoad nvim-treesitter
+ silent! bufdo e
+ ]])
+ end, 15)
+ end, 0)
+
+ async:close()
+end))
+
+async:send()
diff --git a/install.sh b/install.sh
index e205066ba..fc0d3512e 100755
--- a/install.sh
+++ b/install.sh
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
+#
#================================================
# install.sh - Doom Nvim Installation Script
# Author: NTBBloodbath
@@ -12,6 +13,7 @@ Color_reset='\033[0m' # Reset
## Normal colors
Black='\033[0;30m' # Black
+Gray='\033[0;90m' # Gray
White='\033[0;37m' # White
Red='\033[0;31m' # Red
Blue='\033[0;34m' # Blue
@@ -22,6 +24,7 @@ Yellow='\033[0;33m' # Yellow
## Bold colors
BBlack='\033[1;30m' # Black
+BGray='\033[1;90m' # Gray
BWhite='\033[1;37m' # White
BRed='\033[1;31m' # Red
BBlue='\033[1;34m' # Blue
@@ -32,7 +35,7 @@ BYellow='\033[1;33m' # Yellow
# }}}
# Doom Nvim version
-DoomNvimVersion='2.3.5'
+DoomNvimVersion='3.0.0'
# System OS
System="$(uname -s)"
@@ -84,12 +87,13 @@ check_cmd() {
check_all() {
# Install Doom Nvim (see also git)
need_cmd 'curl'
+ sleep 1
# Clone repositories and install Doom Nvim
need_cmd 'git'
- # Generate help tags
- check_cmd 'ctags'
+ sleep 1
# Install Language Server Protocols
check_cmd 'npm'
+ sleep 1
check_cmd 'node'
}
@@ -103,6 +107,7 @@ check_requirements() {
else
log_warn "Check requirements : git"
fi
+ sleep 1
# Checks if neovim is installed
if hash "nvim" &>/dev/null; then
@@ -110,6 +115,7 @@ check_requirements() {
else
log_warn "Check requirements : nvim"
fi
+ sleep 1
# Check if nodejs and npm are installed again,
# we do not check only nodejs because some Linux distributions
@@ -119,6 +125,7 @@ check_requirements() {
else
log_warn "Check requirements : node (optional, required to use LSP)"
fi
+ sleep 1
if hash "npm" &>/dev/null; then
log_success "Check requirements : npm"
else
@@ -172,30 +179,22 @@ update_repo() {
fi
}
-install_nvim_nightly() {
- log_info "Installing Neovim Nightly AppImage ..."
+install_nvim_appimage() {
+ log_info "Installing Neovim 0.5 AppImage ..."
- curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
+ curl -LO https://github.com/neovim/neovim/releases/download/v0.5.0/nvim.appimage
chmod u+x nvim.appimage
mkdir -p $HOME/.local/bin
mv nvim.appimage $HOME/.local/bin/
+ log_info "Creating an alias for the Neovim AppImage ..."
if [ -f "$HOME/.zshrc" ]; then
echo "alias 'nvim'=$HOME/.local/bin/nvim.appimage" >>$HOME/.zshrc
else
echo "alias 'nvim'=$HOME/.local/bin/nvim.appimage" >>$HOME/.bashrc
fi
- log_success "Successfully installed Neovim Nightly under $HOME/.local/bin/ directory"
-}
-
-install_packer() {
- if [[ ! -d "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" ]]; then
- log_info "Installing packer plugin manager ..."
- # NOTE: stop installing that branch when merged into the main branch
- git clone -q -b fix/premature-display-opening https://github.com/wbthomason/packer.nvim \
- $HOME/.local/share/nvim/site/pack/packer/start/packer.nvim
- fi
+ log_success "Successfully installed Neovim 0.5.0 under $HOME/.local/bin/ directory"
}
install_fonts() {
@@ -203,19 +202,21 @@ install_fonts() {
mkdir -p $HOME/.local/share/fonts
fi
- download_font "Fira Code Regular Nerd Font Complete Mono.ttf"
- log_info "Updating font cache, please wait ..."
- if [ $System == "Darwin" ]; then
- if [ ! -e "$HOME/Library/Fonts" ]; then
- mkdir "$HOME/Library/Fonts"
+ if [[ ! -f "$HOME/.local/share/fonts/Fira Code Regular Nerd Font Complete Mono.ttf" ]]; then
+ download_font "Fira Code Regular Nerd Font Complete Mono.ttf"
+ log_info "Updating font cache, please wait ..."
+ if [ "$System" == "Darwin" ]; then
+ if [ ! -e "$HOME/Library/Fonts" ]; then
+ mkdir "$HOME/Library/Fonts"
+ fi
+ cp $HOME/.local/share/fonts/* $HOME/Library/Fonts/
+ else
+ fc-cache -fv >/dev/null
+ mkfontdir "$HOME/.local/share/fonts" >/dev/null
+ mkfontscale "$HOME/.local/share/fonts" >/dev/null
fi
- cp $HOME/.local/share/fonts/* $HOME/Library/Fonts/
- else
- fc-cache -fv >/dev/null
- mkfontdir "$HOME/.local/share/fonts" >/dev/null
- mkfontscale "$HOME/.local/share/fonts" >/dev/null
+ log_success "Font cache done"
fi
- log_success "Font cache done"
}
download_font() {
@@ -241,8 +242,8 @@ install_done() {
pretty_echo ${Green} " You are almost done. Start neovim to install "
pretty_echo ${Green} " the plugins and kill some demons. "
pretty_echo ${Green} " "
- pretty_echo ${Green} " Thanks for installing Doom Nvim, if you have any "
- pretty_echo ${Green} " issue, please report it :) "
+ pretty_echo ${Green} " Thanks for installing Doom Nvim. If you have any "
+ pretty_echo ${Green} " issue, please report it :) "
pretty_echo ${Green} "=================================================="
}
# }}}
@@ -273,26 +274,26 @@ uninstall() {
# ===========
# {{{
welcome() {
- pretty_echo ${BRed} " ================= =============== =============== ======== ========"
- pretty_echo ${BRed} " \\\\\ . . . . . . .\\\\\ //. . . . . . .\\\\\ //. . . . . . .\\\\\ \\\\\. . .\\\\\// . . //"
- pretty_echo ${BRed} " ||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\\/ . . .||"
- pretty_echo ${BRed} " || . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . ||"
- pretty_echo ${BRed} " ||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .||"
- pretty_echo ${BRed} " || . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\ . . . . ||"
- pretty_echo ${BYellow} " ||. . || ||-' || || \`-|| || . .|| ||. . || ||-' || || \`|\_ . .|. .||"
- pretty_echo ${BYellow} " || . _|| || || || || ||_ . || || . _|| || || || |\ \`-_/| . ||"
- pretty_echo ${BYellow} " ||_-' || .|/ || || \|. || \`-_|| ||_-' || .|/ || || | \ / |-_.||"
- pretty_echo ${BYellow} " || ||_-' || || \`-_|| || || ||_-' || || | \ / | \`||"
- pretty_echo ${BYellow} " || \`' || || \`' || || \`' || || | \ / | ||"
- pretty_echo ${BYellow} " || .===' \`===. .==='.\`===. .===' /==. | \/ | ||"
- pretty_echo ${BYellow} " || .==' \_|-_ \`===. .===' _|_ \`===. .===' _-|/ \`== \/ | ||"
- pretty_echo ${BYellow} " || .==' _-' \`-_ \`=' _-' \`-_ \`=' _-' \`-_ /| \/ | ||"
- pretty_echo ${BYellow} " || .==' _-' '-__\._-' '-_./__-' \`' |. /| | ||"
- pretty_echo ${BYellow} " ||.==' _-' \`' | /==.||"
- pretty_echo ${BRed} " ==' _-' \/ \`=="
- pretty_echo ${BRed} " \ _-' N e o v i m \`-_ /"
- pretty_echo ${BRed} " \`'' \`\`' "
- pretty_echo ${BYellow} " Version : ${DoomNvimVersion} By : NTBBloodbath "
+ pretty_echo ${Gray} " ================= =============== =============== ======== ========"
+ pretty_echo ${Gray} " \\\\\ . . . . . . .\\\\\ //. . . . . . .\\\\\ //. . . . . . .\\\\\ \\\\\. . .\\\\\// . . //"
+ pretty_echo ${Gray} " ||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\\/ . . .||"
+ pretty_echo ${Gray} " || . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . ||"
+ pretty_echo ${Gray} " ||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .||"
+ pretty_echo ${Gray} " || . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\ . . . . ||"
+ pretty_echo ${Gray} " ||. . || ||-' || || \`-|| || . .|| ||. . || ||-' || || \`|\_ . .|. .||"
+ pretty_echo ${Gray} " || . _|| || || || || ||_ . || || . _|| || || || |\ \`-_/| . ||"
+ pretty_echo ${Gray} " ||_-' || .|/ || || \|. || \`-_|| ||_-' || .|/ || || | \ / |-_.||"
+ pretty_echo ${Gray} " || ||_-' || || \`-_|| || || ||_-' || || | \ / | \`||"
+ pretty_echo ${Gray} " || \`' || || \`' || || \`' || || | \ / | ||"
+ pretty_echo ${Gray} " || .===' \`===. .==='.\`===. .===' /==. | \/ | ||"
+ pretty_echo ${Gray} " || .==' \_|-_ \`===. .===' _|_ \`===. .===' _-|/ \`== \/ | ||"
+ pretty_echo ${Gray} " || .==' _-' \`-_ \`=' _-' \`-_ \`=' _-' \`-_ /| \/ | ||"
+ pretty_echo ${Gray} " || .==' _-' '-__\._-' '-_./__-' \`' |. /| | ||"
+ pretty_echo ${Gray} " ||.==' _-' \`' | /==.||"
+ pretty_echo ${Gray} " ==' _-' \/ \`=="
+ pretty_echo ${Gray} " \ _-' N E O V I M \`-_ /"
+ pretty_echo ${Gray} " \`'' \`\`' "
+ pretty_echo ${BBlue} " Version : ${DoomNvimVersion} By : NTBBloodbath "
echo ""
}
# }}}
@@ -303,88 +304,85 @@ welcome() {
helper() {
welcome
echo ""
- pretty_echo ${BRed} " Usage ./install.sh [OPTION]"
+ pretty_echo ${BGreen} " Usage: ./install.sh [OPTION]"
echo ""
- pretty_echo ${BRed} " OPTIONS:"
- pretty_echo ${Yellow} " -h --help Displays this message"
- pretty_echo ${Yellow} " -c --check-requirements Check Doom Nvim requirements"
- pretty_echo ${Yellow} " -i --install Install Doom Nvim"
- pretty_echo ${Yellow} " -d --install-dev Install Development version of Doom Nvim"
- pretty_echo ${Yellow} " -n --nightly Install Neovim Nightly and Doom Nvim"
- pretty_echo ${Yellow} " -u --update Update Doom Nvim"
- pretty_echo ${Yellow} " -v --version Echo Doom Nvim version"
- pretty_echo ${Yellow} " -x --uninstall Uninstall Doom Nvim"
+ pretty_echo ${BGreen} " Options:"
+ pretty_echo " -h --help\t\t\t\tDisplays this message"
+ pretty_echo " -c --check-requirements\t\tCheck Doom Nvim requirements"
+ pretty_echo " -i --install\t\t\tInstall Doom Nvim"
+ pretty_echo " -d --install-dev\t\t\tInstall Development version of Doom Nvim"
+ pretty_echo " -n --install-nvim\t\t\tInstall Neovim 0.5.0 and Doom Nvim"
+ pretty_echo " -u --update\t\t\t\tUpdate Doom Nvim"
+ pretty_echo " -v --version\t\t\tEcho Doom Nvim version"
+ pretty_echo " -x --uninstall\t\t\tUninstall Doom Nvim"
}
main() {
if [ $# -gt 0 ]; then
case $1 in
- --check-requirements | -c)
- welcome
- check_requirements
- exit 0
- ;;
- --update | -u)
- welcome
- update_repo
- exit 0
- ;;
- --install | -i)
- welcome
- check_all
- update_repo "main"
- install_packer
- install_fonts
- backup_neovim
- install_done
- exit 0
- ;;
- --install-dev | -d)
- welcome
- check_all
- update_repo "develop"
- install_packer
- install_fonts
- backup_neovim
- install_done
- exit 0
- ;;
- --nvim-nightly | -n)
- welcome
- check_all
- update_repo "main"
- install_packer
- backup_neovim
- install_nvim_nightly
- install_done
- exit 0
- ;;
- --help | -h)
- helper
- exit 0
- ;;
- --version | -v)
- log "Doom Nvim v${DoomNvimVersion}"
- exit 0
- ;;
- --uninstall | -x)
- welcome
- log_info "Uninstalling Doom Nvim ..."
- uninstall
- pretty_echo ${Green} "Thanks for using Doom Nvim, there are no more demons!"
- exit 0
- ;;
+ --check-requirements | -c)
+ welcome
+ check_requirements
+ exit 0
+ ;;
+ --update | -u)
+ welcome
+ update_repo
+ exit 0
+ ;;
+ --install | -i)
+ welcome
+ check_all
+ update_repo "main"
+ install_fonts
+ backup_neovim
+ install_done
+ exit 0
+ ;;
+ --install-dev | -d)
+ welcome
+ check_all
+ update_repo "develop"
+ install_fonts
+ backup_neovim
+ install_done
+ exit 0
+ ;;
+ --install-nvim | -n)
+ welcome
+ check_all
+ update_repo "main"
+ backup_neovim
+ install_nvim_appimage
+ install_done
+ exit 0
+ ;;
+ --help | -h)
+ helper
+ exit 0
+ ;;
+ --version | -v)
+ log "Doom Nvim v${DoomNvimVersion}"
+ exit 0
+ ;;
+ --uninstall | -x)
+ welcome
+ log_info "Uninstalling Doom Nvim ..."
+ uninstall
+ pretty_echo ${Green} "Thanks for using Doom Nvim, there are no more demons!"
+ exit 0
+ ;;
esac
else
# Run normal commands
welcome
check_all
update_repo "main"
- install_packer
backup_neovim
install_fonts
check_requirements
install_done
+ exit 0
fi
}
diff --git a/lua/colors/README.md b/lua/colors/README.md
new file mode 100644
index 000000000..36efdbbb8
--- /dev/null
+++ b/lua/colors/README.md
@@ -0,0 +1,59 @@
+# Colors
+
+This module contains the embedded colorschemes for Doom Nvim and the utils
+module required by those colorschemes.
+
+Actually the embedded colorschemes are the following:
+
+- doom-one (dark and light variant)
+
+## utils
+
+The utils module contains a few utilities for easily port Doom Emacs colorschemes
+to Lua colorschemes. These utilities are the following:
+
+- `Lighten` - lighten the provided HEX color in X percentage (5 by default).
+- `Darken` - darken the provided HEX color in X percentage (5 by default).
+- `Mix` - mix two provided HEX colors in X percentage (0 by default)
+
+## Contributing
+
+### Write colorschemes
+
+If you want to write colorschemes for Doom Nvim you will need to follow some
+requirements.
+
+- The colorscheme should be a Doom Emacs colorscheme, see [emacs-doom-themes].
+- The colorscheme should be written in pure Lua **without using helpers like lush**,
+ you can take a look at [doom-one] source or use it as a template (highly recommended).
+
+### Update embedded colorschemes
+
+If you want to update the embedded colorschemes like [doom-one] you'll need to
+copy the doom-one files to the proper locations and change a few lines to match
+Doom Nvim structure.
+
+- Changes in `colors/doom-one.lua`:
+
+```lua
+--- FROM:
+package.loaded['doom-one'] = nil
+require('doom-one')
+
+--- TO:
+package.loaded['colors.doom-one'] = nil
+require('colors.doom-one')
+```
+
+- Changes in `doom-one/init.lua`:
+
+```lua
+--- FROM:
+local utils = require('utils')
+
+--- TO:
+local utils = require('colors.utils')
+```
+
+[doom-one]: https://github.com/NTBBloodbath/doom-one.nvim
+[emacs-doom-themes]: https://github.com/hlissner/emacs-doom-themes
diff --git a/lua/colors/doom-one/init.lua b/lua/colors/doom-one/init.lua
new file mode 100644
index 000000000..d608c4796
--- /dev/null
+++ b/lua/colors/doom-one/init.lua
@@ -0,0 +1,743 @@
+-- vim:fdm=marker
+-- Vim Color File
+-- Name: doom-one
+-- Maintainer: http//github.com/NTBBloodbath
+-- License: The MIT License (MIT)
+-- Based On: http//github.com/romgrk/doom-one.vim and the original Doom Emacs one
+
+-- Helpers {{{
+
+local utils = require('colors.utils')
+
+-- }}}
+
+-- Customization variables {{{
+
+-- Set default values for doom_one variables if they don't exists
+if vim.g.doom_one_cursor_coloring == nil then
+ vim.g.doom_one_cursor_coloring = false
+end
+if vim.g.doom_one_terminal_colors == nil then
+ vim.g.doom_one_terminal_colors = false
+end
+if vim.g.doom_one_enable_treesitter == nil then
+ vim.g.doom_one_enable_treesitter = true
+end
+if vim.g.doom_one_transparent_background == nil then
+ vim.g.doom_one_transparent_background = false
+end
+if vim.g.doom_one_italic_comments == nil then
+ vim.g.doom_one_italic_comments = false
+end
+if vim.g.doom_one_telescope_highlights == nil then
+ vim.g.doom_one_telescope_highlights = true
+end
+
+local transparent_bg = vim.g.doom_one_transparent_background
+
+-- }}}
+
+-- Highlight Functions and Color definitions {{{
+
+local function high_clear(group)
+ vim.api.nvim_command('hi! clear ' .. group)
+end
+
+local function high_link(group, link)
+ vim.api.nvim_command('hi! link ' .. group .. ' ' .. link)
+end
+
+local function highlight(group, styles)
+ local bg = styles.bg and 'guibg=' .. styles.bg or 'guibg=NONE'
+ local fg = styles.fg and 'guifg=' .. styles.fg or 'guifg=NONE'
+ local sp = styles.sp and 'guisp=' .. styles.sp or 'guisp=NONE'
+ local gui = styles.gui and 'gui=' .. styles.gui or 'gui=NONE'
+
+ vim.api.nvim_command(
+ 'hi! ' .. group .. ' ' .. bg .. ' ' .. fg .. ' ' .. sp .. ' ' .. gui
+ )
+end
+
+local function apply_highlight(groups)
+ for group, styles in pairs(groups) do
+ highlight(group, styles)
+ end
+end
+
+-- Change the colorscheme colors depending on the current background, defaults to
+-- doom-one dark variant colors
+local current_bg = vim.opt.background:get()
+local light_bg = false
+
+local base0 = '#1B2229'
+local base1 = '#1c1f24'
+local base2 = '#202328'
+local base3 = '#23272e'
+local base4 = '#3f444a'
+local base5 = '#5B6268'
+local base6 = '#73797e'
+local base7 = '#9ca0a4'
+local base8 = '#DFDFDF'
+local base9 = '#E6E6E6'
+
+local grey = base4
+local red = '#ff6c6b'
+local orange = '#da8548'
+local green = '#98be65'
+local yellow = '#ECBE7B'
+local blue = '#51afef'
+local dark_blue = '#2257A0'
+local magenta = '#c678dd'
+local light_magenta = utils.Lighten(magenta, 0.4)
+local violet = '#a9a1e1'
+local cyan = '#46D9FF'
+local white = '#efefef'
+
+local bg = '#282c34'
+local bg_alt = '#21242b'
+local bg_highlight = '#21252a'
+local bg_popup = '#3E4556'
+local bg_statusline = bg_popup
+local bg_highlighted = '#4A4A45'
+
+local fg = '#bbc2cf'
+local fg_alt = '#5B6268'
+local fg_highlight = utils.Lighten(fg, 0.2)
+
+local tag = utils.Mix(blue, cyan, 0.5)
+
+local diff_info_fg = orange
+local diff_info_bg0 = utils.Mix('#D8EEFD', bg, 0.6)
+local diff_info_bg1 = utils.Mix('#D8EEFD', bg, 0.8)
+
+local diff_add_fg = green
+local diff_add_fg0 = utils.Mix(green, fg, 0.4)
+local diff_add_bg0 = utils.Mix('#506d5b', bg, 0.6)
+local diff_add_bg1 = utils.Mix('#acf2bd', bg, 0.8)
+
+local gh_danger_fg = red
+local gh_danger_fg0 = utils.Mix(red, fg, 0.6)
+local gh_danger_bg0 = utils.Mix('#ffdce0', bg, 0.6)
+local gh_danger_bg1 = utils.Mix('#ffdce0', bg, 0.8)
+
+if current_bg == 'light' then
+ light_bg = true
+
+ base0 = '#f0f0f0'
+ base1 = '#e7e7e7'
+ base2 = '#dfdfdf'
+ base3 = '#c6c7c7'
+ base4 = '#9ca0a4'
+ base5 = '#383a42'
+ base6 = '#202328'
+ base7 = '#23272e'
+ base8 = '#1c1f24'
+ base9 = '#1B2229'
+
+ grey = base4
+ red = '#e45649'
+ orange = '#da8548'
+ green = '#50a14f'
+ yellow = '#986801'
+ blue = '#4078f2'
+ dark_blue = '#a0bcf8'
+ magenta = '#a626a4'
+ light_magenta = utils.Darken(magenta, 0.36)
+ violet = '#b751b6'
+ cyan = '#0184bc'
+ white = '#efefef'
+
+ bg = '#fafafa'
+ bg_alt = '#f0f0f0'
+ bg_highlight = utils.Darken(bg, 0.3)
+ bg_popup = bg_alt
+ bg_statusline = bg_popup
+
+ fg = base5
+ fg_alt = base3
+ fg_highlight = utils.Lighten(fg, 0.2)
+
+ tag = utils.Mix(blue, cyan, 0.5)
+
+ diff_info_fg = orange
+ diff_info_bg0 = utils.Mix('#D8EEFD', bg, 0.6)
+ diff_info_bg1 = utils.Mix('#D8EEFD', bg, 0.8)
+
+ diff_add_fg = green
+ diff_add_fg0 = utils.Mix(green, fg, 0.4)
+ diff_add_bg0 = utils.Mix('#506d5b', bg, 0.4)
+ diff_add_bg1 = utils.Mix('#acf2bd', bg, 0.8)
+
+ gh_danger_fg = red
+ gh_danger_fg0 = utils.Mix(red, fg, 0.6)
+ gh_danger_bg0 = utils.Mix('#ffdce0', bg, 0.8)
+ gh_danger_bg1 = utils.Mix('#ffdce0', bg, 0.9)
+end
+
+if vim.g.doom_one_cursor_coloring then
+ vim.opt.guicursor =
+ 'n-v-c:block-Cursor,i-ci-ve:ver25-Cursor,r-cr-o:hor25-Cursor'
+end
+
+-- }}}
+
+-- General UI {{{
+
+local general_ui = {
+ Normal = { fg = fg, bg = transparent_bg and 'NONE' or bg },
+ NormalPopup = {
+ fg = fg_highlight,
+ bg = transparent_bg and 'NONE' or bg_popup,
+ },
+ NormalPopover = {
+ fg = fg_highlight,
+ bg = transparent_bg and 'NONE' or bg_popup,
+ },
+ NormalPopupPrompt = {
+ fg = base7,
+ bg = transparent_bg and 'NONE' or utils.Darken(bg_popup, 0.3),
+ gui = 'bold',
+ },
+ NormalPopupSubtle = {
+ fg = base6,
+ bg = transparent_bg and 'NONE' or bg_popup,
+ },
+ EndOfBuffer = { fg = bg, bg = transparent_bg and 'NONE' or bg },
+
+ Visual = { bg = dark_blue },
+ VisualBold = { bg = dark_blue, gui = 'bold' },
+
+ LineNr = { fg = grey, bg = transparent_bg and 'NONE' or bg },
+ Cursor = { bg = blue },
+ CursorLine = { bg = bg_highlight },
+ CursorLineNr = { fg = fg, bg = bg_highlight },
+ CursorColumn = { bg = bg_highlight },
+
+ Folded = { fg = base5, bg = bg_highlight },
+ FoldColumn = { fg = fg_alt, bg = bg },
+ SignColumn = { bg = transparent_bg and 'NONE' or bg },
+ ColorColumn = { bg = bg_highlight },
+
+ IndentGuide = { fg = grey },
+ IndentGuideEven = { fg = grey },
+ IndentGuideOdd = { fg = grey },
+
+ TermCursor = { fg = fg, gui = 'reverse' },
+ TermCursorNC = { fg = fg_alt, gui = 'reverse' },
+ TermNormal = { fg = fg, bg = bg },
+ TermNormalNC = { fg = fg, bg = bg },
+
+ WildMenu = { fg = fg, bg = dark_blue },
+ Separator = { fg = fg_alt },
+ VertSplit = { fg = grey, bg = bg },
+
+ TabLine = {
+ fg = base7,
+ bg = transparent_bg and 'NONE' or bg_alt,
+ gui = 'bold',
+ },
+ TabLineSel = { fg = blue, bg = bg, gui = 'bold' },
+ TabLineFill = { bg = transparent_bg and 'NONE' or base1, gui = 'bold' },
+
+ StatusLine = { fg = base8, bg = base3 },
+ StatusLineNC = { fg = base6, bg = bg_popup },
+ StatusLinePart = { fg = base6, bg = bg_popup, gui = 'bold' },
+ StatusLinePartNC = { fg = base6, bg = bg_popup, gui = 'bold' },
+
+ Pmenu = { fg = fg, bg = bg_highlight },
+ PmenuSel = { fg = base0, bg = blue },
+ PmenuSelBold = { fg = base0, bg = blue, gui = 'bold' },
+ PmenuSbar = { bg = bg_alt },
+ PmenuThumb = { bg = fg },
+}
+
+if vim.opt.pumblend == 1 then
+ vim.opt.pumblend = 20
+end
+
+apply_highlight(general_ui)
+
+-- }}}
+
+-- Search, Highlight. Conceal, Messages {{{
+
+local search_high_ui = {
+ Search = { fg = fg, bg = dark_blue, gui = 'bold' },
+ Substitute = { fg = red, gui = 'strikethrough,bold' },
+ IncSearch = { fg = fg, bg = dark_blue, gui = 'bold' },
+ IncSearchCursor = { gui = 'reverse' },
+
+ Conceal = { fg = grey, gui = 'none' },
+ SpecialKey = { fg = violet, gui = 'bold' },
+ NonText = { fg = fg_alt, gui = 'bold' },
+ MatchParen = { fg = red, gui = 'bold' },
+ Whitespace = { fg = grey },
+
+ Highlight = { bg = bg_highlighted },
+ HighlightSubtle = { bg = bg_highlighted },
+
+ Question = { fg = green, gui = 'bold' },
+
+ File = { fg = fg },
+ Directory = { fg = violet, gui = 'bold' },
+ Title = { fg = violet, gui = 'bold' },
+
+ Bold = { gui = 'bold' },
+ Emphasis = { fg = green, gui = 'bold' },
+}
+
+apply_highlight(search_high_ui)
+
+-- }}}
+
+-- Text levels {{{
+
+local text_colors = {
+ Normal = fg,
+ Info = blue,
+ Success = green,
+ Warning = yellow,
+ Debug = yellow,
+ Error = red,
+ Special = violet,
+ Muted = base7,
+}
+
+for key, _ in pairs(text_colors) do
+ apply_highlight({
+ ['Text' .. key] = {
+ fg = text_colors[key],
+ },
+ })
+ apply_highlight({
+ ['Text' .. key .. 'Bold'] = {
+ fg = text_colors[key],
+ gui = 'bold',
+ },
+ })
+end
+
+high_link('Msg', 'TextSuccess')
+high_link('MoreMsg', 'TextInfo')
+high_link('WarningMsg', 'TextWarning')
+high_link('Error', 'TextError')
+high_link('ErrorMsg', 'TextError')
+high_link('ModeMsg', 'TextSpecial')
+high_link('Todo', 'TextWarningBold')
+
+-- }}}
+
+-- Main Syntax {{{
+
+local main_syntax = {
+ Tag = { fg = tag, gui = 'bold' },
+ Link = { fg = tag, gui = 'undercurl' },
+ URL = { fg = tag, gui = 'undercurl' },
+ Underlined = { fg = tag, gui = 'underline' },
+
+ Comment = {
+ fg = fg_alt,
+ gui = vim.g.doom_one_italic_comments and 'italic' or 'NONE',
+ },
+ CommentBold = { fg = fg_alt, gui = 'bold' },
+ SpecialComment = { fg = base7, gui = 'bold' },
+
+ Macro = { fg = violet },
+ Define = { fg = violet, gui = 'bold' },
+ Include = { fg = violet, gui = 'bold' },
+ PreProc = { fg = violet, gui = 'bold' },
+ PreCondit = { fg = violet, gui = 'bold' },
+
+ Label = { fg = light_bg and orange or blue },
+ Repeat = { fg = light_bg and orange or blue },
+ Keyword = { fg = light_bg and orange or blue },
+ Operator = { fg = light_bg and orange or blue },
+ Delimiter = { fg = light_bg and orange or blue },
+ Statement = { fg = light_bg and orange or blue },
+ Exception = { fg = light_bg and orange or blue },
+ Conditional = { fg = light_bg and orange or blue },
+
+ Variable = { fg = '#8B93E6' },
+ VariableBuiltin = { fg = '#8B93E6', gui = 'bold' },
+ Constant = { fg = violet, gui = 'bold' },
+
+ Number = { fg = light_bg and yellow or orange },
+ Float = { fg = light_bg and yellow or orange },
+ Boolean = { fg = light_bg and yellow or orange, gui = 'bold' },
+ Enum = { fg = light_bg and yellow or orange },
+
+ Character = { fg = violet, gui = 'bold' },
+ SpecialChar = { fg = base8, gui = 'bold' },
+
+ String = { fg = green },
+ StringDelimiter = { fg = green },
+
+ Special = { fg = violet },
+ SpecialBold = { fg = violet, gui = 'bold' },
+
+ Field = { fg = violet },
+ Argument = { fg = light_magenta },
+ Attribute = { fg = light_magenta },
+ Identifier = { fg = light_magenta },
+ Property = { fg = magenta },
+ Function = { fg = magenta },
+ FunctionBuiltin = { fg = light_magenta, gui = 'bold' },
+ KeywordFunction = { fg = light_bg and orange or blue },
+ Method = { fg = violet },
+
+ Type = { fg = yellow },
+ TypeBuiltin = { fg = yellow, gui = 'bold' },
+ StorageClass = { fg = light_bg and orange or blue },
+ Class = { fg = light_bg and orange or blue },
+ Structure = { fg = light_bg and orange or blue },
+ Typedef = { fg = light_bg and orange or blue },
+
+ Regexp = { fg = '#dd0093' },
+ RegexpSpecial = { fg = '#a40073' },
+ RegexpDelimiter = { fg = '#540063', gui = 'bold' },
+ RegexpKey = { fg = '#5f0041', gui = 'bold' },
+}
+
+apply_highlight(main_syntax)
+high_link('CommentURL', 'URL')
+high_link('CommentLabel', 'CommentBold')
+high_link('CommentSection', 'CommentBold')
+high_link('Noise', 'Comment')
+
+-- }}}
+
+-- Diff {{{
+
+local diff = {
+ diffLine = { fg = base8, bg = diff_info_bg1 },
+ diffSubName = { fg = base8, bg = diff_info_bg1 },
+
+ DiffAdd = { bg = diff_add_bg1 },
+ DiffChange = { bg = diff_add_bg1 },
+ DiffText = { bg = diff_add_bg0 },
+ DiffDelete = { bg = gh_danger_bg0 },
+
+ DiffAdded = { fg = diff_add_fg0, bg = diff_add_bg1 },
+ DiffModified = { fg = fg, bg = diff_info_bg0 },
+ DiffRemoved = { fg = gh_danger_fg0, bg = gh_danger_bg1 },
+
+ DiffAddedGutter = { fg = diff_add_fg, gui = 'bold' },
+ DiffModifiedGutter = { fg = diff_info_fg, gui = 'bold' },
+ DiffRemovedGutter = { fg = gh_danger_fg, gui = 'bold' },
+
+ DiffAddedGutterLineNr = { fg = grey },
+ DiffModifiedGutterLineNr = { fg = grey },
+ DiffRemovedGutterLineNr = { fg = grey },
+}
+
+high_clear('DiffAdd')
+high_clear('DiffChange')
+high_clear('DiffText')
+high_clear('DiffDelete')
+apply_highlight(diff)
+
+-- }}}
+
+-- Markdown {{{
+local markdown = {
+ markdownCode = { bg = bg_highlight },
+ markdownCodeBlock = { bg = bg_highlight },
+ markdownH1 = { gui = 'bold' },
+ markdownH2 = { gui = 'bold' },
+ markdownLinkText = { gui = 'underline' },
+}
+
+apply_highlight(markdown)
+--}}}
+
+-- Plugins {{{
+
+-- barbar.nvim {{{
+
+local barbar = {
+ BufferCurrent = { fg = base9, bg = bg },
+ BufferCurrentIndex = { fg = base6, bg = bg },
+ BufferCurrentMod = { fg = yellow, bg = bg },
+ BufferCurrentSign = { fg = blue, bg = bg },
+ BufferCurrentTarget = { fg = red, bg = bg, gui = 'bold' },
+
+ BufferVisible = { fg = base7, bg = bg },
+ BufferVisibleIndex = { fg = base9, bg = bg },
+ BufferVisibleMod = { fg = yellow, bg = bg },
+ BufferVisibleSign = { fg = base4, bg = bg },
+ BufferVisibleTarget = { fg = red, bg = bg, gui = 'bold' },
+
+ BufferInactive = { fg = base6, bg = base1 },
+ BufferInactiveIndex = { fg = base6, bg = base1 },
+ BufferInactiveMod = { fg = yellow, bg = base1 },
+ BufferInactiveSign = { fg = base4, bg = base1 },
+ BufferInactiveTarget = { fg = red, bg = base1, gui = 'bold' },
+
+ BufferTabpages = { fg = blue, bg = bg_statusline, gui = 'bold' },
+ BufferTabpageFill = { fg = base4, bg = base1, gui = 'bold' },
+
+ BufferPart = { fg = diff_info_fg, bg = diff_info_bg0, gui = 'bold' },
+}
+
+apply_highlight(barbar)
+
+-- }}}
+
+-- Gitgutter {{{
+
+high_link('GitGutterAdd', 'DiffAddedGutter')
+high_link('GitGutterChange', 'DiffModifiedGutter')
+high_link('GitGutterDelete', 'DiffRemovedGutter')
+high_link('GitGutterChangeDelete', 'DiffModifiedGutter')
+
+high_link('GitGutterAddLineNr', 'DiffAddedGutterLineNr')
+high_link('GitGutterChangeLineNr', 'DiffModifiedGutterLineNr')
+high_link('GitGutterDeleteLineNr', 'DiffRemovedGutterLineNr')
+high_link('GitGutterChangeDeleteLineNr', 'DiffModifiedGutterLineNr')
+
+-- }}}
+
+-- Gitsigns {{{
+
+high_link('GitSignsAdd', 'DiffAddedGutter')
+high_link('GitSignsChange', 'DiffModifiedGutter')
+high_link('GitSignsDelete', 'DiffRemovedGutter')
+high_link('GitSignsChangeDelete', 'DiffModifiedGutter')
+
+-- }}}
+
+-- Telescope {{{
+
+if vim.g.doom_one_telescope_highlights then
+ local telescope = {
+ TelescopeSelection = { fg = yellow, gui = 'bold' },
+ TelescopeSelectionCaret = { fg = light_bg and orange or blue },
+ TelescopeMultiSelection = { fg = grey },
+ TelescopeNormal = { fg = fg },
+ TelescopeMatching = { fg = green, gui = 'bold' },
+ TelescopePromptPrefix = { fg = light_bg and orange or blue },
+ TelescopeBorder = { fg = light_bg and orange or blue },
+ TelescopePromptBorder = { fg = light_bg and orange or blue },
+ TelescopeResultsBorder = { fg = light_bg and orange or blue },
+ TelescopePreviewBorder = { fg = light_bg and orange or blue },
+ }
+
+ apply_highlight(telescope)
+ high_link('TelescopePrompt', 'TelescopeNormal')
+end
+
+-- }}}
+
+-- NvimTree {{{
+
+local nvim_tree = {
+ NvimTreeFolderName = { fg = light_bg and base9 or blue, gui = 'bold' },
+ NvimTreeRootFolder = { fg = green },
+ NvimTreeEmptyFolderName = { fg = fg_alt, gui = 'bold' },
+ NvimTreeSymlink = { fg = fg, gui = 'underline' },
+ NvimTreeExecFile = { fg = green, gui = 'bold' },
+ NvimTreeImageFile = { fg = light_bg and orange or blue },
+ NvimTreeOpenedFile = { fg = fg_alt },
+ NvimTreeSpecialFile = { fg = fg, gui = 'underline' },
+ NvimTreeMarkdownFile = { fg = fg, gui = 'underline' },
+}
+
+apply_highlight(nvim_tree)
+high_link('NvimTreeGitDirty', 'DiffModifiedGutter')
+high_link('NvimTreeGitStaged', 'DiffModifiedGutter')
+high_link('NvimTreeGitMerge', 'DiffModifiedGutter')
+high_link('NvimTreeGitRenamed', 'DiffModifiedGutter')
+high_link('NvimTreeGitNew', 'DiffAddedGutter')
+high_link('NvimTreeGitDeleted', 'DiffRemovedGutter')
+
+high_link('NvimTreeIndentMarker', 'IndentGuide')
+high_link('NvimTreeOpenedFolderName', 'NvimTreeFolderName')
+
+-- }}}
+
+-- Dashboard {{{
+
+local dashboard = {
+ dashboardHeader = { fg = '#586268' },
+ dashboardCenter = { fg = light_bg and orange or blue },
+ dashboardShortcut = { fg = '#9788b9' },
+}
+
+apply_highlight(dashboard)
+high_link('dashboardFooter', 'dashboardHeader')
+
+-- }}}
+
+-- WhichKey {{{
+
+local whichkey = {
+ WhichKey = { fg = light_bg and orange or blue },
+ WhichKeyGroup = { fg = magenta },
+ WhichKeyDesc = { fg = magenta },
+ WhichKeySeparator = { fg = base5 },
+ WhichKeyFloat = { bg = base2 },
+ WhichKeyValue = { fg = grey },
+}
+
+apply_highlight(whichkey)
+
+-- }}}
+
+-- }}}
+
+-- LSP {{{
+
+local msg_underline = {
+ ErrorMsgUnderline = { fg = red, gui = 'undercurl' },
+ WarningMsgUnderline = { fg = yellow, gui = 'undercurl' },
+ MoreMsgUnderline = { fg = blue, gui = 'undercurl' },
+ MsgUnderline = { fg = green, gui = 'undercurl' },
+}
+
+apply_highlight(msg_underline)
+high_link('LspDiagnosticsFloatingError', 'ErrorMsg')
+high_link('LspDiagnosticsFloatingWarning', 'Warning')
+high_link('LspDiagnosticsFloatingInformation', 'MoreMsg')
+high_link('LspDiagnosticsFloatingHint', 'Msg')
+high_link('LspDiagnosticsDefaultError', 'ErrorMsg')
+high_link('LspDiagnosticsDefaultWarning', 'WarningMsg')
+high_link('LspDiagnosticsDefaultInformation', 'MoreMsg')
+high_link('LspDiagnosticsDefaultHint', 'Msg')
+high_link('LspDiagnosticsVirtualTextError', 'ErrorMsg')
+high_link('LspDiagnosticsVirtualTextWarning', 'WarningMsg')
+high_link('LspDiagnosticsVirtualTextInformation', 'MoreMsg')
+high_link('LspDiagnosticsVirtualTextHint', 'Msg')
+high_link('LspDiagnosticsUnderlineError', 'ErrorMsgUnderline')
+high_link('LspDiagnosticsUnderlineWarning', 'WarningMsgUnderline')
+high_link('LspDiagnosticsUnderlineInformation', 'MoreMsgUnderline')
+high_link('LspDiagnosticsUnderlineHint', 'MsgUnderline')
+high_link('LspDiagnosticsSignError', 'ErrorMsg')
+high_link('LspDiagnosticsSignWarning', 'WarningMsg')
+high_link('LspDiagnosticsSignInformation', 'MoreMsg')
+high_link('LspDiagnosticsSignHint', 'Msg')
+high_link('LspReferenceText', 'Bold')
+high_link('LspReferenceRead', 'Bold')
+high_link('LspReferenceWrite', 'Bold')
+high_link('TermCursor', 'Cursor')
+high_link('healthError', 'ErrorMsg')
+high_link('healthSuccess', 'Msg')
+high_link('healthWarning', 'WarningMsg')
+
+-- LspSaga {{{
+
+local lspsaga = {
+ SagaShadow = { bg = bg },
+ LspSagaDiagnosticHeader = { fg = red },
+}
+
+apply_highlight(lspsaga)
+high_link('LspSagaDiagnosticBorder', 'Normal')
+high_link('LspSagaDiagnosticTruncateLine', 'Normal')
+high_link('LspFloatWinBorder', 'Normal')
+high_link('LspSagaBorderTitle', 'Title')
+high_link('TargetWord', 'Error')
+high_link('ReferencesCount', 'Title')
+high_link('ReferencesIcon', 'Special')
+high_link('DefinitionCount', 'Title')
+high_link('TargetFileName', 'Comment')
+high_link('DefinitionIcon', 'Special')
+high_link('ProviderTruncateLine', 'Normal')
+high_link('LspSagaFinderSelection', 'Search')
+high_link('DiagnosticTruncateLine', 'Normal')
+high_link('DiagnosticError', 'LspDiagnosticsDefaultError')
+high_link('DiagnosticWarning', 'LspDiagnosticsDefaultWarning')
+high_link('DiagnosticInformation', 'LspDiagnosticsDefaultInformation')
+high_link('DiagnosticHint', 'LspDiagnosticsDefaultHint')
+high_link('DefinitionPreviewTitle', 'Title')
+high_link('LspSagaShTruncateLine', 'Normal')
+high_link('LspSagaDocTruncateLine', 'Normal')
+high_link('LineDiagTuncateLine', 'Normal')
+high_link('LspSagaCodeActionTitle', 'Title')
+high_link('LspSagaCodeActionTruncateLine', 'Normal')
+high_link('LspSagaCodeActionContent', 'Normal')
+high_link('LspSagaRenamePromptPrefix', 'Normal')
+high_link('LspSagaRenameBorder', 'Bold')
+high_link('LspSagaHoverBorder', 'Bold')
+high_link('LspSagaSignatureHelpBorder', 'Bold')
+high_link('LspSagaCodeActionBorder', 'Bold')
+high_link('LspSagaDefPreviewBorder', 'Bold')
+high_link('LspLinesDiagBorder', 'Bold')
+
+-- }}}
+
+-- }}}
+
+-- TreeSitter {{{
+
+if vim.g.doom_one_enable_treesitter then
+ high_link('TSException', 'Exception')
+ high_link('TSAnnotation', 'PreProc')
+ high_link('TSAttribute', 'Attribute')
+ high_link('TSConditional', 'Conditional')
+ high_link('TSComment', 'Comment')
+ high_link('TSConstructor', 'Structure')
+ high_link('TSConstant', 'Constant')
+ high_link('TSConstBuiltin', 'Constant')
+ high_link('TSConstMacro', 'Macro')
+ high_link('TSError', 'Error')
+ high_link('TSField', 'Field')
+ high_link('TSFloat', 'Float')
+ high_link('TSFunction', 'Function')
+ high_link('TSFuncBuiltin', 'FunctionBuiltin')
+ high_link('TSFuncMacro', 'Macro')
+ high_link('TSInclude', 'Include')
+ high_link('TSKeyword', 'Keyword')
+ high_link('TSKeywordFunction', 'KeywordFunction')
+ high_link('TSLabel', 'Label')
+ high_link('TSMethod', 'Method')
+ high_link('TSNamespace', 'Directory')
+ high_link('TSNumber', 'Number')
+ high_link('TSOperator', 'Operator')
+ high_link('TSParameter', 'Argument')
+ high_link('TSParameterReference', 'Argument')
+ high_link('TSProperty', 'Property')
+ high_link('TSPunctDelimiter', 'Delimiter')
+ high_link('TSPunctBracket', 'Delimiter')
+ high_link('TSPunctSpecial', 'Delimiter')
+ high_link('TSRepeat', 'Repeat')
+ high_link('TSString', 'String')
+ high_link('TSStringRegex', 'StringDelimiter')
+ high_link('TSStringEscape', 'StringDelimiter')
+ high_link('TSTag', 'Tag')
+ high_link('TSTagDelimiter', 'Delimiter')
+ high_link('TSStrong', 'Bold')
+ high_link('TSURI', 'URL')
+ high_link('TSWarning', 'Warning')
+ high_link('TSDanger', 'Error')
+ high_link('TSType', 'Type')
+ high_link('TSTypeBuiltin', 'TypeBuiltin')
+ high_link('TSVariable', 'None')
+ high_link('TSVariableBuiltin', 'VariableBuiltin')
+end
+
+-- }}}
+
+-- Neovim Terminal Colors {{{
+
+if vim.g.doom_one_terminal_colors then
+ vim.g.terminal_color_0 = bg
+ vim.g.terminal_color_1 = red
+ vim.g.terminal_color_2 = green
+ vim.g.terminal_color_3 = yellow
+ vim.g.terminal_color_4 = blue
+ vim.g.terminal_color_5 = violet
+ vim.g.terminal_color_6 = cyan
+ vim.g.terminal_color_7 = fg
+ vim.g.terminal_color_8 = grey
+ vim.g.terminal_color_9 = red
+ vim.g.terminal_color_10 = green
+ vim.g.terminal_color_11 = orange
+ vim.g.terminal_color_12 = blue
+ vim.g.terminal_color_13 = violet
+ vim.g.terminal_color_14 = cyan
+ vim.g.terminal_color_15 = white
+ vim.g.terminal_color_background = bg_alt
+ vim.g.terminal_color_foreground = fg_alt
+end
+
+-- }}}
diff --git a/lua/colors/utils/init.lua b/lua/colors/utils/init.lua
new file mode 100644
index 000000000..111c0e7c4
--- /dev/null
+++ b/lua/colors/utils/init.lua
@@ -0,0 +1,109 @@
+---[[------------------------]]---
+-- COLOR UTILITIES --
+---]]------------------------[[---
+
+local M = {}
+
+-------------------------------------------------------------------------------
+-- Functions {{{
+
+-- Convert RGB to Hex color.
+-- @param r Red value
+-- @param g Green value
+-- @param b Blue value
+-- @return HEX color, e.g. '#1E1E1E'
+local function RGB_to_Hex(r, g, b)
+ return '#' .. string.format('%02X%02X%02X', r, g, b)
+end
+
+-- Convert Hex to RGB color.
+-- @param color HEX color
+-- @return RGB color, e.g. {30, 30, 30}
+local function Hex_to_RGB(color)
+ color = color:gsub('#', '')
+ return {
+ tonumber('0x' .. string.sub(color, 1, 2)),
+ tonumber('0x' .. string.sub(color, 3, 4)),
+ tonumber('0x' .. string.sub(color, 5, 6)),
+ }
+end
+
+-- }}}
+-------------------------------------------------------------------------------
+-- Composed functions {{{
+
+M.Lighten = function(color, percentage)
+ local amount = percentage == nil and 5.0 or percentage
+
+ if amount < 1.0 then
+ amount = 1.0 + amount
+ else
+ amount = 1.0 + (amount / 100.0)
+ end
+
+ -- Let's pass amount variable to Neovim so we can use
+ -- the Neovim map function
+ vim.g.amount = amount
+
+ local rgb = Hex_to_RGB(color)
+ rgb = vim.fn.map(rgb, 'v:val * amount')
+ -- Let's delete the g:amount variable since we don't need it anymore
+ vim.cmd('unlet g:amount')
+
+ rgb = vim.fn.map(rgb, 'v:val > 255.0 ? 255.0 : v:val')
+ rgb = vim.fn.map(rgb, 'float2nr(v:val)')
+ local hex = RGB_to_Hex(rgb[1], rgb[2], rgb[3])
+
+ return hex
+end
+
+M.Darken = function(color, percentage)
+ local amount = percentage == nil and 5.0 or percentage
+
+ if amount < 1.0 then
+ amount = 1.0 - amount
+ else
+ amount = 1.0 - (amount / 100.0)
+ end
+ if amount < 0.0 then
+ amount = 0.0
+ end
+
+ -- Let's pass amount variable to Neovim so we can use
+ -- the Neovim map function
+ vim.g.amount = amount
+
+ local rgb = Hex_to_RGB(color)
+ rgb = vim.fn.map(rgb, 'v:val * amount')
+ -- Let's delete the g:amount variable since we don't need it anymore
+ vim.cmd('unlet g:amount')
+
+ rgb = vim.fn.map(rgb, 'v:val > 255.0 ? 255.0 : v:val')
+ rgb = vim.fn.map(rgb, 'float2nr(v:val)')
+ local hex = RGB_to_Hex(rgb[1], rgb[2], rgb[3])
+
+ return hex
+end
+
+local function interpolate(start, _end, amount)
+ local diff = _end - start
+ return start + (diff * amount)
+end
+
+M.Mix = function(first, second, percentage)
+ local amount = percentage == nil and 0.0 or percentage
+
+ local first_rgb = Hex_to_RGB(first)
+ local second_rgb = Hex_to_RGB(second)
+
+ local r = interpolate(first_rgb[1], second_rgb[1], amount)
+ local g = interpolate(first_rgb[2], second_rgb[2], amount)
+ local b = interpolate(first_rgb[3], second_rgb[3], amount)
+
+ return RGB_to_Hex(r, g, b)
+end
+-- }}}
+
+return M
+
+-- vim: fdm=marker
diff --git a/lua/doom/README.md b/lua/doom/README.md
new file mode 100644
index 000000000..f6231b13e
--- /dev/null
+++ b/lua/doom/README.md
@@ -0,0 +1,11 @@
+# Doom
+
+This is the entry point module for Doom Nvim. Herein lies the core of Doom
+divided into three different sub-modules.
+
+- [core](./core/README.md) - The Doom core, herein lies the entire Doom core,
+ e.g. configurations, keybindings.
+- [modules](./modules/README.md) - The Doom modules, herein lies the Doom plugins
+ and their configurations.
+- [utils](./utils/README.md) - The Doom utilities, herein lies the Doom utility
+ functions.
diff --git a/lua/doom/config/doomrc.lua b/lua/doom/config/doomrc.lua
deleted file mode 100644
index 1c9ac4653..000000000
--- a/lua/doom/config/doomrc.lua
+++ /dev/null
@@ -1,193 +0,0 @@
----[[---------------------------------------]]---
--- doomrc.lua - Load Doom Nvim doomrc --
--- Author: NTBBloodbath --
--- License: GPLv2 --
----[[---------------------------------------]]---
-
-function Check_BFC()
- -- /home/user/.config/doom-nvim/doomrc
- if Fn.filereadable(Doom_root .. '/doomrc') then
- Doom_bfc = true
- else
- Doom_bfc = false
- end
-end
-
-local function default_BFC_values()
- Doom = {
- -- Autosave
- -- false : Disable autosave
- -- true : Enable autosave
- -- @default = false
- autosave = false,
-
- -- Format on save
- -- false : Disable format on save
- -- true : Enable format on save
- -- @default = false
- fmt_on_save = false,
-
- -- Autosave sessions
- -- false : Disable session autosave
- -- true : Enable session autosave
- -- @default = false
- autosave_sessions = false,
-
- -- Autoload sessions
- -- false : Disable session autoload
- -- true : Enable session autosave
- -- @default = false
- autoload_last_session = false,
-
- -- Preserve last editing position
- -- false : Disable preservation of last editing position
- -- true : Enable preservation of last editing position
- -- @default = false
- preserve_edit_pos = false,
-
- -- Default indent size
- -- @default = 4
- indent = 4,
-
- -- Show indent lines
- -- @default = true
- show_indent = true,
-
- -- Expand tabs
- -- Specifies if spaces or tabs must be used
- -- false : spaces
- -- true : tabs
- -- @default = true
- expand_tabs = true,
-
- -- Set numbering
- -- false : Shows absolute number lines
- -- true : Shows relative number lines
- -- @default = true
- relative_num = true,
-
- -- Set max cols
- -- Defines the column to show a vertical marker
- -- @default = 80
- max_columns = 80,
-
- -- Enable guicolors
- -- Enables gui colors on GUI versions of Neovim
- -- @default = true
- enable_guicolors = true,
-
- -- Sidebar sizing
- -- Specifies the default width of Tree Explorer and Tagbar
- -- @default = 25
- sidebar_width = 25,
-
- -- Tagbar left
- -- Sets Tagbar buffer to the left when enabled
- -- @default = true
- tagbar_left = true,
-
- -- Show hidden files
- -- @default = true
- show_hidden = true,
-
- -- Default colorscheme
- -- @default = doom-one
- colorscheme = 'doom-one',
-
- -- Background color
- -- @default = dark
- colorscheme_bg = 'dark',
-
- -- Checkupdates on start
- -- @default = false
- check_updates = false,
-
- -- Disabled plugins
- -- @default = {'lazygit', 'minimap', 'restclient'}
- -- example:
- -- disabled_plugins = {'emmet-vim'}
- disabled_plugins = { 'lazygit', 'minimap', 'restclient' },
-
- -- Disabled plugins modules
- -- @default = {'git', 'lsp', 'web'}
- -- example:
- -- disabled_modules = {'web'}
- disabled_modules = { 'git', 'lsp', 'web' },
-
- -- Install custom plugins
- -- @default = {}
- -- examples:
- -- plugins without options:
- -- custom_plugins = {'andweeb/presence.nvim'}
- -- plugins with options:
- -- custom_plugins = {
- -- {
- -- 'repo': 'andweeb/presence.nvim',
- -- 'enabled': true,
- -- }
- -- }
- custom_plugins = {},
-
- -- Set the parsers for TreeSitter
- -- @default = {}
- -- example:
- -- ts_parsers = {'python', 'javascript'}
- ts_parsers = {},
-
- -- Set the Terminal direction
- -- Available directions:
- -- - vertical
- -- - horizontal
- -- - window
- -- - float
- -- @default = 'horizontal'
- terminal_direction = 'horizontal',
-
- -- Set the Terminal width
- -- Applies only to float direction
- -- @default = 70
- terminal_width = 70,
-
- -- Set the Terminal height
- -- Applies to all directions except window
- -- @default = 20
- terminal_height = 20,
-
- -- Conceal level
- -- Set Neovim conceal level
- -- 0 : Disable indentline and show all
- -- 1 : Conceal some functions and show indentlines
- -- 2 : Concealed text is completely hidden unless it has a custom replacement
- -- character defined
- -- 3 : Concealed text is completely hidden
- conceallevel = 0,
-
- -- Logging level
- -- 0 : No logging
- -- 1 : All errors, no echo (default)
- -- 2 : All errors and messages, no echo
- -- 3 : All errors and messages, echo
- -- @default = 1
- logging = 3,
- }
-end
-
-function Load_BFC()
- -- /home/user/.config/doom-nvim/doomrc
- if Fn.filereadable(Doom_root .. '/doomrc') then
- Try({
- function()
- Cmd('luafile ' .. Doom_root .. '/doomrc')
- Log_message('+', 'Loading the BFC ...', 2)
- end,
- Catch({
- function(_)
- Log_message('!', 'Error while loading the BFC', 1)
- end,
- }),
- })
- else
- Log_message('+', 'No BFC file found, falling to defaults', 2)
- default_BFC_values()
- end
-end
diff --git a/lua/doom/config/init.lua b/lua/doom/config/init.lua
deleted file mode 100644
index 924970a1b..000000000
--- a/lua/doom/config/init.lua
+++ /dev/null
@@ -1,52 +0,0 @@
----[[---------------------------------------]]---
--- config - Core of Doom Nvim --
--- Author: NTBBloodbath --
--- License: GPLv2 --
----[[---------------------------------------]]---
--- Doom Nvim version
-Doom_version = '2.3.5'
-
--- Check if running Neovim or Vim and fails if:
--- 1. Running Vim instead of Neovim
--- 2. Running Neovim 0.4 or below
-if Fn.has('nvim') then
- if Fn.has('nvim-0.5') ~= 1 then
- Log_message('!!!', 'Doom Nvim requires Neovim 0.5.0', 2)
- end
-else
- Log_message(
- '!!!',
- 'Doom Nvim does not have support for Vim, please use it with Neovim instead',
- 2
- )
-end
-
--- Set some configs on load
-if Fn.has('vim_starting') then
- -- Set encoding
- Opt('o', 'encoding', 'utf-8')
- -- Required to use some colorschemes and improve colors
- Opt('o', 'termguicolors', true)
-end
-
------ Start Doom and run packer.nvim
--- Search for a configuration file (doomrc)
-Check_BFC()
-if Doom_bfc then
- Load_BFC()
-end
--- Set which separator should be used for paths
-Which_os()
--- Load the default Neovim settings, e.g. tabs width
-Default_options()
-
--- Load packer.nvim and load plugins settings
-require('plugins')
-require('doom.config.load_plugins')
-
--- Load the user-defined settings (global variables, autocmds, mappings)
-Custom_commands()
-
-if Doom.check_updates then
- Check_updates()
-end
diff --git a/lua/doom/config/load_plugins/init.lua b/lua/doom/config/load_plugins/init.lua
deleted file mode 100644
index b97839354..000000000
--- a/lua/doom/config/load_plugins/init.lua
+++ /dev/null
@@ -1,61 +0,0 @@
----[[---------------------------------------]]---
--- load_plugins - Load Doom Nvim Plugins --
--- Author: NTBBloodbath --
--- License: GPLv2 --
----[[---------------------------------------]]---
-
--- /home/user/.config/doom-nvim/lua/plugins/init.lua
--- /home/user/.config/doom-nvim/lua/plugins/configs/*.lua
--- Don't load plugin config if the plugin is disabled to improve performance
-
--- Defines the list of plugins to conditionally load
-local conditional_plugins = {
-
- -- Format: ['file-to-require'] = 'plugin-to-check' OR ['file-to-require'] = { 'plugins', 'to', 'check' }
- ['autopairs'] = 'nvim-autopairs',
- ['lsp'] = { 'nvim-lspconfig', 'nvim-lspinstall' },
- ['nvim-compe'] = 'nvim-compe',
- ['nvim-colorizer'] = 'nvim-colorizer.lua',
- ['nvim-telescope'] = 'telescope.nvim',
- ['nvim-toggleterm'] = 'nvim-toggleterm.lua',
- ['nvim-tree'] = 'nvim-tree.lua',
- ['statusline'] = 'galaxyline.nvim',
- ['tree-sitter'] = 'nvim-treesitter',
- ['nvim-gitsigns'] = 'gitsigns.nvim',
- ['which-key'] = 'which-key.nvim',
- ['symbols'] = 'symbols-outline.nvim',
- ['auto-session'] = 'auto-session',
- ['nvim-format'] = 'format.nvim',
- ['nvim-devicons'] = 'nvim-web-devicons',
- ['nvim-dashboard'] = 'dashboard-nvim',
- ['blankline'] = 'indent-blankline.nvim'
-
-}
-
--- Loop through all conditional plugins and see whether we need to load them
-for file_to_require, plugins_to_check in pairs(conditional_plugins) do
-
- -- The plugins_to_check value can be either an array of strings or a single string
- local type_of_plugin = type(plugins_to_check)
-
- if type_of_plugin == 'string' then
- if Check_plugin(plugins_to_check) then
- require('plugins.configs.' .. file_to_require)
- end
- elseif type_of_plugin == 'table' then
-
- -- If we're dealing with a table then loop through it and see if all plugins want to be loaded
- local success = true
-
- for _, plugin in ipairs(plugins_to_check) do
- if not Check_plugin(plugin) then -- If even one of those plugins isn't wanted do not load our file
- success = false
- break
- end
- end
-
- if success then
- require('plugins.configs.' .. file_to_require)
- end
- end
-end
diff --git a/lua/doom/config/ui.lua b/lua/doom/config/ui.lua
deleted file mode 100644
index 7d0acc4a0..000000000
--- a/lua/doom/config/ui.lua
+++ /dev/null
@@ -1,33 +0,0 @@
----[[---------------------------------------]]---
--- ui.lua - Doom Nvim UI settings --
--- Author: NTBBloodbath --
--- License: GPLv2 --
----[[---------------------------------------]]---
-
--- If no colorscheme was established then fallback to defauls
-if not Is_empty(Doom.colorscheme) then
- Try({
- function()
- Execute('set background=' .. Doom.colorscheme_bg)
- Execute('colorscheme ' .. Doom.colorscheme)
- end,
- Catch({
- function(_)
- Log_message('!', 'Colorscheme not found', 1)
- Execute('colorscheme ' .. Doom.colorscheme)
- end,
- }),
- })
-else
- Log_message('!', 'Forced default Doom colorscheme', 1)
- Execute('colorscheme doom-one')
-end
-
--- Set colors based on environment (GUI, TUI)
-if Doom.enable_guicolors then
- if Fn.exists('+termguicolors') then
- Opt('o', 'termguicolors', true)
- elseif Fn.exists('+guicolors') then
- Opt('o', 'guicolors', true)
- end
-end
diff --git a/lua/doom/core/README.md b/lua/doom/core/README.md
new file mode 100644
index 000000000..45b4d3be5
--- /dev/null
+++ b/lua/doom/core/README.md
@@ -0,0 +1,15 @@
+# Core
+
+Herein lies the core of Doom. In other words, the modules needed for Doom to
+be Doom.
+
+Those modules are the following:
+
+- autocmds - Doom autocommands.
+- config - Doom configurations, handles doomrc file and UI settings.
+- default - Doom configurations for Neovim, e.g. `tabwidth`, `showmode`.
+- functions - Doom core functions, e.g. `create_report`.
+- health - Doom health add-on.
+- keybindings - Doom keybindings.
+- logging - Doom logging system.
+- system - Doom system detection (unused at the moment).
diff --git a/lua/doom/autocmds/init.lua b/lua/doom/core/autocmds/init.lua
similarity index 52%
rename from lua/doom/autocmds/init.lua
rename to lua/doom/core/autocmds/init.lua
index 391848832..a3c75ff20 100644
--- a/lua/doom/autocmds/init.lua
+++ b/lua/doom/core/autocmds/init.lua
@@ -4,44 +4,35 @@
-- License: GPLv2 --
---[[---------------------------------------]]---
+local utils = require('doom.utils')
+local log = require('doom.core.logging')
+local config = require('doom.core.config').load_config()
+
+log.debug('Loading Doom autocmds module ...')
+
local autocmds = {
doom_core = {
- -- Set proper syntax highlight for our doomrc
- { 'BufNewFile,BufRead', 'doomrc', 'set ft=lua' },
- -- Ensure every file does full syntax highlight
- { 'BufEnter', '*', ':syntax sync fromstart' },
- { 'BufEnter', '*', ':set signcolumn=yes' },
- {
- 'BufEnter',
- '*',
- ':set pumblend=' .. Doom.complete_transparency,
- },
-- Compile new plugins changes at save
{
'BufWritePost',
- 'init.lua,doomrc',
+ '*/doom-*.lua,doomrc.lua,plugins.lua',
'PackerCompile profile=true',
},
},
doom_extras = {
-- Set up vim_buffer_previewer in telescope.nvim
{ 'User', 'TelescopePreviewerLoaded', 'setlocal wrap' },
- -- Disable tabline on Dashboard
- {
- 'FileType',
- 'dashboard',
- 'set showtabline=0 | autocmd WinLeave set showtabline=2',
- },
},
}
-- Set relative numbers
-if Doom.relative_num then
+if config.doom.relative_num then
table.insert(autocmds['doom_core'], {
'BufEnter,WinEnter',
'*',
'if &nu | set rnu | endif',
})
+else
table.insert(autocmds['doom_core'], {
'BufLeave,WinEnter',
'*',
@@ -50,36 +41,47 @@ if Doom.relative_num then
end
-- Install plugins on launch
-if Doom.auto_install_plugins then
- table.insert(autocmds['doom_core'], {
- 'VimEnter',
- '*',
- 'PackerInstall',
- })
+if config.doom.auto_install_plugins then
+ vim.defer_fn(function()
+ -- Check if there is only packer installed so we can decide if we should
+ -- use PackerInstall or PackerSync, useful for generating the
+ -- `plugin/packer_compiled.lua` on first doom launch
+ if
+ vim.tbl_count(
+ vim.fn.globpath(
+ vim.fn.stdpath('data') .. '/site/pack/packer/opt',
+ '*',
+ 0,
+ 1
+ )
+ ) == 1
+ then
+ vim.cmd('PackerSync')
+ else
+ -- Clean disabled plugins
+ vim.cmd('PackerClean')
+ -- Install the plugins
+ vim.cmd('PackerInstall')
+ end
+ end, 200)
end
-- Set autosave
-if Doom.autosave then
+if config.doom.autosave then
table.insert(autocmds['doom_core'], {
- 'TextChanged,TextChangedI',
+ 'TextChanged,InsertLeave',
'',
'silent! write',
})
end
-- Enable auto comment
-if not Doom.auto_comment then
- table.insert(autocmds['doom_core'], {
- {
- 'BufWinEnter',
- '*',
- 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o',
- },
- })
+if not config.doom.auto_comment then
+ vim.opt.formatoptions:remove({ 'c', 'r', 'o' })
end
-- Enable highlight on yank
-if Doom.highlight_yank then
+if config.doom.highlight_yank then
table.insert(autocmds['doom_core'], {
{
'TextYankPost',
@@ -91,7 +93,7 @@ end
-- Format on save
-- NOTE: Requires formatter to be enabled!
-if Doom.fmt_on_save then
+if config.doom.fmt_on_save then
table.insert(autocmds['doom_core'], {
'BufWritePost',
'*',
@@ -100,26 +102,17 @@ if Doom.fmt_on_save then
end
-- Preserve last editing position
-if Doom.preserve_edit_pos then
+if config.doom.preserve_edit_pos then
table.insert(autocmds['doom_core'], {
'BufReadPost',
'*',
[[
- if line("'\"") > 1 && line("'\"") <= line("$") |
- exe "normal! g'\"" |
- endif
+ if line("'\"") > 1 && line("'\"") <= line("$") |
+ exe "normal! g'\"" |
+ endif
]],
})
end
--- If logging level is greater than 0 then dump :messages to doom.log on exit
-if Doom.logging >= 1 then
- table.insert(autocmds['doom_core'], {
- 'VimLeave',
- '*',
- ':lua Dump_messages()',
- })
-end
-
-- Create augroups
-Create_augroups(autocmds)
+utils.create_augroups(autocmds)
diff --git a/lua/doom/core/config/doomrc.lua b/lua/doom/core/config/doomrc.lua
new file mode 100644
index 000000000..1dfd51a60
--- /dev/null
+++ b/lua/doom/core/config/doomrc.lua
@@ -0,0 +1,105 @@
+---[[---------------------------------------]]---
+-- doomrc.lua - Load Doom Nvim doomrc --
+-- Author: NTBBloodbath --
+-- License: GPLv2 --
+---[[---------------------------------------]]---
+
+local utils = require('doom.utils')
+local log = require('doom.core.logging')
+
+local M = {}
+
+log.debug('Loading Doom doomrc module ...')
+
+-- default_doomrc_values loads the default doomrc values
+-- @return table
+local function default_doomrc_values()
+ return {
+ ui = {
+ 'dashboard', -- Start screen
+ -- 'doom-themes', -- Additional doom emacs' colorschemes
+ 'statusline', -- Statusline
+ 'tabline', -- Tabline, shows your buffers list at top
+ -- 'zen', -- Distraction free environment
+ 'which-key', -- Keybindings popup menu like Emacs' guide-key
+ -- 'indentlines', -- Show indent lines
+ },
+ doom = {
+ -- 'neorg', -- Life Organization Tool
+ -- 'runner', -- Open a REPL for the current language or run the current file
+ -- 'compiler', -- Compile (and run) your code with just pressing three keys!
+ },
+ editor = {
+ 'auto-session', -- A small automated session manager for Neovim
+ -- 'terminal', -- Terminal for Neovim (NOTE: needed for runner and compiler)
+ 'explorer', -- Tree explorer
+ 'symbols', -- LSP symbols and tags
+ -- 'minimap', -- Code minimap, requires github.com/wfxr/code-minimap
+ 'gitsigns', -- Git signs
+ 'telescope', -- Highly extendable fuzzy finder over lists
+ -- 'restclient', -- A fast Neovim http client
+ 'formatter', -- File formatting
+ 'autopairs', -- Autopairs
+ -- 'editorconfig', -- EditorConfig support for Neovim
+ 'kommentary', -- Comments plugin
+ 'lsp', -- Language Server Protocols
+ 'snippets', -- LSP snippets
+ },
+ langs = {
+ -- To enable the language server for a language just add the +lsp flag
+ -- at the end, e.g. 'rust +lsp'. This will install the rust TreeSitter
+ -- parser and rust-analyzer
+ --
+ -- 'html', -- HTML support
+ -- 'css', -- CSS support
+ -- 'javascript', -- JavaScript support
+ -- 'typescript', -- TypeScript support
+ -- 'bash', -- The terminal gods language
+ -- 'python +lsp', -- Python support + lsp
+ -- 'ruby', -- Look ma, I love the gems!
+ 'lua', -- Support for our gods language
+ -- 'elixir', -- Build scalable and maintainable software
+ -- 'haskell', -- Because Functional programming is fun, isn't it?
+
+ -- 'rust +lsp', -- Let's get rusty!
+ -- 'go', -- Hello, gopher
+ -- 'cpp', -- C++ support
+ -- 'java', -- Java support
+
+ -- 'config', -- Configuration files (JSON, YAML, TOML)
+ -- 'dockerfile', -- Do you like containers, right?
+ },
+ utilities = {
+ -- 'suda', -- Write and read files without sudo permissions
+ -- 'lazygit', -- LazyGit integration for Neovim, requires LazyGit
+ -- 'neogit', -- Magit for Neovim
+ -- 'colorizer', -- Fastets colorizer for Neovim
+ 'range-highlight', -- hightlights ranges you have entered in commandline
+ },
+ }
+end
+
+-- load_doomrc Loads the doomrc if it exists, otherwise it'll fallback to doom
+-- default configs.
+M.load_doomrc = function()
+ local config
+
+ -- /home/user/.config/doom-nvim/doomrc
+ if vim.fn.filereadable(utils.doom_root .. '/doomrc.lua') == 1 then
+ local loaded_doomrc, err = pcall(function()
+ log.debug('Loading the doomrc file ...')
+ config = dofile(utils.doom_root .. '/doomrc.lua')
+ end)
+
+ if not loaded_doomrc then
+ log.error('Error while loading the doomrc. Traceback:\n' .. err)
+ end
+ else
+ log.warn('No doomrc.lua file found, falling to defaults')
+ config = default_doomrc_values()
+ end
+
+ return config
+end
+
+return M
diff --git a/lua/doom/core/config/init.lua b/lua/doom/core/config/init.lua
new file mode 100644
index 000000000..2d631abd9
--- /dev/null
+++ b/lua/doom/core/config/init.lua
@@ -0,0 +1,456 @@
+---[[------------------------------]]---
+-- config - Core of Doom Nvim --
+-- Author: NTBBloodbath --
+-- License: GPLv2 --
+---[[------------------------------]]---
+
+local M = {}
+
+local log = require('doom.core.logging')
+local utils = require('doom.utils')
+
+log.debug('Loading Doom core config module ...')
+
+-- Check if running Neovim or Vim and fails if:
+-- 1. Running Vim instead of Neovim
+-- 2. Running Neovim 0.4 or below
+if vim.fn.has('nvim') == 1 then
+ if vim.fn.has('nvim-0.5') ~= 1 then
+ log.fatal('Doom Nvim requires Neovim 0.5.0, please update it')
+ end
+else
+ log.fatal(
+ 'Doom Nvim does not have support for Vim, please use it with Neovim instead'
+ )
+end
+
+-- {{{ Default doom_config values
+
+-- default_doom_config_values loads the default doom_config values
+-- @return table
+local function default_doom_config_values()
+ -- {{{ Doom
+ local doom = {
+ -- Autosave
+ -- false : Disable autosave
+ -- true : Enable autosave
+ -- @default = false
+ autosave = false,
+
+ -- Format on save
+ -- false : Disable format on save
+ -- true : Enable format on save
+ -- @default = false
+ fmt_on_save = false,
+
+ -- Disable Vim macros
+ -- false : Enable Vim macros
+ -- true : Disable Vim macros
+ -- @default = true
+ disable_macros = true,
+
+ -- Autosave sessions
+ -- false : Disable session autosave
+ -- true : Enable session autosave
+ -- @default = false
+ autosave_sessions = false,
+
+ -- Autoload sessions
+ -- false : Disable session autoload
+ -- true : Enable session autoload
+ -- @default = false
+ autoload_last_session = false,
+
+ -- Enable Swap files
+ -- false : no swap files
+ -- true : enables swap files
+ -- @default = false
+ swap_files = false,
+
+ -- Undo Directories
+ -- the backup variable enables backup related settings (undofile, undodir)
+ -- false : ignores undo Directories (this code block will be ignored)
+ -- true : enable undo files/undo dirs.
+ -- @default = false
+ -- WARNING: if you change this to false and you have an undo dir already,
+ -- it will REMOVE the undodir (loss of data might take place)
+ backup = false,
+
+ -- Enable Line wrapping
+ -- false : disables line wrapping
+ -- true : enables line wrapping
+ -- @default = false
+ line_wrap = false,
+
+ -- Enable Show mode ( -- INSERT --, -- NORMAL --, -- VISUAL -- )
+ -- false : disables show mode
+ -- true : enables show mode
+ -- @default = false
+ show_mode = false,
+
+ -- Enable scroll off
+ -- false : disables scroll off
+ -- true : enables scroll off
+ -- @default = true, @default scrolloff_amount = 4,
+ scrolloff = true,
+ scrolloff_amount = 4,
+
+ -- Enable mouse
+ -- false : disables mouse
+ -- true : enables mouse
+ -- @default = true
+ mouse = true,
+
+ -- Preserve last editing position
+ -- false : Disable preservation of last editing position
+ -- true : Enable preservation of last editing position
+ -- @default = false
+ preserve_edit_pos = false,
+
+ -- horizontal split on creating a new file (fn)
+ -- false : doesn't split the window when creating a new file
+ -- true : horizontal split on creating a new file
+ -- @default = true
+ new_file_split = true,
+
+ -- enable current line highlight
+ -- false : disables current line highlight
+ -- true : enables current line highlight
+ -- @default = true
+ line_highlight = true,
+
+ -- Automatically split right
+ -- false : splits right (vertically)
+ -- true : splits left (vertically)
+ -- @default = true
+ split_right = true,
+
+ -- Automatically split above
+ -- false : splits above (horizontally)
+ -- true : splits below (horizontally)
+ -- @default = true
+ split_below = true,
+
+ -- Use clipboard outside of vim
+ -- false : won't use third party clipboard
+ -- true : enables third part clipboard
+ -- @default = true
+ clipboard = true,
+
+ -- Enable auto comment (current line must be commented)
+ -- false : disables auto comment
+ -- true : enables auto comment
+ -- @default = false
+ auto_comment = false,
+
+ -- Show indent lines
+ -- @default = true
+ show_indent = true,
+
+ -- Expand tabs
+ -- Specifies if spaces or tabs must be used
+ -- false : spaces
+ -- true : tabs
+ -- @default = true
+ expand_tabs = true,
+
+ -- Set numbering
+ -- false : Shows absolute number lines
+ -- true : Shows relative number lines
+ -- @default = true
+ relative_num = true,
+
+ -- Enable Highlight on yank
+ -- false : disables highligh on yank
+ -- true : enables highlight on yank
+ -- @default = true
+ highlight_yank = true,
+
+ -- Enable guicolors
+ -- Enables gui colors on GUI versions of Neovim
+ -- @default = true
+ enable_guicolors = true,
+
+ -- Tree explorer on the right
+ -- Places the Tree explorer buffer to the right when enabled
+ -- @default = false
+ explorer_right = false,
+
+ -- Show hidden files
+ -- @default = true
+ show_hidden = true,
+
+ -- Checkupdates on start
+ -- @default = false
+ check_updates = false,
+
+ -- Auto install plugins on launch, useful if you don't want to run
+ -- PackerInstall every time you add a new plugin
+ -- @default = true
+ auto_install_plugins = true,
+
+ -- Disable dashboard status line (does not work perfectly)
+ -- false : disables dashboard status line
+ -- true : enables dashboard status line
+ -- @default = true
+ dashboard_statline = true,
+
+ -- Default indent size
+ -- @default = 4
+ indent = 4,
+
+ -- Set max cols
+ -- Defines the column to show a vertical marker
+ -- @default = 80
+ max_columns = 80,
+
+ -- Completion box height
+ -- @default = 10
+ complete_size = 10,
+
+ -- Completion box transparency
+ -- 0 = no transparency
+ -- 100 = fully transparent
+ -- @default = 25
+ complete_transparency = 25,
+
+ -- Sidebar sizing
+ -- Specifies the default width of Tree Explorer and Tagbar
+ -- @default = 25
+ sidebar_width = 25,
+
+ -- Set the Terminal width
+ -- Applies only to float direction
+ -- @default = 70
+ terminal_width = 70,
+
+ -- Set the Terminal height
+ -- Applies to all directions except window
+ -- @default = 20
+ terminal_height = 20,
+
+ -- Conceal level
+ -- Set Neovim conceal level
+ -- 0 : Disable indentline and show all
+ -- 1 : Conceal some functions and show indentlines
+ -- 2 : Concealed text is completely hidden unless it has a custom replacement
+ -- character defined
+ -- 3 : Concealed text is completely hidden
+ conceallevel = 0,
+
+ -- Logging level
+ -- Set Doom logging level
+ -- Available levels:
+ -- ยท trace
+ -- ยท debug
+ -- ยท info
+ -- ยท warn
+ -- ยท error
+ -- ยท fatal
+ -- @default = 'info'
+ logging = 'info',
+
+ -- Set the Terminal direction
+ -- Available directions:
+ -- - vertical
+ -- - horizontal
+ -- - window
+ -- - float
+ -- @default = 'horizontal'
+ terminal_direction = 'horizontal',
+
+ -- NOTE: This will only be activated if 'backup' is true.
+ -- We don'recommend you put this outside of neovim so we've restricted to thepath: ~/.config/nvim
+ -- WARNING: only put the folder name that you want. (eg: undo_dir = '/undodir')
+ -- @default_directory = '~/.config/nvim/undodir'
+ undo_dir = '/undodir',
+
+ -- Default colorscheme
+ -- @default = doom-one
+ colorscheme = 'doom-one',
+
+ -- Background color
+ -- @default = dark
+ colorscheme_bg = 'dark',
+
+ -- Doom One colorscheme settings
+ doom_one = {
+ -- If the cursor color should be blue
+ -- @default = false
+ cursor_coloring = false,
+ -- If TreeSitter highlighting should be enabled
+ -- @default = true
+ enable_treesitter = true,
+ -- If the comments should be italic
+ -- @default = false
+ italic_comments = false,
+ -- If the telescope plugin window should be colored
+ -- @default = true
+ telescope_highlights = true,
+ -- If the built-in Neovim terminal should use the doom-one
+ -- colorscheme palette
+ -- @default = false
+ terminal_colors = true,
+ -- If the Neovim instance should be transparent
+ -- @default = false
+ transparent_background = false,
+ },
+
+ -- Set gui fonts here
+ -- @default = "FiraCode Nerd Font", @default font size = 15,
+ -- WARNING: Font sizes must be in string format!
+ guifont = 'FiraCode Nerd Font',
+ guifont_size = '15',
+
+ -- change Which Key background color
+ -- can use hex, or normal color names (eg: Red, Gree, Blue)
+ -- @default = #202328
+ whichkey_bg = '#202328',
+
+ -- set your custom lsp diagnostic symbols below
+ lsp_error = '๏',
+ lsp_warning = '๏ฑ',
+ lsp_hint = '๏ช',
+ lsp_information = '๏',
+ lsp_virtual_text = '๏ ',
+
+ -- Set your dashboard custom colors below
+ -- @default = doom emacs' default dashboard colors
+ dashboard_custom_colors = {
+ header_color = '#586268',
+ center_color = '#51afef',
+ shortcut_color = '#a9a1e1',
+ footer_color = '#586268',
+ },
+
+ -- Set your custom dashboard header below
+ -- @default = doom emacs' default dashboard header
+ dashboard_custom_header = {},
+ }
+ -- }}}
+
+ -- {{{ Nvim
+ local nvim = {
+ -- Set custom Neovim global variables
+ -- @default = {}
+ -- example:
+ -- { ['sonokai_style'] = 'andromeda' }
+ global_variables = {},
+
+ -- Set custom autocommands
+ -- @default = {}
+ -- example:
+ -- augroup_name = {
+ -- { 'BufNewFile,BufRead', 'doomrc', 'set ft=lua'}
+ -- }
+ autocmds = {},
+
+ -- Set custom key bindings
+ -- @default = {}
+ -- example:
+ -- {
+ -- {'n', 'ca', ':Lspsaga code_action'}
+ -- }
+ --
+ -- where
+ -- 'n' is the map scope
+ -- 'ca' is the map activator
+ -- ':Lspsaga ...' is the command to be executed
+ mappings = {},
+
+ -- Set custom commands
+ -- @default = {}
+ -- example:
+ -- {
+ -- 'echo "Hello, custom commands!"'
+ -- }
+ commands = {},
+
+ -- Set custom functions
+ -- @default = {}
+ -- example:
+ -- {
+ -- hello_custom_func = function()
+ -- print("Hello, custom functions!")
+ -- end
+ -- }
+ functions = {},
+ }
+ -- }}}
+
+ return {
+ doom = doom,
+ nvim = nvim,
+ }
+end
+
+-- }}}
+
+-- load_config Loads the doom_config.lua file if it exists
+-- @return table
+M.load_config = function()
+ local config = {
+ doom = {},
+ nvim = {},
+ }
+
+ -- /home/user/.config/doom-nvim/doomrc
+ if vim.fn.filereadable(utils.doom_root .. '/doom_config.lua') == 1 then
+ local loaded_doomrc, err = pcall(function()
+ config = dofile(utils.doom_root .. '/doom_config.lua')
+ end)
+
+ if not loaded_doomrc then
+ log.error(
+ 'Error while loading the doom_config file. Traceback:\n' .. err
+ )
+ end
+ else
+ log.warn('No doom_config.lua file found, falling to defaults')
+ default_doom_config_values()
+ end
+
+ return config
+end
+
+-- install_servers will install the language servers for the languages with
+-- the +lsp flag.
+--
+-- @param langs The list of languages in the doomrc
+M.install_servers = function(langs)
+ local lspinstall = require('lspinstall')
+ local installed_servers = lspinstall.installed_servers()
+ local available_servers = lspinstall.available_servers()
+
+ for _, lang in ipairs(langs) do
+ local lang_str = lang
+ lang = lang:gsub('%s+%+lsp', '')
+
+ -- If the +lsp flag exists and the language server is not installed yet
+ if
+ lang_str:find('%+lsp')
+ and (not utils.has_value(installed_servers, lang))
+ then
+ -- Try to install the server only if there is a server available for
+ -- the language, oterwise raise a warning
+ if utils.has_value(available_servers, lang) then
+ lspinstall.install_server(lang)
+ else
+ log.warn(
+ 'The language '
+ .. lang
+ .. ' does not have a server, please remove the "+lsp" flag'
+ )
+ end
+ end
+ end
+end
+
+-- Check plugins updates on start if enabled
+if M.load_config().doom.check_updates then
+ require('doom.core.functions').check_updates()
+end
+
+return M
+
+-- vim: fdm=marker
diff --git a/lua/doom/core/config/ui.lua b/lua/doom/core/config/ui.lua
new file mode 100644
index 000000000..fb2a07d59
--- /dev/null
+++ b/lua/doom/core/config/ui.lua
@@ -0,0 +1,45 @@
+---[[---------------------------------------]]---
+-- ui.lua - Doom Nvim UI settings --
+-- Author: NTBBloodbath --
+-- License: GPLv2 --
+---[[---------------------------------------]]---
+
+local utils = require('doom.utils')
+local log = require('doom.core.logging')
+local config = require('doom.core.config').load_config()
+
+log.debug('Loading Doom UI module ...')
+
+-- If no colorscheme was established then fallback to defauls
+if not utils.is_empty(config.doom.colorscheme) then
+ local loaded_colorscheme = pcall(function()
+ vim.opt.background = config.doom.colorscheme_bg
+ vim.api.nvim_command('colorscheme ' .. config.doom.colorscheme)
+ end)
+
+ if not loaded_colorscheme then
+ log.error('Colorscheme not found, falling to doom-one')
+ vim.api.nvim_command('colorscheme ' .. config.doom.colorscheme)
+ end
+else
+ log.warn('Forced default Doom colorscheme')
+ vim.api.nvim_command('colorscheme doom-one')
+end
+
+-- Set colors based on environment (GUI, TUI)
+if config.doom.enable_guicolors then
+ if vim.fn.exists('+termguicolors') == 1 then
+ vim.opt.termguicolors = true
+ elseif vim.fn.exists('+guicolors') == 1 then
+ vim.opt.guicolors = true
+ end
+end
+
+-- Set doom-one colorscheme settings
+vim.g.doom_one_cursor_coloring = config.doom.doom_one.cursor_coloring
+vim.g.doom_one_enable_treesitter = config.doom.doom_one.enable_treesitter
+vim.g.doom_one_italic_comments = config.doom.doom_one.italic_comments
+vim.g.doom_one_telescope_highlights = config.doom.doom_one.telescope_highlights
+vim.g.doom_one_terminal_colors = config.doom.doom_one.terminal_colors
+vim.g.doom_one_transparent_background =
+ config.doom.doom_one.transparent_background
diff --git a/lua/doom/core/default/init.lua b/lua/doom/core/default/init.lua
new file mode 100644
index 000000000..edc3c1203
--- /dev/null
+++ b/lua/doom/core/default/init.lua
@@ -0,0 +1,157 @@
+---[[---------------------------------------]]---
+-- default - Doom Nvim defaults --
+-- Author: NTBBloodbath --
+-- License: GPLv2 --
+---[[---------------------------------------]]---
+
+local functions = require('doom.core.functions')
+local log = require('doom.core.logging')
+local config = require('doom.core.config').load_config()
+
+local M = {}
+
+log.debug('Loading Doom defaults module ...')
+
+-- load_default_options sets and loads default Doom options based on doomrc values
+M.load_default_options = function()
+ ----- Default Neovim configurations
+ -- Set colorscheme
+ vim.cmd('colorscheme ' .. config.doom.colorscheme)
+ vim.opt.background = config.doom.colorscheme_bg
+ vim.cmd('highlight WhichKeyFloat guibg=' .. config.doom.whichkey_bg)
+
+ -- Global options
+ vim.opt.hidden = true
+ vim.opt.updatetime = 200
+ vim.opt.timeoutlen = 500
+ vim.opt.completeopt = {
+ 'menu',
+ 'menuone',
+ 'preview',
+ 'noinsert',
+ 'noselect',
+ }
+ vim.opt.shortmess:append('atsc')
+ vim.opt.inccommand = 'split'
+ vim.opt.path = '**'
+ vim.opt.signcolumn = 'yes'
+
+ -- Buffer options
+ vim.opt.smartindent = true
+ vim.opt.copyindent = true
+ vim.opt.preserveindent = true
+
+ -- set Gui Fonts
+ vim.opt.guifont = config.doom.guifont .. ':h' .. config.doom.guifont_size
+
+ -- Use clipboard outside vim
+ if config.doom.clipboard then
+ vim.opt.clipboard = 'unnamedplus'
+ end
+
+ if config.doom.line_highlight then
+ vim.opt.cursorline = true
+ else
+ vim.opt.cursorline = false
+ end
+
+ -- Automatic split locations
+ if config.doom.split_right then
+ vim.opt.splitright = true
+ else
+ vim.opt.splitright = false
+ end
+
+ if config.doom.split_below then
+ vim.opt.splitbelow = true
+ else
+ vim.opt.splitbelow = false
+ end
+
+ -- Enable scroll off
+ if config.doom.scrolloff then
+ vim.opt.scrolloff = config.doom.scrolloff_amount
+ end
+
+ -- Enable showmode
+ if not config.doom.show_mode then
+ vim.opt.showmode = false
+ else
+ vim.opt.showmode = true
+ end
+
+ -- Enable mouse input
+ if config.doom.mouse then
+ vim.opt.mouse = 'a'
+ end
+
+ -- Enable wrapping
+ if not config.doom.line_wrap then
+ vim.opt.wrap = false
+ else
+ vim.opt.wrap = true
+ end
+
+ -- Enable swap files
+ if not config.doom.swap_files then
+ vim.opt.swapfile = false
+ else
+ vim.opt.swapfile = true
+ end
+
+ -- Set numbering
+ if config.doom.relative_num then
+ vim.opt.number = true
+ vim.opt.relativenumber = true
+ else
+ vim.opt.number = true
+ end
+
+ -- Checks to see if undo_dir does not exist. If it doesn't, it will create a undo folder
+ local undo_dir = vim.fn.stdpath('config') .. config.doom.undo_dir
+ if config.doom.backup and vim.fn.empty(vim.fn.glob(undo_dir)) > 0 then
+ vim.api.nvim_command('!mkdir ' .. undo_dir .. ' -p')
+ vim.opt.undofile = true
+ end
+
+ -- If backup is false but `undo_dir` still exists then it will delete it.
+ if not config.doom.backup and vim.fn.empty(vim.fn.glob(undo_dir)) == 0 then
+ vim.api.nvim_command('!rm -rf ' .. undo_dir)
+ vim.opt.undofile = false
+ end
+
+ -- Set local-buffer options
+ if config.doom.expand_tabs then
+ vim.opt.expandtab = true
+ else
+ vim.opt.expandtab = false
+ end
+ vim.opt.tabstop = config.doom.indent
+ vim.opt.shiftwidth = config.doom.indent
+ vim.opt.softtabstop = config.doom.indent
+ vim.opt.colorcolumn = tostring(config.doom.max_columns)
+ vim.opt.conceallevel = config.doom.conceallevel
+end
+
+-- Custom Doom Nvim commands
+M.custom_options = function()
+ -- Set a custom command to update Doom Nvim
+ -- can be called by using :DoomUpdate
+ vim.cmd(
+ 'command! DoomUpdate lua require("doom.core.functions").update_doom()'
+ )
+ -- Set a custom command to rollback Doom Nvim version
+ -- can be called by using :DoomRollback
+ vim.cmd(
+ 'command! DoomRollback lua require("doom.core.functions").rollback_doom()'
+ )
+
+ -- Load user-defined settings from the Neovim field in the doomrc file
+ functions.load_custom_settings(config.nvim.autocmds, 'autocmds')
+ functions.load_custom_settings(config.nvim.commands, 'commands')
+ functions.load_custom_settings(config.nvim.functions, 'functions')
+ functions.load_custom_settings(config.nvim.mappings, 'mappings')
+ functions.load_custom_settings(config.nvim.global_variables, 'variables')
+end
+
+return M
diff --git a/lua/doom/core/functions/init.lua b/lua/doom/core/functions/init.lua
new file mode 100644
index 000000000..a93947111
--- /dev/null
+++ b/lua/doom/core/functions/init.lua
@@ -0,0 +1,446 @@
+---[[---------------------------------------]]---
+-- functions - Doom Nvim Functions --
+-- Author: NTBBloodbath --
+-- License: GPLv2 --
+---[[---------------------------------------]]---
+
+local utils = require('doom.utils')
+local log = require('doom.core.logging')
+local config = require('doom.core.config').load_config()
+
+local M = {}
+
+log.debug('Loading Doom functions module ...')
+
+-- check_plugin checks if the given plugin exists
+-- @tparam string plugin_name The plugin name, e.g. nvim-tree.lua
+-- @tparam string path Where should be searched the plugin in packer's path, defaults to `start`
+-- @return bool
+M.check_plugin = function(plugin_name, path)
+ if not path then
+ path = 'start'
+ end
+
+ return vim.fn.isdirectory(
+ vim.fn.stdpath('data')
+ .. '/site/pack/packer/'
+ .. path
+ .. '/'
+ .. plugin_name
+ ) == 1
+end
+
+-- is_plugin_disabled checks if the given plugin is disabled in doomrc
+-- @tparam string plugin The plugin identifier, e.g. statusline
+-- @return bool
+M.is_plugin_disabled = function(plugin)
+ local doomrc = require('doom.core.config.doomrc').load_doomrc()
+
+ -- Iterate over all doomrc sections (e.g. ui) and their plugins
+ for _, section in pairs(doomrc) do
+ if utils.has_value(section, plugin) then
+ return false
+ end
+ end
+
+ return true
+end
+
+-- Load user-defined settings from the Neovim field in the doomrc
+-- @param settings_tbl The settings table to iterate over
+-- @param scope The settings scope, e.g. autocmds
+M.load_custom_settings = function(settings_tbl, scope)
+ -- If the provided settings table is not empty
+ if next(settings_tbl) ~= nil then
+ log.debug('Loading custom ' .. scope .. ' ...')
+ if scope == 'autocmds' then
+ utils.create_augroups(settings_tbl)
+ elseif scope == 'commands' then
+ for _, cmd in ipairs(settings_tbl) do
+ vim.cmd(cmd)
+ end
+ elseif scope == 'functions' then
+ for _, func_body in pairs(settings_tbl) do
+ func_body()
+ end
+ elseif scope == 'mappings' then
+ local opts = { silent = true }
+ for _, map in ipairs(settings_tbl) do
+ -- scope, lhs, rhs, options
+ map(map[1], map[2], map[3], opts)
+ end
+ elseif scope == 'variables' then
+ for var, val in pairs(settings_tbl) do
+ vim.g[var] = val
+ end
+ end
+ end
+end
+
+-- Quit Neovim and change the colorscheme at doomrc if the colorscheme is not the same,
+-- dump all messages to doom.log file
+-- @tparam bool write If doom should save before exiting
+-- @tparam bool force If doom should force the exiting
+M.quit_doom = function(write, force)
+ local changed_colorscheme, err = pcall(function()
+ log.info('Checking if the colorscheme or background were changed ...')
+ local target_colorscheme = vim.g.colors_name
+ local target_background = vim.opt.background:get()
+
+ if target_colorscheme ~= config.doom.colorscheme then
+ vim.cmd(
+ 'silent !sed -i "s/\''
+ .. config.doom.colorscheme
+ .. "'/'"
+ .. target_colorscheme
+ .. '\'/" $HOME/.config/doom-nvim/doom_config.lua'
+ )
+ log.info(
+ 'Colorscheme successfully changed to ' .. target_colorscheme
+ )
+ end
+ if target_background ~= config.doom.colorscheme_bg then
+ vim.cmd(
+ 'silent !sed -i "s/\''
+ .. config.doom.colorscheme_bg
+ .. "'/'"
+ .. target_background
+ .. '\'/" $HOME/.config/doom-nvim/doom_config.lua'
+ )
+ log.info('Background successfully changed to ' .. target_background)
+ end
+ end)
+
+ if not changed_colorscheme then
+ log.error('Unable to write to the doomrc. Traceback:\n' .. err)
+ end
+
+ local quit_cmd = ''
+
+ -- Save current session if enabled
+ if config.doom.autosave_sessions then
+ vim.cmd('SaveSession')
+ end
+
+ if write then
+ quit_cmd = 'wa | '
+ end
+ if force then
+ vim.cmd(quit_cmd .. 'qa!')
+ else
+ vim.cmd(quit_cmd .. 'q!')
+ end
+end
+
+-- check_updates checks for plugins updates
+M.check_updates = function()
+ local updated_plugins, err = pcall(function()
+ log.info('Updating the outdated plugins ...')
+ vim.cmd('PackerSync')
+ end)
+
+ if not updated_plugins then
+ log.error('Unable to update plugins. Traceback:\n' .. err)
+ end
+end
+
+-- create_report creates a markdown report. It's meant to be used when a bug
+-- occurs, useful for debugging issues.
+M.create_report = function()
+ local date = os.date('%Y-%m-%d %H:%M:%S')
+
+ local created_report, err = pcall(function()
+ vim.cmd(
+ 'silent !echo "'
+ .. vim.fn.fnameescape('#')
+ .. ' doom crash report" >> '
+ .. utils.doom_report
+ )
+ vim.cmd(
+ 'silent !echo "Report date: '
+ .. date
+ .. '" >> '
+ .. utils.doom_report
+ )
+ vim.cmd(
+ 'silent !echo "'
+ .. vim.fn.fnameescape('##')
+ .. ' Begin log dump" >> '
+ .. utils.doom_report
+ )
+ vim.cmd(
+ 'silent !cat '
+ .. utils.doom_logs
+ .. ' | grep "$(date +%a %d %b %Y)" >> '
+ .. utils.doom_report
+ )
+ vim.cmd(
+ 'silent !echo "'
+ .. vim.fn.fnameescape('##')
+ .. ' End log dump" >> '
+ .. utils.doom_report
+ )
+ log.info('Report created at ' .. utils.doom_report)
+ end)
+
+ if not created_report then
+ log.error('Error while writing report. Traceback:\n' .. err)
+ end
+end
+
+-- save_backup_hashes saves the commits or releases SHA for future rollbacks
+local function save_backup_hashes()
+ -- Check for the current branch
+ local branch_handler = io.popen(
+ utils.git_workspace .. 'branch --show-current'
+ )
+ local git_branch = branch_handler:read('a'):gsub('[\r\n]', '')
+ branch_handler:close()
+
+ if git_branch == 'main' then
+ local releases_database_path = string.format(
+ '%s/.doom_releases',
+ utils.doom_root
+ )
+
+ -- Fetch for a file containing the releases tags
+ log.info('Saving the Doom releases for future rollbacks ...')
+ local saved_releases, releases_err = pcall(function()
+ -- Get the releases
+ log.debug(
+ 'Executing "' .. utils.git_workspace .. 'show-ref --tags"'
+ )
+ local releases_handler = io.popen(
+ utils.git_workspace .. 'show-ref --tags'
+ )
+ local doom_releases = releases_handler:read('a')
+ releases_handler:close()
+
+ -- Put all the releases into a table so we can sort them later
+ local releases = {}
+ for release in doom_releases:gmatch('[^\r\n]+') do
+ table.insert(releases, release)
+ end
+ -- Sort the releases table
+ local sorted_releases = {}
+ for idx, release in ipairs(releases) do
+ sorted_releases[#releases + 1 - idx] = release:gsub(
+ 'refs/tags/',
+ ''
+ )
+ end
+
+ -- Check if the database already exists so we can check if the
+ -- database is up-to-date or if we should override it.
+ --
+ -- If the database does not exist yet then we will create it
+ if vim.fn.filereadable(releases_database_path) == 1 then
+ local current_releases = utils.read_file(releases_database_path)
+ if current_releases ~= doom_releases then
+ -- Write the first release in the list with 'w+' so the
+ -- actual content will be overwritten by this one
+ utils.write_file(
+ releases_database_path,
+ sorted_releases[1] .. '\n',
+ 'w+'
+ )
+ -- Write the rest of the releases
+ for idx, release in ipairs(sorted_releases) do
+ -- Exclude the first release because we have already
+ -- written it in the database file
+ if idx ~= 1 then
+ utils.write_file(
+ releases_database_path,
+ release .. '\n',
+ 'a+'
+ )
+ end
+ end
+ end
+ else
+ for _, release in ipairs(sorted_releases) do
+ utils.write_file(
+ releases_database_path,
+ release .. '\n',
+ 'a+'
+ )
+ end
+ end
+ end)
+
+ if not saved_releases then
+ log.error(
+ 'Error while saving the Doom releases. Traceback:\n'
+ .. releases_err
+ )
+ end
+ else
+ -- Get the current commit SHA and store it into a hidden file
+ log.info('Saving the current commit SHA for future rollbacks ...')
+ local saved_backup_hash, backup_err = pcall(function()
+ os.execute(
+ utils.git_workspace
+ .. 'rev-parse --short HEAD > '
+ .. utils.doom_root
+ .. '/.doom_backup_hash'
+ )
+ end)
+
+ if not saved_backup_hash then
+ log.error(
+ 'Error while saving the backup commit hash. Traceback:\n'
+ .. backup_err
+ )
+ end
+ end
+end
+
+-- update_doom saves the current commit/release hash into a file for future
+-- restore if needed and then updates Doom.
+M.update_doom = function()
+ save_backup_hashes()
+
+ log.info('Pulling Doom remote changes ...')
+ local updated_doom, update_err = pcall(function()
+ os.execute(utils.git_workspace .. 'pull -q')
+ end)
+
+ if not updated_doom then
+ log.error('Error while updating Doom. Traceback:\n' .. update_err)
+ end
+ -- Run syntax_on event to fix UI if it's broke after the git pull
+ vim.cmd('syntax on')
+
+ log.info('Successfully updated Doom, please restart')
+end
+
+-- rollback_doom will rollback the local doom version to an older one
+-- in case that the local one is broken
+M.rollback_doom = function()
+ -- Backup file for main (stable) branch
+ local releases_database_path = string.format(
+ '%s/.doom_releases',
+ utils.doom_root
+ )
+ -- Backup file for development branch
+ local rolling_backup = string.format(
+ '%s/.doom_backup_hash',
+ utils.doom_root
+ )
+
+ -- Check if there's a rollback file and sets the rollback type
+ if vim.fn.filereadable(releases_database_path) == 1 then
+ -- Get the releases database and split it into a table
+ local doom_releases = utils.read_file(releases_database_path)
+
+ -- Put all the releases into a table so we can sort them later
+ local releases = {}
+ for release in doom_releases:gmatch('[^\r\n]+') do
+ table.insert(releases, release)
+ end
+ -- Sort the releases table
+ local sorted_releases = {}
+ for idx, release in ipairs(releases) do
+ sorted_releases[#releases + 1 - idx] = release:gsub(
+ 'refs/tags/',
+ ''
+ )
+ end
+
+ -- Check the current commit hash and compare it with the ones in the
+ -- releases table
+ local current_version
+ local commit_handler = io.popen(utils.git_workspace .. 'rev-parse HEAD')
+ local current_commit = commit_handler:read('a'):gsub('[\r\n]', '')
+ commit_handler:close()
+ for _, version_info in ipairs(sorted_releases) do
+ for release_hash, version in version_info:gmatch('(%w+)%s(%w+%W+%w+%W+%w+)') do
+ if release_hash == current_commit then
+ current_version = version
+ end
+ end
+ end
+ -- If the current_version variable is still nil then
+ -- fallback to latest version
+ if not current_version then
+ -- next => index, SHA vX.Y.Z
+ local _, release_info = next(releases, nil)
+ -- split => { SHA, vX.Y.Z }, [2] => vX.Y.Z
+ current_version = vim.split(release_info, ' ')[2]
+ end
+
+ local rollback_sha, rollback_version
+ local break_loop = false
+ for _, version_info in ipairs(releases) do
+ for commit_hash, release in version_info:gmatch('(%w+)%s(%w+%W+%w+%W+%w+)') do
+ if release:gsub('v', '') < current_version:gsub('v', '') then
+ rollback_sha = commit_hash
+ rollback_version = release
+ break_loop = true
+ break
+ end
+ end
+ if break_loop then
+ break
+ end
+ end
+
+ log.info(
+ 'Reverting back to version '
+ .. rollback_version
+ .. ' ('
+ .. rollback_sha
+ .. ') ...'
+ )
+ local rolled_back, rolled_err = pcall(function()
+ os.execute(utils.git_workspace .. 'checkout ' .. rollback_sha)
+ end)
+
+ if not rolled_back then
+ log.error(
+ 'Error while rolling back to version '
+ .. rollback_version
+ .. ' ('
+ .. rollback_sha
+ .. '). Traceback:\n'
+ .. rolled_err
+ )
+ end
+
+ log.info(
+ 'Successfully rolled back Doom to version '
+ .. rollback_version
+ .. ' ('
+ .. rollback_sha
+ .. '), please restart'
+ )
+ elseif vim.fn.filereadable(rolling_backup) == 1 then
+ local backup_commit = utils.read_file(rolling_backup):gsub(
+ '[\r\n]+',
+ ''
+ )
+ log.info('Reverting back to commit ' .. backup_commit .. ' ...')
+ local rolled_back, rolled_err = pcall(function()
+ os.execute(utils.git_workspace .. 'checkout ' .. backup_commit)
+ end)
+
+ if not rolled_back then
+ log.error(
+ 'Error while rolling back to commit '
+ .. backup_commit
+ .. '. Traceback:\n'
+ .. rolled_err
+ )
+ end
+
+ log.info(
+ 'Successfully rolled back Doom to commit '
+ .. backup_commit
+ .. ', please restart'
+ )
+ else
+ log.error('There are no backup files to rollback')
+ end
+end
+
+return M
diff --git a/lua/doom/health/init.lua b/lua/doom/core/health/init.lua
similarity index 79%
rename from lua/doom/health/init.lua
rename to lua/doom/core/health/init.lua
index c5d0c63d9..e5b3e5b7a 100644
--- a/lua/doom/health/init.lua
+++ b/lua/doom/core/health/init.lua
@@ -4,14 +4,18 @@
-- License: GPLv2 --
---[[---------------------------------------]]---
--- Health status
-local health_start = Fn['health#report_start']
-local health_ok = Fn['health#report_ok']
-local health_error = Fn['health#report_error']
-local health_warn = Fn['health#report_warn']
+local log = require('doom.core.logging')
local M = {}
+log.debug('Loading Doom health module ...')
+
+-- Health status
+local health_start = vim.fn['health#report_start']
+local health_ok = vim.fn['health#report_ok']
+local health_error = vim.fn['health#report_error']
+local health_warn = vim.fn['health#report_warn']
+
-- Installation health
local function install_health()
health_start('Installation')
@@ -20,7 +24,7 @@ local function install_health()
-- REQUIRED DEPENDENCIES --
---]]-----------------------[[---
-- Check Git
- if Fn.executable('git') == 0 then
+ if vim.fn.executable('git') == 0 then
health_error('`git` executable not found.', {
'Install it with your package manager.',
'Check that your `$PATH` is set correctly.',
@@ -33,7 +37,7 @@ local function install_health()
-- OPTIONAL DEPENDENCIES --
---]]-----------------------[[---
-- Ripgrep and fd
- if Fn.executable('rg') == 0 then
+ if vim.fn.executable('rg') == 0 then
health_warn('`rg` executable not found.', {
'Required to improve file indexing performance for some commands',
'Ignore this message if you have `fd` installed.',
@@ -41,7 +45,7 @@ local function install_health()
else
health_ok('`rg` executable found.')
end
- if Fn.executable('fd') == 0 then
+ if vim.fn.executable('fd') == 0 then
health_warn('`fd` executable not found.', {
'Required to improve file indexing performance for some commands',
'Ignore this message if you have `rg` installed.',
@@ -51,14 +55,14 @@ local function install_health()
end
-- Check NodeJS and NPM
- if Fn.executable('node') == 0 then
+ if vim.fn.executable('node') == 0 then
health_warn('`node` executable not found.', {
'Required by the built-in LSP to work, you should need to install it if you want to use LSP.',
})
else
health_ok('`node` executable found.')
end
- if Fn.executable('npm') == 0 then
+ if vim.fn.executable('npm') == 0 then
health_warn('`npm` executable not found.', {
'Required by the built-in LSP to work, you should need to install it if you want to use LSP.',
'If node is installed but npm is not, you should need to install it with your package manager',
diff --git a/lua/doom/core/init.lua b/lua/doom/core/init.lua
new file mode 100644
index 000000000..d4fde7f68
--- /dev/null
+++ b/lua/doom/core/init.lua
@@ -0,0 +1,22 @@
+--- Main Doom configuration file
+--- This file loads all doom core components
+--- (ui, options, doomrc, modules, packer, ect)
+
+-- Doom core configurations
+require('doom.core.config')
+require('doom.core.config.ui')
+-- Neovim configurations, e.g. shiftwidth
+require('doom.core.default').load_default_options()
+-- User-defined settings (global variables, mappings, ect)
+require('doom.core.default').custom_options()
+-- Doom modules (packer and plugins)
+require('doom.modules')
+-- Doom keybindings
+require('doom.core.keybindings')
+-- Doom autocommands
+require('doom.core.autocmds')
+
+-- Automatically install language servers
+require('doom.core.config').install_servers(
+ require('doom.core.config.doomrc').load_doomrc().langs
+)
diff --git a/lua/doom/core/keybindings/init.lua b/lua/doom/core/keybindings/init.lua
new file mode 100644
index 000000000..d0f61fed6
--- /dev/null
+++ b/lua/doom/core/keybindings/init.lua
@@ -0,0 +1,405 @@
+---[[---------------------------------------]]---
+-- keybindings - Doom Nvim keybindings --
+-- Author: NTBBloodbath --
+-- License: GPLv2 --
+---[[---------------------------------------]]---
+
+local utils = require('doom.utils')
+local log = require('doom.core.logging')
+local config = require('doom.core.config').load_config()
+local functions = require('doom.core.functions')
+
+log.debug('Loading Doom keybindings module ...')
+
+-- Additional options for mappings
+local opts = { silent = true }
+
+-- selene: allow(undefined_variable)
+if packer_plugins and not packer_plugins['which-key.nvim'] then
+ utils.map('n', '', '', opts)
+ vim.g.mapleader = ' '
+end
+
+-- Map WhichKey popup menu
+utils.map('n', '', ':WhichKey ', opts)
+
+-------------------------------------------------
+
+---[[---------------------------------]]---
+-- Custom Key mappings --
+-- --
+-- b = Buffer Menu --
+-- f = File Menu --
+-- g = Git Menu --
+-- p = Plugin Menu --
+-- r = Runner Menu --
+-- s = Session Menu --
+-- t = Toggle Menu --
+-- w = Window Menu --
+-- --
+-- TAB = Cycle buffers --
+-- ESC = Search highlight off --
+-- F2 = Toggle Symbols-Outline --
+-- F3 = Toggle Tree Explorer --
+-- F4 = Toggle Terminal --
+-- F5 = Toggle Minimap --
+-- F6 = Toggle Zen Mode --
+-- F7 = Run restclient --
+---]]---------------------------------[[---
+
+-------------------------------------------------
+
+---[[-----------------]]---
+-- LSP Keybindings --
+---]]-----------------[[---
+
+local lsp_opts = vim.tbl_extend('force', opts, { expr = true })
+
+-- If the LSP is not disabled and compe is installed then set its mappings.
+if functions.check_plugin('nvim-compe', 'opt') then
+ -- https://github.com/hrsh7th/nvim-compe#mappings
+ utils.map('i', '', 'compe#complete()', lsp_opts)
+ utils.map('i', '', 'compe#confirm("")', lsp_opts)
+ utils.map('i', '', 'compe#close("")', lsp_opts)
+ utils.map('i', '', 'compe#scroll({ "delta": +4 })', lsp_opts)
+ utils.map('i', '', 'compe#scroll({ "delta": -4 })', lsp_opts)
+ utils.map('n', 'gd', ':lua vim.lsp.buf.definition()', opts) -- gd: jump to definition
+ utils.map('n', 'gr', ':lua vim.lsp.buf.references()', opts) -- gr: go to reference
+ utils.map('n', 'gi', ':lua vim.lsp.buf.implementation()', opts) -- gi: buf implementation
+ utils.map('n', 'ca', ':Lspsaga code_action', opts) -- ca: code actions
+ utils.map('n', 'K', ':Lspsaga hover_doc', opts) -- K: hover doc
+ utils.map('n', '', ':Lspsaga diagnostic_jump_prev', opts) -- Control+p: Jump to previous diagnostic
+ utils.map('n', '', ':Lspsaga diagnostic_jump_next', opts) -- Control+n: Jump to next diagnostic
+ utils.map(
+ 'n',
+ '',
+ ':lua require("lspsaga.action").smart_scroll_with_saga(1)',
+ opts
+ ) -- Control+f: Scroll down documents
+ utils.map(
+ 'n',
+ '',
+ ":lua require('lspsaga.action').smart_scroll_with_saga(-1)",
+ opts
+ ) -- Control+b: Scroll up documents
+ vim.cmd(
+ 'command! -nargs=0 LspVirtualTextToggle lua require("lsp/virtual_text").toggle()'
+ )
+end
+
+-- LuaSnip mappings
+utils.map(
+ 'n',
+ '',
+ 'luasnip#expand_or_jumpable() ? "luasnip-expand-or-jump" : ""',
+ lsp_opts
+)
+utils.map('i', '', 'lua require("luasnip").jump(-1)', opts)
+
+utils.map('s', '', 'lua require("luasnip").jump(1)', opts)
+utils.map('s', '', 'lua require("luasnip").jump(-1)', opts)
+
+utils.map(
+ 'i',
+ '',
+ 'luasnip#choice_active() ? "luasnip-next-choice" : ""',
+ lsp_opts
+)
+utils.map(
+ 's',
+ '',
+ 'luasnip#choice_active() ? "luasnip-next-choice" : ""',
+ lsp_opts
+)
+
+if config.doom.new_file_split then
+ utils.map('n', 'fn', ':new', opts)
+else
+ utils.map('n', 'fn', ':enew', opts)
+end
+
+-- TAB to cycle buffers too, why not?
+utils.map('n', '', ':bnext', opts)
+utils.map('n', '', ':bprevious', opts)
+
+-- ESC to turn off search highlighting
+utils.map('n', '', ':noh', opts)
+
+--- F keybindings
+if not functions.is_plugin_disabled('symbols') then
+ utils.map('n', '', ':SymbolsOutline', opts)
+end
+if not functions.is_plugin_disabled('explorer') then
+ utils.map('n', '', ':NvimTreeToggle', opts)
+end
+if not functions.is_plugin_disabled('minimap') then
+ utils.map('n', '', ':MinimapToggle', opts)
+end
+if not functions.is_plugin_disabled('zen') then
+ utils.map('n', '', ':TZAtaraxis', opts)
+end
+if not functions.is_plugin_disabled('restclient') then
+ utils.map('n', '