You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

595 lines
24 KiB

*doom_nvim.txt* A Neovim configuration for the advanced martian hacker
================= =============== =============== ======== ========~
\\ . . . . . . .\\ //. . . . . . .\\ //. . . . . . .\\ \\. . .\\// . . //~
||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\/ . . .||~
|| . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . ||~
||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .||~
|| . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\ . . . . ||~
||. . || ||-' || || `-|| || . .|| ||. . || ||-' || || `|\_ . .|. .||~
|| . _|| || || || || ||_ . || || . _|| || || || |\ `-_/| . ||~
||_-' || .|/ || || \|. || `-_|| ||_-' || .|/ || || | \ / |-_.||~
|| ||_-' || || `-_|| || || ||_-' || || | \ / | `||~
|| `' || || `' || || `' || || | \ / | ||~
|| .===' `===. .==='.`===. .===' /==. | \/ | ||~
|| .==' \_|-_ `===. .===' _|_ `===. .===' _-|/ `== \/ | ||~
|| .==' _-' `-_ `=' _-' `-_ `=' _-' `-_ /| \/ | ||~
|| .==' _-' '-__\._-' '-_./__-' `' |. /| | ||~
||.==' _-' `' | /==.||~
==' _-' N E O V I M \/ `==~
\ _-' `-_ /~
`'' ``'~
NTBBloodbath *doom_nvim*
=============================================================================
CONTENTS *doom_nvim_contents*
1. Introduction...........................................|doom_nvim_intro|
2. Autocomplete..........................|doom_nvim_options_autocomplete|
3. Colorscheme............................|doom_nvim_options_colorscheme|
4. Configuration..................................|doom_nvim_configuration|
1. Layout................................|doom_nvim_configuration_layout|
2. File Explorer................|doom_nvim_configuration_layout_explorer|
3. Main Buffer................|doom_nvim_configuration_layout_mainbuffer|
4. Outline.......................|doom_nvim_configuration_layout_outline|
5. Minimap.......................|doom_nvim_configuration_layout_minimap|
6. Terminal.....................|doom_nvim_configuration_layout_terminal|
7. Modules..............................|doom_nvim_configuration_modules|
1. Tweaking modules..........|doom_nvim_configuration_modules_tweaking|
8. Custom Plugins................|doom_nvim_configuration_custom_plugins|
9. LSP......................................|doom_nvim_configuration_lsp|
5. Commands............................................|doom_nvim_commands|
1. Keybindings...........................|doom_nvim_commands_keybindings|
6. Usage..................................................|doom_nvim_usage|
1. Moving around..........................|doom_nvim_usage_moving_around|
7. Known issues..........................................|doom_nvim_issues|
8. FAQ......................................................|doom_nvim_faq|
9. Hacking Doom Nvim....................................|doom_nvim_hacking|
10. Acknowledgements...........................|doom_nvim_acknowledgements|
11. License.............................................|doom_nvim_license|
12. Contributing...................................|doom_nvim_contributing|
13. Changelog.........................................|doom_nvim_changelog|
==============================================================================
INTRODUCTION *doom_nvim_intro*
Doom Neovim is a Neovim port of the Doom Emacs configuration framework, adapted
for the Neovim user that wants less framework in their framework and the performance
of a hand-made configuration. You can use it as a base for your own setup or as
a learning resource on how to achieve a great Neovim configuration.
Doom Neovim features an opinionated collection of reasonable and optional
defaults, with a focus on runtime and startup performance, and a clean,
readable code base.
==============================================================================
AUTOCOMPLETE *doom_nvim_autocomplete*
Doom Neovim uses the built-in LSP as completion engine in Neovim 0.5.0.
Use <C-n> to select the next suggestion and <CR> to select the current
suggestion.
Autocompletion for parenthesis can be disabled by disabling the autopairs
plugin (see |doom_nvim_configuration_modules_disabling| for more information)
==============================================================================
COLORSCHEME *doom_nvim_colorscheme*
The colorscheme of Doom Nvim. Default is `doom-one`. There are some additional
doom emacs' colorschemes port for Neovim that can be enabled by uncommenting
the `doom-themes` in your `doomrc.lua`.
You can switch between colorschemes by doing <Space>ds and then type the name
of the colorscheme you want to use. You can also edit the `doom_config.lua`
file located at `$HOME/.config/doom-nvim` (see |doom_nvim_hacking|).
==============================================================================
CONFIGURATION *doom_nvim_configuration*
The Doom Neovim configuration files reside under the
`$HOME/.config/doom-nvim/` directory. See |doom_nvim_hacking| for more
info.
==============================================================================
LAYOUT *doom_nvim_configuration_layout*
Excluding the statusline and the tabline, Doom Nvim will mostly have the
following layout:
|--------------------------------------|~
| | | | |~
| | | | |~
| | | | |~
| | B | D* | E* |~
| A* | | | |~
| | | | |~
| | | | |~
| |--------------------| | |~
| | C* | | |~
|--------------------------------------|~
'A' : The file explorer (Plugin: nvim-tree.lua)
'B' : The main buffer
'C' : The terminal (Plugin: nvim-toggleterm.lua)
'D' : The minimap (Plugin: minimap.vim)
'E' : The symbol outline (Plugin: SymbolsOutline)
Sections with `*` are not opened by default but can be toggled.
See |doom_nvim_commands| for more information.
==============================================================================
FILE EXPLORER *doom_nvim_configuration_layout_explorer*
Doom Neovim uses the `kyazdani42/nvim-tree.lua` plugin as a file explorer.
It can be toggled by running the following commands:
<Space>oe for `FileExplorer`
<F3> for `FileExplorer`
To create a new file within the file explorer, do <n>[name_of_file]
Append a `/` if you want to create a directory.
Check https://github.com/kyazdani42/nvim-tree.lua for more info.
==============================================================================
MAIN BUFFER *doom_nvim_configuration_layout_mainbuffer*
The main buffer is the buffer where the code is opened.
To split the main buffer, do <Space>w and then select the split method you
want to use horizontally (`s`), or vertically (`v`).
==============================================================================
OUTLINE *doom_nvim_configuration_layout_outline*
Symbols-Outline is a plugin that can show the tags and structure of the opened
file, ordered by its scope. For this function, Doom Nvim makes use of
`simrat39/symbols-outline.nvim`. It can be toggled by performing the following
commands:
<Space>os for `Symbols-Outline`
<F2> for `Symbols-Outline`
See https://github.com/simrat39/symbols-outline.nvim for more information.
==============================================================================
MINIMAP *doom_nvim_configuration_layout_minimap*
Doom Nvim uses `wfxr/minimap.vim` plugin as its minimap.
It can be toggled by performing the following commands:
<Space>om for `Minimap`
<F5> for `Minimap`
==============================================================================
TERMINAL *doom_nvim_configuration_layout_terminal*
The terminal is placed like in others editors, e.g. Visual Studio Code. The
buffer of the terminal is automatically set to `INSERT` mode. The only way to
close it is to enter `exit` to close the shell session, or if you just want to
toggle it, you can enter in `NORMAL` mode:
<Space>ot for `Terminal`
<F4> for `Terminal`
==============================================================================
MODULES *doom_nvim_configuration_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.
To give a quick summary, the modules are as follows:
- UI, everything related to UI
- Doom, neorg and built-in plugins
- Editor, everything related to editing, e.g. tree explorer, git signs, lsp
- Langs, languages support for Doom and language servers
- Utilities, some utility plugins like neogit
You can see in a more detailed view the modules and its plugins at
https://github.com/NTBBloodbath/doom-nvim/blob/main/docs/modules.md
==============================================================================
TWEAKING MODULES *doom_nvim_configuration_modules_tweaking*
For tweaking a module (enable / disable its plugins) you will only need to
comment or uncomment the desired plugin, e.g. for disabling the tree explorer
you will only need to comment it.
`-- Right now the Tree explorer is enabled`
`'explorer',`
`-- Now the Tree explorer is disabled`
`-- 'explorer',`
NOTE: after doing changes to your modules you will only need to restart Neovim
and Doom Nvim will automatically handle your changes on here.
==============================================================================
CUSTOM PLUGINS *doom_nvim_configuration_custom_plugins*
To use your own plugins in Doom Nvim you can use the `plugins.lua` file
located in the Doom Nvim root directory.
NOTE: if you are familiar with `packer.nvim` (the plugins manager used by Doom
Nvim) then you can see the `plugins.lua` file as a wrapper for it.
To add plugins without extra configurations (e.g., if a plugin does not depend
on other plugins), you can simply set it as follow:
` return {`
` 'andweeb/presence.nvim'`
` }`
Otherwise, if your plugin depends on other or you do not want to enable it,
then you can do it as follow:
` return {`
` {`
` 'andweeb/presence.nvim',`
` requires = { 'john/foo', 'doe/bar' },`
` }`
` }`
As you can see, the second way depends on a structure to work.
All the fields for declaring plugins can be found at
https://github.com/wbthomason/packer.nvim#specifying-plugins
==============================================================================
LSP *doom_nvim_configuration_lsp*
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`.
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`:
` local doom = {`
` langs = {`
` 'rust +lsp', -- Let's get rusty!`
` }`
` }`
NOTE: You can see a list of currently supported languages at
https://github.com/kabouzeid/nvim-lspinstall#bundled-installers
==============================================================================
COMMANDS *doom_nvim_commands*
Doom Nvim have its own commands, to make your life easier when developing.
| `:DoomUpdate` | Update Doom Nvim if there are updates.
| `:DoomRollback` | Rollback Doom Nvim to a previous version.
Doom Nvim also uses `WhichKey` as a commands manager, inspired by
emacs's guide-key. To open it, press <Space> and wait for the popup to show,
it should not take much time. Each section has a label and is mnemonic.
e.g:
`Open Terminal` > <Space>ot
There are multiple sections for Doom Nvim's commands. Those sections create a
path in the decision tree that identifies any command.
Let's say you want to go to the next buffer you are working on. You will need
to perform the following keystrokes:
<Space>b
in order to open the `Buffer` section. There we want to go to the `n`ext
buffer.
<Space>bn
Finally, we changed our current buffer to the next buffer in our workspace.
You can see more keybindings in |doom_nvim_commands_keybindings|
==============================================================================
KEYBINDINGS *doom_nvim_commands_keybindings*
In Doom Nvim, we make use of the <Space> keystroke as the map leader.
| <,> | Switch buffer
| <.> | Browse files
| </> | Search
| <:> | Command history
| <`> | Switch buffer
| <Space> | Find file
| <b>uffer
| | <[> Previous buffer
| | <]> Next buffer
| | <b> Switch to other buffer
| | <c> Close buffer
| | <f> Format buffer
| | <g> Goto buffer
| | <n> Next buffer
| | <p> Previous buffer
| <c>ode
| | <b> Compile project
| | <c> Compile and run project
| | <h> Run rest client on the line that the cursor is
| | <i> Start a REPL
| | <r> Run current file
| | <l> +lsp
| <d>oom
| | <c> Edit your Doom Nvim configuration
| | <d> Open Doom Nvim documentation
| | <R> Create crash reports, useful for debugging
| | <r> Rollback Doom Nvim version
| | <s> Change colorscheme
| | <u> Check Doom Nvim updates
| <f>ile
| | <c> Edit Neovim configuration
| | <f> Find files
| | <n> New unnamed buffer
| | <R> Re-open an unreadable file with sudo permissions
| | <r> Recently opened files
| | <t> Help tags
| | <w> Write an unwritable file with sudo permissions
| <g>it
| | <B> Branches
| | <b> Blame line
| | <c> Commits
| | <h> Preview hunk
| | <R> Reset buffer
| | <r> Reset hunk
| | <o> Open LazyGit
| | <l> Pull
| | <p> Push
| | <S> Stage hunk
| | <s> Status
| | <u> Undo stage hunk
| <l>sp
| | <a> Code actions
| | <d> Show type definition
| | <i> Lsp info
| | <l> Show line diagnostics
| | <L> Diagnostics into location list
| <o>pen
| | <d> Start screen
| | <e> Tree explorer
| | <m> Minimap
| | <s> LSP Symbols
| | <t> Terminal
| <p>lugin
| | <c> Clean unused plugins
| | <C> Compile your plugins changes
| | <i> Install missing plugins
| | <p> Profile the time taken loading your plugins
| | <s> Sync plugins (Clean and Update)
| | <S> Plugins status
| <q>uit /
| sessions
| | <l> Session switcher
| | <q> Quit
| | <r> Restore previously saved session
| | <s> Save current session
| | <w> Save and quit
| <s>earch
| | <b> Buffer
| | <g> Grep
| | <h> Command history
| | <m> Jump to mark
| | <s> Goto symbol
| <w>indow
| | <-> Split window below
| | <2> Layout double columns
| | <=> Balance window
| | <|> Split window right
| | <d> Delete window
| | <H> Expand window left
| | <h> Window left
| | <J> Expand window below
| | <j> Window below
| | <K> Expand window up
| | <k> Window up
| | <L> Expand window right
| | <l> Window right
| | <s> Split window below
| | <v> Split window right
| | <w> 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
your life easier!
| <TAB> | Cycle buffers (next buffer)
| <S-TAB> | Cycle buffers (prev buffer)
| <ESC> | Search highlighting off
| <F2> | Toggle Symbols-Outline
| <F3> | Toggle Tree Explorer
| <F4> | Toggle Terminal
| <F5> | Toggle Minimap
| <F6> | Toggle Zen mode
| <F7> | Run rest client
| <Z><Z> | Fast exit from Doom Nvim
| <j><k> | Fast exit from `INSERT` mode
| <g><c><c> | Comment current line (`NORMAL` mode)
| <g><c> | Comment selected block (`VISUAL` mode)
| <C-h> | Select window left
| <C-j> | Select window below
| <C-k> | Select window up
| <C-l> | Select window right
| <C-Up> | Resize window up
| <C-Down> | Resize window below
| <C-Left> | Resize window left
| <C-Right> | Resize window right
You can modify the default keybindings by modifying the following files:
- `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 `doom_config.lua` file.
==============================================================================
USAGE *doom_nvim_usage*
Start Doom Nvim by typing `nvim` in a terminal emulator or by executing your
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.
==============================================================================
MOVING AROUND *doom_nvim_usage_moving_around*
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
<h · l>
j
v
See `Tutor` to know how to use Vim and its keybindings.
To move around buffers execute <Space>b to select the `buffers` section
and then press the key <g> to select a buffer or press `<TAB>` to cycle buffers.
==============================================================================
KNOWN ISSUES *doom_nvim_issues*
- If you are facing an undocummented issue, feel free to open an issue at Doom
Nvim's repository on GitHub and we will try to fix it.
https://github.com/NTBBloodbath/doom-nvim/issues/new
==============================================================================
FAQ *doom_nvim_faq*
- General
- Who is Doom Nvim intended for?
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 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*
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
│ └── 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.
==============================================================================
HACKING LUA CORE *doom_nvim_hacking_lua_core*
The `lua/doom` directory content is loaded by Neovim on_start. It is the
location of the Doom Nvim plugin which is loaded everytime nvim starts.
The `doom/default/init.lua` file contains most of the global variables used by
Doom Nvim and executes the init functions of Doom Nvim.
The files inside the `doom/` directory have core functions for Doom Nvim.
- autocmds/ : Autocommands
- config/ : Manages the BFC
- functions/ : Utility functions
- health/ : Used to check the health of installation
- logging/ : Logging handler
- system/ : Cross-platform support (WIP)
- utils/ : Utility Lua functions
==============================================================================
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
- All our contributors
==============================================================================
LICENSE *doom_nvim_license*
Doom Nvim is distributed under GPLv2 license.
==============================================================================
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.
==============================================================================
CHANGELOG *doom_nvim_changelog*
Please see `$HOME/.config/doom-nvim/CHANGELOG.md` for a full and detailed
changelog.